mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-17 13:12:07 +00:00
fix(api-server): fix swagger
This commit is contained in:
@ -6,7 +6,6 @@ import getSongControls from '@/providers/song-controls';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
AddSongToQueueSchema,
|
AddSongToQueueSchema,
|
||||||
AuthHeadersSchema,
|
|
||||||
GoBackSchema,
|
GoBackSchema,
|
||||||
GoForwardScheme,
|
GoForwardScheme,
|
||||||
MoveSongInQueueSchema,
|
MoveSongInQueueSchema,
|
||||||
@ -116,7 +115,6 @@ const routes = {
|
|||||||
summary: 'seek',
|
summary: 'seek',
|
||||||
description: 'Seek to a specific time in the current song',
|
description: 'Seek to a specific time in the current song',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'seconds to seek to',
|
description: 'seconds to seek to',
|
||||||
content: {
|
content: {
|
||||||
@ -138,7 +136,6 @@ const routes = {
|
|||||||
summary: 'go back',
|
summary: 'go back',
|
||||||
description: 'Move the current song back by a number of seconds',
|
description: 'Move the current song back by a number of seconds',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'seconds to go back',
|
description: 'seconds to go back',
|
||||||
content: {
|
content: {
|
||||||
@ -161,7 +158,6 @@ const routes = {
|
|||||||
summary: 'go forward',
|
summary: 'go forward',
|
||||||
description: 'Move the current song forward by a number of seconds',
|
description: 'Move the current song forward by a number of seconds',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'seconds to go forward',
|
description: 'seconds to go forward',
|
||||||
content: {
|
content: {
|
||||||
@ -213,7 +209,6 @@ const routes = {
|
|||||||
summary: 'switch repeat',
|
summary: 'switch repeat',
|
||||||
description: 'Switch the repeat mode',
|
description: 'Switch the repeat mode',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'number of times to click the repeat button',
|
description: 'number of times to click the repeat button',
|
||||||
content: {
|
content: {
|
||||||
@ -235,7 +230,6 @@ const routes = {
|
|||||||
summary: 'set volume',
|
summary: 'set volume',
|
||||||
description: 'Set the volume of the player',
|
description: 'Set the volume of the player',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'volume to set',
|
description: 'volume to set',
|
||||||
content: {
|
content: {
|
||||||
@ -257,7 +251,6 @@ const routes = {
|
|||||||
summary: 'set fullscreen',
|
summary: 'set fullscreen',
|
||||||
description: 'Set the fullscreen state of the player',
|
description: 'Set the fullscreen state of the player',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'fullscreen state',
|
description: 'fullscreen state',
|
||||||
content: {
|
content: {
|
||||||
@ -387,7 +380,6 @@ const routes = {
|
|||||||
summary: 'add song to queue',
|
summary: 'add song to queue',
|
||||||
description: 'Add a song to the queue',
|
description: 'Add a song to the queue',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'video id of the song to add',
|
description: 'video id of the song to add',
|
||||||
content: {
|
content: {
|
||||||
@ -409,7 +401,6 @@ const routes = {
|
|||||||
summary: 'move song in queue',
|
summary: 'move song in queue',
|
||||||
description: 'Move a song in the queue',
|
description: 'Move a song in the queue',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
params: QueueParamsSchema,
|
params: QueueParamsSchema,
|
||||||
body: {
|
body: {
|
||||||
description: 'index to move the song to',
|
description: 'index to move the song to',
|
||||||
@ -432,7 +423,6 @@ const routes = {
|
|||||||
summary: 'remove song from queue',
|
summary: 'remove song from queue',
|
||||||
description: 'Remove a song from the queue',
|
description: 'Remove a song from the queue',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
params: QueueParamsSchema,
|
params: QueueParamsSchema,
|
||||||
},
|
},
|
||||||
responses: {
|
responses: {
|
||||||
@ -447,7 +437,6 @@ const routes = {
|
|||||||
summary: 'set queue index',
|
summary: 'set queue index',
|
||||||
description: 'Set the current index of the queue',
|
description: 'Set the current index of the queue',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'index to move the song to',
|
description: 'index to move the song to',
|
||||||
content: {
|
content: {
|
||||||
@ -480,7 +469,6 @@ const routes = {
|
|||||||
summary: 'search for a song',
|
summary: 'search for a song',
|
||||||
description: 'search for a song',
|
description: 'search for a song',
|
||||||
request: {
|
request: {
|
||||||
headers: AuthHeadersSchema,
|
|
||||||
body: {
|
body: {
|
||||||
description: 'search query',
|
description: 'search query',
|
||||||
content: {
|
content: {
|
||||||
|
|||||||
@ -1,11 +1,5 @@
|
|||||||
import { z } from '@hono/zod-openapi';
|
import { z } from '@hono/zod-openapi';
|
||||||
|
|
||||||
export const AuthHeadersSchema = z.object({
|
|
||||||
authorization: z.string().openapi({
|
|
||||||
example: 'Bearer token',
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type JWTPayload = z.infer<typeof JWTPayloadSchema>;
|
export type JWTPayload = z.infer<typeof JWTPayloadSchema>;
|
||||||
export const JWTPayloadSchema = z.object({
|
export const JWTPayloadSchema = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user