This commit is contained in:
ACT丶流星雨 2026-04-03 02:29:21 +08:00
commit cc7c192d72
4 changed files with 86 additions and 17 deletions

View File

@ -81,6 +81,8 @@ export default router.post(
} }
if ((vendor.id as string).includes(":")) return res.status(400).send(error("id不能包含英文冒号")); if ((vendor.id as string).includes(":")) return res.status(400).send(error("id不能包含英文冒号"));
const data = await u.db("o_vendorConfig").where("id", vendor.id).first();
if (data) return res.status(500).send(error("供应商id已存在"));
await u.db("o_vendorConfig").insert({ await u.db("o_vendorConfig").insert({
id: vendor.id, id: vendor.id,
author: vendor.author, author: vendor.author,
@ -92,7 +94,7 @@ export default router.post(
models: JSON.stringify(vendor.models ?? []), models: JSON.stringify(vendor.models ?? []),
code: tsCode, code: tsCode,
createTime: Date.now(), createTime: Date.now(),
enable: 1, enable: vendor.id == "toonflow" ? 1 : 0,
}); });
res.status(200).send(success(result.data)); res.status(200).send(success(result.data));
}, },

View File

@ -36,7 +36,7 @@ const vendorConfigSchema = z.object({
modelName: z.string(), modelName: z.string(),
type: z.literal("image"), type: z.literal("image"),
mode: z.array(z.enum(["text", "singleImage", "multiReference"])), mode: z.array(z.enum(["text", "singleImage", "multiReference"])),
associationSkills:z.string().optional(), associationSkills: z.string().optional(),
}), }),
z.object({ z.object({
name: z.string(), name: z.string(),
@ -44,19 +44,11 @@ const vendorConfigSchema = z.object({
type: z.literal("video"), type: z.literal("video"),
mode: z.array( mode: z.array(
z.union([ z.union([
z.enum([ z.enum(["singleImage", "startEndRequired", "endFrameOptional", "startFrameOptional", "text", "audioReference", "videoReference"]),
"singleImage", z.array(z.enum(["audioReference", "videoReference", "textReference", "imageReference"])),
"startEndRequired",
"endFrameOptional",
"startFrameOptional",
"text",
"audioReference",
"videoReference",
]),
z.array(z.enum(["audioReference", "videoReference", "textReference", "imageReference"])),
]), ]),
), ),
associationSkills:z.string().optional(), associationSkills: z.string().optional(),
audio: z.union([z.literal("optional"), z.boolean()]), audio: z.union([z.literal("optional"), z.boolean()]),
durationResolutionMap: z.array( durationResolutionMap: z.array(
z.object({ z.object({
@ -103,7 +95,7 @@ export default router.post(
inputValues: JSON.stringify(vendor.inputValues ?? {}), inputValues: JSON.stringify(vendor.inputValues ?? {}),
models: JSON.stringify(vendor.models ?? []), models: JSON.stringify(vendor.models ?? []),
code: tsCode, code: tsCode,
enable: 0, enable: vendor.id == "toonflow" ? 1 : 0,
createTime: Date.now(), createTime: Date.now(),
}); });
res.status(200).send(success(result.data)); res.status(200).send(success(result.data));

View File

@ -67,7 +67,7 @@ export default router.post(
inputs: JSON.stringify(inputs), inputs: JSON.stringify(inputs),
inputValues: JSON.stringify(inputValues), inputValues: JSON.stringify(inputValues),
models: JSON.stringify(models), models: JSON.stringify(models),
enable: 0, enable: id == "toonflow" ? 1 : 0,
}); });
res.status(200).send(success("更新成功")); res.status(200).send(success("更新成功"));
}, },

View File

@ -1,6 +1,75 @@
// @db-hash 6fa5017e455bc367c9c902ba574d11b4 // @db-hash 35cf00f711e9d4df398703de70511684
//该文件由脚本自动生成,请勿手动修改 //该文件由脚本自动生成,请勿手动修改
export interface _o_project_old_20260402 {
'artStyle'?: string | null;
'createTime'?: number | null;
'id'?: number | null;
'imageModel'?: string | null;
'imageQuality'?: string | null;
'intro'?: string | null;
'mode'?: string | null;
'name'?: string | null;
'projectType'?: string | null;
'type'?: string | null;
'userId'?: number | null;
'videoModel'?: string | null;
'videoRatio'?: string | null;
}
export interface _o_storyboard_old_20260402 {
'createTime'?: number | null;
'duration'?: string | null;
'filePath'?: string | null;
'flowId'?: number | null;
'id'?: number;
'index'?: number | null;
'projectId'?: number | null;
'prompt'?: string | null;
'reason'?: string | null;
'scriptId'?: number | null;
'state'?: string | null;
'trackId'?: number | null;
}
export interface _o_storyboard_old_20260402_1 {
'createTime'?: number | null;
'duration'?: string | null;
'filePath'?: string | null;
'flowId'?: number | null;
'id'?: number;
'index'?: number | null;
'projectId'?: number | null;
'prompt'?: string | null;
'reason'?: string | null;
'scriptId'?: number | null;
'shouldGenerateImage'?: number | null;
'state'?: string | null;
'track'?: string | null;
'trackId'?: number | null;
'videoPrompt'?: string | null;
}
export interface _o_vendorConfig_old_20260401 {
'author'?: string | null;
'code'?: string | null;
'createTime'?: number | null;
'description'?: string | null;
'enableEnglish'?: number | null;
'icon'?: string | null;
'id'?: string;
'inputs'?: string | null;
'inputValues'?: string | null;
'models'?: string | null;
'name'?: string | null;
}
export interface _o_videoTrack_old_20260402 {
'id'?: number;
'projectId'?: number | null;
'prompt'?: string | null;
'reason'?: string | null;
'scriptId'?: number | null;
'selectVideoId'?: number | null;
'state'?: string | null;
'videoId'?: number | null;
}
export interface memories { export interface memories {
'content': string; 'content': string;
'createTime': number; 'createTime': number;
@ -76,6 +145,7 @@ export interface o_image {
'filePath'?: string | null; 'filePath'?: string | null;
'id'?: number; 'id'?: number;
'model'?: string | null; 'model'?: string | null;
'reason'?: string | null;
'resolution'?: string | null; 'resolution'?: string | null;
'state'?: string | null; 'state'?: string | null;
'type'?: string | null; 'type'?: string | null;
@ -201,6 +271,7 @@ export interface o_vendorConfig {
'createTime'?: number | null; 'createTime'?: number | null;
'description'?: string | null; 'description'?: string | null;
'enable'?: number | null; 'enable'?: number | null;
'enableEnglish'?: number | null;
'icon'?: string | null; 'icon'?: string | null;
'id'?: string; 'id'?: string;
'inputs'?: string | null; 'inputs'?: string | null;
@ -225,12 +296,16 @@ export interface o_videoTrack {
'prompt'?: string | null; 'prompt'?: string | null;
'reason'?: string | null; 'reason'?: string | null;
'scriptId'?: number | null; 'scriptId'?: number | null;
'selectVideoId'?: number | null;
'state'?: string | null; 'state'?: string | null;
'videoId'?: number | null; 'videoId'?: number | null;
} }
export interface DB { export interface DB {
"_o_project_old_20260402": _o_project_old_20260402;
"_o_storyboard_old_20260402": _o_storyboard_old_20260402;
"_o_storyboard_old_20260402_1": _o_storyboard_old_20260402_1;
"_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401;
"_o_videoTrack_old_20260402": _o_videoTrack_old_20260402;
"memories": memories; "memories": memories;
"o_agentDeploy": o_agentDeploy; "o_agentDeploy": o_agentDeploy;
"o_agentWorkData": o_agentWorkData; "o_agentWorkData": o_agentWorkData;