@powerhousedao/reactor-workflow 6.2.3-dev.60 → 6.2.3-dev.62
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/index.js +1 -1
- package/dist/{telemetry-DpE4RSaJ.js → telemetry-CBZzPM22.js} +2 -2
- package/dist/{telemetry-DpE4RSaJ.js.map → telemetry-CBZzPM22.js.map} +1 -1
- package/dist/testing.js +1 -1
- package/dist/worker-entry.js +685 -278
- package/dist/worker-entry.js.map +1 -1
- package/package.json +7 -7
package/dist/worker-entry.js
CHANGED
|
@@ -75,64 +75,8 @@ function jsonSafe(value) {
|
|
|
75
75
|
return String(value);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
Object.freeze({ status: "aborted" });
|
|
79
|
-
function $constructor(name, initializer, params) {
|
|
80
|
-
function init(inst, def) {
|
|
81
|
-
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
82
|
-
value: {
|
|
83
|
-
def,
|
|
84
|
-
constr: _,
|
|
85
|
-
traits: /* @__PURE__ */ new Set()
|
|
86
|
-
},
|
|
87
|
-
enumerable: false
|
|
88
|
-
});
|
|
89
|
-
if (inst._zod.traits.has(name)) return;
|
|
90
|
-
inst._zod.traits.add(name);
|
|
91
|
-
initializer(inst, def);
|
|
92
|
-
const proto = _.prototype;
|
|
93
|
-
const keys = Object.keys(proto);
|
|
94
|
-
for (let i = 0; i < keys.length; i++) {
|
|
95
|
-
const k = keys[i];
|
|
96
|
-
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
const Parent = params?.Parent ?? Object;
|
|
100
|
-
class Definition extends Parent {}
|
|
101
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
102
|
-
function _(def) {
|
|
103
|
-
var _a;
|
|
104
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
105
|
-
init(inst, def);
|
|
106
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
107
|
-
for (const fn of inst._zod.deferred) fn();
|
|
108
|
-
return inst;
|
|
109
|
-
}
|
|
110
|
-
Object.defineProperty(_, "init", { value: init });
|
|
111
|
-
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
112
|
-
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
113
|
-
return inst?._zod?.traits?.has(name);
|
|
114
|
-
} });
|
|
115
|
-
Object.defineProperty(_, "name", { value: name });
|
|
116
|
-
return _;
|
|
117
|
-
}
|
|
118
|
-
var $ZodAsyncError = class extends Error {
|
|
119
|
-
constructor() {
|
|
120
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
var $ZodEncodeError = class extends Error {
|
|
124
|
-
constructor(name) {
|
|
125
|
-
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
126
|
-
this.name = "ZodEncodeError";
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
const globalConfig = {};
|
|
130
|
-
function config(newConfig) {
|
|
131
|
-
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
132
|
-
return globalConfig;
|
|
133
|
-
}
|
|
134
78
|
//#endregion
|
|
135
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
79
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
136
80
|
function getEnumValues(entries) {
|
|
137
81
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
138
82
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -141,14 +85,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
141
85
|
if (typeof value === "bigint") return value.toString();
|
|
142
86
|
return value;
|
|
143
87
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
88
|
+
var Cached = class {
|
|
89
|
+
constructor(getter) {
|
|
90
|
+
this._getter = getter;
|
|
91
|
+
this._value = void 0;
|
|
92
|
+
}
|
|
93
|
+
get value() {
|
|
94
|
+
const getter = this._getter;
|
|
95
|
+
if (getter !== void 0) {
|
|
96
|
+
this._value = getter();
|
|
97
|
+
this._getter = void 0;
|
|
150
98
|
}
|
|
151
|
-
|
|
99
|
+
return this._value;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function cached(getter) {
|
|
103
|
+
return new Cached(getter);
|
|
152
104
|
}
|
|
153
105
|
function nullish(input) {
|
|
154
106
|
return input === null || input === void 0;
|
|
@@ -158,21 +110,11 @@ function cleanRegex(source) {
|
|
|
158
110
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
159
111
|
return source.slice(start, end);
|
|
160
112
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (value === EVALUATING) return;
|
|
167
|
-
if (value === void 0) {
|
|
168
|
-
value = EVALUATING;
|
|
169
|
-
value = getter();
|
|
170
|
-
}
|
|
171
|
-
return value;
|
|
172
|
-
},
|
|
173
|
-
set(v) {
|
|
174
|
-
Object.defineProperty(object, key, { value: v });
|
|
175
|
-
},
|
|
113
|
+
function assignProp(target, prop, value) {
|
|
114
|
+
Object.defineProperty(target, prop, {
|
|
115
|
+
value,
|
|
116
|
+
writable: true,
|
|
117
|
+
enumerable: true,
|
|
176
118
|
configurable: true
|
|
177
119
|
});
|
|
178
120
|
}
|
|
@@ -190,7 +132,7 @@ function isPlainObject(o) {
|
|
|
190
132
|
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
191
133
|
return true;
|
|
192
134
|
}
|
|
193
|
-
const propertyKeyTypes = /* @__PURE__
|
|
135
|
+
const propertyKeyTypes = /* @__PURE__*/ new Set([
|
|
194
136
|
"string",
|
|
195
137
|
"number",
|
|
196
138
|
"symbol"
|
|
@@ -220,7 +162,7 @@ function normalizeParams(_params) {
|
|
|
220
162
|
}
|
|
221
163
|
function optionalKeys(shape) {
|
|
222
164
|
return Object.keys(shape).filter((k) => {
|
|
223
|
-
return shape[k]._zod.optin
|
|
165
|
+
return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
|
|
224
166
|
});
|
|
225
167
|
}
|
|
226
168
|
function aborted(x, startIndex = 0) {
|
|
@@ -228,6 +170,11 @@ function aborted(x, startIndex = 0) {
|
|
|
228
170
|
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
|
|
229
171
|
return false;
|
|
230
172
|
}
|
|
173
|
+
function explicitlyAborted(x, startIndex = 0) {
|
|
174
|
+
if (x.aborted === true) return true;
|
|
175
|
+
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
231
178
|
function prefixIssues(path, issues) {
|
|
232
179
|
return issues.map((iss) => {
|
|
233
180
|
var _a;
|
|
@@ -239,17 +186,40 @@ function prefixIssues(path, issues) {
|
|
|
239
186
|
function unwrapMessage(message) {
|
|
240
187
|
return typeof message === "string" ? message : message?.message;
|
|
241
188
|
}
|
|
189
|
+
function attachSchema(issues, start, inst) {
|
|
190
|
+
var _a;
|
|
191
|
+
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
192
|
+
}
|
|
242
193
|
function finalizeIssue(iss, ctx, config) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
194
|
+
var _a;
|
|
195
|
+
const traits = iss.inst?._zod?.traits;
|
|
196
|
+
if (traits?.has("$ZodType")) {
|
|
197
|
+
if (traits.has("$ZodCheck")) (_a = iss).schema ?? (_a.schema = iss.inst);
|
|
198
|
+
else iss.schema = iss.inst;
|
|
199
|
+
}
|
|
200
|
+
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
201
|
+
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";
|
|
202
|
+
const full = {};
|
|
203
|
+
for (const k of Object.keys(iss)) {
|
|
204
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
205
|
+
full[k] = iss[k];
|
|
206
|
+
}
|
|
207
|
+
full.path ?? (full.path = []);
|
|
208
|
+
full.message = message;
|
|
209
|
+
if (ctx?.reportInput) full.input = iss.input;
|
|
251
210
|
return full;
|
|
252
211
|
}
|
|
212
|
+
const highSurrogate = /[\uD800-\uDBFF]/;
|
|
213
|
+
function codePointLength(str) {
|
|
214
|
+
const units = str.length;
|
|
215
|
+
if (!highSurrogate.test(str)) return units;
|
|
216
|
+
let count = units;
|
|
217
|
+
for (let i = 0; i < units - 1; i++) if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
218
|
+
count--;
|
|
219
|
+
i++;
|
|
220
|
+
}
|
|
221
|
+
return count;
|
|
222
|
+
}
|
|
253
223
|
function getLengthableOrigin(input) {
|
|
254
224
|
if (Array.isArray(input)) return "array";
|
|
255
225
|
if (typeof input === "string") return "string";
|
|
@@ -265,56 +235,336 @@ function issue(...args) {
|
|
|
265
235
|
};
|
|
266
236
|
return { ...iss };
|
|
267
237
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
|
|
240
|
+
*
|
|
241
|
+
* Call this from a `proto` initializer, which runs once per prototype — never per instance.
|
|
242
|
+
*/
|
|
243
|
+
function members(proto, table) {
|
|
244
|
+
for (const key in table) {
|
|
245
|
+
const desc = Object.getOwnPropertyDescriptor(table, key);
|
|
246
|
+
if (desc.get) Object.defineProperty(proto, key, {
|
|
247
|
+
...desc,
|
|
248
|
+
enumerable: false
|
|
249
|
+
});
|
|
250
|
+
else defineBound(proto, key, desc.value);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
|
|
254
|
+
function own(inst, key, value, enumerable = true) {
|
|
255
|
+
Object.defineProperty(inst, key, {
|
|
256
|
+
configurable: true,
|
|
257
|
+
writable: true,
|
|
258
|
+
enumerable,
|
|
259
|
+
value
|
|
275
260
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
261
|
+
return value;
|
|
262
|
+
}
|
|
263
|
+
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
|
|
264
|
+
function hide(inst, key, value) {
|
|
265
|
+
return own(inst, key, value, false);
|
|
266
|
+
}
|
|
267
|
+
function defineBound(proto, key, fn) {
|
|
268
|
+
Object.defineProperty(proto, key, {
|
|
269
|
+
configurable: true,
|
|
270
|
+
get() {
|
|
271
|
+
return this == null ? fn : own(this, key, fn.bind(this));
|
|
272
|
+
},
|
|
273
|
+
set(value) {
|
|
274
|
+
own(this, key, value);
|
|
275
|
+
}
|
|
279
276
|
});
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
277
|
+
}
|
|
278
|
+
/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
|
|
279
|
+
function claim(inst, sentinel) {
|
|
280
|
+
const proto = Object.getPrototypeOf(inst);
|
|
281
|
+
return sentinel in proto ? void 0 : proto;
|
|
282
|
+
}
|
|
283
|
+
let installing;
|
|
284
|
+
let broke = false;
|
|
285
|
+
const breaker = {
|
|
286
|
+
configurable: true,
|
|
287
|
+
get() {
|
|
288
|
+
broke = true;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
|
|
293
|
+
* constructor, computed from the internals object itself and cached there on
|
|
294
|
+
* first read. One accessor per constructor rather than one per instance.
|
|
295
|
+
*/
|
|
296
|
+
function defineLazyInternal(inst, key, compute) {
|
|
297
|
+
const proto = Object.getPrototypeOf(inst._zod);
|
|
298
|
+
if (key in proto && installing !== inst._zod) {
|
|
299
|
+
installing = void 0;
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
installing = inst._zod;
|
|
303
|
+
Object.defineProperty(proto, key, {
|
|
304
|
+
configurable: true,
|
|
305
|
+
get() {
|
|
306
|
+
Object.defineProperty(this, key, breaker);
|
|
307
|
+
const outer = broke;
|
|
308
|
+
broke = false;
|
|
309
|
+
try {
|
|
310
|
+
const value = compute(this);
|
|
311
|
+
if (broke) delete this[key];
|
|
312
|
+
else Object.defineProperty(this, key, {
|
|
313
|
+
configurable: true,
|
|
314
|
+
writable: true,
|
|
315
|
+
value
|
|
316
|
+
});
|
|
317
|
+
broke = broke || outer;
|
|
318
|
+
return value;
|
|
319
|
+
} catch (err) {
|
|
320
|
+
delete this[key];
|
|
321
|
+
broke = broke || outer;
|
|
322
|
+
throw err;
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
set(value) {
|
|
326
|
+
Object.defineProperty(this, key, {
|
|
327
|
+
configurable: true,
|
|
328
|
+
writable: true,
|
|
329
|
+
value
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
|
|
336
|
+
* data property. One accessor per constructor rather than one per instance, because an own accessor
|
|
337
|
+
* puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
|
|
338
|
+
*/
|
|
339
|
+
function installLazyProp(inst, key, make, enumerable) {
|
|
340
|
+
const proto = claim(inst, key);
|
|
341
|
+
if (!proto) return;
|
|
342
|
+
Object.defineProperty(proto, key, {
|
|
343
|
+
configurable: true,
|
|
344
|
+
get() {
|
|
345
|
+
const desc = {
|
|
346
|
+
configurable: true,
|
|
347
|
+
writable: true,
|
|
348
|
+
enumerable,
|
|
349
|
+
value: void 0
|
|
350
|
+
};
|
|
351
|
+
Object.defineProperty(this, key, desc);
|
|
352
|
+
desc.value = make(this);
|
|
353
|
+
Object.defineProperty(this, key, desc);
|
|
354
|
+
return desc.value;
|
|
355
|
+
},
|
|
356
|
+
set(value) {
|
|
357
|
+
Object.defineProperty(this, key, {
|
|
358
|
+
configurable: true,
|
|
359
|
+
writable: true,
|
|
360
|
+
enumerable,
|
|
361
|
+
value
|
|
362
|
+
});
|
|
363
|
+
}
|
|
284
364
|
});
|
|
365
|
+
}
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
|
|
368
|
+
var _a;
|
|
369
|
+
const _zodDesc = {
|
|
370
|
+
value: void 0,
|
|
371
|
+
enumerable: false
|
|
285
372
|
};
|
|
286
|
-
|
|
287
|
-
|
|
373
|
+
let _E = "captureStackTrace" in Error ? Error : null;
|
|
374
|
+
function newError(Definition) {
|
|
375
|
+
const E = _E;
|
|
376
|
+
if (E) {
|
|
377
|
+
const saved = E.stackTraceLimit;
|
|
378
|
+
if (typeof saved === "number") {
|
|
379
|
+
try {
|
|
380
|
+
E.stackTraceLimit = 0;
|
|
381
|
+
} catch {
|
|
382
|
+
_E = null;
|
|
383
|
+
return new Definition();
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
return new Definition();
|
|
387
|
+
} finally {
|
|
388
|
+
E.stackTraceLimit = saved;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return new Definition();
|
|
393
|
+
}
|
|
394
|
+
function $constructor(name, initializer, proto, params) {
|
|
395
|
+
const zodProto = {};
|
|
396
|
+
function Internals(def) {
|
|
397
|
+
this.def = def;
|
|
398
|
+
this.constr = _;
|
|
399
|
+
this.traits = /* @__PURE__ */ new Set();
|
|
400
|
+
}
|
|
401
|
+
Internals.prototype = zodProto;
|
|
402
|
+
const protoMembers = proto;
|
|
403
|
+
const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
|
|
404
|
+
function init(inst, def) {
|
|
405
|
+
if (!inst._zod) {
|
|
406
|
+
_zodDesc.value = new Internals(def);
|
|
407
|
+
try {
|
|
408
|
+
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
409
|
+
} finally {
|
|
410
|
+
_zodDesc.value = void 0;
|
|
411
|
+
}
|
|
412
|
+
} else if (inst._zod.traits.has(name)) return;
|
|
413
|
+
inst._zod.traits.add(name);
|
|
414
|
+
initializer(inst, def);
|
|
415
|
+
if (initialized) {
|
|
416
|
+
const own = Object.getPrototypeOf(inst);
|
|
417
|
+
const ctorProto = inst._zod.constr.prototype;
|
|
418
|
+
let up = own;
|
|
419
|
+
while (up && up !== ctorProto) up = Object.getPrototypeOf(up);
|
|
420
|
+
const target = up ?? own;
|
|
421
|
+
if (!initialized.has(target)) {
|
|
422
|
+
initialized.add(target);
|
|
423
|
+
members(target, protoMembers);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const proto = _.prototype;
|
|
427
|
+
for (const k in proto) {
|
|
428
|
+
if (!Object.prototype.hasOwnProperty.call(proto, k)) continue;
|
|
429
|
+
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const Parent = params?.Parent ?? Object;
|
|
433
|
+
class Definition extends Parent {}
|
|
434
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
435
|
+
function _(def) {
|
|
436
|
+
const inst = params?.Parent ? newError(Definition) : this;
|
|
437
|
+
init(inst, def);
|
|
438
|
+
const deferred = inst._zod.deferred;
|
|
439
|
+
if (deferred) {
|
|
440
|
+
for (const fn of deferred) fn();
|
|
441
|
+
inst._zod.deferred = void 0;
|
|
442
|
+
}
|
|
443
|
+
const pp = globalThis.__zod_globalConfig?.postProcessor;
|
|
444
|
+
if (pp) pp(inst);
|
|
445
|
+
return inst;
|
|
446
|
+
}
|
|
447
|
+
Object.defineProperty(_, "init", { value: init });
|
|
448
|
+
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
449
|
+
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
450
|
+
return inst?._zod?.traits?.has(name);
|
|
451
|
+
} });
|
|
452
|
+
Object.defineProperty(_, "name", { value: name });
|
|
453
|
+
return _;
|
|
454
|
+
}
|
|
455
|
+
var $ZodAsyncError = class extends Error {
|
|
456
|
+
constructor() {
|
|
457
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
var $ZodEncodeError = class extends Error {
|
|
461
|
+
constructor(name) {
|
|
462
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
463
|
+
this.name = "ZodEncodeError";
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
|
|
467
|
+
const globalConfig = globalThis.__zod_globalConfig;
|
|
468
|
+
function config(newConfig) {
|
|
469
|
+
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
470
|
+
return globalConfig;
|
|
471
|
+
}
|
|
288
472
|
//#endregion
|
|
289
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
473
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
|
|
474
|
+
function _getMessage() {
|
|
475
|
+
const internals = this._zod;
|
|
476
|
+
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
477
|
+
return internals.message;
|
|
478
|
+
}
|
|
479
|
+
function _setMessage(value) {
|
|
480
|
+
this._zod.message = value;
|
|
481
|
+
}
|
|
482
|
+
const _messageDesc = {
|
|
483
|
+
get: _getMessage,
|
|
484
|
+
set: _setMessage,
|
|
485
|
+
enumerable: true,
|
|
486
|
+
configurable: true
|
|
487
|
+
};
|
|
488
|
+
const _issuesDesc = {
|
|
489
|
+
value: void 0,
|
|
490
|
+
enumerable: false
|
|
491
|
+
};
|
|
492
|
+
const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
493
|
+
const initializer = (inst, def) => {
|
|
494
|
+
inst.name = "$ZodError";
|
|
495
|
+
_issuesDesc.value = def;
|
|
496
|
+
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
497
|
+
_issuesDesc.value = void 0;
|
|
498
|
+
Object.defineProperty(inst, "message", _messageDesc);
|
|
499
|
+
const proto = Object.getPrototypeOf(inst);
|
|
500
|
+
if (!_installedToString.has(proto)) {
|
|
501
|
+
_installedToString.add(proto);
|
|
502
|
+
Object.defineProperty(proto, "toString", {
|
|
503
|
+
configurable: true,
|
|
504
|
+
enumerable: false,
|
|
505
|
+
get() {
|
|
506
|
+
const value = () => this.message;
|
|
507
|
+
Object.defineProperty(this, "toString", {
|
|
508
|
+
value,
|
|
509
|
+
configurable: true,
|
|
510
|
+
writable: true
|
|
511
|
+
});
|
|
512
|
+
return value;
|
|
513
|
+
},
|
|
514
|
+
set(value) {
|
|
515
|
+
Object.defineProperty(this, "toString", {
|
|
516
|
+
value,
|
|
517
|
+
configurable: true,
|
|
518
|
+
writable: true
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
});
|
|
301
522
|
}
|
|
302
|
-
|
|
523
|
+
};
|
|
524
|
+
$constructor("$ZodError", initializer);
|
|
525
|
+
const $ZodRealError = $constructor("$ZodError", initializer, void 0, { Parent: Error });
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
|
|
528
|
+
const _parse = (_Err) => {
|
|
529
|
+
const fn = (schema, value, _ctx, _params) => {
|
|
530
|
+
const ctx = _ctx ? {
|
|
531
|
+
..._ctx,
|
|
532
|
+
async: false
|
|
533
|
+
} : { async: false };
|
|
534
|
+
const result = schema._zod.run({
|
|
535
|
+
value,
|
|
536
|
+
issues: []
|
|
537
|
+
}, ctx);
|
|
538
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
539
|
+
if (result.issues.length) {
|
|
540
|
+
const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
541
|
+
captureStackTrace(e, _params?.callee ?? fn);
|
|
542
|
+
throw e;
|
|
543
|
+
}
|
|
544
|
+
return result.value;
|
|
545
|
+
};
|
|
546
|
+
return fn;
|
|
303
547
|
};
|
|
304
548
|
const parse = /* @__PURE__*/ _parse($ZodRealError);
|
|
305
|
-
const _parseAsync = (_Err) =>
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
549
|
+
const _parseAsync = (_Err) => {
|
|
550
|
+
const fn = async (schema, value, _ctx, params) => {
|
|
551
|
+
const ctx = _ctx ? {
|
|
552
|
+
..._ctx,
|
|
553
|
+
async: true
|
|
554
|
+
} : { async: true };
|
|
555
|
+
let result = schema._zod.run({
|
|
556
|
+
value,
|
|
557
|
+
issues: []
|
|
558
|
+
}, ctx);
|
|
559
|
+
if (result instanceof Promise) result = await result;
|
|
560
|
+
if (result.issues.length) {
|
|
561
|
+
const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
562
|
+
captureStackTrace(e, params?.callee ?? fn);
|
|
563
|
+
throw e;
|
|
564
|
+
}
|
|
565
|
+
return result.value;
|
|
566
|
+
};
|
|
567
|
+
return fn;
|
|
318
568
|
};
|
|
319
569
|
const parseAsync = /* @__PURE__*/ _parseAsync($ZodRealError);
|
|
320
570
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
@@ -327,59 +577,71 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
327
577
|
issues: []
|
|
328
578
|
}, ctx);
|
|
329
579
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
330
|
-
return result.issues.length ? {
|
|
331
|
-
success: false,
|
|
332
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
333
|
-
} : {
|
|
580
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
334
581
|
success: true,
|
|
335
582
|
data: result.value
|
|
336
583
|
};
|
|
337
584
|
};
|
|
338
585
|
const safeParse = /* @__PURE__*/ _safeParse($ZodRealError);
|
|
586
|
+
function failure(Err, issues, ctx) {
|
|
587
|
+
let error;
|
|
588
|
+
return {
|
|
589
|
+
success: false,
|
|
590
|
+
get error() {
|
|
591
|
+
if (!error) {
|
|
592
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
593
|
+
issues = void 0;
|
|
594
|
+
ctx = void 0;
|
|
595
|
+
}
|
|
596
|
+
return error;
|
|
597
|
+
},
|
|
598
|
+
set error(e) {
|
|
599
|
+
error = e;
|
|
600
|
+
issues = void 0;
|
|
601
|
+
ctx = void 0;
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
}
|
|
339
605
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
340
|
-
const ctx = _ctx ?
|
|
606
|
+
const ctx = _ctx ? {
|
|
607
|
+
..._ctx,
|
|
608
|
+
async: true
|
|
609
|
+
} : { async: true };
|
|
341
610
|
let result = schema._zod.run({
|
|
342
611
|
value,
|
|
343
612
|
issues: []
|
|
344
613
|
}, ctx);
|
|
345
614
|
if (result instanceof Promise) result = await result;
|
|
346
|
-
return result.issues.length ? {
|
|
347
|
-
success: false,
|
|
348
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
349
|
-
} : {
|
|
615
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
350
616
|
success: true,
|
|
351
617
|
data: result.value
|
|
352
618
|
};
|
|
353
619
|
};
|
|
354
620
|
const safeParseAsync = /* @__PURE__*/ _safeParseAsync($ZodRealError);
|
|
355
|
-
const
|
|
356
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
357
|
-
return new RegExp(`^${regex}$`);
|
|
358
|
-
};
|
|
621
|
+
const anyString = /^[\s\S]{0,}$/;
|
|
359
622
|
const number$2 = /^-?\d+(?:\.\d+)?$/;
|
|
360
623
|
const boolean$1 = /^(?:true|false)$/i;
|
|
361
624
|
//#endregion
|
|
362
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
625
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
|
|
363
626
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
364
627
|
var _a;
|
|
365
628
|
inst._zod ?? (inst._zod = {});
|
|
366
629
|
inst._zod.def = def;
|
|
367
630
|
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
368
631
|
});
|
|
632
|
+
/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */
|
|
633
|
+
const _whenHasLength = (payload) => {
|
|
634
|
+
const val = payload.value;
|
|
635
|
+
return !nullish(val) && val.length !== void 0;
|
|
636
|
+
};
|
|
369
637
|
const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
370
638
|
var _a;
|
|
371
639
|
$ZodCheck.init(inst, def);
|
|
372
|
-
(_a = inst._zod.def).when ?? (_a.when =
|
|
373
|
-
const val = payload.value;
|
|
374
|
-
return !nullish(val) && val.length !== void 0;
|
|
375
|
-
});
|
|
376
|
-
inst._zod.onattach.push((inst) => {
|
|
377
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
378
|
-
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
379
|
-
});
|
|
640
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
380
641
|
inst._zod.check = (payload) => {
|
|
381
642
|
const input = payload.value;
|
|
382
|
-
|
|
643
|
+
const units = input.length;
|
|
644
|
+
if ((typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units) >= def.minimum) return;
|
|
383
645
|
const origin = getLengthableOrigin(input);
|
|
384
646
|
payload.issues.push({
|
|
385
647
|
origin,
|
|
@@ -395,14 +657,6 @@ const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (ins
|
|
|
395
657
|
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
396
658
|
var _a, _b;
|
|
397
659
|
$ZodCheck.init(inst, def);
|
|
398
|
-
inst._zod.onattach.push((inst) => {
|
|
399
|
-
const bag = inst._zod.bag;
|
|
400
|
-
bag.format = def.format;
|
|
401
|
-
if (def.pattern) {
|
|
402
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
403
|
-
bag.patterns.add(def.pattern);
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
660
|
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
407
661
|
def.pattern.lastIndex = 0;
|
|
408
662
|
if (def.pattern.test(payload.value)) return;
|
|
@@ -435,22 +689,22 @@ const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def)
|
|
|
435
689
|
};
|
|
436
690
|
});
|
|
437
691
|
//#endregion
|
|
438
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
692
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
439
693
|
const version = {
|
|
440
694
|
major: 4,
|
|
441
|
-
minor:
|
|
442
|
-
patch:
|
|
695
|
+
minor: 6,
|
|
696
|
+
patch: 5
|
|
443
697
|
};
|
|
444
698
|
//#endregion
|
|
445
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
699
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
|
|
446
700
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
447
701
|
var _a;
|
|
448
702
|
inst ?? (inst = {});
|
|
449
703
|
inst._zod.def = def;
|
|
450
704
|
inst._zod.bag = inst._zod.bag || {};
|
|
451
705
|
inst._zod.version = version;
|
|
452
|
-
const
|
|
453
|
-
|
|
706
|
+
const defChecks = inst._zod.def.checks;
|
|
707
|
+
const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
|
|
454
708
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
455
709
|
if (checks.length === 0) {
|
|
456
710
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -459,10 +713,12 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
459
713
|
});
|
|
460
714
|
} else {
|
|
461
715
|
const runChecks = (payload, checks, ctx) => {
|
|
716
|
+
if (payload.memo) return payload;
|
|
462
717
|
let isAborted = aborted(payload);
|
|
463
718
|
let asyncResult;
|
|
464
719
|
for (const ch of checks) {
|
|
465
720
|
if (ch._zod.def.when) {
|
|
721
|
+
if (explicitlyAborted(payload)) continue;
|
|
466
722
|
if (!ch._zod.def.when(payload)) continue;
|
|
467
723
|
} else if (isAborted) continue;
|
|
468
724
|
const currLen = payload.issues.length;
|
|
@@ -471,10 +727,12 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
471
727
|
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
472
728
|
await _;
|
|
473
729
|
if (payload.issues.length === currLen) return;
|
|
730
|
+
attachSchema(payload.issues, currLen, inst);
|
|
474
731
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
475
732
|
});
|
|
476
733
|
else {
|
|
477
734
|
if (payload.issues.length === currLen) continue;
|
|
735
|
+
attachSchema(payload.issues, currLen, inst);
|
|
478
736
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
479
737
|
}
|
|
480
738
|
}
|
|
@@ -518,22 +776,43 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
518
776
|
return runChecks(result, checks, ctx);
|
|
519
777
|
};
|
|
520
778
|
}
|
|
521
|
-
|
|
779
|
+
}, {
|
|
780
|
+
get "~standard"() {
|
|
781
|
+
return hide(this, "~standard", standardProps(this));
|
|
782
|
+
},
|
|
783
|
+
set "~standard"(value) {
|
|
784
|
+
own(this, "~standard", value);
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
788
|
+
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
789
|
+
async function validateAsync(inst, value) {
|
|
790
|
+
const ctx = { async: true };
|
|
791
|
+
return toStandardResult(await inst._zod.run({
|
|
792
|
+
value,
|
|
793
|
+
issues: []
|
|
794
|
+
}, ctx), ctx);
|
|
795
|
+
}
|
|
796
|
+
function standardProps(inst) {
|
|
797
|
+
return {
|
|
522
798
|
validate: (value) => {
|
|
799
|
+
const ctx = { async: false };
|
|
523
800
|
try {
|
|
524
|
-
const r =
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
801
|
+
const r = inst._zod.run({
|
|
802
|
+
value,
|
|
803
|
+
issues: []
|
|
804
|
+
}, ctx);
|
|
805
|
+
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
806
|
+
} catch (_) {}
|
|
807
|
+
return validateAsync(inst, value);
|
|
529
808
|
},
|
|
530
809
|
vendor: "zod",
|
|
531
810
|
version: 1
|
|
532
|
-
}
|
|
533
|
-
}
|
|
811
|
+
};
|
|
812
|
+
}
|
|
534
813
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
535
814
|
$ZodType.init(inst, def);
|
|
536
|
-
inst._zod.pattern =
|
|
815
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
537
816
|
inst._zod.parse = (payload, _) => {
|
|
538
817
|
if (def.coerce) try {
|
|
539
818
|
payload.value = String(payload.value);
|
|
@@ -550,14 +829,14 @@ const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
|
550
829
|
});
|
|
551
830
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
552
831
|
$ZodType.init(inst, def);
|
|
553
|
-
inst._zod.pattern =
|
|
832
|
+
inst._zod.pattern = number$2;
|
|
554
833
|
inst._zod.parse = (payload, _ctx) => {
|
|
555
834
|
if (def.coerce) try {
|
|
556
835
|
payload.value = Number(payload.value);
|
|
557
836
|
} catch (_) {}
|
|
558
837
|
const input = payload.value;
|
|
559
838
|
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
560
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ?
|
|
839
|
+
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? String(input) : void 0 : void 0;
|
|
561
840
|
payload.issues.push({
|
|
562
841
|
expected: "number",
|
|
563
842
|
code: "invalid_type",
|
|
@@ -614,6 +893,8 @@ function handleArrayResult(result, final, index) {
|
|
|
614
893
|
}
|
|
615
894
|
const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
616
895
|
$ZodType.init(inst, def);
|
|
896
|
+
const memo = globalConfig.memoizer;
|
|
897
|
+
memo?.attach(inst);
|
|
617
898
|
inst._zod.parse = (payload, ctx) => {
|
|
618
899
|
const input = payload.value;
|
|
619
900
|
if (!Array.isArray(input)) {
|
|
@@ -625,8 +906,9 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
625
906
|
});
|
|
626
907
|
return payload;
|
|
627
908
|
}
|
|
628
|
-
payload.value = Array(input.length);
|
|
909
|
+
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
629
910
|
const proms = [];
|
|
911
|
+
const abortEarly = ctx?.abortEarly;
|
|
630
912
|
for (let i = 0; i < input.length; i++) {
|
|
631
913
|
const item = input[i];
|
|
632
914
|
const result = def.element._zod.run({
|
|
@@ -634,41 +916,71 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
634
916
|
issues: []
|
|
635
917
|
}, ctx);
|
|
636
918
|
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
637
|
-
else
|
|
919
|
+
else {
|
|
920
|
+
handleArrayResult(result, payload, i);
|
|
921
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
922
|
+
}
|
|
638
923
|
}
|
|
639
924
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
640
925
|
return payload;
|
|
641
926
|
};
|
|
642
927
|
});
|
|
643
|
-
function handlePropertyResult(result, final, key, input,
|
|
928
|
+
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
929
|
+
const isPresent = key in input;
|
|
930
|
+
const isOptionalOut = optout === "optional";
|
|
931
|
+
if (!isPresent && isOptionalOut && optin === "optional") return;
|
|
644
932
|
if (result.issues.length) {
|
|
645
|
-
if (isOptionalOut && !
|
|
933
|
+
if (optin !== void 0 && isOptionalOut && !isPresent) return;
|
|
646
934
|
final.issues.push(...prefixIssues(key, result.issues));
|
|
647
935
|
}
|
|
936
|
+
if (!isPresent && optin === void 0) {
|
|
937
|
+
if (!result.issues.length) final.issues.push({
|
|
938
|
+
code: "invalid_type",
|
|
939
|
+
expected: "nonoptional",
|
|
940
|
+
input: void 0,
|
|
941
|
+
path: [key]
|
|
942
|
+
});
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
648
945
|
if (result.value === void 0) {
|
|
649
|
-
if (
|
|
946
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
|
|
650
947
|
} else final.value[key] = result.value;
|
|
651
948
|
}
|
|
949
|
+
const NO_SYMBOL_KEYS = [];
|
|
652
950
|
function normalizeDef(def) {
|
|
653
951
|
const keys = Object.keys(def.shape);
|
|
654
|
-
|
|
952
|
+
const ownSymbols = Object.getOwnPropertySymbols(def.shape);
|
|
953
|
+
const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
|
|
954
|
+
const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
|
|
955
|
+
for (const k of allKeys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
|
|
655
956
|
const okeys = optionalKeys(def.shape);
|
|
656
957
|
return {
|
|
657
958
|
...def,
|
|
658
|
-
|
|
959
|
+
allKeys,
|
|
960
|
+
symbolKeys,
|
|
659
961
|
keySet: new Set(keys),
|
|
660
962
|
numKeys: keys.length,
|
|
661
963
|
optionalKeys: new Set(okeys)
|
|
662
964
|
};
|
|
663
965
|
}
|
|
664
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
966
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
665
967
|
const unrecognized = [];
|
|
666
968
|
const keySet = def.keySet;
|
|
667
969
|
const _catchall = def.catchall._zod;
|
|
668
970
|
const t = _catchall.def.type;
|
|
669
|
-
const
|
|
971
|
+
const optin = _catchall.optin;
|
|
972
|
+
const optout = _catchall.optout;
|
|
973
|
+
let seen = 0;
|
|
670
974
|
for (const key in input) {
|
|
975
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
976
|
+
if (aborted(payload, seen)) break;
|
|
977
|
+
seen = payload.issues.length;
|
|
978
|
+
}
|
|
671
979
|
if (keySet.has(key)) continue;
|
|
980
|
+
if (key === "__proto__") {
|
|
981
|
+
if (t === "never") unrecognized.push(key);
|
|
982
|
+
continue;
|
|
983
|
+
}
|
|
672
984
|
if (t === "never") {
|
|
673
985
|
unrecognized.push(key);
|
|
674
986
|
continue;
|
|
@@ -677,14 +989,15 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
677
989
|
value: input[key],
|
|
678
990
|
issues: []
|
|
679
991
|
}, ctx);
|
|
680
|
-
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input,
|
|
681
|
-
else handlePropertyResult(r, payload, key, input,
|
|
992
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
993
|
+
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
682
994
|
}
|
|
683
995
|
if (unrecognized.length) payload.issues.push({
|
|
684
996
|
code: "unrecognized_keys",
|
|
685
997
|
keys: unrecognized,
|
|
686
998
|
input,
|
|
687
|
-
inst
|
|
999
|
+
inst,
|
|
1000
|
+
continue: true
|
|
688
1001
|
});
|
|
689
1002
|
if (!proms.length) return payload;
|
|
690
1003
|
return Promise.all(proms).then(() => {
|
|
@@ -693,23 +1006,28 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
693
1006
|
}
|
|
694
1007
|
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
695
1008
|
$ZodType.init(inst, def);
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
1009
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1010
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
1011
|
+
if (sh) {
|
|
1012
|
+
const get = () => {
|
|
699
1013
|
const newSh = { ...sh };
|
|
700
1014
|
Object.defineProperty(def, "shape", { value: newSh });
|
|
1015
|
+
get.raw = newSh;
|
|
701
1016
|
return newSh;
|
|
702
|
-
}
|
|
1017
|
+
};
|
|
1018
|
+
get.raw = sh;
|
|
1019
|
+
Object.defineProperty(def, "shape", { get });
|
|
703
1020
|
}
|
|
704
1021
|
const _normalized = cached(() => normalizeDef(def));
|
|
705
|
-
|
|
706
|
-
const shape = def.shape;
|
|
1022
|
+
defineLazyInternal(inst, "propValues", (zod) => {
|
|
1023
|
+
const shape = zod.def.shape;
|
|
707
1024
|
const propValues = {};
|
|
708
1025
|
for (const key in shape) {
|
|
709
1026
|
const field = shape[key]._zod;
|
|
710
1027
|
if (field.values) {
|
|
711
|
-
propValues
|
|
1028
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, key)) assignProp(propValues, key, /* @__PURE__ */ new Set());
|
|
712
1029
|
for (const v of field.values) propValues[key].add(v);
|
|
1030
|
+
if (field.optin !== void 0) propValues[key].add(void 0);
|
|
713
1031
|
}
|
|
714
1032
|
}
|
|
715
1033
|
return propValues;
|
|
@@ -717,6 +1035,8 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
717
1035
|
const isObject = isObject$1;
|
|
718
1036
|
const catchall = def.catchall;
|
|
719
1037
|
let value;
|
|
1038
|
+
const memo = globalConfig.memoizer;
|
|
1039
|
+
memo?.attach(inst);
|
|
720
1040
|
inst._zod.parse = (payload, ctx) => {
|
|
721
1041
|
value ?? (value = _normalized.value);
|
|
722
1042
|
const input = payload.value;
|
|
@@ -729,21 +1049,29 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
729
1049
|
});
|
|
730
1050
|
return payload;
|
|
731
1051
|
}
|
|
732
|
-
payload.value = {};
|
|
1052
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
733
1053
|
const proms = [];
|
|
734
1054
|
const shape = value.shape;
|
|
735
|
-
|
|
1055
|
+
const abortEarly = ctx?.abortEarly;
|
|
1056
|
+
let seen = payload.issues.length;
|
|
1057
|
+
for (const key of value.allKeys) {
|
|
1058
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
1059
|
+
if (aborted(payload, seen)) break;
|
|
1060
|
+
seen = payload.issues.length;
|
|
1061
|
+
}
|
|
1062
|
+
if (key === "__proto__") continue;
|
|
736
1063
|
const el = shape[key];
|
|
737
|
-
const
|
|
1064
|
+
const optin = el._zod.optin;
|
|
1065
|
+
const optout = el._zod.optout;
|
|
738
1066
|
const r = el._zod.run({
|
|
739
1067
|
value: input[key],
|
|
740
1068
|
issues: []
|
|
741
1069
|
}, ctx);
|
|
742
|
-
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input,
|
|
743
|
-
else handlePropertyResult(r, payload, key, input,
|
|
1070
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
1071
|
+
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
744
1072
|
}
|
|
745
1073
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
746
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1074
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
747
1075
|
};
|
|
748
1076
|
});
|
|
749
1077
|
function handleUnionResults(results, final, inst, ctx) {
|
|
@@ -766,21 +1094,20 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
766
1094
|
}
|
|
767
1095
|
const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
768
1096
|
$ZodType.init(inst, def);
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1097
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : zod.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0);
|
|
1098
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
1099
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
1100
|
+
if (zod.def.options.every((o) => o._zod.values)) return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
773
1101
|
});
|
|
774
|
-
|
|
775
|
-
if (def.options.every((o) => o._zod.pattern)) {
|
|
776
|
-
const patterns = def.options.map((o) => o._zod.pattern);
|
|
1102
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
1103
|
+
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
1104
|
+
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
777
1105
|
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
778
1106
|
}
|
|
779
1107
|
});
|
|
780
|
-
const
|
|
781
|
-
const first = def.options[0]._zod.run;
|
|
1108
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
782
1109
|
inst._zod.parse = (payload, ctx) => {
|
|
783
|
-
if (
|
|
1110
|
+
if (first) return first(payload, ctx);
|
|
784
1111
|
let async = false;
|
|
785
1112
|
const results = [];
|
|
786
1113
|
for (const option of def.options) {
|
|
@@ -804,6 +1131,8 @@ const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
|
804
1131
|
});
|
|
805
1132
|
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
806
1133
|
$ZodType.init(inst, def);
|
|
1134
|
+
const memo = globalConfig.memoizer;
|
|
1135
|
+
memo?.attach(inst);
|
|
807
1136
|
inst._zod.parse = (payload, ctx) => {
|
|
808
1137
|
const input = payload.value;
|
|
809
1138
|
if (!isPlainObject(input)) {
|
|
@@ -817,39 +1146,66 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
817
1146
|
}
|
|
818
1147
|
const proms = [];
|
|
819
1148
|
const values = def.keyType._zod.values;
|
|
820
|
-
if (values) {
|
|
821
|
-
payload.value = {};
|
|
1149
|
+
if (values && !def.partial) {
|
|
1150
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
822
1151
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
823
1152
|
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
824
1153
|
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
1154
|
+
if (key === "__proto__") continue;
|
|
1155
|
+
const keyResult = def.keyType._zod.run({
|
|
1156
|
+
value: key,
|
|
1157
|
+
issues: []
|
|
1158
|
+
}, ctx);
|
|
1159
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
1160
|
+
if (keyResult.issues.length) {
|
|
1161
|
+
payload.issues.push({
|
|
1162
|
+
code: "invalid_key",
|
|
1163
|
+
origin: "record",
|
|
1164
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
1165
|
+
input: key,
|
|
1166
|
+
path: [key],
|
|
1167
|
+
inst
|
|
1168
|
+
});
|
|
1169
|
+
continue;
|
|
1170
|
+
}
|
|
1171
|
+
const outKey = keyResult.value;
|
|
1172
|
+
if (outKey === "__proto__") continue;
|
|
825
1173
|
const result = def.valueType._zod.run({
|
|
826
1174
|
value: input[key],
|
|
827
1175
|
issues: []
|
|
828
1176
|
}, ctx);
|
|
829
1177
|
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
830
1178
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
831
|
-
payload.value[
|
|
1179
|
+
payload.value[outKey] = result.value;
|
|
832
1180
|
}));
|
|
833
1181
|
else {
|
|
834
1182
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
835
|
-
payload.value[
|
|
1183
|
+
payload.value[outKey] = result.value;
|
|
836
1184
|
}
|
|
837
1185
|
}
|
|
838
1186
|
let unrecognized;
|
|
839
1187
|
for (const key in input) if (!recordKeys.has(key)) {
|
|
840
|
-
|
|
841
|
-
|
|
1188
|
+
if (def.mode === "loose") {
|
|
1189
|
+
if (key === "__proto__") continue;
|
|
1190
|
+
payload.value[key] = input[key];
|
|
1191
|
+
} else {
|
|
1192
|
+
unrecognized = unrecognized ?? [];
|
|
1193
|
+
unrecognized.push(key);
|
|
1194
|
+
}
|
|
842
1195
|
}
|
|
843
1196
|
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
844
1197
|
code: "unrecognized_keys",
|
|
845
1198
|
input,
|
|
846
1199
|
inst,
|
|
847
|
-
keys: unrecognized
|
|
1200
|
+
keys: unrecognized,
|
|
1201
|
+
continue: true
|
|
848
1202
|
});
|
|
849
1203
|
} else {
|
|
850
|
-
payload.value = {};
|
|
1204
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1205
|
+
let unrecognized;
|
|
851
1206
|
for (const key of Reflect.ownKeys(input)) {
|
|
852
1207
|
if (key === "__proto__") continue;
|
|
1208
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
|
|
853
1209
|
let keyResult = def.keyType._zod.run({
|
|
854
1210
|
value: key,
|
|
855
1211
|
issues: []
|
|
@@ -865,7 +1221,10 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
865
1221
|
}
|
|
866
1222
|
if (keyResult.issues.length) {
|
|
867
1223
|
if (def.mode === "loose") payload.value[key] = input[key];
|
|
868
|
-
else
|
|
1224
|
+
else if (values) {
|
|
1225
|
+
unrecognized = unrecognized ?? [];
|
|
1226
|
+
unrecognized.push(key);
|
|
1227
|
+
} else payload.issues.push({
|
|
869
1228
|
code: "invalid_key",
|
|
870
1229
|
origin: "record",
|
|
871
1230
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
@@ -875,19 +1234,28 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
875
1234
|
});
|
|
876
1235
|
continue;
|
|
877
1236
|
}
|
|
1237
|
+
const outKey = keyResult.value;
|
|
1238
|
+
if (outKey === "__proto__") continue;
|
|
878
1239
|
const result = def.valueType._zod.run({
|
|
879
1240
|
value: input[key],
|
|
880
1241
|
issues: []
|
|
881
1242
|
}, ctx);
|
|
882
1243
|
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
883
1244
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
884
|
-
payload.value[
|
|
1245
|
+
payload.value[outKey] = result.value;
|
|
885
1246
|
}));
|
|
886
1247
|
else {
|
|
887
1248
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
888
|
-
payload.value[
|
|
1249
|
+
payload.value[outKey] = result.value;
|
|
889
1250
|
}
|
|
890
1251
|
}
|
|
1252
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
1253
|
+
code: "unrecognized_keys",
|
|
1254
|
+
input,
|
|
1255
|
+
inst,
|
|
1256
|
+
keys: unrecognized,
|
|
1257
|
+
continue: true
|
|
1258
|
+
});
|
|
891
1259
|
}
|
|
892
1260
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
893
1261
|
return payload;
|
|
@@ -898,7 +1266,10 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
898
1266
|
const values = getEnumValues(def.entries);
|
|
899
1267
|
const valuesSet = new Set(values);
|
|
900
1268
|
inst._zod.values = valuesSet;
|
|
901
|
-
inst
|
|
1269
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
1270
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
1271
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
1272
|
+
});
|
|
902
1273
|
inst._zod.parse = (payload, _ctx) => {
|
|
903
1274
|
const input = payload.value;
|
|
904
1275
|
if (valuesSet.has(input)) return payload;
|
|
@@ -913,10 +1284,12 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
913
1284
|
});
|
|
914
1285
|
const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
915
1286
|
$ZodType.init(inst, def);
|
|
916
|
-
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
917
1287
|
const values = new Set(def.values);
|
|
918
1288
|
inst._zod.values = values;
|
|
919
|
-
inst
|
|
1289
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
1290
|
+
const vals = zod.def.values;
|
|
1291
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
1292
|
+
});
|
|
920
1293
|
inst._zod.parse = (payload, _ctx) => {
|
|
921
1294
|
const input = payload.value;
|
|
922
1295
|
if (values.has(input)) return payload;
|
|
@@ -931,6 +1304,8 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
931
1304
|
});
|
|
932
1305
|
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
933
1306
|
$ZodType.init(inst, def);
|
|
1307
|
+
inst._zod.optin = "optional";
|
|
1308
|
+
globalConfig.memoizer?.guard(inst);
|
|
934
1309
|
inst._zod.parse = (payload, ctx) => {
|
|
935
1310
|
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
936
1311
|
const _out = def.transform(payload.value, payload);
|
|
@@ -943,44 +1318,45 @@ const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) =>
|
|
|
943
1318
|
return payload;
|
|
944
1319
|
};
|
|
945
1320
|
});
|
|
946
|
-
function handleOptionalResult(
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
value: void 0
|
|
950
|
-
};
|
|
951
|
-
return result;
|
|
1321
|
+
function handleOptionalResult(payload, result) {
|
|
1322
|
+
payload.value = result.issues.length ? void 0 : result.value;
|
|
1323
|
+
return payload;
|
|
952
1324
|
}
|
|
953
1325
|
const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
|
|
954
1326
|
$ZodType.init(inst, def);
|
|
955
|
-
inst._zod.optin
|
|
1327
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
956
1328
|
inst._zod.optout = "optional";
|
|
957
|
-
|
|
958
|
-
|
|
1329
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
1330
|
+
const values = zod.def.innerType._zod.values;
|
|
1331
|
+
return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
|
|
959
1332
|
});
|
|
960
|
-
|
|
961
|
-
const pattern = def.innerType._zod.pattern;
|
|
1333
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
1334
|
+
const pattern = zod.def.innerType._zod.pattern;
|
|
962
1335
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
963
1336
|
});
|
|
964
1337
|
inst._zod.parse = (payload, ctx) => {
|
|
965
|
-
if (
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1338
|
+
if (payload.value === void 0) {
|
|
1339
|
+
if (def.innerType._zod.optin !== "defaulted") return payload;
|
|
1340
|
+
const result = def.innerType._zod.run({
|
|
1341
|
+
value: payload.value,
|
|
1342
|
+
issues: []
|
|
1343
|
+
}, ctx);
|
|
1344
|
+
if (result instanceof Promise) return result.then((result) => handleOptionalResult(payload, result));
|
|
1345
|
+
return handleOptionalResult(payload, result);
|
|
969
1346
|
}
|
|
970
|
-
if (payload.value === void 0) return payload;
|
|
971
1347
|
return def.innerType._zod.run(payload, ctx);
|
|
972
1348
|
};
|
|
973
1349
|
});
|
|
974
1350
|
const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
975
1351
|
$ZodType.init(inst, def);
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
const pattern = def.innerType._zod.pattern;
|
|
1352
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
|
|
1353
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
1354
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
1355
|
+
const pattern = zod.def.innerType._zod.pattern;
|
|
980
1356
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
981
1357
|
});
|
|
982
|
-
|
|
983
|
-
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
1358
|
+
defineLazyInternal(inst, "values", (zod) => {
|
|
1359
|
+
return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
|
|
984
1360
|
});
|
|
985
1361
|
inst._zod.parse = (payload, ctx) => {
|
|
986
1362
|
if (payload.value === null) return payload;
|
|
@@ -989,10 +1365,10 @@ const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
|
989
1365
|
});
|
|
990
1366
|
const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
991
1367
|
$ZodType.init(inst, def);
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1368
|
+
defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
1369
|
+
defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
1370
|
+
defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
|
|
1371
|
+
defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
|
|
996
1372
|
inst._zod.parse = (payload, ctx) => {
|
|
997
1373
|
if (ctx.direction === "backward") {
|
|
998
1374
|
const right = def.out._zod.run(payload, ctx);
|
|
@@ -1005,7 +1381,7 @@ const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
|
1005
1381
|
};
|
|
1006
1382
|
});
|
|
1007
1383
|
function handlePipeResult(left, next, ctx) {
|
|
1008
|
-
if (left.issues.
|
|
1384
|
+
if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
|
|
1009
1385
|
left.aborted = true;
|
|
1010
1386
|
return left;
|
|
1011
1387
|
}
|
|
@@ -1041,21 +1417,25 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
1041
1417
|
}
|
|
1042
1418
|
}
|
|
1043
1419
|
//#endregion
|
|
1044
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1420
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
|
|
1421
|
+
function snapshotChecks(def) {
|
|
1422
|
+
if (def.checks) def.checks = [...def.checks];
|
|
1423
|
+
return def;
|
|
1424
|
+
}
|
|
1045
1425
|
// @__NO_SIDE_EFFECTS__
|
|
1046
1426
|
function _string(Class, params) {
|
|
1047
|
-
return new Class({
|
|
1427
|
+
return new Class(snapshotChecks({
|
|
1048
1428
|
type: "string",
|
|
1049
1429
|
...normalizeParams(params)
|
|
1050
|
-
});
|
|
1430
|
+
}));
|
|
1051
1431
|
}
|
|
1052
1432
|
// @__NO_SIDE_EFFECTS__
|
|
1053
1433
|
function _number(Class, params) {
|
|
1054
|
-
return new Class({
|
|
1434
|
+
return new Class(snapshotChecks({
|
|
1055
1435
|
type: "number",
|
|
1056
1436
|
checks: [],
|
|
1057
1437
|
...normalizeParams(params)
|
|
1058
|
-
});
|
|
1438
|
+
}));
|
|
1059
1439
|
}
|
|
1060
1440
|
// @__NO_SIDE_EFFECTS__
|
|
1061
1441
|
function _boolean(Class, params) {
|
|
@@ -1108,18 +1488,34 @@ function _custom(Class, fn, _params) {
|
|
|
1108
1488
|
});
|
|
1109
1489
|
}
|
|
1110
1490
|
//#endregion
|
|
1111
|
-
//#region ../../node_modules/.pnpm/zod@4.
|
|
1491
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/mini/schemas.js
|
|
1112
1492
|
const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
|
|
1113
1493
|
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1114
1494
|
$ZodType.init(inst, def);
|
|
1115
1495
|
inst.def = def;
|
|
1116
1496
|
inst.type = def.type;
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1497
|
+
}, {
|
|
1498
|
+
get with() {
|
|
1499
|
+
return this.check;
|
|
1500
|
+
},
|
|
1501
|
+
set with(value) {
|
|
1502
|
+
own(this, "with", value);
|
|
1503
|
+
},
|
|
1504
|
+
parse(data, params) {
|
|
1505
|
+
return parse(this, data, params, { callee: this.parse });
|
|
1506
|
+
},
|
|
1507
|
+
parseAsync(data, params) {
|
|
1508
|
+
return parseAsync(this, data, params, { callee: this.parseAsync });
|
|
1509
|
+
},
|
|
1510
|
+
safeParse(data, params) {
|
|
1511
|
+
return safeParse(this, data, params);
|
|
1512
|
+
},
|
|
1513
|
+
safeParseAsync(data, params) {
|
|
1514
|
+
return safeParseAsync(this, data, params);
|
|
1515
|
+
},
|
|
1516
|
+
check(...checks) {
|
|
1517
|
+
const def = this.def;
|
|
1518
|
+
return this.clone({
|
|
1123
1519
|
...def,
|
|
1124
1520
|
checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
1125
1521
|
check: ch,
|
|
@@ -1127,15 +1523,20 @@ const ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
|
|
|
1127
1523
|
onattach: []
|
|
1128
1524
|
} } : ch)]
|
|
1129
1525
|
}, { parent: true });
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1526
|
+
},
|
|
1527
|
+
clone(_def, params) {
|
|
1528
|
+
return clone(this, _def, params);
|
|
1529
|
+
},
|
|
1530
|
+
brand() {
|
|
1531
|
+
return this;
|
|
1532
|
+
},
|
|
1533
|
+
register(reg, meta) {
|
|
1534
|
+
reg.add(this, meta);
|
|
1535
|
+
return this;
|
|
1536
|
+
},
|
|
1537
|
+
apply(fn, ...args) {
|
|
1538
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
1539
|
+
}
|
|
1139
1540
|
});
|
|
1140
1541
|
const ZodMiniString = /*@__PURE__*/ $constructor("ZodMiniString", (inst, def) => {
|
|
1141
1542
|
$ZodString.init(inst, def);
|
|
@@ -1200,7 +1601,7 @@ function array(element, params) {
|
|
|
1200
1601
|
const ZodMiniObject = /*@__PURE__*/ $constructor("ZodMiniObject", (inst, def) => {
|
|
1201
1602
|
$ZodObject.init(inst, def);
|
|
1202
1603
|
ZodMiniType.init(inst, def);
|
|
1203
|
-
|
|
1604
|
+
installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
1204
1605
|
});
|
|
1205
1606
|
// @__NO_SIDE_EFFECTS__
|
|
1206
1607
|
function object(shape, params) {
|
|
@@ -1229,6 +1630,12 @@ const ZodMiniRecord = /*@__PURE__*/ $constructor("ZodMiniRecord", (inst, def) =>
|
|
|
1229
1630
|
});
|
|
1230
1631
|
// @__NO_SIDE_EFFECTS__
|
|
1231
1632
|
function record(keyType, valueType, params) {
|
|
1633
|
+
if (!valueType || !valueType._zod) return new ZodMiniRecord({
|
|
1634
|
+
type: "record",
|
|
1635
|
+
keyType: /* @__PURE__ */ string(),
|
|
1636
|
+
valueType: keyType,
|
|
1637
|
+
...normalizeParams(valueType)
|
|
1638
|
+
});
|
|
1232
1639
|
return new ZodMiniRecord({
|
|
1233
1640
|
type: "record",
|
|
1234
1641
|
keyType,
|
|
@@ -1239,7 +1646,7 @@ function record(keyType, valueType, params) {
|
|
|
1239
1646
|
const ZodMiniEnum = /*@__PURE__*/ $constructor("ZodMiniEnum", (inst, def) => {
|
|
1240
1647
|
$ZodEnum.init(inst, def);
|
|
1241
1648
|
ZodMiniType.init(inst, def);
|
|
1242
|
-
inst.options =
|
|
1649
|
+
inst.options = [...inst._zod.values];
|
|
1243
1650
|
});
|
|
1244
1651
|
// @__NO_SIDE_EFFECTS__
|
|
1245
1652
|
function _enum(values, params) {
|