mirror of
https://github.com/versia-pub/server.git
synced 2026-04-28 05:09:16 +02:00
refactor(api): ♻️ Move all client schema code to new package
This commit is contained in:
parent
52602c3da7
commit
3fe07a79b8
128 changed files with 3904 additions and 169 deletions
29
packages/client/schemas/token.ts
Normal file
29
packages/client/schemas/token.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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({
|
||||
description:
|
||||
"Represents an OAuth token used for authenticating with the API and performing actions.",
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/entities/Token",
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue