@ariestools/cli 0.1.20 → 0.1.22
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/README.md +624 -95
- package/dist/bin/aries.mjs +156017 -96534
- package/dist/bin/daemons/chain-server.mjs +931 -443
- package/dist/bin/daemons/dapp-server.mjs +21 -20
- package/dist/bin/daemons/datalake-dev.mjs +1450 -773
- package/dist/node/datalake.d.ts +48 -9
- package/dist/node/datalake.mjs +1029 -16
- package/package.json +24 -23
- package/dist/plugins/xy-readme/.claude-plugin/plugin.json +0 -5
- package/dist/plugins/xy-readme/skills/readme-audit/SKILL.md +0 -187
- package/dist/plugins/xy-readme/skills/readme-author/SKILL.md +0 -293
- package/dist/plugins/xy-readme/skills/readme-init/SKILL.md +0 -243
|
@@ -18,7 +18,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
18
18
|
return target;
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
21
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/util.js
|
|
22
22
|
function getEnumValues(entries) {
|
|
23
23
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
24
24
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -30,14 +30,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
30
30
|
if (typeof value === "bigint") return value.toString();
|
|
31
31
|
return value;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
var Cached = class {
|
|
34
|
+
constructor(getter) {
|
|
35
|
+
this._getter = getter;
|
|
36
|
+
this._value = void 0;
|
|
37
|
+
}
|
|
38
|
+
get value() {
|
|
39
|
+
const getter = this._getter;
|
|
40
|
+
if (getter !== void 0) {
|
|
41
|
+
this._value = getter();
|
|
42
|
+
this._getter = void 0;
|
|
39
43
|
}
|
|
40
|
-
|
|
44
|
+
return this._value;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function cached(getter) {
|
|
48
|
+
return new Cached(getter);
|
|
41
49
|
}
|
|
42
50
|
function nullish$1(input) {
|
|
43
51
|
return input === null || input === void 0;
|
|
@@ -80,6 +88,58 @@ function assignProp(target, prop, value) {
|
|
|
80
88
|
configurable: true
|
|
81
89
|
});
|
|
82
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
93
|
+
*
|
|
94
|
+
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
95
|
+
*/
|
|
96
|
+
function rawShape(def) {
|
|
97
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
98
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
99
|
+
}
|
|
100
|
+
function sourceShape(schema) {
|
|
101
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
102
|
+
}
|
|
103
|
+
function deferProp(target, key, getter) {
|
|
104
|
+
Object.defineProperty(target, key, {
|
|
105
|
+
get() {
|
|
106
|
+
const value = getter();
|
|
107
|
+
assignProp(this, key, value);
|
|
108
|
+
return value;
|
|
109
|
+
},
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function putProp(target, key, value) {
|
|
115
|
+
if (key in target) assignProp(target, key, value);
|
|
116
|
+
else target[key] = value;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
|
|
120
|
+
*
|
|
121
|
+
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
|
|
122
|
+
*/
|
|
123
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
124
|
+
const raw = sourceShape(source);
|
|
125
|
+
for (const key of keys) {
|
|
126
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
127
|
+
if (!desc.enumerable) continue;
|
|
128
|
+
if (desc.get) deferProp(target, key, () => {
|
|
129
|
+
const value = source._zod.def.shape[key];
|
|
130
|
+
return wrap ? wrap(value, key) : value;
|
|
131
|
+
});
|
|
132
|
+
else putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function mirrorProps(target, source) {
|
|
136
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
137
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
138
|
+
if (!desc.enumerable) continue;
|
|
139
|
+
if (desc.get) deferProp(target, key, () => source[key]);
|
|
140
|
+
else putProp(target, key, desc.value);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
83
143
|
function mergeDefs(...defs) {
|
|
84
144
|
const mergedDescriptors = {};
|
|
85
145
|
for (const def of defs) {
|
|
@@ -186,35 +246,31 @@ function pick(schema, mask) {
|
|
|
186
246
|
const currDef = schema._zod.def;
|
|
187
247
|
const checks = currDef.checks;
|
|
188
248
|
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
194
|
-
if (!mask[key]) continue;
|
|
195
|
-
assignProp(newShape, key, currDef.shape[key]);
|
|
196
|
-
}
|
|
197
|
-
assignProp(this, "shape", newShape);
|
|
198
|
-
return newShape;
|
|
199
|
-
},
|
|
249
|
+
const newShape = {};
|
|
250
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
251
|
+
return clone(schema, mergeDefs(currDef, {
|
|
252
|
+
shape: newShape,
|
|
200
253
|
checks: []
|
|
201
254
|
}));
|
|
202
255
|
}
|
|
256
|
+
function maskedKeys(schema, mask) {
|
|
257
|
+
const raw = sourceShape(schema);
|
|
258
|
+
const keys = [];
|
|
259
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
260
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
261
|
+
if (mask[key]) keys.push(key);
|
|
262
|
+
}
|
|
263
|
+
return keys;
|
|
264
|
+
}
|
|
203
265
|
function omit(schema, mask) {
|
|
204
266
|
const currDef = schema._zod.def;
|
|
205
267
|
const checks = currDef.checks;
|
|
206
268
|
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (!mask[key]) continue;
|
|
213
|
-
delete newShape[key];
|
|
214
|
-
}
|
|
215
|
-
assignProp(this, "shape", newShape);
|
|
216
|
-
return newShape;
|
|
217
|
-
},
|
|
269
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
270
|
+
const newShape = {};
|
|
271
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
272
|
+
return clone(schema, mergeDefs(currDef, {
|
|
273
|
+
shape: newShape,
|
|
218
274
|
checks: []
|
|
219
275
|
}));
|
|
220
276
|
}
|
|
@@ -222,41 +278,29 @@ function extend(schema, shape) {
|
|
|
222
278
|
if (!isPlainObject$1(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
223
279
|
const checks = schema._zod.def.checks;
|
|
224
280
|
if (checks && checks.length > 0) {
|
|
225
|
-
const existingShape = schema
|
|
281
|
+
const existingShape = sourceShape(schema);
|
|
226
282
|
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.");
|
|
227
283
|
}
|
|
228
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
} }));
|
|
284
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
285
|
+
}
|
|
286
|
+
function extended(schema, shape) {
|
|
287
|
+
const newShape = {};
|
|
288
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
289
|
+
mirrorProps(newShape, shape);
|
|
290
|
+
return newShape;
|
|
236
291
|
}
|
|
237
292
|
function safeExtend(schema, shape) {
|
|
238
293
|
if (!isPlainObject$1(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
239
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
240
|
-
const _shape = {
|
|
241
|
-
...schema._zod.def.shape,
|
|
242
|
-
...shape
|
|
243
|
-
};
|
|
244
|
-
assignProp(this, "shape", _shape);
|
|
245
|
-
return _shape;
|
|
246
|
-
} }));
|
|
294
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
247
295
|
}
|
|
248
296
|
function merge$1(a, b) {
|
|
249
297
|
if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
250
298
|
if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
299
|
+
const newShape = {};
|
|
300
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
301
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
251
302
|
return clone(a, mergeDefs(a._zod.def, {
|
|
252
|
-
|
|
253
|
-
const _shape = {
|
|
254
|
-
...a._zod.def.shape,
|
|
255
|
-
...b._zod.def.shape
|
|
256
|
-
};
|
|
257
|
-
assignProp(this, "shape", _shape);
|
|
258
|
-
return _shape;
|
|
259
|
-
},
|
|
303
|
+
shape: newShape,
|
|
260
304
|
get catchall() {
|
|
261
305
|
return b._zod.def.catchall;
|
|
262
306
|
},
|
|
@@ -266,47 +310,25 @@ function merge$1(a, b) {
|
|
|
266
310
|
function partial(Class, schema, mask, name = "partial") {
|
|
267
311
|
const checks = schema._zod.def.checks;
|
|
268
312
|
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
313
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
314
|
+
const newShape = {};
|
|
315
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
|
|
316
|
+
type: "optional",
|
|
317
|
+
innerType: value
|
|
318
|
+
})));
|
|
269
319
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
270
|
-
|
|
271
|
-
const oldShape = schema._zod.def.shape;
|
|
272
|
-
const shape = { ...oldShape };
|
|
273
|
-
if (mask) for (const key of Reflect.ownKeys(mask)) {
|
|
274
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
275
|
-
if (!mask[key]) continue;
|
|
276
|
-
shape[key] = Class ? new Class({
|
|
277
|
-
type: "optional",
|
|
278
|
-
innerType: oldShape[key]
|
|
279
|
-
}) : oldShape[key];
|
|
280
|
-
}
|
|
281
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = Class ? new Class({
|
|
282
|
-
type: "optional",
|
|
283
|
-
innerType: oldShape[key]
|
|
284
|
-
}) : oldShape[key];
|
|
285
|
-
assignProp(this, "shape", shape);
|
|
286
|
-
return shape;
|
|
287
|
-
},
|
|
320
|
+
shape: newShape,
|
|
288
321
|
checks: []
|
|
289
322
|
}));
|
|
290
323
|
}
|
|
291
324
|
function required(Class, schema, mask) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
type: "nonoptional",
|
|
300
|
-
innerType: oldShape[key]
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = new Class({
|
|
304
|
-
type: "nonoptional",
|
|
305
|
-
innerType: oldShape[key]
|
|
306
|
-
});
|
|
307
|
-
assignProp(this, "shape", shape);
|
|
308
|
-
return shape;
|
|
309
|
-
} }));
|
|
325
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
326
|
+
const newShape = {};
|
|
327
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({
|
|
328
|
+
type: "nonoptional",
|
|
329
|
+
innerType: value
|
|
330
|
+
}));
|
|
331
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
310
332
|
}
|
|
311
333
|
function aborted(x, startIndex = 0) {
|
|
312
334
|
if (x.aborted === true) return true;
|
|
@@ -342,11 +364,15 @@ function finalizeIssue(iss, ctx, config) {
|
|
|
342
364
|
}
|
|
343
365
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
344
366
|
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";
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
367
|
+
const full = {};
|
|
368
|
+
for (const k of Object.keys(iss)) {
|
|
369
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
370
|
+
full[k] = iss[k];
|
|
371
|
+
}
|
|
372
|
+
full.path ?? (full.path = []);
|
|
373
|
+
full.message = message;
|
|
374
|
+
if (ctx?.reportInput) full.input = iss.input;
|
|
375
|
+
return full;
|
|
350
376
|
}
|
|
351
377
|
function getSizableOrigin(input) {
|
|
352
378
|
if (input instanceof Set) return "set";
|
|
@@ -407,6 +433,7 @@ function members(proto, table) {
|
|
|
407
433
|
});
|
|
408
434
|
else defineBound(proto, key, desc.value);
|
|
409
435
|
}
|
|
436
|
+
for (const sym of Object.getOwnPropertySymbols(table)) defineBound(proto, sym, table[sym]);
|
|
410
437
|
}
|
|
411
438
|
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
|
|
412
439
|
function own(inst, key, value, enumerable = true) {
|
|
@@ -422,11 +449,28 @@ function own(inst, key, value, enumerable = true) {
|
|
|
422
449
|
function hide(inst, key, value) {
|
|
423
450
|
return own(inst, key, value, false);
|
|
424
451
|
}
|
|
452
|
+
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
453
|
+
function derived(computes, table) {
|
|
454
|
+
for (const key in computes) {
|
|
455
|
+
const compute = computes[key];
|
|
456
|
+
Object.defineProperty(table, key, {
|
|
457
|
+
configurable: true,
|
|
458
|
+
enumerable: true,
|
|
459
|
+
get() {
|
|
460
|
+
return own(this, key, compute(this));
|
|
461
|
+
},
|
|
462
|
+
set(value) {
|
|
463
|
+
own(this, key, value);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
return table;
|
|
468
|
+
}
|
|
425
469
|
function defineBound(proto, key, fn) {
|
|
426
470
|
Object.defineProperty(proto, key, {
|
|
427
471
|
configurable: true,
|
|
428
472
|
get() {
|
|
429
|
-
return own(this, key, fn.bind(this));
|
|
473
|
+
return this == null ? fn : own(this, key, fn.bind(this));
|
|
430
474
|
},
|
|
431
475
|
set(value) {
|
|
432
476
|
own(this, key, value);
|
|
@@ -530,9 +574,9 @@ function constantCatch(value) {
|
|
|
530
574
|
return fn;
|
|
531
575
|
}
|
|
532
576
|
//#endregion
|
|
533
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
577
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/core.js
|
|
534
578
|
var _a$1;
|
|
535
|
-
const _zodDesc
|
|
579
|
+
const _zodDesc = {
|
|
536
580
|
value: void 0,
|
|
537
581
|
enumerable: false
|
|
538
582
|
};
|
|
@@ -569,11 +613,11 @@ function $constructor(name, initializer, proto, params) {
|
|
|
569
613
|
const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
|
|
570
614
|
function init(inst, def) {
|
|
571
615
|
if (!inst._zod) {
|
|
572
|
-
_zodDesc
|
|
616
|
+
_zodDesc.value = new Internals(def);
|
|
573
617
|
try {
|
|
574
|
-
Object.defineProperty(inst, "_zod", _zodDesc
|
|
618
|
+
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
575
619
|
} finally {
|
|
576
|
-
_zodDesc
|
|
620
|
+
_zodDesc.value = void 0;
|
|
577
621
|
}
|
|
578
622
|
}
|
|
579
623
|
if (inst._zod.traits.has(name)) return;
|
|
@@ -637,7 +681,7 @@ function config(newConfig) {
|
|
|
637
681
|
return globalConfig;
|
|
638
682
|
}
|
|
639
683
|
//#endregion
|
|
640
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
684
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/errors.js
|
|
641
685
|
function _getMessage() {
|
|
642
686
|
const internals = this._zod;
|
|
643
687
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -652,10 +696,6 @@ const _messageDesc = {
|
|
|
652
696
|
enumerable: true,
|
|
653
697
|
configurable: true
|
|
654
698
|
};
|
|
655
|
-
const _zodDesc = {
|
|
656
|
-
value: void 0,
|
|
657
|
-
enumerable: false
|
|
658
|
-
};
|
|
659
699
|
const _issuesDesc = {
|
|
660
700
|
value: void 0,
|
|
661
701
|
enumerable: false
|
|
@@ -663,11 +703,8 @@ const _issuesDesc = {
|
|
|
663
703
|
const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
664
704
|
const initializer$1 = (inst, def) => {
|
|
665
705
|
inst.name = "$ZodError";
|
|
666
|
-
_zodDesc.value = inst._zod;
|
|
667
|
-
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
668
706
|
_issuesDesc.value = def;
|
|
669
707
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
670
|
-
_zodDesc.value = void 0;
|
|
671
708
|
_issuesDesc.value = void 0;
|
|
672
709
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
673
710
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -760,7 +797,7 @@ function formatError$1(error, mapper = (issue) => issue.message) {
|
|
|
760
797
|
return fieldErrors;
|
|
761
798
|
}
|
|
762
799
|
//#endregion
|
|
763
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
800
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/parse.js
|
|
764
801
|
function finalizeParams(callee, params) {
|
|
765
802
|
return {
|
|
766
803
|
callee: params?.callee ?? callee,
|
|
@@ -819,15 +856,31 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
819
856
|
issues: []
|
|
820
857
|
}, ctx);
|
|
821
858
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
822
|
-
return result.issues.length ? {
|
|
823
|
-
success: false,
|
|
824
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
825
|
-
} : {
|
|
859
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
826
860
|
success: true,
|
|
827
861
|
data: result.value
|
|
828
862
|
};
|
|
829
863
|
};
|
|
830
864
|
const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
|
|
865
|
+
function failure(Err, issues, ctx) {
|
|
866
|
+
let error;
|
|
867
|
+
return {
|
|
868
|
+
success: false,
|
|
869
|
+
get error() {
|
|
870
|
+
if (!error) {
|
|
871
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
872
|
+
issues = void 0;
|
|
873
|
+
ctx = void 0;
|
|
874
|
+
}
|
|
875
|
+
return error;
|
|
876
|
+
},
|
|
877
|
+
set error(e) {
|
|
878
|
+
error = e;
|
|
879
|
+
issues = void 0;
|
|
880
|
+
ctx = void 0;
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
}
|
|
831
884
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
832
885
|
const ctx = _ctx ? {
|
|
833
886
|
..._ctx,
|
|
@@ -838,15 +891,62 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
838
891
|
issues: []
|
|
839
892
|
}, ctx);
|
|
840
893
|
if (result instanceof Promise) result = await result;
|
|
841
|
-
return result.issues.length ? {
|
|
842
|
-
success: false,
|
|
843
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
844
|
-
} : {
|
|
894
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
845
895
|
success: true,
|
|
846
896
|
data: result.value
|
|
847
897
|
};
|
|
848
898
|
};
|
|
849
899
|
const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
|
|
900
|
+
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
901
|
+
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
902
|
+
const validate = ((schema, value, _ctx) => {
|
|
903
|
+
const validator = schema._zod.bag.validator;
|
|
904
|
+
if (validator !== void 0) {
|
|
905
|
+
if (validator(value) !== COMPILE_INVALID) return true;
|
|
906
|
+
if (validator.definite === true && _ctx === void 0) return false;
|
|
907
|
+
}
|
|
908
|
+
return validateFallback(schema, value, _ctx);
|
|
909
|
+
});
|
|
910
|
+
function validateFallback(schema, value, _ctx) {
|
|
911
|
+
const ctx = _ctx ? {
|
|
912
|
+
..._ctx,
|
|
913
|
+
async: false,
|
|
914
|
+
abortEarly: true
|
|
915
|
+
} : {
|
|
916
|
+
async: false,
|
|
917
|
+
abortEarly: true
|
|
918
|
+
};
|
|
919
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
920
|
+
let result;
|
|
921
|
+
if (fallbackRun) {
|
|
922
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
923
|
+
result = fallbackRun({
|
|
924
|
+
value,
|
|
925
|
+
issues: []
|
|
926
|
+
}, ctx);
|
|
927
|
+
} else result = schema._zod.run({
|
|
928
|
+
value,
|
|
929
|
+
issues: []
|
|
930
|
+
}, ctx);
|
|
931
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
932
|
+
return result.issues.length === 0;
|
|
933
|
+
}
|
|
934
|
+
const validateAsync$1 = async (schema, value, _ctx) => {
|
|
935
|
+
const ctx = _ctx ? {
|
|
936
|
+
..._ctx,
|
|
937
|
+
async: true,
|
|
938
|
+
abortEarly: true
|
|
939
|
+
} : {
|
|
940
|
+
async: true,
|
|
941
|
+
abortEarly: true
|
|
942
|
+
};
|
|
943
|
+
let result = schema._zod.run({
|
|
944
|
+
value,
|
|
945
|
+
issues: []
|
|
946
|
+
}, ctx);
|
|
947
|
+
if (result instanceof Promise) result = await result;
|
|
948
|
+
return result.issues.length === 0;
|
|
949
|
+
};
|
|
850
950
|
const _encode = (_Err) => {
|
|
851
951
|
const parse = _parse(_Err);
|
|
852
952
|
const fn = (schema, value, _ctx, _params) => {
|
|
@@ -904,8 +1004,9 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
904
1004
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
905
1005
|
};
|
|
906
1006
|
//#endregion
|
|
907
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1007
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/regexes.js
|
|
908
1008
|
var regexes_exports = /* @__PURE__ */ __exportAll({
|
|
1009
|
+
anyString: () => anyString,
|
|
909
1010
|
base64: () => base64$1,
|
|
910
1011
|
base64url: () => base64url$1,
|
|
911
1012
|
bigint: () => bigint$2,
|
|
@@ -929,6 +1030,7 @@ var regexes_exports = /* @__PURE__ */ __exportAll({
|
|
|
929
1030
|
hostname: () => hostname$1,
|
|
930
1031
|
html5Email: () => html5Email,
|
|
931
1032
|
httpProtocol: () => httpProtocol,
|
|
1033
|
+
iban: () => iban$1,
|
|
932
1034
|
idnEmail: () => idnEmail,
|
|
933
1035
|
integer: () => integer,
|
|
934
1036
|
ipv4: () => ipv4$1,
|
|
@@ -999,7 +1101,7 @@ const uuid4 = /*@__PURE__*/ uuid$1(4);
|
|
|
999
1101
|
const uuid6 = /*@__PURE__*/ uuid$1(6);
|
|
1000
1102
|
const uuid7 = /*@__PURE__*/ uuid$1(7);
|
|
1001
1103
|
/** Practical email validation */
|
|
1002
|
-
const email$1 = /^(
|
|
1104
|
+
const email$1 = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1003
1105
|
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
|
|
1004
1106
|
const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1005
1107
|
/** The classic emailregex.com regex for RFC 5322-compliant emails */
|
|
@@ -1008,7 +1110,7 @@ const rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+
|
|
|
1008
1110
|
const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
1009
1111
|
const idnEmail = unicodeEmail;
|
|
1010
1112
|
const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1011
|
-
const _emoji$1 = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1113
|
+
const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1012
1114
|
function emoji$1() {
|
|
1013
1115
|
return new RegExp(_emoji$1, "u");
|
|
1014
1116
|
}
|
|
@@ -1021,12 +1123,13 @@ const mac$1 = (delimiter) => {
|
|
|
1021
1123
|
const cidrv4$1 = /^((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])$/;
|
|
1022
1124
|
const cidrv6$1 = /^(([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])$/;
|
|
1023
1125
|
const base64$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
1024
|
-
const base64url$1 = /^[A-Za-z0-9_-]
|
|
1126
|
+
const base64url$1 = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
1025
1127
|
const hostname$1 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
1026
1128
|
const domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
1027
1129
|
const httpProtocol = /^https?$/;
|
|
1028
1130
|
const e164$1 = /^\+[1-9]\d{6,14}$/;
|
|
1029
1131
|
const creditCard$1 = /^\d(?:[ -]?\d){11,18}$/;
|
|
1132
|
+
const iban$1 = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
1030
1133
|
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])))`;
|
|
1031
1134
|
/** Anchors a pattern source. The interpolation lives here rather than at the call site because
|
|
1032
1135
|
* esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it
|
|
@@ -1052,6 +1155,7 @@ function datetime$1(args) {
|
|
|
1052
1155
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
1053
1156
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
1054
1157
|
}
|
|
1158
|
+
const anyString = /^[\s\S]{0,}$/;
|
|
1055
1159
|
const string$2 = (params) => {
|
|
1056
1160
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
1057
1161
|
return new RegExp(`^${regex}$`);
|
|
@@ -1087,7 +1191,7 @@ const sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
|
1087
1191
|
const sha512_base64 = /*@__PURE__*/ fixedBase64(86, "==");
|
|
1088
1192
|
const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);
|
|
1089
1193
|
//#endregion
|
|
1090
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1194
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/checks.js
|
|
1091
1195
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1092
1196
|
var _a;
|
|
1093
1197
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1112,14 +1216,6 @@ const numericOriginMap = {
|
|
|
1112
1216
|
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
1113
1217
|
$ZodCheck.init(inst, def);
|
|
1114
1218
|
const origin = numericOriginMap[typeof def.value];
|
|
1115
|
-
inst._zod.onattach.push((inst) => {
|
|
1116
|
-
const bag = inst._zod.bag;
|
|
1117
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1118
|
-
if (def.value < curr) {
|
|
1119
|
-
if (def.inclusive) bag.maximum = def.value;
|
|
1120
|
-
else bag.exclusiveMaximum = def.value;
|
|
1121
|
-
}
|
|
1122
|
-
});
|
|
1123
1219
|
inst._zod.check = (payload) => {
|
|
1124
1220
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
1125
1221
|
payload.issues.push({
|
|
@@ -1136,14 +1232,6 @@ const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst,
|
|
|
1136
1232
|
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
1137
1233
|
$ZodCheck.init(inst, def);
|
|
1138
1234
|
const origin = numericOriginMap[typeof def.value];
|
|
1139
|
-
inst._zod.onattach.push((inst) => {
|
|
1140
|
-
const bag = inst._zod.bag;
|
|
1141
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1142
|
-
if (def.value > curr) {
|
|
1143
|
-
if (def.inclusive) bag.minimum = def.value;
|
|
1144
|
-
else bag.exclusiveMinimum = def.value;
|
|
1145
|
-
}
|
|
1146
|
-
});
|
|
1147
1235
|
inst._zod.check = (payload) => {
|
|
1148
1236
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
1149
1237
|
payload.issues.push({
|
|
@@ -1159,10 +1247,6 @@ const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan",
|
|
|
1159
1247
|
});
|
|
1160
1248
|
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1161
1249
|
$ZodCheck.init(inst, def);
|
|
1162
|
-
inst._zod.onattach.push((inst) => {
|
|
1163
|
-
var _a;
|
|
1164
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
1165
|
-
});
|
|
1166
1250
|
inst._zod.check = (payload) => {
|
|
1167
1251
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1168
1252
|
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
@@ -1182,13 +1266,6 @@ const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat"
|
|
|
1182
1266
|
const isInt = def.format?.includes("int");
|
|
1183
1267
|
const origin = isInt ? "int" : "number";
|
|
1184
1268
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
1185
|
-
inst._zod.onattach.push((inst) => {
|
|
1186
|
-
const bag = inst._zod.bag;
|
|
1187
|
-
bag.format = def.format;
|
|
1188
|
-
bag.minimum = minimum;
|
|
1189
|
-
bag.maximum = maximum;
|
|
1190
|
-
if (isInt) bag.pattern = integer;
|
|
1191
|
-
});
|
|
1192
1269
|
inst._zod.check = (payload) => {
|
|
1193
1270
|
const input = payload.value;
|
|
1194
1271
|
if (isInt) {
|
|
@@ -1250,12 +1327,6 @@ const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat"
|
|
|
1250
1327
|
const $ZodCheckBigIntFormat = /*@__PURE__*/ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
1251
1328
|
$ZodCheck.init(inst, def);
|
|
1252
1329
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
1253
|
-
inst._zod.onattach.push((inst) => {
|
|
1254
|
-
const bag = inst._zod.bag;
|
|
1255
|
-
bag.format = def.format;
|
|
1256
|
-
bag.minimum = minimum;
|
|
1257
|
-
bag.maximum = maximum;
|
|
1258
|
-
});
|
|
1259
1330
|
inst._zod.check = (payload) => {
|
|
1260
1331
|
const input = payload.value;
|
|
1261
1332
|
if (input < minimum) payload.issues.push({
|
|
@@ -1282,10 +1353,6 @@ const $ZodCheckMaxSize = /*@__PURE__*/ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
1282
1353
|
var _a;
|
|
1283
1354
|
$ZodCheck.init(inst, def);
|
|
1284
1355
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasSize);
|
|
1285
|
-
inst._zod.onattach.push((inst) => {
|
|
1286
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1287
|
-
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
1288
|
-
});
|
|
1289
1356
|
inst._zod.check = (payload) => {
|
|
1290
1357
|
const input = payload.value;
|
|
1291
1358
|
if (input.size <= def.maximum) return;
|
|
@@ -1304,10 +1371,6 @@ const $ZodCheckMinSize = /*@__PURE__*/ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
1304
1371
|
var _a;
|
|
1305
1372
|
$ZodCheck.init(inst, def);
|
|
1306
1373
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasSize);
|
|
1307
|
-
inst._zod.onattach.push((inst) => {
|
|
1308
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1309
|
-
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
1310
|
-
});
|
|
1311
1374
|
inst._zod.check = (payload) => {
|
|
1312
1375
|
const input = payload.value;
|
|
1313
1376
|
if (input.size >= def.minimum) return;
|
|
@@ -1326,12 +1389,6 @@ const $ZodCheckSizeEquals = /*@__PURE__*/ $constructor("$ZodCheckSizeEquals", (i
|
|
|
1326
1389
|
var _a;
|
|
1327
1390
|
$ZodCheck.init(inst, def);
|
|
1328
1391
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasSize);
|
|
1329
|
-
inst._zod.onattach.push((inst) => {
|
|
1330
|
-
const bag = inst._zod.bag;
|
|
1331
|
-
bag.minimum = def.size;
|
|
1332
|
-
bag.maximum = def.size;
|
|
1333
|
-
bag.size = def.size;
|
|
1334
|
-
});
|
|
1335
1392
|
inst._zod.check = (payload) => {
|
|
1336
1393
|
const input = payload.value;
|
|
1337
1394
|
const size = input.size;
|
|
@@ -1358,10 +1415,6 @@ const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (ins
|
|
|
1358
1415
|
var _a;
|
|
1359
1416
|
$ZodCheck.init(inst, def);
|
|
1360
1417
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1361
|
-
inst._zod.onattach.push((inst) => {
|
|
1362
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1363
|
-
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
1364
|
-
});
|
|
1365
1418
|
inst._zod.check = (payload) => {
|
|
1366
1419
|
const input = payload.value;
|
|
1367
1420
|
const units = input.length;
|
|
@@ -1382,10 +1435,6 @@ const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (ins
|
|
|
1382
1435
|
var _a;
|
|
1383
1436
|
$ZodCheck.init(inst, def);
|
|
1384
1437
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1385
|
-
inst._zod.onattach.push((inst) => {
|
|
1386
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1387
|
-
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
1388
|
-
});
|
|
1389
1438
|
inst._zod.check = (payload) => {
|
|
1390
1439
|
const input = payload.value;
|
|
1391
1440
|
const units = input.length;
|
|
@@ -1406,12 +1455,6 @@ const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals"
|
|
|
1406
1455
|
var _a;
|
|
1407
1456
|
$ZodCheck.init(inst, def);
|
|
1408
1457
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1409
|
-
inst._zod.onattach.push((inst) => {
|
|
1410
|
-
const bag = inst._zod.bag;
|
|
1411
|
-
bag.minimum = def.length;
|
|
1412
|
-
bag.maximum = def.length;
|
|
1413
|
-
bag.length = def.length;
|
|
1414
|
-
});
|
|
1415
1458
|
inst._zod.check = (payload) => {
|
|
1416
1459
|
const input = payload.value;
|
|
1417
1460
|
const units = input.length;
|
|
@@ -1439,14 +1482,6 @@ const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals"
|
|
|
1439
1482
|
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1440
1483
|
var _a, _b;
|
|
1441
1484
|
$ZodCheck.init(inst, def);
|
|
1442
|
-
inst._zod.onattach.push((inst) => {
|
|
1443
|
-
const bag = inst._zod.bag;
|
|
1444
|
-
bag.format = def.format;
|
|
1445
|
-
if (def.pattern) {
|
|
1446
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1447
|
-
bag.patterns.add(def.pattern);
|
|
1448
|
-
}
|
|
1449
|
-
});
|
|
1450
1485
|
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1451
1486
|
def.pattern.lastIndex = 0;
|
|
1452
1487
|
if (def.pattern.test(payload.value)) return;
|
|
@@ -1489,13 +1524,7 @@ const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (ins
|
|
|
1489
1524
|
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
1490
1525
|
$ZodCheck.init(inst, def);
|
|
1491
1526
|
const escapedRegex = escapeRegex(def.includes);
|
|
1492
|
-
|
|
1493
|
-
def.pattern = pattern;
|
|
1494
|
-
inst._zod.onattach.push((inst) => {
|
|
1495
|
-
const bag = inst._zod.bag;
|
|
1496
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1497
|
-
bag.patterns.add(pattern);
|
|
1498
|
-
});
|
|
1527
|
+
def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1499
1528
|
inst._zod.check = (payload) => {
|
|
1500
1529
|
if (payload.value.includes(def.includes, def.position)) return;
|
|
1501
1530
|
payload.issues.push({
|
|
@@ -1513,11 +1542,6 @@ const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (i
|
|
|
1513
1542
|
$ZodCheck.init(inst, def);
|
|
1514
1543
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1515
1544
|
def.pattern ?? (def.pattern = pattern);
|
|
1516
|
-
inst._zod.onattach.push((inst) => {
|
|
1517
|
-
const bag = inst._zod.bag;
|
|
1518
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1519
|
-
bag.patterns.add(pattern);
|
|
1520
|
-
});
|
|
1521
1545
|
inst._zod.check = (payload) => {
|
|
1522
1546
|
if (payload.value.startsWith(def.prefix)) return;
|
|
1523
1547
|
payload.issues.push({
|
|
@@ -1535,11 +1559,6 @@ const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
1535
1559
|
$ZodCheck.init(inst, def);
|
|
1536
1560
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1537
1561
|
def.pattern ?? (def.pattern = pattern);
|
|
1538
|
-
inst._zod.onattach.push((inst) => {
|
|
1539
|
-
const bag = inst._zod.bag;
|
|
1540
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1541
|
-
bag.patterns.add(pattern);
|
|
1542
|
-
});
|
|
1543
1562
|
inst._zod.check = (payload) => {
|
|
1544
1563
|
if (payload.value.endsWith(def.suffix)) return;
|
|
1545
1564
|
payload.issues.push({
|
|
@@ -1570,9 +1589,6 @@ const $ZodCheckProperty = /*@__PURE__*/ $constructor("$ZodCheckProperty", (inst,
|
|
|
1570
1589
|
const $ZodCheckMimeType = /*@__PURE__*/ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
1571
1590
|
$ZodCheck.init(inst, def);
|
|
1572
1591
|
const mimeSet = new Set(def.mime);
|
|
1573
|
-
inst._zod.onattach.push((inst) => {
|
|
1574
|
-
inst._zod.bag.mime = def.mime;
|
|
1575
|
-
});
|
|
1576
1592
|
inst._zod.check = (payload) => {
|
|
1577
1593
|
if (mimeSet.has(payload.value.type)) return;
|
|
1578
1594
|
payload.issues.push({
|
|
@@ -1591,7 +1607,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1591
1607
|
};
|
|
1592
1608
|
});
|
|
1593
1609
|
//#endregion
|
|
1594
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1610
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/doc.js
|
|
1595
1611
|
var Doc = class {
|
|
1596
1612
|
constructor(args = [], closed = {}) {
|
|
1597
1613
|
this.content = [];
|
|
@@ -1601,8 +1617,11 @@ var Doc = class {
|
|
|
1601
1617
|
}
|
|
1602
1618
|
indented(fn) {
|
|
1603
1619
|
this.indent += 1;
|
|
1604
|
-
|
|
1605
|
-
|
|
1620
|
+
try {
|
|
1621
|
+
fn(this);
|
|
1622
|
+
} finally {
|
|
1623
|
+
this.indent -= 1;
|
|
1624
|
+
}
|
|
1606
1625
|
}
|
|
1607
1626
|
write(arg) {
|
|
1608
1627
|
if (typeof arg === "function") {
|
|
@@ -1622,14 +1641,14 @@ var Doc = class {
|
|
|
1622
1641
|
}
|
|
1623
1642
|
};
|
|
1624
1643
|
//#endregion
|
|
1625
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1644
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/versions.js
|
|
1626
1645
|
const version = {
|
|
1627
1646
|
major: 4,
|
|
1628
|
-
minor:
|
|
1647
|
+
minor: 6,
|
|
1629
1648
|
patch: 1
|
|
1630
1649
|
};
|
|
1631
1650
|
//#endregion
|
|
1632
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1651
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/schemas.js
|
|
1633
1652
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1634
1653
|
var _a;
|
|
1635
1654
|
inst ?? (inst = {});
|
|
@@ -1718,15 +1737,26 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
1718
1737
|
}
|
|
1719
1738
|
});
|
|
1720
1739
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
1721
|
-
const toStandardResult = (r) => r.
|
|
1740
|
+
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
1741
|
+
async function validateAsync(inst, value) {
|
|
1742
|
+
const ctx = { async: true };
|
|
1743
|
+
return toStandardResult(await inst._zod.run({
|
|
1744
|
+
value,
|
|
1745
|
+
issues: []
|
|
1746
|
+
}, ctx), ctx);
|
|
1747
|
+
}
|
|
1722
1748
|
function standardProps(inst) {
|
|
1723
1749
|
return {
|
|
1724
1750
|
validate: (value) => {
|
|
1751
|
+
const ctx = { async: false };
|
|
1725
1752
|
try {
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1753
|
+
const r = inst._zod.run({
|
|
1754
|
+
value,
|
|
1755
|
+
issues: []
|
|
1756
|
+
}, ctx);
|
|
1757
|
+
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
1758
|
+
} catch (_) {}
|
|
1759
|
+
return validateAsync(inst, value);
|
|
1730
1760
|
},
|
|
1731
1761
|
vendor: "zod",
|
|
1732
1762
|
version: 1
|
|
@@ -1734,7 +1764,7 @@ function standardProps(inst) {
|
|
|
1734
1764
|
}
|
|
1735
1765
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1736
1766
|
$ZodType.init(inst, def);
|
|
1737
|
-
inst._zod.pattern =
|
|
1767
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
1738
1768
|
inst._zod.parse = (payload, _) => {
|
|
1739
1769
|
if (def.coerce) try {
|
|
1740
1770
|
payload.value = String(payload.value);
|
|
@@ -1895,12 +1925,6 @@ const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
1895
1925
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1896
1926
|
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1897
1927
|
$ZodStringFormat.init(inst, def);
|
|
1898
|
-
if (def.local || def.precision === -1) {
|
|
1899
|
-
inst._zod.bag.laxFormat = true;
|
|
1900
|
-
inst._zod.onattach.push((s) => {
|
|
1901
|
-
s._zod.bag.laxFormat = true;
|
|
1902
|
-
});
|
|
1903
|
-
}
|
|
1904
1928
|
});
|
|
1905
1929
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1906
1930
|
def.pattern ?? (def.pattern = date$2);
|
|
@@ -1917,7 +1941,6 @@ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def
|
|
|
1917
1941
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1918
1942
|
def.pattern ?? (def.pattern = ipv4$1);
|
|
1919
1943
|
$ZodStringFormat.init(inst, def);
|
|
1920
|
-
inst._zod.bag.format = `ipv4`;
|
|
1921
1944
|
});
|
|
1922
1945
|
/** 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`. */
|
|
1923
1946
|
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
@@ -1933,7 +1956,6 @@ function isValidIPv6(value) {
|
|
|
1933
1956
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1934
1957
|
def.pattern ?? (def.pattern = ipv6$1);
|
|
1935
1958
|
$ZodStringFormat.init(inst, def);
|
|
1936
|
-
inst._zod.bag.format = `ipv6`;
|
|
1937
1959
|
inst._zod.check = (payload) => {
|
|
1938
1960
|
if (!isValidIPv6(payload.value)) payload.issues.push({
|
|
1939
1961
|
code: "invalid_format",
|
|
@@ -1947,7 +1969,6 @@ const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
1947
1969
|
const $ZodMAC = /*@__PURE__*/ $constructor("$ZodMAC", (inst, def) => {
|
|
1948
1970
|
def.pattern ?? (def.pattern = mac$1(def.delimiter));
|
|
1949
1971
|
$ZodStringFormat.init(inst, def);
|
|
1950
|
-
inst._zod.bag.format = `mac`;
|
|
1951
1972
|
});
|
|
1952
1973
|
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1953
1974
|
def.pattern ?? (def.pattern = cidrv4$1);
|
|
@@ -1987,10 +2008,10 @@ function isValidBase64(data) {
|
|
|
1987
2008
|
return false;
|
|
1988
2009
|
}
|
|
1989
2010
|
}
|
|
2011
|
+
const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
1990
2012
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1991
|
-
def.pattern ?? (def.pattern =
|
|
2013
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
1992
2014
|
$ZodStringFormat.init(inst, def);
|
|
1993
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
1994
2015
|
inst._zod.check = (payload) => {
|
|
1995
2016
|
if (isValidBase64(payload.value)) return;
|
|
1996
2017
|
payload.issues.push({
|
|
@@ -2002,15 +2023,15 @@ const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
|
2002
2023
|
});
|
|
2003
2024
|
};
|
|
2004
2025
|
});
|
|
2026
|
+
const base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
2005
2027
|
function isValidBase64URL(data) {
|
|
2006
|
-
if (!
|
|
2028
|
+
if (!base64urlCharset.test(data)) return false;
|
|
2007
2029
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
2008
2030
|
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
2009
2031
|
}
|
|
2010
2032
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
2011
|
-
def.pattern ?? (def.pattern =
|
|
2033
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
2012
2034
|
$ZodStringFormat.init(inst, def);
|
|
2013
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
2014
2035
|
inst._zod.check = (payload) => {
|
|
2015
2036
|
if (isValidBase64URL(payload.value)) return;
|
|
2016
2037
|
payload.issues.push({
|
|
@@ -2033,7 +2054,7 @@ function isLuhnAlgo(digits) {
|
|
|
2033
2054
|
let bit = 1;
|
|
2034
2055
|
let sum = 0;
|
|
2035
2056
|
while (length) {
|
|
2036
|
-
const value =
|
|
2057
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
2037
2058
|
bit ^= 1;
|
|
2038
2059
|
sum += bit ? [
|
|
2039
2060
|
0,
|
|
@@ -2068,6 +2089,37 @@ const $ZodCreditCard = /*@__PURE__*/ $constructor("$ZodCreditCard", (inst, def)
|
|
|
2068
2089
|
});
|
|
2069
2090
|
};
|
|
2070
2091
|
});
|
|
2092
|
+
function isIso7064Mod97(iban) {
|
|
2093
|
+
let remainder = 0;
|
|
2094
|
+
const len = iban.length;
|
|
2095
|
+
for (let i = 4; i < len; i++) {
|
|
2096
|
+
const code = iban.charCodeAt(i);
|
|
2097
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
2098
|
+
}
|
|
2099
|
+
for (let i = 0; i < 4; i++) {
|
|
2100
|
+
const code = iban.charCodeAt(i);
|
|
2101
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
2102
|
+
}
|
|
2103
|
+
return remainder === 1;
|
|
2104
|
+
}
|
|
2105
|
+
function isValidIBAN(input) {
|
|
2106
|
+
if (!iban$1.test(input)) return false;
|
|
2107
|
+
return isIso7064Mod97(input);
|
|
2108
|
+
}
|
|
2109
|
+
const $ZodIBAN = /*@__PURE__*/ $constructor("$ZodIBAN", (inst, def) => {
|
|
2110
|
+
def.pattern ?? (def.pattern = iban$1);
|
|
2111
|
+
$ZodStringFormat.init(inst, def);
|
|
2112
|
+
inst._zod.check = (payload) => {
|
|
2113
|
+
if (isValidIBAN(payload.value)) return;
|
|
2114
|
+
payload.issues.push({
|
|
2115
|
+
code: "invalid_format",
|
|
2116
|
+
format: "iban",
|
|
2117
|
+
input: payload.value,
|
|
2118
|
+
inst,
|
|
2119
|
+
continue: !def.abort
|
|
2120
|
+
});
|
|
2121
|
+
};
|
|
2122
|
+
});
|
|
2071
2123
|
function isValidJWT(token, algorithm = null) {
|
|
2072
2124
|
try {
|
|
2073
2125
|
const tokensParts = token.split(".");
|
|
@@ -2111,7 +2163,7 @@ const $ZodCustomStringFormat = /*@__PURE__*/ $constructor("$ZodCustomStringForma
|
|
|
2111
2163
|
});
|
|
2112
2164
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
2113
2165
|
$ZodType.init(inst, def);
|
|
2114
|
-
inst._zod.pattern =
|
|
2166
|
+
inst._zod.pattern = number$2;
|
|
2115
2167
|
inst._zod.parse = (payload, _ctx) => {
|
|
2116
2168
|
if (def.coerce) try {
|
|
2117
2169
|
payload.value = Number(payload.value);
|
|
@@ -2292,6 +2344,7 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
2292
2344
|
}
|
|
2293
2345
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
2294
2346
|
const proms = [];
|
|
2347
|
+
const abortEarly = ctx?.abortEarly;
|
|
2295
2348
|
for (let i = 0; i < input.length; i++) {
|
|
2296
2349
|
const item = input[i];
|
|
2297
2350
|
const result = def.element._zod.run({
|
|
@@ -2299,7 +2352,10 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
2299
2352
|
issues: []
|
|
2300
2353
|
}, ctx);
|
|
2301
2354
|
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
2302
|
-
else
|
|
2355
|
+
else {
|
|
2356
|
+
handleArrayResult(result, payload, i);
|
|
2357
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
2358
|
+
}
|
|
2303
2359
|
}
|
|
2304
2360
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2305
2361
|
return payload;
|
|
@@ -2343,14 +2399,19 @@ function normalizeDef(def) {
|
|
|
2343
2399
|
optionalKeys: new Set(okeys)
|
|
2344
2400
|
};
|
|
2345
2401
|
}
|
|
2346
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
2402
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
2347
2403
|
const unrecognized = [];
|
|
2348
2404
|
const keySet = def.keySet;
|
|
2349
2405
|
const _catchall = def.catchall._zod;
|
|
2350
2406
|
const t = _catchall.def.type;
|
|
2351
2407
|
const optin = _catchall.optin;
|
|
2352
2408
|
const optout = _catchall.optout;
|
|
2409
|
+
let seen = 0;
|
|
2353
2410
|
for (const key in input) {
|
|
2411
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2412
|
+
if (aborted(payload, seen)) break;
|
|
2413
|
+
seen = payload.issues.length;
|
|
2414
|
+
}
|
|
2354
2415
|
if (keySet.has(key)) continue;
|
|
2355
2416
|
if (key === "__proto__") {
|
|
2356
2417
|
if (t === "never") unrecognized.push(key);
|
|
@@ -2379,18 +2440,19 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
2379
2440
|
return payload;
|
|
2380
2441
|
});
|
|
2381
2442
|
}
|
|
2382
|
-
const propShapes = /* @__PURE__ */ new WeakMap();
|
|
2383
2443
|
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
2384
2444
|
$ZodType.init(inst, def);
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2445
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2446
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
2447
|
+
if (sh) {
|
|
2448
|
+
const get = () => {
|
|
2389
2449
|
const newSh = { ...sh };
|
|
2390
2450
|
Object.defineProperty(def, "shape", { value: newSh });
|
|
2391
|
-
|
|
2451
|
+
get.raw = newSh;
|
|
2392
2452
|
return newSh;
|
|
2393
|
-
}
|
|
2453
|
+
};
|
|
2454
|
+
get.raw = sh;
|
|
2455
|
+
Object.defineProperty(def, "shape", { get });
|
|
2394
2456
|
}
|
|
2395
2457
|
const _normalized = cached(() => normalizeDef(def));
|
|
2396
2458
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -2426,7 +2488,13 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
2426
2488
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2427
2489
|
const proms = [];
|
|
2428
2490
|
const shape = value.shape;
|
|
2491
|
+
const abortEarly = ctx?.abortEarly;
|
|
2492
|
+
let seen = payload.issues.length;
|
|
2429
2493
|
for (const key of value.allKeys) {
|
|
2494
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2495
|
+
if (aborted(payload, seen)) break;
|
|
2496
|
+
seen = payload.issues.length;
|
|
2497
|
+
}
|
|
2430
2498
|
if (key === "__proto__") continue;
|
|
2431
2499
|
const el = shape[key];
|
|
2432
2500
|
const optin = el._zod.optin;
|
|
@@ -2439,7 +2507,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
2439
2507
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2440
2508
|
}
|
|
2441
2509
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2442
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
2510
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2443
2511
|
};
|
|
2444
2512
|
});
|
|
2445
2513
|
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -2458,10 +2526,16 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
2458
2526
|
});
|
|
2459
2527
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
2460
2528
|
const prefixStr = (id, k) => `
|
|
2529
|
+
let ${id}_ab = false;
|
|
2461
2530
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
2462
2531
|
const iss = ${id}.issues[i];
|
|
2463
2532
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
2464
2533
|
payload.issues.push(iss);
|
|
2534
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
2535
|
+
}
|
|
2536
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
2537
|
+
payload.value = newResult;
|
|
2538
|
+
return payload;
|
|
2465
2539
|
}`;
|
|
2466
2540
|
doc.write(`const input = payload.value;`);
|
|
2467
2541
|
const ids = Object.create(null);
|
|
@@ -2503,6 +2577,10 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
2503
2577
|
input: undefined,
|
|
2504
2578
|
path: [${k}]
|
|
2505
2579
|
});
|
|
2580
|
+
if (ctx && ctx.abortEarly) {
|
|
2581
|
+
payload.value = newResult;
|
|
2582
|
+
return payload;
|
|
2583
|
+
}
|
|
2506
2584
|
}
|
|
2507
2585
|
|
|
2508
2586
|
if (${id}_present) {
|
|
@@ -2550,7 +2628,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
2550
2628
|
if (!fastpass) fastpass = generateFastpass(def.shape);
|
|
2551
2629
|
payload = fastpass(payload, ctx);
|
|
2552
2630
|
if (!catchall) return payload;
|
|
2553
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2631
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2554
2632
|
}
|
|
2555
2633
|
return superParse(payload, ctx);
|
|
2556
2634
|
};
|
|
@@ -2657,39 +2735,42 @@ const $ZodXor = /*@__PURE__*/ $constructor("$ZodXor", (inst, def) => {
|
|
|
2657
2735
|
});
|
|
2658
2736
|
};
|
|
2659
2737
|
});
|
|
2738
|
+
function discriminatorMap(def) {
|
|
2739
|
+
const map = /* @__PURE__ */ new Map();
|
|
2740
|
+
for (const option of def.options) {
|
|
2741
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
2742
|
+
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
2743
|
+
for (const value of values) if (map.has(value)) {
|
|
2744
|
+
if (value !== void 0) throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
2745
|
+
map.set(value, null);
|
|
2746
|
+
} else map.set(value, option);
|
|
2747
|
+
}
|
|
2748
|
+
return map;
|
|
2749
|
+
}
|
|
2660
2750
|
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
2661
2751
|
def.inclusive = false;
|
|
2662
2752
|
$ZodUnion.init(inst, def);
|
|
2663
2753
|
const _super = inst._zod.parse;
|
|
2664
2754
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
2665
2755
|
const propValues = {};
|
|
2756
|
+
let undefinedCount = 0;
|
|
2666
2757
|
for (const option of zod.def.options) {
|
|
2667
2758
|
const pv = option._zod.propValues;
|
|
2668
2759
|
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
2760
|
+
if (pv[zod.def.discriminator]?.has(void 0)) undefinedCount++;
|
|
2669
2761
|
for (const [k, v] of Object.entries(pv)) {
|
|
2670
2762
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
2671
2763
|
for (const val of v) propValues[k].add(val);
|
|
2672
2764
|
}
|
|
2673
2765
|
}
|
|
2766
|
+
if (!zod.def.unionFallback && undefinedCount > 1) propValues[zod.def.discriminator]?.delete(void 0);
|
|
2674
2767
|
return propValues;
|
|
2675
2768
|
});
|
|
2676
2769
|
def.options.forEach((option, i) => {
|
|
2677
|
-
const propShape =
|
|
2770
|
+
const propShape = rawShape(option._zod.def);
|
|
2678
2771
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
2679
2772
|
});
|
|
2680
|
-
const disc = cached(() =>
|
|
2681
|
-
const opts = def.options;
|
|
2682
|
-
const map = /* @__PURE__ */ new Map();
|
|
2683
|
-
for (const o of opts) {
|
|
2684
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
2685
|
-
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
2686
|
-
for (const v of values) {
|
|
2687
|
-
if (map.has(v)) throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
2688
|
-
map.set(v, o);
|
|
2689
|
-
}
|
|
2690
|
-
}
|
|
2691
|
-
return map;
|
|
2692
|
-
});
|
|
2773
|
+
const disc = cached(() => discriminatorMap(def));
|
|
2693
2774
|
inst._zod.parse = (payload, ctx) => {
|
|
2694
2775
|
const input = payload.value;
|
|
2695
2776
|
if (!isObject$1(input)) {
|
|
@@ -2701,15 +2782,16 @@ const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnio
|
|
|
2701
2782
|
});
|
|
2702
2783
|
return payload;
|
|
2703
2784
|
}
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2785
|
+
const value = input?.[def.discriminator];
|
|
2786
|
+
const opt = disc.value.get(value);
|
|
2787
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) return opt._zod.run(payload, ctx);
|
|
2706
2788
|
if (def.unionFallback || ctx.direction === "backward") return _super(payload, ctx);
|
|
2707
2789
|
payload.issues.push({
|
|
2708
2790
|
code: "invalid_union",
|
|
2709
2791
|
errors: [],
|
|
2710
2792
|
note: "No matching discriminator",
|
|
2711
2793
|
discriminator: def.discriminator,
|
|
2712
|
-
options: Array.from(disc.value.keys()),
|
|
2794
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2713
2795
|
input,
|
|
2714
2796
|
path: [def.discriminator],
|
|
2715
2797
|
inst
|
|
@@ -2873,6 +2955,8 @@ const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
|
2873
2955
|
});
|
|
2874
2956
|
}
|
|
2875
2957
|
const itemResults = new Array(items.length);
|
|
2958
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
2959
|
+
let itemAborted = false;
|
|
2876
2960
|
for (let i = 0; i < items.length; i++) {
|
|
2877
2961
|
const r = items[i]._zod.run({
|
|
2878
2962
|
value: input[i],
|
|
@@ -2881,12 +2965,20 @@ const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
|
2881
2965
|
if (r instanceof Promise) proms.push(r.then((rr) => {
|
|
2882
2966
|
itemResults[i] = rr;
|
|
2883
2967
|
}));
|
|
2884
|
-
else
|
|
2968
|
+
else {
|
|
2969
|
+
itemResults[i] = r;
|
|
2970
|
+
if (abortEarly && !itemAborted && r.issues.length) itemAborted = aborted(r);
|
|
2971
|
+
}
|
|
2885
2972
|
}
|
|
2886
|
-
if (def.rest) {
|
|
2973
|
+
if (def.rest && !itemAborted) {
|
|
2887
2974
|
let i = items.length - 1;
|
|
2888
2975
|
const rest = input.slice(items.length);
|
|
2976
|
+
let seen = payload.issues.length;
|
|
2889
2977
|
for (const el of rest) {
|
|
2978
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2979
|
+
if (aborted(payload, seen)) break;
|
|
2980
|
+
seen = payload.issues.length;
|
|
2981
|
+
}
|
|
2890
2982
|
i++;
|
|
2891
2983
|
const result = def.rest._zod.run({
|
|
2892
2984
|
value: el,
|
|
@@ -3078,7 +3170,13 @@ const $ZodMap = /*@__PURE__*/ $constructor("$ZodMap", (inst, def) => {
|
|
|
3078
3170
|
}
|
|
3079
3171
|
const proms = [];
|
|
3080
3172
|
payload.value = memo ? memo.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
3173
|
+
const abortEarly = ctx?.abortEarly;
|
|
3174
|
+
let seen = payload.issues.length;
|
|
3081
3175
|
for (const [key, value] of input) {
|
|
3176
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3177
|
+
if (aborted(payload, seen)) break;
|
|
3178
|
+
seen = payload.issues.length;
|
|
3179
|
+
}
|
|
3082
3180
|
const keyResult = def.keyType._zod.run({
|
|
3083
3181
|
value: key,
|
|
3084
3182
|
issues: []
|
|
@@ -3137,7 +3235,13 @@ const $ZodSet = /*@__PURE__*/ $constructor("$ZodSet", (inst, def) => {
|
|
|
3137
3235
|
}
|
|
3138
3236
|
const proms = [];
|
|
3139
3237
|
payload.value = memo ? memo.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
3238
|
+
const abortEarly = ctx?.abortEarly;
|
|
3239
|
+
let seen = payload.issues.length;
|
|
3140
3240
|
for (const item of input) {
|
|
3241
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3242
|
+
if (aborted(payload, seen)) break;
|
|
3243
|
+
seen = payload.issues.length;
|
|
3244
|
+
}
|
|
3141
3245
|
const result = def.valueType._zod.run({
|
|
3142
3246
|
value: item,
|
|
3143
3247
|
issues: []
|
|
@@ -3158,8 +3262,10 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
3158
3262
|
const values = getEnumValues(def.entries);
|
|
3159
3263
|
const valuesSet = new Set(values);
|
|
3160
3264
|
inst._zod.values = valuesSet;
|
|
3161
|
-
|
|
3162
|
-
|
|
3265
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
3266
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
3267
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
3268
|
+
});
|
|
3163
3269
|
inst._zod.parse = (payload, _ctx) => {
|
|
3164
3270
|
const input = payload.value;
|
|
3165
3271
|
if (valuesSet.has(input)) return payload;
|
|
@@ -3176,7 +3282,10 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
3176
3282
|
$ZodType.init(inst, def);
|
|
3177
3283
|
const values = new Set(def.values);
|
|
3178
3284
|
inst._zod.values = values;
|
|
3179
|
-
inst
|
|
3285
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
3286
|
+
const vals = zod.def.values;
|
|
3287
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
3288
|
+
});
|
|
3180
3289
|
inst._zod.parse = (payload, _ctx) => {
|
|
3181
3290
|
const input = payload.value;
|
|
3182
3291
|
if (values.has(input)) return payload;
|
|
@@ -3472,16 +3581,53 @@ function handleReadonlyResult(payload) {
|
|
|
3472
3581
|
if (!payload.memo) payload.value = Object.freeze(payload.value);
|
|
3473
3582
|
return payload;
|
|
3474
3583
|
}
|
|
3584
|
+
function leafPattern(schema) {
|
|
3585
|
+
const def = schema._zod.def;
|
|
3586
|
+
let pattern = def.pattern;
|
|
3587
|
+
let isInt = !!def.format?.includes("int");
|
|
3588
|
+
let minimum;
|
|
3589
|
+
let maximum;
|
|
3590
|
+
for (const ch of def.checks ?? []) {
|
|
3591
|
+
const d = ch._zod.def;
|
|
3592
|
+
if (d.pattern) pattern = d.pattern;
|
|
3593
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
3594
|
+
const lo = d.minimum ?? d.length;
|
|
3595
|
+
const hi = d.maximum ?? d.length;
|
|
3596
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum)) minimum = lo;
|
|
3597
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum)) maximum = hi;
|
|
3598
|
+
}
|
|
3599
|
+
if (pattern) return pattern.source;
|
|
3600
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum) return "(?!)";
|
|
3601
|
+
if (minimum !== void 0 || maximum !== void 0) return string$2({
|
|
3602
|
+
minimum,
|
|
3603
|
+
maximum
|
|
3604
|
+
}).source;
|
|
3605
|
+
const own = schema._zod.pattern;
|
|
3606
|
+
return (isInt && own === number$2 ? integer : own)?.source;
|
|
3607
|
+
}
|
|
3608
|
+
function partPattern(schema) {
|
|
3609
|
+
const def = schema._zod.def;
|
|
3610
|
+
const own = schema._zod.pattern?.source;
|
|
3611
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
3612
|
+
if (inner) {
|
|
3613
|
+
const before = inner._zod.pattern?.source;
|
|
3614
|
+
const after = partPattern(inner);
|
|
3615
|
+
if (own && before && after && after !== before) return own.replace(cleanRegex(before), () => cleanRegex(after));
|
|
3616
|
+
return own;
|
|
3617
|
+
}
|
|
3618
|
+
if (def.options) {
|
|
3619
|
+
const sources = def.options.map(partPattern);
|
|
3620
|
+
if (sources.every(Boolean)) return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
3621
|
+
}
|
|
3622
|
+
return leafPattern(schema);
|
|
3623
|
+
}
|
|
3475
3624
|
const $ZodTemplateLiteral = /*@__PURE__*/ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
3476
3625
|
$ZodType.init(inst, def);
|
|
3477
3626
|
const regexParts = [];
|
|
3478
3627
|
for (const part of def.parts) if (typeof part === "object" && part !== null) {
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
3483
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
3484
|
-
regexParts.push(source.slice(start, end));
|
|
3628
|
+
const source = partPattern(part);
|
|
3629
|
+
if (!source) throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
3630
|
+
regexParts.push(cleanRegex(source));
|
|
3485
3631
|
} else if (part === null || primitiveTypes.has(typeof part)) regexParts.push(escapeRegex(`${part}`));
|
|
3486
3632
|
else throw new Error(`Invalid template literal part: ${part}`);
|
|
3487
3633
|
inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
|
|
@@ -3628,8 +3774,67 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3628
3774
|
payload.issues.push(issue(_iss));
|
|
3629
3775
|
}
|
|
3630
3776
|
}
|
|
3777
|
+
function handlePropertiesResult(result, payload, key) {
|
|
3778
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
3779
|
+
}
|
|
3780
|
+
const $ZodProperties = /*@__PURE__*/ $constructor("$ZodProperties", (inst, def) => {
|
|
3781
|
+
$ZodType.init(inst, def);
|
|
3782
|
+
$ZodCheck.init(inst, def);
|
|
3783
|
+
const memo = globalConfig.memoizer;
|
|
3784
|
+
memo?.attach(inst);
|
|
3785
|
+
let entries;
|
|
3786
|
+
const runShape = (payload, ctx) => {
|
|
3787
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
3788
|
+
const input = payload.value;
|
|
3789
|
+
let proms;
|
|
3790
|
+
for (const [key, schema] of entries) {
|
|
3791
|
+
const result = schema._zod.run({
|
|
3792
|
+
value: input[key],
|
|
3793
|
+
issues: []
|
|
3794
|
+
}, ctx);
|
|
3795
|
+
if (result instanceof Promise) {
|
|
3796
|
+
proms ?? (proms = []);
|
|
3797
|
+
proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
|
|
3798
|
+
} else handlePropertiesResult(result, payload, key);
|
|
3799
|
+
}
|
|
3800
|
+
if (proms) return Promise.all(proms).then(() => void 0);
|
|
3801
|
+
};
|
|
3802
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3803
|
+
const input = payload.value;
|
|
3804
|
+
if (input === null || typeof input !== "object" && typeof input !== "function") {
|
|
3805
|
+
payload.issues.push({
|
|
3806
|
+
expected: "object",
|
|
3807
|
+
code: "invalid_type",
|
|
3808
|
+
input,
|
|
3809
|
+
inst
|
|
3810
|
+
});
|
|
3811
|
+
return payload;
|
|
3812
|
+
}
|
|
3813
|
+
if (ctx.direction === "backward") ctx = {
|
|
3814
|
+
...ctx,
|
|
3815
|
+
direction: "forward"
|
|
3816
|
+
};
|
|
3817
|
+
if (memo) memo.alloc(inst, payload, input, ctx);
|
|
3818
|
+
const result = runShape(payload, ctx);
|
|
3819
|
+
return result instanceof Promise ? result.then(() => payload) : payload;
|
|
3820
|
+
};
|
|
3821
|
+
inst._zod.check = (payload) => {
|
|
3822
|
+
if (payload.value == null) {
|
|
3823
|
+
payload.issues.push({
|
|
3824
|
+
expected: "object",
|
|
3825
|
+
code: "invalid_type",
|
|
3826
|
+
input: payload.value,
|
|
3827
|
+
inst
|
|
3828
|
+
});
|
|
3829
|
+
return;
|
|
3830
|
+
}
|
|
3831
|
+
return runShape(payload, {});
|
|
3832
|
+
};
|
|
3833
|
+
}, { *[Symbol.iterator]() {
|
|
3834
|
+
yield this;
|
|
3835
|
+
} });
|
|
3631
3836
|
//#endregion
|
|
3632
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3837
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/memoizer.js
|
|
3633
3838
|
var $ZodCyclicError = class extends Error {
|
|
3634
3839
|
constructor() {
|
|
3635
3840
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3639,6 +3844,9 @@ var $ZodCyclicError = class extends Error {
|
|
|
3639
3844
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
3640
3845
|
const STATE = "~memo";
|
|
3641
3846
|
const NO_ISSUES = [];
|
|
3847
|
+
function isRef(value) {
|
|
3848
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
3849
|
+
}
|
|
3642
3850
|
function cloneIssues(issues) {
|
|
3643
3851
|
return issues.map((iss) => iss.path ? {
|
|
3644
3852
|
...iss,
|
|
@@ -3646,36 +3854,134 @@ function cloneIssues(issues) {
|
|
|
3646
3854
|
} : { ...iss });
|
|
3647
3855
|
}
|
|
3648
3856
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
3857
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
3858
|
+
const NONE = 0;
|
|
3859
|
+
const ASSUMED = 1;
|
|
3860
|
+
const PROVEN = 2;
|
|
3649
3861
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
3650
|
-
function isRecursive(inst, stack) {
|
|
3862
|
+
function isRecursive(inst, stack, resolve) {
|
|
3651
3863
|
const cached = recursive.get(inst);
|
|
3652
|
-
if (cached !== void 0) return cached;
|
|
3653
|
-
if (stack.has(inst)) return
|
|
3864
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
3865
|
+
if (stack.has(inst)) return PROVEN;
|
|
3654
3866
|
stack.add(inst);
|
|
3655
|
-
let result =
|
|
3867
|
+
let result = NONE;
|
|
3656
3868
|
const check = (child) => {
|
|
3657
|
-
if (
|
|
3869
|
+
if (result !== PROVEN && child?._zod) {
|
|
3870
|
+
const answer = isRecursive(child, stack, resolve);
|
|
3871
|
+
if (answer > result) result = answer;
|
|
3872
|
+
}
|
|
3873
|
+
};
|
|
3874
|
+
const shape = (sh, spread) => {
|
|
3875
|
+
let answer = NONE;
|
|
3876
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
3877
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
3878
|
+
if (spread && !desc.enumerable) continue;
|
|
3879
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
3880
|
+
if (child > answer) answer = child;
|
|
3881
|
+
}
|
|
3882
|
+
return answer;
|
|
3883
|
+
};
|
|
3884
|
+
const merge = (answer) => {
|
|
3885
|
+
if (answer > result) result = answer;
|
|
3658
3886
|
};
|
|
3659
3887
|
const def = inst._zod.def;
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3888
|
+
switch (def.type) {
|
|
3889
|
+
case "object": {
|
|
3890
|
+
const raw = rawShape(def);
|
|
3891
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
3892
|
+
check(def.catchall);
|
|
3893
|
+
break;
|
|
3894
|
+
}
|
|
3895
|
+
case "properties":
|
|
3896
|
+
merge(shape(def.shape, false));
|
|
3897
|
+
break;
|
|
3898
|
+
case "array":
|
|
3899
|
+
check(def.element);
|
|
3900
|
+
break;
|
|
3901
|
+
case "tuple":
|
|
3902
|
+
for (const el of def.items) check(el);
|
|
3903
|
+
check(def.rest);
|
|
3904
|
+
break;
|
|
3905
|
+
case "record":
|
|
3906
|
+
case "map":
|
|
3907
|
+
check(def.keyType);
|
|
3908
|
+
check(def.valueType);
|
|
3909
|
+
break;
|
|
3910
|
+
case "set":
|
|
3911
|
+
check(def.valueType);
|
|
3912
|
+
break;
|
|
3913
|
+
case "union":
|
|
3914
|
+
for (const el of def.options) check(el);
|
|
3915
|
+
break;
|
|
3916
|
+
case "intersection":
|
|
3917
|
+
check(def.left);
|
|
3918
|
+
check(def.right);
|
|
3919
|
+
break;
|
|
3920
|
+
case "optional":
|
|
3921
|
+
case "nullable":
|
|
3922
|
+
case "default":
|
|
3923
|
+
case "prefault":
|
|
3924
|
+
case "catch":
|
|
3925
|
+
case "readonly":
|
|
3926
|
+
case "nonoptional":
|
|
3927
|
+
case "promise":
|
|
3928
|
+
case "success":
|
|
3929
|
+
check(def.innerType);
|
|
3930
|
+
break;
|
|
3931
|
+
case "pipe":
|
|
3932
|
+
check(def.in);
|
|
3933
|
+
check(def.out);
|
|
3934
|
+
break;
|
|
3935
|
+
case "function":
|
|
3936
|
+
check(def.input);
|
|
3937
|
+
check(def.output);
|
|
3938
|
+
break;
|
|
3939
|
+
case "lazy": {
|
|
3940
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
3941
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
3942
|
+
break;
|
|
3943
|
+
}
|
|
3944
|
+
case "template_literal":
|
|
3945
|
+
case "string":
|
|
3946
|
+
case "number":
|
|
3947
|
+
case "int":
|
|
3948
|
+
case "boolean":
|
|
3949
|
+
case "bigint":
|
|
3950
|
+
case "symbol":
|
|
3951
|
+
case "undefined":
|
|
3952
|
+
case "null":
|
|
3953
|
+
case "void":
|
|
3954
|
+
case "never":
|
|
3955
|
+
case "any":
|
|
3956
|
+
case "unknown":
|
|
3957
|
+
case "date":
|
|
3958
|
+
case "nan":
|
|
3959
|
+
case "enum":
|
|
3960
|
+
case "literal":
|
|
3961
|
+
case "file":
|
|
3962
|
+
case "transform":
|
|
3963
|
+
case "custom": break;
|
|
3964
|
+
default: for (const key in def) {
|
|
3965
|
+
const desc = Object.getOwnPropertyDescriptor(def, key);
|
|
3966
|
+
if (!desc || desc.get) continue;
|
|
3967
|
+
const value = desc.value;
|
|
3666
3968
|
if (!value || typeof value !== "object") continue;
|
|
3667
3969
|
if (value._zod) check(value);
|
|
3668
3970
|
else if (Array.isArray(value)) for (const el of value) check(el);
|
|
3669
3971
|
}
|
|
3670
3972
|
}
|
|
3671
3973
|
stack.delete(inst);
|
|
3672
|
-
|
|
3673
|
-
|
|
3974
|
+
return settle(inst, result);
|
|
3975
|
+
}
|
|
3976
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
3977
|
+
function settle(inst, answer) {
|
|
3978
|
+
if (answer !== ASSUMED) recursive.set(inst, answer === PROVEN);
|
|
3979
|
+
return answer;
|
|
3674
3980
|
}
|
|
3675
3981
|
function bucketFor(state, inst) {
|
|
3676
3982
|
let bucket = state.buckets.get(inst);
|
|
3677
3983
|
if (!bucket) {
|
|
3678
|
-
bucket = /* @__PURE__ */ new
|
|
3984
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
3679
3985
|
state.buckets.set(inst, bucket);
|
|
3680
3986
|
}
|
|
3681
3987
|
return bucket;
|
|
@@ -3711,6 +4017,7 @@ const memo = {
|
|
|
3711
4017
|
attach(inst) {
|
|
3712
4018
|
var _a;
|
|
3713
4019
|
let isRecursiveInst;
|
|
4020
|
+
let rechecked = false;
|
|
3714
4021
|
let lastCtx;
|
|
3715
4022
|
let lastBucket;
|
|
3716
4023
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -3718,19 +4025,21 @@ const memo = {
|
|
|
3718
4025
|
const base = inst._zod.parse;
|
|
3719
4026
|
const wrapped = (payload, ctx) => {
|
|
3720
4027
|
if (isRecursiveInst === void 0) {
|
|
3721
|
-
|
|
3722
|
-
if (
|
|
4028
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
4029
|
+
if (walked === NONE) {
|
|
3723
4030
|
inst._zod.parse = base;
|
|
3724
4031
|
if (inst._zod.run === wrapped) inst._zod.run = base;
|
|
3725
4032
|
return base(payload, ctx);
|
|
3726
4033
|
}
|
|
4034
|
+
if (walked === PROVEN || rechecked) isRecursiveInst = true;
|
|
4035
|
+
else rechecked = true;
|
|
3727
4036
|
}
|
|
3728
4037
|
const input = payload.value;
|
|
3729
|
-
if (input
|
|
4038
|
+
if (!isRef(input)) return base(payload, ctx);
|
|
3730
4039
|
let state = ctx[STATE];
|
|
3731
4040
|
if (!state) {
|
|
3732
4041
|
state = {
|
|
3733
|
-
buckets: /* @__PURE__ */ new
|
|
4042
|
+
buckets: /* @__PURE__ */ new WeakMap(),
|
|
3734
4043
|
backEdges: void 0
|
|
3735
4044
|
};
|
|
3736
4045
|
ctx[STATE] = state;
|
|
@@ -3749,7 +4058,7 @@ const memo = {
|
|
|
3749
4058
|
if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
|
|
3750
4059
|
} else {
|
|
3751
4060
|
payload.memo = true;
|
|
3752
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
4061
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
3753
4062
|
state.backEdges.add(hit.value);
|
|
3754
4063
|
}
|
|
3755
4064
|
return payload;
|
|
@@ -3778,10 +4087,10 @@ function memoizer() {
|
|
|
3778
4087
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
3779
4088
|
function isBackEdge(ctx, value) {
|
|
3780
4089
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3781
|
-
return backEdges !== void 0 && value
|
|
4090
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3782
4091
|
}
|
|
3783
4092
|
//#endregion
|
|
3784
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
4093
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/locales/en.js
|
|
3785
4094
|
const error = () => {
|
|
3786
4095
|
const Sizable = {
|
|
3787
4096
|
string: {
|
|
@@ -3837,6 +4146,7 @@ const error = () => {
|
|
|
3837
4146
|
json_string: "JSON string",
|
|
3838
4147
|
e164: "E.164 number",
|
|
3839
4148
|
credit_card: "credit card number",
|
|
4149
|
+
iban: "IBAN",
|
|
3840
4150
|
jwt: "JWT",
|
|
3841
4151
|
template_literal: "input"
|
|
3842
4152
|
};
|
|
@@ -3887,7 +4197,7 @@ function en_default() {
|
|
|
3887
4197
|
return { localeError: error() };
|
|
3888
4198
|
}
|
|
3889
4199
|
//#endregion
|
|
3890
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
4200
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/registries.js
|
|
3891
4201
|
var _a;
|
|
3892
4202
|
var $ZodRegistry = class {
|
|
3893
4203
|
constructor() {
|
|
@@ -3934,7 +4244,7 @@ function registry() {
|
|
|
3934
4244
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3935
4245
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3936
4246
|
//#endregion
|
|
3937
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
4247
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/api.js
|
|
3938
4248
|
// @__NO_SIDE_EFFECTS__
|
|
3939
4249
|
function _string(Class, params) {
|
|
3940
4250
|
return new Class({
|
|
@@ -4181,6 +4491,16 @@ function _creditCard(Class, params) {
|
|
|
4181
4491
|
});
|
|
4182
4492
|
}
|
|
4183
4493
|
// @__NO_SIDE_EFFECTS__
|
|
4494
|
+
function _iban(Class, params) {
|
|
4495
|
+
return new Class({
|
|
4496
|
+
type: "string",
|
|
4497
|
+
format: "iban",
|
|
4498
|
+
check: "string_format",
|
|
4499
|
+
abort: false,
|
|
4500
|
+
...normalizeParams(params)
|
|
4501
|
+
});
|
|
4502
|
+
}
|
|
4503
|
+
// @__NO_SIDE_EFFECTS__
|
|
4184
4504
|
function _jwt(Class, params) {
|
|
4185
4505
|
return new Class({
|
|
4186
4506
|
type: "string",
|
|
@@ -4549,12 +4869,13 @@ function _property(property, schema, params) {
|
|
|
4549
4869
|
});
|
|
4550
4870
|
}
|
|
4551
4871
|
// @__NO_SIDE_EFFECTS__
|
|
4552
|
-
function _properties(shape) {
|
|
4553
|
-
return
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4872
|
+
function _properties(Class, shape, params) {
|
|
4873
|
+
return new Class({
|
|
4874
|
+
type: "properties",
|
|
4875
|
+
check: "properties",
|
|
4876
|
+
shape,
|
|
4877
|
+
...normalizeParams(params)
|
|
4878
|
+
});
|
|
4558
4879
|
}
|
|
4559
4880
|
// @__NO_SIDE_EFFECTS__
|
|
4560
4881
|
function _mime(types, params) {
|
|
@@ -4759,7 +5080,7 @@ function _stringFormat(Class, format, fnOrRegex, _params = {}) {
|
|
|
4759
5080
|
return new Class(def);
|
|
4760
5081
|
}
|
|
4761
5082
|
//#endregion
|
|
4762
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
5083
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/to-json-schema.js
|
|
4763
5084
|
function assignProps(target, ...sources) {
|
|
4764
5085
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
4765
5086
|
return target;
|
|
@@ -4782,6 +5103,7 @@ function initializeContext(params) {
|
|
|
4782
5103
|
cycles: params?.cycles ?? "ref",
|
|
4783
5104
|
reused: params?.reused ?? "inline",
|
|
4784
5105
|
intersections: [],
|
|
5106
|
+
deferred: [],
|
|
4785
5107
|
external: params?.external ?? void 0
|
|
4786
5108
|
};
|
|
4787
5109
|
}
|
|
@@ -4801,7 +5123,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
|
4801
5123
|
Object.assign(json, result);
|
|
4802
5124
|
return true;
|
|
4803
5125
|
}
|
|
4804
|
-
function
|
|
5126
|
+
function processSchema(schema, ctx, _params = {
|
|
4805
5127
|
path: [],
|
|
4806
5128
|
schemaPath: []
|
|
4807
5129
|
}) {
|
|
@@ -4840,7 +5162,7 @@ function process$1(schema, ctx, _params = {
|
|
|
4840
5162
|
const parent = schema._zod.parent;
|
|
4841
5163
|
if (parent) {
|
|
4842
5164
|
if (!result.ref) result.ref = parent;
|
|
4843
|
-
|
|
5165
|
+
processSchema(parent, ctx, params);
|
|
4844
5166
|
ctx.seen.get(parent).isParent = true;
|
|
4845
5167
|
}
|
|
4846
5168
|
}
|
|
@@ -4930,10 +5252,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4930
5252
|
continue;
|
|
4931
5253
|
}
|
|
4932
5254
|
if (seen.count > 1) {
|
|
4933
|
-
if (ctx.reused === "ref")
|
|
4934
|
-
extractToDef(entry);
|
|
4935
|
-
continue;
|
|
4936
|
-
}
|
|
5255
|
+
if (ctx.reused === "ref") extractToDef(entry);
|
|
4937
5256
|
}
|
|
4938
5257
|
}
|
|
4939
5258
|
if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
|
|
@@ -5091,6 +5410,7 @@ function finalize(ctx, schema) {
|
|
|
5091
5410
|
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
|
|
5092
5411
|
for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
|
|
5093
5412
|
if (ctx.target !== "openapi-3.0") for (const entry of ctx.seen.entries()) compactTypeUnion(entry[1].def ?? entry[1].schema);
|
|
5413
|
+
for (const rewrite of ctx.deferred) rewrite();
|
|
5094
5414
|
if (ctx.intersections.length) {
|
|
5095
5415
|
const carriers = /* @__PURE__ */ new Map();
|
|
5096
5416
|
for (const seen of ctx.seen.values()) for (const json of [seen.schema, seen.def]) {
|
|
@@ -5187,7 +5507,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
5187
5507
|
...params,
|
|
5188
5508
|
processors
|
|
5189
5509
|
});
|
|
5190
|
-
|
|
5510
|
+
processSchema(schema, ctx);
|
|
5191
5511
|
extractDefs(ctx, schema);
|
|
5192
5512
|
return finalize(ctx, schema);
|
|
5193
5513
|
};
|
|
@@ -5199,12 +5519,84 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
5199
5519
|
io,
|
|
5200
5520
|
processors
|
|
5201
5521
|
});
|
|
5202
|
-
|
|
5522
|
+
processSchema(schema, ctx);
|
|
5203
5523
|
extractDefs(ctx, schema);
|
|
5204
5524
|
return finalize(ctx, schema);
|
|
5205
5525
|
};
|
|
5206
5526
|
//#endregion
|
|
5207
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
5527
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/json-schema-processors.js
|
|
5528
|
+
const narrowMin = (agg, key, value) => {
|
|
5529
|
+
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
5530
|
+
};
|
|
5531
|
+
const narrowMax = (agg, key, value) => {
|
|
5532
|
+
if (agg[key] === void 0 || value < agg[key]) agg[key] = value;
|
|
5533
|
+
};
|
|
5534
|
+
const narrowBoth = (agg, value) => {
|
|
5535
|
+
narrowMin(agg, "minimum", value);
|
|
5536
|
+
narrowMax(agg, "maximum", value);
|
|
5537
|
+
};
|
|
5538
|
+
const addDivisor = (agg, value) => {
|
|
5539
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
5540
|
+
if (!agg.multipleOf.includes(value)) agg.multipleOf.push(value);
|
|
5541
|
+
};
|
|
5542
|
+
const addPattern = (agg, pattern) => {
|
|
5543
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
5544
|
+
agg.patterns.add(pattern);
|
|
5545
|
+
};
|
|
5546
|
+
const intersectMime = (agg, mime) => {
|
|
5547
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
5548
|
+
};
|
|
5549
|
+
const setFormat = (agg, format) => {
|
|
5550
|
+
agg.format = format;
|
|
5551
|
+
if (format.includes("int")) agg.isInt = true;
|
|
5552
|
+
};
|
|
5553
|
+
const minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
5554
|
+
const maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
5555
|
+
const formatContributor = (ranges) => (agg, def) => {
|
|
5556
|
+
setFormat(agg, def.format);
|
|
5557
|
+
const [minimum, maximum] = ranges[def.format];
|
|
5558
|
+
narrowMin(agg, "minimum", minimum);
|
|
5559
|
+
narrowMax(agg, "maximum", maximum);
|
|
5560
|
+
};
|
|
5561
|
+
const contributors = {
|
|
5562
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
5563
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
5564
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
5565
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
5566
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
5567
|
+
min_length: minContributor,
|
|
5568
|
+
max_length: maxContributor,
|
|
5569
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
5570
|
+
min_size: minContributor,
|
|
5571
|
+
max_size: maxContributor,
|
|
5572
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
5573
|
+
string_format: (agg, def) => {
|
|
5574
|
+
setFormat(agg, def.format);
|
|
5575
|
+
if (def.pattern) addPattern(agg, def.pattern);
|
|
5576
|
+
if (def.format === "base64" || def.format === "base64url") agg.contentEncoding = def.format;
|
|
5577
|
+
if (def.local || def.precision === -1) agg.laxFormat = true;
|
|
5578
|
+
},
|
|
5579
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
5580
|
+
};
|
|
5581
|
+
function aggregateChecks(schema) {
|
|
5582
|
+
const agg = {};
|
|
5583
|
+
const def = schema._zod.def;
|
|
5584
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
5585
|
+
for (const ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
5586
|
+
const bag = schema._zod.bag;
|
|
5587
|
+
if (bag.minimum !== void 0) narrowMin(agg, "minimum", bag.minimum);
|
|
5588
|
+
if (bag.exclusiveMinimum !== void 0) narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
5589
|
+
if (bag.maximum !== void 0) narrowMax(agg, "maximum", bag.maximum);
|
|
5590
|
+
if (bag.exclusiveMaximum !== void 0) narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
5591
|
+
if (bag.multipleOf !== void 0) addDivisor(agg, bag.multipleOf);
|
|
5592
|
+
if (bag.format !== void 0) {
|
|
5593
|
+
agg.format ?? (agg.format = bag.format);
|
|
5594
|
+
if (bag.format.includes("int")) agg.isInt = true;
|
|
5595
|
+
}
|
|
5596
|
+
if (bag.mime) intersectMime(agg, bag.mime);
|
|
5597
|
+
for (const pattern of bag.patterns ?? []) addPattern(agg, pattern);
|
|
5598
|
+
return agg;
|
|
5599
|
+
}
|
|
5208
5600
|
const formatMap = {
|
|
5209
5601
|
guid: "uuid",
|
|
5210
5602
|
url: "uri",
|
|
@@ -5212,10 +5604,12 @@ const formatMap = {
|
|
|
5212
5604
|
json_string: "json-string",
|
|
5213
5605
|
regex: ""
|
|
5214
5606
|
};
|
|
5607
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64$1], [base64urlCharset, base64url$1]]);
|
|
5608
|
+
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
5215
5609
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
5216
5610
|
const json = _json;
|
|
5217
5611
|
json.type = "string";
|
|
5218
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
5612
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
5219
5613
|
if (typeof minimum === "number") json.minLength = minimum;
|
|
5220
5614
|
if (typeof maximum === "number") json.maxLength = maximum;
|
|
5221
5615
|
if (format) {
|
|
@@ -5225,9 +5619,9 @@ const stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5225
5619
|
}
|
|
5226
5620
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
5227
5621
|
if (patterns && patterns.size > 0) {
|
|
5228
|
-
const
|
|
5229
|
-
if (
|
|
5230
|
-
else if (
|
|
5622
|
+
const patternList = [...patterns].map(exactPattern);
|
|
5623
|
+
if (patternList.length === 1) json.pattern = patternList[0].source;
|
|
5624
|
+
else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
|
|
5231
5625
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
5232
5626
|
pattern: regex.source
|
|
5233
5627
|
}))];
|
|
@@ -5235,9 +5629,8 @@ const stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5235
5629
|
};
|
|
5236
5630
|
const numberProcessor = (schema, ctx, _json, params) => {
|
|
5237
5631
|
const json = _json;
|
|
5238
|
-
const { minimum, maximum,
|
|
5239
|
-
|
|
5240
|
-
else json.type = "number";
|
|
5632
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
5633
|
+
json.type = isInt ? "integer" : "number";
|
|
5241
5634
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
5242
5635
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
5243
5636
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -5253,9 +5646,13 @@ const numberProcessor = (schema, ctx, _json, params) => {
|
|
|
5253
5646
|
json.exclusiveMaximum = true;
|
|
5254
5647
|
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
5255
5648
|
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
5256
|
-
if (
|
|
5257
|
-
|
|
5258
|
-
|
|
5649
|
+
if (multipleOf) {
|
|
5650
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
5651
|
+
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
5652
|
+
else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
5653
|
+
const [first, ...rest] = divisors;
|
|
5654
|
+
if (first !== void 0) json.multipleOf = first;
|
|
5655
|
+
if (rest.length) json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
5259
5656
|
}
|
|
5260
5657
|
};
|
|
5261
5658
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -5335,23 +5732,16 @@ const templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
|
5335
5732
|
};
|
|
5336
5733
|
const fileProcessor = (schema, _ctx, json, _params) => {
|
|
5337
5734
|
const _json = json;
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
if (
|
|
5345
|
-
if (
|
|
5346
|
-
if (mime)
|
|
5347
|
-
|
|
5348
|
-
file.contentMediaType = mime[0];
|
|
5349
|
-
Object.assign(_json, file);
|
|
5350
|
-
} else {
|
|
5351
|
-
Object.assign(_json, file);
|
|
5352
|
-
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
5353
|
-
}
|
|
5354
|
-
} else Object.assign(_json, file);
|
|
5735
|
+
_json.type = "string";
|
|
5736
|
+
_json.format = "binary";
|
|
5737
|
+
_json.contentEncoding = "binary";
|
|
5738
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
5739
|
+
if (minimum !== void 0) _json.minLength = minimum;
|
|
5740
|
+
if (maximum !== void 0) _json.maxLength = maximum;
|
|
5741
|
+
if (!mime) return;
|
|
5742
|
+
if (mime.length === 0) _json.not = {};
|
|
5743
|
+
else if (mime.length === 1) _json.contentMediaType = mime[0];
|
|
5744
|
+
else _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
5355
5745
|
};
|
|
5356
5746
|
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
5357
5747
|
json.type = "boolean";
|
|
@@ -5374,11 +5764,11 @@ const setProcessor = (schema, ctx, json, params) => {
|
|
|
5374
5764
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
5375
5765
|
const json = _json;
|
|
5376
5766
|
const def = schema._zod.def;
|
|
5377
|
-
const { minimum, maximum } = schema
|
|
5767
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
5378
5768
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
5379
5769
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
5380
5770
|
json.type = "array";
|
|
5381
|
-
json.items =
|
|
5771
|
+
json.items = processSchema(def.element, ctx, {
|
|
5382
5772
|
...params,
|
|
5383
5773
|
path: [...params.path, "items"]
|
|
5384
5774
|
});
|
|
@@ -5396,7 +5786,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
5396
5786
|
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
5397
5787
|
json.type = "object";
|
|
5398
5788
|
json.properties = {};
|
|
5399
|
-
for (const key in shape) assignProp(json.properties, key,
|
|
5789
|
+
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
5400
5790
|
...params,
|
|
5401
5791
|
path: [
|
|
5402
5792
|
...params.path,
|
|
@@ -5414,7 +5804,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
5414
5804
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
5415
5805
|
else if (!def.catchall) {
|
|
5416
5806
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
5417
|
-
} else if (def.catchall) json.additionalProperties =
|
|
5807
|
+
} else if (def.catchall) json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
5418
5808
|
...params,
|
|
5419
5809
|
path: [...params.path, "additionalProperties"]
|
|
5420
5810
|
});
|
|
@@ -5422,7 +5812,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
5422
5812
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
5423
5813
|
const def = schema._zod.def;
|
|
5424
5814
|
const isExclusive = def.inclusive === false;
|
|
5425
|
-
const options = def.options.map((x, i) =>
|
|
5815
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
5426
5816
|
...params,
|
|
5427
5817
|
path: [
|
|
5428
5818
|
...params.path,
|
|
@@ -5435,7 +5825,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
5435
5825
|
};
|
|
5436
5826
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
5437
5827
|
const def = schema._zod.def;
|
|
5438
|
-
const a =
|
|
5828
|
+
const a = processSchema(def.left, ctx, {
|
|
5439
5829
|
...params,
|
|
5440
5830
|
path: [
|
|
5441
5831
|
...params.path,
|
|
@@ -5443,7 +5833,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
5443
5833
|
0
|
|
5444
5834
|
]
|
|
5445
5835
|
});
|
|
5446
|
-
const b =
|
|
5836
|
+
const b = processSchema(def.right, ctx, {
|
|
5447
5837
|
...params,
|
|
5448
5838
|
path: [
|
|
5449
5839
|
...params.path,
|
|
@@ -5462,7 +5852,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
5462
5852
|
json.type = "array";
|
|
5463
5853
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
5464
5854
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
5465
|
-
const prefixItems = def.items.map((x, i) =>
|
|
5855
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
5466
5856
|
...params,
|
|
5467
5857
|
path: [
|
|
5468
5858
|
...params.path,
|
|
@@ -5470,7 +5860,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
5470
5860
|
i
|
|
5471
5861
|
]
|
|
5472
5862
|
}));
|
|
5473
|
-
const rest = def.rest ?
|
|
5863
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
5474
5864
|
...params,
|
|
5475
5865
|
path: [
|
|
5476
5866
|
...params.path,
|
|
@@ -5504,18 +5894,76 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
5504
5894
|
if (minItems > 0) json.minItems = minItems;
|
|
5505
5895
|
if (isClosed) json.maxItems = maxItems;
|
|
5506
5896
|
}
|
|
5507
|
-
const { minimum, maximum } = schema
|
|
5897
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
5508
5898
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
5509
5899
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
5510
5900
|
};
|
|
5901
|
+
/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
|
|
5902
|
+
* numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
|
|
5903
|
+
* behind a wrapper only carries its own `type` before then, and a union key only has its branches.
|
|
5904
|
+
*
|
|
5905
|
+
* A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather
|
|
5906
|
+
* than carried over: keeping them beside `type: "string"` reproduces the match-nothing schema this
|
|
5907
|
+
* exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`
|
|
5908
|
+
* accepts `"3"` — which is the deliberate trade, since throwing on it would reject an ordinary schema
|
|
5909
|
+
* outright. */
|
|
5910
|
+
function stringifyKeyNames(bySchema, json, visited) {
|
|
5911
|
+
if (json.$ref) {
|
|
5912
|
+
if (visited.has(json)) return json;
|
|
5913
|
+
visited.add(json);
|
|
5914
|
+
const def = bySchema.get(json)?.def;
|
|
5915
|
+
if (!def) return json;
|
|
5916
|
+
const inlined = stringifyKeyNames(bySchema, def, visited);
|
|
5917
|
+
return inlined === def ? json : inlined;
|
|
5918
|
+
}
|
|
5919
|
+
for (const keyword of ["anyOf", "oneOf"]) {
|
|
5920
|
+
const branches = json[keyword];
|
|
5921
|
+
if (!Array.isArray(branches)) continue;
|
|
5922
|
+
const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
5923
|
+
if (mapped.some((branch, i) => branch !== branches[i])) json = {
|
|
5924
|
+
...json,
|
|
5925
|
+
[keyword]: mapped
|
|
5926
|
+
};
|
|
5927
|
+
}
|
|
5928
|
+
const types = Array.isArray(json.type) ? json.type : [json.type];
|
|
5929
|
+
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
5930
|
+
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
5931
|
+
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
5932
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
5933
|
+
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
5934
|
+
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
5935
|
+
if (!numericType) return rest;
|
|
5936
|
+
rest.type = "string";
|
|
5937
|
+
if (!values) rest.pattern = (types.includes("number") ? number$2 : integer).source;
|
|
5938
|
+
return rest;
|
|
5939
|
+
}
|
|
5940
|
+
/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */
|
|
5941
|
+
const pendingRecords = /* @__PURE__ */ new WeakMap();
|
|
5942
|
+
function rewriteKeyNames(ctx) {
|
|
5943
|
+
const bySchema = /* @__PURE__ */ new Map();
|
|
5944
|
+
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
5945
|
+
const rewrites = /* @__PURE__ */ new Map();
|
|
5946
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
5947
|
+
const seen = ctx.seen.get(record);
|
|
5948
|
+
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
5949
|
+
if (!names || names === true || rewrites.has(names)) continue;
|
|
5950
|
+
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
5951
|
+
if (rewritten !== names) rewrites.set(names, rewritten);
|
|
5952
|
+
}
|
|
5953
|
+
if (!rewrites.size) return;
|
|
5954
|
+
for (const entry of ctx.seen.values()) for (const carrier of [entry.schema, entry.def]) {
|
|
5955
|
+
const rewritten = carrier && rewrites.get(carrier.propertyNames);
|
|
5956
|
+
if (rewritten) carrier.propertyNames = rewritten;
|
|
5957
|
+
}
|
|
5958
|
+
}
|
|
5511
5959
|
const recordProcessor = (schema, ctx, _json, params) => {
|
|
5512
5960
|
const json = _json;
|
|
5513
5961
|
const def = schema._zod.def;
|
|
5514
5962
|
json.type = "object";
|
|
5515
5963
|
const keyType = def.keyType;
|
|
5516
|
-
const patterns = keyType.
|
|
5964
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
5517
5965
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
5518
|
-
const valueSchema =
|
|
5966
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
5519
5967
|
...params,
|
|
5520
5968
|
path: [
|
|
5521
5969
|
...params.path,
|
|
@@ -5524,13 +5972,22 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
5524
5972
|
]
|
|
5525
5973
|
});
|
|
5526
5974
|
json.patternProperties = {};
|
|
5527
|
-
for (const pattern of patterns) assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
5975
|
+
for (const pattern of patterns) assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
5528
5976
|
} else {
|
|
5529
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12")
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5977
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
5978
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
5979
|
+
...params,
|
|
5980
|
+
path: [...params.path, "propertyNames"]
|
|
5981
|
+
});
|
|
5982
|
+
let pending = pendingRecords.get(ctx);
|
|
5983
|
+
if (!pending) {
|
|
5984
|
+
pending = [];
|
|
5985
|
+
pendingRecords.set(ctx, pending);
|
|
5986
|
+
ctx.deferred.push(() => rewriteKeyNames(ctx));
|
|
5987
|
+
}
|
|
5988
|
+
pending.push(schema);
|
|
5989
|
+
}
|
|
5990
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
5534
5991
|
...params,
|
|
5535
5992
|
path: [...params.path, "additionalProperties"]
|
|
5536
5993
|
});
|
|
@@ -5539,12 +5996,12 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
5539
5996
|
const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
|
|
5540
5997
|
if (keyValues && !def.partial && !omittableOnInput) {
|
|
5541
5998
|
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
5542
|
-
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
5999
|
+
if (validKeyValues.length > 0) json.required = validKeyValues.map(String);
|
|
5543
6000
|
}
|
|
5544
6001
|
};
|
|
5545
6002
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
5546
6003
|
const def = schema._zod.def;
|
|
5547
|
-
const inner =
|
|
6004
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
5548
6005
|
const seen = ctx.seen.get(schema);
|
|
5549
6006
|
if (ctx.target === "openapi-3.0") {
|
|
5550
6007
|
seen.ref = def.innerType;
|
|
@@ -5553,7 +6010,7 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
5553
6010
|
};
|
|
5554
6011
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
5555
6012
|
const def = schema._zod.def;
|
|
5556
|
-
|
|
6013
|
+
processSchema(def.innerType, ctx, params);
|
|
5557
6014
|
const seen = ctx.seen.get(schema);
|
|
5558
6015
|
seen.ref = def.innerType;
|
|
5559
6016
|
};
|
|
@@ -5574,7 +6031,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
|
|
|
5574
6031
|
}
|
|
5575
6032
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
5576
6033
|
const def = schema._zod.def;
|
|
5577
|
-
|
|
6034
|
+
processSchema(def.innerType, ctx, params);
|
|
5578
6035
|
const seen = ctx.seen.get(schema);
|
|
5579
6036
|
seen.ref = def.innerType;
|
|
5580
6037
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -5582,7 +6039,7 @@ const defaultProcessor = (schema, ctx, json, params) => {
|
|
|
5582
6039
|
};
|
|
5583
6040
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
5584
6041
|
const def = schema._zod.def;
|
|
5585
|
-
|
|
6042
|
+
processSchema(def.innerType, ctx, params);
|
|
5586
6043
|
const seen = ctx.seen.get(schema);
|
|
5587
6044
|
seen.ref = def.innerType;
|
|
5588
6045
|
if (ctx.io !== "input") return;
|
|
@@ -5591,7 +6048,7 @@ const prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
5591
6048
|
};
|
|
5592
6049
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
5593
6050
|
const def = schema._zod.def;
|
|
5594
|
-
|
|
6051
|
+
processSchema(def.innerType, ctx, params);
|
|
5595
6052
|
const seen = ctx.seen.get(schema);
|
|
5596
6053
|
seen.ref = def.innerType;
|
|
5597
6054
|
let catchValue;
|
|
@@ -5607,37 +6064,37 @@ const pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
5607
6064
|
const def = schema._zod.def;
|
|
5608
6065
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
5609
6066
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
5610
|
-
|
|
6067
|
+
processSchema(innerType, ctx, params);
|
|
5611
6068
|
const seen = ctx.seen.get(schema);
|
|
5612
6069
|
seen.ref = innerType;
|
|
5613
6070
|
};
|
|
5614
6071
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
5615
6072
|
const def = schema._zod.def;
|
|
5616
|
-
|
|
6073
|
+
processSchema(def.innerType, ctx, params);
|
|
5617
6074
|
const seen = ctx.seen.get(schema);
|
|
5618
6075
|
seen.ref = def.innerType;
|
|
5619
6076
|
json.readOnly = true;
|
|
5620
6077
|
};
|
|
5621
6078
|
const promiseProcessor = (schema, ctx, _json, params) => {
|
|
5622
6079
|
const def = schema._zod.def;
|
|
5623
|
-
|
|
6080
|
+
processSchema(def.innerType, ctx, params);
|
|
5624
6081
|
const seen = ctx.seen.get(schema);
|
|
5625
6082
|
seen.ref = def.innerType;
|
|
5626
6083
|
};
|
|
5627
6084
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
5628
6085
|
const def = schema._zod.def;
|
|
5629
|
-
|
|
6086
|
+
processSchema(def.innerType, ctx, params);
|
|
5630
6087
|
const seen = ctx.seen.get(schema);
|
|
5631
6088
|
seen.ref = def.innerType;
|
|
5632
6089
|
};
|
|
5633
6090
|
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
5634
6091
|
const innerType = schema._zod.innerType;
|
|
5635
|
-
|
|
6092
|
+
processSchema(innerType, ctx, params);
|
|
5636
6093
|
const seen = ctx.seen.get(schema);
|
|
5637
6094
|
seen.ref = innerType;
|
|
5638
6095
|
};
|
|
5639
6096
|
//#endregion
|
|
5640
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6097
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/checks.js
|
|
5641
6098
|
var checks_exports = /* @__PURE__ */ __exportAll({
|
|
5642
6099
|
endsWith: () => _endsWith,
|
|
5643
6100
|
gt: () => _gt,
|
|
@@ -5659,7 +6116,6 @@ var checks_exports = /* @__PURE__ */ __exportAll({
|
|
|
5659
6116
|
normalize: () => _normalize,
|
|
5660
6117
|
overwrite: () => _overwrite,
|
|
5661
6118
|
positive: () => _positive,
|
|
5662
|
-
properties: () => _properties,
|
|
5663
6119
|
property: () => _property,
|
|
5664
6120
|
regex: () => _regex,
|
|
5665
6121
|
size: () => _size,
|
|
@@ -5671,7 +6127,7 @@ var checks_exports = /* @__PURE__ */ __exportAll({
|
|
|
5671
6127
|
uppercase: () => _uppercase
|
|
5672
6128
|
});
|
|
5673
6129
|
//#endregion
|
|
5674
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6130
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/errors.js
|
|
5675
6131
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5676
6132
|
function _lazyMethod(proto, key, make) {
|
|
5677
6133
|
Object.defineProperty(proto, key, {
|
|
@@ -5721,7 +6177,7 @@ const initializer = (inst, issues) => {
|
|
|
5721
6177
|
};
|
|
5722
6178
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
5723
6179
|
//#endregion
|
|
5724
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6180
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/parse.js
|
|
5725
6181
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
5726
6182
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5727
6183
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5735,7 +6191,7 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
5735
6191
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5736
6192
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5737
6193
|
//#endregion
|
|
5738
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6194
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/schemas.js
|
|
5739
6195
|
var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
5740
6196
|
ZodAny: () => ZodAny,
|
|
5741
6197
|
ZodArray: () => ZodArray,
|
|
@@ -5764,12 +6220,14 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5764
6220
|
ZodFile: () => ZodFile,
|
|
5765
6221
|
ZodFunction: () => ZodFunction,
|
|
5766
6222
|
ZodGUID: () => ZodGUID,
|
|
6223
|
+
ZodIBAN: () => ZodIBAN,
|
|
5767
6224
|
ZodIPv4: () => ZodIPv4,
|
|
5768
6225
|
ZodIPv6: () => ZodIPv6,
|
|
5769
6226
|
ZodISODate: () => ZodISODate,
|
|
5770
6227
|
ZodISODateTime: () => ZodISODateTime,
|
|
5771
6228
|
ZodISODuration: () => ZodISODuration,
|
|
5772
6229
|
ZodISOTime: () => ZodISOTime,
|
|
6230
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
5773
6231
|
ZodIntersection: () => ZodIntersection,
|
|
5774
6232
|
ZodJWT: () => ZodJWT,
|
|
5775
6233
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -5791,6 +6249,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5791
6249
|
ZodPrefault: () => ZodPrefault,
|
|
5792
6250
|
ZodPreprocess: () => ZodPreprocess,
|
|
5793
6251
|
ZodPromise: () => ZodPromise,
|
|
6252
|
+
ZodProperties: () => ZodProperties,
|
|
5794
6253
|
ZodReadonly: () => ZodReadonly,
|
|
5795
6254
|
ZodRecord: () => ZodRecord,
|
|
5796
6255
|
ZodSet: () => ZodSet,
|
|
@@ -5846,6 +6305,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5846
6305
|
hex: () => hex,
|
|
5847
6306
|
hostname: () => hostname,
|
|
5848
6307
|
httpUrl: () => httpUrl,
|
|
6308
|
+
iban: () => iban,
|
|
5849
6309
|
instanceof: () => _instanceof,
|
|
5850
6310
|
int: () => int,
|
|
5851
6311
|
int32: () => int32,
|
|
@@ -5881,6 +6341,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5881
6341
|
prefault: () => prefault,
|
|
5882
6342
|
preprocess: () => preprocess,
|
|
5883
6343
|
promise: () => promise,
|
|
6344
|
+
properties: () => properties,
|
|
5884
6345
|
readonly: () => readonly,
|
|
5885
6346
|
record: () => record$1,
|
|
5886
6347
|
refine: () => refine$1,
|
|
@@ -6040,11 +6501,17 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6040
6501
|
return safeParseAsync(this, data, params);
|
|
6041
6502
|
},
|
|
6042
6503
|
get spa() {
|
|
6043
|
-
return this
|
|
6504
|
+
return this?.safeParseAsync;
|
|
6044
6505
|
},
|
|
6045
6506
|
set spa(value) {
|
|
6046
6507
|
own(this, "spa", value);
|
|
6047
6508
|
},
|
|
6509
|
+
validate(data, params) {
|
|
6510
|
+
return validate(this, data, params);
|
|
6511
|
+
},
|
|
6512
|
+
validateAsync(data, params) {
|
|
6513
|
+
return validateAsync$1(this, data, params);
|
|
6514
|
+
},
|
|
6048
6515
|
encode: function _encode(data, params) {
|
|
6049
6516
|
return encode(this, data, params, { callee: _encode });
|
|
6050
6517
|
},
|
|
@@ -6069,11 +6536,8 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6069
6536
|
async safeDecodeAsync(data, params) {
|
|
6070
6537
|
return safeDecodeAsync(this, data, params);
|
|
6071
6538
|
},
|
|
6072
|
-
|
|
6073
|
-
return
|
|
6074
|
-
},
|
|
6075
|
-
set toJSONSchema(value) {
|
|
6076
|
-
own(this, "toJSONSchema", value);
|
|
6539
|
+
toJSONSchema(params) {
|
|
6540
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
6077
6541
|
},
|
|
6078
6542
|
get description() {
|
|
6079
6543
|
return globalRegistry.get(this)?.description;
|
|
@@ -6087,10 +6551,10 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
6087
6551
|
$ZodString.init(inst, def);
|
|
6088
6552
|
ZodType.init(inst, def);
|
|
6089
6553
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6554
|
+
}, /*@__PURE__*/ derived({
|
|
6555
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
6556
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
6557
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
6094
6558
|
}, {
|
|
6095
6559
|
regex(...args) {
|
|
6096
6560
|
return this.check(/* @__PURE__ */ _regex(...args));
|
|
@@ -6137,7 +6601,7 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
6137
6601
|
slugify() {
|
|
6138
6602
|
return this.check(/* @__PURE__ */ _slugify());
|
|
6139
6603
|
}
|
|
6140
|
-
});
|
|
6604
|
+
}));
|
|
6141
6605
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
6142
6606
|
$ZodString.init(inst, def);
|
|
6143
6607
|
_ZodString.init(inst, def);
|
|
@@ -6412,6 +6876,13 @@ const ZodCreditCard = /*@__PURE__*/ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
6412
6876
|
function creditCard(params) {
|
|
6413
6877
|
return /* @__PURE__ */ _creditCard(ZodCreditCard, params);
|
|
6414
6878
|
}
|
|
6879
|
+
const ZodIBAN = /*@__PURE__*/ $constructor("ZodIBAN", (inst, def) => {
|
|
6880
|
+
$ZodIBAN.init(inst, def);
|
|
6881
|
+
ZodStringFormat.init(inst, def);
|
|
6882
|
+
});
|
|
6883
|
+
function iban(params) {
|
|
6884
|
+
return /* @__PURE__ */ _iban(ZodIBAN, params);
|
|
6885
|
+
}
|
|
6415
6886
|
const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
6416
6887
|
$ZodJWT.init(inst, def);
|
|
6417
6888
|
ZodStringFormat.init(inst, def);
|
|
@@ -6442,12 +6913,21 @@ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
|
6442
6913
|
$ZodNumber.init(inst, def);
|
|
6443
6914
|
ZodType.init(inst, def);
|
|
6444
6915
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
6445
|
-
const bag = inst._zod.bag;
|
|
6446
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
6447
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
6448
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
6449
6916
|
inst.isFinite = true;
|
|
6450
|
-
|
|
6917
|
+
}, /*@__PURE__*/ derived({
|
|
6918
|
+
minValue: (inst) => {
|
|
6919
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
6920
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
6921
|
+
},
|
|
6922
|
+
maxValue: (inst) => {
|
|
6923
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
6924
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
6925
|
+
},
|
|
6926
|
+
isInt: (inst) => {
|
|
6927
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
6928
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
6929
|
+
},
|
|
6930
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
6451
6931
|
}, {
|
|
6452
6932
|
gt(value, params) {
|
|
6453
6933
|
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
@@ -6494,7 +6974,7 @@ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
|
6494
6974
|
finite() {
|
|
6495
6975
|
return this;
|
|
6496
6976
|
}
|
|
6497
|
-
});
|
|
6977
|
+
}));
|
|
6498
6978
|
function number$1(params) {
|
|
6499
6979
|
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
6500
6980
|
}
|
|
@@ -6529,10 +7009,10 @@ const ZodBigInt = /*@__PURE__*/ $constructor("ZodBigInt", (inst, def) => {
|
|
|
6529
7009
|
$ZodBigInt.init(inst, def);
|
|
6530
7010
|
ZodType.init(inst, def);
|
|
6531
7011
|
inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
7012
|
+
}, /*@__PURE__*/ derived({
|
|
7013
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
7014
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
7015
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
6536
7016
|
}, {
|
|
6537
7017
|
gte(value, params) {
|
|
6538
7018
|
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
@@ -6567,7 +7047,7 @@ const ZodBigInt = /*@__PURE__*/ $constructor("ZodBigInt", (inst, def) => {
|
|
|
6567
7047
|
multipleOf(value, params) {
|
|
6568
7048
|
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
6569
7049
|
}
|
|
6570
|
-
});
|
|
7050
|
+
}));
|
|
6571
7051
|
function bigint$1(params) {
|
|
6572
7052
|
return /* @__PURE__ */ _bigint(ZodBigInt, params);
|
|
6573
7053
|
}
|
|
@@ -6643,10 +7123,16 @@ const ZodDate = /*@__PURE__*/ $constructor("ZodDate", (inst, def) => {
|
|
|
6643
7123
|
inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
|
|
6644
7124
|
inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6645
7125
|
inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
7126
|
+
}, /*@__PURE__*/ derived({
|
|
7127
|
+
minDate: (inst) => {
|
|
7128
|
+
const { minimum } = aggregateChecks(inst);
|
|
7129
|
+
return minimum ? new Date(minimum) : null;
|
|
7130
|
+
},
|
|
7131
|
+
maxDate: (inst) => {
|
|
7132
|
+
const { maximum } = aggregateChecks(inst);
|
|
7133
|
+
return maximum ? new Date(maximum) : null;
|
|
7134
|
+
}
|
|
7135
|
+
}, {}));
|
|
6650
7136
|
function date$1(params) {
|
|
6651
7137
|
return /* @__PURE__ */ _date(ZodDate, params);
|
|
6652
7138
|
}
|
|
@@ -6691,34 +7177,19 @@ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
|
6691
7177
|
return _enum(Object.keys(this._zod.def.shape));
|
|
6692
7178
|
},
|
|
6693
7179
|
catchall(catchall) {
|
|
6694
|
-
return this.clone({
|
|
6695
|
-
...this._zod.def,
|
|
6696
|
-
catchall
|
|
6697
|
-
});
|
|
7180
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
6698
7181
|
},
|
|
6699
7182
|
passthrough() {
|
|
6700
|
-
return this.clone({
|
|
6701
|
-
...this._zod.def,
|
|
6702
|
-
catchall: unknown()
|
|
6703
|
-
});
|
|
7183
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
6704
7184
|
},
|
|
6705
7185
|
loose() {
|
|
6706
|
-
return this.clone({
|
|
6707
|
-
...this._zod.def,
|
|
6708
|
-
catchall: unknown()
|
|
6709
|
-
});
|
|
7186
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
6710
7187
|
},
|
|
6711
7188
|
strict() {
|
|
6712
|
-
return this.clone({
|
|
6713
|
-
...this._zod.def,
|
|
6714
|
-
catchall: never()
|
|
6715
|
-
});
|
|
7189
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
6716
7190
|
},
|
|
6717
7191
|
strip() {
|
|
6718
|
-
return this.clone({
|
|
6719
|
-
...this._zod.def,
|
|
6720
|
-
catchall: void 0
|
|
6721
|
-
});
|
|
7192
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
6722
7193
|
},
|
|
6723
7194
|
extend(incoming) {
|
|
6724
7195
|
return extend(this, incoming);
|
|
@@ -6938,7 +7409,7 @@ const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
|
6938
7409
|
ZodType.init(inst, def);
|
|
6939
7410
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
6940
7411
|
inst.enum = def.entries;
|
|
6941
|
-
inst.options =
|
|
7412
|
+
inst.options = [...inst._zod.values];
|
|
6942
7413
|
const keys = new Set(Object.keys(def.entries));
|
|
6943
7414
|
inst.extract = (values, params) => {
|
|
6944
7415
|
const newEntries = {};
|
|
@@ -7269,6 +7740,14 @@ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
|
7269
7740
|
ZodType.init(inst, def);
|
|
7270
7741
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
7271
7742
|
});
|
|
7743
|
+
const ZodProperties = /*@__PURE__*/ $constructor("ZodProperties", (inst, def) => {
|
|
7744
|
+
_ensureDefaultMemoizer();
|
|
7745
|
+
$ZodProperties.init(inst, def);
|
|
7746
|
+
ZodType.init(inst, def);
|
|
7747
|
+
});
|
|
7748
|
+
function properties(shape, params) {
|
|
7749
|
+
return /* @__PURE__ */ _properties(ZodProperties, shape, params);
|
|
7750
|
+
}
|
|
7272
7751
|
function check(fn) {
|
|
7273
7752
|
const ch = new $ZodCheck({ check: "custom" });
|
|
7274
7753
|
ch._zod.check = fn;
|
|
@@ -7285,8 +7764,13 @@ function superRefine(fn, params) {
|
|
|
7285
7764
|
}
|
|
7286
7765
|
const describe = describe$1;
|
|
7287
7766
|
const meta = meta$1;
|
|
7767
|
+
const ZodInstanceOf = /*@__PURE__*/ $constructor("ZodInstanceOf", (inst, def) => {
|
|
7768
|
+
ZodCustom.init(inst, def);
|
|
7769
|
+
}, { properties(shape, params) {
|
|
7770
|
+
return this.check(properties(shape, params));
|
|
7771
|
+
} });
|
|
7288
7772
|
function _instanceof(cls, params = {}) {
|
|
7289
|
-
const inst = new
|
|
7773
|
+
const inst = new ZodInstanceOf({
|
|
7290
7774
|
type: "custom",
|
|
7291
7775
|
check: "custom",
|
|
7292
7776
|
fn: (data) => data instanceof cls,
|
|
@@ -7331,7 +7815,7 @@ function preprocess(fn, schema) {
|
|
|
7331
7815
|
});
|
|
7332
7816
|
}
|
|
7333
7817
|
//#endregion
|
|
7334
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
7818
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/compat.js
|
|
7335
7819
|
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
7336
7820
|
var ZodFirstPartyTypeKind;
|
|
7337
7821
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
@@ -7340,7 +7824,7 @@ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
|
7340
7824
|
...checks_exports
|
|
7341
7825
|
});
|
|
7342
7826
|
//#endregion
|
|
7343
|
-
//#region ../../node_modules/.pnpm/@ariestools+provider-model@1.3.0_zod@4.
|
|
7827
|
+
//#region ../../node_modules/.pnpm/@ariestools+provider-model@1.3.0_zod@4.6.1/node_modules/@ariestools/provider-model/dist/neutral/index.mjs
|
|
7344
7828
|
var ConnectionConfigZod = looseObject({ type: string$1().min(1) });
|
|
7345
7829
|
var ConnectionsConfigZod = record$1(string$1(), ConnectionConfigZod).default({});
|
|
7346
7830
|
strictObject({ dependencies: array$1(string$1().min(1)).default([]) });
|
|
@@ -7354,7 +7838,7 @@ var ProviderConfigFieldsZod = object({
|
|
|
7354
7838
|
providerBindings: record$1(string$1(), ProviderBindingConfigZod).default({})
|
|
7355
7839
|
});
|
|
7356
7840
|
//#endregion
|
|
7357
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
7841
|
+
//#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/mini/schemas.js
|
|
7358
7842
|
const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
|
|
7359
7843
|
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
7360
7844
|
$ZodType.init(inst, def);
|
|
@@ -8950,7 +9434,7 @@ const API_NAME = "trace";
|
|
|
8950
9434
|
}
|
|
8951
9435
|
}).getInstance();
|
|
8952
9436
|
//#endregion
|
|
8953
|
-
//#region ../../node_modules/.pnpm/@ariestools+telemetry@8.
|
|
9437
|
+
//#region ../../node_modules/.pnpm/@ariestools+telemetry@8.3.0_@opentelemetry+api@1.9.1/node_modules/@ariestools/telemetry/dist/neutral/index.mjs
|
|
8954
9438
|
var color$1 = (open, close = 39) => {
|
|
8955
9439
|
return (value) => `\x1B[${open}m${value}\x1B[${close}m`;
|
|
8956
9440
|
};
|
|
@@ -9035,7 +9519,7 @@ function spanDurationInMillis$1(span2) {
|
|
|
9035
9519
|
}
|
|
9036
9520
|
});
|
|
9037
9521
|
//#endregion
|
|
9038
|
-
//#region ../../node_modules/.pnpm/@ariestools+sdk@8.
|
|
9522
|
+
//#region ../../node_modules/.pnpm/@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.1/node_modules/@ariestools/sdk/dist/node/index.mjs
|
|
9039
9523
|
var __defProp$1 = Object.defineProperty;
|
|
9040
9524
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
9041
9525
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -10717,7 +11201,7 @@ function spanDurationInMillis(span2) {
|
|
|
10717
11201
|
}
|
|
10718
11202
|
});
|
|
10719
11203
|
//#endregion
|
|
10720
|
-
//#region ../../node_modules/.pnpm/@ariestools+actor@1.3.0_@ariestools+sdk@8.
|
|
11204
|
+
//#region ../../node_modules/.pnpm/@ariestools+actor@1.3.0_@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.1__@opentelemetry+api@1.9.1_zod@4.6.1/node_modules/@ariestools/actor/dist/neutral/index.mjs
|
|
10721
11205
|
var __defProp = Object.defineProperty;
|
|
10722
11206
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10723
11207
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -10970,7 +11454,7 @@ ${err.stack}` : "";
|
|
|
10970
11454
|
return String(err);
|
|
10971
11455
|
}
|
|
10972
11456
|
//#endregion
|
|
10973
|
-
//#region ../../node_modules/.pnpm/@ariestools+actor-system@1.3.0_@ariestools+sdk@8.
|
|
11457
|
+
//#region ../../node_modules/.pnpm/@ariestools+actor-system@1.3.0_@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.1_e4d63a6db742046cbc8d622a2f828386/node_modules/@ariestools/actor-system/dist/neutral/index.mjs
|
|
10974
11458
|
var ActorSystemSelectionZod = strictObject({
|
|
10975
11459
|
config: unknown().optional(),
|
|
10976
11460
|
host: string$1().min(1).optional(),
|
|
@@ -10991,7 +11475,7 @@ var ActorSystemSelectionZod = strictObject({
|
|
|
10991
11475
|
});
|
|
10992
11476
|
ProviderConfigFieldsZod.extend({ actors: array$1(ActorSystemSelectionZod).default([]) });
|
|
10993
11477
|
//#endregion
|
|
10994
|
-
//#region ../../node_modules/.pnpm/@ariestools+cli-kit@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.
|
|
11478
|
+
//#region ../../node_modules/.pnpm/@ariestools+cli-kit@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.3.0_@opentele_12686f89e232b4319a2511392ce53195/node_modules/@ariestools/cli-kit/dist/node/index.mjs
|
|
10995
11479
|
async function runServiceUntilInterrupt(host, stop) {
|
|
10996
11480
|
await new Promise((resolve, reject) => {
|
|
10997
11481
|
const dispose = host.onInterrupt(async () => {
|
|
@@ -11006,7 +11490,7 @@ async function runServiceUntilInterrupt(host, stop) {
|
|
|
11006
11490
|
});
|
|
11007
11491
|
}
|
|
11008
11492
|
//#endregion
|
|
11009
|
-
//#region ../../node_modules/.pnpm/@ariestools+cli-kit-node@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.
|
|
11493
|
+
//#region ../../node_modules/.pnpm/@ariestools+cli-kit-node@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.3.0_@ope_7b18c786a1c8bb7b1298534a22a75fd9/node_modules/@ariestools/cli-kit-node/dist/node/index.mjs
|
|
11010
11494
|
function resolveEnvironmentValue(key, layers) {
|
|
11011
11495
|
for (const layer of layers) {
|
|
11012
11496
|
if (!Object.hasOwn(layer, key)) continue;
|
|
@@ -11207,8 +11691,8 @@ const TLS_CERT_PATH = process.env.CHAIN_TLS_CERT;
|
|
|
11207
11691
|
const TLS_KEY_PATH = process.env.CHAIN_TLS_KEY;
|
|
11208
11692
|
async function main() {
|
|
11209
11693
|
if (!isChainBackingKind(BACKING)) throw new Error(`Unsupported CHAIN_BACKING '${BACKING}' (supported: ${CHAIN_BACKINGS.join(", ")})`);
|
|
11210
|
-
const backing = resolveBacking(BACKING);
|
|
11211
11694
|
if (TLS_CERT_PATH === void 0 !== (TLS_KEY_PATH === void 0)) throw new Error("CHAIN_TLS_CERT and CHAIN_TLS_KEY must be provided together");
|
|
11695
|
+
const backing = resolveBacking(BACKING);
|
|
11212
11696
|
const server = await startChainServer({
|
|
11213
11697
|
backing,
|
|
11214
11698
|
host: HOST,
|
|
@@ -11222,9 +11706,13 @@ async function main() {
|
|
|
11222
11706
|
console.log(`chain server listening at ${server.baseUrl}\n` + CHAIN_BUCKETS.map((bucket) => ` /${bucket.padEnd(7)} ${server.baseUrl}/${bucket}`).join("\n") + `\nbacking: ${backing.description} — ${backing.directory}`);
|
|
11223
11707
|
await runServiceUntilInterrupt(createNodeProcessHost({ signals: ["SIGINT", "SIGTERM"] }), () => server.close());
|
|
11224
11708
|
}
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
})
|
|
11709
|
+
(async () => {
|
|
11710
|
+
try {
|
|
11711
|
+
await main();
|
|
11712
|
+
} catch (error) {
|
|
11713
|
+
console.error(error);
|
|
11714
|
+
process.exit(1);
|
|
11715
|
+
}
|
|
11716
|
+
})();
|
|
11229
11717
|
//#endregion
|
|
11230
11718
|
export {};
|