mirror of
https://github.com/versia-pub/server.git
synced 2026-04-28 05:09:16 +02:00
refactor: ⬆️ Upgrade to Zod v4 and hono-openapi 0.5.0
This commit is contained in:
parent
add2429606
commit
24d4150da4
209 changed files with 1331 additions and 1622 deletions
|
|
@ -1,30 +1,30 @@
|
|||
import { z } from "zod";
|
||||
import { z } from "zod/v4";
|
||||
|
||||
export const Token = z
|
||||
.object({
|
||||
access_token: z.string().openapi({
|
||||
access_token: z.string().meta({
|
||||
description: "An OAuth token to be used for authorization.",
|
||||
example: "ZA-Yj3aBD8U8Cm7lKUp-lm9O9BmDgdhHzDeqsY8tlL0",
|
||||
}),
|
||||
token_type: z.string().openapi({
|
||||
token_type: z.string().meta({
|
||||
description: "The OAuth token type. Versia uses Bearer tokens.",
|
||||
example: "Bearer",
|
||||
}),
|
||||
scope: z.string().openapi({
|
||||
scope: z.string().meta({
|
||||
description:
|
||||
"The OAuth scopes granted by this token, space-separated.",
|
||||
example: "read write follow push",
|
||||
}),
|
||||
created_at: z.number().nonnegative().openapi({
|
||||
created_at: z.number().nonnegative().meta({
|
||||
description: "When the token was generated. UNIX timestamp.",
|
||||
example: 1573979017,
|
||||
}),
|
||||
})
|
||||
.openapi({
|
||||
.meta({
|
||||
description:
|
||||
"Represents an OAuth token used for authenticating with the API and performing actions.",
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/entities/Token",
|
||||
},
|
||||
ref: "Token",
|
||||
id: "Token",
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue