diff --git a/agent-service-api/package.json b/agent-service-api/package.json index 6f983fe..2d53ff7 100644 --- a/agent-service-api/package.json +++ b/agent-service-api/package.json @@ -27,7 +27,7 @@ "express": "^4.21.2", "handlebars": "^4.7.10", "jsonpath-plus": "^10.3.0", - "zod": "^3.23.8" + "zod": "^4.6.7" }, "devDependencies": { "@types/cors": "^2.8.17", diff --git a/backend/package.json b/backend/package.json index d5abfbd..7323bc1 100644 --- a/backend/package.json +++ b/backend/package.json @@ -27,7 +27,7 @@ "cors": "^2.8.5", "express": "^4.21.2", "uuid": "^11.1.0", - "zod": "^3.23.8" + "zod": "^4.6.7" }, "devDependencies": { "@types/cors": "^2.8.17", diff --git a/backend/src/routes/conversations.ts b/backend/src/routes/conversations.ts index c856fbe..ae1a103 100644 --- a/backend/src/routes/conversations.ts +++ b/backend/src/routes/conversations.ts @@ -26,12 +26,7 @@ const router = Router(); const createConversationBodySchema = z .object({ - name: z - .string({ - required_error: 'Name is required', - invalid_type_error: 'Name is required' - }) - .min(1, 'Name is required') + name: z.string({ error: 'Name is required' }).min(1, 'Name is required') }) .passthrough(); diff --git a/package-lock.json b/package-lock.json index 41af1d6..73fbf78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "express": "^4.21.2", "handlebars": "^4.7.10", "jsonpath-plus": "^10.3.0", - "zod": "^3.23.8" + "zod": "^4.6.7" }, "devDependencies": { "@types/cors": "^2.8.17", @@ -92,7 +92,7 @@ "cors": "^2.8.5", "express": "^4.21.2", "uuid": "^11.1.0", - "zod": "^3.23.8" + "zod": "^4.6.7" }, "devDependencies": { "@types/cors": "^2.8.17", @@ -13957,9 +13957,9 @@ } }, "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -13982,7 +13982,7 @@ "name": "@ibm-vibe/config", "version": "1.0.0", "dependencies": { - "zod": "^3.23.8" + "zod": "^4.6.7" }, "devDependencies": { "typescript": "^5.7.3" @@ -13992,7 +13992,7 @@ "name": "@ibm-vibe/types", "version": "1.0.0", "dependencies": { - "zod": "^3.25.76" + "zod": "^4.6.7" }, "devDependencies": { "typescript": "^5.7.3" diff --git a/packages/config/package.json b/packages/config/package.json index 6fb7ef9..607892d 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -9,7 +9,7 @@ "prepare": "npm run build" }, "dependencies": { - "zod": "^3.23.8" + "zod": "^4.6.7" }, "devDependencies": { "typescript": "^5.7.3" diff --git a/packages/types/data-transfer.ts b/packages/types/data-transfer.ts index 3bf4ba7..df6d828 100644 --- a/packages/types/data-transfer.ts +++ b/packages/types/data-transfer.ts @@ -118,16 +118,18 @@ export const importResolutionSchema = z.object({ new_version: optionalStringSchema }); -export const importResolutionMapSchema = z.record(importResolutionSchema).superRefine((resolutions, ctx) => { - for (const [itemKey, resolution] of Object.entries(resolutions)) { - if (resolution.item_key !== itemKey) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: `Resolution key ${itemKey} must match item_key` - }); +export const importResolutionMapSchema = z + .record(z.string(), importResolutionSchema) + .superRefine((resolutions, ctx) => { + for (const [itemKey, resolution] of Object.entries(resolutions)) { + if (resolution.item_key !== itemKey) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: `Resolution key ${itemKey} must match item_key` + }); + } } - } -}); + }); export const analyzeImportRequestSchema = z.object({ bundle: exportBundleSchema, diff --git a/packages/types/package.json b/packages/types/package.json index 2a312fc..198088b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -23,6 +23,6 @@ "typescript": "^5.7.3" }, "dependencies": { - "zod": "^3.25.76" + "zod": "^4.6.7" } }