Skip to content

Commit d588323

Browse files
committed
zod v4
1 parent ce169c5 commit d588323

File tree

19 files changed

+40
-27
lines changed

19 files changed

+40
-27
lines changed

bun.lock

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"workspaces": {
44
"": {
55
"name": "fastgpt-plugins",
6+
"dependencies": {
7+
"@ts-rest/core": "3.53.0-rc.1",
8+
"@ts-rest/express": "3.53.0-rc.1",
9+
"@ts-rest/open-api": "3.53.0-rc.1",
10+
},
611
"devDependencies": {
712
"@eslint/js": "^9.24.0",
813
"@eslint/json": "^0.11.0",
@@ -40,9 +45,9 @@
4045
"@opentelemetry/sdk-logs": "^0.203.0",
4146
"@opentelemetry/sdk-metrics": "^2.0.1",
4247
"@scalar/express-api-reference": "^0.8.7",
43-
"@ts-rest/core": "^3.52.1",
48+
"@ts-rest/core": "3.53.0-rc.1",
4449
"@ts-rest/express": "^3.52.1",
45-
"@ts-rest/open-api": "^3.52.1",
50+
"@ts-rest/open-api": "3.53.0-rc.1",
4651
"@vercel/otel": "^1.9.2",
4752
"fs-extra": "^11.3.2",
4853
"http-proxy-agent": "^7.0.2",
@@ -88,10 +93,10 @@
8893
},
8994
"sdk": {
9095
"name": "@fastgpt-sdk/plugin",
91-
"version": "0.2.2",
96+
"version": "0.2.6",
9297
"dependencies": {
9398
"@fortaine/fetch-event-source": "^3.0.6",
94-
"@ts-rest/core": "^3.52.1",
99+
"@ts-rest/core": "3.53.0-rc.1",
95100
"zod": "^4.1.12",
96101
},
97102
"devDependencies": {
@@ -417,11 +422,11 @@
417422

418423
"@scalar/types": ["@scalar/[email protected]", "", { "dependencies": { "@scalar/openapi-types": "0.5.0", "nanoid": "5.1.5", "type-fest": "5.0.0", "zod": "4.1.11" } }, "sha512-+X10CCvG57nAqYbTGteiSzRFQcMYm7DLfCRMeEfiWQ9Bq2ladat17XsMSvkvwcfpOSlsoepWf3P5dErERUSOQQ=="],
419424

420-
"@ts-rest/core": ["@ts-rest/core@3.52.1", "", { "peerDependencies": { "@types/node": "^18.18.7 || >=20.8.4", "zod": "^3.22.3" }, "optionalPeers": ["@types/node", "zod"] }, "sha512-tAjz7Kxq/grJodcTA1Anop4AVRDlD40fkksEV5Mmal88VoZeRKAG8oMHsDwdwPZz+B/zgnz0q2sF+cm5M7Bc7g=="],
425+
"@ts-rest/core": ["@ts-rest/core@3.53.0-rc.1", "", { "peerDependencies": { "@types/node": "^18.18.7 || >=20.8.4" }, "optionalPeers": ["@types/node"] }, "sha512-hDMXqKHSys6w+kXFW1Q6EvN8QgRvtXKXJ2TpYByKI4TquaPjiTOv99aLD26X4LNRzdna8Ci1PVyzr0jYZv0oNQ=="],
421426

422-
"@ts-rest/express": ["@ts-rest/express@3.52.1", "", { "peerDependencies": { "@ts-rest/core": "~3.52.0", "express": "^4.0.0", "zod": "^3.22.3" }, "optionalPeers": ["zod"] }, "sha512-ttVynyJSWYnVzn7FazSFvShD5j3Lq1JsIhSKereV2Z51zxWEQwo35CpCO3Q8rELzkfD9CYoT6eNSBJRlJLogIw=="],
427+
"@ts-rest/express": ["@ts-rest/express@3.53.0-rc.1", "", { "peerDependencies": { "@ts-rest/core": "3.53.0-rc.1", "express": "^4.0.0 || ^5.0.0" } }, "sha512-TPF2kFdxCF6fI41z2yXexPjSdjN5e65sanmCiUx/4HNp5/ObcGLkHbdHSnvDhNkmkPn3jcd6g2EOvQgsQ8mkfg=="],
423428

424-
"@ts-rest/open-api": ["@ts-rest/open-api@3.52.1", "", { "dependencies": { "@anatine/zod-openapi": "^1.12.0", "openapi3-ts": "^2.0.2" }, "peerDependencies": { "@ts-rest/core": "~3.52.0", "zod": "^3.22.3" } }, "sha512-VY91g6HFzCe1/fNgX4Y3HzaJbIdztCGHTg34drkh7bKgtNOizLJLXV0wwIkMwLGvjhRHojJxnwYxHjGMIkScwg=="],
429+
"@ts-rest/open-api": ["@ts-rest/open-api@3.53.0-rc.1", "", { "dependencies": { "@anatine/zod-openapi": "^1.12.0", "openapi3-ts": "^2.0.2" }, "peerDependencies": { "@ts-rest/core": "3.53.0-rc.1", "zod": "^3.22.3" } }, "sha512-JqmmdwFP2AHlyK9T4dwgsFL3QGNRppV9JIBh0G9mbJE7m7Kj403VsxJZ5X128E3XqwH7JIgJ4wsyGRX4Zbtqvw=="],
425430

426431
"@types/babel__generator": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="],
427432

@@ -1265,6 +1270,8 @@
12651270

12661271
"@eslint/plugin-kit/@eslint/core": ["@eslint/[email protected]", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw=="],
12671272

1273+
"@fastgpt-plugin/packages/@ts-rest/express": ["@ts-rest/[email protected]", "", { "peerDependencies": { "@ts-rest/core": "~3.52.0", "express": "^4.0.0", "zod": "^3.22.3" }, "optionalPeers": ["zod"] }, "sha512-ttVynyJSWYnVzn7FazSFvShD5j3Lq1JsIhSKereV2Z51zxWEQwo35CpCO3Q8rELzkfD9CYoT6eNSBJRlJLogIw=="],
1274+
12681275
"@fastgpt-sdk/plugin/zod": ["[email protected]", "https://registry.npmmirror.com/zod/-/zod-4.1.12.tgz", {}, "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ=="],
12691276

12701277
"@inquirer/core/signal-exit": ["[email protected]", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],

lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"@opentelemetry/sdk-logs": "^0.203.0",
1515
"@opentelemetry/sdk-metrics": "^2.0.1",
1616
"@scalar/express-api-reference": "^0.8.7",
17-
"@ts-rest/core": "^3.52.1",
17+
"@ts-rest/core": "3.53.0-rc.1",
1818
"@ts-rest/express": "^3.52.1",
19-
"@ts-rest/open-api": "^3.52.1",
19+
"@ts-rest/open-api": "3.53.0-rc.1",
2020
"@vercel/otel": "^1.9.2",
2121
"fs-extra": "^11.3.2",
2222
"jszip": "^3.10.1",

lib/redis/lock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import z from 'zod';
1+
import { z } from 'zod';
22
import { FASTGPT_REDIS_PREFIX, getGlobalRedisConnection } from '.';
33
export const lockEnum = z.enum(['parsePkg']);
44
const lockPrefix = `${FASTGPT_REDIS_PREFIX}LOCK:`;

lib/s3/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const PresignedUrlInputSchema = z.object({
44
filepath: z.string(),
55
filename: z.string(),
66
contentType: z.string().optional(),
7-
metadata: z.record(z.string()).optional(),
7+
metadata: z.record(z.string(), z.string()).optional(),
88
maxSize: z.number().optional().describe('B'),
99
fileExpireMins: z.number().optional()
1010
});

lib/worker/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import z from 'zod';
1+
import { z } from 'zod';
22
import { FileMetadataSchema, type FileMetadata } from '@/s3/config';
33
import { FileInputSchema } from '@/s3/type';
44
import { StreamDataSchema, ToolCallbackReturnSchema } from '@tool/type/req';

modules/model/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import z from 'zod';
1+
import { z } from 'zod';
22
import { c } from '@/contract/init';
33
import { type ListModelsType } from './api/type';
44
import { type I18nStringStrictType } from '@/type/i18n';

modules/tool/api/upload/confirmUpload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export default s.route(contract.tool.upload.confirmUpload, async ({ body }) => {
2727

2828
await mongoSessionRun(async (session) => {
2929
const allToolsInstalled = (
30-
await MongoPlugin.find({ type: pluginTypeEnum.Enum.tool }).lean()
30+
await MongoPlugin.find({ type: pluginTypeEnum.enum.tool }).lean()
3131
).map((tool) => tool.toolId);
3232
// create all that not exists
3333
await MongoPlugin.create(
3434
toolIds
3535
.filter((toolId) => !allToolsInstalled.includes(toolId))
3636
.map((toolId) => ({
3737
toolId,
38-
type: pluginTypeEnum.Enum.tool
38+
type: pluginTypeEnum.enum.tool
3939
})),
4040
{
4141
session,

modules/tool/api/upload/install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default s.route(contract.tool.upload.install, async ({ body }) => {
3030
<T>(item: T): item is NonNullable<T> => !!item
3131
);
3232

33-
const allToolsInstalled = (await MongoPlugin.find({ type: pluginTypeEnum.Enum.tool }).lean()).map(
33+
const allToolsInstalled = (await MongoPlugin.find({ type: pluginTypeEnum.enum.tool }).lean()).map(
3434
(tool) => tool.toolId
3535
);
3636
// create all that not exists
@@ -39,7 +39,7 @@ export default s.route(contract.tool.upload.install, async ({ body }) => {
3939
.filter((toolId) => !allToolsInstalled.includes(toolId))
4040
.map((toolId) => ({
4141
toolId,
42-
type: pluginTypeEnum.Enum.tool
42+
type: pluginTypeEnum.enum.tool
4343
})),
4444
{
4545
ordered: true

modules/tool/api/upload/parseUploadedTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default s.route(contract.tool.upload.parseUploadedTool, async ({ query })
88
const { objectName } = query;
99
addLog.debug(`Parsing uploaded tool: ${objectName}`);
1010
const res = await parseUploadedTool(objectName);
11-
// const res = await withLock(lockEnum.Enum.parsePkg, 20000, () => parseUploadedTool(objectName));
11+
// const res = await withLock(lockEnum.enum.parsePkg, 20000, () => parseUploadedTool(objectName));
1212

1313
addLog.debug(`Parsed tool: ${res.map((item) => item.toolId)}`);
1414
return {

modules/tool/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import z from 'zod';
1+
import { z } from 'zod';
22
import { c } from '@/contract/init';
33
import { ToolDetailSchema, type ToolDetailType, ToolTagListSchema } from './type/api';
44

0 commit comments

Comments
 (0)