@ariestools/aries-chain-serve 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/dist/bin/chainServer.mjs +940 -453
- package/package.json +9 -9
package/dist/bin/chainServer.mjs
CHANGED
|
@@ -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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/node_modules/zod/v4/core/versions.js
|
|
1626
1645
|
const version = {
|
|
1627
1646
|
major: 4,
|
|
1628
|
-
minor:
|
|
1629
|
-
patch:
|
|
1647
|
+
minor: 6,
|
|
1648
|
+
patch: 2
|
|
1630
1649
|
};
|
|
1631
1650
|
//#endregion
|
|
1632
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1651
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/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;
|
|
@@ -2323,7 +2379,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
|
2323
2379
|
return;
|
|
2324
2380
|
}
|
|
2325
2381
|
if (result.value === void 0) {
|
|
2326
|
-
if (isPresent) final.value[key] = void 0;
|
|
2382
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
|
|
2327
2383
|
} else final.value[key] = result.value;
|
|
2328
2384
|
}
|
|
2329
2385
|
const NO_SYMBOL_KEYS = [];
|
|
@@ -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) {
|
|
@@ -2510,19 +2588,18 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
2510
2588
|
}
|
|
2511
2589
|
|
|
2512
2590
|
`);
|
|
2513
|
-
else
|
|
2591
|
+
else {
|
|
2592
|
+
doc.write(`
|
|
2514
2593
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
2515
2594
|
}
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
}
|
|
2521
|
-
} else {
|
|
2595
|
+
`);
|
|
2596
|
+
if (optin === "defaulted") doc.write(`newResult[${k}] = ${id}.value;`);
|
|
2597
|
+
else doc.write(`
|
|
2598
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
2522
2599
|
newResult[${k}] = ${id}.value;
|
|
2523
2600
|
}
|
|
2524
|
-
|
|
2525
2601
|
`);
|
|
2602
|
+
}
|
|
2526
2603
|
}
|
|
2527
2604
|
doc.write(`payload.value = newResult;`);
|
|
2528
2605
|
doc.write(`return payload;`);
|
|
@@ -2550,7 +2627,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
2550
2627
|
if (!fastpass) fastpass = generateFastpass(def.shape);
|
|
2551
2628
|
payload = fastpass(payload, ctx);
|
|
2552
2629
|
if (!catchall) return payload;
|
|
2553
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2630
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2554
2631
|
}
|
|
2555
2632
|
return superParse(payload, ctx);
|
|
2556
2633
|
};
|
|
@@ -2657,39 +2734,42 @@ const $ZodXor = /*@__PURE__*/ $constructor("$ZodXor", (inst, def) => {
|
|
|
2657
2734
|
});
|
|
2658
2735
|
};
|
|
2659
2736
|
});
|
|
2737
|
+
function discriminatorMap(def) {
|
|
2738
|
+
const map = /* @__PURE__ */ new Map();
|
|
2739
|
+
for (const option of def.options) {
|
|
2740
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
2741
|
+
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
2742
|
+
for (const value of values) if (map.has(value)) {
|
|
2743
|
+
if (value !== void 0) throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
2744
|
+
map.set(value, null);
|
|
2745
|
+
} else map.set(value, option);
|
|
2746
|
+
}
|
|
2747
|
+
return map;
|
|
2748
|
+
}
|
|
2660
2749
|
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
2661
2750
|
def.inclusive = false;
|
|
2662
2751
|
$ZodUnion.init(inst, def);
|
|
2663
2752
|
const _super = inst._zod.parse;
|
|
2664
2753
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
2665
2754
|
const propValues = {};
|
|
2755
|
+
let undefinedCount = 0;
|
|
2666
2756
|
for (const option of zod.def.options) {
|
|
2667
2757
|
const pv = option._zod.propValues;
|
|
2668
2758
|
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
2759
|
+
if (pv[zod.def.discriminator]?.has(void 0)) undefinedCount++;
|
|
2669
2760
|
for (const [k, v] of Object.entries(pv)) {
|
|
2670
2761
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
2671
2762
|
for (const val of v) propValues[k].add(val);
|
|
2672
2763
|
}
|
|
2673
2764
|
}
|
|
2765
|
+
if (!zod.def.unionFallback && undefinedCount > 1) propValues[zod.def.discriminator]?.delete(void 0);
|
|
2674
2766
|
return propValues;
|
|
2675
2767
|
});
|
|
2676
2768
|
def.options.forEach((option, i) => {
|
|
2677
|
-
const propShape =
|
|
2769
|
+
const propShape = rawShape(option._zod.def);
|
|
2678
2770
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
2679
2771
|
});
|
|
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
|
-
});
|
|
2772
|
+
const disc = cached(() => discriminatorMap(def));
|
|
2693
2773
|
inst._zod.parse = (payload, ctx) => {
|
|
2694
2774
|
const input = payload.value;
|
|
2695
2775
|
if (!isObject$1(input)) {
|
|
@@ -2701,15 +2781,16 @@ const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnio
|
|
|
2701
2781
|
});
|
|
2702
2782
|
return payload;
|
|
2703
2783
|
}
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2784
|
+
const value = input?.[def.discriminator];
|
|
2785
|
+
const opt = disc.value.get(value);
|
|
2786
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) return opt._zod.run(payload, ctx);
|
|
2706
2787
|
if (def.unionFallback || ctx.direction === "backward") return _super(payload, ctx);
|
|
2707
2788
|
payload.issues.push({
|
|
2708
2789
|
code: "invalid_union",
|
|
2709
2790
|
errors: [],
|
|
2710
2791
|
note: "No matching discriminator",
|
|
2711
2792
|
discriminator: def.discriminator,
|
|
2712
|
-
options: Array.from(disc.value.keys()),
|
|
2793
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2713
2794
|
input,
|
|
2714
2795
|
path: [def.discriminator],
|
|
2715
2796
|
inst
|
|
@@ -2873,6 +2954,8 @@ const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
|
2873
2954
|
});
|
|
2874
2955
|
}
|
|
2875
2956
|
const itemResults = new Array(items.length);
|
|
2957
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
2958
|
+
let itemAborted = false;
|
|
2876
2959
|
for (let i = 0; i < items.length; i++) {
|
|
2877
2960
|
const r = items[i]._zod.run({
|
|
2878
2961
|
value: input[i],
|
|
@@ -2881,12 +2964,20 @@ const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
|
2881
2964
|
if (r instanceof Promise) proms.push(r.then((rr) => {
|
|
2882
2965
|
itemResults[i] = rr;
|
|
2883
2966
|
}));
|
|
2884
|
-
else
|
|
2967
|
+
else {
|
|
2968
|
+
itemResults[i] = r;
|
|
2969
|
+
if (abortEarly && !itemAborted && r.issues.length) itemAborted = aborted(r);
|
|
2970
|
+
}
|
|
2885
2971
|
}
|
|
2886
|
-
if (def.rest) {
|
|
2972
|
+
if (def.rest && !itemAborted) {
|
|
2887
2973
|
let i = items.length - 1;
|
|
2888
2974
|
const rest = input.slice(items.length);
|
|
2975
|
+
let seen = payload.issues.length;
|
|
2889
2976
|
for (const el of rest) {
|
|
2977
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2978
|
+
if (aborted(payload, seen)) break;
|
|
2979
|
+
seen = payload.issues.length;
|
|
2980
|
+
}
|
|
2890
2981
|
i++;
|
|
2891
2982
|
const result = def.rest._zod.run({
|
|
2892
2983
|
value: el,
|
|
@@ -3078,7 +3169,13 @@ const $ZodMap = /*@__PURE__*/ $constructor("$ZodMap", (inst, def) => {
|
|
|
3078
3169
|
}
|
|
3079
3170
|
const proms = [];
|
|
3080
3171
|
payload.value = memo ? memo.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
3172
|
+
const abortEarly = ctx?.abortEarly;
|
|
3173
|
+
let seen = payload.issues.length;
|
|
3081
3174
|
for (const [key, value] of input) {
|
|
3175
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3176
|
+
if (aborted(payload, seen)) break;
|
|
3177
|
+
seen = payload.issues.length;
|
|
3178
|
+
}
|
|
3082
3179
|
const keyResult = def.keyType._zod.run({
|
|
3083
3180
|
value: key,
|
|
3084
3181
|
issues: []
|
|
@@ -3137,7 +3234,13 @@ const $ZodSet = /*@__PURE__*/ $constructor("$ZodSet", (inst, def) => {
|
|
|
3137
3234
|
}
|
|
3138
3235
|
const proms = [];
|
|
3139
3236
|
payload.value = memo ? memo.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
3237
|
+
const abortEarly = ctx?.abortEarly;
|
|
3238
|
+
let seen = payload.issues.length;
|
|
3140
3239
|
for (const item of input) {
|
|
3240
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3241
|
+
if (aborted(payload, seen)) break;
|
|
3242
|
+
seen = payload.issues.length;
|
|
3243
|
+
}
|
|
3141
3244
|
const result = def.valueType._zod.run({
|
|
3142
3245
|
value: item,
|
|
3143
3246
|
issues: []
|
|
@@ -3158,8 +3261,10 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
3158
3261
|
const values = getEnumValues(def.entries);
|
|
3159
3262
|
const valuesSet = new Set(values);
|
|
3160
3263
|
inst._zod.values = valuesSet;
|
|
3161
|
-
|
|
3162
|
-
|
|
3264
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
3265
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
3266
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
3267
|
+
});
|
|
3163
3268
|
inst._zod.parse = (payload, _ctx) => {
|
|
3164
3269
|
const input = payload.value;
|
|
3165
3270
|
if (valuesSet.has(input)) return payload;
|
|
@@ -3176,7 +3281,10 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
3176
3281
|
$ZodType.init(inst, def);
|
|
3177
3282
|
const values = new Set(def.values);
|
|
3178
3283
|
inst._zod.values = values;
|
|
3179
|
-
inst
|
|
3284
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
3285
|
+
const vals = zod.def.values;
|
|
3286
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
3287
|
+
});
|
|
3180
3288
|
inst._zod.parse = (payload, _ctx) => {
|
|
3181
3289
|
const input = payload.value;
|
|
3182
3290
|
if (values.has(input)) return payload;
|
|
@@ -3472,16 +3580,53 @@ function handleReadonlyResult(payload) {
|
|
|
3472
3580
|
if (!payload.memo) payload.value = Object.freeze(payload.value);
|
|
3473
3581
|
return payload;
|
|
3474
3582
|
}
|
|
3583
|
+
function leafPattern(schema) {
|
|
3584
|
+
const def = schema._zod.def;
|
|
3585
|
+
let pattern = def.pattern;
|
|
3586
|
+
let isInt = !!def.format?.includes("int");
|
|
3587
|
+
let minimum;
|
|
3588
|
+
let maximum;
|
|
3589
|
+
for (const ch of def.checks ?? []) {
|
|
3590
|
+
const d = ch._zod.def;
|
|
3591
|
+
if (d.pattern) pattern = d.pattern;
|
|
3592
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
3593
|
+
const lo = d.minimum ?? d.length;
|
|
3594
|
+
const hi = d.maximum ?? d.length;
|
|
3595
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum)) minimum = lo;
|
|
3596
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum)) maximum = hi;
|
|
3597
|
+
}
|
|
3598
|
+
if (pattern) return pattern.source;
|
|
3599
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum) return "(?!)";
|
|
3600
|
+
if (minimum !== void 0 || maximum !== void 0) return string$2({
|
|
3601
|
+
minimum,
|
|
3602
|
+
maximum
|
|
3603
|
+
}).source;
|
|
3604
|
+
const own = schema._zod.pattern;
|
|
3605
|
+
return (isInt && own === number$2 ? integer : own)?.source;
|
|
3606
|
+
}
|
|
3607
|
+
function partPattern(schema) {
|
|
3608
|
+
const def = schema._zod.def;
|
|
3609
|
+
const own = schema._zod.pattern?.source;
|
|
3610
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
3611
|
+
if (inner) {
|
|
3612
|
+
const before = inner._zod.pattern?.source;
|
|
3613
|
+
const after = partPattern(inner);
|
|
3614
|
+
if (own && before && after && after !== before) return own.replace(cleanRegex(before), () => cleanRegex(after));
|
|
3615
|
+
return own;
|
|
3616
|
+
}
|
|
3617
|
+
if (def.options) {
|
|
3618
|
+
const sources = def.options.map(partPattern);
|
|
3619
|
+
if (sources.every(Boolean)) return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
3620
|
+
}
|
|
3621
|
+
return leafPattern(schema);
|
|
3622
|
+
}
|
|
3475
3623
|
const $ZodTemplateLiteral = /*@__PURE__*/ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
3476
3624
|
$ZodType.init(inst, def);
|
|
3477
3625
|
const regexParts = [];
|
|
3478
3626
|
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));
|
|
3627
|
+
const source = partPattern(part);
|
|
3628
|
+
if (!source) throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
3629
|
+
regexParts.push(cleanRegex(source));
|
|
3485
3630
|
} else if (part === null || primitiveTypes.has(typeof part)) regexParts.push(escapeRegex(`${part}`));
|
|
3486
3631
|
else throw new Error(`Invalid template literal part: ${part}`);
|
|
3487
3632
|
inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
|
|
@@ -3628,8 +3773,67 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3628
3773
|
payload.issues.push(issue(_iss));
|
|
3629
3774
|
}
|
|
3630
3775
|
}
|
|
3776
|
+
function handlePropertiesResult(result, payload, key) {
|
|
3777
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
3778
|
+
}
|
|
3779
|
+
const $ZodProperties = /*@__PURE__*/ $constructor("$ZodProperties", (inst, def) => {
|
|
3780
|
+
$ZodType.init(inst, def);
|
|
3781
|
+
$ZodCheck.init(inst, def);
|
|
3782
|
+
const memo = globalConfig.memoizer;
|
|
3783
|
+
memo?.attach(inst);
|
|
3784
|
+
let entries;
|
|
3785
|
+
const runShape = (payload, ctx) => {
|
|
3786
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
3787
|
+
const input = payload.value;
|
|
3788
|
+
let proms;
|
|
3789
|
+
for (const [key, schema] of entries) {
|
|
3790
|
+
const result = schema._zod.run({
|
|
3791
|
+
value: input[key],
|
|
3792
|
+
issues: []
|
|
3793
|
+
}, ctx);
|
|
3794
|
+
if (result instanceof Promise) {
|
|
3795
|
+
proms ?? (proms = []);
|
|
3796
|
+
proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
|
|
3797
|
+
} else handlePropertiesResult(result, payload, key);
|
|
3798
|
+
}
|
|
3799
|
+
if (proms) return Promise.all(proms).then(() => void 0);
|
|
3800
|
+
};
|
|
3801
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3802
|
+
const input = payload.value;
|
|
3803
|
+
if (input === null || typeof input !== "object" && typeof input !== "function") {
|
|
3804
|
+
payload.issues.push({
|
|
3805
|
+
expected: "object",
|
|
3806
|
+
code: "invalid_type",
|
|
3807
|
+
input,
|
|
3808
|
+
inst
|
|
3809
|
+
});
|
|
3810
|
+
return payload;
|
|
3811
|
+
}
|
|
3812
|
+
if (ctx.direction === "backward") ctx = {
|
|
3813
|
+
...ctx,
|
|
3814
|
+
direction: "forward"
|
|
3815
|
+
};
|
|
3816
|
+
if (memo) memo.alloc(inst, payload, input, ctx);
|
|
3817
|
+
const result = runShape(payload, ctx);
|
|
3818
|
+
return result instanceof Promise ? result.then(() => payload) : payload;
|
|
3819
|
+
};
|
|
3820
|
+
inst._zod.check = (payload) => {
|
|
3821
|
+
if (payload.value == null) {
|
|
3822
|
+
payload.issues.push({
|
|
3823
|
+
expected: "object",
|
|
3824
|
+
code: "invalid_type",
|
|
3825
|
+
input: payload.value,
|
|
3826
|
+
inst
|
|
3827
|
+
});
|
|
3828
|
+
return;
|
|
3829
|
+
}
|
|
3830
|
+
return runShape(payload, {});
|
|
3831
|
+
};
|
|
3832
|
+
}, { *[Symbol.iterator]() {
|
|
3833
|
+
yield this;
|
|
3834
|
+
} });
|
|
3631
3835
|
//#endregion
|
|
3632
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
3836
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/core/memoizer.js
|
|
3633
3837
|
var $ZodCyclicError = class extends Error {
|
|
3634
3838
|
constructor() {
|
|
3635
3839
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3639,6 +3843,9 @@ var $ZodCyclicError = class extends Error {
|
|
|
3639
3843
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
3640
3844
|
const STATE = "~memo";
|
|
3641
3845
|
const NO_ISSUES = [];
|
|
3846
|
+
function isRef(value) {
|
|
3847
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
3848
|
+
}
|
|
3642
3849
|
function cloneIssues(issues) {
|
|
3643
3850
|
return issues.map((iss) => iss.path ? {
|
|
3644
3851
|
...iss,
|
|
@@ -3646,36 +3853,134 @@ function cloneIssues(issues) {
|
|
|
3646
3853
|
} : { ...iss });
|
|
3647
3854
|
}
|
|
3648
3855
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
3856
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
3857
|
+
const NONE = 0;
|
|
3858
|
+
const ASSUMED = 1;
|
|
3859
|
+
const PROVEN = 2;
|
|
3649
3860
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
3650
|
-
function isRecursive(inst, stack) {
|
|
3861
|
+
function isRecursive(inst, stack, resolve) {
|
|
3651
3862
|
const cached = recursive.get(inst);
|
|
3652
|
-
if (cached !== void 0) return cached;
|
|
3653
|
-
if (stack.has(inst)) return
|
|
3863
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
3864
|
+
if (stack.has(inst)) return PROVEN;
|
|
3654
3865
|
stack.add(inst);
|
|
3655
|
-
let result =
|
|
3866
|
+
let result = NONE;
|
|
3656
3867
|
const check = (child) => {
|
|
3657
|
-
if (
|
|
3868
|
+
if (result !== PROVEN && child?._zod) {
|
|
3869
|
+
const answer = isRecursive(child, stack, resolve);
|
|
3870
|
+
if (answer > result) result = answer;
|
|
3871
|
+
}
|
|
3872
|
+
};
|
|
3873
|
+
const shape = (sh, spread) => {
|
|
3874
|
+
let answer = NONE;
|
|
3875
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
3876
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
3877
|
+
if (spread && !desc.enumerable) continue;
|
|
3878
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
3879
|
+
if (child > answer) answer = child;
|
|
3880
|
+
}
|
|
3881
|
+
return answer;
|
|
3882
|
+
};
|
|
3883
|
+
const merge = (answer) => {
|
|
3884
|
+
if (answer > result) result = answer;
|
|
3658
3885
|
};
|
|
3659
3886
|
const def = inst._zod.def;
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3887
|
+
switch (def.type) {
|
|
3888
|
+
case "object": {
|
|
3889
|
+
const raw = rawShape(def);
|
|
3890
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
3891
|
+
check(def.catchall);
|
|
3892
|
+
break;
|
|
3893
|
+
}
|
|
3894
|
+
case "properties":
|
|
3895
|
+
merge(shape(def.shape, false));
|
|
3896
|
+
break;
|
|
3897
|
+
case "array":
|
|
3898
|
+
check(def.element);
|
|
3899
|
+
break;
|
|
3900
|
+
case "tuple":
|
|
3901
|
+
for (const el of def.items) check(el);
|
|
3902
|
+
check(def.rest);
|
|
3903
|
+
break;
|
|
3904
|
+
case "record":
|
|
3905
|
+
case "map":
|
|
3906
|
+
check(def.keyType);
|
|
3907
|
+
check(def.valueType);
|
|
3908
|
+
break;
|
|
3909
|
+
case "set":
|
|
3910
|
+
check(def.valueType);
|
|
3911
|
+
break;
|
|
3912
|
+
case "union":
|
|
3913
|
+
for (const el of def.options) check(el);
|
|
3914
|
+
break;
|
|
3915
|
+
case "intersection":
|
|
3916
|
+
check(def.left);
|
|
3917
|
+
check(def.right);
|
|
3918
|
+
break;
|
|
3919
|
+
case "optional":
|
|
3920
|
+
case "nullable":
|
|
3921
|
+
case "default":
|
|
3922
|
+
case "prefault":
|
|
3923
|
+
case "catch":
|
|
3924
|
+
case "readonly":
|
|
3925
|
+
case "nonoptional":
|
|
3926
|
+
case "promise":
|
|
3927
|
+
case "success":
|
|
3928
|
+
check(def.innerType);
|
|
3929
|
+
break;
|
|
3930
|
+
case "pipe":
|
|
3931
|
+
check(def.in);
|
|
3932
|
+
check(def.out);
|
|
3933
|
+
break;
|
|
3934
|
+
case "function":
|
|
3935
|
+
check(def.input);
|
|
3936
|
+
check(def.output);
|
|
3937
|
+
break;
|
|
3938
|
+
case "lazy": {
|
|
3939
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
3940
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
3941
|
+
break;
|
|
3942
|
+
}
|
|
3943
|
+
case "template_literal":
|
|
3944
|
+
case "string":
|
|
3945
|
+
case "number":
|
|
3946
|
+
case "int":
|
|
3947
|
+
case "boolean":
|
|
3948
|
+
case "bigint":
|
|
3949
|
+
case "symbol":
|
|
3950
|
+
case "undefined":
|
|
3951
|
+
case "null":
|
|
3952
|
+
case "void":
|
|
3953
|
+
case "never":
|
|
3954
|
+
case "any":
|
|
3955
|
+
case "unknown":
|
|
3956
|
+
case "date":
|
|
3957
|
+
case "nan":
|
|
3958
|
+
case "enum":
|
|
3959
|
+
case "literal":
|
|
3960
|
+
case "file":
|
|
3961
|
+
case "transform":
|
|
3962
|
+
case "custom": break;
|
|
3963
|
+
default: for (const key in def) {
|
|
3964
|
+
const desc = Object.getOwnPropertyDescriptor(def, key);
|
|
3965
|
+
if (!desc || desc.get) continue;
|
|
3966
|
+
const value = desc.value;
|
|
3666
3967
|
if (!value || typeof value !== "object") continue;
|
|
3667
3968
|
if (value._zod) check(value);
|
|
3668
3969
|
else if (Array.isArray(value)) for (const el of value) check(el);
|
|
3669
3970
|
}
|
|
3670
3971
|
}
|
|
3671
3972
|
stack.delete(inst);
|
|
3672
|
-
|
|
3673
|
-
|
|
3973
|
+
return settle(inst, result);
|
|
3974
|
+
}
|
|
3975
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
3976
|
+
function settle(inst, answer) {
|
|
3977
|
+
if (answer !== ASSUMED) recursive.set(inst, answer === PROVEN);
|
|
3978
|
+
return answer;
|
|
3674
3979
|
}
|
|
3675
3980
|
function bucketFor(state, inst) {
|
|
3676
3981
|
let bucket = state.buckets.get(inst);
|
|
3677
3982
|
if (!bucket) {
|
|
3678
|
-
bucket = /* @__PURE__ */ new
|
|
3983
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
3679
3984
|
state.buckets.set(inst, bucket);
|
|
3680
3985
|
}
|
|
3681
3986
|
return bucket;
|
|
@@ -3711,6 +4016,7 @@ const memo = {
|
|
|
3711
4016
|
attach(inst) {
|
|
3712
4017
|
var _a;
|
|
3713
4018
|
let isRecursiveInst;
|
|
4019
|
+
let rechecked = false;
|
|
3714
4020
|
let lastCtx;
|
|
3715
4021
|
let lastBucket;
|
|
3716
4022
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -3718,19 +4024,21 @@ const memo = {
|
|
|
3718
4024
|
const base = inst._zod.parse;
|
|
3719
4025
|
const wrapped = (payload, ctx) => {
|
|
3720
4026
|
if (isRecursiveInst === void 0) {
|
|
3721
|
-
|
|
3722
|
-
if (
|
|
4027
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
4028
|
+
if (walked === NONE) {
|
|
3723
4029
|
inst._zod.parse = base;
|
|
3724
4030
|
if (inst._zod.run === wrapped) inst._zod.run = base;
|
|
3725
4031
|
return base(payload, ctx);
|
|
3726
4032
|
}
|
|
4033
|
+
if (walked === PROVEN || rechecked) isRecursiveInst = true;
|
|
4034
|
+
else rechecked = true;
|
|
3727
4035
|
}
|
|
3728
4036
|
const input = payload.value;
|
|
3729
|
-
if (input
|
|
4037
|
+
if (!isRef(input)) return base(payload, ctx);
|
|
3730
4038
|
let state = ctx[STATE];
|
|
3731
4039
|
if (!state) {
|
|
3732
4040
|
state = {
|
|
3733
|
-
buckets: /* @__PURE__ */ new
|
|
4041
|
+
buckets: /* @__PURE__ */ new WeakMap(),
|
|
3734
4042
|
backEdges: void 0
|
|
3735
4043
|
};
|
|
3736
4044
|
ctx[STATE] = state;
|
|
@@ -3749,7 +4057,7 @@ const memo = {
|
|
|
3749
4057
|
if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
|
|
3750
4058
|
} else {
|
|
3751
4059
|
payload.memo = true;
|
|
3752
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
4060
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
3753
4061
|
state.backEdges.add(hit.value);
|
|
3754
4062
|
}
|
|
3755
4063
|
return payload;
|
|
@@ -3778,10 +4086,10 @@ function memoizer() {
|
|
|
3778
4086
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
3779
4087
|
function isBackEdge(ctx, value) {
|
|
3780
4088
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3781
|
-
return backEdges !== void 0 && value
|
|
4089
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3782
4090
|
}
|
|
3783
4091
|
//#endregion
|
|
3784
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
4092
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/locales/en.js
|
|
3785
4093
|
const error = () => {
|
|
3786
4094
|
const Sizable = {
|
|
3787
4095
|
string: {
|
|
@@ -3837,6 +4145,7 @@ const error = () => {
|
|
|
3837
4145
|
json_string: "JSON string",
|
|
3838
4146
|
e164: "E.164 number",
|
|
3839
4147
|
credit_card: "credit card number",
|
|
4148
|
+
iban: "IBAN",
|
|
3840
4149
|
jwt: "JWT",
|
|
3841
4150
|
template_literal: "input"
|
|
3842
4151
|
};
|
|
@@ -3887,7 +4196,7 @@ function en_default() {
|
|
|
3887
4196
|
return { localeError: error() };
|
|
3888
4197
|
}
|
|
3889
4198
|
//#endregion
|
|
3890
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
4199
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/core/registries.js
|
|
3891
4200
|
var _a;
|
|
3892
4201
|
var $ZodRegistry = class {
|
|
3893
4202
|
constructor() {
|
|
@@ -3934,7 +4243,7 @@ function registry() {
|
|
|
3934
4243
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3935
4244
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3936
4245
|
//#endregion
|
|
3937
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
4246
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/core/api.js
|
|
3938
4247
|
// @__NO_SIDE_EFFECTS__
|
|
3939
4248
|
function _string(Class, params) {
|
|
3940
4249
|
return new Class({
|
|
@@ -4181,6 +4490,16 @@ function _creditCard(Class, params) {
|
|
|
4181
4490
|
});
|
|
4182
4491
|
}
|
|
4183
4492
|
// @__NO_SIDE_EFFECTS__
|
|
4493
|
+
function _iban(Class, params) {
|
|
4494
|
+
return new Class({
|
|
4495
|
+
type: "string",
|
|
4496
|
+
format: "iban",
|
|
4497
|
+
check: "string_format",
|
|
4498
|
+
abort: false,
|
|
4499
|
+
...normalizeParams(params)
|
|
4500
|
+
});
|
|
4501
|
+
}
|
|
4502
|
+
// @__NO_SIDE_EFFECTS__
|
|
4184
4503
|
function _jwt(Class, params) {
|
|
4185
4504
|
return new Class({
|
|
4186
4505
|
type: "string",
|
|
@@ -4549,12 +4868,13 @@ function _property(property, schema, params) {
|
|
|
4549
4868
|
});
|
|
4550
4869
|
}
|
|
4551
4870
|
// @__NO_SIDE_EFFECTS__
|
|
4552
|
-
function _properties(shape) {
|
|
4553
|
-
return
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4871
|
+
function _properties(Class, shape, params) {
|
|
4872
|
+
return new Class({
|
|
4873
|
+
type: "properties",
|
|
4874
|
+
check: "properties",
|
|
4875
|
+
shape,
|
|
4876
|
+
...normalizeParams(params)
|
|
4877
|
+
});
|
|
4558
4878
|
}
|
|
4559
4879
|
// @__NO_SIDE_EFFECTS__
|
|
4560
4880
|
function _mime(types, params) {
|
|
@@ -4759,7 +5079,7 @@ function _stringFormat(Class, format, fnOrRegex, _params = {}) {
|
|
|
4759
5079
|
return new Class(def);
|
|
4760
5080
|
}
|
|
4761
5081
|
//#endregion
|
|
4762
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
5082
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/core/to-json-schema.js
|
|
4763
5083
|
function assignProps(target, ...sources) {
|
|
4764
5084
|
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
5085
|
return target;
|
|
@@ -4782,6 +5102,7 @@ function initializeContext(params) {
|
|
|
4782
5102
|
cycles: params?.cycles ?? "ref",
|
|
4783
5103
|
reused: params?.reused ?? "inline",
|
|
4784
5104
|
intersections: [],
|
|
5105
|
+
deferred: [],
|
|
4785
5106
|
external: params?.external ?? void 0
|
|
4786
5107
|
};
|
|
4787
5108
|
}
|
|
@@ -4801,7 +5122,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
|
4801
5122
|
Object.assign(json, result);
|
|
4802
5123
|
return true;
|
|
4803
5124
|
}
|
|
4804
|
-
function
|
|
5125
|
+
function processSchema(schema, ctx, _params = {
|
|
4805
5126
|
path: [],
|
|
4806
5127
|
schemaPath: []
|
|
4807
5128
|
}) {
|
|
@@ -4840,7 +5161,7 @@ function process$1(schema, ctx, _params = {
|
|
|
4840
5161
|
const parent = schema._zod.parent;
|
|
4841
5162
|
if (parent) {
|
|
4842
5163
|
if (!result.ref) result.ref = parent;
|
|
4843
|
-
|
|
5164
|
+
processSchema(parent, ctx, params);
|
|
4844
5165
|
ctx.seen.get(parent).isParent = true;
|
|
4845
5166
|
}
|
|
4846
5167
|
}
|
|
@@ -4930,10 +5251,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4930
5251
|
continue;
|
|
4931
5252
|
}
|
|
4932
5253
|
if (seen.count > 1) {
|
|
4933
|
-
if (ctx.reused === "ref")
|
|
4934
|
-
extractToDef(entry);
|
|
4935
|
-
continue;
|
|
4936
|
-
}
|
|
5254
|
+
if (ctx.reused === "ref") extractToDef(entry);
|
|
4937
5255
|
}
|
|
4938
5256
|
}
|
|
4939
5257
|
if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
|
|
@@ -5091,6 +5409,7 @@ function finalize(ctx, schema) {
|
|
|
5091
5409
|
if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
|
|
5092
5410
|
for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
|
|
5093
5411
|
if (ctx.target !== "openapi-3.0") for (const entry of ctx.seen.entries()) compactTypeUnion(entry[1].def ?? entry[1].schema);
|
|
5412
|
+
for (const rewrite of ctx.deferred) rewrite();
|
|
5094
5413
|
if (ctx.intersections.length) {
|
|
5095
5414
|
const carriers = /* @__PURE__ */ new Map();
|
|
5096
5415
|
for (const seen of ctx.seen.values()) for (const json of [seen.schema, seen.def]) {
|
|
@@ -5187,7 +5506,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
5187
5506
|
...params,
|
|
5188
5507
|
processors
|
|
5189
5508
|
});
|
|
5190
|
-
|
|
5509
|
+
processSchema(schema, ctx);
|
|
5191
5510
|
extractDefs(ctx, schema);
|
|
5192
5511
|
return finalize(ctx, schema);
|
|
5193
5512
|
};
|
|
@@ -5199,12 +5518,84 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
5199
5518
|
io,
|
|
5200
5519
|
processors
|
|
5201
5520
|
});
|
|
5202
|
-
|
|
5521
|
+
processSchema(schema, ctx);
|
|
5203
5522
|
extractDefs(ctx, schema);
|
|
5204
5523
|
return finalize(ctx, schema);
|
|
5205
5524
|
};
|
|
5206
5525
|
//#endregion
|
|
5207
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
5526
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/core/json-schema-processors.js
|
|
5527
|
+
const narrowMin = (agg, key, value) => {
|
|
5528
|
+
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
5529
|
+
};
|
|
5530
|
+
const narrowMax = (agg, key, value) => {
|
|
5531
|
+
if (agg[key] === void 0 || value < agg[key]) agg[key] = value;
|
|
5532
|
+
};
|
|
5533
|
+
const narrowBoth = (agg, value) => {
|
|
5534
|
+
narrowMin(agg, "minimum", value);
|
|
5535
|
+
narrowMax(agg, "maximum", value);
|
|
5536
|
+
};
|
|
5537
|
+
const addDivisor = (agg, value) => {
|
|
5538
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
5539
|
+
if (!agg.multipleOf.includes(value)) agg.multipleOf.push(value);
|
|
5540
|
+
};
|
|
5541
|
+
const addPattern = (agg, pattern) => {
|
|
5542
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
5543
|
+
agg.patterns.add(pattern);
|
|
5544
|
+
};
|
|
5545
|
+
const intersectMime = (agg, mime) => {
|
|
5546
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
5547
|
+
};
|
|
5548
|
+
const setFormat = (agg, format) => {
|
|
5549
|
+
agg.format = format;
|
|
5550
|
+
if (format.includes("int")) agg.isInt = true;
|
|
5551
|
+
};
|
|
5552
|
+
const minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
5553
|
+
const maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
5554
|
+
const formatContributor = (ranges) => (agg, def) => {
|
|
5555
|
+
setFormat(agg, def.format);
|
|
5556
|
+
const [minimum, maximum] = ranges[def.format];
|
|
5557
|
+
narrowMin(agg, "minimum", minimum);
|
|
5558
|
+
narrowMax(agg, "maximum", maximum);
|
|
5559
|
+
};
|
|
5560
|
+
const contributors = {
|
|
5561
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
5562
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
5563
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
5564
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
5565
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
5566
|
+
min_length: minContributor,
|
|
5567
|
+
max_length: maxContributor,
|
|
5568
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
5569
|
+
min_size: minContributor,
|
|
5570
|
+
max_size: maxContributor,
|
|
5571
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
5572
|
+
string_format: (agg, def) => {
|
|
5573
|
+
setFormat(agg, def.format);
|
|
5574
|
+
if (def.pattern) addPattern(agg, def.pattern);
|
|
5575
|
+
if (def.format === "base64" || def.format === "base64url") agg.contentEncoding = def.format;
|
|
5576
|
+
if (def.local || def.precision === -1) agg.laxFormat = true;
|
|
5577
|
+
},
|
|
5578
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
5579
|
+
};
|
|
5580
|
+
function aggregateChecks(schema) {
|
|
5581
|
+
const agg = {};
|
|
5582
|
+
const def = schema._zod.def;
|
|
5583
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
5584
|
+
for (const ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
5585
|
+
const bag = schema._zod.bag;
|
|
5586
|
+
if (bag.minimum !== void 0) narrowMin(agg, "minimum", bag.minimum);
|
|
5587
|
+
if (bag.exclusiveMinimum !== void 0) narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
5588
|
+
if (bag.maximum !== void 0) narrowMax(agg, "maximum", bag.maximum);
|
|
5589
|
+
if (bag.exclusiveMaximum !== void 0) narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
5590
|
+
if (bag.multipleOf !== void 0) addDivisor(agg, bag.multipleOf);
|
|
5591
|
+
if (bag.format !== void 0) {
|
|
5592
|
+
agg.format ?? (agg.format = bag.format);
|
|
5593
|
+
if (bag.format.includes("int")) agg.isInt = true;
|
|
5594
|
+
}
|
|
5595
|
+
if (bag.mime) intersectMime(agg, bag.mime);
|
|
5596
|
+
for (const pattern of bag.patterns ?? []) addPattern(agg, pattern);
|
|
5597
|
+
return agg;
|
|
5598
|
+
}
|
|
5208
5599
|
const formatMap = {
|
|
5209
5600
|
guid: "uuid",
|
|
5210
5601
|
url: "uri",
|
|
@@ -5212,10 +5603,12 @@ const formatMap = {
|
|
|
5212
5603
|
json_string: "json-string",
|
|
5213
5604
|
regex: ""
|
|
5214
5605
|
};
|
|
5606
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64$1], [base64urlCharset, base64url$1]]);
|
|
5607
|
+
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
5215
5608
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
5216
5609
|
const json = _json;
|
|
5217
5610
|
json.type = "string";
|
|
5218
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
5611
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
5219
5612
|
if (typeof minimum === "number") json.minLength = minimum;
|
|
5220
5613
|
if (typeof maximum === "number") json.maxLength = maximum;
|
|
5221
5614
|
if (format) {
|
|
@@ -5225,9 +5618,9 @@ const stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5225
5618
|
}
|
|
5226
5619
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
5227
5620
|
if (patterns && patterns.size > 0) {
|
|
5228
|
-
const
|
|
5229
|
-
if (
|
|
5230
|
-
else if (
|
|
5621
|
+
const patternList = [...patterns].map(exactPattern);
|
|
5622
|
+
if (patternList.length === 1) json.pattern = patternList[0].source;
|
|
5623
|
+
else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
|
|
5231
5624
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
5232
5625
|
pattern: regex.source
|
|
5233
5626
|
}))];
|
|
@@ -5235,9 +5628,8 @@ const stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
5235
5628
|
};
|
|
5236
5629
|
const numberProcessor = (schema, ctx, _json, params) => {
|
|
5237
5630
|
const json = _json;
|
|
5238
|
-
const { minimum, maximum,
|
|
5239
|
-
|
|
5240
|
-
else json.type = "number";
|
|
5631
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
5632
|
+
json.type = isInt ? "integer" : "number";
|
|
5241
5633
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
5242
5634
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
5243
5635
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -5253,9 +5645,13 @@ const numberProcessor = (schema, ctx, _json, params) => {
|
|
|
5253
5645
|
json.exclusiveMaximum = true;
|
|
5254
5646
|
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
5255
5647
|
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
5256
|
-
if (
|
|
5257
|
-
|
|
5258
|
-
|
|
5648
|
+
if (multipleOf) {
|
|
5649
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
5650
|
+
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
5651
|
+
else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
5652
|
+
const [first, ...rest] = divisors;
|
|
5653
|
+
if (first !== void 0) json.multipleOf = first;
|
|
5654
|
+
if (rest.length) json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
5259
5655
|
}
|
|
5260
5656
|
};
|
|
5261
5657
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -5335,23 +5731,16 @@ const templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
|
5335
5731
|
};
|
|
5336
5732
|
const fileProcessor = (schema, _ctx, json, _params) => {
|
|
5337
5733
|
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);
|
|
5734
|
+
_json.type = "string";
|
|
5735
|
+
_json.format = "binary";
|
|
5736
|
+
_json.contentEncoding = "binary";
|
|
5737
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
5738
|
+
if (minimum !== void 0) _json.minLength = minimum;
|
|
5739
|
+
if (maximum !== void 0) _json.maxLength = maximum;
|
|
5740
|
+
if (!mime) return;
|
|
5741
|
+
if (mime.length === 0) _json.not = {};
|
|
5742
|
+
else if (mime.length === 1) _json.contentMediaType = mime[0];
|
|
5743
|
+
else _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
5355
5744
|
};
|
|
5356
5745
|
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
5357
5746
|
json.type = "boolean";
|
|
@@ -5374,11 +5763,11 @@ const setProcessor = (schema, ctx, json, params) => {
|
|
|
5374
5763
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
5375
5764
|
const json = _json;
|
|
5376
5765
|
const def = schema._zod.def;
|
|
5377
|
-
const { minimum, maximum } = schema
|
|
5766
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
5378
5767
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
5379
5768
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
5380
5769
|
json.type = "array";
|
|
5381
|
-
json.items =
|
|
5770
|
+
json.items = processSchema(def.element, ctx, {
|
|
5382
5771
|
...params,
|
|
5383
5772
|
path: [...params.path, "items"]
|
|
5384
5773
|
});
|
|
@@ -5396,7 +5785,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
5396
5785
|
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
5397
5786
|
json.type = "object";
|
|
5398
5787
|
json.properties = {};
|
|
5399
|
-
for (const key in shape) assignProp(json.properties, key,
|
|
5788
|
+
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
5400
5789
|
...params,
|
|
5401
5790
|
path: [
|
|
5402
5791
|
...params.path,
|
|
@@ -5414,7 +5803,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
5414
5803
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
5415
5804
|
else if (!def.catchall) {
|
|
5416
5805
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
5417
|
-
} else if (def.catchall) json.additionalProperties =
|
|
5806
|
+
} else if (def.catchall) json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
5418
5807
|
...params,
|
|
5419
5808
|
path: [...params.path, "additionalProperties"]
|
|
5420
5809
|
});
|
|
@@ -5422,7 +5811,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
5422
5811
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
5423
5812
|
const def = schema._zod.def;
|
|
5424
5813
|
const isExclusive = def.inclusive === false;
|
|
5425
|
-
const options = def.options.map((x, i) =>
|
|
5814
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
5426
5815
|
...params,
|
|
5427
5816
|
path: [
|
|
5428
5817
|
...params.path,
|
|
@@ -5435,7 +5824,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
5435
5824
|
};
|
|
5436
5825
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
5437
5826
|
const def = schema._zod.def;
|
|
5438
|
-
const a =
|
|
5827
|
+
const a = processSchema(def.left, ctx, {
|
|
5439
5828
|
...params,
|
|
5440
5829
|
path: [
|
|
5441
5830
|
...params.path,
|
|
@@ -5443,7 +5832,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
5443
5832
|
0
|
|
5444
5833
|
]
|
|
5445
5834
|
});
|
|
5446
|
-
const b =
|
|
5835
|
+
const b = processSchema(def.right, ctx, {
|
|
5447
5836
|
...params,
|
|
5448
5837
|
path: [
|
|
5449
5838
|
...params.path,
|
|
@@ -5462,7 +5851,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
5462
5851
|
json.type = "array";
|
|
5463
5852
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
5464
5853
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
5465
|
-
const prefixItems = def.items.map((x, i) =>
|
|
5854
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
5466
5855
|
...params,
|
|
5467
5856
|
path: [
|
|
5468
5857
|
...params.path,
|
|
@@ -5470,7 +5859,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
5470
5859
|
i
|
|
5471
5860
|
]
|
|
5472
5861
|
}));
|
|
5473
|
-
const rest = def.rest ?
|
|
5862
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
5474
5863
|
...params,
|
|
5475
5864
|
path: [
|
|
5476
5865
|
...params.path,
|
|
@@ -5504,18 +5893,76 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
5504
5893
|
if (minItems > 0) json.minItems = minItems;
|
|
5505
5894
|
if (isClosed) json.maxItems = maxItems;
|
|
5506
5895
|
}
|
|
5507
|
-
const { minimum, maximum } = schema
|
|
5896
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
5508
5897
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
5509
5898
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
5510
5899
|
};
|
|
5900
|
+
/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
|
|
5901
|
+
* numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
|
|
5902
|
+
* behind a wrapper only carries its own `type` before then, and a union key only has its branches.
|
|
5903
|
+
*
|
|
5904
|
+
* A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather
|
|
5905
|
+
* than carried over: keeping them beside `type: "string"` reproduces the match-nothing schema this
|
|
5906
|
+
* exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`
|
|
5907
|
+
* accepts `"3"` — which is the deliberate trade, since throwing on it would reject an ordinary schema
|
|
5908
|
+
* outright. */
|
|
5909
|
+
function stringifyKeyNames(bySchema, json, visited) {
|
|
5910
|
+
if (json.$ref) {
|
|
5911
|
+
if (visited.has(json)) return json;
|
|
5912
|
+
visited.add(json);
|
|
5913
|
+
const def = bySchema.get(json)?.def;
|
|
5914
|
+
if (!def) return json;
|
|
5915
|
+
const inlined = stringifyKeyNames(bySchema, def, visited);
|
|
5916
|
+
return inlined === def ? json : inlined;
|
|
5917
|
+
}
|
|
5918
|
+
for (const keyword of ["anyOf", "oneOf"]) {
|
|
5919
|
+
const branches = json[keyword];
|
|
5920
|
+
if (!Array.isArray(branches)) continue;
|
|
5921
|
+
const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
5922
|
+
if (mapped.some((branch, i) => branch !== branches[i])) json = {
|
|
5923
|
+
...json,
|
|
5924
|
+
[keyword]: mapped
|
|
5925
|
+
};
|
|
5926
|
+
}
|
|
5927
|
+
const types = Array.isArray(json.type) ? json.type : [json.type];
|
|
5928
|
+
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
5929
|
+
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
5930
|
+
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
5931
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
5932
|
+
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
5933
|
+
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
5934
|
+
if (!numericType) return rest;
|
|
5935
|
+
rest.type = "string";
|
|
5936
|
+
if (!values) rest.pattern = (types.includes("number") ? number$2 : integer).source;
|
|
5937
|
+
return rest;
|
|
5938
|
+
}
|
|
5939
|
+
/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */
|
|
5940
|
+
const pendingRecords = /* @__PURE__ */ new WeakMap();
|
|
5941
|
+
function rewriteKeyNames(ctx) {
|
|
5942
|
+
const bySchema = /* @__PURE__ */ new Map();
|
|
5943
|
+
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
5944
|
+
const rewrites = /* @__PURE__ */ new Map();
|
|
5945
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
5946
|
+
const seen = ctx.seen.get(record);
|
|
5947
|
+
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
5948
|
+
if (!names || names === true || rewrites.has(names)) continue;
|
|
5949
|
+
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
5950
|
+
if (rewritten !== names) rewrites.set(names, rewritten);
|
|
5951
|
+
}
|
|
5952
|
+
if (!rewrites.size) return;
|
|
5953
|
+
for (const entry of ctx.seen.values()) for (const carrier of [entry.schema, entry.def]) {
|
|
5954
|
+
const rewritten = carrier && rewrites.get(carrier.propertyNames);
|
|
5955
|
+
if (rewritten) carrier.propertyNames = rewritten;
|
|
5956
|
+
}
|
|
5957
|
+
}
|
|
5511
5958
|
const recordProcessor = (schema, ctx, _json, params) => {
|
|
5512
5959
|
const json = _json;
|
|
5513
5960
|
const def = schema._zod.def;
|
|
5514
5961
|
json.type = "object";
|
|
5515
5962
|
const keyType = def.keyType;
|
|
5516
|
-
const patterns = keyType.
|
|
5963
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
5517
5964
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
5518
|
-
const valueSchema =
|
|
5965
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
5519
5966
|
...params,
|
|
5520
5967
|
path: [
|
|
5521
5968
|
...params.path,
|
|
@@ -5524,13 +5971,22 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
5524
5971
|
]
|
|
5525
5972
|
});
|
|
5526
5973
|
json.patternProperties = {};
|
|
5527
|
-
for (const pattern of patterns) assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
5974
|
+
for (const pattern of patterns) assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
5528
5975
|
} else {
|
|
5529
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12")
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5976
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
5977
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
5978
|
+
...params,
|
|
5979
|
+
path: [...params.path, "propertyNames"]
|
|
5980
|
+
});
|
|
5981
|
+
let pending = pendingRecords.get(ctx);
|
|
5982
|
+
if (!pending) {
|
|
5983
|
+
pending = [];
|
|
5984
|
+
pendingRecords.set(ctx, pending);
|
|
5985
|
+
ctx.deferred.push(() => rewriteKeyNames(ctx));
|
|
5986
|
+
}
|
|
5987
|
+
pending.push(schema);
|
|
5988
|
+
}
|
|
5989
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
5534
5990
|
...params,
|
|
5535
5991
|
path: [...params.path, "additionalProperties"]
|
|
5536
5992
|
});
|
|
@@ -5539,12 +5995,12 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
5539
5995
|
const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
|
|
5540
5996
|
if (keyValues && !def.partial && !omittableOnInput) {
|
|
5541
5997
|
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
5542
|
-
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
5998
|
+
if (validKeyValues.length > 0) json.required = validKeyValues.map(String);
|
|
5543
5999
|
}
|
|
5544
6000
|
};
|
|
5545
6001
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
5546
6002
|
const def = schema._zod.def;
|
|
5547
|
-
const inner =
|
|
6003
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
5548
6004
|
const seen = ctx.seen.get(schema);
|
|
5549
6005
|
if (ctx.target === "openapi-3.0") {
|
|
5550
6006
|
seen.ref = def.innerType;
|
|
@@ -5553,7 +6009,7 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
5553
6009
|
};
|
|
5554
6010
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
5555
6011
|
const def = schema._zod.def;
|
|
5556
|
-
|
|
6012
|
+
processSchema(def.innerType, ctx, params);
|
|
5557
6013
|
const seen = ctx.seen.get(schema);
|
|
5558
6014
|
seen.ref = def.innerType;
|
|
5559
6015
|
};
|
|
@@ -5574,7 +6030,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
|
|
|
5574
6030
|
}
|
|
5575
6031
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
5576
6032
|
const def = schema._zod.def;
|
|
5577
|
-
|
|
6033
|
+
processSchema(def.innerType, ctx, params);
|
|
5578
6034
|
const seen = ctx.seen.get(schema);
|
|
5579
6035
|
seen.ref = def.innerType;
|
|
5580
6036
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -5582,7 +6038,7 @@ const defaultProcessor = (schema, ctx, json, params) => {
|
|
|
5582
6038
|
};
|
|
5583
6039
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
5584
6040
|
const def = schema._zod.def;
|
|
5585
|
-
|
|
6041
|
+
processSchema(def.innerType, ctx, params);
|
|
5586
6042
|
const seen = ctx.seen.get(schema);
|
|
5587
6043
|
seen.ref = def.innerType;
|
|
5588
6044
|
if (ctx.io !== "input") return;
|
|
@@ -5591,7 +6047,7 @@ const prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
5591
6047
|
};
|
|
5592
6048
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
5593
6049
|
const def = schema._zod.def;
|
|
5594
|
-
|
|
6050
|
+
processSchema(def.innerType, ctx, params);
|
|
5595
6051
|
const seen = ctx.seen.get(schema);
|
|
5596
6052
|
seen.ref = def.innerType;
|
|
5597
6053
|
let catchValue;
|
|
@@ -5607,37 +6063,37 @@ const pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
5607
6063
|
const def = schema._zod.def;
|
|
5608
6064
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
5609
6065
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
5610
|
-
|
|
6066
|
+
processSchema(innerType, ctx, params);
|
|
5611
6067
|
const seen = ctx.seen.get(schema);
|
|
5612
6068
|
seen.ref = innerType;
|
|
5613
6069
|
};
|
|
5614
6070
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
5615
6071
|
const def = schema._zod.def;
|
|
5616
|
-
|
|
6072
|
+
processSchema(def.innerType, ctx, params);
|
|
5617
6073
|
const seen = ctx.seen.get(schema);
|
|
5618
6074
|
seen.ref = def.innerType;
|
|
5619
6075
|
json.readOnly = true;
|
|
5620
6076
|
};
|
|
5621
6077
|
const promiseProcessor = (schema, ctx, _json, params) => {
|
|
5622
6078
|
const def = schema._zod.def;
|
|
5623
|
-
|
|
6079
|
+
processSchema(def.innerType, ctx, params);
|
|
5624
6080
|
const seen = ctx.seen.get(schema);
|
|
5625
6081
|
seen.ref = def.innerType;
|
|
5626
6082
|
};
|
|
5627
6083
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
5628
6084
|
const def = schema._zod.def;
|
|
5629
|
-
|
|
6085
|
+
processSchema(def.innerType, ctx, params);
|
|
5630
6086
|
const seen = ctx.seen.get(schema);
|
|
5631
6087
|
seen.ref = def.innerType;
|
|
5632
6088
|
};
|
|
5633
6089
|
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
5634
6090
|
const innerType = schema._zod.innerType;
|
|
5635
|
-
|
|
6091
|
+
processSchema(innerType, ctx, params);
|
|
5636
6092
|
const seen = ctx.seen.get(schema);
|
|
5637
6093
|
seen.ref = innerType;
|
|
5638
6094
|
};
|
|
5639
6095
|
//#endregion
|
|
5640
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6096
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/classic/checks.js
|
|
5641
6097
|
var checks_exports = /* @__PURE__ */ __exportAll({
|
|
5642
6098
|
endsWith: () => _endsWith,
|
|
5643
6099
|
gt: () => _gt,
|
|
@@ -5659,7 +6115,6 @@ var checks_exports = /* @__PURE__ */ __exportAll({
|
|
|
5659
6115
|
normalize: () => _normalize,
|
|
5660
6116
|
overwrite: () => _overwrite,
|
|
5661
6117
|
positive: () => _positive,
|
|
5662
|
-
properties: () => _properties,
|
|
5663
6118
|
property: () => _property,
|
|
5664
6119
|
regex: () => _regex,
|
|
5665
6120
|
size: () => _size,
|
|
@@ -5671,7 +6126,7 @@ var checks_exports = /* @__PURE__ */ __exportAll({
|
|
|
5671
6126
|
uppercase: () => _uppercase
|
|
5672
6127
|
});
|
|
5673
6128
|
//#endregion
|
|
5674
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6129
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/classic/errors.js
|
|
5675
6130
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5676
6131
|
function _lazyMethod(proto, key, make) {
|
|
5677
6132
|
Object.defineProperty(proto, key, {
|
|
@@ -5721,7 +6176,7 @@ const initializer = (inst, issues) => {
|
|
|
5721
6176
|
};
|
|
5722
6177
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
5723
6178
|
//#endregion
|
|
5724
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6179
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/classic/parse.js
|
|
5725
6180
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
5726
6181
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5727
6182
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5735,7 +6190,7 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
5735
6190
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5736
6191
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5737
6192
|
//#endregion
|
|
5738
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
6193
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/classic/schemas.js
|
|
5739
6194
|
var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
5740
6195
|
ZodAny: () => ZodAny,
|
|
5741
6196
|
ZodArray: () => ZodArray,
|
|
@@ -5764,12 +6219,14 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5764
6219
|
ZodFile: () => ZodFile,
|
|
5765
6220
|
ZodFunction: () => ZodFunction,
|
|
5766
6221
|
ZodGUID: () => ZodGUID,
|
|
6222
|
+
ZodIBAN: () => ZodIBAN,
|
|
5767
6223
|
ZodIPv4: () => ZodIPv4,
|
|
5768
6224
|
ZodIPv6: () => ZodIPv6,
|
|
5769
6225
|
ZodISODate: () => ZodISODate,
|
|
5770
6226
|
ZodISODateTime: () => ZodISODateTime,
|
|
5771
6227
|
ZodISODuration: () => ZodISODuration,
|
|
5772
6228
|
ZodISOTime: () => ZodISOTime,
|
|
6229
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
5773
6230
|
ZodIntersection: () => ZodIntersection,
|
|
5774
6231
|
ZodJWT: () => ZodJWT,
|
|
5775
6232
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -5791,6 +6248,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5791
6248
|
ZodPrefault: () => ZodPrefault,
|
|
5792
6249
|
ZodPreprocess: () => ZodPreprocess,
|
|
5793
6250
|
ZodPromise: () => ZodPromise,
|
|
6251
|
+
ZodProperties: () => ZodProperties,
|
|
5794
6252
|
ZodReadonly: () => ZodReadonly,
|
|
5795
6253
|
ZodRecord: () => ZodRecord,
|
|
5796
6254
|
ZodSet: () => ZodSet,
|
|
@@ -5846,6 +6304,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5846
6304
|
hex: () => hex,
|
|
5847
6305
|
hostname: () => hostname,
|
|
5848
6306
|
httpUrl: () => httpUrl,
|
|
6307
|
+
iban: () => iban,
|
|
5849
6308
|
instanceof: () => _instanceof,
|
|
5850
6309
|
int: () => int,
|
|
5851
6310
|
int32: () => int32,
|
|
@@ -5881,6 +6340,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
5881
6340
|
prefault: () => prefault,
|
|
5882
6341
|
preprocess: () => preprocess,
|
|
5883
6342
|
promise: () => promise,
|
|
6343
|
+
properties: () => properties,
|
|
5884
6344
|
readonly: () => readonly,
|
|
5885
6345
|
record: () => record$1,
|
|
5886
6346
|
refine: () => refine$1,
|
|
@@ -6040,11 +6500,17 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6040
6500
|
return safeParseAsync(this, data, params);
|
|
6041
6501
|
},
|
|
6042
6502
|
get spa() {
|
|
6043
|
-
return this
|
|
6503
|
+
return this?.safeParseAsync;
|
|
6044
6504
|
},
|
|
6045
6505
|
set spa(value) {
|
|
6046
6506
|
own(this, "spa", value);
|
|
6047
6507
|
},
|
|
6508
|
+
validate(data, params) {
|
|
6509
|
+
return validate(this, data, params);
|
|
6510
|
+
},
|
|
6511
|
+
validateAsync(data, params) {
|
|
6512
|
+
return validateAsync$1(this, data, params);
|
|
6513
|
+
},
|
|
6048
6514
|
encode: function _encode(data, params) {
|
|
6049
6515
|
return encode(this, data, params, { callee: _encode });
|
|
6050
6516
|
},
|
|
@@ -6069,11 +6535,8 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6069
6535
|
async safeDecodeAsync(data, params) {
|
|
6070
6536
|
return safeDecodeAsync(this, data, params);
|
|
6071
6537
|
},
|
|
6072
|
-
|
|
6073
|
-
return
|
|
6074
|
-
},
|
|
6075
|
-
set toJSONSchema(value) {
|
|
6076
|
-
own(this, "toJSONSchema", value);
|
|
6538
|
+
toJSONSchema(params) {
|
|
6539
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
6077
6540
|
},
|
|
6078
6541
|
get description() {
|
|
6079
6542
|
return globalRegistry.get(this)?.description;
|
|
@@ -6087,10 +6550,10 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
6087
6550
|
$ZodString.init(inst, def);
|
|
6088
6551
|
ZodType.init(inst, def);
|
|
6089
6552
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6553
|
+
}, /*@__PURE__*/ derived({
|
|
6554
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
6555
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
6556
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
6094
6557
|
}, {
|
|
6095
6558
|
regex(...args) {
|
|
6096
6559
|
return this.check(/* @__PURE__ */ _regex(...args));
|
|
@@ -6137,7 +6600,7 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
6137
6600
|
slugify() {
|
|
6138
6601
|
return this.check(/* @__PURE__ */ _slugify());
|
|
6139
6602
|
}
|
|
6140
|
-
});
|
|
6603
|
+
}));
|
|
6141
6604
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
6142
6605
|
$ZodString.init(inst, def);
|
|
6143
6606
|
_ZodString.init(inst, def);
|
|
@@ -6412,6 +6875,13 @@ const ZodCreditCard = /*@__PURE__*/ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
6412
6875
|
function creditCard(params) {
|
|
6413
6876
|
return /* @__PURE__ */ _creditCard(ZodCreditCard, params);
|
|
6414
6877
|
}
|
|
6878
|
+
const ZodIBAN = /*@__PURE__*/ $constructor("ZodIBAN", (inst, def) => {
|
|
6879
|
+
$ZodIBAN.init(inst, def);
|
|
6880
|
+
ZodStringFormat.init(inst, def);
|
|
6881
|
+
});
|
|
6882
|
+
function iban(params) {
|
|
6883
|
+
return /* @__PURE__ */ _iban(ZodIBAN, params);
|
|
6884
|
+
}
|
|
6415
6885
|
const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
6416
6886
|
$ZodJWT.init(inst, def);
|
|
6417
6887
|
ZodStringFormat.init(inst, def);
|
|
@@ -6442,12 +6912,21 @@ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
|
6442
6912
|
$ZodNumber.init(inst, def);
|
|
6443
6913
|
ZodType.init(inst, def);
|
|
6444
6914
|
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
6915
|
inst.isFinite = true;
|
|
6450
|
-
|
|
6916
|
+
}, /*@__PURE__*/ derived({
|
|
6917
|
+
minValue: (inst) => {
|
|
6918
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
6919
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
6920
|
+
},
|
|
6921
|
+
maxValue: (inst) => {
|
|
6922
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
6923
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
6924
|
+
},
|
|
6925
|
+
isInt: (inst) => {
|
|
6926
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
6927
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
6928
|
+
},
|
|
6929
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
6451
6930
|
}, {
|
|
6452
6931
|
gt(value, params) {
|
|
6453
6932
|
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
@@ -6494,7 +6973,7 @@ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
|
6494
6973
|
finite() {
|
|
6495
6974
|
return this;
|
|
6496
6975
|
}
|
|
6497
|
-
});
|
|
6976
|
+
}));
|
|
6498
6977
|
function number$1(params) {
|
|
6499
6978
|
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
6500
6979
|
}
|
|
@@ -6529,10 +7008,10 @@ const ZodBigInt = /*@__PURE__*/ $constructor("ZodBigInt", (inst, def) => {
|
|
|
6529
7008
|
$ZodBigInt.init(inst, def);
|
|
6530
7009
|
ZodType.init(inst, def);
|
|
6531
7010
|
inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
7011
|
+
}, /*@__PURE__*/ derived({
|
|
7012
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
7013
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
7014
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
6536
7015
|
}, {
|
|
6537
7016
|
gte(value, params) {
|
|
6538
7017
|
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
@@ -6567,7 +7046,7 @@ const ZodBigInt = /*@__PURE__*/ $constructor("ZodBigInt", (inst, def) => {
|
|
|
6567
7046
|
multipleOf(value, params) {
|
|
6568
7047
|
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
6569
7048
|
}
|
|
6570
|
-
});
|
|
7049
|
+
}));
|
|
6571
7050
|
function bigint$1(params) {
|
|
6572
7051
|
return /* @__PURE__ */ _bigint(ZodBigInt, params);
|
|
6573
7052
|
}
|
|
@@ -6643,10 +7122,16 @@ const ZodDate = /*@__PURE__*/ $constructor("ZodDate", (inst, def) => {
|
|
|
6643
7122
|
inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
|
|
6644
7123
|
inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6645
7124
|
inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
7125
|
+
}, /*@__PURE__*/ derived({
|
|
7126
|
+
minDate: (inst) => {
|
|
7127
|
+
const { minimum } = aggregateChecks(inst);
|
|
7128
|
+
return minimum ? new Date(minimum) : null;
|
|
7129
|
+
},
|
|
7130
|
+
maxDate: (inst) => {
|
|
7131
|
+
const { maximum } = aggregateChecks(inst);
|
|
7132
|
+
return maximum ? new Date(maximum) : null;
|
|
7133
|
+
}
|
|
7134
|
+
}, {}));
|
|
6650
7135
|
function date$1(params) {
|
|
6651
7136
|
return /* @__PURE__ */ _date(ZodDate, params);
|
|
6652
7137
|
}
|
|
@@ -6691,34 +7176,19 @@ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
|
6691
7176
|
return _enum(Object.keys(this._zod.def.shape));
|
|
6692
7177
|
},
|
|
6693
7178
|
catchall(catchall) {
|
|
6694
|
-
return this.clone({
|
|
6695
|
-
...this._zod.def,
|
|
6696
|
-
catchall
|
|
6697
|
-
});
|
|
7179
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
6698
7180
|
},
|
|
6699
7181
|
passthrough() {
|
|
6700
|
-
return this.clone({
|
|
6701
|
-
...this._zod.def,
|
|
6702
|
-
catchall: unknown()
|
|
6703
|
-
});
|
|
7182
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
6704
7183
|
},
|
|
6705
7184
|
loose() {
|
|
6706
|
-
return this.clone({
|
|
6707
|
-
...this._zod.def,
|
|
6708
|
-
catchall: unknown()
|
|
6709
|
-
});
|
|
7185
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
6710
7186
|
},
|
|
6711
7187
|
strict() {
|
|
6712
|
-
return this.clone({
|
|
6713
|
-
...this._zod.def,
|
|
6714
|
-
catchall: never()
|
|
6715
|
-
});
|
|
7188
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
6716
7189
|
},
|
|
6717
7190
|
strip() {
|
|
6718
|
-
return this.clone({
|
|
6719
|
-
...this._zod.def,
|
|
6720
|
-
catchall: void 0
|
|
6721
|
-
});
|
|
7191
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
6722
7192
|
},
|
|
6723
7193
|
extend(incoming) {
|
|
6724
7194
|
return extend(this, incoming);
|
|
@@ -6938,7 +7408,7 @@ const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
|
6938
7408
|
ZodType.init(inst, def);
|
|
6939
7409
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
6940
7410
|
inst.enum = def.entries;
|
|
6941
|
-
inst.options =
|
|
7411
|
+
inst.options = [...inst._zod.values];
|
|
6942
7412
|
const keys = new Set(Object.keys(def.entries));
|
|
6943
7413
|
inst.extract = (values, params) => {
|
|
6944
7414
|
const newEntries = {};
|
|
@@ -7269,6 +7739,14 @@ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
|
7269
7739
|
ZodType.init(inst, def);
|
|
7270
7740
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
7271
7741
|
});
|
|
7742
|
+
const ZodProperties = /*@__PURE__*/ $constructor("ZodProperties", (inst, def) => {
|
|
7743
|
+
_ensureDefaultMemoizer();
|
|
7744
|
+
$ZodProperties.init(inst, def);
|
|
7745
|
+
ZodType.init(inst, def);
|
|
7746
|
+
});
|
|
7747
|
+
function properties(shape, params) {
|
|
7748
|
+
return /* @__PURE__ */ _properties(ZodProperties, shape, params);
|
|
7749
|
+
}
|
|
7272
7750
|
function check(fn) {
|
|
7273
7751
|
const ch = new $ZodCheck({ check: "custom" });
|
|
7274
7752
|
ch._zod.check = fn;
|
|
@@ -7285,8 +7763,13 @@ function superRefine(fn, params) {
|
|
|
7285
7763
|
}
|
|
7286
7764
|
const describe = describe$1;
|
|
7287
7765
|
const meta = meta$1;
|
|
7766
|
+
const ZodInstanceOf = /*@__PURE__*/ $constructor("ZodInstanceOf", (inst, def) => {
|
|
7767
|
+
ZodCustom.init(inst, def);
|
|
7768
|
+
}, { properties(shape, params) {
|
|
7769
|
+
return this.check(properties(shape, params));
|
|
7770
|
+
} });
|
|
7288
7771
|
function _instanceof(cls, params = {}) {
|
|
7289
|
-
const inst = new
|
|
7772
|
+
const inst = new ZodInstanceOf({
|
|
7290
7773
|
type: "custom",
|
|
7291
7774
|
check: "custom",
|
|
7292
7775
|
fn: (data) => data instanceof cls,
|
|
@@ -7331,7 +7814,7 @@ function preprocess(fn, schema) {
|
|
|
7331
7814
|
});
|
|
7332
7815
|
}
|
|
7333
7816
|
//#endregion
|
|
7334
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
7817
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/classic/compat.js
|
|
7335
7818
|
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
7336
7819
|
var ZodFirstPartyTypeKind;
|
|
7337
7820
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
@@ -7340,7 +7823,7 @@ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
|
7340
7823
|
...checks_exports
|
|
7341
7824
|
});
|
|
7342
7825
|
//#endregion
|
|
7343
|
-
//#region ../../node_modules/.pnpm/@ariestools+provider-model@1.3.0_zod@4.
|
|
7826
|
+
//#region ../../node_modules/.pnpm/@ariestools+provider-model@1.3.0_zod@4.6.2/node_modules/@ariestools/provider-model/dist/neutral/index.mjs
|
|
7344
7827
|
var ConnectionConfigZod = looseObject({ type: string$1().min(1) });
|
|
7345
7828
|
var ConnectionsConfigZod = record$1(string$1(), ConnectionConfigZod).default({});
|
|
7346
7829
|
strictObject({ dependencies: array$1(string$1().min(1)).default([]) });
|
|
@@ -7354,7 +7837,7 @@ var ProviderConfigFieldsZod = object({
|
|
|
7354
7837
|
providerBindings: record$1(string$1(), ProviderBindingConfigZod).default({})
|
|
7355
7838
|
});
|
|
7356
7839
|
//#endregion
|
|
7357
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
7840
|
+
//#region ../../node_modules/.pnpm/zod@4.6.2/node_modules/zod/v4/mini/schemas.js
|
|
7358
7841
|
const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
|
|
7359
7842
|
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
7360
7843
|
$ZodType.init(inst, def);
|
|
@@ -8950,7 +9433,7 @@ const API_NAME = "trace";
|
|
|
8950
9433
|
}
|
|
8951
9434
|
}).getInstance();
|
|
8952
9435
|
//#endregion
|
|
8953
|
-
//#region ../../node_modules/.pnpm/@ariestools+telemetry@8.
|
|
9436
|
+
//#region ../../node_modules/.pnpm/@ariestools+telemetry@8.3.0_@opentelemetry+api@1.9.1/node_modules/@ariestools/telemetry/dist/neutral/index.mjs
|
|
8954
9437
|
var color$1 = (open, close = 39) => {
|
|
8955
9438
|
return (value) => `\x1B[${open}m${value}\x1B[${close}m`;
|
|
8956
9439
|
};
|
|
@@ -9035,7 +9518,7 @@ function spanDurationInMillis$1(span2) {
|
|
|
9035
9518
|
}
|
|
9036
9519
|
});
|
|
9037
9520
|
//#endregion
|
|
9038
|
-
//#region ../../node_modules/.pnpm/@ariestools+sdk@8.
|
|
9521
|
+
//#region ../../node_modules/.pnpm/@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.2/node_modules/@ariestools/sdk/dist/node/index.mjs
|
|
9039
9522
|
var __defProp$1 = Object.defineProperty;
|
|
9040
9523
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
9041
9524
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -10717,7 +11200,7 @@ function spanDurationInMillis(span2) {
|
|
|
10717
11200
|
}
|
|
10718
11201
|
});
|
|
10719
11202
|
//#endregion
|
|
10720
|
-
//#region ../../node_modules/.pnpm/@ariestools+actor@1.3.0_@ariestools+sdk@8.
|
|
11203
|
+
//#region ../../node_modules/.pnpm/@ariestools+actor@1.3.0_@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.2__@opentelemetry+api@1.9.1_zod@4.6.2/node_modules/@ariestools/actor/dist/neutral/index.mjs
|
|
10721
11204
|
var __defProp = Object.defineProperty;
|
|
10722
11205
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10723
11206
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -10970,7 +11453,7 @@ ${err.stack}` : "";
|
|
|
10970
11453
|
return String(err);
|
|
10971
11454
|
}
|
|
10972
11455
|
//#endregion
|
|
10973
|
-
//#region ../../node_modules/.pnpm/@ariestools+actor-system@1.3.0_@ariestools+sdk@8.
|
|
11456
|
+
//#region ../../node_modules/.pnpm/@ariestools+actor-system@1.3.0_@ariestools+sdk@8.3.0_@opentelemetry+api@1.9.1_zod@4.6.2_6fc20aaf3429d662cc94765bda4c28c6/node_modules/@ariestools/actor-system/dist/neutral/index.mjs
|
|
10974
11457
|
var ActorSystemSelectionZod = strictObject({
|
|
10975
11458
|
config: unknown().optional(),
|
|
10976
11459
|
host: string$1().min(1).optional(),
|
|
@@ -10991,7 +11474,7 @@ var ActorSystemSelectionZod = strictObject({
|
|
|
10991
11474
|
});
|
|
10992
11475
|
ProviderConfigFieldsZod.extend({ actors: array$1(ActorSystemSelectionZod).default([]) });
|
|
10993
11476
|
//#endregion
|
|
10994
|
-
//#region ../../node_modules/.pnpm/@ariestools+cli-kit@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.
|
|
11477
|
+
//#region ../../node_modules/.pnpm/@ariestools+cli-kit@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.3.0_@opentele_b27e97704f6c21835803309fe3951ddb/node_modules/@ariestools/cli-kit/dist/node/index.mjs
|
|
10995
11478
|
async function runServiceUntilInterrupt(host, stop) {
|
|
10996
11479
|
await new Promise((resolve, reject) => {
|
|
10997
11480
|
const dispose = host.onInterrupt(async () => {
|
|
@@ -11006,7 +11489,7 @@ async function runServiceUntilInterrupt(host, stop) {
|
|
|
11006
11489
|
});
|
|
11007
11490
|
}
|
|
11008
11491
|
//#endregion
|
|
11009
|
-
//#region ../../node_modules/.pnpm/@ariestools+cli-kit-node@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.
|
|
11492
|
+
//#region ../../node_modules/.pnpm/@ariestools+cli-kit-node@1.2.3_@ariestools+actor-model@1.3.0_@ariestools+sdk@8.3.0_@ope_d237c79c83ad8f127ba774e4cf8e1673/node_modules/@ariestools/cli-kit-node/dist/node/index.mjs
|
|
11010
11493
|
function resolveEnvironmentValue(key, layers) {
|
|
11011
11494
|
for (const layer of layers) {
|
|
11012
11495
|
if (!Object.hasOwn(layer, key)) continue;
|
|
@@ -11207,8 +11690,8 @@ const TLS_CERT_PATH = process.env.CHAIN_TLS_CERT;
|
|
|
11207
11690
|
const TLS_KEY_PATH = process.env.CHAIN_TLS_KEY;
|
|
11208
11691
|
async function main() {
|
|
11209
11692
|
if (!isChainBackingKind(BACKING)) throw new Error(`Unsupported CHAIN_BACKING '${BACKING}' (supported: ${CHAIN_BACKINGS.join(", ")})`);
|
|
11210
|
-
const backing = resolveBacking(BACKING);
|
|
11211
11693
|
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");
|
|
11694
|
+
const backing = resolveBacking(BACKING);
|
|
11212
11695
|
const server = await startChainServer({
|
|
11213
11696
|
backing,
|
|
11214
11697
|
host: HOST,
|
|
@@ -11222,9 +11705,13 @@ async function main() {
|
|
|
11222
11705
|
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
11706
|
await runServiceUntilInterrupt(createNodeProcessHost({ signals: ["SIGINT", "SIGTERM"] }), () => server.close());
|
|
11224
11707
|
}
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
})
|
|
11708
|
+
(async () => {
|
|
11709
|
+
try {
|
|
11710
|
+
await main();
|
|
11711
|
+
} catch (error) {
|
|
11712
|
+
console.error(error);
|
|
11713
|
+
process.exit(1);
|
|
11714
|
+
}
|
|
11715
|
+
})();
|
|
11229
11716
|
//#endregion
|
|
11230
11717
|
export {};
|