mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 53s
Build Docker Images / lint (push) Failing after 10s
Build Docker Images / check (push) Failing after 10s
Build Docker Images / tests (push) Failing after 6s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / build (push) Failing after 5s
Mirror to Codeberg / Mirror (push) Failing after 0s
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Nix Build / check (push) Failing after 5s
30 lines
1 KiB
TypeScript
30 lines
1 KiB
TypeScript
import { z } from "@hono/zod-openapi";
|
|
|
|
export const Token = z
|
|
.object({
|
|
access_token: z.string().openapi({
|
|
description: "An OAuth token to be used for authorization.",
|
|
example: "ZA-Yj3aBD8U8Cm7lKUp-lm9O9BmDgdhHzDeqsY8tlL0",
|
|
}),
|
|
token_type: z.string().openapi({
|
|
description: "The OAuth token type. Versia uses Bearer tokens.",
|
|
example: "Bearer",
|
|
}),
|
|
scope: z.string().openapi({
|
|
description:
|
|
"The OAuth scopes granted by this token, space-separated.",
|
|
example: "read write follow push",
|
|
}),
|
|
created_at: z.number().nonnegative().openapi({
|
|
description: "When the token was generated. UNIX timestamp.",
|
|
example: 1573979017,
|
|
}),
|
|
})
|
|
.openapi("Token", {
|
|
description:
|
|
"Represents an OAuth token used for authenticating with the API and performing actions.",
|
|
externalDocs: {
|
|
url: "https://docs.joinmastodon.org/entities/Token",
|
|
},
|
|
});
|