mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 12:54:55 +00:00
fix(api): fix update team settings and make request schema type-safe
This commit is contained in:
@@ -63,12 +63,6 @@ export const listMembersQuerySchema = z.object({
|
||||
.transform((v) => v === 'true'),
|
||||
})
|
||||
|
||||
export const updateTeamSettingsRequestSchema = z.object({
|
||||
key: z.string(),
|
||||
value: z.any(),
|
||||
})
|
||||
export type UpdateTeamSettingsRequest = z.infer<typeof updateTeamSettingsRequestSchema>
|
||||
|
||||
export const VideoTranscodeStrategy = {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
best_match: 'best_match',
|
||||
@@ -77,6 +71,14 @@ export const VideoTranscodeStrategy = {
|
||||
export type VideoTranscodeStrategy =
|
||||
(typeof VideoTranscodeStrategy)[keyof typeof VideoTranscodeStrategy]
|
||||
|
||||
export const updateTeamSettingsRequestSchema = z.discriminatedUnion('key', [
|
||||
z.object({
|
||||
key: z.literal('transcode.videoStrategy'),
|
||||
value: z.nativeEnum(VideoTranscodeStrategy),
|
||||
}),
|
||||
])
|
||||
export type UpdateTeamSettingsRequest = z.infer<typeof updateTeamSettingsRequestSchema>
|
||||
|
||||
export const sandboxSettingsSchema = z.object({
|
||||
allowedDomains: z.array(z.string()),
|
||||
pendingDomains: z.array(z.string()).default([]),
|
||||
|
||||
Reference in New Issue
Block a user