@hasna/skills 0.10.4 → 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/bin/index.js +2279 -1385
- package/bin/mcp.js +1893 -1116
- package/bin/migrate.js +1 -1
- package/bin/server.js +176 -1163
- package/bin/worker.js +92 -1079
- package/dist/cli/commands/registry.d.ts +2 -0
- package/dist/index.js +1456 -669
- package/dist/lib/review-export.d.ts +16 -0
- package/dist/sdk/index.js +1617 -1817
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -622,36 +622,38 @@ var require_Alias = __commonJS((exports) => {
|
|
|
622
622
|
if (node.anchor === this.source)
|
|
623
623
|
found = node;
|
|
624
624
|
}
|
|
625
|
+
if (found && ctx) {
|
|
626
|
+
const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
|
|
627
|
+
let data = anchors2.get(found);
|
|
628
|
+
if (!data) {
|
|
629
|
+
toJS.toJS(found, null, ctx);
|
|
630
|
+
data = anchors2.get(found);
|
|
631
|
+
}
|
|
632
|
+
if (data?.res === undefined) {
|
|
633
|
+
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
634
|
+
throw new ReferenceError(msg);
|
|
635
|
+
}
|
|
636
|
+
if (maxAliasCount >= 0) {
|
|
637
|
+
data.count += 1;
|
|
638
|
+
if (data.aliasCount === 0)
|
|
639
|
+
data.aliasCount = getAliasCount(doc2, found, anchors2);
|
|
640
|
+
if (data.count * data.aliasCount > maxAliasCount) {
|
|
641
|
+
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
642
|
+
throw new ReferenceError(msg);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
625
646
|
return found;
|
|
626
647
|
}
|
|
627
648
|
toJSON(_arg, ctx) {
|
|
628
649
|
if (!ctx)
|
|
629
650
|
return { source: this.source };
|
|
630
|
-
const
|
|
631
|
-
const source = this.resolve(doc, ctx);
|
|
651
|
+
const source = this.resolve(ctx.doc, ctx);
|
|
632
652
|
if (!source) {
|
|
633
653
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
634
654
|
throw new ReferenceError(msg);
|
|
635
655
|
}
|
|
636
|
-
|
|
637
|
-
if (!data) {
|
|
638
|
-
toJS.toJS(source, null, ctx);
|
|
639
|
-
data = anchors2.get(source);
|
|
640
|
-
}
|
|
641
|
-
if (data?.res === undefined) {
|
|
642
|
-
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
643
|
-
throw new ReferenceError(msg);
|
|
644
|
-
}
|
|
645
|
-
if (maxAliasCount >= 0) {
|
|
646
|
-
data.count += 1;
|
|
647
|
-
if (data.aliasCount === 0)
|
|
648
|
-
data.aliasCount = getAliasCount(doc, source, anchors2);
|
|
649
|
-
if (data.count * data.aliasCount > maxAliasCount) {
|
|
650
|
-
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
651
|
-
throw new ReferenceError(msg);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
return data.res;
|
|
656
|
+
return ctx.anchors.get(source).res;
|
|
655
657
|
}
|
|
656
658
|
toString(ctx, _onComment, _onChompKeep) {
|
|
657
659
|
const src = `*${this.source}`;
|
|
@@ -4413,33 +4415,32 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4413
4415
|
}
|
|
4414
4416
|
if (badChar)
|
|
4415
4417
|
onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
|
|
4416
|
-
return
|
|
4418
|
+
return unfoldLines(source);
|
|
4417
4419
|
}
|
|
4418
4420
|
function singleQuotedValue(source, onError) {
|
|
4419
4421
|
if (source[source.length - 1] !== "'" || source.length === 1)
|
|
4420
4422
|
onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
|
|
4421
|
-
return
|
|
4423
|
+
return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
|
|
4422
4424
|
}
|
|
4423
|
-
function
|
|
4424
|
-
|
|
4425
|
+
function unfoldLines(source) {
|
|
4426
|
+
const line = /(.*?)\r?\n/sy;
|
|
4427
|
+
let match = line.exec(source);
|
|
4428
|
+
if (!match)
|
|
4429
|
+
return source;
|
|
4430
|
+
let trimEnd, trimBoth;
|
|
4425
4431
|
try {
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
line = new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
4429
|
-
`, "sy");
|
|
4432
|
+
trimEnd = new RegExp("(?<![ \t])[ \t]+$");
|
|
4433
|
+
trimBoth = new RegExp("^[ \t]+|(?<![ \t])[ \t]+$", "g");
|
|
4430
4434
|
} catch {
|
|
4431
|
-
|
|
4432
|
-
|
|
4435
|
+
trimEnd = /[ \t]+$/;
|
|
4436
|
+
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
4433
4437
|
}
|
|
4434
|
-
let
|
|
4435
|
-
if (!match)
|
|
4436
|
-
return source;
|
|
4437
|
-
let res = match[1];
|
|
4438
|
+
let res = match[1].replace(trimEnd, "");
|
|
4438
4439
|
let sep2 = " ";
|
|
4439
|
-
let pos =
|
|
4440
|
-
line.lastIndex = pos;
|
|
4440
|
+
let pos = line.lastIndex;
|
|
4441
4441
|
while (match = line.exec(source)) {
|
|
4442
|
-
|
|
4442
|
+
const lm = match[1].replace(trimBoth, "");
|
|
4443
|
+
if (lm === "") {
|
|
4443
4444
|
if (sep2 === `
|
|
4444
4445
|
`)
|
|
4445
4446
|
res += sep2;
|
|
@@ -4447,7 +4448,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4447
4448
|
sep2 = `
|
|
4448
4449
|
`;
|
|
4449
4450
|
} else {
|
|
4450
|
-
res += sep2 +
|
|
4451
|
+
res += sep2 + lm;
|
|
4451
4452
|
sep2 = " ";
|
|
4452
4453
|
}
|
|
4453
4454
|
pos = line.lastIndex;
|
|
@@ -9611,7 +9612,7 @@ import { isAbsolute as isAbsolute11, join as join23, resolve as resolve11 } from
|
|
|
9611
9612
|
// package.json
|
|
9612
9613
|
var package_default = {
|
|
9613
9614
|
name: "@hasna/skills",
|
|
9614
|
-
version: "0.10.
|
|
9615
|
+
version: "0.10.6",
|
|
9615
9616
|
description: "Skills library for AI coding agents",
|
|
9616
9617
|
type: "module",
|
|
9617
9618
|
bin: {
|
|
@@ -14133,6 +14134,9 @@ function assertManagedAgentBridge(agent, options = {}) {
|
|
|
14133
14134
|
return false;
|
|
14134
14135
|
if (entry.path.startsWith(canonicalAgentPath(join16(home, ".codex", "plugins", "cache"), aliases) + sep4))
|
|
14135
14136
|
return true;
|
|
14137
|
+
const runtimeCache = canonicalAgentPath(join16(home, ".cache", "codex-runtimes"), aliases);
|
|
14138
|
+
if (entry.path.startsWith(runtimeCache + sep4) && discovery?.method === "automatic" && discovery.roots.some((root) => entry.path.startsWith(root + sep4)))
|
|
14139
|
+
return true;
|
|
14136
14140
|
if (!entry.path.startsWith(canonicalAgentPath(join16(home, ".codex", "skills", ".system"), aliases) + sep4))
|
|
14137
14141
|
return false;
|
|
14138
14142
|
return Array.isArray(binding.disabledBuiltins) && binding.disabledBuiltins.some((item) => item.path === entry.path && item.hash === entry.hash);
|
|
@@ -16864,6 +16868,7 @@ function captureDiscoveryPathSources(paths) {
|
|
|
16864
16868
|
return paths.map((path) => ({ path, hashMode: "path-bytes", sha256: hashDiscoveryPathFile(path, budget) }));
|
|
16865
16869
|
}
|
|
16866
16870
|
function assertProjectDiscovery(agent, directories, home, canonical4 = resolve14, reviewed) {
|
|
16871
|
+
const homeConfigPath = canonical4(agentDiscoveryConfigPath(home, agent));
|
|
16867
16872
|
for (const directory of directories) {
|
|
16868
16873
|
const isHome = resolve14(directory) === resolve14(home);
|
|
16869
16874
|
if (agent === "hermes") {
|
|
@@ -16877,7 +16882,8 @@ function assertProjectDiscovery(agent, directories, home, canonical4 = resolve14
|
|
|
16877
16882
|
const path = canonical4(join26(directory, suffix)), raw = read2(path);
|
|
16878
16883
|
if (raw === null)
|
|
16879
16884
|
continue;
|
|
16880
|
-
|
|
16885
|
+
const isRootAliasedHomeConfig = agent === "claude" && suffix === ".claude/settings.json" || agent === "codex" && suffix === ".codex/config.toml";
|
|
16886
|
+
if (isRootAliasedHomeConfig && path === homeConfigPath)
|
|
16881
16887
|
continue;
|
|
16882
16888
|
if (suffix.endsWith(".jsonc"))
|
|
16883
16889
|
throw new Error(`NATIVE_SKILL_DRIFT: project JSONC discovery configuration requires review: ${path}`);
|
|
@@ -18153,6 +18159,7 @@ var exports_external = {};
|
|
|
18153
18159
|
__export(exports_external, {
|
|
18154
18160
|
xor: () => xor,
|
|
18155
18161
|
xid: () => xid2,
|
|
18162
|
+
withParser: () => withParser,
|
|
18156
18163
|
void: () => _void2,
|
|
18157
18164
|
validateAsync: () => validateAsync,
|
|
18158
18165
|
validate: () => validate,
|
|
@@ -18264,6 +18271,7 @@ __export(exports_external, {
|
|
|
18264
18271
|
instanceof: () => _instanceof,
|
|
18265
18272
|
input: () => input,
|
|
18266
18273
|
includes: () => _includes,
|
|
18274
|
+
iban: () => iban2,
|
|
18267
18275
|
httpUrl: () => httpUrl,
|
|
18268
18276
|
hostname: () => hostname3,
|
|
18269
18277
|
hex: () => hex2,
|
|
@@ -18296,6 +18304,7 @@ __export(exports_external, {
|
|
|
18296
18304
|
decode: () => decode2,
|
|
18297
18305
|
date: () => date2,
|
|
18298
18306
|
custom: () => custom,
|
|
18307
|
+
currencyCode: () => currencyCode2,
|
|
18299
18308
|
cuid2: () => cuid22,
|
|
18300
18309
|
cuid: () => cuid3,
|
|
18301
18310
|
creditCard: () => creditCard2,
|
|
@@ -18361,12 +18370,14 @@ __export(exports_external, {
|
|
|
18361
18370
|
ZodJWT: () => ZodJWT,
|
|
18362
18371
|
ZodIssueCode: () => ZodIssueCode,
|
|
18363
18372
|
ZodIntersection: () => ZodIntersection,
|
|
18373
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
18364
18374
|
ZodISOTime: () => ZodISOTime,
|
|
18365
18375
|
ZodISODuration: () => ZodISODuration,
|
|
18366
18376
|
ZodISODateTime: () => ZodISODateTime,
|
|
18367
18377
|
ZodISODate: () => ZodISODate,
|
|
18368
18378
|
ZodIPv6: () => ZodIPv6,
|
|
18369
18379
|
ZodIPv4: () => ZodIPv4,
|
|
18380
|
+
ZodIBAN: () => ZodIBAN,
|
|
18370
18381
|
ZodGUID: () => ZodGUID,
|
|
18371
18382
|
ZodFunction: () => ZodFunction,
|
|
18372
18383
|
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
@@ -18400,6 +18411,7 @@ __export(exports_external, {
|
|
|
18400
18411
|
ZodAny: () => ZodAny,
|
|
18401
18412
|
TimePrecision: () => TimePrecision,
|
|
18402
18413
|
NEVER: () => NEVER,
|
|
18414
|
+
INVALID: () => INVALID,
|
|
18403
18415
|
$output: () => $output,
|
|
18404
18416
|
$input: () => $input,
|
|
18405
18417
|
$brand: () => $brand
|
|
@@ -18408,7 +18420,9 @@ __export(exports_external, {
|
|
|
18408
18420
|
// node_modules/zod/v4/core/index.js
|
|
18409
18421
|
var exports_core2 = {};
|
|
18410
18422
|
__export(exports_core2, {
|
|
18423
|
+
withParser: () => withParser,
|
|
18411
18424
|
version: () => version,
|
|
18425
|
+
validateURL: () => validateURL,
|
|
18412
18426
|
validateAsync: () => validateAsync,
|
|
18413
18427
|
validate: () => validate,
|
|
18414
18428
|
util: () => exports_util,
|
|
@@ -18428,7 +18442,8 @@ __export(exports_core2, {
|
|
|
18428
18442
|
safeDecode: () => safeDecode,
|
|
18429
18443
|
registry: () => registry,
|
|
18430
18444
|
regexes: () => exports_regexes,
|
|
18431
|
-
|
|
18445
|
+
processSchema: () => processSchema,
|
|
18446
|
+
process: () => processSchema,
|
|
18432
18447
|
prettifyError: () => prettifyError,
|
|
18433
18448
|
parseURLObject: () => parseURLObject,
|
|
18434
18449
|
parseAsync: () => parseAsync,
|
|
@@ -18439,6 +18454,7 @@ __export(exports_core2, {
|
|
|
18439
18454
|
locales: () => exports_locales,
|
|
18440
18455
|
isValidJWT: () => isValidJWT,
|
|
18441
18456
|
isValidIPv6: () => isValidIPv6,
|
|
18457
|
+
isValidIBAN: () => isValidIBAN,
|
|
18442
18458
|
isValidCreditCard: () => isValidCreditCard,
|
|
18443
18459
|
isValidCIDRv6: () => isValidCIDRv6,
|
|
18444
18460
|
isValidBase64URL: () => isValidBase64URL,
|
|
@@ -18465,6 +18481,9 @@ __export(exports_core2, {
|
|
|
18465
18481
|
compileFn: () => compileFn,
|
|
18466
18482
|
compile: () => compile,
|
|
18467
18483
|
clone: () => clone,
|
|
18484
|
+
canParseURL: () => canParseURL,
|
|
18485
|
+
base64urlCharset: () => base64urlCharset,
|
|
18486
|
+
base64Charset: () => base64Charset,
|
|
18468
18487
|
_xor: () => _xor,
|
|
18469
18488
|
_xid: () => _xid,
|
|
18470
18489
|
_void: () => _void,
|
|
@@ -18556,6 +18575,7 @@ __export(exports_core2, {
|
|
|
18556
18575
|
_int32: () => _int32,
|
|
18557
18576
|
_int: () => _int,
|
|
18558
18577
|
_includes: () => _includes,
|
|
18578
|
+
_iban: () => _iban,
|
|
18559
18579
|
_guid: () => _guid,
|
|
18560
18580
|
_gte: () => _gte,
|
|
18561
18581
|
_gt: () => _gt,
|
|
@@ -18657,6 +18677,7 @@ __export(exports_core2, {
|
|
|
18657
18677
|
$ZodISODate: () => $ZodISODate,
|
|
18658
18678
|
$ZodIPv6: () => $ZodIPv6,
|
|
18659
18679
|
$ZodIPv4: () => $ZodIPv4,
|
|
18680
|
+
$ZodIBAN: () => $ZodIBAN,
|
|
18660
18681
|
$ZodGUID: () => $ZodGUID,
|
|
18661
18682
|
$ZodFunction: () => $ZodFunction,
|
|
18662
18683
|
$ZodFile: () => $ZodFile,
|
|
@@ -18681,6 +18702,7 @@ __export(exports_core2, {
|
|
|
18681
18702
|
$ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
|
|
18682
18703
|
$ZodCheckRegex: () => $ZodCheckRegex,
|
|
18683
18704
|
$ZodCheckProperty: () => $ZodCheckProperty,
|
|
18705
|
+
$ZodCheckProperties: () => $ZodCheckProperties,
|
|
18684
18706
|
$ZodCheckOverwrite: () => $ZodCheckOverwrite,
|
|
18685
18707
|
$ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
|
|
18686
18708
|
$ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
|
|
@@ -18725,6 +18747,7 @@ __export(exports_util, {
|
|
|
18725
18747
|
shallowClone: () => shallowClone,
|
|
18726
18748
|
safeExtend: () => safeExtend,
|
|
18727
18749
|
required: () => required,
|
|
18750
|
+
rawShape: () => rawShape,
|
|
18728
18751
|
randomString: () => randomString,
|
|
18729
18752
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
18730
18753
|
promiseAllObject: () => promiseAllObject,
|
|
@@ -18762,6 +18785,7 @@ __export(exports_util, {
|
|
|
18762
18785
|
explicitlyAborted: () => explicitlyAborted,
|
|
18763
18786
|
escapeRegex: () => escapeRegex,
|
|
18764
18787
|
esc: () => esc,
|
|
18788
|
+
derived: () => derived,
|
|
18765
18789
|
defineLazyInternal: () => defineLazyInternal,
|
|
18766
18790
|
defineLazy: () => defineLazy,
|
|
18767
18791
|
createTransparentProxy: () => createTransparentProxy,
|
|
@@ -18816,18 +18840,23 @@ function jsonStringifyReplacer(_, value) {
|
|
|
18816
18840
|
return value.toString();
|
|
18817
18841
|
return value;
|
|
18818
18842
|
}
|
|
18819
|
-
|
|
18820
|
-
|
|
18821
|
-
|
|
18822
|
-
|
|
18823
|
-
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
|
|
18828
|
-
|
|
18843
|
+
|
|
18844
|
+
class Cached {
|
|
18845
|
+
constructor(getter) {
|
|
18846
|
+
this._getter = getter;
|
|
18847
|
+
this._value = undefined;
|
|
18848
|
+
}
|
|
18849
|
+
get value() {
|
|
18850
|
+
const getter = this._getter;
|
|
18851
|
+
if (getter !== undefined) {
|
|
18852
|
+
this._value = getter();
|
|
18853
|
+
this._getter = undefined;
|
|
18829
18854
|
}
|
|
18830
|
-
|
|
18855
|
+
return this._value;
|
|
18856
|
+
}
|
|
18857
|
+
}
|
|
18858
|
+
function cached(getter) {
|
|
18859
|
+
return new Cached(getter);
|
|
18831
18860
|
}
|
|
18832
18861
|
function nullish(input) {
|
|
18833
18862
|
return input === null || input === undefined;
|
|
@@ -18878,6 +18907,56 @@ function assignProp(target, prop, value) {
|
|
|
18878
18907
|
configurable: true
|
|
18879
18908
|
});
|
|
18880
18909
|
}
|
|
18910
|
+
function rawShape(def) {
|
|
18911
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
18912
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
18913
|
+
}
|
|
18914
|
+
function sourceShape(schema) {
|
|
18915
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
18916
|
+
}
|
|
18917
|
+
function deferProp(target, key, getter) {
|
|
18918
|
+
Object.defineProperty(target, key, {
|
|
18919
|
+
get() {
|
|
18920
|
+
const value = getter();
|
|
18921
|
+
assignProp(this, key, value);
|
|
18922
|
+
return value;
|
|
18923
|
+
},
|
|
18924
|
+
enumerable: true,
|
|
18925
|
+
configurable: true
|
|
18926
|
+
});
|
|
18927
|
+
}
|
|
18928
|
+
function putProp(target, key, value) {
|
|
18929
|
+
if (key in target)
|
|
18930
|
+
assignProp(target, key, value);
|
|
18931
|
+
else
|
|
18932
|
+
target[key] = value;
|
|
18933
|
+
}
|
|
18934
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
18935
|
+
const raw = sourceShape(source);
|
|
18936
|
+
for (const key of keys) {
|
|
18937
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
18938
|
+
if (!desc.enumerable)
|
|
18939
|
+
continue;
|
|
18940
|
+
if (desc.get) {
|
|
18941
|
+
deferProp(target, key, () => {
|
|
18942
|
+
const value = source._zod.def.shape[key];
|
|
18943
|
+
return wrap ? wrap(value, key) : value;
|
|
18944
|
+
});
|
|
18945
|
+
} else
|
|
18946
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
18947
|
+
}
|
|
18948
|
+
}
|
|
18949
|
+
function mirrorProps(target, source) {
|
|
18950
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
18951
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
18952
|
+
if (!desc.enumerable)
|
|
18953
|
+
continue;
|
|
18954
|
+
if (desc.get)
|
|
18955
|
+
deferProp(target, key, () => source[key]);
|
|
18956
|
+
else
|
|
18957
|
+
putProp(target, key, desc.value);
|
|
18958
|
+
}
|
|
18959
|
+
}
|
|
18881
18960
|
function mergeDefs(...defs) {
|
|
18882
18961
|
const mergedDescriptors = {};
|
|
18883
18962
|
for (const def of defs) {
|
|
@@ -19115,23 +19194,21 @@ function pick(schema, mask) {
|
|
|
19115
19194
|
if (hasChecks) {
|
|
19116
19195
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
19117
19196
|
}
|
|
19118
|
-
const
|
|
19119
|
-
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19130
|
-
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
});
|
|
19134
|
-
return clone(schema, def);
|
|
19197
|
+
const newShape = {};
|
|
19198
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
19199
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
19200
|
+
}
|
|
19201
|
+
function maskedKeys(schema, mask) {
|
|
19202
|
+
const raw = sourceShape(schema);
|
|
19203
|
+
const keys = [];
|
|
19204
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
19205
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
19206
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
19207
|
+
}
|
|
19208
|
+
if (mask[key])
|
|
19209
|
+
keys.push(key);
|
|
19210
|
+
}
|
|
19211
|
+
return keys;
|
|
19135
19212
|
}
|
|
19136
19213
|
function omit(schema, mask) {
|
|
19137
19214
|
const currDef = schema._zod.def;
|
|
@@ -19140,23 +19217,10 @@ function omit(schema, mask) {
|
|
|
19140
19217
|
if (hasChecks) {
|
|
19141
19218
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
19142
19219
|
}
|
|
19143
|
-
const
|
|
19144
|
-
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
19148
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
19149
|
-
}
|
|
19150
|
-
if (!mask[key])
|
|
19151
|
-
continue;
|
|
19152
|
-
delete newShape[key];
|
|
19153
|
-
}
|
|
19154
|
-
assignProp(this, "shape", newShape);
|
|
19155
|
-
return newShape;
|
|
19156
|
-
},
|
|
19157
|
-
checks: []
|
|
19158
|
-
});
|
|
19159
|
-
return clone(schema, def);
|
|
19220
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
19221
|
+
const newShape = {};
|
|
19222
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
19223
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
19160
19224
|
}
|
|
19161
19225
|
function extend(schema, shape) {
|
|
19162
19226
|
if (!isPlainObject(shape)) {
|
|
@@ -19165,34 +19229,26 @@ function extend(schema, shape) {
|
|
|
19165
19229
|
const checks = schema._zod.def.checks;
|
|
19166
19230
|
const hasChecks = checks && checks.length > 0;
|
|
19167
19231
|
if (hasChecks) {
|
|
19168
|
-
const existingShape = schema
|
|
19232
|
+
const existingShape = sourceShape(schema);
|
|
19169
19233
|
for (const key of Reflect.ownKeys(shape)) {
|
|
19170
19234
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
|
|
19171
19235
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
19172
19236
|
}
|
|
19173
19237
|
}
|
|
19174
19238
|
}
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
return clone(schema, def);
|
|
19239
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
19240
|
+
}
|
|
19241
|
+
function extended(schema, shape) {
|
|
19242
|
+
const newShape = {};
|
|
19243
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
19244
|
+
mirrorProps(newShape, shape);
|
|
19245
|
+
return newShape;
|
|
19183
19246
|
}
|
|
19184
19247
|
function safeExtend(schema, shape) {
|
|
19185
19248
|
if (!isPlainObject(shape)) {
|
|
19186
19249
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
19187
19250
|
}
|
|
19188
|
-
|
|
19189
|
-
get shape() {
|
|
19190
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
19191
|
-
assignProp(this, "shape", _shape);
|
|
19192
|
-
return _shape;
|
|
19193
|
-
}
|
|
19194
|
-
});
|
|
19195
|
-
return clone(schema, def);
|
|
19251
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
19196
19252
|
}
|
|
19197
19253
|
function merge(a, b) {
|
|
19198
19254
|
if (!b?._zod?.def) {
|
|
@@ -19201,12 +19257,11 @@ function merge(a, b) {
|
|
|
19201
19257
|
if (a._zod.def.checks?.length) {
|
|
19202
19258
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
19203
19259
|
}
|
|
19260
|
+
const newShape = {};
|
|
19261
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
19262
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
19204
19263
|
const def = mergeDefs(a._zod.def, {
|
|
19205
|
-
|
|
19206
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
19207
|
-
assignProp(this, "shape", _shape);
|
|
19208
|
-
return _shape;
|
|
19209
|
-
},
|
|
19264
|
+
shape: newShape,
|
|
19210
19265
|
get catchall() {
|
|
19211
19266
|
return b._zod.def.catchall;
|
|
19212
19267
|
},
|
|
@@ -19221,67 +19276,16 @@ function partial(Class, schema, mask, name = "partial") {
|
|
|
19221
19276
|
if (hasChecks) {
|
|
19222
19277
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
19223
19278
|
}
|
|
19224
|
-
const
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
if (mask) {
|
|
19229
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
19230
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
19231
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
19232
|
-
}
|
|
19233
|
-
if (!mask[key])
|
|
19234
|
-
continue;
|
|
19235
|
-
shape[key] = Class ? new Class({
|
|
19236
|
-
type: "optional",
|
|
19237
|
-
innerType: oldShape[key]
|
|
19238
|
-
}) : oldShape[key];
|
|
19239
|
-
}
|
|
19240
|
-
} else {
|
|
19241
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
19242
|
-
shape[key] = Class ? new Class({
|
|
19243
|
-
type: "optional",
|
|
19244
|
-
innerType: oldShape[key]
|
|
19245
|
-
}) : oldShape[key];
|
|
19246
|
-
}
|
|
19247
|
-
}
|
|
19248
|
-
assignProp(this, "shape", shape);
|
|
19249
|
-
return shape;
|
|
19250
|
-
},
|
|
19251
|
-
checks: []
|
|
19252
|
-
});
|
|
19253
|
-
return clone(schema, def);
|
|
19279
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
19280
|
+
const newShape = {};
|
|
19281
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
|
|
19282
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
19254
19283
|
}
|
|
19255
19284
|
function required(Class, schema, mask) {
|
|
19256
|
-
const
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
if (mask) {
|
|
19261
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
19262
|
-
if (!Object.prototype.hasOwnProperty.call(shape, key)) {
|
|
19263
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
19264
|
-
}
|
|
19265
|
-
if (!mask[key])
|
|
19266
|
-
continue;
|
|
19267
|
-
shape[key] = new Class({
|
|
19268
|
-
type: "nonoptional",
|
|
19269
|
-
innerType: oldShape[key]
|
|
19270
|
-
});
|
|
19271
|
-
}
|
|
19272
|
-
} else {
|
|
19273
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
19274
|
-
shape[key] = new Class({
|
|
19275
|
-
type: "nonoptional",
|
|
19276
|
-
innerType: oldShape[key]
|
|
19277
|
-
});
|
|
19278
|
-
}
|
|
19279
|
-
}
|
|
19280
|
-
assignProp(this, "shape", shape);
|
|
19281
|
-
return shape;
|
|
19282
|
-
}
|
|
19283
|
-
});
|
|
19284
|
-
return clone(schema, def);
|
|
19285
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
19286
|
+
const newShape = {};
|
|
19287
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
|
|
19288
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
19285
19289
|
}
|
|
19286
19290
|
function aborted(x, startIndex = 0) {
|
|
19287
19291
|
if (x.aborted === true)
|
|
@@ -19331,13 +19335,18 @@ function finalizeIssue(iss, ctx, config) {
|
|
|
19331
19335
|
}
|
|
19332
19336
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
|
|
19333
19337
|
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";
|
|
19334
|
-
const
|
|
19335
|
-
|
|
19336
|
-
|
|
19338
|
+
const full = {};
|
|
19339
|
+
for (const k of Object.keys(iss)) {
|
|
19340
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
19341
|
+
continue;
|
|
19342
|
+
full[k] = iss[k];
|
|
19343
|
+
}
|
|
19344
|
+
full.path ?? (full.path = []);
|
|
19345
|
+
full.message = message;
|
|
19337
19346
|
if (ctx?.reportInput) {
|
|
19338
|
-
|
|
19347
|
+
full.input = iss.input;
|
|
19339
19348
|
}
|
|
19340
|
-
return
|
|
19349
|
+
return full;
|
|
19341
19350
|
}
|
|
19342
19351
|
function getSizableOrigin(input) {
|
|
19343
19352
|
if (input instanceof Set)
|
|
@@ -19464,6 +19473,22 @@ function own(inst, key, value, enumerable = true) {
|
|
|
19464
19473
|
function hide(inst, key, value) {
|
|
19465
19474
|
return own(inst, key, value, false);
|
|
19466
19475
|
}
|
|
19476
|
+
function derived(computes, table) {
|
|
19477
|
+
for (const key in computes) {
|
|
19478
|
+
const compute = computes[key];
|
|
19479
|
+
Object.defineProperty(table, key, {
|
|
19480
|
+
configurable: true,
|
|
19481
|
+
enumerable: true,
|
|
19482
|
+
get() {
|
|
19483
|
+
return own(this, key, compute(this));
|
|
19484
|
+
},
|
|
19485
|
+
set(value) {
|
|
19486
|
+
own(this, key, value);
|
|
19487
|
+
}
|
|
19488
|
+
});
|
|
19489
|
+
}
|
|
19490
|
+
return table;
|
|
19491
|
+
}
|
|
19467
19492
|
function defineBound(proto, key, fn) {
|
|
19468
19493
|
Object.defineProperty(proto, key, {
|
|
19469
19494
|
configurable: true,
|
|
@@ -19590,8 +19615,7 @@ function $constructor(name, initializer, proto, params) {
|
|
|
19590
19615
|
} finally {
|
|
19591
19616
|
_zodDesc.value = undefined;
|
|
19592
19617
|
}
|
|
19593
|
-
}
|
|
19594
|
-
if (inst._zod.traits.has(name)) {
|
|
19618
|
+
} else if (inst._zod.traits.has(name)) {
|
|
19595
19619
|
return;
|
|
19596
19620
|
}
|
|
19597
19621
|
inst._zod.traits.add(name);
|
|
@@ -19684,16 +19708,12 @@ var _messageDesc = {
|
|
|
19684
19708
|
enumerable: true,
|
|
19685
19709
|
configurable: true
|
|
19686
19710
|
};
|
|
19687
|
-
var _zodDesc2 = { value: undefined, enumerable: false };
|
|
19688
19711
|
var _issuesDesc = { value: undefined, enumerable: false };
|
|
19689
19712
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
19690
19713
|
var initializer = (inst, def) => {
|
|
19691
19714
|
inst.name = "$ZodError";
|
|
19692
|
-
_zodDesc2.value = inst._zod;
|
|
19693
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
19694
19715
|
_issuesDesc.value = def;
|
|
19695
19716
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
19696
|
-
_zodDesc2.value = undefined;
|
|
19697
19717
|
_issuesDesc.value = undefined;
|
|
19698
19718
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
19699
19719
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -19909,33 +19929,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
19909
19929
|
if (result instanceof Promise) {
|
|
19910
19930
|
throw new $ZodAsyncError;
|
|
19911
19931
|
}
|
|
19912
|
-
return result.issues.length ? {
|
|
19913
|
-
success: false,
|
|
19914
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
19915
|
-
} : { success: true, data: result.value };
|
|
19932
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
19916
19933
|
};
|
|
19917
19934
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
19935
|
+
function failure(Err, issues, ctx) {
|
|
19936
|
+
let error;
|
|
19937
|
+
return {
|
|
19938
|
+
success: false,
|
|
19939
|
+
get error() {
|
|
19940
|
+
if (!error) {
|
|
19941
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
19942
|
+
issues = undefined;
|
|
19943
|
+
ctx = undefined;
|
|
19944
|
+
}
|
|
19945
|
+
return error;
|
|
19946
|
+
},
|
|
19947
|
+
set error(e2) {
|
|
19948
|
+
error = e2;
|
|
19949
|
+
issues = undefined;
|
|
19950
|
+
ctx = undefined;
|
|
19951
|
+
}
|
|
19952
|
+
};
|
|
19953
|
+
}
|
|
19918
19954
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
19919
19955
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
19920
19956
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
19921
19957
|
if (result instanceof Promise)
|
|
19922
19958
|
result = await result;
|
|
19923
|
-
return result.issues.length ? {
|
|
19924
|
-
success: false,
|
|
19925
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
19926
|
-
} : { success: true, data: result.value };
|
|
19959
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
19927
19960
|
};
|
|
19928
19961
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
19929
19962
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
19930
19963
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
19931
19964
|
var validate = (schema, value, _ctx) => {
|
|
19932
19965
|
const validator = schema._zod.bag.validator;
|
|
19933
|
-
if (validator !== undefined
|
|
19934
|
-
|
|
19966
|
+
if (validator !== undefined) {
|
|
19967
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
19968
|
+
return true;
|
|
19969
|
+
if (validator.definite === true && _ctx === undefined)
|
|
19970
|
+
return false;
|
|
19971
|
+
}
|
|
19935
19972
|
return validateFallback(schema, value, _ctx);
|
|
19936
19973
|
};
|
|
19937
19974
|
function validateFallback(schema, value, _ctx) {
|
|
19938
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
19975
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
19939
19976
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
19940
19977
|
let result;
|
|
19941
19978
|
if (fallbackRun) {
|
|
@@ -19950,7 +19987,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
19950
19987
|
return result.issues.length === 0;
|
|
19951
19988
|
}
|
|
19952
19989
|
var validateAsync = async (schema, value, _ctx) => {
|
|
19953
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
19990
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
19954
19991
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
19955
19992
|
if (result instanceof Promise)
|
|
19956
19993
|
result = await result;
|
|
@@ -20049,6 +20086,7 @@ __export(exports_regexes, {
|
|
|
20049
20086
|
ipv4: () => ipv4,
|
|
20050
20087
|
integer: () => integer,
|
|
20051
20088
|
idnEmail: () => idnEmail,
|
|
20089
|
+
iban: () => iban,
|
|
20052
20090
|
httpProtocol: () => httpProtocol,
|
|
20053
20091
|
html5Email: () => html5Email,
|
|
20054
20092
|
hostname: () => hostname2,
|
|
@@ -20062,6 +20100,7 @@ __export(exports_regexes, {
|
|
|
20062
20100
|
domain: () => domain,
|
|
20063
20101
|
datetime: () => datetime,
|
|
20064
20102
|
date: () => date,
|
|
20103
|
+
currencyCode: () => currencyCode,
|
|
20065
20104
|
cuid2: () => cuid2,
|
|
20066
20105
|
cuid: () => cuid,
|
|
20067
20106
|
creditCard: () => creditCard,
|
|
@@ -20071,7 +20110,8 @@ __export(exports_regexes, {
|
|
|
20071
20110
|
boolean: () => boolean,
|
|
20072
20111
|
bigint: () => bigint,
|
|
20073
20112
|
base64url: () => base64url,
|
|
20074
|
-
base64: () => base64
|
|
20113
|
+
base64: () => base64,
|
|
20114
|
+
anyString: () => anyString
|
|
20075
20115
|
});
|
|
20076
20116
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
20077
20117
|
var cuid2 = /^[0-9a-z]+$/;
|
|
@@ -20093,13 +20133,13 @@ var uuid = (version) => {
|
|
|
20093
20133
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
20094
20134
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
20095
20135
|
var uuid7 = /* @__PURE__ */ uuid(7);
|
|
20096
|
-
var email = /^(
|
|
20136
|
+
var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
20097
20137
|
var 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])?)*$/;
|
|
20098
20138
|
var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
20099
20139
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
20100
20140
|
var idnEmail = unicodeEmail;
|
|
20101
20141
|
var 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])?)*$/;
|
|
20102
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
20142
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
20103
20143
|
function emoji() {
|
|
20104
20144
|
return new RegExp(_emoji, "u");
|
|
20105
20145
|
}
|
|
@@ -20112,12 +20152,14 @@ var mac = (delimiter) => {
|
|
|
20112
20152
|
var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
20113
20153
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
20114
20154
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
20115
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
20155
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
20116
20156
|
var hostname2 = /^(?=.{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])?)*\.?$/;
|
|
20117
20157
|
var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
20118
20158
|
var httpProtocol = /^https?$/;
|
|
20119
20159
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
20120
20160
|
var creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
20161
|
+
var currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
|
|
20162
|
+
var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
20121
20163
|
var 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])))`;
|
|
20122
20164
|
function anchor(source) {
|
|
20123
20165
|
return new RegExp(`^${source}$`);
|
|
@@ -20139,6 +20181,7 @@ function datetime(args) {
|
|
|
20139
20181
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
20140
20182
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
20141
20183
|
}
|
|
20184
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
20142
20185
|
var string = (params) => {
|
|
20143
20186
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
20144
20187
|
return new RegExp(`^${regex}$`);
|
|
@@ -20197,16 +20240,6 @@ var numericOriginMap = {
|
|
|
20197
20240
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
20198
20241
|
$ZodCheck.init(inst, def);
|
|
20199
20242
|
const origin = numericOriginMap[typeof def.value];
|
|
20200
|
-
inst._zod.onattach.push((inst2) => {
|
|
20201
|
-
const bag = inst2._zod.bag;
|
|
20202
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
20203
|
-
if (def.value < curr) {
|
|
20204
|
-
if (def.inclusive)
|
|
20205
|
-
bag.maximum = def.value;
|
|
20206
|
-
else
|
|
20207
|
-
bag.exclusiveMaximum = def.value;
|
|
20208
|
-
}
|
|
20209
|
-
});
|
|
20210
20243
|
inst._zod.check = (payload) => {
|
|
20211
20244
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
20212
20245
|
return;
|
|
@@ -20225,16 +20258,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
20225
20258
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
20226
20259
|
$ZodCheck.init(inst, def);
|
|
20227
20260
|
const origin = numericOriginMap[typeof def.value];
|
|
20228
|
-
inst._zod.onattach.push((inst2) => {
|
|
20229
|
-
const bag = inst2._zod.bag;
|
|
20230
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
20231
|
-
if (def.value > curr) {
|
|
20232
|
-
if (def.inclusive)
|
|
20233
|
-
bag.minimum = def.value;
|
|
20234
|
-
else
|
|
20235
|
-
bag.exclusiveMinimum = def.value;
|
|
20236
|
-
}
|
|
20237
|
-
});
|
|
20238
20261
|
inst._zod.check = (payload) => {
|
|
20239
20262
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
20240
20263
|
return;
|
|
@@ -20252,10 +20275,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
20252
20275
|
});
|
|
20253
20276
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
20254
20277
|
$ZodCheck.init(inst, def);
|
|
20255
|
-
inst._zod.onattach.push((inst2) => {
|
|
20256
|
-
var _a2;
|
|
20257
|
-
(_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
|
|
20258
|
-
});
|
|
20259
20278
|
inst._zod.check = (payload) => {
|
|
20260
20279
|
if (typeof payload.value !== typeof def.value)
|
|
20261
20280
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -20278,14 +20297,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
20278
20297
|
const isInt = def.format?.includes("int");
|
|
20279
20298
|
const origin = isInt ? "int" : "number";
|
|
20280
20299
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
20281
|
-
inst._zod.onattach.push((inst2) => {
|
|
20282
|
-
const bag = inst2._zod.bag;
|
|
20283
|
-
bag.format = def.format;
|
|
20284
|
-
bag.minimum = minimum;
|
|
20285
|
-
bag.maximum = maximum;
|
|
20286
|
-
if (isInt)
|
|
20287
|
-
bag.pattern = integer;
|
|
20288
|
-
});
|
|
20289
20300
|
inst._zod.check = (payload) => {
|
|
20290
20301
|
const input = payload.value;
|
|
20291
20302
|
if (isInt) {
|
|
@@ -20354,12 +20365,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
20354
20365
|
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
20355
20366
|
$ZodCheck.init(inst, def);
|
|
20356
20367
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
20357
|
-
inst._zod.onattach.push((inst2) => {
|
|
20358
|
-
const bag = inst2._zod.bag;
|
|
20359
|
-
bag.format = def.format;
|
|
20360
|
-
bag.minimum = minimum;
|
|
20361
|
-
bag.maximum = maximum;
|
|
20362
|
-
});
|
|
20363
20368
|
inst._zod.check = (payload) => {
|
|
20364
20369
|
const input = payload.value;
|
|
20365
20370
|
if (input < minimum) {
|
|
@@ -20390,11 +20395,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
20390
20395
|
var _a2;
|
|
20391
20396
|
$ZodCheck.init(inst, def);
|
|
20392
20397
|
(_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
|
|
20393
|
-
inst._zod.onattach.push((inst2) => {
|
|
20394
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
20395
|
-
if (def.maximum < curr)
|
|
20396
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
20397
|
-
});
|
|
20398
20398
|
inst._zod.check = (payload) => {
|
|
20399
20399
|
const input = payload.value;
|
|
20400
20400
|
const size = input.size;
|
|
@@ -20415,11 +20415,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
20415
20415
|
var _a2;
|
|
20416
20416
|
$ZodCheck.init(inst, def);
|
|
20417
20417
|
(_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
|
|
20418
|
-
inst._zod.onattach.push((inst2) => {
|
|
20419
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
20420
|
-
if (def.minimum > curr)
|
|
20421
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
20422
|
-
});
|
|
20423
20418
|
inst._zod.check = (payload) => {
|
|
20424
20419
|
const input = payload.value;
|
|
20425
20420
|
const size = input.size;
|
|
@@ -20440,12 +20435,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
20440
20435
|
var _a2;
|
|
20441
20436
|
$ZodCheck.init(inst, def);
|
|
20442
20437
|
(_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
|
|
20443
|
-
inst._zod.onattach.push((inst2) => {
|
|
20444
|
-
const bag = inst2._zod.bag;
|
|
20445
|
-
bag.minimum = def.size;
|
|
20446
|
-
bag.maximum = def.size;
|
|
20447
|
-
bag.size = def.size;
|
|
20448
|
-
});
|
|
20449
20438
|
inst._zod.check = (payload) => {
|
|
20450
20439
|
const input = payload.value;
|
|
20451
20440
|
const size = input.size;
|
|
@@ -20467,11 +20456,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
20467
20456
|
var _a2;
|
|
20468
20457
|
$ZodCheck.init(inst, def);
|
|
20469
20458
|
(_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
|
|
20470
|
-
inst._zod.onattach.push((inst2) => {
|
|
20471
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
20472
|
-
if (def.maximum < curr)
|
|
20473
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
20474
|
-
});
|
|
20475
20459
|
inst._zod.check = (payload) => {
|
|
20476
20460
|
const input = payload.value;
|
|
20477
20461
|
const units = input.length;
|
|
@@ -20494,11 +20478,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
20494
20478
|
var _a2;
|
|
20495
20479
|
$ZodCheck.init(inst, def);
|
|
20496
20480
|
(_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
|
|
20497
|
-
inst._zod.onattach.push((inst2) => {
|
|
20498
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
20499
|
-
if (def.minimum > curr)
|
|
20500
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
20501
|
-
});
|
|
20502
20481
|
inst._zod.check = (payload) => {
|
|
20503
20482
|
const input = payload.value;
|
|
20504
20483
|
const units = input.length;
|
|
@@ -20521,12 +20500,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
20521
20500
|
var _a2;
|
|
20522
20501
|
$ZodCheck.init(inst, def);
|
|
20523
20502
|
(_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
|
|
20524
|
-
inst._zod.onattach.push((inst2) => {
|
|
20525
|
-
const bag = inst2._zod.bag;
|
|
20526
|
-
bag.minimum = def.length;
|
|
20527
|
-
bag.maximum = def.length;
|
|
20528
|
-
bag.length = def.length;
|
|
20529
|
-
});
|
|
20530
20503
|
inst._zod.check = (payload) => {
|
|
20531
20504
|
const input = payload.value;
|
|
20532
20505
|
const units = input.length;
|
|
@@ -20549,14 +20522,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
20549
20522
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
20550
20523
|
var _a2, _b;
|
|
20551
20524
|
$ZodCheck.init(inst, def);
|
|
20552
|
-
inst._zod.onattach.push((inst2) => {
|
|
20553
|
-
const bag = inst2._zod.bag;
|
|
20554
|
-
bag.format = def.format;
|
|
20555
|
-
if (def.pattern) {
|
|
20556
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
20557
|
-
bag.patterns.add(def.pattern);
|
|
20558
|
-
}
|
|
20559
|
-
});
|
|
20560
20525
|
if (def.pattern)
|
|
20561
20526
|
(_a2 = inst._zod).check ?? (_a2.check = (payload) => {
|
|
20562
20527
|
def.pattern.lastIndex = 0;
|
|
@@ -20605,11 +20570,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
20605
20570
|
const escapedRegex = escapeRegex(def.includes);
|
|
20606
20571
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
20607
20572
|
def.pattern = pattern;
|
|
20608
|
-
inst._zod.onattach.push((inst2) => {
|
|
20609
|
-
const bag = inst2._zod.bag;
|
|
20610
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
20611
|
-
bag.patterns.add(pattern);
|
|
20612
|
-
});
|
|
20613
20573
|
inst._zod.check = (payload) => {
|
|
20614
20574
|
if (payload.value.includes(def.includes, def.position))
|
|
20615
20575
|
return;
|
|
@@ -20628,11 +20588,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
20628
20588
|
$ZodCheck.init(inst, def);
|
|
20629
20589
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
20630
20590
|
def.pattern ?? (def.pattern = pattern);
|
|
20631
|
-
inst._zod.onattach.push((inst2) => {
|
|
20632
|
-
const bag = inst2._zod.bag;
|
|
20633
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
20634
|
-
bag.patterns.add(pattern);
|
|
20635
|
-
});
|
|
20636
20591
|
inst._zod.check = (payload) => {
|
|
20637
20592
|
if (payload.value.startsWith(def.prefix))
|
|
20638
20593
|
return;
|
|
@@ -20651,11 +20606,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
20651
20606
|
$ZodCheck.init(inst, def);
|
|
20652
20607
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
20653
20608
|
def.pattern ?? (def.pattern = pattern);
|
|
20654
|
-
inst._zod.onattach.push((inst2) => {
|
|
20655
|
-
const bag = inst2._zod.bag;
|
|
20656
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
20657
|
-
bag.patterns.add(pattern);
|
|
20658
|
-
});
|
|
20659
20609
|
inst._zod.check = (payload) => {
|
|
20660
20610
|
if (payload.value.endsWith(def.suffix))
|
|
20661
20611
|
return;
|
|
@@ -20689,12 +20639,39 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
|
|
|
20689
20639
|
return;
|
|
20690
20640
|
};
|
|
20691
20641
|
});
|
|
20642
|
+
var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
|
|
20643
|
+
$ZodCheck.init(inst, def);
|
|
20644
|
+
hide(inst, Symbol.iterator, function* () {
|
|
20645
|
+
yield inst;
|
|
20646
|
+
});
|
|
20647
|
+
let entries;
|
|
20648
|
+
inst._zod.check = (payload) => {
|
|
20649
|
+
if (payload.value == null) {
|
|
20650
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
20651
|
+
return;
|
|
20652
|
+
}
|
|
20653
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
20654
|
+
const input = payload.value;
|
|
20655
|
+
let proms;
|
|
20656
|
+
for (const [key, schema] of entries) {
|
|
20657
|
+
const result = schema._zod.run({ value: input[key], issues: [] }, {});
|
|
20658
|
+
if (result instanceof Promise) {
|
|
20659
|
+
proms ?? (proms = []);
|
|
20660
|
+
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
|
|
20661
|
+
} else {
|
|
20662
|
+
handleCheckPropertyResult(result, payload, key);
|
|
20663
|
+
}
|
|
20664
|
+
}
|
|
20665
|
+
if (proms)
|
|
20666
|
+
return Promise.all(proms).then(() => {
|
|
20667
|
+
return;
|
|
20668
|
+
});
|
|
20669
|
+
return;
|
|
20670
|
+
};
|
|
20671
|
+
});
|
|
20692
20672
|
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
20693
20673
|
$ZodCheck.init(inst, def);
|
|
20694
20674
|
const mimeSet = new Set(def.mime);
|
|
20695
|
-
inst._zod.onattach.push((inst2) => {
|
|
20696
|
-
inst2._zod.bag.mime = def.mime;
|
|
20697
|
-
});
|
|
20698
20675
|
inst._zod.check = (payload) => {
|
|
20699
20676
|
if (mimeSet.has(payload.value.type))
|
|
20700
20677
|
return;
|
|
@@ -20724,8 +20701,11 @@ class Doc {
|
|
|
20724
20701
|
}
|
|
20725
20702
|
indented(fn) {
|
|
20726
20703
|
this.indent += 1;
|
|
20727
|
-
|
|
20728
|
-
|
|
20704
|
+
try {
|
|
20705
|
+
fn(this);
|
|
20706
|
+
} finally {
|
|
20707
|
+
this.indent -= 1;
|
|
20708
|
+
}
|
|
20729
20709
|
}
|
|
20730
20710
|
write(arg) {
|
|
20731
20711
|
if (typeof arg === "function") {
|
|
@@ -20756,8 +20736,8 @@ ${content.join(`
|
|
|
20756
20736
|
// node_modules/zod/v4/core/versions.js
|
|
20757
20737
|
var version = {
|
|
20758
20738
|
major: 4,
|
|
20759
|
-
minor:
|
|
20760
|
-
patch:
|
|
20739
|
+
minor: 6,
|
|
20740
|
+
patch: 5
|
|
20761
20741
|
};
|
|
20762
20742
|
|
|
20763
20743
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -20869,15 +20849,21 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
20869
20849
|
own(this, "~standard", value);
|
|
20870
20850
|
}
|
|
20871
20851
|
});
|
|
20872
|
-
var toStandardResult = (r2) => r2.
|
|
20852
|
+
var toStandardResult = (r2, ctx) => r2.issues.length ? { issues: r2.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r2.value };
|
|
20853
|
+
async function validateAsync2(inst, value) {
|
|
20854
|
+
const ctx = { async: true };
|
|
20855
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
20856
|
+
}
|
|
20873
20857
|
function standardProps(inst) {
|
|
20874
20858
|
return {
|
|
20875
20859
|
validate: (value) => {
|
|
20860
|
+
const ctx = { async: false };
|
|
20876
20861
|
try {
|
|
20877
|
-
|
|
20878
|
-
|
|
20879
|
-
|
|
20880
|
-
}
|
|
20862
|
+
const r2 = inst._zod.run({ value, issues: [] }, ctx);
|
|
20863
|
+
if (!(r2 instanceof Promise))
|
|
20864
|
+
return toStandardResult(r2, ctx);
|
|
20865
|
+
} catch (_) {}
|
|
20866
|
+
return validateAsync2(inst, value);
|
|
20881
20867
|
},
|
|
20882
20868
|
vendor: "zod",
|
|
20883
20869
|
version: 1
|
|
@@ -20885,7 +20871,7 @@ function standardProps(inst) {
|
|
|
20885
20871
|
}
|
|
20886
20872
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
20887
20873
|
$ZodType.init(inst, def);
|
|
20888
|
-
inst._zod.pattern =
|
|
20874
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
20889
20875
|
inst._zod.parse = (payload, _) => {
|
|
20890
20876
|
if (def.coerce)
|
|
20891
20877
|
try {
|
|
@@ -20936,11 +20922,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
|
20936
20922
|
});
|
|
20937
20923
|
var URL_BAD_FORMAT = 1;
|
|
20938
20924
|
var URL_UNPARSEABLE = 2;
|
|
20925
|
+
function canParseURL(input) {
|
|
20926
|
+
try {
|
|
20927
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function")
|
|
20928
|
+
return URL.canParse(input);
|
|
20929
|
+
new URL(input);
|
|
20930
|
+
return true;
|
|
20931
|
+
} catch {
|
|
20932
|
+
return false;
|
|
20933
|
+
}
|
|
20934
|
+
}
|
|
20935
|
+
function validateURL(trimmed, def) {
|
|
20936
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
|
|
20937
|
+
return canParseURL(trimmed) || URL_UNPARSEABLE;
|
|
20938
|
+
}
|
|
20939
|
+
return parseURLObject(trimmed, def);
|
|
20940
|
+
}
|
|
20939
20941
|
function parseURLObject(trimmed, def) {
|
|
20940
20942
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
20941
20943
|
return URL_BAD_FORMAT;
|
|
20942
20944
|
}
|
|
20943
20945
|
try {
|
|
20946
|
+
if (typeof URL !== "undefined") {
|
|
20947
|
+
const URLStatic = URL;
|
|
20948
|
+
if (typeof URLStatic.parse === "function")
|
|
20949
|
+
return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
|
|
20950
|
+
}
|
|
20944
20951
|
return new URL(trimmed);
|
|
20945
20952
|
} catch {
|
|
20946
20953
|
return URL_UNPARSEABLE;
|
|
@@ -20963,7 +20970,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
20963
20970
|
inst._zod.check = (payload) => {
|
|
20964
20971
|
try {
|
|
20965
20972
|
const trimmed = payload.value.trim();
|
|
20966
|
-
const url =
|
|
20973
|
+
const url = validateURL(trimmed, def);
|
|
20967
20974
|
if (url === URL_BAD_FORMAT) {
|
|
20968
20975
|
payload.issues.push({
|
|
20969
20976
|
code: "invalid_format",
|
|
@@ -20985,6 +20992,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
20985
20992
|
});
|
|
20986
20993
|
return;
|
|
20987
20994
|
}
|
|
20995
|
+
if (url === true) {
|
|
20996
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
20997
|
+
return;
|
|
20998
|
+
}
|
|
20988
20999
|
if (def.hostname && !urlHostnameOk(url, def.hostname)) {
|
|
20989
21000
|
payload.issues.push({
|
|
20990
21001
|
code: "invalid_format",
|
|
@@ -21053,12 +21064,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
21053
21064
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
21054
21065
|
def.pattern ?? (def.pattern = datetime(def));
|
|
21055
21066
|
$ZodStringFormat.init(inst, def);
|
|
21056
|
-
if (def.local || def.precision === -1) {
|
|
21057
|
-
inst._zod.bag.laxFormat = true;
|
|
21058
|
-
inst._zod.onattach.push((s) => {
|
|
21059
|
-
s._zod.bag.laxFormat = true;
|
|
21060
|
-
});
|
|
21061
|
-
}
|
|
21062
21067
|
});
|
|
21063
21068
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
21064
21069
|
def.pattern ?? (def.pattern = date);
|
|
@@ -21075,23 +21080,16 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
21075
21080
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
21076
21081
|
def.pattern ?? (def.pattern = ipv4);
|
|
21077
21082
|
$ZodStringFormat.init(inst, def);
|
|
21078
|
-
inst._zod.bag.format = `ipv4`;
|
|
21079
21083
|
});
|
|
21080
21084
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
21081
21085
|
function isValidIPv6(value) {
|
|
21082
21086
|
if (!ipv6Alphabet.test(value))
|
|
21083
21087
|
return false;
|
|
21084
|
-
|
|
21085
|
-
new URL(`http://[${value}]`);
|
|
21086
|
-
return true;
|
|
21087
|
-
} catch {
|
|
21088
|
-
return false;
|
|
21089
|
-
}
|
|
21088
|
+
return canParseURL(`http://[${value}]`);
|
|
21090
21089
|
}
|
|
21091
21090
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
21092
21091
|
def.pattern ?? (def.pattern = ipv6);
|
|
21093
21092
|
$ZodStringFormat.init(inst, def);
|
|
21094
|
-
inst._zod.bag.format = `ipv6`;
|
|
21095
21093
|
inst._zod.check = (payload) => {
|
|
21096
21094
|
if (!isValidIPv6(payload.value)) {
|
|
21097
21095
|
payload.issues.push({
|
|
@@ -21107,7 +21105,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
21107
21105
|
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
|
|
21108
21106
|
def.pattern ?? (def.pattern = mac(def.delimiter));
|
|
21109
21107
|
$ZodStringFormat.init(inst, def);
|
|
21110
|
-
inst._zod.bag.format = `mac`;
|
|
21111
21108
|
});
|
|
21112
21109
|
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
21113
21110
|
def.pattern ?? (def.pattern = cidrv4);
|
|
@@ -21156,10 +21153,10 @@ function isValidBase64(data) {
|
|
|
21156
21153
|
return false;
|
|
21157
21154
|
}
|
|
21158
21155
|
}
|
|
21156
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
21159
21157
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
21160
|
-
def.pattern ?? (def.pattern =
|
|
21158
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
21161
21159
|
$ZodStringFormat.init(inst, def);
|
|
21162
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
21163
21160
|
inst._zod.check = (payload) => {
|
|
21164
21161
|
if (isValidBase64(payload.value))
|
|
21165
21162
|
return;
|
|
@@ -21172,17 +21169,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
21172
21169
|
});
|
|
21173
21170
|
};
|
|
21174
21171
|
});
|
|
21172
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
21175
21173
|
function isValidBase64URL(data) {
|
|
21176
|
-
if (!
|
|
21174
|
+
if (!base64urlCharset.test(data))
|
|
21177
21175
|
return false;
|
|
21178
21176
|
const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
21179
21177
|
const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
|
|
21180
21178
|
return isValidBase64(padded);
|
|
21181
21179
|
}
|
|
21182
21180
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
21183
|
-
def.pattern ?? (def.pattern =
|
|
21181
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
21184
21182
|
$ZodStringFormat.init(inst, def);
|
|
21185
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
21186
21183
|
inst._zod.check = (payload) => {
|
|
21187
21184
|
if (isValidBase64URL(payload.value))
|
|
21188
21185
|
return;
|
|
@@ -21205,7 +21202,7 @@ function isLuhnAlgo(digits) {
|
|
|
21205
21202
|
let bit = 1;
|
|
21206
21203
|
let sum = 0;
|
|
21207
21204
|
while (length) {
|
|
21208
|
-
const value =
|
|
21205
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
21209
21206
|
bit ^= 1;
|
|
21210
21207
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
21211
21208
|
}
|
|
@@ -21231,6 +21228,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
|
|
|
21231
21228
|
});
|
|
21232
21229
|
};
|
|
21233
21230
|
});
|
|
21231
|
+
function isIso7064Mod97(iban2) {
|
|
21232
|
+
let remainder = 0;
|
|
21233
|
+
const len = iban2.length;
|
|
21234
|
+
for (let i = 4;i < len; i++) {
|
|
21235
|
+
const code = iban2.charCodeAt(i);
|
|
21236
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
21237
|
+
}
|
|
21238
|
+
for (let i = 0;i < 4; i++) {
|
|
21239
|
+
const code = iban2.charCodeAt(i);
|
|
21240
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
21241
|
+
}
|
|
21242
|
+
return remainder === 1;
|
|
21243
|
+
}
|
|
21244
|
+
function isValidIBAN(input) {
|
|
21245
|
+
if (!iban.test(input))
|
|
21246
|
+
return false;
|
|
21247
|
+
return isIso7064Mod97(input);
|
|
21248
|
+
}
|
|
21249
|
+
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
21250
|
+
def.pattern ?? (def.pattern = iban);
|
|
21251
|
+
$ZodStringFormat.init(inst, def);
|
|
21252
|
+
inst._zod.check = (payload) => {
|
|
21253
|
+
if (isValidIBAN(payload.value))
|
|
21254
|
+
return;
|
|
21255
|
+
payload.issues.push({
|
|
21256
|
+
code: "invalid_format",
|
|
21257
|
+
format: "iban",
|
|
21258
|
+
input: payload.value,
|
|
21259
|
+
inst,
|
|
21260
|
+
continue: !def.abort
|
|
21261
|
+
});
|
|
21262
|
+
};
|
|
21263
|
+
});
|
|
21234
21264
|
function isValidJWT(token, algorithm = null) {
|
|
21235
21265
|
try {
|
|
21236
21266
|
const tokensParts = token.split(".");
|
|
@@ -21281,7 +21311,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
|
|
|
21281
21311
|
});
|
|
21282
21312
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
21283
21313
|
$ZodType.init(inst, def);
|
|
21284
|
-
inst._zod.pattern =
|
|
21314
|
+
inst._zod.pattern = number;
|
|
21285
21315
|
inst._zod.parse = (payload, _ctx) => {
|
|
21286
21316
|
if (def.coerce)
|
|
21287
21317
|
try {
|
|
@@ -21479,6 +21509,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
21479
21509
|
}
|
|
21480
21510
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
21481
21511
|
const proms = [];
|
|
21512
|
+
const abortEarly = ctx?.abortEarly;
|
|
21482
21513
|
for (let i = 0;i < input.length; i++) {
|
|
21483
21514
|
const item = input[i];
|
|
21484
21515
|
const result = def.element._zod.run({
|
|
@@ -21489,6 +21520,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
21489
21520
|
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
21490
21521
|
} else {
|
|
21491
21522
|
handleArrayResult(result, payload, i);
|
|
21523
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
21524
|
+
break;
|
|
21492
21525
|
}
|
|
21493
21526
|
}
|
|
21494
21527
|
if (proms.length) {
|
|
@@ -21521,7 +21554,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
|
21521
21554
|
return;
|
|
21522
21555
|
}
|
|
21523
21556
|
if (result.value === undefined) {
|
|
21524
|
-
if (isPresent) {
|
|
21557
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
21525
21558
|
final.value[key] = undefined;
|
|
21526
21559
|
}
|
|
21527
21560
|
} else {
|
|
@@ -21549,14 +21582,20 @@ function normalizeDef(def) {
|
|
|
21549
21582
|
optionalKeys: new Set(okeys)
|
|
21550
21583
|
};
|
|
21551
21584
|
}
|
|
21552
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
21585
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
21553
21586
|
const unrecognized = [];
|
|
21554
21587
|
const keySet = def.keySet;
|
|
21555
21588
|
const _catchall = def.catchall._zod;
|
|
21556
21589
|
const t2 = _catchall.def.type;
|
|
21557
21590
|
const optin = _catchall.optin;
|
|
21558
21591
|
const optout = _catchall.optout;
|
|
21592
|
+
let seen = 0;
|
|
21559
21593
|
for (const key in input) {
|
|
21594
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
21595
|
+
if (aborted(payload, seen))
|
|
21596
|
+
break;
|
|
21597
|
+
seen = payload.issues.length;
|
|
21598
|
+
}
|
|
21560
21599
|
if (keySet.has(key))
|
|
21561
21600
|
continue;
|
|
21562
21601
|
if (key === "__proto__") {
|
|
@@ -21590,23 +21629,19 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
21590
21629
|
return payload;
|
|
21591
21630
|
});
|
|
21592
21631
|
}
|
|
21593
|
-
var propShapes = new WeakMap;
|
|
21594
21632
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
21595
21633
|
$ZodType.init(inst, def);
|
|
21596
21634
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
21597
|
-
|
|
21598
|
-
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
|
|
21602
|
-
|
|
21603
|
-
|
|
21604
|
-
|
|
21605
|
-
|
|
21606
|
-
|
|
21607
|
-
return newSh;
|
|
21608
|
-
}
|
|
21609
|
-
});
|
|
21635
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
21636
|
+
if (sh) {
|
|
21637
|
+
const get = () => {
|
|
21638
|
+
const newSh = { ...sh };
|
|
21639
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
21640
|
+
get.raw = newSh;
|
|
21641
|
+
return newSh;
|
|
21642
|
+
};
|
|
21643
|
+
get.raw = sh;
|
|
21644
|
+
Object.defineProperty(def, "shape", { get });
|
|
21610
21645
|
}
|
|
21611
21646
|
const _normalized = cached(() => normalizeDef(def));
|
|
21612
21647
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -21646,7 +21681,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
21646
21681
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
21647
21682
|
const proms = [];
|
|
21648
21683
|
const shape = value.shape;
|
|
21684
|
+
const abortEarly = ctx?.abortEarly;
|
|
21685
|
+
let seen = payload.issues.length;
|
|
21649
21686
|
for (const key of value.allKeys) {
|
|
21687
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
21688
|
+
if (aborted(payload, seen))
|
|
21689
|
+
break;
|
|
21690
|
+
seen = payload.issues.length;
|
|
21691
|
+
}
|
|
21650
21692
|
if (key === "__proto__")
|
|
21651
21693
|
continue;
|
|
21652
21694
|
const el = shape[key];
|
|
@@ -21662,7 +21704,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
21662
21704
|
if (!catchall) {
|
|
21663
21705
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
21664
21706
|
}
|
|
21665
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
21707
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
21666
21708
|
};
|
|
21667
21709
|
});
|
|
21668
21710
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -21676,10 +21718,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
21676
21718
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
|
|
21677
21719
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
21678
21720
|
const prefixStr = (id, k) => `
|
|
21721
|
+
let ${id}_ab = false;
|
|
21679
21722
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
21680
21723
|
const iss = ${id}.issues[i];
|
|
21681
21724
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
21682
21725
|
payload.issues.push(iss);
|
|
21726
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
21727
|
+
}
|
|
21728
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
21729
|
+
payload.value = newResult;
|
|
21730
|
+
return payload;
|
|
21683
21731
|
}`;
|
|
21684
21732
|
doc.write(`const input = payload.value;`);
|
|
21685
21733
|
const ids = Object.create(null);
|
|
@@ -21725,6 +21773,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
21725
21773
|
input: undefined,
|
|
21726
21774
|
path: [${k}]
|
|
21727
21775
|
});
|
|
21776
|
+
if (ctx && ctx.abortEarly) {
|
|
21777
|
+
payload.value = newResult;
|
|
21778
|
+
return payload;
|
|
21779
|
+
}
|
|
21728
21780
|
}
|
|
21729
21781
|
|
|
21730
21782
|
if (${id}_present) {
|
|
@@ -21736,16 +21788,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
21736
21788
|
doc.write(`
|
|
21737
21789
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
21738
21790
|
}
|
|
21739
|
-
|
|
21740
|
-
if (
|
|
21741
|
-
|
|
21742
|
-
newResult[${k}] = undefined;
|
|
21743
|
-
}
|
|
21791
|
+
`);
|
|
21792
|
+
if (optin === "defaulted") {
|
|
21793
|
+
doc.write(`newResult[${k}] = ${id}.value;`);
|
|
21744
21794
|
} else {
|
|
21795
|
+
doc.write(`
|
|
21796
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
21745
21797
|
newResult[${k}] = ${id}.value;
|
|
21746
21798
|
}
|
|
21747
|
-
|
|
21748
21799
|
`);
|
|
21800
|
+
}
|
|
21749
21801
|
}
|
|
21750
21802
|
}
|
|
21751
21803
|
doc.write(`payload.value = newResult;`);
|
|
@@ -21777,7 +21829,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
21777
21829
|
payload = fastpass(payload, ctx);
|
|
21778
21830
|
if (!catchall)
|
|
21779
21831
|
return payload;
|
|
21780
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
21832
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
21781
21833
|
}
|
|
21782
21834
|
return superParse(payload, ctx);
|
|
21783
21835
|
};
|
|
@@ -21909,16 +21961,31 @@ function getDiscriminatedOption(union, value) {
|
|
|
21909
21961
|
const internals = union._zod;
|
|
21910
21962
|
let map = internals.bag.optionsMap;
|
|
21911
21963
|
if (!map) {
|
|
21912
|
-
map =
|
|
21913
|
-
const { options, discriminator } = internals.def;
|
|
21914
|
-
for (const option of options) {
|
|
21915
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
21916
|
-
if (!map.has(v))
|
|
21917
|
-
map.set(v, option);
|
|
21918
|
-
}
|
|
21964
|
+
map = discriminatorMap(internals.def);
|
|
21919
21965
|
internals.bag.optionsMap = map;
|
|
21920
21966
|
}
|
|
21921
|
-
|
|
21967
|
+
const option = map.get(value);
|
|
21968
|
+
if (option === null)
|
|
21969
|
+
throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
21970
|
+
return option;
|
|
21971
|
+
}
|
|
21972
|
+
function discriminatorMap(def) {
|
|
21973
|
+
const map = new Map;
|
|
21974
|
+
for (const option of def.options) {
|
|
21975
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
21976
|
+
if (!values || values.size === 0)
|
|
21977
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
21978
|
+
for (const value of values) {
|
|
21979
|
+
if (map.has(value)) {
|
|
21980
|
+
if (value !== undefined)
|
|
21981
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
21982
|
+
map.set(value, null);
|
|
21983
|
+
} else {
|
|
21984
|
+
map.set(value, option);
|
|
21985
|
+
}
|
|
21986
|
+
}
|
|
21987
|
+
}
|
|
21988
|
+
return map;
|
|
21922
21989
|
}
|
|
21923
21990
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
21924
21991
|
def.inclusive = false;
|
|
@@ -21926,10 +21993,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
21926
21993
|
const _super = inst._zod.parse;
|
|
21927
21994
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
21928
21995
|
const propValues = {};
|
|
21996
|
+
let undefinedCount = 0;
|
|
21929
21997
|
for (const option of zod.def.options) {
|
|
21930
21998
|
const pv = option._zod.propValues;
|
|
21931
21999
|
if (!pv || Object.keys(pv).length === 0)
|
|
21932
22000
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
22001
|
+
if (pv[zod.def.discriminator]?.has(undefined))
|
|
22002
|
+
undefinedCount++;
|
|
21933
22003
|
for (const [k, v] of Object.entries(pv)) {
|
|
21934
22004
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
21935
22005
|
assignProp(propValues, k, new Set);
|
|
@@ -21939,30 +22009,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
21939
22009
|
}
|
|
21940
22010
|
}
|
|
21941
22011
|
}
|
|
22012
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
22013
|
+
propValues[zod.def.discriminator]?.delete(undefined);
|
|
21942
22014
|
return propValues;
|
|
21943
22015
|
});
|
|
21944
22016
|
def.options.forEach((option, i) => {
|
|
21945
|
-
const propShape =
|
|
22017
|
+
const propShape = rawShape(option._zod.def);
|
|
21946
22018
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
21947
22019
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
21948
22020
|
}
|
|
21949
22021
|
});
|
|
21950
|
-
const disc = cached(() =>
|
|
21951
|
-
const opts = def.options;
|
|
21952
|
-
const map = new Map;
|
|
21953
|
-
for (const o2 of opts) {
|
|
21954
|
-
const values = o2._zod.propValues?.[def.discriminator];
|
|
21955
|
-
if (!values || values.size === 0)
|
|
21956
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o2)}"`);
|
|
21957
|
-
for (const v of values) {
|
|
21958
|
-
if (map.has(v)) {
|
|
21959
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
21960
|
-
}
|
|
21961
|
-
map.set(v, o2);
|
|
21962
|
-
}
|
|
21963
|
-
}
|
|
21964
|
-
return map;
|
|
21965
|
-
});
|
|
22022
|
+
const disc = cached(() => discriminatorMap(def));
|
|
21966
22023
|
inst._zod.parse = (payload, ctx) => {
|
|
21967
22024
|
const input = payload.value;
|
|
21968
22025
|
if (!isObject(input)) {
|
|
@@ -21974,8 +22031,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
21974
22031
|
});
|
|
21975
22032
|
return payload;
|
|
21976
22033
|
}
|
|
21977
|
-
const
|
|
21978
|
-
|
|
22034
|
+
const value = input?.[def.discriminator];
|
|
22035
|
+
const opt = disc.value.get(value);
|
|
22036
|
+
if (opt && (value !== undefined || ctx.direction !== "backward")) {
|
|
21979
22037
|
return opt._zod.run(payload, ctx);
|
|
21980
22038
|
}
|
|
21981
22039
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -21986,7 +22044,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
21986
22044
|
errors: [],
|
|
21987
22045
|
note: "No matching discriminator",
|
|
21988
22046
|
discriminator: def.discriminator,
|
|
21989
|
-
options: Array.from(disc.value.keys()),
|
|
22047
|
+
options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
|
|
21990
22048
|
input,
|
|
21991
22049
|
path: [def.discriminator],
|
|
21992
22050
|
inst
|
|
@@ -22152,6 +22210,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
22152
22210
|
}
|
|
22153
22211
|
}
|
|
22154
22212
|
const itemResults = new Array(items.length);
|
|
22213
|
+
const abortEarly = def.rest ? ctx?.abortEarly : undefined;
|
|
22214
|
+
let itemAborted = false;
|
|
22155
22215
|
for (let i = 0;i < items.length; i++) {
|
|
22156
22216
|
const r2 = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
|
|
22157
22217
|
if (r2 instanceof Promise) {
|
|
@@ -22160,12 +22220,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
22160
22220
|
}));
|
|
22161
22221
|
} else {
|
|
22162
22222
|
itemResults[i] = r2;
|
|
22223
|
+
if (abortEarly && !itemAborted && r2.issues.length)
|
|
22224
|
+
itemAborted = aborted(r2);
|
|
22163
22225
|
}
|
|
22164
22226
|
}
|
|
22165
|
-
if (def.rest) {
|
|
22227
|
+
if (def.rest && !itemAborted) {
|
|
22166
22228
|
let i = items.length - 1;
|
|
22167
22229
|
const rest = input.slice(items.length);
|
|
22230
|
+
let seen = payload.issues.length;
|
|
22168
22231
|
for (const el of rest) {
|
|
22232
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
22233
|
+
if (aborted(payload, seen))
|
|
22234
|
+
break;
|
|
22235
|
+
seen = payload.issues.length;
|
|
22236
|
+
}
|
|
22169
22237
|
i++;
|
|
22170
22238
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
22171
22239
|
if (result instanceof Promise) {
|
|
@@ -22393,7 +22461,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
22393
22461
|
}
|
|
22394
22462
|
const proms = [];
|
|
22395
22463
|
payload.value = memo ? memo.alloc(inst, payload, new Map, ctx) : new Map;
|
|
22464
|
+
const abortEarly = ctx?.abortEarly;
|
|
22465
|
+
let seen = payload.issues.length;
|
|
22396
22466
|
for (const [key, value] of input) {
|
|
22467
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
22468
|
+
if (aborted(payload, seen))
|
|
22469
|
+
break;
|
|
22470
|
+
seen = payload.issues.length;
|
|
22471
|
+
}
|
|
22397
22472
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
22398
22473
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
22399
22474
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
@@ -22456,7 +22531,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
22456
22531
|
}
|
|
22457
22532
|
const proms = [];
|
|
22458
22533
|
payload.value = memo ? memo.alloc(inst, payload, new Set, ctx) : new Set;
|
|
22534
|
+
const abortEarly = ctx?.abortEarly;
|
|
22535
|
+
let seen = payload.issues.length;
|
|
22459
22536
|
for (const item of input) {
|
|
22537
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
22538
|
+
if (aborted(payload, seen))
|
|
22539
|
+
break;
|
|
22540
|
+
seen = payload.issues.length;
|
|
22541
|
+
}
|
|
22460
22542
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
22461
22543
|
if (result instanceof Promise) {
|
|
22462
22544
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -22479,8 +22561,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
22479
22561
|
const values = getEnumValues(def.entries);
|
|
22480
22562
|
const valuesSet = new Set(values);
|
|
22481
22563
|
inst._zod.values = valuesSet;
|
|
22482
|
-
|
|
22483
|
-
|
|
22564
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
22565
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
22566
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o2) => escapeRegex(o2.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
22567
|
+
});
|
|
22484
22568
|
inst._zod.parse = (payload, _ctx) => {
|
|
22485
22569
|
const input = payload.value;
|
|
22486
22570
|
if (valuesSet.has(input)) {
|
|
@@ -22499,7 +22583,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
22499
22583
|
$ZodType.init(inst, def);
|
|
22500
22584
|
const values = new Set(def.values);
|
|
22501
22585
|
inst._zod.values = values;
|
|
22502
|
-
inst
|
|
22586
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
22587
|
+
const vals = zod.def.values;
|
|
22588
|
+
return new RegExp(vals.length ? `^(${vals.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$` : "^[^\\s\\S]$");
|
|
22589
|
+
});
|
|
22503
22590
|
inst._zod.parse = (payload, _ctx) => {
|
|
22504
22591
|
const input = payload.value;
|
|
22505
22592
|
if (values.has(input)) {
|
|
@@ -22837,20 +22924,62 @@ function handleReadonlyResult(payload) {
|
|
|
22837
22924
|
payload.value = Object.freeze(payload.value);
|
|
22838
22925
|
return payload;
|
|
22839
22926
|
}
|
|
22927
|
+
function leafPattern(schema) {
|
|
22928
|
+
const def = schema._zod.def;
|
|
22929
|
+
let pattern = def.pattern;
|
|
22930
|
+
let isInt = !!def.format?.includes("int");
|
|
22931
|
+
let minimum;
|
|
22932
|
+
let maximum;
|
|
22933
|
+
for (const ch of def.checks ?? []) {
|
|
22934
|
+
const d = ch._zod.def;
|
|
22935
|
+
if (d.pattern)
|
|
22936
|
+
pattern = d.pattern;
|
|
22937
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
22938
|
+
const lo = d.minimum ?? d.length;
|
|
22939
|
+
const hi = d.maximum ?? d.length;
|
|
22940
|
+
if (lo !== undefined && (minimum === undefined || lo > minimum))
|
|
22941
|
+
minimum = lo;
|
|
22942
|
+
if (hi !== undefined && (maximum === undefined || hi < maximum))
|
|
22943
|
+
maximum = hi;
|
|
22944
|
+
}
|
|
22945
|
+
if (pattern)
|
|
22946
|
+
return pattern.source;
|
|
22947
|
+
if (minimum !== undefined && maximum !== undefined && minimum > maximum)
|
|
22948
|
+
return "(?!)";
|
|
22949
|
+
if (minimum !== undefined || maximum !== undefined)
|
|
22950
|
+
return string({ minimum, maximum }).source;
|
|
22951
|
+
const own2 = schema._zod.pattern;
|
|
22952
|
+
return (isInt && own2 === number ? integer : own2)?.source;
|
|
22953
|
+
}
|
|
22954
|
+
function partPattern(schema) {
|
|
22955
|
+
const def = schema._zod.def;
|
|
22956
|
+
const own2 = schema._zod.pattern?.source;
|
|
22957
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
22958
|
+
if (inner) {
|
|
22959
|
+
const before = inner._zod.pattern?.source;
|
|
22960
|
+
const after = partPattern(inner);
|
|
22961
|
+
if (own2 && before && after && after !== before) {
|
|
22962
|
+
return own2.replace(cleanRegex(before), () => cleanRegex(after));
|
|
22963
|
+
}
|
|
22964
|
+
return own2;
|
|
22965
|
+
}
|
|
22966
|
+
if (def.options) {
|
|
22967
|
+
const sources = def.options.map(partPattern);
|
|
22968
|
+
if (sources.every(Boolean))
|
|
22969
|
+
return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
22970
|
+
}
|
|
22971
|
+
return leafPattern(schema);
|
|
22972
|
+
}
|
|
22840
22973
|
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
22841
22974
|
$ZodType.init(inst, def);
|
|
22842
22975
|
const regexParts = [];
|
|
22843
22976
|
for (const part of def.parts) {
|
|
22844
22977
|
if (typeof part === "object" && part !== null) {
|
|
22845
|
-
|
|
22978
|
+
const source = partPattern(part);
|
|
22979
|
+
if (!source) {
|
|
22846
22980
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
22847
22981
|
}
|
|
22848
|
-
|
|
22849
|
-
if (!source)
|
|
22850
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
22851
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
22852
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
22853
|
-
regexParts.push(source.slice(start, end));
|
|
22982
|
+
regexParts.push(cleanRegex(source));
|
|
22854
22983
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
22855
22984
|
regexParts.push(escapeRegex(`${part}`));
|
|
22856
22985
|
} else {
|
|
@@ -23021,28 +23150,53 @@ class $ZodCyclicError extends Error {
|
|
|
23021
23150
|
}
|
|
23022
23151
|
var STATE = "~memo";
|
|
23023
23152
|
var NO_ISSUES = [];
|
|
23153
|
+
function isRef(value) {
|
|
23154
|
+
return value !== null && typeof value === "object";
|
|
23155
|
+
}
|
|
23024
23156
|
function cloneIssues(issues) {
|
|
23025
23157
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
23026
23158
|
}
|
|
23027
23159
|
var recursive = /* @__PURE__ */ new WeakMap;
|
|
23028
|
-
|
|
23160
|
+
var NONE = 0;
|
|
23161
|
+
var ASSUMED = 1;
|
|
23162
|
+
var PROVEN = 2;
|
|
23163
|
+
function isRecursive(inst, stack, resolve17) {
|
|
23029
23164
|
const cached2 = recursive.get(inst);
|
|
23030
23165
|
if (cached2 !== undefined)
|
|
23031
|
-
return cached2;
|
|
23166
|
+
return cached2 ? PROVEN : NONE;
|
|
23032
23167
|
if (stack.has(inst))
|
|
23033
|
-
return
|
|
23168
|
+
return PROVEN;
|
|
23034
23169
|
stack.add(inst);
|
|
23035
|
-
let result =
|
|
23170
|
+
let result = NONE;
|
|
23036
23171
|
const check = (child) => {
|
|
23037
|
-
if (
|
|
23038
|
-
|
|
23172
|
+
if (result !== PROVEN && child?._zod) {
|
|
23173
|
+
const answer = isRecursive(child, stack, resolve17);
|
|
23174
|
+
if (answer > result)
|
|
23175
|
+
result = answer;
|
|
23176
|
+
}
|
|
23177
|
+
};
|
|
23178
|
+
const shape = (sh, spread) => {
|
|
23179
|
+
let answer = NONE;
|
|
23180
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
23181
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
23182
|
+
if (spread && !desc.enumerable)
|
|
23183
|
+
continue;
|
|
23184
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve17) : NONE;
|
|
23185
|
+
if (child > answer)
|
|
23186
|
+
answer = child;
|
|
23187
|
+
}
|
|
23188
|
+
return answer;
|
|
23189
|
+
};
|
|
23190
|
+
const merge2 = (answer) => {
|
|
23191
|
+
if (answer > result)
|
|
23192
|
+
result = answer;
|
|
23039
23193
|
};
|
|
23040
23194
|
const def = inst._zod.def;
|
|
23041
23195
|
const kind = def.type;
|
|
23042
23196
|
switch (kind) {
|
|
23043
23197
|
case "object": {
|
|
23044
|
-
|
|
23045
|
-
|
|
23198
|
+
const raw = rawShape(def);
|
|
23199
|
+
merge2(raw ? shape(raw, true) : ASSUMED);
|
|
23046
23200
|
check(def.catchall);
|
|
23047
23201
|
break;
|
|
23048
23202
|
}
|
|
@@ -23089,9 +23243,11 @@ function isRecursive(inst, stack) {
|
|
|
23089
23243
|
check(def.input);
|
|
23090
23244
|
check(def.output);
|
|
23091
23245
|
break;
|
|
23092
|
-
case "lazy":
|
|
23093
|
-
|
|
23246
|
+
case "lazy": {
|
|
23247
|
+
const inner = def._cachedInner ?? (resolve17 ? inst._zod.innerType : undefined);
|
|
23248
|
+
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
23094
23249
|
break;
|
|
23250
|
+
}
|
|
23095
23251
|
case "template_literal":
|
|
23096
23252
|
case "string":
|
|
23097
23253
|
case "number":
|
|
@@ -23130,16 +23286,20 @@ function isRecursive(inst, stack) {
|
|
|
23130
23286
|
}
|
|
23131
23287
|
}
|
|
23132
23288
|
stack.delete(inst);
|
|
23133
|
-
|
|
23134
|
-
|
|
23289
|
+
return settle(inst, result);
|
|
23290
|
+
}
|
|
23291
|
+
function settle(inst, answer) {
|
|
23292
|
+
if (answer !== ASSUMED)
|
|
23293
|
+
recursive.set(inst, answer === PROVEN);
|
|
23294
|
+
return answer;
|
|
23135
23295
|
}
|
|
23136
23296
|
function isRecursiveSchema(inst) {
|
|
23137
|
-
return isRecursive(inst, new Set);
|
|
23297
|
+
return isRecursive(inst, new Set, true) !== NONE;
|
|
23138
23298
|
}
|
|
23139
23299
|
function bucketFor(state, inst) {
|
|
23140
23300
|
let bucket = state.buckets.get(inst);
|
|
23141
23301
|
if (!bucket) {
|
|
23142
|
-
bucket = new
|
|
23302
|
+
bucket = new WeakMap;
|
|
23143
23303
|
state.buckets.set(inst, bucket);
|
|
23144
23304
|
}
|
|
23145
23305
|
return bucket;
|
|
@@ -23175,6 +23335,7 @@ var memo = {
|
|
|
23175
23335
|
attach(inst) {
|
|
23176
23336
|
var _a2;
|
|
23177
23337
|
let isRecursiveInst;
|
|
23338
|
+
let rechecked = false;
|
|
23178
23339
|
let lastCtx;
|
|
23179
23340
|
let lastBucket;
|
|
23180
23341
|
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
@@ -23182,20 +23343,24 @@ var memo = {
|
|
|
23182
23343
|
const base = inst._zod.parse;
|
|
23183
23344
|
const wrapped = (payload, ctx) => {
|
|
23184
23345
|
if (isRecursiveInst === undefined) {
|
|
23185
|
-
|
|
23186
|
-
if (
|
|
23346
|
+
const walked = isRecursive(inst, new Set, false);
|
|
23347
|
+
if (walked === NONE) {
|
|
23187
23348
|
inst._zod.parse = base;
|
|
23188
23349
|
if (inst._zod.run === wrapped)
|
|
23189
23350
|
inst._zod.run = base;
|
|
23190
23351
|
return base(payload, ctx);
|
|
23191
23352
|
}
|
|
23353
|
+
if (walked === PROVEN || rechecked)
|
|
23354
|
+
isRecursiveInst = true;
|
|
23355
|
+
else
|
|
23356
|
+
rechecked = true;
|
|
23192
23357
|
}
|
|
23193
23358
|
const input = payload.value;
|
|
23194
|
-
if (input
|
|
23359
|
+
if (!isRef(input))
|
|
23195
23360
|
return base(payload, ctx);
|
|
23196
23361
|
let state = ctx[STATE];
|
|
23197
23362
|
if (!state) {
|
|
23198
|
-
state = { buckets: new
|
|
23363
|
+
state = { buckets: new WeakMap, backEdges: undefined };
|
|
23199
23364
|
ctx[STATE] = state;
|
|
23200
23365
|
}
|
|
23201
23366
|
let bucket;
|
|
@@ -23214,7 +23379,7 @@ var memo = {
|
|
|
23214
23379
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
23215
23380
|
} else {
|
|
23216
23381
|
payload.memo = true;
|
|
23217
|
-
state.backEdges ?? (state.backEdges = new
|
|
23382
|
+
state.backEdges ?? (state.backEdges = new WeakSet);
|
|
23218
23383
|
state.backEdges.add(hit.value);
|
|
23219
23384
|
}
|
|
23220
23385
|
return payload;
|
|
@@ -23246,7 +23411,7 @@ function memoizer() {
|
|
|
23246
23411
|
}
|
|
23247
23412
|
function isBackEdge(ctx, value) {
|
|
23248
23413
|
const backEdges = ctx[STATE]?.backEdges;
|
|
23249
|
-
return backEdges !== undefined && value
|
|
23414
|
+
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
23250
23415
|
}
|
|
23251
23416
|
// node_modules/zod/v4/locales/index.js
|
|
23252
23417
|
var exports_locales = {};
|
|
@@ -23262,6 +23427,7 @@ __export(exports_locales, {
|
|
|
23262
23427
|
tr: () => tr_default,
|
|
23263
23428
|
tk: () => tk_default,
|
|
23264
23429
|
th: () => th_default,
|
|
23430
|
+
tg: () => tg_default,
|
|
23265
23431
|
ta: () => ta_default,
|
|
23266
23432
|
sv: () => sv_default,
|
|
23267
23433
|
sl: () => sl_default,
|
|
@@ -23356,6 +23522,8 @@ var error = () => {
|
|
|
23356
23522
|
json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
|
|
23357
23523
|
e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
|
|
23358
23524
|
credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
|
|
23525
|
+
currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
|
|
23526
|
+
iban: "IBAN",
|
|
23359
23527
|
jwt: "JWT",
|
|
23360
23528
|
template_literal: "\u0645\u062F\u062E\u0644"
|
|
23361
23529
|
};
|
|
@@ -23465,6 +23633,8 @@ var error2 = () => {
|
|
|
23465
23633
|
json_string: "JSON string",
|
|
23466
23634
|
e164: "E.164 number",
|
|
23467
23635
|
credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
|
|
23636
|
+
currency_code: "valyuta kodu",
|
|
23637
|
+
iban: "IBAN",
|
|
23468
23638
|
jwt: "JWT",
|
|
23469
23639
|
template_literal: "input"
|
|
23470
23640
|
};
|
|
@@ -23623,6 +23793,8 @@ var error3 = () => {
|
|
|
23623
23793
|
json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
|
|
23624
23794
|
e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
|
|
23625
23795
|
credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
23796
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
23797
|
+
iban: "IBAN",
|
|
23626
23798
|
jwt: "JWT",
|
|
23627
23799
|
template_literal: "\u0443\u0432\u043E\u0434"
|
|
23628
23800
|
};
|
|
@@ -23739,6 +23911,8 @@ var error4 = () => {
|
|
|
23739
23911
|
json_string: "JSON \u043D\u0438\u0437",
|
|
23740
23912
|
e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
|
|
23741
23913
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
|
|
23914
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
23915
|
+
iban: "IBAN",
|
|
23742
23916
|
jwt: "JWT",
|
|
23743
23917
|
template_literal: "\u0432\u0445\u043E\u0434"
|
|
23744
23918
|
};
|
|
@@ -23862,6 +24036,8 @@ var error5 = () => {
|
|
|
23862
24036
|
json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
|
|
23863
24037
|
e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
23864
24038
|
credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
24039
|
+
currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
|
|
24040
|
+
iban: "IBAN",
|
|
23865
24041
|
jwt: "JWT",
|
|
23866
24042
|
template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
|
|
23867
24043
|
};
|
|
@@ -23973,6 +24149,8 @@ var error6 = () => {
|
|
|
23973
24149
|
json_string: "cadena JSON",
|
|
23974
24150
|
e164: "n\xFAmero E.164",
|
|
23975
24151
|
credit_card: "n\xFAmero de targeta de cr\xE8dit",
|
|
24152
|
+
currency_code: "codi de moneda",
|
|
24153
|
+
iban: "IBAN",
|
|
23976
24154
|
jwt: "JWT",
|
|
23977
24155
|
template_literal: "entrada"
|
|
23978
24156
|
};
|
|
@@ -24083,6 +24261,8 @@ var error7 = () => {
|
|
|
24083
24261
|
json_string: "\u062F\u06D5\u0642\u06CC JSON",
|
|
24084
24262
|
e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
|
|
24085
24263
|
credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
|
|
24264
|
+
currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
|
|
24265
|
+
iban: "IBAN",
|
|
24086
24266
|
jwt: "JWT",
|
|
24087
24267
|
template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
|
|
24088
24268
|
};
|
|
@@ -24213,6 +24393,8 @@ var error8 = () => {
|
|
|
24213
24393
|
json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
|
|
24214
24394
|
e164: "\u010D\xEDslo E.164",
|
|
24215
24395
|
credit_card: "\u010D\xEDslo kreditn\xED karty",
|
|
24396
|
+
currency_code: "k\xF3d m\u011Bny",
|
|
24397
|
+
iban: "IBAN",
|
|
24216
24398
|
jwt: "JWT",
|
|
24217
24399
|
template_literal: "vstup"
|
|
24218
24400
|
};
|
|
@@ -24327,6 +24509,8 @@ var error9 = () => {
|
|
|
24327
24509
|
json_string: "JSON-streng",
|
|
24328
24510
|
e164: "E.164-nummer",
|
|
24329
24511
|
credit_card: "kreditkortnummer",
|
|
24512
|
+
currency_code: "valutakode",
|
|
24513
|
+
iban: "IBAN",
|
|
24330
24514
|
jwt: "JWT",
|
|
24331
24515
|
template_literal: "input"
|
|
24332
24516
|
};
|
|
@@ -24445,6 +24629,8 @@ var error10 = () => {
|
|
|
24445
24629
|
json_string: "JSON-String",
|
|
24446
24630
|
e164: "E.164-Nummer",
|
|
24447
24631
|
credit_card: "Kreditkartennummer",
|
|
24632
|
+
currency_code: "W\xE4hrungscode",
|
|
24633
|
+
iban: "IBAN",
|
|
24448
24634
|
jwt: "JWT",
|
|
24449
24635
|
template_literal: "Eingabe"
|
|
24450
24636
|
};
|
|
@@ -24556,6 +24742,8 @@ var error11 = () => {
|
|
|
24556
24742
|
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
24557
24743
|
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
24558
24744
|
credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
|
|
24745
|
+
currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
|
|
24746
|
+
iban: "IBAN",
|
|
24559
24747
|
jwt: "JWT",
|
|
24560
24748
|
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
24561
24749
|
};
|
|
@@ -24665,7 +24853,9 @@ var error12 = () => {
|
|
|
24665
24853
|
base64url: "base64url-encoded string",
|
|
24666
24854
|
json_string: "JSON string",
|
|
24667
24855
|
e164: "E.164 number",
|
|
24856
|
+
currency_code: "currency code",
|
|
24668
24857
|
credit_card: "credit card number",
|
|
24858
|
+
iban: "IBAN",
|
|
24669
24859
|
jwt: "JWT",
|
|
24670
24860
|
template_literal: "input"
|
|
24671
24861
|
};
|
|
@@ -24786,6 +24976,8 @@ var error13 = () => {
|
|
|
24786
24976
|
json_string: "JSON-karaktraro",
|
|
24787
24977
|
e164: "E.164-nombro",
|
|
24788
24978
|
credit_card: "kreditkarta numero",
|
|
24979
|
+
currency_code: "valuta kodo",
|
|
24980
|
+
iban: "IBAN",
|
|
24789
24981
|
jwt: "JWT",
|
|
24790
24982
|
template_literal: "enigo"
|
|
24791
24983
|
};
|
|
@@ -24897,6 +25089,8 @@ var error14 = () => {
|
|
|
24897
25089
|
json_string: "cadena JSON",
|
|
24898
25090
|
e164: "n\xFAmero E.164",
|
|
24899
25091
|
credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
|
|
25092
|
+
currency_code: "c\xF3digo de moneda",
|
|
25093
|
+
iban: "IBAN",
|
|
24900
25094
|
jwt: "JWT",
|
|
24901
25095
|
template_literal: "entrada"
|
|
24902
25096
|
};
|
|
@@ -25032,6 +25226,8 @@ var error15 = () => {
|
|
|
25032
25226
|
json_string: "JSON \u0631\u0634\u062A\u0647",
|
|
25033
25227
|
e164: "E.164 \u0639\u062F\u062F",
|
|
25034
25228
|
credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
|
|
25229
|
+
currency_code: "\u06A9\u062F \u0627\u0631\u0632",
|
|
25230
|
+
iban: "IBAN",
|
|
25035
25231
|
jwt: "JWT",
|
|
25036
25232
|
template_literal: "\u0648\u0631\u0648\u062F\u06CC"
|
|
25037
25233
|
};
|
|
@@ -25153,6 +25349,8 @@ var error16 = () => {
|
|
|
25153
25349
|
json_string: "JSON-merkkijono",
|
|
25154
25350
|
e164: "E.164-luku",
|
|
25155
25351
|
credit_card: "luottokortin numero",
|
|
25352
|
+
currency_code: "valuuttakoodi",
|
|
25353
|
+
iban: "IBAN",
|
|
25156
25354
|
jwt: "JWT",
|
|
25157
25355
|
template_literal: "templaattimerkkijono"
|
|
25158
25356
|
};
|
|
@@ -25263,6 +25461,8 @@ var error17 = () => {
|
|
|
25263
25461
|
json_string: "cha\xEEne de caract\xE8res JSON",
|
|
25264
25462
|
e164: "num\xE9ro au format E.164",
|
|
25265
25463
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
25464
|
+
currency_code: "code de devise",
|
|
25465
|
+
iban: "IBAN",
|
|
25266
25466
|
jwt: "JWT",
|
|
25267
25467
|
template_literal: "entr\xE9e"
|
|
25268
25468
|
};
|
|
@@ -25391,6 +25591,8 @@ var error18 = () => {
|
|
|
25391
25591
|
json_string: "cha\xEEne JSON",
|
|
25392
25592
|
e164: "num\xE9ro E.164",
|
|
25393
25593
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
25594
|
+
currency_code: "code de devise",
|
|
25595
|
+
iban: "IBAN",
|
|
25394
25596
|
jwt: "JWT",
|
|
25395
25597
|
template_literal: "entr\xE9e"
|
|
25396
25598
|
};
|
|
@@ -25501,6 +25703,8 @@ var error19 = () => {
|
|
|
25501
25703
|
json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
|
|
25502
25704
|
e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
25503
25705
|
credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
25706
|
+
currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
|
|
25707
|
+
iban: "IBAN",
|
|
25504
25708
|
jwt: "JWT",
|
|
25505
25709
|
template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
|
|
25506
25710
|
};
|
|
@@ -25647,6 +25851,8 @@ var error20 = () => {
|
|
|
25647
25851
|
json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
|
|
25648
25852
|
e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
|
|
25649
25853
|
credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
|
|
25854
|
+
currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
|
|
25855
|
+
iban: { label: "IBAN", gender: "m" },
|
|
25650
25856
|
jwt: { label: "JWT", gender: "m" },
|
|
25651
25857
|
template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
25652
25858
|
ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
@@ -25810,6 +26016,8 @@ var error21 = () => {
|
|
|
25810
26016
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
|
|
25811
26017
|
e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
25812
26018
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
26019
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
26020
|
+
iban: "IBAN",
|
|
25813
26021
|
jwt: "JWT",
|
|
25814
26022
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
25815
26023
|
};
|
|
@@ -25918,6 +26126,8 @@ var error22 = () => {
|
|
|
25918
26126
|
json_string: "JSON tekst",
|
|
25919
26127
|
e164: "E.164 broj",
|
|
25920
26128
|
credit_card: "broj kreditne kartice",
|
|
26129
|
+
currency_code: "kod valute",
|
|
26130
|
+
iban: "IBAN",
|
|
25921
26131
|
jwt: "JWT",
|
|
25922
26132
|
template_literal: "unos"
|
|
25923
26133
|
};
|
|
@@ -26043,6 +26253,8 @@ var error23 = () => {
|
|
|
26043
26253
|
json_string: "JSON string",
|
|
26044
26254
|
e164: "E.164 sz\xE1m",
|
|
26045
26255
|
credit_card: "hitelk\xE1rtyasz\xE1m",
|
|
26256
|
+
currency_code: "p\xE9nznemk\xF3d",
|
|
26257
|
+
iban: "IBAN",
|
|
26046
26258
|
jwt: "JWT",
|
|
26047
26259
|
template_literal: "bemenet"
|
|
26048
26260
|
};
|
|
@@ -26194,6 +26406,8 @@ var error24 = () => {
|
|
|
26194
26406
|
json_string: "JSON \u057F\u0578\u0572",
|
|
26195
26407
|
e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
|
|
26196
26408
|
credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
|
|
26409
|
+
currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
|
|
26410
|
+
iban: "IBAN",
|
|
26197
26411
|
jwt: "JWT",
|
|
26198
26412
|
template_literal: "\u0574\u0578\u0582\u057F\u0584"
|
|
26199
26413
|
};
|
|
@@ -26310,6 +26524,8 @@ var error25 = () => {
|
|
|
26310
26524
|
json_string: "string JSON",
|
|
26311
26525
|
e164: "angka E.164",
|
|
26312
26526
|
credit_card: "nomor kartu kredit",
|
|
26527
|
+
currency_code: "kode mata uang",
|
|
26528
|
+
iban: "IBAN",
|
|
26313
26529
|
jwt: "JWT",
|
|
26314
26530
|
template_literal: "input"
|
|
26315
26531
|
};
|
|
@@ -26419,6 +26635,8 @@ var error26 = () => {
|
|
|
26419
26635
|
json_string: "JSON strengur",
|
|
26420
26636
|
e164: "E.164 t\xF6lugildi",
|
|
26421
26637
|
credit_card: "kreditkortan\xFAmer",
|
|
26638
|
+
currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
|
|
26639
|
+
iban: "IBAN",
|
|
26422
26640
|
jwt: "JWT",
|
|
26423
26641
|
template_literal: "gildi"
|
|
26424
26642
|
};
|
|
@@ -26531,6 +26749,8 @@ var error27 = () => {
|
|
|
26531
26749
|
json_string: "stringa JSON",
|
|
26532
26750
|
e164: "numero E.164",
|
|
26533
26751
|
credit_card: "numero di carta di credito",
|
|
26752
|
+
currency_code: "codice valuta",
|
|
26753
|
+
iban: "IBAN",
|
|
26534
26754
|
jwt: "JWT",
|
|
26535
26755
|
template_literal: "input"
|
|
26536
26756
|
};
|
|
@@ -26642,6 +26862,8 @@ var error28 = () => {
|
|
|
26642
26862
|
json_string: "JSON\u6587\u5B57\u5217",
|
|
26643
26863
|
e164: "E.164\u756A\u53F7",
|
|
26644
26864
|
credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
|
|
26865
|
+
currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
|
|
26866
|
+
iban: "IBAN",
|
|
26645
26867
|
jwt: "JWT",
|
|
26646
26868
|
template_literal: "\u5165\u529B\u5024"
|
|
26647
26869
|
};
|
|
@@ -26752,6 +26974,8 @@ var error29 = () => {
|
|
|
26752
26974
|
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
26753
26975
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
26754
26976
|
credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
26977
|
+
currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
|
|
26978
|
+
iban: "IBAN",
|
|
26755
26979
|
jwt: "JWT",
|
|
26756
26980
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
26757
26981
|
};
|
|
@@ -26867,6 +27091,8 @@ var error30 = () => {
|
|
|
26867
27091
|
json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
|
|
26868
27092
|
e164: "\u179B\u17C1\u1781 E.164",
|
|
26869
27093
|
credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
|
|
27094
|
+
currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
|
|
27095
|
+
iban: "IBAN",
|
|
26870
27096
|
jwt: "JWT",
|
|
26871
27097
|
template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
|
|
26872
27098
|
};
|
|
@@ -26985,6 +27211,8 @@ var error31 = () => {
|
|
|
26985
27211
|
json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
|
|
26986
27212
|
e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
26987
27213
|
credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
27214
|
+
currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
|
|
27215
|
+
iban: "IBAN",
|
|
26988
27216
|
jwt: "JWT",
|
|
26989
27217
|
template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
|
|
26990
27218
|
};
|
|
@@ -27096,6 +27324,8 @@ var error32 = () => {
|
|
|
27096
27324
|
json_string: "JSON \uBB38\uC790\uC5F4",
|
|
27097
27325
|
e164: "E.164 \uBC88\uD638",
|
|
27098
27326
|
credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
|
|
27327
|
+
currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
|
|
27328
|
+
iban: "IBAN",
|
|
27099
27329
|
jwt: "JWT",
|
|
27100
27330
|
template_literal: "\uC785\uB825"
|
|
27101
27331
|
};
|
|
@@ -27292,6 +27522,8 @@ var error33 = () => {
|
|
|
27292
27522
|
json_string: "JSON eilut\u0117",
|
|
27293
27523
|
e164: "E.164 numeris",
|
|
27294
27524
|
credit_card: "kredito kortel\u0117s numeris",
|
|
27525
|
+
currency_code: "valiutos kodas",
|
|
27526
|
+
iban: "IBAN",
|
|
27295
27527
|
jwt: "JWT",
|
|
27296
27528
|
template_literal: "\u012Fvestis"
|
|
27297
27529
|
};
|
|
@@ -27415,6 +27647,8 @@ var error34 = () => {
|
|
|
27415
27647
|
json_string: "JSON \u043D\u0438\u0437\u0430",
|
|
27416
27648
|
e164: "E.164 \u0431\u0440\u043E\u0458",
|
|
27417
27649
|
credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
|
|
27650
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
27651
|
+
iban: "IBAN",
|
|
27418
27652
|
jwt: "JWT",
|
|
27419
27653
|
template_literal: "\u0432\u043D\u0435\u0441"
|
|
27420
27654
|
};
|
|
@@ -27527,6 +27761,8 @@ var error35 = () => {
|
|
|
27527
27761
|
json_string: "string JSON",
|
|
27528
27762
|
e164: "nombor E.164",
|
|
27529
27763
|
credit_card: "nombor kad kredit",
|
|
27764
|
+
currency_code: "kod mata wang",
|
|
27765
|
+
iban: "IBAN",
|
|
27530
27766
|
jwt: "JWT",
|
|
27531
27767
|
template_literal: "input"
|
|
27532
27768
|
};
|
|
@@ -27637,6 +27873,8 @@ var error36 = () => {
|
|
|
27637
27873
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
|
|
27638
27874
|
e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
|
|
27639
27875
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
|
|
27876
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
27877
|
+
iban: "IBAN",
|
|
27640
27878
|
jwt: "JWT",
|
|
27641
27879
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
27642
27880
|
};
|
|
@@ -27746,6 +27984,8 @@ var error37 = () => {
|
|
|
27746
27984
|
json_string: "JSON string",
|
|
27747
27985
|
e164: "E.164-nummer",
|
|
27748
27986
|
credit_card: "creditcardnummer",
|
|
27987
|
+
currency_code: "valutacode",
|
|
27988
|
+
iban: "IBAN",
|
|
27749
27989
|
jwt: "JWT",
|
|
27750
27990
|
template_literal: "invoer"
|
|
27751
27991
|
};
|
|
@@ -27859,6 +28099,8 @@ var error38 = () => {
|
|
|
27859
28099
|
json_string: "JSON-streng",
|
|
27860
28100
|
e164: "E.164-nummer",
|
|
27861
28101
|
credit_card: "kredittkortnummer",
|
|
28102
|
+
currency_code: "valutakode",
|
|
28103
|
+
iban: "IBAN",
|
|
27862
28104
|
jwt: "JWT",
|
|
27863
28105
|
template_literal: "input"
|
|
27864
28106
|
};
|
|
@@ -27970,6 +28212,8 @@ var error39 = () => {
|
|
|
27970
28212
|
json_string: "JSON-streng",
|
|
27971
28213
|
e164: "E.164-nummer",
|
|
27972
28214
|
credit_card: "kredittkortnummer",
|
|
28215
|
+
currency_code: "valutakode",
|
|
28216
|
+
iban: "IBAN",
|
|
27973
28217
|
jwt: "JWT",
|
|
27974
28218
|
template_literal: "input"
|
|
27975
28219
|
};
|
|
@@ -28081,6 +28325,8 @@ var error40 = () => {
|
|
|
28081
28325
|
json_string: "JSON metin",
|
|
28082
28326
|
e164: "E.164 say\u0131s\u0131",
|
|
28083
28327
|
credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
|
|
28328
|
+
currency_code: "para birimi kodu",
|
|
28329
|
+
iban: "IBAN",
|
|
28084
28330
|
jwt: "JWT",
|
|
28085
28331
|
template_literal: "giren"
|
|
28086
28332
|
};
|
|
@@ -28193,6 +28439,8 @@ var error41 = () => {
|
|
|
28193
28439
|
json_string: "JSON \u0645\u062A\u0646",
|
|
28194
28440
|
e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
|
|
28195
28441
|
credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
|
|
28442
|
+
currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
|
|
28443
|
+
iban: "IBAN",
|
|
28196
28444
|
jwt: "JWT",
|
|
28197
28445
|
template_literal: "\u0648\u0631\u0648\u062F\u064A"
|
|
28198
28446
|
};
|
|
@@ -28310,6 +28558,8 @@ var error42 = () => {
|
|
|
28310
28558
|
json_string: "ci\u0105g znak\xF3w w formacie JSON",
|
|
28311
28559
|
e164: "liczba E.164",
|
|
28312
28560
|
credit_card: "numer karty kredytowej",
|
|
28561
|
+
currency_code: "kod waluty",
|
|
28562
|
+
iban: "IBAN",
|
|
28313
28563
|
jwt: "JWT",
|
|
28314
28564
|
template_literal: "wej\u015Bcie"
|
|
28315
28565
|
};
|
|
@@ -28422,6 +28672,8 @@ var error43 = () => {
|
|
|
28422
28672
|
json_string: "o texto JSON",
|
|
28423
28673
|
e164: "o n\xFAmero E.164",
|
|
28424
28674
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
28675
|
+
currency_code: "o c\xF3digo de moeda",
|
|
28676
|
+
iban: "o IBAN",
|
|
28425
28677
|
jwt: "o JWT",
|
|
28426
28678
|
template_literal: "a entrada"
|
|
28427
28679
|
};
|
|
@@ -28562,6 +28814,8 @@ var error44 = () => {
|
|
|
28562
28814
|
json_string: "o texto JSON",
|
|
28563
28815
|
e164: "o n\xFAmero E.164",
|
|
28564
28816
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
28817
|
+
currency_code: "o c\xF3digo de moeda",
|
|
28818
|
+
iban: "o IBAN",
|
|
28565
28819
|
jwt: "o JWT",
|
|
28566
28820
|
template_literal: "a entrada"
|
|
28567
28821
|
};
|
|
@@ -28703,6 +28957,8 @@ var error45 = () => {
|
|
|
28703
28957
|
json_string: "\u0219ir JSON",
|
|
28704
28958
|
e164: "num\u0103r E.164",
|
|
28705
28959
|
credit_card: "num\u0103r de card de credit",
|
|
28960
|
+
currency_code: "cod valutar",
|
|
28961
|
+
iban: "IBAN",
|
|
28706
28962
|
jwt: "JWT",
|
|
28707
28963
|
template_literal: "intrare"
|
|
28708
28964
|
};
|
|
@@ -28873,6 +29129,8 @@ var error46 = () => {
|
|
|
28873
29129
|
json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
|
|
28874
29130
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
28875
29131
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
29132
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
29133
|
+
iban: "IBAN",
|
|
28876
29134
|
jwt: "JWT",
|
|
28877
29135
|
template_literal: "\u0432\u0432\u043E\u0434"
|
|
28878
29136
|
};
|
|
@@ -28989,6 +29247,8 @@ var error47 = () => {
|
|
|
28989
29247
|
json_string: "re\u0165azec vo form\xE1te JSON",
|
|
28990
29248
|
e164: "\u010D\xEDslo E.164",
|
|
28991
29249
|
credit_card: "\u010D\xEDslo kreditnej karty",
|
|
29250
|
+
currency_code: "k\xF3d meny",
|
|
29251
|
+
iban: "IBAN",
|
|
28992
29252
|
jwt: "JWT",
|
|
28993
29253
|
template_literal: "vstup"
|
|
28994
29254
|
};
|
|
@@ -29103,6 +29363,8 @@ var error48 = () => {
|
|
|
29103
29363
|
json_string: "JSON niz",
|
|
29104
29364
|
e164: "E.164 \u0161tevilka",
|
|
29105
29365
|
credit_card: "\u0161tevilka kreditne kartice",
|
|
29366
|
+
currency_code: "koda valute",
|
|
29367
|
+
iban: "IBAN",
|
|
29106
29368
|
jwt: "JWT",
|
|
29107
29369
|
template_literal: "vnos"
|
|
29108
29370
|
};
|
|
@@ -29215,6 +29477,8 @@ var error49 = () => {
|
|
|
29215
29477
|
json_string: "JSON-str\xE4ng",
|
|
29216
29478
|
e164: "E.164-nummer",
|
|
29217
29479
|
credit_card: "kreditkortsnummer",
|
|
29480
|
+
currency_code: "valutakod",
|
|
29481
|
+
iban: "IBAN",
|
|
29218
29482
|
jwt: "JWT",
|
|
29219
29483
|
template_literal: "mall-literal"
|
|
29220
29484
|
};
|
|
@@ -29328,6 +29592,8 @@ var error50 = () => {
|
|
|
29328
29592
|
json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
|
|
29329
29593
|
e164: "E.164 \u0B8E\u0BA3\u0BCD",
|
|
29330
29594
|
credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
|
|
29595
|
+
currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
|
|
29596
|
+
iban: "IBAN",
|
|
29331
29597
|
jwt: "JWT",
|
|
29332
29598
|
template_literal: "input"
|
|
29333
29599
|
};
|
|
@@ -29400,8 +29666,124 @@ function ta_default() {
|
|
|
29400
29666
|
localeError: error50()
|
|
29401
29667
|
};
|
|
29402
29668
|
}
|
|
29403
|
-
// node_modules/zod/v4/locales/
|
|
29669
|
+
// node_modules/zod/v4/locales/tg.js
|
|
29404
29670
|
var error51 = () => {
|
|
29671
|
+
const Sizable = {
|
|
29672
|
+
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
29673
|
+
file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
29674
|
+
array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
29675
|
+
set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
29676
|
+
map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
|
|
29677
|
+
};
|
|
29678
|
+
function getSizing(origin) {
|
|
29679
|
+
return Sizable[origin] ?? null;
|
|
29680
|
+
}
|
|
29681
|
+
const FormatDictionary = {
|
|
29682
|
+
regex: "\u0432\u0443\u0440\u0443\u0434",
|
|
29683
|
+
email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
|
|
29684
|
+
url: "URL",
|
|
29685
|
+
emoji: "\u044D\u043C\u043E\u04B7\u0438",
|
|
29686
|
+
uuid: "UUID",
|
|
29687
|
+
uuidv4: "UUIDv4",
|
|
29688
|
+
uuidv6: "UUIDv6",
|
|
29689
|
+
nanoid: "nanoid",
|
|
29690
|
+
guid: "GUID",
|
|
29691
|
+
cuid: "cuid",
|
|
29692
|
+
cuid2: "cuid2",
|
|
29693
|
+
ulid: "ULID",
|
|
29694
|
+
xid: "XID",
|
|
29695
|
+
ksuid: "KSUID",
|
|
29696
|
+
datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
|
|
29697
|
+
date: "\u0441\u0430\u043D\u0430\u0438 ISO",
|
|
29698
|
+
time: "\u0432\u0430\u049B\u0442\u0438 ISO",
|
|
29699
|
+
duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
|
|
29700
|
+
ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
|
|
29701
|
+
ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
|
|
29702
|
+
mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
|
|
29703
|
+
cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
|
|
29704
|
+
cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
|
|
29705
|
+
base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
|
|
29706
|
+
base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
|
|
29707
|
+
json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
|
|
29708
|
+
e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
|
|
29709
|
+
credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
|
|
29710
|
+
currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
|
|
29711
|
+
iban: "IBAN",
|
|
29712
|
+
jwt: "JWT",
|
|
29713
|
+
template_literal: "\u0432\u0443\u0440\u0443\u0434"
|
|
29714
|
+
};
|
|
29715
|
+
const TypeDictionary = {
|
|
29716
|
+
nan: "NaN",
|
|
29717
|
+
number: "\u0440\u0430\u049B\u0430\u043C",
|
|
29718
|
+
string: "\u0441\u0430\u0442\u0440",
|
|
29719
|
+
array: "\u043C\u0430\u0441\u0441\u0438\u0432",
|
|
29720
|
+
object: "\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
29721
|
+
date: "\u0441\u0430\u043D\u0430"
|
|
29722
|
+
};
|
|
29723
|
+
return (issue2) => {
|
|
29724
|
+
switch (issue2.code) {
|
|
29725
|
+
case "invalid_type": {
|
|
29726
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
29727
|
+
const receivedType = parsedType(issue2.input);
|
|
29728
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
29729
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${expected} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${received} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`;
|
|
29730
|
+
}
|
|
29731
|
+
case "invalid_value":
|
|
29732
|
+
if (issue2.values.length === 1)
|
|
29733
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${stringifyPrimitive(issue2.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
29734
|
+
return `\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${joinValues(issue2.values, "|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
29735
|
+
case "too_big": {
|
|
29736
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
29737
|
+
const sizing = getSizing(issue2.origin);
|
|
29738
|
+
if (sizing)
|
|
29739
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
29740
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
29741
|
+
}
|
|
29742
|
+
case "too_small": {
|
|
29743
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
29744
|
+
const sizing = getSizing(issue2.origin);
|
|
29745
|
+
if (sizing)
|
|
29746
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
29747
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
29748
|
+
}
|
|
29749
|
+
case "invalid_format": {
|
|
29750
|
+
const _issue = issue2;
|
|
29751
|
+
if (_issue.format === "starts_with")
|
|
29752
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`;
|
|
29753
|
+
if (_issue.format === "ends_with")
|
|
29754
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`;
|
|
29755
|
+
if (_issue.format === "includes")
|
|
29756
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${_issue.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`;
|
|
29757
|
+
if (_issue.format === "regex")
|
|
29758
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${_issue.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`;
|
|
29759
|
+
return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
29760
|
+
}
|
|
29761
|
+
case "not_multiple_of":
|
|
29762
|
+
return `\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${issue2.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;
|
|
29763
|
+
case "unrecognized_keys":
|
|
29764
|
+
return `\u041A\u0430\u043B\u0438\u0434${issue2.keys.length > 1 ? "\u04B3\u043E\u0438" : "\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${joinValues(issue2.keys, ", ")}`;
|
|
29765
|
+
case "invalid_key":
|
|
29766
|
+
return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
29767
|
+
case "invalid_union":
|
|
29768
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
29769
|
+
const opts = issue2.options.map((o2) => `'${o2}'`).join(" | ");
|
|
29770
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${opts} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
29771
|
+
}
|
|
29772
|
+
return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
|
|
29773
|
+
case "invalid_element":
|
|
29774
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
29775
|
+
default:
|
|
29776
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
29777
|
+
}
|
|
29778
|
+
};
|
|
29779
|
+
};
|
|
29780
|
+
function tg_default() {
|
|
29781
|
+
return {
|
|
29782
|
+
localeError: error51()
|
|
29783
|
+
};
|
|
29784
|
+
}
|
|
29785
|
+
// node_modules/zod/v4/locales/th.js
|
|
29786
|
+
var error52 = () => {
|
|
29405
29787
|
const Sizable = {
|
|
29406
29788
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
29407
29789
|
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -29441,6 +29823,8 @@ var error51 = () => {
|
|
|
29441
29823
|
json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
|
|
29442
29824
|
e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
|
|
29443
29825
|
credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
|
|
29826
|
+
currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
|
|
29827
|
+
iban: "IBAN",
|
|
29444
29828
|
jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
|
|
29445
29829
|
template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
|
|
29446
29830
|
};
|
|
@@ -29510,11 +29894,11 @@ var error51 = () => {
|
|
|
29510
29894
|
};
|
|
29511
29895
|
function th_default() {
|
|
29512
29896
|
return {
|
|
29513
|
-
localeError:
|
|
29897
|
+
localeError: error52()
|
|
29514
29898
|
};
|
|
29515
29899
|
}
|
|
29516
29900
|
// node_modules/zod/v4/locales/tk.js
|
|
29517
|
-
var
|
|
29901
|
+
var error53 = () => {
|
|
29518
29902
|
const Sizable = {
|
|
29519
29903
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
29520
29904
|
file: { unit: "ba\xFDt", verb: "bolmaly" },
|
|
@@ -29554,6 +29938,8 @@ var error52 = () => {
|
|
|
29554
29938
|
json_string: "JSON setiri",
|
|
29555
29939
|
e164: "E.164 nomeri",
|
|
29556
29940
|
credit_card: "kredit kartyny\u0148 nomeri",
|
|
29941
|
+
currency_code: "wal\xFDuta kody",
|
|
29942
|
+
iban: "IBAN",
|
|
29557
29943
|
jwt: "JWT",
|
|
29558
29944
|
template_literal: "\u015Fablon"
|
|
29559
29945
|
};
|
|
@@ -29615,11 +30001,11 @@ var error52 = () => {
|
|
|
29615
30001
|
};
|
|
29616
30002
|
function tk_default() {
|
|
29617
30003
|
return {
|
|
29618
|
-
localeError:
|
|
30004
|
+
localeError: error53()
|
|
29619
30005
|
};
|
|
29620
30006
|
}
|
|
29621
30007
|
// node_modules/zod/v4/locales/tr.js
|
|
29622
|
-
var
|
|
30008
|
+
var error54 = () => {
|
|
29623
30009
|
const Sizable = {
|
|
29624
30010
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
29625
30011
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -29659,6 +30045,8 @@ var error53 = () => {
|
|
|
29659
30045
|
json_string: "JSON dizesi",
|
|
29660
30046
|
e164: "E.164 say\u0131s\u0131",
|
|
29661
30047
|
credit_card: "kredi kart\u0131 numaras\u0131",
|
|
30048
|
+
currency_code: "para birimi kodu",
|
|
30049
|
+
iban: "IBAN",
|
|
29662
30050
|
jwt: "JWT",
|
|
29663
30051
|
template_literal: "\u015Eablon dizesi"
|
|
29664
30052
|
};
|
|
@@ -29723,11 +30111,11 @@ var error53 = () => {
|
|
|
29723
30111
|
};
|
|
29724
30112
|
function tr_default() {
|
|
29725
30113
|
return {
|
|
29726
|
-
localeError:
|
|
30114
|
+
localeError: error54()
|
|
29727
30115
|
};
|
|
29728
30116
|
}
|
|
29729
30117
|
// node_modules/zod/v4/locales/uk.js
|
|
29730
|
-
var
|
|
30118
|
+
var error55 = () => {
|
|
29731
30119
|
const Sizable = {
|
|
29732
30120
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
29733
30121
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -29767,6 +30155,8 @@ var error54 = () => {
|
|
|
29767
30155
|
json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
|
|
29768
30156
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
29769
30157
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
|
|
30158
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
|
|
30159
|
+
iban: "IBAN",
|
|
29770
30160
|
jwt: "JWT",
|
|
29771
30161
|
template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
|
|
29772
30162
|
};
|
|
@@ -29834,7 +30224,7 @@ var error54 = () => {
|
|
|
29834
30224
|
};
|
|
29835
30225
|
function uk_default() {
|
|
29836
30226
|
return {
|
|
29837
|
-
localeError:
|
|
30227
|
+
localeError: error55()
|
|
29838
30228
|
};
|
|
29839
30229
|
}
|
|
29840
30230
|
|
|
@@ -29843,7 +30233,7 @@ function ua_default() {
|
|
|
29843
30233
|
return uk_default();
|
|
29844
30234
|
}
|
|
29845
30235
|
// node_modules/zod/v4/locales/ur.js
|
|
29846
|
-
var
|
|
30236
|
+
var error56 = () => {
|
|
29847
30237
|
const Sizable = {
|
|
29848
30238
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
29849
30239
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -29883,6 +30273,8 @@ var error55 = () => {
|
|
|
29883
30273
|
json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
|
|
29884
30274
|
e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
|
|
29885
30275
|
credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
|
|
30276
|
+
currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
|
|
30277
|
+
iban: "IBAN",
|
|
29886
30278
|
jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
|
|
29887
30279
|
template_literal: "\u0627\u0646 \u067E\u0679"
|
|
29888
30280
|
};
|
|
@@ -29952,11 +30344,11 @@ var error55 = () => {
|
|
|
29952
30344
|
};
|
|
29953
30345
|
function ur_default() {
|
|
29954
30346
|
return {
|
|
29955
|
-
localeError:
|
|
30347
|
+
localeError: error56()
|
|
29956
30348
|
};
|
|
29957
30349
|
}
|
|
29958
30350
|
// node_modules/zod/v4/locales/uz.js
|
|
29959
|
-
var
|
|
30351
|
+
var error57 = () => {
|
|
29960
30352
|
const Sizable = {
|
|
29961
30353
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
29962
30354
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -29996,6 +30388,8 @@ var error56 = () => {
|
|
|
29996
30388
|
json_string: "JSON satr",
|
|
29997
30389
|
e164: "E.164 raqam",
|
|
29998
30390
|
credit_card: "kredit karta raqami",
|
|
30391
|
+
currency_code: "valyuta kodi",
|
|
30392
|
+
iban: "IBAN",
|
|
29999
30393
|
jwt: "JWT",
|
|
30000
30394
|
template_literal: "kirish"
|
|
30001
30395
|
};
|
|
@@ -30063,11 +30457,11 @@ var error56 = () => {
|
|
|
30063
30457
|
};
|
|
30064
30458
|
function uz_default() {
|
|
30065
30459
|
return {
|
|
30066
|
-
localeError:
|
|
30460
|
+
localeError: error57()
|
|
30067
30461
|
};
|
|
30068
30462
|
}
|
|
30069
30463
|
// node_modules/zod/v4/locales/vi.js
|
|
30070
|
-
var
|
|
30464
|
+
var error58 = () => {
|
|
30071
30465
|
const Sizable = {
|
|
30072
30466
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
30073
30467
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -30107,6 +30501,8 @@ var error57 = () => {
|
|
|
30107
30501
|
json_string: "chu\u1ED7i JSON",
|
|
30108
30502
|
e164: "s\u1ED1 E.164",
|
|
30109
30503
|
credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
|
|
30504
|
+
currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
|
|
30505
|
+
iban: "IBAN",
|
|
30110
30506
|
jwt: "JWT",
|
|
30111
30507
|
template_literal: "\u0111\u1EA7u v\xE0o"
|
|
30112
30508
|
};
|
|
@@ -30174,11 +30570,11 @@ var error57 = () => {
|
|
|
30174
30570
|
};
|
|
30175
30571
|
function vi_default() {
|
|
30176
30572
|
return {
|
|
30177
|
-
localeError:
|
|
30573
|
+
localeError: error58()
|
|
30178
30574
|
};
|
|
30179
30575
|
}
|
|
30180
30576
|
// node_modules/zod/v4/locales/zh-CN.js
|
|
30181
|
-
var
|
|
30577
|
+
var error59 = () => {
|
|
30182
30578
|
const Sizable = {
|
|
30183
30579
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
30184
30580
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -30218,6 +30614,8 @@ var error58 = () => {
|
|
|
30218
30614
|
json_string: "JSON\u5B57\u7B26\u4E32",
|
|
30219
30615
|
e164: "E.164\u53F7\u7801",
|
|
30220
30616
|
credit_card: "\u4FE1\u7528\u5361\u53F7",
|
|
30617
|
+
currency_code: "\u8D27\u5E01\u4EE3\u7801",
|
|
30618
|
+
iban: "IBAN",
|
|
30221
30619
|
jwt: "JWT",
|
|
30222
30620
|
template_literal: "\u8F93\u5165"
|
|
30223
30621
|
};
|
|
@@ -30286,11 +30684,11 @@ var error58 = () => {
|
|
|
30286
30684
|
};
|
|
30287
30685
|
function zh_CN_default() {
|
|
30288
30686
|
return {
|
|
30289
|
-
localeError:
|
|
30687
|
+
localeError: error59()
|
|
30290
30688
|
};
|
|
30291
30689
|
}
|
|
30292
30690
|
// node_modules/zod/v4/locales/zh-TW.js
|
|
30293
|
-
var
|
|
30691
|
+
var error60 = () => {
|
|
30294
30692
|
const Sizable = {
|
|
30295
30693
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
30296
30694
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -30330,6 +30728,8 @@ var error59 = () => {
|
|
|
30330
30728
|
json_string: "JSON \u5B57\u4E32",
|
|
30331
30729
|
e164: "E.164 \u6578\u503C",
|
|
30332
30730
|
credit_card: "\u4FE1\u7528\u5361\u865F",
|
|
30731
|
+
currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
|
|
30732
|
+
iban: "IBAN",
|
|
30333
30733
|
jwt: "JWT",
|
|
30334
30734
|
template_literal: "\u8F38\u5165"
|
|
30335
30735
|
};
|
|
@@ -30396,11 +30796,11 @@ var error59 = () => {
|
|
|
30396
30796
|
};
|
|
30397
30797
|
function zh_TW_default() {
|
|
30398
30798
|
return {
|
|
30399
|
-
localeError:
|
|
30799
|
+
localeError: error60()
|
|
30400
30800
|
};
|
|
30401
30801
|
}
|
|
30402
30802
|
// node_modules/zod/v4/locales/yo.js
|
|
30403
|
-
var
|
|
30803
|
+
var error61 = () => {
|
|
30404
30804
|
const Sizable = {
|
|
30405
30805
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
30406
30806
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -30440,6 +30840,8 @@ var error60 = () => {
|
|
|
30440
30840
|
json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
|
|
30441
30841
|
e164: "n\u1ECD\u0301mb\xE0 E.164",
|
|
30442
30842
|
credit_card: "n\u1ECDmba kaadi gbese",
|
|
30843
|
+
currency_code: "koodu ow\xF3",
|
|
30844
|
+
iban: "IBAN",
|
|
30443
30845
|
jwt: "JWT",
|
|
30444
30846
|
template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
|
|
30445
30847
|
};
|
|
@@ -30506,7 +30908,7 @@ var error60 = () => {
|
|
|
30506
30908
|
};
|
|
30507
30909
|
function yo_default() {
|
|
30508
30910
|
return {
|
|
30509
|
-
localeError:
|
|
30911
|
+
localeError: error61()
|
|
30510
30912
|
};
|
|
30511
30913
|
}
|
|
30512
30914
|
// node_modules/zod/v4/core/registries.js
|
|
@@ -30587,31 +30989,8 @@ function compileValidator(schema, parser2) {
|
|
|
30587
30989
|
function compile(schema, options) {
|
|
30588
30990
|
try {
|
|
30589
30991
|
const parser2 = compileFn(schema);
|
|
30590
|
-
const clone2 =
|
|
30591
|
-
const liveRun = schema._zod.run;
|
|
30592
|
-
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
30593
|
-
const wrapped = (payload, ctx) => {
|
|
30594
|
-
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
30595
|
-
return originalRun(payload, ctx);
|
|
30596
|
-
}
|
|
30597
|
-
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
30598
|
-
return originalRun(payload, ctx);
|
|
30599
|
-
}
|
|
30600
|
-
const out = parser2(payload.value);
|
|
30601
|
-
if (out !== INVALID) {
|
|
30602
|
-
payload.value = out;
|
|
30603
|
-
return payload;
|
|
30604
|
-
}
|
|
30605
|
-
if (ctx)
|
|
30606
|
-
ctx[FALLBACK_FLAG] = true;
|
|
30607
|
-
return originalRun(payload, ctx);
|
|
30608
|
-
};
|
|
30609
|
-
wrapped.__originalRun = originalRun;
|
|
30610
|
-
clone2._zod.bag.fallbackRun = originalRun;
|
|
30992
|
+
const clone2 = withParser(schema, parser2);
|
|
30611
30993
|
clone2._zod.bag.validator = compileValidator(schema, parser2);
|
|
30612
|
-
clone2._zod.run = wrapped;
|
|
30613
|
-
if (!liveRun.__originalRun)
|
|
30614
|
-
installCompiledUserMethods(clone2, schema, parser2);
|
|
30615
30994
|
return clone2;
|
|
30616
30995
|
} catch (err) {
|
|
30617
30996
|
if (options?.strict)
|
|
@@ -30619,6 +30998,37 @@ function compile(schema, options) {
|
|
|
30619
30998
|
return schema;
|
|
30620
30999
|
}
|
|
30621
31000
|
}
|
|
31001
|
+
function withParser(schema, parser2) {
|
|
31002
|
+
if (isRecursiveSchema(schema)) {
|
|
31003
|
+
throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
|
|
31004
|
+
}
|
|
31005
|
+
const clone2 = clone(schema);
|
|
31006
|
+
const liveRun = schema._zod.run;
|
|
31007
|
+
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
31008
|
+
const wrapped = (payload, ctx) => {
|
|
31009
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
31010
|
+
return originalRun(payload, ctx);
|
|
31011
|
+
}
|
|
31012
|
+
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
31013
|
+
return originalRun(payload, ctx);
|
|
31014
|
+
}
|
|
31015
|
+
const out = parser2(payload.value);
|
|
31016
|
+
if (out !== INVALID) {
|
|
31017
|
+
payload.value = out;
|
|
31018
|
+
return payload;
|
|
31019
|
+
}
|
|
31020
|
+
if (ctx)
|
|
31021
|
+
ctx[FALLBACK_FLAG] = true;
|
|
31022
|
+
return originalRun(payload, ctx);
|
|
31023
|
+
};
|
|
31024
|
+
wrapped.__originalRun = originalRun;
|
|
31025
|
+
clone2._zod.bag.fallbackRun = originalRun;
|
|
31026
|
+
clone2._zod.bag.validator = parser2;
|
|
31027
|
+
clone2._zod.run = wrapped;
|
|
31028
|
+
if (!liveRun.__originalRun)
|
|
31029
|
+
installCompiledUserMethods(clone2, schema, parser2);
|
|
31030
|
+
return clone2;
|
|
31031
|
+
}
|
|
30622
31032
|
function installCompiledUserMethods(target, source, parser2) {
|
|
30623
31033
|
const targetAny = target;
|
|
30624
31034
|
const sourceAny = source;
|
|
@@ -30654,7 +31064,8 @@ function compileFn(schema, options) {
|
|
|
30654
31064
|
const ctx = {
|
|
30655
31065
|
constants: new Map,
|
|
30656
31066
|
constantCounter: 0,
|
|
30657
|
-
varCounter: 0
|
|
31067
|
+
varCounter: 0,
|
|
31068
|
+
definite: true
|
|
30658
31069
|
};
|
|
30659
31070
|
const doc = new Doc(["input"]);
|
|
30660
31071
|
const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
|
|
@@ -30679,6 +31090,7 @@ ${code}
|
|
|
30679
31090
|
if (options?.debug) {
|
|
30680
31091
|
fn.code = fullCode;
|
|
30681
31092
|
}
|
|
31093
|
+
fn.definite = ctx.definite;
|
|
30682
31094
|
return fn;
|
|
30683
31095
|
}
|
|
30684
31096
|
function addConstant(ctx, value) {
|
|
@@ -30690,6 +31102,10 @@ function addConstant(ctx, value) {
|
|
|
30690
31102
|
ctx.constants.set(name, value);
|
|
30691
31103
|
return name;
|
|
30692
31104
|
}
|
|
31105
|
+
function addUserConstant(ctx, fn) {
|
|
31106
|
+
ctx.definite = false;
|
|
31107
|
+
return addConstant(ctx, fn);
|
|
31108
|
+
}
|
|
30693
31109
|
function newVar(ctx) {
|
|
30694
31110
|
return `v${ctx.varCounter++}`;
|
|
30695
31111
|
}
|
|
@@ -30722,6 +31138,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
30722
31138
|
}
|
|
30723
31139
|
}
|
|
30724
31140
|
function emitRuntimeIsland(doc, ctx, schema, accessor) {
|
|
31141
|
+
ctx.definite = false;
|
|
30725
31142
|
const schemaConst = addConstant(ctx, schema);
|
|
30726
31143
|
const runConst = addConstant(ctx, runtimeRun);
|
|
30727
31144
|
const outVar = newVar(ctx);
|
|
@@ -30802,6 +31219,9 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
30802
31219
|
case "property":
|
|
30803
31220
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
30804
31221
|
break;
|
|
31222
|
+
case "properties":
|
|
31223
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
31224
|
+
break;
|
|
30805
31225
|
case "overwrite": {
|
|
30806
31226
|
const newAccessor = newVar(ctx);
|
|
30807
31227
|
generateOverwriteCheck(doc, ctx, check, currentAccessor, newAccessor);
|
|
@@ -30907,6 +31327,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
30907
31327
|
doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
|
|
30908
31328
|
}
|
|
30909
31329
|
}
|
|
31330
|
+
function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
31331
|
+
if (def.when) {
|
|
31332
|
+
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
31333
|
+
}
|
|
31334
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
31335
|
+
const shape = def.shape;
|
|
31336
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
31337
|
+
const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
|
|
31338
|
+
const inputVar = newVar(ctx);
|
|
31339
|
+
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
31340
|
+
compileChild(doc, ctx, shape[key], inputVar, false);
|
|
31341
|
+
}
|
|
31342
|
+
}
|
|
30910
31343
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
30911
31344
|
const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
|
|
30912
31345
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
@@ -30934,7 +31367,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
|
|
|
30934
31367
|
if (isAsyncFunction(def.fn)) {
|
|
30935
31368
|
throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
|
|
30936
31369
|
}
|
|
30937
|
-
const fnConst =
|
|
31370
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
30938
31371
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
30939
31372
|
const resVar = newVar(ctx);
|
|
30940
31373
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -30954,7 +31387,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
|
|
|
30954
31387
|
throwAsync();
|
|
30955
31388
|
return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
|
|
30956
31389
|
};
|
|
30957
|
-
const helperConst =
|
|
31390
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
30958
31391
|
const outVar = newVar(ctx);
|
|
30959
31392
|
doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
|
|
30960
31393
|
doc.write(`if (${outVar} === INVALID) return INVALID;`);
|
|
@@ -30988,7 +31421,7 @@ var PATTERN_IS_COMPLETE = new Set([
|
|
|
30988
31421
|
"uuid",
|
|
30989
31422
|
"xid"
|
|
30990
31423
|
]);
|
|
30991
|
-
function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
31424
|
+
function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
|
|
30992
31425
|
const fmt = def.format;
|
|
30993
31426
|
if (fmt === "base64") {
|
|
30994
31427
|
const validator = addConstant(ctx, isValidBase64);
|
|
@@ -31021,9 +31454,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
31021
31454
|
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
31022
31455
|
return accessor;
|
|
31023
31456
|
}
|
|
31457
|
+
if (fmt === "iban") {
|
|
31458
|
+
const validator = addConstant(ctx, isValidIBAN);
|
|
31459
|
+
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
31460
|
+
return accessor;
|
|
31461
|
+
}
|
|
31024
31462
|
const formatDef = def;
|
|
31025
31463
|
if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== undefined || formatDef.protocol !== undefined) {
|
|
31026
|
-
const parseConst = addConstant(ctx,
|
|
31464
|
+
const parseConst = addConstant(ctx, validateURL);
|
|
31027
31465
|
const defConst = addConstant(ctx, def);
|
|
31028
31466
|
const trimVar = newVar(ctx);
|
|
31029
31467
|
const urlVar = newVar(ctx);
|
|
@@ -31038,6 +31476,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
31038
31476
|
const protocolConst = addConstant(ctx, urlProtocolOk);
|
|
31039
31477
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
31040
31478
|
}
|
|
31479
|
+
if (!needsValue)
|
|
31480
|
+
return null;
|
|
31041
31481
|
const outputVar = newVar(ctx);
|
|
31042
31482
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
|
|
31043
31483
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -31096,7 +31536,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
31096
31536
|
let typeAccessor;
|
|
31097
31537
|
switch (type) {
|
|
31098
31538
|
case "string":
|
|
31099
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
31539
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
31100
31540
|
break;
|
|
31101
31541
|
case "number":
|
|
31102
31542
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -31216,12 +31656,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
31216
31656
|
return null;
|
|
31217
31657
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
31218
31658
|
}
|
|
31219
|
-
function generateStringCheck(doc, ctx, schema, accessor) {
|
|
31659
|
+
function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
31220
31660
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
31221
31661
|
const def = schema._zod.def;
|
|
31222
31662
|
if (def.format === undefined)
|
|
31223
31663
|
return accessor;
|
|
31224
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
31664
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
31225
31665
|
}
|
|
31226
31666
|
function generateNumberCheck(doc, schema, accessor) {
|
|
31227
31667
|
doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
|
|
@@ -31339,7 +31779,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
31339
31779
|
}
|
|
31340
31780
|
}
|
|
31341
31781
|
const outputVar = newVar(ctx);
|
|
31342
|
-
const hasConditionalKeys = allKeys.some((k) =>
|
|
31782
|
+
const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
|
|
31343
31783
|
if (!buildsValue) {
|
|
31344
31784
|
if (unknownKeysMode === "schema") {
|
|
31345
31785
|
const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
|
|
@@ -31366,7 +31806,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
31366
31806
|
const out = propOutputs.get(k);
|
|
31367
31807
|
if (dropsWhenAbsent(propShape[k])) {
|
|
31368
31808
|
doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
31369
|
-
} else if (
|
|
31809
|
+
} else if (mayOmitUndefined(propShape[k])) {
|
|
31370
31810
|
doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
31371
31811
|
} else {
|
|
31372
31812
|
doc.write(`${outputVar}[${kx}] = ${out};`);
|
|
@@ -31499,6 +31939,9 @@ function fastPathAcceptsAbsence(schema) {
|
|
|
31499
31939
|
function dropsWhenAbsent(schema) {
|
|
31500
31940
|
return schema._zod.optin === "optional" && schema._zod.optout === "optional";
|
|
31501
31941
|
}
|
|
31942
|
+
function mayOmitUndefined(schema) {
|
|
31943
|
+
return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
|
|
31944
|
+
}
|
|
31502
31945
|
function mayOutputUndefined(schema) {
|
|
31503
31946
|
const def = schema._zod.def;
|
|
31504
31947
|
switch (def.type) {
|
|
@@ -31841,6 +32284,7 @@ function literalEquality(ctx, accessor, value) {
|
|
|
31841
32284
|
}
|
|
31842
32285
|
function generateIntersectionCheck(doc, ctx, schema, accessor) {
|
|
31843
32286
|
const def = schema._zod.def;
|
|
32287
|
+
ctx.definite = false;
|
|
31844
32288
|
const leftOutput = compileChild(doc, ctx, def.left, accessor);
|
|
31845
32289
|
const rightOutput = compileChild(doc, ctx, def.right, accessor);
|
|
31846
32290
|
const mergeConst = addConstant(ctx, mergeValues);
|
|
@@ -31894,14 +32338,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
31894
32338
|
const keyIsBareString = keyDef.type === "string" && keyDef.format === undefined && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
|
|
31895
32339
|
if (!keyIsBareString) {
|
|
31896
32340
|
const isLoose = def.mode === "loose";
|
|
31897
|
-
const
|
|
32341
|
+
const keyFn = compileFn(def.keyType);
|
|
32342
|
+
if (keyFn.definite === false)
|
|
32343
|
+
ctx.definite = false;
|
|
32344
|
+
const keyFast = addConstant(ctx, keyFn);
|
|
31898
32345
|
const numericConst = addConstant(ctx, number);
|
|
31899
|
-
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
31900
32346
|
const outKeyVar = newVar(ctx);
|
|
31901
|
-
doc
|
|
31902
|
-
doc.indented((d) => {
|
|
31903
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
31904
|
-
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
32347
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
31905
32348
|
d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
|
|
31906
32349
|
d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
|
|
31907
32350
|
if (isLoose) {
|
|
@@ -31915,21 +32358,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
31915
32358
|
const valOutput = compileChild(d, ctx, def.valueType, valueVar);
|
|
31916
32359
|
d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
|
|
31917
32360
|
});
|
|
31918
|
-
doc.write(`}`);
|
|
31919
32361
|
return outputVar;
|
|
31920
32362
|
}
|
|
31921
|
-
|
|
31922
|
-
doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
|
|
31923
|
-
doc.indented((d) => {
|
|
31924
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
31925
|
-
d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
|
|
31926
|
-
d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
|
|
32363
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
31927
32364
|
d.write(`const ${valVar} = ${accessor}[${kVar}];`);
|
|
31928
32365
|
const valOutput = compileChild(d, ctx, def.valueType, valVar);
|
|
31929
32366
|
d.write(`${outputVar}[${kVar}] = ${valOutput};`);
|
|
32367
|
+
}, `return INVALID;`);
|
|
32368
|
+
return outputVar;
|
|
32369
|
+
}
|
|
32370
|
+
function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
32371
|
+
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
32372
|
+
const symsVar = newVar(ctx);
|
|
32373
|
+
const keysVar = newVar(ctx);
|
|
32374
|
+
const iVar = newVar(ctx);
|
|
32375
|
+
doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
|
|
32376
|
+
doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
|
|
32377
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
|
|
32378
|
+
doc.indented((d) => {
|
|
32379
|
+
d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
|
|
32380
|
+
d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
32381
|
+
body(d);
|
|
32382
|
+
});
|
|
32383
|
+
doc.write(`}`);
|
|
32384
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
|
|
32385
|
+
doc.indented((d) => {
|
|
32386
|
+
d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
|
|
32387
|
+
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
32388
|
+
if (onSymbol)
|
|
32389
|
+
d.write(onSymbol);
|
|
32390
|
+
else
|
|
32391
|
+
body(d);
|
|
31930
32392
|
});
|
|
31931
32393
|
doc.write(`}`);
|
|
31932
|
-
return outputVar;
|
|
31933
32394
|
}
|
|
31934
32395
|
function literalPropertyKey(ctx, key) {
|
|
31935
32396
|
if (typeof key === "string")
|
|
@@ -31982,7 +32443,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
|
|
|
31982
32443
|
}
|
|
31983
32444
|
function generateLazyCheck(doc, ctx, schema, accessor) {
|
|
31984
32445
|
const def = schema._zod.def;
|
|
31985
|
-
const getterConst =
|
|
32446
|
+
const getterConst = addUserConstant(ctx, def.getter);
|
|
31986
32447
|
const cacheConst = addConstant(ctx, { parser: null });
|
|
31987
32448
|
doc.write(`if (!${cacheConst}.parser) {`);
|
|
31988
32449
|
doc.indented((d) => {
|
|
@@ -32015,7 +32476,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
|
|
|
32015
32476
|
return INVALID;
|
|
32016
32477
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
32017
32478
|
};
|
|
32018
|
-
const helperConst =
|
|
32479
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
32019
32480
|
const transformedVar = newVar(ctx);
|
|
32020
32481
|
doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
|
|
32021
32482
|
doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
|
|
@@ -32033,7 +32494,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
|
|
|
32033
32494
|
if (isAsyncFunction(def.fn)) {
|
|
32034
32495
|
throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
|
|
32035
32496
|
}
|
|
32036
|
-
const fnConst =
|
|
32497
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
32037
32498
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
32038
32499
|
const resVar = newVar(ctx);
|
|
32039
32500
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -32066,7 +32527,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
|
|
|
32066
32527
|
});
|
|
32067
32528
|
doc.write(`})();`);
|
|
32068
32529
|
const innerConst = addConstant(ctx, def.innerType);
|
|
32069
|
-
const catchConst =
|
|
32530
|
+
const catchConst = addUserConstant(ctx, def.catchValue);
|
|
32070
32531
|
const catchHelperConst = addConstant(ctx, runtimeCatch);
|
|
32071
32532
|
doc.write(`if (${outputVar} === INVALID) {`);
|
|
32072
32533
|
doc.indented((d) => {
|
|
@@ -32090,7 +32551,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
32090
32551
|
return INVALID;
|
|
32091
32552
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
32092
32553
|
};
|
|
32093
|
-
const helperConst =
|
|
32554
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
32094
32555
|
const outputVar = newVar(ctx);
|
|
32095
32556
|
doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
|
|
32096
32557
|
doc.write(`if (${outputVar} === INVALID) return INVALID;`);
|
|
@@ -32099,18 +32560,16 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
32099
32560
|
return accessor;
|
|
32100
32561
|
}
|
|
32101
32562
|
// node_modules/zod/v4/core/api.js
|
|
32563
|
+
function snapshotChecks(def) {
|
|
32564
|
+
if (def.checks)
|
|
32565
|
+
def.checks = [...def.checks];
|
|
32566
|
+
return def;
|
|
32567
|
+
}
|
|
32102
32568
|
function _string(Class2, params) {
|
|
32103
|
-
return new Class2({
|
|
32104
|
-
type: "string",
|
|
32105
|
-
...normalizeParams(params)
|
|
32106
|
-
});
|
|
32569
|
+
return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
|
|
32107
32570
|
}
|
|
32108
32571
|
function _coercedString(Class2, params) {
|
|
32109
|
-
return new Class2({
|
|
32110
|
-
type: "string",
|
|
32111
|
-
coerce: true,
|
|
32112
|
-
...normalizeParams(params)
|
|
32113
|
-
});
|
|
32572
|
+
return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
|
|
32114
32573
|
}
|
|
32115
32574
|
function _email(Class2, params) {
|
|
32116
32575
|
return new Class2({
|
|
@@ -32322,6 +32781,15 @@ function _creditCard(Class2, params) {
|
|
|
32322
32781
|
...normalizeParams(params)
|
|
32323
32782
|
});
|
|
32324
32783
|
}
|
|
32784
|
+
function _iban(Class2, params) {
|
|
32785
|
+
return new Class2({
|
|
32786
|
+
type: "string",
|
|
32787
|
+
format: "iban",
|
|
32788
|
+
check: "string_format",
|
|
32789
|
+
abort: false,
|
|
32790
|
+
...normalizeParams(params)
|
|
32791
|
+
});
|
|
32792
|
+
}
|
|
32325
32793
|
function _jwt(Class2, params) {
|
|
32326
32794
|
return new Class2({
|
|
32327
32795
|
type: "string",
|
|
@@ -32375,19 +32843,10 @@ function _isoDuration(Class2, params) {
|
|
|
32375
32843
|
});
|
|
32376
32844
|
}
|
|
32377
32845
|
function _number(Class2, params) {
|
|
32378
|
-
return new Class2({
|
|
32379
|
-
type: "number",
|
|
32380
|
-
checks: [],
|
|
32381
|
-
...normalizeParams(params)
|
|
32382
|
-
});
|
|
32846
|
+
return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
|
|
32383
32847
|
}
|
|
32384
32848
|
function _coercedNumber(Class2, params) {
|
|
32385
|
-
return new Class2({
|
|
32386
|
-
type: "number",
|
|
32387
|
-
coerce: true,
|
|
32388
|
-
checks: [],
|
|
32389
|
-
...normalizeParams(params)
|
|
32390
|
-
});
|
|
32849
|
+
return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
|
|
32391
32850
|
}
|
|
32392
32851
|
function _int(Class2, params) {
|
|
32393
32852
|
return new Class2({
|
|
@@ -32685,8 +33144,12 @@ function _property(property, schema, params) {
|
|
|
32685
33144
|
...normalizeParams(params)
|
|
32686
33145
|
});
|
|
32687
33146
|
}
|
|
32688
|
-
function _properties(shape) {
|
|
32689
|
-
return
|
|
33147
|
+
function _properties(shape, params) {
|
|
33148
|
+
return new $ZodCheckProperties({
|
|
33149
|
+
check: "properties",
|
|
33150
|
+
shape,
|
|
33151
|
+
...normalizeParams(params)
|
|
33152
|
+
});
|
|
32690
33153
|
}
|
|
32691
33154
|
function _mime(types, params) {
|
|
32692
33155
|
return new $ZodCheckMimeType({
|
|
@@ -33077,7 +33540,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
|
33077
33540
|
Object.assign(json, result);
|
|
33078
33541
|
return true;
|
|
33079
33542
|
}
|
|
33080
|
-
function
|
|
33543
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
33081
33544
|
var _a3;
|
|
33082
33545
|
const def = schema._zod.def;
|
|
33083
33546
|
const seen = ctx.seen.get(schema);
|
|
@@ -33116,7 +33579,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
33116
33579
|
if (parent) {
|
|
33117
33580
|
if (!result.ref)
|
|
33118
33581
|
result.ref = parent;
|
|
33119
|
-
|
|
33582
|
+
processSchema(parent, ctx, params);
|
|
33120
33583
|
ctx.seen.get(parent).isParent = true;
|
|
33121
33584
|
}
|
|
33122
33585
|
}
|
|
@@ -33221,7 +33684,6 @@ function extractDefs(ctx, schema) {
|
|
|
33221
33684
|
if (seen.count > 1) {
|
|
33222
33685
|
if (ctx.reused === "ref") {
|
|
33223
33686
|
extractToDef(entry);
|
|
33224
|
-
continue;
|
|
33225
33687
|
}
|
|
33226
33688
|
}
|
|
33227
33689
|
}
|
|
@@ -33546,18 +34008,106 @@ function isTransforming(_schema, _ctx) {
|
|
|
33546
34008
|
}
|
|
33547
34009
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
33548
34010
|
const ctx = initializeContext({ ...params, processors });
|
|
33549
|
-
|
|
34011
|
+
processSchema(schema, ctx);
|
|
33550
34012
|
extractDefs(ctx, schema);
|
|
33551
34013
|
return finalize(ctx, schema);
|
|
33552
34014
|
};
|
|
33553
34015
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
33554
34016
|
const { libraryOptions, target } = params ?? {};
|
|
33555
34017
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
33556
|
-
|
|
34018
|
+
processSchema(schema, ctx);
|
|
33557
34019
|
extractDefs(ctx, schema);
|
|
33558
34020
|
return finalize(ctx, schema);
|
|
33559
34021
|
};
|
|
33560
34022
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
34023
|
+
var narrowMin = (agg, key, value) => {
|
|
34024
|
+
if (agg[key] === undefined || value > agg[key])
|
|
34025
|
+
agg[key] = value;
|
|
34026
|
+
};
|
|
34027
|
+
var narrowMax = (agg, key, value) => {
|
|
34028
|
+
if (agg[key] === undefined || value < agg[key])
|
|
34029
|
+
agg[key] = value;
|
|
34030
|
+
};
|
|
34031
|
+
var narrowBoth = (agg, value) => {
|
|
34032
|
+
narrowMin(agg, "minimum", value);
|
|
34033
|
+
narrowMax(agg, "maximum", value);
|
|
34034
|
+
};
|
|
34035
|
+
var addDivisor = (agg, value) => {
|
|
34036
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
34037
|
+
if (!agg.multipleOf.includes(value))
|
|
34038
|
+
agg.multipleOf.push(value);
|
|
34039
|
+
};
|
|
34040
|
+
var addPattern = (agg, pattern) => {
|
|
34041
|
+
agg.patterns ?? (agg.patterns = new Set);
|
|
34042
|
+
agg.patterns.add(pattern);
|
|
34043
|
+
};
|
|
34044
|
+
var intersectMime = (agg, mime) => {
|
|
34045
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
34046
|
+
};
|
|
34047
|
+
var setFormat = (agg, format) => {
|
|
34048
|
+
agg.format = format;
|
|
34049
|
+
if (format.includes("int"))
|
|
34050
|
+
agg.isInt = true;
|
|
34051
|
+
};
|
|
34052
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
34053
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
34054
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
34055
|
+
setFormat(agg, def.format);
|
|
34056
|
+
const [minimum, maximum] = ranges[def.format];
|
|
34057
|
+
narrowMin(agg, "minimum", minimum);
|
|
34058
|
+
narrowMax(agg, "maximum", maximum);
|
|
34059
|
+
};
|
|
34060
|
+
var contributors = {
|
|
34061
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
34062
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
34063
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
34064
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
34065
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
34066
|
+
min_length: minContributor,
|
|
34067
|
+
max_length: maxContributor,
|
|
34068
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
34069
|
+
min_size: minContributor,
|
|
34070
|
+
max_size: maxContributor,
|
|
34071
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
34072
|
+
string_format: (agg, def) => {
|
|
34073
|
+
setFormat(agg, def.format);
|
|
34074
|
+
if (def.pattern)
|
|
34075
|
+
addPattern(agg, def.pattern);
|
|
34076
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
34077
|
+
agg.contentEncoding = def.format;
|
|
34078
|
+
if (def.local || def.precision === -1)
|
|
34079
|
+
agg.laxFormat = true;
|
|
34080
|
+
},
|
|
34081
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
34082
|
+
};
|
|
34083
|
+
function aggregateChecks(schema) {
|
|
34084
|
+
const agg = {};
|
|
34085
|
+
const def = schema._zod.def;
|
|
34086
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
34087
|
+
for (const ch of list)
|
|
34088
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
34089
|
+
const bag = schema._zod.bag;
|
|
34090
|
+
if (bag.minimum !== undefined)
|
|
34091
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
34092
|
+
if (bag.exclusiveMinimum !== undefined)
|
|
34093
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
34094
|
+
if (bag.maximum !== undefined)
|
|
34095
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
34096
|
+
if (bag.exclusiveMaximum !== undefined)
|
|
34097
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
34098
|
+
if (bag.multipleOf !== undefined)
|
|
34099
|
+
addDivisor(agg, bag.multipleOf);
|
|
34100
|
+
if (bag.format !== undefined) {
|
|
34101
|
+
agg.format ?? (agg.format = bag.format);
|
|
34102
|
+
if (bag.format.includes("int"))
|
|
34103
|
+
agg.isInt = true;
|
|
34104
|
+
}
|
|
34105
|
+
if (bag.mime)
|
|
34106
|
+
intersectMime(agg, bag.mime);
|
|
34107
|
+
for (const pattern of bag.patterns ?? [])
|
|
34108
|
+
addPattern(agg, pattern);
|
|
34109
|
+
return agg;
|
|
34110
|
+
}
|
|
33561
34111
|
var formatMap = {
|
|
33562
34112
|
guid: "uuid",
|
|
33563
34113
|
url: "uri",
|
|
@@ -33565,10 +34115,15 @@ var formatMap = {
|
|
|
33565
34115
|
json_string: "json-string",
|
|
33566
34116
|
regex: ""
|
|
33567
34117
|
};
|
|
34118
|
+
var exactPatterns = new Map([
|
|
34119
|
+
[base64Charset, base64],
|
|
34120
|
+
[base64urlCharset, base64url]
|
|
34121
|
+
]);
|
|
34122
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
33568
34123
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
33569
34124
|
const json = _json;
|
|
33570
34125
|
json.type = "string";
|
|
33571
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
34126
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
33572
34127
|
if (typeof minimum === "number")
|
|
33573
34128
|
json.minLength = minimum;
|
|
33574
34129
|
if (typeof maximum === "number")
|
|
@@ -33584,7 +34139,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
33584
34139
|
if (contentEncoding)
|
|
33585
34140
|
json.contentEncoding = contentEncoding;
|
|
33586
34141
|
if (patterns && patterns.size > 0) {
|
|
33587
|
-
const patternList = [...patterns];
|
|
34142
|
+
const patternList = [...patterns].map(exactPattern);
|
|
33588
34143
|
if (patternList.length === 1)
|
|
33589
34144
|
json.pattern = patternList[0].source;
|
|
33590
34145
|
else if (patternList.length > 1) {
|
|
@@ -33599,11 +34154,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
33599
34154
|
};
|
|
33600
34155
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
33601
34156
|
const json = _json;
|
|
33602
|
-
const { minimum, maximum,
|
|
33603
|
-
|
|
33604
|
-
json.type = "integer";
|
|
33605
|
-
else
|
|
33606
|
-
json.type = "number";
|
|
34157
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
34158
|
+
json.type = isInt ? "integer" : "number";
|
|
33607
34159
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
33608
34160
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
33609
34161
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -33627,11 +34179,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
33627
34179
|
} else if (typeof maximum === "number") {
|
|
33628
34180
|
json.maximum = maximum;
|
|
33629
34181
|
}
|
|
33630
|
-
if (
|
|
33631
|
-
|
|
33632
|
-
|
|
33633
|
-
|
|
33634
|
-
|
|
34182
|
+
if (multipleOf) {
|
|
34183
|
+
const divisors = new Set;
|
|
34184
|
+
for (const divisor of multipleOf) {
|
|
34185
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
34186
|
+
divisors.add(Math.abs(divisor));
|
|
34187
|
+
else
|
|
34188
|
+
handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
34189
|
+
}
|
|
34190
|
+
const [first, ...rest] = divisors;
|
|
34191
|
+
if (first !== undefined)
|
|
34192
|
+
json.multipleOf = first;
|
|
34193
|
+
if (rest.length)
|
|
34194
|
+
json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
33635
34195
|
}
|
|
33636
34196
|
};
|
|
33637
34197
|
var booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -33731,27 +34291,22 @@ var templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
|
33731
34291
|
};
|
|
33732
34292
|
var fileProcessor = (schema, _ctx, json, _params) => {
|
|
33733
34293
|
const _json = json;
|
|
33734
|
-
|
|
33735
|
-
|
|
33736
|
-
|
|
33737
|
-
|
|
33738
|
-
};
|
|
33739
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
34294
|
+
_json.type = "string";
|
|
34295
|
+
_json.format = "binary";
|
|
34296
|
+
_json.contentEncoding = "binary";
|
|
34297
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
33740
34298
|
if (minimum !== undefined)
|
|
33741
|
-
|
|
34299
|
+
_json.minLength = minimum;
|
|
33742
34300
|
if (maximum !== undefined)
|
|
33743
|
-
|
|
33744
|
-
if (mime)
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33751
|
-
}
|
|
33752
|
-
} else {
|
|
33753
|
-
Object.assign(_json, file);
|
|
33754
|
-
}
|
|
34301
|
+
_json.maxLength = maximum;
|
|
34302
|
+
if (!mime)
|
|
34303
|
+
return;
|
|
34304
|
+
if (mime.length === 0)
|
|
34305
|
+
_json.not = {};
|
|
34306
|
+
else if (mime.length === 1)
|
|
34307
|
+
_json.contentMediaType = mime[0];
|
|
34308
|
+
else
|
|
34309
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
33755
34310
|
};
|
|
33756
34311
|
var successProcessor = (_schema, _ctx, json, _params) => {
|
|
33757
34312
|
json.type = "boolean";
|
|
@@ -33774,13 +34329,13 @@ var setProcessor = (schema, ctx, json, params) => {
|
|
|
33774
34329
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
33775
34330
|
const json = _json;
|
|
33776
34331
|
const def = schema._zod.def;
|
|
33777
|
-
const { minimum, maximum } = schema
|
|
34332
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
33778
34333
|
if (typeof minimum === "number")
|
|
33779
34334
|
json.minItems = minimum;
|
|
33780
34335
|
if (typeof maximum === "number")
|
|
33781
34336
|
json.maxItems = maximum;
|
|
33782
34337
|
json.type = "array";
|
|
33783
|
-
json.items =
|
|
34338
|
+
json.items = processSchema(def.element, ctx, {
|
|
33784
34339
|
...params,
|
|
33785
34340
|
path: [...params.path, "items"]
|
|
33786
34341
|
});
|
|
@@ -33806,22 +34361,20 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
33806
34361
|
json.type = "object";
|
|
33807
34362
|
json.properties = {};
|
|
33808
34363
|
for (const key in shape) {
|
|
33809
|
-
assignProp(json.properties, key,
|
|
34364
|
+
assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
33810
34365
|
...params,
|
|
33811
34366
|
path: [...params.path, "properties", key]
|
|
33812
34367
|
}));
|
|
33813
34368
|
}
|
|
33814
|
-
const
|
|
33815
|
-
const
|
|
34369
|
+
const requiredKeys = [];
|
|
34370
|
+
for (const key of Object.keys(shape)) {
|
|
33816
34371
|
const field2 = def.shape[key];
|
|
33817
|
-
if (ctx.io === "input") {
|
|
33818
|
-
|
|
33819
|
-
} else {
|
|
33820
|
-
return field2._zod.optout === undefined;
|
|
34372
|
+
if (ctx.io === "input" ? inputOptin(field2) === undefined : field2._zod.optout === undefined) {
|
|
34373
|
+
requiredKeys.push(key);
|
|
33821
34374
|
}
|
|
33822
|
-
}
|
|
33823
|
-
if (requiredKeys.
|
|
33824
|
-
json.required =
|
|
34375
|
+
}
|
|
34376
|
+
if (requiredKeys.length > 0) {
|
|
34377
|
+
json.required = requiredKeys;
|
|
33825
34378
|
}
|
|
33826
34379
|
if (def.catchall?._zod.def.type === "never") {
|
|
33827
34380
|
json.additionalProperties = false;
|
|
@@ -33829,7 +34382,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
33829
34382
|
if (ctx.io === "output")
|
|
33830
34383
|
json.additionalProperties = false;
|
|
33831
34384
|
} else if (def.catchall) {
|
|
33832
|
-
json.additionalProperties =
|
|
34385
|
+
json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
33833
34386
|
...params,
|
|
33834
34387
|
path: [...params.path, "additionalProperties"]
|
|
33835
34388
|
});
|
|
@@ -33838,7 +34391,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
33838
34391
|
var unionProcessor = (schema, ctx, json, params) => {
|
|
33839
34392
|
const def = schema._zod.def;
|
|
33840
34393
|
const isExclusive = def.inclusive === false;
|
|
33841
|
-
const options = def.options.map((x, i) =>
|
|
34394
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
33842
34395
|
...params,
|
|
33843
34396
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
33844
34397
|
}));
|
|
@@ -33850,11 +34403,11 @@ var unionProcessor = (schema, ctx, json, params) => {
|
|
|
33850
34403
|
};
|
|
33851
34404
|
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
33852
34405
|
const def = schema._zod.def;
|
|
33853
|
-
const a =
|
|
34406
|
+
const a = processSchema(def.left, ctx, {
|
|
33854
34407
|
...params,
|
|
33855
34408
|
path: [...params.path, "allOf", 0]
|
|
33856
34409
|
});
|
|
33857
|
-
const b =
|
|
34410
|
+
const b = processSchema(def.right, ctx, {
|
|
33858
34411
|
...params,
|
|
33859
34412
|
path: [...params.path, "allOf", 1]
|
|
33860
34413
|
});
|
|
@@ -33872,11 +34425,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
33872
34425
|
json.type = "array";
|
|
33873
34426
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
33874
34427
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
33875
|
-
const prefixItems = def.items.map((x, i) =>
|
|
34428
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
33876
34429
|
...params,
|
|
33877
34430
|
path: [...params.path, prefixPath, i]
|
|
33878
34431
|
}));
|
|
33879
|
-
const rest = def.rest ?
|
|
34432
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
33880
34433
|
...params,
|
|
33881
34434
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
33882
34435
|
}) : null;
|
|
@@ -33924,7 +34477,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
33924
34477
|
if (isClosed)
|
|
33925
34478
|
json.maxItems = maxItems;
|
|
33926
34479
|
}
|
|
33927
|
-
const { minimum, maximum } = schema
|
|
34480
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
33928
34481
|
if (typeof minimum === "number")
|
|
33929
34482
|
json.minItems = minimum;
|
|
33930
34483
|
if (typeof maximum === "number")
|
|
@@ -33998,20 +34551,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
33998
34551
|
const def = schema._zod.def;
|
|
33999
34552
|
json.type = "object";
|
|
34000
34553
|
const keyType = def.keyType;
|
|
34001
|
-
const
|
|
34002
|
-
const patterns = keyBag?.patterns;
|
|
34554
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
34003
34555
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
34004
|
-
const valueSchema =
|
|
34556
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
34005
34557
|
...params,
|
|
34006
34558
|
path: [...params.path, "patternProperties", "*"]
|
|
34007
34559
|
});
|
|
34008
34560
|
json.patternProperties = {};
|
|
34009
34561
|
for (const pattern of patterns) {
|
|
34010
|
-
assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
34562
|
+
assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
34011
34563
|
}
|
|
34012
34564
|
} else {
|
|
34013
34565
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
34014
|
-
json.propertyNames =
|
|
34566
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
34015
34567
|
...params,
|
|
34016
34568
|
path: [...params.path, "propertyNames"]
|
|
34017
34569
|
});
|
|
@@ -34023,7 +34575,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
34023
34575
|
}
|
|
34024
34576
|
pending.push(schema);
|
|
34025
34577
|
}
|
|
34026
|
-
json.additionalProperties =
|
|
34578
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
34027
34579
|
...params,
|
|
34028
34580
|
path: [...params.path, "additionalProperties"]
|
|
34029
34581
|
});
|
|
@@ -34039,7 +34591,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
34039
34591
|
};
|
|
34040
34592
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
34041
34593
|
const def = schema._zod.def;
|
|
34042
|
-
const inner =
|
|
34594
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
34043
34595
|
const seen = ctx.seen.get(schema);
|
|
34044
34596
|
if (ctx.target === "openapi-3.0") {
|
|
34045
34597
|
seen.ref = def.innerType;
|
|
@@ -34050,7 +34602,7 @@ var nullableProcessor = (schema, ctx, json, params) => {
|
|
|
34050
34602
|
};
|
|
34051
34603
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
34052
34604
|
const def = schema._zod.def;
|
|
34053
|
-
|
|
34605
|
+
processSchema(def.innerType, ctx, params);
|
|
34054
34606
|
const seen = ctx.seen.get(schema);
|
|
34055
34607
|
seen.ref = def.innerType;
|
|
34056
34608
|
};
|
|
@@ -34070,7 +34622,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
|
|
|
34070
34622
|
}
|
|
34071
34623
|
var defaultProcessor = (schema, ctx, json, params) => {
|
|
34072
34624
|
const def = schema._zod.def;
|
|
34073
|
-
|
|
34625
|
+
processSchema(def.innerType, ctx, params);
|
|
34074
34626
|
const seen = ctx.seen.get(schema);
|
|
34075
34627
|
seen.ref = def.innerType;
|
|
34076
34628
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -34079,7 +34631,7 @@ var defaultProcessor = (schema, ctx, json, params) => {
|
|
|
34079
34631
|
};
|
|
34080
34632
|
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
34081
34633
|
const def = schema._zod.def;
|
|
34082
|
-
|
|
34634
|
+
processSchema(def.innerType, ctx, params);
|
|
34083
34635
|
const seen = ctx.seen.get(schema);
|
|
34084
34636
|
seen.ref = def.innerType;
|
|
34085
34637
|
if (ctx.io !== "input")
|
|
@@ -34090,7 +34642,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
34090
34642
|
};
|
|
34091
34643
|
var catchProcessor = (schema, ctx, json, params) => {
|
|
34092
34644
|
const def = schema._zod.def;
|
|
34093
|
-
|
|
34645
|
+
processSchema(def.innerType, ctx, params);
|
|
34094
34646
|
const seen = ctx.seen.get(schema);
|
|
34095
34647
|
seen.ref = def.innerType;
|
|
34096
34648
|
let catchValue;
|
|
@@ -34106,32 +34658,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
34106
34658
|
const def = schema._zod.def;
|
|
34107
34659
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
34108
34660
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
34109
|
-
|
|
34661
|
+
processSchema(innerType, ctx, params);
|
|
34110
34662
|
const seen = ctx.seen.get(schema);
|
|
34111
34663
|
seen.ref = innerType;
|
|
34112
34664
|
};
|
|
34113
34665
|
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
34114
34666
|
const def = schema._zod.def;
|
|
34115
|
-
|
|
34667
|
+
processSchema(def.innerType, ctx, params);
|
|
34116
34668
|
const seen = ctx.seen.get(schema);
|
|
34117
34669
|
seen.ref = def.innerType;
|
|
34118
34670
|
json.readOnly = true;
|
|
34119
34671
|
};
|
|
34120
34672
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
34121
34673
|
const def = schema._zod.def;
|
|
34122
|
-
|
|
34674
|
+
processSchema(def.innerType, ctx, params);
|
|
34123
34675
|
const seen = ctx.seen.get(schema);
|
|
34124
34676
|
seen.ref = def.innerType;
|
|
34125
34677
|
};
|
|
34126
34678
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
34127
34679
|
const def = schema._zod.def;
|
|
34128
|
-
|
|
34680
|
+
processSchema(def.innerType, ctx, params);
|
|
34129
34681
|
const seen = ctx.seen.get(schema);
|
|
34130
34682
|
seen.ref = def.innerType;
|
|
34131
34683
|
};
|
|
34132
34684
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
34133
34685
|
const innerType = schema._zod.innerType;
|
|
34134
|
-
|
|
34686
|
+
processSchema(innerType, ctx, params);
|
|
34135
34687
|
const seen = ctx.seen.get(schema);
|
|
34136
34688
|
seen.ref = innerType;
|
|
34137
34689
|
};
|
|
@@ -34183,7 +34735,7 @@ function toJSONSchema(input, params) {
|
|
|
34183
34735
|
const defs = {};
|
|
34184
34736
|
for (const entry of registry2._idmap.entries()) {
|
|
34185
34737
|
const [_, schema] = entry;
|
|
34186
|
-
|
|
34738
|
+
processSchema(schema, ctx2);
|
|
34187
34739
|
}
|
|
34188
34740
|
const schemas = {};
|
|
34189
34741
|
const external = {
|
|
@@ -34206,7 +34758,7 @@ function toJSONSchema(input, params) {
|
|
|
34206
34758
|
return { schemas };
|
|
34207
34759
|
}
|
|
34208
34760
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
34209
|
-
|
|
34761
|
+
processSchema(input, ctx);
|
|
34210
34762
|
extractDefs(ctx, input);
|
|
34211
34763
|
return finalize(ctx, input);
|
|
34212
34764
|
}
|
|
@@ -34252,7 +34804,7 @@ class JSONSchemaGenerator {
|
|
|
34252
34804
|
});
|
|
34253
34805
|
}
|
|
34254
34806
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
34255
|
-
return
|
|
34807
|
+
return processSchema(schema, this.ctx, _params);
|
|
34256
34808
|
}
|
|
34257
34809
|
emit(schema, _params) {
|
|
34258
34810
|
if (_params) {
|
|
@@ -34339,6 +34891,7 @@ __export(exports_schemas2, {
|
|
|
34339
34891
|
int32: () => int32,
|
|
34340
34892
|
int: () => int,
|
|
34341
34893
|
instanceof: () => _instanceof,
|
|
34894
|
+
iban: () => iban2,
|
|
34342
34895
|
httpUrl: () => httpUrl,
|
|
34343
34896
|
hostname: () => hostname3,
|
|
34344
34897
|
hex: () => hex2,
|
|
@@ -34357,6 +34910,7 @@ __export(exports_schemas2, {
|
|
|
34357
34910
|
describe: () => describe2,
|
|
34358
34911
|
date: () => date2,
|
|
34359
34912
|
custom: () => custom,
|
|
34913
|
+
currencyCode: () => currencyCode2,
|
|
34360
34914
|
cuid2: () => cuid22,
|
|
34361
34915
|
cuid: () => cuid3,
|
|
34362
34916
|
creditCard: () => creditCard2,
|
|
@@ -34415,12 +34969,14 @@ __export(exports_schemas2, {
|
|
|
34415
34969
|
ZodKSUID: () => ZodKSUID,
|
|
34416
34970
|
ZodJWT: () => ZodJWT,
|
|
34417
34971
|
ZodIntersection: () => ZodIntersection,
|
|
34972
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
34418
34973
|
ZodISOTime: () => ZodISOTime,
|
|
34419
34974
|
ZodISODuration: () => ZodISODuration,
|
|
34420
34975
|
ZodISODateTime: () => ZodISODateTime,
|
|
34421
34976
|
ZodISODate: () => ZodISODate,
|
|
34422
34977
|
ZodIPv6: () => ZodIPv6,
|
|
34423
34978
|
ZodIPv4: () => ZodIPv4,
|
|
34979
|
+
ZodIBAN: () => ZodIBAN,
|
|
34424
34980
|
ZodGUID: () => ZodGUID,
|
|
34425
34981
|
ZodFunction: () => ZodFunction,
|
|
34426
34982
|
ZodFile: () => ZodFile,
|
|
@@ -34685,6 +35241,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
34685
35241
|
set spa(value) {
|
|
34686
35242
|
exports_util.own(this, "spa", value);
|
|
34687
35243
|
},
|
|
35244
|
+
validate(data, params) {
|
|
35245
|
+
return validate(this, data, params);
|
|
35246
|
+
},
|
|
35247
|
+
validateAsync(data, params) {
|
|
35248
|
+
return validateAsync(this, data, params);
|
|
35249
|
+
},
|
|
34688
35250
|
encode: function _encode2(data, params) {
|
|
34689
35251
|
return encode2(this, data, params, { callee: _encode2 });
|
|
34690
35252
|
},
|
|
@@ -34723,10 +35285,10 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
34723
35285
|
$ZodString.init(inst, def);
|
|
34724
35286
|
ZodType.init(inst, def);
|
|
34725
35287
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
34726
|
-
|
|
34727
|
-
|
|
34728
|
-
|
|
34729
|
-
|
|
35288
|
+
}, /* @__PURE__ */ exports_util.derived({
|
|
35289
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
35290
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
35291
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
34730
35292
|
}, {
|
|
34731
35293
|
regex(...args) {
|
|
34732
35294
|
return this.check(_regex(...args));
|
|
@@ -34773,7 +35335,7 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
34773
35335
|
slugify() {
|
|
34774
35336
|
return this.check(_slugify());
|
|
34775
35337
|
}
|
|
34776
|
-
});
|
|
35338
|
+
}));
|
|
34777
35339
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
34778
35340
|
$ZodString.init(inst, def);
|
|
34779
35341
|
_ZodString.init(inst, def);
|
|
@@ -34919,8 +35481,8 @@ function url(params) {
|
|
|
34919
35481
|
}
|
|
34920
35482
|
function httpUrl(params) {
|
|
34921
35483
|
return _url(ZodURL, {
|
|
34922
|
-
protocol:
|
|
34923
|
-
hostname:
|
|
35484
|
+
protocol: httpProtocol,
|
|
35485
|
+
hostname: domain,
|
|
34924
35486
|
...exports_util.normalizeParams(params)
|
|
34925
35487
|
});
|
|
34926
35488
|
}
|
|
@@ -35036,6 +35598,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
35036
35598
|
function creditCard2(params) {
|
|
35037
35599
|
return _creditCard(ZodCreditCard, params);
|
|
35038
35600
|
}
|
|
35601
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
35602
|
+
$ZodIBAN.init(inst, def);
|
|
35603
|
+
ZodStringFormat.init(inst, def);
|
|
35604
|
+
});
|
|
35605
|
+
function iban2(params) {
|
|
35606
|
+
return _iban(ZodIBAN, params);
|
|
35607
|
+
}
|
|
35039
35608
|
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
35040
35609
|
$ZodJWT.init(inst, def);
|
|
35041
35610
|
ZodStringFormat.init(inst, def);
|
|
@@ -35051,10 +35620,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
35051
35620
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
35052
35621
|
}
|
|
35053
35622
|
function hostname3(_params) {
|
|
35054
|
-
return _stringFormat(ZodCustomStringFormat, "hostname",
|
|
35623
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", hostname2, _params);
|
|
35055
35624
|
}
|
|
35056
35625
|
function hex2(_params) {
|
|
35057
|
-
return _stringFormat(ZodCustomStringFormat, "hex",
|
|
35626
|
+
return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
|
|
35627
|
+
}
|
|
35628
|
+
function currencyCode2(_params) {
|
|
35629
|
+
return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
|
|
35058
35630
|
}
|
|
35059
35631
|
function hash2(alg, params) {
|
|
35060
35632
|
const enc = params?.enc ?? "hex";
|
|
@@ -35068,12 +35640,21 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
35068
35640
|
$ZodNumber.init(inst, def);
|
|
35069
35641
|
ZodType.init(inst, def);
|
|
35070
35642
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
35071
|
-
const bag = inst._zod.bag;
|
|
35072
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
35073
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
35074
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
35075
35643
|
inst.isFinite = true;
|
|
35076
|
-
|
|
35644
|
+
}, /* @__PURE__ */ exports_util.derived({
|
|
35645
|
+
minValue: (inst) => {
|
|
35646
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
35647
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
35648
|
+
},
|
|
35649
|
+
maxValue: (inst) => {
|
|
35650
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
35651
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
35652
|
+
},
|
|
35653
|
+
isInt: (inst) => {
|
|
35654
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
35655
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
35656
|
+
},
|
|
35657
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
35077
35658
|
}, {
|
|
35078
35659
|
gt(value, params) {
|
|
35079
35660
|
return this.check(_gt(value, params));
|
|
@@ -35120,7 +35701,7 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
35120
35701
|
finite() {
|
|
35121
35702
|
return this;
|
|
35122
35703
|
}
|
|
35123
|
-
});
|
|
35704
|
+
}));
|
|
35124
35705
|
function number2(params) {
|
|
35125
35706
|
return _number(ZodNumber, params);
|
|
35126
35707
|
}
|
|
@@ -35155,10 +35736,10 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
|
|
|
35155
35736
|
$ZodBigInt.init(inst, def);
|
|
35156
35737
|
ZodType.init(inst, def);
|
|
35157
35738
|
inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
|
|
35158
|
-
|
|
35159
|
-
|
|
35160
|
-
|
|
35161
|
-
|
|
35739
|
+
}, /* @__PURE__ */ exports_util.derived({
|
|
35740
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
35741
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
35742
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
35162
35743
|
}, {
|
|
35163
35744
|
gte(value, params) {
|
|
35164
35745
|
return this.check(_gte(value, params));
|
|
@@ -35193,7 +35774,7 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
|
|
|
35193
35774
|
multipleOf(value, params) {
|
|
35194
35775
|
return this.check(_multipleOf(value, params));
|
|
35195
35776
|
}
|
|
35196
|
-
});
|
|
35777
|
+
}));
|
|
35197
35778
|
function bigint2(params) {
|
|
35198
35779
|
return _bigint(ZodBigInt, params);
|
|
35199
35780
|
}
|
|
@@ -35269,10 +35850,16 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
|
35269
35850
|
inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
|
|
35270
35851
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
35271
35852
|
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
35272
|
-
|
|
35273
|
-
|
|
35274
|
-
|
|
35275
|
-
|
|
35853
|
+
}, /* @__PURE__ */ exports_util.derived({
|
|
35854
|
+
minDate: (inst) => {
|
|
35855
|
+
const { minimum } = aggregateChecks(inst);
|
|
35856
|
+
return minimum ? new Date(minimum) : null;
|
|
35857
|
+
},
|
|
35858
|
+
maxDate: (inst) => {
|
|
35859
|
+
const { maximum } = aggregateChecks(inst);
|
|
35860
|
+
return maximum ? new Date(maximum) : null;
|
|
35861
|
+
}
|
|
35862
|
+
}, {}));
|
|
35276
35863
|
function date2(params) {
|
|
35277
35864
|
return _date(ZodDate, params);
|
|
35278
35865
|
}
|
|
@@ -35317,19 +35904,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
35317
35904
|
return _enum2(Object.keys(this._zod.def.shape));
|
|
35318
35905
|
},
|
|
35319
35906
|
catchall(catchall) {
|
|
35320
|
-
return this.clone(
|
|
35907
|
+
return this.clone(exports_util.mergeDefs(this._zod.def, { catchall }));
|
|
35321
35908
|
},
|
|
35322
35909
|
passthrough() {
|
|
35323
|
-
return this.clone(
|
|
35910
|
+
return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
35324
35911
|
},
|
|
35325
35912
|
loose() {
|
|
35326
|
-
return this.clone(
|
|
35913
|
+
return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
35327
35914
|
},
|
|
35328
35915
|
strict() {
|
|
35329
|
-
return this.clone(
|
|
35916
|
+
return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: never() }));
|
|
35330
35917
|
},
|
|
35331
35918
|
strip() {
|
|
35332
|
-
return this.clone(
|
|
35919
|
+
return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: undefined }));
|
|
35333
35920
|
},
|
|
35334
35921
|
extend(incoming) {
|
|
35335
35922
|
return exports_util.extend(this, incoming);
|
|
@@ -35548,7 +36135,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
35548
36135
|
ZodType.init(inst, def);
|
|
35549
36136
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
35550
36137
|
inst.enum = def.entries;
|
|
35551
|
-
inst.options =
|
|
36138
|
+
inst.options = [...inst._zod.values];
|
|
35552
36139
|
const keys = new Set(Object.keys(def.entries));
|
|
35553
36140
|
inst.extract = (values, params) => {
|
|
35554
36141
|
const newEntries = {};
|
|
@@ -35909,8 +36496,15 @@ function superRefine(fn, params) {
|
|
|
35909
36496
|
}
|
|
35910
36497
|
var describe2 = describe;
|
|
35911
36498
|
var meta2 = meta;
|
|
36499
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
36500
|
+
ZodCustom.init(inst, def);
|
|
36501
|
+
}, {
|
|
36502
|
+
properties(shape, params) {
|
|
36503
|
+
return this.check(_properties(shape, params));
|
|
36504
|
+
}
|
|
36505
|
+
});
|
|
35912
36506
|
function _instanceof(cls, params = {}) {
|
|
35913
|
-
const inst = new
|
|
36507
|
+
const inst = new ZodInstanceOf({
|
|
35914
36508
|
type: "custom",
|
|
35915
36509
|
check: "custom",
|
|
35916
36510
|
fn: (data) => data instanceof cls,
|
|
@@ -36100,27 +36694,188 @@ function resolveRef(ref, ctx) {
|
|
|
36100
36694
|
}
|
|
36101
36695
|
throw new Error(`Reference not found: ${ref}`);
|
|
36102
36696
|
}
|
|
36103
|
-
function
|
|
36697
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
36104
36698
|
const guard = z.transform((value) => value).check((payload) => {
|
|
36105
36699
|
const value = payload.value;
|
|
36106
36700
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
36107
36701
|
return;
|
|
36108
|
-
|
|
36109
|
-
|
|
36110
|
-
if (result.success)
|
|
36111
|
-
continue;
|
|
36702
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
36703
|
+
if (guards.minProperties !== undefined && keys.length < guards.minProperties) {
|
|
36112
36704
|
payload.issues.push({
|
|
36113
|
-
|
|
36114
|
-
|
|
36115
|
-
|
|
36116
|
-
|
|
36117
|
-
|
|
36705
|
+
origin: "object",
|
|
36706
|
+
code: "too_small",
|
|
36707
|
+
minimum: guards.minProperties,
|
|
36708
|
+
inclusive: true,
|
|
36709
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
36710
|
+
input: value,
|
|
36711
|
+
inst: objectSchema,
|
|
36118
36712
|
continue: true
|
|
36119
36713
|
});
|
|
36120
36714
|
}
|
|
36715
|
+
if (guards.maxProperties !== undefined && keys.length > guards.maxProperties) {
|
|
36716
|
+
payload.issues.push({
|
|
36717
|
+
origin: "object",
|
|
36718
|
+
code: "too_big",
|
|
36719
|
+
maximum: guards.maxProperties,
|
|
36720
|
+
inclusive: true,
|
|
36721
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
36722
|
+
input: value,
|
|
36723
|
+
inst: objectSchema,
|
|
36724
|
+
continue: true
|
|
36725
|
+
});
|
|
36726
|
+
}
|
|
36727
|
+
if (guards.keySchema) {
|
|
36728
|
+
for (const key of keys) {
|
|
36729
|
+
const result = guards.keySchema.safeParse(key);
|
|
36730
|
+
if (result.success)
|
|
36731
|
+
continue;
|
|
36732
|
+
payload.issues.push({
|
|
36733
|
+
code: "invalid_key",
|
|
36734
|
+
origin: "record",
|
|
36735
|
+
issues: result.error.issues,
|
|
36736
|
+
input: key,
|
|
36737
|
+
path: [key],
|
|
36738
|
+
continue: true
|
|
36739
|
+
});
|
|
36740
|
+
}
|
|
36741
|
+
}
|
|
36121
36742
|
});
|
|
36122
36743
|
return guard.pipe(objectSchema);
|
|
36123
36744
|
}
|
|
36745
|
+
function canonicalKey(value, seen) {
|
|
36746
|
+
if (value === null)
|
|
36747
|
+
return "z";
|
|
36748
|
+
const type = typeof value;
|
|
36749
|
+
if (type !== "object") {
|
|
36750
|
+
if (type === "number" && Number.isNaN(value))
|
|
36751
|
+
return null;
|
|
36752
|
+
const raw = String(value);
|
|
36753
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
36754
|
+
}
|
|
36755
|
+
if (seen.has(value))
|
|
36756
|
+
return null;
|
|
36757
|
+
seen.add(value);
|
|
36758
|
+
try {
|
|
36759
|
+
if (Array.isArray(value)) {
|
|
36760
|
+
const parts2 = [];
|
|
36761
|
+
for (const item of value) {
|
|
36762
|
+
const key = canonicalKey(item, seen);
|
|
36763
|
+
if (key === null)
|
|
36764
|
+
return null;
|
|
36765
|
+
parts2.push(key);
|
|
36766
|
+
}
|
|
36767
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
36768
|
+
}
|
|
36769
|
+
const keys = Object.keys(value).sort();
|
|
36770
|
+
const parts = [];
|
|
36771
|
+
for (const k of keys) {
|
|
36772
|
+
const key = canonicalKey(value[k], seen);
|
|
36773
|
+
if (key === null)
|
|
36774
|
+
return null;
|
|
36775
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
36776
|
+
}
|
|
36777
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
36778
|
+
} finally {
|
|
36779
|
+
seen.delete(value);
|
|
36780
|
+
}
|
|
36781
|
+
}
|
|
36782
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
36783
|
+
"items",
|
|
36784
|
+
"prefixItems",
|
|
36785
|
+
"additionalItems",
|
|
36786
|
+
"additionalProperties",
|
|
36787
|
+
"contains",
|
|
36788
|
+
"propertyNames",
|
|
36789
|
+
"not",
|
|
36790
|
+
"if",
|
|
36791
|
+
"then",
|
|
36792
|
+
"else",
|
|
36793
|
+
"allOf",
|
|
36794
|
+
"anyOf",
|
|
36795
|
+
"oneOf",
|
|
36796
|
+
"unevaluatedItems",
|
|
36797
|
+
"unevaluatedProperties",
|
|
36798
|
+
"contentSchema"
|
|
36799
|
+
]);
|
|
36800
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
36801
|
+
"properties",
|
|
36802
|
+
"patternProperties",
|
|
36803
|
+
"dependentSchemas",
|
|
36804
|
+
"dependencies",
|
|
36805
|
+
"$defs",
|
|
36806
|
+
"definitions"
|
|
36807
|
+
]);
|
|
36808
|
+
function containsRef(value) {
|
|
36809
|
+
if (typeof value !== "object" || value === null)
|
|
36810
|
+
return false;
|
|
36811
|
+
if (Array.isArray(value))
|
|
36812
|
+
return value.some(containsRef);
|
|
36813
|
+
if (typeof value.$ref === "string")
|
|
36814
|
+
return true;
|
|
36815
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
36816
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
36817
|
+
return containsRef(sub);
|
|
36818
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
36819
|
+
return false;
|
|
36820
|
+
return Object.values(sub).some(containsRef);
|
|
36821
|
+
});
|
|
36822
|
+
}
|
|
36823
|
+
function plural(n2) {
|
|
36824
|
+
return n2 === 1 ? "element" : "elements";
|
|
36825
|
+
}
|
|
36826
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
36827
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
36828
|
+
const items = payload.value;
|
|
36829
|
+
if (!Array.isArray(items))
|
|
36830
|
+
return;
|
|
36831
|
+
if (guards.uniqueItems === true) {
|
|
36832
|
+
const firstSeen = new Map;
|
|
36833
|
+
for (let i = 0;i < items.length; i++) {
|
|
36834
|
+
const key = canonicalKey(items[i], new Set);
|
|
36835
|
+
if (key === null)
|
|
36836
|
+
continue;
|
|
36837
|
+
const first = firstSeen.get(key);
|
|
36838
|
+
if (first === undefined) {
|
|
36839
|
+
firstSeen.set(key, i);
|
|
36840
|
+
continue;
|
|
36841
|
+
}
|
|
36842
|
+
payload.issues.push({
|
|
36843
|
+
code: "custom",
|
|
36844
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
36845
|
+
input: items,
|
|
36846
|
+
path: [i],
|
|
36847
|
+
continue: true
|
|
36848
|
+
});
|
|
36849
|
+
}
|
|
36850
|
+
}
|
|
36851
|
+
if (guards.containsSchema) {
|
|
36852
|
+
const minContains = guards.minContains ?? 1;
|
|
36853
|
+
const ceiling = guards.maxContains !== undefined ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
36854
|
+
let matches = 0;
|
|
36855
|
+
for (const item of items) {
|
|
36856
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
36857
|
+
break;
|
|
36858
|
+
}
|
|
36859
|
+
if (matches < minContains) {
|
|
36860
|
+
payload.issues.push({
|
|
36861
|
+
code: "custom",
|
|
36862
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
36863
|
+
input: items,
|
|
36864
|
+
continue: true
|
|
36865
|
+
});
|
|
36866
|
+
}
|
|
36867
|
+
if (guards.maxContains !== undefined && matches > guards.maxContains) {
|
|
36868
|
+
payload.issues.push({
|
|
36869
|
+
code: "custom",
|
|
36870
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
36871
|
+
input: items,
|
|
36872
|
+
continue: true
|
|
36873
|
+
});
|
|
36874
|
+
}
|
|
36875
|
+
}
|
|
36876
|
+
});
|
|
36877
|
+
return guard.pipe(arraySchema);
|
|
36878
|
+
}
|
|
36124
36879
|
function getTupleRest(restSchema, ctx) {
|
|
36125
36880
|
if (restSchema === false) {
|
|
36126
36881
|
return;
|
|
@@ -36250,6 +37005,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
36250
37005
|
stringSchema = stringSchema.check(z.e164());
|
|
36251
37006
|
} else if (format === "credit_card") {
|
|
36252
37007
|
stringSchema = stringSchema.check(z.creditCard());
|
|
37008
|
+
} else if (format === "iban") {
|
|
37009
|
+
stringSchema = stringSchema.check(z.iban());
|
|
36253
37010
|
} else if (format === "jwt") {
|
|
36254
37011
|
stringSchema = stringSchema.check(z.jwt());
|
|
36255
37012
|
} else if (format === "emoji") {
|
|
@@ -36382,9 +37139,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
36382
37139
|
zodSchema = objectSchema.passthrough();
|
|
36383
37140
|
}
|
|
36384
37141
|
}
|
|
36385
|
-
|
|
36386
|
-
|
|
36387
|
-
|
|
37142
|
+
const hasKeyGuard = schema.propertyNames !== undefined && schema.propertyNames !== true;
|
|
37143
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : undefined;
|
|
37144
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : undefined;
|
|
37145
|
+
if (hasKeyGuard || minProperties !== undefined || maxProperties !== undefined) {
|
|
37146
|
+
let keySchema;
|
|
37147
|
+
if (hasKeyGuard) {
|
|
37148
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
37149
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
37150
|
+
}
|
|
37151
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
36388
37152
|
}
|
|
36389
37153
|
break;
|
|
36390
37154
|
}
|
|
@@ -36430,6 +37194,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
36430
37194
|
} else {
|
|
36431
37195
|
zodSchema = z.array(z.any());
|
|
36432
37196
|
}
|
|
37197
|
+
if (schema.uniqueItems === true || schema.contains !== undefined) {
|
|
37198
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
37199
|
+
uniqueItems: schema.uniqueItems === true,
|
|
37200
|
+
containsSchema: schema.contains !== undefined ? convertSchema(schema.contains, ctx) : undefined,
|
|
37201
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : undefined,
|
|
37202
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : undefined
|
|
37203
|
+
});
|
|
37204
|
+
}
|
|
36433
37205
|
break;
|
|
36434
37206
|
}
|
|
36435
37207
|
default:
|
|
@@ -36487,8 +37259,23 @@ function convertSchema(schema, ctx) {
|
|
|
36487
37259
|
extraMeta[key] = schema[key];
|
|
36488
37260
|
}
|
|
36489
37261
|
}
|
|
36490
|
-
if (schema.
|
|
36491
|
-
|
|
37262
|
+
if (schema.type === "object" && schema.$ref === undefined) {
|
|
37263
|
+
if (schema.propertyNames !== undefined && !containsRef(schema.propertyNames)) {
|
|
37264
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
37265
|
+
}
|
|
37266
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
37267
|
+
if (schema[key] !== undefined)
|
|
37268
|
+
extraMeta[key] = schema[key];
|
|
37269
|
+
}
|
|
37270
|
+
}
|
|
37271
|
+
if (schema.type === "array" && schema.$ref === undefined) {
|
|
37272
|
+
if (schema.contains !== undefined && !containsRef(schema.contains)) {
|
|
37273
|
+
extraMeta.contains = schema.contains;
|
|
37274
|
+
}
|
|
37275
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
37276
|
+
if (schema[key] !== undefined)
|
|
37277
|
+
extraMeta[key] = schema[key];
|
|
37278
|
+
}
|
|
36492
37279
|
}
|
|
36493
37280
|
for (const key of Object.keys(schema)) {
|
|
36494
37281
|
if (!RECOGNIZED_KEYS.has(key)) {
|
|
@@ -36948,10 +37735,10 @@ function parseRemoteSkillPayload(payload) {
|
|
|
36948
37735
|
function parseRemoteContract(schema, payload, message) {
|
|
36949
37736
|
try {
|
|
36950
37737
|
return schema.parse(payload);
|
|
36951
|
-
} catch (
|
|
36952
|
-
if (
|
|
36953
|
-
throw new Error(message, { cause:
|
|
36954
|
-
throw
|
|
37738
|
+
} catch (error62) {
|
|
37739
|
+
if (error62 instanceof exports_external.ZodError)
|
|
37740
|
+
throw new Error(message, { cause: error62 });
|
|
37741
|
+
throw error62;
|
|
36955
37742
|
}
|
|
36956
37743
|
}
|
|
36957
37744
|
async function remoteRequestHeaders(options) {
|
|
@@ -39200,8 +39987,8 @@ class RemoteSkillsClient {
|
|
|
39200
39987
|
throw new RemoteCreditCheckoutError("CREDIT_CHECKOUT_UNCONFIRMED", response.status, requestIdempotencyKey);
|
|
39201
39988
|
}
|
|
39202
39989
|
if (!response.ok) {
|
|
39203
|
-
const
|
|
39204
|
-
throw new RemoteCreditCheckoutError(
|
|
39990
|
+
const failure2 = creditCheckoutFailure(value, response.status, requestIdempotencyKey);
|
|
39991
|
+
throw new RemoteCreditCheckoutError(failure2.code, response.status, requestIdempotencyKey, failure2.retryAfterSeconds);
|
|
39205
39992
|
}
|
|
39206
39993
|
try {
|
|
39207
39994
|
const checkout = parseRemoteCheckout(value);
|
|
@@ -39359,9 +40146,9 @@ class RemoteSkillsClient {
|
|
|
39359
40146
|
async publishSkill(manifest, bundle2, ifMatch) {
|
|
39360
40147
|
try {
|
|
39361
40148
|
assertSkillsPermission(await this.getCapabilities({ refresh: true }), "publish");
|
|
39362
|
-
} catch (
|
|
39363
|
-
if (!(
|
|
39364
|
-
throw
|
|
40149
|
+
} catch (error62) {
|
|
40150
|
+
if (!(error62 instanceof RemoteRouteUnsupportedError))
|
|
40151
|
+
throw error62;
|
|
39365
40152
|
}
|
|
39366
40153
|
const form = new FormData;
|
|
39367
40154
|
form.set("manifest", JSON.stringify(manifest));
|
|
@@ -39753,9 +40540,9 @@ function getNextRun(cron, from = new Date) {
|
|
|
39753
40540
|
return null;
|
|
39754
40541
|
}
|
|
39755
40542
|
function addSchedule(skill, cron, options = {}) {
|
|
39756
|
-
const { valid, error:
|
|
40543
|
+
const { valid, error: error62 } = validateCron(cron);
|
|
39757
40544
|
if (!valid)
|
|
39758
|
-
return { schedule: null, error:
|
|
40545
|
+
return { schedule: null, error: error62 };
|
|
39759
40546
|
const data = loadSchedules(options.targetDir);
|
|
39760
40547
|
const id = `${skill}-${Date.now()}`;
|
|
39761
40548
|
const now = new Date;
|
|
@@ -39912,8 +40699,8 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
|
|
|
39912
40699
|
let slug2;
|
|
39913
40700
|
try {
|
|
39914
40701
|
slug2 = normalizePortableSkillName(bareName);
|
|
39915
|
-
} catch (
|
|
39916
|
-
return { name: rawName, success: false, error:
|
|
40702
|
+
} catch (error62) {
|
|
40703
|
+
return { name: rawName, success: false, error: error62.message };
|
|
39917
40704
|
}
|
|
39918
40705
|
if (requestedVersion !== undefined && !isValidSkillVersion(requestedVersion)) {
|
|
39919
40706
|
return { name: rawName, success: false, error: `'${requestedVersion}' is not a valid skill version (${SKILL_VERSION_RULE}).` };
|
|
@@ -39922,8 +40709,8 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
|
|
|
39922
40709
|
let bundleResponse;
|
|
39923
40710
|
try {
|
|
39924
40711
|
bundleResponse = await client2.getBundle(slug2, requestedVersion);
|
|
39925
|
-
} catch (
|
|
39926
|
-
return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${
|
|
40712
|
+
} catch (error62) {
|
|
40713
|
+
return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error62.message}` };
|
|
39927
40714
|
}
|
|
39928
40715
|
if (requestedVersion && (!bundleResponse || bundleResponse.status === 404)) {
|
|
39929
40716
|
return {
|
|
@@ -39959,18 +40746,18 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
|
|
|
39959
40746
|
expectedSha256 = typeof recorded.bundleSha256 === "string" ? recorded.bundleSha256 : undefined;
|
|
39960
40747
|
}
|
|
39961
40748
|
return await installVerifiedBundle(slug2, bundleResponse, meta3, corpusOptions, verify, requestedVersion ? { version: requestedVersion, expectedSha256 } : undefined);
|
|
39962
|
-
} catch (
|
|
39963
|
-
if (
|
|
39964
|
-
return { name: slug2, success: false, error:
|
|
40749
|
+
} catch (error62) {
|
|
40750
|
+
if (error62 instanceof PullSkillError) {
|
|
40751
|
+
return { name: slug2, success: false, error: error62.message };
|
|
39965
40752
|
}
|
|
39966
|
-
throw
|
|
40753
|
+
throw error62;
|
|
39967
40754
|
}
|
|
39968
40755
|
}
|
|
39969
40756
|
let skillMd;
|
|
39970
40757
|
try {
|
|
39971
40758
|
skillMd = await client2.getSkillMd(slug2);
|
|
39972
|
-
} catch (
|
|
39973
|
-
return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${
|
|
40759
|
+
} catch (error62) {
|
|
40760
|
+
return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error62.message}` };
|
|
39974
40761
|
}
|
|
39975
40762
|
if (skillMd === null) {
|
|
39976
40763
|
return { name: slug2, success: false, error: `Skill '${slug2}' was not found on the configured Skills instance.` };
|
|
@@ -39984,11 +40771,11 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
|
|
|
39984
40771
|
let provenRevisionId;
|
|
39985
40772
|
try {
|
|
39986
40773
|
provenRevisionId = meta3?.revisionId ? provenRevision({ ...meta3, skillMd }, slug2, {}) : undefined;
|
|
39987
|
-
} catch (
|
|
39988
|
-
if (
|
|
39989
|
-
return { name: slug2, success: false, error:
|
|
40774
|
+
} catch (error62) {
|
|
40775
|
+
if (error62 instanceof PullSkillError) {
|
|
40776
|
+
return { name: slug2, success: false, error: error62.message };
|
|
39990
40777
|
}
|
|
39991
|
-
throw
|
|
40778
|
+
throw error62;
|
|
39992
40779
|
}
|
|
39993
40780
|
const written = installCorpusSkillAtomically({ name: slug2, skillMd, meta: meta3 }, corpusOptions);
|
|
39994
40781
|
writePullMarker(written.path, {
|
|
@@ -40067,8 +40854,8 @@ function installVerifiedBundle(slug2, response, meta3, corpusOptions, verify, ex
|
|
|
40067
40854
|
let entries;
|
|
40068
40855
|
try {
|
|
40069
40856
|
entries = unpackSkillBundle(verified.bytes);
|
|
40070
|
-
} catch (
|
|
40071
|
-
throw new PullSkillError(`Bundle for '${slug2}' could not be unpacked: ${
|
|
40857
|
+
} catch (error62) {
|
|
40858
|
+
throw new PullSkillError(`Bundle for '${slug2}' could not be unpacked: ${error62.message}`);
|
|
40072
40859
|
}
|
|
40073
40860
|
const version2 = exact?.version ?? served ?? str(meta3?.version) ?? versionFromEntries(entries) ?? "unknown";
|
|
40074
40861
|
const sourceCommit = sourceCommitFromEntries(entries);
|
|
@@ -40204,14 +40991,14 @@ function installBundleAtomically(name, entries, options = {}, marker = {}) {
|
|
|
40204
40991
|
renameSync6(staging, target);
|
|
40205
40992
|
if (moved && backup)
|
|
40206
40993
|
rmSync5(backup, { recursive: true, force: true });
|
|
40207
|
-
} catch (
|
|
40994
|
+
} catch (error62) {
|
|
40208
40995
|
rmSync5(staging, { recursive: true, force: true });
|
|
40209
40996
|
if (moved && backup && existsSync17(join32(backup, name))) {
|
|
40210
40997
|
try {
|
|
40211
40998
|
renameSync6(join32(backup, name), target);
|
|
40212
40999
|
} catch {}
|
|
40213
41000
|
}
|
|
40214
|
-
throw
|
|
41001
|
+
throw error62;
|
|
40215
41002
|
}
|
|
40216
41003
|
return { path: target, created };
|
|
40217
41004
|
}
|
|
@@ -40369,9 +41156,9 @@ async function requestInvitationEmail(origin, action, input2) {
|
|
|
40369
41156
|
if (action === "accept" && response.status === 200 && uuid11(parsed.organizationId) && uuid11(parsed.membershipId) && parsed.accepted === true && parsed.changed === true && parsed.signInRequired === true) {
|
|
40370
41157
|
return { organizationId: parsed.organizationId, membershipId: parsed.membershipId, accepted: true, changed: true, signInRequired: true };
|
|
40371
41158
|
}
|
|
40372
|
-
} catch (
|
|
40373
|
-
if (
|
|
40374
|
-
throw
|
|
41159
|
+
} catch (error62) {
|
|
41160
|
+
if (error62 instanceof RemoteInvitationEmailError)
|
|
41161
|
+
throw error62;
|
|
40375
41162
|
}
|
|
40376
41163
|
throw new RemoteInvitationEmailUnconfirmedError(action);
|
|
40377
41164
|
}
|
|
@@ -40502,11 +41289,11 @@ async function boundedJson(url2, init, token, mutation, budget2 = 15000, signal)
|
|
|
40502
41289
|
timer = setTimeout(abort, Math.max(1, Math.min(15000, budget2)));
|
|
40503
41290
|
signal?.addEventListener("abort", abort, { once: true });
|
|
40504
41291
|
})]);
|
|
40505
|
-
} catch (
|
|
40506
|
-
if (
|
|
40507
|
-
if (mutation &&
|
|
41292
|
+
} catch (error62) {
|
|
41293
|
+
if (error62 instanceof PrivatePublicationError) {
|
|
41294
|
+
if (mutation && error62.code === "INVALID_PUBLICATION_RESPONSE")
|
|
40508
41295
|
throw timeout;
|
|
40509
|
-
throw
|
|
41296
|
+
throw error62;
|
|
40510
41297
|
}
|
|
40511
41298
|
throw timeout;
|
|
40512
41299
|
} finally {
|
|
@@ -40563,10 +41350,10 @@ class RemotePrivatePublicationsClient {
|
|
|
40563
41350
|
if (!record8(value) || !Object.keys(value).every((k) => k === "upload" || k === "changed") || value.changed !== undefined && typeof value.changed !== "boolean")
|
|
40564
41351
|
return invalid4();
|
|
40565
41352
|
return checkedPublicationView(value.upload, skillId, intentId, declaration);
|
|
40566
|
-
} catch (
|
|
41353
|
+
} catch (error62) {
|
|
40567
41354
|
if (method !== "GET")
|
|
40568
41355
|
throw new PrivatePublicationError("PUBLICATION_UNCONFIRMED", "The publication result could not be confirmed. Reconcile the saved intent before another action.", true);
|
|
40569
|
-
throw
|
|
41356
|
+
throw error62;
|
|
40570
41357
|
}
|
|
40571
41358
|
}
|
|
40572
41359
|
async begin(skillId, input2) {
|
|
@@ -40661,10 +41448,10 @@ class RemotePrivatePublicationsClient {
|
|
|
40661
41448
|
let view;
|
|
40662
41449
|
try {
|
|
40663
41450
|
view = await this.get(skillId, intentId, { timeoutMs: timeout === 0 ? 15000 : Math.max(1, Math.min(15000, until - Date.now())), signal: options.signal });
|
|
40664
|
-
} catch (
|
|
41451
|
+
} catch (error62) {
|
|
40665
41452
|
if (previous && Date.now() >= until && !options.signal?.aborted)
|
|
40666
41453
|
return previous;
|
|
40667
|
-
throw
|
|
41454
|
+
throw error62;
|
|
40668
41455
|
}
|
|
40669
41456
|
previous = view;
|
|
40670
41457
|
if (!["queued", "verifying"].includes(view.state) || Date.now() >= until)
|
|
@@ -40725,9 +41512,9 @@ async function requestAuthApi(instance, path, options) {
|
|
|
40725
41512
|
if (!res.ok) {
|
|
40726
41513
|
const record9 = isRecord5(body) ? body : {};
|
|
40727
41514
|
const detail = typeof record9.detail === "string" ? record9.detail : undefined;
|
|
40728
|
-
const
|
|
41515
|
+
const error62 = typeof record9.error === "string" ? record9.error : undefined;
|
|
40729
41516
|
const code = typeof record9.code === "string" ? record9.code : undefined;
|
|
40730
|
-
throw new HostedApiError(detail ||
|
|
41517
|
+
throw new HostedApiError(detail || error62 || `${res.status} ${res.statusText}`, {
|
|
40731
41518
|
status: res.status,
|
|
40732
41519
|
code,
|
|
40733
41520
|
detail,
|
|
@@ -43226,8 +44013,8 @@ function readSnapshotManifest(repoRoot, stationId) {
|
|
|
43226
44013
|
let manifest;
|
|
43227
44014
|
try {
|
|
43228
44015
|
manifest = JSON.parse(readFileSync26(manifestPath, "utf8"));
|
|
43229
|
-
} catch (
|
|
43230
|
-
fail("MANIFEST_UNREADABLE", `cannot read snapshot manifest: ${manifestPath}: ${
|
|
44016
|
+
} catch (error62) {
|
|
44017
|
+
fail("MANIFEST_UNREADABLE", `cannot read snapshot manifest: ${manifestPath}: ${error62.message}`);
|
|
43231
44018
|
}
|
|
43232
44019
|
const sourceSnapshotSha = sha256File(manifestPath);
|
|
43233
44020
|
return { manifest, manifestPath, sourceSnapshotSha };
|
|
@@ -43698,12 +44485,12 @@ async function continueLocked(client2, directory2, options) {
|
|
|
43698
44485
|
save(directory2, receipt);
|
|
43699
44486
|
try {
|
|
43700
44487
|
await client2.upload(receipt.skillId, receipt.intent, bytes);
|
|
43701
|
-
} catch (
|
|
43702
|
-
if (
|
|
44488
|
+
} catch (error62) {
|
|
44489
|
+
if (error62 instanceof PrivatePublicationError && !error62.uncertain) {
|
|
43703
44490
|
receipt.phase = "awaiting_upload";
|
|
43704
44491
|
save(directory2, receipt);
|
|
43705
44492
|
}
|
|
43706
|
-
throw
|
|
44493
|
+
throw error62;
|
|
43707
44494
|
}
|
|
43708
44495
|
receipt.phase = "uploaded";
|
|
43709
44496
|
save(directory2, receipt);
|