gogcli-mcp 2.29.1 → 2.30.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/dist/index.js +1693 -883
- package/dist/lib.js +1751 -805
- package/manifest.json +1 -1
- package/mint.yaml +2 -2
- package/package.json +4 -4
- package/server.json +2 -2
- package/src/blob-upload.ts +179 -0
- package/src/blob-urls.ts +280 -0
- package/src/lib.ts +19 -0
- package/src/runner.ts +19 -2
- package/src/worker.ts +1 -1
- package/tests/blob-upload.test.ts +204 -0
- package/tests/blob-urls.test.ts +319 -0
- package/tests/runner.test.ts +62 -1
package/dist/lib.js
CHANGED
|
@@ -472,9 +472,9 @@ var require_codegen = __commonJS({
|
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
474
|
var Throw = class extends Node {
|
|
475
|
-
constructor(
|
|
475
|
+
constructor(error62) {
|
|
476
476
|
super();
|
|
477
|
-
this.error =
|
|
477
|
+
this.error = error62;
|
|
478
478
|
}
|
|
479
479
|
render({ _n }) {
|
|
480
480
|
return `throw ${this.error};` + _n;
|
|
@@ -711,9 +711,9 @@ var require_codegen = __commonJS({
|
|
|
711
711
|
}
|
|
712
712
|
};
|
|
713
713
|
var Catch = class extends BlockNode {
|
|
714
|
-
constructor(
|
|
714
|
+
constructor(error62) {
|
|
715
715
|
super();
|
|
716
|
-
this.error =
|
|
716
|
+
this.error = error62;
|
|
717
717
|
}
|
|
718
718
|
render(opts) {
|
|
719
719
|
return `catch(${this.error})` + super.render(opts);
|
|
@@ -904,9 +904,9 @@ var require_codegen = __commonJS({
|
|
|
904
904
|
this._blockNode(node2);
|
|
905
905
|
this.code(tryBody);
|
|
906
906
|
if (catchCode) {
|
|
907
|
-
const
|
|
908
|
-
this._currNode = node2.catch = new Catch(
|
|
909
|
-
catchCode(
|
|
907
|
+
const error62 = this.name("e");
|
|
908
|
+
this._currNode = node2.catch = new Catch(error62);
|
|
909
|
+
catchCode(error62);
|
|
910
910
|
}
|
|
911
911
|
if (finallyCode) {
|
|
912
912
|
this._currNode = node2.finally = new Finally();
|
|
@@ -915,8 +915,8 @@ var require_codegen = __commonJS({
|
|
|
915
915
|
return this._endBlockNode(Catch, Finally);
|
|
916
916
|
}
|
|
917
917
|
// `throw` statement
|
|
918
|
-
throw(
|
|
919
|
-
return this._leafNode(new Throw(
|
|
918
|
+
throw(error62) {
|
|
919
|
+
return this._leafNode(new Throw(error62));
|
|
920
920
|
}
|
|
921
921
|
// start self-balancing block
|
|
922
922
|
block(body, nodeCount) {
|
|
@@ -1272,10 +1272,10 @@ var require_errors = __commonJS({
|
|
|
1272
1272
|
exports.keyword$DataError = {
|
|
1273
1273
|
message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`
|
|
1274
1274
|
};
|
|
1275
|
-
function reportError(cxt,
|
|
1275
|
+
function reportError(cxt, error62 = exports.keywordError, errorPaths, overrideAllErrors) {
|
|
1276
1276
|
const { it } = cxt;
|
|
1277
1277
|
const { gen, compositeRule, allErrors } = it;
|
|
1278
|
-
const errObj = errorObjectCode(cxt,
|
|
1278
|
+
const errObj = errorObjectCode(cxt, error62, errorPaths);
|
|
1279
1279
|
if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) {
|
|
1280
1280
|
addError(gen, errObj);
|
|
1281
1281
|
} else {
|
|
@@ -1283,10 +1283,10 @@ var require_errors = __commonJS({
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
exports.reportError = reportError;
|
|
1286
|
-
function reportExtraError(cxt,
|
|
1286
|
+
function reportExtraError(cxt, error62 = exports.keywordError, errorPaths) {
|
|
1287
1287
|
const { it } = cxt;
|
|
1288
1288
|
const { gen, compositeRule, allErrors } = it;
|
|
1289
|
-
const errObj = errorObjectCode(cxt,
|
|
1289
|
+
const errObj = errorObjectCode(cxt, error62, errorPaths);
|
|
1290
1290
|
addError(gen, errObj);
|
|
1291
1291
|
if (!(compositeRule || allErrors)) {
|
|
1292
1292
|
returnErrors(it, names_1.default.vErrors);
|
|
@@ -1337,19 +1337,19 @@ var require_errors = __commonJS({
|
|
|
1337
1337
|
schema: new codegen_1.Name("schema"),
|
|
1338
1338
|
parentSchema: new codegen_1.Name("parentSchema")
|
|
1339
1339
|
};
|
|
1340
|
-
function errorObjectCode(cxt,
|
|
1340
|
+
function errorObjectCode(cxt, error62, errorPaths) {
|
|
1341
1341
|
const { createErrors } = cxt.it;
|
|
1342
1342
|
if (createErrors === false)
|
|
1343
1343
|
return (0, codegen_1._)`{}`;
|
|
1344
|
-
return errorObject(cxt,
|
|
1344
|
+
return errorObject(cxt, error62, errorPaths);
|
|
1345
1345
|
}
|
|
1346
|
-
function errorObject(cxt,
|
|
1346
|
+
function errorObject(cxt, error62, errorPaths = {}) {
|
|
1347
1347
|
const { gen, it } = cxt;
|
|
1348
1348
|
const keyValues = [
|
|
1349
1349
|
errorInstancePath(it, errorPaths),
|
|
1350
1350
|
errorSchemaPath(cxt, errorPaths)
|
|
1351
1351
|
];
|
|
1352
|
-
extraErrorProps(cxt,
|
|
1352
|
+
extraErrorProps(cxt, error62, keyValues);
|
|
1353
1353
|
return gen.object(...keyValues);
|
|
1354
1354
|
}
|
|
1355
1355
|
function errorInstancePath({ errorPath }, { instancePath }) {
|
|
@@ -1677,10 +1677,10 @@ var require_defaults = __commonJS({
|
|
|
1677
1677
|
var codegen_1 = require_codegen();
|
|
1678
1678
|
var util_1 = require_util();
|
|
1679
1679
|
function assignDefaults(it, ty) {
|
|
1680
|
-
const { properties, items } = it.schema;
|
|
1681
|
-
if (ty === "object" &&
|
|
1682
|
-
for (const key in
|
|
1683
|
-
assignDefault(it, key,
|
|
1680
|
+
const { properties: properties2, items } = it.schema;
|
|
1681
|
+
if (ty === "object" && properties2) {
|
|
1682
|
+
for (const key in properties2) {
|
|
1683
|
+
assignDefault(it, key, properties2[key].default);
|
|
1684
1684
|
}
|
|
1685
1685
|
} else if (ty === "array" && Array.isArray(items)) {
|
|
1686
1686
|
items.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
@@ -1723,8 +1723,8 @@ var require_code2 = __commonJS({
|
|
|
1723
1723
|
});
|
|
1724
1724
|
}
|
|
1725
1725
|
exports.checkReportMissingProp = checkReportMissingProp;
|
|
1726
|
-
function checkMissingProp({ gen, data, it: { opts } },
|
|
1727
|
-
return (0, codegen_1.or)(...
|
|
1726
|
+
function checkMissingProp({ gen, data, it: { opts } }, properties2, missing) {
|
|
1727
|
+
return (0, codegen_1.or)(...properties2.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
|
|
1728
1728
|
}
|
|
1729
1729
|
exports.checkMissingProp = checkMissingProp;
|
|
1730
1730
|
function reportMissingProp(cxt, missing) {
|
|
@@ -1881,13 +1881,13 @@ var require_keyword = __commonJS({
|
|
|
1881
1881
|
modifyData(cxt);
|
|
1882
1882
|
reportErrs(() => cxt.error());
|
|
1883
1883
|
} else {
|
|
1884
|
-
const ruleErrs = def.async ?
|
|
1884
|
+
const ruleErrs = def.async ? validateAsync3() : validateSync();
|
|
1885
1885
|
if (def.modifying)
|
|
1886
1886
|
modifyData(cxt);
|
|
1887
1887
|
reportErrs(() => addErrs(cxt, ruleErrs));
|
|
1888
1888
|
}
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1890
|
+
function validateAsync3() {
|
|
1891
1891
|
const ruleErrs = gen.let("ruleErrs", null);
|
|
1892
1892
|
gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
|
|
1893
1893
|
return ruleErrs;
|
|
@@ -5013,7 +5013,7 @@ var require_limitNumber = __commonJS({
|
|
|
5013
5013
|
exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
5014
5014
|
exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
5015
5015
|
};
|
|
5016
|
-
var
|
|
5016
|
+
var error62 = {
|
|
5017
5017
|
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
5018
5018
|
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
5019
5019
|
};
|
|
@@ -5022,7 +5022,7 @@ var require_limitNumber = __commonJS({
|
|
|
5022
5022
|
type: "number",
|
|
5023
5023
|
schemaType: "number",
|
|
5024
5024
|
$data: true,
|
|
5025
|
-
error:
|
|
5025
|
+
error: error62,
|
|
5026
5026
|
code(cxt) {
|
|
5027
5027
|
const { keyword, data, schemaCode } = cxt;
|
|
5028
5028
|
cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
|
|
@@ -5038,7 +5038,7 @@ var require_multipleOf = __commonJS({
|
|
|
5038
5038
|
"use strict";
|
|
5039
5039
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5040
5040
|
var codegen_1 = require_codegen();
|
|
5041
|
-
var
|
|
5041
|
+
var error62 = {
|
|
5042
5042
|
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
5043
5043
|
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
5044
5044
|
};
|
|
@@ -5047,7 +5047,7 @@ var require_multipleOf = __commonJS({
|
|
|
5047
5047
|
type: "number",
|
|
5048
5048
|
schemaType: "number",
|
|
5049
5049
|
$data: true,
|
|
5050
|
-
error:
|
|
5050
|
+
error: error62,
|
|
5051
5051
|
code(cxt) {
|
|
5052
5052
|
const { gen, data, schemaCode, it } = cxt;
|
|
5053
5053
|
const prec = it.opts.multipleOfPrecision;
|
|
@@ -5094,7 +5094,7 @@ var require_limitLength = __commonJS({
|
|
|
5094
5094
|
var codegen_1 = require_codegen();
|
|
5095
5095
|
var util_1 = require_util();
|
|
5096
5096
|
var ucs2length_1 = require_ucs2length();
|
|
5097
|
-
var
|
|
5097
|
+
var error62 = {
|
|
5098
5098
|
message({ keyword, schemaCode }) {
|
|
5099
5099
|
const comp = keyword === "maxLength" ? "more" : "fewer";
|
|
5100
5100
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
|
|
@@ -5106,7 +5106,7 @@ var require_limitLength = __commonJS({
|
|
|
5106
5106
|
type: "string",
|
|
5107
5107
|
schemaType: "number",
|
|
5108
5108
|
$data: true,
|
|
5109
|
-
error:
|
|
5109
|
+
error: error62,
|
|
5110
5110
|
code(cxt) {
|
|
5111
5111
|
const { keyword, data, schemaCode, it } = cxt;
|
|
5112
5112
|
const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -5126,7 +5126,7 @@ var require_pattern = __commonJS({
|
|
|
5126
5126
|
var code_1 = require_code2();
|
|
5127
5127
|
var util_1 = require_util();
|
|
5128
5128
|
var codegen_1 = require_codegen();
|
|
5129
|
-
var
|
|
5129
|
+
var error62 = {
|
|
5130
5130
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
5131
5131
|
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
|
|
5132
5132
|
};
|
|
@@ -5135,7 +5135,7 @@ var require_pattern = __commonJS({
|
|
|
5135
5135
|
type: "string",
|
|
5136
5136
|
schemaType: "string",
|
|
5137
5137
|
$data: true,
|
|
5138
|
-
error:
|
|
5138
|
+
error: error62,
|
|
5139
5139
|
code(cxt) {
|
|
5140
5140
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5141
5141
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
@@ -5161,7 +5161,7 @@ var require_limitProperties = __commonJS({
|
|
|
5161
5161
|
"use strict";
|
|
5162
5162
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5163
5163
|
var codegen_1 = require_codegen();
|
|
5164
|
-
var
|
|
5164
|
+
var error62 = {
|
|
5165
5165
|
message({ keyword, schemaCode }) {
|
|
5166
5166
|
const comp = keyword === "maxProperties" ? "more" : "fewer";
|
|
5167
5167
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
|
|
@@ -5173,7 +5173,7 @@ var require_limitProperties = __commonJS({
|
|
|
5173
5173
|
type: "object",
|
|
5174
5174
|
schemaType: "number",
|
|
5175
5175
|
$data: true,
|
|
5176
|
-
error:
|
|
5176
|
+
error: error62,
|
|
5177
5177
|
code(cxt) {
|
|
5178
5178
|
const { keyword, data, schemaCode } = cxt;
|
|
5179
5179
|
const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -5192,7 +5192,7 @@ var require_required = __commonJS({
|
|
|
5192
5192
|
var code_1 = require_code2();
|
|
5193
5193
|
var codegen_1 = require_codegen();
|
|
5194
5194
|
var util_1 = require_util();
|
|
5195
|
-
var
|
|
5195
|
+
var error62 = {
|
|
5196
5196
|
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
5197
5197
|
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
5198
5198
|
};
|
|
@@ -5201,7 +5201,7 @@ var require_required = __commonJS({
|
|
|
5201
5201
|
type: "object",
|
|
5202
5202
|
schemaType: "array",
|
|
5203
5203
|
$data: true,
|
|
5204
|
-
error:
|
|
5204
|
+
error: error62,
|
|
5205
5205
|
code(cxt) {
|
|
5206
5206
|
const { gen, schema, schemaCode, data, $data, it } = cxt;
|
|
5207
5207
|
const { opts } = it;
|
|
@@ -5272,7 +5272,7 @@ var require_limitItems = __commonJS({
|
|
|
5272
5272
|
"use strict";
|
|
5273
5273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5274
5274
|
var codegen_1 = require_codegen();
|
|
5275
|
-
var
|
|
5275
|
+
var error62 = {
|
|
5276
5276
|
message({ keyword, schemaCode }) {
|
|
5277
5277
|
const comp = keyword === "maxItems" ? "more" : "fewer";
|
|
5278
5278
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
|
|
@@ -5284,7 +5284,7 @@ var require_limitItems = __commonJS({
|
|
|
5284
5284
|
type: "array",
|
|
5285
5285
|
schemaType: "number",
|
|
5286
5286
|
$data: true,
|
|
5287
|
-
error:
|
|
5287
|
+
error: error62,
|
|
5288
5288
|
code(cxt) {
|
|
5289
5289
|
const { keyword, data, schemaCode } = cxt;
|
|
5290
5290
|
const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -5315,7 +5315,7 @@ var require_uniqueItems = __commonJS({
|
|
|
5315
5315
|
var codegen_1 = require_codegen();
|
|
5316
5316
|
var util_1 = require_util();
|
|
5317
5317
|
var equal_1 = require_equal();
|
|
5318
|
-
var
|
|
5318
|
+
var error62 = {
|
|
5319
5319
|
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
5320
5320
|
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
5321
5321
|
};
|
|
@@ -5324,7 +5324,7 @@ var require_uniqueItems = __commonJS({
|
|
|
5324
5324
|
type: "array",
|
|
5325
5325
|
schemaType: "boolean",
|
|
5326
5326
|
$data: true,
|
|
5327
|
-
error:
|
|
5327
|
+
error: error62,
|
|
5328
5328
|
code(cxt) {
|
|
5329
5329
|
const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
|
|
5330
5330
|
if (!$data && !schema)
|
|
@@ -5381,14 +5381,14 @@ var require_const = __commonJS({
|
|
|
5381
5381
|
var codegen_1 = require_codegen();
|
|
5382
5382
|
var util_1 = require_util();
|
|
5383
5383
|
var equal_1 = require_equal();
|
|
5384
|
-
var
|
|
5384
|
+
var error62 = {
|
|
5385
5385
|
message: "must be equal to constant",
|
|
5386
5386
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
|
|
5387
5387
|
};
|
|
5388
5388
|
var def = {
|
|
5389
5389
|
keyword: "const",
|
|
5390
5390
|
$data: true,
|
|
5391
|
-
error:
|
|
5391
|
+
error: error62,
|
|
5392
5392
|
code(cxt) {
|
|
5393
5393
|
const { gen, data, $data, schemaCode, schema } = cxt;
|
|
5394
5394
|
if ($data || schema && typeof schema == "object") {
|
|
@@ -5410,7 +5410,7 @@ var require_enum = __commonJS({
|
|
|
5410
5410
|
var codegen_1 = require_codegen();
|
|
5411
5411
|
var util_1 = require_util();
|
|
5412
5412
|
var equal_1 = require_equal();
|
|
5413
|
-
var
|
|
5413
|
+
var error62 = {
|
|
5414
5414
|
message: "must be equal to one of the allowed values",
|
|
5415
5415
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
|
|
5416
5416
|
};
|
|
@@ -5418,7 +5418,7 @@ var require_enum = __commonJS({
|
|
|
5418
5418
|
keyword: "enum",
|
|
5419
5419
|
schemaType: "array",
|
|
5420
5420
|
$data: true,
|
|
5421
|
-
error:
|
|
5421
|
+
error: error62,
|
|
5422
5422
|
code(cxt) {
|
|
5423
5423
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5424
5424
|
if (!$data && schema.length === 0)
|
|
@@ -5497,7 +5497,7 @@ var require_additionalItems = __commonJS({
|
|
|
5497
5497
|
exports.validateAdditionalItems = void 0;
|
|
5498
5498
|
var codegen_1 = require_codegen();
|
|
5499
5499
|
var util_1 = require_util();
|
|
5500
|
-
var
|
|
5500
|
+
var error62 = {
|
|
5501
5501
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5502
5502
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5503
5503
|
};
|
|
@@ -5506,7 +5506,7 @@ var require_additionalItems = __commonJS({
|
|
|
5506
5506
|
type: "array",
|
|
5507
5507
|
schemaType: ["boolean", "object"],
|
|
5508
5508
|
before: "uniqueItems",
|
|
5509
|
-
error:
|
|
5509
|
+
error: error62,
|
|
5510
5510
|
code(cxt) {
|
|
5511
5511
|
const { parentSchema, it } = cxt;
|
|
5512
5512
|
const { items } = parentSchema;
|
|
@@ -5625,7 +5625,7 @@ var require_items2020 = __commonJS({
|
|
|
5625
5625
|
var util_1 = require_util();
|
|
5626
5626
|
var code_1 = require_code2();
|
|
5627
5627
|
var additionalItems_1 = require_additionalItems();
|
|
5628
|
-
var
|
|
5628
|
+
var error62 = {
|
|
5629
5629
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5630
5630
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5631
5631
|
};
|
|
@@ -5634,7 +5634,7 @@ var require_items2020 = __commonJS({
|
|
|
5634
5634
|
type: "array",
|
|
5635
5635
|
schemaType: ["object", "boolean"],
|
|
5636
5636
|
before: "uniqueItems",
|
|
5637
|
-
error:
|
|
5637
|
+
error: error62,
|
|
5638
5638
|
code(cxt) {
|
|
5639
5639
|
const { schema, parentSchema, it } = cxt;
|
|
5640
5640
|
const { prefixItems } = parentSchema;
|
|
@@ -5658,7 +5658,7 @@ var require_contains = __commonJS({
|
|
|
5658
5658
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5659
5659
|
var codegen_1 = require_codegen();
|
|
5660
5660
|
var util_1 = require_util();
|
|
5661
|
-
var
|
|
5661
|
+
var error62 = {
|
|
5662
5662
|
message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
|
|
5663
5663
|
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
|
|
5664
5664
|
};
|
|
@@ -5668,7 +5668,7 @@ var require_contains = __commonJS({
|
|
|
5668
5668
|
schemaType: ["object", "boolean"],
|
|
5669
5669
|
before: "uniqueItems",
|
|
5670
5670
|
trackErrors: true,
|
|
5671
|
-
error:
|
|
5671
|
+
error: error62,
|
|
5672
5672
|
code(cxt) {
|
|
5673
5673
|
const { gen, schema, parentSchema, data, it } = cxt;
|
|
5674
5674
|
let min;
|
|
@@ -5846,7 +5846,7 @@ var require_propertyNames = __commonJS({
|
|
|
5846
5846
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5847
5847
|
var codegen_1 = require_codegen();
|
|
5848
5848
|
var util_1 = require_util();
|
|
5849
|
-
var
|
|
5849
|
+
var error62 = {
|
|
5850
5850
|
message: "property name must be valid",
|
|
5851
5851
|
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
|
|
5852
5852
|
};
|
|
@@ -5854,7 +5854,7 @@ var require_propertyNames = __commonJS({
|
|
|
5854
5854
|
keyword: "propertyNames",
|
|
5855
5855
|
type: "object",
|
|
5856
5856
|
schemaType: ["object", "boolean"],
|
|
5857
|
-
error:
|
|
5857
|
+
error: error62,
|
|
5858
5858
|
code(cxt) {
|
|
5859
5859
|
const { gen, schema, data, it } = cxt;
|
|
5860
5860
|
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
@@ -5891,7 +5891,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5891
5891
|
var codegen_1 = require_codegen();
|
|
5892
5892
|
var names_1 = require_names();
|
|
5893
5893
|
var util_1 = require_util();
|
|
5894
|
-
var
|
|
5894
|
+
var error62 = {
|
|
5895
5895
|
message: "must NOT have additional properties",
|
|
5896
5896
|
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
|
|
5897
5897
|
};
|
|
@@ -5901,7 +5901,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5901
5901
|
schemaType: ["boolean", "object"],
|
|
5902
5902
|
allowUndefined: true,
|
|
5903
5903
|
trackErrors: true,
|
|
5904
|
-
error:
|
|
5904
|
+
error: error62,
|
|
5905
5905
|
code(cxt) {
|
|
5906
5906
|
const { gen, schema, parentSchema, data, errsCount, it } = cxt;
|
|
5907
5907
|
if (!errsCount)
|
|
@@ -6013,11 +6013,11 @@ var require_properties = __commonJS({
|
|
|
6013
6013
|
if (it.opts.unevaluated && allProps.length && it.props !== true) {
|
|
6014
6014
|
it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
6015
6015
|
}
|
|
6016
|
-
const
|
|
6017
|
-
if (
|
|
6016
|
+
const properties2 = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
6017
|
+
if (properties2.length === 0)
|
|
6018
6018
|
return;
|
|
6019
6019
|
const valid = gen.name("valid");
|
|
6020
|
-
for (const prop of
|
|
6020
|
+
for (const prop of properties2) {
|
|
6021
6021
|
if (hasDefault(prop)) {
|
|
6022
6022
|
applyPropertySchema(prop);
|
|
6023
6023
|
} else {
|
|
@@ -6175,7 +6175,7 @@ var require_oneOf = __commonJS({
|
|
|
6175
6175
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6176
6176
|
var codegen_1 = require_codegen();
|
|
6177
6177
|
var util_1 = require_util();
|
|
6178
|
-
var
|
|
6178
|
+
var error62 = {
|
|
6179
6179
|
message: "must match exactly one schema in oneOf",
|
|
6180
6180
|
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
|
|
6181
6181
|
};
|
|
@@ -6183,7 +6183,7 @@ var require_oneOf = __commonJS({
|
|
|
6183
6183
|
keyword: "oneOf",
|
|
6184
6184
|
schemaType: "array",
|
|
6185
6185
|
trackErrors: true,
|
|
6186
|
-
error:
|
|
6186
|
+
error: error62,
|
|
6187
6187
|
code(cxt) {
|
|
6188
6188
|
const { gen, schema, parentSchema, it } = cxt;
|
|
6189
6189
|
if (!Array.isArray(schema))
|
|
@@ -6260,7 +6260,7 @@ var require_if = __commonJS({
|
|
|
6260
6260
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6261
6261
|
var codegen_1 = require_codegen();
|
|
6262
6262
|
var util_1 = require_util();
|
|
6263
|
-
var
|
|
6263
|
+
var error62 = {
|
|
6264
6264
|
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
6265
6265
|
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
|
|
6266
6266
|
};
|
|
@@ -6268,7 +6268,7 @@ var require_if = __commonJS({
|
|
|
6268
6268
|
keyword: "if",
|
|
6269
6269
|
schemaType: ["object", "boolean"],
|
|
6270
6270
|
trackErrors: true,
|
|
6271
|
-
error:
|
|
6271
|
+
error: error62,
|
|
6272
6272
|
code(cxt) {
|
|
6273
6273
|
const { gen, parentSchema, it } = cxt;
|
|
6274
6274
|
if (parentSchema.then === void 0 && parentSchema.else === void 0) {
|
|
@@ -6394,7 +6394,7 @@ var require_format = __commonJS({
|
|
|
6394
6394
|
"use strict";
|
|
6395
6395
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6396
6396
|
var codegen_1 = require_codegen();
|
|
6397
|
-
var
|
|
6397
|
+
var error62 = {
|
|
6398
6398
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
6399
6399
|
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
6400
6400
|
};
|
|
@@ -6403,7 +6403,7 @@ var require_format = __commonJS({
|
|
|
6403
6403
|
type: ["number", "string"],
|
|
6404
6404
|
schemaType: "string",
|
|
6405
6405
|
$data: true,
|
|
6406
|
-
error:
|
|
6406
|
+
error: error62,
|
|
6407
6407
|
code(cxt, ruleType) {
|
|
6408
6408
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
6409
6409
|
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
@@ -6558,7 +6558,7 @@ var require_discriminator = __commonJS({
|
|
|
6558
6558
|
var compile_1 = require_compile();
|
|
6559
6559
|
var ref_error_1 = require_ref_error();
|
|
6560
6560
|
var util_1 = require_util();
|
|
6561
|
-
var
|
|
6561
|
+
var error62 = {
|
|
6562
6562
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
6563
6563
|
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
6564
6564
|
};
|
|
@@ -6566,7 +6566,7 @@ var require_discriminator = __commonJS({
|
|
|
6566
6566
|
keyword: "discriminator",
|
|
6567
6567
|
type: "object",
|
|
6568
6568
|
schemaType: "object",
|
|
6569
|
-
error:
|
|
6569
|
+
error: error62,
|
|
6570
6570
|
code(cxt) {
|
|
6571
6571
|
const { gen, data, schema, parentSchema, it } = cxt;
|
|
6572
6572
|
const { oneOf } = parentSchema;
|
|
@@ -7098,7 +7098,7 @@ var require_limit = __commonJS({
|
|
|
7098
7098
|
formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
7099
7099
|
formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
7100
7100
|
};
|
|
7101
|
-
var
|
|
7101
|
+
var error62 = {
|
|
7102
7102
|
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
7103
7103
|
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
7104
7104
|
};
|
|
@@ -7107,7 +7107,7 @@ var require_limit = __commonJS({
|
|
|
7107
7107
|
type: "string",
|
|
7108
7108
|
schemaType: "string",
|
|
7109
7109
|
$data: true,
|
|
7110
|
-
error:
|
|
7110
|
+
error: error62,
|
|
7111
7111
|
code(cxt) {
|
|
7112
7112
|
const { gen, data, schemaCode, keyword, it } = cxt;
|
|
7113
7113
|
const { opts, self } = it;
|
|
@@ -7203,6 +7203,7 @@ __export(external_exports, {
|
|
|
7203
7203
|
$brand: () => $brand,
|
|
7204
7204
|
$input: () => $input,
|
|
7205
7205
|
$output: () => $output,
|
|
7206
|
+
INVALID: () => INVALID,
|
|
7206
7207
|
NEVER: () => NEVER,
|
|
7207
7208
|
TimePrecision: () => TimePrecision,
|
|
7208
7209
|
ZodAny: () => ZodAny,
|
|
@@ -7236,12 +7237,14 @@ __export(external_exports, {
|
|
|
7236
7237
|
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
7237
7238
|
ZodFunction: () => ZodFunction,
|
|
7238
7239
|
ZodGUID: () => ZodGUID,
|
|
7240
|
+
ZodIBAN: () => ZodIBAN,
|
|
7239
7241
|
ZodIPv4: () => ZodIPv4,
|
|
7240
7242
|
ZodIPv6: () => ZodIPv6,
|
|
7241
7243
|
ZodISODate: () => ZodISODate,
|
|
7242
7244
|
ZodISODateTime: () => ZodISODateTime,
|
|
7243
7245
|
ZodISODuration: () => ZodISODuration,
|
|
7244
7246
|
ZodISOTime: () => ZodISOTime,
|
|
7247
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
7245
7248
|
ZodIntersection: () => ZodIntersection,
|
|
7246
7249
|
ZodIssueCode: () => ZodIssueCode,
|
|
7247
7250
|
ZodJWT: () => ZodJWT,
|
|
@@ -7264,6 +7267,7 @@ __export(external_exports, {
|
|
|
7264
7267
|
ZodPrefault: () => ZodPrefault,
|
|
7265
7268
|
ZodPreprocess: () => ZodPreprocess,
|
|
7266
7269
|
ZodPromise: () => ZodPromise,
|
|
7270
|
+
ZodProperties: () => ZodProperties,
|
|
7267
7271
|
ZodReadonly: () => ZodReadonly,
|
|
7268
7272
|
ZodRealError: () => ZodRealError,
|
|
7269
7273
|
ZodRecord: () => ZodRecord,
|
|
@@ -7339,6 +7343,7 @@ __export(external_exports, {
|
|
|
7339
7343
|
hex: () => hex2,
|
|
7340
7344
|
hostname: () => hostname2,
|
|
7341
7345
|
httpUrl: () => httpUrl,
|
|
7346
|
+
iban: () => iban2,
|
|
7342
7347
|
includes: () => _includes,
|
|
7343
7348
|
input: () => input,
|
|
7344
7349
|
instanceof: () => _instanceof,
|
|
@@ -7399,7 +7404,7 @@ __export(external_exports, {
|
|
|
7399
7404
|
preprocess: () => preprocess,
|
|
7400
7405
|
prettifyError: () => prettifyError,
|
|
7401
7406
|
promise: () => promise,
|
|
7402
|
-
properties: () =>
|
|
7407
|
+
properties: () => properties,
|
|
7403
7408
|
property: () => _property,
|
|
7404
7409
|
readonly: () => readonly,
|
|
7405
7410
|
record: () => record,
|
|
@@ -7450,6 +7455,7 @@ __export(external_exports, {
|
|
|
7450
7455
|
validate: () => validate,
|
|
7451
7456
|
validateAsync: () => validateAsync,
|
|
7452
7457
|
void: () => _void2,
|
|
7458
|
+
withParser: () => withParser,
|
|
7453
7459
|
xid: () => xid2,
|
|
7454
7460
|
xor: () => xor
|
|
7455
7461
|
});
|
|
@@ -7510,6 +7516,7 @@ __export(core_exports2, {
|
|
|
7510
7516
|
$ZodFile: () => $ZodFile,
|
|
7511
7517
|
$ZodFunction: () => $ZodFunction,
|
|
7512
7518
|
$ZodGUID: () => $ZodGUID,
|
|
7519
|
+
$ZodIBAN: () => $ZodIBAN,
|
|
7513
7520
|
$ZodIPv4: () => $ZodIPv4,
|
|
7514
7521
|
$ZodIPv6: () => $ZodIPv6,
|
|
7515
7522
|
$ZodISODate: () => $ZodISODate,
|
|
@@ -7538,6 +7545,7 @@ __export(core_exports2, {
|
|
|
7538
7545
|
$ZodPrefault: () => $ZodPrefault,
|
|
7539
7546
|
$ZodPreprocess: () => $ZodPreprocess,
|
|
7540
7547
|
$ZodPromise: () => $ZodPromise,
|
|
7548
|
+
$ZodProperties: () => $ZodProperties,
|
|
7541
7549
|
$ZodReadonly: () => $ZodReadonly,
|
|
7542
7550
|
$ZodRealError: () => $ZodRealError,
|
|
7543
7551
|
$ZodRecord: () => $ZodRecord,
|
|
@@ -7611,6 +7619,7 @@ __export(core_exports2, {
|
|
|
7611
7619
|
_gt: () => _gt,
|
|
7612
7620
|
_gte: () => _gte,
|
|
7613
7621
|
_guid: () => _guid,
|
|
7622
|
+
_iban: () => _iban,
|
|
7614
7623
|
_includes: () => _includes,
|
|
7615
7624
|
_int: () => _int,
|
|
7616
7625
|
_int32: () => _int32,
|
|
@@ -7702,6 +7711,8 @@ __export(core_exports2, {
|
|
|
7702
7711
|
_void: () => _void,
|
|
7703
7712
|
_xid: () => _xid,
|
|
7704
7713
|
_xor: () => _xor,
|
|
7714
|
+
base64Charset: () => base64Charset,
|
|
7715
|
+
base64urlCharset: () => base64urlCharset,
|
|
7705
7716
|
clone: () => clone,
|
|
7706
7717
|
compile: () => compile,
|
|
7707
7718
|
compileFn: () => compileFn,
|
|
@@ -7724,10 +7735,12 @@ __export(core_exports2, {
|
|
|
7724
7735
|
initializeContext: () => initializeContext,
|
|
7725
7736
|
isBackEdge: () => isBackEdge,
|
|
7726
7737
|
isRecursiveSchema: () => isRecursiveSchema,
|
|
7738
|
+
isTransforming: () => isTransforming,
|
|
7727
7739
|
isValidBase64: () => isValidBase64,
|
|
7728
7740
|
isValidBase64URL: () => isValidBase64URL,
|
|
7729
7741
|
isValidCIDRv6: () => isValidCIDRv6,
|
|
7730
7742
|
isValidCreditCard: () => isValidCreditCard,
|
|
7743
|
+
isValidIBAN: () => isValidIBAN,
|
|
7731
7744
|
isValidIPv6: () => isValidIPv6,
|
|
7732
7745
|
isValidJWT: () => isValidJWT,
|
|
7733
7746
|
locales: () => locales_exports,
|
|
@@ -7738,7 +7751,8 @@ __export(core_exports2, {
|
|
|
7738
7751
|
parseAsync: () => parseAsync,
|
|
7739
7752
|
parseURLObject: () => parseURLObject,
|
|
7740
7753
|
prettifyError: () => prettifyError,
|
|
7741
|
-
process: () =>
|
|
7754
|
+
process: () => processSchema,
|
|
7755
|
+
processSchema: () => processSchema,
|
|
7742
7756
|
regexes: () => regexes_exports,
|
|
7743
7757
|
registry: () => registry,
|
|
7744
7758
|
safeDecode: () => safeDecode,
|
|
@@ -7758,7 +7772,8 @@ __export(core_exports2, {
|
|
|
7758
7772
|
util: () => util_exports,
|
|
7759
7773
|
validate: () => validate,
|
|
7760
7774
|
validateAsync: () => validateAsync,
|
|
7761
|
-
version: () => version
|
|
7775
|
+
version: () => version,
|
|
7776
|
+
withParser: () => withParser
|
|
7762
7777
|
});
|
|
7763
7778
|
|
|
7764
7779
|
// ../../node_modules/zod/v4/core/util.js
|
|
@@ -7790,6 +7805,7 @@ __export(util_exports, {
|
|
|
7790
7805
|
createTransparentProxy: () => createTransparentProxy,
|
|
7791
7806
|
defineLazy: () => defineLazy,
|
|
7792
7807
|
defineLazyInternal: () => defineLazyInternal,
|
|
7808
|
+
derived: () => derived,
|
|
7793
7809
|
esc: () => esc,
|
|
7794
7810
|
escapeRegex: () => escapeRegex,
|
|
7795
7811
|
explicitlyAborted: () => explicitlyAborted,
|
|
@@ -7827,6 +7843,7 @@ __export(util_exports, {
|
|
|
7827
7843
|
promiseAllObject: () => promiseAllObject,
|
|
7828
7844
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
7829
7845
|
randomString: () => randomString,
|
|
7846
|
+
rawShape: () => rawShape,
|
|
7830
7847
|
required: () => required,
|
|
7831
7848
|
safeExtend: () => safeExtend,
|
|
7832
7849
|
shallowClone: () => shallowClone,
|
|
@@ -7867,18 +7884,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
7867
7884
|
return value.toString();
|
|
7868
7885
|
return value;
|
|
7869
7886
|
}
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7887
|
+
var Cached = class {
|
|
7888
|
+
constructor(getter) {
|
|
7889
|
+
this._getter = getter;
|
|
7890
|
+
this._value = void 0;
|
|
7891
|
+
}
|
|
7892
|
+
get value() {
|
|
7893
|
+
const getter = this._getter;
|
|
7894
|
+
if (getter !== void 0) {
|
|
7895
|
+
this._value = getter();
|
|
7896
|
+
this._getter = void 0;
|
|
7880
7897
|
}
|
|
7881
|
-
|
|
7898
|
+
return this._value;
|
|
7899
|
+
}
|
|
7900
|
+
};
|
|
7901
|
+
function cached(getter) {
|
|
7902
|
+
return new Cached(getter);
|
|
7882
7903
|
}
|
|
7883
7904
|
function nullish(input2) {
|
|
7884
7905
|
return input2 === null || input2 === void 0;
|
|
@@ -7930,6 +7951,56 @@ function assignProp(target, prop, value) {
|
|
|
7930
7951
|
configurable: true
|
|
7931
7952
|
});
|
|
7932
7953
|
}
|
|
7954
|
+
function rawShape(def) {
|
|
7955
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
7956
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
7957
|
+
}
|
|
7958
|
+
function sourceShape(schema) {
|
|
7959
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
7960
|
+
}
|
|
7961
|
+
function deferProp(target, key, getter) {
|
|
7962
|
+
Object.defineProperty(target, key, {
|
|
7963
|
+
get() {
|
|
7964
|
+
const value = getter();
|
|
7965
|
+
assignProp(this, key, value);
|
|
7966
|
+
return value;
|
|
7967
|
+
},
|
|
7968
|
+
enumerable: true,
|
|
7969
|
+
configurable: true
|
|
7970
|
+
});
|
|
7971
|
+
}
|
|
7972
|
+
function putProp(target, key, value) {
|
|
7973
|
+
if (key in target)
|
|
7974
|
+
assignProp(target, key, value);
|
|
7975
|
+
else
|
|
7976
|
+
target[key] = value;
|
|
7977
|
+
}
|
|
7978
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
7979
|
+
const raw = sourceShape(source);
|
|
7980
|
+
for (const key of keys) {
|
|
7981
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
7982
|
+
if (!desc.enumerable)
|
|
7983
|
+
continue;
|
|
7984
|
+
if (desc.get) {
|
|
7985
|
+
deferProp(target, key, () => {
|
|
7986
|
+
const value = source._zod.def.shape[key];
|
|
7987
|
+
return wrap ? wrap(value, key) : value;
|
|
7988
|
+
});
|
|
7989
|
+
} else
|
|
7990
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
7991
|
+
}
|
|
7992
|
+
}
|
|
7993
|
+
function mirrorProps(target, source) {
|
|
7994
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
7995
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
7996
|
+
if (!desc.enumerable)
|
|
7997
|
+
continue;
|
|
7998
|
+
if (desc.get)
|
|
7999
|
+
deferProp(target, key, () => source[key]);
|
|
8000
|
+
else
|
|
8001
|
+
putProp(target, key, desc.value);
|
|
8002
|
+
}
|
|
8003
|
+
}
|
|
7933
8004
|
function mergeDefs(...defs) {
|
|
7934
8005
|
const mergedDescriptors = {};
|
|
7935
8006
|
for (const def of defs) {
|
|
@@ -8168,23 +8239,21 @@ function pick(schema, mask) {
|
|
|
8168
8239
|
if (hasChecks) {
|
|
8169
8240
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
8170
8241
|
}
|
|
8171
|
-
const
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
});
|
|
8187
|
-
return clone(schema, def);
|
|
8242
|
+
const newShape = {};
|
|
8243
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
8244
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
8245
|
+
}
|
|
8246
|
+
function maskedKeys(schema, mask) {
|
|
8247
|
+
const raw = sourceShape(schema);
|
|
8248
|
+
const keys = [];
|
|
8249
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
8250
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
8251
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
8252
|
+
}
|
|
8253
|
+
if (mask[key])
|
|
8254
|
+
keys.push(key);
|
|
8255
|
+
}
|
|
8256
|
+
return keys;
|
|
8188
8257
|
}
|
|
8189
8258
|
function omit(schema, mask) {
|
|
8190
8259
|
const currDef = schema._zod.def;
|
|
@@ -8193,23 +8262,10 @@ function omit(schema, mask) {
|
|
|
8193
8262
|
if (hasChecks) {
|
|
8194
8263
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
8195
8264
|
}
|
|
8196
|
-
const
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
8201
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
8202
|
-
}
|
|
8203
|
-
if (!mask[key])
|
|
8204
|
-
continue;
|
|
8205
|
-
delete newShape[key];
|
|
8206
|
-
}
|
|
8207
|
-
assignProp(this, "shape", newShape);
|
|
8208
|
-
return newShape;
|
|
8209
|
-
},
|
|
8210
|
-
checks: []
|
|
8211
|
-
});
|
|
8212
|
-
return clone(schema, def);
|
|
8265
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
8266
|
+
const newShape = {};
|
|
8267
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
8268
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
8213
8269
|
}
|
|
8214
8270
|
function extend(schema, shape) {
|
|
8215
8271
|
if (!isPlainObject(shape)) {
|
|
@@ -8218,34 +8274,26 @@ function extend(schema, shape) {
|
|
|
8218
8274
|
const checks = schema._zod.def.checks;
|
|
8219
8275
|
const hasChecks = checks && checks.length > 0;
|
|
8220
8276
|
if (hasChecks) {
|
|
8221
|
-
const existingShape = schema
|
|
8277
|
+
const existingShape = sourceShape(schema);
|
|
8222
8278
|
for (const key of Reflect.ownKeys(shape)) {
|
|
8223
8279
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
8224
8280
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
8225
8281
|
}
|
|
8226
8282
|
}
|
|
8227
8283
|
}
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
return clone(schema, def);
|
|
8284
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
8285
|
+
}
|
|
8286
|
+
function extended(schema, shape) {
|
|
8287
|
+
const newShape = {};
|
|
8288
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
8289
|
+
mirrorProps(newShape, shape);
|
|
8290
|
+
return newShape;
|
|
8236
8291
|
}
|
|
8237
8292
|
function safeExtend(schema, shape) {
|
|
8238
8293
|
if (!isPlainObject(shape)) {
|
|
8239
8294
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
8240
8295
|
}
|
|
8241
|
-
|
|
8242
|
-
get shape() {
|
|
8243
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
8244
|
-
assignProp(this, "shape", _shape);
|
|
8245
|
-
return _shape;
|
|
8246
|
-
}
|
|
8247
|
-
});
|
|
8248
|
-
return clone(schema, def);
|
|
8296
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
8249
8297
|
}
|
|
8250
8298
|
function merge(a, b) {
|
|
8251
8299
|
if (!b?._zod?.def) {
|
|
@@ -8254,12 +8302,11 @@ function merge(a, b) {
|
|
|
8254
8302
|
if (a._zod.def.checks?.length) {
|
|
8255
8303
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
8256
8304
|
}
|
|
8305
|
+
const newShape = {};
|
|
8306
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
8307
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
8257
8308
|
const def = mergeDefs(a._zod.def, {
|
|
8258
|
-
|
|
8259
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
8260
|
-
assignProp(this, "shape", _shape);
|
|
8261
|
-
return _shape;
|
|
8262
|
-
},
|
|
8309
|
+
shape: newShape,
|
|
8263
8310
|
get catchall() {
|
|
8264
8311
|
return b._zod.def.catchall;
|
|
8265
8312
|
},
|
|
@@ -8274,67 +8321,19 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
8274
8321
|
if (hasChecks) {
|
|
8275
8322
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
8276
8323
|
}
|
|
8277
|
-
const
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
if (mask) {
|
|
8282
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
8283
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
8284
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
8285
|
-
}
|
|
8286
|
-
if (!mask[key])
|
|
8287
|
-
continue;
|
|
8288
|
-
shape[key] = Class2 ? new Class2({
|
|
8289
|
-
type: "optional",
|
|
8290
|
-
innerType: oldShape[key]
|
|
8291
|
-
}) : oldShape[key];
|
|
8292
|
-
}
|
|
8293
|
-
} else {
|
|
8294
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
8295
|
-
shape[key] = Class2 ? new Class2({
|
|
8296
|
-
type: "optional",
|
|
8297
|
-
innerType: oldShape[key]
|
|
8298
|
-
}) : oldShape[key];
|
|
8299
|
-
}
|
|
8300
|
-
}
|
|
8301
|
-
assignProp(this, "shape", shape);
|
|
8302
|
-
return shape;
|
|
8303
|
-
},
|
|
8304
|
-
checks: []
|
|
8305
|
-
});
|
|
8306
|
-
return clone(schema, def);
|
|
8324
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
8325
|
+
const newShape = {};
|
|
8326
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
|
|
8327
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
8307
8328
|
}
|
|
8308
8329
|
function required(Class2, schema, mask) {
|
|
8309
|
-
const
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
8317
|
-
}
|
|
8318
|
-
if (!mask[key])
|
|
8319
|
-
continue;
|
|
8320
|
-
shape[key] = new Class2({
|
|
8321
|
-
type: "nonoptional",
|
|
8322
|
-
innerType: oldShape[key]
|
|
8323
|
-
});
|
|
8324
|
-
}
|
|
8325
|
-
} else {
|
|
8326
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
8327
|
-
shape[key] = new Class2({
|
|
8328
|
-
type: "nonoptional",
|
|
8329
|
-
innerType: oldShape[key]
|
|
8330
|
-
});
|
|
8331
|
-
}
|
|
8332
|
-
}
|
|
8333
|
-
assignProp(this, "shape", shape);
|
|
8334
|
-
return shape;
|
|
8335
|
-
}
|
|
8336
|
-
});
|
|
8337
|
-
return clone(schema, def);
|
|
8330
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
8331
|
+
const newShape = {};
|
|
8332
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
|
|
8333
|
+
// overwrite with non-optional
|
|
8334
|
+
selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
8335
|
+
));
|
|
8336
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
8338
8337
|
}
|
|
8339
8338
|
function aborted(x, startIndex = 0) {
|
|
8340
8339
|
if (x.aborted === true)
|
|
@@ -8384,13 +8383,18 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
8384
8383
|
}
|
|
8385
8384
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
8386
8385
|
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";
|
|
8387
|
-
const
|
|
8388
|
-
|
|
8389
|
-
|
|
8386
|
+
const full = {};
|
|
8387
|
+
for (const k of Object.keys(iss)) {
|
|
8388
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
8389
|
+
continue;
|
|
8390
|
+
full[k] = iss[k];
|
|
8391
|
+
}
|
|
8392
|
+
full.path ?? (full.path = []);
|
|
8393
|
+
full.message = message;
|
|
8390
8394
|
if (ctx?.reportInput) {
|
|
8391
|
-
|
|
8395
|
+
full.input = iss.input;
|
|
8392
8396
|
}
|
|
8393
|
-
return
|
|
8397
|
+
return full;
|
|
8394
8398
|
}
|
|
8395
8399
|
function getSizableOrigin(input2) {
|
|
8396
8400
|
if (input2 instanceof Set)
|
|
@@ -8509,6 +8513,9 @@ function members(proto, table) {
|
|
|
8509
8513
|
else
|
|
8510
8514
|
defineBound(proto, key, desc.value);
|
|
8511
8515
|
}
|
|
8516
|
+
for (const sym of Object.getOwnPropertySymbols(table)) {
|
|
8517
|
+
defineBound(proto, sym, table[sym]);
|
|
8518
|
+
}
|
|
8512
8519
|
}
|
|
8513
8520
|
function own(inst, key, value, enumerable = true) {
|
|
8514
8521
|
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
|
|
@@ -8517,6 +8524,23 @@ function own(inst, key, value, enumerable = true) {
|
|
|
8517
8524
|
function hide(inst, key, value) {
|
|
8518
8525
|
return own(inst, key, value, false);
|
|
8519
8526
|
}
|
|
8527
|
+
// @__NO_SIDE_EFFECTS__
|
|
8528
|
+
function derived(computes, table) {
|
|
8529
|
+
for (const key in computes) {
|
|
8530
|
+
const compute = computes[key];
|
|
8531
|
+
Object.defineProperty(table, key, {
|
|
8532
|
+
configurable: true,
|
|
8533
|
+
enumerable: true,
|
|
8534
|
+
get() {
|
|
8535
|
+
return own(this, key, compute(this));
|
|
8536
|
+
},
|
|
8537
|
+
set(value) {
|
|
8538
|
+
own(this, key, value);
|
|
8539
|
+
}
|
|
8540
|
+
});
|
|
8541
|
+
}
|
|
8542
|
+
return table;
|
|
8543
|
+
}
|
|
8520
8544
|
function defineBound(proto, key, fn) {
|
|
8521
8545
|
Object.defineProperty(proto, key, {
|
|
8522
8546
|
configurable: true,
|
|
@@ -8736,16 +8760,12 @@ var _messageDesc = {
|
|
|
8736
8760
|
enumerable: true,
|
|
8737
8761
|
configurable: true
|
|
8738
8762
|
};
|
|
8739
|
-
var _zodDesc2 = { value: void 0, enumerable: false };
|
|
8740
8763
|
var _issuesDesc = { value: void 0, enumerable: false };
|
|
8741
8764
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
8742
8765
|
var initializer = (inst, def) => {
|
|
8743
8766
|
inst.name = "$ZodError";
|
|
8744
|
-
_zodDesc2.value = inst._zod;
|
|
8745
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
8746
8767
|
_issuesDesc.value = def;
|
|
8747
8768
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
8748
|
-
_zodDesc2.value = void 0;
|
|
8749
8769
|
_issuesDesc.value = void 0;
|
|
8750
8770
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
8751
8771
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -8779,10 +8799,10 @@ function node(obj, key, make) {
|
|
|
8779
8799
|
}
|
|
8780
8800
|
return obj[key];
|
|
8781
8801
|
}
|
|
8782
|
-
function flattenError(
|
|
8802
|
+
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
8783
8803
|
const fieldErrors = {};
|
|
8784
8804
|
const formErrors = [];
|
|
8785
|
-
for (const sub of
|
|
8805
|
+
for (const sub of error62.issues) {
|
|
8786
8806
|
if (sub.path.length > 0) {
|
|
8787
8807
|
node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
8788
8808
|
} else {
|
|
@@ -8791,10 +8811,10 @@ function flattenError(error61, mapper = (issue2) => issue2.message) {
|
|
|
8791
8811
|
}
|
|
8792
8812
|
return { formErrors, fieldErrors };
|
|
8793
8813
|
}
|
|
8794
|
-
function formatError(
|
|
8814
|
+
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
8795
8815
|
const fieldErrors = { _errors: [] };
|
|
8796
|
-
const processError = (
|
|
8797
|
-
for (const issue2 of
|
|
8816
|
+
const processError = (error63, path = []) => {
|
|
8817
|
+
for (const issue2 of error63.issues) {
|
|
8798
8818
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
8799
8819
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
8800
8820
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -8836,14 +8856,14 @@ function formatError(error61, mapper = (issue2) => issue2.message) {
|
|
|
8836
8856
|
}
|
|
8837
8857
|
}
|
|
8838
8858
|
};
|
|
8839
|
-
processError(
|
|
8859
|
+
processError(error62);
|
|
8840
8860
|
return fieldErrors;
|
|
8841
8861
|
}
|
|
8842
|
-
function treeifyError(
|
|
8862
|
+
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
8843
8863
|
const result = { errors: [] };
|
|
8844
|
-
const processError = (
|
|
8864
|
+
const processError = (error63, path = []) => {
|
|
8845
8865
|
var _a3;
|
|
8846
|
-
for (const issue2 of
|
|
8866
|
+
for (const issue2 of error63.issues) {
|
|
8847
8867
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
8848
8868
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
8849
8869
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -8885,7 +8905,7 @@ function treeifyError(error61, mapper = (issue2) => issue2.message) {
|
|
|
8885
8905
|
}
|
|
8886
8906
|
}
|
|
8887
8907
|
};
|
|
8888
|
-
processError(
|
|
8908
|
+
processError(error62);
|
|
8889
8909
|
return result;
|
|
8890
8910
|
}
|
|
8891
8911
|
function toDotPath(_path) {
|
|
@@ -8906,9 +8926,9 @@ function toDotPath(_path) {
|
|
|
8906
8926
|
}
|
|
8907
8927
|
return segs.join("");
|
|
8908
8928
|
}
|
|
8909
|
-
function prettifyError(
|
|
8929
|
+
function prettifyError(error62) {
|
|
8910
8930
|
const lines = [];
|
|
8911
|
-
const issues = [...
|
|
8931
|
+
const issues = [...error62.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
8912
8932
|
for (const issue2 of issues) {
|
|
8913
8933
|
lines.push(`\u2716 ${issue2.message}`);
|
|
8914
8934
|
if (issue2.path?.length)
|
|
@@ -8960,33 +8980,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
8960
8980
|
if (result instanceof Promise) {
|
|
8961
8981
|
throw new $ZodAsyncError();
|
|
8962
8982
|
}
|
|
8963
|
-
return result.issues.length ? {
|
|
8964
|
-
success: false,
|
|
8965
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
8966
|
-
} : { success: true, data: result.value };
|
|
8983
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
8967
8984
|
};
|
|
8968
8985
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
8986
|
+
function failure(Err, issues, ctx) {
|
|
8987
|
+
let error62;
|
|
8988
|
+
return {
|
|
8989
|
+
success: false,
|
|
8990
|
+
get error() {
|
|
8991
|
+
if (!error62) {
|
|
8992
|
+
error62 = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
8993
|
+
issues = void 0;
|
|
8994
|
+
ctx = void 0;
|
|
8995
|
+
}
|
|
8996
|
+
return error62;
|
|
8997
|
+
},
|
|
8998
|
+
set error(e) {
|
|
8999
|
+
error62 = e;
|
|
9000
|
+
issues = void 0;
|
|
9001
|
+
ctx = void 0;
|
|
9002
|
+
}
|
|
9003
|
+
};
|
|
9004
|
+
}
|
|
8969
9005
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
8970
9006
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
8971
9007
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
8972
9008
|
if (result instanceof Promise)
|
|
8973
9009
|
result = await result;
|
|
8974
|
-
return result.issues.length ? {
|
|
8975
|
-
success: false,
|
|
8976
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
8977
|
-
} : { success: true, data: result.value };
|
|
9010
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
8978
9011
|
};
|
|
8979
9012
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
8980
9013
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
8981
9014
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
8982
9015
|
var validate = ((schema, value, _ctx) => {
|
|
8983
9016
|
const validator = schema._zod.bag.validator;
|
|
8984
|
-
if (validator !== void 0
|
|
8985
|
-
|
|
9017
|
+
if (validator !== void 0) {
|
|
9018
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
9019
|
+
return true;
|
|
9020
|
+
if (validator.definite === true && _ctx === void 0)
|
|
9021
|
+
return false;
|
|
9022
|
+
}
|
|
8986
9023
|
return validateFallback(schema, value, _ctx);
|
|
8987
9024
|
});
|
|
8988
9025
|
function validateFallback(schema, value, _ctx) {
|
|
8989
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
9026
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
8990
9027
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
8991
9028
|
let result;
|
|
8992
9029
|
if (fallbackRun) {
|
|
@@ -9001,7 +9038,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
9001
9038
|
return result.issues.length === 0;
|
|
9002
9039
|
}
|
|
9003
9040
|
var validateAsync = async (schema, value, _ctx) => {
|
|
9004
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
9041
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
9005
9042
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
9006
9043
|
if (result instanceof Promise)
|
|
9007
9044
|
result = await result;
|
|
@@ -9063,6 +9100,7 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
|
9063
9100
|
// ../../node_modules/zod/v4/core/regexes.js
|
|
9064
9101
|
var regexes_exports = {};
|
|
9065
9102
|
__export(regexes_exports, {
|
|
9103
|
+
anyString: () => anyString,
|
|
9066
9104
|
base64: () => base64,
|
|
9067
9105
|
base64url: () => base64url,
|
|
9068
9106
|
bigint: () => bigint,
|
|
@@ -9086,6 +9124,7 @@ __export(regexes_exports, {
|
|
|
9086
9124
|
hostname: () => hostname,
|
|
9087
9125
|
html5Email: () => html5Email,
|
|
9088
9126
|
httpProtocol: () => httpProtocol,
|
|
9127
|
+
iban: () => iban,
|
|
9089
9128
|
idnEmail: () => idnEmail,
|
|
9090
9129
|
integer: () => integer,
|
|
9091
9130
|
ipv4: () => ipv4,
|
|
@@ -9145,13 +9184,13 @@ var uuid = (version2) => {
|
|
|
9145
9184
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
9146
9185
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
9147
9186
|
var uuid7 = /* @__PURE__ */ uuid(7);
|
|
9148
|
-
var email = /^(
|
|
9187
|
+
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,}$/;
|
|
9149
9188
|
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])?)*$/;
|
|
9150
9189
|
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,}))$/;
|
|
9151
9190
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
9152
9191
|
var idnEmail = unicodeEmail;
|
|
9153
9192
|
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])?)*$/;
|
|
9154
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
9193
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
9155
9194
|
function emoji() {
|
|
9156
9195
|
return new RegExp(_emoji, "u");
|
|
9157
9196
|
}
|
|
@@ -9164,12 +9203,13 @@ var mac = (delimiter2) => {
|
|
|
9164
9203
|
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])$/;
|
|
9165
9204
|
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])$/;
|
|
9166
9205
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
9167
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
9206
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
9168
9207
|
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])?)*\.?$/;
|
|
9169
9208
|
var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
9170
9209
|
var httpProtocol = /^https?$/;
|
|
9171
9210
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
9172
9211
|
var creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
9212
|
+
var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
9173
9213
|
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])))`;
|
|
9174
9214
|
function anchor(source) {
|
|
9175
9215
|
return new RegExp(`^${source}$`);
|
|
@@ -9191,6 +9231,7 @@ function datetime(args) {
|
|
|
9191
9231
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
9192
9232
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
9193
9233
|
}
|
|
9234
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
9194
9235
|
var string = (params) => {
|
|
9195
9236
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
9196
9237
|
return new RegExp(`^${regex}$`);
|
|
@@ -9249,16 +9290,6 @@ var numericOriginMap = {
|
|
|
9249
9290
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
9250
9291
|
$ZodCheck.init(inst, def);
|
|
9251
9292
|
const origin = numericOriginMap[typeof def.value];
|
|
9252
|
-
inst._zod.onattach.push((inst2) => {
|
|
9253
|
-
const bag = inst2._zod.bag;
|
|
9254
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
9255
|
-
if (def.value < curr) {
|
|
9256
|
-
if (def.inclusive)
|
|
9257
|
-
bag.maximum = def.value;
|
|
9258
|
-
else
|
|
9259
|
-
bag.exclusiveMaximum = def.value;
|
|
9260
|
-
}
|
|
9261
|
-
});
|
|
9262
9293
|
inst._zod.check = (payload) => {
|
|
9263
9294
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
9264
9295
|
return;
|
|
@@ -9277,16 +9308,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
9277
9308
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
9278
9309
|
$ZodCheck.init(inst, def);
|
|
9279
9310
|
const origin = numericOriginMap[typeof def.value];
|
|
9280
|
-
inst._zod.onattach.push((inst2) => {
|
|
9281
|
-
const bag = inst2._zod.bag;
|
|
9282
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
9283
|
-
if (def.value > curr) {
|
|
9284
|
-
if (def.inclusive)
|
|
9285
|
-
bag.minimum = def.value;
|
|
9286
|
-
else
|
|
9287
|
-
bag.exclusiveMinimum = def.value;
|
|
9288
|
-
}
|
|
9289
|
-
});
|
|
9290
9311
|
inst._zod.check = (payload) => {
|
|
9291
9312
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
9292
9313
|
return;
|
|
@@ -9304,10 +9325,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
9304
9325
|
});
|
|
9305
9326
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
9306
9327
|
$ZodCheck.init(inst, def);
|
|
9307
|
-
inst._zod.onattach.push((inst2) => {
|
|
9308
|
-
var _a3;
|
|
9309
|
-
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
9310
|
-
});
|
|
9311
9328
|
inst._zod.check = (payload) => {
|
|
9312
9329
|
if (typeof payload.value !== typeof def.value)
|
|
9313
9330
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -9333,14 +9350,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
9333
9350
|
const isInt = def.format?.includes("int");
|
|
9334
9351
|
const origin = isInt ? "int" : "number";
|
|
9335
9352
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
9336
|
-
inst._zod.onattach.push((inst2) => {
|
|
9337
|
-
const bag = inst2._zod.bag;
|
|
9338
|
-
bag.format = def.format;
|
|
9339
|
-
bag.minimum = minimum;
|
|
9340
|
-
bag.maximum = maximum;
|
|
9341
|
-
if (isInt)
|
|
9342
|
-
bag.pattern = integer;
|
|
9343
|
-
});
|
|
9344
9353
|
inst._zod.check = (payload) => {
|
|
9345
9354
|
const input2 = payload.value;
|
|
9346
9355
|
if (isInt) {
|
|
@@ -9409,12 +9418,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
9409
9418
|
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
9410
9419
|
$ZodCheck.init(inst, def);
|
|
9411
9420
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
9412
|
-
inst._zod.onattach.push((inst2) => {
|
|
9413
|
-
const bag = inst2._zod.bag;
|
|
9414
|
-
bag.format = def.format;
|
|
9415
|
-
bag.minimum = minimum;
|
|
9416
|
-
bag.maximum = maximum;
|
|
9417
|
-
});
|
|
9418
9421
|
inst._zod.check = (payload) => {
|
|
9419
9422
|
const input2 = payload.value;
|
|
9420
9423
|
if (input2 < minimum) {
|
|
@@ -9445,11 +9448,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
9445
9448
|
var _a3;
|
|
9446
9449
|
$ZodCheck.init(inst, def);
|
|
9447
9450
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
9448
|
-
inst._zod.onattach.push((inst2) => {
|
|
9449
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
9450
|
-
if (def.maximum < curr)
|
|
9451
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
9452
|
-
});
|
|
9453
9451
|
inst._zod.check = (payload) => {
|
|
9454
9452
|
const input2 = payload.value;
|
|
9455
9453
|
const size = input2.size;
|
|
@@ -9470,11 +9468,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
9470
9468
|
var _a3;
|
|
9471
9469
|
$ZodCheck.init(inst, def);
|
|
9472
9470
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
9473
|
-
inst._zod.onattach.push((inst2) => {
|
|
9474
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
9475
|
-
if (def.minimum > curr)
|
|
9476
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
9477
|
-
});
|
|
9478
9471
|
inst._zod.check = (payload) => {
|
|
9479
9472
|
const input2 = payload.value;
|
|
9480
9473
|
const size = input2.size;
|
|
@@ -9495,12 +9488,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
9495
9488
|
var _a3;
|
|
9496
9489
|
$ZodCheck.init(inst, def);
|
|
9497
9490
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
9498
|
-
inst._zod.onattach.push((inst2) => {
|
|
9499
|
-
const bag = inst2._zod.bag;
|
|
9500
|
-
bag.minimum = def.size;
|
|
9501
|
-
bag.maximum = def.size;
|
|
9502
|
-
bag.size = def.size;
|
|
9503
|
-
});
|
|
9504
9491
|
inst._zod.check = (payload) => {
|
|
9505
9492
|
const input2 = payload.value;
|
|
9506
9493
|
const size = input2.size;
|
|
@@ -9522,11 +9509,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
9522
9509
|
var _a3;
|
|
9523
9510
|
$ZodCheck.init(inst, def);
|
|
9524
9511
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
9525
|
-
inst._zod.onattach.push((inst2) => {
|
|
9526
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
9527
|
-
if (def.maximum < curr)
|
|
9528
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
9529
|
-
});
|
|
9530
9512
|
inst._zod.check = (payload) => {
|
|
9531
9513
|
const input2 = payload.value;
|
|
9532
9514
|
const units = input2.length;
|
|
@@ -9549,11 +9531,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
9549
9531
|
var _a3;
|
|
9550
9532
|
$ZodCheck.init(inst, def);
|
|
9551
9533
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
9552
|
-
inst._zod.onattach.push((inst2) => {
|
|
9553
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
9554
|
-
if (def.minimum > curr)
|
|
9555
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
9556
|
-
});
|
|
9557
9534
|
inst._zod.check = (payload) => {
|
|
9558
9535
|
const input2 = payload.value;
|
|
9559
9536
|
const units = input2.length;
|
|
@@ -9576,12 +9553,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
9576
9553
|
var _a3;
|
|
9577
9554
|
$ZodCheck.init(inst, def);
|
|
9578
9555
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
9579
|
-
inst._zod.onattach.push((inst2) => {
|
|
9580
|
-
const bag = inst2._zod.bag;
|
|
9581
|
-
bag.minimum = def.length;
|
|
9582
|
-
bag.maximum = def.length;
|
|
9583
|
-
bag.length = def.length;
|
|
9584
|
-
});
|
|
9585
9556
|
inst._zod.check = (payload) => {
|
|
9586
9557
|
const input2 = payload.value;
|
|
9587
9558
|
const units = input2.length;
|
|
@@ -9604,14 +9575,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
9604
9575
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
9605
9576
|
var _a3, _b;
|
|
9606
9577
|
$ZodCheck.init(inst, def);
|
|
9607
|
-
inst._zod.onattach.push((inst2) => {
|
|
9608
|
-
const bag = inst2._zod.bag;
|
|
9609
|
-
bag.format = def.format;
|
|
9610
|
-
if (def.pattern) {
|
|
9611
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
9612
|
-
bag.patterns.add(def.pattern);
|
|
9613
|
-
}
|
|
9614
|
-
});
|
|
9615
9578
|
if (def.pattern)
|
|
9616
9579
|
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
9617
9580
|
def.pattern.lastIndex = 0;
|
|
@@ -9661,11 +9624,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
9661
9624
|
const escapedRegex = escapeRegex(def.includes);
|
|
9662
9625
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
9663
9626
|
def.pattern = pattern;
|
|
9664
|
-
inst._zod.onattach.push((inst2) => {
|
|
9665
|
-
const bag = inst2._zod.bag;
|
|
9666
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
9667
|
-
bag.patterns.add(pattern);
|
|
9668
|
-
});
|
|
9669
9627
|
inst._zod.check = (payload) => {
|
|
9670
9628
|
if (payload.value.includes(def.includes, def.position))
|
|
9671
9629
|
return;
|
|
@@ -9684,11 +9642,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
9684
9642
|
$ZodCheck.init(inst, def);
|
|
9685
9643
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
9686
9644
|
def.pattern ?? (def.pattern = pattern);
|
|
9687
|
-
inst._zod.onattach.push((inst2) => {
|
|
9688
|
-
const bag = inst2._zod.bag;
|
|
9689
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
9690
|
-
bag.patterns.add(pattern);
|
|
9691
|
-
});
|
|
9692
9645
|
inst._zod.check = (payload) => {
|
|
9693
9646
|
if (payload.value.startsWith(def.prefix))
|
|
9694
9647
|
return;
|
|
@@ -9707,11 +9660,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
9707
9660
|
$ZodCheck.init(inst, def);
|
|
9708
9661
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
9709
9662
|
def.pattern ?? (def.pattern = pattern);
|
|
9710
|
-
inst._zod.onattach.push((inst2) => {
|
|
9711
|
-
const bag = inst2._zod.bag;
|
|
9712
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
9713
|
-
bag.patterns.add(pattern);
|
|
9714
|
-
});
|
|
9715
9663
|
inst._zod.check = (payload) => {
|
|
9716
9664
|
if (payload.value.endsWith(def.suffix))
|
|
9717
9665
|
return;
|
|
@@ -9748,9 +9696,6 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
|
|
|
9748
9696
|
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
9749
9697
|
$ZodCheck.init(inst, def);
|
|
9750
9698
|
const mimeSet = new Set(def.mime);
|
|
9751
|
-
inst._zod.onattach.push((inst2) => {
|
|
9752
|
-
inst2._zod.bag.mime = def.mime;
|
|
9753
|
-
});
|
|
9754
9699
|
inst._zod.check = (payload) => {
|
|
9755
9700
|
if (mimeSet.has(payload.value.type))
|
|
9756
9701
|
return;
|
|
@@ -9778,10 +9723,14 @@ var Doc = class {
|
|
|
9778
9723
|
this.args = args;
|
|
9779
9724
|
this.closed = closed;
|
|
9780
9725
|
}
|
|
9726
|
+
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
|
|
9781
9727
|
indented(fn) {
|
|
9782
9728
|
this.indent += 1;
|
|
9783
|
-
|
|
9784
|
-
|
|
9729
|
+
try {
|
|
9730
|
+
fn(this);
|
|
9731
|
+
} finally {
|
|
9732
|
+
this.indent -= 1;
|
|
9733
|
+
}
|
|
9785
9734
|
}
|
|
9786
9735
|
write(arg) {
|
|
9787
9736
|
if (typeof arg === "function") {
|
|
@@ -9810,8 +9759,8 @@ ${content.join("\n")}
|
|
|
9810
9759
|
// ../../node_modules/zod/v4/core/versions.js
|
|
9811
9760
|
var version = {
|
|
9812
9761
|
major: 4,
|
|
9813
|
-
minor:
|
|
9814
|
-
patch:
|
|
9762
|
+
minor: 6,
|
|
9763
|
+
patch: 1
|
|
9815
9764
|
};
|
|
9816
9765
|
|
|
9817
9766
|
// ../../node_modules/zod/v4/core/schemas.js
|
|
@@ -9924,15 +9873,22 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
9924
9873
|
own(this, "~standard", value);
|
|
9925
9874
|
}
|
|
9926
9875
|
});
|
|
9927
|
-
var toStandardResult = (r) => r.
|
|
9876
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
9877
|
+
async function validateAsync2(inst, value) {
|
|
9878
|
+
const ctx = { async: true };
|
|
9879
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
9880
|
+
}
|
|
9928
9881
|
function standardProps(inst) {
|
|
9929
9882
|
return {
|
|
9930
9883
|
validate: (value) => {
|
|
9884
|
+
const ctx = { async: false };
|
|
9931
9885
|
try {
|
|
9932
|
-
|
|
9886
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
9887
|
+
if (!(r instanceof Promise))
|
|
9888
|
+
return toStandardResult(r, ctx);
|
|
9933
9889
|
} catch (_) {
|
|
9934
|
-
return safeParseAsync(inst, value).then(toStandardResult);
|
|
9935
9890
|
}
|
|
9891
|
+
return validateAsync2(inst, value);
|
|
9936
9892
|
},
|
|
9937
9893
|
vendor: "zod",
|
|
9938
9894
|
version: 1
|
|
@@ -9940,7 +9896,7 @@ function standardProps(inst) {
|
|
|
9940
9896
|
}
|
|
9941
9897
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
9942
9898
|
$ZodType.init(inst, def);
|
|
9943
|
-
inst._zod.pattern =
|
|
9899
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
9944
9900
|
inst._zod.parse = (payload, _) => {
|
|
9945
9901
|
if (def.coerce)
|
|
9946
9902
|
try {
|
|
@@ -10109,12 +10065,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
10109
10065
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
10110
10066
|
def.pattern ?? (def.pattern = datetime(def));
|
|
10111
10067
|
$ZodStringFormat.init(inst, def);
|
|
10112
|
-
if (def.local || def.precision === -1) {
|
|
10113
|
-
inst._zod.bag.laxFormat = true;
|
|
10114
|
-
inst._zod.onattach.push((s) => {
|
|
10115
|
-
s._zod.bag.laxFormat = true;
|
|
10116
|
-
});
|
|
10117
|
-
}
|
|
10118
10068
|
});
|
|
10119
10069
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
10120
10070
|
def.pattern ?? (def.pattern = date);
|
|
@@ -10131,7 +10081,6 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
10131
10081
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
10132
10082
|
def.pattern ?? (def.pattern = ipv4);
|
|
10133
10083
|
$ZodStringFormat.init(inst, def);
|
|
10134
|
-
inst._zod.bag.format = `ipv4`;
|
|
10135
10084
|
});
|
|
10136
10085
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
10137
10086
|
function isValidIPv6(value) {
|
|
@@ -10147,7 +10096,6 @@ function isValidIPv6(value) {
|
|
|
10147
10096
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
10148
10097
|
def.pattern ?? (def.pattern = ipv6);
|
|
10149
10098
|
$ZodStringFormat.init(inst, def);
|
|
10150
|
-
inst._zod.bag.format = `ipv6`;
|
|
10151
10099
|
inst._zod.check = (payload) => {
|
|
10152
10100
|
if (!isValidIPv6(payload.value)) {
|
|
10153
10101
|
payload.issues.push({
|
|
@@ -10163,7 +10111,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
10163
10111
|
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
|
|
10164
10112
|
def.pattern ?? (def.pattern = mac(def.delimiter));
|
|
10165
10113
|
$ZodStringFormat.init(inst, def);
|
|
10166
|
-
inst._zod.bag.format = `mac`;
|
|
10167
10114
|
});
|
|
10168
10115
|
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
10169
10116
|
def.pattern ?? (def.pattern = cidrv4);
|
|
@@ -10212,10 +10159,10 @@ function isValidBase64(data) {
|
|
|
10212
10159
|
return false;
|
|
10213
10160
|
}
|
|
10214
10161
|
}
|
|
10162
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
10215
10163
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
10216
|
-
def.pattern ?? (def.pattern =
|
|
10164
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
10217
10165
|
$ZodStringFormat.init(inst, def);
|
|
10218
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
10219
10166
|
inst._zod.check = (payload) => {
|
|
10220
10167
|
if (isValidBase64(payload.value))
|
|
10221
10168
|
return;
|
|
@@ -10228,17 +10175,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
10228
10175
|
});
|
|
10229
10176
|
};
|
|
10230
10177
|
});
|
|
10178
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
10231
10179
|
function isValidBase64URL(data) {
|
|
10232
|
-
if (!
|
|
10180
|
+
if (!base64urlCharset.test(data))
|
|
10233
10181
|
return false;
|
|
10234
10182
|
const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
10235
10183
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
10236
10184
|
return isValidBase64(padded);
|
|
10237
10185
|
}
|
|
10238
10186
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
10239
|
-
def.pattern ?? (def.pattern =
|
|
10187
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
10240
10188
|
$ZodStringFormat.init(inst, def);
|
|
10241
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
10242
10189
|
inst._zod.check = (payload) => {
|
|
10243
10190
|
if (isValidBase64URL(payload.value))
|
|
10244
10191
|
return;
|
|
@@ -10261,7 +10208,7 @@ function isLuhnAlgo(digits) {
|
|
|
10261
10208
|
let bit = 1;
|
|
10262
10209
|
let sum = 0;
|
|
10263
10210
|
while (length) {
|
|
10264
|
-
const value =
|
|
10211
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
10265
10212
|
bit ^= 1;
|
|
10266
10213
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
10267
10214
|
}
|
|
@@ -10287,6 +10234,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
|
|
|
10287
10234
|
});
|
|
10288
10235
|
};
|
|
10289
10236
|
});
|
|
10237
|
+
function isIso7064Mod97(iban3) {
|
|
10238
|
+
let remainder = 0;
|
|
10239
|
+
const len = iban3.length;
|
|
10240
|
+
for (let i = 4; i < len; i++) {
|
|
10241
|
+
const code = iban3.charCodeAt(i);
|
|
10242
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
10243
|
+
}
|
|
10244
|
+
for (let i = 0; i < 4; i++) {
|
|
10245
|
+
const code = iban3.charCodeAt(i);
|
|
10246
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
10247
|
+
}
|
|
10248
|
+
return remainder === 1;
|
|
10249
|
+
}
|
|
10250
|
+
function isValidIBAN(input2) {
|
|
10251
|
+
if (!iban.test(input2))
|
|
10252
|
+
return false;
|
|
10253
|
+
return isIso7064Mod97(input2);
|
|
10254
|
+
}
|
|
10255
|
+
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
10256
|
+
def.pattern ?? (def.pattern = iban);
|
|
10257
|
+
$ZodStringFormat.init(inst, def);
|
|
10258
|
+
inst._zod.check = (payload) => {
|
|
10259
|
+
if (isValidIBAN(payload.value))
|
|
10260
|
+
return;
|
|
10261
|
+
payload.issues.push({
|
|
10262
|
+
code: "invalid_format",
|
|
10263
|
+
format: "iban",
|
|
10264
|
+
input: payload.value,
|
|
10265
|
+
inst,
|
|
10266
|
+
continue: !def.abort
|
|
10267
|
+
});
|
|
10268
|
+
};
|
|
10269
|
+
});
|
|
10290
10270
|
function isValidJWT(token, algorithm = null) {
|
|
10291
10271
|
try {
|
|
10292
10272
|
const tokensParts = token.split(".");
|
|
@@ -10337,7 +10317,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
|
|
|
10337
10317
|
});
|
|
10338
10318
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
10339
10319
|
$ZodType.init(inst, def);
|
|
10340
|
-
inst._zod.pattern =
|
|
10320
|
+
inst._zod.pattern = number;
|
|
10341
10321
|
inst._zod.parse = (payload, _ctx) => {
|
|
10342
10322
|
if (def.coerce)
|
|
10343
10323
|
try {
|
|
@@ -10539,6 +10519,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
10539
10519
|
}
|
|
10540
10520
|
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input2.length), ctx) : Array(input2.length);
|
|
10541
10521
|
const proms = [];
|
|
10522
|
+
const abortEarly = ctx?.abortEarly;
|
|
10542
10523
|
for (let i = 0; i < input2.length; i++) {
|
|
10543
10524
|
const item = input2[i];
|
|
10544
10525
|
const result = def.element._zod.run({
|
|
@@ -10549,6 +10530,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
10549
10530
|
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
10550
10531
|
} else {
|
|
10551
10532
|
handleArrayResult(result, payload, i);
|
|
10533
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
10534
|
+
break;
|
|
10552
10535
|
}
|
|
10553
10536
|
}
|
|
10554
10537
|
if (proms.length) {
|
|
@@ -10610,14 +10593,20 @@ function normalizeDef(def) {
|
|
|
10610
10593
|
optionalKeys: new Set(okeys)
|
|
10611
10594
|
};
|
|
10612
10595
|
}
|
|
10613
|
-
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
10596
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
10614
10597
|
const unrecognized = [];
|
|
10615
10598
|
const keySet = def.keySet;
|
|
10616
10599
|
const _catchall = def.catchall._zod;
|
|
10617
10600
|
const t = _catchall.def.type;
|
|
10618
10601
|
const optin = _catchall.optin;
|
|
10619
10602
|
const optout = _catchall.optout;
|
|
10603
|
+
let seen = 0;
|
|
10620
10604
|
for (const key in input2) {
|
|
10605
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
10606
|
+
if (aborted(payload, seen))
|
|
10607
|
+
break;
|
|
10608
|
+
seen = payload.issues.length;
|
|
10609
|
+
}
|
|
10621
10610
|
if (keySet.has(key))
|
|
10622
10611
|
continue;
|
|
10623
10612
|
if (key === "__proto__") {
|
|
@@ -10652,23 +10641,19 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
|
10652
10641
|
return payload;
|
|
10653
10642
|
});
|
|
10654
10643
|
}
|
|
10655
|
-
var propShapes = /* @__PURE__ */ new WeakMap();
|
|
10656
10644
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
10657
10645
|
$ZodType.init(inst, def);
|
|
10658
10646
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
return newSh;
|
|
10670
|
-
}
|
|
10671
|
-
});
|
|
10647
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
10648
|
+
if (sh) {
|
|
10649
|
+
const get = () => {
|
|
10650
|
+
const newSh = { ...sh };
|
|
10651
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
10652
|
+
get.raw = newSh;
|
|
10653
|
+
return newSh;
|
|
10654
|
+
};
|
|
10655
|
+
get.raw = sh;
|
|
10656
|
+
Object.defineProperty(def, "shape", { get });
|
|
10672
10657
|
}
|
|
10673
10658
|
const _normalized = cached(() => normalizeDef(def));
|
|
10674
10659
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -10708,7 +10693,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
10708
10693
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
10709
10694
|
const proms = [];
|
|
10710
10695
|
const shape = value.shape;
|
|
10696
|
+
const abortEarly = ctx?.abortEarly;
|
|
10697
|
+
let seen = payload.issues.length;
|
|
10711
10698
|
for (const key of value.allKeys) {
|
|
10699
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
10700
|
+
if (aborted(payload, seen))
|
|
10701
|
+
break;
|
|
10702
|
+
seen = payload.issues.length;
|
|
10703
|
+
}
|
|
10712
10704
|
if (key === "__proto__")
|
|
10713
10705
|
continue;
|
|
10714
10706
|
const el = shape[key];
|
|
@@ -10724,7 +10716,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
10724
10716
|
if (!catchall) {
|
|
10725
10717
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
10726
10718
|
}
|
|
10727
|
-
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
10719
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
10728
10720
|
};
|
|
10729
10721
|
});
|
|
10730
10722
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -10738,10 +10730,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
10738
10730
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
10739
10731
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
10740
10732
|
const prefixStr = (id, k) => `
|
|
10733
|
+
let ${id}_ab = false;
|
|
10741
10734
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
10742
10735
|
const iss = ${id}.issues[i];
|
|
10743
10736
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
10744
10737
|
payload.issues.push(iss);
|
|
10738
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
10739
|
+
}
|
|
10740
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
10741
|
+
payload.value = newResult;
|
|
10742
|
+
return payload;
|
|
10745
10743
|
}`;
|
|
10746
10744
|
doc.write(`const input = payload.value;`);
|
|
10747
10745
|
const ids2 = /* @__PURE__ */ Object.create(null);
|
|
@@ -10787,6 +10785,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
10787
10785
|
input: undefined,
|
|
10788
10786
|
path: [${k}]
|
|
10789
10787
|
});
|
|
10788
|
+
if (ctx && ctx.abortEarly) {
|
|
10789
|
+
payload.value = newResult;
|
|
10790
|
+
return payload;
|
|
10791
|
+
}
|
|
10790
10792
|
}
|
|
10791
10793
|
|
|
10792
10794
|
if (${id}_present) {
|
|
@@ -10839,7 +10841,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
10839
10841
|
payload = fastpass(payload, ctx);
|
|
10840
10842
|
if (!catchall)
|
|
10841
10843
|
return payload;
|
|
10842
|
-
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
10844
|
+
return handleCatchall([], input2, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
10843
10845
|
}
|
|
10844
10846
|
return superParse(payload, ctx);
|
|
10845
10847
|
};
|
|
@@ -10971,16 +10973,31 @@ function getDiscriminatedOption(union2, value) {
|
|
|
10971
10973
|
const internals = union2._zod;
|
|
10972
10974
|
let map2 = internals.bag.optionsMap;
|
|
10973
10975
|
if (!map2) {
|
|
10974
|
-
map2 =
|
|
10975
|
-
const { options, discriminator } = internals.def;
|
|
10976
|
-
for (const option of options) {
|
|
10977
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
10978
|
-
if (!map2.has(v))
|
|
10979
|
-
map2.set(v, option);
|
|
10980
|
-
}
|
|
10976
|
+
map2 = discriminatorMap(internals.def);
|
|
10981
10977
|
internals.bag.optionsMap = map2;
|
|
10982
10978
|
}
|
|
10983
|
-
|
|
10979
|
+
const option = map2.get(value);
|
|
10980
|
+
if (option === null)
|
|
10981
|
+
throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
10982
|
+
return option;
|
|
10983
|
+
}
|
|
10984
|
+
function discriminatorMap(def) {
|
|
10985
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
10986
|
+
for (const option of def.options) {
|
|
10987
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
10988
|
+
if (!values || values.size === 0)
|
|
10989
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
10990
|
+
for (const value of values) {
|
|
10991
|
+
if (map2.has(value)) {
|
|
10992
|
+
if (value !== void 0)
|
|
10993
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
10994
|
+
map2.set(value, null);
|
|
10995
|
+
} else {
|
|
10996
|
+
map2.set(value, option);
|
|
10997
|
+
}
|
|
10998
|
+
}
|
|
10999
|
+
}
|
|
11000
|
+
return map2;
|
|
10984
11001
|
}
|
|
10985
11002
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
10986
11003
|
def.inclusive = false;
|
|
@@ -10988,10 +11005,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
10988
11005
|
const _super = inst._zod.parse;
|
|
10989
11006
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
10990
11007
|
const propValues = {};
|
|
11008
|
+
let undefinedCount = 0;
|
|
10991
11009
|
for (const option of zod.def.options) {
|
|
10992
11010
|
const pv = option._zod.propValues;
|
|
10993
11011
|
if (!pv || Object.keys(pv).length === 0)
|
|
10994
11012
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
11013
|
+
if (pv[zod.def.discriminator]?.has(void 0))
|
|
11014
|
+
undefinedCount++;
|
|
10995
11015
|
for (const [k, v] of Object.entries(pv)) {
|
|
10996
11016
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
10997
11017
|
assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
@@ -11001,30 +11021,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
11001
11021
|
}
|
|
11002
11022
|
}
|
|
11003
11023
|
}
|
|
11024
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
11025
|
+
propValues[zod.def.discriminator]?.delete(void 0);
|
|
11004
11026
|
return propValues;
|
|
11005
11027
|
});
|
|
11006
11028
|
def.options.forEach((option, i) => {
|
|
11007
|
-
const propShape =
|
|
11029
|
+
const propShape = rawShape(option._zod.def);
|
|
11008
11030
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
11009
11031
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
11010
11032
|
}
|
|
11011
11033
|
});
|
|
11012
|
-
const disc = cached(() =>
|
|
11013
|
-
const opts = def.options;
|
|
11014
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
11015
|
-
for (const o of opts) {
|
|
11016
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
11017
|
-
if (!values || values.size === 0)
|
|
11018
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
11019
|
-
for (const v of values) {
|
|
11020
|
-
if (map2.has(v)) {
|
|
11021
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
11022
|
-
}
|
|
11023
|
-
map2.set(v, o);
|
|
11024
|
-
}
|
|
11025
|
-
}
|
|
11026
|
-
return map2;
|
|
11027
|
-
});
|
|
11034
|
+
const disc = cached(() => discriminatorMap(def));
|
|
11028
11035
|
inst._zod.parse = (payload, ctx) => {
|
|
11029
11036
|
const input2 = payload.value;
|
|
11030
11037
|
if (!isObject(input2)) {
|
|
@@ -11036,8 +11043,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
11036
11043
|
});
|
|
11037
11044
|
return payload;
|
|
11038
11045
|
}
|
|
11039
|
-
const
|
|
11040
|
-
|
|
11046
|
+
const value = input2?.[def.discriminator];
|
|
11047
|
+
const opt = disc.value.get(value);
|
|
11048
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) {
|
|
11041
11049
|
return opt._zod.run(payload, ctx);
|
|
11042
11050
|
}
|
|
11043
11051
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -11048,7 +11056,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
11048
11056
|
errors: [],
|
|
11049
11057
|
note: "No matching discriminator",
|
|
11050
11058
|
discriminator: def.discriminator,
|
|
11051
|
-
options: Array.from(disc.value.keys()),
|
|
11059
|
+
options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
|
|
11052
11060
|
input: input2,
|
|
11053
11061
|
path: [def.discriminator],
|
|
11054
11062
|
inst
|
|
@@ -11214,6 +11222,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
11214
11222
|
}
|
|
11215
11223
|
}
|
|
11216
11224
|
const itemResults = new Array(items.length);
|
|
11225
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
11226
|
+
let itemAborted = false;
|
|
11217
11227
|
for (let i = 0; i < items.length; i++) {
|
|
11218
11228
|
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
11219
11229
|
if (r instanceof Promise) {
|
|
@@ -11222,12 +11232,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
11222
11232
|
}));
|
|
11223
11233
|
} else {
|
|
11224
11234
|
itemResults[i] = r;
|
|
11235
|
+
if (abortEarly && !itemAborted && r.issues.length)
|
|
11236
|
+
itemAborted = aborted(r);
|
|
11225
11237
|
}
|
|
11226
11238
|
}
|
|
11227
|
-
if (def.rest) {
|
|
11239
|
+
if (def.rest && !itemAborted) {
|
|
11228
11240
|
let i = items.length - 1;
|
|
11229
11241
|
const rest = input2.slice(items.length);
|
|
11242
|
+
let seen = payload.issues.length;
|
|
11230
11243
|
for (const el of rest) {
|
|
11244
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
11245
|
+
if (aborted(payload, seen))
|
|
11246
|
+
break;
|
|
11247
|
+
seen = payload.issues.length;
|
|
11248
|
+
}
|
|
11231
11249
|
i++;
|
|
11232
11250
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
11233
11251
|
if (result instanceof Promise) {
|
|
@@ -11455,7 +11473,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
11455
11473
|
}
|
|
11456
11474
|
const proms = [];
|
|
11457
11475
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
11476
|
+
const abortEarly = ctx?.abortEarly;
|
|
11477
|
+
let seen = payload.issues.length;
|
|
11458
11478
|
for (const [key, value] of input2) {
|
|
11479
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
11480
|
+
if (aborted(payload, seen))
|
|
11481
|
+
break;
|
|
11482
|
+
seen = payload.issues.length;
|
|
11483
|
+
}
|
|
11459
11484
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
11460
11485
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
11461
11486
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
@@ -11518,7 +11543,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
11518
11543
|
}
|
|
11519
11544
|
const proms = [];
|
|
11520
11545
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
11546
|
+
const abortEarly = ctx?.abortEarly;
|
|
11547
|
+
let seen = payload.issues.length;
|
|
11521
11548
|
for (const item of input2) {
|
|
11549
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
11550
|
+
if (aborted(payload, seen))
|
|
11551
|
+
break;
|
|
11552
|
+
seen = payload.issues.length;
|
|
11553
|
+
}
|
|
11522
11554
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
11523
11555
|
if (result instanceof Promise) {
|
|
11524
11556
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -11541,8 +11573,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
11541
11573
|
const values = getEnumValues(def.entries);
|
|
11542
11574
|
const valuesSet = new Set(values);
|
|
11543
11575
|
inst._zod.values = valuesSet;
|
|
11544
|
-
|
|
11545
|
-
|
|
11576
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
11577
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
11578
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
11579
|
+
});
|
|
11546
11580
|
inst._zod.parse = (payload, _ctx) => {
|
|
11547
11581
|
const input2 = payload.value;
|
|
11548
11582
|
if (valuesSet.has(input2)) {
|
|
@@ -11561,7 +11595,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
11561
11595
|
$ZodType.init(inst, def);
|
|
11562
11596
|
const values = new Set(def.values);
|
|
11563
11597
|
inst._zod.values = values;
|
|
11564
|
-
inst
|
|
11598
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
11599
|
+
const vals = zod.def.values;
|
|
11600
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
11601
|
+
});
|
|
11565
11602
|
inst._zod.parse = (payload, _ctx) => {
|
|
11566
11603
|
const input2 = payload.value;
|
|
11567
11604
|
if (values.has(input2)) {
|
|
@@ -11899,20 +11936,62 @@ function handleReadonlyResult(payload) {
|
|
|
11899
11936
|
payload.value = Object.freeze(payload.value);
|
|
11900
11937
|
return payload;
|
|
11901
11938
|
}
|
|
11939
|
+
function leafPattern(schema) {
|
|
11940
|
+
const def = schema._zod.def;
|
|
11941
|
+
let pattern = def.pattern;
|
|
11942
|
+
let isInt = !!def.format?.includes("int");
|
|
11943
|
+
let minimum;
|
|
11944
|
+
let maximum;
|
|
11945
|
+
for (const ch of def.checks ?? []) {
|
|
11946
|
+
const d = ch._zod.def;
|
|
11947
|
+
if (d.pattern)
|
|
11948
|
+
pattern = d.pattern;
|
|
11949
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
11950
|
+
const lo = d.minimum ?? d.length;
|
|
11951
|
+
const hi = d.maximum ?? d.length;
|
|
11952
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum))
|
|
11953
|
+
minimum = lo;
|
|
11954
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum))
|
|
11955
|
+
maximum = hi;
|
|
11956
|
+
}
|
|
11957
|
+
if (pattern)
|
|
11958
|
+
return pattern.source;
|
|
11959
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum)
|
|
11960
|
+
return "(?!)";
|
|
11961
|
+
if (minimum !== void 0 || maximum !== void 0)
|
|
11962
|
+
return string({ minimum, maximum }).source;
|
|
11963
|
+
const own2 = schema._zod.pattern;
|
|
11964
|
+
return (isInt && own2 === number ? integer : own2)?.source;
|
|
11965
|
+
}
|
|
11966
|
+
function partPattern(schema) {
|
|
11967
|
+
const def = schema._zod.def;
|
|
11968
|
+
const own2 = schema._zod.pattern?.source;
|
|
11969
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
11970
|
+
if (inner) {
|
|
11971
|
+
const before = inner._zod.pattern?.source;
|
|
11972
|
+
const after = partPattern(inner);
|
|
11973
|
+
if (own2 && before && after && after !== before) {
|
|
11974
|
+
return own2.replace(cleanRegex(before), () => cleanRegex(after));
|
|
11975
|
+
}
|
|
11976
|
+
return own2;
|
|
11977
|
+
}
|
|
11978
|
+
if (def.options) {
|
|
11979
|
+
const sources = def.options.map(partPattern);
|
|
11980
|
+
if (sources.every(Boolean))
|
|
11981
|
+
return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
11982
|
+
}
|
|
11983
|
+
return leafPattern(schema);
|
|
11984
|
+
}
|
|
11902
11985
|
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
11903
11986
|
$ZodType.init(inst, def);
|
|
11904
11987
|
const regexParts = [];
|
|
11905
11988
|
for (const part of def.parts) {
|
|
11906
11989
|
if (typeof part === "object" && part !== null) {
|
|
11907
|
-
|
|
11990
|
+
const source = partPattern(part);
|
|
11991
|
+
if (!source) {
|
|
11908
11992
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
11909
11993
|
}
|
|
11910
|
-
|
|
11911
|
-
if (!source)
|
|
11912
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
11913
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
11914
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
11915
|
-
regexParts.push(source.slice(start, end));
|
|
11994
|
+
regexParts.push(cleanRegex(source));
|
|
11916
11995
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
11917
11996
|
regexParts.push(escapeRegex(`${part}`));
|
|
11918
11997
|
} else {
|
|
@@ -12077,6 +12156,59 @@ function handleRefineResult(result, payload, input2, inst) {
|
|
|
12077
12156
|
payload.issues.push(issue(_iss));
|
|
12078
12157
|
}
|
|
12079
12158
|
}
|
|
12159
|
+
function handlePropertiesResult(result, payload, key) {
|
|
12160
|
+
if (result.issues.length) {
|
|
12161
|
+
payload.issues.push(...prefixIssues(key, result.issues));
|
|
12162
|
+
}
|
|
12163
|
+
}
|
|
12164
|
+
var $ZodProperties = /* @__PURE__ */ $constructor("$ZodProperties", (inst, def) => {
|
|
12165
|
+
$ZodType.init(inst, def);
|
|
12166
|
+
$ZodCheck.init(inst, def);
|
|
12167
|
+
const memo2 = globalConfig.memoizer;
|
|
12168
|
+
memo2?.attach(inst);
|
|
12169
|
+
let entries;
|
|
12170
|
+
const runShape = (payload, ctx) => {
|
|
12171
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
12172
|
+
const input2 = payload.value;
|
|
12173
|
+
let proms;
|
|
12174
|
+
for (const [key, schema] of entries) {
|
|
12175
|
+
const result = schema._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
12176
|
+
if (result instanceof Promise) {
|
|
12177
|
+
proms ?? (proms = []);
|
|
12178
|
+
proms.push(result.then((result2) => handlePropertiesResult(result2, payload, key)));
|
|
12179
|
+
} else {
|
|
12180
|
+
handlePropertiesResult(result, payload, key);
|
|
12181
|
+
}
|
|
12182
|
+
}
|
|
12183
|
+
if (proms)
|
|
12184
|
+
return Promise.all(proms).then(() => void 0);
|
|
12185
|
+
return void 0;
|
|
12186
|
+
};
|
|
12187
|
+
inst._zod.parse = (payload, ctx) => {
|
|
12188
|
+
const input2 = payload.value;
|
|
12189
|
+
if (input2 === null || typeof input2 !== "object" && typeof input2 !== "function") {
|
|
12190
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: input2, inst });
|
|
12191
|
+
return payload;
|
|
12192
|
+
}
|
|
12193
|
+
if (ctx.direction === "backward")
|
|
12194
|
+
ctx = { ...ctx, direction: "forward" };
|
|
12195
|
+
if (memo2)
|
|
12196
|
+
memo2.alloc(inst, payload, input2, ctx);
|
|
12197
|
+
const result = runShape(payload, ctx);
|
|
12198
|
+
return result instanceof Promise ? result.then(() => payload) : payload;
|
|
12199
|
+
};
|
|
12200
|
+
inst._zod.check = (payload) => {
|
|
12201
|
+
if (payload.value == null) {
|
|
12202
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
12203
|
+
return void 0;
|
|
12204
|
+
}
|
|
12205
|
+
return runShape(payload, {});
|
|
12206
|
+
};
|
|
12207
|
+
}, {
|
|
12208
|
+
*[Symbol.iterator]() {
|
|
12209
|
+
yield this;
|
|
12210
|
+
}
|
|
12211
|
+
});
|
|
12080
12212
|
|
|
12081
12213
|
// ../../node_modules/zod/v4/core/memoizer.js
|
|
12082
12214
|
var $ZodCyclicError = class extends Error {
|
|
@@ -12087,31 +12219,59 @@ var $ZodCyclicError = class extends Error {
|
|
|
12087
12219
|
};
|
|
12088
12220
|
var STATE = "~memo";
|
|
12089
12221
|
var NO_ISSUES = [];
|
|
12222
|
+
function isRef(value) {
|
|
12223
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
12224
|
+
}
|
|
12090
12225
|
function cloneIssues(issues) {
|
|
12091
12226
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
12092
12227
|
}
|
|
12093
12228
|
var recursive = /* @__PURE__ */ new WeakMap();
|
|
12094
|
-
|
|
12229
|
+
var NONE = 0;
|
|
12230
|
+
var ASSUMED = 1;
|
|
12231
|
+
var PROVEN = 2;
|
|
12232
|
+
function isRecursive(inst, stack, resolve) {
|
|
12095
12233
|
const cached2 = recursive.get(inst);
|
|
12096
12234
|
if (cached2 !== void 0)
|
|
12097
|
-
return cached2;
|
|
12235
|
+
return cached2 ? PROVEN : NONE;
|
|
12098
12236
|
if (stack.has(inst))
|
|
12099
|
-
return
|
|
12237
|
+
return PROVEN;
|
|
12100
12238
|
stack.add(inst);
|
|
12101
|
-
let result =
|
|
12239
|
+
let result = NONE;
|
|
12102
12240
|
const check2 = (child) => {
|
|
12103
|
-
if (
|
|
12104
|
-
|
|
12241
|
+
if (result !== PROVEN && child?._zod) {
|
|
12242
|
+
const answer = isRecursive(child, stack, resolve);
|
|
12243
|
+
if (answer > result)
|
|
12244
|
+
result = answer;
|
|
12245
|
+
}
|
|
12246
|
+
};
|
|
12247
|
+
const shape = (sh, spread) => {
|
|
12248
|
+
let answer = NONE;
|
|
12249
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
12250
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
12251
|
+
if (spread && !desc.enumerable)
|
|
12252
|
+
continue;
|
|
12253
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
12254
|
+
if (child > answer)
|
|
12255
|
+
answer = child;
|
|
12256
|
+
}
|
|
12257
|
+
return answer;
|
|
12258
|
+
};
|
|
12259
|
+
const merge2 = (answer) => {
|
|
12260
|
+
if (answer > result)
|
|
12261
|
+
result = answer;
|
|
12105
12262
|
};
|
|
12106
12263
|
const def = inst._zod.def;
|
|
12107
12264
|
const kind = def.type;
|
|
12108
12265
|
switch (kind) {
|
|
12109
12266
|
case "object": {
|
|
12110
|
-
|
|
12111
|
-
|
|
12267
|
+
const raw = rawShape(def);
|
|
12268
|
+
merge2(raw ? shape(raw, true) : ASSUMED);
|
|
12112
12269
|
check2(def.catchall);
|
|
12113
12270
|
break;
|
|
12114
12271
|
}
|
|
12272
|
+
case "properties":
|
|
12273
|
+
merge2(shape(def.shape, false));
|
|
12274
|
+
break;
|
|
12115
12275
|
case "array":
|
|
12116
12276
|
check2(def.element);
|
|
12117
12277
|
break;
|
|
@@ -12155,10 +12315,12 @@ function isRecursive(inst, stack) {
|
|
|
12155
12315
|
check2(def.input);
|
|
12156
12316
|
check2(def.output);
|
|
12157
12317
|
break;
|
|
12158
|
-
//
|
|
12159
|
-
case "lazy":
|
|
12160
|
-
|
|
12318
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
12319
|
+
case "lazy": {
|
|
12320
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
12321
|
+
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
12161
12322
|
break;
|
|
12323
|
+
}
|
|
12162
12324
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
12163
12325
|
case "template_literal":
|
|
12164
12326
|
// leaves
|
|
@@ -12200,16 +12362,20 @@ function isRecursive(inst, stack) {
|
|
|
12200
12362
|
}
|
|
12201
12363
|
}
|
|
12202
12364
|
stack.delete(inst);
|
|
12203
|
-
|
|
12204
|
-
|
|
12365
|
+
return settle(inst, result);
|
|
12366
|
+
}
|
|
12367
|
+
function settle(inst, answer) {
|
|
12368
|
+
if (answer !== ASSUMED)
|
|
12369
|
+
recursive.set(inst, answer === PROVEN);
|
|
12370
|
+
return answer;
|
|
12205
12371
|
}
|
|
12206
12372
|
function isRecursiveSchema(inst) {
|
|
12207
|
-
return isRecursive(inst, /* @__PURE__ */ new Set());
|
|
12373
|
+
return isRecursive(inst, /* @__PURE__ */ new Set(), true) !== NONE;
|
|
12208
12374
|
}
|
|
12209
12375
|
function bucketFor(state, inst) {
|
|
12210
12376
|
let bucket = state.buckets.get(inst);
|
|
12211
12377
|
if (!bucket) {
|
|
12212
|
-
bucket = /* @__PURE__ */ new
|
|
12378
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
12213
12379
|
state.buckets.set(inst, bucket);
|
|
12214
12380
|
}
|
|
12215
12381
|
return bucket;
|
|
@@ -12245,6 +12411,7 @@ var memo = {
|
|
|
12245
12411
|
attach(inst) {
|
|
12246
12412
|
var _a3;
|
|
12247
12413
|
let isRecursiveInst;
|
|
12414
|
+
let rechecked = false;
|
|
12248
12415
|
let lastCtx;
|
|
12249
12416
|
let lastBucket;
|
|
12250
12417
|
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
@@ -12252,20 +12419,24 @@ var memo = {
|
|
|
12252
12419
|
const base = inst._zod.parse;
|
|
12253
12420
|
const wrapped = (payload, ctx) => {
|
|
12254
12421
|
if (isRecursiveInst === void 0) {
|
|
12255
|
-
|
|
12256
|
-
if (
|
|
12422
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
12423
|
+
if (walked === NONE) {
|
|
12257
12424
|
inst._zod.parse = base;
|
|
12258
12425
|
if (inst._zod.run === wrapped)
|
|
12259
12426
|
inst._zod.run = base;
|
|
12260
12427
|
return base(payload, ctx);
|
|
12261
12428
|
}
|
|
12429
|
+
if (walked === PROVEN || rechecked)
|
|
12430
|
+
isRecursiveInst = true;
|
|
12431
|
+
else
|
|
12432
|
+
rechecked = true;
|
|
12262
12433
|
}
|
|
12263
12434
|
const input2 = payload.value;
|
|
12264
|
-
if (input2
|
|
12435
|
+
if (!isRef(input2))
|
|
12265
12436
|
return base(payload, ctx);
|
|
12266
12437
|
let state = ctx[STATE];
|
|
12267
12438
|
if (!state) {
|
|
12268
|
-
state = { buckets: /* @__PURE__ */ new
|
|
12439
|
+
state = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 };
|
|
12269
12440
|
ctx[STATE] = state;
|
|
12270
12441
|
}
|
|
12271
12442
|
let bucket;
|
|
@@ -12284,7 +12455,7 @@ var memo = {
|
|
|
12284
12455
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
12285
12456
|
} else {
|
|
12286
12457
|
payload.memo = true;
|
|
12287
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
12458
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
12288
12459
|
state.backEdges.add(hit.value);
|
|
12289
12460
|
}
|
|
12290
12461
|
return payload;
|
|
@@ -12316,7 +12487,7 @@ function memoizer() {
|
|
|
12316
12487
|
}
|
|
12317
12488
|
function isBackEdge(ctx, value) {
|
|
12318
12489
|
const backEdges = ctx[STATE]?.backEdges;
|
|
12319
|
-
return backEdges !== void 0 && value
|
|
12490
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
12320
12491
|
}
|
|
12321
12492
|
|
|
12322
12493
|
// ../../node_modules/zod/v4/locales/index.js
|
|
@@ -12373,6 +12544,7 @@ __export(locales_exports, {
|
|
|
12373
12544
|
sl: () => sl_default,
|
|
12374
12545
|
sv: () => sv_default,
|
|
12375
12546
|
ta: () => ta_default,
|
|
12547
|
+
tg: () => tg_default,
|
|
12376
12548
|
th: () => th_default,
|
|
12377
12549
|
tk: () => tk_default,
|
|
12378
12550
|
tr: () => tr_default,
|
|
@@ -12427,6 +12599,7 @@ var error = () => {
|
|
|
12427
12599
|
json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
|
|
12428
12600
|
e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
|
|
12429
12601
|
credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
|
|
12602
|
+
iban: "IBAN",
|
|
12430
12603
|
jwt: "JWT",
|
|
12431
12604
|
template_literal: "\u0645\u062F\u062E\u0644"
|
|
12432
12605
|
};
|
|
@@ -12537,6 +12710,7 @@ var error2 = () => {
|
|
|
12537
12710
|
json_string: "JSON string",
|
|
12538
12711
|
e164: "E.164 number",
|
|
12539
12712
|
credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
|
|
12713
|
+
iban: "IBAN",
|
|
12540
12714
|
jwt: "JWT",
|
|
12541
12715
|
template_literal: "input"
|
|
12542
12716
|
};
|
|
@@ -12696,6 +12870,7 @@ var error3 = () => {
|
|
|
12696
12870
|
json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
|
|
12697
12871
|
e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
|
|
12698
12872
|
credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
12873
|
+
iban: "IBAN",
|
|
12699
12874
|
jwt: "JWT",
|
|
12700
12875
|
template_literal: "\u0443\u0432\u043E\u0434"
|
|
12701
12876
|
};
|
|
@@ -12813,6 +12988,7 @@ var error4 = () => {
|
|
|
12813
12988
|
json_string: "JSON \u043D\u0438\u0437",
|
|
12814
12989
|
e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
|
|
12815
12990
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
|
|
12991
|
+
iban: "IBAN",
|
|
12816
12992
|
jwt: "JWT",
|
|
12817
12993
|
template_literal: "\u0432\u0445\u043E\u0434"
|
|
12818
12994
|
};
|
|
@@ -12937,6 +13113,7 @@ var error5 = () => {
|
|
|
12937
13113
|
json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
|
|
12938
13114
|
e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
12939
13115
|
credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
13116
|
+
iban: "IBAN",
|
|
12940
13117
|
jwt: "JWT",
|
|
12941
13118
|
template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
|
|
12942
13119
|
};
|
|
@@ -13049,6 +13226,7 @@ var error6 = () => {
|
|
|
13049
13226
|
json_string: "cadena JSON",
|
|
13050
13227
|
e164: "n\xFAmero E.164",
|
|
13051
13228
|
credit_card: "n\xFAmero de targeta de cr\xE8dit",
|
|
13229
|
+
iban: "IBAN",
|
|
13052
13230
|
jwt: "JWT",
|
|
13053
13231
|
template_literal: "entrada"
|
|
13054
13232
|
};
|
|
@@ -13161,6 +13339,7 @@ var error7 = () => {
|
|
|
13161
13339
|
json_string: "\u062F\u06D5\u0642\u06CC JSON",
|
|
13162
13340
|
e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
|
|
13163
13341
|
credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
|
|
13342
|
+
iban: "IBAN",
|
|
13164
13343
|
jwt: "JWT",
|
|
13165
13344
|
template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
|
|
13166
13345
|
};
|
|
@@ -13292,6 +13471,7 @@ var error8 = () => {
|
|
|
13292
13471
|
json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
|
|
13293
13472
|
e164: "\u010D\xEDslo E.164",
|
|
13294
13473
|
credit_card: "\u010D\xEDslo kreditn\xED karty",
|
|
13474
|
+
iban: "IBAN",
|
|
13295
13475
|
jwt: "JWT",
|
|
13296
13476
|
template_literal: "vstup"
|
|
13297
13477
|
};
|
|
@@ -13407,6 +13587,7 @@ var error9 = () => {
|
|
|
13407
13587
|
json_string: "JSON-streng",
|
|
13408
13588
|
e164: "E.164-nummer",
|
|
13409
13589
|
credit_card: "kreditkortnummer",
|
|
13590
|
+
iban: "IBAN",
|
|
13410
13591
|
jwt: "JWT",
|
|
13411
13592
|
template_literal: "input"
|
|
13412
13593
|
};
|
|
@@ -13526,6 +13707,7 @@ var error10 = () => {
|
|
|
13526
13707
|
json_string: "JSON-String",
|
|
13527
13708
|
e164: "E.164-Nummer",
|
|
13528
13709
|
credit_card: "Kreditkartennummer",
|
|
13710
|
+
iban: "IBAN",
|
|
13529
13711
|
jwt: "JWT",
|
|
13530
13712
|
template_literal: "Eingabe"
|
|
13531
13713
|
};
|
|
@@ -13638,6 +13820,7 @@ var error11 = () => {
|
|
|
13638
13820
|
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
13639
13821
|
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
13640
13822
|
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",
|
|
13823
|
+
iban: "IBAN",
|
|
13641
13824
|
jwt: "JWT",
|
|
13642
13825
|
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
13643
13826
|
};
|
|
@@ -13749,6 +13932,7 @@ var error12 = () => {
|
|
|
13749
13932
|
json_string: "JSON string",
|
|
13750
13933
|
e164: "E.164 number",
|
|
13751
13934
|
credit_card: "credit card number",
|
|
13935
|
+
iban: "IBAN",
|
|
13752
13936
|
jwt: "JWT",
|
|
13753
13937
|
template_literal: "input"
|
|
13754
13938
|
};
|
|
@@ -13872,6 +14056,7 @@ var error13 = () => {
|
|
|
13872
14056
|
json_string: "JSON-karaktraro",
|
|
13873
14057
|
e164: "E.164-nombro",
|
|
13874
14058
|
credit_card: "kreditkarta numero",
|
|
14059
|
+
iban: "IBAN",
|
|
13875
14060
|
jwt: "JWT",
|
|
13876
14061
|
template_literal: "enigo"
|
|
13877
14062
|
};
|
|
@@ -13984,6 +14169,7 @@ var error14 = () => {
|
|
|
13984
14169
|
json_string: "cadena JSON",
|
|
13985
14170
|
e164: "n\xFAmero E.164",
|
|
13986
14171
|
credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
|
|
14172
|
+
iban: "IBAN",
|
|
13987
14173
|
jwt: "JWT",
|
|
13988
14174
|
template_literal: "entrada"
|
|
13989
14175
|
};
|
|
@@ -14120,6 +14306,7 @@ var error15 = () => {
|
|
|
14120
14306
|
json_string: "JSON \u0631\u0634\u062A\u0647",
|
|
14121
14307
|
e164: "E.164 \u0639\u062F\u062F",
|
|
14122
14308
|
credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
|
|
14309
|
+
iban: "IBAN",
|
|
14123
14310
|
jwt: "JWT",
|
|
14124
14311
|
template_literal: "\u0648\u0631\u0648\u062F\u06CC"
|
|
14125
14312
|
};
|
|
@@ -14242,6 +14429,7 @@ var error16 = () => {
|
|
|
14242
14429
|
json_string: "JSON-merkkijono",
|
|
14243
14430
|
e164: "E.164-luku",
|
|
14244
14431
|
credit_card: "luottokortin numero",
|
|
14432
|
+
iban: "IBAN",
|
|
14245
14433
|
jwt: "JWT",
|
|
14246
14434
|
template_literal: "templaattimerkkijono"
|
|
14247
14435
|
};
|
|
@@ -14353,6 +14541,7 @@ var error17 = () => {
|
|
|
14353
14541
|
json_string: "cha\xEEne de caract\xE8res JSON",
|
|
14354
14542
|
e164: "num\xE9ro au format E.164",
|
|
14355
14543
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
14544
|
+
iban: "IBAN",
|
|
14356
14545
|
jwt: "JWT",
|
|
14357
14546
|
template_literal: "entr\xE9e"
|
|
14358
14547
|
};
|
|
@@ -14482,6 +14671,7 @@ var error18 = () => {
|
|
|
14482
14671
|
json_string: "cha\xEEne JSON",
|
|
14483
14672
|
e164: "num\xE9ro E.164",
|
|
14484
14673
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
14674
|
+
iban: "IBAN",
|
|
14485
14675
|
jwt: "JWT",
|
|
14486
14676
|
template_literal: "entr\xE9e"
|
|
14487
14677
|
};
|
|
@@ -14593,6 +14783,7 @@ var error19 = () => {
|
|
|
14593
14783
|
json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
|
|
14594
14784
|
e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
14595
14785
|
credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
14786
|
+
iban: "IBAN",
|
|
14596
14787
|
jwt: "JWT",
|
|
14597
14788
|
template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
|
|
14598
14789
|
};
|
|
@@ -14741,6 +14932,7 @@ var error20 = () => {
|
|
|
14741
14932
|
json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
|
|
14742
14933
|
e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
|
|
14743
14934
|
credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
|
|
14935
|
+
iban: { label: "IBAN", gender: "m" },
|
|
14744
14936
|
jwt: { label: "JWT", gender: "m" },
|
|
14745
14937
|
template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
14746
14938
|
ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
@@ -14905,6 +15097,7 @@ var error21 = () => {
|
|
|
14905
15097
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
|
|
14906
15098
|
e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
14907
15099
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
15100
|
+
iban: "IBAN",
|
|
14908
15101
|
jwt: "JWT",
|
|
14909
15102
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
14910
15103
|
};
|
|
@@ -15014,6 +15207,7 @@ var error22 = () => {
|
|
|
15014
15207
|
json_string: "JSON tekst",
|
|
15015
15208
|
e164: "E.164 broj",
|
|
15016
15209
|
credit_card: "broj kreditne kartice",
|
|
15210
|
+
iban: "IBAN",
|
|
15017
15211
|
jwt: "JWT",
|
|
15018
15212
|
template_literal: "unos"
|
|
15019
15213
|
};
|
|
@@ -15140,6 +15334,7 @@ var error23 = () => {
|
|
|
15140
15334
|
json_string: "JSON string",
|
|
15141
15335
|
e164: "E.164 sz\xE1m",
|
|
15142
15336
|
credit_card: "hitelk\xE1rtyasz\xE1m",
|
|
15337
|
+
iban: "IBAN",
|
|
15143
15338
|
jwt: "JWT",
|
|
15144
15339
|
template_literal: "bemenet"
|
|
15145
15340
|
};
|
|
@@ -15292,6 +15487,7 @@ var error24 = () => {
|
|
|
15292
15487
|
json_string: "JSON \u057F\u0578\u0572",
|
|
15293
15488
|
e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
|
|
15294
15489
|
credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
|
|
15490
|
+
iban: "IBAN",
|
|
15295
15491
|
jwt: "JWT",
|
|
15296
15492
|
template_literal: "\u0574\u0578\u0582\u057F\u0584"
|
|
15297
15493
|
};
|
|
@@ -15409,6 +15605,7 @@ var error25 = () => {
|
|
|
15409
15605
|
json_string: "string JSON",
|
|
15410
15606
|
e164: "angka E.164",
|
|
15411
15607
|
credit_card: "nomor kartu kredit",
|
|
15608
|
+
iban: "IBAN",
|
|
15412
15609
|
jwt: "JWT",
|
|
15413
15610
|
template_literal: "input"
|
|
15414
15611
|
};
|
|
@@ -15519,6 +15716,7 @@ var error26 = () => {
|
|
|
15519
15716
|
json_string: "JSON strengur",
|
|
15520
15717
|
e164: "E.164 t\xF6lugildi",
|
|
15521
15718
|
credit_card: "kreditkortan\xFAmer",
|
|
15719
|
+
iban: "IBAN",
|
|
15522
15720
|
jwt: "JWT",
|
|
15523
15721
|
template_literal: "gildi"
|
|
15524
15722
|
};
|
|
@@ -15632,6 +15830,7 @@ var error27 = () => {
|
|
|
15632
15830
|
json_string: "stringa JSON",
|
|
15633
15831
|
e164: "numero E.164",
|
|
15634
15832
|
credit_card: "numero di carta di credito",
|
|
15833
|
+
iban: "IBAN",
|
|
15635
15834
|
jwt: "JWT",
|
|
15636
15835
|
template_literal: "input"
|
|
15637
15836
|
};
|
|
@@ -15744,6 +15943,7 @@ var error28 = () => {
|
|
|
15744
15943
|
json_string: "JSON\u6587\u5B57\u5217",
|
|
15745
15944
|
e164: "E.164\u756A\u53F7",
|
|
15746
15945
|
credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
|
|
15946
|
+
iban: "IBAN",
|
|
15747
15947
|
jwt: "JWT",
|
|
15748
15948
|
template_literal: "\u5165\u529B\u5024"
|
|
15749
15949
|
};
|
|
@@ -15855,6 +16055,7 @@ var error29 = () => {
|
|
|
15855
16055
|
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
15856
16056
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
15857
16057
|
credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
16058
|
+
iban: "IBAN",
|
|
15858
16059
|
jwt: "JWT",
|
|
15859
16060
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
15860
16061
|
};
|
|
@@ -15971,6 +16172,7 @@ var error30 = () => {
|
|
|
15971
16172
|
json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
|
|
15972
16173
|
e164: "\u179B\u17C1\u1781 E.164",
|
|
15973
16174
|
credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
|
|
16175
|
+
iban: "IBAN",
|
|
15974
16176
|
jwt: "JWT",
|
|
15975
16177
|
template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
|
|
15976
16178
|
};
|
|
@@ -16090,6 +16292,7 @@ var error31 = () => {
|
|
|
16090
16292
|
json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
|
|
16091
16293
|
e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
16092
16294
|
credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
16295
|
+
iban: "IBAN",
|
|
16093
16296
|
jwt: "JWT",
|
|
16094
16297
|
template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
|
|
16095
16298
|
};
|
|
@@ -16204,6 +16407,7 @@ var error32 = () => {
|
|
|
16204
16407
|
json_string: "JSON \uBB38\uC790\uC5F4",
|
|
16205
16408
|
e164: "E.164 \uBC88\uD638",
|
|
16206
16409
|
credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
|
|
16410
|
+
iban: "IBAN",
|
|
16207
16411
|
jwt: "JWT",
|
|
16208
16412
|
template_literal: "\uC785\uB825"
|
|
16209
16413
|
};
|
|
@@ -16401,6 +16605,7 @@ var error33 = () => {
|
|
|
16401
16605
|
json_string: "JSON eilut\u0117",
|
|
16402
16606
|
e164: "E.164 numeris",
|
|
16403
16607
|
credit_card: "kredito kortel\u0117s numeris",
|
|
16608
|
+
iban: "IBAN",
|
|
16404
16609
|
jwt: "JWT",
|
|
16405
16610
|
template_literal: "\u012Fvestis"
|
|
16406
16611
|
};
|
|
@@ -16525,6 +16730,7 @@ var error34 = () => {
|
|
|
16525
16730
|
json_string: "JSON \u043D\u0438\u0437\u0430",
|
|
16526
16731
|
e164: "E.164 \u0431\u0440\u043E\u0458",
|
|
16527
16732
|
credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
|
|
16733
|
+
iban: "IBAN",
|
|
16528
16734
|
jwt: "JWT",
|
|
16529
16735
|
template_literal: "\u0432\u043D\u0435\u0441"
|
|
16530
16736
|
};
|
|
@@ -16638,6 +16844,7 @@ var error35 = () => {
|
|
|
16638
16844
|
json_string: "string JSON",
|
|
16639
16845
|
e164: "nombor E.164",
|
|
16640
16846
|
credit_card: "nombor kad kredit",
|
|
16847
|
+
iban: "IBAN",
|
|
16641
16848
|
jwt: "JWT",
|
|
16642
16849
|
template_literal: "input"
|
|
16643
16850
|
};
|
|
@@ -16749,6 +16956,7 @@ var error36 = () => {
|
|
|
16749
16956
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
|
|
16750
16957
|
e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
|
|
16751
16958
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
|
|
16959
|
+
iban: "IBAN",
|
|
16752
16960
|
jwt: "JWT",
|
|
16753
16961
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
16754
16962
|
};
|
|
@@ -16859,6 +17067,7 @@ var error37 = () => {
|
|
|
16859
17067
|
json_string: "JSON string",
|
|
16860
17068
|
e164: "E.164-nummer",
|
|
16861
17069
|
credit_card: "creditcardnummer",
|
|
17070
|
+
iban: "IBAN",
|
|
16862
17071
|
jwt: "JWT",
|
|
16863
17072
|
template_literal: "invoer"
|
|
16864
17073
|
};
|
|
@@ -16973,6 +17182,7 @@ var error38 = () => {
|
|
|
16973
17182
|
json_string: "JSON-streng",
|
|
16974
17183
|
e164: "E.164-nummer",
|
|
16975
17184
|
credit_card: "kredittkortnummer",
|
|
17185
|
+
iban: "IBAN",
|
|
16976
17186
|
jwt: "JWT",
|
|
16977
17187
|
template_literal: "input"
|
|
16978
17188
|
};
|
|
@@ -17085,6 +17295,7 @@ var error39 = () => {
|
|
|
17085
17295
|
json_string: "JSON-streng",
|
|
17086
17296
|
e164: "E.164-nummer",
|
|
17087
17297
|
credit_card: "kredittkortnummer",
|
|
17298
|
+
iban: "IBAN",
|
|
17088
17299
|
jwt: "JWT",
|
|
17089
17300
|
template_literal: "input"
|
|
17090
17301
|
};
|
|
@@ -17197,6 +17408,7 @@ var error40 = () => {
|
|
|
17197
17408
|
json_string: "JSON metin",
|
|
17198
17409
|
e164: "E.164 say\u0131s\u0131",
|
|
17199
17410
|
credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
|
|
17411
|
+
iban: "IBAN",
|
|
17200
17412
|
jwt: "JWT",
|
|
17201
17413
|
template_literal: "giren"
|
|
17202
17414
|
};
|
|
@@ -17310,6 +17522,7 @@ var error41 = () => {
|
|
|
17310
17522
|
json_string: "JSON \u0645\u062A\u0646",
|
|
17311
17523
|
e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
|
|
17312
17524
|
credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
|
|
17525
|
+
iban: "IBAN",
|
|
17313
17526
|
jwt: "JWT",
|
|
17314
17527
|
template_literal: "\u0648\u0631\u0648\u062F\u064A"
|
|
17315
17528
|
};
|
|
@@ -17428,6 +17641,7 @@ var error42 = () => {
|
|
|
17428
17641
|
json_string: "ci\u0105g znak\xF3w w formacie JSON",
|
|
17429
17642
|
e164: "liczba E.164",
|
|
17430
17643
|
credit_card: "numer karty kredytowej",
|
|
17644
|
+
iban: "IBAN",
|
|
17431
17645
|
jwt: "JWT",
|
|
17432
17646
|
template_literal: "wej\u015Bcie"
|
|
17433
17647
|
};
|
|
@@ -17541,6 +17755,7 @@ var error43 = () => {
|
|
|
17541
17755
|
json_string: "o texto JSON",
|
|
17542
17756
|
e164: "o n\xFAmero E.164",
|
|
17543
17757
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
17758
|
+
iban: "o IBAN",
|
|
17544
17759
|
jwt: "o JWT",
|
|
17545
17760
|
template_literal: "a entrada"
|
|
17546
17761
|
};
|
|
@@ -17618,8 +17833,8 @@ var error43 = () => {
|
|
|
17618
17833
|
case "not_multiple_of":
|
|
17619
17834
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
17620
17835
|
case "unrecognized_keys": {
|
|
17621
|
-
const
|
|
17622
|
-
return `Chave${
|
|
17836
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
17837
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
17623
17838
|
}
|
|
17624
17839
|
case "invalid_key":
|
|
17625
17840
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -17683,6 +17898,7 @@ var error44 = () => {
|
|
|
17683
17898
|
json_string: "o texto JSON",
|
|
17684
17899
|
e164: "o n\xFAmero E.164",
|
|
17685
17900
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
17901
|
+
iban: "o IBAN",
|
|
17686
17902
|
jwt: "o JWT",
|
|
17687
17903
|
template_literal: "a entrada"
|
|
17688
17904
|
};
|
|
@@ -17761,8 +17977,8 @@ var error44 = () => {
|
|
|
17761
17977
|
case "not_multiple_of":
|
|
17762
17978
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
17763
17979
|
case "unrecognized_keys": {
|
|
17764
|
-
const
|
|
17765
|
-
return `Chave${
|
|
17980
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
17981
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
17766
17982
|
}
|
|
17767
17983
|
case "invalid_key":
|
|
17768
17984
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -17826,6 +18042,7 @@ var error45 = () => {
|
|
|
17826
18042
|
json_string: "\u0219ir JSON",
|
|
17827
18043
|
e164: "num\u0103r E.164",
|
|
17828
18044
|
credit_card: "num\u0103r de card de credit",
|
|
18045
|
+
iban: "IBAN",
|
|
17829
18046
|
jwt: "JWT",
|
|
17830
18047
|
template_literal: "intrare"
|
|
17831
18048
|
};
|
|
@@ -17997,6 +18214,7 @@ var error46 = () => {
|
|
|
17997
18214
|
json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
|
|
17998
18215
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
17999
18216
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
18217
|
+
iban: "IBAN",
|
|
18000
18218
|
jwt: "JWT",
|
|
18001
18219
|
template_literal: "\u0432\u0432\u043E\u0434"
|
|
18002
18220
|
};
|
|
@@ -18114,6 +18332,7 @@ var error47 = () => {
|
|
|
18114
18332
|
json_string: "re\u0165azec vo form\xE1te JSON",
|
|
18115
18333
|
e164: "\u010D\xEDslo E.164",
|
|
18116
18334
|
credit_card: "\u010D\xEDslo kreditnej karty",
|
|
18335
|
+
iban: "IBAN",
|
|
18117
18336
|
jwt: "JWT",
|
|
18118
18337
|
template_literal: "vstup"
|
|
18119
18338
|
};
|
|
@@ -18229,6 +18448,7 @@ var error48 = () => {
|
|
|
18229
18448
|
json_string: "JSON niz",
|
|
18230
18449
|
e164: "E.164 \u0161tevilka",
|
|
18231
18450
|
credit_card: "\u0161tevilka kreditne kartice",
|
|
18451
|
+
iban: "IBAN",
|
|
18232
18452
|
jwt: "JWT",
|
|
18233
18453
|
template_literal: "vnos"
|
|
18234
18454
|
};
|
|
@@ -18342,6 +18562,7 @@ var error49 = () => {
|
|
|
18342
18562
|
json_string: "JSON-str\xE4ng",
|
|
18343
18563
|
e164: "E.164-nummer",
|
|
18344
18564
|
credit_card: "kreditkortsnummer",
|
|
18565
|
+
iban: "IBAN",
|
|
18345
18566
|
jwt: "JWT",
|
|
18346
18567
|
template_literal: "mall-literal"
|
|
18347
18568
|
};
|
|
@@ -18456,6 +18677,7 @@ var error50 = () => {
|
|
|
18456
18677
|
json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
|
|
18457
18678
|
e164: "E.164 \u0B8E\u0BA3\u0BCD",
|
|
18458
18679
|
credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
|
|
18680
|
+
iban: "IBAN",
|
|
18459
18681
|
jwt: "JWT",
|
|
18460
18682
|
template_literal: "input"
|
|
18461
18683
|
};
|
|
@@ -18529,23 +18751,23 @@ function ta_default() {
|
|
|
18529
18751
|
};
|
|
18530
18752
|
}
|
|
18531
18753
|
|
|
18532
|
-
// ../../node_modules/zod/v4/locales/
|
|
18754
|
+
// ../../node_modules/zod/v4/locales/tg.js
|
|
18533
18755
|
var error51 = () => {
|
|
18534
18756
|
const Sizable = {
|
|
18535
|
-
string: { unit: "\
|
|
18536
|
-
file: { unit: "\
|
|
18537
|
-
array: { unit: "\
|
|
18538
|
-
set: { unit: "\
|
|
18539
|
-
map: { unit: "\
|
|
18757
|
+
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
18758
|
+
file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
18759
|
+
array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
18760
|
+
set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
18761
|
+
map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
|
|
18540
18762
|
};
|
|
18541
18763
|
function getSizing(origin) {
|
|
18542
18764
|
return Sizable[origin] ?? null;
|
|
18543
18765
|
}
|
|
18544
18766
|
const FormatDictionary = {
|
|
18545
|
-
regex: "\
|
|
18546
|
-
email: "\
|
|
18767
|
+
regex: "\u0432\u0443\u0440\u0443\u0434",
|
|
18768
|
+
email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
|
|
18547
18769
|
url: "URL",
|
|
18548
|
-
emoji: "\
|
|
18770
|
+
emoji: "\u044D\u043C\u043E\u04B7\u0438",
|
|
18549
18771
|
uuid: "UUID",
|
|
18550
18772
|
uuidv4: "UUIDv4",
|
|
18551
18773
|
uuidv6: "UUIDv6",
|
|
@@ -18556,28 +18778,31 @@ var error51 = () => {
|
|
|
18556
18778
|
ulid: "ULID",
|
|
18557
18779
|
xid: "XID",
|
|
18558
18780
|
ksuid: "KSUID",
|
|
18559
|
-
datetime: "\
|
|
18560
|
-
date: "\
|
|
18561
|
-
time: "\
|
|
18562
|
-
duration: "\
|
|
18563
|
-
ipv4: "\
|
|
18564
|
-
ipv6: "\
|
|
18565
|
-
mac: "\
|
|
18566
|
-
cidrv4: "\
|
|
18567
|
-
cidrv6: "\
|
|
18568
|
-
base64: "\
|
|
18569
|
-
base64url: "\
|
|
18570
|
-
json_string: "\
|
|
18571
|
-
e164: "\
|
|
18572
|
-
credit_card: "\
|
|
18573
|
-
|
|
18574
|
-
|
|
18781
|
+
datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
|
|
18782
|
+
date: "\u0441\u0430\u043D\u0430\u0438 ISO",
|
|
18783
|
+
time: "\u0432\u0430\u049B\u0442\u0438 ISO",
|
|
18784
|
+
duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
|
|
18785
|
+
ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
|
|
18786
|
+
ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
|
|
18787
|
+
mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
|
|
18788
|
+
cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
|
|
18789
|
+
cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
|
|
18790
|
+
base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
|
|
18791
|
+
base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
|
|
18792
|
+
json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
|
|
18793
|
+
e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
|
|
18794
|
+
credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
|
|
18795
|
+
iban: "IBAN",
|
|
18796
|
+
jwt: "JWT",
|
|
18797
|
+
template_literal: "\u0432\u0443\u0440\u0443\u0434"
|
|
18575
18798
|
};
|
|
18576
18799
|
const TypeDictionary = {
|
|
18577
18800
|
nan: "NaN",
|
|
18578
|
-
number: "\
|
|
18579
|
-
|
|
18580
|
-
|
|
18801
|
+
number: "\u0440\u0430\u049B\u0430\u043C",
|
|
18802
|
+
string: "\u0441\u0430\u0442\u0440",
|
|
18803
|
+
array: "\u043C\u0430\u0441\u0441\u0438\u0432",
|
|
18804
|
+
object: "\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
18805
|
+
date: "\u0441\u0430\u043D\u0430"
|
|
18581
18806
|
};
|
|
18582
18807
|
return (issue2) => {
|
|
18583
18808
|
switch (issue2.code) {
|
|
@@ -18585,17 +18810,131 @@ var error51 = () => {
|
|
|
18585
18810
|
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
18586
18811
|
const receivedType = parsedType(issue2.input);
|
|
18587
18812
|
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
18588
|
-
|
|
18589
|
-
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}`;
|
|
18590
|
-
}
|
|
18591
|
-
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}`;
|
|
18813
|
+
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`;
|
|
18592
18814
|
}
|
|
18593
18815
|
case "invalid_value":
|
|
18594
18816
|
if (issue2.values.length === 1)
|
|
18595
|
-
return `\
|
|
18596
|
-
return `\
|
|
18817
|
+
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`;
|
|
18818
|
+
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`;
|
|
18597
18819
|
case "too_big": {
|
|
18598
|
-
const adj = issue2.inclusive ? "
|
|
18820
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
18821
|
+
const sizing = getSizing(issue2.origin);
|
|
18822
|
+
if (sizing)
|
|
18823
|
+
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}`;
|
|
18824
|
+
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`;
|
|
18825
|
+
}
|
|
18826
|
+
case "too_small": {
|
|
18827
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
18828
|
+
const sizing = getSizing(issue2.origin);
|
|
18829
|
+
if (sizing)
|
|
18830
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
18831
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
18832
|
+
}
|
|
18833
|
+
case "invalid_format": {
|
|
18834
|
+
const _issue = issue2;
|
|
18835
|
+
if (_issue.format === "starts_with")
|
|
18836
|
+
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`;
|
|
18837
|
+
if (_issue.format === "ends_with")
|
|
18838
|
+
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`;
|
|
18839
|
+
if (_issue.format === "includes")
|
|
18840
|
+
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`;
|
|
18841
|
+
if (_issue.format === "regex")
|
|
18842
|
+
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`;
|
|
18843
|
+
return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
18844
|
+
}
|
|
18845
|
+
case "not_multiple_of":
|
|
18846
|
+
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`;
|
|
18847
|
+
case "unrecognized_keys":
|
|
18848
|
+
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, ", ")}`;
|
|
18849
|
+
case "invalid_key":
|
|
18850
|
+
return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
18851
|
+
case "invalid_union":
|
|
18852
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
18853
|
+
const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
|
|
18854
|
+
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`;
|
|
18855
|
+
}
|
|
18856
|
+
return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
|
|
18857
|
+
case "invalid_element":
|
|
18858
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
18859
|
+
default:
|
|
18860
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
18861
|
+
}
|
|
18862
|
+
};
|
|
18863
|
+
};
|
|
18864
|
+
function tg_default() {
|
|
18865
|
+
return {
|
|
18866
|
+
localeError: error51()
|
|
18867
|
+
};
|
|
18868
|
+
}
|
|
18869
|
+
|
|
18870
|
+
// ../../node_modules/zod/v4/locales/th.js
|
|
18871
|
+
var error52 = () => {
|
|
18872
|
+
const Sizable = {
|
|
18873
|
+
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
18874
|
+
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
18875
|
+
array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
18876
|
+
set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
18877
|
+
map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
|
|
18878
|
+
};
|
|
18879
|
+
function getSizing(origin) {
|
|
18880
|
+
return Sizable[origin] ?? null;
|
|
18881
|
+
}
|
|
18882
|
+
const FormatDictionary = {
|
|
18883
|
+
regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
|
|
18884
|
+
email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
|
|
18885
|
+
url: "URL",
|
|
18886
|
+
emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
|
|
18887
|
+
uuid: "UUID",
|
|
18888
|
+
uuidv4: "UUIDv4",
|
|
18889
|
+
uuidv6: "UUIDv6",
|
|
18890
|
+
nanoid: "nanoid",
|
|
18891
|
+
guid: "GUID",
|
|
18892
|
+
cuid: "cuid",
|
|
18893
|
+
cuid2: "cuid2",
|
|
18894
|
+
ulid: "ULID",
|
|
18895
|
+
xid: "XID",
|
|
18896
|
+
ksuid: "KSUID",
|
|
18897
|
+
datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
18898
|
+
date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
|
|
18899
|
+
time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
18900
|
+
duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
18901
|
+
ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
|
|
18902
|
+
ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
|
|
18903
|
+
mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
|
|
18904
|
+
cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
|
|
18905
|
+
cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
|
|
18906
|
+
base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
|
|
18907
|
+
base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
|
|
18908
|
+
json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
|
|
18909
|
+
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)",
|
|
18910
|
+
credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
|
|
18911
|
+
iban: "IBAN",
|
|
18912
|
+
jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
|
|
18913
|
+
template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
|
|
18914
|
+
};
|
|
18915
|
+
const TypeDictionary = {
|
|
18916
|
+
nan: "NaN",
|
|
18917
|
+
number: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
|
|
18918
|
+
array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",
|
|
18919
|
+
null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"
|
|
18920
|
+
};
|
|
18921
|
+
return (issue2) => {
|
|
18922
|
+
switch (issue2.code) {
|
|
18923
|
+
case "invalid_type": {
|
|
18924
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
18925
|
+
const receivedType = parsedType(issue2.input);
|
|
18926
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
18927
|
+
if (/^[A-Z]/.test(issue2.expected)) {
|
|
18928
|
+
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}`;
|
|
18929
|
+
}
|
|
18930
|
+
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}`;
|
|
18931
|
+
}
|
|
18932
|
+
case "invalid_value":
|
|
18933
|
+
if (issue2.values.length === 1)
|
|
18934
|
+
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])}`;
|
|
18935
|
+
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, "|")}`;
|
|
18936
|
+
case "too_big": {
|
|
18937
|
+
const adj = issue2.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32";
|
|
18599
18938
|
const sizing = getSizing(issue2.origin);
|
|
18600
18939
|
if (sizing)
|
|
18601
18940
|
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"}`;
|
|
@@ -18639,12 +18978,12 @@ var error51 = () => {
|
|
|
18639
18978
|
};
|
|
18640
18979
|
function th_default() {
|
|
18641
18980
|
return {
|
|
18642
|
-
localeError:
|
|
18981
|
+
localeError: error52()
|
|
18643
18982
|
};
|
|
18644
18983
|
}
|
|
18645
18984
|
|
|
18646
18985
|
// ../../node_modules/zod/v4/locales/tk.js
|
|
18647
|
-
var
|
|
18986
|
+
var error53 = () => {
|
|
18648
18987
|
const Sizable = {
|
|
18649
18988
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
18650
18989
|
file: { unit: "ba\xFDt", verb: "bolmaly" },
|
|
@@ -18684,6 +19023,7 @@ var error52 = () => {
|
|
|
18684
19023
|
json_string: "JSON setiri",
|
|
18685
19024
|
e164: "E.164 nomeri",
|
|
18686
19025
|
credit_card: "kredit kartyny\u0148 nomeri",
|
|
19026
|
+
iban: "IBAN",
|
|
18687
19027
|
jwt: "JWT",
|
|
18688
19028
|
template_literal: "\u015Fablon"
|
|
18689
19029
|
};
|
|
@@ -18745,12 +19085,12 @@ var error52 = () => {
|
|
|
18745
19085
|
};
|
|
18746
19086
|
function tk_default() {
|
|
18747
19087
|
return {
|
|
18748
|
-
localeError:
|
|
19088
|
+
localeError: error53()
|
|
18749
19089
|
};
|
|
18750
19090
|
}
|
|
18751
19091
|
|
|
18752
19092
|
// ../../node_modules/zod/v4/locales/tr.js
|
|
18753
|
-
var
|
|
19093
|
+
var error54 = () => {
|
|
18754
19094
|
const Sizable = {
|
|
18755
19095
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
18756
19096
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -18790,6 +19130,7 @@ var error53 = () => {
|
|
|
18790
19130
|
json_string: "JSON dizesi",
|
|
18791
19131
|
e164: "E.164 say\u0131s\u0131",
|
|
18792
19132
|
credit_card: "kredi kart\u0131 numaras\u0131",
|
|
19133
|
+
iban: "IBAN",
|
|
18793
19134
|
jwt: "JWT",
|
|
18794
19135
|
template_literal: "\u015Eablon dizesi"
|
|
18795
19136
|
};
|
|
@@ -18854,12 +19195,12 @@ var error53 = () => {
|
|
|
18854
19195
|
};
|
|
18855
19196
|
function tr_default() {
|
|
18856
19197
|
return {
|
|
18857
|
-
localeError:
|
|
19198
|
+
localeError: error54()
|
|
18858
19199
|
};
|
|
18859
19200
|
}
|
|
18860
19201
|
|
|
18861
19202
|
// ../../node_modules/zod/v4/locales/uk.js
|
|
18862
|
-
var
|
|
19203
|
+
var error55 = () => {
|
|
18863
19204
|
const Sizable = {
|
|
18864
19205
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
18865
19206
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -18899,6 +19240,7 @@ var error54 = () => {
|
|
|
18899
19240
|
json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
|
|
18900
19241
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
18901
19242
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
|
|
19243
|
+
iban: "IBAN",
|
|
18902
19244
|
jwt: "JWT",
|
|
18903
19245
|
template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
|
|
18904
19246
|
};
|
|
@@ -18966,7 +19308,7 @@ var error54 = () => {
|
|
|
18966
19308
|
};
|
|
18967
19309
|
function uk_default() {
|
|
18968
19310
|
return {
|
|
18969
|
-
localeError:
|
|
19311
|
+
localeError: error55()
|
|
18970
19312
|
};
|
|
18971
19313
|
}
|
|
18972
19314
|
|
|
@@ -18976,7 +19318,7 @@ function ua_default() {
|
|
|
18976
19318
|
}
|
|
18977
19319
|
|
|
18978
19320
|
// ../../node_modules/zod/v4/locales/ur.js
|
|
18979
|
-
var
|
|
19321
|
+
var error56 = () => {
|
|
18980
19322
|
const Sizable = {
|
|
18981
19323
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
18982
19324
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -19016,6 +19358,7 @@ var error55 = () => {
|
|
|
19016
19358
|
json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
|
|
19017
19359
|
e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
|
|
19018
19360
|
credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
|
|
19361
|
+
iban: "IBAN",
|
|
19019
19362
|
jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
|
|
19020
19363
|
template_literal: "\u0627\u0646 \u067E\u0679"
|
|
19021
19364
|
};
|
|
@@ -19085,12 +19428,12 @@ var error55 = () => {
|
|
|
19085
19428
|
};
|
|
19086
19429
|
function ur_default() {
|
|
19087
19430
|
return {
|
|
19088
|
-
localeError:
|
|
19431
|
+
localeError: error56()
|
|
19089
19432
|
};
|
|
19090
19433
|
}
|
|
19091
19434
|
|
|
19092
19435
|
// ../../node_modules/zod/v4/locales/uz.js
|
|
19093
|
-
var
|
|
19436
|
+
var error57 = () => {
|
|
19094
19437
|
const Sizable = {
|
|
19095
19438
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
19096
19439
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -19130,6 +19473,7 @@ var error56 = () => {
|
|
|
19130
19473
|
json_string: "JSON satr",
|
|
19131
19474
|
e164: "E.164 raqam",
|
|
19132
19475
|
credit_card: "kredit karta raqami",
|
|
19476
|
+
iban: "IBAN",
|
|
19133
19477
|
jwt: "JWT",
|
|
19134
19478
|
template_literal: "kirish"
|
|
19135
19479
|
};
|
|
@@ -19197,12 +19541,12 @@ var error56 = () => {
|
|
|
19197
19541
|
};
|
|
19198
19542
|
function uz_default() {
|
|
19199
19543
|
return {
|
|
19200
|
-
localeError:
|
|
19544
|
+
localeError: error57()
|
|
19201
19545
|
};
|
|
19202
19546
|
}
|
|
19203
19547
|
|
|
19204
19548
|
// ../../node_modules/zod/v4/locales/vi.js
|
|
19205
|
-
var
|
|
19549
|
+
var error58 = () => {
|
|
19206
19550
|
const Sizable = {
|
|
19207
19551
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
19208
19552
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -19242,6 +19586,7 @@ var error57 = () => {
|
|
|
19242
19586
|
json_string: "chu\u1ED7i JSON",
|
|
19243
19587
|
e164: "s\u1ED1 E.164",
|
|
19244
19588
|
credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
|
|
19589
|
+
iban: "IBAN",
|
|
19245
19590
|
jwt: "JWT",
|
|
19246
19591
|
template_literal: "\u0111\u1EA7u v\xE0o"
|
|
19247
19592
|
};
|
|
@@ -19309,12 +19654,12 @@ var error57 = () => {
|
|
|
19309
19654
|
};
|
|
19310
19655
|
function vi_default() {
|
|
19311
19656
|
return {
|
|
19312
|
-
localeError:
|
|
19657
|
+
localeError: error58()
|
|
19313
19658
|
};
|
|
19314
19659
|
}
|
|
19315
19660
|
|
|
19316
19661
|
// ../../node_modules/zod/v4/locales/zh-CN.js
|
|
19317
|
-
var
|
|
19662
|
+
var error59 = () => {
|
|
19318
19663
|
const Sizable = {
|
|
19319
19664
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
19320
19665
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -19354,6 +19699,7 @@ var error58 = () => {
|
|
|
19354
19699
|
json_string: "JSON\u5B57\u7B26\u4E32",
|
|
19355
19700
|
e164: "E.164\u53F7\u7801",
|
|
19356
19701
|
credit_card: "\u4FE1\u7528\u5361\u53F7",
|
|
19702
|
+
iban: "IBAN",
|
|
19357
19703
|
jwt: "JWT",
|
|
19358
19704
|
template_literal: "\u8F93\u5165"
|
|
19359
19705
|
};
|
|
@@ -19422,12 +19768,12 @@ var error58 = () => {
|
|
|
19422
19768
|
};
|
|
19423
19769
|
function zh_CN_default() {
|
|
19424
19770
|
return {
|
|
19425
|
-
localeError:
|
|
19771
|
+
localeError: error59()
|
|
19426
19772
|
};
|
|
19427
19773
|
}
|
|
19428
19774
|
|
|
19429
19775
|
// ../../node_modules/zod/v4/locales/zh-TW.js
|
|
19430
|
-
var
|
|
19776
|
+
var error60 = () => {
|
|
19431
19777
|
const Sizable = {
|
|
19432
19778
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
19433
19779
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -19467,6 +19813,7 @@ var error59 = () => {
|
|
|
19467
19813
|
json_string: "JSON \u5B57\u4E32",
|
|
19468
19814
|
e164: "E.164 \u6578\u503C",
|
|
19469
19815
|
credit_card: "\u4FE1\u7528\u5361\u865F",
|
|
19816
|
+
iban: "IBAN",
|
|
19470
19817
|
jwt: "JWT",
|
|
19471
19818
|
template_literal: "\u8F38\u5165"
|
|
19472
19819
|
};
|
|
@@ -19533,12 +19880,12 @@ var error59 = () => {
|
|
|
19533
19880
|
};
|
|
19534
19881
|
function zh_TW_default() {
|
|
19535
19882
|
return {
|
|
19536
|
-
localeError:
|
|
19883
|
+
localeError: error60()
|
|
19537
19884
|
};
|
|
19538
19885
|
}
|
|
19539
19886
|
|
|
19540
19887
|
// ../../node_modules/zod/v4/locales/yo.js
|
|
19541
|
-
var
|
|
19888
|
+
var error61 = () => {
|
|
19542
19889
|
const Sizable = {
|
|
19543
19890
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
19544
19891
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -19578,6 +19925,7 @@ var error60 = () => {
|
|
|
19578
19925
|
json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
|
|
19579
19926
|
e164: "n\u1ECD\u0301mb\xE0 E.164",
|
|
19580
19927
|
credit_card: "n\u1ECDmba kaadi gbese",
|
|
19928
|
+
iban: "IBAN",
|
|
19581
19929
|
jwt: "JWT",
|
|
19582
19930
|
template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
|
|
19583
19931
|
};
|
|
@@ -19644,7 +19992,7 @@ var error60 = () => {
|
|
|
19644
19992
|
};
|
|
19645
19993
|
function yo_default() {
|
|
19646
19994
|
return {
|
|
19647
|
-
localeError:
|
|
19995
|
+
localeError: error61()
|
|
19648
19996
|
};
|
|
19649
19997
|
}
|
|
19650
19998
|
|
|
@@ -19724,31 +20072,8 @@ function compileValidator(schema, parser) {
|
|
|
19724
20072
|
function compile(schema, options) {
|
|
19725
20073
|
try {
|
|
19726
20074
|
const parser = compileFn(schema);
|
|
19727
|
-
const clone2 =
|
|
19728
|
-
const liveRun = schema._zod.run;
|
|
19729
|
-
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
19730
|
-
const wrapped = (payload, ctx) => {
|
|
19731
|
-
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
19732
|
-
return originalRun(payload, ctx);
|
|
19733
|
-
}
|
|
19734
|
-
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
19735
|
-
return originalRun(payload, ctx);
|
|
19736
|
-
}
|
|
19737
|
-
const out = parser(payload.value);
|
|
19738
|
-
if (out !== INVALID) {
|
|
19739
|
-
payload.value = out;
|
|
19740
|
-
return payload;
|
|
19741
|
-
}
|
|
19742
|
-
if (ctx)
|
|
19743
|
-
ctx[FALLBACK_FLAG] = true;
|
|
19744
|
-
return originalRun(payload, ctx);
|
|
19745
|
-
};
|
|
19746
|
-
wrapped.__originalRun = originalRun;
|
|
19747
|
-
clone2._zod.bag.fallbackRun = originalRun;
|
|
20075
|
+
const clone2 = withParser(schema, parser);
|
|
19748
20076
|
clone2._zod.bag.validator = compileValidator(schema, parser);
|
|
19749
|
-
clone2._zod.run = wrapped;
|
|
19750
|
-
if (!liveRun.__originalRun)
|
|
19751
|
-
installCompiledUserMethods(clone2, schema, parser);
|
|
19752
20077
|
return clone2;
|
|
19753
20078
|
} catch (err) {
|
|
19754
20079
|
if (options?.strict)
|
|
@@ -19756,6 +20081,37 @@ function compile(schema, options) {
|
|
|
19756
20081
|
return schema;
|
|
19757
20082
|
}
|
|
19758
20083
|
}
|
|
20084
|
+
function withParser(schema, parser) {
|
|
20085
|
+
if (isRecursiveSchema(schema)) {
|
|
20086
|
+
throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
|
|
20087
|
+
}
|
|
20088
|
+
const clone2 = clone(schema);
|
|
20089
|
+
const liveRun = schema._zod.run;
|
|
20090
|
+
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
20091
|
+
const wrapped = (payload, ctx) => {
|
|
20092
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
20093
|
+
return originalRun(payload, ctx);
|
|
20094
|
+
}
|
|
20095
|
+
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
20096
|
+
return originalRun(payload, ctx);
|
|
20097
|
+
}
|
|
20098
|
+
const out = parser(payload.value);
|
|
20099
|
+
if (out !== INVALID) {
|
|
20100
|
+
payload.value = out;
|
|
20101
|
+
return payload;
|
|
20102
|
+
}
|
|
20103
|
+
if (ctx)
|
|
20104
|
+
ctx[FALLBACK_FLAG] = true;
|
|
20105
|
+
return originalRun(payload, ctx);
|
|
20106
|
+
};
|
|
20107
|
+
wrapped.__originalRun = originalRun;
|
|
20108
|
+
clone2._zod.bag.fallbackRun = originalRun;
|
|
20109
|
+
clone2._zod.bag.validator = parser;
|
|
20110
|
+
clone2._zod.run = wrapped;
|
|
20111
|
+
if (!liveRun.__originalRun)
|
|
20112
|
+
installCompiledUserMethods(clone2, schema, parser);
|
|
20113
|
+
return clone2;
|
|
20114
|
+
}
|
|
19759
20115
|
function installCompiledUserMethods(target, source, parser) {
|
|
19760
20116
|
const targetAny = target;
|
|
19761
20117
|
const sourceAny = source;
|
|
@@ -19792,7 +20148,8 @@ function compileFn(schema, options) {
|
|
|
19792
20148
|
const ctx = {
|
|
19793
20149
|
constants: /* @__PURE__ */ new Map(),
|
|
19794
20150
|
constantCounter: 0,
|
|
19795
|
-
varCounter: 0
|
|
20151
|
+
varCounter: 0,
|
|
20152
|
+
definite: true
|
|
19796
20153
|
};
|
|
19797
20154
|
const doc = new Doc(["input"]);
|
|
19798
20155
|
const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
|
|
@@ -19816,6 +20173,7 @@ ${code}
|
|
|
19816
20173
|
if (options?.debug) {
|
|
19817
20174
|
fn.code = fullCode;
|
|
19818
20175
|
}
|
|
20176
|
+
fn.definite = ctx.definite;
|
|
19819
20177
|
return fn;
|
|
19820
20178
|
}
|
|
19821
20179
|
function addConstant(ctx, value) {
|
|
@@ -19827,6 +20185,10 @@ function addConstant(ctx, value) {
|
|
|
19827
20185
|
ctx.constants.set(name, value);
|
|
19828
20186
|
return name;
|
|
19829
20187
|
}
|
|
20188
|
+
function addUserConstant(ctx, fn) {
|
|
20189
|
+
ctx.definite = false;
|
|
20190
|
+
return addConstant(ctx, fn);
|
|
20191
|
+
}
|
|
19830
20192
|
function newVar(ctx) {
|
|
19831
20193
|
return `v${ctx.varCounter++}`;
|
|
19832
20194
|
}
|
|
@@ -19859,6 +20221,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
19859
20221
|
}
|
|
19860
20222
|
}
|
|
19861
20223
|
function emitRuntimeIsland(doc, ctx, schema, accessor) {
|
|
20224
|
+
ctx.definite = false;
|
|
19862
20225
|
const schemaConst = addConstant(ctx, schema);
|
|
19863
20226
|
const runConst = addConstant(ctx, runtimeRun);
|
|
19864
20227
|
const outVar = newVar(ctx);
|
|
@@ -19939,6 +20302,9 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
19939
20302
|
case "property":
|
|
19940
20303
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
19941
20304
|
break;
|
|
20305
|
+
case "properties":
|
|
20306
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor, false);
|
|
20307
|
+
break;
|
|
19942
20308
|
case "overwrite": {
|
|
19943
20309
|
const newAccessor = newVar(ctx);
|
|
19944
20310
|
generateOverwriteCheck(doc, ctx, check2, currentAccessor, newAccessor);
|
|
@@ -20047,6 +20413,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
20047
20413
|
doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
|
|
20048
20414
|
}
|
|
20049
20415
|
}
|
|
20416
|
+
function generatePropertiesChecks(doc, ctx, def, accessor, schemaRole) {
|
|
20417
|
+
if (def.when) {
|
|
20418
|
+
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
20419
|
+
}
|
|
20420
|
+
doc.write(schemaRole ? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;` : `if (${accessor} == null) return INVALID;`);
|
|
20421
|
+
const shape = def.shape;
|
|
20422
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
20423
|
+
const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
|
|
20424
|
+
const inputVar = newVar(ctx);
|
|
20425
|
+
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
20426
|
+
compileChild(doc, ctx, shape[key], inputVar, false);
|
|
20427
|
+
}
|
|
20428
|
+
}
|
|
20050
20429
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
20051
20430
|
const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
|
|
20052
20431
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
@@ -20074,7 +20453,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
20074
20453
|
if (isAsyncFunction(def.fn)) {
|
|
20075
20454
|
throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
|
|
20076
20455
|
}
|
|
20077
|
-
const fnConst =
|
|
20456
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
20078
20457
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
20079
20458
|
const resVar = newVar(ctx);
|
|
20080
20459
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -20094,7 +20473,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
20094
20473
|
throwAsync();
|
|
20095
20474
|
return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
|
|
20096
20475
|
};
|
|
20097
|
-
const helperConst =
|
|
20476
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
20098
20477
|
const outVar = newVar(ctx);
|
|
20099
20478
|
doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
|
|
20100
20479
|
doc.write(`if (${outVar} === INVALID) return INVALID;`);
|
|
@@ -20161,6 +20540,11 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
20161
20540
|
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
20162
20541
|
return accessor;
|
|
20163
20542
|
}
|
|
20543
|
+
if (fmt === "iban") {
|
|
20544
|
+
const validator = addConstant(ctx, isValidIBAN);
|
|
20545
|
+
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
20546
|
+
return accessor;
|
|
20547
|
+
}
|
|
20164
20548
|
const formatDef = def;
|
|
20165
20549
|
if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
|
|
20166
20550
|
const parseConst = addConstant(ctx, parseURLObject);
|
|
@@ -20343,6 +20727,10 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
20343
20727
|
case "custom":
|
|
20344
20728
|
typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
|
|
20345
20729
|
break;
|
|
20730
|
+
case "properties":
|
|
20731
|
+
generatePropertiesChecks(doc, ctx, schema._zod.def, accessor, true);
|
|
20732
|
+
typeAccessor = accessor;
|
|
20733
|
+
break;
|
|
20346
20734
|
case "transform":
|
|
20347
20735
|
typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
|
|
20348
20736
|
break;
|
|
@@ -20983,6 +21371,7 @@ function literalEquality(ctx, accessor, value) {
|
|
|
20983
21371
|
}
|
|
20984
21372
|
function generateIntersectionCheck(doc, ctx, schema, accessor) {
|
|
20985
21373
|
const def = schema._zod.def;
|
|
21374
|
+
ctx.definite = false;
|
|
20986
21375
|
const leftOutput = compileChild(doc, ctx, def.left, accessor);
|
|
20987
21376
|
const rightOutput = compileChild(doc, ctx, def.right, accessor);
|
|
20988
21377
|
const mergeConst = addConstant(ctx, mergeValues);
|
|
@@ -21036,14 +21425,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
21036
21425
|
const keyIsBareString = keyDef.type === "string" && keyDef.format === void 0 && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
|
|
21037
21426
|
if (!keyIsBareString) {
|
|
21038
21427
|
const isLoose = def.mode === "loose";
|
|
21039
|
-
const
|
|
21428
|
+
const keyFn = compileFn(def.keyType);
|
|
21429
|
+
if (keyFn.definite === false)
|
|
21430
|
+
ctx.definite = false;
|
|
21431
|
+
const keyFast = addConstant(ctx, keyFn);
|
|
21040
21432
|
const numericConst = addConstant(ctx, number);
|
|
21041
|
-
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
21042
21433
|
const outKeyVar = newVar(ctx);
|
|
21043
|
-
doc
|
|
21044
|
-
doc.indented((d) => {
|
|
21045
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
21046
|
-
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
21434
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
21047
21435
|
d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
|
|
21048
21436
|
d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
|
|
21049
21437
|
if (isLoose) {
|
|
@@ -21057,21 +21445,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
21057
21445
|
const valOutput = compileChild(d, ctx, def.valueType, valueVar);
|
|
21058
21446
|
d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
|
|
21059
21447
|
});
|
|
21060
|
-
doc.write(`}`);
|
|
21061
21448
|
return outputVar;
|
|
21062
21449
|
}
|
|
21063
|
-
|
|
21064
|
-
doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
|
|
21065
|
-
doc.indented((d) => {
|
|
21066
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
21067
|
-
d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
|
|
21068
|
-
d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
|
|
21450
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
21069
21451
|
d.write(`const ${valVar} = ${accessor}[${kVar}];`);
|
|
21070
21452
|
const valOutput = compileChild(d, ctx, def.valueType, valVar);
|
|
21071
21453
|
d.write(`${outputVar}[${kVar}] = ${valOutput};`);
|
|
21454
|
+
}, `return INVALID;`);
|
|
21455
|
+
return outputVar;
|
|
21456
|
+
}
|
|
21457
|
+
function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
21458
|
+
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
21459
|
+
const symsVar = newVar(ctx);
|
|
21460
|
+
const keysVar = newVar(ctx);
|
|
21461
|
+
const iVar = newVar(ctx);
|
|
21462
|
+
doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
|
|
21463
|
+
doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
|
|
21464
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
|
|
21465
|
+
doc.indented((d) => {
|
|
21466
|
+
d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
|
|
21467
|
+
d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
21468
|
+
body(d);
|
|
21469
|
+
});
|
|
21470
|
+
doc.write(`}`);
|
|
21471
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
|
|
21472
|
+
doc.indented((d) => {
|
|
21473
|
+
d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
|
|
21474
|
+
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
21475
|
+
if (onSymbol)
|
|
21476
|
+
d.write(onSymbol);
|
|
21477
|
+
else
|
|
21478
|
+
body(d);
|
|
21072
21479
|
});
|
|
21073
21480
|
doc.write(`}`);
|
|
21074
|
-
return outputVar;
|
|
21075
21481
|
}
|
|
21076
21482
|
function literalPropertyKey(ctx, key) {
|
|
21077
21483
|
if (typeof key === "string")
|
|
@@ -21124,7 +21530,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
|
|
|
21124
21530
|
}
|
|
21125
21531
|
function generateLazyCheck(doc, ctx, schema, accessor) {
|
|
21126
21532
|
const def = schema._zod.def;
|
|
21127
|
-
const getterConst =
|
|
21533
|
+
const getterConst = addUserConstant(ctx, def.getter);
|
|
21128
21534
|
const cacheConst = addConstant(ctx, { parser: null });
|
|
21129
21535
|
doc.write(`if (!${cacheConst}.parser) {`);
|
|
21130
21536
|
doc.indented((d) => {
|
|
@@ -21157,7 +21563,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
|
|
|
21157
21563
|
return INVALID;
|
|
21158
21564
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
21159
21565
|
};
|
|
21160
|
-
const helperConst =
|
|
21566
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
21161
21567
|
const transformedVar = newVar(ctx);
|
|
21162
21568
|
doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
|
|
21163
21569
|
doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
|
|
@@ -21175,7 +21581,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
|
|
|
21175
21581
|
if (isAsyncFunction(def.fn)) {
|
|
21176
21582
|
throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
|
|
21177
21583
|
}
|
|
21178
|
-
const fnConst =
|
|
21584
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
21179
21585
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
21180
21586
|
const resVar = newVar(ctx);
|
|
21181
21587
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -21208,7 +21614,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
|
|
|
21208
21614
|
});
|
|
21209
21615
|
doc.write(`})();`);
|
|
21210
21616
|
const innerConst = addConstant(ctx, def.innerType);
|
|
21211
|
-
const catchConst =
|
|
21617
|
+
const catchConst = addUserConstant(ctx, def.catchValue);
|
|
21212
21618
|
const catchHelperConst = addConstant(ctx, runtimeCatch);
|
|
21213
21619
|
doc.write(`if (${outputVar} === INVALID) {`);
|
|
21214
21620
|
doc.indented((d) => {
|
|
@@ -21232,7 +21638,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
21232
21638
|
return INVALID;
|
|
21233
21639
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
21234
21640
|
};
|
|
21235
|
-
const helperConst =
|
|
21641
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
21236
21642
|
const outputVar = newVar(ctx);
|
|
21237
21643
|
doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
|
|
21238
21644
|
doc.write(`if (${outputVar} === INVALID) return INVALID;`);
|
|
@@ -21491,6 +21897,16 @@ function _creditCard(Class2, params) {
|
|
|
21491
21897
|
});
|
|
21492
21898
|
}
|
|
21493
21899
|
// @__NO_SIDE_EFFECTS__
|
|
21900
|
+
function _iban(Class2, params) {
|
|
21901
|
+
return new Class2({
|
|
21902
|
+
type: "string",
|
|
21903
|
+
format: "iban",
|
|
21904
|
+
check: "string_format",
|
|
21905
|
+
abort: false,
|
|
21906
|
+
...normalizeParams(params)
|
|
21907
|
+
});
|
|
21908
|
+
}
|
|
21909
|
+
// @__NO_SIDE_EFFECTS__
|
|
21494
21910
|
function _jwt(Class2, params) {
|
|
21495
21911
|
return new Class2({
|
|
21496
21912
|
type: "string",
|
|
@@ -21904,8 +22320,13 @@ function _property(property, schema, params) {
|
|
|
21904
22320
|
});
|
|
21905
22321
|
}
|
|
21906
22322
|
// @__NO_SIDE_EFFECTS__
|
|
21907
|
-
function _properties(shape) {
|
|
21908
|
-
return
|
|
22323
|
+
function _properties(Class2, shape, params) {
|
|
22324
|
+
return new Class2({
|
|
22325
|
+
type: "properties",
|
|
22326
|
+
check: "properties",
|
|
22327
|
+
shape,
|
|
22328
|
+
...normalizeParams(params)
|
|
22329
|
+
});
|
|
21909
22330
|
}
|
|
21910
22331
|
// @__NO_SIDE_EFFECTS__
|
|
21911
22332
|
function _mime(types, params) {
|
|
@@ -22342,7 +22763,7 @@ function handleUnrepresentable(schema, ctx, json2, params, message) {
|
|
|
22342
22763
|
Object.assign(json2, result);
|
|
22343
22764
|
return true;
|
|
22344
22765
|
}
|
|
22345
|
-
function
|
|
22766
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
22346
22767
|
var _a3;
|
|
22347
22768
|
const def = schema._zod.def;
|
|
22348
22769
|
const seen = ctx.seen.get(schema);
|
|
@@ -22381,7 +22802,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
22381
22802
|
if (parent) {
|
|
22382
22803
|
if (!result.ref)
|
|
22383
22804
|
result.ref = parent;
|
|
22384
|
-
|
|
22805
|
+
processSchema(parent, ctx, params);
|
|
22385
22806
|
ctx.seen.get(parent).isParent = true;
|
|
22386
22807
|
}
|
|
22387
22808
|
}
|
|
@@ -22488,7 +22909,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22488
22909
|
if (seen.count > 1) {
|
|
22489
22910
|
if (ctx.reused === "ref") {
|
|
22490
22911
|
extractToDef(entry);
|
|
22491
|
-
continue;
|
|
22492
22912
|
}
|
|
22493
22913
|
}
|
|
22494
22914
|
}
|
|
@@ -22537,11 +22957,11 @@ function foldObjects(members2) {
|
|
|
22537
22957
|
}
|
|
22538
22958
|
objects.push(member);
|
|
22539
22959
|
}
|
|
22540
|
-
const
|
|
22960
|
+
const properties2 = {};
|
|
22541
22961
|
const required2 = /* @__PURE__ */ new Set();
|
|
22542
22962
|
for (const object2 of objects) {
|
|
22543
22963
|
for (const key in object2.properties) {
|
|
22544
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
22964
|
+
if (Object.prototype.hasOwnProperty.call(properties2, key))
|
|
22545
22965
|
continue;
|
|
22546
22966
|
const parts = [];
|
|
22547
22967
|
for (const other of objects) {
|
|
@@ -22552,12 +22972,12 @@ function foldObjects(members2) {
|
|
|
22552
22972
|
parts.push(part);
|
|
22553
22973
|
}
|
|
22554
22974
|
const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
|
|
22555
|
-
assignProp(
|
|
22975
|
+
assignProp(properties2, key, merged);
|
|
22556
22976
|
}
|
|
22557
22977
|
for (const key of object2.required ?? [])
|
|
22558
22978
|
required2.add(key);
|
|
22559
22979
|
}
|
|
22560
|
-
const folded = { type: "object", properties };
|
|
22980
|
+
const folded = { type: "object", properties: properties2 };
|
|
22561
22981
|
if (required2.size)
|
|
22562
22982
|
folded.required = [...required2];
|
|
22563
22983
|
if (objects.every((object2) => object2.additionalProperties === false)) {
|
|
@@ -22816,19 +23236,107 @@ function isTransforming(_schema, _ctx) {
|
|
|
22816
23236
|
}
|
|
22817
23237
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
22818
23238
|
const ctx = initializeContext({ ...params, processors });
|
|
22819
|
-
|
|
23239
|
+
processSchema(schema, ctx);
|
|
22820
23240
|
extractDefs(ctx, schema);
|
|
22821
23241
|
return finalize(ctx, schema);
|
|
22822
23242
|
};
|
|
22823
23243
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
22824
23244
|
const { libraryOptions, target } = params ?? {};
|
|
22825
23245
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
22826
|
-
|
|
23246
|
+
processSchema(schema, ctx);
|
|
22827
23247
|
extractDefs(ctx, schema);
|
|
22828
23248
|
return finalize(ctx, schema);
|
|
22829
23249
|
};
|
|
22830
23250
|
|
|
22831
23251
|
// ../../node_modules/zod/v4/core/json-schema-processors.js
|
|
23252
|
+
var narrowMin = (agg, key, value) => {
|
|
23253
|
+
if (agg[key] === void 0 || value > agg[key])
|
|
23254
|
+
agg[key] = value;
|
|
23255
|
+
};
|
|
23256
|
+
var narrowMax = (agg, key, value) => {
|
|
23257
|
+
if (agg[key] === void 0 || value < agg[key])
|
|
23258
|
+
agg[key] = value;
|
|
23259
|
+
};
|
|
23260
|
+
var narrowBoth = (agg, value) => {
|
|
23261
|
+
narrowMin(agg, "minimum", value);
|
|
23262
|
+
narrowMax(agg, "maximum", value);
|
|
23263
|
+
};
|
|
23264
|
+
var addDivisor = (agg, value) => {
|
|
23265
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
23266
|
+
if (!agg.multipleOf.includes(value))
|
|
23267
|
+
agg.multipleOf.push(value);
|
|
23268
|
+
};
|
|
23269
|
+
var addPattern = (agg, pattern) => {
|
|
23270
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
23271
|
+
agg.patterns.add(pattern);
|
|
23272
|
+
};
|
|
23273
|
+
var intersectMime = (agg, mime) => {
|
|
23274
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
23275
|
+
};
|
|
23276
|
+
var setFormat = (agg, format) => {
|
|
23277
|
+
agg.format = format;
|
|
23278
|
+
if (format.includes("int"))
|
|
23279
|
+
agg.isInt = true;
|
|
23280
|
+
};
|
|
23281
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
23282
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
23283
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
23284
|
+
setFormat(agg, def.format);
|
|
23285
|
+
const [minimum, maximum] = ranges[def.format];
|
|
23286
|
+
narrowMin(agg, "minimum", minimum);
|
|
23287
|
+
narrowMax(agg, "maximum", maximum);
|
|
23288
|
+
};
|
|
23289
|
+
var contributors = {
|
|
23290
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
23291
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
23292
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
23293
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
23294
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
23295
|
+
min_length: minContributor,
|
|
23296
|
+
max_length: maxContributor,
|
|
23297
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
23298
|
+
min_size: minContributor,
|
|
23299
|
+
max_size: maxContributor,
|
|
23300
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
23301
|
+
string_format: (agg, def) => {
|
|
23302
|
+
setFormat(agg, def.format);
|
|
23303
|
+
if (def.pattern)
|
|
23304
|
+
addPattern(agg, def.pattern);
|
|
23305
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
23306
|
+
agg.contentEncoding = def.format;
|
|
23307
|
+
if (def.local || def.precision === -1)
|
|
23308
|
+
agg.laxFormat = true;
|
|
23309
|
+
},
|
|
23310
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
23311
|
+
};
|
|
23312
|
+
function aggregateChecks(schema) {
|
|
23313
|
+
const agg = {};
|
|
23314
|
+
const def = schema._zod.def;
|
|
23315
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
23316
|
+
for (const ch of list)
|
|
23317
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
23318
|
+
const bag = schema._zod.bag;
|
|
23319
|
+
if (bag.minimum !== void 0)
|
|
23320
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
23321
|
+
if (bag.exclusiveMinimum !== void 0)
|
|
23322
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
23323
|
+
if (bag.maximum !== void 0)
|
|
23324
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
23325
|
+
if (bag.exclusiveMaximum !== void 0)
|
|
23326
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
23327
|
+
if (bag.multipleOf !== void 0)
|
|
23328
|
+
addDivisor(agg, bag.multipleOf);
|
|
23329
|
+
if (bag.format !== void 0) {
|
|
23330
|
+
agg.format ?? (agg.format = bag.format);
|
|
23331
|
+
if (bag.format.includes("int"))
|
|
23332
|
+
agg.isInt = true;
|
|
23333
|
+
}
|
|
23334
|
+
if (bag.mime)
|
|
23335
|
+
intersectMime(agg, bag.mime);
|
|
23336
|
+
for (const pattern of bag.patterns ?? [])
|
|
23337
|
+
addPattern(agg, pattern);
|
|
23338
|
+
return agg;
|
|
23339
|
+
}
|
|
22832
23340
|
var formatMap = {
|
|
22833
23341
|
guid: "uuid",
|
|
22834
23342
|
url: "uri",
|
|
@@ -22837,10 +23345,15 @@ var formatMap = {
|
|
|
22837
23345
|
regex: ""
|
|
22838
23346
|
// do not set
|
|
22839
23347
|
};
|
|
23348
|
+
var exactPatterns = /* @__PURE__ */ new Map([
|
|
23349
|
+
[base64Charset, base64],
|
|
23350
|
+
[base64urlCharset, base64url]
|
|
23351
|
+
]);
|
|
23352
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
22840
23353
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
22841
23354
|
const json2 = _json;
|
|
22842
23355
|
json2.type = "string";
|
|
22843
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
23356
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
22844
23357
|
if (typeof minimum === "number")
|
|
22845
23358
|
json2.minLength = minimum;
|
|
22846
23359
|
if (typeof maximum === "number")
|
|
@@ -22856,7 +23369,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
22856
23369
|
if (contentEncoding)
|
|
22857
23370
|
json2.contentEncoding = contentEncoding;
|
|
22858
23371
|
if (patterns && patterns.size > 0) {
|
|
22859
|
-
const patternList = [...patterns];
|
|
23372
|
+
const patternList = [...patterns].map(exactPattern);
|
|
22860
23373
|
if (patternList.length === 1)
|
|
22861
23374
|
json2.pattern = patternList[0].source;
|
|
22862
23375
|
else if (patternList.length > 1) {
|
|
@@ -22871,11 +23384,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
22871
23384
|
};
|
|
22872
23385
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
22873
23386
|
const json2 = _json;
|
|
22874
|
-
const { minimum, maximum,
|
|
22875
|
-
|
|
22876
|
-
json2.type = "integer";
|
|
22877
|
-
else
|
|
22878
|
-
json2.type = "number";
|
|
23387
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
23388
|
+
json2.type = isInt ? "integer" : "number";
|
|
22879
23389
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
22880
23390
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
22881
23391
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -22899,11 +23409,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
22899
23409
|
} else if (typeof maximum === "number") {
|
|
22900
23410
|
json2.maximum = maximum;
|
|
22901
23411
|
}
|
|
22902
|
-
if (
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
23412
|
+
if (multipleOf) {
|
|
23413
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
23414
|
+
for (const divisor of multipleOf) {
|
|
23415
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
23416
|
+
divisors.add(Math.abs(divisor));
|
|
23417
|
+
else
|
|
23418
|
+
handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
23419
|
+
}
|
|
23420
|
+
const [first, ...rest] = divisors;
|
|
23421
|
+
if (first !== void 0)
|
|
23422
|
+
json2.multipleOf = first;
|
|
23423
|
+
if (rest.length)
|
|
23424
|
+
json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
22907
23425
|
}
|
|
22908
23426
|
};
|
|
22909
23427
|
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
@@ -23006,27 +23524,22 @@ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
|
23006
23524
|
};
|
|
23007
23525
|
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
23008
23526
|
const _json = json2;
|
|
23009
|
-
|
|
23010
|
-
|
|
23011
|
-
|
|
23012
|
-
|
|
23013
|
-
};
|
|
23014
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
23527
|
+
_json.type = "string";
|
|
23528
|
+
_json.format = "binary";
|
|
23529
|
+
_json.contentEncoding = "binary";
|
|
23530
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
23015
23531
|
if (minimum !== void 0)
|
|
23016
|
-
|
|
23532
|
+
_json.minLength = minimum;
|
|
23017
23533
|
if (maximum !== void 0)
|
|
23018
|
-
|
|
23019
|
-
if (mime)
|
|
23020
|
-
|
|
23021
|
-
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23025
|
-
|
|
23026
|
-
}
|
|
23027
|
-
} else {
|
|
23028
|
-
Object.assign(_json, file2);
|
|
23029
|
-
}
|
|
23534
|
+
_json.maxLength = maximum;
|
|
23535
|
+
if (!mime)
|
|
23536
|
+
return;
|
|
23537
|
+
if (mime.length === 0)
|
|
23538
|
+
_json.not = {};
|
|
23539
|
+
else if (mime.length === 1)
|
|
23540
|
+
_json.contentMediaType = mime[0];
|
|
23541
|
+
else
|
|
23542
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
23030
23543
|
};
|
|
23031
23544
|
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
23032
23545
|
json2.type = "boolean";
|
|
@@ -23049,13 +23562,13 @@ var setProcessor = (schema, ctx, json2, params) => {
|
|
|
23049
23562
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
23050
23563
|
const json2 = _json;
|
|
23051
23564
|
const def = schema._zod.def;
|
|
23052
|
-
const { minimum, maximum } = schema
|
|
23565
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
23053
23566
|
if (typeof minimum === "number")
|
|
23054
23567
|
json2.minItems = minimum;
|
|
23055
23568
|
if (typeof maximum === "number")
|
|
23056
23569
|
json2.maxItems = maximum;
|
|
23057
23570
|
json2.type = "array";
|
|
23058
|
-
json2.items =
|
|
23571
|
+
json2.items = processSchema(def.element, ctx, {
|
|
23059
23572
|
...params,
|
|
23060
23573
|
path: [...params.path, "items"]
|
|
23061
23574
|
});
|
|
@@ -23081,7 +23594,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
23081
23594
|
json2.type = "object";
|
|
23082
23595
|
json2.properties = {};
|
|
23083
23596
|
for (const key in shape) {
|
|
23084
|
-
assignProp(json2.properties, key,
|
|
23597
|
+
assignProp(json2.properties, key, processSchema(shape[key], ctx, {
|
|
23085
23598
|
...params,
|
|
23086
23599
|
path: [...params.path, "properties", key]
|
|
23087
23600
|
}));
|
|
@@ -23104,16 +23617,41 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
23104
23617
|
if (ctx.io === "output")
|
|
23105
23618
|
json2.additionalProperties = false;
|
|
23106
23619
|
} else if (def.catchall) {
|
|
23107
|
-
json2.additionalProperties =
|
|
23620
|
+
json2.additionalProperties = processSchema(def.catchall, ctx, {
|
|
23108
23621
|
...params,
|
|
23109
23622
|
path: [...params.path, "additionalProperties"]
|
|
23110
23623
|
});
|
|
23111
23624
|
}
|
|
23112
23625
|
};
|
|
23626
|
+
var propertiesProcessor = (schema, ctx, _json, params) => {
|
|
23627
|
+
const json2 = _json;
|
|
23628
|
+
const def = schema._zod.def;
|
|
23629
|
+
if (Object.getOwnPropertySymbols(def.shape).length && handleUnrepresentable(schema, ctx, json2, params, "Symbol keys cannot be represented in JSON Schema")) {
|
|
23630
|
+
return;
|
|
23631
|
+
}
|
|
23632
|
+
if (ctx.io === "output") {
|
|
23633
|
+
for (const key in def.shape) {
|
|
23634
|
+
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`)) {
|
|
23635
|
+
return;
|
|
23636
|
+
}
|
|
23637
|
+
}
|
|
23638
|
+
}
|
|
23639
|
+
json2.type = "object";
|
|
23640
|
+
json2.properties = {};
|
|
23641
|
+
for (const key in def.shape) {
|
|
23642
|
+
assignProp(json2.properties, key, processSchema(def.shape[key], ctx, {
|
|
23643
|
+
...params,
|
|
23644
|
+
path: [...params.path, "properties", key]
|
|
23645
|
+
}));
|
|
23646
|
+
}
|
|
23647
|
+
const required2 = Object.keys(def.shape).filter((key) => inputOptin(def.shape[key]) === void 0);
|
|
23648
|
+
if (required2.length > 0)
|
|
23649
|
+
json2.required = required2;
|
|
23650
|
+
};
|
|
23113
23651
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
23114
23652
|
const def = schema._zod.def;
|
|
23115
23653
|
const isExclusive = def.inclusive === false;
|
|
23116
|
-
const options = def.options.map((x, i) =>
|
|
23654
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
23117
23655
|
...params,
|
|
23118
23656
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
23119
23657
|
}));
|
|
@@ -23125,11 +23663,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
23125
23663
|
};
|
|
23126
23664
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
23127
23665
|
const def = schema._zod.def;
|
|
23128
|
-
const a =
|
|
23666
|
+
const a = processSchema(def.left, ctx, {
|
|
23129
23667
|
...params,
|
|
23130
23668
|
path: [...params.path, "allOf", 0]
|
|
23131
23669
|
});
|
|
23132
|
-
const b =
|
|
23670
|
+
const b = processSchema(def.right, ctx, {
|
|
23133
23671
|
...params,
|
|
23134
23672
|
path: [...params.path, "allOf", 1]
|
|
23135
23673
|
});
|
|
@@ -23147,11 +23685,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
23147
23685
|
json2.type = "array";
|
|
23148
23686
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
23149
23687
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
23150
|
-
const prefixItems = def.items.map((x, i) =>
|
|
23688
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
23151
23689
|
...params,
|
|
23152
23690
|
path: [...params.path, prefixPath, i]
|
|
23153
23691
|
}));
|
|
23154
|
-
const rest = def.rest ?
|
|
23692
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
23155
23693
|
...params,
|
|
23156
23694
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
23157
23695
|
}) : null;
|
|
@@ -23199,7 +23737,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
23199
23737
|
if (isClosed)
|
|
23200
23738
|
json2.maxItems = maxItems;
|
|
23201
23739
|
}
|
|
23202
|
-
const { minimum, maximum } = schema
|
|
23740
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
23203
23741
|
if (typeof minimum === "number")
|
|
23204
23742
|
json2.minItems = minimum;
|
|
23205
23743
|
if (typeof maximum === "number")
|
|
@@ -23273,20 +23811,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
23273
23811
|
const def = schema._zod.def;
|
|
23274
23812
|
json2.type = "object";
|
|
23275
23813
|
const keyType = def.keyType;
|
|
23276
|
-
const
|
|
23277
|
-
const patterns = keyBag?.patterns;
|
|
23814
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
23278
23815
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
23279
|
-
const valueSchema =
|
|
23816
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
23280
23817
|
...params,
|
|
23281
23818
|
path: [...params.path, "patternProperties", "*"]
|
|
23282
23819
|
});
|
|
23283
23820
|
json2.patternProperties = {};
|
|
23284
23821
|
for (const pattern of patterns) {
|
|
23285
|
-
assignProp(json2.patternProperties, pattern.source, valueSchema);
|
|
23822
|
+
assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
23286
23823
|
}
|
|
23287
23824
|
} else {
|
|
23288
23825
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
23289
|
-
json2.propertyNames =
|
|
23826
|
+
json2.propertyNames = processSchema(def.keyType, ctx, {
|
|
23290
23827
|
...params,
|
|
23291
23828
|
path: [...params.path, "propertyNames"]
|
|
23292
23829
|
});
|
|
@@ -23298,7 +23835,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
23298
23835
|
}
|
|
23299
23836
|
pending.push(schema);
|
|
23300
23837
|
}
|
|
23301
|
-
json2.additionalProperties =
|
|
23838
|
+
json2.additionalProperties = processSchema(def.valueType, ctx, {
|
|
23302
23839
|
...params,
|
|
23303
23840
|
path: [...params.path, "additionalProperties"]
|
|
23304
23841
|
});
|
|
@@ -23314,7 +23851,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
23314
23851
|
};
|
|
23315
23852
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
23316
23853
|
const def = schema._zod.def;
|
|
23317
|
-
const inner =
|
|
23854
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
23318
23855
|
const seen = ctx.seen.get(schema);
|
|
23319
23856
|
if (ctx.target === "openapi-3.0") {
|
|
23320
23857
|
seen.ref = def.innerType;
|
|
@@ -23325,7 +23862,7 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
23325
23862
|
};
|
|
23326
23863
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
23327
23864
|
const def = schema._zod.def;
|
|
23328
|
-
|
|
23865
|
+
processSchema(def.innerType, ctx, params);
|
|
23329
23866
|
const seen = ctx.seen.get(schema);
|
|
23330
23867
|
seen.ref = def.innerType;
|
|
23331
23868
|
};
|
|
@@ -23345,7 +23882,7 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
|
|
|
23345
23882
|
}
|
|
23346
23883
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
23347
23884
|
const def = schema._zod.def;
|
|
23348
|
-
|
|
23885
|
+
processSchema(def.innerType, ctx, params);
|
|
23349
23886
|
const seen = ctx.seen.get(schema);
|
|
23350
23887
|
seen.ref = def.innerType;
|
|
23351
23888
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
|
|
@@ -23354,7 +23891,7 @@ var defaultProcessor = (schema, ctx, json2, params) => {
|
|
|
23354
23891
|
};
|
|
23355
23892
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
23356
23893
|
const def = schema._zod.def;
|
|
23357
|
-
|
|
23894
|
+
processSchema(def.innerType, ctx, params);
|
|
23358
23895
|
const seen = ctx.seen.get(schema);
|
|
23359
23896
|
seen.ref = def.innerType;
|
|
23360
23897
|
if (ctx.io !== "input")
|
|
@@ -23365,7 +23902,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
23365
23902
|
};
|
|
23366
23903
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
23367
23904
|
const def = schema._zod.def;
|
|
23368
|
-
|
|
23905
|
+
processSchema(def.innerType, ctx, params);
|
|
23369
23906
|
const seen = ctx.seen.get(schema);
|
|
23370
23907
|
seen.ref = def.innerType;
|
|
23371
23908
|
let catchValue;
|
|
@@ -23381,32 +23918,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
23381
23918
|
const def = schema._zod.def;
|
|
23382
23919
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
23383
23920
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
23384
|
-
|
|
23921
|
+
processSchema(innerType, ctx, params);
|
|
23385
23922
|
const seen = ctx.seen.get(schema);
|
|
23386
23923
|
seen.ref = innerType;
|
|
23387
23924
|
};
|
|
23388
23925
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
23389
23926
|
const def = schema._zod.def;
|
|
23390
|
-
|
|
23927
|
+
processSchema(def.innerType, ctx, params);
|
|
23391
23928
|
const seen = ctx.seen.get(schema);
|
|
23392
23929
|
seen.ref = def.innerType;
|
|
23393
23930
|
json2.readOnly = true;
|
|
23394
23931
|
};
|
|
23395
23932
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
23396
23933
|
const def = schema._zod.def;
|
|
23397
|
-
|
|
23934
|
+
processSchema(def.innerType, ctx, params);
|
|
23398
23935
|
const seen = ctx.seen.get(schema);
|
|
23399
23936
|
seen.ref = def.innerType;
|
|
23400
23937
|
};
|
|
23401
23938
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
23402
23939
|
const def = schema._zod.def;
|
|
23403
|
-
|
|
23940
|
+
processSchema(def.innerType, ctx, params);
|
|
23404
23941
|
const seen = ctx.seen.get(schema);
|
|
23405
23942
|
seen.ref = def.innerType;
|
|
23406
23943
|
};
|
|
23407
23944
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
23408
23945
|
const innerType = schema._zod.innerType;
|
|
23409
|
-
|
|
23946
|
+
processSchema(innerType, ctx, params);
|
|
23410
23947
|
const seen = ctx.seen.get(schema);
|
|
23411
23948
|
seen.ref = innerType;
|
|
23412
23949
|
};
|
|
@@ -23430,6 +23967,7 @@ var allProcessors = {
|
|
|
23430
23967
|
file: fileProcessor,
|
|
23431
23968
|
success: successProcessor,
|
|
23432
23969
|
custom: customProcessor,
|
|
23970
|
+
properties: propertiesProcessor,
|
|
23433
23971
|
function: functionProcessor,
|
|
23434
23972
|
transform: transformProcessor,
|
|
23435
23973
|
map: mapProcessor,
|
|
@@ -23458,7 +23996,7 @@ function toJSONSchema(input2, params) {
|
|
|
23458
23996
|
const defs = {};
|
|
23459
23997
|
for (const entry of registry2._idmap.entries()) {
|
|
23460
23998
|
const [_, schema] = entry;
|
|
23461
|
-
|
|
23999
|
+
processSchema(schema, ctx2);
|
|
23462
24000
|
}
|
|
23463
24001
|
const schemas = {};
|
|
23464
24002
|
const external = {
|
|
@@ -23481,7 +24019,7 @@ function toJSONSchema(input2, params) {
|
|
|
23481
24019
|
return { schemas };
|
|
23482
24020
|
}
|
|
23483
24021
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
23484
|
-
|
|
24022
|
+
processSchema(input2, ctx);
|
|
23485
24023
|
extractDefs(ctx, input2);
|
|
23486
24024
|
return finalize(ctx, input2);
|
|
23487
24025
|
}
|
|
@@ -23540,7 +24078,7 @@ var JSONSchemaGenerator = class {
|
|
|
23540
24078
|
* This must be called before emit().
|
|
23541
24079
|
*/
|
|
23542
24080
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
23543
|
-
return
|
|
24081
|
+
return processSchema(schema, this.ctx, _params);
|
|
23544
24082
|
}
|
|
23545
24083
|
/**
|
|
23546
24084
|
* Emit the final JSON Schema after processing.
|
|
@@ -23597,12 +24135,14 @@ __export(schemas_exports2, {
|
|
|
23597
24135
|
ZodFile: () => ZodFile,
|
|
23598
24136
|
ZodFunction: () => ZodFunction,
|
|
23599
24137
|
ZodGUID: () => ZodGUID,
|
|
24138
|
+
ZodIBAN: () => ZodIBAN,
|
|
23600
24139
|
ZodIPv4: () => ZodIPv4,
|
|
23601
24140
|
ZodIPv6: () => ZodIPv6,
|
|
23602
24141
|
ZodISODate: () => ZodISODate,
|
|
23603
24142
|
ZodISODateTime: () => ZodISODateTime,
|
|
23604
24143
|
ZodISODuration: () => ZodISODuration,
|
|
23605
24144
|
ZodISOTime: () => ZodISOTime,
|
|
24145
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
23606
24146
|
ZodIntersection: () => ZodIntersection,
|
|
23607
24147
|
ZodJWT: () => ZodJWT,
|
|
23608
24148
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -23624,6 +24164,7 @@ __export(schemas_exports2, {
|
|
|
23624
24164
|
ZodPrefault: () => ZodPrefault,
|
|
23625
24165
|
ZodPreprocess: () => ZodPreprocess,
|
|
23626
24166
|
ZodPromise: () => ZodPromise,
|
|
24167
|
+
ZodProperties: () => ZodProperties,
|
|
23627
24168
|
ZodReadonly: () => ZodReadonly,
|
|
23628
24169
|
ZodRecord: () => ZodRecord,
|
|
23629
24170
|
ZodSet: () => ZodSet,
|
|
@@ -23679,6 +24220,7 @@ __export(schemas_exports2, {
|
|
|
23679
24220
|
hex: () => hex2,
|
|
23680
24221
|
hostname: () => hostname2,
|
|
23681
24222
|
httpUrl: () => httpUrl,
|
|
24223
|
+
iban: () => iban2,
|
|
23682
24224
|
instanceof: () => _instanceof,
|
|
23683
24225
|
int: () => int,
|
|
23684
24226
|
int32: () => int32,
|
|
@@ -23714,6 +24256,7 @@ __export(schemas_exports2, {
|
|
|
23714
24256
|
prefault: () => prefault,
|
|
23715
24257
|
preprocess: () => preprocess,
|
|
23716
24258
|
promise: () => promise,
|
|
24259
|
+
properties: () => properties,
|
|
23717
24260
|
readonly: () => readonly,
|
|
23718
24261
|
record: () => record,
|
|
23719
24262
|
refine: () => refine,
|
|
@@ -23767,7 +24310,6 @@ __export(checks_exports2, {
|
|
|
23767
24310
|
normalize: () => _normalize,
|
|
23768
24311
|
overwrite: () => _overwrite,
|
|
23769
24312
|
positive: () => _positive,
|
|
23770
|
-
properties: () => _properties,
|
|
23771
24313
|
property: () => _property,
|
|
23772
24314
|
regex: () => _regex,
|
|
23773
24315
|
size: () => _size,
|
|
@@ -23981,6 +24523,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
23981
24523
|
set spa(value) {
|
|
23982
24524
|
util_exports.own(this, "spa", value);
|
|
23983
24525
|
},
|
|
24526
|
+
validate(data, params) {
|
|
24527
|
+
return validate(this, data, params);
|
|
24528
|
+
},
|
|
24529
|
+
validateAsync(data, params) {
|
|
24530
|
+
return validateAsync(this, data, params);
|
|
24531
|
+
},
|
|
23984
24532
|
encode: function _encode2(data, params) {
|
|
23985
24533
|
return encode2(this, data, params, { callee: _encode2 });
|
|
23986
24534
|
},
|
|
@@ -24017,61 +24565,65 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
24017
24565
|
return this._zod.def;
|
|
24018
24566
|
}
|
|
24019
24567
|
});
|
|
24020
|
-
var _ZodString = /* @__PURE__ */ $constructor(
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
|
|
24024
|
-
|
|
24025
|
-
|
|
24026
|
-
inst.minLength = bag.minimum ?? null;
|
|
24027
|
-
inst.maxLength = bag.maximum ?? null;
|
|
24028
|
-
}, {
|
|
24029
|
-
regex(...args) {
|
|
24030
|
-
return this.check(_regex(...args));
|
|
24031
|
-
},
|
|
24032
|
-
includes(...args) {
|
|
24033
|
-
return this.check(_includes(...args));
|
|
24034
|
-
},
|
|
24035
|
-
startsWith(...args) {
|
|
24036
|
-
return this.check(_startsWith(...args));
|
|
24037
|
-
},
|
|
24038
|
-
endsWith(...args) {
|
|
24039
|
-
return this.check(_endsWith(...args));
|
|
24040
|
-
},
|
|
24041
|
-
min(...args) {
|
|
24042
|
-
return this.check(_minLength(...args));
|
|
24043
|
-
},
|
|
24044
|
-
max(...args) {
|
|
24045
|
-
return this.check(_maxLength(...args));
|
|
24046
|
-
},
|
|
24047
|
-
length(...args) {
|
|
24048
|
-
return this.check(_length(...args));
|
|
24049
|
-
},
|
|
24050
|
-
nonempty(...args) {
|
|
24051
|
-
return this.check(_minLength(1, ...args));
|
|
24052
|
-
},
|
|
24053
|
-
lowercase(params) {
|
|
24054
|
-
return this.check(_lowercase(params));
|
|
24568
|
+
var _ZodString = /* @__PURE__ */ $constructor(
|
|
24569
|
+
"_ZodString",
|
|
24570
|
+
(inst, def) => {
|
|
24571
|
+
$ZodString.init(inst, def);
|
|
24572
|
+
ZodType.init(inst, def);
|
|
24573
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
|
|
24055
24574
|
},
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
|
|
24064
|
-
|
|
24065
|
-
|
|
24066
|
-
|
|
24067
|
-
|
|
24068
|
-
|
|
24069
|
-
|
|
24070
|
-
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
|
|
24074
|
-
|
|
24575
|
+
/* @__PURE__ */ util_exports.derived({
|
|
24576
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
24577
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
24578
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
24579
|
+
}, {
|
|
24580
|
+
regex(...args) {
|
|
24581
|
+
return this.check(_regex(...args));
|
|
24582
|
+
},
|
|
24583
|
+
includes(...args) {
|
|
24584
|
+
return this.check(_includes(...args));
|
|
24585
|
+
},
|
|
24586
|
+
startsWith(...args) {
|
|
24587
|
+
return this.check(_startsWith(...args));
|
|
24588
|
+
},
|
|
24589
|
+
endsWith(...args) {
|
|
24590
|
+
return this.check(_endsWith(...args));
|
|
24591
|
+
},
|
|
24592
|
+
min(...args) {
|
|
24593
|
+
return this.check(_minLength(...args));
|
|
24594
|
+
},
|
|
24595
|
+
max(...args) {
|
|
24596
|
+
return this.check(_maxLength(...args));
|
|
24597
|
+
},
|
|
24598
|
+
length(...args) {
|
|
24599
|
+
return this.check(_length(...args));
|
|
24600
|
+
},
|
|
24601
|
+
nonempty(...args) {
|
|
24602
|
+
return this.check(_minLength(1, ...args));
|
|
24603
|
+
},
|
|
24604
|
+
lowercase(params) {
|
|
24605
|
+
return this.check(_lowercase(params));
|
|
24606
|
+
},
|
|
24607
|
+
uppercase(params) {
|
|
24608
|
+
return this.check(_uppercase(params));
|
|
24609
|
+
},
|
|
24610
|
+
trim() {
|
|
24611
|
+
return this.check(_trim());
|
|
24612
|
+
},
|
|
24613
|
+
normalize(...args) {
|
|
24614
|
+
return this.check(_normalize(...args));
|
|
24615
|
+
},
|
|
24616
|
+
toLowerCase() {
|
|
24617
|
+
return this.check(_toLowerCase());
|
|
24618
|
+
},
|
|
24619
|
+
toUpperCase() {
|
|
24620
|
+
return this.check(_toUpperCase());
|
|
24621
|
+
},
|
|
24622
|
+
slugify() {
|
|
24623
|
+
return this.check(_slugify());
|
|
24624
|
+
}
|
|
24625
|
+
})
|
|
24626
|
+
);
|
|
24075
24627
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
24076
24628
|
$ZodString.init(inst, def);
|
|
24077
24629
|
_ZodString.init(inst, def);
|
|
@@ -24334,6 +24886,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
24334
24886
|
function creditCard2(params) {
|
|
24335
24887
|
return _creditCard(ZodCreditCard, params);
|
|
24336
24888
|
}
|
|
24889
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
24890
|
+
$ZodIBAN.init(inst, def);
|
|
24891
|
+
ZodStringFormat.init(inst, def);
|
|
24892
|
+
});
|
|
24893
|
+
function iban2(params) {
|
|
24894
|
+
return _iban(ZodIBAN, params);
|
|
24895
|
+
}
|
|
24337
24896
|
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
24338
24897
|
$ZodJWT.init(inst, def);
|
|
24339
24898
|
ZodStringFormat.init(inst, def);
|
|
@@ -24362,63 +24921,76 @@ function hash(alg, params) {
|
|
|
24362
24921
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
24363
24922
|
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
24364
24923
|
}
|
|
24365
|
-
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
|
|
24371
|
-
|
|
24372
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
24373
|
-
inst.isFinite = true;
|
|
24374
|
-
inst.format = bag.format ?? null;
|
|
24375
|
-
}, {
|
|
24376
|
-
gt(value, params) {
|
|
24377
|
-
return this.check(_gt(value, params));
|
|
24378
|
-
},
|
|
24379
|
-
gte(value, params) {
|
|
24380
|
-
return this.check(_gte(value, params));
|
|
24924
|
+
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
24925
|
+
"ZodNumber",
|
|
24926
|
+
(inst, def) => {
|
|
24927
|
+
$ZodNumber.init(inst, def);
|
|
24928
|
+
ZodType.init(inst, def);
|
|
24929
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
24930
|
+
inst.isFinite = true;
|
|
24381
24931
|
},
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
},
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24932
|
+
/* @__PURE__ */ util_exports.derived({
|
|
24933
|
+
minValue: (inst) => {
|
|
24934
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
24935
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
24936
|
+
},
|
|
24937
|
+
maxValue: (inst) => {
|
|
24938
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
24939
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
24940
|
+
},
|
|
24941
|
+
isInt: (inst) => {
|
|
24942
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
24943
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
24944
|
+
},
|
|
24945
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
24946
|
+
}, {
|
|
24947
|
+
gt(value, params) {
|
|
24948
|
+
return this.check(_gt(value, params));
|
|
24949
|
+
},
|
|
24950
|
+
gte(value, params) {
|
|
24951
|
+
return this.check(_gte(value, params));
|
|
24952
|
+
},
|
|
24953
|
+
min(value, params) {
|
|
24954
|
+
return this.check(_gte(value, params));
|
|
24955
|
+
},
|
|
24956
|
+
lt(value, params) {
|
|
24957
|
+
return this.check(_lt(value, params));
|
|
24958
|
+
},
|
|
24959
|
+
lte(value, params) {
|
|
24960
|
+
return this.check(_lte(value, params));
|
|
24961
|
+
},
|
|
24962
|
+
max(value, params) {
|
|
24963
|
+
return this.check(_lte(value, params));
|
|
24964
|
+
},
|
|
24965
|
+
int(params) {
|
|
24966
|
+
return this.check(int(params));
|
|
24967
|
+
},
|
|
24968
|
+
safe(params) {
|
|
24969
|
+
return this.check(int(params));
|
|
24970
|
+
},
|
|
24971
|
+
positive(params) {
|
|
24972
|
+
return this.check(_gt(0, params));
|
|
24973
|
+
},
|
|
24974
|
+
nonnegative(params) {
|
|
24975
|
+
return this.check(_gte(0, params));
|
|
24976
|
+
},
|
|
24977
|
+
negative(params) {
|
|
24978
|
+
return this.check(_lt(0, params));
|
|
24979
|
+
},
|
|
24980
|
+
nonpositive(params) {
|
|
24981
|
+
return this.check(_lte(0, params));
|
|
24982
|
+
},
|
|
24983
|
+
multipleOf(value, params) {
|
|
24984
|
+
return this.check(_multipleOf(value, params));
|
|
24985
|
+
},
|
|
24986
|
+
step(value, params) {
|
|
24987
|
+
return this.check(_multipleOf(value, params));
|
|
24988
|
+
},
|
|
24989
|
+
finite() {
|
|
24990
|
+
return this;
|
|
24991
|
+
}
|
|
24992
|
+
})
|
|
24993
|
+
);
|
|
24422
24994
|
function number2(params) {
|
|
24423
24995
|
return _number(ZodNumber, params);
|
|
24424
24996
|
}
|
|
@@ -24449,49 +25021,53 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
24449
25021
|
function boolean2(params) {
|
|
24450
25022
|
return _boolean(ZodBoolean, params);
|
|
24451
25023
|
}
|
|
24452
|
-
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
24453
|
-
|
|
24454
|
-
|
|
24455
|
-
|
|
24456
|
-
|
|
24457
|
-
|
|
24458
|
-
inst.maxValue = bag.maximum ?? null;
|
|
24459
|
-
inst.format = bag.format ?? null;
|
|
24460
|
-
}, {
|
|
24461
|
-
gte(value, params) {
|
|
24462
|
-
return this.check(_gte(value, params));
|
|
24463
|
-
},
|
|
24464
|
-
min(value, params) {
|
|
24465
|
-
return this.check(_gte(value, params));
|
|
24466
|
-
},
|
|
24467
|
-
gt(value, params) {
|
|
24468
|
-
return this.check(_gt(value, params));
|
|
24469
|
-
},
|
|
24470
|
-
lt(value, params) {
|
|
24471
|
-
return this.check(_lt(value, params));
|
|
24472
|
-
},
|
|
24473
|
-
lte(value, params) {
|
|
24474
|
-
return this.check(_lte(value, params));
|
|
24475
|
-
},
|
|
24476
|
-
max(value, params) {
|
|
24477
|
-
return this.check(_lte(value, params));
|
|
24478
|
-
},
|
|
24479
|
-
positive(params) {
|
|
24480
|
-
return this.check(_gt(BigInt(0), params));
|
|
24481
|
-
},
|
|
24482
|
-
negative(params) {
|
|
24483
|
-
return this.check(_lt(BigInt(0), params));
|
|
24484
|
-
},
|
|
24485
|
-
nonpositive(params) {
|
|
24486
|
-
return this.check(_lte(BigInt(0), params));
|
|
25024
|
+
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
25025
|
+
"ZodBigInt",
|
|
25026
|
+
(inst, def) => {
|
|
25027
|
+
$ZodBigInt.init(inst, def);
|
|
25028
|
+
ZodType.init(inst, def);
|
|
25029
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
24487
25030
|
},
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
25031
|
+
/* @__PURE__ */ util_exports.derived({
|
|
25032
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
25033
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
25034
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
25035
|
+
}, {
|
|
25036
|
+
gte(value, params) {
|
|
25037
|
+
return this.check(_gte(value, params));
|
|
25038
|
+
},
|
|
25039
|
+
min(value, params) {
|
|
25040
|
+
return this.check(_gte(value, params));
|
|
25041
|
+
},
|
|
25042
|
+
gt(value, params) {
|
|
25043
|
+
return this.check(_gt(value, params));
|
|
25044
|
+
},
|
|
25045
|
+
lt(value, params) {
|
|
25046
|
+
return this.check(_lt(value, params));
|
|
25047
|
+
},
|
|
25048
|
+
lte(value, params) {
|
|
25049
|
+
return this.check(_lte(value, params));
|
|
25050
|
+
},
|
|
25051
|
+
max(value, params) {
|
|
25052
|
+
return this.check(_lte(value, params));
|
|
25053
|
+
},
|
|
25054
|
+
positive(params) {
|
|
25055
|
+
return this.check(_gt(BigInt(0), params));
|
|
25056
|
+
},
|
|
25057
|
+
negative(params) {
|
|
25058
|
+
return this.check(_lt(BigInt(0), params));
|
|
25059
|
+
},
|
|
25060
|
+
nonpositive(params) {
|
|
25061
|
+
return this.check(_lte(BigInt(0), params));
|
|
25062
|
+
},
|
|
25063
|
+
nonnegative(params) {
|
|
25064
|
+
return this.check(_gte(BigInt(0), params));
|
|
25065
|
+
},
|
|
25066
|
+
multipleOf(value, params) {
|
|
25067
|
+
return this.check(_multipleOf(value, params));
|
|
25068
|
+
}
|
|
25069
|
+
})
|
|
25070
|
+
);
|
|
24495
25071
|
function bigint2(params) {
|
|
24496
25072
|
return _bigint(ZodBigInt, params);
|
|
24497
25073
|
}
|
|
@@ -24561,16 +25137,26 @@ var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
|
24561
25137
|
function _void2(params) {
|
|
24562
25138
|
return _void(ZodVoid, params);
|
|
24563
25139
|
}
|
|
24564
|
-
var ZodDate = /* @__PURE__ */ $constructor(
|
|
24565
|
-
|
|
24566
|
-
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
25140
|
+
var ZodDate = /* @__PURE__ */ $constructor(
|
|
25141
|
+
"ZodDate",
|
|
25142
|
+
(inst, def) => {
|
|
25143
|
+
$ZodDate.init(inst, def);
|
|
25144
|
+
ZodType.init(inst, def);
|
|
25145
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
25146
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
25147
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
25148
|
+
},
|
|
25149
|
+
/* @__PURE__ */ util_exports.derived({
|
|
25150
|
+
minDate: (inst) => {
|
|
25151
|
+
const { minimum } = aggregateChecks(inst);
|
|
25152
|
+
return minimum ? new Date(minimum) : null;
|
|
25153
|
+
},
|
|
25154
|
+
maxDate: (inst) => {
|
|
25155
|
+
const { maximum } = aggregateChecks(inst);
|
|
25156
|
+
return maximum ? new Date(maximum) : null;
|
|
25157
|
+
}
|
|
25158
|
+
}, {})
|
|
25159
|
+
);
|
|
24574
25160
|
function date2(params) {
|
|
24575
25161
|
return _date(ZodDate, params);
|
|
24576
25162
|
}
|
|
@@ -24615,19 +25201,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
24615
25201
|
return _enum2(Object.keys(this._zod.def.shape));
|
|
24616
25202
|
},
|
|
24617
25203
|
catchall(catchall) {
|
|
24618
|
-
return this.clone(
|
|
25204
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
|
|
24619
25205
|
},
|
|
24620
25206
|
passthrough() {
|
|
24621
|
-
return this.clone(
|
|
25207
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
24622
25208
|
},
|
|
24623
25209
|
loose() {
|
|
24624
|
-
return this.clone(
|
|
25210
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
24625
25211
|
},
|
|
24626
25212
|
strict() {
|
|
24627
|
-
return this.clone(
|
|
25213
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
|
|
24628
25214
|
},
|
|
24629
25215
|
strip() {
|
|
24630
|
-
return this.clone(
|
|
25216
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
24631
25217
|
},
|
|
24632
25218
|
extend(incoming) {
|
|
24633
25219
|
return util_exports.extend(this, incoming);
|
|
@@ -24846,7 +25432,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
24846
25432
|
ZodType.init(inst, def);
|
|
24847
25433
|
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
24848
25434
|
inst.enum = def.entries;
|
|
24849
|
-
inst.options =
|
|
25435
|
+
inst.options = [...inst._zod.values];
|
|
24850
25436
|
const keys = new Set(Object.keys(def.entries));
|
|
24851
25437
|
inst.extract = (values, params) => {
|
|
24852
25438
|
const newEntries = {};
|
|
@@ -25190,6 +25776,14 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
|
25190
25776
|
ZodType.init(inst, def);
|
|
25191
25777
|
inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
|
|
25192
25778
|
});
|
|
25779
|
+
var ZodProperties = /* @__PURE__ */ $constructor("ZodProperties", (inst, def) => {
|
|
25780
|
+
_ensureDefaultMemoizer();
|
|
25781
|
+
$ZodProperties.init(inst, def);
|
|
25782
|
+
ZodType.init(inst, def);
|
|
25783
|
+
});
|
|
25784
|
+
function properties(shape, params) {
|
|
25785
|
+
return _properties(ZodProperties, shape, params);
|
|
25786
|
+
}
|
|
25193
25787
|
function check(fn) {
|
|
25194
25788
|
const ch = new $ZodCheck({
|
|
25195
25789
|
check: "custom"
|
|
@@ -25209,8 +25803,15 @@ function superRefine(fn, params) {
|
|
|
25209
25803
|
}
|
|
25210
25804
|
var describe2 = describe;
|
|
25211
25805
|
var meta2 = meta;
|
|
25806
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
25807
|
+
ZodCustom.init(inst, def);
|
|
25808
|
+
}, {
|
|
25809
|
+
properties(shape, params) {
|
|
25810
|
+
return this.check(properties(shape, params));
|
|
25811
|
+
}
|
|
25812
|
+
});
|
|
25212
25813
|
function _instanceof(cls, params = {}) {
|
|
25213
|
-
const inst = new
|
|
25814
|
+
const inst = new ZodInstanceOf({
|
|
25214
25815
|
type: "custom",
|
|
25215
25816
|
check: "custom",
|
|
25216
25817
|
fn: (data) => data instanceof cls,
|
|
@@ -25415,27 +26016,188 @@ function resolveRef(ref, ctx) {
|
|
|
25415
26016
|
}
|
|
25416
26017
|
throw new Error(`Reference not found: ${ref}`);
|
|
25417
26018
|
}
|
|
25418
|
-
function
|
|
26019
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
25419
26020
|
const guard = z.transform((value) => value).check((payload) => {
|
|
25420
26021
|
const value = payload.value;
|
|
25421
26022
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
25422
26023
|
return;
|
|
25423
|
-
|
|
25424
|
-
|
|
25425
|
-
if (result.success)
|
|
25426
|
-
continue;
|
|
26024
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
26025
|
+
if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
|
|
25427
26026
|
payload.issues.push({
|
|
25428
|
-
|
|
25429
|
-
|
|
25430
|
-
|
|
25431
|
-
|
|
25432
|
-
|
|
26027
|
+
origin: "object",
|
|
26028
|
+
code: "too_small",
|
|
26029
|
+
minimum: guards.minProperties,
|
|
26030
|
+
inclusive: true,
|
|
26031
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
26032
|
+
input: value,
|
|
26033
|
+
inst: objectSchema,
|
|
25433
26034
|
continue: true
|
|
25434
26035
|
});
|
|
25435
26036
|
}
|
|
26037
|
+
if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
|
|
26038
|
+
payload.issues.push({
|
|
26039
|
+
origin: "object",
|
|
26040
|
+
code: "too_big",
|
|
26041
|
+
maximum: guards.maxProperties,
|
|
26042
|
+
inclusive: true,
|
|
26043
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
26044
|
+
input: value,
|
|
26045
|
+
inst: objectSchema,
|
|
26046
|
+
continue: true
|
|
26047
|
+
});
|
|
26048
|
+
}
|
|
26049
|
+
if (guards.keySchema) {
|
|
26050
|
+
for (const key of keys) {
|
|
26051
|
+
const result = guards.keySchema.safeParse(key);
|
|
26052
|
+
if (result.success)
|
|
26053
|
+
continue;
|
|
26054
|
+
payload.issues.push({
|
|
26055
|
+
code: "invalid_key",
|
|
26056
|
+
origin: "record",
|
|
26057
|
+
issues: result.error.issues,
|
|
26058
|
+
input: key,
|
|
26059
|
+
path: [key],
|
|
26060
|
+
continue: true
|
|
26061
|
+
});
|
|
26062
|
+
}
|
|
26063
|
+
}
|
|
25436
26064
|
});
|
|
25437
26065
|
return guard.pipe(objectSchema);
|
|
25438
26066
|
}
|
|
26067
|
+
function canonicalKey(value, seen) {
|
|
26068
|
+
if (value === null)
|
|
26069
|
+
return "z";
|
|
26070
|
+
const type = typeof value;
|
|
26071
|
+
if (type !== "object") {
|
|
26072
|
+
if (type === "number" && Number.isNaN(value))
|
|
26073
|
+
return null;
|
|
26074
|
+
const raw = String(value);
|
|
26075
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
26076
|
+
}
|
|
26077
|
+
if (seen.has(value))
|
|
26078
|
+
return null;
|
|
26079
|
+
seen.add(value);
|
|
26080
|
+
try {
|
|
26081
|
+
if (Array.isArray(value)) {
|
|
26082
|
+
const parts2 = [];
|
|
26083
|
+
for (const item of value) {
|
|
26084
|
+
const key = canonicalKey(item, seen);
|
|
26085
|
+
if (key === null)
|
|
26086
|
+
return null;
|
|
26087
|
+
parts2.push(key);
|
|
26088
|
+
}
|
|
26089
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
26090
|
+
}
|
|
26091
|
+
const keys = Object.keys(value).sort();
|
|
26092
|
+
const parts = [];
|
|
26093
|
+
for (const k of keys) {
|
|
26094
|
+
const key = canonicalKey(value[k], seen);
|
|
26095
|
+
if (key === null)
|
|
26096
|
+
return null;
|
|
26097
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
26098
|
+
}
|
|
26099
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
26100
|
+
} finally {
|
|
26101
|
+
seen.delete(value);
|
|
26102
|
+
}
|
|
26103
|
+
}
|
|
26104
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
26105
|
+
"items",
|
|
26106
|
+
"prefixItems",
|
|
26107
|
+
"additionalItems",
|
|
26108
|
+
"additionalProperties",
|
|
26109
|
+
"contains",
|
|
26110
|
+
"propertyNames",
|
|
26111
|
+
"not",
|
|
26112
|
+
"if",
|
|
26113
|
+
"then",
|
|
26114
|
+
"else",
|
|
26115
|
+
"allOf",
|
|
26116
|
+
"anyOf",
|
|
26117
|
+
"oneOf",
|
|
26118
|
+
"unevaluatedItems",
|
|
26119
|
+
"unevaluatedProperties",
|
|
26120
|
+
"contentSchema"
|
|
26121
|
+
]);
|
|
26122
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
26123
|
+
"properties",
|
|
26124
|
+
"patternProperties",
|
|
26125
|
+
"dependentSchemas",
|
|
26126
|
+
"dependencies",
|
|
26127
|
+
"$defs",
|
|
26128
|
+
"definitions"
|
|
26129
|
+
]);
|
|
26130
|
+
function containsRef(value) {
|
|
26131
|
+
if (typeof value !== "object" || value === null)
|
|
26132
|
+
return false;
|
|
26133
|
+
if (Array.isArray(value))
|
|
26134
|
+
return value.some(containsRef);
|
|
26135
|
+
if (typeof value.$ref === "string")
|
|
26136
|
+
return true;
|
|
26137
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
26138
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
26139
|
+
return containsRef(sub);
|
|
26140
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
26141
|
+
return false;
|
|
26142
|
+
return Object.values(sub).some(containsRef);
|
|
26143
|
+
});
|
|
26144
|
+
}
|
|
26145
|
+
function plural(n) {
|
|
26146
|
+
return n === 1 ? "element" : "elements";
|
|
26147
|
+
}
|
|
26148
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
26149
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
26150
|
+
const items = payload.value;
|
|
26151
|
+
if (!Array.isArray(items))
|
|
26152
|
+
return;
|
|
26153
|
+
if (guards.uniqueItems === true) {
|
|
26154
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
26155
|
+
for (let i = 0; i < items.length; i++) {
|
|
26156
|
+
const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
26157
|
+
if (key === null)
|
|
26158
|
+
continue;
|
|
26159
|
+
const first = firstSeen.get(key);
|
|
26160
|
+
if (first === void 0) {
|
|
26161
|
+
firstSeen.set(key, i);
|
|
26162
|
+
continue;
|
|
26163
|
+
}
|
|
26164
|
+
payload.issues.push({
|
|
26165
|
+
code: "custom",
|
|
26166
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
26167
|
+
input: items,
|
|
26168
|
+
path: [i],
|
|
26169
|
+
continue: true
|
|
26170
|
+
});
|
|
26171
|
+
}
|
|
26172
|
+
}
|
|
26173
|
+
if (guards.containsSchema) {
|
|
26174
|
+
const minContains = guards.minContains ?? 1;
|
|
26175
|
+
const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
26176
|
+
let matches = 0;
|
|
26177
|
+
for (const item of items) {
|
|
26178
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
26179
|
+
break;
|
|
26180
|
+
}
|
|
26181
|
+
if (matches < minContains) {
|
|
26182
|
+
payload.issues.push({
|
|
26183
|
+
code: "custom",
|
|
26184
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
26185
|
+
input: items,
|
|
26186
|
+
continue: true
|
|
26187
|
+
});
|
|
26188
|
+
}
|
|
26189
|
+
if (guards.maxContains !== void 0 && matches > guards.maxContains) {
|
|
26190
|
+
payload.issues.push({
|
|
26191
|
+
code: "custom",
|
|
26192
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
26193
|
+
input: items,
|
|
26194
|
+
continue: true
|
|
26195
|
+
});
|
|
26196
|
+
}
|
|
26197
|
+
}
|
|
26198
|
+
});
|
|
26199
|
+
return guard.pipe(arraySchema);
|
|
26200
|
+
}
|
|
25439
26201
|
function getTupleRest(restSchema, ctx) {
|
|
25440
26202
|
if (restSchema === false) {
|
|
25441
26203
|
return void 0;
|
|
@@ -25565,6 +26327,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
25565
26327
|
stringSchema = stringSchema.check(z.e164());
|
|
25566
26328
|
} else if (format === "credit_card") {
|
|
25567
26329
|
stringSchema = stringSchema.check(z.creditCard());
|
|
26330
|
+
} else if (format === "iban") {
|
|
26331
|
+
stringSchema = stringSchema.check(z.iban());
|
|
25568
26332
|
} else if (format === "jwt") {
|
|
25569
26333
|
stringSchema = stringSchema.check(z.jwt());
|
|
25570
26334
|
} else if (format === "emoji") {
|
|
@@ -25630,10 +26394,10 @@ function convertBaseSchema(schema, ctx) {
|
|
|
25630
26394
|
}
|
|
25631
26395
|
case "object": {
|
|
25632
26396
|
const shape = {};
|
|
25633
|
-
const
|
|
26397
|
+
const properties2 = schema.properties || {};
|
|
25634
26398
|
const requiredSet = new Set(schema.required || []);
|
|
25635
26399
|
const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : void 0;
|
|
25636
|
-
for (const [key, propSchema] of Object.entries(
|
|
26400
|
+
for (const [key, propSchema] of Object.entries(properties2)) {
|
|
25637
26401
|
const propZodSchema = convertSchema(propSchema, ctx);
|
|
25638
26402
|
assignProp(shape, key, requiredSet.has(key) ? propZodSchema : propZodSchema.optional());
|
|
25639
26403
|
}
|
|
@@ -25697,9 +26461,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
25697
26461
|
zodSchema = objectSchema.passthrough();
|
|
25698
26462
|
}
|
|
25699
26463
|
}
|
|
25700
|
-
|
|
25701
|
-
|
|
25702
|
-
|
|
26464
|
+
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
26465
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
|
|
26466
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
|
|
26467
|
+
if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
|
|
26468
|
+
let keySchema;
|
|
26469
|
+
if (hasKeyGuard) {
|
|
26470
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
26471
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
26472
|
+
}
|
|
26473
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
25703
26474
|
}
|
|
25704
26475
|
break;
|
|
25705
26476
|
}
|
|
@@ -25745,6 +26516,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
25745
26516
|
} else {
|
|
25746
26517
|
zodSchema = z.array(z.any());
|
|
25747
26518
|
}
|
|
26519
|
+
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
26520
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
26521
|
+
uniqueItems: schema.uniqueItems === true,
|
|
26522
|
+
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
26523
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
26524
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
|
|
26525
|
+
});
|
|
26526
|
+
}
|
|
25748
26527
|
break;
|
|
25749
26528
|
}
|
|
25750
26529
|
default:
|
|
@@ -25802,8 +26581,23 @@ function convertSchema(schema, ctx) {
|
|
|
25802
26581
|
extraMeta[key] = schema[key];
|
|
25803
26582
|
}
|
|
25804
26583
|
}
|
|
25805
|
-
if (schema.
|
|
25806
|
-
|
|
26584
|
+
if (schema.type === "object" && schema.$ref === void 0) {
|
|
26585
|
+
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
26586
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
26587
|
+
}
|
|
26588
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
26589
|
+
if (schema[key] !== void 0)
|
|
26590
|
+
extraMeta[key] = schema[key];
|
|
26591
|
+
}
|
|
26592
|
+
}
|
|
26593
|
+
if (schema.type === "array" && schema.$ref === void 0) {
|
|
26594
|
+
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
26595
|
+
extraMeta.contains = schema.contains;
|
|
26596
|
+
}
|
|
26597
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
26598
|
+
if (schema[key] !== void 0)
|
|
26599
|
+
extraMeta[key] = schema[key];
|
|
26600
|
+
}
|
|
25807
26601
|
}
|
|
25808
26602
|
for (const key of Object.keys(schema)) {
|
|
25809
26603
|
if (!RECOGNIZED_KEYS.has(key)) {
|
|
@@ -25964,6 +26758,18 @@ function visit(schema, fnOrHandlers) {
|
|
|
25964
26758
|
const { _cachedInner, ...rest } = def;
|
|
25965
26759
|
return clone(s, { ...rest, getter: () => run2(original()) });
|
|
25966
26760
|
}
|
|
26761
|
+
case "properties": {
|
|
26762
|
+
const oldShape = def.shape;
|
|
26763
|
+
let changed = false;
|
|
26764
|
+
const newShape = {};
|
|
26765
|
+
for (const k of Reflect.ownKeys(oldShape)) {
|
|
26766
|
+
const mapped = run2(oldShape[k]);
|
|
26767
|
+
if (mapped !== oldShape[k])
|
|
26768
|
+
changed = true;
|
|
26769
|
+
newShape[k] = mapped;
|
|
26770
|
+
}
|
|
26771
|
+
return changed ? clone(s, { ...def, shape: newShape }) : s;
|
|
26772
|
+
}
|
|
25967
26773
|
// A leaf by choice: `parts` are regex fragments, not data positions.
|
|
25968
26774
|
case "template_literal":
|
|
25969
26775
|
// Leaves.
|
|
@@ -27616,17 +28422,21 @@ function minifiedResult(data) {
|
|
|
27616
28422
|
}
|
|
27617
28423
|
|
|
27618
28424
|
// ../../node_modules/@chrischall/mcp-utils/dist/response/media.js
|
|
27619
|
-
var MEDIA_NOUN = "(?:avatar|
|
|
27620
|
-
var
|
|
28425
|
+
var MEDIA_NOUN = "(?:avatar|picture|photo|thumbnail|thumb|image|icon|banner|profile_pic(?:ture)?|logo)";
|
|
28426
|
+
var MEDIA_QUALIFIER = "(?:primary|secondary|main|default|cover|hero|profile|master|rendered|small|medium|large|full|original|tall)";
|
|
28427
|
+
var MEDIA_KEY = new RegExp(`^(?:(?:${MEDIA_QUALIFIER}|${MEDIA_NOUN})[_-]?)?${MEDIA_NOUN}s?(?:[_-]?(?:link|uri|url|src)s?)?$`, "i");
|
|
27621
28428
|
var MEDIA_URL = /^https?:\/\/[^\s]+?\.(png|jpe?g|gif|webp|svg|avif|bmp|ico)([?#]|$)/i;
|
|
27622
28429
|
function stripMediaUrls(value, opts = {}) {
|
|
27623
|
-
const keep =
|
|
27624
|
-
const drop = (opts.drop ?? [])
|
|
28430
|
+
const keep = normalizeRules(opts.keep ?? []);
|
|
28431
|
+
const drop = normalizeRules(opts.drop ?? []);
|
|
27625
28432
|
return walk(value, keep, drop);
|
|
27626
28433
|
}
|
|
27627
|
-
function
|
|
28434
|
+
function normalizeRules(rules) {
|
|
28435
|
+
return rules.map((rule) => typeof rule === "string" ? rule.toLowerCase() : new RegExp(rule.source, rule.flags));
|
|
28436
|
+
}
|
|
28437
|
+
function matchesRule(key, rules) {
|
|
27628
28438
|
const lower = key.toLowerCase();
|
|
27629
|
-
for (const rule of
|
|
28439
|
+
for (const rule of rules) {
|
|
27630
28440
|
if (typeof rule === "string") {
|
|
27631
28441
|
if (rule === lower)
|
|
27632
28442
|
return true;
|
|
@@ -27647,11 +28457,11 @@ function walk(value, keep, drop) {
|
|
|
27647
28457
|
return value;
|
|
27648
28458
|
const out = {};
|
|
27649
28459
|
for (const [key, v] of Object.entries(value)) {
|
|
27650
|
-
if (
|
|
28460
|
+
if (matchesRule(key, keep)) {
|
|
27651
28461
|
out[key] = v;
|
|
27652
28462
|
continue;
|
|
27653
28463
|
}
|
|
27654
|
-
if (MEDIA_KEY.test(key) ||
|
|
28464
|
+
if (MEDIA_KEY.test(key) || matchesRule(key, drop))
|
|
27655
28465
|
continue;
|
|
27656
28466
|
if (typeof v === "string" && MEDIA_URL.test(v))
|
|
27657
28467
|
continue;
|
|
@@ -27748,7 +28558,7 @@ function activeExecutor() {
|
|
|
27748
28558
|
return runExecutor.getStore() ?? defaultExecutor;
|
|
27749
28559
|
}
|
|
27750
28560
|
var TIMEOUT_MS = 3e4;
|
|
27751
|
-
var MIN_GOG_VERSION = "0.
|
|
28561
|
+
var MIN_GOG_VERSION = "0.40.0";
|
|
27752
28562
|
function readonlyEnvEnabled() {
|
|
27753
28563
|
return readEnvVar("GOG_READONLY") !== void 0 && parseBoolEnv("GOG_READONLY", { default: true });
|
|
27754
28564
|
}
|
|
@@ -27757,7 +28567,7 @@ function sanitizedEnv() {
|
|
|
27757
28567
|
for (const [key, value] of Object.entries(process.env)) {
|
|
27758
28568
|
if (key === "GOG_ACCESS_TOKEN") continue;
|
|
27759
28569
|
if (key === "GOOGLE_APPLICATION_CREDENTIALS") continue;
|
|
27760
|
-
if (/(_TOKEN|_SECRET|
|
|
28570
|
+
if (/(_TOKEN|_SECRET|_KEY|_CREDENTIALS)$/.test(key)) continue;
|
|
27761
28571
|
result[key] = value;
|
|
27762
28572
|
}
|
|
27763
28573
|
return result;
|
|
@@ -27989,9 +28799,9 @@ function offsetAt(instant, tz) {
|
|
|
27989
28799
|
const w = wallPartsIn(instant, tz);
|
|
27990
28800
|
const asUTC = Date.UTC(w.year, w.month - 1, w.day, w.hour, w.minute, w.second, instant.getUTCMilliseconds());
|
|
27991
28801
|
const minutes = Math.round((asUTC - instant.getTime()) / 6e4);
|
|
27992
|
-
const
|
|
28802
|
+
const sign2 = minutes < 0 ? "-" : "+";
|
|
27993
28803
|
const abs = Math.abs(minutes);
|
|
27994
|
-
return `${
|
|
28804
|
+
return `${sign2}${pad(Math.floor(abs / 60))}:${pad(abs % 60)}`;
|
|
27995
28805
|
}
|
|
27996
28806
|
function wallPartsIn(instant, tz) {
|
|
27997
28807
|
const parts = new Intl.DateTimeFormat("en-US", {
|
|
@@ -30524,7 +31334,7 @@ function registerTasksTools(server) {
|
|
|
30524
31334
|
}
|
|
30525
31335
|
|
|
30526
31336
|
// src/server.ts
|
|
30527
|
-
var VERSION = true ? "2.
|
|
31337
|
+
var VERSION = true ? "2.30.0" : "0.0.0";
|
|
30528
31338
|
var BASE_TOOL_REGISTRARS = [
|
|
30529
31339
|
registerApiTools,
|
|
30530
31340
|
registerAppScriptTools,
|
|
@@ -31024,14 +31834,147 @@ function useRemoteGogRunner(env = process.env) {
|
|
|
31024
31834
|
);
|
|
31025
31835
|
return true;
|
|
31026
31836
|
}
|
|
31837
|
+
|
|
31838
|
+
// src/blob-urls.ts
|
|
31839
|
+
import { createHmac } from "node:crypto";
|
|
31840
|
+
var BLOB_URL_MAX_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
31841
|
+
var BLOB_URL_CEILING_MARGIN_MS = 60 * 1e3;
|
|
31842
|
+
var BLOB_URL_DEFAULT_TTL_MS = 60 * 60 * 1e3;
|
|
31843
|
+
var MIN_TTL_MS = 1e3;
|
|
31844
|
+
function readPayload(objectKey, exp) {
|
|
31845
|
+
return `${objectKey}
|
|
31846
|
+
${exp}`;
|
|
31847
|
+
}
|
|
31848
|
+
function writePayload(objectKey, contentType, exp) {
|
|
31849
|
+
return `put\0${objectKey}\0${contentType}\0${exp}`;
|
|
31850
|
+
}
|
|
31851
|
+
function sign(signingKey, payload) {
|
|
31852
|
+
return createHmac("sha256", signingKey).update(payload, "utf8").digest("base64url");
|
|
31853
|
+
}
|
|
31854
|
+
function objectPathSegments(rest) {
|
|
31855
|
+
const segments = rest.split("/");
|
|
31856
|
+
if (segments.some((seg) => seg === "" || seg === "." || seg === "..")) {
|
|
31857
|
+
throw new Error(
|
|
31858
|
+
`invalid blob object path ${JSON.stringify(rest)}: every segment must be non-empty and neither "." nor ".."`
|
|
31859
|
+
);
|
|
31860
|
+
}
|
|
31861
|
+
return segments;
|
|
31862
|
+
}
|
|
31863
|
+
function expiryFor(options) {
|
|
31864
|
+
const now = options?.now ?? Date.now();
|
|
31865
|
+
const requested = options?.ttlMs ?? BLOB_URL_DEFAULT_TTL_MS;
|
|
31866
|
+
const ceiling = BLOB_URL_MAX_TTL_MS - BLOB_URL_CEILING_MARGIN_MS;
|
|
31867
|
+
return now + Math.min(Math.max(requested, MIN_TTL_MS), ceiling);
|
|
31868
|
+
}
|
|
31869
|
+
function createBlobUrlMinter(config2) {
|
|
31870
|
+
if (!config2.signingKey) {
|
|
31871
|
+
throw new Error("MCP_BLOB_SIGNING_KEY is empty \u2014 cannot sign blob-store URLs");
|
|
31872
|
+
}
|
|
31873
|
+
let parsed;
|
|
31874
|
+
try {
|
|
31875
|
+
parsed = new URL(config2.baseUrl);
|
|
31876
|
+
} catch {
|
|
31877
|
+
throw new Error("MCP_BLOB_BASE_URL is not a valid URL");
|
|
31878
|
+
}
|
|
31879
|
+
const pathSegments = parsed.pathname.split("/").filter((seg) => seg !== "");
|
|
31880
|
+
const registrationId = pathSegments.length >= 2 ? pathSegments[pathSegments.length - 1] : void 0;
|
|
31881
|
+
if (!registrationId) {
|
|
31882
|
+
throw new Error("MCP_BLOB_BASE_URL has no registration id in its path");
|
|
31883
|
+
}
|
|
31884
|
+
const basePrefix = `${parsed.origin}/${pathSegments.join("/")}`;
|
|
31885
|
+
function mint(rest, exp, payload) {
|
|
31886
|
+
const segments = objectPathSegments(rest);
|
|
31887
|
+
const url2 = `${basePrefix}/${segments.map(encodeURIComponent).join("/")}`;
|
|
31888
|
+
const signature = sign(config2.signingKey, payload(`${registrationId}/${segments.join("/")}`));
|
|
31889
|
+
return `${url2}?exp=${exp}&sig=${signature}`;
|
|
31890
|
+
}
|
|
31891
|
+
return {
|
|
31892
|
+
registrationId,
|
|
31893
|
+
putUrl(rest, contentType, options) {
|
|
31894
|
+
const exp = expiryFor(options);
|
|
31895
|
+
return {
|
|
31896
|
+
url: mint(rest, exp, (key) => writePayload(key, contentType, exp)),
|
|
31897
|
+
contentType
|
|
31898
|
+
};
|
|
31899
|
+
},
|
|
31900
|
+
getUrl(rest, options) {
|
|
31901
|
+
const exp = expiryFor(options);
|
|
31902
|
+
return mint(rest, exp, (key) => readPayload(key, exp));
|
|
31903
|
+
}
|
|
31904
|
+
};
|
|
31905
|
+
}
|
|
31906
|
+
function blobStoreFromEnv() {
|
|
31907
|
+
const baseUrl = readEnvVar("MCP_BLOB_BASE_URL");
|
|
31908
|
+
const signingKey = readEnvVar("MCP_BLOB_SIGNING_KEY");
|
|
31909
|
+
if (!baseUrl || !signingKey) return void 0;
|
|
31910
|
+
return { baseUrl, signingKey };
|
|
31911
|
+
}
|
|
31912
|
+
|
|
31913
|
+
// src/blob-upload.ts
|
|
31914
|
+
var RUNNER_UPLOAD_TIMEOUT_MS = 125e3;
|
|
31915
|
+
function withoutUrlSecrets(message, url2) {
|
|
31916
|
+
let out = url2 ? message.split(url2).join("<signed url>") : message;
|
|
31917
|
+
const signature = /[?&]sig=([^&#]+)/.exec(url2)?.[1];
|
|
31918
|
+
if (signature) out = out.split(signature).join("<signature>");
|
|
31919
|
+
return out;
|
|
31920
|
+
}
|
|
31921
|
+
async function uploadToBlobStore(request, options = {}) {
|
|
31922
|
+
const env = options.env ?? process.env;
|
|
31923
|
+
const endpoint = readEnvVar("GOG_RUNNER_URL", { env });
|
|
31924
|
+
const key = readEnvVar("GOG_RUNNER_KEY", { env });
|
|
31925
|
+
if (!endpoint || !key) {
|
|
31926
|
+
throw new Error(
|
|
31927
|
+
"no gog runner is configured (GOG_RUNNER_URL + GOG_RUNNER_KEY, both or neither), and the attachment bytes are on the runner's disk rather than here \u2014 so nothing on this side can send them"
|
|
31928
|
+
);
|
|
31929
|
+
}
|
|
31930
|
+
let response;
|
|
31931
|
+
try {
|
|
31932
|
+
response = await fetch(`${endpoint.replace(/\/+$/, "")}/upload`, {
|
|
31933
|
+
method: "POST",
|
|
31934
|
+
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
|
|
31935
|
+
body: JSON.stringify({ path: request.path, url: request.url, contentType: request.contentType }),
|
|
31936
|
+
signal: AbortSignal.timeout(RUNNER_UPLOAD_TIMEOUT_MS)
|
|
31937
|
+
});
|
|
31938
|
+
} catch (err) {
|
|
31939
|
+
throw new Error(withoutUrlSecrets(
|
|
31940
|
+
`the upload to the blob store did not complete: ${err instanceof Error ? err.message : String(err)}`,
|
|
31941
|
+
request.url
|
|
31942
|
+
));
|
|
31943
|
+
}
|
|
31944
|
+
let raw;
|
|
31945
|
+
try {
|
|
31946
|
+
raw = await response.text();
|
|
31947
|
+
} catch (err) {
|
|
31948
|
+
throw new Error(withoutUrlSecrets(
|
|
31949
|
+
`the upload to the blob store did not complete: the runner's answer could not be read: ${err instanceof Error ? err.message : String(err)}`,
|
|
31950
|
+
request.url
|
|
31951
|
+
));
|
|
31952
|
+
}
|
|
31953
|
+
let body = {};
|
|
31954
|
+
try {
|
|
31955
|
+
body = JSON.parse(raw);
|
|
31956
|
+
} catch {
|
|
31957
|
+
body = { error: raw };
|
|
31958
|
+
}
|
|
31959
|
+
if (!response.ok) {
|
|
31960
|
+
throw new Error(withoutUrlSecrets(
|
|
31961
|
+
`the runner could not store the attachment (HTTP ${response.status}${body.status ? `, blob store ${body.status}` : ""}): ${body.error ?? "no reason given"}`,
|
|
31962
|
+
request.url
|
|
31963
|
+
));
|
|
31964
|
+
}
|
|
31965
|
+
return { bytes: body.bytes, status: body.status };
|
|
31966
|
+
}
|
|
31027
31967
|
export {
|
|
31028
31968
|
BASE_TOOL_REGISTRARS,
|
|
31969
|
+
BLOB_URL_DEFAULT_TTL_MS,
|
|
31970
|
+
BLOB_URL_MAX_TTL_MS,
|
|
31029
31971
|
INLINE_ATTACHMENT_LIMITS_TEXT,
|
|
31030
31972
|
MAX_INLINE_ATTACHMENT_BYTES,
|
|
31031
31973
|
MAX_INLINE_ATTACHMENT_TOTAL_BYTES,
|
|
31032
31974
|
MAX_REQUEST_PAYLOAD_WIRE_BYTES,
|
|
31033
31975
|
MIN_GOG_VERSION,
|
|
31034
31976
|
PAYLOAD_INLINE_MAX,
|
|
31977
|
+
RUNNER_UPLOAD_TIMEOUT_MS,
|
|
31035
31978
|
VERSION,
|
|
31036
31979
|
accountParam,
|
|
31037
31980
|
annotateTruncatedList,
|
|
@@ -31039,6 +31982,8 @@ export {
|
|
|
31039
31982
|
assertNotBoth,
|
|
31040
31983
|
attachInlineParam,
|
|
31041
31984
|
authToolsFor,
|
|
31985
|
+
blobStoreFromEnv,
|
|
31986
|
+
createBlobUrlMinter,
|
|
31042
31987
|
diagnose,
|
|
31043
31988
|
errorText,
|
|
31044
31989
|
fetchGmailPages,
|
|
@@ -31075,5 +32020,6 @@ export {
|
|
|
31075
32020
|
runExecutor,
|
|
31076
32021
|
runOrDiagnose,
|
|
31077
32022
|
stripConsumedPageToken,
|
|
32023
|
+
uploadToBlobStore,
|
|
31078
32024
|
useRemoteGogRunner
|
|
31079
32025
|
};
|