This commit is contained in:
john 2025-05-03 20:18:13 +02:00
parent e84cf232a5
commit 5595d0ace0
3 changed files with 156 additions and 0 deletions

120
src/api/schema.ts Normal file
View file

@ -0,0 +1,120 @@
export interface paths {
'/posts': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
get?: never
put?: never
post: {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
requestBody: {
content: {
'application/json': components['schemas']['CreatePostRequest']
'text/json': components['schemas']['CreatePostRequest']
'application/*+json': components['schemas']['CreatePostRequest']
}
}
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown
}
content: {
'text/plain': components['schemas']['CreatePostResponse']
'application/json': components['schemas']['CreatePostResponse']
'text/json': components['schemas']['CreatePostResponse']
}
}
}
}
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/authors/{username}/posts': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
get: {
parameters: {
query?: {
Cursor?: string
Count?: number
}
header?: never
path: {
username: string
}
cookie?: never
}
requestBody?: never
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown
}
content: {
'text/plain': components['schemas']['GetAuthorPostsResponse']
'application/json': components['schemas']['GetAuthorPostsResponse']
'text/json': components['schemas']['GetAuthorPostsResponse']
}
}
}
}
put?: never
post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
}
export type webhooks = Record<string, never>
export interface components {
schemas: {
AuthorPostDto: {
/** Format: uuid */
postId: string
content: string
media: string[]
/** Format: date-time */
createdAt: string
}
CreatePostRequest: {
/** Format: uuid */
authorId: string
content: string
media: string[]
}
CreatePostResponse: {
/** Format: uuid */
postId: string
}
GetAuthorPostsResponse: {
posts: components['schemas']['AuthorPostDto'][]
}
}
responses: never
parameters: never
requestBodies: never
headers: never
pathItems: never
}
export type $defs = Record<string, never>
export type operations = Record<string, never>