| 1 | import { createZodDto } from '@yikart/common' |
| 2 | import { z } from 'zod' |
| 3 | import { createPlatformConfigSchema } from '../platforms.config' |
| 4 | import { PlatformStatus } from '../platforms.interface' |
| 5 | |
| 6 | const rednoteAvailableConfigSchema = z.object({ |
| 7 | status: z.literal(PlatformStatus.Available), |
| 8 | logoUrl: z.url(), |
| 9 | appKey: z.string().min(1), |
| 10 | appSecret: z.string().min(1), |
| 11 | accessTokenUrl: z.url(), |
| 12 | }) |
| 13 | |
| 14 | export const rednoteConfigSchema = createPlatformConfigSchema(rednoteAvailableConfigSchema) |
| 15 | |
| 16 | export class RednoteConfig extends createZodDto(rednoteAvailableConfigSchema) {} |
| 17 |