@aws/nx-plugin-mcp 1.0.0-rc.90 → 1.0.0-rc.92
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.
- package/bin/aws-nx-mcp.js +2161 -1045
- package/docs/get_started/tutorials/dungeon-game/1.mdx +12 -8
- package/docs/get_started/tutorials/dungeon-game/overview.mdx +1 -1
- package/docs/guides/docker-bundling.mdx +11 -10
- package/docs/guides/py-agent.mdx +20 -8
- package/docs/guides/py-mcp-server.mdx +11 -3
- package/docs/guides/react-website-auth.mdx +1 -1
- package/docs/guides/ts-agent.mdx +23 -9
- package/docs/guides/ts-mcp-server.mdx +13 -3
- package/docs/snippets/agent/bedrock-deployment.mdx +36 -11
- package/docs/snippets/agentcore-hosting.mdx +9 -0
- package/docs/snippets/api/cors-configuration-cdk-note.mdx +2 -2
- package/docs/snippets/api/cors-configuration-terraform-note.mdx +1 -1
- package/docs/snippets/mcp/bedrock-deployment.mdx +26 -9
- package/docs/snippets/mcp/shared-constructs.mdx +4 -0
- package/docs/snippets/rdb/deploying.mdx +9 -1
- package/package.json +1 -1
- package/src/py/agent/schema.json +2 -2
- package/src/py/mcp-server/schema.json +2 -2
- package/src/ts/agent/schema.json +2 -2
- package/src/ts/mcp-server/schema.json +2 -2
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -49,7 +49,7 @@ fs = __toESM(fs, 1);
|
|
|
49
49
|
let node_path = require("node:path");
|
|
50
50
|
node_path = __toESM(node_path, 1);
|
|
51
51
|
let node_url = require("node:url");
|
|
52
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
52
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/util.js
|
|
53
53
|
var util;
|
|
54
54
|
(function(util) {
|
|
55
55
|
util.assertEqual = (_) => {};
|
|
@@ -145,7 +145,7 @@ const getParsedType = (data) => {
|
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
//#endregion
|
|
148
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
148
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/ZodError.js
|
|
149
149
|
const ZodIssueCode = util.arrayToEnum([
|
|
150
150
|
"invalid_type",
|
|
151
151
|
"invalid_literal",
|
|
@@ -198,12 +198,23 @@ var ZodError = class ZodError extends Error {
|
|
|
198
198
|
let i = 0;
|
|
199
199
|
while (i < issue.path.length) {
|
|
200
200
|
const el = issue.path[i];
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
const terminal = i === issue.path.length - 1;
|
|
202
|
+
if (el === "_errors") {
|
|
203
|
+
if (terminal) curr._errors.push(mapper(issue));
|
|
204
|
+
i++;
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (!Object.prototype.hasOwnProperty.call(curr, el)) {
|
|
208
|
+
if (el === "__proto__") Object.defineProperty(curr, el, {
|
|
209
|
+
value: { _errors: [] },
|
|
210
|
+
writable: true,
|
|
211
|
+
enumerable: true,
|
|
212
|
+
configurable: true
|
|
213
|
+
});
|
|
214
|
+
else curr[el] = { _errors: [] };
|
|
205
215
|
}
|
|
206
216
|
curr = curr[el];
|
|
217
|
+
if (terminal) curr._errors.push(mapper(issue));
|
|
207
218
|
i++;
|
|
208
219
|
}
|
|
209
220
|
}
|
|
@@ -244,7 +255,7 @@ ZodError.create = (issues) => {
|
|
|
244
255
|
return new ZodError(issues);
|
|
245
256
|
};
|
|
246
257
|
//#endregion
|
|
247
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
258
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/locales/en.js
|
|
248
259
|
const errorMap = (issue, _ctx) => {
|
|
249
260
|
let message;
|
|
250
261
|
switch (issue.code) {
|
|
@@ -322,13 +333,13 @@ const errorMap = (issue, _ctx) => {
|
|
|
322
333
|
return { message };
|
|
323
334
|
};
|
|
324
335
|
//#endregion
|
|
325
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
336
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/errors.js
|
|
326
337
|
let overrideErrorMap = errorMap;
|
|
327
338
|
function getErrorMap() {
|
|
328
339
|
return overrideErrorMap;
|
|
329
340
|
}
|
|
330
341
|
//#endregion
|
|
331
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
342
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/parseUtil.js
|
|
332
343
|
const makeIssue = (params) => {
|
|
333
344
|
const { data, path, errorMaps, issueData } = params;
|
|
334
345
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -432,14 +443,14 @@ const isDirty = (x) => x.status === "dirty";
|
|
|
432
443
|
const isValid = (x) => x.status === "valid";
|
|
433
444
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
434
445
|
//#endregion
|
|
435
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
446
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/errorUtil.js
|
|
436
447
|
var errorUtil;
|
|
437
448
|
(function(errorUtil) {
|
|
438
449
|
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
439
450
|
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
440
451
|
})(errorUtil || (errorUtil = {}));
|
|
441
452
|
//#endregion
|
|
442
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
453
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/types.js
|
|
443
454
|
var ParseInputLazyPath = class {
|
|
444
455
|
constructor(parent, value, path, key) {
|
|
445
456
|
this._cachedPath = [];
|
|
@@ -780,7 +791,7 @@ const nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
|
780
791
|
const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
781
792
|
const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
782
793
|
const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
783
|
-
const _emojiRegex = `^
|
|
794
|
+
const _emojiRegex = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
784
795
|
let emojiRegex$1;
|
|
785
796
|
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
786
797
|
const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
|
|
@@ -2566,7 +2577,9 @@ function mergeValues$1(a, b) {
|
|
|
2566
2577
|
...a,
|
|
2567
2578
|
...b
|
|
2568
2579
|
};
|
|
2580
|
+
if (Object.prototype.hasOwnProperty.call(newObj, "__proto__")) delete newObj.__proto__;
|
|
2569
2581
|
for (const key of sharedKeys) {
|
|
2582
|
+
if (key === "__proto__") continue;
|
|
2570
2583
|
const sharedValue = mergeValues$1(a[key], b[key]);
|
|
2571
2584
|
if (!sharedValue.valid) return { valid: false };
|
|
2572
2585
|
newObj[key] = sharedValue.data;
|
|
@@ -3598,70 +3611,14 @@ ZodNullable$1.create;
|
|
|
3598
3611
|
ZodEffects.createWithPreprocess;
|
|
3599
3612
|
ZodPipeline.create;
|
|
3600
3613
|
//#endregion
|
|
3601
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
3602
|
-
var _a$1;
|
|
3603
|
-
function $constructor(name, initializer, params) {
|
|
3604
|
-
function init(inst, def) {
|
|
3605
|
-
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
3606
|
-
value: {
|
|
3607
|
-
def,
|
|
3608
|
-
constr: _,
|
|
3609
|
-
traits: /* @__PURE__ */ new Set()
|
|
3610
|
-
},
|
|
3611
|
-
enumerable: false
|
|
3612
|
-
});
|
|
3613
|
-
if (inst._zod.traits.has(name)) return;
|
|
3614
|
-
inst._zod.traits.add(name);
|
|
3615
|
-
initializer(inst, def);
|
|
3616
|
-
const proto = _.prototype;
|
|
3617
|
-
const keys = Object.keys(proto);
|
|
3618
|
-
for (let i = 0; i < keys.length; i++) {
|
|
3619
|
-
const k = keys[i];
|
|
3620
|
-
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
3621
|
-
}
|
|
3622
|
-
}
|
|
3623
|
-
const Parent = params?.Parent ?? Object;
|
|
3624
|
-
class Definition extends Parent {}
|
|
3625
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
3626
|
-
function _(def) {
|
|
3627
|
-
var _a;
|
|
3628
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
3629
|
-
init(inst, def);
|
|
3630
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
3631
|
-
for (const fn of inst._zod.deferred) fn();
|
|
3632
|
-
return inst;
|
|
3633
|
-
}
|
|
3634
|
-
Object.defineProperty(_, "init", { value: init });
|
|
3635
|
-
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
3636
|
-
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
3637
|
-
return inst?._zod?.traits?.has(name);
|
|
3638
|
-
} });
|
|
3639
|
-
Object.defineProperty(_, "name", { value: name });
|
|
3640
|
-
return _;
|
|
3641
|
-
}
|
|
3642
|
-
var $ZodAsyncError = class extends Error {
|
|
3643
|
-
constructor() {
|
|
3644
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
3645
|
-
}
|
|
3646
|
-
};
|
|
3647
|
-
var $ZodEncodeError = class extends Error {
|
|
3648
|
-
constructor(name) {
|
|
3649
|
-
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
3650
|
-
this.name = "ZodEncodeError";
|
|
3651
|
-
}
|
|
3652
|
-
};
|
|
3653
|
-
(_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
|
|
3654
|
-
const globalConfig = globalThis.__zod_globalConfig;
|
|
3655
|
-
function config(newConfig) {
|
|
3656
|
-
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
3657
|
-
return globalConfig;
|
|
3658
|
-
}
|
|
3659
|
-
//#endregion
|
|
3660
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
3614
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/util.js
|
|
3661
3615
|
function getEnumValues(entries) {
|
|
3662
3616
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
3663
3617
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
3664
3618
|
}
|
|
3619
|
+
function joinValues(array, separator = "|") {
|
|
3620
|
+
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
3621
|
+
}
|
|
3665
3622
|
function jsonStringifyReplacer(_, value) {
|
|
3666
3623
|
if (typeof value === "bigint") return value.toString();
|
|
3667
3624
|
return value;
|
|
@@ -3686,28 +3643,10 @@ function cleanRegex(source) {
|
|
|
3686
3643
|
function floatSafeRemainder(val, step) {
|
|
3687
3644
|
const ratio = val / step;
|
|
3688
3645
|
const roundedRatio = Math.round(ratio);
|
|
3689
|
-
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
3646
|
+
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
3690
3647
|
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
3691
3648
|
return ratio - roundedRatio;
|
|
3692
3649
|
}
|
|
3693
|
-
const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
|
|
3694
|
-
function defineLazy(object, key, getter) {
|
|
3695
|
-
let value = void 0;
|
|
3696
|
-
Object.defineProperty(object, key, {
|
|
3697
|
-
get() {
|
|
3698
|
-
if (value === EVALUATING) return;
|
|
3699
|
-
if (value === void 0) {
|
|
3700
|
-
value = EVALUATING;
|
|
3701
|
-
value = getter();
|
|
3702
|
-
}
|
|
3703
|
-
return value;
|
|
3704
|
-
},
|
|
3705
|
-
set(v) {
|
|
3706
|
-
Object.defineProperty(object, key, { value: v });
|
|
3707
|
-
},
|
|
3708
|
-
configurable: true
|
|
3709
|
-
});
|
|
3710
|
-
}
|
|
3711
3650
|
function assignProp(target, prop, value) {
|
|
3712
3651
|
Object.defineProperty(target, prop, {
|
|
3713
3652
|
value,
|
|
@@ -3789,18 +3728,23 @@ function normalizeParams(_params) {
|
|
|
3789
3728
|
};
|
|
3790
3729
|
return params;
|
|
3791
3730
|
}
|
|
3731
|
+
function stringifyPrimitive(value) {
|
|
3732
|
+
if (typeof value === "bigint") return value.toString() + "n";
|
|
3733
|
+
if (typeof value === "string") return `"${value}"`;
|
|
3734
|
+
return `${value}`;
|
|
3735
|
+
}
|
|
3792
3736
|
function optionalKeys(shape) {
|
|
3793
3737
|
return Object.keys(shape).filter((k) => {
|
|
3794
|
-
return shape[k]._zod.optin
|
|
3738
|
+
return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
|
|
3795
3739
|
});
|
|
3796
3740
|
}
|
|
3797
|
-
const NUMBER_FORMAT_RANGES = {
|
|
3741
|
+
const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
|
|
3798
3742
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
3799
3743
|
int32: [-2147483648, 2147483647],
|
|
3800
3744
|
uint32: [0, 4294967295],
|
|
3801
3745
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
3802
3746
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
3803
|
-
};
|
|
3747
|
+
}))();
|
|
3804
3748
|
function pick$2(schema, mask) {
|
|
3805
3749
|
const currDef = schema._zod.def;
|
|
3806
3750
|
const checks = currDef.checks;
|
|
@@ -3808,10 +3752,10 @@ function pick$2(schema, mask) {
|
|
|
3808
3752
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
3809
3753
|
get shape() {
|
|
3810
3754
|
const newShape = {};
|
|
3811
|
-
for (const key
|
|
3812
|
-
if (!(
|
|
3755
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
3756
|
+
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
3813
3757
|
if (!mask[key]) continue;
|
|
3814
|
-
newShape
|
|
3758
|
+
assignProp(newShape, key, currDef.shape[key]);
|
|
3815
3759
|
}
|
|
3816
3760
|
assignProp(this, "shape", newShape);
|
|
3817
3761
|
return newShape;
|
|
@@ -3826,8 +3770,8 @@ function omit(schema, mask) {
|
|
|
3826
3770
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
3827
3771
|
get shape() {
|
|
3828
3772
|
const newShape = { ...schema._zod.def.shape };
|
|
3829
|
-
for (const key
|
|
3830
|
-
if (!(
|
|
3773
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
3774
|
+
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
3831
3775
|
if (!mask[key]) continue;
|
|
3832
3776
|
delete newShape[key];
|
|
3833
3777
|
}
|
|
@@ -3842,7 +3786,7 @@ function extend$1(schema, shape) {
|
|
|
3842
3786
|
const checks = schema._zod.def.checks;
|
|
3843
3787
|
if (checks && checks.length > 0) {
|
|
3844
3788
|
const existingShape = schema._zod.def.shape;
|
|
3845
|
-
for (const key
|
|
3789
|
+
for (const key of Reflect.ownKeys(shape)) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
3846
3790
|
}
|
|
3847
3791
|
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
3848
3792
|
const _shape = {
|
|
@@ -3865,6 +3809,7 @@ function safeExtend(schema, shape) {
|
|
|
3865
3809
|
} }));
|
|
3866
3810
|
}
|
|
3867
3811
|
function merge$1(a, b) {
|
|
3812
|
+
if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
3868
3813
|
if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
3869
3814
|
return clone(a, mergeDefs(a._zod.def, {
|
|
3870
3815
|
get shape() {
|
|
@@ -3881,22 +3826,22 @@ function merge$1(a, b) {
|
|
|
3881
3826
|
checks: b._zod.def.checks ?? []
|
|
3882
3827
|
}));
|
|
3883
3828
|
}
|
|
3884
|
-
function partial(Class, schema, mask) {
|
|
3829
|
+
function partial(Class, schema, mask, name = "partial") {
|
|
3885
3830
|
const checks = schema._zod.def.checks;
|
|
3886
|
-
if (checks && checks.length > 0) throw new Error(
|
|
3831
|
+
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
3887
3832
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
3888
3833
|
get shape() {
|
|
3889
3834
|
const oldShape = schema._zod.def.shape;
|
|
3890
3835
|
const shape = { ...oldShape };
|
|
3891
|
-
if (mask) for (const key
|
|
3892
|
-
if (!(key
|
|
3836
|
+
if (mask) for (const key of Reflect.ownKeys(mask)) {
|
|
3837
|
+
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
3893
3838
|
if (!mask[key]) continue;
|
|
3894
3839
|
shape[key] = Class ? new Class({
|
|
3895
3840
|
type: "optional",
|
|
3896
3841
|
innerType: oldShape[key]
|
|
3897
3842
|
}) : oldShape[key];
|
|
3898
3843
|
}
|
|
3899
|
-
else for (const key
|
|
3844
|
+
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = Class ? new Class({
|
|
3900
3845
|
type: "optional",
|
|
3901
3846
|
innerType: oldShape[key]
|
|
3902
3847
|
}) : oldShape[key];
|
|
@@ -3910,15 +3855,15 @@ function required(Class, schema, mask) {
|
|
|
3910
3855
|
return clone(schema, mergeDefs(schema._zod.def, { get shape() {
|
|
3911
3856
|
const oldShape = schema._zod.def.shape;
|
|
3912
3857
|
const shape = { ...oldShape };
|
|
3913
|
-
if (mask) for (const key
|
|
3914
|
-
if (!(key
|
|
3858
|
+
if (mask) for (const key of Reflect.ownKeys(mask)) {
|
|
3859
|
+
if (!Object.prototype.hasOwnProperty.call(shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
3915
3860
|
if (!mask[key]) continue;
|
|
3916
3861
|
shape[key] = new Class({
|
|
3917
3862
|
type: "nonoptional",
|
|
3918
3863
|
innerType: oldShape[key]
|
|
3919
3864
|
});
|
|
3920
3865
|
}
|
|
3921
|
-
else for (const key
|
|
3866
|
+
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = new Class({
|
|
3922
3867
|
type: "nonoptional",
|
|
3923
3868
|
innerType: oldShape[key]
|
|
3924
3869
|
});
|
|
@@ -3947,19 +3892,54 @@ function prefixIssues(path, issues) {
|
|
|
3947
3892
|
function unwrapMessage(message) {
|
|
3948
3893
|
return typeof message === "string" ? message : message?.message;
|
|
3949
3894
|
}
|
|
3895
|
+
function attachSchema(issues, start, inst) {
|
|
3896
|
+
var _a;
|
|
3897
|
+
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
3898
|
+
}
|
|
3950
3899
|
function finalizeIssue(iss, ctx, config) {
|
|
3951
|
-
|
|
3952
|
-
const
|
|
3900
|
+
var _a;
|
|
3901
|
+
const traits = iss.inst?._zod?.traits;
|
|
3902
|
+
if (traits?.has("$ZodType")) {
|
|
3903
|
+
if (traits.has("$ZodCheck")) (_a = iss).schema ?? (_a.schema = iss.inst);
|
|
3904
|
+
else iss.schema = iss.inst;
|
|
3905
|
+
}
|
|
3906
|
+
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
3907
|
+
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
3908
|
+
const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
|
|
3953
3909
|
rest.path ?? (rest.path = []);
|
|
3954
3910
|
rest.message = message;
|
|
3955
3911
|
if (ctx?.reportInput) rest.input = _input;
|
|
3956
3912
|
return rest;
|
|
3957
3913
|
}
|
|
3914
|
+
const highSurrogate = /[\uD800-\uDBFF]/;
|
|
3915
|
+
function codePointLength(str) {
|
|
3916
|
+
const units = str.length;
|
|
3917
|
+
if (!highSurrogate.test(str)) return units;
|
|
3918
|
+
let count = units;
|
|
3919
|
+
for (let i = 0; i < units - 1; i++) if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
3920
|
+
count--;
|
|
3921
|
+
i++;
|
|
3922
|
+
}
|
|
3923
|
+
return count;
|
|
3924
|
+
}
|
|
3958
3925
|
function getLengthableOrigin(input) {
|
|
3959
3926
|
if (Array.isArray(input)) return "array";
|
|
3960
3927
|
if (typeof input === "string") return "string";
|
|
3961
3928
|
return "unknown";
|
|
3962
3929
|
}
|
|
3930
|
+
function parsedType(data) {
|
|
3931
|
+
const t = typeof data;
|
|
3932
|
+
switch (t) {
|
|
3933
|
+
case "number": return Number.isNaN(data) ? "nan" : "number";
|
|
3934
|
+
case "object": {
|
|
3935
|
+
if (data === null) return "null";
|
|
3936
|
+
if (Array.isArray(data)) return "array";
|
|
3937
|
+
const obj = data;
|
|
3938
|
+
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) return obj.constructor.name;
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
return t;
|
|
3942
|
+
}
|
|
3963
3943
|
function issue(...args) {
|
|
3964
3944
|
const [iss, input, inst] = args;
|
|
3965
3945
|
if (typeof iss === "string") return {
|
|
@@ -3970,33 +3950,330 @@ function issue(...args) {
|
|
|
3970
3950
|
};
|
|
3971
3951
|
return { ...iss };
|
|
3972
3952
|
}
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3953
|
+
/**
|
|
3954
|
+
* Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
|
|
3955
|
+
*
|
|
3956
|
+
* Call this from a `proto` initializer, which runs once per prototype — never per instance.
|
|
3957
|
+
*/
|
|
3958
|
+
function members(proto, table) {
|
|
3959
|
+
for (const key in table) {
|
|
3960
|
+
const desc = Object.getOwnPropertyDescriptor(table, key);
|
|
3961
|
+
if (desc.get) Object.defineProperty(proto, key, {
|
|
3962
|
+
...desc,
|
|
3963
|
+
enumerable: false
|
|
3964
|
+
});
|
|
3965
|
+
else defineBound(proto, key, desc.value);
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
|
|
3969
|
+
function own$7(inst, key, value, enumerable = true) {
|
|
3970
|
+
Object.defineProperty(inst, key, {
|
|
3971
|
+
configurable: true,
|
|
3972
|
+
writable: true,
|
|
3973
|
+
enumerable,
|
|
3974
|
+
value
|
|
3975
|
+
});
|
|
3976
|
+
return value;
|
|
3977
|
+
}
|
|
3978
|
+
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
|
|
3979
|
+
function hide(inst, key, value) {
|
|
3980
|
+
return own$7(inst, key, value, false);
|
|
3981
|
+
}
|
|
3982
|
+
function defineBound(proto, key, fn) {
|
|
3983
|
+
Object.defineProperty(proto, key, {
|
|
3984
|
+
configurable: true,
|
|
3985
|
+
get() {
|
|
3986
|
+
return this == null ? fn : own$7(this, key, fn.bind(this));
|
|
3987
|
+
},
|
|
3988
|
+
set(value) {
|
|
3989
|
+
own$7(this, key, value);
|
|
3990
|
+
}
|
|
3980
3991
|
});
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3992
|
+
}
|
|
3993
|
+
/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
|
|
3994
|
+
function claim(inst, sentinel) {
|
|
3995
|
+
const proto = Object.getPrototypeOf(inst);
|
|
3996
|
+
return sentinel in proto ? void 0 : proto;
|
|
3997
|
+
}
|
|
3998
|
+
let installing;
|
|
3999
|
+
let broke = false;
|
|
4000
|
+
const breaker = {
|
|
4001
|
+
configurable: true,
|
|
4002
|
+
get() {
|
|
4003
|
+
broke = true;
|
|
4004
|
+
}
|
|
4005
|
+
};
|
|
4006
|
+
/**
|
|
4007
|
+
* Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
|
|
4008
|
+
* constructor, computed from the internals object itself and cached there on
|
|
4009
|
+
* first read. One accessor per constructor rather than one per instance.
|
|
4010
|
+
*/
|
|
4011
|
+
function defineLazyInternal(inst, key, compute) {
|
|
4012
|
+
const proto = Object.getPrototypeOf(inst._zod);
|
|
4013
|
+
if (key in proto && installing !== inst._zod) {
|
|
4014
|
+
installing = void 0;
|
|
4015
|
+
return;
|
|
4016
|
+
}
|
|
4017
|
+
installing = inst._zod;
|
|
4018
|
+
Object.defineProperty(proto, key, {
|
|
4019
|
+
configurable: true,
|
|
4020
|
+
get() {
|
|
4021
|
+
Object.defineProperty(this, key, breaker);
|
|
4022
|
+
const outer = broke;
|
|
4023
|
+
broke = false;
|
|
4024
|
+
try {
|
|
4025
|
+
const value = compute(this);
|
|
4026
|
+
if (broke) delete this[key];
|
|
4027
|
+
else Object.defineProperty(this, key, {
|
|
4028
|
+
configurable: true,
|
|
4029
|
+
writable: true,
|
|
4030
|
+
value
|
|
4031
|
+
});
|
|
4032
|
+
broke = broke || outer;
|
|
4033
|
+
return value;
|
|
4034
|
+
} catch (err) {
|
|
4035
|
+
delete this[key];
|
|
4036
|
+
broke = broke || outer;
|
|
4037
|
+
throw err;
|
|
4038
|
+
}
|
|
4039
|
+
},
|
|
4040
|
+
set(value) {
|
|
4041
|
+
Object.defineProperty(this, key, {
|
|
4042
|
+
configurable: true,
|
|
4043
|
+
writable: true,
|
|
4044
|
+
value
|
|
4045
|
+
});
|
|
4046
|
+
}
|
|
3984
4047
|
});
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
4048
|
+
}
|
|
4049
|
+
/**
|
|
4050
|
+
* Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
|
|
4051
|
+
* data property. One accessor per constructor rather than one per instance, because an own accessor
|
|
4052
|
+
* puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
|
|
4053
|
+
*/
|
|
4054
|
+
function installLazyProp(inst, key, make, enumerable) {
|
|
4055
|
+
const proto = claim(inst, key);
|
|
4056
|
+
if (!proto) return;
|
|
4057
|
+
Object.defineProperty(proto, key, {
|
|
4058
|
+
configurable: true,
|
|
4059
|
+
get() {
|
|
4060
|
+
const desc = {
|
|
4061
|
+
configurable: true,
|
|
4062
|
+
writable: true,
|
|
4063
|
+
enumerable,
|
|
4064
|
+
value: void 0
|
|
4065
|
+
};
|
|
4066
|
+
Object.defineProperty(this, key, desc);
|
|
4067
|
+
desc.value = make(this);
|
|
4068
|
+
Object.defineProperty(this, key, desc);
|
|
4069
|
+
return desc.value;
|
|
4070
|
+
},
|
|
4071
|
+
set(value) {
|
|
4072
|
+
Object.defineProperty(this, key, {
|
|
4073
|
+
configurable: true,
|
|
4074
|
+
writable: true,
|
|
4075
|
+
enumerable,
|
|
4076
|
+
value
|
|
4077
|
+
});
|
|
4078
|
+
}
|
|
3989
4079
|
});
|
|
4080
|
+
}
|
|
4081
|
+
/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
|
|
4082
|
+
const CONSTANT_CATCH = "~constantCatch";
|
|
4083
|
+
/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
|
|
4084
|
+
function constantCatch(value) {
|
|
4085
|
+
const fn = () => value;
|
|
4086
|
+
fn[CONSTANT_CATCH] = true;
|
|
4087
|
+
return fn;
|
|
4088
|
+
}
|
|
4089
|
+
//#endregion
|
|
4090
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/core.js
|
|
4091
|
+
var _a$1;
|
|
4092
|
+
const _zodDesc$1 = {
|
|
4093
|
+
value: void 0,
|
|
4094
|
+
enumerable: false
|
|
4095
|
+
};
|
|
4096
|
+
let _E = "captureStackTrace" in Error ? Error : null;
|
|
4097
|
+
function newError(Definition) {
|
|
4098
|
+
const E = _E;
|
|
4099
|
+
if (E) {
|
|
4100
|
+
const saved = E.stackTraceLimit;
|
|
4101
|
+
if (typeof saved === "number") {
|
|
4102
|
+
try {
|
|
4103
|
+
E.stackTraceLimit = 0;
|
|
4104
|
+
} catch {
|
|
4105
|
+
_E = null;
|
|
4106
|
+
return new Definition();
|
|
4107
|
+
}
|
|
4108
|
+
try {
|
|
4109
|
+
return new Definition();
|
|
4110
|
+
} finally {
|
|
4111
|
+
E.stackTraceLimit = saved;
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
4115
|
+
return new Definition();
|
|
4116
|
+
}
|
|
4117
|
+
function $constructor(name, initializer, proto, params) {
|
|
4118
|
+
const zodProto = {};
|
|
4119
|
+
function Internals(def) {
|
|
4120
|
+
this.def = def;
|
|
4121
|
+
this.constr = _;
|
|
4122
|
+
this.traits = /* @__PURE__ */ new Set();
|
|
4123
|
+
}
|
|
4124
|
+
Internals.prototype = zodProto;
|
|
4125
|
+
const protoMembers = proto;
|
|
4126
|
+
const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
|
|
4127
|
+
function init(inst, def) {
|
|
4128
|
+
if (!inst._zod) {
|
|
4129
|
+
_zodDesc$1.value = new Internals(def);
|
|
4130
|
+
try {
|
|
4131
|
+
Object.defineProperty(inst, "_zod", _zodDesc$1);
|
|
4132
|
+
} finally {
|
|
4133
|
+
_zodDesc$1.value = void 0;
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
if (inst._zod.traits.has(name)) return;
|
|
4137
|
+
inst._zod.traits.add(name);
|
|
4138
|
+
initializer(inst, def);
|
|
4139
|
+
if (initialized) {
|
|
4140
|
+
const own = Object.getPrototypeOf(inst);
|
|
4141
|
+
const ctorProto = inst._zod.constr.prototype;
|
|
4142
|
+
let up = own;
|
|
4143
|
+
while (up && up !== ctorProto) up = Object.getPrototypeOf(up);
|
|
4144
|
+
const target = up ?? own;
|
|
4145
|
+
if (!initialized.has(target)) {
|
|
4146
|
+
initialized.add(target);
|
|
4147
|
+
members(target, protoMembers);
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
const proto = _.prototype;
|
|
4151
|
+
for (const k in proto) {
|
|
4152
|
+
if (!Object.prototype.hasOwnProperty.call(proto, k)) continue;
|
|
4153
|
+
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
const Parent = params?.Parent ?? Object;
|
|
4157
|
+
class Definition extends Parent {}
|
|
4158
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
4159
|
+
function _(def) {
|
|
4160
|
+
const inst = params?.Parent ? newError(Definition) : this;
|
|
4161
|
+
init(inst, def);
|
|
4162
|
+
const deferred = inst._zod.deferred;
|
|
4163
|
+
if (deferred) {
|
|
4164
|
+
for (const fn of deferred) fn();
|
|
4165
|
+
inst._zod.deferred = void 0;
|
|
4166
|
+
}
|
|
4167
|
+
const pp = globalThis.__zod_globalConfig?.postProcessor;
|
|
4168
|
+
if (pp) pp(inst);
|
|
4169
|
+
return inst;
|
|
4170
|
+
}
|
|
4171
|
+
Object.defineProperty(_, "init", { value: init });
|
|
4172
|
+
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
4173
|
+
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
4174
|
+
return inst?._zod?.traits?.has(name);
|
|
4175
|
+
} });
|
|
4176
|
+
Object.defineProperty(_, "name", { value: name });
|
|
4177
|
+
return _;
|
|
4178
|
+
}
|
|
4179
|
+
var $ZodAsyncError = class extends Error {
|
|
4180
|
+
constructor() {
|
|
4181
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
4182
|
+
}
|
|
4183
|
+
};
|
|
4184
|
+
var $ZodEncodeError = class extends Error {
|
|
4185
|
+
constructor(name) {
|
|
4186
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
4187
|
+
this.name = "ZodEncodeError";
|
|
4188
|
+
}
|
|
4189
|
+
};
|
|
4190
|
+
(_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
|
|
4191
|
+
const globalConfig = globalThis.__zod_globalConfig;
|
|
4192
|
+
function config(newConfig) {
|
|
4193
|
+
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
4194
|
+
return globalConfig;
|
|
4195
|
+
}
|
|
4196
|
+
//#endregion
|
|
4197
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/errors.js
|
|
4198
|
+
function _getMessage() {
|
|
4199
|
+
const internals = this._zod;
|
|
4200
|
+
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
4201
|
+
return internals.message;
|
|
4202
|
+
}
|
|
4203
|
+
function _setMessage(value) {
|
|
4204
|
+
this._zod.message = value;
|
|
4205
|
+
}
|
|
4206
|
+
const _messageDesc = {
|
|
4207
|
+
get: _getMessage,
|
|
4208
|
+
set: _setMessage,
|
|
4209
|
+
enumerable: true,
|
|
4210
|
+
configurable: true
|
|
4211
|
+
};
|
|
4212
|
+
const _zodDesc = {
|
|
4213
|
+
value: void 0,
|
|
4214
|
+
enumerable: false
|
|
4215
|
+
};
|
|
4216
|
+
const _issuesDesc = {
|
|
4217
|
+
value: void 0,
|
|
4218
|
+
enumerable: false
|
|
4219
|
+
};
|
|
4220
|
+
const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4221
|
+
const initializer$1 = (inst, def) => {
|
|
4222
|
+
inst.name = "$ZodError";
|
|
4223
|
+
_zodDesc.value = inst._zod;
|
|
4224
|
+
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
4225
|
+
_issuesDesc.value = def;
|
|
4226
|
+
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
4227
|
+
_zodDesc.value = void 0;
|
|
4228
|
+
_issuesDesc.value = void 0;
|
|
4229
|
+
Object.defineProperty(inst, "message", _messageDesc);
|
|
4230
|
+
const proto = Object.getPrototypeOf(inst);
|
|
4231
|
+
if (!_installedToString.has(proto)) {
|
|
4232
|
+
_installedToString.add(proto);
|
|
4233
|
+
Object.defineProperty(proto, "toString", {
|
|
4234
|
+
configurable: true,
|
|
4235
|
+
enumerable: false,
|
|
4236
|
+
get() {
|
|
4237
|
+
const value = () => this.message;
|
|
4238
|
+
Object.defineProperty(this, "toString", {
|
|
4239
|
+
value,
|
|
4240
|
+
configurable: true,
|
|
4241
|
+
writable: true
|
|
4242
|
+
});
|
|
4243
|
+
return value;
|
|
4244
|
+
},
|
|
4245
|
+
set(value) {
|
|
4246
|
+
Object.defineProperty(this, "toString", {
|
|
4247
|
+
value,
|
|
4248
|
+
configurable: true,
|
|
4249
|
+
writable: true
|
|
4250
|
+
});
|
|
4251
|
+
}
|
|
4252
|
+
});
|
|
4253
|
+
}
|
|
3990
4254
|
};
|
|
3991
4255
|
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
3992
|
-
const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
|
|
4256
|
+
const $ZodRealError = $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
4257
|
+
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
4258
|
+
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
4259
|
+
* "__proto__" would hit the setter instead of creating a key. */
|
|
4260
|
+
function node$1(obj, key, make) {
|
|
4261
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
4262
|
+
if (key === "__proto__") Object.defineProperty(obj, key, {
|
|
4263
|
+
value: make(),
|
|
4264
|
+
writable: true,
|
|
4265
|
+
enumerable: true,
|
|
4266
|
+
configurable: true
|
|
4267
|
+
});
|
|
4268
|
+
else obj[key] = make();
|
|
4269
|
+
}
|
|
4270
|
+
return obj[key];
|
|
4271
|
+
}
|
|
3993
4272
|
function flattenError(error, mapper = (issue) => issue.message) {
|
|
3994
4273
|
const fieldErrors = {};
|
|
3995
4274
|
const formErrors = [];
|
|
3996
|
-
for (const sub of error.issues) if (sub.path.length > 0)
|
|
3997
|
-
|
|
3998
|
-
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
3999
|
-
} else formErrors.push(mapper(sub));
|
|
4275
|
+
for (const sub of error.issues) if (sub.path.length > 0) node$1(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
4276
|
+
else formErrors.push(mapper(sub));
|
|
4000
4277
|
return {
|
|
4001
4278
|
formErrors,
|
|
4002
4279
|
fieldErrors
|
|
@@ -4016,12 +4293,21 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
4016
4293
|
let i = 0;
|
|
4017
4294
|
while (i < fullpath.length) {
|
|
4018
4295
|
const el = fullpath[i];
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4296
|
+
const terminal = i === fullpath.length - 1;
|
|
4297
|
+
if (el === "_errors") {
|
|
4298
|
+
if (terminal) curr._errors.push(mapper(issue));
|
|
4299
|
+
i++;
|
|
4300
|
+
continue;
|
|
4023
4301
|
}
|
|
4024
|
-
curr
|
|
4302
|
+
if (!Object.prototype.hasOwnProperty.call(curr, el)) Object.defineProperty(curr, el, {
|
|
4303
|
+
value: { _errors: [] },
|
|
4304
|
+
enumerable: true,
|
|
4305
|
+
writable: true,
|
|
4306
|
+
configurable: true
|
|
4307
|
+
});
|
|
4308
|
+
const node = curr[el];
|
|
4309
|
+
if (terminal) node._errors.push(mapper(issue));
|
|
4310
|
+
curr = node;
|
|
4025
4311
|
i++;
|
|
4026
4312
|
}
|
|
4027
4313
|
}
|
|
@@ -4031,41 +4317,53 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
4031
4317
|
return fieldErrors;
|
|
4032
4318
|
}
|
|
4033
4319
|
//#endregion
|
|
4034
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
}
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4320
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/parse.js
|
|
4321
|
+
function finalizeParams(callee, params) {
|
|
4322
|
+
return {
|
|
4323
|
+
callee: params?.callee ?? callee,
|
|
4324
|
+
Err: params?.Err
|
|
4325
|
+
};
|
|
4326
|
+
}
|
|
4327
|
+
const _parse = (_Err) => {
|
|
4328
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
4329
|
+
const ctx = _ctx ? {
|
|
4330
|
+
..._ctx,
|
|
4331
|
+
async: false
|
|
4332
|
+
} : { async: false };
|
|
4333
|
+
const result = schema._zod.run({
|
|
4334
|
+
value,
|
|
4335
|
+
issues: []
|
|
4336
|
+
}, ctx);
|
|
4337
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
4338
|
+
if (result.issues.length) {
|
|
4339
|
+
const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
4340
|
+
captureStackTrace(e, _params?.callee ?? fn);
|
|
4341
|
+
throw e;
|
|
4342
|
+
}
|
|
4343
|
+
return result.value;
|
|
4344
|
+
};
|
|
4345
|
+
return fn;
|
|
4051
4346
|
};
|
|
4052
4347
|
const parse$2 = /* @__PURE__*/ _parse($ZodRealError);
|
|
4053
|
-
const _parseAsync = (_Err) =>
|
|
4054
|
-
const
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4348
|
+
const _parseAsync = (_Err) => {
|
|
4349
|
+
const fn = async (schema, value, _ctx, params) => {
|
|
4350
|
+
const ctx = _ctx ? {
|
|
4351
|
+
..._ctx,
|
|
4352
|
+
async: true
|
|
4353
|
+
} : { async: true };
|
|
4354
|
+
let result = schema._zod.run({
|
|
4355
|
+
value,
|
|
4356
|
+
issues: []
|
|
4357
|
+
}, ctx);
|
|
4358
|
+
if (result instanceof Promise) result = await result;
|
|
4359
|
+
if (result.issues.length) {
|
|
4360
|
+
const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
4361
|
+
captureStackTrace(e, params?.callee ?? fn);
|
|
4362
|
+
throw e;
|
|
4363
|
+
}
|
|
4364
|
+
return result.value;
|
|
4365
|
+
};
|
|
4366
|
+
return fn;
|
|
4069
4367
|
};
|
|
4070
4368
|
const parseAsync$1 = /* @__PURE__*/ _parseAsync($ZodRealError);
|
|
4071
4369
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
@@ -4106,25 +4404,41 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
4106
4404
|
};
|
|
4107
4405
|
};
|
|
4108
4406
|
const safeParseAsync$2 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
|
|
4109
|
-
const _encode = (_Err) =>
|
|
4110
|
-
const
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4407
|
+
const _encode = (_Err) => {
|
|
4408
|
+
const parse = _parse(_Err);
|
|
4409
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
4410
|
+
const ctx = _ctx ? {
|
|
4411
|
+
..._ctx,
|
|
4412
|
+
direction: "backward"
|
|
4413
|
+
} : { direction: "backward" };
|
|
4414
|
+
return parse(schema, value, ctx, finalizeParams(fn, _params));
|
|
4415
|
+
};
|
|
4416
|
+
return fn;
|
|
4115
4417
|
};
|
|
4116
|
-
const _decode = (_Err) =>
|
|
4117
|
-
|
|
4418
|
+
const _decode = (_Err) => {
|
|
4419
|
+
const parse = _parse(_Err);
|
|
4420
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
4421
|
+
return parse(schema, value, _ctx, finalizeParams(fn, _params));
|
|
4422
|
+
};
|
|
4423
|
+
return fn;
|
|
4118
4424
|
};
|
|
4119
|
-
const _encodeAsync = (_Err) =>
|
|
4120
|
-
const
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4425
|
+
const _encodeAsync = (_Err) => {
|
|
4426
|
+
const parseAsync = _parseAsync(_Err);
|
|
4427
|
+
const fn = async (schema, value, _ctx, _params) => {
|
|
4428
|
+
const ctx = _ctx ? {
|
|
4429
|
+
..._ctx,
|
|
4430
|
+
direction: "backward"
|
|
4431
|
+
} : { direction: "backward" };
|
|
4432
|
+
return await parseAsync(schema, value, ctx, finalizeParams(fn, _params));
|
|
4433
|
+
};
|
|
4434
|
+
return fn;
|
|
4125
4435
|
};
|
|
4126
|
-
const _decodeAsync = (_Err) =>
|
|
4127
|
-
|
|
4436
|
+
const _decodeAsync = (_Err) => {
|
|
4437
|
+
const parseAsync = _parseAsync(_Err);
|
|
4438
|
+
const fn = async (schema, value, _ctx, _params) => {
|
|
4439
|
+
return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));
|
|
4440
|
+
};
|
|
4441
|
+
return fn;
|
|
4128
4442
|
};
|
|
4129
4443
|
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
4130
4444
|
const ctx = _ctx ? {
|
|
@@ -4147,7 +4461,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
4147
4461
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
4148
4462
|
};
|
|
4149
4463
|
//#endregion
|
|
4150
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
4464
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/regexes.js
|
|
4151
4465
|
/**
|
|
4152
4466
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
4153
4467
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -4155,12 +4469,15 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
4155
4469
|
*/
|
|
4156
4470
|
const cuid = /^[cC][0-9a-z]{6,}$/;
|
|
4157
4471
|
const cuid2 = /^[0-9a-z]+$/;
|
|
4158
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{
|
|
4472
|
+
const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
4159
4473
|
const xid = /^[0-9a-vA-V]{20}$/;
|
|
4160
4474
|
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
4161
4475
|
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
4476
|
+
function nanoidOfLength(length) {
|
|
4477
|
+
return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
|
|
4478
|
+
}
|
|
4162
4479
|
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
4163
|
-
const duration
|
|
4480
|
+
const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
4164
4481
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
4165
4482
|
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
4166
4483
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
@@ -4172,33 +4489,41 @@ const uuid = (version) => {
|
|
|
4172
4489
|
};
|
|
4173
4490
|
/** Practical email validation */
|
|
4174
4491
|
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
4175
|
-
const _emoji$1 = `^
|
|
4492
|
+
const _emoji$1 = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
4176
4493
|
function emoji() {
|
|
4177
4494
|
return new RegExp(_emoji$1, "u");
|
|
4178
4495
|
}
|
|
4179
4496
|
const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
4180
4497
|
const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
4181
4498
|
const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
4182
|
-
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}
|
|
4499
|
+
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
4183
4500
|
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
4184
4501
|
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
4185
4502
|
const httpProtocol = /^https?$/;
|
|
4186
4503
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
4187
4504
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
4188
|
-
|
|
4505
|
+
/** Anchors a pattern source. The interpolation lives here rather than at the call site because
|
|
4506
|
+
* esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it
|
|
4507
|
+
* will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */
|
|
4508
|
+
function anchor(source) {
|
|
4509
|
+
return new RegExp(`^${source}$`);
|
|
4510
|
+
}
|
|
4511
|
+
const date = /*@__PURE__*/ anchor(dateSource);
|
|
4189
4512
|
function timeSource(args) {
|
|
4190
4513
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
4191
|
-
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
4514
|
+
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
4192
4515
|
}
|
|
4193
|
-
function time
|
|
4516
|
+
function time(args) {
|
|
4194
4517
|
return new RegExp(`^${timeSource(args)}$`);
|
|
4195
4518
|
}
|
|
4196
4519
|
function datetime$1(args) {
|
|
4197
|
-
const time = timeSource({ precision: args.precision });
|
|
4198
4520
|
const opts = ["Z"];
|
|
4199
|
-
if (args.local) opts.push("");
|
|
4200
4521
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
4201
|
-
const
|
|
4522
|
+
const qualified = `${timeSource({
|
|
4523
|
+
precision: args.precision,
|
|
4524
|
+
seconds: true
|
|
4525
|
+
})}(?:${opts.join("|")})`;
|
|
4526
|
+
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
4202
4527
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
4203
4528
|
}
|
|
4204
4529
|
const string$3 = (params) => {
|
|
@@ -4212,13 +4537,18 @@ const _null$3 = /^null$/i;
|
|
|
4212
4537
|
const lowercase = /^[^A-Z]*$/;
|
|
4213
4538
|
const uppercase = /^[^a-z]*$/;
|
|
4214
4539
|
//#endregion
|
|
4215
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
4540
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/checks.js
|
|
4216
4541
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
4217
4542
|
var _a;
|
|
4218
4543
|
inst._zod ?? (inst._zod = {});
|
|
4219
4544
|
inst._zod.def = def;
|
|
4220
4545
|
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
4221
4546
|
});
|
|
4547
|
+
/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */
|
|
4548
|
+
const _whenHasLength = (payload) => {
|
|
4549
|
+
const val = payload.value;
|
|
4550
|
+
return !nullish(val) && val.length !== void 0;
|
|
4551
|
+
};
|
|
4222
4552
|
const numericOriginMap = {
|
|
4223
4553
|
number: "number",
|
|
4224
4554
|
bigint: "bigint",
|
|
@@ -4238,7 +4568,7 @@ const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst,
|
|
|
4238
4568
|
inst._zod.check = (payload) => {
|
|
4239
4569
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
4240
4570
|
payload.issues.push({
|
|
4241
|
-
origin,
|
|
4571
|
+
origin: numericOriginMap[typeof payload.value] ?? origin,
|
|
4242
4572
|
code: "too_big",
|
|
4243
4573
|
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
4244
4574
|
input: payload.value,
|
|
@@ -4262,7 +4592,7 @@ const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan",
|
|
|
4262
4592
|
inst._zod.check = (payload) => {
|
|
4263
4593
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
4264
4594
|
payload.issues.push({
|
|
4265
|
-
origin,
|
|
4595
|
+
origin: numericOriginMap[typeof payload.value] ?? origin,
|
|
4266
4596
|
code: "too_small",
|
|
4267
4597
|
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
4268
4598
|
input: payload.value,
|
|
@@ -4280,7 +4610,7 @@ const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (i
|
|
|
4280
4610
|
});
|
|
4281
4611
|
inst._zod.check = (payload) => {
|
|
4282
4612
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
4283
|
-
if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
4613
|
+
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
4284
4614
|
payload.issues.push({
|
|
4285
4615
|
origin: typeof payload.value,
|
|
4286
4616
|
code: "not_multiple_of",
|
|
@@ -4365,17 +4695,15 @@ const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat"
|
|
|
4365
4695
|
const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
4366
4696
|
var _a;
|
|
4367
4697
|
$ZodCheck.init(inst, def);
|
|
4368
|
-
(_a = inst._zod.def).when ?? (_a.when =
|
|
4369
|
-
const val = payload.value;
|
|
4370
|
-
return !nullish(val) && val.length !== void 0;
|
|
4371
|
-
});
|
|
4698
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
4372
4699
|
inst._zod.onattach.push((inst) => {
|
|
4373
4700
|
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
4374
4701
|
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
4375
4702
|
});
|
|
4376
4703
|
inst._zod.check = (payload) => {
|
|
4377
4704
|
const input = payload.value;
|
|
4378
|
-
|
|
4705
|
+
const units = input.length;
|
|
4706
|
+
if ((typeof input === "string" && units > def.maximum ? codePointLength(input) : units) <= def.maximum) return;
|
|
4379
4707
|
const origin = getLengthableOrigin(input);
|
|
4380
4708
|
payload.issues.push({
|
|
4381
4709
|
origin,
|
|
@@ -4391,17 +4719,15 @@ const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (ins
|
|
|
4391
4719
|
const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
4392
4720
|
var _a;
|
|
4393
4721
|
$ZodCheck.init(inst, def);
|
|
4394
|
-
(_a = inst._zod.def).when ?? (_a.when =
|
|
4395
|
-
const val = payload.value;
|
|
4396
|
-
return !nullish(val) && val.length !== void 0;
|
|
4397
|
-
});
|
|
4722
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
4398
4723
|
inst._zod.onattach.push((inst) => {
|
|
4399
4724
|
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
4400
4725
|
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
4401
4726
|
});
|
|
4402
4727
|
inst._zod.check = (payload) => {
|
|
4403
4728
|
const input = payload.value;
|
|
4404
|
-
|
|
4729
|
+
const units = input.length;
|
|
4730
|
+
if ((typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units) >= def.minimum) return;
|
|
4405
4731
|
const origin = getLengthableOrigin(input);
|
|
4406
4732
|
payload.issues.push({
|
|
4407
4733
|
origin,
|
|
@@ -4417,10 +4743,7 @@ const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (ins
|
|
|
4417
4743
|
const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
4418
4744
|
var _a;
|
|
4419
4745
|
$ZodCheck.init(inst, def);
|
|
4420
|
-
(_a = inst._zod.def).when ?? (_a.when =
|
|
4421
|
-
const val = payload.value;
|
|
4422
|
-
return !nullish(val) && val.length !== void 0;
|
|
4423
|
-
});
|
|
4746
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
4424
4747
|
inst._zod.onattach.push((inst) => {
|
|
4425
4748
|
const bag = inst._zod.bag;
|
|
4426
4749
|
bag.minimum = def.length;
|
|
@@ -4429,7 +4752,8 @@ const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals"
|
|
|
4429
4752
|
});
|
|
4430
4753
|
inst._zod.check = (payload) => {
|
|
4431
4754
|
const input = payload.value;
|
|
4432
|
-
const
|
|
4755
|
+
const units = input.length;
|
|
4756
|
+
const length = typeof input === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input) : units;
|
|
4433
4757
|
if (length === def.length) return;
|
|
4434
4758
|
const origin = getLengthableOrigin(input);
|
|
4435
4759
|
const tooBig = length > def.length;
|
|
@@ -4503,7 +4827,7 @@ const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (ins
|
|
|
4503
4827
|
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
4504
4828
|
$ZodCheck.init(inst, def);
|
|
4505
4829
|
const escapedRegex = escapeRegex(def.includes);
|
|
4506
|
-
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
4830
|
+
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
4507
4831
|
def.pattern = pattern;
|
|
4508
4832
|
inst._zod.onattach.push((inst) => {
|
|
4509
4833
|
const bag = inst._zod.bag;
|
|
@@ -4574,12 +4898,13 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
|
|
|
4574
4898
|
};
|
|
4575
4899
|
});
|
|
4576
4900
|
//#endregion
|
|
4577
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
4901
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/doc.js
|
|
4578
4902
|
var Doc = class {
|
|
4579
|
-
constructor(args = []) {
|
|
4903
|
+
constructor(args = [], closed = {}) {
|
|
4580
4904
|
this.content = [];
|
|
4581
4905
|
this.indent = 0;
|
|
4582
|
-
|
|
4906
|
+
this.args = args;
|
|
4907
|
+
this.closed = closed;
|
|
4583
4908
|
}
|
|
4584
4909
|
indented(fn) {
|
|
4585
4910
|
this.indent += 1;
|
|
@@ -4599,28 +4924,27 @@ var Doc = class {
|
|
|
4599
4924
|
}
|
|
4600
4925
|
compile() {
|
|
4601
4926
|
const F = Function;
|
|
4602
|
-
const
|
|
4603
|
-
|
|
4604
|
-
return new F(...args, lines.join("\n"));
|
|
4927
|
+
const content = this?.content ?? [``];
|
|
4928
|
+
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
|
|
4605
4929
|
}
|
|
4606
4930
|
};
|
|
4607
4931
|
//#endregion
|
|
4608
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
4932
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.js
|
|
4609
4933
|
const version$2 = {
|
|
4610
4934
|
major: 4,
|
|
4611
|
-
minor:
|
|
4612
|
-
patch:
|
|
4935
|
+
minor: 5,
|
|
4936
|
+
patch: 4
|
|
4613
4937
|
};
|
|
4614
4938
|
//#endregion
|
|
4615
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
4939
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/schemas.js
|
|
4616
4940
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
4617
4941
|
var _a;
|
|
4618
4942
|
inst ?? (inst = {});
|
|
4619
4943
|
inst._zod.def = def;
|
|
4620
4944
|
inst._zod.bag = inst._zod.bag || {};
|
|
4621
4945
|
inst._zod.version = version$2;
|
|
4622
|
-
const
|
|
4623
|
-
|
|
4946
|
+
const defChecks = inst._zod.def.checks;
|
|
4947
|
+
const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
|
|
4624
4948
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
4625
4949
|
if (checks.length === 0) {
|
|
4626
4950
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -4629,6 +4953,7 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
4629
4953
|
});
|
|
4630
4954
|
} else {
|
|
4631
4955
|
const runChecks = (payload, checks, ctx) => {
|
|
4956
|
+
if (payload.memo) return payload;
|
|
4632
4957
|
let isAborted = aborted(payload);
|
|
4633
4958
|
let asyncResult;
|
|
4634
4959
|
for (const ch of checks) {
|
|
@@ -4642,10 +4967,12 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
4642
4967
|
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
4643
4968
|
await _;
|
|
4644
4969
|
if (payload.issues.length === currLen) return;
|
|
4970
|
+
attachSchema(payload.issues, currLen, inst);
|
|
4645
4971
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
4646
4972
|
});
|
|
4647
4973
|
else {
|
|
4648
4974
|
if (payload.issues.length === currLen) continue;
|
|
4975
|
+
attachSchema(payload.issues, currLen, inst);
|
|
4649
4976
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
4650
4977
|
}
|
|
4651
4978
|
}
|
|
@@ -4689,19 +5016,29 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
4689
5016
|
return runChecks(result, checks, ctx);
|
|
4690
5017
|
};
|
|
4691
5018
|
}
|
|
4692
|
-
|
|
5019
|
+
}, {
|
|
5020
|
+
get "~standard"() {
|
|
5021
|
+
return hide(this, "~standard", standardProps(this));
|
|
5022
|
+
},
|
|
5023
|
+
set "~standard"(value) {
|
|
5024
|
+
own$7(this, "~standard", value);
|
|
5025
|
+
}
|
|
5026
|
+
});
|
|
5027
|
+
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
5028
|
+
const toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
5029
|
+
function standardProps(inst) {
|
|
5030
|
+
return {
|
|
4693
5031
|
validate: (value) => {
|
|
4694
5032
|
try {
|
|
4695
|
-
|
|
4696
|
-
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
5033
|
+
return toStandardResult(safeParse$2(inst, value));
|
|
4697
5034
|
} catch (_) {
|
|
4698
|
-
return safeParseAsync$2(inst, value).then(
|
|
5035
|
+
return safeParseAsync$2(inst, value).then(toStandardResult);
|
|
4699
5036
|
}
|
|
4700
5037
|
},
|
|
4701
5038
|
vendor: "zod",
|
|
4702
5039
|
version: 1
|
|
4703
|
-
}
|
|
4704
|
-
}
|
|
5040
|
+
};
|
|
5041
|
+
}
|
|
4705
5042
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
4706
5043
|
$ZodType.init(inst, def);
|
|
4707
5044
|
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$3(inst._zod.bag);
|
|
@@ -4748,51 +5085,74 @@ const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
|
4748
5085
|
def.pattern ?? (def.pattern = email);
|
|
4749
5086
|
$ZodStringFormat.init(inst, def);
|
|
4750
5087
|
});
|
|
5088
|
+
/** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
|
|
5089
|
+
function parseURLObject(trimmed, def) {
|
|
5090
|
+
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
|
|
5091
|
+
try {
|
|
5092
|
+
return new URL(trimmed);
|
|
5093
|
+
} catch {
|
|
5094
|
+
return 2;
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
const asciiTabOrNewline = /[\t\n\r]/g;
|
|
5098
|
+
/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
|
|
5099
|
+
function stripTabAndNewline(value) {
|
|
5100
|
+
return value.replace(asciiTabOrNewline, "");
|
|
5101
|
+
}
|
|
5102
|
+
function urlHostnameOk(url, hostname) {
|
|
5103
|
+
hostname.lastIndex = 0;
|
|
5104
|
+
return hostname.test(url.hostname);
|
|
5105
|
+
}
|
|
5106
|
+
function urlProtocolOk(url, protocol) {
|
|
5107
|
+
protocol.lastIndex = 0;
|
|
5108
|
+
return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
|
|
5109
|
+
}
|
|
4751
5110
|
const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
4752
5111
|
$ZodStringFormat.init(inst, def);
|
|
4753
5112
|
inst._zod.check = (payload) => {
|
|
4754
5113
|
try {
|
|
4755
5114
|
const trimmed = payload.value.trim();
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
code: "invalid_format",
|
|
4760
|
-
format: "url",
|
|
4761
|
-
note: "Invalid URL format",
|
|
4762
|
-
input: payload.value,
|
|
4763
|
-
inst,
|
|
4764
|
-
continue: !def.abort
|
|
4765
|
-
});
|
|
4766
|
-
return;
|
|
4767
|
-
}
|
|
4768
|
-
}
|
|
4769
|
-
const url = new URL(trimmed);
|
|
4770
|
-
if (def.hostname) {
|
|
4771
|
-
def.hostname.lastIndex = 0;
|
|
4772
|
-
if (!def.hostname.test(url.hostname)) payload.issues.push({
|
|
5115
|
+
const url = parseURLObject(trimmed, def);
|
|
5116
|
+
if (url === 1) {
|
|
5117
|
+
payload.issues.push({
|
|
4773
5118
|
code: "invalid_format",
|
|
4774
5119
|
format: "url",
|
|
4775
|
-
note: "Invalid
|
|
4776
|
-
pattern: def.hostname.source,
|
|
5120
|
+
note: "Invalid URL format",
|
|
4777
5121
|
input: payload.value,
|
|
4778
5122
|
inst,
|
|
4779
5123
|
continue: !def.abort
|
|
4780
5124
|
});
|
|
5125
|
+
return;
|
|
4781
5126
|
}
|
|
4782
|
-
if (
|
|
4783
|
-
|
|
4784
|
-
if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
|
|
5127
|
+
if (url === 2) {
|
|
5128
|
+
payload.issues.push({
|
|
4785
5129
|
code: "invalid_format",
|
|
4786
5130
|
format: "url",
|
|
4787
|
-
note: "Invalid protocol",
|
|
4788
|
-
pattern: def.protocol.source,
|
|
4789
5131
|
input: payload.value,
|
|
4790
5132
|
inst,
|
|
4791
5133
|
continue: !def.abort
|
|
4792
5134
|
});
|
|
5135
|
+
return;
|
|
4793
5136
|
}
|
|
4794
|
-
if (def.
|
|
4795
|
-
|
|
5137
|
+
if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
|
|
5138
|
+
code: "invalid_format",
|
|
5139
|
+
format: "url",
|
|
5140
|
+
note: "Invalid hostname",
|
|
5141
|
+
pattern: def.hostname.source,
|
|
5142
|
+
input: payload.value,
|
|
5143
|
+
inst,
|
|
5144
|
+
continue: !def.abort
|
|
5145
|
+
});
|
|
5146
|
+
if (def.protocol && !urlProtocolOk(url, def.protocol)) payload.issues.push({
|
|
5147
|
+
code: "invalid_format",
|
|
5148
|
+
format: "url",
|
|
5149
|
+
note: "Invalid protocol",
|
|
5150
|
+
pattern: def.protocol.source,
|
|
5151
|
+
input: payload.value,
|
|
5152
|
+
inst,
|
|
5153
|
+
continue: !def.abort
|
|
5154
|
+
});
|
|
5155
|
+
payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
|
|
4796
5156
|
return;
|
|
4797
5157
|
} catch (_) {
|
|
4798
5158
|
payload.issues.push({
|
|
@@ -4810,7 +5170,8 @@ const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
|
|
|
4810
5170
|
$ZodStringFormat.init(inst, def);
|
|
4811
5171
|
});
|
|
4812
5172
|
const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
|
|
4813
|
-
def.
|
|
5173
|
+
if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1)) throw new Error(`Invalid nanoid length: ${def.length}`);
|
|
5174
|
+
def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
|
|
4814
5175
|
$ZodStringFormat.init(inst, def);
|
|
4815
5176
|
});
|
|
4816
5177
|
/**
|
|
@@ -4841,17 +5202,23 @@ const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
4841
5202
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
4842
5203
|
def.pattern ?? (def.pattern = datetime$1(def));
|
|
4843
5204
|
$ZodStringFormat.init(inst, def);
|
|
5205
|
+
if (def.local || def.precision === -1) {
|
|
5206
|
+
inst._zod.bag.laxFormat = true;
|
|
5207
|
+
inst._zod.onattach.push((s) => {
|
|
5208
|
+
s._zod.bag.laxFormat = true;
|
|
5209
|
+
});
|
|
5210
|
+
}
|
|
4844
5211
|
});
|
|
4845
5212
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
4846
|
-
def.pattern ?? (def.pattern = date
|
|
5213
|
+
def.pattern ?? (def.pattern = date);
|
|
4847
5214
|
$ZodStringFormat.init(inst, def);
|
|
4848
5215
|
});
|
|
4849
5216
|
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
4850
|
-
def.pattern ?? (def.pattern = time
|
|
5217
|
+
def.pattern ?? (def.pattern = time(def));
|
|
4851
5218
|
$ZodStringFormat.init(inst, def);
|
|
4852
5219
|
});
|
|
4853
5220
|
const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
|
|
4854
|
-
def.pattern ?? (def.pattern = duration
|
|
5221
|
+
def.pattern ?? (def.pattern = duration);
|
|
4855
5222
|
$ZodStringFormat.init(inst, def);
|
|
4856
5223
|
});
|
|
4857
5224
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
@@ -4859,50 +5226,56 @@ const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
|
4859
5226
|
$ZodStringFormat.init(inst, def);
|
|
4860
5227
|
inst._zod.bag.format = `ipv4`;
|
|
4861
5228
|
});
|
|
5229
|
+
/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
|
|
5230
|
+
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
5231
|
+
function isValidIPv6(value) {
|
|
5232
|
+
if (!ipv6Alphabet.test(value)) return false;
|
|
5233
|
+
try {
|
|
5234
|
+
new URL(`http://[${value}]`);
|
|
5235
|
+
return true;
|
|
5236
|
+
} catch {
|
|
5237
|
+
return false;
|
|
5238
|
+
}
|
|
5239
|
+
}
|
|
4862
5240
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
4863
5241
|
def.pattern ?? (def.pattern = ipv6);
|
|
4864
5242
|
$ZodStringFormat.init(inst, def);
|
|
4865
5243
|
inst._zod.bag.format = `ipv6`;
|
|
4866
5244
|
inst._zod.check = (payload) => {
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
payload.
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
inst,
|
|
4875
|
-
continue: !def.abort
|
|
4876
|
-
});
|
|
4877
|
-
}
|
|
5245
|
+
if (!isValidIPv6(payload.value)) payload.issues.push({
|
|
5246
|
+
code: "invalid_format",
|
|
5247
|
+
format: "ipv6",
|
|
5248
|
+
input: payload.value,
|
|
5249
|
+
inst,
|
|
5250
|
+
continue: !def.abort
|
|
5251
|
+
});
|
|
4878
5252
|
};
|
|
4879
5253
|
});
|
|
4880
5254
|
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
4881
5255
|
def.pattern ?? (def.pattern = cidrv4);
|
|
4882
5256
|
$ZodStringFormat.init(inst, def);
|
|
4883
5257
|
});
|
|
5258
|
+
function isValidCIDRv6(value) {
|
|
5259
|
+
const parts = value.split("/");
|
|
5260
|
+
if (parts.length !== 2) return false;
|
|
5261
|
+
const [address, prefix] = parts;
|
|
5262
|
+
if (!prefix) return false;
|
|
5263
|
+
const prefixNum = Number(prefix);
|
|
5264
|
+
if (`${prefixNum}` !== prefix) return false;
|
|
5265
|
+
if (prefixNum < 0 || prefixNum > 128) return false;
|
|
5266
|
+
return isValidIPv6(address);
|
|
5267
|
+
}
|
|
4884
5268
|
const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
4885
5269
|
def.pattern ?? (def.pattern = cidrv6);
|
|
4886
5270
|
$ZodStringFormat.init(inst, def);
|
|
4887
5271
|
inst._zod.check = (payload) => {
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
if (prefixNum < 0 || prefixNum > 128) throw new Error();
|
|
4896
|
-
new URL(`http://[${address}]`);
|
|
4897
|
-
} catch {
|
|
4898
|
-
payload.issues.push({
|
|
4899
|
-
code: "invalid_format",
|
|
4900
|
-
format: "cidrv6",
|
|
4901
|
-
input: payload.value,
|
|
4902
|
-
inst,
|
|
4903
|
-
continue: !def.abort
|
|
4904
|
-
});
|
|
4905
|
-
}
|
|
5272
|
+
if (!isValidCIDRv6(payload.value)) payload.issues.push({
|
|
5273
|
+
code: "invalid_format",
|
|
5274
|
+
format: "cidrv6",
|
|
5275
|
+
input: payload.value,
|
|
5276
|
+
inst,
|
|
5277
|
+
continue: !def.abort
|
|
5278
|
+
});
|
|
4906
5279
|
};
|
|
4907
5280
|
});
|
|
4908
5281
|
function isValidBase64(data) {
|
|
@@ -4992,7 +5365,7 @@ const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
|
4992
5365
|
} catch (_) {}
|
|
4993
5366
|
const input = payload.value;
|
|
4994
5367
|
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
4995
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ?
|
|
5368
|
+
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? String(input) : void 0 : void 0;
|
|
4996
5369
|
payload.issues.push({
|
|
4997
5370
|
expected: "number",
|
|
4998
5371
|
code: "invalid_type",
|
|
@@ -5063,6 +5436,8 @@ function handleArrayResult(result, final, index) {
|
|
|
5063
5436
|
}
|
|
5064
5437
|
const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
5065
5438
|
$ZodType.init(inst, def);
|
|
5439
|
+
const memo = globalConfig.memoizer;
|
|
5440
|
+
memo?.attach(inst);
|
|
5066
5441
|
inst._zod.parse = (payload, ctx) => {
|
|
5067
5442
|
const input = payload.value;
|
|
5068
5443
|
if (!Array.isArray(input)) {
|
|
@@ -5074,7 +5449,7 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
5074
5449
|
});
|
|
5075
5450
|
return payload;
|
|
5076
5451
|
}
|
|
5077
|
-
payload.value = Array(input.length);
|
|
5452
|
+
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
5078
5453
|
const proms = [];
|
|
5079
5454
|
for (let i = 0; i < input.length; i++) {
|
|
5080
5455
|
const item = input[i];
|
|
@@ -5089,13 +5464,15 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
5089
5464
|
return payload;
|
|
5090
5465
|
};
|
|
5091
5466
|
});
|
|
5092
|
-
function handlePropertyResult(result, final, key, input,
|
|
5467
|
+
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
5093
5468
|
const isPresent = key in input;
|
|
5469
|
+
const isOptionalOut = optout === "optional";
|
|
5470
|
+
if (!isPresent && isOptionalOut && optin === "optional") return;
|
|
5094
5471
|
if (result.issues.length) {
|
|
5095
|
-
if (
|
|
5472
|
+
if (optin !== void 0 && isOptionalOut && !isPresent) return;
|
|
5096
5473
|
final.issues.push(...prefixIssues(key, result.issues));
|
|
5097
5474
|
}
|
|
5098
|
-
if (!isPresent &&
|
|
5475
|
+
if (!isPresent && optin === void 0) {
|
|
5099
5476
|
if (!result.issues.length) final.issues.push({
|
|
5100
5477
|
code: "invalid_type",
|
|
5101
5478
|
expected: "nonoptional",
|
|
@@ -5108,13 +5485,18 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
|
|
|
5108
5485
|
if (isPresent) final.value[key] = void 0;
|
|
5109
5486
|
} else final.value[key] = result.value;
|
|
5110
5487
|
}
|
|
5488
|
+
const NO_SYMBOL_KEYS = [];
|
|
5111
5489
|
function normalizeDef(def) {
|
|
5112
5490
|
const keys = Object.keys(def.shape);
|
|
5113
|
-
|
|
5491
|
+
const ownSymbols = Object.getOwnPropertySymbols(def.shape);
|
|
5492
|
+
const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
|
|
5493
|
+
const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
|
|
5494
|
+
for (const k of allKeys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
|
|
5114
5495
|
const okeys = optionalKeys(def.shape);
|
|
5115
5496
|
return {
|
|
5116
5497
|
...def,
|
|
5117
|
-
|
|
5498
|
+
allKeys,
|
|
5499
|
+
symbolKeys,
|
|
5118
5500
|
keySet: new Set(keys),
|
|
5119
5501
|
numKeys: keys.length,
|
|
5120
5502
|
optionalKeys: new Set(okeys)
|
|
@@ -5125,11 +5507,14 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
5125
5507
|
const keySet = def.keySet;
|
|
5126
5508
|
const _catchall = def.catchall._zod;
|
|
5127
5509
|
const t = _catchall.def.type;
|
|
5128
|
-
const
|
|
5129
|
-
const
|
|
5510
|
+
const optin = _catchall.optin;
|
|
5511
|
+
const optout = _catchall.optout;
|
|
5130
5512
|
for (const key in input) {
|
|
5131
|
-
if (key === "__proto__") continue;
|
|
5132
5513
|
if (keySet.has(key)) continue;
|
|
5514
|
+
if (key === "__proto__") {
|
|
5515
|
+
if (t === "never") unrecognized.push(key);
|
|
5516
|
+
continue;
|
|
5517
|
+
}
|
|
5133
5518
|
if (t === "never") {
|
|
5134
5519
|
unrecognized.push(key);
|
|
5135
5520
|
continue;
|
|
@@ -5138,39 +5523,44 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
5138
5523
|
value: input[key],
|
|
5139
5524
|
issues: []
|
|
5140
5525
|
}, ctx);
|
|
5141
|
-
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input,
|
|
5142
|
-
else handlePropertyResult(r, payload, key, input,
|
|
5526
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
5527
|
+
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
5143
5528
|
}
|
|
5144
5529
|
if (unrecognized.length) payload.issues.push({
|
|
5145
5530
|
code: "unrecognized_keys",
|
|
5146
5531
|
keys: unrecognized,
|
|
5147
5532
|
input,
|
|
5148
|
-
inst
|
|
5533
|
+
inst,
|
|
5534
|
+
continue: true
|
|
5149
5535
|
});
|
|
5150
5536
|
if (!proms.length) return payload;
|
|
5151
5537
|
return Promise.all(proms).then(() => {
|
|
5152
5538
|
return payload;
|
|
5153
5539
|
});
|
|
5154
5540
|
}
|
|
5541
|
+
const propShapes = /* @__PURE__ */ new WeakMap();
|
|
5155
5542
|
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
5156
5543
|
$ZodType.init(inst, def);
|
|
5157
5544
|
if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
|
|
5158
5545
|
const sh = def.shape;
|
|
5546
|
+
propShapes.set(def, sh);
|
|
5159
5547
|
Object.defineProperty(def, "shape", { get: () => {
|
|
5160
5548
|
const newSh = { ...sh };
|
|
5161
5549
|
Object.defineProperty(def, "shape", { value: newSh });
|
|
5550
|
+
propShapes.set(def, newSh);
|
|
5162
5551
|
return newSh;
|
|
5163
5552
|
} });
|
|
5164
5553
|
}
|
|
5165
5554
|
const _normalized = cached(() => normalizeDef(def));
|
|
5166
|
-
|
|
5167
|
-
const shape = def.shape;
|
|
5555
|
+
defineLazyInternal(inst, "propValues", (zod) => {
|
|
5556
|
+
const shape = zod.def.shape;
|
|
5168
5557
|
const propValues = {};
|
|
5169
5558
|
for (const key in shape) {
|
|
5170
5559
|
const field = shape[key]._zod;
|
|
5171
5560
|
if (field.values) {
|
|
5172
|
-
propValues
|
|
5561
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, key)) assignProp(propValues, key, /* @__PURE__ */ new Set());
|
|
5173
5562
|
for (const v of field.values) propValues[key].add(v);
|
|
5563
|
+
if (field.optin !== void 0) propValues[key].add(void 0);
|
|
5174
5564
|
}
|
|
5175
5565
|
}
|
|
5176
5566
|
return propValues;
|
|
@@ -5178,6 +5568,8 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
5178
5568
|
const isObject$1 = isObject;
|
|
5179
5569
|
const catchall = def.catchall;
|
|
5180
5570
|
let value;
|
|
5571
|
+
const memo = globalConfig.memoizer;
|
|
5572
|
+
memo?.attach(inst);
|
|
5181
5573
|
inst._zod.parse = (payload, ctx) => {
|
|
5182
5574
|
value ?? (value = _normalized.value);
|
|
5183
5575
|
const input = payload.value;
|
|
@@ -5190,19 +5582,20 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
5190
5582
|
});
|
|
5191
5583
|
return payload;
|
|
5192
5584
|
}
|
|
5193
|
-
payload.value = {};
|
|
5585
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
5194
5586
|
const proms = [];
|
|
5195
5587
|
const shape = value.shape;
|
|
5196
|
-
for (const key of value.
|
|
5588
|
+
for (const key of value.allKeys) {
|
|
5589
|
+
if (key === "__proto__") continue;
|
|
5197
5590
|
const el = shape[key];
|
|
5198
|
-
const
|
|
5199
|
-
const
|
|
5591
|
+
const optin = el._zod.optin;
|
|
5592
|
+
const optout = el._zod.optout;
|
|
5200
5593
|
const r = el._zod.run({
|
|
5201
5594
|
value: input[key],
|
|
5202
5595
|
issues: []
|
|
5203
5596
|
}, ctx);
|
|
5204
|
-
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input,
|
|
5205
|
-
else handlePropertyResult(r, payload, key, input,
|
|
5597
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
5598
|
+
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
5206
5599
|
}
|
|
5207
5600
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
5208
5601
|
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
@@ -5212,55 +5605,55 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
5212
5605
|
$ZodObject.init(inst, def);
|
|
5213
5606
|
const superParse = inst._zod.parse;
|
|
5214
5607
|
const _normalized = cached(() => normalizeDef(def));
|
|
5608
|
+
const memo = globalConfig.memoizer;
|
|
5215
5609
|
const generateFastpass = (shape) => {
|
|
5216
|
-
const doc = new Doc([
|
|
5217
|
-
"shape",
|
|
5218
|
-
"payload",
|
|
5219
|
-
"ctx"
|
|
5220
|
-
]);
|
|
5221
5610
|
const normalized = _normalized.value;
|
|
5222
|
-
const
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5611
|
+
const syms = normalized.symbolKeys;
|
|
5612
|
+
const doc = new Doc(["payload", "ctx"], {
|
|
5613
|
+
shape,
|
|
5614
|
+
inst,
|
|
5615
|
+
memo,
|
|
5616
|
+
syms
|
|
5617
|
+
});
|
|
5618
|
+
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
5619
|
+
const prefixStr = (id, k) => `
|
|
5620
|
+
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
5621
|
+
const iss = ${id}.issues[i];
|
|
5622
|
+
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
5623
|
+
payload.issues.push(iss);
|
|
5624
|
+
}`;
|
|
5226
5625
|
doc.write(`const input = payload.value;`);
|
|
5227
5626
|
const ids = Object.create(null);
|
|
5228
5627
|
let counter = 0;
|
|
5229
|
-
for (const key of normalized.
|
|
5230
|
-
doc.write(`const newResult = {};`);
|
|
5231
|
-
for (const key of normalized.
|
|
5628
|
+
for (const key of normalized.allKeys) ids[key] = `key_${counter++}`;
|
|
5629
|
+
doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
5630
|
+
for (const key of normalized.allKeys) {
|
|
5631
|
+
if (key === "__proto__") continue;
|
|
5232
5632
|
const id = ids[key];
|
|
5233
|
-
const k = esc(key);
|
|
5633
|
+
const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
|
|
5634
|
+
const isPresent = `${k} in input`;
|
|
5234
5635
|
const schema = shape[key];
|
|
5235
|
-
const
|
|
5636
|
+
const optin = schema?._zod?.optin;
|
|
5637
|
+
const isOptionalIn = optin !== void 0;
|
|
5236
5638
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
5237
|
-
doc.write(`const ${id} = ${parseStr(
|
|
5238
|
-
if (isOptionalIn && isOptionalOut)
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
})));
|
|
5639
|
+
doc.write(`const ${id} = ${parseStr(k)};`);
|
|
5640
|
+
if (isOptionalIn && isOptionalOut) {
|
|
5641
|
+
const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
|
|
5642
|
+
doc.write(`
|
|
5643
|
+
const ${id}_present = ${isPresent};
|
|
5644
|
+
if (!${id}.issues.length || ${id}_present) {
|
|
5645
|
+
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
5245
5646
|
}
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
if (${k} in input) {
|
|
5250
|
-
newResult[${k}] = undefined;
|
|
5647
|
+
|
|
5648
|
+
if (${assign}) {
|
|
5649
|
+
newResult[${k}] = ${id}.value;
|
|
5251
5650
|
}
|
|
5252
|
-
} else {
|
|
5253
|
-
newResult[${k}] = ${id}.value;
|
|
5254
5651
|
}
|
|
5255
|
-
|
|
5652
|
+
|
|
5256
5653
|
`);
|
|
5257
|
-
else if (!isOptionalIn) doc.write(`
|
|
5258
|
-
const ${id}_present = ${
|
|
5259
|
-
if (${id}.issues.length) {
|
|
5260
|
-
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
5261
|
-
...iss,
|
|
5262
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
5263
|
-
})));
|
|
5654
|
+
} else if (!isOptionalIn) doc.write(`
|
|
5655
|
+
const ${id}_present = ${isPresent};
|
|
5656
|
+
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
5264
5657
|
}
|
|
5265
5658
|
if (!${id}_present && !${id}.issues.length) {
|
|
5266
5659
|
payload.issues.push({
|
|
@@ -5272,36 +5665,27 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
5272
5665
|
}
|
|
5273
5666
|
|
|
5274
5667
|
if (${id}_present) {
|
|
5275
|
-
|
|
5276
|
-
newResult[${k}] = undefined;
|
|
5277
|
-
} else {
|
|
5278
|
-
newResult[${k}] = ${id}.value;
|
|
5279
|
-
}
|
|
5668
|
+
newResult[${k}] = ${id}.value;
|
|
5280
5669
|
}
|
|
5281
5670
|
|
|
5282
5671
|
`);
|
|
5283
5672
|
else doc.write(`
|
|
5284
|
-
if (${id}.issues.length) {
|
|
5285
|
-
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
5286
|
-
...iss,
|
|
5287
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
5288
|
-
})));
|
|
5673
|
+
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
5289
5674
|
}
|
|
5290
5675
|
|
|
5291
5676
|
if (${id}.value === undefined) {
|
|
5292
|
-
if (${
|
|
5677
|
+
if (${isPresent}) {
|
|
5293
5678
|
newResult[${k}] = undefined;
|
|
5294
5679
|
}
|
|
5295
5680
|
} else {
|
|
5296
5681
|
newResult[${k}] = ${id}.value;
|
|
5297
5682
|
}
|
|
5298
|
-
|
|
5683
|
+
|
|
5299
5684
|
`);
|
|
5300
5685
|
}
|
|
5301
5686
|
doc.write(`payload.value = newResult;`);
|
|
5302
5687
|
doc.write(`return payload;`);
|
|
5303
|
-
|
|
5304
|
-
return (payload, ctx) => fn(shape, payload, ctx);
|
|
5688
|
+
return doc.compile();
|
|
5305
5689
|
};
|
|
5306
5690
|
let fastpass;
|
|
5307
5691
|
const isObject$2 = isObject;
|
|
@@ -5350,14 +5734,14 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
5350
5734
|
}
|
|
5351
5735
|
const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
5352
5736
|
$ZodType.init(inst, def);
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
5737
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : zod.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0);
|
|
5738
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
5739
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
5740
|
+
if (zod.def.options.every((o) => o._zod.values)) return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
5357
5741
|
});
|
|
5358
|
-
|
|
5359
|
-
if (def.options.every((o) => o._zod.pattern)) {
|
|
5360
|
-
const patterns = def.options.map((o) => o._zod.pattern);
|
|
5742
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
5743
|
+
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
5744
|
+
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
5361
5745
|
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
5362
5746
|
}
|
|
5363
5747
|
});
|
|
@@ -5389,18 +5773,22 @@ const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnio
|
|
|
5389
5773
|
def.inclusive = false;
|
|
5390
5774
|
$ZodUnion.init(inst, def);
|
|
5391
5775
|
const _super = inst._zod.parse;
|
|
5392
|
-
|
|
5776
|
+
defineLazyInternal(inst, "propValues", (zod) => {
|
|
5393
5777
|
const propValues = {};
|
|
5394
|
-
for (const option of def.options) {
|
|
5778
|
+
for (const option of zod.def.options) {
|
|
5395
5779
|
const pv = option._zod.propValues;
|
|
5396
|
-
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
5780
|
+
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
5397
5781
|
for (const [k, v] of Object.entries(pv)) {
|
|
5398
|
-
if (!propValues
|
|
5782
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
5399
5783
|
for (const val of v) propValues[k].add(val);
|
|
5400
5784
|
}
|
|
5401
5785
|
}
|
|
5402
5786
|
return propValues;
|
|
5403
5787
|
});
|
|
5788
|
+
def.options.forEach((option, i) => {
|
|
5789
|
+
const propShape = propShapes.get(option._zod.def);
|
|
5790
|
+
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
5791
|
+
});
|
|
5404
5792
|
const disc = cached(() => {
|
|
5405
5793
|
const opts = def.options;
|
|
5406
5794
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -5475,7 +5863,9 @@ function mergeValues(a, b) {
|
|
|
5475
5863
|
...a,
|
|
5476
5864
|
...b
|
|
5477
5865
|
};
|
|
5866
|
+
if (Object.prototype.hasOwnProperty.call(newObj, "__proto__")) delete newObj.__proto__;
|
|
5478
5867
|
for (const key of sharedKeys) {
|
|
5868
|
+
if (key === "__proto__") continue;
|
|
5479
5869
|
const sharedValue = mergeValues(a[key], b[key]);
|
|
5480
5870
|
if (!sharedValue.valid) return {
|
|
5481
5871
|
valid: false,
|
|
@@ -5517,31 +5907,46 @@ function mergeValues(a, b) {
|
|
|
5517
5907
|
function handleIntersectionResults(result, left, right) {
|
|
5518
5908
|
const unrecKeys = /* @__PURE__ */ new Map();
|
|
5519
5909
|
let unrecIssue;
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5910
|
+
const keyIssues = /* @__PURE__ */ new Map();
|
|
5911
|
+
const collect = (iss, side) => {
|
|
5912
|
+
let keys;
|
|
5913
|
+
if (iss.code === "unrecognized_keys" && !iss.path?.length) {
|
|
5914
|
+
unrecIssue ?? (unrecIssue = iss);
|
|
5915
|
+
keys = iss.keys;
|
|
5916
|
+
} else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
|
|
5917
|
+
const k = String(iss.path[0]);
|
|
5918
|
+
if (!keyIssues.has(k)) keyIssues.set(k, iss);
|
|
5919
|
+
keys = [k];
|
|
5920
|
+
} else return false;
|
|
5921
|
+
for (const k of keys) {
|
|
5523
5922
|
if (!unrecKeys.has(k)) unrecKeys.set(k, {});
|
|
5524
|
-
unrecKeys.get(k)
|
|
5923
|
+
unrecKeys.get(k)[side] = true;
|
|
5525
5924
|
}
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
}
|
|
5531
|
-
else result.issues.push(iss);
|
|
5925
|
+
return true;
|
|
5926
|
+
};
|
|
5927
|
+
for (const iss of left.issues) if (!collect(iss, "l")) result.issues.push(iss);
|
|
5928
|
+
for (const iss of right.issues) if (!collect(iss, "r")) result.issues.push(iss);
|
|
5532
5929
|
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
5533
|
-
if (bothKeys.length
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5930
|
+
if (bothKeys.length) {
|
|
5931
|
+
const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
|
|
5932
|
+
if (aggregated.length) result.issues.push({
|
|
5933
|
+
...unrecIssue,
|
|
5934
|
+
keys: aggregated
|
|
5935
|
+
});
|
|
5936
|
+
for (const k of bothKeys) if (!aggregated.includes(k) && keyIssues.has(k)) result.issues.push(keyIssues.get(k));
|
|
5937
|
+
}
|
|
5538
5938
|
const merged = mergeValues(left.value, right.value);
|
|
5539
|
-
if (!merged.valid)
|
|
5939
|
+
if (!merged.valid) {
|
|
5940
|
+
if (aborted(result)) return result;
|
|
5941
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
|
5942
|
+
}
|
|
5540
5943
|
result.value = merged.data;
|
|
5541
5944
|
return result;
|
|
5542
5945
|
}
|
|
5543
5946
|
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
5544
5947
|
$ZodType.init(inst, def);
|
|
5948
|
+
const memo = globalConfig.memoizer;
|
|
5949
|
+
memo?.attach(inst);
|
|
5545
5950
|
inst._zod.parse = (payload, ctx) => {
|
|
5546
5951
|
const input = payload.value;
|
|
5547
5952
|
if (!isPlainObject$2(input)) {
|
|
@@ -5555,11 +5960,12 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5555
5960
|
}
|
|
5556
5961
|
const proms = [];
|
|
5557
5962
|
const values = def.keyType._zod.values;
|
|
5558
|
-
if (values) {
|
|
5559
|
-
payload.value = {};
|
|
5963
|
+
if (values && !def.partial) {
|
|
5964
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
5560
5965
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
5561
5966
|
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
5562
5967
|
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
5968
|
+
if (key === "__proto__") continue;
|
|
5563
5969
|
const keyResult = def.keyType._zod.run({
|
|
5564
5970
|
value: key,
|
|
5565
5971
|
issues: []
|
|
@@ -5577,6 +5983,7 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5577
5983
|
continue;
|
|
5578
5984
|
}
|
|
5579
5985
|
const outKey = keyResult.value;
|
|
5986
|
+
if (outKey === "__proto__") continue;
|
|
5580
5987
|
const result = def.valueType._zod.run({
|
|
5581
5988
|
value: input[key],
|
|
5582
5989
|
issues: []
|
|
@@ -5592,17 +5999,24 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5592
5999
|
}
|
|
5593
6000
|
let unrecognized;
|
|
5594
6001
|
for (const key in input) if (!recordKeys.has(key)) {
|
|
5595
|
-
|
|
5596
|
-
|
|
6002
|
+
if (def.mode === "loose") {
|
|
6003
|
+
if (key === "__proto__") continue;
|
|
6004
|
+
payload.value[key] = input[key];
|
|
6005
|
+
} else {
|
|
6006
|
+
unrecognized = unrecognized ?? [];
|
|
6007
|
+
unrecognized.push(key);
|
|
6008
|
+
}
|
|
5597
6009
|
}
|
|
5598
6010
|
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
5599
6011
|
code: "unrecognized_keys",
|
|
5600
6012
|
input,
|
|
5601
6013
|
inst,
|
|
5602
|
-
keys: unrecognized
|
|
6014
|
+
keys: unrecognized,
|
|
6015
|
+
continue: true
|
|
5603
6016
|
});
|
|
5604
6017
|
} else {
|
|
5605
|
-
payload.value = {};
|
|
6018
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
6019
|
+
let unrecognized;
|
|
5606
6020
|
for (const key of Reflect.ownKeys(input)) {
|
|
5607
6021
|
if (key === "__proto__") continue;
|
|
5608
6022
|
if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
|
|
@@ -5621,7 +6035,10 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5621
6035
|
}
|
|
5622
6036
|
if (keyResult.issues.length) {
|
|
5623
6037
|
if (def.mode === "loose") payload.value[key] = input[key];
|
|
5624
|
-
else
|
|
6038
|
+
else if (values) {
|
|
6039
|
+
unrecognized = unrecognized ?? [];
|
|
6040
|
+
unrecognized.push(key);
|
|
6041
|
+
} else payload.issues.push({
|
|
5625
6042
|
code: "invalid_key",
|
|
5626
6043
|
origin: "record",
|
|
5627
6044
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
@@ -5631,19 +6048,28 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
5631
6048
|
});
|
|
5632
6049
|
continue;
|
|
5633
6050
|
}
|
|
6051
|
+
const outKey = keyResult.value;
|
|
6052
|
+
if (outKey === "__proto__") continue;
|
|
5634
6053
|
const result = def.valueType._zod.run({
|
|
5635
6054
|
value: input[key],
|
|
5636
6055
|
issues: []
|
|
5637
6056
|
}, ctx);
|
|
5638
6057
|
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
5639
6058
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5640
|
-
payload.value[
|
|
6059
|
+
payload.value[outKey] = result.value;
|
|
5641
6060
|
}));
|
|
5642
6061
|
else {
|
|
5643
6062
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
5644
|
-
payload.value[
|
|
6063
|
+
payload.value[outKey] = result.value;
|
|
5645
6064
|
}
|
|
5646
6065
|
}
|
|
6066
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
6067
|
+
code: "unrecognized_keys",
|
|
6068
|
+
input,
|
|
6069
|
+
inst,
|
|
6070
|
+
keys: unrecognized,
|
|
6071
|
+
continue: true
|
|
6072
|
+
});
|
|
5647
6073
|
}
|
|
5648
6074
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
5649
6075
|
return payload;
|
|
@@ -5654,7 +6080,8 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
5654
6080
|
const values = getEnumValues(def.entries);
|
|
5655
6081
|
const valuesSet = new Set(values);
|
|
5656
6082
|
inst._zod.values = valuesSet;
|
|
5657
|
-
|
|
6083
|
+
const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
|
|
6084
|
+
inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
5658
6085
|
inst._zod.parse = (payload, _ctx) => {
|
|
5659
6086
|
const input = payload.value;
|
|
5660
6087
|
if (valuesSet.has(input)) return payload;
|
|
@@ -5669,10 +6096,9 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
5669
6096
|
});
|
|
5670
6097
|
const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
5671
6098
|
$ZodType.init(inst, def);
|
|
5672
|
-
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
5673
6099
|
const values = new Set(def.values);
|
|
5674
6100
|
inst._zod.values = values;
|
|
5675
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
6101
|
+
inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
5676
6102
|
inst._zod.parse = (payload, _ctx) => {
|
|
5677
6103
|
const input = payload.value;
|
|
5678
6104
|
if (values.has(input)) return payload;
|
|
@@ -5688,67 +6114,66 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
5688
6114
|
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
5689
6115
|
$ZodType.init(inst, def);
|
|
5690
6116
|
inst._zod.optin = "optional";
|
|
6117
|
+
globalConfig.memoizer?.guard(inst);
|
|
5691
6118
|
inst._zod.parse = (payload, ctx) => {
|
|
5692
6119
|
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
5693
6120
|
const _out = def.transform(payload.value, payload);
|
|
5694
6121
|
if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
|
|
5695
6122
|
payload.value = output;
|
|
5696
|
-
payload.fallback = true;
|
|
5697
6123
|
return payload;
|
|
5698
6124
|
});
|
|
5699
6125
|
if (_out instanceof Promise) throw new $ZodAsyncError();
|
|
5700
6126
|
payload.value = _out;
|
|
5701
|
-
payload.fallback = true;
|
|
5702
6127
|
return payload;
|
|
5703
6128
|
};
|
|
5704
6129
|
});
|
|
5705
|
-
function handleOptionalResult(
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
value: void 0
|
|
5709
|
-
};
|
|
5710
|
-
return result;
|
|
6130
|
+
function handleOptionalResult(payload, result) {
|
|
6131
|
+
payload.value = result.issues.length ? void 0 : result.value;
|
|
6132
|
+
return payload;
|
|
5711
6133
|
}
|
|
5712
6134
|
const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
|
|
5713
6135
|
$ZodType.init(inst, def);
|
|
5714
|
-
inst._zod.optin
|
|
6136
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
5715
6137
|
inst._zod.optout = "optional";
|
|
5716
|
-
|
|
5717
|
-
|
|
6138
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
6139
|
+
const values = zod.def.innerType._zod.values;
|
|
6140
|
+
return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
|
|
5718
6141
|
});
|
|
5719
|
-
|
|
5720
|
-
const pattern = def.innerType._zod.pattern;
|
|
6142
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
6143
|
+
const pattern = zod.def.innerType._zod.pattern;
|
|
5721
6144
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
5722
6145
|
});
|
|
5723
6146
|
inst._zod.parse = (payload, ctx) => {
|
|
5724
|
-
if (
|
|
5725
|
-
|
|
5726
|
-
const result = def.innerType._zod.run(
|
|
5727
|
-
|
|
5728
|
-
|
|
6147
|
+
if (payload.value === void 0) {
|
|
6148
|
+
if (def.innerType._zod.optin !== "defaulted") return payload;
|
|
6149
|
+
const result = def.innerType._zod.run({
|
|
6150
|
+
value: payload.value,
|
|
6151
|
+
issues: []
|
|
6152
|
+
}, ctx);
|
|
6153
|
+
if (result instanceof Promise) return result.then((result) => handleOptionalResult(payload, result));
|
|
6154
|
+
return handleOptionalResult(payload, result);
|
|
5729
6155
|
}
|
|
5730
|
-
if (payload.value === void 0) return payload;
|
|
5731
6156
|
return def.innerType._zod.run(payload, ctx);
|
|
5732
6157
|
};
|
|
5733
6158
|
});
|
|
5734
6159
|
const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
|
|
5735
6160
|
$ZodOptional.init(inst, def);
|
|
5736
|
-
|
|
5737
|
-
|
|
6161
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
6162
|
+
defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
|
|
5738
6163
|
inst._zod.parse = (payload, ctx) => {
|
|
5739
6164
|
return def.innerType._zod.run(payload, ctx);
|
|
5740
6165
|
};
|
|
5741
6166
|
});
|
|
5742
6167
|
const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
5743
6168
|
$ZodType.init(inst, def);
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
const pattern = def.innerType._zod.pattern;
|
|
6169
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
|
|
6170
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
6171
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
6172
|
+
const pattern = zod.def.innerType._zod.pattern;
|
|
5748
6173
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
5749
6174
|
});
|
|
5750
|
-
|
|
5751
|
-
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
6175
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
6176
|
+
return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
|
|
5752
6177
|
});
|
|
5753
6178
|
inst._zod.parse = (payload, ctx) => {
|
|
5754
6179
|
if (payload.value === null) return payload;
|
|
@@ -5757,8 +6182,8 @@ const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
|
5757
6182
|
});
|
|
5758
6183
|
const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
|
|
5759
6184
|
$ZodType.init(inst, def);
|
|
5760
|
-
inst._zod.optin = "
|
|
5761
|
-
|
|
6185
|
+
inst._zod.optin = "defaulted";
|
|
6186
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
5762
6187
|
inst._zod.parse = (payload, ctx) => {
|
|
5763
6188
|
if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
|
|
5764
6189
|
if (payload.value === void 0) {
|
|
@@ -5779,8 +6204,8 @@ function handleDefaultResult(payload, def) {
|
|
|
5779
6204
|
}
|
|
5780
6205
|
const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
|
|
5781
6206
|
$ZodType.init(inst, def);
|
|
5782
|
-
inst._zod.optin = "
|
|
5783
|
-
|
|
6207
|
+
inst._zod.optin = "defaulted";
|
|
6208
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
5784
6209
|
inst._zod.parse = (payload, ctx) => {
|
|
5785
6210
|
if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
|
|
5786
6211
|
if (payload.value === void 0) payload.value = def.defaultValue;
|
|
@@ -5789,8 +6214,8 @@ const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
|
|
|
5789
6214
|
});
|
|
5790
6215
|
const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
|
|
5791
6216
|
$ZodType.init(inst, def);
|
|
5792
|
-
|
|
5793
|
-
const v = def.innerType._zod.values;
|
|
6217
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
6218
|
+
const v = zod.def.innerType._zod.values;
|
|
5794
6219
|
return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
|
|
5795
6220
|
});
|
|
5796
6221
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -5808,46 +6233,41 @@ function handleNonOptionalResult(payload, inst) {
|
|
|
5808
6233
|
});
|
|
5809
6234
|
return payload;
|
|
5810
6235
|
}
|
|
6236
|
+
function handleCatchResult(payload, result, def, ctx) {
|
|
6237
|
+
if (!result.issues.length) {
|
|
6238
|
+
payload.value = result.value;
|
|
6239
|
+
if (result.memo) payload.memo = true;
|
|
6240
|
+
return payload;
|
|
6241
|
+
}
|
|
6242
|
+
payload.value = def.catchValue({
|
|
6243
|
+
...result,
|
|
6244
|
+
value: payload.value,
|
|
6245
|
+
error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
|
|
6246
|
+
input: payload.value
|
|
6247
|
+
});
|
|
6248
|
+
return payload;
|
|
6249
|
+
}
|
|
5811
6250
|
const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
|
|
5812
6251
|
$ZodType.init(inst, def);
|
|
5813
|
-
inst._zod.optin
|
|
5814
|
-
|
|
5815
|
-
|
|
6252
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
6253
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
6254
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
5816
6255
|
inst._zod.parse = (payload, ctx) => {
|
|
5817
6256
|
if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
|
|
5818
|
-
const result = def.innerType._zod.run(
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
|
|
5825
|
-
input: payload.value
|
|
5826
|
-
});
|
|
5827
|
-
payload.issues = [];
|
|
5828
|
-
payload.fallback = true;
|
|
5829
|
-
}
|
|
5830
|
-
return payload;
|
|
5831
|
-
});
|
|
5832
|
-
payload.value = result.value;
|
|
5833
|
-
if (result.issues.length) {
|
|
5834
|
-
payload.value = def.catchValue({
|
|
5835
|
-
...payload,
|
|
5836
|
-
error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
|
|
5837
|
-
input: payload.value
|
|
5838
|
-
});
|
|
5839
|
-
payload.issues = [];
|
|
5840
|
-
payload.fallback = true;
|
|
5841
|
-
}
|
|
5842
|
-
return payload;
|
|
6257
|
+
const result = def.innerType._zod.run({
|
|
6258
|
+
value: payload.value,
|
|
6259
|
+
issues: []
|
|
6260
|
+
}, ctx);
|
|
6261
|
+
if (result instanceof Promise) return result.then((result) => handleCatchResult(payload, result, def, ctx));
|
|
6262
|
+
return handleCatchResult(payload, result, def, ctx);
|
|
5843
6263
|
};
|
|
5844
6264
|
});
|
|
5845
6265
|
const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
5846
6266
|
$ZodType.init(inst, def);
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
6267
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
6268
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
6269
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
|
|
6270
|
+
defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
|
|
5851
6271
|
inst._zod.parse = (payload, ctx) => {
|
|
5852
6272
|
if (ctx.direction === "backward") {
|
|
5853
6273
|
const right = def.out._zod.run(payload, ctx);
|
|
@@ -5860,14 +6280,13 @@ const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
|
5860
6280
|
};
|
|
5861
6281
|
});
|
|
5862
6282
|
function handlePipeResult(left, next, ctx) {
|
|
5863
|
-
if (left.issues.
|
|
6283
|
+
if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
|
|
5864
6284
|
left.aborted = true;
|
|
5865
6285
|
return left;
|
|
5866
6286
|
}
|
|
5867
6287
|
return next._zod.run({
|
|
5868
6288
|
value: left.value,
|
|
5869
|
-
issues: left.issues
|
|
5870
|
-
fallback: left.fallback
|
|
6289
|
+
issues: left.issues
|
|
5871
6290
|
}, ctx);
|
|
5872
6291
|
}
|
|
5873
6292
|
const $ZodPreprocess = /*@__PURE__*/ $constructor("$ZodPreprocess", (inst, def) => {
|
|
@@ -5875,10 +6294,10 @@ const $ZodPreprocess = /*@__PURE__*/ $constructor("$ZodPreprocess", (inst, def)
|
|
|
5875
6294
|
});
|
|
5876
6295
|
const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
5877
6296
|
$ZodType.init(inst, def);
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
6297
|
+
defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
|
|
6298
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
6299
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
|
|
6300
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
|
|
5882
6301
|
inst._zod.parse = (payload, ctx) => {
|
|
5883
6302
|
if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
|
|
5884
6303
|
const result = def.innerType._zod.run(payload, ctx);
|
|
@@ -5887,7 +6306,7 @@ const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
|
5887
6306
|
};
|
|
5888
6307
|
});
|
|
5889
6308
|
function handleReadonlyResult(payload) {
|
|
5890
|
-
payload.value = Object.freeze(payload.value);
|
|
6309
|
+
if (!payload.memo) payload.value = Object.freeze(payload.value);
|
|
5891
6310
|
return payload;
|
|
5892
6311
|
}
|
|
5893
6312
|
const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
|
|
@@ -5917,7 +6336,332 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
5917
6336
|
}
|
|
5918
6337
|
}
|
|
5919
6338
|
//#endregion
|
|
5920
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
6339
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
|
|
6340
|
+
var $ZodCyclicError = class extends Error {
|
|
6341
|
+
constructor() {
|
|
6342
|
+
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
6343
|
+
this.name = "ZodCyclicError";
|
|
6344
|
+
}
|
|
6345
|
+
};
|
|
6346
|
+
/** Keyed off the context object every schema in one parse call already shares. */
|
|
6347
|
+
const STATE = "~memo";
|
|
6348
|
+
const NO_ISSUES = [];
|
|
6349
|
+
function cloneIssues(issues) {
|
|
6350
|
+
return issues.map((iss) => iss.path ? {
|
|
6351
|
+
...iss,
|
|
6352
|
+
path: iss.path.slice()
|
|
6353
|
+
} : { ...iss });
|
|
6354
|
+
}
|
|
6355
|
+
const recursive = /*@__PURE__*/ new WeakMap();
|
|
6356
|
+
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
6357
|
+
function isRecursive(inst, stack) {
|
|
6358
|
+
const cached = recursive.get(inst);
|
|
6359
|
+
if (cached !== void 0) return cached;
|
|
6360
|
+
if (stack.has(inst)) return true;
|
|
6361
|
+
stack.add(inst);
|
|
6362
|
+
let result = false;
|
|
6363
|
+
const check = (child) => {
|
|
6364
|
+
if (!result && child?._zod && isRecursive(child, stack)) result = true;
|
|
6365
|
+
};
|
|
6366
|
+
const def = inst._zod.def;
|
|
6367
|
+
switch (def.type) {
|
|
6368
|
+
case "object":
|
|
6369
|
+
for (const key of Reflect.ownKeys(def.shape)) check(def.shape[key]);
|
|
6370
|
+
check(def.catchall);
|
|
6371
|
+
break;
|
|
6372
|
+
case "array":
|
|
6373
|
+
check(def.element);
|
|
6374
|
+
break;
|
|
6375
|
+
case "tuple":
|
|
6376
|
+
for (const el of def.items) check(el);
|
|
6377
|
+
check(def.rest);
|
|
6378
|
+
break;
|
|
6379
|
+
case "record":
|
|
6380
|
+
case "map":
|
|
6381
|
+
check(def.keyType);
|
|
6382
|
+
check(def.valueType);
|
|
6383
|
+
break;
|
|
6384
|
+
case "set":
|
|
6385
|
+
check(def.valueType);
|
|
6386
|
+
break;
|
|
6387
|
+
case "union":
|
|
6388
|
+
for (const el of def.options) check(el);
|
|
6389
|
+
break;
|
|
6390
|
+
case "intersection":
|
|
6391
|
+
check(def.left);
|
|
6392
|
+
check(def.right);
|
|
6393
|
+
break;
|
|
6394
|
+
case "optional":
|
|
6395
|
+
case "nullable":
|
|
6396
|
+
case "default":
|
|
6397
|
+
case "prefault":
|
|
6398
|
+
case "catch":
|
|
6399
|
+
case "readonly":
|
|
6400
|
+
case "nonoptional":
|
|
6401
|
+
case "promise":
|
|
6402
|
+
case "success":
|
|
6403
|
+
check(def.innerType);
|
|
6404
|
+
break;
|
|
6405
|
+
case "pipe":
|
|
6406
|
+
check(def.in);
|
|
6407
|
+
check(def.out);
|
|
6408
|
+
break;
|
|
6409
|
+
case "function":
|
|
6410
|
+
check(def.input);
|
|
6411
|
+
check(def.output);
|
|
6412
|
+
break;
|
|
6413
|
+
case "lazy":
|
|
6414
|
+
check(inst._zod.innerType);
|
|
6415
|
+
break;
|
|
6416
|
+
case "template_literal":
|
|
6417
|
+
case "string":
|
|
6418
|
+
case "number":
|
|
6419
|
+
case "int":
|
|
6420
|
+
case "boolean":
|
|
6421
|
+
case "bigint":
|
|
6422
|
+
case "symbol":
|
|
6423
|
+
case "undefined":
|
|
6424
|
+
case "null":
|
|
6425
|
+
case "void":
|
|
6426
|
+
case "never":
|
|
6427
|
+
case "any":
|
|
6428
|
+
case "unknown":
|
|
6429
|
+
case "date":
|
|
6430
|
+
case "nan":
|
|
6431
|
+
case "enum":
|
|
6432
|
+
case "literal":
|
|
6433
|
+
case "file":
|
|
6434
|
+
case "transform":
|
|
6435
|
+
case "custom": break;
|
|
6436
|
+
default: for (const key in def) {
|
|
6437
|
+
const desc = Object.getOwnPropertyDescriptor(def, key);
|
|
6438
|
+
if (!desc || desc.get) continue;
|
|
6439
|
+
const value = desc.value;
|
|
6440
|
+
if (!value || typeof value !== "object") continue;
|
|
6441
|
+
if (value._zod) check(value);
|
|
6442
|
+
else if (Array.isArray(value)) for (const el of value) check(el);
|
|
6443
|
+
}
|
|
6444
|
+
}
|
|
6445
|
+
stack.delete(inst);
|
|
6446
|
+
recursive.set(inst, result);
|
|
6447
|
+
return result;
|
|
6448
|
+
}
|
|
6449
|
+
function bucketFor(state, inst) {
|
|
6450
|
+
let bucket = state.buckets.get(inst);
|
|
6451
|
+
if (!bucket) {
|
|
6452
|
+
bucket = /* @__PURE__ */ new Map();
|
|
6453
|
+
state.buckets.set(inst, bucket);
|
|
6454
|
+
}
|
|
6455
|
+
return bucket;
|
|
6456
|
+
}
|
|
6457
|
+
let handoff;
|
|
6458
|
+
const open = [];
|
|
6459
|
+
const memo = {
|
|
6460
|
+
alloc(_inst, payload, empty) {
|
|
6461
|
+
const bucket = handoff;
|
|
6462
|
+
if (!bucket) return empty;
|
|
6463
|
+
handoff = void 0;
|
|
6464
|
+
const entry = {
|
|
6465
|
+
value: empty,
|
|
6466
|
+
issues: null
|
|
6467
|
+
};
|
|
6468
|
+
bucket.set(payload.value, entry);
|
|
6469
|
+
open.push(entry);
|
|
6470
|
+
return empty;
|
|
6471
|
+
},
|
|
6472
|
+
guard(inst) {
|
|
6473
|
+
var _a;
|
|
6474
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
6475
|
+
inst._zod.deferred.push(() => {
|
|
6476
|
+
const base = inst._zod.parse;
|
|
6477
|
+
const wrapped = (payload, ctx) => {
|
|
6478
|
+
if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value)) throw new $ZodCyclicError();
|
|
6479
|
+
return base(payload, ctx);
|
|
6480
|
+
};
|
|
6481
|
+
inst._zod.parse = wrapped;
|
|
6482
|
+
if (inst._zod.run === base) inst._zod.run = wrapped;
|
|
6483
|
+
});
|
|
6484
|
+
},
|
|
6485
|
+
attach(inst) {
|
|
6486
|
+
var _a;
|
|
6487
|
+
let isRecursiveInst;
|
|
6488
|
+
let lastCtx;
|
|
6489
|
+
let lastBucket;
|
|
6490
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
6491
|
+
inst._zod.deferred.push(() => {
|
|
6492
|
+
const base = inst._zod.parse;
|
|
6493
|
+
const wrapped = (payload, ctx) => {
|
|
6494
|
+
if (isRecursiveInst === void 0) {
|
|
6495
|
+
isRecursiveInst = isRecursive(inst, /* @__PURE__ */ new Set());
|
|
6496
|
+
if (!isRecursiveInst) {
|
|
6497
|
+
inst._zod.parse = base;
|
|
6498
|
+
if (inst._zod.run === wrapped) inst._zod.run = base;
|
|
6499
|
+
return base(payload, ctx);
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
const input = payload.value;
|
|
6503
|
+
if (input === null || typeof input !== "object") return base(payload, ctx);
|
|
6504
|
+
let state = ctx[STATE];
|
|
6505
|
+
if (!state) {
|
|
6506
|
+
state = {
|
|
6507
|
+
buckets: /* @__PURE__ */ new Map(),
|
|
6508
|
+
backEdges: void 0
|
|
6509
|
+
};
|
|
6510
|
+
ctx[STATE] = state;
|
|
6511
|
+
}
|
|
6512
|
+
let bucket;
|
|
6513
|
+
if (lastCtx === ctx) bucket = lastBucket;
|
|
6514
|
+
else {
|
|
6515
|
+
bucket = bucketFor(state, inst);
|
|
6516
|
+
lastCtx = ctx;
|
|
6517
|
+
lastBucket = bucket;
|
|
6518
|
+
}
|
|
6519
|
+
const hit = bucket.get(input);
|
|
6520
|
+
if (hit) {
|
|
6521
|
+
payload.value = hit.value;
|
|
6522
|
+
if (hit.issues) {
|
|
6523
|
+
if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
|
|
6524
|
+
} else {
|
|
6525
|
+
payload.memo = true;
|
|
6526
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new Set());
|
|
6527
|
+
state.backEdges.add(hit.value);
|
|
6528
|
+
}
|
|
6529
|
+
return payload;
|
|
6530
|
+
}
|
|
6531
|
+
handoff = bucket;
|
|
6532
|
+
const depth = open.length;
|
|
6533
|
+
const result = base(payload, ctx);
|
|
6534
|
+
handoff = void 0;
|
|
6535
|
+
const entry = open.length > depth ? open.pop() : void 0;
|
|
6536
|
+
if (result instanceof Promise) return result.then((r) => {
|
|
6537
|
+
if (entry) entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
|
|
6538
|
+
return r;
|
|
6539
|
+
});
|
|
6540
|
+
if (entry) entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
|
|
6541
|
+
return result;
|
|
6542
|
+
};
|
|
6543
|
+
inst._zod.parse = wrapped;
|
|
6544
|
+
if (inst._zod.run === base) inst._zod.run = wrapped;
|
|
6545
|
+
});
|
|
6546
|
+
}
|
|
6547
|
+
};
|
|
6548
|
+
/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
|
|
6549
|
+
function memoizer() {
|
|
6550
|
+
return memo;
|
|
6551
|
+
}
|
|
6552
|
+
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
6553
|
+
function isBackEdge(ctx, value) {
|
|
6554
|
+
const backEdges = ctx[STATE]?.backEdges;
|
|
6555
|
+
return backEdges !== void 0 && value !== null && typeof value === "object" && backEdges.has(value);
|
|
6556
|
+
}
|
|
6557
|
+
//#endregion
|
|
6558
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/en.js
|
|
6559
|
+
const error = () => {
|
|
6560
|
+
const Sizable = {
|
|
6561
|
+
string: {
|
|
6562
|
+
unit: "characters",
|
|
6563
|
+
verb: "to have"
|
|
6564
|
+
},
|
|
6565
|
+
file: {
|
|
6566
|
+
unit: "bytes",
|
|
6567
|
+
verb: "to have"
|
|
6568
|
+
},
|
|
6569
|
+
array: {
|
|
6570
|
+
unit: "items",
|
|
6571
|
+
verb: "to have"
|
|
6572
|
+
},
|
|
6573
|
+
set: {
|
|
6574
|
+
unit: "items",
|
|
6575
|
+
verb: "to have"
|
|
6576
|
+
},
|
|
6577
|
+
map: {
|
|
6578
|
+
unit: "entries",
|
|
6579
|
+
verb: "to have"
|
|
6580
|
+
}
|
|
6581
|
+
};
|
|
6582
|
+
function getSizing(origin) {
|
|
6583
|
+
return Sizable[origin] ?? null;
|
|
6584
|
+
}
|
|
6585
|
+
const FormatDictionary = {
|
|
6586
|
+
regex: "input",
|
|
6587
|
+
email: "email address",
|
|
6588
|
+
url: "URL",
|
|
6589
|
+
emoji: "emoji",
|
|
6590
|
+
uuid: "UUID",
|
|
6591
|
+
uuidv4: "UUIDv4",
|
|
6592
|
+
uuidv6: "UUIDv6",
|
|
6593
|
+
nanoid: "nanoid",
|
|
6594
|
+
guid: "GUID",
|
|
6595
|
+
cuid: "cuid",
|
|
6596
|
+
cuid2: "cuid2",
|
|
6597
|
+
ulid: "ULID",
|
|
6598
|
+
xid: "XID",
|
|
6599
|
+
ksuid: "KSUID",
|
|
6600
|
+
datetime: "ISO datetime",
|
|
6601
|
+
date: "ISO date",
|
|
6602
|
+
time: "ISO time",
|
|
6603
|
+
duration: "ISO duration",
|
|
6604
|
+
ipv4: "IPv4 address",
|
|
6605
|
+
ipv6: "IPv6 address",
|
|
6606
|
+
mac: "MAC address",
|
|
6607
|
+
cidrv4: "IPv4 range",
|
|
6608
|
+
cidrv6: "IPv6 range",
|
|
6609
|
+
base64: "base64-encoded string",
|
|
6610
|
+
base64url: "base64url-encoded string",
|
|
6611
|
+
json_string: "JSON string",
|
|
6612
|
+
e164: "E.164 number",
|
|
6613
|
+
credit_card: "credit card number",
|
|
6614
|
+
jwt: "JWT",
|
|
6615
|
+
template_literal: "input"
|
|
6616
|
+
};
|
|
6617
|
+
const TypeDictionary = { nan: "NaN" };
|
|
6618
|
+
function getTypeName(type, input) {
|
|
6619
|
+
if (type === "number" && typeof input === "number" && !Number.isFinite(input)) return String(input);
|
|
6620
|
+
return TypeDictionary[type] ?? type;
|
|
6621
|
+
}
|
|
6622
|
+
return (issue) => {
|
|
6623
|
+
switch (issue.code) {
|
|
6624
|
+
case "invalid_type": return `Invalid input: expected ${getTypeName(issue.expected)}, received ${getTypeName(parsedType(issue.input), issue.input)}`;
|
|
6625
|
+
case "invalid_value":
|
|
6626
|
+
if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
|
|
6627
|
+
return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
|
|
6628
|
+
case "too_big": {
|
|
6629
|
+
const adj = issue.exact ? "exactly " : issue.inclusive ? "<=" : "<";
|
|
6630
|
+
const sizing = getSizing(issue.origin);
|
|
6631
|
+
if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
|
6632
|
+
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
|
6633
|
+
}
|
|
6634
|
+
case "too_small": {
|
|
6635
|
+
const adj = issue.exact ? "exactly " : issue.inclusive ? ">=" : ">";
|
|
6636
|
+
const sizing = getSizing(issue.origin);
|
|
6637
|
+
if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
6638
|
+
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
|
6639
|
+
}
|
|
6640
|
+
case "invalid_format": {
|
|
6641
|
+
const _issue = issue;
|
|
6642
|
+
if (_issue.format === "starts_with") return `Invalid string: must start with "${_issue.prefix}"`;
|
|
6643
|
+
if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`;
|
|
6644
|
+
if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`;
|
|
6645
|
+
if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`;
|
|
6646
|
+
return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
6647
|
+
}
|
|
6648
|
+
case "not_multiple_of": return `Invalid number: must be a multiple of ${issue.divisor}`;
|
|
6649
|
+
case "unrecognized_keys": return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
|
|
6650
|
+
case "invalid_key": return `Invalid key in ${issue.origin}`;
|
|
6651
|
+
case "invalid_union":
|
|
6652
|
+
if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) return `Invalid discriminator value. Expected ${issue.options.map((o) => `'${o}'`).join(" | ")}`;
|
|
6653
|
+
if (issue.inclusive === false) return "Invalid input: more than one option matched";
|
|
6654
|
+
return "Invalid input";
|
|
6655
|
+
case "invalid_element": return `Invalid value in ${issue.origin}`;
|
|
6656
|
+
default: return `Invalid input`;
|
|
6657
|
+
}
|
|
6658
|
+
};
|
|
6659
|
+
};
|
|
6660
|
+
function en_default() {
|
|
6661
|
+
return { localeError: error() };
|
|
6662
|
+
}
|
|
6663
|
+
//#endregion
|
|
6664
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/registries.js
|
|
5921
6665
|
var _a;
|
|
5922
6666
|
var $ZodRegistry = class {
|
|
5923
6667
|
constructor() {
|
|
@@ -5964,7 +6708,7 @@ function registry() {
|
|
|
5964
6708
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
5965
6709
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
5966
6710
|
//#endregion
|
|
5967
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
6711
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.js
|
|
5968
6712
|
// @__NO_SIDE_EFFECTS__
|
|
5969
6713
|
function _string(Class, params) {
|
|
5970
6714
|
return new Class({
|
|
@@ -6467,7 +7211,7 @@ function _superRefine(fn, params) {
|
|
|
6467
7211
|
const _issue = issue$2;
|
|
6468
7212
|
if (_issue.fatal) _issue.continue = false;
|
|
6469
7213
|
_issue.code ?? (_issue.code = "custom");
|
|
6470
|
-
|
|
7214
|
+
if (!("input" in _issue)) _issue.input = payload.value;
|
|
6471
7215
|
_issue.inst ?? (_issue.inst = ch);
|
|
6472
7216
|
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
6473
7217
|
payload.issues.push(issue(_issue));
|
|
@@ -6487,7 +7231,11 @@ function _check(fn, params) {
|
|
|
6487
7231
|
return ch;
|
|
6488
7232
|
}
|
|
6489
7233
|
//#endregion
|
|
6490
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
7234
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
|
|
7235
|
+
function assignProps(target, ...sources) {
|
|
7236
|
+
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
7237
|
+
return target;
|
|
7238
|
+
}
|
|
6491
7239
|
function initializeContext(params) {
|
|
6492
7240
|
let target = params?.target ?? "draft-2020-12";
|
|
6493
7241
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -6501,11 +7249,31 @@ function initializeContext(params) {
|
|
|
6501
7249
|
io: params?.io ?? "output",
|
|
6502
7250
|
counter: 0,
|
|
6503
7251
|
seen: /* @__PURE__ */ new Map(),
|
|
7252
|
+
sharedDefsExtractedFor: void 0,
|
|
7253
|
+
sharedEmitDoneFor: void 0,
|
|
6504
7254
|
cycles: params?.cycles ?? "ref",
|
|
6505
7255
|
reused: params?.reused ?? "inline",
|
|
7256
|
+
intersections: [],
|
|
7257
|
+
deferred: [],
|
|
6506
7258
|
external: params?.external ?? void 0
|
|
6507
7259
|
};
|
|
6508
7260
|
}
|
|
7261
|
+
/**
|
|
7262
|
+
* Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws
|
|
7263
|
+
* `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a
|
|
7264
|
+
* custom JSON Schema was written into `json`, in which case the caller must not write its own.
|
|
7265
|
+
*/
|
|
7266
|
+
function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
7267
|
+
const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({
|
|
7268
|
+
zodSchema: schema,
|
|
7269
|
+
path: params.path,
|
|
7270
|
+
message
|
|
7271
|
+
}) : ctx.unrepresentable;
|
|
7272
|
+
if (result === "any") return false;
|
|
7273
|
+
if (result === void 0 || result === "throw") throw new Error(message);
|
|
7274
|
+
Object.assign(json, result);
|
|
7275
|
+
return true;
|
|
7276
|
+
}
|
|
6509
7277
|
function process$1(schema, ctx, _params = {
|
|
6510
7278
|
path: [],
|
|
6511
7279
|
schemaPath: []
|
|
@@ -6525,6 +7293,8 @@ function process$1(schema, ctx, _params = {
|
|
|
6525
7293
|
path: _params.path
|
|
6526
7294
|
};
|
|
6527
7295
|
ctx.seen.set(schema, result);
|
|
7296
|
+
ctx.sharedDefsExtractedFor = void 0;
|
|
7297
|
+
ctx.sharedEmitDoneFor = void 0;
|
|
6528
7298
|
const overrideSchema = schema._zod.toJSONSchema?.();
|
|
6529
7299
|
if (overrideSchema) result.schema = overrideSchema;
|
|
6530
7300
|
else {
|
|
@@ -6548,7 +7318,7 @@ function process$1(schema, ctx, _params = {
|
|
|
6548
7318
|
}
|
|
6549
7319
|
}
|
|
6550
7320
|
const meta = ctx.metadataRegistry.get(schema);
|
|
6551
|
-
if (meta)
|
|
7321
|
+
if (meta) assignProps(result.schema, meta);
|
|
6552
7322
|
if (ctx.io === "input" && isTransforming(schema)) {
|
|
6553
7323
|
delete result.schema.examples;
|
|
6554
7324
|
delete result.schema.default;
|
|
@@ -6557,9 +7327,13 @@ function process$1(schema, ctx, _params = {
|
|
|
6557
7327
|
delete result.schema._prefault;
|
|
6558
7328
|
return ctx.seen.get(schema).schema;
|
|
6559
7329
|
}
|
|
7330
|
+
function encodeJSONPointerSegment(segment) {
|
|
7331
|
+
return segment.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
7332
|
+
}
|
|
6560
7333
|
function extractDefs(ctx, schema) {
|
|
6561
7334
|
const root = ctx.seen.get(schema);
|
|
6562
7335
|
if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
7336
|
+
if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external) return;
|
|
6563
7337
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
6564
7338
|
for (const entry of ctx.seen.entries()) {
|
|
6565
7339
|
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
@@ -6579,15 +7353,16 @@ function extractDefs(ctx, schema) {
|
|
|
6579
7353
|
entry[1].defId = id;
|
|
6580
7354
|
return {
|
|
6581
7355
|
defId: id,
|
|
6582
|
-
ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
|
|
7356
|
+
ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}`
|
|
6583
7357
|
};
|
|
6584
7358
|
}
|
|
6585
|
-
|
|
6586
|
-
const defUriPrefix =
|
|
7359
|
+
const uriPrefix = `#`;
|
|
7360
|
+
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
7361
|
+
if (entry[1] === root && !entry[1].schema.id) return { ref: uriPrefix };
|
|
6587
7362
|
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
|
|
6588
7363
|
return {
|
|
6589
7364
|
defId,
|
|
6590
|
-
ref: defUriPrefix + defId
|
|
7365
|
+
ref: defUriPrefix + encodeJSONPointerSegment(defId)
|
|
6591
7366
|
};
|
|
6592
7367
|
};
|
|
6593
7368
|
const extractToDef = (entry) => {
|
|
@@ -6634,6 +7409,111 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6634
7409
|
}
|
|
6635
7410
|
}
|
|
6636
7411
|
}
|
|
7412
|
+
if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
|
|
7413
|
+
}
|
|
7414
|
+
/** Rewrites `anyOf: [{type: "a"}, {type: "b"}]` to `type: ["a", "b"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so "exactly one" and "at least one" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */
|
|
7415
|
+
function compactTypeUnion(schema) {
|
|
7416
|
+
const options = schema.anyOf;
|
|
7417
|
+
if (!Array.isArray(options) || options.length === 0 || schema.type !== void 0) return;
|
|
7418
|
+
const types = [];
|
|
7419
|
+
for (const option of options) {
|
|
7420
|
+
if (!option || typeof option !== "object") return;
|
|
7421
|
+
compactTypeUnion(option);
|
|
7422
|
+
const keys = Object.keys(option);
|
|
7423
|
+
if (keys.length !== 1 || keys[0] !== "type") return;
|
|
7424
|
+
const type = option.type;
|
|
7425
|
+
for (const member of Array.isArray(type) ? type : [type]) {
|
|
7426
|
+
if (typeof member !== "string") return;
|
|
7427
|
+
if (!types.includes(member)) types.push(member);
|
|
7428
|
+
}
|
|
7429
|
+
}
|
|
7430
|
+
delete schema.anyOf;
|
|
7431
|
+
schema.type = types.length === 1 ? types[0] : types;
|
|
7432
|
+
}
|
|
7433
|
+
/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,
|
|
7434
|
+
* an annotation like `description` — makes a member unfoldable, so a constraint this does not
|
|
7435
|
+
* understand leaves the `allOf` alone instead of being silently dropped or misattributed. */
|
|
7436
|
+
const FOLDABLE_KEYS = /* @__PURE__ */ new Set([
|
|
7437
|
+
"type",
|
|
7438
|
+
"properties",
|
|
7439
|
+
"required",
|
|
7440
|
+
"additionalProperties"
|
|
7441
|
+
]);
|
|
7442
|
+
const UNION_KEYS = ["oneOf", "anyOf"];
|
|
7443
|
+
/** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */
|
|
7444
|
+
function undeclaredConstraint(member) {
|
|
7445
|
+
const extra = member.additionalProperties;
|
|
7446
|
+
if (extra === void 0 || extra === false || typeof extra !== "object" || extra === null) return null;
|
|
7447
|
+
return Object.keys(extra).length ? extra : null;
|
|
7448
|
+
}
|
|
7449
|
+
/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */
|
|
7450
|
+
function foldObjects(members) {
|
|
7451
|
+
const objects = [];
|
|
7452
|
+
for (const member of members) {
|
|
7453
|
+
if (typeof member !== "object" || member.type !== "object") return null;
|
|
7454
|
+
for (const key in member) if (!FOLDABLE_KEYS.has(key)) return null;
|
|
7455
|
+
objects.push(member);
|
|
7456
|
+
}
|
|
7457
|
+
const properties = {};
|
|
7458
|
+
const required = /* @__PURE__ */ new Set();
|
|
7459
|
+
for (const object of objects) {
|
|
7460
|
+
for (const key in object.properties) {
|
|
7461
|
+
if (Object.prototype.hasOwnProperty.call(properties, key)) continue;
|
|
7462
|
+
const parts = [];
|
|
7463
|
+
for (const other of objects) {
|
|
7464
|
+
const part = other.properties?.[key] ?? undeclaredConstraint(other);
|
|
7465
|
+
if (part === null || part === void 0) continue;
|
|
7466
|
+
if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
|
|
7467
|
+
}
|
|
7468
|
+
assignProp(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
|
|
7469
|
+
}
|
|
7470
|
+
for (const key of object.required ?? []) required.add(key);
|
|
7471
|
+
}
|
|
7472
|
+
const folded = {
|
|
7473
|
+
type: "object",
|
|
7474
|
+
properties
|
|
7475
|
+
};
|
|
7476
|
+
if (required.size) folded.required = [...required];
|
|
7477
|
+
if (objects.every((object) => object.additionalProperties === false)) folded.additionalProperties = false;
|
|
7478
|
+
else {
|
|
7479
|
+
const constraints = [];
|
|
7480
|
+
for (const object of objects) {
|
|
7481
|
+
const constraint = undeclaredConstraint(object);
|
|
7482
|
+
if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint))) constraints.push(constraint);
|
|
7483
|
+
}
|
|
7484
|
+
if (constraints.length === 1) folded.additionalProperties = constraints[0];
|
|
7485
|
+
else if (constraints.length > 1) folded.additionalProperties = { allOf: constraints };
|
|
7486
|
+
}
|
|
7487
|
+
return folded;
|
|
7488
|
+
}
|
|
7489
|
+
/** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two
|
|
7490
|
+
* closed object members reject each other's keys and the schema validates nothing. Zod's parser
|
|
7491
|
+
* pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when
|
|
7492
|
+
* *every* side rejects it — so the emitted schema has to pool them too, and folding the members
|
|
7493
|
+
* into one object is the encoding that says so on every target.
|
|
7494
|
+
*
|
|
7495
|
+
* This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`
|
|
7496
|
+
* machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it
|
|
7497
|
+
* keeps its reference and its own closedness rather than being inlined as a stale copy. */
|
|
7498
|
+
function foldIntersection(json) {
|
|
7499
|
+
const allOf = json.allOf;
|
|
7500
|
+
if (!Array.isArray(allOf) || allOf.length < 2) return;
|
|
7501
|
+
for (const key of FOLDABLE_KEYS) if (key in json) return;
|
|
7502
|
+
const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
|
|
7503
|
+
let folded = null;
|
|
7504
|
+
if (!unions.length) folded = foldObjects(allOf);
|
|
7505
|
+
else {
|
|
7506
|
+
const union = unions[0];
|
|
7507
|
+
const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));
|
|
7508
|
+
if (Object.keys(union).length !== 1) return;
|
|
7509
|
+
const rest = allOf.filter((m) => m !== union);
|
|
7510
|
+
const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));
|
|
7511
|
+
if (branches.some((b) => !b)) return;
|
|
7512
|
+
folded = { [keyword]: branches };
|
|
7513
|
+
}
|
|
7514
|
+
if (!folded) return;
|
|
7515
|
+
delete json.allOf;
|
|
7516
|
+
assignProps(json, folded);
|
|
6637
7517
|
}
|
|
6638
7518
|
function finalize(ctx, schema) {
|
|
6639
7519
|
const root = ctx.seen.get(schema);
|
|
@@ -6652,8 +7532,8 @@ function finalize(ctx, schema) {
|
|
|
6652
7532
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
6653
7533
|
schema.allOf = schema.allOf ?? [];
|
|
6654
7534
|
schema.allOf.push(refSchema);
|
|
6655
|
-
} else
|
|
6656
|
-
|
|
7535
|
+
} else assignProps(schema, refSchema);
|
|
7536
|
+
assignProps(schema, _cached);
|
|
6657
7537
|
if (zodSchema._zod.parent === ref) for (const key in schema) {
|
|
6658
7538
|
if (key === "$ref" || key === "allOf") continue;
|
|
6659
7539
|
if (!(key in _cached)) delete schema[key];
|
|
@@ -6681,7 +7561,22 @@ function finalize(ctx, schema) {
|
|
|
6681
7561
|
path: seen.path ?? []
|
|
6682
7562
|
});
|
|
6683
7563
|
};
|
|
6684
|
-
|
|
7564
|
+
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
|
|
7565
|
+
for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
|
|
7566
|
+
if (ctx.target !== "openapi-3.0") for (const entry of ctx.seen.entries()) compactTypeUnion(entry[1].def ?? entry[1].schema);
|
|
7567
|
+
for (const rewrite of ctx.deferred) rewrite();
|
|
7568
|
+
if (ctx.intersections.length) {
|
|
7569
|
+
const carriers = /* @__PURE__ */ new Map();
|
|
7570
|
+
for (const seen of ctx.seen.values()) for (const json of [seen.schema, seen.def]) {
|
|
7571
|
+
const allOf = json?.allOf;
|
|
7572
|
+
if (!Array.isArray(allOf)) continue;
|
|
7573
|
+
const existing = carriers.get(allOf);
|
|
7574
|
+
if (existing) existing.push(json);
|
|
7575
|
+
else carriers.set(allOf, [json]);
|
|
7576
|
+
}
|
|
7577
|
+
for (const allOf of ctx.intersections) for (const json of carriers.get(allOf) ?? []) foldIntersection(json);
|
|
7578
|
+
}
|
|
7579
|
+
}
|
|
6685
7580
|
const result = {};
|
|
6686
7581
|
if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
6687
7582
|
else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
@@ -6692,17 +7587,18 @@ function finalize(ctx, schema) {
|
|
|
6692
7587
|
if (!id) throw new Error("Schema is missing an `id` property");
|
|
6693
7588
|
result.$id = ctx.external.uri(id);
|
|
6694
7589
|
}
|
|
6695
|
-
|
|
7590
|
+
assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
|
|
6696
7591
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
6697
7592
|
if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
|
|
6698
7593
|
const defs = ctx.external?.defs ?? {};
|
|
6699
|
-
for (const entry of ctx.seen.entries()) {
|
|
7594
|
+
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) for (const entry of ctx.seen.entries()) {
|
|
6700
7595
|
const seen = entry[1];
|
|
6701
7596
|
if (seen.def && seen.defId) {
|
|
6702
7597
|
if (seen.def.id === seen.defId) delete seen.def.id;
|
|
6703
|
-
defs
|
|
7598
|
+
assignProp(defs, seen.defId, seen.def);
|
|
6704
7599
|
}
|
|
6705
7600
|
}
|
|
7601
|
+
if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
|
|
6706
7602
|
if (ctx.external) {} else if (Object.keys(defs).length > 0) {
|
|
6707
7603
|
if (ctx.target === "draft-2020-12") result.$defs = defs;
|
|
6708
7604
|
else result.definitions = defs;
|
|
@@ -6734,7 +7630,7 @@ function isTransforming(_schema, _ctx) {
|
|
|
6734
7630
|
if (def.type === "array") return isTransforming(def.element, ctx);
|
|
6735
7631
|
if (def.type === "set") return isTransforming(def.valueType, ctx);
|
|
6736
7632
|
if (def.type === "lazy") return isTransforming(def.getter(), ctx);
|
|
6737
|
-
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
|
|
7633
|
+
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault" || def.type === "catch") return isTransforming(def.innerType, ctx);
|
|
6738
7634
|
if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
6739
7635
|
if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
6740
7636
|
if (def.type === "pipe") {
|
|
@@ -6782,7 +7678,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
6782
7678
|
return finalize(ctx, schema);
|
|
6783
7679
|
};
|
|
6784
7680
|
//#endregion
|
|
6785
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
7681
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js
|
|
6786
7682
|
const formatMap = {
|
|
6787
7683
|
guid: "uuid",
|
|
6788
7684
|
url: "uri",
|
|
@@ -6793,25 +7689,25 @@ const formatMap = {
|
|
|
6793
7689
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
6794
7690
|
const json = _json;
|
|
6795
7691
|
json.type = "string";
|
|
6796
|
-
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
7692
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
|
|
6797
7693
|
if (typeof minimum === "number") json.minLength = minimum;
|
|
6798
7694
|
if (typeof maximum === "number") json.maxLength = maximum;
|
|
6799
7695
|
if (format) {
|
|
6800
7696
|
json.format = formatMap[format] ?? format;
|
|
6801
7697
|
if (json.format === "") delete json.format;
|
|
6802
|
-
if (format === "time") delete json.format;
|
|
7698
|
+
if (format === "time" || laxFormat) delete json.format;
|
|
6803
7699
|
}
|
|
6804
7700
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
6805
7701
|
if (patterns && patterns.size > 0) {
|
|
6806
|
-
const
|
|
6807
|
-
if (
|
|
6808
|
-
else if (
|
|
7702
|
+
const patternList = [...patterns];
|
|
7703
|
+
if (patternList.length === 1) json.pattern = patternList[0].source;
|
|
7704
|
+
else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
|
|
6809
7705
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
6810
7706
|
pattern: regex.source
|
|
6811
7707
|
}))];
|
|
6812
7708
|
}
|
|
6813
7709
|
};
|
|
6814
|
-
const numberProcessor = (schema, ctx, _json,
|
|
7710
|
+
const numberProcessor = (schema, ctx, _json, params) => {
|
|
6815
7711
|
const json = _json;
|
|
6816
7712
|
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
6817
7713
|
if (typeof format === "string" && format.includes("int")) json.type = "integer";
|
|
@@ -6831,16 +7727,19 @@ const numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
6831
7727
|
json.exclusiveMaximum = true;
|
|
6832
7728
|
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
6833
7729
|
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
6834
|
-
if (typeof multipleOf === "number")
|
|
7730
|
+
if (typeof multipleOf === "number") {
|
|
7731
|
+
if (Number.isFinite(multipleOf) && multipleOf !== 0) json.multipleOf = Math.abs(multipleOf);
|
|
7732
|
+
else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
|
|
7733
|
+
}
|
|
6835
7734
|
};
|
|
6836
7735
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
6837
7736
|
json.type = "boolean";
|
|
6838
7737
|
};
|
|
6839
|
-
const bigintProcessor = (
|
|
6840
|
-
|
|
7738
|
+
const bigintProcessor = (schema, ctx, json, params) => {
|
|
7739
|
+
handleUnrepresentable(schema, ctx, json, params, "BigInt cannot be represented in JSON Schema");
|
|
6841
7740
|
};
|
|
6842
|
-
const symbolProcessor = (
|
|
6843
|
-
|
|
7741
|
+
const symbolProcessor = (schema, ctx, json, params) => {
|
|
7742
|
+
handleUnrepresentable(schema, ctx, json, params, "Symbols cannot be represented in JSON Schema");
|
|
6844
7743
|
};
|
|
6845
7744
|
const nullProcessor = (_schema, ctx, json, _params) => {
|
|
6846
7745
|
if (ctx.target === "openapi-3.0") {
|
|
@@ -6849,35 +7748,43 @@ const nullProcessor = (_schema, ctx, json, _params) => {
|
|
|
6849
7748
|
json.enum = [null];
|
|
6850
7749
|
} else json.type = "null";
|
|
6851
7750
|
};
|
|
6852
|
-
const undefinedProcessor = (
|
|
6853
|
-
|
|
7751
|
+
const undefinedProcessor = (schema, ctx, json, params) => {
|
|
7752
|
+
handleUnrepresentable(schema, ctx, json, params, "Undefined cannot be represented in JSON Schema");
|
|
6854
7753
|
};
|
|
6855
|
-
const voidProcessor = (
|
|
6856
|
-
|
|
7754
|
+
const voidProcessor = (schema, ctx, json, params) => {
|
|
7755
|
+
handleUnrepresentable(schema, ctx, json, params, "Void cannot be represented in JSON Schema");
|
|
6857
7756
|
};
|
|
6858
7757
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
6859
7758
|
json.not = {};
|
|
6860
7759
|
};
|
|
6861
7760
|
const anyProcessor = (_schema, _ctx, _json, _params) => {};
|
|
6862
7761
|
const unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
6863
|
-
const dateProcessor = (
|
|
6864
|
-
|
|
7762
|
+
const dateProcessor = (schema, ctx, json, params) => {
|
|
7763
|
+
handleUnrepresentable(schema, ctx, json, params, "Date cannot be represented in JSON Schema");
|
|
6865
7764
|
};
|
|
6866
7765
|
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
6867
7766
|
const def = schema._zod.def;
|
|
6868
7767
|
const values = getEnumValues(def.entries);
|
|
7768
|
+
if (values.length === 0) {
|
|
7769
|
+
json.not = {};
|
|
7770
|
+
return;
|
|
7771
|
+
}
|
|
6869
7772
|
if (values.every((v) => typeof v === "number")) json.type = "number";
|
|
6870
7773
|
if (values.every((v) => typeof v === "string")) json.type = "string";
|
|
6871
7774
|
json.enum = values;
|
|
6872
7775
|
};
|
|
6873
|
-
const literalProcessor = (schema, ctx, json,
|
|
7776
|
+
const literalProcessor = (schema, ctx, json, params) => {
|
|
6874
7777
|
const def = schema._zod.def;
|
|
7778
|
+
if (def.values.length === 0) {
|
|
7779
|
+
json.not = {};
|
|
7780
|
+
return;
|
|
7781
|
+
}
|
|
6875
7782
|
const vals = [];
|
|
6876
7783
|
for (const val of def.values) if (val === void 0) {
|
|
6877
|
-
if (ctx
|
|
7784
|
+
if (handleUnrepresentable(schema, ctx, json, params, "Literal `undefined` cannot be represented in JSON Schema")) return;
|
|
6878
7785
|
} else if (typeof val === "bigint") {
|
|
6879
|
-
if (ctx
|
|
6880
|
-
|
|
7786
|
+
if (handleUnrepresentable(schema, ctx, json, params, "BigInt literals cannot be represented in JSON Schema")) return;
|
|
7787
|
+
vals.push(Number(val));
|
|
6881
7788
|
} else vals.push(val);
|
|
6882
7789
|
if (vals.length === 0) {} else if (vals.length === 1) {
|
|
6883
7790
|
const val = vals[0];
|
|
@@ -6892,8 +7799,8 @@ const literalProcessor = (schema, ctx, json, _params) => {
|
|
|
6892
7799
|
json.enum = vals;
|
|
6893
7800
|
}
|
|
6894
7801
|
};
|
|
6895
|
-
const nanProcessor = (
|
|
6896
|
-
|
|
7802
|
+
const nanProcessor = (schema, ctx, json, params) => {
|
|
7803
|
+
handleUnrepresentable(schema, ctx, json, params, "NaN cannot be represented in JSON Schema");
|
|
6897
7804
|
};
|
|
6898
7805
|
const templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
6899
7806
|
const _json = json;
|
|
@@ -6925,20 +7832,20 @@ const fileProcessor = (schema, _ctx, json, _params) => {
|
|
|
6925
7832
|
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
6926
7833
|
json.type = "boolean";
|
|
6927
7834
|
};
|
|
6928
|
-
const customProcessor = (
|
|
6929
|
-
|
|
7835
|
+
const customProcessor = (schema, ctx, json, params) => {
|
|
7836
|
+
handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
|
|
6930
7837
|
};
|
|
6931
|
-
const functionProcessor = (
|
|
6932
|
-
|
|
7838
|
+
const functionProcessor = (schema, ctx, json, params) => {
|
|
7839
|
+
handleUnrepresentable(schema, ctx, json, params, "Function types cannot be represented in JSON Schema");
|
|
6933
7840
|
};
|
|
6934
|
-
const transformProcessor = (
|
|
6935
|
-
|
|
7841
|
+
const transformProcessor = (schema, ctx, json, params) => {
|
|
7842
|
+
handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
|
|
6936
7843
|
};
|
|
6937
|
-
const mapProcessor = (
|
|
6938
|
-
|
|
7844
|
+
const mapProcessor = (schema, ctx, json, params) => {
|
|
7845
|
+
handleUnrepresentable(schema, ctx, json, params, "Map cannot be represented in JSON Schema");
|
|
6939
7846
|
};
|
|
6940
|
-
const setProcessor = (
|
|
6941
|
-
|
|
7847
|
+
const setProcessor = (schema, ctx, json, params) => {
|
|
7848
|
+
handleUnrepresentable(schema, ctx, json, params, "Set cannot be represented in JSON Schema");
|
|
6942
7849
|
};
|
|
6943
7850
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
6944
7851
|
const json = _json;
|
|
@@ -6952,25 +7859,32 @@ const arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
6952
7859
|
path: [...params.path, "items"]
|
|
6953
7860
|
});
|
|
6954
7861
|
};
|
|
7862
|
+
function inputOptin(schema) {
|
|
7863
|
+
const def = schema._zod.def;
|
|
7864
|
+
if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) return inputOptin(def.out);
|
|
7865
|
+
if (def.type === "catch") return inputOptin(def.innerType);
|
|
7866
|
+
return schema._zod.optin;
|
|
7867
|
+
}
|
|
6955
7868
|
const objectProcessor = (schema, ctx, _json, params) => {
|
|
6956
7869
|
const json = _json;
|
|
6957
7870
|
const def = schema._zod.def;
|
|
7871
|
+
const shape = def.shape;
|
|
7872
|
+
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
6958
7873
|
json.type = "object";
|
|
6959
7874
|
json.properties = {};
|
|
6960
|
-
const shape
|
|
6961
|
-
for (const key in shape) json.properties[key] = process$1(shape[key], ctx, {
|
|
7875
|
+
for (const key in shape) assignProp(json.properties, key, process$1(shape[key], ctx, {
|
|
6962
7876
|
...params,
|
|
6963
7877
|
path: [
|
|
6964
7878
|
...params.path,
|
|
6965
7879
|
"properties",
|
|
6966
7880
|
key
|
|
6967
7881
|
]
|
|
6968
|
-
});
|
|
7882
|
+
}));
|
|
6969
7883
|
const allKeys = new Set(Object.keys(shape));
|
|
6970
7884
|
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
6971
|
-
const
|
|
6972
|
-
if (ctx.io === "input") return
|
|
6973
|
-
else return
|
|
7885
|
+
const field = def.shape[key];
|
|
7886
|
+
if (ctx.io === "input") return inputOptin(field) === void 0;
|
|
7887
|
+
else return field._zod.optout === void 0;
|
|
6974
7888
|
}));
|
|
6975
7889
|
if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
|
|
6976
7890
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
@@ -7014,7 +7928,9 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
7014
7928
|
]
|
|
7015
7929
|
});
|
|
7016
7930
|
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
7017
|
-
|
|
7931
|
+
const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
|
|
7932
|
+
json.allOf = allOf;
|
|
7933
|
+
ctx.intersections.push(allOf);
|
|
7018
7934
|
};
|
|
7019
7935
|
const tupleProcessor = (schema, ctx, _json, params) => {
|
|
7020
7936
|
const json = _json;
|
|
@@ -7038,24 +7954,96 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7038
7954
|
...ctx.target === "openapi-3.0" ? [def.items.length] : []
|
|
7039
7955
|
]
|
|
7040
7956
|
}) : null;
|
|
7957
|
+
let minItems = def.items.length;
|
|
7958
|
+
while (minItems > 0) {
|
|
7959
|
+
const item = def.items[minItems - 1];
|
|
7960
|
+
if (!(ctx.io === "input" ? inputOptin(item) !== void 0 : item._zod.optout === "optional")) break;
|
|
7961
|
+
minItems--;
|
|
7962
|
+
}
|
|
7963
|
+
const maxItems = def.items.length;
|
|
7964
|
+
const isClosed = !def.rest;
|
|
7041
7965
|
if (ctx.target === "draft-2020-12") {
|
|
7042
7966
|
json.prefixItems = prefixItems;
|
|
7043
|
-
if (
|
|
7967
|
+
if (isClosed) json.items = false;
|
|
7968
|
+
else if (rest) json.items = rest;
|
|
7969
|
+
if (minItems > 0) json.minItems = minItems;
|
|
7970
|
+
if (isClosed) json.maxItems = maxItems;
|
|
7044
7971
|
} else if (ctx.target === "openapi-3.0") {
|
|
7045
7972
|
json.items = { anyOf: prefixItems };
|
|
7046
7973
|
if (rest) json.items.anyOf.push(rest);
|
|
7047
|
-
json.minItems =
|
|
7048
|
-
if (
|
|
7974
|
+
if (minItems > 0) json.minItems = minItems;
|
|
7975
|
+
if (isClosed) json.maxItems = maxItems;
|
|
7049
7976
|
} else {
|
|
7050
7977
|
json.items = prefixItems;
|
|
7051
|
-
if (
|
|
7978
|
+
if (isClosed) json.additionalItems = false;
|
|
7979
|
+
else if (rest) json.additionalItems = rest;
|
|
7980
|
+
if (minItems > 0) json.minItems = minItems;
|
|
7981
|
+
if (isClosed) json.maxItems = maxItems;
|
|
7052
7982
|
}
|
|
7053
7983
|
const { minimum, maximum } = schema._zod.bag;
|
|
7054
7984
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
7055
7985
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
7056
7986
|
};
|
|
7057
|
-
|
|
7058
|
-
|
|
7987
|
+
/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
|
|
7988
|
+
* numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
|
|
7989
|
+
* behind a wrapper only carries its own `type` before then, and a union key only has its branches.
|
|
7990
|
+
*
|
|
7991
|
+
* A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather
|
|
7992
|
+
* than carried over: keeping them beside `type: "string"` reproduces the match-nothing schema this
|
|
7993
|
+
* exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`
|
|
7994
|
+
* accepts `"3"` — which is the deliberate trade, since throwing on it would reject an ordinary schema
|
|
7995
|
+
* outright. */
|
|
7996
|
+
function stringifyKeyNames(bySchema, json, visited) {
|
|
7997
|
+
if (json.$ref) {
|
|
7998
|
+
if (visited.has(json)) return json;
|
|
7999
|
+
visited.add(json);
|
|
8000
|
+
const def = bySchema.get(json)?.def;
|
|
8001
|
+
if (!def) return json;
|
|
8002
|
+
const inlined = stringifyKeyNames(bySchema, def, visited);
|
|
8003
|
+
return inlined === def ? json : inlined;
|
|
8004
|
+
}
|
|
8005
|
+
for (const keyword of ["anyOf", "oneOf"]) {
|
|
8006
|
+
const branches = json[keyword];
|
|
8007
|
+
if (!Array.isArray(branches)) continue;
|
|
8008
|
+
const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
8009
|
+
if (mapped.some((branch, i) => branch !== branches[i])) json = {
|
|
8010
|
+
...json,
|
|
8011
|
+
[keyword]: mapped
|
|
8012
|
+
};
|
|
8013
|
+
}
|
|
8014
|
+
const types = Array.isArray(json.type) ? json.type : [json.type];
|
|
8015
|
+
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
8016
|
+
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
8017
|
+
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
8018
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
8019
|
+
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
8020
|
+
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
8021
|
+
if (!numericType) return rest;
|
|
8022
|
+
rest.type = "string";
|
|
8023
|
+
if (!values) rest.pattern = (types.includes("number") ? number$1 : integer).source;
|
|
8024
|
+
return rest;
|
|
8025
|
+
}
|
|
8026
|
+
/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */
|
|
8027
|
+
const pendingRecords = /* @__PURE__ */ new WeakMap();
|
|
8028
|
+
function rewriteKeyNames(ctx) {
|
|
8029
|
+
const bySchema = /* @__PURE__ */ new Map();
|
|
8030
|
+
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
8031
|
+
const rewrites = /* @__PURE__ */ new Map();
|
|
8032
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
8033
|
+
const seen = ctx.seen.get(record);
|
|
8034
|
+
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
8035
|
+
if (!names || names === true || rewrites.has(names)) continue;
|
|
8036
|
+
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
8037
|
+
if (rewritten !== names) rewrites.set(names, rewritten);
|
|
8038
|
+
}
|
|
8039
|
+
if (!rewrites.size) return;
|
|
8040
|
+
for (const entry of ctx.seen.values()) for (const carrier of [entry.schema, entry.def]) {
|
|
8041
|
+
const rewritten = carrier && rewrites.get(carrier.propertyNames);
|
|
8042
|
+
if (rewritten) carrier.propertyNames = rewritten;
|
|
8043
|
+
}
|
|
8044
|
+
}
|
|
8045
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
8046
|
+
const json = _json;
|
|
7059
8047
|
const def = schema._zod.def;
|
|
7060
8048
|
json.type = "object";
|
|
7061
8049
|
const keyType = def.keyType;
|
|
@@ -7070,21 +8058,31 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7070
8058
|
]
|
|
7071
8059
|
});
|
|
7072
8060
|
json.patternProperties = {};
|
|
7073
|
-
for (const pattern of patterns) json.patternProperties
|
|
8061
|
+
for (const pattern of patterns) assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
7074
8062
|
} else {
|
|
7075
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12")
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
8063
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
8064
|
+
json.propertyNames = process$1(def.keyType, ctx, {
|
|
8065
|
+
...params,
|
|
8066
|
+
path: [...params.path, "propertyNames"]
|
|
8067
|
+
});
|
|
8068
|
+
let pending = pendingRecords.get(ctx);
|
|
8069
|
+
if (!pending) {
|
|
8070
|
+
pending = [];
|
|
8071
|
+
pendingRecords.set(ctx, pending);
|
|
8072
|
+
ctx.deferred.push(() => rewriteKeyNames(ctx));
|
|
8073
|
+
}
|
|
8074
|
+
pending.push(schema);
|
|
8075
|
+
}
|
|
7079
8076
|
json.additionalProperties = process$1(def.valueType, ctx, {
|
|
7080
8077
|
...params,
|
|
7081
8078
|
path: [...params.path, "additionalProperties"]
|
|
7082
8079
|
});
|
|
7083
8080
|
}
|
|
7084
8081
|
const keyValues = keyType._zod.values;
|
|
7085
|
-
|
|
8082
|
+
const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
|
|
8083
|
+
if (keyValues && !def.partial && !omittableOnInput) {
|
|
7086
8084
|
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
7087
|
-
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
8085
|
+
if (validKeyValues.length > 0) json.required = validKeyValues.map(String);
|
|
7088
8086
|
}
|
|
7089
8087
|
};
|
|
7090
8088
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
@@ -7102,19 +8100,37 @@ const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
|
7102
8100
|
const seen = ctx.seen.get(schema);
|
|
7103
8101
|
seen.ref = def.innerType;
|
|
7104
8102
|
};
|
|
8103
|
+
/** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.
|
|
8104
|
+
* A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other
|
|
8105
|
+
* unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */
|
|
8106
|
+
const UNREPRESENTABLE_DEFAULT = Symbol();
|
|
8107
|
+
function serializeDefaultValue(value, schema, ctx, json, params) {
|
|
8108
|
+
let unrepresentable = false;
|
|
8109
|
+
const serialized = JSON.stringify(value, (_, val) => {
|
|
8110
|
+
if (typeof val !== "bigint") return val;
|
|
8111
|
+
unrepresentable = true;
|
|
8112
|
+
return null;
|
|
8113
|
+
});
|
|
8114
|
+
if (!unrepresentable) return JSON.parse(serialized);
|
|
8115
|
+
handleUnrepresentable(schema, ctx, json, params, "BigInt defaults cannot be represented in JSON Schema");
|
|
8116
|
+
return UNREPRESENTABLE_DEFAULT;
|
|
8117
|
+
}
|
|
7105
8118
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7106
8119
|
const def = schema._zod.def;
|
|
7107
8120
|
process$1(def.innerType, ctx, params);
|
|
7108
8121
|
const seen = ctx.seen.get(schema);
|
|
7109
8122
|
seen.ref = def.innerType;
|
|
7110
|
-
|
|
8123
|
+
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
8124
|
+
if (value !== UNREPRESENTABLE_DEFAULT) json.default = value;
|
|
7111
8125
|
};
|
|
7112
8126
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7113
8127
|
const def = schema._zod.def;
|
|
7114
8128
|
process$1(def.innerType, ctx, params);
|
|
7115
8129
|
const seen = ctx.seen.get(schema);
|
|
7116
8130
|
seen.ref = def.innerType;
|
|
7117
|
-
if (ctx.io
|
|
8131
|
+
if (ctx.io !== "input") return;
|
|
8132
|
+
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
8133
|
+
if (value !== UNREPRESENTABLE_DEFAULT) json._prefault = value;
|
|
7118
8134
|
};
|
|
7119
8135
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
7120
8136
|
const def = schema._zod.def;
|
|
@@ -7125,7 +8141,8 @@ const catchProcessor = (schema, ctx, json, params) => {
|
|
|
7125
8141
|
try {
|
|
7126
8142
|
catchValue = def.catchValue(void 0);
|
|
7127
8143
|
} catch {
|
|
7128
|
-
|
|
8144
|
+
handleUnrepresentable(schema, ctx, json, params, "Dynamic catch values are not supported in JSON Schema");
|
|
8145
|
+
return;
|
|
7129
8146
|
}
|
|
7130
8147
|
json.default = catchValue;
|
|
7131
8148
|
};
|
|
@@ -7224,7 +8241,7 @@ function toJSONSchema(input, params) {
|
|
|
7224
8241
|
for (const entry of registry._idmap.entries()) {
|
|
7225
8242
|
const [key, schema] = entry;
|
|
7226
8243
|
extractDefs(ctx, schema);
|
|
7227
|
-
schemas
|
|
8244
|
+
assignProp(schemas, key, finalize(ctx, schema));
|
|
7228
8245
|
}
|
|
7229
8246
|
if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
|
|
7230
8247
|
return { schemas };
|
|
@@ -7238,18 +8255,34 @@ function toJSONSchema(input, params) {
|
|
|
7238
8255
|
return finalize(ctx, input);
|
|
7239
8256
|
}
|
|
7240
8257
|
//#endregion
|
|
7241
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
8258
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/mini/schemas.js
|
|
7242
8259
|
const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
|
|
7243
8260
|
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
7244
8261
|
$ZodType.init(inst, def);
|
|
7245
8262
|
inst.def = def;
|
|
7246
8263
|
inst.type = def.type;
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
8264
|
+
}, {
|
|
8265
|
+
get with() {
|
|
8266
|
+
return this.check;
|
|
8267
|
+
},
|
|
8268
|
+
set with(value) {
|
|
8269
|
+
own$7(this, "with", value);
|
|
8270
|
+
},
|
|
8271
|
+
parse(data, params) {
|
|
8272
|
+
return parse$2(this, data, params, { callee: this.parse });
|
|
8273
|
+
},
|
|
8274
|
+
parseAsync(data, params) {
|
|
8275
|
+
return parseAsync$1(this, data, params, { callee: this.parseAsync });
|
|
8276
|
+
},
|
|
8277
|
+
safeParse(data, params) {
|
|
8278
|
+
return safeParse$2(this, data, params);
|
|
8279
|
+
},
|
|
8280
|
+
safeParseAsync(data, params) {
|
|
8281
|
+
return safeParseAsync$2(this, data, params);
|
|
8282
|
+
},
|
|
8283
|
+
check(...checks) {
|
|
8284
|
+
const def = this.def;
|
|
8285
|
+
return this.clone({
|
|
7253
8286
|
...def,
|
|
7254
8287
|
checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
7255
8288
|
check: ch,
|
|
@@ -7257,20 +8290,25 @@ const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
|
|
|
7257
8290
|
onattach: []
|
|
7258
8291
|
} } : ch)]
|
|
7259
8292
|
}, { parent: true });
|
|
7260
|
-
}
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
8293
|
+
},
|
|
8294
|
+
clone(_def, params) {
|
|
8295
|
+
return clone(this, _def, params);
|
|
8296
|
+
},
|
|
8297
|
+
brand() {
|
|
8298
|
+
return this;
|
|
8299
|
+
},
|
|
8300
|
+
register(reg, meta) {
|
|
8301
|
+
reg.add(this, meta);
|
|
8302
|
+
return this;
|
|
8303
|
+
},
|
|
8304
|
+
apply(fn, ...args) {
|
|
8305
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
8306
|
+
}
|
|
7269
8307
|
});
|
|
7270
8308
|
const ZodMiniObject = /*@__PURE__*/ $constructor("ZodMiniObject", (inst, def) => {
|
|
7271
8309
|
$ZodObject.init(inst, def);
|
|
7272
8310
|
ZodMiniType.init(inst, def);
|
|
7273
|
-
|
|
8311
|
+
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
7274
8312
|
});
|
|
7275
8313
|
// @__NO_SIDE_EFFECTS__
|
|
7276
8314
|
function object$1(shape, params) {
|
|
@@ -7282,7 +8320,7 @@ function object$1(shape, params) {
|
|
|
7282
8320
|
return new ZodMiniObject(def);
|
|
7283
8321
|
}
|
|
7284
8322
|
//#endregion
|
|
7285
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
8323
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
7286
8324
|
function isZ4Schema(s) {
|
|
7287
8325
|
return !!s._zod;
|
|
7288
8326
|
}
|
|
@@ -7405,59 +8443,57 @@ function getLiteralValue(schema) {
|
|
|
7405
8443
|
if (directValue !== void 0) return directValue;
|
|
7406
8444
|
}
|
|
7407
8445
|
//#endregion
|
|
7408
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
7409
|
-
const
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
}
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
}
|
|
7430
|
-
|
|
7431
|
-
$ZodISODuration.init(inst, def);
|
|
7432
|
-
ZodStringFormat.init(inst, def);
|
|
7433
|
-
});
|
|
7434
|
-
function duration(params) {
|
|
7435
|
-
return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
|
|
8446
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.js
|
|
8447
|
+
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
8448
|
+
function _lazyMethod(proto, key, make) {
|
|
8449
|
+
Object.defineProperty(proto, key, {
|
|
8450
|
+
configurable: true,
|
|
8451
|
+
enumerable: false,
|
|
8452
|
+
get() {
|
|
8453
|
+
const value = make(this);
|
|
8454
|
+
Object.defineProperty(this, key, {
|
|
8455
|
+
value,
|
|
8456
|
+
configurable: true,
|
|
8457
|
+
writable: true
|
|
8458
|
+
});
|
|
8459
|
+
return value;
|
|
8460
|
+
},
|
|
8461
|
+
set(value) {
|
|
8462
|
+
Object.defineProperty(this, key, {
|
|
8463
|
+
value,
|
|
8464
|
+
configurable: true,
|
|
8465
|
+
writable: true
|
|
8466
|
+
});
|
|
8467
|
+
}
|
|
8468
|
+
});
|
|
7436
8469
|
}
|
|
7437
|
-
//#endregion
|
|
7438
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
|
|
7439
8470
|
const initializer = (inst, issues) => {
|
|
7440
8471
|
$ZodError.init(inst, issues);
|
|
7441
8472
|
inst.name = "ZodError";
|
|
7442
|
-
Object.
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
8473
|
+
const proto = Object.getPrototypeOf(inst);
|
|
8474
|
+
if (_installedErrorProtos.has(proto)) return;
|
|
8475
|
+
_installedErrorProtos.add(proto);
|
|
8476
|
+
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
8477
|
+
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
8478
|
+
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
8479
|
+
self.issues.push(issue);
|
|
8480
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
8481
|
+
});
|
|
8482
|
+
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
8483
|
+
self.issues.push(...issues);
|
|
8484
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
8485
|
+
});
|
|
8486
|
+
Object.defineProperty(proto, "isEmpty", {
|
|
8487
|
+
configurable: true,
|
|
8488
|
+
enumerable: false,
|
|
8489
|
+
get() {
|
|
8490
|
+
return this.issues.length === 0;
|
|
8491
|
+
}
|
|
7456
8492
|
});
|
|
7457
8493
|
};
|
|
7458
|
-
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
|
|
8494
|
+
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
7459
8495
|
//#endregion
|
|
7460
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
8496
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/parse.js
|
|
7461
8497
|
const parse$1 = /* @__PURE__ */ _parse(ZodRealError);
|
|
7462
8498
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
7463
8499
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -7471,167 +8507,175 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
7471
8507
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
7472
8508
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
7473
8509
|
//#endregion
|
|
7474
|
-
//#region ../../node_modules/.pnpm/zod@4.4
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
if (!
|
|
7480
|
-
installed = /* @__PURE__ */ new Set();
|
|
7481
|
-
_installedGroups.set(proto, installed);
|
|
7482
|
-
}
|
|
7483
|
-
if (installed.has(group)) return;
|
|
7484
|
-
installed.add(group);
|
|
7485
|
-
for (const key in methods) {
|
|
7486
|
-
const fn = methods[key];
|
|
7487
|
-
Object.defineProperty(proto, key, {
|
|
7488
|
-
configurable: true,
|
|
7489
|
-
enumerable: false,
|
|
7490
|
-
get() {
|
|
7491
|
-
const bound = fn.bind(this);
|
|
7492
|
-
Object.defineProperty(this, key, {
|
|
7493
|
-
configurable: true,
|
|
7494
|
-
writable: true,
|
|
7495
|
-
enumerable: true,
|
|
7496
|
-
value: bound
|
|
7497
|
-
});
|
|
7498
|
-
return bound;
|
|
7499
|
-
},
|
|
7500
|
-
set(v) {
|
|
7501
|
-
Object.defineProperty(this, key, {
|
|
7502
|
-
configurable: true,
|
|
7503
|
-
writable: true,
|
|
7504
|
-
enumerable: true,
|
|
7505
|
-
value: v
|
|
7506
|
-
});
|
|
7507
|
-
}
|
|
7508
|
-
});
|
|
7509
|
-
}
|
|
8510
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
|
|
8511
|
+
function _ensureDefaultLocale() {
|
|
8512
|
+
if (!globalConfig.localeError) config(en_default());
|
|
8513
|
+
}
|
|
8514
|
+
function _ensureDefaultMemoizer() {
|
|
8515
|
+
if (!globalConfig.memoizer) config({ memoizer: memoizer() });
|
|
7510
8516
|
}
|
|
7511
8517
|
const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
8518
|
+
_ensureDefaultLocale();
|
|
7512
8519
|
$ZodType.init(inst, def);
|
|
7513
|
-
Object.assign(inst["~standard"], { jsonSchema: {
|
|
7514
|
-
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
7515
|
-
output: createStandardJSONSchemaMethod(inst, "output")
|
|
7516
|
-
} });
|
|
7517
|
-
inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
|
|
7518
8520
|
inst.def = def;
|
|
7519
8521
|
inst.type = def.type;
|
|
7520
|
-
Object.defineProperty(inst, "_def", { value: def });
|
|
7521
|
-
inst.parse = (data, params) => parse$1(inst, data, params, { callee: inst.parse });
|
|
7522
|
-
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
7523
|
-
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
7524
|
-
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
7525
|
-
inst.spa = inst.safeParseAsync;
|
|
7526
|
-
inst.encode = (data, params) => encode(inst, data, params);
|
|
7527
|
-
inst.decode = (data, params) => decode$1(inst, data, params);
|
|
7528
|
-
inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
|
|
7529
|
-
inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
|
|
7530
|
-
inst.safeEncode = (data, params) => safeEncode(inst, data, params);
|
|
7531
|
-
inst.safeDecode = (data, params) => safeDecode(inst, data, params);
|
|
7532
|
-
inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
|
|
7533
|
-
inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
|
|
7534
|
-
_installLazyMethods(inst, "ZodType", {
|
|
7535
|
-
check(...chks) {
|
|
7536
|
-
const def = this.def;
|
|
7537
|
-
return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
7538
|
-
check: ch,
|
|
7539
|
-
def: { check: "custom" },
|
|
7540
|
-
onattach: []
|
|
7541
|
-
} } : ch)] }), { parent: true });
|
|
7542
|
-
},
|
|
7543
|
-
with(...chks) {
|
|
7544
|
-
return this.check(...chks);
|
|
7545
|
-
},
|
|
7546
|
-
clone(def, params) {
|
|
7547
|
-
return clone(this, def, params);
|
|
7548
|
-
},
|
|
7549
|
-
brand() {
|
|
7550
|
-
return this;
|
|
7551
|
-
},
|
|
7552
|
-
register(reg, meta) {
|
|
7553
|
-
reg.add(this, meta);
|
|
7554
|
-
return this;
|
|
7555
|
-
},
|
|
7556
|
-
refine(check, params) {
|
|
7557
|
-
return this.check(refine(check, params));
|
|
7558
|
-
},
|
|
7559
|
-
superRefine(refinement, params) {
|
|
7560
|
-
return this.check(superRefine(refinement, params));
|
|
7561
|
-
},
|
|
7562
|
-
overwrite(fn) {
|
|
7563
|
-
return this.check(/* @__PURE__ */ _overwrite(fn));
|
|
7564
|
-
},
|
|
7565
|
-
optional() {
|
|
7566
|
-
return optional(this);
|
|
7567
|
-
},
|
|
7568
|
-
exactOptional() {
|
|
7569
|
-
return exactOptional(this);
|
|
7570
|
-
},
|
|
7571
|
-
nullable() {
|
|
7572
|
-
return nullable(this);
|
|
7573
|
-
},
|
|
7574
|
-
nullish() {
|
|
7575
|
-
return optional(nullable(this));
|
|
7576
|
-
},
|
|
7577
|
-
nonoptional(params) {
|
|
7578
|
-
return nonoptional(this, params);
|
|
7579
|
-
},
|
|
7580
|
-
array() {
|
|
7581
|
-
return array(this);
|
|
7582
|
-
},
|
|
7583
|
-
or(arg) {
|
|
7584
|
-
return union([this, arg]);
|
|
7585
|
-
},
|
|
7586
|
-
and(arg) {
|
|
7587
|
-
return intersection(this, arg);
|
|
7588
|
-
},
|
|
7589
|
-
transform(tx) {
|
|
7590
|
-
return pipe(this, transform(tx));
|
|
7591
|
-
},
|
|
7592
|
-
default(d) {
|
|
7593
|
-
return _default$1(this, d);
|
|
7594
|
-
},
|
|
7595
|
-
prefault(d) {
|
|
7596
|
-
return prefault(this, d);
|
|
7597
|
-
},
|
|
7598
|
-
catch(params) {
|
|
7599
|
-
return _catch(this, params);
|
|
7600
|
-
},
|
|
7601
|
-
pipe(target) {
|
|
7602
|
-
return pipe(this, target);
|
|
7603
|
-
},
|
|
7604
|
-
readonly() {
|
|
7605
|
-
return readonly(this);
|
|
7606
|
-
},
|
|
7607
|
-
describe(description) {
|
|
7608
|
-
const cl = this.clone();
|
|
7609
|
-
globalRegistry.add(cl, { description });
|
|
7610
|
-
return cl;
|
|
7611
|
-
},
|
|
7612
|
-
meta(...args) {
|
|
7613
|
-
if (args.length === 0) return globalRegistry.get(this);
|
|
7614
|
-
const cl = this.clone();
|
|
7615
|
-
globalRegistry.add(cl, args[0]);
|
|
7616
|
-
return cl;
|
|
7617
|
-
},
|
|
7618
|
-
isOptional() {
|
|
7619
|
-
return this.safeParse(void 0).success;
|
|
7620
|
-
},
|
|
7621
|
-
isNullable() {
|
|
7622
|
-
return this.safeParse(null).success;
|
|
7623
|
-
},
|
|
7624
|
-
apply(fn) {
|
|
7625
|
-
return fn(this);
|
|
7626
|
-
}
|
|
7627
|
-
});
|
|
7628
|
-
Object.defineProperty(inst, "description", {
|
|
7629
|
-
get() {
|
|
7630
|
-
return globalRegistry.get(inst)?.description;
|
|
7631
|
-
},
|
|
7632
|
-
configurable: true
|
|
7633
|
-
});
|
|
7634
8522
|
return inst;
|
|
8523
|
+
}, {
|
|
8524
|
+
check(...chks) {
|
|
8525
|
+
const def = this.def;
|
|
8526
|
+
return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
8527
|
+
check: ch,
|
|
8528
|
+
def: { check: "custom" },
|
|
8529
|
+
onattach: []
|
|
8530
|
+
} } : ch)] }), { parent: true });
|
|
8531
|
+
},
|
|
8532
|
+
with(...chks) {
|
|
8533
|
+
return this.check(...chks);
|
|
8534
|
+
},
|
|
8535
|
+
clone(def, params) {
|
|
8536
|
+
return clone(this, def, params);
|
|
8537
|
+
},
|
|
8538
|
+
brand() {
|
|
8539
|
+
return this;
|
|
8540
|
+
},
|
|
8541
|
+
register(reg, meta) {
|
|
8542
|
+
reg.add(this, meta);
|
|
8543
|
+
return this;
|
|
8544
|
+
},
|
|
8545
|
+
refine(check, params) {
|
|
8546
|
+
return this.check(refine(check, params));
|
|
8547
|
+
},
|
|
8548
|
+
superRefine(refinement, params) {
|
|
8549
|
+
return this.check(superRefine(refinement, params));
|
|
8550
|
+
},
|
|
8551
|
+
overwrite(fn) {
|
|
8552
|
+
return this.check(/* @__PURE__ */ _overwrite(fn));
|
|
8553
|
+
},
|
|
8554
|
+
optional() {
|
|
8555
|
+
return optional(this);
|
|
8556
|
+
},
|
|
8557
|
+
exactOptional() {
|
|
8558
|
+
return exactOptional(this);
|
|
8559
|
+
},
|
|
8560
|
+
nullable() {
|
|
8561
|
+
return nullable(this);
|
|
8562
|
+
},
|
|
8563
|
+
nullish() {
|
|
8564
|
+
return optional(nullable(this));
|
|
8565
|
+
},
|
|
8566
|
+
nonoptional(params) {
|
|
8567
|
+
return nonoptional(this, params);
|
|
8568
|
+
},
|
|
8569
|
+
array() {
|
|
8570
|
+
return array(this);
|
|
8571
|
+
},
|
|
8572
|
+
or(arg) {
|
|
8573
|
+
return union([this, arg]);
|
|
8574
|
+
},
|
|
8575
|
+
and(arg) {
|
|
8576
|
+
return intersection(this, arg);
|
|
8577
|
+
},
|
|
8578
|
+
transform(tx) {
|
|
8579
|
+
return pipe(this, transform(tx));
|
|
8580
|
+
},
|
|
8581
|
+
default(d) {
|
|
8582
|
+
return _default$1(this, d);
|
|
8583
|
+
},
|
|
8584
|
+
prefault(d) {
|
|
8585
|
+
return prefault(this, d);
|
|
8586
|
+
},
|
|
8587
|
+
catch(params) {
|
|
8588
|
+
return _catch(this, params);
|
|
8589
|
+
},
|
|
8590
|
+
pipe(target) {
|
|
8591
|
+
return pipe(this, target);
|
|
8592
|
+
},
|
|
8593
|
+
readonly() {
|
|
8594
|
+
return readonly(this);
|
|
8595
|
+
},
|
|
8596
|
+
describe(description) {
|
|
8597
|
+
const cl = this.clone();
|
|
8598
|
+
globalRegistry.add(cl, { description });
|
|
8599
|
+
return cl;
|
|
8600
|
+
},
|
|
8601
|
+
meta(...args) {
|
|
8602
|
+
if (args.length === 0) return globalRegistry.get(this);
|
|
8603
|
+
const cl = this.clone();
|
|
8604
|
+
globalRegistry.add(cl, args[0]);
|
|
8605
|
+
return cl;
|
|
8606
|
+
},
|
|
8607
|
+
isOptional() {
|
|
8608
|
+
return this.safeParse(void 0).success;
|
|
8609
|
+
},
|
|
8610
|
+
isNullable() {
|
|
8611
|
+
return this.safeParse(null).success;
|
|
8612
|
+
},
|
|
8613
|
+
apply(fn, ...args) {
|
|
8614
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
8615
|
+
},
|
|
8616
|
+
get "~standard"() {
|
|
8617
|
+
return hide(this, "~standard", {
|
|
8618
|
+
...standardProps(this),
|
|
8619
|
+
jsonSchema: {
|
|
8620
|
+
input: createStandardJSONSchemaMethod(this, "input"),
|
|
8621
|
+
output: createStandardJSONSchemaMethod(this, "output")
|
|
8622
|
+
}
|
|
8623
|
+
});
|
|
8624
|
+
},
|
|
8625
|
+
set "~standard"(value) {
|
|
8626
|
+
own$7(this, "~standard", value);
|
|
8627
|
+
},
|
|
8628
|
+
parse: function _parse(data, params) {
|
|
8629
|
+
return parse$1(this, data, params, { callee: _parse });
|
|
8630
|
+
},
|
|
8631
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
8632
|
+
return await parseAsync(this, data, params, { callee: _parseAsync });
|
|
8633
|
+
},
|
|
8634
|
+
safeParse(data, params) {
|
|
8635
|
+
return safeParse(this, data, params);
|
|
8636
|
+
},
|
|
8637
|
+
async safeParseAsync(data, params) {
|
|
8638
|
+
return safeParseAsync(this, data, params);
|
|
8639
|
+
},
|
|
8640
|
+
get spa() {
|
|
8641
|
+
return this?.safeParseAsync;
|
|
8642
|
+
},
|
|
8643
|
+
set spa(value) {
|
|
8644
|
+
own$7(this, "spa", value);
|
|
8645
|
+
},
|
|
8646
|
+
encode: function _encode(data, params) {
|
|
8647
|
+
return encode(this, data, params, { callee: _encode });
|
|
8648
|
+
},
|
|
8649
|
+
decode: function _decode(data, params) {
|
|
8650
|
+
return decode$1(this, data, params, { callee: _decode });
|
|
8651
|
+
},
|
|
8652
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
8653
|
+
return await encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
8654
|
+
},
|
|
8655
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
8656
|
+
return await decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
8657
|
+
},
|
|
8658
|
+
safeEncode(data, params) {
|
|
8659
|
+
return safeEncode(this, data, params);
|
|
8660
|
+
},
|
|
8661
|
+
safeDecode(data, params) {
|
|
8662
|
+
return safeDecode(this, data, params);
|
|
8663
|
+
},
|
|
8664
|
+
async safeEncodeAsync(data, params) {
|
|
8665
|
+
return safeEncodeAsync(this, data, params);
|
|
8666
|
+
},
|
|
8667
|
+
async safeDecodeAsync(data, params) {
|
|
8668
|
+
return safeDecodeAsync(this, data, params);
|
|
8669
|
+
},
|
|
8670
|
+
toJSONSchema(params) {
|
|
8671
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
8672
|
+
},
|
|
8673
|
+
get description() {
|
|
8674
|
+
return globalRegistry.get(this)?.description;
|
|
8675
|
+
},
|
|
8676
|
+
get _def() {
|
|
8677
|
+
return this._zod.def;
|
|
8678
|
+
}
|
|
7635
8679
|
});
|
|
7636
8680
|
/** @internal */
|
|
7637
8681
|
const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
@@ -7642,84 +8686,135 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
7642
8686
|
inst.format = bag.format ?? null;
|
|
7643
8687
|
inst.minLength = bag.minimum ?? null;
|
|
7644
8688
|
inst.maxLength = bag.maximum ?? null;
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
});
|
|
8689
|
+
}, {
|
|
8690
|
+
regex(...args) {
|
|
8691
|
+
return this.check(/* @__PURE__ */ _regex(...args));
|
|
8692
|
+
},
|
|
8693
|
+
includes(...args) {
|
|
8694
|
+
return this.check(/* @__PURE__ */ _includes(...args));
|
|
8695
|
+
},
|
|
8696
|
+
startsWith(...args) {
|
|
8697
|
+
return this.check(/* @__PURE__ */ _startsWith(...args));
|
|
8698
|
+
},
|
|
8699
|
+
endsWith(...args) {
|
|
8700
|
+
return this.check(/* @__PURE__ */ _endsWith(...args));
|
|
8701
|
+
},
|
|
8702
|
+
min(...args) {
|
|
8703
|
+
return this.check(/* @__PURE__ */ _minLength(...args));
|
|
8704
|
+
},
|
|
8705
|
+
max(...args) {
|
|
8706
|
+
return this.check(/* @__PURE__ */ _maxLength(...args));
|
|
8707
|
+
},
|
|
8708
|
+
length(...args) {
|
|
8709
|
+
return this.check(/* @__PURE__ */ _length(...args));
|
|
8710
|
+
},
|
|
8711
|
+
nonempty(...args) {
|
|
8712
|
+
return this.check(/* @__PURE__ */ _minLength(1, ...args));
|
|
8713
|
+
},
|
|
8714
|
+
lowercase(params) {
|
|
8715
|
+
return this.check(/* @__PURE__ */ _lowercase(params));
|
|
8716
|
+
},
|
|
8717
|
+
uppercase(params) {
|
|
8718
|
+
return this.check(/* @__PURE__ */ _uppercase(params));
|
|
8719
|
+
},
|
|
8720
|
+
trim() {
|
|
8721
|
+
return this.check(/* @__PURE__ */ _trim());
|
|
8722
|
+
},
|
|
8723
|
+
normalize(...args) {
|
|
8724
|
+
return this.check(/* @__PURE__ */ _normalize(...args));
|
|
8725
|
+
},
|
|
8726
|
+
toLowerCase() {
|
|
8727
|
+
return this.check(/* @__PURE__ */ _toLowerCase());
|
|
8728
|
+
},
|
|
8729
|
+
toUpperCase() {
|
|
8730
|
+
return this.check(/* @__PURE__ */ _toUpperCase());
|
|
8731
|
+
},
|
|
8732
|
+
slugify() {
|
|
8733
|
+
return this.check(/* @__PURE__ */ _slugify());
|
|
8734
|
+
}
|
|
7692
8735
|
});
|
|
7693
8736
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
7694
8737
|
$ZodString.init(inst, def);
|
|
7695
8738
|
_ZodString.init(inst, def);
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
8739
|
+
}, {
|
|
8740
|
+
email(params) {
|
|
8741
|
+
return this.check(/* @__PURE__ */ _email(ZodEmail, params));
|
|
8742
|
+
},
|
|
8743
|
+
url(params) {
|
|
8744
|
+
return this.check(/* @__PURE__ */ _url(ZodURL, params));
|
|
8745
|
+
},
|
|
8746
|
+
jwt(params) {
|
|
8747
|
+
return this.check(/* @__PURE__ */ _jwt(ZodJWT, params));
|
|
8748
|
+
},
|
|
8749
|
+
emoji(params) {
|
|
8750
|
+
return this.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
|
|
8751
|
+
},
|
|
8752
|
+
guid(params) {
|
|
8753
|
+
return this.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
8754
|
+
},
|
|
8755
|
+
uuid(params) {
|
|
8756
|
+
return this.check(/* @__PURE__ */ _uuid(ZodUUID, params));
|
|
8757
|
+
},
|
|
8758
|
+
uuidv4(params) {
|
|
8759
|
+
return this.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
|
|
8760
|
+
},
|
|
8761
|
+
uuidv6(params) {
|
|
8762
|
+
return this.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
|
|
8763
|
+
},
|
|
8764
|
+
uuidv7(params) {
|
|
8765
|
+
return this.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
|
|
8766
|
+
},
|
|
8767
|
+
nanoid(params) {
|
|
8768
|
+
return this.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
|
|
8769
|
+
},
|
|
8770
|
+
cuid(params) {
|
|
8771
|
+
return this.check(/* @__PURE__ */ _cuid(ZodCUID, params));
|
|
8772
|
+
},
|
|
8773
|
+
cuid2(params) {
|
|
8774
|
+
return this.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
|
|
8775
|
+
},
|
|
8776
|
+
ulid(params) {
|
|
8777
|
+
return this.check(/* @__PURE__ */ _ulid(ZodULID, params));
|
|
8778
|
+
},
|
|
8779
|
+
base64(params) {
|
|
8780
|
+
return this.check(/* @__PURE__ */ _base64(ZodBase64, params));
|
|
8781
|
+
},
|
|
8782
|
+
base64url(params) {
|
|
8783
|
+
return this.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
|
|
8784
|
+
},
|
|
8785
|
+
xid(params) {
|
|
8786
|
+
return this.check(/* @__PURE__ */ _xid(ZodXID, params));
|
|
8787
|
+
},
|
|
8788
|
+
ksuid(params) {
|
|
8789
|
+
return this.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
|
|
8790
|
+
},
|
|
8791
|
+
ipv4(params) {
|
|
8792
|
+
return this.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
|
|
8793
|
+
},
|
|
8794
|
+
ipv6(params) {
|
|
8795
|
+
return this.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
|
|
8796
|
+
},
|
|
8797
|
+
cidrv4(params) {
|
|
8798
|
+
return this.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
|
|
8799
|
+
},
|
|
8800
|
+
cidrv6(params) {
|
|
8801
|
+
return this.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
|
|
8802
|
+
},
|
|
8803
|
+
e164(params) {
|
|
8804
|
+
return this.check(/* @__PURE__ */ _e164(ZodE164, params));
|
|
8805
|
+
},
|
|
8806
|
+
datetime(params) {
|
|
8807
|
+
return this.check(/* @__PURE__ */ _isoDateTime(ZodISODateTime, params));
|
|
8808
|
+
},
|
|
8809
|
+
date(params) {
|
|
8810
|
+
return this.check(/* @__PURE__ */ _isoDate(ZodISODate, params));
|
|
8811
|
+
},
|
|
8812
|
+
time(params) {
|
|
8813
|
+
return this.check(/* @__PURE__ */ _isoTime(ZodISOTime, params));
|
|
8814
|
+
},
|
|
8815
|
+
duration(params) {
|
|
8816
|
+
return this.check(/* @__PURE__ */ _isoDuration(ZodISODuration, params));
|
|
8817
|
+
}
|
|
7723
8818
|
});
|
|
7724
8819
|
function string$2(params) {
|
|
7725
8820
|
return /* @__PURE__ */ _string(ZodString, params);
|
|
@@ -7728,6 +8823,22 @@ const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def
|
|
|
7728
8823
|
$ZodStringFormat.init(inst, def);
|
|
7729
8824
|
_ZodString.init(inst, def);
|
|
7730
8825
|
});
|
|
8826
|
+
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
8827
|
+
$ZodISODateTime.init(inst, def);
|
|
8828
|
+
ZodStringFormat.init(inst, def);
|
|
8829
|
+
});
|
|
8830
|
+
const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
|
|
8831
|
+
$ZodISODate.init(inst, def);
|
|
8832
|
+
ZodStringFormat.init(inst, def);
|
|
8833
|
+
});
|
|
8834
|
+
const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
|
|
8835
|
+
$ZodISOTime.init(inst, def);
|
|
8836
|
+
ZodStringFormat.init(inst, def);
|
|
8837
|
+
});
|
|
8838
|
+
const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
|
|
8839
|
+
$ZodISODuration.init(inst, def);
|
|
8840
|
+
ZodStringFormat.init(inst, def);
|
|
8841
|
+
});
|
|
7731
8842
|
const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
|
|
7732
8843
|
$ZodEmail.init(inst, def);
|
|
7733
8844
|
ZodStringFormat.init(inst, def);
|
|
@@ -7813,59 +8924,58 @@ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
|
7813
8924
|
$ZodNumber.init(inst, def);
|
|
7814
8925
|
ZodType.init(inst, def);
|
|
7815
8926
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
7816
|
-
_installLazyMethods(inst, "ZodNumber", {
|
|
7817
|
-
gt(value, params) {
|
|
7818
|
-
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
7819
|
-
},
|
|
7820
|
-
gte(value, params) {
|
|
7821
|
-
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
7822
|
-
},
|
|
7823
|
-
min(value, params) {
|
|
7824
|
-
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
7825
|
-
},
|
|
7826
|
-
lt(value, params) {
|
|
7827
|
-
return this.check(/* @__PURE__ */ _lt(value, params));
|
|
7828
|
-
},
|
|
7829
|
-
lte(value, params) {
|
|
7830
|
-
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
7831
|
-
},
|
|
7832
|
-
max(value, params) {
|
|
7833
|
-
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
7834
|
-
},
|
|
7835
|
-
int(params) {
|
|
7836
|
-
return this.check(int$1(params));
|
|
7837
|
-
},
|
|
7838
|
-
safe(params) {
|
|
7839
|
-
return this.check(int$1(params));
|
|
7840
|
-
},
|
|
7841
|
-
positive(params) {
|
|
7842
|
-
return this.check(/* @__PURE__ */ _gt(0, params));
|
|
7843
|
-
},
|
|
7844
|
-
nonnegative(params) {
|
|
7845
|
-
return this.check(/* @__PURE__ */ _gte(0, params));
|
|
7846
|
-
},
|
|
7847
|
-
negative(params) {
|
|
7848
|
-
return this.check(/* @__PURE__ */ _lt(0, params));
|
|
7849
|
-
},
|
|
7850
|
-
nonpositive(params) {
|
|
7851
|
-
return this.check(/* @__PURE__ */ _lte(0, params));
|
|
7852
|
-
},
|
|
7853
|
-
multipleOf(value, params) {
|
|
7854
|
-
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
7855
|
-
},
|
|
7856
|
-
step(value, params) {
|
|
7857
|
-
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
7858
|
-
},
|
|
7859
|
-
finite() {
|
|
7860
|
-
return this;
|
|
7861
|
-
}
|
|
7862
|
-
});
|
|
7863
8927
|
const bag = inst._zod.bag;
|
|
7864
8928
|
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
7865
8929
|
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
7866
8930
|
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
7867
8931
|
inst.isFinite = true;
|
|
7868
8932
|
inst.format = bag.format ?? null;
|
|
8933
|
+
}, {
|
|
8934
|
+
gt(value, params) {
|
|
8935
|
+
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
8936
|
+
},
|
|
8937
|
+
gte(value, params) {
|
|
8938
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
8939
|
+
},
|
|
8940
|
+
min(value, params) {
|
|
8941
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
8942
|
+
},
|
|
8943
|
+
lt(value, params) {
|
|
8944
|
+
return this.check(/* @__PURE__ */ _lt(value, params));
|
|
8945
|
+
},
|
|
8946
|
+
lte(value, params) {
|
|
8947
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
8948
|
+
},
|
|
8949
|
+
max(value, params) {
|
|
8950
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
8951
|
+
},
|
|
8952
|
+
int(params) {
|
|
8953
|
+
return this.check(int$1(params));
|
|
8954
|
+
},
|
|
8955
|
+
safe(params) {
|
|
8956
|
+
return this.check(int$1(params));
|
|
8957
|
+
},
|
|
8958
|
+
positive(params) {
|
|
8959
|
+
return this.check(/* @__PURE__ */ _gt(0, params));
|
|
8960
|
+
},
|
|
8961
|
+
nonnegative(params) {
|
|
8962
|
+
return this.check(/* @__PURE__ */ _gte(0, params));
|
|
8963
|
+
},
|
|
8964
|
+
negative(params) {
|
|
8965
|
+
return this.check(/* @__PURE__ */ _lt(0, params));
|
|
8966
|
+
},
|
|
8967
|
+
nonpositive(params) {
|
|
8968
|
+
return this.check(/* @__PURE__ */ _lte(0, params));
|
|
8969
|
+
},
|
|
8970
|
+
multipleOf(value, params) {
|
|
8971
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
8972
|
+
},
|
|
8973
|
+
step(value, params) {
|
|
8974
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
8975
|
+
},
|
|
8976
|
+
finite() {
|
|
8977
|
+
return this;
|
|
8978
|
+
}
|
|
7869
8979
|
});
|
|
7870
8980
|
function number(params) {
|
|
7871
8981
|
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
@@ -7910,94 +9020,95 @@ function never(params) {
|
|
|
7910
9020
|
return /* @__PURE__ */ _never(ZodNever, params);
|
|
7911
9021
|
}
|
|
7912
9022
|
const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
9023
|
+
_ensureDefaultMemoizer();
|
|
7913
9024
|
$ZodArray.init(inst, def);
|
|
7914
9025
|
ZodType.init(inst, def);
|
|
7915
9026
|
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
7916
9027
|
inst.element = def.element;
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
});
|
|
9028
|
+
}, {
|
|
9029
|
+
min(n, params) {
|
|
9030
|
+
return this.check(/* @__PURE__ */ _minLength(n, params));
|
|
9031
|
+
},
|
|
9032
|
+
nonempty(params) {
|
|
9033
|
+
return this.check(/* @__PURE__ */ _minLength(1, params));
|
|
9034
|
+
},
|
|
9035
|
+
max(n, params) {
|
|
9036
|
+
return this.check(/* @__PURE__ */ _maxLength(n, params));
|
|
9037
|
+
},
|
|
9038
|
+
length(n, params) {
|
|
9039
|
+
return this.check(/* @__PURE__ */ _length(n, params));
|
|
9040
|
+
},
|
|
9041
|
+
unwrap() {
|
|
9042
|
+
return this.element;
|
|
9043
|
+
}
|
|
7934
9044
|
});
|
|
7935
9045
|
function array(element, params) {
|
|
7936
9046
|
return /* @__PURE__ */ _array(ZodArray, element, params);
|
|
7937
9047
|
}
|
|
7938
9048
|
const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
9049
|
+
_ensureDefaultMemoizer();
|
|
7939
9050
|
$ZodObjectJIT.init(inst, def);
|
|
7940
9051
|
ZodType.init(inst, def);
|
|
7941
9052
|
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
}
|
|
9053
|
+
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
9054
|
+
}, {
|
|
9055
|
+
keyof() {
|
|
9056
|
+
return _enum(Object.keys(this._zod.def.shape));
|
|
9057
|
+
},
|
|
9058
|
+
catchall(catchall) {
|
|
9059
|
+
return this.clone({
|
|
9060
|
+
...this._zod.def,
|
|
9061
|
+
catchall
|
|
9062
|
+
});
|
|
9063
|
+
},
|
|
9064
|
+
passthrough() {
|
|
9065
|
+
return this.clone({
|
|
9066
|
+
...this._zod.def,
|
|
9067
|
+
catchall: unknown$1()
|
|
9068
|
+
});
|
|
9069
|
+
},
|
|
9070
|
+
loose() {
|
|
9071
|
+
return this.clone({
|
|
9072
|
+
...this._zod.def,
|
|
9073
|
+
catchall: unknown$1()
|
|
9074
|
+
});
|
|
9075
|
+
},
|
|
9076
|
+
strict() {
|
|
9077
|
+
return this.clone({
|
|
9078
|
+
...this._zod.def,
|
|
9079
|
+
catchall: never()
|
|
9080
|
+
});
|
|
9081
|
+
},
|
|
9082
|
+
strip() {
|
|
9083
|
+
return this.clone({
|
|
9084
|
+
...this._zod.def,
|
|
9085
|
+
catchall: void 0
|
|
9086
|
+
});
|
|
9087
|
+
},
|
|
9088
|
+
extend(incoming) {
|
|
9089
|
+
return extend$1(this, incoming);
|
|
9090
|
+
},
|
|
9091
|
+
safeExtend(incoming) {
|
|
9092
|
+
return safeExtend(this, incoming);
|
|
9093
|
+
},
|
|
9094
|
+
merge(other) {
|
|
9095
|
+
return merge$1(this, other);
|
|
9096
|
+
},
|
|
9097
|
+
pick(mask) {
|
|
9098
|
+
return pick$2(this, mask);
|
|
9099
|
+
},
|
|
9100
|
+
omit(mask) {
|
|
9101
|
+
return omit(this, mask);
|
|
9102
|
+
},
|
|
9103
|
+
partial(...args) {
|
|
9104
|
+
return partial(ZodOptional, this, args[0]);
|
|
9105
|
+
},
|
|
9106
|
+
exactPartial(...args) {
|
|
9107
|
+
return partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
9108
|
+
},
|
|
9109
|
+
required(...args) {
|
|
9110
|
+
return required(ZodNonOptional, this, args[0]);
|
|
9111
|
+
}
|
|
8001
9112
|
});
|
|
8002
9113
|
function object(shape, params) {
|
|
8003
9114
|
const def = {
|
|
@@ -8053,6 +9164,7 @@ function intersection(left, right) {
|
|
|
8053
9164
|
});
|
|
8054
9165
|
}
|
|
8055
9166
|
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
9167
|
+
_ensureDefaultMemoizer();
|
|
8056
9168
|
$ZodRecord.init(inst, def);
|
|
8057
9169
|
ZodType.init(inst, def);
|
|
8058
9170
|
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
@@ -8129,6 +9241,7 @@ function literal$1(value, params) {
|
|
|
8129
9241
|
});
|
|
8130
9242
|
}
|
|
8131
9243
|
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
9244
|
+
_ensureDefaultMemoizer();
|
|
8132
9245
|
$ZodTransform.init(inst, def);
|
|
8133
9246
|
ZodType.init(inst, def);
|
|
8134
9247
|
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
@@ -8140,7 +9253,7 @@ const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
|
8140
9253
|
const _issue = issue$1;
|
|
8141
9254
|
if (_issue.fatal) _issue.continue = false;
|
|
8142
9255
|
_issue.code ?? (_issue.code = "custom");
|
|
8143
|
-
|
|
9256
|
+
if (!("input" in _issue)) _issue.input = payload.value;
|
|
8144
9257
|
_issue.inst ?? (_issue.inst = inst);
|
|
8145
9258
|
payload.issues.push(issue(_issue));
|
|
8146
9259
|
}
|
|
@@ -8148,11 +9261,9 @@ const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
|
8148
9261
|
const output = def.transform(payload.value, payload);
|
|
8149
9262
|
if (output instanceof Promise) return output.then((output) => {
|
|
8150
9263
|
payload.value = output;
|
|
8151
|
-
payload.fallback = true;
|
|
8152
9264
|
return payload;
|
|
8153
9265
|
});
|
|
8154
9266
|
payload.value = output;
|
|
8155
|
-
payload.fallback = true;
|
|
8156
9267
|
return payload;
|
|
8157
9268
|
};
|
|
8158
9269
|
});
|
|
@@ -8253,7 +9364,7 @@ function _catch(innerType, catchValue) {
|
|
|
8253
9364
|
return new ZodCatch({
|
|
8254
9365
|
type: "catch",
|
|
8255
9366
|
innerType,
|
|
8256
|
-
catchValue: typeof catchValue === "function" ? catchValue : ()
|
|
9367
|
+
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
8257
9368
|
});
|
|
8258
9369
|
}
|
|
8259
9370
|
const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
@@ -8308,7 +9419,12 @@ function preprocess$1(fn, schema) {
|
|
|
8308
9419
|
});
|
|
8309
9420
|
}
|
|
8310
9421
|
//#endregion
|
|
8311
|
-
//#region ../../node_modules/.pnpm
|
|
9422
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/iso.js
|
|
9423
|
+
function datetime(params) {
|
|
9424
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
9425
|
+
}
|
|
9426
|
+
//#endregion
|
|
9427
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
8312
9428
|
const LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
8313
9429
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
8314
9430
|
LATEST_PROTOCOL_VERSION,
|
|
@@ -10209,7 +11325,7 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
10209
11325
|
}
|
|
10210
11326
|
};
|
|
10211
11327
|
//#endregion
|
|
10212
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
11328
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
10213
11329
|
/**
|
|
10214
11330
|
* Experimental task interfaces for MCP SDK.
|
|
10215
11331
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -10226,7 +11342,7 @@ function isTerminal(status) {
|
|
|
10226
11342
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
10227
11343
|
}
|
|
10228
11344
|
//#endregion
|
|
10229
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11345
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
10230
11346
|
const ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
10231
11347
|
const defaultOptions$1 = {
|
|
10232
11348
|
name: void 0,
|
|
@@ -10260,7 +11376,7 @@ const getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
10260
11376
|
...options
|
|
10261
11377
|
};
|
|
10262
11378
|
//#endregion
|
|
10263
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11379
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
10264
11380
|
const getRefs = (options) => {
|
|
10265
11381
|
const _options = getDefaultOptions(options);
|
|
10266
11382
|
const currentPath = _options.name !== void 0 ? [
|
|
@@ -10285,7 +11401,7 @@ const getRefs = (options) => {
|
|
|
10285
11401
|
};
|
|
10286
11402
|
};
|
|
10287
11403
|
//#endregion
|
|
10288
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11404
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
10289
11405
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
10290
11406
|
if (!refs?.errorMessages) return;
|
|
10291
11407
|
if (errorMessage) res.errorMessage = {
|
|
@@ -10298,14 +11414,14 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
10298
11414
|
addErrorMessage(res, key, errorMessage, refs);
|
|
10299
11415
|
}
|
|
10300
11416
|
//#endregion
|
|
10301
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11417
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
10302
11418
|
const getRelativePath = (pathA, pathB) => {
|
|
10303
11419
|
let i = 0;
|
|
10304
11420
|
for (; i < pathA.length && i < pathB.length; i++) if (pathA[i] !== pathB[i]) break;
|
|
10305
11421
|
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
10306
11422
|
};
|
|
10307
11423
|
//#endregion
|
|
10308
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11424
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
10309
11425
|
function parseAnyDef(refs) {
|
|
10310
11426
|
if (refs.target !== "openAi") return {};
|
|
10311
11427
|
const anyDefinitionPath = [
|
|
@@ -10317,7 +11433,7 @@ function parseAnyDef(refs) {
|
|
|
10317
11433
|
return { $ref: refs.$refStrategy === "relative" ? getRelativePath(anyDefinitionPath, refs.currentPath) : anyDefinitionPath.join("/") };
|
|
10318
11434
|
}
|
|
10319
11435
|
//#endregion
|
|
10320
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11436
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
10321
11437
|
function parseArrayDef(def, refs) {
|
|
10322
11438
|
const res = { type: "array" };
|
|
10323
11439
|
if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) res.items = parseDef(def.type._def, {
|
|
@@ -10333,7 +11449,7 @@ function parseArrayDef(def, refs) {
|
|
|
10333
11449
|
return res;
|
|
10334
11450
|
}
|
|
10335
11451
|
//#endregion
|
|
10336
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11452
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
10337
11453
|
function parseBigintDef(def, refs) {
|
|
10338
11454
|
const res = {
|
|
10339
11455
|
type: "integer",
|
|
@@ -10364,22 +11480,22 @@ function parseBigintDef(def, refs) {
|
|
|
10364
11480
|
return res;
|
|
10365
11481
|
}
|
|
10366
11482
|
//#endregion
|
|
10367
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11483
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
10368
11484
|
function parseBooleanDef() {
|
|
10369
11485
|
return { type: "boolean" };
|
|
10370
11486
|
}
|
|
10371
11487
|
//#endregion
|
|
10372
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11488
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
10373
11489
|
function parseBrandedDef(_def, refs) {
|
|
10374
11490
|
return parseDef(_def.type._def, refs);
|
|
10375
11491
|
}
|
|
10376
11492
|
//#endregion
|
|
10377
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11493
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
10378
11494
|
const parseCatchDef = (def, refs) => {
|
|
10379
11495
|
return parseDef(def.innerType._def, refs);
|
|
10380
11496
|
};
|
|
10381
11497
|
//#endregion
|
|
10382
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11498
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
10383
11499
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
10384
11500
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
10385
11501
|
if (Array.isArray(strategy)) return { anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)) };
|
|
@@ -10411,7 +11527,7 @@ const integerDateParser = (def, refs) => {
|
|
|
10411
11527
|
return res;
|
|
10412
11528
|
};
|
|
10413
11529
|
//#endregion
|
|
10414
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11530
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
10415
11531
|
function parseDefaultDef(_def, refs) {
|
|
10416
11532
|
return {
|
|
10417
11533
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -10419,12 +11535,12 @@ function parseDefaultDef(_def, refs) {
|
|
|
10419
11535
|
};
|
|
10420
11536
|
}
|
|
10421
11537
|
//#endregion
|
|
10422
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11538
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
10423
11539
|
function parseEffectsDef(_def, refs) {
|
|
10424
11540
|
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
10425
11541
|
}
|
|
10426
11542
|
//#endregion
|
|
10427
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11543
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
10428
11544
|
function parseEnumDef(def) {
|
|
10429
11545
|
return {
|
|
10430
11546
|
type: "string",
|
|
@@ -10432,7 +11548,7 @@ function parseEnumDef(def) {
|
|
|
10432
11548
|
};
|
|
10433
11549
|
}
|
|
10434
11550
|
//#endregion
|
|
10435
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11551
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
10436
11552
|
const isJsonSchema7AllOfType = (type) => {
|
|
10437
11553
|
if ("type" in type && type.type === "string") return false;
|
|
10438
11554
|
return "allOf" in type;
|
|
@@ -10474,7 +11590,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
10474
11590
|
} : void 0;
|
|
10475
11591
|
}
|
|
10476
11592
|
//#endregion
|
|
10477
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11593
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
10478
11594
|
function parseLiteralDef(def, refs) {
|
|
10479
11595
|
const parsedType = typeof def.value;
|
|
10480
11596
|
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") return { type: Array.isArray(def.value) ? "array" : "object" };
|
|
@@ -10488,7 +11604,7 @@ function parseLiteralDef(def, refs) {
|
|
|
10488
11604
|
};
|
|
10489
11605
|
}
|
|
10490
11606
|
//#endregion
|
|
10491
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11607
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
10492
11608
|
let emojiRegex = void 0;
|
|
10493
11609
|
/**
|
|
10494
11610
|
* Generated from the regular expressions found here as of 2024-05-22:
|
|
@@ -10751,7 +11867,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
10751
11867
|
return pattern;
|
|
10752
11868
|
}
|
|
10753
11869
|
//#endregion
|
|
10754
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11870
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
10755
11871
|
function parseRecordDef(def, refs) {
|
|
10756
11872
|
if (refs.target === "openAi") console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
10757
11873
|
if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) return {
|
|
@@ -10798,7 +11914,7 @@ function parseRecordDef(def, refs) {
|
|
|
10798
11914
|
return schema;
|
|
10799
11915
|
}
|
|
10800
11916
|
//#endregion
|
|
10801
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11917
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
10802
11918
|
function parseMapDef(def, refs) {
|
|
10803
11919
|
if (refs.mapStrategy === "record") return parseRecordDef(def, refs);
|
|
10804
11920
|
return {
|
|
@@ -10829,7 +11945,7 @@ function parseMapDef(def, refs) {
|
|
|
10829
11945
|
};
|
|
10830
11946
|
}
|
|
10831
11947
|
//#endregion
|
|
10832
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11948
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
10833
11949
|
function parseNativeEnumDef(def) {
|
|
10834
11950
|
const object = def.values;
|
|
10835
11951
|
const actualValues = Object.keys(def.values).filter((key) => {
|
|
@@ -10842,7 +11958,7 @@ function parseNativeEnumDef(def) {
|
|
|
10842
11958
|
};
|
|
10843
11959
|
}
|
|
10844
11960
|
//#endregion
|
|
10845
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11961
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
10846
11962
|
function parseNeverDef(refs) {
|
|
10847
11963
|
return refs.target === "openAi" ? void 0 : { not: parseAnyDef({
|
|
10848
11964
|
...refs,
|
|
@@ -10850,7 +11966,7 @@ function parseNeverDef(refs) {
|
|
|
10850
11966
|
}) };
|
|
10851
11967
|
}
|
|
10852
11968
|
//#endregion
|
|
10853
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11969
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
10854
11970
|
function parseNullDef(refs) {
|
|
10855
11971
|
return refs.target === "openApi3" ? {
|
|
10856
11972
|
enum: ["null"],
|
|
@@ -10858,7 +11974,7 @@ function parseNullDef(refs) {
|
|
|
10858
11974
|
} : { type: "null" };
|
|
10859
11975
|
}
|
|
10860
11976
|
//#endregion
|
|
10861
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
11977
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
10862
11978
|
const primitiveMappings = {
|
|
10863
11979
|
ZodString: "string",
|
|
10864
11980
|
ZodNumber: "number",
|
|
@@ -10914,7 +12030,7 @@ const asAnyOf = (def, refs) => {
|
|
|
10914
12030
|
return anyOf.length ? { anyOf } : void 0;
|
|
10915
12031
|
};
|
|
10916
12032
|
//#endregion
|
|
10917
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12033
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
10918
12034
|
function parseNullableDef(def, refs) {
|
|
10919
12035
|
if ([
|
|
10920
12036
|
"ZodString",
|
|
@@ -10954,7 +12070,7 @@ function parseNullableDef(def, refs) {
|
|
|
10954
12070
|
return base && { anyOf: [base, { type: "null" }] };
|
|
10955
12071
|
}
|
|
10956
12072
|
//#endregion
|
|
10957
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12073
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
10958
12074
|
function parseNumberDef(def, refs) {
|
|
10959
12075
|
const res = { type: "number" };
|
|
10960
12076
|
if (!def.checks) return res;
|
|
@@ -10986,7 +12102,7 @@ function parseNumberDef(def, refs) {
|
|
|
10986
12102
|
return res;
|
|
10987
12103
|
}
|
|
10988
12104
|
//#endregion
|
|
10989
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12105
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
10990
12106
|
function parseObjectDef(def, refs) {
|
|
10991
12107
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
10992
12108
|
const result = {
|
|
@@ -11045,7 +12161,7 @@ function safeIsOptional(schema) {
|
|
|
11045
12161
|
}
|
|
11046
12162
|
}
|
|
11047
12163
|
//#endregion
|
|
11048
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12164
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
11049
12165
|
const parseOptionalDef = (def, refs) => {
|
|
11050
12166
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) return parseDef(def.innerType._def, refs);
|
|
11051
12167
|
const innerSchema = parseDef(def.innerType._def, {
|
|
@@ -11059,7 +12175,7 @@ const parseOptionalDef = (def, refs) => {
|
|
|
11059
12175
|
return innerSchema ? { anyOf: [{ not: parseAnyDef(refs) }, innerSchema] } : parseAnyDef(refs);
|
|
11060
12176
|
};
|
|
11061
12177
|
//#endregion
|
|
11062
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12178
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
11063
12179
|
const parsePipelineDef = (def, refs) => {
|
|
11064
12180
|
if (refs.pipeStrategy === "input") return parseDef(def.in._def, refs);
|
|
11065
12181
|
else if (refs.pipeStrategy === "output") return parseDef(def.out._def, refs);
|
|
@@ -11081,12 +12197,12 @@ const parsePipelineDef = (def, refs) => {
|
|
|
11081
12197
|
})].filter((x) => x !== void 0) };
|
|
11082
12198
|
};
|
|
11083
12199
|
//#endregion
|
|
11084
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12200
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
11085
12201
|
function parsePromiseDef(def, refs) {
|
|
11086
12202
|
return parseDef(def.type._def, refs);
|
|
11087
12203
|
}
|
|
11088
12204
|
//#endregion
|
|
11089
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12205
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
11090
12206
|
function parseSetDef(def, refs) {
|
|
11091
12207
|
const schema = {
|
|
11092
12208
|
type: "array",
|
|
@@ -11101,7 +12217,7 @@ function parseSetDef(def, refs) {
|
|
|
11101
12217
|
return schema;
|
|
11102
12218
|
}
|
|
11103
12219
|
//#endregion
|
|
11104
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12220
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
11105
12221
|
function parseTupleDef(def, refs) {
|
|
11106
12222
|
if (def.rest) return {
|
|
11107
12223
|
type: "array",
|
|
@@ -11134,22 +12250,22 @@ function parseTupleDef(def, refs) {
|
|
|
11134
12250
|
};
|
|
11135
12251
|
}
|
|
11136
12252
|
//#endregion
|
|
11137
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12253
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
11138
12254
|
function parseUndefinedDef(refs) {
|
|
11139
12255
|
return { not: parseAnyDef(refs) };
|
|
11140
12256
|
}
|
|
11141
12257
|
//#endregion
|
|
11142
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12258
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
11143
12259
|
function parseUnknownDef(refs) {
|
|
11144
12260
|
return parseAnyDef(refs);
|
|
11145
12261
|
}
|
|
11146
12262
|
//#endregion
|
|
11147
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12263
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
11148
12264
|
const parseReadonlyDef = (def, refs) => {
|
|
11149
12265
|
return parseDef(def.innerType._def, refs);
|
|
11150
12266
|
};
|
|
11151
12267
|
//#endregion
|
|
11152
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12268
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
11153
12269
|
const selectParser = (def, typeName, refs) => {
|
|
11154
12270
|
switch (typeName) {
|
|
11155
12271
|
case ZodFirstPartyTypeKind.ZodString: return parseStringDef(def, refs);
|
|
@@ -11192,7 +12308,7 @@ const selectParser = (def, typeName, refs) => {
|
|
|
11192
12308
|
}
|
|
11193
12309
|
};
|
|
11194
12310
|
//#endregion
|
|
11195
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12311
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
11196
12312
|
function parseDef(def, refs, forceResolution = false) {
|
|
11197
12313
|
const seenItem = refs.seen.get(def);
|
|
11198
12314
|
if (refs.override) {
|
|
@@ -11241,7 +12357,7 @@ const addMeta = (def, refs, jsonSchema) => {
|
|
|
11241
12357
|
return jsonSchema;
|
|
11242
12358
|
};
|
|
11243
12359
|
//#endregion
|
|
11244
|
-
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.4
|
|
12360
|
+
//#region ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
11245
12361
|
const zodToJsonSchema = (schema, options) => {
|
|
11246
12362
|
const refs = getRefs(options);
|
|
11247
12363
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({
|
|
@@ -11304,7 +12420,7 @@ const zodToJsonSchema = (schema, options) => {
|
|
|
11304
12420
|
return combined;
|
|
11305
12421
|
};
|
|
11306
12422
|
//#endregion
|
|
11307
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
12423
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
11308
12424
|
function mapMiniTarget(t) {
|
|
11309
12425
|
if (!t) return "draft-7";
|
|
11310
12426
|
if (t === "jsonSchema7" || t === "draft-7") return "draft-7";
|
|
@@ -18265,7 +19381,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
18265
19381
|
exports.default = formatsPlugin;
|
|
18266
19382
|
}));
|
|
18267
19383
|
//#endregion
|
|
18268
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
19384
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
18269
19385
|
var import_ajv = /* @__PURE__ */ __toESM(require_ajv(), 1);
|
|
18270
19386
|
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
18271
19387
|
function createDefaultAjvInstance() {
|
|
@@ -18341,7 +19457,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
18341
19457
|
}
|
|
18342
19458
|
};
|
|
18343
19459
|
//#endregion
|
|
18344
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
19460
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
18345
19461
|
/**
|
|
18346
19462
|
* Experimental server task features for MCP SDK.
|
|
18347
19463
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -18559,7 +19675,7 @@ var ExperimentalServerTasks = class {
|
|
|
18559
19675
|
}
|
|
18560
19676
|
};
|
|
18561
19677
|
//#endregion
|
|
18562
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
19678
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
18563
19679
|
/**
|
|
18564
19680
|
* Experimental task capability assertion helpers.
|
|
18565
19681
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -18604,7 +19720,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
18604
19720
|
}
|
|
18605
19721
|
}
|
|
18606
19722
|
//#endregion
|
|
18607
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
19723
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
18608
19724
|
/**
|
|
18609
19725
|
* An MCP server on top of a pluggable transport.
|
|
18610
19726
|
*
|
|
@@ -18927,7 +20043,7 @@ var Server = class extends Protocol {
|
|
|
18927
20043
|
}
|
|
18928
20044
|
};
|
|
18929
20045
|
//#endregion
|
|
18930
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
20046
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
18931
20047
|
const COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
18932
20048
|
/**
|
|
18933
20049
|
* Checks if a schema is completable (has completion metadata).
|
|
@@ -18946,7 +20062,7 @@ var McpZodTypeKind;
|
|
|
18946
20062
|
McpZodTypeKind["Completable"] = "McpCompletable";
|
|
18947
20063
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
18948
20064
|
//#endregion
|
|
18949
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
20065
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
18950
20066
|
/**
|
|
18951
20067
|
* Tool name validation utilities according to SEP: Specify Format for Tool Names
|
|
18952
20068
|
*
|
|
@@ -19017,7 +20133,7 @@ function validateAndWarnToolName(name) {
|
|
|
19017
20133
|
return result.isValid;
|
|
19018
20134
|
}
|
|
19019
20135
|
//#endregion
|
|
19020
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
20136
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
19021
20137
|
/**
|
|
19022
20138
|
* Experimental McpServer task features for MCP SDK.
|
|
19023
20139
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -19048,7 +20164,7 @@ var ExperimentalMcpServerTasks = class {
|
|
|
19048
20164
|
}
|
|
19049
20165
|
};
|
|
19050
20166
|
//#endregion
|
|
19051
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
20167
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
19052
20168
|
/**
|
|
19053
20169
|
* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
|
|
19054
20170
|
* For advanced usage (like sending notifications or setting custom request handlers), use the underlying
|
|
@@ -19706,7 +20822,7 @@ function serializeMessage(message) {
|
|
|
19706
20822
|
return JSON.stringify(message) + "\n";
|
|
19707
20823
|
}
|
|
19708
20824
|
//#endregion
|
|
19709
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4
|
|
20825
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
19710
20826
|
/**
|
|
19711
20827
|
* Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout.
|
|
19712
20828
|
*
|
|
@@ -20801,17 +21917,17 @@ const NX_VERSION = {
|
|
|
20801
21917
|
"@aws/aws-distro-opentelemetry-node-autoinstrumentation": "0.12.0",
|
|
20802
21918
|
"@opentelemetry/propagator-jaeger": "2.10.0",
|
|
20803
21919
|
minimatch: "10.2.6",
|
|
20804
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
20805
|
-
"@aws-sdk/client-api-gateway": "3.
|
|
20806
|
-
"@aws-sdk/client-iam": "3.
|
|
20807
|
-
"@aws-sdk/client-bedrock-agentcore": "3.
|
|
20808
|
-
"@aws-sdk/client-bedrock-runtime": "3.
|
|
20809
|
-
"@aws-sdk/client-s3": "3.
|
|
20810
|
-
"@aws-sdk/client-sts": "3.
|
|
20811
|
-
"@aws-sdk/credential-providers": "3.
|
|
21920
|
+
"@aws-sdk/client-dynamodb": "3.1121.0",
|
|
21921
|
+
"@aws-sdk/client-api-gateway": "3.1121.0",
|
|
21922
|
+
"@aws-sdk/client-iam": "3.1121.0",
|
|
21923
|
+
"@aws-sdk/client-bedrock-agentcore": "3.1121.0",
|
|
21924
|
+
"@aws-sdk/client-bedrock-runtime": "3.1121.0",
|
|
21925
|
+
"@aws-sdk/client-s3": "3.1121.0",
|
|
21926
|
+
"@aws-sdk/client-sts": "3.1121.0",
|
|
21927
|
+
"@aws-sdk/credential-providers": "3.1121.0",
|
|
20812
21928
|
"@aws-sdk/credential-provider-cognito-identity": "3.972.69",
|
|
20813
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
20814
|
-
"@aws-sdk/rds-signer": "3.
|
|
21929
|
+
"@aws-sdk/client-secrets-manager": "3.1121.0",
|
|
21930
|
+
"@aws-sdk/rds-signer": "3.1121.0",
|
|
20815
21931
|
"@smithy/server-apigateway": "0.3.3",
|
|
20816
21932
|
"@smithy/server-node": "0.3.3",
|
|
20817
21933
|
"@aws-lambda-powertools/logger": "2.35.0",
|
|
@@ -20819,8 +21935,8 @@ const NX_VERSION = {
|
|
|
20819
21935
|
"@aws-lambda-powertools/parameters": "2.35.0",
|
|
20820
21936
|
"@aws-lambda-powertools/tracer": "2.35.0",
|
|
20821
21937
|
"@aws-lambda-powertools/parser": "2.35.0",
|
|
20822
|
-
"@aws-sdk/client-appconfigdata": "3.
|
|
20823
|
-
"@middy/core": "7.
|
|
21938
|
+
"@aws-sdk/client-appconfigdata": "3.1121.0",
|
|
21939
|
+
"@middy/core": "7.9.2",
|
|
20824
21940
|
"@nxlv/python": "23.0.0",
|
|
20825
21941
|
"@nx-extend/terraform": "10.4.1",
|
|
20826
21942
|
nx: "23.1.2",
|
|
@@ -20841,20 +21957,20 @@ const NX_VERSION = {
|
|
|
20841
21957
|
"@ag-ui/core": "0.0.57",
|
|
20842
21958
|
"@ag-ui/encoder": "0.0.57",
|
|
20843
21959
|
"agent-chat-cli": "0.3.0",
|
|
20844
|
-
"@copilotkit/react-core": "1.69.
|
|
21960
|
+
"@copilotkit/react-core": "1.69.3",
|
|
20845
21961
|
rxjs: "7.8.2",
|
|
20846
|
-
"@strands-agents/sdk": "1.
|
|
21962
|
+
"@strands-agents/sdk": "1.15.0",
|
|
20847
21963
|
"@tanstack/react-router": "1.170.32",
|
|
20848
21964
|
"@tanstack/router-plugin": "1.168.35",
|
|
20849
21965
|
"@tanstack/router-generator": "1.167.33",
|
|
20850
21966
|
"@tanstack/virtual-file-routes": "1.162.0",
|
|
20851
21967
|
"@tanstack/router-utils": "1.162.2",
|
|
20852
|
-
"@cloudscape-design/board-components": "3.0.
|
|
20853
|
-
"@cloudscape-design/chat-components": "1.0.
|
|
20854
|
-
"@cloudscape-design/components": "3.0.
|
|
21968
|
+
"@cloudscape-design/board-components": "3.0.221",
|
|
21969
|
+
"@cloudscape-design/chat-components": "1.0.165",
|
|
21970
|
+
"@cloudscape-design/components": "3.0.1356",
|
|
20855
21971
|
"@cloudscape-design/global-styles": "1.0.67",
|
|
20856
|
-
"@tanstack/react-query": "5.102.
|
|
20857
|
-
"@tanstack/react-query-devtools": "5.102.
|
|
21972
|
+
"@tanstack/react-query": "5.102.8",
|
|
21973
|
+
"@tanstack/react-query-devtools": "5.102.8",
|
|
20858
21974
|
"@trpc/tanstack-react-query": "11.18.0",
|
|
20859
21975
|
"@trpc/client": "11.18.0",
|
|
20860
21976
|
"@trpc/server": "11.18.0",
|
|
@@ -20871,12 +21987,12 @@ const NX_VERSION = {
|
|
|
20871
21987
|
"@vitest/coverage-v8": "4.1.11",
|
|
20872
21988
|
"@vitest/ui": "4.1.11",
|
|
20873
21989
|
"@astrojs/react": "6.0.4",
|
|
20874
|
-
"@astrojs/starlight": "0.41.
|
|
20875
|
-
astro: "7.2.
|
|
21990
|
+
"@astrojs/starlight": "0.41.10",
|
|
21991
|
+
astro: "7.2.9",
|
|
20876
21992
|
cookie: "2.0.1",
|
|
20877
21993
|
aws4fetch: "1.0.20",
|
|
20878
21994
|
"aws-cdk": "2.1139.0",
|
|
20879
|
-
"aws-cdk-lib": "2.
|
|
21995
|
+
"aws-cdk-lib": "2.267.0",
|
|
20880
21996
|
"aws-xray-sdk-core": "3.12.0",
|
|
20881
21997
|
constructs: "10.8.1",
|
|
20882
21998
|
cors: "2.8.6",
|
|
@@ -20889,7 +22005,7 @@ const NX_VERSION = {
|
|
|
20889
22005
|
esbuild: "0.28.2",
|
|
20890
22006
|
"event-source-polyfill": "1.0.31",
|
|
20891
22007
|
"@types/event-source-polyfill": "1.0.5",
|
|
20892
|
-
"@biomejs/biome": "2.5.
|
|
22008
|
+
"@biomejs/biome": "2.5.11",
|
|
20893
22009
|
"@prisma/adapter-mariadb": "7.10.0",
|
|
20894
22010
|
"@prisma/adapter-pg": "7.10.0",
|
|
20895
22011
|
"@prisma/client": "7.10.0",
|
|
@@ -20914,14 +22030,14 @@ const NX_VERSION = {
|
|
|
20914
22030
|
"react-dom": "19.2.8",
|
|
20915
22031
|
rimraf: "6.1.3",
|
|
20916
22032
|
rolldown: "1.2.6",
|
|
20917
|
-
"rolldown-plugin-dts": "0.28.
|
|
22033
|
+
"rolldown-plugin-dts": "0.28.3",
|
|
20918
22034
|
"simple-git": "3.36.0",
|
|
20919
22035
|
"source-map-support": "0.5.21",
|
|
20920
22036
|
"starlight-blog": "0.29.0",
|
|
20921
22037
|
tailwindcss: "4.3.3",
|
|
20922
22038
|
"@tailwindcss/vite": "4.3.3",
|
|
20923
22039
|
tsx: "4.23.12",
|
|
20924
|
-
"lucide-react": "1.
|
|
22040
|
+
"lucide-react": "1.37.0",
|
|
20925
22041
|
"radix-ui": "1.6.7",
|
|
20926
22042
|
shadcn: "4.19.0",
|
|
20927
22043
|
"tw-animate-css": "1.4.0",
|
|
@@ -20929,7 +22045,7 @@ const NX_VERSION = {
|
|
|
20929
22045
|
vite: "8.2.2",
|
|
20930
22046
|
typescript: "6.0.3",
|
|
20931
22047
|
vitest: "4.1.11",
|
|
20932
|
-
zod: "4.4
|
|
22048
|
+
zod: "4.5.4",
|
|
20933
22049
|
ws: "8.21.3"
|
|
20934
22050
|
}.nx;
|
|
20935
22051
|
//#endregion
|