| 1 | import type { PlatformStaticMetadata } from '../platforms.interface' |
| 2 | import { AccountType } from '@yikart/common' |
| 3 | import { AuthType, ChannelWorkAnalyticsDataSource, CompletionStrategy, EditorType, PublishContentMode } from '../platforms.interface' |
| 4 | import { KwaiOptionSchema } from './kwai.schema' |
| 5 | |
| 6 | export enum KwaiOAuthGrantType { |
| 7 | AuthorizationCode = 'authorization_code', |
| 8 | RefreshToken = 'refresh_token', |
| 9 | } |
| 10 | |
| 11 | export enum KwaiPublishResultStatus { |
| 12 | Published = 200, |
| 13 | Processing = 202, |
| 14 | } |
| 15 | |
| 16 | export const KWAI_METADATA = { |
| 17 | platform: AccountType.Kwai, |
| 18 | displayName: { 'en-US': 'Kwai', 'zh-CN': '快手' }, |
| 19 | authType: AuthType.OAuth2, |
| 20 | editor: EditorType.Text, |
| 21 | contentLimits: { modes: [PublishContentMode.Video], maxTitleLength: 30, maxBodyLength: 1000, maxTotalTextLength: 1000, maxImages: 0, maxVideos: 1 }, |
| 22 | mediaRules: { |
| 23 | imageFormats: ['jpg', 'jpeg', 'png', 'bmp', 'webp'], |
| 24 | videoFormats: ['mp4', 'avi', 'mkv', 'mov', 'webm'], |
| 25 | maxImageSize: 20 * 1024 * 1024, |
| 26 | maxVideoSize: 100 * 1024 * 1024, |
| 27 | maxVideoDuration: 1800, |
| 28 | }, |
| 29 | // 产品兜底:未找到快手官方 topic 数量文档。 |
| 30 | topic: { supported: true, maxCount: 4 }, |
| 31 | publishPolicy: { |
| 32 | completionStrategy: CompletionStrategy.Polling, |
| 33 | scheduleByPlatform: false, |
| 34 | updateSupported: false, |
| 35 | }, |
| 36 | analytics: { work: { dataSources: [ChannelWorkAnalyticsDataSource.PostInsightCrawler] } }, |
| 37 | optionSchema: KwaiOptionSchema, |
| 38 | } satisfies PlatformStaticMetadata |
| 39 |