agent-relay 11.10.4 → 12.0.0
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 +9 -1
- package/dist/cli/agent-relay-mcp.d.ts.map +1 -1
- package/dist/cli/agent-relay-mcp.js +35 -32
- package/dist/cli/agent-relay-mcp.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts +3 -1
- package/dist/cli/commands/fleet.d.ts.map +1 -1
- package/dist/cli/commands/fleet.js +157 -24
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/integration-recipient.d.ts +21 -0
- package/dist/cli/commands/integration-recipient.d.ts.map +1 -0
- package/dist/cli/commands/integration-recipient.js +115 -0
- package/dist/cli/commands/integration-recipient.js.map +1 -0
- package/dist/cli/commands/integration.d.ts +3 -0
- package/dist/cli/commands/integration.d.ts.map +1 -1
- package/dist/cli/commands/integration.js +72 -27
- package/dist/cli/commands/integration.js.map +1 -1
- package/dist/cli/commands/local-agent.d.ts +1 -0
- package/dist/cli/commands/local-agent.d.ts.map +1 -1
- package/dist/cli/commands/local-agent.js +17 -1
- package/dist/cli/commands/local-agent.js.map +1 -1
- package/dist/cli/commands/observer.d.ts.map +1 -1
- package/dist/cli/commands/observer.js +6 -5
- package/dist/cli/commands/observer.js.map +1 -1
- package/dist/cli/lib/attach-fleet-node.d.ts +1 -0
- package/dist/cli/lib/attach-fleet-node.d.ts.map +1 -1
- package/dist/cli/lib/attach-fleet-node.js +29 -3
- package/dist/cli/lib/attach-fleet-node.js.map +1 -1
- package/dist/cli/lib/broker-lifecycle.d.ts.map +1 -1
- package/dist/cli/lib/broker-lifecycle.js +17 -4
- package/dist/cli/lib/broker-lifecycle.js.map +1 -1
- package/dist/cli/lib/enrollment-pin.js +2 -2
- package/dist/cli/lib/enrollment-pin.js.map +1 -1
- package/dist/cli/lib/project-workspace-key.d.ts +1 -1
- package/dist/cli/lib/project-workspace-key.d.ts.map +1 -1
- package/dist/cli/lib/project-workspace-key.js +1 -1
- package/dist/cli/lib/project-workspace-key.js.map +1 -1
- package/dist/cli/lib/sdk-client.d.ts +20 -1
- package/dist/cli/lib/sdk-client.d.ts.map +1 -1
- package/dist/cli/lib/sdk-client.js +133 -15
- package/dist/cli/lib/sdk-client.js.map +1 -1
- package/dist/cli/lib/workspace-session.d.ts +4 -0
- package/dist/cli/lib/workspace-session.d.ts.map +1 -1
- package/dist/cli/lib/workspace-session.js +18 -5
- package/dist/cli/lib/workspace-session.js.map +1 -1
- package/dist/index.cjs +1704 -832
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -303,7 +303,7 @@ __export(index_exports, {
|
|
|
303
303
|
module.exports = __toCommonJS(index_exports);
|
|
304
304
|
|
|
305
305
|
// ../../node_modules/@relaycast/sdk/dist/version.js
|
|
306
|
-
var SDK_VERSION = "8.
|
|
306
|
+
var SDK_VERSION = "8.8.0";
|
|
307
307
|
|
|
308
308
|
// ../../node_modules/zod/v4/classic/external.js
|
|
309
309
|
var external_exports = {};
|
|
@@ -311,6 +311,7 @@ __export(external_exports, {
|
|
|
311
311
|
$brand: () => $brand,
|
|
312
312
|
$input: () => $input,
|
|
313
313
|
$output: () => $output,
|
|
314
|
+
INVALID: () => INVALID,
|
|
314
315
|
NEVER: () => NEVER,
|
|
315
316
|
TimePrecision: () => TimePrecision,
|
|
316
317
|
ZodAny: () => ZodAny,
|
|
@@ -344,12 +345,14 @@ __export(external_exports, {
|
|
|
344
345
|
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
345
346
|
ZodFunction: () => ZodFunction,
|
|
346
347
|
ZodGUID: () => ZodGUID,
|
|
348
|
+
ZodIBAN: () => ZodIBAN,
|
|
347
349
|
ZodIPv4: () => ZodIPv4,
|
|
348
350
|
ZodIPv6: () => ZodIPv6,
|
|
349
351
|
ZodISODate: () => ZodISODate,
|
|
350
352
|
ZodISODateTime: () => ZodISODateTime,
|
|
351
353
|
ZodISODuration: () => ZodISODuration,
|
|
352
354
|
ZodISOTime: () => ZodISOTime,
|
|
355
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
353
356
|
ZodIntersection: () => ZodIntersection,
|
|
354
357
|
ZodIssueCode: () => ZodIssueCode,
|
|
355
358
|
ZodJWT: () => ZodJWT,
|
|
@@ -372,6 +375,7 @@ __export(external_exports, {
|
|
|
372
375
|
ZodPrefault: () => ZodPrefault,
|
|
373
376
|
ZodPreprocess: () => ZodPreprocess,
|
|
374
377
|
ZodPromise: () => ZodPromise,
|
|
378
|
+
ZodProperties: () => ZodProperties,
|
|
375
379
|
ZodReadonly: () => ZodReadonly,
|
|
376
380
|
ZodRealError: () => ZodRealError,
|
|
377
381
|
ZodRecord: () => ZodRecord,
|
|
@@ -447,6 +451,7 @@ __export(external_exports, {
|
|
|
447
451
|
hex: () => hex2,
|
|
448
452
|
hostname: () => hostname2,
|
|
449
453
|
httpUrl: () => httpUrl,
|
|
454
|
+
iban: () => iban2,
|
|
450
455
|
includes: () => _includes,
|
|
451
456
|
input: () => input,
|
|
452
457
|
instanceof: () => _instanceof,
|
|
@@ -507,7 +512,7 @@ __export(external_exports, {
|
|
|
507
512
|
preprocess: () => preprocess,
|
|
508
513
|
prettifyError: () => prettifyError,
|
|
509
514
|
promise: () => promise,
|
|
510
|
-
properties: () =>
|
|
515
|
+
properties: () => properties,
|
|
511
516
|
property: () => _property,
|
|
512
517
|
readonly: () => readonly,
|
|
513
518
|
record: () => record,
|
|
@@ -558,6 +563,7 @@ __export(external_exports, {
|
|
|
558
563
|
validate: () => validate,
|
|
559
564
|
validateAsync: () => validateAsync,
|
|
560
565
|
void: () => _void2,
|
|
566
|
+
withParser: () => withParser,
|
|
561
567
|
xid: () => xid2,
|
|
562
568
|
xor: () => xor
|
|
563
569
|
});
|
|
@@ -618,6 +624,7 @@ __export(core_exports2, {
|
|
|
618
624
|
$ZodFile: () => $ZodFile,
|
|
619
625
|
$ZodFunction: () => $ZodFunction,
|
|
620
626
|
$ZodGUID: () => $ZodGUID,
|
|
627
|
+
$ZodIBAN: () => $ZodIBAN,
|
|
621
628
|
$ZodIPv4: () => $ZodIPv4,
|
|
622
629
|
$ZodIPv6: () => $ZodIPv6,
|
|
623
630
|
$ZodISODate: () => $ZodISODate,
|
|
@@ -646,6 +653,7 @@ __export(core_exports2, {
|
|
|
646
653
|
$ZodPrefault: () => $ZodPrefault,
|
|
647
654
|
$ZodPreprocess: () => $ZodPreprocess,
|
|
648
655
|
$ZodPromise: () => $ZodPromise,
|
|
656
|
+
$ZodProperties: () => $ZodProperties,
|
|
649
657
|
$ZodReadonly: () => $ZodReadonly,
|
|
650
658
|
$ZodRealError: () => $ZodRealError,
|
|
651
659
|
$ZodRecord: () => $ZodRecord,
|
|
@@ -719,6 +727,7 @@ __export(core_exports2, {
|
|
|
719
727
|
_gt: () => _gt,
|
|
720
728
|
_gte: () => _gte,
|
|
721
729
|
_guid: () => _guid,
|
|
730
|
+
_iban: () => _iban,
|
|
722
731
|
_includes: () => _includes,
|
|
723
732
|
_int: () => _int,
|
|
724
733
|
_int32: () => _int32,
|
|
@@ -810,6 +819,8 @@ __export(core_exports2, {
|
|
|
810
819
|
_void: () => _void,
|
|
811
820
|
_xid: () => _xid,
|
|
812
821
|
_xor: () => _xor,
|
|
822
|
+
base64Charset: () => base64Charset,
|
|
823
|
+
base64urlCharset: () => base64urlCharset,
|
|
813
824
|
clone: () => clone,
|
|
814
825
|
compile: () => compile,
|
|
815
826
|
compileFn: () => compileFn,
|
|
@@ -832,10 +843,12 @@ __export(core_exports2, {
|
|
|
832
843
|
initializeContext: () => initializeContext,
|
|
833
844
|
isBackEdge: () => isBackEdge,
|
|
834
845
|
isRecursiveSchema: () => isRecursiveSchema,
|
|
846
|
+
isTransforming: () => isTransforming,
|
|
835
847
|
isValidBase64: () => isValidBase64,
|
|
836
848
|
isValidBase64URL: () => isValidBase64URL,
|
|
837
849
|
isValidCIDRv6: () => isValidCIDRv6,
|
|
838
850
|
isValidCreditCard: () => isValidCreditCard,
|
|
851
|
+
isValidIBAN: () => isValidIBAN,
|
|
839
852
|
isValidIPv6: () => isValidIPv6,
|
|
840
853
|
isValidJWT: () => isValidJWT,
|
|
841
854
|
locales: () => locales_exports,
|
|
@@ -846,7 +859,8 @@ __export(core_exports2, {
|
|
|
846
859
|
parseAsync: () => parseAsync,
|
|
847
860
|
parseURLObject: () => parseURLObject,
|
|
848
861
|
prettifyError: () => prettifyError,
|
|
849
|
-
process: () =>
|
|
862
|
+
process: () => processSchema,
|
|
863
|
+
processSchema: () => processSchema,
|
|
850
864
|
regexes: () => regexes_exports,
|
|
851
865
|
registry: () => registry,
|
|
852
866
|
safeDecode: () => safeDecode,
|
|
@@ -866,7 +880,8 @@ __export(core_exports2, {
|
|
|
866
880
|
util: () => util_exports,
|
|
867
881
|
validate: () => validate,
|
|
868
882
|
validateAsync: () => validateAsync,
|
|
869
|
-
version: () => version
|
|
883
|
+
version: () => version,
|
|
884
|
+
withParser: () => withParser
|
|
870
885
|
});
|
|
871
886
|
|
|
872
887
|
// ../../node_modules/zod/v4/core/util.js
|
|
@@ -898,6 +913,7 @@ __export(util_exports, {
|
|
|
898
913
|
createTransparentProxy: () => createTransparentProxy,
|
|
899
914
|
defineLazy: () => defineLazy,
|
|
900
915
|
defineLazyInternal: () => defineLazyInternal,
|
|
916
|
+
derived: () => derived,
|
|
901
917
|
esc: () => esc,
|
|
902
918
|
escapeRegex: () => escapeRegex,
|
|
903
919
|
explicitlyAborted: () => explicitlyAborted,
|
|
@@ -935,6 +951,7 @@ __export(util_exports, {
|
|
|
935
951
|
promiseAllObject: () => promiseAllObject,
|
|
936
952
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
937
953
|
randomString: () => randomString,
|
|
954
|
+
rawShape: () => rawShape,
|
|
938
955
|
required: () => required,
|
|
939
956
|
safeExtend: () => safeExtend,
|
|
940
957
|
shallowClone: () => shallowClone,
|
|
@@ -975,18 +992,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
975
992
|
return value.toString();
|
|
976
993
|
return value;
|
|
977
994
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
995
|
+
var Cached = class {
|
|
996
|
+
constructor(getter) {
|
|
997
|
+
this._getter = getter;
|
|
998
|
+
this._value = void 0;
|
|
999
|
+
}
|
|
1000
|
+
get value() {
|
|
1001
|
+
const getter = this._getter;
|
|
1002
|
+
if (getter !== void 0) {
|
|
1003
|
+
this._value = getter();
|
|
1004
|
+
this._getter = void 0;
|
|
988
1005
|
}
|
|
989
|
-
|
|
1006
|
+
return this._value;
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
function cached(getter) {
|
|
1010
|
+
return new Cached(getter);
|
|
990
1011
|
}
|
|
991
1012
|
function nullish(input2) {
|
|
992
1013
|
return input2 === null || input2 === void 0;
|
|
@@ -1038,6 +1059,56 @@ function assignProp(target, prop, value) {
|
|
|
1038
1059
|
configurable: true
|
|
1039
1060
|
});
|
|
1040
1061
|
}
|
|
1062
|
+
function rawShape(def) {
|
|
1063
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1064
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
1065
|
+
}
|
|
1066
|
+
function sourceShape(schema) {
|
|
1067
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
1068
|
+
}
|
|
1069
|
+
function deferProp(target, key, getter) {
|
|
1070
|
+
Object.defineProperty(target, key, {
|
|
1071
|
+
get() {
|
|
1072
|
+
const value = getter();
|
|
1073
|
+
assignProp(this, key, value);
|
|
1074
|
+
return value;
|
|
1075
|
+
},
|
|
1076
|
+
enumerable: true,
|
|
1077
|
+
configurable: true
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
function putProp(target, key, value) {
|
|
1081
|
+
if (key in target)
|
|
1082
|
+
assignProp(target, key, value);
|
|
1083
|
+
else
|
|
1084
|
+
target[key] = value;
|
|
1085
|
+
}
|
|
1086
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
1087
|
+
const raw = sourceShape(source);
|
|
1088
|
+
for (const key of keys) {
|
|
1089
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
1090
|
+
if (!desc.enumerable)
|
|
1091
|
+
continue;
|
|
1092
|
+
if (desc.get) {
|
|
1093
|
+
deferProp(target, key, () => {
|
|
1094
|
+
const value = source._zod.def.shape[key];
|
|
1095
|
+
return wrap ? wrap(value, key) : value;
|
|
1096
|
+
});
|
|
1097
|
+
} else
|
|
1098
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
function mirrorProps(target, source) {
|
|
1102
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
1103
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1104
|
+
if (!desc.enumerable)
|
|
1105
|
+
continue;
|
|
1106
|
+
if (desc.get)
|
|
1107
|
+
deferProp(target, key, () => source[key]);
|
|
1108
|
+
else
|
|
1109
|
+
putProp(target, key, desc.value);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1041
1112
|
function mergeDefs(...defs) {
|
|
1042
1113
|
const mergedDescriptors = {};
|
|
1043
1114
|
for (const def of defs) {
|
|
@@ -1276,23 +1347,21 @@ function pick(schema, mask) {
|
|
|
1276
1347
|
if (hasChecks) {
|
|
1277
1348
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
1278
1349
|
}
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
});
|
|
1295
|
-
return clone(schema, def);
|
|
1350
|
+
const newShape = {};
|
|
1351
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
1352
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1353
|
+
}
|
|
1354
|
+
function maskedKeys(schema, mask) {
|
|
1355
|
+
const raw = sourceShape(schema);
|
|
1356
|
+
const keys = [];
|
|
1357
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
1358
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
1359
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1360
|
+
}
|
|
1361
|
+
if (mask[key])
|
|
1362
|
+
keys.push(key);
|
|
1363
|
+
}
|
|
1364
|
+
return keys;
|
|
1296
1365
|
}
|
|
1297
1366
|
function omit(schema, mask) {
|
|
1298
1367
|
const currDef = schema._zod.def;
|
|
@@ -1301,23 +1370,10 @@ function omit(schema, mask) {
|
|
|
1301
1370
|
if (hasChecks) {
|
|
1302
1371
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
1303
1372
|
}
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
1309
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1310
|
-
}
|
|
1311
|
-
if (!mask[key])
|
|
1312
|
-
continue;
|
|
1313
|
-
delete newShape[key];
|
|
1314
|
-
}
|
|
1315
|
-
assignProp(this, "shape", newShape);
|
|
1316
|
-
return newShape;
|
|
1317
|
-
},
|
|
1318
|
-
checks: []
|
|
1319
|
-
});
|
|
1320
|
-
return clone(schema, def);
|
|
1373
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
1374
|
+
const newShape = {};
|
|
1375
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
1376
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1321
1377
|
}
|
|
1322
1378
|
function extend(schema, shape) {
|
|
1323
1379
|
if (!isPlainObject(shape)) {
|
|
@@ -1326,34 +1382,26 @@ function extend(schema, shape) {
|
|
|
1326
1382
|
const checks = schema._zod.def.checks;
|
|
1327
1383
|
const hasChecks = checks && checks.length > 0;
|
|
1328
1384
|
if (hasChecks) {
|
|
1329
|
-
const existingShape = schema
|
|
1385
|
+
const existingShape = sourceShape(schema);
|
|
1330
1386
|
for (const key of Reflect.ownKeys(shape)) {
|
|
1331
1387
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
1332
1388
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
1333
1389
|
}
|
|
1334
1390
|
}
|
|
1335
1391
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
return clone(schema, def);
|
|
1392
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
1393
|
+
}
|
|
1394
|
+
function extended(schema, shape) {
|
|
1395
|
+
const newShape = {};
|
|
1396
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
1397
|
+
mirrorProps(newShape, shape);
|
|
1398
|
+
return newShape;
|
|
1344
1399
|
}
|
|
1345
1400
|
function safeExtend(schema, shape) {
|
|
1346
1401
|
if (!isPlainObject(shape)) {
|
|
1347
1402
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1348
1403
|
}
|
|
1349
|
-
|
|
1350
|
-
get shape() {
|
|
1351
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1352
|
-
assignProp(this, "shape", _shape);
|
|
1353
|
-
return _shape;
|
|
1354
|
-
}
|
|
1355
|
-
});
|
|
1356
|
-
return clone(schema, def);
|
|
1404
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
1357
1405
|
}
|
|
1358
1406
|
function merge(a, b) {
|
|
1359
1407
|
if (!b?._zod?.def) {
|
|
@@ -1362,12 +1410,11 @@ function merge(a, b) {
|
|
|
1362
1410
|
if (a._zod.def.checks?.length) {
|
|
1363
1411
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
1364
1412
|
}
|
|
1413
|
+
const newShape = {};
|
|
1414
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
1415
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
1365
1416
|
const def = mergeDefs(a._zod.def, {
|
|
1366
|
-
|
|
1367
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
1368
|
-
assignProp(this, "shape", _shape);
|
|
1369
|
-
return _shape;
|
|
1370
|
-
},
|
|
1417
|
+
shape: newShape,
|
|
1371
1418
|
get catchall() {
|
|
1372
1419
|
return b._zod.def.catchall;
|
|
1373
1420
|
},
|
|
@@ -1382,67 +1429,19 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
1382
1429
|
if (hasChecks) {
|
|
1383
1430
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
1384
1431
|
}
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
if (mask) {
|
|
1390
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
1391
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
1392
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1393
|
-
}
|
|
1394
|
-
if (!mask[key])
|
|
1395
|
-
continue;
|
|
1396
|
-
shape[key] = Class2 ? new Class2({
|
|
1397
|
-
type: "optional",
|
|
1398
|
-
innerType: oldShape[key]
|
|
1399
|
-
}) : oldShape[key];
|
|
1400
|
-
}
|
|
1401
|
-
} else {
|
|
1402
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
1403
|
-
shape[key] = Class2 ? new Class2({
|
|
1404
|
-
type: "optional",
|
|
1405
|
-
innerType: oldShape[key]
|
|
1406
|
-
}) : oldShape[key];
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
assignProp(this, "shape", shape);
|
|
1410
|
-
return shape;
|
|
1411
|
-
},
|
|
1412
|
-
checks: []
|
|
1413
|
-
});
|
|
1414
|
-
return clone(schema, def);
|
|
1432
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
1433
|
+
const newShape = {};
|
|
1434
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
|
|
1435
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
1415
1436
|
}
|
|
1416
1437
|
function required(Class2, schema, mask) {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1425
|
-
}
|
|
1426
|
-
if (!mask[key])
|
|
1427
|
-
continue;
|
|
1428
|
-
shape[key] = new Class2({
|
|
1429
|
-
type: "nonoptional",
|
|
1430
|
-
innerType: oldShape[key]
|
|
1431
|
-
});
|
|
1432
|
-
}
|
|
1433
|
-
} else {
|
|
1434
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
1435
|
-
shape[key] = new Class2({
|
|
1436
|
-
type: "nonoptional",
|
|
1437
|
-
innerType: oldShape[key]
|
|
1438
|
-
});
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
assignProp(this, "shape", shape);
|
|
1442
|
-
return shape;
|
|
1443
|
-
}
|
|
1444
|
-
});
|
|
1445
|
-
return clone(schema, def);
|
|
1438
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
1439
|
+
const newShape = {};
|
|
1440
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
|
|
1441
|
+
// overwrite with non-optional
|
|
1442
|
+
selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
1443
|
+
));
|
|
1444
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
1446
1445
|
}
|
|
1447
1446
|
function aborted(x, startIndex = 0) {
|
|
1448
1447
|
if (x.aborted === true)
|
|
@@ -1492,13 +1491,18 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1492
1491
|
}
|
|
1493
1492
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
1494
1493
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
|
|
1494
|
+
const full = {};
|
|
1495
|
+
for (const k of Object.keys(iss)) {
|
|
1496
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
1497
|
+
continue;
|
|
1498
|
+
full[k] = iss[k];
|
|
1499
|
+
}
|
|
1500
|
+
full.path ?? (full.path = []);
|
|
1501
|
+
full.message = message;
|
|
1498
1502
|
if (ctx?.reportInput) {
|
|
1499
|
-
|
|
1503
|
+
full.input = iss.input;
|
|
1500
1504
|
}
|
|
1501
|
-
return
|
|
1505
|
+
return full;
|
|
1502
1506
|
}
|
|
1503
1507
|
function getSizableOrigin(input2) {
|
|
1504
1508
|
if (input2 instanceof Set)
|
|
@@ -1617,6 +1621,9 @@ function members(proto, table) {
|
|
|
1617
1621
|
else
|
|
1618
1622
|
defineBound(proto, key, desc.value);
|
|
1619
1623
|
}
|
|
1624
|
+
for (const sym of Object.getOwnPropertySymbols(table)) {
|
|
1625
|
+
defineBound(proto, sym, table[sym]);
|
|
1626
|
+
}
|
|
1620
1627
|
}
|
|
1621
1628
|
function own(inst, key, value, enumerable = true) {
|
|
1622
1629
|
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
|
|
@@ -1625,6 +1632,23 @@ function own(inst, key, value, enumerable = true) {
|
|
|
1625
1632
|
function hide(inst, key, value) {
|
|
1626
1633
|
return own(inst, key, value, false);
|
|
1627
1634
|
}
|
|
1635
|
+
// @__NO_SIDE_EFFECTS__
|
|
1636
|
+
function derived(computes, table) {
|
|
1637
|
+
for (const key in computes) {
|
|
1638
|
+
const compute = computes[key];
|
|
1639
|
+
Object.defineProperty(table, key, {
|
|
1640
|
+
configurable: true,
|
|
1641
|
+
enumerable: true,
|
|
1642
|
+
get() {
|
|
1643
|
+
return own(this, key, compute(this));
|
|
1644
|
+
},
|
|
1645
|
+
set(value) {
|
|
1646
|
+
own(this, key, value);
|
|
1647
|
+
}
|
|
1648
|
+
});
|
|
1649
|
+
}
|
|
1650
|
+
return table;
|
|
1651
|
+
}
|
|
1628
1652
|
function defineBound(proto, key, fn) {
|
|
1629
1653
|
Object.defineProperty(proto, key, {
|
|
1630
1654
|
configurable: true,
|
|
@@ -1844,16 +1868,12 @@ var _messageDesc = {
|
|
|
1844
1868
|
enumerable: true,
|
|
1845
1869
|
configurable: true
|
|
1846
1870
|
};
|
|
1847
|
-
var _zodDesc2 = { value: void 0, enumerable: false };
|
|
1848
1871
|
var _issuesDesc = { value: void 0, enumerable: false };
|
|
1849
1872
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
1850
1873
|
var initializer = (inst, def) => {
|
|
1851
1874
|
inst.name = "$ZodError";
|
|
1852
|
-
_zodDesc2.value = inst._zod;
|
|
1853
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
1854
1875
|
_issuesDesc.value = def;
|
|
1855
1876
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
1856
|
-
_zodDesc2.value = void 0;
|
|
1857
1877
|
_issuesDesc.value = void 0;
|
|
1858
1878
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
1859
1879
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -1887,10 +1907,10 @@ function node(obj, key, make) {
|
|
|
1887
1907
|
}
|
|
1888
1908
|
return obj[key];
|
|
1889
1909
|
}
|
|
1890
|
-
function flattenError(
|
|
1910
|
+
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
1891
1911
|
const fieldErrors = {};
|
|
1892
1912
|
const formErrors = [];
|
|
1893
|
-
for (const sub of
|
|
1913
|
+
for (const sub of error62.issues) {
|
|
1894
1914
|
if (sub.path.length > 0) {
|
|
1895
1915
|
node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
1896
1916
|
} else {
|
|
@@ -1899,10 +1919,10 @@ function flattenError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1899
1919
|
}
|
|
1900
1920
|
return { formErrors, fieldErrors };
|
|
1901
1921
|
}
|
|
1902
|
-
function formatError(
|
|
1922
|
+
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
1903
1923
|
const fieldErrors = { _errors: [] };
|
|
1904
|
-
const processError = (
|
|
1905
|
-
for (const issue2 of
|
|
1924
|
+
const processError = (error63, path5 = []) => {
|
|
1925
|
+
for (const issue2 of error63.issues) {
|
|
1906
1926
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1907
1927
|
issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
|
|
1908
1928
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -1944,14 +1964,14 @@ function formatError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1944
1964
|
}
|
|
1945
1965
|
}
|
|
1946
1966
|
};
|
|
1947
|
-
processError(
|
|
1967
|
+
processError(error62);
|
|
1948
1968
|
return fieldErrors;
|
|
1949
1969
|
}
|
|
1950
|
-
function treeifyError(
|
|
1970
|
+
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
1951
1971
|
const result = { errors: [] };
|
|
1952
|
-
const processError = (
|
|
1972
|
+
const processError = (error63, path5 = []) => {
|
|
1953
1973
|
var _a3;
|
|
1954
|
-
for (const issue2 of
|
|
1974
|
+
for (const issue2 of error63.issues) {
|
|
1955
1975
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1956
1976
|
issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
|
|
1957
1977
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -1993,7 +2013,7 @@ function treeifyError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1993
2013
|
}
|
|
1994
2014
|
}
|
|
1995
2015
|
};
|
|
1996
|
-
processError(
|
|
2016
|
+
processError(error62);
|
|
1997
2017
|
return result;
|
|
1998
2018
|
}
|
|
1999
2019
|
function toDotPath(_path) {
|
|
@@ -2014,9 +2034,9 @@ function toDotPath(_path) {
|
|
|
2014
2034
|
}
|
|
2015
2035
|
return segs.join("");
|
|
2016
2036
|
}
|
|
2017
|
-
function prettifyError(
|
|
2037
|
+
function prettifyError(error62) {
|
|
2018
2038
|
const lines = [];
|
|
2019
|
-
const issues = [...
|
|
2039
|
+
const issues = [...error62.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
2020
2040
|
for (const issue2 of issues) {
|
|
2021
2041
|
lines.push(`\u2716 ${issue2.message}`);
|
|
2022
2042
|
if (issue2.path?.length)
|
|
@@ -2068,33 +2088,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
2068
2088
|
if (result instanceof Promise) {
|
|
2069
2089
|
throw new $ZodAsyncError();
|
|
2070
2090
|
}
|
|
2071
|
-
return result.issues.length ? {
|
|
2072
|
-
success: false,
|
|
2073
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
2074
|
-
} : { success: true, data: result.value };
|
|
2091
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
2075
2092
|
};
|
|
2076
2093
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
2094
|
+
function failure(Err, issues, ctx) {
|
|
2095
|
+
let error62;
|
|
2096
|
+
return {
|
|
2097
|
+
success: false,
|
|
2098
|
+
get error() {
|
|
2099
|
+
if (!error62) {
|
|
2100
|
+
error62 = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
2101
|
+
issues = void 0;
|
|
2102
|
+
ctx = void 0;
|
|
2103
|
+
}
|
|
2104
|
+
return error62;
|
|
2105
|
+
},
|
|
2106
|
+
set error(e) {
|
|
2107
|
+
error62 = e;
|
|
2108
|
+
issues = void 0;
|
|
2109
|
+
ctx = void 0;
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2077
2113
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
2078
2114
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
2079
2115
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
2080
2116
|
if (result instanceof Promise)
|
|
2081
2117
|
result = await result;
|
|
2082
|
-
return result.issues.length ? {
|
|
2083
|
-
success: false,
|
|
2084
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
2085
|
-
} : { success: true, data: result.value };
|
|
2118
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
2086
2119
|
};
|
|
2087
2120
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
2088
2121
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
2089
2122
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
2090
2123
|
var validate = ((schema, value, _ctx) => {
|
|
2091
2124
|
const validator = schema._zod.bag.validator;
|
|
2092
|
-
if (validator !== void 0
|
|
2093
|
-
|
|
2125
|
+
if (validator !== void 0) {
|
|
2126
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
2127
|
+
return true;
|
|
2128
|
+
if (validator.definite === true && _ctx === void 0)
|
|
2129
|
+
return false;
|
|
2130
|
+
}
|
|
2094
2131
|
return validateFallback(schema, value, _ctx);
|
|
2095
2132
|
});
|
|
2096
2133
|
function validateFallback(schema, value, _ctx) {
|
|
2097
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
2134
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
2098
2135
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
2099
2136
|
let result;
|
|
2100
2137
|
if (fallbackRun) {
|
|
@@ -2109,7 +2146,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
2109
2146
|
return result.issues.length === 0;
|
|
2110
2147
|
}
|
|
2111
2148
|
var validateAsync = async (schema, value, _ctx) => {
|
|
2112
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
2149
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
2113
2150
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
2114
2151
|
if (result instanceof Promise)
|
|
2115
2152
|
result = await result;
|
|
@@ -2171,6 +2208,7 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
|
2171
2208
|
// ../../node_modules/zod/v4/core/regexes.js
|
|
2172
2209
|
var regexes_exports = {};
|
|
2173
2210
|
__export(regexes_exports, {
|
|
2211
|
+
anyString: () => anyString,
|
|
2174
2212
|
base64: () => base64,
|
|
2175
2213
|
base64url: () => base64url,
|
|
2176
2214
|
bigint: () => bigint,
|
|
@@ -2194,6 +2232,7 @@ __export(regexes_exports, {
|
|
|
2194
2232
|
hostname: () => hostname,
|
|
2195
2233
|
html5Email: () => html5Email,
|
|
2196
2234
|
httpProtocol: () => httpProtocol,
|
|
2235
|
+
iban: () => iban,
|
|
2197
2236
|
idnEmail: () => idnEmail,
|
|
2198
2237
|
integer: () => integer,
|
|
2199
2238
|
ipv4: () => ipv4,
|
|
@@ -2253,13 +2292,13 @@ var uuid = (version2) => {
|
|
|
2253
2292
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
2254
2293
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
2255
2294
|
var uuid7 = /* @__PURE__ */ uuid(7);
|
|
2256
|
-
var email = /^(
|
|
2295
|
+
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,}$/;
|
|
2257
2296
|
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])?)*$/;
|
|
2258
2297
|
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,}))$/;
|
|
2259
2298
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
2260
2299
|
var idnEmail = unicodeEmail;
|
|
2261
2300
|
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])?)*$/;
|
|
2262
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
2301
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
2263
2302
|
function emoji() {
|
|
2264
2303
|
return new RegExp(_emoji, "u");
|
|
2265
2304
|
}
|
|
@@ -2272,12 +2311,13 @@ var mac = (delimiter) => {
|
|
|
2272
2311
|
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])$/;
|
|
2273
2312
|
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])$/;
|
|
2274
2313
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
2275
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
2314
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
2276
2315
|
var hostname = /^(?=.{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])?)*\.?$/;
|
|
2277
2316
|
var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
2278
2317
|
var httpProtocol = /^https?$/;
|
|
2279
2318
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
2280
2319
|
var creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
2320
|
+
var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
2281
2321
|
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])))`;
|
|
2282
2322
|
function anchor(source) {
|
|
2283
2323
|
return new RegExp(`^${source}$`);
|
|
@@ -2299,6 +2339,7 @@ function datetime(args) {
|
|
|
2299
2339
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
2300
2340
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
2301
2341
|
}
|
|
2342
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
2302
2343
|
var string = (params) => {
|
|
2303
2344
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
2304
2345
|
return new RegExp(`^${regex}$`);
|
|
@@ -2357,16 +2398,6 @@ var numericOriginMap = {
|
|
|
2357
2398
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
2358
2399
|
$ZodCheck.init(inst, def);
|
|
2359
2400
|
const origin = numericOriginMap[typeof def.value];
|
|
2360
|
-
inst._zod.onattach.push((inst2) => {
|
|
2361
|
-
const bag = inst2._zod.bag;
|
|
2362
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
2363
|
-
if (def.value < curr) {
|
|
2364
|
-
if (def.inclusive)
|
|
2365
|
-
bag.maximum = def.value;
|
|
2366
|
-
else
|
|
2367
|
-
bag.exclusiveMaximum = def.value;
|
|
2368
|
-
}
|
|
2369
|
-
});
|
|
2370
2401
|
inst._zod.check = (payload) => {
|
|
2371
2402
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
2372
2403
|
return;
|
|
@@ -2385,16 +2416,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
2385
2416
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
2386
2417
|
$ZodCheck.init(inst, def);
|
|
2387
2418
|
const origin = numericOriginMap[typeof def.value];
|
|
2388
|
-
inst._zod.onattach.push((inst2) => {
|
|
2389
|
-
const bag = inst2._zod.bag;
|
|
2390
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
2391
|
-
if (def.value > curr) {
|
|
2392
|
-
if (def.inclusive)
|
|
2393
|
-
bag.minimum = def.value;
|
|
2394
|
-
else
|
|
2395
|
-
bag.exclusiveMinimum = def.value;
|
|
2396
|
-
}
|
|
2397
|
-
});
|
|
2398
2419
|
inst._zod.check = (payload) => {
|
|
2399
2420
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
2400
2421
|
return;
|
|
@@ -2412,10 +2433,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
2412
2433
|
});
|
|
2413
2434
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
2414
2435
|
$ZodCheck.init(inst, def);
|
|
2415
|
-
inst._zod.onattach.push((inst2) => {
|
|
2416
|
-
var _a3;
|
|
2417
|
-
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
2418
|
-
});
|
|
2419
2436
|
inst._zod.check = (payload) => {
|
|
2420
2437
|
if (typeof payload.value !== typeof def.value)
|
|
2421
2438
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -2441,14 +2458,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2441
2458
|
const isInt = def.format?.includes("int");
|
|
2442
2459
|
const origin = isInt ? "int" : "number";
|
|
2443
2460
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
2444
|
-
inst._zod.onattach.push((inst2) => {
|
|
2445
|
-
const bag = inst2._zod.bag;
|
|
2446
|
-
bag.format = def.format;
|
|
2447
|
-
bag.minimum = minimum;
|
|
2448
|
-
bag.maximum = maximum;
|
|
2449
|
-
if (isInt)
|
|
2450
|
-
bag.pattern = integer;
|
|
2451
|
-
});
|
|
2452
2461
|
inst._zod.check = (payload) => {
|
|
2453
2462
|
const input2 = payload.value;
|
|
2454
2463
|
if (isInt) {
|
|
@@ -2517,12 +2526,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2517
2526
|
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
2518
2527
|
$ZodCheck.init(inst, def);
|
|
2519
2528
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
2520
|
-
inst._zod.onattach.push((inst2) => {
|
|
2521
|
-
const bag = inst2._zod.bag;
|
|
2522
|
-
bag.format = def.format;
|
|
2523
|
-
bag.minimum = minimum;
|
|
2524
|
-
bag.maximum = maximum;
|
|
2525
|
-
});
|
|
2526
2529
|
inst._zod.check = (payload) => {
|
|
2527
2530
|
const input2 = payload.value;
|
|
2528
2531
|
if (input2 < minimum) {
|
|
@@ -2553,11 +2556,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
2553
2556
|
var _a3;
|
|
2554
2557
|
$ZodCheck.init(inst, def);
|
|
2555
2558
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2556
|
-
inst._zod.onattach.push((inst2) => {
|
|
2557
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2558
|
-
if (def.maximum < curr)
|
|
2559
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
2560
|
-
});
|
|
2561
2559
|
inst._zod.check = (payload) => {
|
|
2562
2560
|
const input2 = payload.value;
|
|
2563
2561
|
const size = input2.size;
|
|
@@ -2578,11 +2576,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
2578
2576
|
var _a3;
|
|
2579
2577
|
$ZodCheck.init(inst, def);
|
|
2580
2578
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2581
|
-
inst._zod.onattach.push((inst2) => {
|
|
2582
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2583
|
-
if (def.minimum > curr)
|
|
2584
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
2585
|
-
});
|
|
2586
2579
|
inst._zod.check = (payload) => {
|
|
2587
2580
|
const input2 = payload.value;
|
|
2588
2581
|
const size = input2.size;
|
|
@@ -2603,12 +2596,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
2603
2596
|
var _a3;
|
|
2604
2597
|
$ZodCheck.init(inst, def);
|
|
2605
2598
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2606
|
-
inst._zod.onattach.push((inst2) => {
|
|
2607
|
-
const bag = inst2._zod.bag;
|
|
2608
|
-
bag.minimum = def.size;
|
|
2609
|
-
bag.maximum = def.size;
|
|
2610
|
-
bag.size = def.size;
|
|
2611
|
-
});
|
|
2612
2599
|
inst._zod.check = (payload) => {
|
|
2613
2600
|
const input2 = payload.value;
|
|
2614
2601
|
const size = input2.size;
|
|
@@ -2630,11 +2617,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2630
2617
|
var _a3;
|
|
2631
2618
|
$ZodCheck.init(inst, def);
|
|
2632
2619
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2633
|
-
inst._zod.onattach.push((inst2) => {
|
|
2634
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2635
|
-
if (def.maximum < curr)
|
|
2636
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
2637
|
-
});
|
|
2638
2620
|
inst._zod.check = (payload) => {
|
|
2639
2621
|
const input2 = payload.value;
|
|
2640
2622
|
const units = input2.length;
|
|
@@ -2657,11 +2639,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2657
2639
|
var _a3;
|
|
2658
2640
|
$ZodCheck.init(inst, def);
|
|
2659
2641
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2660
|
-
inst._zod.onattach.push((inst2) => {
|
|
2661
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2662
|
-
if (def.minimum > curr)
|
|
2663
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
2664
|
-
});
|
|
2665
2642
|
inst._zod.check = (payload) => {
|
|
2666
2643
|
const input2 = payload.value;
|
|
2667
2644
|
const units = input2.length;
|
|
@@ -2684,12 +2661,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2684
2661
|
var _a3;
|
|
2685
2662
|
$ZodCheck.init(inst, def);
|
|
2686
2663
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2687
|
-
inst._zod.onattach.push((inst2) => {
|
|
2688
|
-
const bag = inst2._zod.bag;
|
|
2689
|
-
bag.minimum = def.length;
|
|
2690
|
-
bag.maximum = def.length;
|
|
2691
|
-
bag.length = def.length;
|
|
2692
|
-
});
|
|
2693
2664
|
inst._zod.check = (payload) => {
|
|
2694
2665
|
const input2 = payload.value;
|
|
2695
2666
|
const units = input2.length;
|
|
@@ -2712,14 +2683,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2712
2683
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
2713
2684
|
var _a3, _b;
|
|
2714
2685
|
$ZodCheck.init(inst, def);
|
|
2715
|
-
inst._zod.onattach.push((inst2) => {
|
|
2716
|
-
const bag = inst2._zod.bag;
|
|
2717
|
-
bag.format = def.format;
|
|
2718
|
-
if (def.pattern) {
|
|
2719
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2720
|
-
bag.patterns.add(def.pattern);
|
|
2721
|
-
}
|
|
2722
|
-
});
|
|
2723
2686
|
if (def.pattern)
|
|
2724
2687
|
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
2725
2688
|
def.pattern.lastIndex = 0;
|
|
@@ -2769,11 +2732,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
2769
2732
|
const escapedRegex = escapeRegex(def.includes);
|
|
2770
2733
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
2771
2734
|
def.pattern = pattern;
|
|
2772
|
-
inst._zod.onattach.push((inst2) => {
|
|
2773
|
-
const bag = inst2._zod.bag;
|
|
2774
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2775
|
-
bag.patterns.add(pattern);
|
|
2776
|
-
});
|
|
2777
2735
|
inst._zod.check = (payload) => {
|
|
2778
2736
|
if (payload.value.includes(def.includes, def.position))
|
|
2779
2737
|
return;
|
|
@@ -2792,11 +2750,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
2792
2750
|
$ZodCheck.init(inst, def);
|
|
2793
2751
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
2794
2752
|
def.pattern ?? (def.pattern = pattern);
|
|
2795
|
-
inst._zod.onattach.push((inst2) => {
|
|
2796
|
-
const bag = inst2._zod.bag;
|
|
2797
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2798
|
-
bag.patterns.add(pattern);
|
|
2799
|
-
});
|
|
2800
2753
|
inst._zod.check = (payload) => {
|
|
2801
2754
|
if (payload.value.startsWith(def.prefix))
|
|
2802
2755
|
return;
|
|
@@ -2815,11 +2768,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
2815
2768
|
$ZodCheck.init(inst, def);
|
|
2816
2769
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
2817
2770
|
def.pattern ?? (def.pattern = pattern);
|
|
2818
|
-
inst._zod.onattach.push((inst2) => {
|
|
2819
|
-
const bag = inst2._zod.bag;
|
|
2820
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2821
|
-
bag.patterns.add(pattern);
|
|
2822
|
-
});
|
|
2823
2771
|
inst._zod.check = (payload) => {
|
|
2824
2772
|
if (payload.value.endsWith(def.suffix))
|
|
2825
2773
|
return;
|
|
@@ -2856,9 +2804,6 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
|
|
|
2856
2804
|
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
2857
2805
|
$ZodCheck.init(inst, def);
|
|
2858
2806
|
const mimeSet = new Set(def.mime);
|
|
2859
|
-
inst._zod.onattach.push((inst2) => {
|
|
2860
|
-
inst2._zod.bag.mime = def.mime;
|
|
2861
|
-
});
|
|
2862
2807
|
inst._zod.check = (payload) => {
|
|
2863
2808
|
if (mimeSet.has(payload.value.type))
|
|
2864
2809
|
return;
|
|
@@ -2886,10 +2831,14 @@ var Doc = class {
|
|
|
2886
2831
|
this.args = args;
|
|
2887
2832
|
this.closed = closed;
|
|
2888
2833
|
}
|
|
2834
|
+
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
|
|
2889
2835
|
indented(fn) {
|
|
2890
2836
|
this.indent += 1;
|
|
2891
|
-
|
|
2892
|
-
|
|
2837
|
+
try {
|
|
2838
|
+
fn(this);
|
|
2839
|
+
} finally {
|
|
2840
|
+
this.indent -= 1;
|
|
2841
|
+
}
|
|
2893
2842
|
}
|
|
2894
2843
|
write(arg) {
|
|
2895
2844
|
if (typeof arg === "function") {
|
|
@@ -2918,8 +2867,8 @@ ${content.join("\n")}
|
|
|
2918
2867
|
// ../../node_modules/zod/v4/core/versions.js
|
|
2919
2868
|
var version = {
|
|
2920
2869
|
major: 4,
|
|
2921
|
-
minor:
|
|
2922
|
-
patch:
|
|
2870
|
+
minor: 6,
|
|
2871
|
+
patch: 1
|
|
2923
2872
|
};
|
|
2924
2873
|
|
|
2925
2874
|
// ../../node_modules/zod/v4/core/schemas.js
|
|
@@ -3032,15 +2981,22 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
3032
2981
|
own(this, "~standard", value);
|
|
3033
2982
|
}
|
|
3034
2983
|
});
|
|
3035
|
-
var toStandardResult = (r) => r.
|
|
2984
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
2985
|
+
async function validateAsync2(inst, value) {
|
|
2986
|
+
const ctx = { async: true };
|
|
2987
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
2988
|
+
}
|
|
3036
2989
|
function standardProps(inst) {
|
|
3037
2990
|
return {
|
|
3038
2991
|
validate: (value) => {
|
|
2992
|
+
const ctx = { async: false };
|
|
3039
2993
|
try {
|
|
3040
|
-
|
|
2994
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
2995
|
+
if (!(r instanceof Promise))
|
|
2996
|
+
return toStandardResult(r, ctx);
|
|
3041
2997
|
} catch (_) {
|
|
3042
|
-
return safeParseAsync(inst, value).then(toStandardResult);
|
|
3043
2998
|
}
|
|
2999
|
+
return validateAsync2(inst, value);
|
|
3044
3000
|
},
|
|
3045
3001
|
vendor: "zod",
|
|
3046
3002
|
version: 1
|
|
@@ -3048,7 +3004,7 @@ function standardProps(inst) {
|
|
|
3048
3004
|
}
|
|
3049
3005
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
3050
3006
|
$ZodType.init(inst, def);
|
|
3051
|
-
inst._zod.pattern =
|
|
3007
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
3052
3008
|
inst._zod.parse = (payload, _) => {
|
|
3053
3009
|
if (def.coerce)
|
|
3054
3010
|
try {
|
|
@@ -3217,12 +3173,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
3217
3173
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
3218
3174
|
def.pattern ?? (def.pattern = datetime(def));
|
|
3219
3175
|
$ZodStringFormat.init(inst, def);
|
|
3220
|
-
if (def.local || def.precision === -1) {
|
|
3221
|
-
inst._zod.bag.laxFormat = true;
|
|
3222
|
-
inst._zod.onattach.push((s) => {
|
|
3223
|
-
s._zod.bag.laxFormat = true;
|
|
3224
|
-
});
|
|
3225
|
-
}
|
|
3226
3176
|
});
|
|
3227
3177
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
3228
3178
|
def.pattern ?? (def.pattern = date);
|
|
@@ -3239,7 +3189,6 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
3239
3189
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
3240
3190
|
def.pattern ?? (def.pattern = ipv4);
|
|
3241
3191
|
$ZodStringFormat.init(inst, def);
|
|
3242
|
-
inst._zod.bag.format = `ipv4`;
|
|
3243
3192
|
});
|
|
3244
3193
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
3245
3194
|
function isValidIPv6(value) {
|
|
@@ -3255,7 +3204,6 @@ function isValidIPv6(value) {
|
|
|
3255
3204
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
3256
3205
|
def.pattern ?? (def.pattern = ipv6);
|
|
3257
3206
|
$ZodStringFormat.init(inst, def);
|
|
3258
|
-
inst._zod.bag.format = `ipv6`;
|
|
3259
3207
|
inst._zod.check = (payload) => {
|
|
3260
3208
|
if (!isValidIPv6(payload.value)) {
|
|
3261
3209
|
payload.issues.push({
|
|
@@ -3271,7 +3219,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
3271
3219
|
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
|
|
3272
3220
|
def.pattern ?? (def.pattern = mac(def.delimiter));
|
|
3273
3221
|
$ZodStringFormat.init(inst, def);
|
|
3274
|
-
inst._zod.bag.format = `mac`;
|
|
3275
3222
|
});
|
|
3276
3223
|
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
3277
3224
|
def.pattern ?? (def.pattern = cidrv4);
|
|
@@ -3320,10 +3267,10 @@ function isValidBase64(data) {
|
|
|
3320
3267
|
return false;
|
|
3321
3268
|
}
|
|
3322
3269
|
}
|
|
3270
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
3323
3271
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
3324
|
-
def.pattern ?? (def.pattern =
|
|
3272
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
3325
3273
|
$ZodStringFormat.init(inst, def);
|
|
3326
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
3327
3274
|
inst._zod.check = (payload) => {
|
|
3328
3275
|
if (isValidBase64(payload.value))
|
|
3329
3276
|
return;
|
|
@@ -3336,17 +3283,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
3336
3283
|
});
|
|
3337
3284
|
};
|
|
3338
3285
|
});
|
|
3286
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
3339
3287
|
function isValidBase64URL(data) {
|
|
3340
|
-
if (!
|
|
3288
|
+
if (!base64urlCharset.test(data))
|
|
3341
3289
|
return false;
|
|
3342
3290
|
const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
3343
3291
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
3344
3292
|
return isValidBase64(padded);
|
|
3345
3293
|
}
|
|
3346
3294
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
3347
|
-
def.pattern ?? (def.pattern =
|
|
3295
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
3348
3296
|
$ZodStringFormat.init(inst, def);
|
|
3349
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
3350
3297
|
inst._zod.check = (payload) => {
|
|
3351
3298
|
if (isValidBase64URL(payload.value))
|
|
3352
3299
|
return;
|
|
@@ -3369,7 +3316,7 @@ function isLuhnAlgo(digits) {
|
|
|
3369
3316
|
let bit = 1;
|
|
3370
3317
|
let sum = 0;
|
|
3371
3318
|
while (length) {
|
|
3372
|
-
const value =
|
|
3319
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
3373
3320
|
bit ^= 1;
|
|
3374
3321
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
3375
3322
|
}
|
|
@@ -3395,6 +3342,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
|
|
|
3395
3342
|
});
|
|
3396
3343
|
};
|
|
3397
3344
|
});
|
|
3345
|
+
function isIso7064Mod97(iban3) {
|
|
3346
|
+
let remainder = 0;
|
|
3347
|
+
const len = iban3.length;
|
|
3348
|
+
for (let i = 4; i < len; i++) {
|
|
3349
|
+
const code = iban3.charCodeAt(i);
|
|
3350
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
3351
|
+
}
|
|
3352
|
+
for (let i = 0; i < 4; i++) {
|
|
3353
|
+
const code = iban3.charCodeAt(i);
|
|
3354
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
3355
|
+
}
|
|
3356
|
+
return remainder === 1;
|
|
3357
|
+
}
|
|
3358
|
+
function isValidIBAN(input2) {
|
|
3359
|
+
if (!iban.test(input2))
|
|
3360
|
+
return false;
|
|
3361
|
+
return isIso7064Mod97(input2);
|
|
3362
|
+
}
|
|
3363
|
+
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
3364
|
+
def.pattern ?? (def.pattern = iban);
|
|
3365
|
+
$ZodStringFormat.init(inst, def);
|
|
3366
|
+
inst._zod.check = (payload) => {
|
|
3367
|
+
if (isValidIBAN(payload.value))
|
|
3368
|
+
return;
|
|
3369
|
+
payload.issues.push({
|
|
3370
|
+
code: "invalid_format",
|
|
3371
|
+
format: "iban",
|
|
3372
|
+
input: payload.value,
|
|
3373
|
+
inst,
|
|
3374
|
+
continue: !def.abort
|
|
3375
|
+
});
|
|
3376
|
+
};
|
|
3377
|
+
});
|
|
3398
3378
|
function isValidJWT(token, algorithm = null) {
|
|
3399
3379
|
try {
|
|
3400
3380
|
const tokensParts = token.split(".");
|
|
@@ -3445,7 +3425,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
|
|
|
3445
3425
|
});
|
|
3446
3426
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
3447
3427
|
$ZodType.init(inst, def);
|
|
3448
|
-
inst._zod.pattern =
|
|
3428
|
+
inst._zod.pattern = number;
|
|
3449
3429
|
inst._zod.parse = (payload, _ctx) => {
|
|
3450
3430
|
if (def.coerce)
|
|
3451
3431
|
try {
|
|
@@ -3647,6 +3627,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3647
3627
|
}
|
|
3648
3628
|
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input2.length), ctx) : Array(input2.length);
|
|
3649
3629
|
const proms = [];
|
|
3630
|
+
const abortEarly = ctx?.abortEarly;
|
|
3650
3631
|
for (let i = 0; i < input2.length; i++) {
|
|
3651
3632
|
const item = input2[i];
|
|
3652
3633
|
const result = def.element._zod.run({
|
|
@@ -3657,6 +3638,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3657
3638
|
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
3658
3639
|
} else {
|
|
3659
3640
|
handleArrayResult(result, payload, i);
|
|
3641
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
3642
|
+
break;
|
|
3660
3643
|
}
|
|
3661
3644
|
}
|
|
3662
3645
|
if (proms.length) {
|
|
@@ -3718,14 +3701,20 @@ function normalizeDef(def) {
|
|
|
3718
3701
|
optionalKeys: new Set(okeys)
|
|
3719
3702
|
};
|
|
3720
3703
|
}
|
|
3721
|
-
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
3704
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
3722
3705
|
const unrecognized = [];
|
|
3723
3706
|
const keySet = def.keySet;
|
|
3724
3707
|
const _catchall = def.catchall._zod;
|
|
3725
3708
|
const t = _catchall.def.type;
|
|
3726
3709
|
const optin = _catchall.optin;
|
|
3727
3710
|
const optout = _catchall.optout;
|
|
3711
|
+
let seen = 0;
|
|
3728
3712
|
for (const key in input2) {
|
|
3713
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3714
|
+
if (aborted(payload, seen))
|
|
3715
|
+
break;
|
|
3716
|
+
seen = payload.issues.length;
|
|
3717
|
+
}
|
|
3729
3718
|
if (keySet.has(key))
|
|
3730
3719
|
continue;
|
|
3731
3720
|
if (key === "__proto__") {
|
|
@@ -3760,23 +3749,19 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
|
3760
3749
|
return payload;
|
|
3761
3750
|
});
|
|
3762
3751
|
}
|
|
3763
|
-
var propShapes = /* @__PURE__ */ new WeakMap();
|
|
3764
3752
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
3765
3753
|
$ZodType.init(inst, def);
|
|
3766
3754
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
return newSh;
|
|
3778
|
-
}
|
|
3779
|
-
});
|
|
3755
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
3756
|
+
if (sh) {
|
|
3757
|
+
const get = () => {
|
|
3758
|
+
const newSh = { ...sh };
|
|
3759
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
3760
|
+
get.raw = newSh;
|
|
3761
|
+
return newSh;
|
|
3762
|
+
};
|
|
3763
|
+
get.raw = sh;
|
|
3764
|
+
Object.defineProperty(def, "shape", { get });
|
|
3780
3765
|
}
|
|
3781
3766
|
const _normalized = cached(() => normalizeDef(def));
|
|
3782
3767
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -3816,7 +3801,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3816
3801
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
3817
3802
|
const proms = [];
|
|
3818
3803
|
const shape = value.shape;
|
|
3804
|
+
const abortEarly = ctx?.abortEarly;
|
|
3805
|
+
let seen = payload.issues.length;
|
|
3819
3806
|
for (const key of value.allKeys) {
|
|
3807
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3808
|
+
if (aborted(payload, seen))
|
|
3809
|
+
break;
|
|
3810
|
+
seen = payload.issues.length;
|
|
3811
|
+
}
|
|
3820
3812
|
if (key === "__proto__")
|
|
3821
3813
|
continue;
|
|
3822
3814
|
const el = shape[key];
|
|
@@ -3832,7 +3824,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3832
3824
|
if (!catchall) {
|
|
3833
3825
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3834
3826
|
}
|
|
3835
|
-
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3827
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
3836
3828
|
};
|
|
3837
3829
|
});
|
|
3838
3830
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3846,10 +3838,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3846
3838
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
3847
3839
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
3848
3840
|
const prefixStr = (id, k) => `
|
|
3841
|
+
let ${id}_ab = false;
|
|
3849
3842
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
3850
3843
|
const iss = ${id}.issues[i];
|
|
3851
3844
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
3852
3845
|
payload.issues.push(iss);
|
|
3846
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
3847
|
+
}
|
|
3848
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
3849
|
+
payload.value = newResult;
|
|
3850
|
+
return payload;
|
|
3853
3851
|
}`;
|
|
3854
3852
|
doc.write(`const input = payload.value;`);
|
|
3855
3853
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -3895,6 +3893,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3895
3893
|
input: undefined,
|
|
3896
3894
|
path: [${k}]
|
|
3897
3895
|
});
|
|
3896
|
+
if (ctx && ctx.abortEarly) {
|
|
3897
|
+
payload.value = newResult;
|
|
3898
|
+
return payload;
|
|
3899
|
+
}
|
|
3898
3900
|
}
|
|
3899
3901
|
|
|
3900
3902
|
if (${id}_present) {
|
|
@@ -3947,7 +3949,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3947
3949
|
payload = fastpass(payload, ctx);
|
|
3948
3950
|
if (!catchall)
|
|
3949
3951
|
return payload;
|
|
3950
|
-
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3952
|
+
return handleCatchall([], input2, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
3951
3953
|
}
|
|
3952
3954
|
return superParse(payload, ctx);
|
|
3953
3955
|
};
|
|
@@ -4079,16 +4081,31 @@ function getDiscriminatedOption(union2, value) {
|
|
|
4079
4081
|
const internals = union2._zod;
|
|
4080
4082
|
let map2 = internals.bag.optionsMap;
|
|
4081
4083
|
if (!map2) {
|
|
4082
|
-
map2 =
|
|
4083
|
-
const { options, discriminator } = internals.def;
|
|
4084
|
-
for (const option of options) {
|
|
4085
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
4086
|
-
if (!map2.has(v))
|
|
4087
|
-
map2.set(v, option);
|
|
4088
|
-
}
|
|
4084
|
+
map2 = discriminatorMap(internals.def);
|
|
4089
4085
|
internals.bag.optionsMap = map2;
|
|
4090
4086
|
}
|
|
4091
|
-
|
|
4087
|
+
const option = map2.get(value);
|
|
4088
|
+
if (option === null)
|
|
4089
|
+
throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
4090
|
+
return option;
|
|
4091
|
+
}
|
|
4092
|
+
function discriminatorMap(def) {
|
|
4093
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
4094
|
+
for (const option of def.options) {
|
|
4095
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
4096
|
+
if (!values || values.size === 0)
|
|
4097
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
4098
|
+
for (const value of values) {
|
|
4099
|
+
if (map2.has(value)) {
|
|
4100
|
+
if (value !== void 0)
|
|
4101
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
4102
|
+
map2.set(value, null);
|
|
4103
|
+
} else {
|
|
4104
|
+
map2.set(value, option);
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
return map2;
|
|
4092
4109
|
}
|
|
4093
4110
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
4094
4111
|
def.inclusive = false;
|
|
@@ -4096,10 +4113,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4096
4113
|
const _super = inst._zod.parse;
|
|
4097
4114
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
4098
4115
|
const propValues = {};
|
|
4116
|
+
let undefinedCount = 0;
|
|
4099
4117
|
for (const option of zod.def.options) {
|
|
4100
4118
|
const pv = option._zod.propValues;
|
|
4101
4119
|
if (!pv || Object.keys(pv).length === 0)
|
|
4102
4120
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
4121
|
+
if (pv[zod.def.discriminator]?.has(void 0))
|
|
4122
|
+
undefinedCount++;
|
|
4103
4123
|
for (const [k, v] of Object.entries(pv)) {
|
|
4104
4124
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
4105
4125
|
assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
@@ -4109,30 +4129,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4109
4129
|
}
|
|
4110
4130
|
}
|
|
4111
4131
|
}
|
|
4132
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
4133
|
+
propValues[zod.def.discriminator]?.delete(void 0);
|
|
4112
4134
|
return propValues;
|
|
4113
4135
|
});
|
|
4114
4136
|
def.options.forEach((option, i) => {
|
|
4115
|
-
const propShape =
|
|
4137
|
+
const propShape = rawShape(option._zod.def);
|
|
4116
4138
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
4117
4139
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
4118
4140
|
}
|
|
4119
4141
|
});
|
|
4120
|
-
const disc = cached(() =>
|
|
4121
|
-
const opts = def.options;
|
|
4122
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
4123
|
-
for (const o of opts) {
|
|
4124
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
4125
|
-
if (!values || values.size === 0)
|
|
4126
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
4127
|
-
for (const v of values) {
|
|
4128
|
-
if (map2.has(v)) {
|
|
4129
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
4130
|
-
}
|
|
4131
|
-
map2.set(v, o);
|
|
4132
|
-
}
|
|
4133
|
-
}
|
|
4134
|
-
return map2;
|
|
4135
|
-
});
|
|
4142
|
+
const disc = cached(() => discriminatorMap(def));
|
|
4136
4143
|
inst._zod.parse = (payload, ctx) => {
|
|
4137
4144
|
const input2 = payload.value;
|
|
4138
4145
|
if (!isObject(input2)) {
|
|
@@ -4144,8 +4151,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4144
4151
|
});
|
|
4145
4152
|
return payload;
|
|
4146
4153
|
}
|
|
4147
|
-
const
|
|
4148
|
-
|
|
4154
|
+
const value = input2?.[def.discriminator];
|
|
4155
|
+
const opt2 = disc.value.get(value);
|
|
4156
|
+
if (opt2 && (value !== void 0 || ctx.direction !== "backward")) {
|
|
4149
4157
|
return opt2._zod.run(payload, ctx);
|
|
4150
4158
|
}
|
|
4151
4159
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -4156,7 +4164,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4156
4164
|
errors: [],
|
|
4157
4165
|
note: "No matching discriminator",
|
|
4158
4166
|
discriminator: def.discriminator,
|
|
4159
|
-
options: Array.from(disc.value.keys()),
|
|
4167
|
+
options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
|
|
4160
4168
|
input: input2,
|
|
4161
4169
|
path: [def.discriminator],
|
|
4162
4170
|
inst
|
|
@@ -4322,6 +4330,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4322
4330
|
}
|
|
4323
4331
|
}
|
|
4324
4332
|
const itemResults = new Array(items.length);
|
|
4333
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
4334
|
+
let itemAborted = false;
|
|
4325
4335
|
for (let i = 0; i < items.length; i++) {
|
|
4326
4336
|
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
4327
4337
|
if (r instanceof Promise) {
|
|
@@ -4330,12 +4340,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4330
4340
|
}));
|
|
4331
4341
|
} else {
|
|
4332
4342
|
itemResults[i] = r;
|
|
4343
|
+
if (abortEarly && !itemAborted && r.issues.length)
|
|
4344
|
+
itemAborted = aborted(r);
|
|
4333
4345
|
}
|
|
4334
4346
|
}
|
|
4335
|
-
if (def.rest) {
|
|
4347
|
+
if (def.rest && !itemAborted) {
|
|
4336
4348
|
let i = items.length - 1;
|
|
4337
4349
|
const rest = input2.slice(items.length);
|
|
4350
|
+
let seen = payload.issues.length;
|
|
4338
4351
|
for (const el of rest) {
|
|
4352
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4353
|
+
if (aborted(payload, seen))
|
|
4354
|
+
break;
|
|
4355
|
+
seen = payload.issues.length;
|
|
4356
|
+
}
|
|
4339
4357
|
i++;
|
|
4340
4358
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
4341
4359
|
if (result instanceof Promise) {
|
|
@@ -4563,7 +4581,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4563
4581
|
}
|
|
4564
4582
|
const proms = [];
|
|
4565
4583
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
4584
|
+
const abortEarly = ctx?.abortEarly;
|
|
4585
|
+
let seen = payload.issues.length;
|
|
4566
4586
|
for (const [key, value] of input2) {
|
|
4587
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4588
|
+
if (aborted(payload, seen))
|
|
4589
|
+
break;
|
|
4590
|
+
seen = payload.issues.length;
|
|
4591
|
+
}
|
|
4567
4592
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4568
4593
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
4569
4594
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
@@ -4626,7 +4651,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4626
4651
|
}
|
|
4627
4652
|
const proms = [];
|
|
4628
4653
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
4654
|
+
const abortEarly = ctx?.abortEarly;
|
|
4655
|
+
let seen = payload.issues.length;
|
|
4629
4656
|
for (const item of input2) {
|
|
4657
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4658
|
+
if (aborted(payload, seen))
|
|
4659
|
+
break;
|
|
4660
|
+
seen = payload.issues.length;
|
|
4661
|
+
}
|
|
4630
4662
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
4631
4663
|
if (result instanceof Promise) {
|
|
4632
4664
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -4649,8 +4681,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
4649
4681
|
const values = getEnumValues(def.entries);
|
|
4650
4682
|
const valuesSet = new Set(values);
|
|
4651
4683
|
inst._zod.values = valuesSet;
|
|
4652
|
-
|
|
4653
|
-
|
|
4684
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4685
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
4686
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
4687
|
+
});
|
|
4654
4688
|
inst._zod.parse = (payload, _ctx) => {
|
|
4655
4689
|
const input2 = payload.value;
|
|
4656
4690
|
if (valuesSet.has(input2)) {
|
|
@@ -4669,7 +4703,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4669
4703
|
$ZodType.init(inst, def);
|
|
4670
4704
|
const values = new Set(def.values);
|
|
4671
4705
|
inst._zod.values = values;
|
|
4672
|
-
inst
|
|
4706
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4707
|
+
const vals = zod.def.values;
|
|
4708
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
4709
|
+
});
|
|
4673
4710
|
inst._zod.parse = (payload, _ctx) => {
|
|
4674
4711
|
const input2 = payload.value;
|
|
4675
4712
|
if (values.has(input2)) {
|
|
@@ -5007,20 +5044,62 @@ function handleReadonlyResult(payload) {
|
|
|
5007
5044
|
payload.value = Object.freeze(payload.value);
|
|
5008
5045
|
return payload;
|
|
5009
5046
|
}
|
|
5047
|
+
function leafPattern(schema) {
|
|
5048
|
+
const def = schema._zod.def;
|
|
5049
|
+
let pattern = def.pattern;
|
|
5050
|
+
let isInt = !!def.format?.includes("int");
|
|
5051
|
+
let minimum;
|
|
5052
|
+
let maximum;
|
|
5053
|
+
for (const ch of def.checks ?? []) {
|
|
5054
|
+
const d = ch._zod.def;
|
|
5055
|
+
if (d.pattern)
|
|
5056
|
+
pattern = d.pattern;
|
|
5057
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
5058
|
+
const lo = d.minimum ?? d.length;
|
|
5059
|
+
const hi = d.maximum ?? d.length;
|
|
5060
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum))
|
|
5061
|
+
minimum = lo;
|
|
5062
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum))
|
|
5063
|
+
maximum = hi;
|
|
5064
|
+
}
|
|
5065
|
+
if (pattern)
|
|
5066
|
+
return pattern.source;
|
|
5067
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum)
|
|
5068
|
+
return "(?!)";
|
|
5069
|
+
if (minimum !== void 0 || maximum !== void 0)
|
|
5070
|
+
return string({ minimum, maximum }).source;
|
|
5071
|
+
const own2 = schema._zod.pattern;
|
|
5072
|
+
return (isInt && own2 === number ? integer : own2)?.source;
|
|
5073
|
+
}
|
|
5074
|
+
function partPattern(schema) {
|
|
5075
|
+
const def = schema._zod.def;
|
|
5076
|
+
const own2 = schema._zod.pattern?.source;
|
|
5077
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
5078
|
+
if (inner) {
|
|
5079
|
+
const before = inner._zod.pattern?.source;
|
|
5080
|
+
const after = partPattern(inner);
|
|
5081
|
+
if (own2 && before && after && after !== before) {
|
|
5082
|
+
return own2.replace(cleanRegex(before), () => cleanRegex(after));
|
|
5083
|
+
}
|
|
5084
|
+
return own2;
|
|
5085
|
+
}
|
|
5086
|
+
if (def.options) {
|
|
5087
|
+
const sources = def.options.map(partPattern);
|
|
5088
|
+
if (sources.every(Boolean))
|
|
5089
|
+
return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
5090
|
+
}
|
|
5091
|
+
return leafPattern(schema);
|
|
5092
|
+
}
|
|
5010
5093
|
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
5011
5094
|
$ZodType.init(inst, def);
|
|
5012
5095
|
const regexParts = [];
|
|
5013
5096
|
for (const part of def.parts) {
|
|
5014
5097
|
if (typeof part === "object" && part !== null) {
|
|
5015
|
-
|
|
5098
|
+
const source = partPattern(part);
|
|
5099
|
+
if (!source) {
|
|
5016
5100
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
5017
5101
|
}
|
|
5018
|
-
|
|
5019
|
-
if (!source)
|
|
5020
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
5021
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
5022
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
5023
|
-
regexParts.push(source.slice(start, end));
|
|
5102
|
+
regexParts.push(cleanRegex(source));
|
|
5024
5103
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
5025
5104
|
regexParts.push(escapeRegex(`${part}`));
|
|
5026
5105
|
} else {
|
|
@@ -5185,6 +5264,59 @@ function handleRefineResult(result, payload, input2, inst) {
|
|
|
5185
5264
|
payload.issues.push(issue(_iss));
|
|
5186
5265
|
}
|
|
5187
5266
|
}
|
|
5267
|
+
function handlePropertiesResult(result, payload, key) {
|
|
5268
|
+
if (result.issues.length) {
|
|
5269
|
+
payload.issues.push(...prefixIssues(key, result.issues));
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
var $ZodProperties = /* @__PURE__ */ $constructor("$ZodProperties", (inst, def) => {
|
|
5273
|
+
$ZodType.init(inst, def);
|
|
5274
|
+
$ZodCheck.init(inst, def);
|
|
5275
|
+
const memo2 = globalConfig.memoizer;
|
|
5276
|
+
memo2?.attach(inst);
|
|
5277
|
+
let entries;
|
|
5278
|
+
const runShape = (payload, ctx) => {
|
|
5279
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
5280
|
+
const input2 = payload.value;
|
|
5281
|
+
let proms;
|
|
5282
|
+
for (const [key, schema] of entries) {
|
|
5283
|
+
const result = schema._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
5284
|
+
if (result instanceof Promise) {
|
|
5285
|
+
proms ?? (proms = []);
|
|
5286
|
+
proms.push(result.then((result2) => handlePropertiesResult(result2, payload, key)));
|
|
5287
|
+
} else {
|
|
5288
|
+
handlePropertiesResult(result, payload, key);
|
|
5289
|
+
}
|
|
5290
|
+
}
|
|
5291
|
+
if (proms)
|
|
5292
|
+
return Promise.all(proms).then(() => void 0);
|
|
5293
|
+
return void 0;
|
|
5294
|
+
};
|
|
5295
|
+
inst._zod.parse = (payload, ctx) => {
|
|
5296
|
+
const input2 = payload.value;
|
|
5297
|
+
if (input2 === null || typeof input2 !== "object" && typeof input2 !== "function") {
|
|
5298
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: input2, inst });
|
|
5299
|
+
return payload;
|
|
5300
|
+
}
|
|
5301
|
+
if (ctx.direction === "backward")
|
|
5302
|
+
ctx = { ...ctx, direction: "forward" };
|
|
5303
|
+
if (memo2)
|
|
5304
|
+
memo2.alloc(inst, payload, input2, ctx);
|
|
5305
|
+
const result = runShape(payload, ctx);
|
|
5306
|
+
return result instanceof Promise ? result.then(() => payload) : payload;
|
|
5307
|
+
};
|
|
5308
|
+
inst._zod.check = (payload) => {
|
|
5309
|
+
if (payload.value == null) {
|
|
5310
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
5311
|
+
return void 0;
|
|
5312
|
+
}
|
|
5313
|
+
return runShape(payload, {});
|
|
5314
|
+
};
|
|
5315
|
+
}, {
|
|
5316
|
+
*[Symbol.iterator]() {
|
|
5317
|
+
yield this;
|
|
5318
|
+
}
|
|
5319
|
+
});
|
|
5188
5320
|
|
|
5189
5321
|
// ../../node_modules/zod/v4/core/memoizer.js
|
|
5190
5322
|
var $ZodCyclicError = class extends Error {
|
|
@@ -5195,31 +5327,59 @@ var $ZodCyclicError = class extends Error {
|
|
|
5195
5327
|
};
|
|
5196
5328
|
var STATE = "~memo";
|
|
5197
5329
|
var NO_ISSUES = [];
|
|
5330
|
+
function isRef(value) {
|
|
5331
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
5332
|
+
}
|
|
5198
5333
|
function cloneIssues(issues) {
|
|
5199
5334
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
5200
5335
|
}
|
|
5201
5336
|
var recursive = /* @__PURE__ */ new WeakMap();
|
|
5202
|
-
|
|
5337
|
+
var NONE = 0;
|
|
5338
|
+
var ASSUMED = 1;
|
|
5339
|
+
var PROVEN = 2;
|
|
5340
|
+
function isRecursive(inst, stack, resolve2) {
|
|
5203
5341
|
const cached2 = recursive.get(inst);
|
|
5204
5342
|
if (cached2 !== void 0)
|
|
5205
|
-
return cached2;
|
|
5343
|
+
return cached2 ? PROVEN : NONE;
|
|
5206
5344
|
if (stack.has(inst))
|
|
5207
|
-
return
|
|
5345
|
+
return PROVEN;
|
|
5208
5346
|
stack.add(inst);
|
|
5209
|
-
let result =
|
|
5347
|
+
let result = NONE;
|
|
5210
5348
|
const check2 = (child) => {
|
|
5211
|
-
if (
|
|
5212
|
-
|
|
5349
|
+
if (result !== PROVEN && child?._zod) {
|
|
5350
|
+
const answer = isRecursive(child, stack, resolve2);
|
|
5351
|
+
if (answer > result)
|
|
5352
|
+
result = answer;
|
|
5353
|
+
}
|
|
5354
|
+
};
|
|
5355
|
+
const shape = (sh, spread) => {
|
|
5356
|
+
let answer = NONE;
|
|
5357
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
5358
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
5359
|
+
if (spread && !desc.enumerable)
|
|
5360
|
+
continue;
|
|
5361
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve2) : NONE;
|
|
5362
|
+
if (child > answer)
|
|
5363
|
+
answer = child;
|
|
5364
|
+
}
|
|
5365
|
+
return answer;
|
|
5366
|
+
};
|
|
5367
|
+
const merge2 = (answer) => {
|
|
5368
|
+
if (answer > result)
|
|
5369
|
+
result = answer;
|
|
5213
5370
|
};
|
|
5214
5371
|
const def = inst._zod.def;
|
|
5215
5372
|
const kind = def.type;
|
|
5216
5373
|
switch (kind) {
|
|
5217
5374
|
case "object": {
|
|
5218
|
-
|
|
5219
|
-
|
|
5375
|
+
const raw = rawShape(def);
|
|
5376
|
+
merge2(raw ? shape(raw, true) : ASSUMED);
|
|
5220
5377
|
check2(def.catchall);
|
|
5221
5378
|
break;
|
|
5222
5379
|
}
|
|
5380
|
+
case "properties":
|
|
5381
|
+
merge2(shape(def.shape, false));
|
|
5382
|
+
break;
|
|
5223
5383
|
case "array":
|
|
5224
5384
|
check2(def.element);
|
|
5225
5385
|
break;
|
|
@@ -5263,10 +5423,12 @@ function isRecursive(inst, stack) {
|
|
|
5263
5423
|
check2(def.input);
|
|
5264
5424
|
check2(def.output);
|
|
5265
5425
|
break;
|
|
5266
|
-
//
|
|
5267
|
-
case "lazy":
|
|
5268
|
-
|
|
5426
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
5427
|
+
case "lazy": {
|
|
5428
|
+
const inner = def._cachedInner ?? (resolve2 ? inst._zod.innerType : void 0);
|
|
5429
|
+
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
5269
5430
|
break;
|
|
5431
|
+
}
|
|
5270
5432
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
5271
5433
|
case "template_literal":
|
|
5272
5434
|
// leaves
|
|
@@ -5308,16 +5470,20 @@ function isRecursive(inst, stack) {
|
|
|
5308
5470
|
}
|
|
5309
5471
|
}
|
|
5310
5472
|
stack.delete(inst);
|
|
5311
|
-
|
|
5312
|
-
|
|
5473
|
+
return settle(inst, result);
|
|
5474
|
+
}
|
|
5475
|
+
function settle(inst, answer) {
|
|
5476
|
+
if (answer !== ASSUMED)
|
|
5477
|
+
recursive.set(inst, answer === PROVEN);
|
|
5478
|
+
return answer;
|
|
5313
5479
|
}
|
|
5314
5480
|
function isRecursiveSchema(inst) {
|
|
5315
|
-
return isRecursive(inst, /* @__PURE__ */ new Set());
|
|
5481
|
+
return isRecursive(inst, /* @__PURE__ */ new Set(), true) !== NONE;
|
|
5316
5482
|
}
|
|
5317
5483
|
function bucketFor(state, inst) {
|
|
5318
5484
|
let bucket = state.buckets.get(inst);
|
|
5319
5485
|
if (!bucket) {
|
|
5320
|
-
bucket = /* @__PURE__ */ new
|
|
5486
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
5321
5487
|
state.buckets.set(inst, bucket);
|
|
5322
5488
|
}
|
|
5323
5489
|
return bucket;
|
|
@@ -5353,6 +5519,7 @@ var memo = {
|
|
|
5353
5519
|
attach(inst) {
|
|
5354
5520
|
var _a3;
|
|
5355
5521
|
let isRecursiveInst;
|
|
5522
|
+
let rechecked = false;
|
|
5356
5523
|
let lastCtx;
|
|
5357
5524
|
let lastBucket;
|
|
5358
5525
|
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
@@ -5360,20 +5527,24 @@ var memo = {
|
|
|
5360
5527
|
const base = inst._zod.parse;
|
|
5361
5528
|
const wrapped = (payload, ctx) => {
|
|
5362
5529
|
if (isRecursiveInst === void 0) {
|
|
5363
|
-
|
|
5364
|
-
if (
|
|
5530
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
5531
|
+
if (walked === NONE) {
|
|
5365
5532
|
inst._zod.parse = base;
|
|
5366
5533
|
if (inst._zod.run === wrapped)
|
|
5367
5534
|
inst._zod.run = base;
|
|
5368
5535
|
return base(payload, ctx);
|
|
5369
5536
|
}
|
|
5537
|
+
if (walked === PROVEN || rechecked)
|
|
5538
|
+
isRecursiveInst = true;
|
|
5539
|
+
else
|
|
5540
|
+
rechecked = true;
|
|
5370
5541
|
}
|
|
5371
5542
|
const input2 = payload.value;
|
|
5372
|
-
if (input2
|
|
5543
|
+
if (!isRef(input2))
|
|
5373
5544
|
return base(payload, ctx);
|
|
5374
5545
|
let state = ctx[STATE];
|
|
5375
5546
|
if (!state) {
|
|
5376
|
-
state = { buckets: /* @__PURE__ */ new
|
|
5547
|
+
state = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 };
|
|
5377
5548
|
ctx[STATE] = state;
|
|
5378
5549
|
}
|
|
5379
5550
|
let bucket;
|
|
@@ -5392,7 +5563,7 @@ var memo = {
|
|
|
5392
5563
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
5393
5564
|
} else {
|
|
5394
5565
|
payload.memo = true;
|
|
5395
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
5566
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
5396
5567
|
state.backEdges.add(hit.value);
|
|
5397
5568
|
}
|
|
5398
5569
|
return payload;
|
|
@@ -5424,7 +5595,7 @@ function memoizer() {
|
|
|
5424
5595
|
}
|
|
5425
5596
|
function isBackEdge(ctx, value) {
|
|
5426
5597
|
const backEdges = ctx[STATE]?.backEdges;
|
|
5427
|
-
return backEdges !== void 0 && value
|
|
5598
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
5428
5599
|
}
|
|
5429
5600
|
|
|
5430
5601
|
// ../../node_modules/zod/v4/locales/index.js
|
|
@@ -5481,6 +5652,7 @@ __export(locales_exports, {
|
|
|
5481
5652
|
sl: () => sl_default,
|
|
5482
5653
|
sv: () => sv_default,
|
|
5483
5654
|
ta: () => ta_default,
|
|
5655
|
+
tg: () => tg_default,
|
|
5484
5656
|
th: () => th_default,
|
|
5485
5657
|
tk: () => tk_default,
|
|
5486
5658
|
tr: () => tr_default,
|
|
@@ -5535,6 +5707,7 @@ var error = () => {
|
|
|
5535
5707
|
json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
|
|
5536
5708
|
e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
|
|
5537
5709
|
credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
|
|
5710
|
+
iban: "IBAN",
|
|
5538
5711
|
jwt: "JWT",
|
|
5539
5712
|
template_literal: "\u0645\u062F\u062E\u0644"
|
|
5540
5713
|
};
|
|
@@ -5645,6 +5818,7 @@ var error2 = () => {
|
|
|
5645
5818
|
json_string: "JSON string",
|
|
5646
5819
|
e164: "E.164 number",
|
|
5647
5820
|
credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
|
|
5821
|
+
iban: "IBAN",
|
|
5648
5822
|
jwt: "JWT",
|
|
5649
5823
|
template_literal: "input"
|
|
5650
5824
|
};
|
|
@@ -5804,6 +5978,7 @@ var error3 = () => {
|
|
|
5804
5978
|
json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
|
|
5805
5979
|
e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
|
|
5806
5980
|
credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
5981
|
+
iban: "IBAN",
|
|
5807
5982
|
jwt: "JWT",
|
|
5808
5983
|
template_literal: "\u0443\u0432\u043E\u0434"
|
|
5809
5984
|
};
|
|
@@ -5921,6 +6096,7 @@ var error4 = () => {
|
|
|
5921
6096
|
json_string: "JSON \u043D\u0438\u0437",
|
|
5922
6097
|
e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
|
|
5923
6098
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
|
|
6099
|
+
iban: "IBAN",
|
|
5924
6100
|
jwt: "JWT",
|
|
5925
6101
|
template_literal: "\u0432\u0445\u043E\u0434"
|
|
5926
6102
|
};
|
|
@@ -6045,6 +6221,7 @@ var error5 = () => {
|
|
|
6045
6221
|
json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
|
|
6046
6222
|
e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
6047
6223
|
credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
6224
|
+
iban: "IBAN",
|
|
6048
6225
|
jwt: "JWT",
|
|
6049
6226
|
template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
|
|
6050
6227
|
};
|
|
@@ -6157,6 +6334,7 @@ var error6 = () => {
|
|
|
6157
6334
|
json_string: "cadena JSON",
|
|
6158
6335
|
e164: "n\xFAmero E.164",
|
|
6159
6336
|
credit_card: "n\xFAmero de targeta de cr\xE8dit",
|
|
6337
|
+
iban: "IBAN",
|
|
6160
6338
|
jwt: "JWT",
|
|
6161
6339
|
template_literal: "entrada"
|
|
6162
6340
|
};
|
|
@@ -6269,6 +6447,7 @@ var error7 = () => {
|
|
|
6269
6447
|
json_string: "\u062F\u06D5\u0642\u06CC JSON",
|
|
6270
6448
|
e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
|
|
6271
6449
|
credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
|
|
6450
|
+
iban: "IBAN",
|
|
6272
6451
|
jwt: "JWT",
|
|
6273
6452
|
template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
|
|
6274
6453
|
};
|
|
@@ -6400,6 +6579,7 @@ var error8 = () => {
|
|
|
6400
6579
|
json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
|
|
6401
6580
|
e164: "\u010D\xEDslo E.164",
|
|
6402
6581
|
credit_card: "\u010D\xEDslo kreditn\xED karty",
|
|
6582
|
+
iban: "IBAN",
|
|
6403
6583
|
jwt: "JWT",
|
|
6404
6584
|
template_literal: "vstup"
|
|
6405
6585
|
};
|
|
@@ -6515,6 +6695,7 @@ var error9 = () => {
|
|
|
6515
6695
|
json_string: "JSON-streng",
|
|
6516
6696
|
e164: "E.164-nummer",
|
|
6517
6697
|
credit_card: "kreditkortnummer",
|
|
6698
|
+
iban: "IBAN",
|
|
6518
6699
|
jwt: "JWT",
|
|
6519
6700
|
template_literal: "input"
|
|
6520
6701
|
};
|
|
@@ -6634,6 +6815,7 @@ var error10 = () => {
|
|
|
6634
6815
|
json_string: "JSON-String",
|
|
6635
6816
|
e164: "E.164-Nummer",
|
|
6636
6817
|
credit_card: "Kreditkartennummer",
|
|
6818
|
+
iban: "IBAN",
|
|
6637
6819
|
jwt: "JWT",
|
|
6638
6820
|
template_literal: "Eingabe"
|
|
6639
6821
|
};
|
|
@@ -6746,6 +6928,7 @@ var error11 = () => {
|
|
|
6746
6928
|
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
6747
6929
|
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
6748
6930
|
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",
|
|
6931
|
+
iban: "IBAN",
|
|
6749
6932
|
jwt: "JWT",
|
|
6750
6933
|
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
6751
6934
|
};
|
|
@@ -6857,6 +7040,7 @@ var error12 = () => {
|
|
|
6857
7040
|
json_string: "JSON string",
|
|
6858
7041
|
e164: "E.164 number",
|
|
6859
7042
|
credit_card: "credit card number",
|
|
7043
|
+
iban: "IBAN",
|
|
6860
7044
|
jwt: "JWT",
|
|
6861
7045
|
template_literal: "input"
|
|
6862
7046
|
};
|
|
@@ -6980,6 +7164,7 @@ var error13 = () => {
|
|
|
6980
7164
|
json_string: "JSON-karaktraro",
|
|
6981
7165
|
e164: "E.164-nombro",
|
|
6982
7166
|
credit_card: "kreditkarta numero",
|
|
7167
|
+
iban: "IBAN",
|
|
6983
7168
|
jwt: "JWT",
|
|
6984
7169
|
template_literal: "enigo"
|
|
6985
7170
|
};
|
|
@@ -7092,6 +7277,7 @@ var error14 = () => {
|
|
|
7092
7277
|
json_string: "cadena JSON",
|
|
7093
7278
|
e164: "n\xFAmero E.164",
|
|
7094
7279
|
credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
|
|
7280
|
+
iban: "IBAN",
|
|
7095
7281
|
jwt: "JWT",
|
|
7096
7282
|
template_literal: "entrada"
|
|
7097
7283
|
};
|
|
@@ -7228,6 +7414,7 @@ var error15 = () => {
|
|
|
7228
7414
|
json_string: "JSON \u0631\u0634\u062A\u0647",
|
|
7229
7415
|
e164: "E.164 \u0639\u062F\u062F",
|
|
7230
7416
|
credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
|
|
7417
|
+
iban: "IBAN",
|
|
7231
7418
|
jwt: "JWT",
|
|
7232
7419
|
template_literal: "\u0648\u0631\u0648\u062F\u06CC"
|
|
7233
7420
|
};
|
|
@@ -7350,6 +7537,7 @@ var error16 = () => {
|
|
|
7350
7537
|
json_string: "JSON-merkkijono",
|
|
7351
7538
|
e164: "E.164-luku",
|
|
7352
7539
|
credit_card: "luottokortin numero",
|
|
7540
|
+
iban: "IBAN",
|
|
7353
7541
|
jwt: "JWT",
|
|
7354
7542
|
template_literal: "templaattimerkkijono"
|
|
7355
7543
|
};
|
|
@@ -7461,6 +7649,7 @@ var error17 = () => {
|
|
|
7461
7649
|
json_string: "cha\xEEne de caract\xE8res JSON",
|
|
7462
7650
|
e164: "num\xE9ro au format E.164",
|
|
7463
7651
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
7652
|
+
iban: "IBAN",
|
|
7464
7653
|
jwt: "JWT",
|
|
7465
7654
|
template_literal: "entr\xE9e"
|
|
7466
7655
|
};
|
|
@@ -7590,6 +7779,7 @@ var error18 = () => {
|
|
|
7590
7779
|
json_string: "cha\xEEne JSON",
|
|
7591
7780
|
e164: "num\xE9ro E.164",
|
|
7592
7781
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
7782
|
+
iban: "IBAN",
|
|
7593
7783
|
jwt: "JWT",
|
|
7594
7784
|
template_literal: "entr\xE9e"
|
|
7595
7785
|
};
|
|
@@ -7701,6 +7891,7 @@ var error19 = () => {
|
|
|
7701
7891
|
json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
|
|
7702
7892
|
e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
7703
7893
|
credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
7894
|
+
iban: "IBAN",
|
|
7704
7895
|
jwt: "JWT",
|
|
7705
7896
|
template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
|
|
7706
7897
|
};
|
|
@@ -7849,6 +8040,7 @@ var error20 = () => {
|
|
|
7849
8040
|
json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
|
|
7850
8041
|
e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
|
|
7851
8042
|
credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
|
|
8043
|
+
iban: { label: "IBAN", gender: "m" },
|
|
7852
8044
|
jwt: { label: "JWT", gender: "m" },
|
|
7853
8045
|
template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
7854
8046
|
ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
@@ -8013,6 +8205,7 @@ var error21 = () => {
|
|
|
8013
8205
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
|
|
8014
8206
|
e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
8015
8207
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
8208
|
+
iban: "IBAN",
|
|
8016
8209
|
jwt: "JWT",
|
|
8017
8210
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
8018
8211
|
};
|
|
@@ -8122,6 +8315,7 @@ var error22 = () => {
|
|
|
8122
8315
|
json_string: "JSON tekst",
|
|
8123
8316
|
e164: "E.164 broj",
|
|
8124
8317
|
credit_card: "broj kreditne kartice",
|
|
8318
|
+
iban: "IBAN",
|
|
8125
8319
|
jwt: "JWT",
|
|
8126
8320
|
template_literal: "unos"
|
|
8127
8321
|
};
|
|
@@ -8248,6 +8442,7 @@ var error23 = () => {
|
|
|
8248
8442
|
json_string: "JSON string",
|
|
8249
8443
|
e164: "E.164 sz\xE1m",
|
|
8250
8444
|
credit_card: "hitelk\xE1rtyasz\xE1m",
|
|
8445
|
+
iban: "IBAN",
|
|
8251
8446
|
jwt: "JWT",
|
|
8252
8447
|
template_literal: "bemenet"
|
|
8253
8448
|
};
|
|
@@ -8400,6 +8595,7 @@ var error24 = () => {
|
|
|
8400
8595
|
json_string: "JSON \u057F\u0578\u0572",
|
|
8401
8596
|
e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
|
|
8402
8597
|
credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
|
|
8598
|
+
iban: "IBAN",
|
|
8403
8599
|
jwt: "JWT",
|
|
8404
8600
|
template_literal: "\u0574\u0578\u0582\u057F\u0584"
|
|
8405
8601
|
};
|
|
@@ -8517,6 +8713,7 @@ var error25 = () => {
|
|
|
8517
8713
|
json_string: "string JSON",
|
|
8518
8714
|
e164: "angka E.164",
|
|
8519
8715
|
credit_card: "nomor kartu kredit",
|
|
8716
|
+
iban: "IBAN",
|
|
8520
8717
|
jwt: "JWT",
|
|
8521
8718
|
template_literal: "input"
|
|
8522
8719
|
};
|
|
@@ -8627,6 +8824,7 @@ var error26 = () => {
|
|
|
8627
8824
|
json_string: "JSON strengur",
|
|
8628
8825
|
e164: "E.164 t\xF6lugildi",
|
|
8629
8826
|
credit_card: "kreditkortan\xFAmer",
|
|
8827
|
+
iban: "IBAN",
|
|
8630
8828
|
jwt: "JWT",
|
|
8631
8829
|
template_literal: "gildi"
|
|
8632
8830
|
};
|
|
@@ -8740,6 +8938,7 @@ var error27 = () => {
|
|
|
8740
8938
|
json_string: "stringa JSON",
|
|
8741
8939
|
e164: "numero E.164",
|
|
8742
8940
|
credit_card: "numero di carta di credito",
|
|
8941
|
+
iban: "IBAN",
|
|
8743
8942
|
jwt: "JWT",
|
|
8744
8943
|
template_literal: "input"
|
|
8745
8944
|
};
|
|
@@ -8852,6 +9051,7 @@ var error28 = () => {
|
|
|
8852
9051
|
json_string: "JSON\u6587\u5B57\u5217",
|
|
8853
9052
|
e164: "E.164\u756A\u53F7",
|
|
8854
9053
|
credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
|
|
9054
|
+
iban: "IBAN",
|
|
8855
9055
|
jwt: "JWT",
|
|
8856
9056
|
template_literal: "\u5165\u529B\u5024"
|
|
8857
9057
|
};
|
|
@@ -8963,6 +9163,7 @@ var error29 = () => {
|
|
|
8963
9163
|
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
8964
9164
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
8965
9165
|
credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
9166
|
+
iban: "IBAN",
|
|
8966
9167
|
jwt: "JWT",
|
|
8967
9168
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
8968
9169
|
};
|
|
@@ -9079,6 +9280,7 @@ var error30 = () => {
|
|
|
9079
9280
|
json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
|
|
9080
9281
|
e164: "\u179B\u17C1\u1781 E.164",
|
|
9081
9282
|
credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
|
|
9283
|
+
iban: "IBAN",
|
|
9082
9284
|
jwt: "JWT",
|
|
9083
9285
|
template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
|
|
9084
9286
|
};
|
|
@@ -9198,6 +9400,7 @@ var error31 = () => {
|
|
|
9198
9400
|
json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
|
|
9199
9401
|
e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
9200
9402
|
credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
9403
|
+
iban: "IBAN",
|
|
9201
9404
|
jwt: "JWT",
|
|
9202
9405
|
template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
|
|
9203
9406
|
};
|
|
@@ -9312,6 +9515,7 @@ var error32 = () => {
|
|
|
9312
9515
|
json_string: "JSON \uBB38\uC790\uC5F4",
|
|
9313
9516
|
e164: "E.164 \uBC88\uD638",
|
|
9314
9517
|
credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
|
|
9518
|
+
iban: "IBAN",
|
|
9315
9519
|
jwt: "JWT",
|
|
9316
9520
|
template_literal: "\uC785\uB825"
|
|
9317
9521
|
};
|
|
@@ -9509,6 +9713,7 @@ var error33 = () => {
|
|
|
9509
9713
|
json_string: "JSON eilut\u0117",
|
|
9510
9714
|
e164: "E.164 numeris",
|
|
9511
9715
|
credit_card: "kredito kortel\u0117s numeris",
|
|
9716
|
+
iban: "IBAN",
|
|
9512
9717
|
jwt: "JWT",
|
|
9513
9718
|
template_literal: "\u012Fvestis"
|
|
9514
9719
|
};
|
|
@@ -9633,6 +9838,7 @@ var error34 = () => {
|
|
|
9633
9838
|
json_string: "JSON \u043D\u0438\u0437\u0430",
|
|
9634
9839
|
e164: "E.164 \u0431\u0440\u043E\u0458",
|
|
9635
9840
|
credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
|
|
9841
|
+
iban: "IBAN",
|
|
9636
9842
|
jwt: "JWT",
|
|
9637
9843
|
template_literal: "\u0432\u043D\u0435\u0441"
|
|
9638
9844
|
};
|
|
@@ -9746,6 +9952,7 @@ var error35 = () => {
|
|
|
9746
9952
|
json_string: "string JSON",
|
|
9747
9953
|
e164: "nombor E.164",
|
|
9748
9954
|
credit_card: "nombor kad kredit",
|
|
9955
|
+
iban: "IBAN",
|
|
9749
9956
|
jwt: "JWT",
|
|
9750
9957
|
template_literal: "input"
|
|
9751
9958
|
};
|
|
@@ -9857,6 +10064,7 @@ var error36 = () => {
|
|
|
9857
10064
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
|
|
9858
10065
|
e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
|
|
9859
10066
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
|
|
10067
|
+
iban: "IBAN",
|
|
9860
10068
|
jwt: "JWT",
|
|
9861
10069
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
9862
10070
|
};
|
|
@@ -9967,6 +10175,7 @@ var error37 = () => {
|
|
|
9967
10175
|
json_string: "JSON string",
|
|
9968
10176
|
e164: "E.164-nummer",
|
|
9969
10177
|
credit_card: "creditcardnummer",
|
|
10178
|
+
iban: "IBAN",
|
|
9970
10179
|
jwt: "JWT",
|
|
9971
10180
|
template_literal: "invoer"
|
|
9972
10181
|
};
|
|
@@ -10081,6 +10290,7 @@ var error38 = () => {
|
|
|
10081
10290
|
json_string: "JSON-streng",
|
|
10082
10291
|
e164: "E.164-nummer",
|
|
10083
10292
|
credit_card: "kredittkortnummer",
|
|
10293
|
+
iban: "IBAN",
|
|
10084
10294
|
jwt: "JWT",
|
|
10085
10295
|
template_literal: "input"
|
|
10086
10296
|
};
|
|
@@ -10193,6 +10403,7 @@ var error39 = () => {
|
|
|
10193
10403
|
json_string: "JSON-streng",
|
|
10194
10404
|
e164: "E.164-nummer",
|
|
10195
10405
|
credit_card: "kredittkortnummer",
|
|
10406
|
+
iban: "IBAN",
|
|
10196
10407
|
jwt: "JWT",
|
|
10197
10408
|
template_literal: "input"
|
|
10198
10409
|
};
|
|
@@ -10305,6 +10516,7 @@ var error40 = () => {
|
|
|
10305
10516
|
json_string: "JSON metin",
|
|
10306
10517
|
e164: "E.164 say\u0131s\u0131",
|
|
10307
10518
|
credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
|
|
10519
|
+
iban: "IBAN",
|
|
10308
10520
|
jwt: "JWT",
|
|
10309
10521
|
template_literal: "giren"
|
|
10310
10522
|
};
|
|
@@ -10418,6 +10630,7 @@ var error41 = () => {
|
|
|
10418
10630
|
json_string: "JSON \u0645\u062A\u0646",
|
|
10419
10631
|
e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
|
|
10420
10632
|
credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
|
|
10633
|
+
iban: "IBAN",
|
|
10421
10634
|
jwt: "JWT",
|
|
10422
10635
|
template_literal: "\u0648\u0631\u0648\u062F\u064A"
|
|
10423
10636
|
};
|
|
@@ -10536,6 +10749,7 @@ var error42 = () => {
|
|
|
10536
10749
|
json_string: "ci\u0105g znak\xF3w w formacie JSON",
|
|
10537
10750
|
e164: "liczba E.164",
|
|
10538
10751
|
credit_card: "numer karty kredytowej",
|
|
10752
|
+
iban: "IBAN",
|
|
10539
10753
|
jwt: "JWT",
|
|
10540
10754
|
template_literal: "wej\u015Bcie"
|
|
10541
10755
|
};
|
|
@@ -10649,6 +10863,7 @@ var error43 = () => {
|
|
|
10649
10863
|
json_string: "o texto JSON",
|
|
10650
10864
|
e164: "o n\xFAmero E.164",
|
|
10651
10865
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
10866
|
+
iban: "o IBAN",
|
|
10652
10867
|
jwt: "o JWT",
|
|
10653
10868
|
template_literal: "a entrada"
|
|
10654
10869
|
};
|
|
@@ -10726,8 +10941,8 @@ var error43 = () => {
|
|
|
10726
10941
|
case "not_multiple_of":
|
|
10727
10942
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
10728
10943
|
case "unrecognized_keys": {
|
|
10729
|
-
const
|
|
10730
|
-
return `Chave${
|
|
10944
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
10945
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
10731
10946
|
}
|
|
10732
10947
|
case "invalid_key":
|
|
10733
10948
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -10791,6 +11006,7 @@ var error44 = () => {
|
|
|
10791
11006
|
json_string: "o texto JSON",
|
|
10792
11007
|
e164: "o n\xFAmero E.164",
|
|
10793
11008
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
11009
|
+
iban: "o IBAN",
|
|
10794
11010
|
jwt: "o JWT",
|
|
10795
11011
|
template_literal: "a entrada"
|
|
10796
11012
|
};
|
|
@@ -10869,8 +11085,8 @@ var error44 = () => {
|
|
|
10869
11085
|
case "not_multiple_of":
|
|
10870
11086
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
10871
11087
|
case "unrecognized_keys": {
|
|
10872
|
-
const
|
|
10873
|
-
return `Chave${
|
|
11088
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
11089
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
10874
11090
|
}
|
|
10875
11091
|
case "invalid_key":
|
|
10876
11092
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -10934,6 +11150,7 @@ var error45 = () => {
|
|
|
10934
11150
|
json_string: "\u0219ir JSON",
|
|
10935
11151
|
e164: "num\u0103r E.164",
|
|
10936
11152
|
credit_card: "num\u0103r de card de credit",
|
|
11153
|
+
iban: "IBAN",
|
|
10937
11154
|
jwt: "JWT",
|
|
10938
11155
|
template_literal: "intrare"
|
|
10939
11156
|
};
|
|
@@ -11105,6 +11322,7 @@ var error46 = () => {
|
|
|
11105
11322
|
json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
|
|
11106
11323
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
11107
11324
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
11325
|
+
iban: "IBAN",
|
|
11108
11326
|
jwt: "JWT",
|
|
11109
11327
|
template_literal: "\u0432\u0432\u043E\u0434"
|
|
11110
11328
|
};
|
|
@@ -11222,6 +11440,7 @@ var error47 = () => {
|
|
|
11222
11440
|
json_string: "re\u0165azec vo form\xE1te JSON",
|
|
11223
11441
|
e164: "\u010D\xEDslo E.164",
|
|
11224
11442
|
credit_card: "\u010D\xEDslo kreditnej karty",
|
|
11443
|
+
iban: "IBAN",
|
|
11225
11444
|
jwt: "JWT",
|
|
11226
11445
|
template_literal: "vstup"
|
|
11227
11446
|
};
|
|
@@ -11337,6 +11556,7 @@ var error48 = () => {
|
|
|
11337
11556
|
json_string: "JSON niz",
|
|
11338
11557
|
e164: "E.164 \u0161tevilka",
|
|
11339
11558
|
credit_card: "\u0161tevilka kreditne kartice",
|
|
11559
|
+
iban: "IBAN",
|
|
11340
11560
|
jwt: "JWT",
|
|
11341
11561
|
template_literal: "vnos"
|
|
11342
11562
|
};
|
|
@@ -11450,6 +11670,7 @@ var error49 = () => {
|
|
|
11450
11670
|
json_string: "JSON-str\xE4ng",
|
|
11451
11671
|
e164: "E.164-nummer",
|
|
11452
11672
|
credit_card: "kreditkortsnummer",
|
|
11673
|
+
iban: "IBAN",
|
|
11453
11674
|
jwt: "JWT",
|
|
11454
11675
|
template_literal: "mall-literal"
|
|
11455
11676
|
};
|
|
@@ -11564,6 +11785,7 @@ var error50 = () => {
|
|
|
11564
11785
|
json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
|
|
11565
11786
|
e164: "E.164 \u0B8E\u0BA3\u0BCD",
|
|
11566
11787
|
credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
|
|
11788
|
+
iban: "IBAN",
|
|
11567
11789
|
jwt: "JWT",
|
|
11568
11790
|
template_literal: "input"
|
|
11569
11791
|
};
|
|
@@ -11637,23 +11859,23 @@ function ta_default() {
|
|
|
11637
11859
|
};
|
|
11638
11860
|
}
|
|
11639
11861
|
|
|
11640
|
-
// ../../node_modules/zod/v4/locales/
|
|
11862
|
+
// ../../node_modules/zod/v4/locales/tg.js
|
|
11641
11863
|
var error51 = () => {
|
|
11642
11864
|
const Sizable = {
|
|
11643
|
-
string: { unit: "\
|
|
11644
|
-
file: { unit: "\
|
|
11645
|
-
array: { unit: "\
|
|
11646
|
-
set: { unit: "\
|
|
11647
|
-
map: { unit: "\
|
|
11865
|
+
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11866
|
+
file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11867
|
+
array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11868
|
+
set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11869
|
+
map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
|
|
11648
11870
|
};
|
|
11649
11871
|
function getSizing(origin) {
|
|
11650
11872
|
return Sizable[origin] ?? null;
|
|
11651
11873
|
}
|
|
11652
11874
|
const FormatDictionary = {
|
|
11653
|
-
regex: "\
|
|
11654
|
-
email: "\
|
|
11875
|
+
regex: "\u0432\u0443\u0440\u0443\u0434",
|
|
11876
|
+
email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
|
|
11655
11877
|
url: "URL",
|
|
11656
|
-
emoji: "\
|
|
11878
|
+
emoji: "\u044D\u043C\u043E\u04B7\u0438",
|
|
11657
11879
|
uuid: "UUID",
|
|
11658
11880
|
uuidv4: "UUIDv4",
|
|
11659
11881
|
uuidv6: "UUIDv6",
|
|
@@ -11664,28 +11886,31 @@ var error51 = () => {
|
|
|
11664
11886
|
ulid: "ULID",
|
|
11665
11887
|
xid: "XID",
|
|
11666
11888
|
ksuid: "KSUID",
|
|
11667
|
-
datetime: "\
|
|
11668
|
-
date: "\
|
|
11669
|
-
time: "\
|
|
11670
|
-
duration: "\
|
|
11671
|
-
ipv4: "\
|
|
11672
|
-
ipv6: "\
|
|
11673
|
-
mac: "\
|
|
11674
|
-
cidrv4: "\
|
|
11675
|
-
cidrv6: "\
|
|
11676
|
-
base64: "\
|
|
11677
|
-
base64url: "\
|
|
11678
|
-
json_string: "\
|
|
11679
|
-
e164: "\
|
|
11680
|
-
credit_card: "\
|
|
11681
|
-
|
|
11682
|
-
|
|
11889
|
+
datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
|
|
11890
|
+
date: "\u0441\u0430\u043D\u0430\u0438 ISO",
|
|
11891
|
+
time: "\u0432\u0430\u049B\u0442\u0438 ISO",
|
|
11892
|
+
duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
|
|
11893
|
+
ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
|
|
11894
|
+
ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
|
|
11895
|
+
mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
|
|
11896
|
+
cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
|
|
11897
|
+
cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
|
|
11898
|
+
base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
|
|
11899
|
+
base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
|
|
11900
|
+
json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
|
|
11901
|
+
e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
|
|
11902
|
+
credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
|
|
11903
|
+
iban: "IBAN",
|
|
11904
|
+
jwt: "JWT",
|
|
11905
|
+
template_literal: "\u0432\u0443\u0440\u0443\u0434"
|
|
11683
11906
|
};
|
|
11684
11907
|
const TypeDictionary = {
|
|
11685
11908
|
nan: "NaN",
|
|
11686
|
-
number: "\
|
|
11687
|
-
|
|
11688
|
-
|
|
11909
|
+
number: "\u0440\u0430\u049B\u0430\u043C",
|
|
11910
|
+
string: "\u0441\u0430\u0442\u0440",
|
|
11911
|
+
array: "\u043C\u0430\u0441\u0441\u0438\u0432",
|
|
11912
|
+
object: "\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
11913
|
+
date: "\u0441\u0430\u043D\u0430"
|
|
11689
11914
|
};
|
|
11690
11915
|
return (issue2) => {
|
|
11691
11916
|
switch (issue2.code) {
|
|
@@ -11693,17 +11918,131 @@ var error51 = () => {
|
|
|
11693
11918
|
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
11694
11919
|
const receivedType = parsedType(issue2.input);
|
|
11695
11920
|
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
11696
|
-
|
|
11697
|
-
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue2.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
11698
|
-
}
|
|
11699
|
-
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
11921
|
+
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`;
|
|
11700
11922
|
}
|
|
11701
11923
|
case "invalid_value":
|
|
11702
11924
|
if (issue2.values.length === 1)
|
|
11703
|
-
return `\
|
|
11704
|
-
return `\
|
|
11925
|
+
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`;
|
|
11926
|
+
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`;
|
|
11705
11927
|
case "too_big": {
|
|
11706
|
-
const adj = issue2.inclusive ? "
|
|
11928
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
11929
|
+
const sizing = getSizing(issue2.origin);
|
|
11930
|
+
if (sizing)
|
|
11931
|
+
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}`;
|
|
11932
|
+
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`;
|
|
11933
|
+
}
|
|
11934
|
+
case "too_small": {
|
|
11935
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
11936
|
+
const sizing = getSizing(issue2.origin);
|
|
11937
|
+
if (sizing)
|
|
11938
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
11939
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
11940
|
+
}
|
|
11941
|
+
case "invalid_format": {
|
|
11942
|
+
const _issue = issue2;
|
|
11943
|
+
if (_issue.format === "starts_with")
|
|
11944
|
+
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`;
|
|
11945
|
+
if (_issue.format === "ends_with")
|
|
11946
|
+
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`;
|
|
11947
|
+
if (_issue.format === "includes")
|
|
11948
|
+
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`;
|
|
11949
|
+
if (_issue.format === "regex")
|
|
11950
|
+
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`;
|
|
11951
|
+
return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
11952
|
+
}
|
|
11953
|
+
case "not_multiple_of":
|
|
11954
|
+
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`;
|
|
11955
|
+
case "unrecognized_keys":
|
|
11956
|
+
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, ", ")}`;
|
|
11957
|
+
case "invalid_key":
|
|
11958
|
+
return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
11959
|
+
case "invalid_union":
|
|
11960
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
11961
|
+
const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
|
|
11962
|
+
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`;
|
|
11963
|
+
}
|
|
11964
|
+
return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
|
|
11965
|
+
case "invalid_element":
|
|
11966
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
11967
|
+
default:
|
|
11968
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
11969
|
+
}
|
|
11970
|
+
};
|
|
11971
|
+
};
|
|
11972
|
+
function tg_default() {
|
|
11973
|
+
return {
|
|
11974
|
+
localeError: error51()
|
|
11975
|
+
};
|
|
11976
|
+
}
|
|
11977
|
+
|
|
11978
|
+
// ../../node_modules/zod/v4/locales/th.js
|
|
11979
|
+
var error52 = () => {
|
|
11980
|
+
const Sizable = {
|
|
11981
|
+
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11982
|
+
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11983
|
+
array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11984
|
+
set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11985
|
+
map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
|
|
11986
|
+
};
|
|
11987
|
+
function getSizing(origin) {
|
|
11988
|
+
return Sizable[origin] ?? null;
|
|
11989
|
+
}
|
|
11990
|
+
const FormatDictionary = {
|
|
11991
|
+
regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
|
|
11992
|
+
email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
|
|
11993
|
+
url: "URL",
|
|
11994
|
+
emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
|
|
11995
|
+
uuid: "UUID",
|
|
11996
|
+
uuidv4: "UUIDv4",
|
|
11997
|
+
uuidv6: "UUIDv6",
|
|
11998
|
+
nanoid: "nanoid",
|
|
11999
|
+
guid: "GUID",
|
|
12000
|
+
cuid: "cuid",
|
|
12001
|
+
cuid2: "cuid2",
|
|
12002
|
+
ulid: "ULID",
|
|
12003
|
+
xid: "XID",
|
|
12004
|
+
ksuid: "KSUID",
|
|
12005
|
+
datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
12006
|
+
date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
|
|
12007
|
+
time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
12008
|
+
duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
12009
|
+
ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
|
|
12010
|
+
ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
|
|
12011
|
+
mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
|
|
12012
|
+
cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
|
|
12013
|
+
cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
|
|
12014
|
+
base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
|
|
12015
|
+
base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
|
|
12016
|
+
json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
|
|
12017
|
+
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)",
|
|
12018
|
+
credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
|
|
12019
|
+
iban: "IBAN",
|
|
12020
|
+
jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
|
|
12021
|
+
template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
|
|
12022
|
+
};
|
|
12023
|
+
const TypeDictionary = {
|
|
12024
|
+
nan: "NaN",
|
|
12025
|
+
number: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
|
|
12026
|
+
array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",
|
|
12027
|
+
null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"
|
|
12028
|
+
};
|
|
12029
|
+
return (issue2) => {
|
|
12030
|
+
switch (issue2.code) {
|
|
12031
|
+
case "invalid_type": {
|
|
12032
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
12033
|
+
const receivedType = parsedType(issue2.input);
|
|
12034
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
12035
|
+
if (/^[A-Z]/.test(issue2.expected)) {
|
|
12036
|
+
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue2.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
12037
|
+
}
|
|
12038
|
+
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
12039
|
+
}
|
|
12040
|
+
case "invalid_value":
|
|
12041
|
+
if (issue2.values.length === 1)
|
|
12042
|
+
return `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${stringifyPrimitive(issue2.values[0])}`;
|
|
12043
|
+
return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${joinValues(issue2.values, "|")}`;
|
|
12044
|
+
case "too_big": {
|
|
12045
|
+
const adj = issue2.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32";
|
|
11707
12046
|
const sizing = getSizing(issue2.origin);
|
|
11708
12047
|
if (sizing)
|
|
11709
12048
|
return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;
|
|
@@ -11747,12 +12086,12 @@ var error51 = () => {
|
|
|
11747
12086
|
};
|
|
11748
12087
|
function th_default() {
|
|
11749
12088
|
return {
|
|
11750
|
-
localeError:
|
|
12089
|
+
localeError: error52()
|
|
11751
12090
|
};
|
|
11752
12091
|
}
|
|
11753
12092
|
|
|
11754
12093
|
// ../../node_modules/zod/v4/locales/tk.js
|
|
11755
|
-
var
|
|
12094
|
+
var error53 = () => {
|
|
11756
12095
|
const Sizable = {
|
|
11757
12096
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
11758
12097
|
file: { unit: "ba\xFDt", verb: "bolmaly" },
|
|
@@ -11792,6 +12131,7 @@ var error52 = () => {
|
|
|
11792
12131
|
json_string: "JSON setiri",
|
|
11793
12132
|
e164: "E.164 nomeri",
|
|
11794
12133
|
credit_card: "kredit kartyny\u0148 nomeri",
|
|
12134
|
+
iban: "IBAN",
|
|
11795
12135
|
jwt: "JWT",
|
|
11796
12136
|
template_literal: "\u015Fablon"
|
|
11797
12137
|
};
|
|
@@ -11853,12 +12193,12 @@ var error52 = () => {
|
|
|
11853
12193
|
};
|
|
11854
12194
|
function tk_default() {
|
|
11855
12195
|
return {
|
|
11856
|
-
localeError:
|
|
12196
|
+
localeError: error53()
|
|
11857
12197
|
};
|
|
11858
12198
|
}
|
|
11859
12199
|
|
|
11860
12200
|
// ../../node_modules/zod/v4/locales/tr.js
|
|
11861
|
-
var
|
|
12201
|
+
var error54 = () => {
|
|
11862
12202
|
const Sizable = {
|
|
11863
12203
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
11864
12204
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -11898,6 +12238,7 @@ var error53 = () => {
|
|
|
11898
12238
|
json_string: "JSON dizesi",
|
|
11899
12239
|
e164: "E.164 say\u0131s\u0131",
|
|
11900
12240
|
credit_card: "kredi kart\u0131 numaras\u0131",
|
|
12241
|
+
iban: "IBAN",
|
|
11901
12242
|
jwt: "JWT",
|
|
11902
12243
|
template_literal: "\u015Eablon dizesi"
|
|
11903
12244
|
};
|
|
@@ -11962,12 +12303,12 @@ var error53 = () => {
|
|
|
11962
12303
|
};
|
|
11963
12304
|
function tr_default() {
|
|
11964
12305
|
return {
|
|
11965
|
-
localeError:
|
|
12306
|
+
localeError: error54()
|
|
11966
12307
|
};
|
|
11967
12308
|
}
|
|
11968
12309
|
|
|
11969
12310
|
// ../../node_modules/zod/v4/locales/uk.js
|
|
11970
|
-
var
|
|
12311
|
+
var error55 = () => {
|
|
11971
12312
|
const Sizable = {
|
|
11972
12313
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
11973
12314
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -12007,6 +12348,7 @@ var error54 = () => {
|
|
|
12007
12348
|
json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
|
|
12008
12349
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
12009
12350
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
|
|
12351
|
+
iban: "IBAN",
|
|
12010
12352
|
jwt: "JWT",
|
|
12011
12353
|
template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
|
|
12012
12354
|
};
|
|
@@ -12074,7 +12416,7 @@ var error54 = () => {
|
|
|
12074
12416
|
};
|
|
12075
12417
|
function uk_default() {
|
|
12076
12418
|
return {
|
|
12077
|
-
localeError:
|
|
12419
|
+
localeError: error55()
|
|
12078
12420
|
};
|
|
12079
12421
|
}
|
|
12080
12422
|
|
|
@@ -12084,7 +12426,7 @@ function ua_default() {
|
|
|
12084
12426
|
}
|
|
12085
12427
|
|
|
12086
12428
|
// ../../node_modules/zod/v4/locales/ur.js
|
|
12087
|
-
var
|
|
12429
|
+
var error56 = () => {
|
|
12088
12430
|
const Sizable = {
|
|
12089
12431
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
12090
12432
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -12124,6 +12466,7 @@ var error55 = () => {
|
|
|
12124
12466
|
json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
|
|
12125
12467
|
e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
|
|
12126
12468
|
credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
|
|
12469
|
+
iban: "IBAN",
|
|
12127
12470
|
jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
|
|
12128
12471
|
template_literal: "\u0627\u0646 \u067E\u0679"
|
|
12129
12472
|
};
|
|
@@ -12193,12 +12536,12 @@ var error55 = () => {
|
|
|
12193
12536
|
};
|
|
12194
12537
|
function ur_default() {
|
|
12195
12538
|
return {
|
|
12196
|
-
localeError:
|
|
12539
|
+
localeError: error56()
|
|
12197
12540
|
};
|
|
12198
12541
|
}
|
|
12199
12542
|
|
|
12200
12543
|
// ../../node_modules/zod/v4/locales/uz.js
|
|
12201
|
-
var
|
|
12544
|
+
var error57 = () => {
|
|
12202
12545
|
const Sizable = {
|
|
12203
12546
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
12204
12547
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -12238,6 +12581,7 @@ var error56 = () => {
|
|
|
12238
12581
|
json_string: "JSON satr",
|
|
12239
12582
|
e164: "E.164 raqam",
|
|
12240
12583
|
credit_card: "kredit karta raqami",
|
|
12584
|
+
iban: "IBAN",
|
|
12241
12585
|
jwt: "JWT",
|
|
12242
12586
|
template_literal: "kirish"
|
|
12243
12587
|
};
|
|
@@ -12305,12 +12649,12 @@ var error56 = () => {
|
|
|
12305
12649
|
};
|
|
12306
12650
|
function uz_default() {
|
|
12307
12651
|
return {
|
|
12308
|
-
localeError:
|
|
12652
|
+
localeError: error57()
|
|
12309
12653
|
};
|
|
12310
12654
|
}
|
|
12311
12655
|
|
|
12312
12656
|
// ../../node_modules/zod/v4/locales/vi.js
|
|
12313
|
-
var
|
|
12657
|
+
var error58 = () => {
|
|
12314
12658
|
const Sizable = {
|
|
12315
12659
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
12316
12660
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -12350,6 +12694,7 @@ var error57 = () => {
|
|
|
12350
12694
|
json_string: "chu\u1ED7i JSON",
|
|
12351
12695
|
e164: "s\u1ED1 E.164",
|
|
12352
12696
|
credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
|
|
12697
|
+
iban: "IBAN",
|
|
12353
12698
|
jwt: "JWT",
|
|
12354
12699
|
template_literal: "\u0111\u1EA7u v\xE0o"
|
|
12355
12700
|
};
|
|
@@ -12417,12 +12762,12 @@ var error57 = () => {
|
|
|
12417
12762
|
};
|
|
12418
12763
|
function vi_default() {
|
|
12419
12764
|
return {
|
|
12420
|
-
localeError:
|
|
12765
|
+
localeError: error58()
|
|
12421
12766
|
};
|
|
12422
12767
|
}
|
|
12423
12768
|
|
|
12424
12769
|
// ../../node_modules/zod/v4/locales/zh-CN.js
|
|
12425
|
-
var
|
|
12770
|
+
var error59 = () => {
|
|
12426
12771
|
const Sizable = {
|
|
12427
12772
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
12428
12773
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -12462,6 +12807,7 @@ var error58 = () => {
|
|
|
12462
12807
|
json_string: "JSON\u5B57\u7B26\u4E32",
|
|
12463
12808
|
e164: "E.164\u53F7\u7801",
|
|
12464
12809
|
credit_card: "\u4FE1\u7528\u5361\u53F7",
|
|
12810
|
+
iban: "IBAN",
|
|
12465
12811
|
jwt: "JWT",
|
|
12466
12812
|
template_literal: "\u8F93\u5165"
|
|
12467
12813
|
};
|
|
@@ -12530,12 +12876,12 @@ var error58 = () => {
|
|
|
12530
12876
|
};
|
|
12531
12877
|
function zh_CN_default() {
|
|
12532
12878
|
return {
|
|
12533
|
-
localeError:
|
|
12879
|
+
localeError: error59()
|
|
12534
12880
|
};
|
|
12535
12881
|
}
|
|
12536
12882
|
|
|
12537
12883
|
// ../../node_modules/zod/v4/locales/zh-TW.js
|
|
12538
|
-
var
|
|
12884
|
+
var error60 = () => {
|
|
12539
12885
|
const Sizable = {
|
|
12540
12886
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
12541
12887
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -12575,6 +12921,7 @@ var error59 = () => {
|
|
|
12575
12921
|
json_string: "JSON \u5B57\u4E32",
|
|
12576
12922
|
e164: "E.164 \u6578\u503C",
|
|
12577
12923
|
credit_card: "\u4FE1\u7528\u5361\u865F",
|
|
12924
|
+
iban: "IBAN",
|
|
12578
12925
|
jwt: "JWT",
|
|
12579
12926
|
template_literal: "\u8F38\u5165"
|
|
12580
12927
|
};
|
|
@@ -12641,12 +12988,12 @@ var error59 = () => {
|
|
|
12641
12988
|
};
|
|
12642
12989
|
function zh_TW_default() {
|
|
12643
12990
|
return {
|
|
12644
|
-
localeError:
|
|
12991
|
+
localeError: error60()
|
|
12645
12992
|
};
|
|
12646
12993
|
}
|
|
12647
12994
|
|
|
12648
12995
|
// ../../node_modules/zod/v4/locales/yo.js
|
|
12649
|
-
var
|
|
12996
|
+
var error61 = () => {
|
|
12650
12997
|
const Sizable = {
|
|
12651
12998
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
12652
12999
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -12686,6 +13033,7 @@ var error60 = () => {
|
|
|
12686
13033
|
json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
|
|
12687
13034
|
e164: "n\u1ECD\u0301mb\xE0 E.164",
|
|
12688
13035
|
credit_card: "n\u1ECDmba kaadi gbese",
|
|
13036
|
+
iban: "IBAN",
|
|
12689
13037
|
jwt: "JWT",
|
|
12690
13038
|
template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
|
|
12691
13039
|
};
|
|
@@ -12752,7 +13100,7 @@ var error60 = () => {
|
|
|
12752
13100
|
};
|
|
12753
13101
|
function yo_default() {
|
|
12754
13102
|
return {
|
|
12755
|
-
localeError:
|
|
13103
|
+
localeError: error61()
|
|
12756
13104
|
};
|
|
12757
13105
|
}
|
|
12758
13106
|
|
|
@@ -12832,31 +13180,8 @@ function compileValidator(schema, parser) {
|
|
|
12832
13180
|
function compile(schema, options) {
|
|
12833
13181
|
try {
|
|
12834
13182
|
const parser = compileFn(schema);
|
|
12835
|
-
const clone2 =
|
|
12836
|
-
const liveRun = schema._zod.run;
|
|
12837
|
-
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
12838
|
-
const wrapped = (payload, ctx) => {
|
|
12839
|
-
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
12840
|
-
return originalRun(payload, ctx);
|
|
12841
|
-
}
|
|
12842
|
-
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
12843
|
-
return originalRun(payload, ctx);
|
|
12844
|
-
}
|
|
12845
|
-
const out = parser(payload.value);
|
|
12846
|
-
if (out !== INVALID) {
|
|
12847
|
-
payload.value = out;
|
|
12848
|
-
return payload;
|
|
12849
|
-
}
|
|
12850
|
-
if (ctx)
|
|
12851
|
-
ctx[FALLBACK_FLAG] = true;
|
|
12852
|
-
return originalRun(payload, ctx);
|
|
12853
|
-
};
|
|
12854
|
-
wrapped.__originalRun = originalRun;
|
|
12855
|
-
clone2._zod.bag.fallbackRun = originalRun;
|
|
13183
|
+
const clone2 = withParser(schema, parser);
|
|
12856
13184
|
clone2._zod.bag.validator = compileValidator(schema, parser);
|
|
12857
|
-
clone2._zod.run = wrapped;
|
|
12858
|
-
if (!liveRun.__originalRun)
|
|
12859
|
-
installCompiledUserMethods(clone2, schema, parser);
|
|
12860
13185
|
return clone2;
|
|
12861
13186
|
} catch (err) {
|
|
12862
13187
|
if (options?.strict)
|
|
@@ -12864,6 +13189,37 @@ function compile(schema, options) {
|
|
|
12864
13189
|
return schema;
|
|
12865
13190
|
}
|
|
12866
13191
|
}
|
|
13192
|
+
function withParser(schema, parser) {
|
|
13193
|
+
if (isRecursiveSchema(schema)) {
|
|
13194
|
+
throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
|
|
13195
|
+
}
|
|
13196
|
+
const clone2 = clone(schema);
|
|
13197
|
+
const liveRun = schema._zod.run;
|
|
13198
|
+
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
13199
|
+
const wrapped = (payload, ctx) => {
|
|
13200
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
13201
|
+
return originalRun(payload, ctx);
|
|
13202
|
+
}
|
|
13203
|
+
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
13204
|
+
return originalRun(payload, ctx);
|
|
13205
|
+
}
|
|
13206
|
+
const out = parser(payload.value);
|
|
13207
|
+
if (out !== INVALID) {
|
|
13208
|
+
payload.value = out;
|
|
13209
|
+
return payload;
|
|
13210
|
+
}
|
|
13211
|
+
if (ctx)
|
|
13212
|
+
ctx[FALLBACK_FLAG] = true;
|
|
13213
|
+
return originalRun(payload, ctx);
|
|
13214
|
+
};
|
|
13215
|
+
wrapped.__originalRun = originalRun;
|
|
13216
|
+
clone2._zod.bag.fallbackRun = originalRun;
|
|
13217
|
+
clone2._zod.bag.validator = parser;
|
|
13218
|
+
clone2._zod.run = wrapped;
|
|
13219
|
+
if (!liveRun.__originalRun)
|
|
13220
|
+
installCompiledUserMethods(clone2, schema, parser);
|
|
13221
|
+
return clone2;
|
|
13222
|
+
}
|
|
12867
13223
|
function installCompiledUserMethods(target, source, parser) {
|
|
12868
13224
|
const targetAny = target;
|
|
12869
13225
|
const sourceAny = source;
|
|
@@ -12900,7 +13256,8 @@ function compileFn(schema, options) {
|
|
|
12900
13256
|
const ctx = {
|
|
12901
13257
|
constants: /* @__PURE__ */ new Map(),
|
|
12902
13258
|
constantCounter: 0,
|
|
12903
|
-
varCounter: 0
|
|
13259
|
+
varCounter: 0,
|
|
13260
|
+
definite: true
|
|
12904
13261
|
};
|
|
12905
13262
|
const doc = new Doc(["input"]);
|
|
12906
13263
|
const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
|
|
@@ -12924,6 +13281,7 @@ ${code}
|
|
|
12924
13281
|
if (options?.debug) {
|
|
12925
13282
|
fn.code = fullCode;
|
|
12926
13283
|
}
|
|
13284
|
+
fn.definite = ctx.definite;
|
|
12927
13285
|
return fn;
|
|
12928
13286
|
}
|
|
12929
13287
|
function addConstant(ctx, value) {
|
|
@@ -12935,6 +13293,10 @@ function addConstant(ctx, value) {
|
|
|
12935
13293
|
ctx.constants.set(name, value);
|
|
12936
13294
|
return name;
|
|
12937
13295
|
}
|
|
13296
|
+
function addUserConstant(ctx, fn) {
|
|
13297
|
+
ctx.definite = false;
|
|
13298
|
+
return addConstant(ctx, fn);
|
|
13299
|
+
}
|
|
12938
13300
|
function newVar(ctx) {
|
|
12939
13301
|
return `v${ctx.varCounter++}`;
|
|
12940
13302
|
}
|
|
@@ -12967,6 +13329,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
12967
13329
|
}
|
|
12968
13330
|
}
|
|
12969
13331
|
function emitRuntimeIsland(doc, ctx, schema, accessor) {
|
|
13332
|
+
ctx.definite = false;
|
|
12970
13333
|
const schemaConst = addConstant(ctx, schema);
|
|
12971
13334
|
const runConst = addConstant(ctx, runtimeRun);
|
|
12972
13335
|
const outVar = newVar(ctx);
|
|
@@ -13047,6 +13410,9 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
13047
13410
|
case "property":
|
|
13048
13411
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
13049
13412
|
break;
|
|
13413
|
+
case "properties":
|
|
13414
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor, false);
|
|
13415
|
+
break;
|
|
13050
13416
|
case "overwrite": {
|
|
13051
13417
|
const newAccessor = newVar(ctx);
|
|
13052
13418
|
generateOverwriteCheck(doc, ctx, check2, currentAccessor, newAccessor);
|
|
@@ -13155,6 +13521,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
13155
13521
|
doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
|
|
13156
13522
|
}
|
|
13157
13523
|
}
|
|
13524
|
+
function generatePropertiesChecks(doc, ctx, def, accessor, schemaRole) {
|
|
13525
|
+
if (def.when) {
|
|
13526
|
+
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
13527
|
+
}
|
|
13528
|
+
doc.write(schemaRole ? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;` : `if (${accessor} == null) return INVALID;`);
|
|
13529
|
+
const shape = def.shape;
|
|
13530
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
13531
|
+
const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
|
|
13532
|
+
const inputVar = newVar(ctx);
|
|
13533
|
+
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
13534
|
+
compileChild(doc, ctx, shape[key], inputVar, false);
|
|
13535
|
+
}
|
|
13536
|
+
}
|
|
13158
13537
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
13159
13538
|
const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
|
|
13160
13539
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
@@ -13182,7 +13561,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
13182
13561
|
if (isAsyncFunction(def.fn)) {
|
|
13183
13562
|
throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
|
|
13184
13563
|
}
|
|
13185
|
-
const fnConst =
|
|
13564
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
13186
13565
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
13187
13566
|
const resVar = newVar(ctx);
|
|
13188
13567
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -13202,7 +13581,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
13202
13581
|
throwAsync();
|
|
13203
13582
|
return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
|
|
13204
13583
|
};
|
|
13205
|
-
const helperConst =
|
|
13584
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
13206
13585
|
const outVar = newVar(ctx);
|
|
13207
13586
|
doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
|
|
13208
13587
|
doc.write(`if (${outVar} === INVALID) return INVALID;`);
|
|
@@ -13269,6 +13648,11 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
13269
13648
|
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
13270
13649
|
return accessor;
|
|
13271
13650
|
}
|
|
13651
|
+
if (fmt === "iban") {
|
|
13652
|
+
const validator = addConstant(ctx, isValidIBAN);
|
|
13653
|
+
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
13654
|
+
return accessor;
|
|
13655
|
+
}
|
|
13272
13656
|
const formatDef = def;
|
|
13273
13657
|
if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
|
|
13274
13658
|
const parseConst = addConstant(ctx, parseURLObject);
|
|
@@ -13451,6 +13835,10 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
13451
13835
|
case "custom":
|
|
13452
13836
|
typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
|
|
13453
13837
|
break;
|
|
13838
|
+
case "properties":
|
|
13839
|
+
generatePropertiesChecks(doc, ctx, schema._zod.def, accessor, true);
|
|
13840
|
+
typeAccessor = accessor;
|
|
13841
|
+
break;
|
|
13454
13842
|
case "transform":
|
|
13455
13843
|
typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
|
|
13456
13844
|
break;
|
|
@@ -14091,6 +14479,7 @@ function literalEquality(ctx, accessor, value) {
|
|
|
14091
14479
|
}
|
|
14092
14480
|
function generateIntersectionCheck(doc, ctx, schema, accessor) {
|
|
14093
14481
|
const def = schema._zod.def;
|
|
14482
|
+
ctx.definite = false;
|
|
14094
14483
|
const leftOutput = compileChild(doc, ctx, def.left, accessor);
|
|
14095
14484
|
const rightOutput = compileChild(doc, ctx, def.right, accessor);
|
|
14096
14485
|
const mergeConst = addConstant(ctx, mergeValues);
|
|
@@ -14144,14 +14533,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
14144
14533
|
const keyIsBareString = keyDef.type === "string" && keyDef.format === void 0 && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
|
|
14145
14534
|
if (!keyIsBareString) {
|
|
14146
14535
|
const isLoose = def.mode === "loose";
|
|
14147
|
-
const
|
|
14536
|
+
const keyFn = compileFn(def.keyType);
|
|
14537
|
+
if (keyFn.definite === false)
|
|
14538
|
+
ctx.definite = false;
|
|
14539
|
+
const keyFast = addConstant(ctx, keyFn);
|
|
14148
14540
|
const numericConst = addConstant(ctx, number);
|
|
14149
|
-
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
14150
14541
|
const outKeyVar = newVar(ctx);
|
|
14151
|
-
doc
|
|
14152
|
-
doc.indented((d) => {
|
|
14153
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
14154
|
-
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14542
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
14155
14543
|
d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
|
|
14156
14544
|
d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
|
|
14157
14545
|
if (isLoose) {
|
|
@@ -14165,21 +14553,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
14165
14553
|
const valOutput = compileChild(d, ctx, def.valueType, valueVar);
|
|
14166
14554
|
d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
|
|
14167
14555
|
});
|
|
14168
|
-
doc.write(`}`);
|
|
14169
14556
|
return outputVar;
|
|
14170
14557
|
}
|
|
14171
|
-
|
|
14172
|
-
doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
|
|
14173
|
-
doc.indented((d) => {
|
|
14174
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
14175
|
-
d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
|
|
14176
|
-
d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
|
|
14558
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
14177
14559
|
d.write(`const ${valVar} = ${accessor}[${kVar}];`);
|
|
14178
14560
|
const valOutput = compileChild(d, ctx, def.valueType, valVar);
|
|
14179
14561
|
d.write(`${outputVar}[${kVar}] = ${valOutput};`);
|
|
14562
|
+
}, `return INVALID;`);
|
|
14563
|
+
return outputVar;
|
|
14564
|
+
}
|
|
14565
|
+
function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
14566
|
+
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
14567
|
+
const symsVar = newVar(ctx);
|
|
14568
|
+
const keysVar = newVar(ctx);
|
|
14569
|
+
const iVar = newVar(ctx);
|
|
14570
|
+
doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
|
|
14571
|
+
doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
|
|
14572
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
|
|
14573
|
+
doc.indented((d) => {
|
|
14574
|
+
d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
|
|
14575
|
+
d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14576
|
+
body(d);
|
|
14577
|
+
});
|
|
14578
|
+
doc.write(`}`);
|
|
14579
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
|
|
14580
|
+
doc.indented((d) => {
|
|
14581
|
+
d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
|
|
14582
|
+
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14583
|
+
if (onSymbol)
|
|
14584
|
+
d.write(onSymbol);
|
|
14585
|
+
else
|
|
14586
|
+
body(d);
|
|
14180
14587
|
});
|
|
14181
14588
|
doc.write(`}`);
|
|
14182
|
-
return outputVar;
|
|
14183
14589
|
}
|
|
14184
14590
|
function literalPropertyKey(ctx, key) {
|
|
14185
14591
|
if (typeof key === "string")
|
|
@@ -14232,7 +14638,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
|
|
|
14232
14638
|
}
|
|
14233
14639
|
function generateLazyCheck(doc, ctx, schema, accessor) {
|
|
14234
14640
|
const def = schema._zod.def;
|
|
14235
|
-
const getterConst =
|
|
14641
|
+
const getterConst = addUserConstant(ctx, def.getter);
|
|
14236
14642
|
const cacheConst = addConstant(ctx, { parser: null });
|
|
14237
14643
|
doc.write(`if (!${cacheConst}.parser) {`);
|
|
14238
14644
|
doc.indented((d) => {
|
|
@@ -14265,7 +14671,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
|
|
|
14265
14671
|
return INVALID;
|
|
14266
14672
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
14267
14673
|
};
|
|
14268
|
-
const helperConst =
|
|
14674
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
14269
14675
|
const transformedVar = newVar(ctx);
|
|
14270
14676
|
doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
|
|
14271
14677
|
doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
|
|
@@ -14283,7 +14689,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
|
|
|
14283
14689
|
if (isAsyncFunction(def.fn)) {
|
|
14284
14690
|
throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
|
|
14285
14691
|
}
|
|
14286
|
-
const fnConst =
|
|
14692
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
14287
14693
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
14288
14694
|
const resVar = newVar(ctx);
|
|
14289
14695
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -14316,7 +14722,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
|
|
|
14316
14722
|
});
|
|
14317
14723
|
doc.write(`})();`);
|
|
14318
14724
|
const innerConst = addConstant(ctx, def.innerType);
|
|
14319
|
-
const catchConst =
|
|
14725
|
+
const catchConst = addUserConstant(ctx, def.catchValue);
|
|
14320
14726
|
const catchHelperConst = addConstant(ctx, runtimeCatch);
|
|
14321
14727
|
doc.write(`if (${outputVar} === INVALID) {`);
|
|
14322
14728
|
doc.indented((d) => {
|
|
@@ -14340,7 +14746,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
14340
14746
|
return INVALID;
|
|
14341
14747
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
14342
14748
|
};
|
|
14343
|
-
const helperConst =
|
|
14749
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
14344
14750
|
const outputVar = newVar(ctx);
|
|
14345
14751
|
doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
|
|
14346
14752
|
doc.write(`if (${outputVar} === INVALID) return INVALID;`);
|
|
@@ -14599,6 +15005,16 @@ function _creditCard(Class2, params) {
|
|
|
14599
15005
|
});
|
|
14600
15006
|
}
|
|
14601
15007
|
// @__NO_SIDE_EFFECTS__
|
|
15008
|
+
function _iban(Class2, params) {
|
|
15009
|
+
return new Class2({
|
|
15010
|
+
type: "string",
|
|
15011
|
+
format: "iban",
|
|
15012
|
+
check: "string_format",
|
|
15013
|
+
abort: false,
|
|
15014
|
+
...normalizeParams(params)
|
|
15015
|
+
});
|
|
15016
|
+
}
|
|
15017
|
+
// @__NO_SIDE_EFFECTS__
|
|
14602
15018
|
function _jwt(Class2, params) {
|
|
14603
15019
|
return new Class2({
|
|
14604
15020
|
type: "string",
|
|
@@ -15012,8 +15428,13 @@ function _property(property, schema, params) {
|
|
|
15012
15428
|
});
|
|
15013
15429
|
}
|
|
15014
15430
|
// @__NO_SIDE_EFFECTS__
|
|
15015
|
-
function _properties(shape) {
|
|
15016
|
-
return
|
|
15431
|
+
function _properties(Class2, shape, params) {
|
|
15432
|
+
return new Class2({
|
|
15433
|
+
type: "properties",
|
|
15434
|
+
check: "properties",
|
|
15435
|
+
shape,
|
|
15436
|
+
...normalizeParams(params)
|
|
15437
|
+
});
|
|
15017
15438
|
}
|
|
15018
15439
|
// @__NO_SIDE_EFFECTS__
|
|
15019
15440
|
function _mime(types, params) {
|
|
@@ -15450,7 +15871,7 @@ function handleUnrepresentable(schema, ctx, json2, params, message) {
|
|
|
15450
15871
|
Object.assign(json2, result);
|
|
15451
15872
|
return true;
|
|
15452
15873
|
}
|
|
15453
|
-
function
|
|
15874
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
15454
15875
|
var _a3;
|
|
15455
15876
|
const def = schema._zod.def;
|
|
15456
15877
|
const seen = ctx.seen.get(schema);
|
|
@@ -15489,7 +15910,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
15489
15910
|
if (parent) {
|
|
15490
15911
|
if (!result.ref)
|
|
15491
15912
|
result.ref = parent;
|
|
15492
|
-
|
|
15913
|
+
processSchema(parent, ctx, params);
|
|
15493
15914
|
ctx.seen.get(parent).isParent = true;
|
|
15494
15915
|
}
|
|
15495
15916
|
}
|
|
@@ -15596,7 +16017,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15596
16017
|
if (seen.count > 1) {
|
|
15597
16018
|
if (ctx.reused === "ref") {
|
|
15598
16019
|
extractToDef(entry);
|
|
15599
|
-
continue;
|
|
15600
16020
|
}
|
|
15601
16021
|
}
|
|
15602
16022
|
}
|
|
@@ -15645,11 +16065,11 @@ function foldObjects(members2) {
|
|
|
15645
16065
|
}
|
|
15646
16066
|
objects.push(member);
|
|
15647
16067
|
}
|
|
15648
|
-
const
|
|
16068
|
+
const properties2 = {};
|
|
15649
16069
|
const required2 = /* @__PURE__ */ new Set();
|
|
15650
16070
|
for (const object2 of objects) {
|
|
15651
16071
|
for (const key in object2.properties) {
|
|
15652
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
16072
|
+
if (Object.prototype.hasOwnProperty.call(properties2, key))
|
|
15653
16073
|
continue;
|
|
15654
16074
|
const parts = [];
|
|
15655
16075
|
for (const other of objects) {
|
|
@@ -15660,12 +16080,12 @@ function foldObjects(members2) {
|
|
|
15660
16080
|
parts.push(part);
|
|
15661
16081
|
}
|
|
15662
16082
|
const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
|
|
15663
|
-
assignProp(
|
|
16083
|
+
assignProp(properties2, key, merged);
|
|
15664
16084
|
}
|
|
15665
16085
|
for (const key of object2.required ?? [])
|
|
15666
16086
|
required2.add(key);
|
|
15667
16087
|
}
|
|
15668
|
-
const folded = { type: "object", properties };
|
|
16088
|
+
const folded = { type: "object", properties: properties2 };
|
|
15669
16089
|
if (required2.size)
|
|
15670
16090
|
folded.required = [...required2];
|
|
15671
16091
|
if (objects.every((object2) => object2.additionalProperties === false)) {
|
|
@@ -15924,19 +16344,107 @@ function isTransforming(_schema, _ctx) {
|
|
|
15924
16344
|
}
|
|
15925
16345
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
15926
16346
|
const ctx = initializeContext({ ...params, processors });
|
|
15927
|
-
|
|
16347
|
+
processSchema(schema, ctx);
|
|
15928
16348
|
extractDefs(ctx, schema);
|
|
15929
16349
|
return finalize(ctx, schema);
|
|
15930
16350
|
};
|
|
15931
16351
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
15932
16352
|
const { libraryOptions, target } = params ?? {};
|
|
15933
16353
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
15934
|
-
|
|
16354
|
+
processSchema(schema, ctx);
|
|
15935
16355
|
extractDefs(ctx, schema);
|
|
15936
16356
|
return finalize(ctx, schema);
|
|
15937
16357
|
};
|
|
15938
16358
|
|
|
15939
16359
|
// ../../node_modules/zod/v4/core/json-schema-processors.js
|
|
16360
|
+
var narrowMin = (agg, key, value) => {
|
|
16361
|
+
if (agg[key] === void 0 || value > agg[key])
|
|
16362
|
+
agg[key] = value;
|
|
16363
|
+
};
|
|
16364
|
+
var narrowMax = (agg, key, value) => {
|
|
16365
|
+
if (agg[key] === void 0 || value < agg[key])
|
|
16366
|
+
agg[key] = value;
|
|
16367
|
+
};
|
|
16368
|
+
var narrowBoth = (agg, value) => {
|
|
16369
|
+
narrowMin(agg, "minimum", value);
|
|
16370
|
+
narrowMax(agg, "maximum", value);
|
|
16371
|
+
};
|
|
16372
|
+
var addDivisor = (agg, value) => {
|
|
16373
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
16374
|
+
if (!agg.multipleOf.includes(value))
|
|
16375
|
+
agg.multipleOf.push(value);
|
|
16376
|
+
};
|
|
16377
|
+
var addPattern = (agg, pattern) => {
|
|
16378
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
16379
|
+
agg.patterns.add(pattern);
|
|
16380
|
+
};
|
|
16381
|
+
var intersectMime = (agg, mime) => {
|
|
16382
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
16383
|
+
};
|
|
16384
|
+
var setFormat = (agg, format) => {
|
|
16385
|
+
agg.format = format;
|
|
16386
|
+
if (format.includes("int"))
|
|
16387
|
+
agg.isInt = true;
|
|
16388
|
+
};
|
|
16389
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
16390
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
16391
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
16392
|
+
setFormat(agg, def.format);
|
|
16393
|
+
const [minimum, maximum] = ranges[def.format];
|
|
16394
|
+
narrowMin(agg, "minimum", minimum);
|
|
16395
|
+
narrowMax(agg, "maximum", maximum);
|
|
16396
|
+
};
|
|
16397
|
+
var contributors = {
|
|
16398
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
16399
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
16400
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
16401
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
16402
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
16403
|
+
min_length: minContributor,
|
|
16404
|
+
max_length: maxContributor,
|
|
16405
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
16406
|
+
min_size: minContributor,
|
|
16407
|
+
max_size: maxContributor,
|
|
16408
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
16409
|
+
string_format: (agg, def) => {
|
|
16410
|
+
setFormat(agg, def.format);
|
|
16411
|
+
if (def.pattern)
|
|
16412
|
+
addPattern(agg, def.pattern);
|
|
16413
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
16414
|
+
agg.contentEncoding = def.format;
|
|
16415
|
+
if (def.local || def.precision === -1)
|
|
16416
|
+
agg.laxFormat = true;
|
|
16417
|
+
},
|
|
16418
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
16419
|
+
};
|
|
16420
|
+
function aggregateChecks(schema) {
|
|
16421
|
+
const agg = {};
|
|
16422
|
+
const def = schema._zod.def;
|
|
16423
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
16424
|
+
for (const ch of list)
|
|
16425
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
16426
|
+
const bag = schema._zod.bag;
|
|
16427
|
+
if (bag.minimum !== void 0)
|
|
16428
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
16429
|
+
if (bag.exclusiveMinimum !== void 0)
|
|
16430
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
16431
|
+
if (bag.maximum !== void 0)
|
|
16432
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
16433
|
+
if (bag.exclusiveMaximum !== void 0)
|
|
16434
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
16435
|
+
if (bag.multipleOf !== void 0)
|
|
16436
|
+
addDivisor(agg, bag.multipleOf);
|
|
16437
|
+
if (bag.format !== void 0) {
|
|
16438
|
+
agg.format ?? (agg.format = bag.format);
|
|
16439
|
+
if (bag.format.includes("int"))
|
|
16440
|
+
agg.isInt = true;
|
|
16441
|
+
}
|
|
16442
|
+
if (bag.mime)
|
|
16443
|
+
intersectMime(agg, bag.mime);
|
|
16444
|
+
for (const pattern of bag.patterns ?? [])
|
|
16445
|
+
addPattern(agg, pattern);
|
|
16446
|
+
return agg;
|
|
16447
|
+
}
|
|
15940
16448
|
var formatMap = {
|
|
15941
16449
|
guid: "uuid",
|
|
15942
16450
|
url: "uri",
|
|
@@ -15945,10 +16453,15 @@ var formatMap = {
|
|
|
15945
16453
|
regex: ""
|
|
15946
16454
|
// do not set
|
|
15947
16455
|
};
|
|
16456
|
+
var exactPatterns = /* @__PURE__ */ new Map([
|
|
16457
|
+
[base64Charset, base64],
|
|
16458
|
+
[base64urlCharset, base64url]
|
|
16459
|
+
]);
|
|
16460
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
15948
16461
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
15949
16462
|
const json2 = _json;
|
|
15950
16463
|
json2.type = "string";
|
|
15951
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
16464
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
15952
16465
|
if (typeof minimum === "number")
|
|
15953
16466
|
json2.minLength = minimum;
|
|
15954
16467
|
if (typeof maximum === "number")
|
|
@@ -15964,7 +16477,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15964
16477
|
if (contentEncoding)
|
|
15965
16478
|
json2.contentEncoding = contentEncoding;
|
|
15966
16479
|
if (patterns && patterns.size > 0) {
|
|
15967
|
-
const patternList = [...patterns];
|
|
16480
|
+
const patternList = [...patterns].map(exactPattern);
|
|
15968
16481
|
if (patternList.length === 1)
|
|
15969
16482
|
json2.pattern = patternList[0].source;
|
|
15970
16483
|
else if (patternList.length > 1) {
|
|
@@ -15979,11 +16492,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15979
16492
|
};
|
|
15980
16493
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
15981
16494
|
const json2 = _json;
|
|
15982
|
-
const { minimum, maximum,
|
|
15983
|
-
|
|
15984
|
-
json2.type = "integer";
|
|
15985
|
-
else
|
|
15986
|
-
json2.type = "number";
|
|
16495
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
16496
|
+
json2.type = isInt ? "integer" : "number";
|
|
15987
16497
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
15988
16498
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
15989
16499
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -16007,11 +16517,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
16007
16517
|
} else if (typeof maximum === "number") {
|
|
16008
16518
|
json2.maximum = maximum;
|
|
16009
16519
|
}
|
|
16010
|
-
if (
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16520
|
+
if (multipleOf) {
|
|
16521
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
16522
|
+
for (const divisor of multipleOf) {
|
|
16523
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
16524
|
+
divisors.add(Math.abs(divisor));
|
|
16525
|
+
else
|
|
16526
|
+
handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
16527
|
+
}
|
|
16528
|
+
const [first, ...rest] = divisors;
|
|
16529
|
+
if (first !== void 0)
|
|
16530
|
+
json2.multipleOf = first;
|
|
16531
|
+
if (rest.length)
|
|
16532
|
+
json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
16015
16533
|
}
|
|
16016
16534
|
};
|
|
16017
16535
|
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
@@ -16114,27 +16632,22 @@ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
|
16114
16632
|
};
|
|
16115
16633
|
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
16116
16634
|
const _json = json2;
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
};
|
|
16122
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
16635
|
+
_json.type = "string";
|
|
16636
|
+
_json.format = "binary";
|
|
16637
|
+
_json.contentEncoding = "binary";
|
|
16638
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
16123
16639
|
if (minimum !== void 0)
|
|
16124
|
-
|
|
16640
|
+
_json.minLength = minimum;
|
|
16125
16641
|
if (maximum !== void 0)
|
|
16126
|
-
|
|
16127
|
-
if (mime)
|
|
16128
|
-
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
}
|
|
16135
|
-
} else {
|
|
16136
|
-
Object.assign(_json, file2);
|
|
16137
|
-
}
|
|
16642
|
+
_json.maxLength = maximum;
|
|
16643
|
+
if (!mime)
|
|
16644
|
+
return;
|
|
16645
|
+
if (mime.length === 0)
|
|
16646
|
+
_json.not = {};
|
|
16647
|
+
else if (mime.length === 1)
|
|
16648
|
+
_json.contentMediaType = mime[0];
|
|
16649
|
+
else
|
|
16650
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
16138
16651
|
};
|
|
16139
16652
|
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
16140
16653
|
json2.type = "boolean";
|
|
@@ -16157,13 +16670,13 @@ var setProcessor = (schema, ctx, json2, params) => {
|
|
|
16157
16670
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
16158
16671
|
const json2 = _json;
|
|
16159
16672
|
const def = schema._zod.def;
|
|
16160
|
-
const { minimum, maximum } = schema
|
|
16673
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
16161
16674
|
if (typeof minimum === "number")
|
|
16162
16675
|
json2.minItems = minimum;
|
|
16163
16676
|
if (typeof maximum === "number")
|
|
16164
16677
|
json2.maxItems = maximum;
|
|
16165
16678
|
json2.type = "array";
|
|
16166
|
-
json2.items =
|
|
16679
|
+
json2.items = processSchema(def.element, ctx, {
|
|
16167
16680
|
...params,
|
|
16168
16681
|
path: [...params.path, "items"]
|
|
16169
16682
|
});
|
|
@@ -16189,7 +16702,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
16189
16702
|
json2.type = "object";
|
|
16190
16703
|
json2.properties = {};
|
|
16191
16704
|
for (const key in shape) {
|
|
16192
|
-
assignProp(json2.properties, key,
|
|
16705
|
+
assignProp(json2.properties, key, processSchema(shape[key], ctx, {
|
|
16193
16706
|
...params,
|
|
16194
16707
|
path: [...params.path, "properties", key]
|
|
16195
16708
|
}));
|
|
@@ -16212,16 +16725,41 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
16212
16725
|
if (ctx.io === "output")
|
|
16213
16726
|
json2.additionalProperties = false;
|
|
16214
16727
|
} else if (def.catchall) {
|
|
16215
|
-
json2.additionalProperties =
|
|
16728
|
+
json2.additionalProperties = processSchema(def.catchall, ctx, {
|
|
16216
16729
|
...params,
|
|
16217
16730
|
path: [...params.path, "additionalProperties"]
|
|
16218
16731
|
});
|
|
16219
16732
|
}
|
|
16220
16733
|
};
|
|
16734
|
+
var propertiesProcessor = (schema, ctx, _json, params) => {
|
|
16735
|
+
const json2 = _json;
|
|
16736
|
+
const def = schema._zod.def;
|
|
16737
|
+
if (Object.getOwnPropertySymbols(def.shape).length && handleUnrepresentable(schema, ctx, json2, params, "Symbol keys cannot be represented in JSON Schema")) {
|
|
16738
|
+
return;
|
|
16739
|
+
}
|
|
16740
|
+
if (ctx.io === "output") {
|
|
16741
|
+
for (const key in def.shape) {
|
|
16742
|
+
if (isTransforming(def.shape[key]) && handleUnrepresentable(schema, ctx, json2, params, `z.properties() returns its input, so the output of a transforming schema at key "${key}" cannot be represented in JSON Schema`)) {
|
|
16743
|
+
return;
|
|
16744
|
+
}
|
|
16745
|
+
}
|
|
16746
|
+
}
|
|
16747
|
+
json2.type = "object";
|
|
16748
|
+
json2.properties = {};
|
|
16749
|
+
for (const key in def.shape) {
|
|
16750
|
+
assignProp(json2.properties, key, processSchema(def.shape[key], ctx, {
|
|
16751
|
+
...params,
|
|
16752
|
+
path: [...params.path, "properties", key]
|
|
16753
|
+
}));
|
|
16754
|
+
}
|
|
16755
|
+
const required2 = Object.keys(def.shape).filter((key) => inputOptin(def.shape[key]) === void 0);
|
|
16756
|
+
if (required2.length > 0)
|
|
16757
|
+
json2.required = required2;
|
|
16758
|
+
};
|
|
16221
16759
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
16222
16760
|
const def = schema._zod.def;
|
|
16223
16761
|
const isExclusive = def.inclusive === false;
|
|
16224
|
-
const options = def.options.map((x, i) =>
|
|
16762
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
16225
16763
|
...params,
|
|
16226
16764
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
16227
16765
|
}));
|
|
@@ -16233,11 +16771,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
16233
16771
|
};
|
|
16234
16772
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
16235
16773
|
const def = schema._zod.def;
|
|
16236
|
-
const a =
|
|
16774
|
+
const a = processSchema(def.left, ctx, {
|
|
16237
16775
|
...params,
|
|
16238
16776
|
path: [...params.path, "allOf", 0]
|
|
16239
16777
|
});
|
|
16240
|
-
const b =
|
|
16778
|
+
const b = processSchema(def.right, ctx, {
|
|
16241
16779
|
...params,
|
|
16242
16780
|
path: [...params.path, "allOf", 1]
|
|
16243
16781
|
});
|
|
@@ -16255,11 +16793,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
16255
16793
|
json2.type = "array";
|
|
16256
16794
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
16257
16795
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
16258
|
-
const prefixItems = def.items.map((x, i) =>
|
|
16796
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
16259
16797
|
...params,
|
|
16260
16798
|
path: [...params.path, prefixPath, i]
|
|
16261
16799
|
}));
|
|
16262
|
-
const rest = def.rest ?
|
|
16800
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
16263
16801
|
...params,
|
|
16264
16802
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
16265
16803
|
}) : null;
|
|
@@ -16307,7 +16845,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
16307
16845
|
if (isClosed)
|
|
16308
16846
|
json2.maxItems = maxItems;
|
|
16309
16847
|
}
|
|
16310
|
-
const { minimum, maximum } = schema
|
|
16848
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
16311
16849
|
if (typeof minimum === "number")
|
|
16312
16850
|
json2.minItems = minimum;
|
|
16313
16851
|
if (typeof maximum === "number")
|
|
@@ -16381,20 +16919,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16381
16919
|
const def = schema._zod.def;
|
|
16382
16920
|
json2.type = "object";
|
|
16383
16921
|
const keyType = def.keyType;
|
|
16384
|
-
const
|
|
16385
|
-
const patterns = keyBag?.patterns;
|
|
16922
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
16386
16923
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
16387
|
-
const valueSchema =
|
|
16924
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
16388
16925
|
...params,
|
|
16389
16926
|
path: [...params.path, "patternProperties", "*"]
|
|
16390
16927
|
});
|
|
16391
16928
|
json2.patternProperties = {};
|
|
16392
16929
|
for (const pattern of patterns) {
|
|
16393
|
-
assignProp(json2.patternProperties, pattern.source, valueSchema);
|
|
16930
|
+
assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
16394
16931
|
}
|
|
16395
16932
|
} else {
|
|
16396
16933
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
16397
|
-
json2.propertyNames =
|
|
16934
|
+
json2.propertyNames = processSchema(def.keyType, ctx, {
|
|
16398
16935
|
...params,
|
|
16399
16936
|
path: [...params.path, "propertyNames"]
|
|
16400
16937
|
});
|
|
@@ -16406,7 +16943,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16406
16943
|
}
|
|
16407
16944
|
pending.push(schema);
|
|
16408
16945
|
}
|
|
16409
|
-
json2.additionalProperties =
|
|
16946
|
+
json2.additionalProperties = processSchema(def.valueType, ctx, {
|
|
16410
16947
|
...params,
|
|
16411
16948
|
path: [...params.path, "additionalProperties"]
|
|
16412
16949
|
});
|
|
@@ -16422,7 +16959,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16422
16959
|
};
|
|
16423
16960
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
16424
16961
|
const def = schema._zod.def;
|
|
16425
|
-
const inner =
|
|
16962
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
16426
16963
|
const seen = ctx.seen.get(schema);
|
|
16427
16964
|
if (ctx.target === "openapi-3.0") {
|
|
16428
16965
|
seen.ref = def.innerType;
|
|
@@ -16433,7 +16970,7 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
16433
16970
|
};
|
|
16434
16971
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
16435
16972
|
const def = schema._zod.def;
|
|
16436
|
-
|
|
16973
|
+
processSchema(def.innerType, ctx, params);
|
|
16437
16974
|
const seen = ctx.seen.get(schema);
|
|
16438
16975
|
seen.ref = def.innerType;
|
|
16439
16976
|
};
|
|
@@ -16453,7 +16990,7 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
|
|
|
16453
16990
|
}
|
|
16454
16991
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
16455
16992
|
const def = schema._zod.def;
|
|
16456
|
-
|
|
16993
|
+
processSchema(def.innerType, ctx, params);
|
|
16457
16994
|
const seen = ctx.seen.get(schema);
|
|
16458
16995
|
seen.ref = def.innerType;
|
|
16459
16996
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
|
|
@@ -16462,7 +16999,7 @@ var defaultProcessor = (schema, ctx, json2, params) => {
|
|
|
16462
16999
|
};
|
|
16463
17000
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
16464
17001
|
const def = schema._zod.def;
|
|
16465
|
-
|
|
17002
|
+
processSchema(def.innerType, ctx, params);
|
|
16466
17003
|
const seen = ctx.seen.get(schema);
|
|
16467
17004
|
seen.ref = def.innerType;
|
|
16468
17005
|
if (ctx.io !== "input")
|
|
@@ -16473,7 +17010,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
16473
17010
|
};
|
|
16474
17011
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
16475
17012
|
const def = schema._zod.def;
|
|
16476
|
-
|
|
17013
|
+
processSchema(def.innerType, ctx, params);
|
|
16477
17014
|
const seen = ctx.seen.get(schema);
|
|
16478
17015
|
seen.ref = def.innerType;
|
|
16479
17016
|
let catchValue;
|
|
@@ -16489,32 +17026,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
16489
17026
|
const def = schema._zod.def;
|
|
16490
17027
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
16491
17028
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
16492
|
-
|
|
17029
|
+
processSchema(innerType, ctx, params);
|
|
16493
17030
|
const seen = ctx.seen.get(schema);
|
|
16494
17031
|
seen.ref = innerType;
|
|
16495
17032
|
};
|
|
16496
17033
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
16497
17034
|
const def = schema._zod.def;
|
|
16498
|
-
|
|
17035
|
+
processSchema(def.innerType, ctx, params);
|
|
16499
17036
|
const seen = ctx.seen.get(schema);
|
|
16500
17037
|
seen.ref = def.innerType;
|
|
16501
17038
|
json2.readOnly = true;
|
|
16502
17039
|
};
|
|
16503
17040
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
16504
17041
|
const def = schema._zod.def;
|
|
16505
|
-
|
|
17042
|
+
processSchema(def.innerType, ctx, params);
|
|
16506
17043
|
const seen = ctx.seen.get(schema);
|
|
16507
17044
|
seen.ref = def.innerType;
|
|
16508
17045
|
};
|
|
16509
17046
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
16510
17047
|
const def = schema._zod.def;
|
|
16511
|
-
|
|
17048
|
+
processSchema(def.innerType, ctx, params);
|
|
16512
17049
|
const seen = ctx.seen.get(schema);
|
|
16513
17050
|
seen.ref = def.innerType;
|
|
16514
17051
|
};
|
|
16515
17052
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
16516
17053
|
const innerType = schema._zod.innerType;
|
|
16517
|
-
|
|
17054
|
+
processSchema(innerType, ctx, params);
|
|
16518
17055
|
const seen = ctx.seen.get(schema);
|
|
16519
17056
|
seen.ref = innerType;
|
|
16520
17057
|
};
|
|
@@ -16538,6 +17075,7 @@ var allProcessors = {
|
|
|
16538
17075
|
file: fileProcessor,
|
|
16539
17076
|
success: successProcessor,
|
|
16540
17077
|
custom: customProcessor,
|
|
17078
|
+
properties: propertiesProcessor,
|
|
16541
17079
|
function: functionProcessor,
|
|
16542
17080
|
transform: transformProcessor,
|
|
16543
17081
|
map: mapProcessor,
|
|
@@ -16566,7 +17104,7 @@ function toJSONSchema(input2, params) {
|
|
|
16566
17104
|
const defs = {};
|
|
16567
17105
|
for (const entry of registry2._idmap.entries()) {
|
|
16568
17106
|
const [_, schema] = entry;
|
|
16569
|
-
|
|
17107
|
+
processSchema(schema, ctx2);
|
|
16570
17108
|
}
|
|
16571
17109
|
const schemas = {};
|
|
16572
17110
|
const external = {
|
|
@@ -16589,7 +17127,7 @@ function toJSONSchema(input2, params) {
|
|
|
16589
17127
|
return { schemas };
|
|
16590
17128
|
}
|
|
16591
17129
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
16592
|
-
|
|
17130
|
+
processSchema(input2, ctx);
|
|
16593
17131
|
extractDefs(ctx, input2);
|
|
16594
17132
|
return finalize(ctx, input2);
|
|
16595
17133
|
}
|
|
@@ -16648,7 +17186,7 @@ var JSONSchemaGenerator = class {
|
|
|
16648
17186
|
* This must be called before emit().
|
|
16649
17187
|
*/
|
|
16650
17188
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
16651
|
-
return
|
|
17189
|
+
return processSchema(schema, this.ctx, _params);
|
|
16652
17190
|
}
|
|
16653
17191
|
/**
|
|
16654
17192
|
* Emit the final JSON Schema after processing.
|
|
@@ -16705,12 +17243,14 @@ __export(schemas_exports2, {
|
|
|
16705
17243
|
ZodFile: () => ZodFile,
|
|
16706
17244
|
ZodFunction: () => ZodFunction,
|
|
16707
17245
|
ZodGUID: () => ZodGUID,
|
|
17246
|
+
ZodIBAN: () => ZodIBAN,
|
|
16708
17247
|
ZodIPv4: () => ZodIPv4,
|
|
16709
17248
|
ZodIPv6: () => ZodIPv6,
|
|
16710
17249
|
ZodISODate: () => ZodISODate,
|
|
16711
17250
|
ZodISODateTime: () => ZodISODateTime,
|
|
16712
17251
|
ZodISODuration: () => ZodISODuration,
|
|
16713
17252
|
ZodISOTime: () => ZodISOTime,
|
|
17253
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
16714
17254
|
ZodIntersection: () => ZodIntersection,
|
|
16715
17255
|
ZodJWT: () => ZodJWT,
|
|
16716
17256
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -16732,6 +17272,7 @@ __export(schemas_exports2, {
|
|
|
16732
17272
|
ZodPrefault: () => ZodPrefault,
|
|
16733
17273
|
ZodPreprocess: () => ZodPreprocess,
|
|
16734
17274
|
ZodPromise: () => ZodPromise,
|
|
17275
|
+
ZodProperties: () => ZodProperties,
|
|
16735
17276
|
ZodReadonly: () => ZodReadonly,
|
|
16736
17277
|
ZodRecord: () => ZodRecord,
|
|
16737
17278
|
ZodSet: () => ZodSet,
|
|
@@ -16787,6 +17328,7 @@ __export(schemas_exports2, {
|
|
|
16787
17328
|
hex: () => hex2,
|
|
16788
17329
|
hostname: () => hostname2,
|
|
16789
17330
|
httpUrl: () => httpUrl,
|
|
17331
|
+
iban: () => iban2,
|
|
16790
17332
|
instanceof: () => _instanceof,
|
|
16791
17333
|
int: () => int,
|
|
16792
17334
|
int32: () => int32,
|
|
@@ -16822,6 +17364,7 @@ __export(schemas_exports2, {
|
|
|
16822
17364
|
prefault: () => prefault,
|
|
16823
17365
|
preprocess: () => preprocess,
|
|
16824
17366
|
promise: () => promise,
|
|
17367
|
+
properties: () => properties,
|
|
16825
17368
|
readonly: () => readonly,
|
|
16826
17369
|
record: () => record,
|
|
16827
17370
|
refine: () => refine,
|
|
@@ -16875,7 +17418,6 @@ __export(checks_exports2, {
|
|
|
16875
17418
|
normalize: () => _normalize,
|
|
16876
17419
|
overwrite: () => _overwrite,
|
|
16877
17420
|
positive: () => _positive,
|
|
16878
|
-
properties: () => _properties,
|
|
16879
17421
|
property: () => _property,
|
|
16880
17422
|
regex: () => _regex,
|
|
16881
17423
|
size: () => _size,
|
|
@@ -17089,6 +17631,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
17089
17631
|
set spa(value) {
|
|
17090
17632
|
util_exports.own(this, "spa", value);
|
|
17091
17633
|
},
|
|
17634
|
+
validate(data, params) {
|
|
17635
|
+
return validate(this, data, params);
|
|
17636
|
+
},
|
|
17637
|
+
validateAsync(data, params) {
|
|
17638
|
+
return validateAsync(this, data, params);
|
|
17639
|
+
},
|
|
17092
17640
|
encode: function _encode2(data, params) {
|
|
17093
17641
|
return encode2(this, data, params, { callee: _encode2 });
|
|
17094
17642
|
},
|
|
@@ -17125,61 +17673,65 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
17125
17673
|
return this._zod.def;
|
|
17126
17674
|
}
|
|
17127
17675
|
});
|
|
17128
|
-
var _ZodString = /* @__PURE__ */ $constructor(
|
|
17129
|
-
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
inst.minLength = bag.minimum ?? null;
|
|
17135
|
-
inst.maxLength = bag.maximum ?? null;
|
|
17136
|
-
}, {
|
|
17137
|
-
regex(...args) {
|
|
17138
|
-
return this.check(_regex(...args));
|
|
17139
|
-
},
|
|
17140
|
-
includes(...args) {
|
|
17141
|
-
return this.check(_includes(...args));
|
|
17142
|
-
},
|
|
17143
|
-
startsWith(...args) {
|
|
17144
|
-
return this.check(_startsWith(...args));
|
|
17145
|
-
},
|
|
17146
|
-
endsWith(...args) {
|
|
17147
|
-
return this.check(_endsWith(...args));
|
|
17148
|
-
},
|
|
17149
|
-
min(...args) {
|
|
17150
|
-
return this.check(_minLength(...args));
|
|
17151
|
-
},
|
|
17152
|
-
max(...args) {
|
|
17153
|
-
return this.check(_maxLength(...args));
|
|
17154
|
-
},
|
|
17155
|
-
length(...args) {
|
|
17156
|
-
return this.check(_length(...args));
|
|
17157
|
-
},
|
|
17158
|
-
nonempty(...args) {
|
|
17159
|
-
return this.check(_minLength(1, ...args));
|
|
17160
|
-
},
|
|
17161
|
-
lowercase(params) {
|
|
17162
|
-
return this.check(_lowercase(params));
|
|
17163
|
-
},
|
|
17164
|
-
uppercase(params) {
|
|
17165
|
-
return this.check(_uppercase(params));
|
|
17676
|
+
var _ZodString = /* @__PURE__ */ $constructor(
|
|
17677
|
+
"_ZodString",
|
|
17678
|
+
(inst, def) => {
|
|
17679
|
+
$ZodString.init(inst, def);
|
|
17680
|
+
ZodType.init(inst, def);
|
|
17681
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
|
|
17166
17682
|
},
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17683
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17684
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
17685
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
17686
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
17687
|
+
}, {
|
|
17688
|
+
regex(...args) {
|
|
17689
|
+
return this.check(_regex(...args));
|
|
17690
|
+
},
|
|
17691
|
+
includes(...args) {
|
|
17692
|
+
return this.check(_includes(...args));
|
|
17693
|
+
},
|
|
17694
|
+
startsWith(...args) {
|
|
17695
|
+
return this.check(_startsWith(...args));
|
|
17696
|
+
},
|
|
17697
|
+
endsWith(...args) {
|
|
17698
|
+
return this.check(_endsWith(...args));
|
|
17699
|
+
},
|
|
17700
|
+
min(...args) {
|
|
17701
|
+
return this.check(_minLength(...args));
|
|
17702
|
+
},
|
|
17703
|
+
max(...args) {
|
|
17704
|
+
return this.check(_maxLength(...args));
|
|
17705
|
+
},
|
|
17706
|
+
length(...args) {
|
|
17707
|
+
return this.check(_length(...args));
|
|
17708
|
+
},
|
|
17709
|
+
nonempty(...args) {
|
|
17710
|
+
return this.check(_minLength(1, ...args));
|
|
17711
|
+
},
|
|
17712
|
+
lowercase(params) {
|
|
17713
|
+
return this.check(_lowercase(params));
|
|
17714
|
+
},
|
|
17715
|
+
uppercase(params) {
|
|
17716
|
+
return this.check(_uppercase(params));
|
|
17717
|
+
},
|
|
17718
|
+
trim() {
|
|
17719
|
+
return this.check(_trim());
|
|
17720
|
+
},
|
|
17721
|
+
normalize(...args) {
|
|
17722
|
+
return this.check(_normalize(...args));
|
|
17723
|
+
},
|
|
17724
|
+
toLowerCase() {
|
|
17725
|
+
return this.check(_toLowerCase());
|
|
17726
|
+
},
|
|
17727
|
+
toUpperCase() {
|
|
17728
|
+
return this.check(_toUpperCase());
|
|
17729
|
+
},
|
|
17730
|
+
slugify() {
|
|
17731
|
+
return this.check(_slugify());
|
|
17732
|
+
}
|
|
17733
|
+
})
|
|
17734
|
+
);
|
|
17183
17735
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
17184
17736
|
$ZodString.init(inst, def);
|
|
17185
17737
|
_ZodString.init(inst, def);
|
|
@@ -17442,6 +17994,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
17442
17994
|
function creditCard2(params) {
|
|
17443
17995
|
return _creditCard(ZodCreditCard, params);
|
|
17444
17996
|
}
|
|
17997
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
17998
|
+
$ZodIBAN.init(inst, def);
|
|
17999
|
+
ZodStringFormat.init(inst, def);
|
|
18000
|
+
});
|
|
18001
|
+
function iban2(params) {
|
|
18002
|
+
return _iban(ZodIBAN, params);
|
|
18003
|
+
}
|
|
17445
18004
|
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
17446
18005
|
$ZodJWT.init(inst, def);
|
|
17447
18006
|
ZodStringFormat.init(inst, def);
|
|
@@ -17470,63 +18029,76 @@ function hash(alg, params) {
|
|
|
17470
18029
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
17471
18030
|
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
17472
18031
|
}
|
|
17473
|
-
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
17481
|
-
inst.isFinite = true;
|
|
17482
|
-
inst.format = bag.format ?? null;
|
|
17483
|
-
}, {
|
|
17484
|
-
gt(value, params) {
|
|
17485
|
-
return this.check(_gt(value, params));
|
|
18032
|
+
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
18033
|
+
"ZodNumber",
|
|
18034
|
+
(inst, def) => {
|
|
18035
|
+
$ZodNumber.init(inst, def);
|
|
18036
|
+
ZodType.init(inst, def);
|
|
18037
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
18038
|
+
inst.isFinite = true;
|
|
17486
18039
|
},
|
|
17487
|
-
|
|
17488
|
-
|
|
17489
|
-
|
|
17490
|
-
|
|
17491
|
-
|
|
17492
|
-
|
|
17493
|
-
|
|
17494
|
-
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
},
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
|
|
17518
|
-
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
|
|
17523
|
-
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
|
|
18040
|
+
/* @__PURE__ */ util_exports.derived({
|
|
18041
|
+
minValue: (inst) => {
|
|
18042
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
18043
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
18044
|
+
},
|
|
18045
|
+
maxValue: (inst) => {
|
|
18046
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
18047
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
18048
|
+
},
|
|
18049
|
+
isInt: (inst) => {
|
|
18050
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
18051
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
18052
|
+
},
|
|
18053
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
18054
|
+
}, {
|
|
18055
|
+
gt(value, params) {
|
|
18056
|
+
return this.check(_gt(value, params));
|
|
18057
|
+
},
|
|
18058
|
+
gte(value, params) {
|
|
18059
|
+
return this.check(_gte(value, params));
|
|
18060
|
+
},
|
|
18061
|
+
min(value, params) {
|
|
18062
|
+
return this.check(_gte(value, params));
|
|
18063
|
+
},
|
|
18064
|
+
lt(value, params) {
|
|
18065
|
+
return this.check(_lt(value, params));
|
|
18066
|
+
},
|
|
18067
|
+
lte(value, params) {
|
|
18068
|
+
return this.check(_lte(value, params));
|
|
18069
|
+
},
|
|
18070
|
+
max(value, params) {
|
|
18071
|
+
return this.check(_lte(value, params));
|
|
18072
|
+
},
|
|
18073
|
+
int(params) {
|
|
18074
|
+
return this.check(int(params));
|
|
18075
|
+
},
|
|
18076
|
+
safe(params) {
|
|
18077
|
+
return this.check(int(params));
|
|
18078
|
+
},
|
|
18079
|
+
positive(params) {
|
|
18080
|
+
return this.check(_gt(0, params));
|
|
18081
|
+
},
|
|
18082
|
+
nonnegative(params) {
|
|
18083
|
+
return this.check(_gte(0, params));
|
|
18084
|
+
},
|
|
18085
|
+
negative(params) {
|
|
18086
|
+
return this.check(_lt(0, params));
|
|
18087
|
+
},
|
|
18088
|
+
nonpositive(params) {
|
|
18089
|
+
return this.check(_lte(0, params));
|
|
18090
|
+
},
|
|
18091
|
+
multipleOf(value, params) {
|
|
18092
|
+
return this.check(_multipleOf(value, params));
|
|
18093
|
+
},
|
|
18094
|
+
step(value, params) {
|
|
18095
|
+
return this.check(_multipleOf(value, params));
|
|
18096
|
+
},
|
|
18097
|
+
finite() {
|
|
18098
|
+
return this;
|
|
18099
|
+
}
|
|
18100
|
+
})
|
|
18101
|
+
);
|
|
17530
18102
|
function number2(params) {
|
|
17531
18103
|
return _number(ZodNumber, params);
|
|
17532
18104
|
}
|
|
@@ -17557,49 +18129,53 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
17557
18129
|
function boolean2(params) {
|
|
17558
18130
|
return _boolean(ZodBoolean, params);
|
|
17559
18131
|
}
|
|
17560
|
-
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
17561
|
-
|
|
17562
|
-
|
|
17563
|
-
|
|
17564
|
-
|
|
17565
|
-
|
|
17566
|
-
inst.maxValue = bag.maximum ?? null;
|
|
17567
|
-
inst.format = bag.format ?? null;
|
|
17568
|
-
}, {
|
|
17569
|
-
gte(value, params) {
|
|
17570
|
-
return this.check(_gte(value, params));
|
|
17571
|
-
},
|
|
17572
|
-
min(value, params) {
|
|
17573
|
-
return this.check(_gte(value, params));
|
|
17574
|
-
},
|
|
17575
|
-
gt(value, params) {
|
|
17576
|
-
return this.check(_gt(value, params));
|
|
17577
|
-
},
|
|
17578
|
-
lt(value, params) {
|
|
17579
|
-
return this.check(_lt(value, params));
|
|
17580
|
-
},
|
|
17581
|
-
lte(value, params) {
|
|
17582
|
-
return this.check(_lte(value, params));
|
|
18132
|
+
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
18133
|
+
"ZodBigInt",
|
|
18134
|
+
(inst, def) => {
|
|
18135
|
+
$ZodBigInt.init(inst, def);
|
|
18136
|
+
ZodType.init(inst, def);
|
|
18137
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
17583
18138
|
},
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17594
|
-
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
|
|
17602
|
-
|
|
18139
|
+
/* @__PURE__ */ util_exports.derived({
|
|
18140
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
18141
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
18142
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
18143
|
+
}, {
|
|
18144
|
+
gte(value, params) {
|
|
18145
|
+
return this.check(_gte(value, params));
|
|
18146
|
+
},
|
|
18147
|
+
min(value, params) {
|
|
18148
|
+
return this.check(_gte(value, params));
|
|
18149
|
+
},
|
|
18150
|
+
gt(value, params) {
|
|
18151
|
+
return this.check(_gt(value, params));
|
|
18152
|
+
},
|
|
18153
|
+
lt(value, params) {
|
|
18154
|
+
return this.check(_lt(value, params));
|
|
18155
|
+
},
|
|
18156
|
+
lte(value, params) {
|
|
18157
|
+
return this.check(_lte(value, params));
|
|
18158
|
+
},
|
|
18159
|
+
max(value, params) {
|
|
18160
|
+
return this.check(_lte(value, params));
|
|
18161
|
+
},
|
|
18162
|
+
positive(params) {
|
|
18163
|
+
return this.check(_gt(BigInt(0), params));
|
|
18164
|
+
},
|
|
18165
|
+
negative(params) {
|
|
18166
|
+
return this.check(_lt(BigInt(0), params));
|
|
18167
|
+
},
|
|
18168
|
+
nonpositive(params) {
|
|
18169
|
+
return this.check(_lte(BigInt(0), params));
|
|
18170
|
+
},
|
|
18171
|
+
nonnegative(params) {
|
|
18172
|
+
return this.check(_gte(BigInt(0), params));
|
|
18173
|
+
},
|
|
18174
|
+
multipleOf(value, params) {
|
|
18175
|
+
return this.check(_multipleOf(value, params));
|
|
18176
|
+
}
|
|
18177
|
+
})
|
|
18178
|
+
);
|
|
17603
18179
|
function bigint2(params) {
|
|
17604
18180
|
return _bigint(ZodBigInt, params);
|
|
17605
18181
|
}
|
|
@@ -17669,16 +18245,26 @@ var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
|
17669
18245
|
function _void2(params) {
|
|
17670
18246
|
return _void(ZodVoid, params);
|
|
17671
18247
|
}
|
|
17672
|
-
var ZodDate = /* @__PURE__ */ $constructor(
|
|
17673
|
-
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
18248
|
+
var ZodDate = /* @__PURE__ */ $constructor(
|
|
18249
|
+
"ZodDate",
|
|
18250
|
+
(inst, def) => {
|
|
18251
|
+
$ZodDate.init(inst, def);
|
|
18252
|
+
ZodType.init(inst, def);
|
|
18253
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
18254
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
18255
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
18256
|
+
},
|
|
18257
|
+
/* @__PURE__ */ util_exports.derived({
|
|
18258
|
+
minDate: (inst) => {
|
|
18259
|
+
const { minimum } = aggregateChecks(inst);
|
|
18260
|
+
return minimum ? new Date(minimum) : null;
|
|
18261
|
+
},
|
|
18262
|
+
maxDate: (inst) => {
|
|
18263
|
+
const { maximum } = aggregateChecks(inst);
|
|
18264
|
+
return maximum ? new Date(maximum) : null;
|
|
18265
|
+
}
|
|
18266
|
+
}, {})
|
|
18267
|
+
);
|
|
17682
18268
|
function date2(params) {
|
|
17683
18269
|
return _date(ZodDate, params);
|
|
17684
18270
|
}
|
|
@@ -17723,19 +18309,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
17723
18309
|
return _enum2(Object.keys(this._zod.def.shape));
|
|
17724
18310
|
},
|
|
17725
18311
|
catchall(catchall) {
|
|
17726
|
-
return this.clone(
|
|
18312
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
|
|
17727
18313
|
},
|
|
17728
18314
|
passthrough() {
|
|
17729
|
-
return this.clone(
|
|
18315
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
17730
18316
|
},
|
|
17731
18317
|
loose() {
|
|
17732
|
-
return this.clone(
|
|
18318
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
17733
18319
|
},
|
|
17734
18320
|
strict() {
|
|
17735
|
-
return this.clone(
|
|
18321
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
|
|
17736
18322
|
},
|
|
17737
18323
|
strip() {
|
|
17738
|
-
return this.clone(
|
|
18324
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
17739
18325
|
},
|
|
17740
18326
|
extend(incoming) {
|
|
17741
18327
|
return util_exports.extend(this, incoming);
|
|
@@ -17954,7 +18540,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
17954
18540
|
ZodType.init(inst, def);
|
|
17955
18541
|
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
17956
18542
|
inst.enum = def.entries;
|
|
17957
|
-
inst.options =
|
|
18543
|
+
inst.options = [...inst._zod.values];
|
|
17958
18544
|
const keys = new Set(Object.keys(def.entries));
|
|
17959
18545
|
inst.extract = (values, params) => {
|
|
17960
18546
|
const newEntries = {};
|
|
@@ -18298,6 +18884,14 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
|
18298
18884
|
ZodType.init(inst, def);
|
|
18299
18885
|
inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
|
|
18300
18886
|
});
|
|
18887
|
+
var ZodProperties = /* @__PURE__ */ $constructor("ZodProperties", (inst, def) => {
|
|
18888
|
+
_ensureDefaultMemoizer();
|
|
18889
|
+
$ZodProperties.init(inst, def);
|
|
18890
|
+
ZodType.init(inst, def);
|
|
18891
|
+
});
|
|
18892
|
+
function properties(shape, params) {
|
|
18893
|
+
return _properties(ZodProperties, shape, params);
|
|
18894
|
+
}
|
|
18301
18895
|
function check(fn) {
|
|
18302
18896
|
const ch = new $ZodCheck({
|
|
18303
18897
|
check: "custom"
|
|
@@ -18317,8 +18911,15 @@ function superRefine(fn, params) {
|
|
|
18317
18911
|
}
|
|
18318
18912
|
var describe2 = describe;
|
|
18319
18913
|
var meta2 = meta;
|
|
18914
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
18915
|
+
ZodCustom.init(inst, def);
|
|
18916
|
+
}, {
|
|
18917
|
+
properties(shape, params) {
|
|
18918
|
+
return this.check(properties(shape, params));
|
|
18919
|
+
}
|
|
18920
|
+
});
|
|
18320
18921
|
function _instanceof(cls, params = {}) {
|
|
18321
|
-
const inst = new
|
|
18922
|
+
const inst = new ZodInstanceOf({
|
|
18322
18923
|
type: "custom",
|
|
18323
18924
|
check: "custom",
|
|
18324
18925
|
fn: (data) => data instanceof cls,
|
|
@@ -18523,27 +19124,188 @@ function resolveRef(ref, ctx) {
|
|
|
18523
19124
|
}
|
|
18524
19125
|
throw new Error(`Reference not found: ${ref}`);
|
|
18525
19126
|
}
|
|
18526
|
-
function
|
|
19127
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
18527
19128
|
const guard = z.transform((value) => value).check((payload) => {
|
|
18528
19129
|
const value = payload.value;
|
|
18529
19130
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
18530
19131
|
return;
|
|
18531
|
-
|
|
18532
|
-
|
|
18533
|
-
if (result.success)
|
|
18534
|
-
continue;
|
|
19132
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
19133
|
+
if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
|
|
18535
19134
|
payload.issues.push({
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
|
|
18540
|
-
|
|
19135
|
+
origin: "object",
|
|
19136
|
+
code: "too_small",
|
|
19137
|
+
minimum: guards.minProperties,
|
|
19138
|
+
inclusive: true,
|
|
19139
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
19140
|
+
input: value,
|
|
19141
|
+
inst: objectSchema,
|
|
18541
19142
|
continue: true
|
|
18542
19143
|
});
|
|
18543
19144
|
}
|
|
19145
|
+
if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
|
|
19146
|
+
payload.issues.push({
|
|
19147
|
+
origin: "object",
|
|
19148
|
+
code: "too_big",
|
|
19149
|
+
maximum: guards.maxProperties,
|
|
19150
|
+
inclusive: true,
|
|
19151
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
19152
|
+
input: value,
|
|
19153
|
+
inst: objectSchema,
|
|
19154
|
+
continue: true
|
|
19155
|
+
});
|
|
19156
|
+
}
|
|
19157
|
+
if (guards.keySchema) {
|
|
19158
|
+
for (const key of keys) {
|
|
19159
|
+
const result = guards.keySchema.safeParse(key);
|
|
19160
|
+
if (result.success)
|
|
19161
|
+
continue;
|
|
19162
|
+
payload.issues.push({
|
|
19163
|
+
code: "invalid_key",
|
|
19164
|
+
origin: "record",
|
|
19165
|
+
issues: result.error.issues,
|
|
19166
|
+
input: key,
|
|
19167
|
+
path: [key],
|
|
19168
|
+
continue: true
|
|
19169
|
+
});
|
|
19170
|
+
}
|
|
19171
|
+
}
|
|
18544
19172
|
});
|
|
18545
19173
|
return guard.pipe(objectSchema);
|
|
18546
19174
|
}
|
|
19175
|
+
function canonicalKey(value, seen) {
|
|
19176
|
+
if (value === null)
|
|
19177
|
+
return "z";
|
|
19178
|
+
const type = typeof value;
|
|
19179
|
+
if (type !== "object") {
|
|
19180
|
+
if (type === "number" && Number.isNaN(value))
|
|
19181
|
+
return null;
|
|
19182
|
+
const raw = String(value);
|
|
19183
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
19184
|
+
}
|
|
19185
|
+
if (seen.has(value))
|
|
19186
|
+
return null;
|
|
19187
|
+
seen.add(value);
|
|
19188
|
+
try {
|
|
19189
|
+
if (Array.isArray(value)) {
|
|
19190
|
+
const parts2 = [];
|
|
19191
|
+
for (const item of value) {
|
|
19192
|
+
const key = canonicalKey(item, seen);
|
|
19193
|
+
if (key === null)
|
|
19194
|
+
return null;
|
|
19195
|
+
parts2.push(key);
|
|
19196
|
+
}
|
|
19197
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
19198
|
+
}
|
|
19199
|
+
const keys = Object.keys(value).sort();
|
|
19200
|
+
const parts = [];
|
|
19201
|
+
for (const k of keys) {
|
|
19202
|
+
const key = canonicalKey(value[k], seen);
|
|
19203
|
+
if (key === null)
|
|
19204
|
+
return null;
|
|
19205
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
19206
|
+
}
|
|
19207
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
19208
|
+
} finally {
|
|
19209
|
+
seen.delete(value);
|
|
19210
|
+
}
|
|
19211
|
+
}
|
|
19212
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
19213
|
+
"items",
|
|
19214
|
+
"prefixItems",
|
|
19215
|
+
"additionalItems",
|
|
19216
|
+
"additionalProperties",
|
|
19217
|
+
"contains",
|
|
19218
|
+
"propertyNames",
|
|
19219
|
+
"not",
|
|
19220
|
+
"if",
|
|
19221
|
+
"then",
|
|
19222
|
+
"else",
|
|
19223
|
+
"allOf",
|
|
19224
|
+
"anyOf",
|
|
19225
|
+
"oneOf",
|
|
19226
|
+
"unevaluatedItems",
|
|
19227
|
+
"unevaluatedProperties",
|
|
19228
|
+
"contentSchema"
|
|
19229
|
+
]);
|
|
19230
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
19231
|
+
"properties",
|
|
19232
|
+
"patternProperties",
|
|
19233
|
+
"dependentSchemas",
|
|
19234
|
+
"dependencies",
|
|
19235
|
+
"$defs",
|
|
19236
|
+
"definitions"
|
|
19237
|
+
]);
|
|
19238
|
+
function containsRef(value) {
|
|
19239
|
+
if (typeof value !== "object" || value === null)
|
|
19240
|
+
return false;
|
|
19241
|
+
if (Array.isArray(value))
|
|
19242
|
+
return value.some(containsRef);
|
|
19243
|
+
if (typeof value.$ref === "string")
|
|
19244
|
+
return true;
|
|
19245
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
19246
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
19247
|
+
return containsRef(sub);
|
|
19248
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
19249
|
+
return false;
|
|
19250
|
+
return Object.values(sub).some(containsRef);
|
|
19251
|
+
});
|
|
19252
|
+
}
|
|
19253
|
+
function plural(n) {
|
|
19254
|
+
return n === 1 ? "element" : "elements";
|
|
19255
|
+
}
|
|
19256
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
19257
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
19258
|
+
const items = payload.value;
|
|
19259
|
+
if (!Array.isArray(items))
|
|
19260
|
+
return;
|
|
19261
|
+
if (guards.uniqueItems === true) {
|
|
19262
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
19263
|
+
for (let i = 0; i < items.length; i++) {
|
|
19264
|
+
const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
19265
|
+
if (key === null)
|
|
19266
|
+
continue;
|
|
19267
|
+
const first = firstSeen.get(key);
|
|
19268
|
+
if (first === void 0) {
|
|
19269
|
+
firstSeen.set(key, i);
|
|
19270
|
+
continue;
|
|
19271
|
+
}
|
|
19272
|
+
payload.issues.push({
|
|
19273
|
+
code: "custom",
|
|
19274
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
19275
|
+
input: items,
|
|
19276
|
+
path: [i],
|
|
19277
|
+
continue: true
|
|
19278
|
+
});
|
|
19279
|
+
}
|
|
19280
|
+
}
|
|
19281
|
+
if (guards.containsSchema) {
|
|
19282
|
+
const minContains = guards.minContains ?? 1;
|
|
19283
|
+
const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
19284
|
+
let matches = 0;
|
|
19285
|
+
for (const item of items) {
|
|
19286
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
19287
|
+
break;
|
|
19288
|
+
}
|
|
19289
|
+
if (matches < minContains) {
|
|
19290
|
+
payload.issues.push({
|
|
19291
|
+
code: "custom",
|
|
19292
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
19293
|
+
input: items,
|
|
19294
|
+
continue: true
|
|
19295
|
+
});
|
|
19296
|
+
}
|
|
19297
|
+
if (guards.maxContains !== void 0 && matches > guards.maxContains) {
|
|
19298
|
+
payload.issues.push({
|
|
19299
|
+
code: "custom",
|
|
19300
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
19301
|
+
input: items,
|
|
19302
|
+
continue: true
|
|
19303
|
+
});
|
|
19304
|
+
}
|
|
19305
|
+
}
|
|
19306
|
+
});
|
|
19307
|
+
return guard.pipe(arraySchema);
|
|
19308
|
+
}
|
|
18547
19309
|
function getTupleRest(restSchema, ctx) {
|
|
18548
19310
|
if (restSchema === false) {
|
|
18549
19311
|
return void 0;
|
|
@@ -18673,6 +19435,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18673
19435
|
stringSchema = stringSchema.check(z.e164());
|
|
18674
19436
|
} else if (format === "credit_card") {
|
|
18675
19437
|
stringSchema = stringSchema.check(z.creditCard());
|
|
19438
|
+
} else if (format === "iban") {
|
|
19439
|
+
stringSchema = stringSchema.check(z.iban());
|
|
18676
19440
|
} else if (format === "jwt") {
|
|
18677
19441
|
stringSchema = stringSchema.check(z.jwt());
|
|
18678
19442
|
} else if (format === "emoji") {
|
|
@@ -18738,10 +19502,10 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18738
19502
|
}
|
|
18739
19503
|
case "object": {
|
|
18740
19504
|
const shape = {};
|
|
18741
|
-
const
|
|
19505
|
+
const properties2 = schema.properties || {};
|
|
18742
19506
|
const requiredSet = new Set(schema.required || []);
|
|
18743
19507
|
const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : void 0;
|
|
18744
|
-
for (const [key, propSchema] of Object.entries(
|
|
19508
|
+
for (const [key, propSchema] of Object.entries(properties2)) {
|
|
18745
19509
|
const propZodSchema = convertSchema(propSchema, ctx);
|
|
18746
19510
|
assignProp(shape, key, requiredSet.has(key) ? propZodSchema : propZodSchema.optional());
|
|
18747
19511
|
}
|
|
@@ -18805,9 +19569,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18805
19569
|
zodSchema = objectSchema.passthrough();
|
|
18806
19570
|
}
|
|
18807
19571
|
}
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
|
|
19572
|
+
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
19573
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
|
|
19574
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
|
|
19575
|
+
if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
|
|
19576
|
+
let keySchema;
|
|
19577
|
+
if (hasKeyGuard) {
|
|
19578
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
19579
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
19580
|
+
}
|
|
19581
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
18811
19582
|
}
|
|
18812
19583
|
break;
|
|
18813
19584
|
}
|
|
@@ -18853,6 +19624,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18853
19624
|
} else {
|
|
18854
19625
|
zodSchema = z.array(z.any());
|
|
18855
19626
|
}
|
|
19627
|
+
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
19628
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
19629
|
+
uniqueItems: schema.uniqueItems === true,
|
|
19630
|
+
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
19631
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
19632
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
|
|
19633
|
+
});
|
|
19634
|
+
}
|
|
18856
19635
|
break;
|
|
18857
19636
|
}
|
|
18858
19637
|
default:
|
|
@@ -18910,8 +19689,23 @@ function convertSchema(schema, ctx) {
|
|
|
18910
19689
|
extraMeta[key] = schema[key];
|
|
18911
19690
|
}
|
|
18912
19691
|
}
|
|
18913
|
-
if (schema.
|
|
18914
|
-
|
|
19692
|
+
if (schema.type === "object" && schema.$ref === void 0) {
|
|
19693
|
+
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
19694
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
19695
|
+
}
|
|
19696
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
19697
|
+
if (schema[key] !== void 0)
|
|
19698
|
+
extraMeta[key] = schema[key];
|
|
19699
|
+
}
|
|
19700
|
+
}
|
|
19701
|
+
if (schema.type === "array" && schema.$ref === void 0) {
|
|
19702
|
+
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
19703
|
+
extraMeta.contains = schema.contains;
|
|
19704
|
+
}
|
|
19705
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
19706
|
+
if (schema[key] !== void 0)
|
|
19707
|
+
extraMeta[key] = schema[key];
|
|
19708
|
+
}
|
|
18915
19709
|
}
|
|
18916
19710
|
for (const key of Object.keys(schema)) {
|
|
18917
19711
|
if (!RECOGNIZED_KEYS.has(key)) {
|
|
@@ -19072,6 +19866,18 @@ function visit(schema, fnOrHandlers) {
|
|
|
19072
19866
|
const { _cachedInner, ...rest } = def;
|
|
19073
19867
|
return clone(s, { ...rest, getter: () => run(original()) });
|
|
19074
19868
|
}
|
|
19869
|
+
case "properties": {
|
|
19870
|
+
const oldShape = def.shape;
|
|
19871
|
+
let changed = false;
|
|
19872
|
+
const newShape = {};
|
|
19873
|
+
for (const k of Reflect.ownKeys(oldShape)) {
|
|
19874
|
+
const mapped = run(oldShape[k]);
|
|
19875
|
+
if (mapped !== oldShape[k])
|
|
19876
|
+
changed = true;
|
|
19877
|
+
newShape[k] = mapped;
|
|
19878
|
+
}
|
|
19879
|
+
return changed ? clone(s, { ...def, shape: newShape }) : s;
|
|
19880
|
+
}
|
|
19075
19881
|
// A leaf by choice: `parts` are regex fragments, not data positions.
|
|
19076
19882
|
case "template_literal":
|
|
19077
19883
|
// Leaves.
|
|
@@ -19271,6 +20077,7 @@ var AgentSkillInputSchema = external_exports.object({
|
|
|
19271
20077
|
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
19272
20078
|
});
|
|
19273
20079
|
var CreateAgentRequestSchema = external_exports.object({
|
|
20080
|
+
auto_join_general: external_exports.boolean().optional(),
|
|
19274
20081
|
name: external_exports.string(),
|
|
19275
20082
|
type: AgentTypeSchema.optional(),
|
|
19276
20083
|
persona: external_exports.string().optional(),
|
|
@@ -20591,6 +21398,7 @@ var FleetNodeSpawnMessageSchema = external_exports.object({
|
|
|
20591
21398
|
var FleetAgentRegisterMessageSchema = external_exports.object({
|
|
20592
21399
|
...FleetRequestEnvelopeFields,
|
|
20593
21400
|
type: external_exports.literal("agent.register"),
|
|
21401
|
+
auto_join_general: external_exports.boolean().optional(),
|
|
20594
21402
|
name: external_exports.string(),
|
|
20595
21403
|
invocation_id: external_exports.string().optional(),
|
|
20596
21404
|
session_ref: external_exports.string().optional(),
|
|
@@ -22417,6 +23225,62 @@ function resolveWorkspaceLookupOptions(options) {
|
|
|
22417
23225
|
}
|
|
22418
23226
|
return options ?? {};
|
|
22419
23227
|
}
|
|
23228
|
+
var MIN_BOOTSTRAP_IDEMPOTENCY_KEY_LENGTH = 32;
|
|
23229
|
+
var HOSTED_GATEWAY_HOSTNAME = "cast.agentrelay.com";
|
|
23230
|
+
var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
|
|
23231
|
+
function validateAnonymousKeyedBootstrapDestination(value) {
|
|
23232
|
+
let baseUrl;
|
|
23233
|
+
try {
|
|
23234
|
+
baseUrl = new URL(value);
|
|
23235
|
+
} catch {
|
|
23236
|
+
throw new RelayError("transport_error", "Anonymous keyed workspace bootstrap requires a valid baseUrl", {
|
|
23237
|
+
statusCode: 400,
|
|
23238
|
+
retryable: false,
|
|
23239
|
+
rawCode: "workspace_create_bootstrap_base_url_required"
|
|
23240
|
+
});
|
|
23241
|
+
}
|
|
23242
|
+
const hostname3 = baseUrl.hostname.replace(/^\[|\]$/g, "").replace(/\.$/, "").toLowerCase();
|
|
23243
|
+
const isLoopbackHttp = baseUrl.protocol === "http:" && LOOPBACK_HOSTNAMES.has(hostname3);
|
|
23244
|
+
if (baseUrl.protocol !== "https:" && !isLoopbackHttp) {
|
|
23245
|
+
throw new RelayError("transport_error", "Anonymous keyed workspace bootstrap requires an HTTPS self-hosted baseUrl (or loopback HTTP for local development)", {
|
|
23246
|
+
statusCode: 400,
|
|
23247
|
+
retryable: false,
|
|
23248
|
+
rawCode: "workspace_create_bootstrap_base_url_required"
|
|
23249
|
+
});
|
|
23250
|
+
}
|
|
23251
|
+
return baseUrl;
|
|
23252
|
+
}
|
|
23253
|
+
function validateWorkspaceBootstrapOptions(options) {
|
|
23254
|
+
if (!options.apiKey && options.idempotencyKey !== void 0 && options.idempotencyKey.length < MIN_BOOTSTRAP_IDEMPOTENCY_KEY_LENGTH) {
|
|
23255
|
+
throw new RelayError("transport_error", `Anonymous Idempotency-Key must be at least ${MIN_BOOTSTRAP_IDEMPOTENCY_KEY_LENGTH} characters`, {
|
|
23256
|
+
statusCode: 400,
|
|
23257
|
+
retryable: false,
|
|
23258
|
+
rawCode: "workspace_create_idempotency_key_too_weak"
|
|
23259
|
+
});
|
|
23260
|
+
}
|
|
23261
|
+
const anonymousKeyedBootstrap = !options.apiKey && options.idempotencyKey !== void 0;
|
|
23262
|
+
if (anonymousKeyedBootstrap) {
|
|
23263
|
+
validateAnonymousKeyedBootstrapDestination(options.baseUrl ?? "https://cast.agentrelay.com");
|
|
23264
|
+
}
|
|
23265
|
+
if (anonymousKeyedBootstrap && options.bootstrapSecret !== void 0) {
|
|
23266
|
+
if (!options.baseUrl) {
|
|
23267
|
+
throw new RelayError("transport_error", "Anonymous keyed workspace bootstrap with a bootstrapSecret requires an explicit self-hosted baseUrl", {
|
|
23268
|
+
statusCode: 400,
|
|
23269
|
+
retryable: false,
|
|
23270
|
+
rawCode: "workspace_create_bootstrap_base_url_required"
|
|
23271
|
+
});
|
|
23272
|
+
}
|
|
23273
|
+
const baseUrl = validateAnonymousKeyedBootstrapDestination(options.baseUrl);
|
|
23274
|
+
const hostname3 = baseUrl.hostname.replace(/\.$/, "").toLowerCase();
|
|
23275
|
+
if (hostname3 === HOSTED_GATEWAY_HOSTNAME) {
|
|
23276
|
+
throw new RelayError("transport_error", "Anonymous keyed workspace bootstrap cannot send a bootstrapSecret to the hosted gateway", {
|
|
23277
|
+
statusCode: 400,
|
|
23278
|
+
retryable: false,
|
|
23279
|
+
rawCode: "workspace_create_bootstrap_base_url_required"
|
|
23280
|
+
});
|
|
23281
|
+
}
|
|
23282
|
+
}
|
|
23283
|
+
}
|
|
22420
23284
|
var RelayCast = class _RelayCast {
|
|
22421
23285
|
client;
|
|
22422
23286
|
ws;
|
|
@@ -22487,16 +23351,21 @@ var RelayCast = class _RelayCast {
|
|
|
22487
23351
|
}
|
|
22488
23352
|
static async createWorkspaceWithStatus(name, options) {
|
|
22489
23353
|
const resolved = resolveWorkspaceBootstrapOptions(options);
|
|
23354
|
+
validateWorkspaceBootstrapOptions(resolved);
|
|
22490
23355
|
const { apiKey, baseUrl } = resolved;
|
|
22491
23356
|
const requestBaseUrl = baseUrl ?? "https://cast.agentrelay.com";
|
|
22492
23357
|
const identity = resolveAgentRelayIdentity(resolved);
|
|
23358
|
+
const anonymousKeyedBootstrap = !apiKey && resolved.idempotencyKey !== void 0;
|
|
23359
|
+
const sendsBootstrapSecret = anonymousKeyedBootstrap && resolved.bootstrapSecret !== void 0;
|
|
22493
23360
|
const url2 = new URL("/v1/workspaces", requestBaseUrl);
|
|
22494
23361
|
const res = await fetch(url2.toString(), {
|
|
22495
23362
|
method: "POST",
|
|
23363
|
+
...anonymousKeyedBootstrap ? { redirect: "manual" } : {},
|
|
22496
23364
|
headers: {
|
|
22497
23365
|
"Content-Type": "application/json",
|
|
22498
23366
|
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {},
|
|
22499
23367
|
...resolved.idempotencyKey !== void 0 ? { "Idempotency-Key": resolved.idempotencyKey } : {},
|
|
23368
|
+
...sendsBootstrapSecret ? { "X-Workspace-Bootstrap-Secret": resolved.bootstrapSecret } : {},
|
|
22500
23369
|
"X-SDK-Version": SDK_VERSION,
|
|
22501
23370
|
"X-Relaycast-Origin-Client": SDK_ORIGIN.client,
|
|
22502
23371
|
"X-Relaycast-Origin-Version": SDK_ORIGIN.version,
|
|
@@ -22508,6 +23377,9 @@ var RelayCast = class _RelayCast {
|
|
|
22508
23377
|
provenance: toWorkspaceProvenanceInput(resolved.provenance)
|
|
22509
23378
|
})
|
|
22510
23379
|
});
|
|
23380
|
+
if (anonymousKeyedBootstrap && (res.type === "opaqueredirect" || res.status >= 300 && res.status < 400)) {
|
|
23381
|
+
throw new RelayError("transport_error", "Refusing to follow an anonymous bootstrap redirect", { statusCode: res.status, retryable: false });
|
|
23382
|
+
}
|
|
22511
23383
|
let parsed;
|
|
22512
23384
|
try {
|
|
22513
23385
|
parsed = await res.json();
|
|
@@ -22749,11 +23621,11 @@ var RelayCast = class _RelayCast {
|
|
|
22749
23621
|
query.after = opts.after;
|
|
22750
23622
|
try {
|
|
22751
23623
|
return await this.client.get(`/v1/sessions/${encodeURIComponent(sessionRef)}/messages`, query, { schema: SessionMessagesResultSchema });
|
|
22752
|
-
} catch (
|
|
23624
|
+
} catch (error62) {
|
|
22753
23625
|
return {
|
|
22754
23626
|
sessionRef,
|
|
22755
23627
|
availability: "unknown",
|
|
22756
|
-
reason:
|
|
23628
|
+
reason: error62 instanceof ZodError ? "response_invalid" : "query_failed",
|
|
22757
23629
|
retention: {
|
|
22758
23630
|
policy: "unknown",
|
|
22759
23631
|
messageTtlDays: null,
|
|
@@ -23041,8 +23913,8 @@ function validateObject(value, schema, path5, state) {
|
|
|
23041
23913
|
addIssue(state, appendPath(path5, key), "required property is missing");
|
|
23042
23914
|
}
|
|
23043
23915
|
}
|
|
23044
|
-
const
|
|
23045
|
-
for (const [key, childSchema] of Object.entries(
|
|
23916
|
+
const properties2 = schema.properties ?? {};
|
|
23917
|
+
for (const [key, childSchema] of Object.entries(properties2)) {
|
|
23046
23918
|
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
23047
23919
|
validateAgainstSchema(value[key], childSchema, appendPath(path5, key), state);
|
|
23048
23920
|
}
|
|
@@ -23052,7 +23924,7 @@ function validateObject(value, schema, path5, state) {
|
|
|
23052
23924
|
return;
|
|
23053
23925
|
}
|
|
23054
23926
|
for (const key of Object.keys(value)) {
|
|
23055
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
23927
|
+
if (Object.prototype.hasOwnProperty.call(properties2, key)) {
|
|
23056
23928
|
continue;
|
|
23057
23929
|
}
|
|
23058
23930
|
if (additional === false) {
|
|
@@ -23374,8 +24246,8 @@ var InMemoryAgentRelayActions = class {
|
|
|
23374
24246
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
23375
24247
|
});
|
|
23376
24248
|
return { action: name, ok: true, output: outputValidation.value };
|
|
23377
|
-
} catch (
|
|
23378
|
-
const message =
|
|
24249
|
+
} catch (error62) {
|
|
24250
|
+
const message = error62 instanceof Error ? error62.message : String(error62);
|
|
23379
24251
|
await context.emit?.({
|
|
23380
24252
|
type: "action.failed",
|
|
23381
24253
|
action: name,
|
|
@@ -23471,8 +24343,8 @@ function validateActionSchema(input2, schema) {
|
|
|
23471
24343
|
function isZodLikeSchema(schema) {
|
|
23472
24344
|
return Boolean(schema && typeof schema === "object" && !Array.isArray(schema) && typeof schema.safeParse === "function");
|
|
23473
24345
|
}
|
|
23474
|
-
function zodIssues(
|
|
23475
|
-
const issues =
|
|
24346
|
+
function zodIssues(error62) {
|
|
24347
|
+
const issues = error62.issues ?? [];
|
|
23476
24348
|
if (issues.length === 0) {
|
|
23477
24349
|
return [{ path: "$", message: "invalid value" }];
|
|
23478
24350
|
}
|
|
@@ -24202,23 +25074,23 @@ function createEventFanIn(fallback, options = {}) {
|
|
|
24202
25074
|
let fallbackForwarding;
|
|
24203
25075
|
let fallbackConnected = false;
|
|
24204
25076
|
let noSourceTimer;
|
|
24205
|
-
const report = (
|
|
25077
|
+
const report = (error62) => {
|
|
24206
25078
|
if (options.onError) {
|
|
24207
25079
|
try {
|
|
24208
|
-
options.onError(
|
|
25080
|
+
options.onError(error62);
|
|
24209
25081
|
} catch {
|
|
24210
25082
|
}
|
|
24211
25083
|
return;
|
|
24212
25084
|
}
|
|
24213
|
-
console.warn("[agent-relay] event stream:",
|
|
25085
|
+
console.warn("[agent-relay] event stream:", error62);
|
|
24214
25086
|
};
|
|
24215
25087
|
const emitLocal = (event) => {
|
|
24216
25088
|
for (const key of [event.type, "any"]) {
|
|
24217
25089
|
for (const handler of handlers.get(key) ?? []) {
|
|
24218
25090
|
try {
|
|
24219
25091
|
void Promise.resolve(handler(event)).catch(report);
|
|
24220
|
-
} catch (
|
|
24221
|
-
report(
|
|
25092
|
+
} catch (error62) {
|
|
25093
|
+
report(error62);
|
|
24222
25094
|
}
|
|
24223
25095
|
}
|
|
24224
25096
|
}
|
|
@@ -24274,15 +25146,15 @@ function createEventFanIn(fallback, options = {}) {
|
|
|
24274
25146
|
if (typeof source.connect === "function") {
|
|
24275
25147
|
try {
|
|
24276
25148
|
source.connect();
|
|
24277
|
-
} catch (
|
|
24278
|
-
report(
|
|
25149
|
+
} catch (error62) {
|
|
25150
|
+
report(error62);
|
|
24279
25151
|
}
|
|
24280
25152
|
}
|
|
24281
25153
|
if (desiredChannels.size > 0 && typeof source.subscribe === "function") {
|
|
24282
25154
|
try {
|
|
24283
25155
|
source.subscribe([...desiredChannels]);
|
|
24284
|
-
} catch (
|
|
24285
|
-
report(
|
|
25156
|
+
} catch (error62) {
|
|
25157
|
+
report(error62);
|
|
24286
25158
|
}
|
|
24287
25159
|
}
|
|
24288
25160
|
};
|
|
@@ -24294,8 +25166,8 @@ function createEventFanIn(fallback, options = {}) {
|
|
|
24294
25166
|
try {
|
|
24295
25167
|
fallback.connect();
|
|
24296
25168
|
fallbackConnected = true;
|
|
24297
|
-
} catch (
|
|
24298
|
-
report(
|
|
25169
|
+
} catch (error62) {
|
|
25170
|
+
report(error62);
|
|
24299
25171
|
}
|
|
24300
25172
|
}
|
|
24301
25173
|
};
|
|
@@ -24362,8 +25234,8 @@ function createEventFanIn(fallback, options = {}) {
|
|
|
24362
25234
|
continue;
|
|
24363
25235
|
try {
|
|
24364
25236
|
source.subscribe(channels);
|
|
24365
|
-
} catch (
|
|
24366
|
-
report(
|
|
25237
|
+
} catch (error62) {
|
|
25238
|
+
report(error62);
|
|
24367
25239
|
}
|
|
24368
25240
|
}
|
|
24369
25241
|
},
|
|
@@ -24375,8 +25247,8 @@ function createEventFanIn(fallback, options = {}) {
|
|
|
24375
25247
|
continue;
|
|
24376
25248
|
try {
|
|
24377
25249
|
source.unsubscribe(channels);
|
|
24378
|
-
} catch (
|
|
24379
|
-
report(
|
|
25250
|
+
} catch (error62) {
|
|
25251
|
+
report(error62);
|
|
24380
25252
|
}
|
|
24381
25253
|
}
|
|
24382
25254
|
},
|
|
@@ -24457,8 +25329,8 @@ function createRawObserverStream(baseUrl, token, report, webSocketImpl) {
|
|
|
24457
25329
|
let ws;
|
|
24458
25330
|
try {
|
|
24459
25331
|
ws = construct(WebSocketImpl);
|
|
24460
|
-
} catch (
|
|
24461
|
-
report(
|
|
25332
|
+
} catch (error62) {
|
|
25333
|
+
report(error62);
|
|
24462
25334
|
scheduleReconnect();
|
|
24463
25335
|
return;
|
|
24464
25336
|
}
|
|
@@ -24579,23 +25451,23 @@ function createObserverEventSource(options) {
|
|
|
24579
25451
|
let pending = [];
|
|
24580
25452
|
let backfillDone = false;
|
|
24581
25453
|
let epoch = 0;
|
|
24582
|
-
const report = (
|
|
25454
|
+
const report = (error62) => {
|
|
24583
25455
|
if (options.onError) {
|
|
24584
25456
|
try {
|
|
24585
|
-
options.onError(
|
|
25457
|
+
options.onError(error62);
|
|
24586
25458
|
} catch {
|
|
24587
25459
|
}
|
|
24588
25460
|
return;
|
|
24589
25461
|
}
|
|
24590
|
-
console.warn("[agent-relay] observer stream:",
|
|
25462
|
+
console.warn("[agent-relay] observer stream:", error62);
|
|
24591
25463
|
};
|
|
24592
25464
|
const emit = (event) => {
|
|
24593
25465
|
for (const key of [event.type, "any"]) {
|
|
24594
25466
|
for (const handler of handlers.get(key) ?? []) {
|
|
24595
25467
|
try {
|
|
24596
25468
|
void Promise.resolve(handler(event)).catch(report);
|
|
24597
|
-
} catch (
|
|
24598
|
-
report(
|
|
25469
|
+
} catch (error62) {
|
|
25470
|
+
report(error62);
|
|
24599
25471
|
}
|
|
24600
25472
|
}
|
|
24601
25473
|
}
|
|
@@ -24682,10 +25554,10 @@ function createObserverEventSource(options) {
|
|
|
24682
25554
|
break;
|
|
24683
25555
|
}
|
|
24684
25556
|
}
|
|
24685
|
-
} catch (
|
|
25557
|
+
} catch (error62) {
|
|
24686
25558
|
if (epoch !== startedEpoch)
|
|
24687
25559
|
return;
|
|
24688
|
-
report(
|
|
25560
|
+
report(error62);
|
|
24689
25561
|
}
|
|
24690
25562
|
if (epoch !== startedEpoch)
|
|
24691
25563
|
return;
|
|
@@ -24709,7 +25581,7 @@ function createObserverEventSource(options) {
|
|
|
24709
25581
|
hadOpen = true;
|
|
24710
25582
|
});
|
|
24711
25583
|
live.connect();
|
|
24712
|
-
} catch (
|
|
25584
|
+
} catch (error62) {
|
|
24713
25585
|
offLive?.();
|
|
24714
25586
|
offLive = void 0;
|
|
24715
25587
|
offOpen?.();
|
|
@@ -24720,7 +25592,7 @@ function createObserverEventSource(options) {
|
|
|
24720
25592
|
stream?.disconnect();
|
|
24721
25593
|
} catch {
|
|
24722
25594
|
}
|
|
24723
|
-
report(
|
|
25595
|
+
report(error62);
|
|
24724
25596
|
}
|
|
24725
25597
|
void runBackfill();
|
|
24726
25598
|
},
|
|
@@ -24737,8 +25609,8 @@ function createObserverEventSource(options) {
|
|
|
24737
25609
|
if (stream) {
|
|
24738
25610
|
try {
|
|
24739
25611
|
stream.disconnect();
|
|
24740
|
-
} catch (
|
|
24741
|
-
report(
|
|
25612
|
+
} catch (error62) {
|
|
25613
|
+
report(error62);
|
|
24742
25614
|
}
|
|
24743
25615
|
}
|
|
24744
25616
|
},
|
|
@@ -25574,7 +26446,7 @@ var RelaycastMessagingClient = class {
|
|
|
25574
26446
|
for (; ; ) {
|
|
25575
26447
|
const remainingMs = deadline - Date.now();
|
|
25576
26448
|
if (remainingMs > 0) {
|
|
25577
|
-
const read = this.commands.getInvocation(actionName, invocationId).then((value) => ({ ok: true, value }), (
|
|
26449
|
+
const read = this.commands.getInvocation(actionName, invocationId).then((value) => ({ ok: true, value }), (error62) => ({ ok: false, error: error62 instanceof Error ? error62.message : String(error62) }));
|
|
25578
26450
|
const outcome = await raceConfirmRead(read, remainingMs);
|
|
25579
26451
|
if (outcome !== READ_TIMED_OUT) {
|
|
25580
26452
|
if (outcome.ok) {
|
|
@@ -25716,9 +26588,9 @@ var RelaycastMessagingClient = class {
|
|
|
25716
26588
|
try {
|
|
25717
26589
|
const nodes = await this.nodes.list({ capability });
|
|
25718
26590
|
return nodes.find((candidate) => candidate.id === nodeId || candidate.nodeId === nodeId);
|
|
25719
|
-
} catch (
|
|
26591
|
+
} catch (error62) {
|
|
25720
26592
|
try {
|
|
25721
|
-
this.placementLog?.(`[placement] dispatch ${ack.invocationId ?? "unknown"} accepted by ${nodeId}, but roster metadata could not be refreshed: ${
|
|
26593
|
+
this.placementLog?.(`[placement] dispatch ${ack.invocationId ?? "unknown"} accepted by ${nodeId}, but roster metadata could not be refreshed: ${error62 instanceof Error ? error62.message : String(error62)}`);
|
|
25722
26594
|
} catch {
|
|
25723
26595
|
}
|
|
25724
26596
|
}
|
|
@@ -25736,16 +26608,16 @@ var RelaycastMessagingClient = class {
|
|
|
25736
26608
|
this.logPlacement(input2, event.message);
|
|
25737
26609
|
try {
|
|
25738
26610
|
await input2.onReconcile?.(event);
|
|
25739
|
-
} catch (
|
|
25740
|
-
this.placementLog?.(`[agent-relay] placement reconcile hook threw: ${
|
|
26611
|
+
} catch (error62) {
|
|
26612
|
+
this.placementLog?.(`[agent-relay] placement reconcile hook threw: ${error62 instanceof Error ? error62.message : String(error62)}`);
|
|
25741
26613
|
}
|
|
25742
26614
|
}
|
|
25743
26615
|
logPlacement(input2, message) {
|
|
25744
26616
|
const line = `[agent-relay] ${message}`;
|
|
25745
26617
|
try {
|
|
25746
26618
|
input2.log?.(line);
|
|
25747
|
-
} catch (
|
|
25748
|
-
this.placementLog?.(`[agent-relay] placement log hook threw: ${
|
|
26619
|
+
} catch (error62) {
|
|
26620
|
+
this.placementLog?.(`[agent-relay] placement log hook threw: ${error62 instanceof Error ? error62.message : String(error62)}`);
|
|
25749
26621
|
}
|
|
25750
26622
|
if (input2.log !== this.placementLog) {
|
|
25751
26623
|
try {
|
|
@@ -25937,12 +26809,12 @@ var RelaycastMessagingClient = class {
|
|
|
25937
26809
|
try {
|
|
25938
26810
|
const result = handler(event);
|
|
25939
26811
|
if (result && typeof result.catch === "function") {
|
|
25940
|
-
void result.catch((
|
|
25941
|
-
console.error(`[agent-relay] messaging listener for "${event.type}" threw:`,
|
|
26812
|
+
void result.catch((error62) => {
|
|
26813
|
+
console.error(`[agent-relay] messaging listener for "${event.type}" threw:`, error62);
|
|
25942
26814
|
});
|
|
25943
26815
|
}
|
|
25944
|
-
} catch (
|
|
25945
|
-
console.error(`[agent-relay] messaging listener for "${event.type}" threw:`,
|
|
26816
|
+
} catch (error62) {
|
|
26817
|
+
console.error(`[agent-relay] messaging listener for "${event.type}" threw:`, error62);
|
|
25946
26818
|
}
|
|
25947
26819
|
}
|
|
25948
26820
|
}
|
|
@@ -26080,13 +26952,13 @@ async function createWorkspace(name, options = {}) {
|
|
|
26080
26952
|
}
|
|
26081
26953
|
|
|
26082
26954
|
// ../sdk/dist/listeners.js
|
|
26083
|
-
function logRelayHandlerError(
|
|
26955
|
+
function logRelayHandlerError(error62, context) {
|
|
26084
26956
|
const where = context.action ? `action "${context.action}"` : `"${context.selector ?? "unknown"}"`;
|
|
26085
26957
|
if (context.operation) {
|
|
26086
|
-
console.warn(`[agent-relay] ${context.source} ${context.operation} for ${where} failed:`,
|
|
26958
|
+
console.warn(`[agent-relay] ${context.source} ${context.operation} for ${where} failed:`, error62);
|
|
26087
26959
|
return;
|
|
26088
26960
|
}
|
|
26089
|
-
console.warn(`[agent-relay] ${context.source} handler for ${where} threw:`,
|
|
26961
|
+
console.warn(`[agent-relay] ${context.source} handler for ${where} threw:`, error62);
|
|
26090
26962
|
}
|
|
26091
26963
|
function stripSigil(value) {
|
|
26092
26964
|
return value.startsWith("@") || value.startsWith("#") ? value.slice(1) : value;
|
|
@@ -26094,18 +26966,18 @@ function stripSigil(value) {
|
|
|
26094
26966
|
function runHandler(handler, event, report) {
|
|
26095
26967
|
try {
|
|
26096
26968
|
void Promise.resolve(handler(event)).catch(report);
|
|
26097
|
-
} catch (
|
|
26098
|
-
report(
|
|
26969
|
+
} catch (error62) {
|
|
26970
|
+
report(error62);
|
|
26099
26971
|
}
|
|
26100
26972
|
}
|
|
26101
26973
|
function makeReporter(context, info) {
|
|
26102
|
-
return (
|
|
26974
|
+
return (error62) => {
|
|
26103
26975
|
if (!context.onError) {
|
|
26104
|
-
logRelayHandlerError(
|
|
26976
|
+
logRelayHandlerError(error62, info);
|
|
26105
26977
|
return;
|
|
26106
26978
|
}
|
|
26107
26979
|
try {
|
|
26108
|
-
context.onError(
|
|
26980
|
+
context.onError(error62, info);
|
|
26109
26981
|
} catch {
|
|
26110
26982
|
}
|
|
26111
26983
|
};
|
|
@@ -26426,12 +27298,12 @@ function createListenerHub(baseEvents, actions, options) {
|
|
|
26426
27298
|
const addListener = (selector, handler) => {
|
|
26427
27299
|
try {
|
|
26428
27300
|
context.events.connect();
|
|
26429
|
-
} catch (
|
|
27301
|
+
} catch (error62) {
|
|
26430
27302
|
makeReporter(context, {
|
|
26431
27303
|
source: "listener",
|
|
26432
27304
|
operation: "connect",
|
|
26433
27305
|
selector: typeof selector === "string" ? selector : "predicate"
|
|
26434
|
-
})(
|
|
27306
|
+
})(error62);
|
|
26435
27307
|
}
|
|
26436
27308
|
if (typeof selector !== "string") {
|
|
26437
27309
|
return selector.subscribe(context, handler);
|
|
@@ -26671,15 +27543,15 @@ function createWorkspaceFacade(messaging, deps) {
|
|
|
26671
27543
|
}
|
|
26672
27544
|
};
|
|
26673
27545
|
}
|
|
26674
|
-
function reportActionError(wiring, action, operation, message,
|
|
27546
|
+
function reportActionError(wiring, action, operation, message, error62) {
|
|
26675
27547
|
if (wiring.onError) {
|
|
26676
27548
|
try {
|
|
26677
|
-
wiring.onError(
|
|
27549
|
+
wiring.onError(error62, { source: "action", action, operation });
|
|
26678
27550
|
} catch {
|
|
26679
27551
|
}
|
|
26680
27552
|
return;
|
|
26681
27553
|
}
|
|
26682
|
-
console.error(`[agent-relay] ${message}`,
|
|
27554
|
+
console.error(`[agent-relay] ${message}`, error62);
|
|
26683
27555
|
}
|
|
26684
27556
|
function registerFacadeAction(actions, def, wiring) {
|
|
26685
27557
|
const allowed = def.availableTo?.map(resolveAgentName);
|
|
@@ -26725,8 +27597,8 @@ function wireRelayAction(actions, def, wiring, allowed) {
|
|
|
26725
27597
|
inputSchema: actionSchemaToJsonSchema(def.inputSchema ?? def.input),
|
|
26726
27598
|
outputSchema: actionSchemaToJsonSchema(def.outputSchema ?? def.output),
|
|
26727
27599
|
...allowed ? { availableTo: allowed } : {}
|
|
26728
|
-
}).catch((
|
|
26729
|
-
reportActionError(wiring, def.name, "register", `failed to register action descriptor "${def.name}":`,
|
|
27600
|
+
}).catch((error62) => {
|
|
27601
|
+
reportActionError(wiring, def.name, "register", `failed to register action descriptor "${def.name}":`, error62);
|
|
26730
27602
|
});
|
|
26731
27603
|
const unsubscribe = wiring.messaging.events.on("actionInvoked", async (event) => {
|
|
26732
27604
|
if (event.actionName !== def.name) {
|
|
@@ -26736,8 +27608,8 @@ function wireRelayAction(actions, def, wiring, allowed) {
|
|
|
26736
27608
|
});
|
|
26737
27609
|
try {
|
|
26738
27610
|
wiring.messaging.events.connect();
|
|
26739
|
-
} catch (
|
|
26740
|
-
reportActionError(wiring, def.name, "connect", `failed to open the event stream for action "${def.name}":`,
|
|
27611
|
+
} catch (error62) {
|
|
27612
|
+
reportActionError(wiring, def.name, "connect", `failed to open the event stream for action "${def.name}":`, error62);
|
|
26741
27613
|
}
|
|
26742
27614
|
return unsubscribe;
|
|
26743
27615
|
}
|
|
@@ -26746,8 +27618,8 @@ async function handleActionInvoked(actions, commands, actionName, event, wiring)
|
|
|
26746
27618
|
try {
|
|
26747
27619
|
const invocation = await commands.getInvocation(actionName, event.invocationId);
|
|
26748
27620
|
input2 = invocation.input ?? {};
|
|
26749
|
-
} catch (
|
|
26750
|
-
reportActionError(wiring, actionName, "load_invocation", `failed to load invocation "${event.invocationId}":`,
|
|
27621
|
+
} catch (error62) {
|
|
27622
|
+
reportActionError(wiring, actionName, "load_invocation", `failed to load invocation "${event.invocationId}":`, error62);
|
|
26751
27623
|
}
|
|
26752
27624
|
const result = await actions.invoke({
|
|
26753
27625
|
name: actionName,
|
|
@@ -26756,8 +27628,8 @@ async function handleActionInvoked(actions, commands, actionName, event, wiring)
|
|
|
26756
27628
|
});
|
|
26757
27629
|
try {
|
|
26758
27630
|
await commands.completeInvocation(actionName, event.invocationId, result.ok ? { output: toOutputRecord(result.output) } : { error: result.error?.message ?? "handler failed" });
|
|
26759
|
-
} catch (
|
|
26760
|
-
reportActionError(wiring, actionName, "complete_invocation", `failed to complete invocation "${event.invocationId}":`,
|
|
27631
|
+
} catch (error62) {
|
|
27632
|
+
reportActionError(wiring, actionName, "complete_invocation", `failed to complete invocation "${event.invocationId}":`, error62);
|
|
26761
27633
|
}
|
|
26762
27634
|
}
|
|
26763
27635
|
function toOutputRecord(output2) {
|
|
@@ -26804,18 +27676,18 @@ var AgentRelay = class _AgentRelay {
|
|
|
26804
27676
|
this.createAgentMessaging = createAgentMessaging ?? ((token) => new RelaycastMessagingClient({ ...this.messagingOptions, agentToken: token }));
|
|
26805
27677
|
if (observerToken) {
|
|
26806
27678
|
this.eventFanIn = createEventFanIn(void 0, {
|
|
26807
|
-
onError: (
|
|
27679
|
+
onError: (error62) => this.reportError(error62, { source: "listener", selector: "events.connect" })
|
|
26808
27680
|
});
|
|
26809
27681
|
this.eventFanIn.addSource(createObserverEventSource({
|
|
26810
27682
|
observerToken,
|
|
26811
27683
|
baseUrl: messagingOptions.baseUrl,
|
|
26812
27684
|
sinceSeq,
|
|
26813
27685
|
onCursor,
|
|
26814
|
-
onError: (
|
|
27686
|
+
onError: (error62) => this.reportError(error62, { source: "listener", selector: "events.connect" })
|
|
26815
27687
|
}));
|
|
26816
27688
|
} else {
|
|
26817
27689
|
this.eventFanIn = createEventFanIn(this.messaging.events, {
|
|
26818
|
-
onError: (
|
|
27690
|
+
onError: (error62) => this.reportError(error62, { source: "listener", selector: "events.connect" })
|
|
26819
27691
|
});
|
|
26820
27692
|
}
|
|
26821
27693
|
if (onError) {
|
|
@@ -26879,7 +27751,7 @@ var AgentRelay = class _AgentRelay {
|
|
|
26879
27751
|
get listenerHub() {
|
|
26880
27752
|
if (!this.hub) {
|
|
26881
27753
|
this.hub = createListenerHub(this.eventFanIn, this.actions, {
|
|
26882
|
-
onError: (
|
|
27754
|
+
onError: (error62, context) => this.reportError(error62, context)
|
|
26883
27755
|
});
|
|
26884
27756
|
}
|
|
26885
27757
|
return this.hub;
|
|
@@ -26929,7 +27801,7 @@ var AgentRelay = class _AgentRelay {
|
|
|
26929
27801
|
id: registration.id,
|
|
26930
27802
|
name: registration.name,
|
|
26931
27803
|
token: registration.token
|
|
26932
|
-
}, { onError: (
|
|
27804
|
+
}, { onError: (error62, context) => this.reportError(error62, context) });
|
|
26933
27805
|
}
|
|
26934
27806
|
/** Rehydrate a live client from a persisted agent token, resolving identity from the relay. */
|
|
26935
27807
|
async reconnectAgent(apiToken) {
|
|
@@ -26939,12 +27811,12 @@ var AgentRelay = class _AgentRelay {
|
|
|
26939
27811
|
id: identity.id,
|
|
26940
27812
|
name: identity.name,
|
|
26941
27813
|
token: apiToken
|
|
26942
|
-
}, { onError: (
|
|
27814
|
+
}, { onError: (error62, context) => this.reportError(error62, context) });
|
|
26943
27815
|
}
|
|
26944
27816
|
registerAction(def) {
|
|
26945
27817
|
return registerFacadeAction(this.actions, def, {
|
|
26946
27818
|
messaging: this.messaging,
|
|
26947
|
-
onError: (
|
|
27819
|
+
onError: (error62, context) => this.reportError(error62, context)
|
|
26948
27820
|
});
|
|
26949
27821
|
}
|
|
26950
27822
|
addListener(selector, handler) {
|
|
@@ -26964,14 +27836,14 @@ var AgentRelay = class _AgentRelay {
|
|
|
26964
27836
|
this.errorHooks.delete(hook);
|
|
26965
27837
|
};
|
|
26966
27838
|
}
|
|
26967
|
-
reportError(
|
|
27839
|
+
reportError(error62, context) {
|
|
26968
27840
|
if (this.errorHooks.size === 0) {
|
|
26969
|
-
logRelayHandlerError(
|
|
27841
|
+
logRelayHandlerError(error62, context);
|
|
26970
27842
|
return;
|
|
26971
27843
|
}
|
|
26972
27844
|
for (const hook of this.errorHooks) {
|
|
26973
27845
|
try {
|
|
26974
|
-
hook(
|
|
27846
|
+
hook(error62, context);
|
|
26975
27847
|
} catch {
|
|
26976
27848
|
}
|
|
26977
27849
|
}
|
|
@@ -26989,8 +27861,8 @@ var AgentRelay = class _AgentRelay {
|
|
|
26989
27861
|
this.listenerHub.emitSessionEvent(agentId, event);
|
|
26990
27862
|
try {
|
|
26991
27863
|
await this.messaging.sessionEvents?.emit(agentId, event);
|
|
26992
|
-
} catch (
|
|
26993
|
-
this.reportError(
|
|
27864
|
+
} catch (error62) {
|
|
27865
|
+
this.reportError(error62, {
|
|
26994
27866
|
source: "listener",
|
|
26995
27867
|
selector: event.type,
|
|
26996
27868
|
operation: "publish_session_event"
|
|
@@ -27132,11 +28004,11 @@ var DeliveryRunner = class {
|
|
|
27132
28004
|
state: result.status === "delivered" ? "delivered" : void 0,
|
|
27133
28005
|
metadata: result.metadata
|
|
27134
28006
|
});
|
|
27135
|
-
} catch (
|
|
27136
|
-
await Promise.resolve(this.options.onError?.(item,
|
|
28007
|
+
} catch (error62) {
|
|
28008
|
+
await Promise.resolve(this.options.onError?.(item, error62));
|
|
27137
28009
|
await this.options.messaging.inbox.fail({
|
|
27138
28010
|
inboxItemId: item.id,
|
|
27139
|
-
error:
|
|
28011
|
+
error: error62 instanceof Error ? error62.message : String(error62),
|
|
27140
28012
|
retry: true
|
|
27141
28013
|
});
|
|
27142
28014
|
}
|
|
@@ -27482,20 +28354,20 @@ function reduceAgentActivity(previous, event) {
|
|
|
27482
28354
|
default:
|
|
27483
28355
|
break;
|
|
27484
28356
|
}
|
|
27485
|
-
const
|
|
27486
|
-
if (
|
|
28357
|
+
const derived2 = deriveActivity(state);
|
|
28358
|
+
if (derived2.activity === previous.activity)
|
|
27487
28359
|
return { state };
|
|
27488
|
-
state.activity =
|
|
27489
|
-
const fidelity =
|
|
28360
|
+
state.activity = derived2.activity;
|
|
28361
|
+
const fidelity = derived2.fidelity ?? observation.fidelity;
|
|
27490
28362
|
return {
|
|
27491
28363
|
state,
|
|
27492
28364
|
transition: {
|
|
27493
28365
|
type: "activity.changed",
|
|
27494
|
-
activity:
|
|
28366
|
+
activity: derived2.activity,
|
|
27495
28367
|
previousActivity: previous.activity,
|
|
27496
|
-
reason:
|
|
27497
|
-
...
|
|
27498
|
-
...
|
|
28368
|
+
reason: derived2.reason,
|
|
28369
|
+
...derived2.tool ? { tool: derived2.tool } : {},
|
|
28370
|
+
...derived2.approval ? { approval: derived2.approval } : {},
|
|
27499
28371
|
at: observation.timestamp,
|
|
27500
28372
|
observability: { ...observation, fidelity }
|
|
27501
28373
|
}
|
|
@@ -27550,8 +28422,8 @@ var INVALID_AGENT_TOKEN_CODE = "agent_token_invalid";
|
|
|
27550
28422
|
var INVALID_AGENT_TOKEN_MESSAGE = "Invalid agent token";
|
|
27551
28423
|
var RELAY_SERVICE_FAILURE_MESSAGE = "Relay service could not complete the request. Retry, or contact the workspace operator if the problem persists.";
|
|
27552
28424
|
var DATABASE_DIAGNOSTIC_PATTERN = /(?:failed\s+query\s*:|\bparams?\s*:|\bparameters\s*:|\bsqlstate\b|\b(?:select|insert\s+into|update|delete\s+from|drop\s+table|truncate\s+table|alter\s+table)\s+(?:["`[*]|[a-z_][\w.]*\s*(?:from\s+[a-z_][\w.]*|where|set|values|\(|;)))/i;
|
|
27553
|
-
function safeRelayErrorMessage(
|
|
27554
|
-
const message =
|
|
28425
|
+
function safeRelayErrorMessage(error62) {
|
|
28426
|
+
const message = error62 instanceof Error ? error62.message : String(error62);
|
|
27555
28427
|
return DATABASE_DIAGNOSTIC_PATTERN.test(message) ? RELAY_SERVICE_FAILURE_MESSAGE : message;
|
|
27556
28428
|
}
|
|
27557
28429
|
function normalizeCode(value) {
|
|
@@ -27586,13 +28458,13 @@ function readBodyError(body) {
|
|
|
27586
28458
|
message: typeof root.message === "string" ? root.message : void 0
|
|
27587
28459
|
};
|
|
27588
28460
|
}
|
|
27589
|
-
function isInvalidAgentTokenError(
|
|
27590
|
-
if (!
|
|
28461
|
+
function isInvalidAgentTokenError(error62, visited = /* @__PURE__ */ new WeakSet()) {
|
|
28462
|
+
if (!error62 || typeof error62 !== "object")
|
|
27591
28463
|
return false;
|
|
27592
|
-
if (visited.has(
|
|
28464
|
+
if (visited.has(error62))
|
|
27593
28465
|
return false;
|
|
27594
|
-
visited.add(
|
|
27595
|
-
const err =
|
|
28466
|
+
visited.add(error62);
|
|
28467
|
+
const err = error62;
|
|
27596
28468
|
if (normalizeCode(err.code) === INVALID_AGENT_TOKEN_CODE)
|
|
27597
28469
|
return true;
|
|
27598
28470
|
const bodyError = readBodyError(err.body);
|
|
@@ -28373,17 +29245,17 @@ async function checkForUpdates(currentVersion) {
|
|
|
28373
29245
|
latestVersion
|
|
28374
29246
|
};
|
|
28375
29247
|
} catch (err) {
|
|
28376
|
-
const
|
|
29248
|
+
const error62 = err.message;
|
|
28377
29249
|
writeCache({
|
|
28378
29250
|
lastCheck: now,
|
|
28379
29251
|
latestVersion: cache?.latestVersion || null,
|
|
28380
|
-
error:
|
|
29252
|
+
error: error62
|
|
28381
29253
|
});
|
|
28382
29254
|
return {
|
|
28383
29255
|
updateAvailable: false,
|
|
28384
29256
|
currentVersion,
|
|
28385
29257
|
latestVersion: cache?.latestVersion || null,
|
|
28386
|
-
error:
|
|
29258
|
+
error: error62
|
|
28387
29259
|
};
|
|
28388
29260
|
}
|
|
28389
29261
|
}
|
|
@@ -28446,17 +29318,17 @@ function createTraceableError(message, context = {}, originalError) {
|
|
|
28446
29318
|
};
|
|
28447
29319
|
}
|
|
28448
29320
|
function logAndTraceError(message, context = {}, originalError) {
|
|
28449
|
-
const
|
|
28450
|
-
console.error(
|
|
28451
|
-
return
|
|
29321
|
+
const error62 = createTraceableError(message, context, originalError);
|
|
29322
|
+
console.error(error62.logMessage);
|
|
29323
|
+
return error62;
|
|
28452
29324
|
}
|
|
28453
29325
|
function withErrorTracing(fn, baseContext = {}) {
|
|
28454
29326
|
return (async (...args) => {
|
|
28455
29327
|
try {
|
|
28456
29328
|
return await fn(...args);
|
|
28457
29329
|
} catch (err) {
|
|
28458
|
-
const
|
|
28459
|
-
throw new TracedError(
|
|
29330
|
+
const error62 = logAndTraceError(err instanceof Error ? err.message : "Unknown error", baseContext, err instanceof Error ? err : void 0);
|
|
29331
|
+
throw new TracedError(error62);
|
|
28460
29332
|
}
|
|
28461
29333
|
});
|
|
28462
29334
|
}
|