chore: upgrade to latest zod v3 (#12938)
* chore: upgrade to latest zod v3 * chore: set explicit versions * chore: remove v3 scope --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -97,8 +97,8 @@
|
||||
"morgan": "^1.9.1",
|
||||
"path-to-regexp": "^0.1.10",
|
||||
"tsconfig-paths": "^4.2.0",
|
||||
"zod": "3.22.4",
|
||||
"zod-validation-error": "^3.4.1"
|
||||
"zod": "3.25.76",
|
||||
"zod-validation-error": "3.5.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@aws-sdk/client-dynamodb": "^3.218.0",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { raw } from "express"
|
||||
import { MedusaRequest, MedusaResponse, MedusaNextFunction } from "../../types"
|
||||
import { z } from "zod"
|
||||
import { MedusaNextFunction, MedusaRequest, MedusaResponse } from "../../types"
|
||||
import { defineMiddlewares } from "../../utils/define-middlewares"
|
||||
import {
|
||||
customersCreateMiddlewareMock,
|
||||
customersGlobalMiddlewareMock,
|
||||
customersCreateMiddlewareValidatorMock,
|
||||
customersGlobalMiddlewareMock,
|
||||
storeGlobalMiddlewareMock,
|
||||
} from "../mocks"
|
||||
import z from "zod"
|
||||
import { defineMiddlewares } from "../../utils/define-middlewares"
|
||||
|
||||
const customersGlobalMiddleware = (
|
||||
req: MedusaRequest,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import zod from "zod"
|
||||
import { MedusaError } from "@medusajs/utils"
|
||||
import { validateAndTransformBody } from "../utils/validate-body"
|
||||
import zod, { ZodNullable, ZodObject, ZodOptional } from "zod"
|
||||
import { MedusaRequest, MedusaResponse } from "../types"
|
||||
import { validateAndTransformBody } from "../utils/validate-body"
|
||||
|
||||
const createLinkBody = () => {
|
||||
return zod.object({
|
||||
@@ -33,7 +33,7 @@ describe("validateAndTransformBody", () => {
|
||||
.nullish()
|
||||
|
||||
const validatorFactory = (
|
||||
schema?: Zod.ZodOptional<Zod.ZodNullable<Zod.ZodObject<any, any>>>
|
||||
schema?: ZodOptional<ZodNullable<ZodObject<any, any>>>
|
||||
) => {
|
||||
return schema
|
||||
? createLinkBody().extend({
|
||||
@@ -69,7 +69,7 @@ describe("validateAndTransformBody", () => {
|
||||
.nullish()
|
||||
|
||||
const validatorFactory = (
|
||||
schema?: Zod.ZodOptional<Zod.ZodNullable<Zod.ZodObject<any, any>>>
|
||||
schema?: ZodOptional<ZodNullable<ZodObject<any, any>>>
|
||||
) => {
|
||||
return schema
|
||||
? createLinkBody().extend({
|
||||
@@ -102,7 +102,7 @@ describe("validateAndTransformBody", () => {
|
||||
.nullish()
|
||||
|
||||
const validatorFactory = (
|
||||
schema?: Zod.ZodOptional<Zod.ZodNullable<Zod.ZodObject<any, any>>>
|
||||
schema?: ZodOptional<ZodNullable<ZodObject<any, any>>>
|
||||
) => {
|
||||
return schema
|
||||
? createLinkBody().extend({
|
||||
|
||||
Reference in New Issue
Block a user