lody 0.92.1 → 0.93.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2566,6 +2566,18 @@ function handleReadonlyResult(payload) {
2566
2566
  payload.value = Object.freeze(payload.value);
2567
2567
  return payload;
2568
2568
  }
2569
+ const $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
2570
+ $ZodType.init(inst, def);
2571
+ defineLazy(inst._zod, "innerType", () => def.getter());
2572
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
2573
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
2574
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
2575
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0);
2576
+ inst._zod.parse = (payload, ctx) => {
2577
+ const inner = inst._zod.innerType;
2578
+ return inner._zod.run(payload, ctx);
2579
+ };
2580
+ });
2569
2581
  const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2570
2582
  $ZodCheck.init(inst, def);
2571
2583
  $ZodType.init(inst, def);
@@ -3538,29 +3550,29 @@ const formatMap = {
3538
3550
  // do not set
3539
3551
  };
3540
3552
  const stringProcessor = (schema, ctx, _json, _params) => {
3541
- const json = _json;
3542
- json.type = "string";
3553
+ const json2 = _json;
3554
+ json2.type = "string";
3543
3555
  const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
3544
3556
  if (typeof minimum === "number")
3545
- json.minLength = minimum;
3557
+ json2.minLength = minimum;
3546
3558
  if (typeof maximum === "number")
3547
- json.maxLength = maximum;
3559
+ json2.maxLength = maximum;
3548
3560
  if (format) {
3549
- json.format = formatMap[format] ?? format;
3550
- if (json.format === "")
3551
- delete json.format;
3561
+ json2.format = formatMap[format] ?? format;
3562
+ if (json2.format === "")
3563
+ delete json2.format;
3552
3564
  if (format === "time") {
3553
- delete json.format;
3565
+ delete json2.format;
3554
3566
  }
3555
3567
  }
3556
3568
  if (contentEncoding)
3557
- json.contentEncoding = contentEncoding;
3569
+ json2.contentEncoding = contentEncoding;
3558
3570
  if (patterns && patterns.size > 0) {
3559
3571
  const regexes = [...patterns];
3560
3572
  if (regexes.length === 1)
3561
- json.pattern = regexes[0].source;
3573
+ json2.pattern = regexes[0].source;
3562
3574
  else if (regexes.length > 1) {
3563
- json.allOf = [
3575
+ json2.allOf = [
3564
3576
  ...regexes.map((regex) => ({
3565
3577
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
3566
3578
  pattern: regex.source
@@ -3570,51 +3582,51 @@ const stringProcessor = (schema, ctx, _json, _params) => {
3570
3582
  }
3571
3583
  };
3572
3584
  const numberProcessor = (schema, ctx, _json, _params) => {
3573
- const json = _json;
3585
+ const json2 = _json;
3574
3586
  const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3575
3587
  if (typeof format === "string" && format.includes("int"))
3576
- json.type = "integer";
3588
+ json2.type = "integer";
3577
3589
  else
3578
- json.type = "number";
3590
+ json2.type = "number";
3579
3591
  if (typeof exclusiveMinimum === "number") {
3580
3592
  if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3581
- json.minimum = exclusiveMinimum;
3582
- json.exclusiveMinimum = true;
3593
+ json2.minimum = exclusiveMinimum;
3594
+ json2.exclusiveMinimum = true;
3583
3595
  } else {
3584
- json.exclusiveMinimum = exclusiveMinimum;
3596
+ json2.exclusiveMinimum = exclusiveMinimum;
3585
3597
  }
3586
3598
  }
3587
3599
  if (typeof minimum === "number") {
3588
- json.minimum = minimum;
3600
+ json2.minimum = minimum;
3589
3601
  if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
3590
3602
  if (exclusiveMinimum >= minimum)
3591
- delete json.minimum;
3603
+ delete json2.minimum;
3592
3604
  else
3593
- delete json.exclusiveMinimum;
3605
+ delete json2.exclusiveMinimum;
3594
3606
  }
3595
3607
  }
3596
3608
  if (typeof exclusiveMaximum === "number") {
3597
3609
  if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3598
- json.maximum = exclusiveMaximum;
3599
- json.exclusiveMaximum = true;
3610
+ json2.maximum = exclusiveMaximum;
3611
+ json2.exclusiveMaximum = true;
3600
3612
  } else {
3601
- json.exclusiveMaximum = exclusiveMaximum;
3613
+ json2.exclusiveMaximum = exclusiveMaximum;
3602
3614
  }
3603
3615
  }
3604
3616
  if (typeof maximum === "number") {
3605
- json.maximum = maximum;
3617
+ json2.maximum = maximum;
3606
3618
  if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
3607
3619
  if (exclusiveMaximum <= maximum)
3608
- delete json.maximum;
3620
+ delete json2.maximum;
3609
3621
  else
3610
- delete json.exclusiveMaximum;
3622
+ delete json2.exclusiveMaximum;
3611
3623
  }
3612
3624
  }
3613
3625
  if (typeof multipleOf === "number")
3614
- json.multipleOf = multipleOf;
3626
+ json2.multipleOf = multipleOf;
3615
3627
  };
3616
- const booleanProcessor = (_schema, _ctx, json, _params) => {
3617
- json.type = "boolean";
3628
+ const booleanProcessor = (_schema, _ctx, json2, _params) => {
3629
+ json2.type = "boolean";
3618
3630
  };
3619
3631
  const bigintProcessor = (_schema, ctx, _json, _params) => {
3620
3632
  if (ctx.unrepresentable === "throw") {
@@ -3626,13 +3638,13 @@ const symbolProcessor = (_schema, ctx, _json, _params) => {
3626
3638
  throw new Error("Symbols cannot be represented in JSON Schema");
3627
3639
  }
3628
3640
  };
3629
- const nullProcessor = (_schema, ctx, json, _params) => {
3641
+ const nullProcessor = (_schema, ctx, json2, _params) => {
3630
3642
  if (ctx.target === "openapi-3.0") {
3631
- json.type = "string";
3632
- json.nullable = true;
3633
- json.enum = [null];
3643
+ json2.type = "string";
3644
+ json2.nullable = true;
3645
+ json2.enum = [null];
3634
3646
  } else {
3635
- json.type = "null";
3647
+ json2.type = "null";
3636
3648
  }
3637
3649
  };
3638
3650
  const undefinedProcessor = (_schema, ctx, _json, _params) => {
@@ -3645,8 +3657,8 @@ const voidProcessor = (_schema, ctx, _json, _params) => {
3645
3657
  throw new Error("Void cannot be represented in JSON Schema");
3646
3658
  }
3647
3659
  };
3648
- const neverProcessor = (_schema, _ctx, json, _params) => {
3649
- json.not = {};
3660
+ const neverProcessor = (_schema, _ctx, json2, _params) => {
3661
+ json2.not = {};
3650
3662
  };
3651
3663
  const anyProcessor = (_schema, _ctx, _json, _params) => {
3652
3664
  };
@@ -3657,16 +3669,16 @@ const dateProcessor = (_schema, ctx, _json, _params) => {
3657
3669
  throw new Error("Date cannot be represented in JSON Schema");
3658
3670
  }
3659
3671
  };
3660
- const enumProcessor = (schema, _ctx, json, _params) => {
3672
+ const enumProcessor = (schema, _ctx, json2, _params) => {
3661
3673
  const def = schema._zod.def;
3662
3674
  const values = getEnumValues(def.entries);
3663
3675
  if (values.every((v) => typeof v === "number"))
3664
- json.type = "number";
3676
+ json2.type = "number";
3665
3677
  if (values.every((v) => typeof v === "string"))
3666
- json.type = "string";
3667
- json.enum = values;
3678
+ json2.type = "string";
3679
+ json2.enum = values;
3668
3680
  };
3669
- const literalProcessor = (schema, ctx, json, _params) => {
3681
+ const literalProcessor = (schema, ctx, json2, _params) => {
3670
3682
  const def = schema._zod.def;
3671
3683
  const vals = [];
3672
3684
  for (const val of def.values) {
@@ -3687,22 +3699,22 @@ const literalProcessor = (schema, ctx, json, _params) => {
3687
3699
  if (vals.length === 0) ;
3688
3700
  else if (vals.length === 1) {
3689
3701
  const val = vals[0];
3690
- json.type = val === null ? "null" : typeof val;
3702
+ json2.type = val === null ? "null" : typeof val;
3691
3703
  if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3692
- json.enum = [val];
3704
+ json2.enum = [val];
3693
3705
  } else {
3694
- json.const = val;
3706
+ json2.const = val;
3695
3707
  }
3696
3708
  } else {
3697
3709
  if (vals.every((v) => typeof v === "number"))
3698
- json.type = "number";
3710
+ json2.type = "number";
3699
3711
  if (vals.every((v) => typeof v === "string"))
3700
- json.type = "string";
3712
+ json2.type = "string";
3701
3713
  if (vals.every((v) => typeof v === "boolean"))
3702
- json.type = "boolean";
3714
+ json2.type = "boolean";
3703
3715
  if (vals.every((v) => v === null))
3704
- json.type = "null";
3705
- json.enum = vals;
3716
+ json2.type = "null";
3717
+ json2.enum = vals;
3706
3718
  }
3707
3719
  };
3708
3720
  const nanProcessor = (_schema, ctx, _json, _params) => {
@@ -3710,16 +3722,16 @@ const nanProcessor = (_schema, ctx, _json, _params) => {
3710
3722
  throw new Error("NaN cannot be represented in JSON Schema");
3711
3723
  }
3712
3724
  };
3713
- const templateLiteralProcessor = (schema, _ctx, json, _params) => {
3714
- const _json = json;
3725
+ const templateLiteralProcessor = (schema, _ctx, json2, _params) => {
3726
+ const _json = json2;
3715
3727
  const pattern = schema._zod.pattern;
3716
3728
  if (!pattern)
3717
3729
  throw new Error("Pattern not found in template literal");
3718
3730
  _json.type = "string";
3719
3731
  _json.pattern = pattern.source;
3720
3732
  };
3721
- const fileProcessor = (schema, _ctx, json, _params) => {
3722
- const _json = json;
3733
+ const fileProcessor = (schema, _ctx, json2, _params) => {
3734
+ const _json = json2;
3723
3735
  const file = {
3724
3736
  type: "string",
3725
3737
  format: "binary",
@@ -3742,8 +3754,8 @@ const fileProcessor = (schema, _ctx, json, _params) => {
3742
3754
  Object.assign(_json, file);
3743
3755
  }
3744
3756
  };
3745
- const successProcessor = (_schema, _ctx, json, _params) => {
3746
- json.type = "boolean";
3757
+ const successProcessor = (_schema, _ctx, json2, _params) => {
3758
+ json2.type = "boolean";
3747
3759
  };
3748
3760
  const customProcessor = (_schema, ctx, _json, _params) => {
3749
3761
  if (ctx.unrepresentable === "throw") {
@@ -3771,24 +3783,24 @@ const setProcessor = (_schema, ctx, _json, _params) => {
3771
3783
  }
3772
3784
  };
3773
3785
  const arrayProcessor = (schema, ctx, _json, params) => {
3774
- const json = _json;
3786
+ const json2 = _json;
3775
3787
  const def = schema._zod.def;
3776
3788
  const { minimum, maximum } = schema._zod.bag;
3777
3789
  if (typeof minimum === "number")
3778
- json.minItems = minimum;
3790
+ json2.minItems = minimum;
3779
3791
  if (typeof maximum === "number")
3780
- json.maxItems = maximum;
3781
- json.type = "array";
3782
- json.items = process(def.element, ctx, { ...params, path: [...params.path, "items"] });
3792
+ json2.maxItems = maximum;
3793
+ json2.type = "array";
3794
+ json2.items = process(def.element, ctx, { ...params, path: [...params.path, "items"] });
3783
3795
  };
3784
3796
  const objectProcessor = (schema, ctx, _json, params) => {
3785
- const json = _json;
3797
+ const json2 = _json;
3786
3798
  const def = schema._zod.def;
3787
- json.type = "object";
3788
- json.properties = {};
3799
+ json2.type = "object";
3800
+ json2.properties = {};
3789
3801
  const shape = def.shape;
3790
3802
  for (const key in shape) {
3791
- json.properties[key] = process(shape[key], ctx, {
3803
+ json2.properties[key] = process(shape[key], ctx, {
3792
3804
  ...params,
3793
3805
  path: [...params.path, "properties", key]
3794
3806
  });
@@ -3803,21 +3815,21 @@ const objectProcessor = (schema, ctx, _json, params) => {
3803
3815
  }
3804
3816
  }));
3805
3817
  if (requiredKeys.size > 0) {
3806
- json.required = Array.from(requiredKeys);
3818
+ json2.required = Array.from(requiredKeys);
3807
3819
  }
3808
3820
  if (def.catchall?._zod.def.type === "never") {
3809
- json.additionalProperties = false;
3821
+ json2.additionalProperties = false;
3810
3822
  } else if (!def.catchall) {
3811
3823
  if (ctx.io === "output")
3812
- json.additionalProperties = false;
3824
+ json2.additionalProperties = false;
3813
3825
  } else if (def.catchall) {
3814
- json.additionalProperties = process(def.catchall, ctx, {
3826
+ json2.additionalProperties = process(def.catchall, ctx, {
3815
3827
  ...params,
3816
3828
  path: [...params.path, "additionalProperties"]
3817
3829
  });
3818
3830
  }
3819
3831
  };
3820
- const unionProcessor = (schema, ctx, json, params) => {
3832
+ const unionProcessor = (schema, ctx, json2, params) => {
3821
3833
  const def = schema._zod.def;
3822
3834
  const isExclusive = def.inclusive === false;
3823
3835
  const options = def.options.map((x, i) => process(x, ctx, {
@@ -3825,12 +3837,12 @@ const unionProcessor = (schema, ctx, json, params) => {
3825
3837
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
3826
3838
  }));
3827
3839
  if (isExclusive) {
3828
- json.oneOf = options;
3840
+ json2.oneOf = options;
3829
3841
  } else {
3830
- json.anyOf = options;
3842
+ json2.anyOf = options;
3831
3843
  }
3832
3844
  };
3833
- const intersectionProcessor = (schema, ctx, json, params) => {
3845
+ const intersectionProcessor = (schema, ctx, json2, params) => {
3834
3846
  const def = schema._zod.def;
3835
3847
  const a = process(def.left, ctx, {
3836
3848
  ...params,
@@ -3845,12 +3857,12 @@ const intersectionProcessor = (schema, ctx, json, params) => {
3845
3857
  ...isSimpleIntersection(a) ? a.allOf : [a],
3846
3858
  ...isSimpleIntersection(b) ? b.allOf : [b]
3847
3859
  ];
3848
- json.allOf = allOf;
3860
+ json2.allOf = allOf;
3849
3861
  };
3850
3862
  const tupleProcessor = (schema, ctx, _json, params) => {
3851
- const json = _json;
3863
+ const json2 = _json;
3852
3864
  const def = schema._zod.def;
3853
- json.type = "array";
3865
+ json2.type = "array";
3854
3866
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
3855
3867
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
3856
3868
  const prefixItems = def.items.map((x, i) => process(x, ctx, {
@@ -3862,37 +3874,37 @@ const tupleProcessor = (schema, ctx, _json, params) => {
3862
3874
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
3863
3875
  }) : null;
3864
3876
  if (ctx.target === "draft-2020-12") {
3865
- json.prefixItems = prefixItems;
3877
+ json2.prefixItems = prefixItems;
3866
3878
  if (rest) {
3867
- json.items = rest;
3879
+ json2.items = rest;
3868
3880
  }
3869
3881
  } else if (ctx.target === "openapi-3.0") {
3870
- json.items = {
3882
+ json2.items = {
3871
3883
  anyOf: prefixItems
3872
3884
  };
3873
3885
  if (rest) {
3874
- json.items.anyOf.push(rest);
3886
+ json2.items.anyOf.push(rest);
3875
3887
  }
3876
- json.minItems = prefixItems.length;
3888
+ json2.minItems = prefixItems.length;
3877
3889
  if (!rest) {
3878
- json.maxItems = prefixItems.length;
3890
+ json2.maxItems = prefixItems.length;
3879
3891
  }
3880
3892
  } else {
3881
- json.items = prefixItems;
3893
+ json2.items = prefixItems;
3882
3894
  if (rest) {
3883
- json.additionalItems = rest;
3895
+ json2.additionalItems = rest;
3884
3896
  }
3885
3897
  }
3886
3898
  const { minimum, maximum } = schema._zod.bag;
3887
3899
  if (typeof minimum === "number")
3888
- json.minItems = minimum;
3900
+ json2.minItems = minimum;
3889
3901
  if (typeof maximum === "number")
3890
- json.maxItems = maximum;
3902
+ json2.maxItems = maximum;
3891
3903
  };
3892
3904
  const recordProcessor = (schema, ctx, _json, params) => {
3893
- const json = _json;
3905
+ const json2 = _json;
3894
3906
  const def = schema._zod.def;
3895
- json.type = "object";
3907
+ json2.type = "object";
3896
3908
  const keyType = def.keyType;
3897
3909
  const keyBag = keyType._zod.bag;
3898
3910
  const patterns = keyBag?.patterns;
@@ -3901,18 +3913,18 @@ const recordProcessor = (schema, ctx, _json, params) => {
3901
3913
  ...params,
3902
3914
  path: [...params.path, "patternProperties", "*"]
3903
3915
  });
3904
- json.patternProperties = {};
3916
+ json2.patternProperties = {};
3905
3917
  for (const pattern of patterns) {
3906
- json.patternProperties[pattern.source] = valueSchema;
3918
+ json2.patternProperties[pattern.source] = valueSchema;
3907
3919
  }
3908
3920
  } else {
3909
3921
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
3910
- json.propertyNames = process(def.keyType, ctx, {
3922
+ json2.propertyNames = process(def.keyType, ctx, {
3911
3923
  ...params,
3912
3924
  path: [...params.path, "propertyNames"]
3913
3925
  });
3914
3926
  }
3915
- json.additionalProperties = process(def.valueType, ctx, {
3927
+ json2.additionalProperties = process(def.valueType, ctx, {
3916
3928
  ...params,
3917
3929
  path: [...params.path, "additionalProperties"]
3918
3930
  });
@@ -3921,19 +3933,19 @@ const recordProcessor = (schema, ctx, _json, params) => {
3921
3933
  if (keyValues) {
3922
3934
  const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
3923
3935
  if (validKeyValues.length > 0) {
3924
- json.required = validKeyValues;
3936
+ json2.required = validKeyValues;
3925
3937
  }
3926
3938
  }
3927
3939
  };
3928
- const nullableProcessor = (schema, ctx, json, params) => {
3940
+ const nullableProcessor = (schema, ctx, json2, params) => {
3929
3941
  const def = schema._zod.def;
3930
3942
  const inner = process(def.innerType, ctx, params);
3931
3943
  const seen = ctx.seen.get(schema);
3932
3944
  if (ctx.target === "openapi-3.0") {
3933
3945
  seen.ref = def.innerType;
3934
- json.nullable = true;
3946
+ json2.nullable = true;
3935
3947
  } else {
3936
- json.anyOf = [inner, { type: "null" }];
3948
+ json2.anyOf = [inner, { type: "null" }];
3937
3949
  }
3938
3950
  };
3939
3951
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
@@ -3942,22 +3954,22 @@ const nonoptionalProcessor = (schema, ctx, _json, params) => {
3942
3954
  const seen = ctx.seen.get(schema);
3943
3955
  seen.ref = def.innerType;
3944
3956
  };
3945
- const defaultProcessor = (schema, ctx, json, params) => {
3957
+ const defaultProcessor = (schema, ctx, json2, params) => {
3946
3958
  const def = schema._zod.def;
3947
3959
  process(def.innerType, ctx, params);
3948
3960
  const seen = ctx.seen.get(schema);
3949
3961
  seen.ref = def.innerType;
3950
- json.default = JSON.parse(JSON.stringify(def.defaultValue));
3962
+ json2.default = JSON.parse(JSON.stringify(def.defaultValue));
3951
3963
  };
3952
- const prefaultProcessor = (schema, ctx, json, params) => {
3964
+ const prefaultProcessor = (schema, ctx, json2, params) => {
3953
3965
  const def = schema._zod.def;
3954
3966
  process(def.innerType, ctx, params);
3955
3967
  const seen = ctx.seen.get(schema);
3956
3968
  seen.ref = def.innerType;
3957
3969
  if (ctx.io === "input")
3958
- json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3970
+ json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3959
3971
  };
3960
- const catchProcessor = (schema, ctx, json, params) => {
3972
+ const catchProcessor = (schema, ctx, json2, params) => {
3961
3973
  const def = schema._zod.def;
3962
3974
  process(def.innerType, ctx, params);
3963
3975
  const seen = ctx.seen.get(schema);
@@ -3968,7 +3980,7 @@ const catchProcessor = (schema, ctx, json, params) => {
3968
3980
  } catch {
3969
3981
  throw new Error("Dynamic catch values are not supported in JSON Schema");
3970
3982
  }
3971
- json.default = catchValue;
3983
+ json2.default = catchValue;
3972
3984
  };
3973
3985
  const pipeProcessor = (schema, ctx, _json, params) => {
3974
3986
  const def = schema._zod.def;
@@ -3977,12 +3989,12 @@ const pipeProcessor = (schema, ctx, _json, params) => {
3977
3989
  const seen = ctx.seen.get(schema);
3978
3990
  seen.ref = innerType;
3979
3991
  };
3980
- const readonlyProcessor = (schema, ctx, json, params) => {
3992
+ const readonlyProcessor = (schema, ctx, json2, params) => {
3981
3993
  const def = schema._zod.def;
3982
3994
  process(def.innerType, ctx, params);
3983
3995
  const seen = ctx.seen.get(schema);
3984
3996
  seen.ref = def.innerType;
3985
- json.readOnly = true;
3997
+ json2.readOnly = true;
3986
3998
  };
3987
3999
  const promiseProcessor = (schema, ctx, _json, params) => {
3988
4000
  const def = schema._zod.def;
@@ -4241,7 +4253,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
4241
4253
  const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
4242
4254
  $ZodString.init(inst, def);
4243
4255
  ZodType.init(inst, def);
4244
- inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json);
4256
+ inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2);
4245
4257
  const bag = inst._zod.bag;
4246
4258
  inst.format = bag.format ?? null;
4247
4259
  inst.minLength = bag.minimum ?? null;
@@ -4382,7 +4394,7 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
4382
4394
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
4383
4395
  $ZodNumber.init(inst, def);
4384
4396
  ZodType.init(inst, def);
4385
- inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json);
4397
+ inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2);
4386
4398
  inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
4387
4399
  inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
4388
4400
  inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
@@ -4418,7 +4430,7 @@ function int(params) {
4418
4430
  const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
4419
4431
  $ZodBoolean.init(inst, def);
4420
4432
  ZodType.init(inst, def);
4421
- inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json);
4433
+ inst._zod.processJSONSchema = (ctx, json2, params) => booleanProcessor(inst, ctx, json2);
4422
4434
  });
4423
4435
  function boolean(params) {
4424
4436
  return /* @__PURE__ */ _boolean(ZodBoolean, params);
@@ -4426,7 +4438,7 @@ function boolean(params) {
4426
4438
  const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
4427
4439
  $ZodNull.init(inst, def);
4428
4440
  ZodType.init(inst, def);
4429
- inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json);
4441
+ inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2);
4430
4442
  });
4431
4443
  function _null(params) {
4432
4444
  return /* @__PURE__ */ _null$1(ZodNull, params);
@@ -4434,7 +4446,7 @@ function _null(params) {
4434
4446
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
4435
4447
  $ZodUnknown.init(inst, def);
4436
4448
  ZodType.init(inst, def);
4437
- inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor();
4449
+ inst._zod.processJSONSchema = (ctx, json2, params) => unknownProcessor();
4438
4450
  });
4439
4451
  function unknown() {
4440
4452
  return /* @__PURE__ */ _unknown(ZodUnknown);
@@ -4442,7 +4454,7 @@ function unknown() {
4442
4454
  const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
4443
4455
  $ZodNever.init(inst, def);
4444
4456
  ZodType.init(inst, def);
4445
- inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json);
4457
+ inst._zod.processJSONSchema = (ctx, json2, params) => neverProcessor(inst, ctx, json2);
4446
4458
  });
4447
4459
  function never(params) {
4448
4460
  return /* @__PURE__ */ _never(ZodNever, params);
@@ -4450,7 +4462,7 @@ function never(params) {
4450
4462
  const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
4451
4463
  $ZodArray.init(inst, def);
4452
4464
  ZodType.init(inst, def);
4453
- inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
4465
+ inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
4454
4466
  inst.element = def.element;
4455
4467
  inst.min = (minLength, params) => inst.check(/* @__PURE__ */ _minLength(minLength, params));
4456
4468
  inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minLength(1, params));
@@ -4464,7 +4476,7 @@ function array(element, params) {
4464
4476
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
4465
4477
  $ZodObjectJIT.init(inst, def);
4466
4478
  ZodType.init(inst, def);
4467
- inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
4479
+ inst._zod.processJSONSchema = (ctx, json2, params) => objectProcessor(inst, ctx, json2, params);
4468
4480
  defineLazy(inst, "shape", () => {
4469
4481
  return def.shape;
4470
4482
  });
@@ -4505,7 +4517,7 @@ function looseObject(shape, params) {
4505
4517
  const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4506
4518
  $ZodUnion.init(inst, def);
4507
4519
  ZodType.init(inst, def);
4508
- inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
4520
+ inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
4509
4521
  inst.options = def.options;
4510
4522
  });
4511
4523
  function union(options, params) {
@@ -4518,7 +4530,7 @@ function union(options, params) {
4518
4530
  const ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
4519
4531
  ZodUnion.init(inst, def);
4520
4532
  $ZodXor.init(inst, def);
4521
- inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
4533
+ inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
4522
4534
  inst.options = def.options;
4523
4535
  });
4524
4536
  function xor(options, params) {
@@ -4544,7 +4556,7 @@ function discriminatedUnion(discriminator, options, params) {
4544
4556
  const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
4545
4557
  $ZodIntersection.init(inst, def);
4546
4558
  ZodType.init(inst, def);
4547
- inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
4559
+ inst._zod.processJSONSchema = (ctx, json2, params) => intersectionProcessor(inst, ctx, json2, params);
4548
4560
  });
4549
4561
  function intersection(left, right) {
4550
4562
  return new ZodIntersection({
@@ -4556,7 +4568,7 @@ function intersection(left, right) {
4556
4568
  const ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
4557
4569
  $ZodTuple.init(inst, def);
4558
4570
  ZodType.init(inst, def);
4559
- inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
4571
+ inst._zod.processJSONSchema = (ctx, json2, params) => tupleProcessor(inst, ctx, json2, params);
4560
4572
  inst.rest = (rest) => inst.clone({
4561
4573
  ...inst._zod.def,
4562
4574
  rest
@@ -4576,7 +4588,7 @@ function tuple(items, _paramsOrRest, _params) {
4576
4588
  const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
4577
4589
  $ZodRecord.init(inst, def);
4578
4590
  ZodType.init(inst, def);
4579
- inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
4591
+ inst._zod.processJSONSchema = (ctx, json2, params) => recordProcessor(inst, ctx, json2, params);
4580
4592
  inst.keyType = def.keyType;
4581
4593
  inst.valueType = def.valueType;
4582
4594
  });
@@ -4591,7 +4603,7 @@ function record(keyType, valueType, params) {
4591
4603
  const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
4592
4604
  $ZodEnum.init(inst, def);
4593
4605
  ZodType.init(inst, def);
4594
- inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json);
4606
+ inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2);
4595
4607
  inst.enum = def.entries;
4596
4608
  inst.options = Object.values(def.entries);
4597
4609
  const keys = new Set(Object.keys(def.entries));
@@ -4637,7 +4649,7 @@ function _enum(values, params) {
4637
4649
  const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
4638
4650
  $ZodLiteral.init(inst, def);
4639
4651
  ZodType.init(inst, def);
4640
- inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json);
4652
+ inst._zod.processJSONSchema = (ctx, json2, params) => literalProcessor(inst, ctx, json2);
4641
4653
  inst.values = new Set(def.values);
4642
4654
  Object.defineProperty(inst, "value", {
4643
4655
  get() {
@@ -4658,7 +4670,7 @@ function literal(value, params) {
4658
4670
  const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
4659
4671
  $ZodTransform.init(inst, def);
4660
4672
  ZodType.init(inst, def);
4661
- inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx);
4673
+ inst._zod.processJSONSchema = (ctx, json2, params) => transformProcessor(inst, ctx);
4662
4674
  inst._zod.parse = (payload, _ctx) => {
4663
4675
  if (_ctx.direction === "backward") {
4664
4676
  throw new $ZodEncodeError(inst.constructor.name);
@@ -4696,7 +4708,7 @@ function transform(fn) {
4696
4708
  const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
4697
4709
  $ZodOptional.init(inst, def);
4698
4710
  ZodType.init(inst, def);
4699
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4711
+ inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
4700
4712
  inst.unwrap = () => inst._zod.def.innerType;
4701
4713
  });
4702
4714
  function optional(innerType) {
@@ -4708,7 +4720,7 @@ function optional(innerType) {
4708
4720
  const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
4709
4721
  $ZodExactOptional.init(inst, def);
4710
4722
  ZodType.init(inst, def);
4711
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4723
+ inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
4712
4724
  inst.unwrap = () => inst._zod.def.innerType;
4713
4725
  });
4714
4726
  function exactOptional(innerType) {
@@ -4720,7 +4732,7 @@ function exactOptional(innerType) {
4720
4732
  const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
4721
4733
  $ZodNullable.init(inst, def);
4722
4734
  ZodType.init(inst, def);
4723
- inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
4735
+ inst._zod.processJSONSchema = (ctx, json2, params) => nullableProcessor(inst, ctx, json2, params);
4724
4736
  inst.unwrap = () => inst._zod.def.innerType;
4725
4737
  });
4726
4738
  function nullable(innerType) {
@@ -4732,7 +4744,7 @@ function nullable(innerType) {
4732
4744
  const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
4733
4745
  $ZodDefault.init(inst, def);
4734
4746
  ZodType.init(inst, def);
4735
- inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
4747
+ inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params);
4736
4748
  inst.unwrap = () => inst._zod.def.innerType;
4737
4749
  inst.removeDefault = inst.unwrap;
4738
4750
  });
@@ -4748,7 +4760,7 @@ function _default(innerType, defaultValue) {
4748
4760
  const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
4749
4761
  $ZodPrefault.init(inst, def);
4750
4762
  ZodType.init(inst, def);
4751
- inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
4763
+ inst._zod.processJSONSchema = (ctx, json2, params) => prefaultProcessor(inst, ctx, json2, params);
4752
4764
  inst.unwrap = () => inst._zod.def.innerType;
4753
4765
  });
4754
4766
  function prefault(innerType, defaultValue) {
@@ -4763,7 +4775,7 @@ function prefault(innerType, defaultValue) {
4763
4775
  const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
4764
4776
  $ZodNonOptional.init(inst, def);
4765
4777
  ZodType.init(inst, def);
4766
- inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
4778
+ inst._zod.processJSONSchema = (ctx, json2, params) => nonoptionalProcessor(inst, ctx, json2, params);
4767
4779
  inst.unwrap = () => inst._zod.def.innerType;
4768
4780
  });
4769
4781
  function nonoptional(innerType, params) {
@@ -4776,7 +4788,7 @@ function nonoptional(innerType, params) {
4776
4788
  const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
4777
4789
  $ZodCatch.init(inst, def);
4778
4790
  ZodType.init(inst, def);
4779
- inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
4791
+ inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params);
4780
4792
  inst.unwrap = () => inst._zod.def.innerType;
4781
4793
  inst.removeCatch = inst.unwrap;
4782
4794
  });
@@ -4790,7 +4802,7 @@ function _catch(innerType, catchValue) {
4790
4802
  const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
4791
4803
  $ZodPipe.init(inst, def);
4792
4804
  ZodType.init(inst, def);
4793
- inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
4805
+ inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params);
4794
4806
  inst.in = def.in;
4795
4807
  inst.out = def.out;
4796
4808
  });
@@ -4805,7 +4817,7 @@ function pipe(in_, out) {
4805
4817
  const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
4806
4818
  $ZodReadonly.init(inst, def);
4807
4819
  ZodType.init(inst, def);
4808
- inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
4820
+ inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params);
4809
4821
  inst.unwrap = () => inst._zod.def.innerType;
4810
4822
  });
4811
4823
  function readonly(innerType) {
@@ -4814,10 +4826,22 @@ function readonly(innerType) {
4814
4826
  innerType
4815
4827
  });
4816
4828
  }
4829
+ const ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
4830
+ $ZodLazy.init(inst, def);
4831
+ ZodType.init(inst, def);
4832
+ inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params);
4833
+ inst.unwrap = () => inst._zod.def.getter();
4834
+ });
4835
+ function lazy(getter) {
4836
+ return new ZodLazy({
4837
+ type: "lazy",
4838
+ getter
4839
+ });
4840
+ }
4817
4841
  const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
4818
4842
  $ZodCustom.init(inst, def);
4819
4843
  ZodType.init(inst, def);
4820
- inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx);
4844
+ inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx);
4821
4845
  });
4822
4846
  function custom(fn, _params) {
4823
4847
  return /* @__PURE__ */ _custom(ZodCustom, fn ?? (() => true), _params);
@@ -4850,48 +4874,64 @@ function _instanceof(cls, params = {}) {
4850
4874
  };
4851
4875
  return inst;
4852
4876
  }
4877
+ function json(params) {
4878
+ const jsonSchema = lazy(() => {
4879
+ return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
4880
+ });
4881
+ return jsonSchema;
4882
+ }
4853
4883
  function preprocess(fn, schema) {
4854
4884
  return pipe(transform(fn), schema);
4855
4885
  }
4856
4886
  export {
4857
4887
  $constructor as $,
4858
- optional as A,
4859
- datetime as B,
4860
- custom as C,
4861
- toJSONSchema as D,
4862
- ZodOptional as E,
4863
- never as F,
4864
- xor as G,
4865
- int as H,
4866
- url as I,
4867
- tuple as J,
4868
- NEVER as N,
4888
+ normalizeParams as A,
4889
+ $ZodObject as B,
4890
+ defineLazy as C,
4891
+ $ZodType as D,
4892
+ parse$1 as E,
4893
+ safeParse$1 as F,
4894
+ parseAsync$1 as G,
4895
+ safeParseAsync$1 as H,
4896
+ clone as I,
4897
+ looseObject as J,
4898
+ intersection as K,
4899
+ optional as L,
4900
+ datetime as M,
4901
+ custom as N,
4902
+ toJSONSchema as O,
4903
+ never as P,
4904
+ xor as Q,
4905
+ NEVER as R,
4906
+ int as S,
4907
+ url as T,
4908
+ tuple as U,
4869
4909
  ZodNumber as Z,
4870
4910
  _coercedNumber as _,
4871
4911
  _enum as a,
4872
4912
  boolean as b,
4873
4913
  array as c,
4874
4914
  discriminatedUnion as d,
4875
- _instanceof as e,
4876
- union as f,
4877
- ZodError as g,
4878
- _null as h,
4879
- normalizeParams as i,
4880
- $ZodObject as j,
4881
- defineLazy as k,
4915
+ union as e,
4916
+ ZodObject as f,
4917
+ ZodLiteral as g,
4918
+ ZodError as h,
4919
+ safeParse as i,
4920
+ json as j,
4921
+ ZodOptional as k,
4882
4922
  literal as l,
4883
- $ZodType as m,
4923
+ ZodNullable as m,
4884
4924
  number as n,
4885
4925
  object as o,
4886
4926
  preprocess as p,
4887
- parse$1 as q,
4927
+ ZodPipe as q,
4888
4928
  record as r,
4889
4929
  string as s,
4890
- safeParse$1 as t,
4930
+ ZodUnion as t,
4891
4931
  unknown as u,
4892
- parseAsync$1 as v,
4893
- safeParseAsync$1 as w,
4894
- clone as x,
4895
- looseObject as y,
4896
- intersection as z
4932
+ ZodArray as v,
4933
+ ZodNever as w,
4934
+ ZodDiscriminatedUnion as x,
4935
+ _instanceof as y,
4936
+ _null as z
4897
4937
  };