mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
* feat: Add Gitea integration for issue, pull request, and repository previews * fix: Gitea repository previews and request deadlines Refresh the token before repository discovery, keep repository previews when the issue tracker is disabled, and keep the request timeout active while the response body is read. * chore: Use the shared fetch timeout for Gitea requests * chore: Mention Forgejo in Gitea copy and reuse the callback URL helper * Remove service specific getters in IntegrationsStore
28 lines
783 B
TypeScript
28 lines
783 B
TypeScript
import { isEmpty } from "es-toolkit/compat";
|
|
import { z } from "zod";
|
|
import { BaseSchema } from "@server/routes/api/schema";
|
|
|
|
export const GiteaCallbackSchema = BaseSchema.extend({
|
|
query: z
|
|
.object({
|
|
code: z.string().nullish(),
|
|
state: z.string(),
|
|
error: z.string().nullish(),
|
|
})
|
|
.refine((req) => !(isEmpty(req.code) && isEmpty(req.error)), {
|
|
message: "one of code or error is required",
|
|
}),
|
|
});
|
|
|
|
export type GiteaCallbackReq = z.infer<typeof GiteaCallbackSchema>;
|
|
|
|
export const GiteaConnectSchema = BaseSchema.extend({
|
|
body: z.object({
|
|
url: z.url().startsWith("https://"),
|
|
clientId: z.string().trim().min(1),
|
|
clientSecret: z.string().trim().min(1),
|
|
}),
|
|
});
|
|
|
|
export type GiteaConnectReq = z.infer<typeof GiteaConnectSchema>;
|