Fix review issues: lyrics polling, validation, undici fetch, retry, timeout, throttle, payload helper

This commit is contained in:
OpenCode
2026-07-14 16:17:51 +07:00
parent ac22e28128
commit 82087be1b3
14 changed files with 628 additions and 315 deletions
+128 -4
View File
@@ -1,5 +1,5 @@
import { z } from 'zod';
export declare const GenerateMusicSchema: z.ZodObject<{
export declare const GenerateMusicSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
model: z.ZodEnum<[string, ...string[]]>;
negativeTags: z.ZodOptional<z.ZodString>;
vocalGender: z.ZodOptional<z.ZodEnum<["m", "f"]>>;
@@ -44,6 +44,66 @@ export declare const GenerateMusicSchema: z.ZodObject<{
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}>, {
customMode: boolean;
instrumental: boolean;
model: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}, {
customMode: boolean;
instrumental: boolean;
model: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}>, {
customMode: boolean;
instrumental: boolean;
model: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}, {
customMode: boolean;
instrumental: boolean;
model: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}>;
export declare const GenerateLyricsSchema: z.ZodObject<{
prompt: z.ZodString;
@@ -142,11 +202,11 @@ export declare const ReplaceSectionSchema: z.ZodObject<{
model: z.ZodEnum<[string, ...string[]]>;
callBackUrl: z.ZodOptional<z.ZodString>;
}, "strict", z.ZodTypeAny, {
end: number;
prompt: string;
model: string;
audioId: string;
start: number;
end: number;
customMode?: boolean | undefined;
instrumental?: boolean | undefined;
style?: string | undefined;
@@ -154,11 +214,11 @@ export declare const ReplaceSectionSchema: z.ZodObject<{
callBackUrl?: string | undefined;
replaceAudioUrl?: string | undefined;
}, {
end: number;
prompt: string;
model: string;
audioId: string;
start: number;
end: number;
customMode?: boolean | undefined;
instrumental?: boolean | undefined;
style?: string | undefined;
@@ -216,7 +276,7 @@ export declare const AddInstrumentalSchema: z.ZodObject<{
title?: string | undefined;
callBackUrl?: string | undefined;
}>;
export declare const UploadAndCoverSchema: z.ZodObject<{
export declare const UploadAndCoverSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
uploadUrl: z.ZodString;
prompt: z.ZodOptional<z.ZodString>;
customMode: z.ZodBoolean;
@@ -264,6 +324,70 @@ export declare const UploadAndCoverSchema: z.ZodObject<{
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}>, {
customMode: boolean;
instrumental: boolean;
model: string;
uploadUrl: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}, {
customMode: boolean;
instrumental: boolean;
model: string;
uploadUrl: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}>, {
customMode: boolean;
instrumental: boolean;
model: string;
uploadUrl: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}, {
customMode: boolean;
instrumental: boolean;
model: string;
uploadUrl: string;
prompt?: string | undefined;
style?: string | undefined;
title?: string | undefined;
negativeTags?: string | undefined;
vocalGender?: "m" | "f" | undefined;
styleWeight?: number | undefined;
weirdnessConstraint?: number | undefined;
audioWeight?: number | undefined;
personaId?: string | undefined;
personaModel?: "style_persona" | "voice_persona" | undefined;
callBackUrl?: string | undefined;
}>;
export declare const UploadAndExtendSchema: z.ZodObject<{
uploadUrl: z.ZodString;