| 1 | import { z } from 'zod' |
| 2 | |
| 3 | export enum YoutubeOAuthGrantType { |
| 4 | RefreshToken = 'refresh_token', |
| 5 | } |
| 6 | |
| 7 | export enum YoutubePrivacyStatus { |
| 8 | Public = 'public', |
| 9 | Unlisted = 'unlisted', |
| 10 | Private = 'private', |
| 11 | } |
| 12 | |
| 13 | export enum YoutubeLicense { |
| 14 | CreativeCommon = 'creativeCommon', |
| 15 | Youtube = 'youtube', |
| 16 | } |
| 17 | |
| 18 | export enum YoutubeSearchOrder { |
| 19 | Date = 'date', |
| 20 | Rating = 'rating', |
| 21 | Relevance = 'relevance', |
| 22 | Title = 'title', |
| 23 | VideoCount = 'videoCount', |
| 24 | ViewCount = 'viewCount', |
| 25 | } |
| 26 | |
| 27 | export enum YoutubeSearchType { |
| 28 | Channel = 'channel', |
| 29 | Playlist = 'playlist', |
| 30 | Video = 'video', |
| 31 | } |
| 32 | |
| 33 | export const YoutubeOptionSchema = z.object({ |
| 34 | privacyStatus: z.enum(YoutubePrivacyStatus).optional().default(YoutubePrivacyStatus.Public).describe('隐私状态'), |
| 35 | categoryId: z.string().optional().describe('分类 ID'), |
| 36 | publishAt: z.string().datetime().optional().describe('定时发布时间,必须配合 private 隐私状态'), |
| 37 | license: z.enum(YoutubeLicense).optional().describe('许可证'), |
| 38 | embeddable: z.boolean().optional().default(true).describe('是否可嵌入'), |
| 39 | notifySubscribers: z.boolean().optional().default(false).describe('是否通知订阅者'), |
| 40 | selfDeclaredMadeForKids: z.boolean().optional().default(false).describe('是否自认为适合儿童'), |
| 41 | madeForKids: z.boolean().optional().describe('YouTube 审核后的儿童内容标记'), |
| 42 | containsSyntheticMedia: z.boolean().optional().describe('是否包含合成媒体内容'), |
| 43 | }) |
| 44 | |
| 45 | export type YoutubeOption = z.infer<typeof YoutubeOptionSchema> |
| 46 |