ofw-mcp 2.0.3 → 2.0.5
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 +9 -3
- package/.claude-plugin/plugin.json +8 -2
- package/dist/bundle.js +1931 -682
- package/dist/cache.js +192 -0
- package/dist/client.js +21 -3
- package/dist/config.js +21 -0
- package/dist/index.js +11 -1
- package/dist/sync.js +149 -0
- package/dist/tools/messages.js +160 -57
- package/package.json +7 -5
- package/server.json +35 -0
package/dist/bundle.js
CHANGED
|
@@ -72,12 +72,12 @@ var require_code = __commonJS({
|
|
|
72
72
|
return item === "" || item === '""';
|
|
73
73
|
}
|
|
74
74
|
get str() {
|
|
75
|
-
var
|
|
76
|
-
return (
|
|
75
|
+
var _a3;
|
|
76
|
+
return (_a3 = this._str) !== null && _a3 !== void 0 ? _a3 : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
|
|
77
77
|
}
|
|
78
78
|
get names() {
|
|
79
|
-
var
|
|
80
|
-
return (
|
|
79
|
+
var _a3;
|
|
80
|
+
return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names, c) => {
|
|
81
81
|
if (c instanceof Name)
|
|
82
82
|
names[c.str] = (names[c.str] || 0) + 1;
|
|
83
83
|
return names;
|
|
@@ -223,8 +223,8 @@ var require_scope = __commonJS({
|
|
|
223
223
|
return `${prefix}${ng.index++}`;
|
|
224
224
|
}
|
|
225
225
|
_nameGroup(prefix) {
|
|
226
|
-
var
|
|
227
|
-
if (((_b = (
|
|
226
|
+
var _a3, _b;
|
|
227
|
+
if (((_b = (_a3 = this._parent) === null || _a3 === void 0 ? void 0 : _a3._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
|
|
228
228
|
throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
|
|
229
229
|
}
|
|
230
230
|
return this._names[prefix] = { prefix, index: 0 };
|
|
@@ -257,12 +257,12 @@ var require_scope = __commonJS({
|
|
|
257
257
|
return new ValueScopeName(prefix, this._newName(prefix));
|
|
258
258
|
}
|
|
259
259
|
value(nameOrPrefix, value) {
|
|
260
|
-
var
|
|
260
|
+
var _a3;
|
|
261
261
|
if (value.ref === void 0)
|
|
262
262
|
throw new Error("CodeGen: ref must be passed in value");
|
|
263
263
|
const name = this.toName(nameOrPrefix);
|
|
264
264
|
const { prefix } = name;
|
|
265
|
-
const valueKey = (
|
|
265
|
+
const valueKey = (_a3 = value.key) !== null && _a3 !== void 0 ? _a3 : value.ref;
|
|
266
266
|
let vs = this._values[prefix];
|
|
267
267
|
if (vs) {
|
|
268
268
|
const _name = vs.get(valueKey);
|
|
@@ -469,9 +469,9 @@ var require_codegen = __commonJS({
|
|
|
469
469
|
}
|
|
470
470
|
};
|
|
471
471
|
var Throw = class extends Node {
|
|
472
|
-
constructor(
|
|
472
|
+
constructor(error51) {
|
|
473
473
|
super();
|
|
474
|
-
this.error =
|
|
474
|
+
this.error = error51;
|
|
475
475
|
}
|
|
476
476
|
render({ _n }) {
|
|
477
477
|
return `throw ${this.error};` + _n;
|
|
@@ -580,8 +580,8 @@ var require_codegen = __commonJS({
|
|
|
580
580
|
return this;
|
|
581
581
|
}
|
|
582
582
|
optimizeNames(names, constants) {
|
|
583
|
-
var
|
|
584
|
-
this.else = (
|
|
583
|
+
var _a3;
|
|
584
|
+
this.else = (_a3 = this.else) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants);
|
|
585
585
|
if (!(super.optimizeNames(names, constants) || this.else))
|
|
586
586
|
return;
|
|
587
587
|
this.condition = optimizeExpr(this.condition, names, constants);
|
|
@@ -685,16 +685,16 @@ var require_codegen = __commonJS({
|
|
|
685
685
|
return code;
|
|
686
686
|
}
|
|
687
687
|
optimizeNodes() {
|
|
688
|
-
var
|
|
688
|
+
var _a3, _b;
|
|
689
689
|
super.optimizeNodes();
|
|
690
|
-
(
|
|
690
|
+
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNodes();
|
|
691
691
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
692
692
|
return this;
|
|
693
693
|
}
|
|
694
694
|
optimizeNames(names, constants) {
|
|
695
|
-
var
|
|
695
|
+
var _a3, _b;
|
|
696
696
|
super.optimizeNames(names, constants);
|
|
697
|
-
(
|
|
697
|
+
(_a3 = this.catch) === null || _a3 === void 0 ? void 0 : _a3.optimizeNames(names, constants);
|
|
698
698
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
|
|
699
699
|
return this;
|
|
700
700
|
}
|
|
@@ -708,9 +708,9 @@ var require_codegen = __commonJS({
|
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
710
|
var Catch = class extends BlockNode {
|
|
711
|
-
constructor(
|
|
711
|
+
constructor(error51) {
|
|
712
712
|
super();
|
|
713
|
-
this.error =
|
|
713
|
+
this.error = error51;
|
|
714
714
|
}
|
|
715
715
|
render(opts) {
|
|
716
716
|
return `catch(${this.error})` + super.render(opts);
|
|
@@ -901,9 +901,9 @@ var require_codegen = __commonJS({
|
|
|
901
901
|
this._blockNode(node);
|
|
902
902
|
this.code(tryBody);
|
|
903
903
|
if (catchCode) {
|
|
904
|
-
const
|
|
905
|
-
this._currNode = node.catch = new Catch(
|
|
906
|
-
catchCode(
|
|
904
|
+
const error51 = this.name("e");
|
|
905
|
+
this._currNode = node.catch = new Catch(error51);
|
|
906
|
+
catchCode(error51);
|
|
907
907
|
}
|
|
908
908
|
if (finallyCode) {
|
|
909
909
|
this._currNode = node.finally = new Finally();
|
|
@@ -912,8 +912,8 @@ var require_codegen = __commonJS({
|
|
|
912
912
|
return this._endBlockNode(Catch, Finally);
|
|
913
913
|
}
|
|
914
914
|
// `throw` statement
|
|
915
|
-
throw(
|
|
916
|
-
return this._leafNode(new Throw(
|
|
915
|
+
throw(error51) {
|
|
916
|
+
return this._leafNode(new Throw(error51));
|
|
917
917
|
}
|
|
918
918
|
// start self-balancing block
|
|
919
919
|
block(body, nodeCount) {
|
|
@@ -1269,10 +1269,10 @@ var require_errors = __commonJS({
|
|
|
1269
1269
|
exports.keyword$DataError = {
|
|
1270
1270
|
message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`
|
|
1271
1271
|
};
|
|
1272
|
-
function reportError(cxt,
|
|
1272
|
+
function reportError(cxt, error51 = exports.keywordError, errorPaths, overrideAllErrors) {
|
|
1273
1273
|
const { it } = cxt;
|
|
1274
1274
|
const { gen, compositeRule, allErrors } = it;
|
|
1275
|
-
const errObj = errorObjectCode(cxt,
|
|
1275
|
+
const errObj = errorObjectCode(cxt, error51, errorPaths);
|
|
1276
1276
|
if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) {
|
|
1277
1277
|
addError(gen, errObj);
|
|
1278
1278
|
} else {
|
|
@@ -1280,10 +1280,10 @@ var require_errors = __commonJS({
|
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
exports.reportError = reportError;
|
|
1283
|
-
function reportExtraError(cxt,
|
|
1283
|
+
function reportExtraError(cxt, error51 = exports.keywordError, errorPaths) {
|
|
1284
1284
|
const { it } = cxt;
|
|
1285
1285
|
const { gen, compositeRule, allErrors } = it;
|
|
1286
|
-
const errObj = errorObjectCode(cxt,
|
|
1286
|
+
const errObj = errorObjectCode(cxt, error51, errorPaths);
|
|
1287
1287
|
addError(gen, errObj);
|
|
1288
1288
|
if (!(compositeRule || allErrors)) {
|
|
1289
1289
|
returnErrors(it, names_1.default.vErrors);
|
|
@@ -1334,19 +1334,19 @@ var require_errors = __commonJS({
|
|
|
1334
1334
|
schema: new codegen_1.Name("schema"),
|
|
1335
1335
|
parentSchema: new codegen_1.Name("parentSchema")
|
|
1336
1336
|
};
|
|
1337
|
-
function errorObjectCode(cxt,
|
|
1337
|
+
function errorObjectCode(cxt, error51, errorPaths) {
|
|
1338
1338
|
const { createErrors } = cxt.it;
|
|
1339
1339
|
if (createErrors === false)
|
|
1340
1340
|
return (0, codegen_1._)`{}`;
|
|
1341
|
-
return errorObject(cxt,
|
|
1341
|
+
return errorObject(cxt, error51, errorPaths);
|
|
1342
1342
|
}
|
|
1343
|
-
function errorObject(cxt,
|
|
1343
|
+
function errorObject(cxt, error51, errorPaths = {}) {
|
|
1344
1344
|
const { gen, it } = cxt;
|
|
1345
1345
|
const keyValues = [
|
|
1346
1346
|
errorInstancePath(it, errorPaths),
|
|
1347
1347
|
errorSchemaPath(cxt, errorPaths)
|
|
1348
1348
|
];
|
|
1349
|
-
extraErrorProps(cxt,
|
|
1349
|
+
extraErrorProps(cxt, error51, keyValues);
|
|
1350
1350
|
return gen.object(...keyValues);
|
|
1351
1351
|
}
|
|
1352
1352
|
function errorInstancePath({ errorPath }, { instancePath }) {
|
|
@@ -1474,8 +1474,8 @@ var require_applicability = __commonJS({
|
|
|
1474
1474
|
}
|
|
1475
1475
|
exports.shouldUseGroup = shouldUseGroup;
|
|
1476
1476
|
function shouldUseRule(schema, rule) {
|
|
1477
|
-
var
|
|
1478
|
-
return schema[rule.keyword] !== void 0 || ((
|
|
1477
|
+
var _a3;
|
|
1478
|
+
return schema[rule.keyword] !== void 0 || ((_a3 = rule.definition.implements) === null || _a3 === void 0 ? void 0 : _a3.some((kwd) => schema[kwd] !== void 0));
|
|
1479
1479
|
}
|
|
1480
1480
|
exports.shouldUseRule = shouldUseRule;
|
|
1481
1481
|
}
|
|
@@ -1863,14 +1863,14 @@ var require_keyword = __commonJS({
|
|
|
1863
1863
|
}
|
|
1864
1864
|
exports.macroKeywordCode = macroKeywordCode;
|
|
1865
1865
|
function funcKeywordCode(cxt, def) {
|
|
1866
|
-
var
|
|
1866
|
+
var _a3;
|
|
1867
1867
|
const { gen, keyword, schema, parentSchema, $data, it } = cxt;
|
|
1868
1868
|
checkAsyncKeyword(it, def);
|
|
1869
1869
|
const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
|
|
1870
1870
|
const validateRef = useKeyword(gen, keyword, validate);
|
|
1871
1871
|
const valid = gen.let("valid");
|
|
1872
1872
|
cxt.block$data(valid, validateKeyword);
|
|
1873
|
-
cxt.ok((
|
|
1873
|
+
cxt.ok((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid);
|
|
1874
1874
|
function validateKeyword() {
|
|
1875
1875
|
if (def.errors === false) {
|
|
1876
1876
|
assignValid();
|
|
@@ -1901,8 +1901,8 @@ var require_keyword = __commonJS({
|
|
|
1901
1901
|
gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
|
|
1902
1902
|
}
|
|
1903
1903
|
function reportErrs(errors) {
|
|
1904
|
-
var
|
|
1905
|
-
gen.if((0, codegen_1.not)((
|
|
1904
|
+
var _a4;
|
|
1905
|
+
gen.if((0, codegen_1.not)((_a4 = def.valid) !== null && _a4 !== void 0 ? _a4 : valid), errors);
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
1908
|
exports.funcKeywordCode = funcKeywordCode;
|
|
@@ -2870,7 +2870,7 @@ var require_compile = __commonJS({
|
|
|
2870
2870
|
var validate_1 = require_validate();
|
|
2871
2871
|
var SchemaEnv = class {
|
|
2872
2872
|
constructor(env) {
|
|
2873
|
-
var
|
|
2873
|
+
var _a3;
|
|
2874
2874
|
this.refs = {};
|
|
2875
2875
|
this.dynamicAnchors = {};
|
|
2876
2876
|
let schema;
|
|
@@ -2879,7 +2879,7 @@ var require_compile = __commonJS({
|
|
|
2879
2879
|
this.schema = env.schema;
|
|
2880
2880
|
this.schemaId = env.schemaId;
|
|
2881
2881
|
this.root = env.root || this;
|
|
2882
|
-
this.baseId = (
|
|
2882
|
+
this.baseId = (_a3 = env.baseId) !== null && _a3 !== void 0 ? _a3 : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
|
|
2883
2883
|
this.schemaPath = env.schemaPath;
|
|
2884
2884
|
this.localRefs = env.localRefs;
|
|
2885
2885
|
this.meta = env.meta;
|
|
@@ -2975,14 +2975,14 @@ var require_compile = __commonJS({
|
|
|
2975
2975
|
}
|
|
2976
2976
|
exports.compileSchema = compileSchema;
|
|
2977
2977
|
function resolveRef2(root, baseId, ref) {
|
|
2978
|
-
var
|
|
2978
|
+
var _a3;
|
|
2979
2979
|
ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
|
|
2980
2980
|
const schOrFunc = root.refs[ref];
|
|
2981
2981
|
if (schOrFunc)
|
|
2982
2982
|
return schOrFunc;
|
|
2983
2983
|
let _sch = resolve.call(this, root, ref);
|
|
2984
2984
|
if (_sch === void 0) {
|
|
2985
|
-
const schema = (
|
|
2985
|
+
const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
|
|
2986
2986
|
const { schemaId } = this.opts;
|
|
2987
2987
|
if (schema)
|
|
2988
2988
|
_sch = new SchemaEnv({ schema, schemaId, root, baseId });
|
|
@@ -3051,8 +3051,8 @@ var require_compile = __commonJS({
|
|
|
3051
3051
|
"definitions"
|
|
3052
3052
|
]);
|
|
3053
3053
|
function getJsonPointer(parsedRef, { baseId, schema, root }) {
|
|
3054
|
-
var
|
|
3055
|
-
if (((
|
|
3054
|
+
var _a3;
|
|
3055
|
+
if (((_a3 = parsedRef.fragment) === null || _a3 === void 0 ? void 0 : _a3[0]) !== "/")
|
|
3056
3056
|
return;
|
|
3057
3057
|
for (const part of parsedRef.fragment.slice(1).split("/")) {
|
|
3058
3058
|
if (typeof schema === "boolean")
|
|
@@ -3913,9 +3913,9 @@ var require_core = __commonJS({
|
|
|
3913
3913
|
};
|
|
3914
3914
|
var MAX_EXPRESSION = 200;
|
|
3915
3915
|
function requiredOptions(o) {
|
|
3916
|
-
var
|
|
3916
|
+
var _a3, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
3917
3917
|
const s = o.strict;
|
|
3918
|
-
const _optz = (
|
|
3918
|
+
const _optz = (_a3 = o.code) === null || _a3 === void 0 ? void 0 : _a3.optimize;
|
|
3919
3919
|
const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
|
|
3920
3920
|
const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
|
|
3921
3921
|
const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
|
|
@@ -4389,7 +4389,7 @@ var require_core = __commonJS({
|
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
4391
|
function addRule(keyword, definition, dataType) {
|
|
4392
|
-
var
|
|
4392
|
+
var _a3;
|
|
4393
4393
|
const post = definition === null || definition === void 0 ? void 0 : definition.post;
|
|
4394
4394
|
if (dataType && post)
|
|
4395
4395
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
@@ -4415,7 +4415,7 @@ var require_core = __commonJS({
|
|
|
4415
4415
|
else
|
|
4416
4416
|
ruleGroup.rules.push(rule);
|
|
4417
4417
|
RULES.all[keyword] = rule;
|
|
4418
|
-
(
|
|
4418
|
+
(_a3 = definition.implements) === null || _a3 === void 0 ? void 0 : _a3.forEach((kwd) => this.addKeyword(kwd));
|
|
4419
4419
|
}
|
|
4420
4420
|
function addBeforeRule(ruleGroup, rule, before) {
|
|
4421
4421
|
const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
|
|
@@ -4549,10 +4549,10 @@ var require_ref = __commonJS({
|
|
|
4549
4549
|
gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
|
|
4550
4550
|
}
|
|
4551
4551
|
function addEvaluatedFrom(source) {
|
|
4552
|
-
var
|
|
4552
|
+
var _a3;
|
|
4553
4553
|
if (!it.opts.unevaluated)
|
|
4554
4554
|
return;
|
|
4555
|
-
const schEvaluated = (
|
|
4555
|
+
const schEvaluated = (_a3 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a3 === void 0 ? void 0 : _a3.evaluated;
|
|
4556
4556
|
if (it.props !== true) {
|
|
4557
4557
|
if (schEvaluated && !schEvaluated.dynamicProps) {
|
|
4558
4558
|
if (schEvaluated.props !== void 0) {
|
|
@@ -4614,7 +4614,7 @@ var require_limitNumber = __commonJS({
|
|
|
4614
4614
|
exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
4615
4615
|
exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
4616
4616
|
};
|
|
4617
|
-
var
|
|
4617
|
+
var error51 = {
|
|
4618
4618
|
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
4619
4619
|
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
4620
4620
|
};
|
|
@@ -4623,7 +4623,7 @@ var require_limitNumber = __commonJS({
|
|
|
4623
4623
|
type: "number",
|
|
4624
4624
|
schemaType: "number",
|
|
4625
4625
|
$data: true,
|
|
4626
|
-
error:
|
|
4626
|
+
error: error51,
|
|
4627
4627
|
code(cxt) {
|
|
4628
4628
|
const { keyword, data, schemaCode } = cxt;
|
|
4629
4629
|
cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
|
|
@@ -4639,7 +4639,7 @@ var require_multipleOf = __commonJS({
|
|
|
4639
4639
|
"use strict";
|
|
4640
4640
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4641
4641
|
var codegen_1 = require_codegen();
|
|
4642
|
-
var
|
|
4642
|
+
var error51 = {
|
|
4643
4643
|
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
4644
4644
|
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
4645
4645
|
};
|
|
@@ -4648,7 +4648,7 @@ var require_multipleOf = __commonJS({
|
|
|
4648
4648
|
type: "number",
|
|
4649
4649
|
schemaType: "number",
|
|
4650
4650
|
$data: true,
|
|
4651
|
-
error:
|
|
4651
|
+
error: error51,
|
|
4652
4652
|
code(cxt) {
|
|
4653
4653
|
const { gen, data, schemaCode, it } = cxt;
|
|
4654
4654
|
const prec = it.opts.multipleOfPrecision;
|
|
@@ -4695,7 +4695,7 @@ var require_limitLength = __commonJS({
|
|
|
4695
4695
|
var codegen_1 = require_codegen();
|
|
4696
4696
|
var util_1 = require_util();
|
|
4697
4697
|
var ucs2length_1 = require_ucs2length();
|
|
4698
|
-
var
|
|
4698
|
+
var error51 = {
|
|
4699
4699
|
message({ keyword, schemaCode }) {
|
|
4700
4700
|
const comp = keyword === "maxLength" ? "more" : "fewer";
|
|
4701
4701
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
|
|
@@ -4707,7 +4707,7 @@ var require_limitLength = __commonJS({
|
|
|
4707
4707
|
type: "string",
|
|
4708
4708
|
schemaType: "number",
|
|
4709
4709
|
$data: true,
|
|
4710
|
-
error:
|
|
4710
|
+
error: error51,
|
|
4711
4711
|
code(cxt) {
|
|
4712
4712
|
const { keyword, data, schemaCode, it } = cxt;
|
|
4713
4713
|
const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -4727,7 +4727,7 @@ var require_pattern = __commonJS({
|
|
|
4727
4727
|
var code_1 = require_code2();
|
|
4728
4728
|
var util_1 = require_util();
|
|
4729
4729
|
var codegen_1 = require_codegen();
|
|
4730
|
-
var
|
|
4730
|
+
var error51 = {
|
|
4731
4731
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
4732
4732
|
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
|
|
4733
4733
|
};
|
|
@@ -4736,7 +4736,7 @@ var require_pattern = __commonJS({
|
|
|
4736
4736
|
type: "string",
|
|
4737
4737
|
schemaType: "string",
|
|
4738
4738
|
$data: true,
|
|
4739
|
-
error:
|
|
4739
|
+
error: error51,
|
|
4740
4740
|
code(cxt) {
|
|
4741
4741
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
4742
4742
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
@@ -4762,7 +4762,7 @@ var require_limitProperties = __commonJS({
|
|
|
4762
4762
|
"use strict";
|
|
4763
4763
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4764
4764
|
var codegen_1 = require_codegen();
|
|
4765
|
-
var
|
|
4765
|
+
var error51 = {
|
|
4766
4766
|
message({ keyword, schemaCode }) {
|
|
4767
4767
|
const comp = keyword === "maxProperties" ? "more" : "fewer";
|
|
4768
4768
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
|
|
@@ -4774,7 +4774,7 @@ var require_limitProperties = __commonJS({
|
|
|
4774
4774
|
type: "object",
|
|
4775
4775
|
schemaType: "number",
|
|
4776
4776
|
$data: true,
|
|
4777
|
-
error:
|
|
4777
|
+
error: error51,
|
|
4778
4778
|
code(cxt) {
|
|
4779
4779
|
const { keyword, data, schemaCode } = cxt;
|
|
4780
4780
|
const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -4793,7 +4793,7 @@ var require_required = __commonJS({
|
|
|
4793
4793
|
var code_1 = require_code2();
|
|
4794
4794
|
var codegen_1 = require_codegen();
|
|
4795
4795
|
var util_1 = require_util();
|
|
4796
|
-
var
|
|
4796
|
+
var error51 = {
|
|
4797
4797
|
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
4798
4798
|
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
4799
4799
|
};
|
|
@@ -4802,7 +4802,7 @@ var require_required = __commonJS({
|
|
|
4802
4802
|
type: "object",
|
|
4803
4803
|
schemaType: "array",
|
|
4804
4804
|
$data: true,
|
|
4805
|
-
error:
|
|
4805
|
+
error: error51,
|
|
4806
4806
|
code(cxt) {
|
|
4807
4807
|
const { gen, schema, schemaCode, data, $data, it } = cxt;
|
|
4808
4808
|
const { opts } = it;
|
|
@@ -4873,7 +4873,7 @@ var require_limitItems = __commonJS({
|
|
|
4873
4873
|
"use strict";
|
|
4874
4874
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4875
4875
|
var codegen_1 = require_codegen();
|
|
4876
|
-
var
|
|
4876
|
+
var error51 = {
|
|
4877
4877
|
message({ keyword, schemaCode }) {
|
|
4878
4878
|
const comp = keyword === "maxItems" ? "more" : "fewer";
|
|
4879
4879
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
|
|
@@ -4885,7 +4885,7 @@ var require_limitItems = __commonJS({
|
|
|
4885
4885
|
type: "array",
|
|
4886
4886
|
schemaType: "number",
|
|
4887
4887
|
$data: true,
|
|
4888
|
-
error:
|
|
4888
|
+
error: error51,
|
|
4889
4889
|
code(cxt) {
|
|
4890
4890
|
const { keyword, data, schemaCode } = cxt;
|
|
4891
4891
|
const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -4916,7 +4916,7 @@ var require_uniqueItems = __commonJS({
|
|
|
4916
4916
|
var codegen_1 = require_codegen();
|
|
4917
4917
|
var util_1 = require_util();
|
|
4918
4918
|
var equal_1 = require_equal();
|
|
4919
|
-
var
|
|
4919
|
+
var error51 = {
|
|
4920
4920
|
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
4921
4921
|
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
4922
4922
|
};
|
|
@@ -4925,7 +4925,7 @@ var require_uniqueItems = __commonJS({
|
|
|
4925
4925
|
type: "array",
|
|
4926
4926
|
schemaType: "boolean",
|
|
4927
4927
|
$data: true,
|
|
4928
|
-
error:
|
|
4928
|
+
error: error51,
|
|
4929
4929
|
code(cxt) {
|
|
4930
4930
|
const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
|
|
4931
4931
|
if (!$data && !schema)
|
|
@@ -4982,14 +4982,14 @@ var require_const = __commonJS({
|
|
|
4982
4982
|
var codegen_1 = require_codegen();
|
|
4983
4983
|
var util_1 = require_util();
|
|
4984
4984
|
var equal_1 = require_equal();
|
|
4985
|
-
var
|
|
4985
|
+
var error51 = {
|
|
4986
4986
|
message: "must be equal to constant",
|
|
4987
4987
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
|
|
4988
4988
|
};
|
|
4989
4989
|
var def = {
|
|
4990
4990
|
keyword: "const",
|
|
4991
4991
|
$data: true,
|
|
4992
|
-
error:
|
|
4992
|
+
error: error51,
|
|
4993
4993
|
code(cxt) {
|
|
4994
4994
|
const { gen, data, $data, schemaCode, schema } = cxt;
|
|
4995
4995
|
if ($data || schema && typeof schema == "object") {
|
|
@@ -5011,7 +5011,7 @@ var require_enum = __commonJS({
|
|
|
5011
5011
|
var codegen_1 = require_codegen();
|
|
5012
5012
|
var util_1 = require_util();
|
|
5013
5013
|
var equal_1 = require_equal();
|
|
5014
|
-
var
|
|
5014
|
+
var error51 = {
|
|
5015
5015
|
message: "must be equal to one of the allowed values",
|
|
5016
5016
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
|
|
5017
5017
|
};
|
|
@@ -5019,7 +5019,7 @@ var require_enum = __commonJS({
|
|
|
5019
5019
|
keyword: "enum",
|
|
5020
5020
|
schemaType: "array",
|
|
5021
5021
|
$data: true,
|
|
5022
|
-
error:
|
|
5022
|
+
error: error51,
|
|
5023
5023
|
code(cxt) {
|
|
5024
5024
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5025
5025
|
if (!$data && schema.length === 0)
|
|
@@ -5098,7 +5098,7 @@ var require_additionalItems = __commonJS({
|
|
|
5098
5098
|
exports.validateAdditionalItems = void 0;
|
|
5099
5099
|
var codegen_1 = require_codegen();
|
|
5100
5100
|
var util_1 = require_util();
|
|
5101
|
-
var
|
|
5101
|
+
var error51 = {
|
|
5102
5102
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5103
5103
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5104
5104
|
};
|
|
@@ -5107,7 +5107,7 @@ var require_additionalItems = __commonJS({
|
|
|
5107
5107
|
type: "array",
|
|
5108
5108
|
schemaType: ["boolean", "object"],
|
|
5109
5109
|
before: "uniqueItems",
|
|
5110
|
-
error:
|
|
5110
|
+
error: error51,
|
|
5111
5111
|
code(cxt) {
|
|
5112
5112
|
const { parentSchema, it } = cxt;
|
|
5113
5113
|
const { items } = parentSchema;
|
|
@@ -5226,7 +5226,7 @@ var require_items2020 = __commonJS({
|
|
|
5226
5226
|
var util_1 = require_util();
|
|
5227
5227
|
var code_1 = require_code2();
|
|
5228
5228
|
var additionalItems_1 = require_additionalItems();
|
|
5229
|
-
var
|
|
5229
|
+
var error51 = {
|
|
5230
5230
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5231
5231
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5232
5232
|
};
|
|
@@ -5235,7 +5235,7 @@ var require_items2020 = __commonJS({
|
|
|
5235
5235
|
type: "array",
|
|
5236
5236
|
schemaType: ["object", "boolean"],
|
|
5237
5237
|
before: "uniqueItems",
|
|
5238
|
-
error:
|
|
5238
|
+
error: error51,
|
|
5239
5239
|
code(cxt) {
|
|
5240
5240
|
const { schema, parentSchema, it } = cxt;
|
|
5241
5241
|
const { prefixItems } = parentSchema;
|
|
@@ -5259,7 +5259,7 @@ var require_contains = __commonJS({
|
|
|
5259
5259
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5260
5260
|
var codegen_1 = require_codegen();
|
|
5261
5261
|
var util_1 = require_util();
|
|
5262
|
-
var
|
|
5262
|
+
var error51 = {
|
|
5263
5263
|
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)`,
|
|
5264
5264
|
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
|
|
5265
5265
|
};
|
|
@@ -5269,7 +5269,7 @@ var require_contains = __commonJS({
|
|
|
5269
5269
|
schemaType: ["object", "boolean"],
|
|
5270
5270
|
before: "uniqueItems",
|
|
5271
5271
|
trackErrors: true,
|
|
5272
|
-
error:
|
|
5272
|
+
error: error51,
|
|
5273
5273
|
code(cxt) {
|
|
5274
5274
|
const { gen, schema, parentSchema, data, it } = cxt;
|
|
5275
5275
|
let min;
|
|
@@ -5447,7 +5447,7 @@ var require_propertyNames = __commonJS({
|
|
|
5447
5447
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5448
5448
|
var codegen_1 = require_codegen();
|
|
5449
5449
|
var util_1 = require_util();
|
|
5450
|
-
var
|
|
5450
|
+
var error51 = {
|
|
5451
5451
|
message: "property name must be valid",
|
|
5452
5452
|
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
|
|
5453
5453
|
};
|
|
@@ -5455,7 +5455,7 @@ var require_propertyNames = __commonJS({
|
|
|
5455
5455
|
keyword: "propertyNames",
|
|
5456
5456
|
type: "object",
|
|
5457
5457
|
schemaType: ["object", "boolean"],
|
|
5458
|
-
error:
|
|
5458
|
+
error: error51,
|
|
5459
5459
|
code(cxt) {
|
|
5460
5460
|
const { gen, schema, data, it } = cxt;
|
|
5461
5461
|
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
@@ -5492,7 +5492,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5492
5492
|
var codegen_1 = require_codegen();
|
|
5493
5493
|
var names_1 = require_names();
|
|
5494
5494
|
var util_1 = require_util();
|
|
5495
|
-
var
|
|
5495
|
+
var error51 = {
|
|
5496
5496
|
message: "must NOT have additional properties",
|
|
5497
5497
|
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
|
|
5498
5498
|
};
|
|
@@ -5502,7 +5502,7 @@ var require_additionalProperties = __commonJS({
|
|
|
5502
5502
|
schemaType: ["boolean", "object"],
|
|
5503
5503
|
allowUndefined: true,
|
|
5504
5504
|
trackErrors: true,
|
|
5505
|
-
error:
|
|
5505
|
+
error: error51,
|
|
5506
5506
|
code(cxt) {
|
|
5507
5507
|
const { gen, schema, parentSchema, data, errsCount, it } = cxt;
|
|
5508
5508
|
if (!errsCount)
|
|
@@ -5776,7 +5776,7 @@ var require_oneOf = __commonJS({
|
|
|
5776
5776
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5777
5777
|
var codegen_1 = require_codegen();
|
|
5778
5778
|
var util_1 = require_util();
|
|
5779
|
-
var
|
|
5779
|
+
var error51 = {
|
|
5780
5780
|
message: "must match exactly one schema in oneOf",
|
|
5781
5781
|
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
|
|
5782
5782
|
};
|
|
@@ -5784,7 +5784,7 @@ var require_oneOf = __commonJS({
|
|
|
5784
5784
|
keyword: "oneOf",
|
|
5785
5785
|
schemaType: "array",
|
|
5786
5786
|
trackErrors: true,
|
|
5787
|
-
error:
|
|
5787
|
+
error: error51,
|
|
5788
5788
|
code(cxt) {
|
|
5789
5789
|
const { gen, schema, parentSchema, it } = cxt;
|
|
5790
5790
|
if (!Array.isArray(schema))
|
|
@@ -5861,7 +5861,7 @@ var require_if = __commonJS({
|
|
|
5861
5861
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5862
5862
|
var codegen_1 = require_codegen();
|
|
5863
5863
|
var util_1 = require_util();
|
|
5864
|
-
var
|
|
5864
|
+
var error51 = {
|
|
5865
5865
|
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
5866
5866
|
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
|
|
5867
5867
|
};
|
|
@@ -5869,7 +5869,7 @@ var require_if = __commonJS({
|
|
|
5869
5869
|
keyword: "if",
|
|
5870
5870
|
schemaType: ["object", "boolean"],
|
|
5871
5871
|
trackErrors: true,
|
|
5872
|
-
error:
|
|
5872
|
+
error: error51,
|
|
5873
5873
|
code(cxt) {
|
|
5874
5874
|
const { gen, parentSchema, it } = cxt;
|
|
5875
5875
|
if (parentSchema.then === void 0 && parentSchema.else === void 0) {
|
|
@@ -5995,7 +5995,7 @@ var require_format = __commonJS({
|
|
|
5995
5995
|
"use strict";
|
|
5996
5996
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5997
5997
|
var codegen_1 = require_codegen();
|
|
5998
|
-
var
|
|
5998
|
+
var error51 = {
|
|
5999
5999
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
6000
6000
|
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
6001
6001
|
};
|
|
@@ -6004,7 +6004,7 @@ var require_format = __commonJS({
|
|
|
6004
6004
|
type: ["number", "string"],
|
|
6005
6005
|
schemaType: "string",
|
|
6006
6006
|
$data: true,
|
|
6007
|
-
error:
|
|
6007
|
+
error: error51,
|
|
6008
6008
|
code(cxt, ruleType) {
|
|
6009
6009
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
6010
6010
|
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
@@ -6159,7 +6159,7 @@ var require_discriminator = __commonJS({
|
|
|
6159
6159
|
var compile_1 = require_compile();
|
|
6160
6160
|
var ref_error_1 = require_ref_error();
|
|
6161
6161
|
var util_1 = require_util();
|
|
6162
|
-
var
|
|
6162
|
+
var error51 = {
|
|
6163
6163
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
6164
6164
|
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
6165
6165
|
};
|
|
@@ -6167,7 +6167,7 @@ var require_discriminator = __commonJS({
|
|
|
6167
6167
|
keyword: "discriminator",
|
|
6168
6168
|
type: "object",
|
|
6169
6169
|
schemaType: "object",
|
|
6170
|
-
error:
|
|
6170
|
+
error: error51,
|
|
6171
6171
|
code(cxt) {
|
|
6172
6172
|
const { gen, data, schema, parentSchema, it } = cxt;
|
|
6173
6173
|
const { oneOf } = parentSchema;
|
|
@@ -6203,7 +6203,7 @@ var require_discriminator = __commonJS({
|
|
|
6203
6203
|
return _valid;
|
|
6204
6204
|
}
|
|
6205
6205
|
function getMapping() {
|
|
6206
|
-
var
|
|
6206
|
+
var _a3;
|
|
6207
6207
|
const oneOfMapping = {};
|
|
6208
6208
|
const topRequired = hasRequired(parentSchema);
|
|
6209
6209
|
let tagRequired = true;
|
|
@@ -6217,7 +6217,7 @@ var require_discriminator = __commonJS({
|
|
|
6217
6217
|
if (sch === void 0)
|
|
6218
6218
|
throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
|
|
6219
6219
|
}
|
|
6220
|
-
const propSch = (
|
|
6220
|
+
const propSch = (_a3 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a3 === void 0 ? void 0 : _a3[tagName];
|
|
6221
6221
|
if (typeof propSch != "object") {
|
|
6222
6222
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
|
|
6223
6223
|
}
|
|
@@ -6699,7 +6699,7 @@ var require_limit = __commonJS({
|
|
|
6699
6699
|
formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
6700
6700
|
formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
6701
6701
|
};
|
|
6702
|
-
var
|
|
6702
|
+
var error51 = {
|
|
6703
6703
|
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
6704
6704
|
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
6705
6705
|
};
|
|
@@ -6708,7 +6708,7 @@ var require_limit = __commonJS({
|
|
|
6708
6708
|
type: "string",
|
|
6709
6709
|
schemaType: "string",
|
|
6710
6710
|
$data: true,
|
|
6711
|
-
error:
|
|
6711
|
+
error: error51,
|
|
6712
6712
|
code(cxt) {
|
|
6713
6713
|
const { gen, data, schemaCode, keyword, it } = cxt;
|
|
6714
6714
|
const { opts, self } = it;
|
|
@@ -6786,9 +6786,9 @@ var require_dist = __commonJS({
|
|
|
6786
6786
|
return f;
|
|
6787
6787
|
};
|
|
6788
6788
|
function addFormats(ajv, list, fs, exportName) {
|
|
6789
|
-
var
|
|
6789
|
+
var _a3;
|
|
6790
6790
|
var _b;
|
|
6791
|
-
(
|
|
6791
|
+
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
6792
6792
|
for (const f of list)
|
|
6793
6793
|
ajv.addFormat(f, fs[f]);
|
|
6794
6794
|
}
|
|
@@ -6978,8 +6978,8 @@ var ZodError = class _ZodError extends Error {
|
|
|
6978
6978
|
return issue2.message;
|
|
6979
6979
|
};
|
|
6980
6980
|
const fieldErrors = { _errors: [] };
|
|
6981
|
-
const processError = (
|
|
6982
|
-
for (const issue2 of
|
|
6981
|
+
const processError = (error51) => {
|
|
6982
|
+
for (const issue2 of error51.issues) {
|
|
6983
6983
|
if (issue2.code === "invalid_union") {
|
|
6984
6984
|
issue2.unionErrors.map(processError);
|
|
6985
6985
|
} else if (issue2.code === "invalid_return_type") {
|
|
@@ -7042,8 +7042,8 @@ var ZodError = class _ZodError extends Error {
|
|
|
7042
7042
|
}
|
|
7043
7043
|
};
|
|
7044
7044
|
ZodError.create = (issues) => {
|
|
7045
|
-
const
|
|
7046
|
-
return
|
|
7045
|
+
const error51 = new ZodError(issues);
|
|
7046
|
+
return error51;
|
|
7047
7047
|
};
|
|
7048
7048
|
|
|
7049
7049
|
// node_modules/zod/v3/locales/en.js
|
|
@@ -7303,8 +7303,8 @@ var handleResult = (ctx, result) => {
|
|
|
7303
7303
|
get error() {
|
|
7304
7304
|
if (this._error)
|
|
7305
7305
|
return this._error;
|
|
7306
|
-
const
|
|
7307
|
-
this._error =
|
|
7306
|
+
const error51 = new ZodError(ctx.common.issues);
|
|
7307
|
+
this._error = error51;
|
|
7308
7308
|
return this._error;
|
|
7309
7309
|
}
|
|
7310
7310
|
};
|
|
@@ -9959,25 +9959,25 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
9959
9959
|
});
|
|
9960
9960
|
return INVALID;
|
|
9961
9961
|
}
|
|
9962
|
-
function makeArgsIssue(args,
|
|
9962
|
+
function makeArgsIssue(args, error51) {
|
|
9963
9963
|
return makeIssue({
|
|
9964
9964
|
data: args,
|
|
9965
9965
|
path: ctx.path,
|
|
9966
9966
|
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
9967
9967
|
issueData: {
|
|
9968
9968
|
code: ZodIssueCode.invalid_arguments,
|
|
9969
|
-
argumentsError:
|
|
9969
|
+
argumentsError: error51
|
|
9970
9970
|
}
|
|
9971
9971
|
});
|
|
9972
9972
|
}
|
|
9973
|
-
function makeReturnsIssue(returns,
|
|
9973
|
+
function makeReturnsIssue(returns, error51) {
|
|
9974
9974
|
return makeIssue({
|
|
9975
9975
|
data: returns,
|
|
9976
9976
|
path: ctx.path,
|
|
9977
9977
|
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
9978
9978
|
issueData: {
|
|
9979
9979
|
code: ZodIssueCode.invalid_return_type,
|
|
9980
|
-
returnTypeError:
|
|
9980
|
+
returnTypeError: error51
|
|
9981
9981
|
}
|
|
9982
9982
|
});
|
|
9983
9983
|
}
|
|
@@ -9986,15 +9986,15 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
9986
9986
|
if (this._def.returns instanceof ZodPromise) {
|
|
9987
9987
|
const me = this;
|
|
9988
9988
|
return OK(async function(...args) {
|
|
9989
|
-
const
|
|
9989
|
+
const error51 = new ZodError([]);
|
|
9990
9990
|
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
9991
|
-
|
|
9992
|
-
throw
|
|
9991
|
+
error51.addIssue(makeArgsIssue(args, e));
|
|
9992
|
+
throw error51;
|
|
9993
9993
|
});
|
|
9994
9994
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
9995
9995
|
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
9996
|
-
|
|
9997
|
-
throw
|
|
9996
|
+
error51.addIssue(makeReturnsIssue(result, e));
|
|
9997
|
+
throw error51;
|
|
9998
9998
|
});
|
|
9999
9999
|
return parsedReturns;
|
|
10000
10000
|
});
|
|
@@ -10754,6 +10754,7 @@ __export(core_exports2, {
|
|
|
10754
10754
|
$ZodOptional: () => $ZodOptional,
|
|
10755
10755
|
$ZodPipe: () => $ZodPipe,
|
|
10756
10756
|
$ZodPrefault: () => $ZodPrefault,
|
|
10757
|
+
$ZodPreprocess: () => $ZodPreprocess,
|
|
10757
10758
|
$ZodPromise: () => $ZodPromise,
|
|
10758
10759
|
$ZodReadonly: () => $ZodReadonly,
|
|
10759
10760
|
$ZodRealError: () => $ZodRealError,
|
|
@@ -10953,7 +10954,8 @@ __export(core_exports2, {
|
|
|
10953
10954
|
});
|
|
10954
10955
|
|
|
10955
10956
|
// node_modules/zod/v4/core/core.js
|
|
10956
|
-
var
|
|
10957
|
+
var _a;
|
|
10958
|
+
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
10957
10959
|
status: "aborted"
|
|
10958
10960
|
});
|
|
10959
10961
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -10988,10 +10990,10 @@ function $constructor(name, initializer3, params) {
|
|
|
10988
10990
|
}
|
|
10989
10991
|
Object.defineProperty(Definition, "name", { value: name });
|
|
10990
10992
|
function _(def) {
|
|
10991
|
-
var
|
|
10993
|
+
var _a3;
|
|
10992
10994
|
const inst = params?.Parent ? new Definition() : this;
|
|
10993
10995
|
init(inst, def);
|
|
10994
|
-
(
|
|
10996
|
+
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
10995
10997
|
for (const fn of inst._zod.deferred) {
|
|
10996
10998
|
fn();
|
|
10997
10999
|
}
|
|
@@ -11020,7 +11022,8 @@ var $ZodEncodeError = class extends Error {
|
|
|
11020
11022
|
this.name = "ZodEncodeError";
|
|
11021
11023
|
}
|
|
11022
11024
|
};
|
|
11023
|
-
|
|
11025
|
+
(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
|
|
11026
|
+
var globalConfig = globalThis.__zod_globalConfig;
|
|
11024
11027
|
function config(newConfig) {
|
|
11025
11028
|
if (newConfig)
|
|
11026
11029
|
Object.assign(globalConfig, newConfig);
|
|
@@ -11053,6 +11056,7 @@ __export(util_exports, {
|
|
|
11053
11056
|
defineLazy: () => defineLazy,
|
|
11054
11057
|
esc: () => esc,
|
|
11055
11058
|
escapeRegex: () => escapeRegex,
|
|
11059
|
+
explicitlyAborted: () => explicitlyAborted,
|
|
11056
11060
|
extend: () => extend,
|
|
11057
11061
|
finalizeIssue: () => finalizeIssue,
|
|
11058
11062
|
floatSafeRemainder: () => floatSafeRemainder2,
|
|
@@ -11141,19 +11145,12 @@ function cleanRegex(source) {
|
|
|
11141
11145
|
return source.slice(start, end);
|
|
11142
11146
|
}
|
|
11143
11147
|
function floatSafeRemainder2(val, step) {
|
|
11144
|
-
const
|
|
11145
|
-
const
|
|
11146
|
-
|
|
11147
|
-
if (
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
stepDecCount = Number.parseInt(match[1]);
|
|
11151
|
-
}
|
|
11152
|
-
}
|
|
11153
|
-
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
11154
|
-
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
11155
|
-
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
11156
|
-
return valInt % stepInt / 10 ** decCount;
|
|
11148
|
+
const ratio = val / step;
|
|
11149
|
+
const roundedRatio = Math.round(ratio);
|
|
11150
|
+
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
11151
|
+
if (Math.abs(ratio - roundedRatio) < tolerance)
|
|
11152
|
+
return 0;
|
|
11153
|
+
return ratio - roundedRatio;
|
|
11157
11154
|
}
|
|
11158
11155
|
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
11159
11156
|
function defineLazy(object3, key, getter) {
|
|
@@ -11235,7 +11232,10 @@ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace :
|
|
|
11235
11232
|
function isObject(data) {
|
|
11236
11233
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
11237
11234
|
}
|
|
11238
|
-
var allowsEval = cached(() => {
|
|
11235
|
+
var allowsEval = /* @__PURE__ */ cached(() => {
|
|
11236
|
+
if (globalConfig.jitless) {
|
|
11237
|
+
return false;
|
|
11238
|
+
}
|
|
11239
11239
|
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
11240
11240
|
return false;
|
|
11241
11241
|
}
|
|
@@ -11268,6 +11268,10 @@ function shallowClone(o) {
|
|
|
11268
11268
|
return { ...o };
|
|
11269
11269
|
if (Array.isArray(o))
|
|
11270
11270
|
return [...o];
|
|
11271
|
+
if (o instanceof Map)
|
|
11272
|
+
return new Map(o);
|
|
11273
|
+
if (o instanceof Set)
|
|
11274
|
+
return new Set(o);
|
|
11271
11275
|
return o;
|
|
11272
11276
|
}
|
|
11273
11277
|
function numKeys(data) {
|
|
@@ -11324,7 +11328,14 @@ var getParsedType2 = (data) => {
|
|
|
11324
11328
|
}
|
|
11325
11329
|
};
|
|
11326
11330
|
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
11327
|
-
var primitiveTypes = /* @__PURE__ */ new Set([
|
|
11331
|
+
var primitiveTypes = /* @__PURE__ */ new Set([
|
|
11332
|
+
"string",
|
|
11333
|
+
"number",
|
|
11334
|
+
"bigint",
|
|
11335
|
+
"boolean",
|
|
11336
|
+
"symbol",
|
|
11337
|
+
"undefined"
|
|
11338
|
+
]);
|
|
11328
11339
|
function escapeRegex(str) {
|
|
11329
11340
|
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
11330
11341
|
}
|
|
@@ -11493,6 +11504,9 @@ function safeExtend(schema, shape) {
|
|
|
11493
11504
|
return clone(schema, def);
|
|
11494
11505
|
}
|
|
11495
11506
|
function merge(a, b) {
|
|
11507
|
+
if (a._zod.def.checks?.length) {
|
|
11508
|
+
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
11509
|
+
}
|
|
11496
11510
|
const def = mergeDefs(a._zod.def, {
|
|
11497
11511
|
get shape() {
|
|
11498
11512
|
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
@@ -11502,8 +11516,7 @@ function merge(a, b) {
|
|
|
11502
11516
|
get catchall() {
|
|
11503
11517
|
return b._zod.def.catchall;
|
|
11504
11518
|
},
|
|
11505
|
-
checks: []
|
|
11506
|
-
// delete existing checks
|
|
11519
|
+
checks: b._zod.def.checks ?? []
|
|
11507
11520
|
});
|
|
11508
11521
|
return clone(a, def);
|
|
11509
11522
|
}
|
|
@@ -11586,10 +11599,20 @@ function aborted(x, startIndex = 0) {
|
|
|
11586
11599
|
}
|
|
11587
11600
|
return false;
|
|
11588
11601
|
}
|
|
11602
|
+
function explicitlyAborted(x, startIndex = 0) {
|
|
11603
|
+
if (x.aborted === true)
|
|
11604
|
+
return true;
|
|
11605
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
11606
|
+
if (x.issues[i]?.continue === false) {
|
|
11607
|
+
return true;
|
|
11608
|
+
}
|
|
11609
|
+
}
|
|
11610
|
+
return false;
|
|
11611
|
+
}
|
|
11589
11612
|
function prefixIssues(path, issues) {
|
|
11590
11613
|
return issues.map((iss) => {
|
|
11591
|
-
var
|
|
11592
|
-
(
|
|
11614
|
+
var _a3;
|
|
11615
|
+
(_a3 = iss).path ?? (_a3.path = []);
|
|
11593
11616
|
iss.path.unshift(path);
|
|
11594
11617
|
return iss;
|
|
11595
11618
|
});
|
|
@@ -11598,17 +11621,14 @@ function unwrapMessage(message) {
|
|
|
11598
11621
|
return typeof message === "string" ? message : message?.message;
|
|
11599
11622
|
}
|
|
11600
11623
|
function finalizeIssue(iss, ctx, config2) {
|
|
11601
|
-
const
|
|
11602
|
-
|
|
11603
|
-
|
|
11604
|
-
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
delete full.continue;
|
|
11608
|
-
if (!ctx?.reportInput) {
|
|
11609
|
-
delete full.input;
|
|
11624
|
+
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
11625
|
+
const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
|
|
11626
|
+
rest.path ?? (rest.path = []);
|
|
11627
|
+
rest.message = message;
|
|
11628
|
+
if (ctx?.reportInput) {
|
|
11629
|
+
rest.input = _input;
|
|
11610
11630
|
}
|
|
11611
|
-
return
|
|
11631
|
+
return rest;
|
|
11612
11632
|
}
|
|
11613
11633
|
function getSizableOrigin(input) {
|
|
11614
11634
|
if (input instanceof Set)
|
|
@@ -11725,10 +11745,10 @@ var initializer = (inst, def) => {
|
|
|
11725
11745
|
};
|
|
11726
11746
|
var $ZodError = $constructor("$ZodError", initializer);
|
|
11727
11747
|
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
11728
|
-
function flattenError(
|
|
11748
|
+
function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
11729
11749
|
const fieldErrors = {};
|
|
11730
11750
|
const formErrors = [];
|
|
11731
|
-
for (const sub of
|
|
11751
|
+
for (const sub of error51.issues) {
|
|
11732
11752
|
if (sub.path.length > 0) {
|
|
11733
11753
|
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
11734
11754
|
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
@@ -11738,50 +11758,53 @@ function flattenError(error48, mapper = (issue2) => issue2.message) {
|
|
|
11738
11758
|
}
|
|
11739
11759
|
return { formErrors, fieldErrors };
|
|
11740
11760
|
}
|
|
11741
|
-
function formatError(
|
|
11761
|
+
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
11742
11762
|
const fieldErrors = { _errors: [] };
|
|
11743
|
-
const processError = (
|
|
11744
|
-
for (const issue2 of
|
|
11763
|
+
const processError = (error52, path = []) => {
|
|
11764
|
+
for (const issue2 of error52.issues) {
|
|
11745
11765
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
11746
|
-
issue2.errors.map((issues) => processError({ issues }));
|
|
11766
|
+
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
11747
11767
|
} else if (issue2.code === "invalid_key") {
|
|
11748
|
-
processError({ issues: issue2.issues });
|
|
11768
|
+
processError({ issues: issue2.issues }, [...path, ...issue2.path]);
|
|
11749
11769
|
} else if (issue2.code === "invalid_element") {
|
|
11750
|
-
processError({ issues: issue2.issues });
|
|
11751
|
-
} else if (issue2.path.length === 0) {
|
|
11752
|
-
fieldErrors._errors.push(mapper(issue2));
|
|
11770
|
+
processError({ issues: issue2.issues }, [...path, ...issue2.path]);
|
|
11753
11771
|
} else {
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11772
|
+
const fullpath = [...path, ...issue2.path];
|
|
11773
|
+
if (fullpath.length === 0) {
|
|
11774
|
+
fieldErrors._errors.push(mapper(issue2));
|
|
11775
|
+
} else {
|
|
11776
|
+
let curr = fieldErrors;
|
|
11777
|
+
let i = 0;
|
|
11778
|
+
while (i < fullpath.length) {
|
|
11779
|
+
const el = fullpath[i];
|
|
11780
|
+
const terminal = i === fullpath.length - 1;
|
|
11781
|
+
if (!terminal) {
|
|
11782
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
11783
|
+
} else {
|
|
11784
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
11785
|
+
curr[el]._errors.push(mapper(issue2));
|
|
11786
|
+
}
|
|
11787
|
+
curr = curr[el];
|
|
11788
|
+
i++;
|
|
11764
11789
|
}
|
|
11765
|
-
curr = curr[el];
|
|
11766
|
-
i++;
|
|
11767
11790
|
}
|
|
11768
11791
|
}
|
|
11769
11792
|
}
|
|
11770
11793
|
};
|
|
11771
|
-
processError(
|
|
11794
|
+
processError(error51);
|
|
11772
11795
|
return fieldErrors;
|
|
11773
11796
|
}
|
|
11774
|
-
function treeifyError(
|
|
11797
|
+
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
11775
11798
|
const result = { errors: [] };
|
|
11776
|
-
const processError = (
|
|
11777
|
-
var
|
|
11778
|
-
for (const issue2 of
|
|
11799
|
+
const processError = (error52, path = []) => {
|
|
11800
|
+
var _a3, _b;
|
|
11801
|
+
for (const issue2 of error52.issues) {
|
|
11779
11802
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
11780
|
-
issue2.errors.map((issues) => processError({ issues }, issue2.path));
|
|
11803
|
+
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
11781
11804
|
} else if (issue2.code === "invalid_key") {
|
|
11782
|
-
processError({ issues: issue2.issues }, issue2.path);
|
|
11805
|
+
processError({ issues: issue2.issues }, [...path, ...issue2.path]);
|
|
11783
11806
|
} else if (issue2.code === "invalid_element") {
|
|
11784
|
-
processError({ issues: issue2.issues }, issue2.path);
|
|
11807
|
+
processError({ issues: issue2.issues }, [...path, ...issue2.path]);
|
|
11785
11808
|
} else {
|
|
11786
11809
|
const fullpath = [...path, ...issue2.path];
|
|
11787
11810
|
if (fullpath.length === 0) {
|
|
@@ -11795,7 +11818,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
11795
11818
|
const terminal = i === fullpath.length - 1;
|
|
11796
11819
|
if (typeof el === "string") {
|
|
11797
11820
|
curr.properties ?? (curr.properties = {});
|
|
11798
|
-
(
|
|
11821
|
+
(_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
|
|
11799
11822
|
curr = curr.properties[el];
|
|
11800
11823
|
} else {
|
|
11801
11824
|
curr.items ?? (curr.items = []);
|
|
@@ -11810,7 +11833,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
11810
11833
|
}
|
|
11811
11834
|
}
|
|
11812
11835
|
};
|
|
11813
|
-
processError(
|
|
11836
|
+
processError(error51);
|
|
11814
11837
|
return result;
|
|
11815
11838
|
}
|
|
11816
11839
|
function toDotPath(_path) {
|
|
@@ -11831,9 +11854,9 @@ function toDotPath(_path) {
|
|
|
11831
11854
|
}
|
|
11832
11855
|
return segs.join("");
|
|
11833
11856
|
}
|
|
11834
|
-
function prettifyError(
|
|
11857
|
+
function prettifyError(error51) {
|
|
11835
11858
|
const lines = [];
|
|
11836
|
-
const issues = [...
|
|
11859
|
+
const issues = [...error51.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
11837
11860
|
for (const issue2 of issues) {
|
|
11838
11861
|
lines.push(`\u2716 ${issue2.message}`);
|
|
11839
11862
|
if (issue2.path?.length)
|
|
@@ -11844,7 +11867,7 @@ function prettifyError(error48) {
|
|
|
11844
11867
|
|
|
11845
11868
|
// node_modules/zod/v4/core/parse.js
|
|
11846
11869
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
11847
|
-
const ctx = _ctx ?
|
|
11870
|
+
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
11848
11871
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
11849
11872
|
if (result instanceof Promise) {
|
|
11850
11873
|
throw new $ZodAsyncError();
|
|
@@ -11858,7 +11881,7 @@ var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
11858
11881
|
};
|
|
11859
11882
|
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
11860
11883
|
var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
11861
|
-
const ctx = _ctx ?
|
|
11884
|
+
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
11862
11885
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
11863
11886
|
if (result instanceof Promise)
|
|
11864
11887
|
result = await result;
|
|
@@ -11883,7 +11906,7 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
11883
11906
|
};
|
|
11884
11907
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
11885
11908
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
11886
|
-
const ctx = _ctx ?
|
|
11909
|
+
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
11887
11910
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
11888
11911
|
if (result instanceof Promise)
|
|
11889
11912
|
result = await result;
|
|
@@ -11894,7 +11917,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
11894
11917
|
};
|
|
11895
11918
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
11896
11919
|
var _encode = (_Err) => (schema, value, _ctx) => {
|
|
11897
|
-
const ctx = _ctx ?
|
|
11920
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
11898
11921
|
return _parse(_Err)(schema, value, ctx);
|
|
11899
11922
|
};
|
|
11900
11923
|
var encode = /* @__PURE__ */ _encode($ZodRealError);
|
|
@@ -11903,7 +11926,7 @@ var _decode = (_Err) => (schema, value, _ctx) => {
|
|
|
11903
11926
|
};
|
|
11904
11927
|
var decode = /* @__PURE__ */ _decode($ZodRealError);
|
|
11905
11928
|
var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
11906
|
-
const ctx = _ctx ?
|
|
11929
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
11907
11930
|
return _parseAsync(_Err)(schema, value, ctx);
|
|
11908
11931
|
};
|
|
11909
11932
|
var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
|
|
@@ -11912,7 +11935,7 @@ var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
11912
11935
|
};
|
|
11913
11936
|
var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
|
|
11914
11937
|
var _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
11915
|
-
const ctx = _ctx ?
|
|
11938
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
11916
11939
|
return _safeParse(_Err)(schema, value, ctx);
|
|
11917
11940
|
};
|
|
11918
11941
|
var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
|
|
@@ -11921,7 +11944,7 @@ var _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
|
11921
11944
|
};
|
|
11922
11945
|
var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
|
|
11923
11946
|
var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
11924
|
-
const ctx = _ctx ?
|
|
11947
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
11925
11948
|
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
11926
11949
|
};
|
|
11927
11950
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
|
|
@@ -11954,6 +11977,7 @@ __export(regexes_exports, {
|
|
|
11954
11977
|
hex: () => hex,
|
|
11955
11978
|
hostname: () => hostname,
|
|
11956
11979
|
html5Email: () => html5Email,
|
|
11980
|
+
httpProtocol: () => httpProtocol,
|
|
11957
11981
|
idnEmail: () => idnEmail,
|
|
11958
11982
|
integer: () => integer,
|
|
11959
11983
|
ipv4: () => ipv4,
|
|
@@ -11992,7 +12016,7 @@ __export(regexes_exports, {
|
|
|
11992
12016
|
uuid7: () => uuid7,
|
|
11993
12017
|
xid: () => xid
|
|
11994
12018
|
});
|
|
11995
|
-
var cuid = /^[cC][
|
|
12019
|
+
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
11996
12020
|
var cuid2 = /^[0-9a-z]+$/;
|
|
11997
12021
|
var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
11998
12022
|
var xid = /^[0-9a-vA-V]{20}$/;
|
|
@@ -12031,6 +12055,7 @@ var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/
|
|
|
12031
12055
|
var base64url = /^[A-Za-z0-9_-]*$/;
|
|
12032
12056
|
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])?)*\.?$/;
|
|
12033
12057
|
var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
12058
|
+
var httpProtocol = /^https?$/;
|
|
12034
12059
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
12035
12060
|
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])))`;
|
|
12036
12061
|
var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
@@ -12089,10 +12114,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
|
12089
12114
|
|
|
12090
12115
|
// node_modules/zod/v4/core/checks.js
|
|
12091
12116
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
12092
|
-
var
|
|
12117
|
+
var _a3;
|
|
12093
12118
|
inst._zod ?? (inst._zod = {});
|
|
12094
12119
|
inst._zod.def = def;
|
|
12095
|
-
(
|
|
12120
|
+
(_a3 = inst._zod).onattach ?? (_a3.onattach = []);
|
|
12096
12121
|
});
|
|
12097
12122
|
var numericOriginMap = {
|
|
12098
12123
|
number: "number",
|
|
@@ -12158,8 +12183,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
12158
12183
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
12159
12184
|
$ZodCheck.init(inst, def);
|
|
12160
12185
|
inst._zod.onattach.push((inst2) => {
|
|
12161
|
-
var
|
|
12162
|
-
(
|
|
12186
|
+
var _a3;
|
|
12187
|
+
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
12163
12188
|
});
|
|
12164
12189
|
inst._zod.check = (payload) => {
|
|
12165
12190
|
if (typeof payload.value !== typeof def.value)
|
|
@@ -12292,9 +12317,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
12292
12317
|
};
|
|
12293
12318
|
});
|
|
12294
12319
|
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
12295
|
-
var
|
|
12320
|
+
var _a3;
|
|
12296
12321
|
$ZodCheck.init(inst, def);
|
|
12297
|
-
(
|
|
12322
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
12298
12323
|
const val = payload.value;
|
|
12299
12324
|
return !nullish(val) && val.size !== void 0;
|
|
12300
12325
|
});
|
|
@@ -12320,9 +12345,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
12320
12345
|
};
|
|
12321
12346
|
});
|
|
12322
12347
|
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
12323
|
-
var
|
|
12348
|
+
var _a3;
|
|
12324
12349
|
$ZodCheck.init(inst, def);
|
|
12325
|
-
(
|
|
12350
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
12326
12351
|
const val = payload.value;
|
|
12327
12352
|
return !nullish(val) && val.size !== void 0;
|
|
12328
12353
|
});
|
|
@@ -12348,9 +12373,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
12348
12373
|
};
|
|
12349
12374
|
});
|
|
12350
12375
|
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
12351
|
-
var
|
|
12376
|
+
var _a3;
|
|
12352
12377
|
$ZodCheck.init(inst, def);
|
|
12353
|
-
(
|
|
12378
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
12354
12379
|
const val = payload.value;
|
|
12355
12380
|
return !nullish(val) && val.size !== void 0;
|
|
12356
12381
|
});
|
|
@@ -12378,9 +12403,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
12378
12403
|
};
|
|
12379
12404
|
});
|
|
12380
12405
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
12381
|
-
var
|
|
12406
|
+
var _a3;
|
|
12382
12407
|
$ZodCheck.init(inst, def);
|
|
12383
|
-
(
|
|
12408
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
12384
12409
|
const val = payload.value;
|
|
12385
12410
|
return !nullish(val) && val.length !== void 0;
|
|
12386
12411
|
});
|
|
@@ -12407,9 +12432,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
12407
12432
|
};
|
|
12408
12433
|
});
|
|
12409
12434
|
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
12410
|
-
var
|
|
12435
|
+
var _a3;
|
|
12411
12436
|
$ZodCheck.init(inst, def);
|
|
12412
|
-
(
|
|
12437
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
12413
12438
|
const val = payload.value;
|
|
12414
12439
|
return !nullish(val) && val.length !== void 0;
|
|
12415
12440
|
});
|
|
@@ -12436,9 +12461,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
12436
12461
|
};
|
|
12437
12462
|
});
|
|
12438
12463
|
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
12439
|
-
var
|
|
12464
|
+
var _a3;
|
|
12440
12465
|
$ZodCheck.init(inst, def);
|
|
12441
|
-
(
|
|
12466
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
12442
12467
|
const val = payload.value;
|
|
12443
12468
|
return !nullish(val) && val.length !== void 0;
|
|
12444
12469
|
});
|
|
@@ -12467,7 +12492,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
12467
12492
|
};
|
|
12468
12493
|
});
|
|
12469
12494
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
12470
|
-
var
|
|
12495
|
+
var _a3, _b;
|
|
12471
12496
|
$ZodCheck.init(inst, def);
|
|
12472
12497
|
inst._zod.onattach.push((inst2) => {
|
|
12473
12498
|
const bag = inst2._zod.bag;
|
|
@@ -12478,7 +12503,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
12478
12503
|
}
|
|
12479
12504
|
});
|
|
12480
12505
|
if (def.pattern)
|
|
12481
|
-
(
|
|
12506
|
+
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
12482
12507
|
def.pattern.lastIndex = 0;
|
|
12483
12508
|
if (def.pattern.test(payload.value))
|
|
12484
12509
|
return;
|
|
@@ -12674,13 +12699,13 @@ var Doc = class {
|
|
|
12674
12699
|
// node_modules/zod/v4/core/versions.js
|
|
12675
12700
|
var version = {
|
|
12676
12701
|
major: 4,
|
|
12677
|
-
minor:
|
|
12678
|
-
patch:
|
|
12702
|
+
minor: 4,
|
|
12703
|
+
patch: 2
|
|
12679
12704
|
};
|
|
12680
12705
|
|
|
12681
12706
|
// node_modules/zod/v4/core/schemas.js
|
|
12682
12707
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
12683
|
-
var
|
|
12708
|
+
var _a3;
|
|
12684
12709
|
inst ?? (inst = {});
|
|
12685
12710
|
inst._zod.def = def;
|
|
12686
12711
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -12695,7 +12720,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
12695
12720
|
}
|
|
12696
12721
|
}
|
|
12697
12722
|
if (checks.length === 0) {
|
|
12698
|
-
(
|
|
12723
|
+
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
12699
12724
|
inst._zod.deferred?.push(() => {
|
|
12700
12725
|
inst._zod.run = inst._zod.parse;
|
|
12701
12726
|
});
|
|
@@ -12705,6 +12730,8 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
12705
12730
|
let asyncResult;
|
|
12706
12731
|
for (const ch of checks2) {
|
|
12707
12732
|
if (ch._zod.def.when) {
|
|
12733
|
+
if (explicitlyAborted(payload))
|
|
12734
|
+
continue;
|
|
12708
12735
|
const shouldRun = ch._zod.def.when(payload);
|
|
12709
12736
|
if (!shouldRun)
|
|
12710
12737
|
continue;
|
|
@@ -12845,6 +12872,19 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
12845
12872
|
inst._zod.check = (payload) => {
|
|
12846
12873
|
try {
|
|
12847
12874
|
const trimmed = payload.value.trim();
|
|
12875
|
+
if (!def.normalize && def.protocol?.source === httpProtocol.source) {
|
|
12876
|
+
if (!/^https?:\/\//i.test(trimmed)) {
|
|
12877
|
+
payload.issues.push({
|
|
12878
|
+
code: "invalid_format",
|
|
12879
|
+
format: "url",
|
|
12880
|
+
note: "Invalid URL format",
|
|
12881
|
+
input: payload.value,
|
|
12882
|
+
inst,
|
|
12883
|
+
continue: !def.abort
|
|
12884
|
+
});
|
|
12885
|
+
return;
|
|
12886
|
+
}
|
|
12887
|
+
}
|
|
12848
12888
|
const url2 = new URL(trimmed);
|
|
12849
12889
|
if (def.hostname) {
|
|
12850
12890
|
def.hostname.lastIndex = 0;
|
|
@@ -12998,6 +13038,8 @@ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
|
12998
13038
|
function isValidBase64(data) {
|
|
12999
13039
|
if (data === "")
|
|
13000
13040
|
return true;
|
|
13041
|
+
if (/\s/.test(data))
|
|
13042
|
+
return false;
|
|
13001
13043
|
if (data.length % 4 !== 0)
|
|
13002
13044
|
return false;
|
|
13003
13045
|
try {
|
|
@@ -13190,8 +13232,6 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
13190
13232
|
$ZodType.init(inst, def);
|
|
13191
13233
|
inst._zod.pattern = _undefined;
|
|
13192
13234
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
13193
|
-
inst._zod.optin = "optional";
|
|
13194
|
-
inst._zod.optout = "optional";
|
|
13195
13235
|
inst._zod.parse = (payload, _ctx) => {
|
|
13196
13236
|
const input = payload.value;
|
|
13197
13237
|
if (typeof input === "undefined")
|
|
@@ -13320,15 +13360,27 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
13320
13360
|
return payload;
|
|
13321
13361
|
};
|
|
13322
13362
|
});
|
|
13323
|
-
function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
13363
|
+
function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
|
|
13364
|
+
const isPresent = key in input;
|
|
13324
13365
|
if (result.issues.length) {
|
|
13325
|
-
if (isOptionalOut && !
|
|
13366
|
+
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
13326
13367
|
return;
|
|
13327
13368
|
}
|
|
13328
13369
|
final.issues.push(...prefixIssues(key, result.issues));
|
|
13329
13370
|
}
|
|
13371
|
+
if (!isPresent && !isOptionalIn) {
|
|
13372
|
+
if (!result.issues.length) {
|
|
13373
|
+
final.issues.push({
|
|
13374
|
+
code: "invalid_type",
|
|
13375
|
+
expected: "nonoptional",
|
|
13376
|
+
input: void 0,
|
|
13377
|
+
path: [key]
|
|
13378
|
+
});
|
|
13379
|
+
}
|
|
13380
|
+
return;
|
|
13381
|
+
}
|
|
13330
13382
|
if (result.value === void 0) {
|
|
13331
|
-
if (
|
|
13383
|
+
if (isPresent) {
|
|
13332
13384
|
final.value[key] = void 0;
|
|
13333
13385
|
}
|
|
13334
13386
|
} else {
|
|
@@ -13356,8 +13408,11 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
13356
13408
|
const keySet = def.keySet;
|
|
13357
13409
|
const _catchall = def.catchall._zod;
|
|
13358
13410
|
const t = _catchall.def.type;
|
|
13411
|
+
const isOptionalIn = _catchall.optin === "optional";
|
|
13359
13412
|
const isOptionalOut = _catchall.optout === "optional";
|
|
13360
13413
|
for (const key in input) {
|
|
13414
|
+
if (key === "__proto__")
|
|
13415
|
+
continue;
|
|
13361
13416
|
if (keySet.has(key))
|
|
13362
13417
|
continue;
|
|
13363
13418
|
if (t === "never") {
|
|
@@ -13366,9 +13421,9 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
13366
13421
|
}
|
|
13367
13422
|
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
13368
13423
|
if (r instanceof Promise) {
|
|
13369
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
|
|
13424
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
|
|
13370
13425
|
} else {
|
|
13371
|
-
handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
13426
|
+
handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
|
|
13372
13427
|
}
|
|
13373
13428
|
}
|
|
13374
13429
|
if (unrecognized.length) {
|
|
@@ -13434,12 +13489,13 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
13434
13489
|
const shape = value.shape;
|
|
13435
13490
|
for (const key of value.keys) {
|
|
13436
13491
|
const el = shape[key];
|
|
13492
|
+
const isOptionalIn = el._zod.optin === "optional";
|
|
13437
13493
|
const isOptionalOut = el._zod.optout === "optional";
|
|
13438
13494
|
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
13439
13495
|
if (r instanceof Promise) {
|
|
13440
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
|
|
13496
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
|
|
13441
13497
|
} else {
|
|
13442
|
-
handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
13498
|
+
handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
|
|
13443
13499
|
}
|
|
13444
13500
|
}
|
|
13445
13501
|
if (!catchall) {
|
|
@@ -13470,9 +13526,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
13470
13526
|
const id = ids[key];
|
|
13471
13527
|
const k = esc(key);
|
|
13472
13528
|
const schema = shape[key];
|
|
13529
|
+
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
13473
13530
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
13474
13531
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
13475
|
-
if (isOptionalOut) {
|
|
13532
|
+
if (isOptionalIn && isOptionalOut) {
|
|
13476
13533
|
doc.write(`
|
|
13477
13534
|
if (${id}.issues.length) {
|
|
13478
13535
|
if (${k} in input) {
|
|
@@ -13491,6 +13548,33 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
13491
13548
|
newResult[${k}] = ${id}.value;
|
|
13492
13549
|
}
|
|
13493
13550
|
|
|
13551
|
+
`);
|
|
13552
|
+
} else if (!isOptionalIn) {
|
|
13553
|
+
doc.write(`
|
|
13554
|
+
const ${id}_present = ${k} in input;
|
|
13555
|
+
if (${id}.issues.length) {
|
|
13556
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
13557
|
+
...iss,
|
|
13558
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
13559
|
+
})));
|
|
13560
|
+
}
|
|
13561
|
+
if (!${id}_present && !${id}.issues.length) {
|
|
13562
|
+
payload.issues.push({
|
|
13563
|
+
code: "invalid_type",
|
|
13564
|
+
expected: "nonoptional",
|
|
13565
|
+
input: undefined,
|
|
13566
|
+
path: [${k}]
|
|
13567
|
+
});
|
|
13568
|
+
}
|
|
13569
|
+
|
|
13570
|
+
if (${id}_present) {
|
|
13571
|
+
if (${id}.value === undefined) {
|
|
13572
|
+
newResult[${k}] = undefined;
|
|
13573
|
+
} else {
|
|
13574
|
+
newResult[${k}] = ${id}.value;
|
|
13575
|
+
}
|
|
13576
|
+
}
|
|
13577
|
+
|
|
13494
13578
|
`);
|
|
13495
13579
|
} else {
|
|
13496
13580
|
doc.write(`
|
|
@@ -13584,10 +13668,9 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
13584
13668
|
}
|
|
13585
13669
|
return void 0;
|
|
13586
13670
|
});
|
|
13587
|
-
const
|
|
13588
|
-
const first = def.options[0]._zod.run;
|
|
13671
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
13589
13672
|
inst._zod.parse = (payload, ctx) => {
|
|
13590
|
-
if (
|
|
13673
|
+
if (first) {
|
|
13591
13674
|
return first(payload, ctx);
|
|
13592
13675
|
}
|
|
13593
13676
|
let async = false;
|
|
@@ -13640,10 +13723,9 @@ function handleExclusiveUnionResults(results, final, inst, ctx) {
|
|
|
13640
13723
|
var $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => {
|
|
13641
13724
|
$ZodUnion.init(inst, def);
|
|
13642
13725
|
def.inclusive = false;
|
|
13643
|
-
const
|
|
13644
|
-
const first = def.options[0]._zod.run;
|
|
13726
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
13645
13727
|
inst._zod.parse = (payload, ctx) => {
|
|
13646
|
-
if (
|
|
13728
|
+
if (first) {
|
|
13647
13729
|
return first(payload, ctx);
|
|
13648
13730
|
}
|
|
13649
13731
|
let async = false;
|
|
@@ -13718,7 +13800,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
13718
13800
|
if (opt) {
|
|
13719
13801
|
return opt._zod.run(payload, ctx);
|
|
13720
13802
|
}
|
|
13721
|
-
if (def.unionFallback) {
|
|
13803
|
+
if (def.unionFallback || ctx.direction === "backward") {
|
|
13722
13804
|
return _super(payload, ctx);
|
|
13723
13805
|
}
|
|
13724
13806
|
payload.issues.push({
|
|
@@ -13726,6 +13808,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
13726
13808
|
errors: [],
|
|
13727
13809
|
note: "No matching discriminator",
|
|
13728
13810
|
discriminator: def.discriminator,
|
|
13811
|
+
options: Array.from(disc.value.keys()),
|
|
13729
13812
|
input,
|
|
13730
13813
|
path: [def.discriminator],
|
|
13731
13814
|
inst
|
|
@@ -13847,64 +13930,96 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
13847
13930
|
}
|
|
13848
13931
|
payload.value = [];
|
|
13849
13932
|
const proms = [];
|
|
13850
|
-
const
|
|
13851
|
-
const
|
|
13933
|
+
const optinStart = getTupleOptStart(items, "optin");
|
|
13934
|
+
const optoutStart = getTupleOptStart(items, "optout");
|
|
13852
13935
|
if (!def.rest) {
|
|
13853
|
-
|
|
13854
|
-
const tooSmall = input.length < optStart - 1;
|
|
13855
|
-
if (tooBig || tooSmall) {
|
|
13936
|
+
if (input.length < optinStart) {
|
|
13856
13937
|
payload.issues.push({
|
|
13857
|
-
|
|
13938
|
+
code: "too_small",
|
|
13939
|
+
minimum: optinStart,
|
|
13940
|
+
inclusive: true,
|
|
13858
13941
|
input,
|
|
13859
13942
|
inst,
|
|
13860
13943
|
origin: "array"
|
|
13861
13944
|
});
|
|
13862
13945
|
return payload;
|
|
13863
13946
|
}
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13947
|
+
if (input.length > items.length) {
|
|
13948
|
+
payload.issues.push({
|
|
13949
|
+
code: "too_big",
|
|
13950
|
+
maximum: items.length,
|
|
13951
|
+
inclusive: true,
|
|
13952
|
+
input,
|
|
13953
|
+
inst,
|
|
13954
|
+
origin: "array"
|
|
13955
|
+
});
|
|
13871
13956
|
}
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
}, ctx);
|
|
13876
|
-
if (
|
|
13877
|
-
proms.push(
|
|
13957
|
+
}
|
|
13958
|
+
const itemResults = new Array(items.length);
|
|
13959
|
+
for (let i = 0; i < items.length; i++) {
|
|
13960
|
+
const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
|
|
13961
|
+
if (r instanceof Promise) {
|
|
13962
|
+
proms.push(r.then((rr) => {
|
|
13963
|
+
itemResults[i] = rr;
|
|
13964
|
+
}));
|
|
13878
13965
|
} else {
|
|
13879
|
-
|
|
13966
|
+
itemResults[i] = r;
|
|
13880
13967
|
}
|
|
13881
13968
|
}
|
|
13882
13969
|
if (def.rest) {
|
|
13970
|
+
let i = items.length - 1;
|
|
13883
13971
|
const rest = input.slice(items.length);
|
|
13884
13972
|
for (const el of rest) {
|
|
13885
13973
|
i++;
|
|
13886
|
-
const result = def.rest._zod.run({
|
|
13887
|
-
value: el,
|
|
13888
|
-
issues: []
|
|
13889
|
-
}, ctx);
|
|
13974
|
+
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
13890
13975
|
if (result instanceof Promise) {
|
|
13891
|
-
proms.push(result.then((
|
|
13976
|
+
proms.push(result.then((r) => handleTupleResult(r, payload, i)));
|
|
13892
13977
|
} else {
|
|
13893
13978
|
handleTupleResult(result, payload, i);
|
|
13894
13979
|
}
|
|
13895
13980
|
}
|
|
13896
13981
|
}
|
|
13897
|
-
if (proms.length)
|
|
13898
|
-
return Promise.all(proms).then(() => payload);
|
|
13899
|
-
|
|
13982
|
+
if (proms.length) {
|
|
13983
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
|
|
13984
|
+
}
|
|
13985
|
+
return handleTupleResults(itemResults, payload, items, input, optoutStart);
|
|
13900
13986
|
};
|
|
13901
13987
|
});
|
|
13988
|
+
function getTupleOptStart(items, key) {
|
|
13989
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
13990
|
+
if (items[i]._zod[key] !== "optional")
|
|
13991
|
+
return i + 1;
|
|
13992
|
+
}
|
|
13993
|
+
return 0;
|
|
13994
|
+
}
|
|
13902
13995
|
function handleTupleResult(result, final, index) {
|
|
13903
13996
|
if (result.issues.length) {
|
|
13904
13997
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
13905
13998
|
}
|
|
13906
13999
|
final.value[index] = result.value;
|
|
13907
14000
|
}
|
|
14001
|
+
function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
14002
|
+
for (let i = 0; i < items.length; i++) {
|
|
14003
|
+
const r = itemResults[i];
|
|
14004
|
+
const isPresent = i < input.length;
|
|
14005
|
+
if (r.issues.length) {
|
|
14006
|
+
if (!isPresent && i >= optoutStart) {
|
|
14007
|
+
final.value.length = i;
|
|
14008
|
+
break;
|
|
14009
|
+
}
|
|
14010
|
+
final.issues.push(...prefixIssues(i, r.issues));
|
|
14011
|
+
}
|
|
14012
|
+
final.value[i] = r.value;
|
|
14013
|
+
}
|
|
14014
|
+
for (let i = final.value.length - 1; i >= input.length; i--) {
|
|
14015
|
+
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
14016
|
+
final.value.length = i;
|
|
14017
|
+
} else {
|
|
14018
|
+
break;
|
|
14019
|
+
}
|
|
14020
|
+
}
|
|
14021
|
+
return final;
|
|
14022
|
+
}
|
|
13908
14023
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
13909
14024
|
$ZodType.init(inst, def);
|
|
13910
14025
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -13926,19 +14041,35 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
13926
14041
|
for (const key of values) {
|
|
13927
14042
|
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
13928
14043
|
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
14044
|
+
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
14045
|
+
if (keyResult instanceof Promise) {
|
|
14046
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
14047
|
+
}
|
|
14048
|
+
if (keyResult.issues.length) {
|
|
14049
|
+
payload.issues.push({
|
|
14050
|
+
code: "invalid_key",
|
|
14051
|
+
origin: "record",
|
|
14052
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
14053
|
+
input: key,
|
|
14054
|
+
path: [key],
|
|
14055
|
+
inst
|
|
14056
|
+
});
|
|
14057
|
+
continue;
|
|
14058
|
+
}
|
|
14059
|
+
const outKey = keyResult.value;
|
|
13929
14060
|
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
13930
14061
|
if (result instanceof Promise) {
|
|
13931
14062
|
proms.push(result.then((result2) => {
|
|
13932
14063
|
if (result2.issues.length) {
|
|
13933
14064
|
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
13934
14065
|
}
|
|
13935
|
-
payload.value[
|
|
14066
|
+
payload.value[outKey] = result2.value;
|
|
13936
14067
|
}));
|
|
13937
14068
|
} else {
|
|
13938
14069
|
if (result.issues.length) {
|
|
13939
14070
|
payload.issues.push(...prefixIssues(key, result.issues));
|
|
13940
14071
|
}
|
|
13941
|
-
payload.value[
|
|
14072
|
+
payload.value[outKey] = result.value;
|
|
13942
14073
|
}
|
|
13943
14074
|
}
|
|
13944
14075
|
}
|
|
@@ -13962,6 +14093,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
13962
14093
|
for (const key of Reflect.ownKeys(input)) {
|
|
13963
14094
|
if (key === "__proto__")
|
|
13964
14095
|
continue;
|
|
14096
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key))
|
|
14097
|
+
continue;
|
|
13965
14098
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
13966
14099
|
if (keyResult instanceof Promise) {
|
|
13967
14100
|
throw new Error("Async schemas not supported in object keys currently");
|
|
@@ -14454,6 +14587,11 @@ function handleCodecTxResult(left, value, nextSchema, ctx) {
|
|
|
14454
14587
|
}
|
|
14455
14588
|
return nextSchema._zod.run({ value, issues: left.issues }, ctx);
|
|
14456
14589
|
}
|
|
14590
|
+
var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
|
|
14591
|
+
$ZodPipe.init(inst, def);
|
|
14592
|
+
defineLazy(inst._zod, "optin", () => def.out._zod.optin);
|
|
14593
|
+
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
14594
|
+
});
|
|
14457
14595
|
var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
|
|
14458
14596
|
$ZodType.init(inst, def);
|
|
14459
14597
|
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
@@ -14605,7 +14743,12 @@ var $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def) => {
|
|
|
14605
14743
|
});
|
|
14606
14744
|
var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
|
|
14607
14745
|
$ZodType.init(inst, def);
|
|
14608
|
-
defineLazy(inst._zod, "innerType", () =>
|
|
14746
|
+
defineLazy(inst._zod, "innerType", () => {
|
|
14747
|
+
const d = def;
|
|
14748
|
+
if (!d._cachedInner)
|
|
14749
|
+
d._cachedInner = def.getter();
|
|
14750
|
+
return d._cachedInner;
|
|
14751
|
+
});
|
|
14609
14752
|
defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
|
|
14610
14753
|
defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
|
|
14611
14754
|
defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
|
|
@@ -14660,6 +14803,7 @@ __export(locales_exports, {
|
|
|
14660
14803
|
cs: () => cs_default,
|
|
14661
14804
|
da: () => da_default,
|
|
14662
14805
|
de: () => de_default,
|
|
14806
|
+
el: () => el_default,
|
|
14663
14807
|
en: () => en_default2,
|
|
14664
14808
|
eo: () => eo_default,
|
|
14665
14809
|
es: () => es_default,
|
|
@@ -14668,6 +14812,7 @@ __export(locales_exports, {
|
|
|
14668
14812
|
fr: () => fr_default,
|
|
14669
14813
|
frCA: () => fr_CA_default,
|
|
14670
14814
|
he: () => he_default,
|
|
14815
|
+
hr: () => hr_default,
|
|
14671
14816
|
hu: () => hu_default,
|
|
14672
14817
|
hy: () => hy_default,
|
|
14673
14818
|
id: () => id_default,
|
|
@@ -14687,6 +14832,7 @@ __export(locales_exports, {
|
|
|
14687
14832
|
pl: () => pl_default,
|
|
14688
14833
|
ps: () => ps_default,
|
|
14689
14834
|
pt: () => pt_default,
|
|
14835
|
+
ro: () => ro_default,
|
|
14690
14836
|
ru: () => ru_default,
|
|
14691
14837
|
sl: () => sl_default,
|
|
14692
14838
|
sv: () => sv_default,
|
|
@@ -15640,8 +15786,118 @@ function de_default() {
|
|
|
15640
15786
|
};
|
|
15641
15787
|
}
|
|
15642
15788
|
|
|
15643
|
-
// node_modules/zod/v4/locales/
|
|
15789
|
+
// node_modules/zod/v4/locales/el.js
|
|
15644
15790
|
var error9 = () => {
|
|
15791
|
+
const Sizable = {
|
|
15792
|
+
string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
15793
|
+
file: { unit: "bytes", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
15794
|
+
array: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
15795
|
+
set: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
15796
|
+
map: { unit: "\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" }
|
|
15797
|
+
};
|
|
15798
|
+
function getSizing(origin) {
|
|
15799
|
+
return Sizable[origin] ?? null;
|
|
15800
|
+
}
|
|
15801
|
+
const FormatDictionary = {
|
|
15802
|
+
regex: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",
|
|
15803
|
+
email: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",
|
|
15804
|
+
url: "URL",
|
|
15805
|
+
emoji: "emoji",
|
|
15806
|
+
uuid: "UUID",
|
|
15807
|
+
uuidv4: "UUIDv4",
|
|
15808
|
+
uuidv6: "UUIDv6",
|
|
15809
|
+
nanoid: "nanoid",
|
|
15810
|
+
guid: "GUID",
|
|
15811
|
+
cuid: "cuid",
|
|
15812
|
+
cuid2: "cuid2",
|
|
15813
|
+
ulid: "ULID",
|
|
15814
|
+
xid: "XID",
|
|
15815
|
+
ksuid: "KSUID",
|
|
15816
|
+
datetime: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",
|
|
15817
|
+
date: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",
|
|
15818
|
+
time: "ISO \u03CE\u03C1\u03B1",
|
|
15819
|
+
duration: "ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",
|
|
15820
|
+
ipv4: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",
|
|
15821
|
+
ipv6: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",
|
|
15822
|
+
mac: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",
|
|
15823
|
+
cidrv4: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",
|
|
15824
|
+
cidrv6: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",
|
|
15825
|
+
base64: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",
|
|
15826
|
+
base64url: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",
|
|
15827
|
+
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
15828
|
+
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
15829
|
+
jwt: "JWT",
|
|
15830
|
+
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
15831
|
+
};
|
|
15832
|
+
const TypeDictionary = {
|
|
15833
|
+
nan: "NaN"
|
|
15834
|
+
};
|
|
15835
|
+
return (issue2) => {
|
|
15836
|
+
switch (issue2.code) {
|
|
15837
|
+
case "invalid_type": {
|
|
15838
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
15839
|
+
const receivedType = parsedType(issue2.input);
|
|
15840
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
15841
|
+
if (typeof issue2.expected === "string" && /^[A-Z]/.test(issue2.expected)) {
|
|
15842
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${issue2.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
|
|
15843
|
+
}
|
|
15844
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
|
|
15845
|
+
}
|
|
15846
|
+
case "invalid_value":
|
|
15847
|
+
if (issue2.values.length === 1)
|
|
15848
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${stringifyPrimitive(issue2.values[0])}`;
|
|
15849
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${joinValues(issue2.values, "|")}`;
|
|
15850
|
+
case "too_big": {
|
|
15851
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
15852
|
+
const sizing = getSizing(issue2.origin);
|
|
15853
|
+
if (sizing)
|
|
15854
|
+
return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;
|
|
15855
|
+
return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.maximum.toString()}`;
|
|
15856
|
+
}
|
|
15857
|
+
case "too_small": {
|
|
15858
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
15859
|
+
const sizing = getSizing(issue2.origin);
|
|
15860
|
+
if (sizing) {
|
|
15861
|
+
return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
15862
|
+
}
|
|
15863
|
+
return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.minimum.toString()}`;
|
|
15864
|
+
}
|
|
15865
|
+
case "invalid_format": {
|
|
15866
|
+
const _issue = issue2;
|
|
15867
|
+
if (_issue.format === "starts_with") {
|
|
15868
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${_issue.prefix}"`;
|
|
15869
|
+
}
|
|
15870
|
+
if (_issue.format === "ends_with")
|
|
15871
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${_issue.suffix}"`;
|
|
15872
|
+
if (_issue.format === "includes")
|
|
15873
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${_issue.includes}"`;
|
|
15874
|
+
if (_issue.format === "regex")
|
|
15875
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${_issue.pattern}`;
|
|
15876
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${FormatDictionary[_issue.format] ?? issue2.format}`;
|
|
15877
|
+
}
|
|
15878
|
+
case "not_multiple_of":
|
|
15879
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${issue2.divisor}`;
|
|
15880
|
+
case "unrecognized_keys":
|
|
15881
|
+
return `\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${issue2.keys.length > 1 ? "\u03B1" : "\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${issue2.keys.length > 1 ? "\u03B9\u03AC" : "\u03AF"}: ${joinValues(issue2.keys, ", ")}`;
|
|
15882
|
+
case "invalid_key":
|
|
15883
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${issue2.origin}`;
|
|
15884
|
+
case "invalid_union":
|
|
15885
|
+
return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";
|
|
15886
|
+
case "invalid_element":
|
|
15887
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${issue2.origin}`;
|
|
15888
|
+
default:
|
|
15889
|
+
return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2`;
|
|
15890
|
+
}
|
|
15891
|
+
};
|
|
15892
|
+
};
|
|
15893
|
+
function el_default() {
|
|
15894
|
+
return {
|
|
15895
|
+
localeError: error9()
|
|
15896
|
+
};
|
|
15897
|
+
}
|
|
15898
|
+
|
|
15899
|
+
// node_modules/zod/v4/locales/en.js
|
|
15900
|
+
var error10 = () => {
|
|
15645
15901
|
const Sizable = {
|
|
15646
15902
|
string: { unit: "characters", verb: "to have" },
|
|
15647
15903
|
file: { unit: "bytes", verb: "to have" },
|
|
@@ -15735,6 +15991,10 @@ var error9 = () => {
|
|
|
15735
15991
|
case "invalid_key":
|
|
15736
15992
|
return `Invalid key in ${issue2.origin}`;
|
|
15737
15993
|
case "invalid_union":
|
|
15994
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
15995
|
+
const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
|
|
15996
|
+
return `Invalid discriminator value. Expected ${opts}`;
|
|
15997
|
+
}
|
|
15738
15998
|
return "Invalid input";
|
|
15739
15999
|
case "invalid_element":
|
|
15740
16000
|
return `Invalid value in ${issue2.origin}`;
|
|
@@ -15745,12 +16005,12 @@ var error9 = () => {
|
|
|
15745
16005
|
};
|
|
15746
16006
|
function en_default2() {
|
|
15747
16007
|
return {
|
|
15748
|
-
localeError:
|
|
16008
|
+
localeError: error10()
|
|
15749
16009
|
};
|
|
15750
16010
|
}
|
|
15751
16011
|
|
|
15752
16012
|
// node_modules/zod/v4/locales/eo.js
|
|
15753
|
-
var
|
|
16013
|
+
var error11 = () => {
|
|
15754
16014
|
const Sizable = {
|
|
15755
16015
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
15756
16016
|
file: { unit: "bajtojn", verb: "havi" },
|
|
@@ -15855,12 +16115,12 @@ var error10 = () => {
|
|
|
15855
16115
|
};
|
|
15856
16116
|
function eo_default() {
|
|
15857
16117
|
return {
|
|
15858
|
-
localeError:
|
|
16118
|
+
localeError: error11()
|
|
15859
16119
|
};
|
|
15860
16120
|
}
|
|
15861
16121
|
|
|
15862
16122
|
// node_modules/zod/v4/locales/es.js
|
|
15863
|
-
var
|
|
16123
|
+
var error12 = () => {
|
|
15864
16124
|
const Sizable = {
|
|
15865
16125
|
string: { unit: "caracteres", verb: "tener" },
|
|
15866
16126
|
file: { unit: "bytes", verb: "tener" },
|
|
@@ -15988,12 +16248,12 @@ var error11 = () => {
|
|
|
15988
16248
|
};
|
|
15989
16249
|
function es_default() {
|
|
15990
16250
|
return {
|
|
15991
|
-
localeError:
|
|
16251
|
+
localeError: error12()
|
|
15992
16252
|
};
|
|
15993
16253
|
}
|
|
15994
16254
|
|
|
15995
16255
|
// node_modules/zod/v4/locales/fa.js
|
|
15996
|
-
var
|
|
16256
|
+
var error13 = () => {
|
|
15997
16257
|
const Sizable = {
|
|
15998
16258
|
string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
15999
16259
|
file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
@@ -16103,12 +16363,12 @@ var error12 = () => {
|
|
|
16103
16363
|
};
|
|
16104
16364
|
function fa_default() {
|
|
16105
16365
|
return {
|
|
16106
|
-
localeError:
|
|
16366
|
+
localeError: error13()
|
|
16107
16367
|
};
|
|
16108
16368
|
}
|
|
16109
16369
|
|
|
16110
16370
|
// node_modules/zod/v4/locales/fi.js
|
|
16111
|
-
var
|
|
16371
|
+
var error14 = () => {
|
|
16112
16372
|
const Sizable = {
|
|
16113
16373
|
string: { unit: "merkki\xE4", subject: "merkkijonon" },
|
|
16114
16374
|
file: { unit: "tavua", subject: "tiedoston" },
|
|
@@ -16216,12 +16476,12 @@ var error13 = () => {
|
|
|
16216
16476
|
};
|
|
16217
16477
|
function fi_default() {
|
|
16218
16478
|
return {
|
|
16219
|
-
localeError:
|
|
16479
|
+
localeError: error14()
|
|
16220
16480
|
};
|
|
16221
16481
|
}
|
|
16222
16482
|
|
|
16223
16483
|
// node_modules/zod/v4/locales/fr.js
|
|
16224
|
-
var
|
|
16484
|
+
var error15 = () => {
|
|
16225
16485
|
const Sizable = {
|
|
16226
16486
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
16227
16487
|
file: { unit: "octets", verb: "avoir" },
|
|
@@ -16262,9 +16522,27 @@ var error14 = () => {
|
|
|
16262
16522
|
template_literal: "entr\xE9e"
|
|
16263
16523
|
};
|
|
16264
16524
|
const TypeDictionary = {
|
|
16265
|
-
|
|
16525
|
+
string: "cha\xEEne",
|
|
16266
16526
|
number: "nombre",
|
|
16267
|
-
|
|
16527
|
+
int: "entier",
|
|
16528
|
+
boolean: "bool\xE9en",
|
|
16529
|
+
bigint: "grand entier",
|
|
16530
|
+
symbol: "symbole",
|
|
16531
|
+
undefined: "ind\xE9fini",
|
|
16532
|
+
null: "null",
|
|
16533
|
+
never: "jamais",
|
|
16534
|
+
void: "vide",
|
|
16535
|
+
date: "date",
|
|
16536
|
+
array: "tableau",
|
|
16537
|
+
object: "objet",
|
|
16538
|
+
tuple: "tuple",
|
|
16539
|
+
record: "enregistrement",
|
|
16540
|
+
map: "carte",
|
|
16541
|
+
set: "ensemble",
|
|
16542
|
+
file: "fichier",
|
|
16543
|
+
nonoptional: "non-optionnel",
|
|
16544
|
+
nan: "NaN",
|
|
16545
|
+
function: "fonction"
|
|
16268
16546
|
};
|
|
16269
16547
|
return (issue2) => {
|
|
16270
16548
|
switch (issue2.code) {
|
|
@@ -16285,16 +16563,15 @@ var error14 = () => {
|
|
|
16285
16563
|
const adj = issue2.inclusive ? "<=" : "<";
|
|
16286
16564
|
const sizing = getSizing(issue2.origin);
|
|
16287
16565
|
if (sizing)
|
|
16288
|
-
return `Trop grand : ${issue2.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
|
|
16289
|
-
return `Trop grand : ${issue2.origin ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
|
|
16566
|
+
return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
|
|
16567
|
+
return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
|
|
16290
16568
|
}
|
|
16291
16569
|
case "too_small": {
|
|
16292
16570
|
const adj = issue2.inclusive ? ">=" : ">";
|
|
16293
16571
|
const sizing = getSizing(issue2.origin);
|
|
16294
|
-
if (sizing)
|
|
16295
|
-
return `Trop petit : ${issue2.origin} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
16296
|
-
}
|
|
16297
|
-
return `Trop petit : ${issue2.origin} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
|
|
16572
|
+
if (sizing)
|
|
16573
|
+
return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
16574
|
+
return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
|
|
16298
16575
|
}
|
|
16299
16576
|
case "invalid_format": {
|
|
16300
16577
|
const _issue = issue2;
|
|
@@ -16325,12 +16602,12 @@ var error14 = () => {
|
|
|
16325
16602
|
};
|
|
16326
16603
|
function fr_default() {
|
|
16327
16604
|
return {
|
|
16328
|
-
localeError:
|
|
16605
|
+
localeError: error15()
|
|
16329
16606
|
};
|
|
16330
16607
|
}
|
|
16331
16608
|
|
|
16332
16609
|
// node_modules/zod/v4/locales/fr-CA.js
|
|
16333
|
-
var
|
|
16610
|
+
var error16 = () => {
|
|
16334
16611
|
const Sizable = {
|
|
16335
16612
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
16336
16613
|
file: { unit: "octets", verb: "avoir" },
|
|
@@ -16433,12 +16710,12 @@ var error15 = () => {
|
|
|
16433
16710
|
};
|
|
16434
16711
|
function fr_CA_default() {
|
|
16435
16712
|
return {
|
|
16436
|
-
localeError:
|
|
16713
|
+
localeError: error16()
|
|
16437
16714
|
};
|
|
16438
16715
|
}
|
|
16439
16716
|
|
|
16440
16717
|
// node_modules/zod/v4/locales/he.js
|
|
16441
|
-
var
|
|
16718
|
+
var error17 = () => {
|
|
16442
16719
|
const TypeNames = {
|
|
16443
16720
|
string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
|
|
16444
16721
|
number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" },
|
|
@@ -16628,24 +16905,24 @@ var error16 = () => {
|
|
|
16628
16905
|
};
|
|
16629
16906
|
function he_default() {
|
|
16630
16907
|
return {
|
|
16631
|
-
localeError:
|
|
16908
|
+
localeError: error17()
|
|
16632
16909
|
};
|
|
16633
16910
|
}
|
|
16634
16911
|
|
|
16635
|
-
// node_modules/zod/v4/locales/
|
|
16636
|
-
var
|
|
16912
|
+
// node_modules/zod/v4/locales/hr.js
|
|
16913
|
+
var error18 = () => {
|
|
16637
16914
|
const Sizable = {
|
|
16638
|
-
string: { unit: "
|
|
16639
|
-
file: { unit: "
|
|
16640
|
-
array: { unit: "
|
|
16641
|
-
set: { unit: "
|
|
16915
|
+
string: { unit: "znakova", verb: "imati" },
|
|
16916
|
+
file: { unit: "bajtova", verb: "imati" },
|
|
16917
|
+
array: { unit: "stavki", verb: "imati" },
|
|
16918
|
+
set: { unit: "stavki", verb: "imati" }
|
|
16642
16919
|
};
|
|
16643
16920
|
function getSizing(origin) {
|
|
16644
16921
|
return Sizable[origin] ?? null;
|
|
16645
16922
|
}
|
|
16646
16923
|
const FormatDictionary = {
|
|
16647
|
-
regex: "
|
|
16648
|
-
email: "email
|
|
16924
|
+
regex: "unos",
|
|
16925
|
+
email: "email adresa",
|
|
16649
16926
|
url: "URL",
|
|
16650
16927
|
emoji: "emoji",
|
|
16651
16928
|
uuid: "UUID",
|
|
@@ -16658,7 +16935,130 @@ var error17 = () => {
|
|
|
16658
16935
|
ulid: "ULID",
|
|
16659
16936
|
xid: "XID",
|
|
16660
16937
|
ksuid: "KSUID",
|
|
16661
|
-
datetime: "ISO
|
|
16938
|
+
datetime: "ISO datum i vrijeme",
|
|
16939
|
+
date: "ISO datum",
|
|
16940
|
+
time: "ISO vrijeme",
|
|
16941
|
+
duration: "ISO trajanje",
|
|
16942
|
+
ipv4: "IPv4 adresa",
|
|
16943
|
+
ipv6: "IPv6 adresa",
|
|
16944
|
+
cidrv4: "IPv4 raspon",
|
|
16945
|
+
cidrv6: "IPv6 raspon",
|
|
16946
|
+
base64: "base64 kodirani tekst",
|
|
16947
|
+
base64url: "base64url kodirani tekst",
|
|
16948
|
+
json_string: "JSON tekst",
|
|
16949
|
+
e164: "E.164 broj",
|
|
16950
|
+
jwt: "JWT",
|
|
16951
|
+
template_literal: "unos"
|
|
16952
|
+
};
|
|
16953
|
+
const TypeDictionary = {
|
|
16954
|
+
nan: "NaN",
|
|
16955
|
+
string: "tekst",
|
|
16956
|
+
number: "broj",
|
|
16957
|
+
boolean: "boolean",
|
|
16958
|
+
array: "niz",
|
|
16959
|
+
object: "objekt",
|
|
16960
|
+
set: "skup",
|
|
16961
|
+
file: "datoteka",
|
|
16962
|
+
date: "datum",
|
|
16963
|
+
bigint: "bigint",
|
|
16964
|
+
symbol: "simbol",
|
|
16965
|
+
undefined: "undefined",
|
|
16966
|
+
null: "null",
|
|
16967
|
+
function: "funkcija",
|
|
16968
|
+
map: "mapa"
|
|
16969
|
+
};
|
|
16970
|
+
return (issue2) => {
|
|
16971
|
+
switch (issue2.code) {
|
|
16972
|
+
case "invalid_type": {
|
|
16973
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
16974
|
+
const receivedType = parsedType(issue2.input);
|
|
16975
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
16976
|
+
if (/^[A-Z]/.test(issue2.expected)) {
|
|
16977
|
+
return `Neispravan unos: o\u010Dekuje se instanceof ${issue2.expected}, a primljeno je ${received}`;
|
|
16978
|
+
}
|
|
16979
|
+
return `Neispravan unos: o\u010Dekuje se ${expected}, a primljeno je ${received}`;
|
|
16980
|
+
}
|
|
16981
|
+
case "invalid_value":
|
|
16982
|
+
if (issue2.values.length === 1)
|
|
16983
|
+
return `Neispravna vrijednost: o\u010Dekivano ${stringifyPrimitive(issue2.values[0])}`;
|
|
16984
|
+
return `Neispravna opcija: o\u010Dekivano jedno od ${joinValues(issue2.values, "|")}`;
|
|
16985
|
+
case "too_big": {
|
|
16986
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
16987
|
+
const sizing = getSizing(issue2.origin);
|
|
16988
|
+
const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
|
|
16989
|
+
if (sizing)
|
|
16990
|
+
return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} ima ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemenata"}`;
|
|
16991
|
+
return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} bude ${adj}${issue2.maximum.toString()}`;
|
|
16992
|
+
}
|
|
16993
|
+
case "too_small": {
|
|
16994
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
16995
|
+
const sizing = getSizing(issue2.origin);
|
|
16996
|
+
const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
|
|
16997
|
+
if (sizing) {
|
|
16998
|
+
return `Premalo: o\u010Dekivano da ${origin} ima ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
16999
|
+
}
|
|
17000
|
+
return `Premalo: o\u010Dekivano da ${origin} bude ${adj}${issue2.minimum.toString()}`;
|
|
17001
|
+
}
|
|
17002
|
+
case "invalid_format": {
|
|
17003
|
+
const _issue = issue2;
|
|
17004
|
+
if (_issue.format === "starts_with")
|
|
17005
|
+
return `Neispravan tekst: mora zapo\u010Dinjati s "${_issue.prefix}"`;
|
|
17006
|
+
if (_issue.format === "ends_with")
|
|
17007
|
+
return `Neispravan tekst: mora zavr\u0161avati s "${_issue.suffix}"`;
|
|
17008
|
+
if (_issue.format === "includes")
|
|
17009
|
+
return `Neispravan tekst: mora sadr\u017Eavati "${_issue.includes}"`;
|
|
17010
|
+
if (_issue.format === "regex")
|
|
17011
|
+
return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`;
|
|
17012
|
+
return `Neispravna ${FormatDictionary[_issue.format] ?? issue2.format}`;
|
|
17013
|
+
}
|
|
17014
|
+
case "not_multiple_of":
|
|
17015
|
+
return `Neispravan broj: mora biti vi\u0161ekratnik od ${issue2.divisor}`;
|
|
17016
|
+
case "unrecognized_keys":
|
|
17017
|
+
return `Neprepoznat${issue2.keys.length > 1 ? "i klju\u010Devi" : " klju\u010D"}: ${joinValues(issue2.keys, ", ")}`;
|
|
17018
|
+
case "invalid_key":
|
|
17019
|
+
return `Neispravan klju\u010D u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
|
|
17020
|
+
case "invalid_union":
|
|
17021
|
+
return "Neispravan unos";
|
|
17022
|
+
case "invalid_element":
|
|
17023
|
+
return `Neispravna vrijednost u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
|
|
17024
|
+
default:
|
|
17025
|
+
return `Neispravan unos`;
|
|
17026
|
+
}
|
|
17027
|
+
};
|
|
17028
|
+
};
|
|
17029
|
+
function hr_default() {
|
|
17030
|
+
return {
|
|
17031
|
+
localeError: error18()
|
|
17032
|
+
};
|
|
17033
|
+
}
|
|
17034
|
+
|
|
17035
|
+
// node_modules/zod/v4/locales/hu.js
|
|
17036
|
+
var error19 = () => {
|
|
17037
|
+
const Sizable = {
|
|
17038
|
+
string: { unit: "karakter", verb: "legyen" },
|
|
17039
|
+
file: { unit: "byte", verb: "legyen" },
|
|
17040
|
+
array: { unit: "elem", verb: "legyen" },
|
|
17041
|
+
set: { unit: "elem", verb: "legyen" }
|
|
17042
|
+
};
|
|
17043
|
+
function getSizing(origin) {
|
|
17044
|
+
return Sizable[origin] ?? null;
|
|
17045
|
+
}
|
|
17046
|
+
const FormatDictionary = {
|
|
17047
|
+
regex: "bemenet",
|
|
17048
|
+
email: "email c\xEDm",
|
|
17049
|
+
url: "URL",
|
|
17050
|
+
emoji: "emoji",
|
|
17051
|
+
uuid: "UUID",
|
|
17052
|
+
uuidv4: "UUIDv4",
|
|
17053
|
+
uuidv6: "UUIDv6",
|
|
17054
|
+
nanoid: "nanoid",
|
|
17055
|
+
guid: "GUID",
|
|
17056
|
+
cuid: "cuid",
|
|
17057
|
+
cuid2: "cuid2",
|
|
17058
|
+
ulid: "ULID",
|
|
17059
|
+
xid: "XID",
|
|
17060
|
+
ksuid: "KSUID",
|
|
17061
|
+
datetime: "ISO id\u0151b\xE9lyeg",
|
|
16662
17062
|
date: "ISO d\xE1tum",
|
|
16663
17063
|
time: "ISO id\u0151",
|
|
16664
17064
|
duration: "ISO id\u0151intervallum",
|
|
@@ -16737,7 +17137,7 @@ var error17 = () => {
|
|
|
16737
17137
|
};
|
|
16738
17138
|
function hu_default() {
|
|
16739
17139
|
return {
|
|
16740
|
-
localeError:
|
|
17140
|
+
localeError: error19()
|
|
16741
17141
|
};
|
|
16742
17142
|
}
|
|
16743
17143
|
|
|
@@ -16752,7 +17152,7 @@ function withDefiniteArticle(word) {
|
|
|
16752
17152
|
const lastChar = word[word.length - 1];
|
|
16753
17153
|
return word + (vowels.includes(lastChar) ? "\u0576" : "\u0568");
|
|
16754
17154
|
}
|
|
16755
|
-
var
|
|
17155
|
+
var error20 = () => {
|
|
16756
17156
|
const Sizable = {
|
|
16757
17157
|
string: {
|
|
16758
17158
|
unit: {
|
|
@@ -16885,12 +17285,12 @@ var error18 = () => {
|
|
|
16885
17285
|
};
|
|
16886
17286
|
function hy_default() {
|
|
16887
17287
|
return {
|
|
16888
|
-
localeError:
|
|
17288
|
+
localeError: error20()
|
|
16889
17289
|
};
|
|
16890
17290
|
}
|
|
16891
17291
|
|
|
16892
17292
|
// node_modules/zod/v4/locales/id.js
|
|
16893
|
-
var
|
|
17293
|
+
var error21 = () => {
|
|
16894
17294
|
const Sizable = {
|
|
16895
17295
|
string: { unit: "karakter", verb: "memiliki" },
|
|
16896
17296
|
file: { unit: "byte", verb: "memiliki" },
|
|
@@ -16992,12 +17392,12 @@ var error19 = () => {
|
|
|
16992
17392
|
};
|
|
16993
17393
|
function id_default() {
|
|
16994
17394
|
return {
|
|
16995
|
-
localeError:
|
|
17395
|
+
localeError: error21()
|
|
16996
17396
|
};
|
|
16997
17397
|
}
|
|
16998
17398
|
|
|
16999
17399
|
// node_modules/zod/v4/locales/is.js
|
|
17000
|
-
var
|
|
17400
|
+
var error22 = () => {
|
|
17001
17401
|
const Sizable = {
|
|
17002
17402
|
string: { unit: "stafi", verb: "a\xF0 hafa" },
|
|
17003
17403
|
file: { unit: "b\xE6ti", verb: "a\xF0 hafa" },
|
|
@@ -17102,12 +17502,12 @@ var error20 = () => {
|
|
|
17102
17502
|
};
|
|
17103
17503
|
function is_default() {
|
|
17104
17504
|
return {
|
|
17105
|
-
localeError:
|
|
17505
|
+
localeError: error22()
|
|
17106
17506
|
};
|
|
17107
17507
|
}
|
|
17108
17508
|
|
|
17109
17509
|
// node_modules/zod/v4/locales/it.js
|
|
17110
|
-
var
|
|
17510
|
+
var error23 = () => {
|
|
17111
17511
|
const Sizable = {
|
|
17112
17512
|
string: { unit: "caratteri", verb: "avere" },
|
|
17113
17513
|
file: { unit: "byte", verb: "avere" },
|
|
@@ -17192,7 +17592,7 @@ var error21 = () => {
|
|
|
17192
17592
|
return `Stringa non valida: deve includere "${_issue.includes}"`;
|
|
17193
17593
|
if (_issue.format === "regex")
|
|
17194
17594
|
return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
|
|
17195
|
-
return `
|
|
17595
|
+
return `Input non valido: ${FormatDictionary[_issue.format] ?? issue2.format}`;
|
|
17196
17596
|
}
|
|
17197
17597
|
case "not_multiple_of":
|
|
17198
17598
|
return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`;
|
|
@@ -17211,12 +17611,12 @@ var error21 = () => {
|
|
|
17211
17611
|
};
|
|
17212
17612
|
function it_default() {
|
|
17213
17613
|
return {
|
|
17214
|
-
localeError:
|
|
17614
|
+
localeError: error23()
|
|
17215
17615
|
};
|
|
17216
17616
|
}
|
|
17217
17617
|
|
|
17218
17618
|
// node_modules/zod/v4/locales/ja.js
|
|
17219
|
-
var
|
|
17619
|
+
var error24 = () => {
|
|
17220
17620
|
const Sizable = {
|
|
17221
17621
|
string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
|
|
17222
17622
|
file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" },
|
|
@@ -17319,12 +17719,12 @@ var error22 = () => {
|
|
|
17319
17719
|
};
|
|
17320
17720
|
function ja_default() {
|
|
17321
17721
|
return {
|
|
17322
|
-
localeError:
|
|
17722
|
+
localeError: error24()
|
|
17323
17723
|
};
|
|
17324
17724
|
}
|
|
17325
17725
|
|
|
17326
17726
|
// node_modules/zod/v4/locales/ka.js
|
|
17327
|
-
var
|
|
17727
|
+
var error25 = () => {
|
|
17328
17728
|
const Sizable = {
|
|
17329
17729
|
string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
17330
17730
|
file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
@@ -17357,9 +17757,9 @@ var error23 = () => {
|
|
|
17357
17757
|
ipv6: "IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
|
|
17358
17758
|
cidrv4: "IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
|
|
17359
17759
|
cidrv6: "IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
|
|
17360
|
-
base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \
|
|
17361
|
-
base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \
|
|
17362
|
-
json_string: "JSON \
|
|
17760
|
+
base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
|
|
17761
|
+
base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
|
|
17762
|
+
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
17363
17763
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
17364
17764
|
jwt: "JWT",
|
|
17365
17765
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
@@ -17367,7 +17767,7 @@ var error23 = () => {
|
|
|
17367
17767
|
const TypeDictionary = {
|
|
17368
17768
|
nan: "NaN",
|
|
17369
17769
|
number: "\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",
|
|
17370
|
-
string: "\
|
|
17770
|
+
string: "\u10D5\u10D4\u10DA\u10D8",
|
|
17371
17771
|
boolean: "\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",
|
|
17372
17772
|
function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",
|
|
17373
17773
|
array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"
|
|
@@ -17405,14 +17805,14 @@ var error23 = () => {
|
|
|
17405
17805
|
case "invalid_format": {
|
|
17406
17806
|
const _issue = issue2;
|
|
17407
17807
|
if (_issue.format === "starts_with") {
|
|
17408
|
-
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \
|
|
17808
|
+
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
|
|
17409
17809
|
}
|
|
17410
17810
|
if (_issue.format === "ends_with")
|
|
17411
|
-
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \
|
|
17811
|
+
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
|
|
17412
17812
|
if (_issue.format === "includes")
|
|
17413
|
-
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \
|
|
17813
|
+
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
|
|
17414
17814
|
if (_issue.format === "regex")
|
|
17415
|
-
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \
|
|
17815
|
+
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`;
|
|
17416
17816
|
return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue2.format}`;
|
|
17417
17817
|
}
|
|
17418
17818
|
case "not_multiple_of":
|
|
@@ -17432,12 +17832,12 @@ var error23 = () => {
|
|
|
17432
17832
|
};
|
|
17433
17833
|
function ka_default() {
|
|
17434
17834
|
return {
|
|
17435
|
-
localeError:
|
|
17835
|
+
localeError: error25()
|
|
17436
17836
|
};
|
|
17437
17837
|
}
|
|
17438
17838
|
|
|
17439
17839
|
// node_modules/zod/v4/locales/km.js
|
|
17440
|
-
var
|
|
17840
|
+
var error26 = () => {
|
|
17441
17841
|
const Sizable = {
|
|
17442
17842
|
string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
17443
17843
|
file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
@@ -17543,7 +17943,7 @@ var error24 = () => {
|
|
|
17543
17943
|
};
|
|
17544
17944
|
function km_default() {
|
|
17545
17945
|
return {
|
|
17546
|
-
localeError:
|
|
17946
|
+
localeError: error26()
|
|
17547
17947
|
};
|
|
17548
17948
|
}
|
|
17549
17949
|
|
|
@@ -17553,7 +17953,7 @@ function kh_default() {
|
|
|
17553
17953
|
}
|
|
17554
17954
|
|
|
17555
17955
|
// node_modules/zod/v4/locales/ko.js
|
|
17556
|
-
var
|
|
17956
|
+
var error27 = () => {
|
|
17557
17957
|
const Sizable = {
|
|
17558
17958
|
string: { unit: "\uBB38\uC790", verb: "to have" },
|
|
17559
17959
|
file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" },
|
|
@@ -17660,7 +18060,7 @@ var error25 = () => {
|
|
|
17660
18060
|
};
|
|
17661
18061
|
function ko_default() {
|
|
17662
18062
|
return {
|
|
17663
|
-
localeError:
|
|
18063
|
+
localeError: error27()
|
|
17664
18064
|
};
|
|
17665
18065
|
}
|
|
17666
18066
|
|
|
@@ -17678,7 +18078,7 @@ function getUnitTypeFromNumber(number4) {
|
|
|
17678
18078
|
return "one";
|
|
17679
18079
|
return "few";
|
|
17680
18080
|
}
|
|
17681
|
-
var
|
|
18081
|
+
var error28 = () => {
|
|
17682
18082
|
const Sizable = {
|
|
17683
18083
|
string: {
|
|
17684
18084
|
unit: {
|
|
@@ -17864,12 +18264,12 @@ var error26 = () => {
|
|
|
17864
18264
|
};
|
|
17865
18265
|
function lt_default() {
|
|
17866
18266
|
return {
|
|
17867
|
-
localeError:
|
|
18267
|
+
localeError: error28()
|
|
17868
18268
|
};
|
|
17869
18269
|
}
|
|
17870
18270
|
|
|
17871
18271
|
// node_modules/zod/v4/locales/mk.js
|
|
17872
|
-
var
|
|
18272
|
+
var error29 = () => {
|
|
17873
18273
|
const Sizable = {
|
|
17874
18274
|
string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
17875
18275
|
file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
@@ -17974,12 +18374,12 @@ var error27 = () => {
|
|
|
17974
18374
|
};
|
|
17975
18375
|
function mk_default() {
|
|
17976
18376
|
return {
|
|
17977
|
-
localeError:
|
|
18377
|
+
localeError: error29()
|
|
17978
18378
|
};
|
|
17979
18379
|
}
|
|
17980
18380
|
|
|
17981
18381
|
// node_modules/zod/v4/locales/ms.js
|
|
17982
|
-
var
|
|
18382
|
+
var error30 = () => {
|
|
17983
18383
|
const Sizable = {
|
|
17984
18384
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
17985
18385
|
file: { unit: "bait", verb: "mempunyai" },
|
|
@@ -18082,12 +18482,12 @@ var error28 = () => {
|
|
|
18082
18482
|
};
|
|
18083
18483
|
function ms_default() {
|
|
18084
18484
|
return {
|
|
18085
|
-
localeError:
|
|
18485
|
+
localeError: error30()
|
|
18086
18486
|
};
|
|
18087
18487
|
}
|
|
18088
18488
|
|
|
18089
18489
|
// node_modules/zod/v4/locales/nl.js
|
|
18090
|
-
var
|
|
18490
|
+
var error31 = () => {
|
|
18091
18491
|
const Sizable = {
|
|
18092
18492
|
string: { unit: "tekens", verb: "heeft" },
|
|
18093
18493
|
file: { unit: "bytes", verb: "heeft" },
|
|
@@ -18193,12 +18593,12 @@ var error29 = () => {
|
|
|
18193
18593
|
};
|
|
18194
18594
|
function nl_default() {
|
|
18195
18595
|
return {
|
|
18196
|
-
localeError:
|
|
18596
|
+
localeError: error31()
|
|
18197
18597
|
};
|
|
18198
18598
|
}
|
|
18199
18599
|
|
|
18200
18600
|
// node_modules/zod/v4/locales/no.js
|
|
18201
|
-
var
|
|
18601
|
+
var error32 = () => {
|
|
18202
18602
|
const Sizable = {
|
|
18203
18603
|
string: { unit: "tegn", verb: "\xE5 ha" },
|
|
18204
18604
|
file: { unit: "bytes", verb: "\xE5 ha" },
|
|
@@ -18302,12 +18702,12 @@ var error30 = () => {
|
|
|
18302
18702
|
};
|
|
18303
18703
|
function no_default() {
|
|
18304
18704
|
return {
|
|
18305
|
-
localeError:
|
|
18705
|
+
localeError: error32()
|
|
18306
18706
|
};
|
|
18307
18707
|
}
|
|
18308
18708
|
|
|
18309
18709
|
// node_modules/zod/v4/locales/ota.js
|
|
18310
|
-
var
|
|
18710
|
+
var error33 = () => {
|
|
18311
18711
|
const Sizable = {
|
|
18312
18712
|
string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
|
|
18313
18713
|
file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
|
|
@@ -18412,12 +18812,12 @@ var error31 = () => {
|
|
|
18412
18812
|
};
|
|
18413
18813
|
function ota_default() {
|
|
18414
18814
|
return {
|
|
18415
|
-
localeError:
|
|
18815
|
+
localeError: error33()
|
|
18416
18816
|
};
|
|
18417
18817
|
}
|
|
18418
18818
|
|
|
18419
18819
|
// node_modules/zod/v4/locales/ps.js
|
|
18420
|
-
var
|
|
18820
|
+
var error34 = () => {
|
|
18421
18821
|
const Sizable = {
|
|
18422
18822
|
string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
|
|
18423
18823
|
file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" },
|
|
@@ -18527,12 +18927,12 @@ var error32 = () => {
|
|
|
18527
18927
|
};
|
|
18528
18928
|
function ps_default() {
|
|
18529
18929
|
return {
|
|
18530
|
-
localeError:
|
|
18930
|
+
localeError: error34()
|
|
18531
18931
|
};
|
|
18532
18932
|
}
|
|
18533
18933
|
|
|
18534
18934
|
// node_modules/zod/v4/locales/pl.js
|
|
18535
|
-
var
|
|
18935
|
+
var error35 = () => {
|
|
18536
18936
|
const Sizable = {
|
|
18537
18937
|
string: { unit: "znak\xF3w", verb: "mie\u0107" },
|
|
18538
18938
|
file: { unit: "bajt\xF3w", verb: "mie\u0107" },
|
|
@@ -18637,12 +19037,12 @@ var error33 = () => {
|
|
|
18637
19037
|
};
|
|
18638
19038
|
function pl_default() {
|
|
18639
19039
|
return {
|
|
18640
|
-
localeError:
|
|
19040
|
+
localeError: error35()
|
|
18641
19041
|
};
|
|
18642
19042
|
}
|
|
18643
19043
|
|
|
18644
19044
|
// node_modules/zod/v4/locales/pt.js
|
|
18645
|
-
var
|
|
19045
|
+
var error36 = () => {
|
|
18646
19046
|
const Sizable = {
|
|
18647
19047
|
string: { unit: "caracteres", verb: "ter" },
|
|
18648
19048
|
file: { unit: "bytes", verb: "ter" },
|
|
@@ -18746,7 +19146,127 @@ var error34 = () => {
|
|
|
18746
19146
|
};
|
|
18747
19147
|
function pt_default() {
|
|
18748
19148
|
return {
|
|
18749
|
-
localeError:
|
|
19149
|
+
localeError: error36()
|
|
19150
|
+
};
|
|
19151
|
+
}
|
|
19152
|
+
|
|
19153
|
+
// node_modules/zod/v4/locales/ro.js
|
|
19154
|
+
var error37 = () => {
|
|
19155
|
+
const Sizable = {
|
|
19156
|
+
string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
|
|
19157
|
+
file: { unit: "octe\u021Bi", verb: "s\u0103 aib\u0103" },
|
|
19158
|
+
array: { unit: "elemente", verb: "s\u0103 aib\u0103" },
|
|
19159
|
+
set: { unit: "elemente", verb: "s\u0103 aib\u0103" },
|
|
19160
|
+
map: { unit: "intr\u0103ri", verb: "s\u0103 aib\u0103" }
|
|
19161
|
+
};
|
|
19162
|
+
function getSizing(origin) {
|
|
19163
|
+
return Sizable[origin] ?? null;
|
|
19164
|
+
}
|
|
19165
|
+
const FormatDictionary = {
|
|
19166
|
+
regex: "intrare",
|
|
19167
|
+
email: "adres\u0103 de email",
|
|
19168
|
+
url: "URL",
|
|
19169
|
+
emoji: "emoji",
|
|
19170
|
+
uuid: "UUID",
|
|
19171
|
+
uuidv4: "UUIDv4",
|
|
19172
|
+
uuidv6: "UUIDv6",
|
|
19173
|
+
nanoid: "nanoid",
|
|
19174
|
+
guid: "GUID",
|
|
19175
|
+
cuid: "cuid",
|
|
19176
|
+
cuid2: "cuid2",
|
|
19177
|
+
ulid: "ULID",
|
|
19178
|
+
xid: "XID",
|
|
19179
|
+
ksuid: "KSUID",
|
|
19180
|
+
datetime: "dat\u0103 \u0219i or\u0103 ISO",
|
|
19181
|
+
date: "dat\u0103 ISO",
|
|
19182
|
+
time: "or\u0103 ISO",
|
|
19183
|
+
duration: "durat\u0103 ISO",
|
|
19184
|
+
ipv4: "adres\u0103 IPv4",
|
|
19185
|
+
ipv6: "adres\u0103 IPv6",
|
|
19186
|
+
mac: "adres\u0103 MAC",
|
|
19187
|
+
cidrv4: "interval IPv4",
|
|
19188
|
+
cidrv6: "interval IPv6",
|
|
19189
|
+
base64: "\u0219ir codat base64",
|
|
19190
|
+
base64url: "\u0219ir codat base64url",
|
|
19191
|
+
json_string: "\u0219ir JSON",
|
|
19192
|
+
e164: "num\u0103r E.164",
|
|
19193
|
+
jwt: "JWT",
|
|
19194
|
+
template_literal: "intrare"
|
|
19195
|
+
};
|
|
19196
|
+
const TypeDictionary = {
|
|
19197
|
+
nan: "NaN",
|
|
19198
|
+
string: "\u0219ir",
|
|
19199
|
+
number: "num\u0103r",
|
|
19200
|
+
boolean: "boolean",
|
|
19201
|
+
function: "func\u021Bie",
|
|
19202
|
+
array: "matrice",
|
|
19203
|
+
object: "obiect",
|
|
19204
|
+
undefined: "nedefinit",
|
|
19205
|
+
symbol: "simbol",
|
|
19206
|
+
bigint: "num\u0103r mare",
|
|
19207
|
+
void: "void",
|
|
19208
|
+
never: "never",
|
|
19209
|
+
map: "hart\u0103",
|
|
19210
|
+
set: "set"
|
|
19211
|
+
};
|
|
19212
|
+
return (issue2) => {
|
|
19213
|
+
switch (issue2.code) {
|
|
19214
|
+
case "invalid_type": {
|
|
19215
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
19216
|
+
const receivedType = parsedType(issue2.input);
|
|
19217
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
19218
|
+
return `Intrare invalid\u0103: a\u0219teptat ${expected}, primit ${received}`;
|
|
19219
|
+
}
|
|
19220
|
+
case "invalid_value":
|
|
19221
|
+
if (issue2.values.length === 1)
|
|
19222
|
+
return `Intrare invalid\u0103: a\u0219teptat ${stringifyPrimitive(issue2.values[0])}`;
|
|
19223
|
+
return `Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${joinValues(issue2.values, "|")}`;
|
|
19224
|
+
case "too_big": {
|
|
19225
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
19226
|
+
const sizing = getSizing(issue2.origin);
|
|
19227
|
+
if (sizing)
|
|
19228
|
+
return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemente"}`;
|
|
19229
|
+
return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} s\u0103 fie ${adj}${issue2.maximum.toString()}`;
|
|
19230
|
+
}
|
|
19231
|
+
case "too_small": {
|
|
19232
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
19233
|
+
const sizing = getSizing(issue2.origin);
|
|
19234
|
+
if (sizing) {
|
|
19235
|
+
return `Prea mic: a\u0219teptat ca ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
19236
|
+
}
|
|
19237
|
+
return `Prea mic: a\u0219teptat ca ${issue2.origin} s\u0103 fie ${adj}${issue2.minimum.toString()}`;
|
|
19238
|
+
}
|
|
19239
|
+
case "invalid_format": {
|
|
19240
|
+
const _issue = issue2;
|
|
19241
|
+
if (_issue.format === "starts_with") {
|
|
19242
|
+
return `\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${_issue.prefix}"`;
|
|
19243
|
+
}
|
|
19244
|
+
if (_issue.format === "ends_with")
|
|
19245
|
+
return `\u0218ir invalid: trebuie s\u0103 se termine cu "${_issue.suffix}"`;
|
|
19246
|
+
if (_issue.format === "includes")
|
|
19247
|
+
return `\u0218ir invalid: trebuie s\u0103 includ\u0103 "${_issue.includes}"`;
|
|
19248
|
+
if (_issue.format === "regex")
|
|
19249
|
+
return `\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${_issue.pattern}`;
|
|
19250
|
+
return `Format invalid: ${FormatDictionary[_issue.format] ?? issue2.format}`;
|
|
19251
|
+
}
|
|
19252
|
+
case "not_multiple_of":
|
|
19253
|
+
return `Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${issue2.divisor}`;
|
|
19254
|
+
case "unrecognized_keys":
|
|
19255
|
+
return `Chei nerecunoscute: ${joinValues(issue2.keys, ", ")}`;
|
|
19256
|
+
case "invalid_key":
|
|
19257
|
+
return `Cheie invalid\u0103 \xEEn ${issue2.origin}`;
|
|
19258
|
+
case "invalid_union":
|
|
19259
|
+
return "Intrare invalid\u0103";
|
|
19260
|
+
case "invalid_element":
|
|
19261
|
+
return `Valoare invalid\u0103 \xEEn ${issue2.origin}`;
|
|
19262
|
+
default:
|
|
19263
|
+
return `Intrare invalid\u0103`;
|
|
19264
|
+
}
|
|
19265
|
+
};
|
|
19266
|
+
};
|
|
19267
|
+
function ro_default() {
|
|
19268
|
+
return {
|
|
19269
|
+
localeError: error37()
|
|
18750
19270
|
};
|
|
18751
19271
|
}
|
|
18752
19272
|
|
|
@@ -18766,7 +19286,7 @@ function getRussianPlural(count, one, few, many) {
|
|
|
18766
19286
|
}
|
|
18767
19287
|
return many;
|
|
18768
19288
|
}
|
|
18769
|
-
var
|
|
19289
|
+
var error38 = () => {
|
|
18770
19290
|
const Sizable = {
|
|
18771
19291
|
string: {
|
|
18772
19292
|
unit: {
|
|
@@ -18903,12 +19423,12 @@ var error35 = () => {
|
|
|
18903
19423
|
};
|
|
18904
19424
|
function ru_default() {
|
|
18905
19425
|
return {
|
|
18906
|
-
localeError:
|
|
19426
|
+
localeError: error38()
|
|
18907
19427
|
};
|
|
18908
19428
|
}
|
|
18909
19429
|
|
|
18910
19430
|
// node_modules/zod/v4/locales/sl.js
|
|
18911
|
-
var
|
|
19431
|
+
var error39 = () => {
|
|
18912
19432
|
const Sizable = {
|
|
18913
19433
|
string: { unit: "znakov", verb: "imeti" },
|
|
18914
19434
|
file: { unit: "bajtov", verb: "imeti" },
|
|
@@ -19013,12 +19533,12 @@ var error36 = () => {
|
|
|
19013
19533
|
};
|
|
19014
19534
|
function sl_default() {
|
|
19015
19535
|
return {
|
|
19016
|
-
localeError:
|
|
19536
|
+
localeError: error39()
|
|
19017
19537
|
};
|
|
19018
19538
|
}
|
|
19019
19539
|
|
|
19020
19540
|
// node_modules/zod/v4/locales/sv.js
|
|
19021
|
-
var
|
|
19541
|
+
var error40 = () => {
|
|
19022
19542
|
const Sizable = {
|
|
19023
19543
|
string: { unit: "tecken", verb: "att ha" },
|
|
19024
19544
|
file: { unit: "bytes", verb: "att ha" },
|
|
@@ -19124,12 +19644,12 @@ var error37 = () => {
|
|
|
19124
19644
|
};
|
|
19125
19645
|
function sv_default() {
|
|
19126
19646
|
return {
|
|
19127
|
-
localeError:
|
|
19647
|
+
localeError: error40()
|
|
19128
19648
|
};
|
|
19129
19649
|
}
|
|
19130
19650
|
|
|
19131
19651
|
// node_modules/zod/v4/locales/ta.js
|
|
19132
|
-
var
|
|
19652
|
+
var error41 = () => {
|
|
19133
19653
|
const Sizable = {
|
|
19134
19654
|
string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
19135
19655
|
file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
@@ -19235,12 +19755,12 @@ var error38 = () => {
|
|
|
19235
19755
|
};
|
|
19236
19756
|
function ta_default() {
|
|
19237
19757
|
return {
|
|
19238
|
-
localeError:
|
|
19758
|
+
localeError: error41()
|
|
19239
19759
|
};
|
|
19240
19760
|
}
|
|
19241
19761
|
|
|
19242
19762
|
// node_modules/zod/v4/locales/th.js
|
|
19243
|
-
var
|
|
19763
|
+
var error42 = () => {
|
|
19244
19764
|
const Sizable = {
|
|
19245
19765
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
19246
19766
|
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -19346,12 +19866,12 @@ var error39 = () => {
|
|
|
19346
19866
|
};
|
|
19347
19867
|
function th_default() {
|
|
19348
19868
|
return {
|
|
19349
|
-
localeError:
|
|
19869
|
+
localeError: error42()
|
|
19350
19870
|
};
|
|
19351
19871
|
}
|
|
19352
19872
|
|
|
19353
19873
|
// node_modules/zod/v4/locales/tr.js
|
|
19354
|
-
var
|
|
19874
|
+
var error43 = () => {
|
|
19355
19875
|
const Sizable = {
|
|
19356
19876
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
19357
19877
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -19452,12 +19972,12 @@ var error40 = () => {
|
|
|
19452
19972
|
};
|
|
19453
19973
|
function tr_default() {
|
|
19454
19974
|
return {
|
|
19455
|
-
localeError:
|
|
19975
|
+
localeError: error43()
|
|
19456
19976
|
};
|
|
19457
19977
|
}
|
|
19458
19978
|
|
|
19459
19979
|
// node_modules/zod/v4/locales/uk.js
|
|
19460
|
-
var
|
|
19980
|
+
var error44 = () => {
|
|
19461
19981
|
const Sizable = {
|
|
19462
19982
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
19463
19983
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -19561,7 +20081,7 @@ var error41 = () => {
|
|
|
19561
20081
|
};
|
|
19562
20082
|
function uk_default() {
|
|
19563
20083
|
return {
|
|
19564
|
-
localeError:
|
|
20084
|
+
localeError: error44()
|
|
19565
20085
|
};
|
|
19566
20086
|
}
|
|
19567
20087
|
|
|
@@ -19571,7 +20091,7 @@ function ua_default() {
|
|
|
19571
20091
|
}
|
|
19572
20092
|
|
|
19573
20093
|
// node_modules/zod/v4/locales/ur.js
|
|
19574
|
-
var
|
|
20094
|
+
var error45 = () => {
|
|
19575
20095
|
const Sizable = {
|
|
19576
20096
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
19577
20097
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -19677,17 +20197,18 @@ var error42 = () => {
|
|
|
19677
20197
|
};
|
|
19678
20198
|
function ur_default() {
|
|
19679
20199
|
return {
|
|
19680
|
-
localeError:
|
|
20200
|
+
localeError: error45()
|
|
19681
20201
|
};
|
|
19682
20202
|
}
|
|
19683
20203
|
|
|
19684
20204
|
// node_modules/zod/v4/locales/uz.js
|
|
19685
|
-
var
|
|
20205
|
+
var error46 = () => {
|
|
19686
20206
|
const Sizable = {
|
|
19687
20207
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
19688
20208
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
19689
20209
|
array: { unit: "element", verb: "bo\u2018lishi kerak" },
|
|
19690
|
-
set: { unit: "element", verb: "bo\u2018lishi kerak" }
|
|
20210
|
+
set: { unit: "element", verb: "bo\u2018lishi kerak" },
|
|
20211
|
+
map: { unit: "yozuv", verb: "bo\u2018lishi kerak" }
|
|
19691
20212
|
};
|
|
19692
20213
|
function getSizing(origin) {
|
|
19693
20214
|
return Sizable[origin] ?? null;
|
|
@@ -19787,12 +20308,12 @@ var error43 = () => {
|
|
|
19787
20308
|
};
|
|
19788
20309
|
function uz_default() {
|
|
19789
20310
|
return {
|
|
19790
|
-
localeError:
|
|
20311
|
+
localeError: error46()
|
|
19791
20312
|
};
|
|
19792
20313
|
}
|
|
19793
20314
|
|
|
19794
20315
|
// node_modules/zod/v4/locales/vi.js
|
|
19795
|
-
var
|
|
20316
|
+
var error47 = () => {
|
|
19796
20317
|
const Sizable = {
|
|
19797
20318
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
19798
20319
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -19896,12 +20417,12 @@ var error44 = () => {
|
|
|
19896
20417
|
};
|
|
19897
20418
|
function vi_default() {
|
|
19898
20419
|
return {
|
|
19899
|
-
localeError:
|
|
20420
|
+
localeError: error47()
|
|
19900
20421
|
};
|
|
19901
20422
|
}
|
|
19902
20423
|
|
|
19903
20424
|
// node_modules/zod/v4/locales/zh-CN.js
|
|
19904
|
-
var
|
|
20425
|
+
var error48 = () => {
|
|
19905
20426
|
const Sizable = {
|
|
19906
20427
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
19907
20428
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -20006,12 +20527,12 @@ var error45 = () => {
|
|
|
20006
20527
|
};
|
|
20007
20528
|
function zh_CN_default() {
|
|
20008
20529
|
return {
|
|
20009
|
-
localeError:
|
|
20530
|
+
localeError: error48()
|
|
20010
20531
|
};
|
|
20011
20532
|
}
|
|
20012
20533
|
|
|
20013
20534
|
// node_modules/zod/v4/locales/zh-TW.js
|
|
20014
|
-
var
|
|
20535
|
+
var error49 = () => {
|
|
20015
20536
|
const Sizable = {
|
|
20016
20537
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
20017
20538
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -20114,12 +20635,12 @@ var error46 = () => {
|
|
|
20114
20635
|
};
|
|
20115
20636
|
function zh_TW_default() {
|
|
20116
20637
|
return {
|
|
20117
|
-
localeError:
|
|
20638
|
+
localeError: error49()
|
|
20118
20639
|
};
|
|
20119
20640
|
}
|
|
20120
20641
|
|
|
20121
20642
|
// node_modules/zod/v4/locales/yo.js
|
|
20122
|
-
var
|
|
20643
|
+
var error50 = () => {
|
|
20123
20644
|
const Sizable = {
|
|
20124
20645
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
20125
20646
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -20222,12 +20743,12 @@ var error47 = () => {
|
|
|
20222
20743
|
};
|
|
20223
20744
|
function yo_default() {
|
|
20224
20745
|
return {
|
|
20225
|
-
localeError:
|
|
20746
|
+
localeError: error50()
|
|
20226
20747
|
};
|
|
20227
20748
|
}
|
|
20228
20749
|
|
|
20229
20750
|
// node_modules/zod/v4/core/registries.js
|
|
20230
|
-
var
|
|
20751
|
+
var _a2;
|
|
20231
20752
|
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
20232
20753
|
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
20233
20754
|
var $ZodRegistry = class {
|
|
@@ -20273,7 +20794,7 @@ var $ZodRegistry = class {
|
|
|
20273
20794
|
function registry() {
|
|
20274
20795
|
return new $ZodRegistry();
|
|
20275
20796
|
}
|
|
20276
|
-
(
|
|
20797
|
+
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
20277
20798
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
20278
20799
|
|
|
20279
20800
|
// node_modules/zod/v4/core/api.js
|
|
@@ -21191,7 +21712,7 @@ function _refine(Class2, fn, _params) {
|
|
|
21191
21712
|
return schema;
|
|
21192
21713
|
}
|
|
21193
21714
|
// @__NO_SIDE_EFFECTS__
|
|
21194
|
-
function _superRefine(fn) {
|
|
21715
|
+
function _superRefine(fn, params) {
|
|
21195
21716
|
const ch = /* @__PURE__ */ _check((payload) => {
|
|
21196
21717
|
payload.addIssue = (issue2) => {
|
|
21197
21718
|
if (typeof issue2 === "string") {
|
|
@@ -21208,7 +21729,7 @@ function _superRefine(fn) {
|
|
|
21208
21729
|
}
|
|
21209
21730
|
};
|
|
21210
21731
|
return fn(payload.value, payload);
|
|
21211
|
-
});
|
|
21732
|
+
}, params);
|
|
21212
21733
|
return ch;
|
|
21213
21734
|
}
|
|
21214
21735
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -21338,7 +21859,7 @@ function initializeContext(params) {
|
|
|
21338
21859
|
};
|
|
21339
21860
|
}
|
|
21340
21861
|
function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
21341
|
-
var
|
|
21862
|
+
var _a3;
|
|
21342
21863
|
const def = schema._zod.def;
|
|
21343
21864
|
const seen = ctx.seen.get(schema);
|
|
21344
21865
|
if (seen) {
|
|
@@ -21385,8 +21906,8 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
21385
21906
|
delete result.schema.examples;
|
|
21386
21907
|
delete result.schema.default;
|
|
21387
21908
|
}
|
|
21388
|
-
if (ctx.io === "input" && result.schema
|
|
21389
|
-
(
|
|
21909
|
+
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
21910
|
+
(_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
|
|
21390
21911
|
delete result.schema._prefault;
|
|
21391
21912
|
const _result = ctx.seen.get(schema);
|
|
21392
21913
|
return _result.schema;
|
|
@@ -21567,10 +22088,15 @@ function finalize(ctx, schema) {
|
|
|
21567
22088
|
result.$id = ctx.external.uri(id);
|
|
21568
22089
|
}
|
|
21569
22090
|
Object.assign(result, root.def ?? root.schema);
|
|
22091
|
+
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
22092
|
+
if (rootMetaId !== void 0 && result.id === rootMetaId)
|
|
22093
|
+
delete result.id;
|
|
21570
22094
|
const defs = ctx.external?.defs ?? {};
|
|
21571
22095
|
for (const entry of ctx.seen.entries()) {
|
|
21572
22096
|
const seen = entry[1];
|
|
21573
22097
|
if (seen.def && seen.defId) {
|
|
22098
|
+
if (seen.def.id === seen.defId)
|
|
22099
|
+
delete seen.def.id;
|
|
21574
22100
|
defs[seen.defId] = seen.def;
|
|
21575
22101
|
}
|
|
21576
22102
|
}
|
|
@@ -21626,6 +22152,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
21626
22152
|
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
21627
22153
|
}
|
|
21628
22154
|
if (def.type === "pipe") {
|
|
22155
|
+
if (_schema._zod.traits.has("$ZodCodec"))
|
|
22156
|
+
return true;
|
|
21629
22157
|
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
21630
22158
|
}
|
|
21631
22159
|
if (def.type === "object") {
|
|
@@ -21715,39 +22243,28 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
21715
22243
|
json2.type = "integer";
|
|
21716
22244
|
else
|
|
21717
22245
|
json2.type = "number";
|
|
21718
|
-
|
|
21719
|
-
|
|
22246
|
+
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
22247
|
+
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
22248
|
+
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
22249
|
+
if (exMin) {
|
|
22250
|
+
if (legacy) {
|
|
21720
22251
|
json2.minimum = exclusiveMinimum;
|
|
21721
22252
|
json2.exclusiveMinimum = true;
|
|
21722
22253
|
} else {
|
|
21723
22254
|
json2.exclusiveMinimum = exclusiveMinimum;
|
|
21724
22255
|
}
|
|
21725
|
-
}
|
|
21726
|
-
if (typeof minimum === "number") {
|
|
22256
|
+
} else if (typeof minimum === "number") {
|
|
21727
22257
|
json2.minimum = minimum;
|
|
21728
|
-
if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
|
|
21729
|
-
if (exclusiveMinimum >= minimum)
|
|
21730
|
-
delete json2.minimum;
|
|
21731
|
-
else
|
|
21732
|
-
delete json2.exclusiveMinimum;
|
|
21733
|
-
}
|
|
21734
22258
|
}
|
|
21735
|
-
if (
|
|
21736
|
-
if (
|
|
22259
|
+
if (exMax) {
|
|
22260
|
+
if (legacy) {
|
|
21737
22261
|
json2.maximum = exclusiveMaximum;
|
|
21738
22262
|
json2.exclusiveMaximum = true;
|
|
21739
22263
|
} else {
|
|
21740
22264
|
json2.exclusiveMaximum = exclusiveMaximum;
|
|
21741
22265
|
}
|
|
21742
|
-
}
|
|
21743
|
-
if (typeof maximum === "number") {
|
|
22266
|
+
} else if (typeof maximum === "number") {
|
|
21744
22267
|
json2.maximum = maximum;
|
|
21745
|
-
if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
|
|
21746
|
-
if (exclusiveMaximum <= maximum)
|
|
21747
|
-
delete json2.maximum;
|
|
21748
|
-
else
|
|
21749
|
-
delete json2.exclusiveMaximum;
|
|
21750
|
-
}
|
|
21751
22268
|
}
|
|
21752
22269
|
if (typeof multipleOf === "number")
|
|
21753
22270
|
json2.multipleOf = multipleOf;
|
|
@@ -21919,7 +22436,10 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
21919
22436
|
if (typeof maximum === "number")
|
|
21920
22437
|
json2.maxItems = maximum;
|
|
21921
22438
|
json2.type = "array";
|
|
21922
|
-
json2.items = process2(def.element, ctx, {
|
|
22439
|
+
json2.items = process2(def.element, ctx, {
|
|
22440
|
+
...params,
|
|
22441
|
+
path: [...params.path, "items"]
|
|
22442
|
+
});
|
|
21923
22443
|
};
|
|
21924
22444
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
21925
22445
|
const json2 = _json;
|
|
@@ -22112,7 +22632,8 @@ var catchProcessor = (schema, ctx, json2, params) => {
|
|
|
22112
22632
|
};
|
|
22113
22633
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
22114
22634
|
const def = schema._zod.def;
|
|
22115
|
-
const
|
|
22635
|
+
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
22636
|
+
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
22116
22637
|
process2(innerType, ctx, params);
|
|
22117
22638
|
const seen = ctx.seen.get(schema);
|
|
22118
22639
|
seen.ref = innerType;
|
|
@@ -22312,7 +22833,9 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
|
22312
22833
|
...def,
|
|
22313
22834
|
checks: [
|
|
22314
22835
|
...def.checks ?? [],
|
|
22315
|
-
...checks.map((ch) => typeof ch === "function" ? {
|
|
22836
|
+
...checks.map((ch) => typeof ch === "function" ? {
|
|
22837
|
+
_zod: { check: ch, def: { check: "custom" }, onattach: [] }
|
|
22838
|
+
} : ch)
|
|
22316
22839
|
]
|
|
22317
22840
|
}, { parent: true });
|
|
22318
22841
|
};
|
|
@@ -22424,24 +22947,24 @@ function normalizeObjectSchema(schema) {
|
|
|
22424
22947
|
}
|
|
22425
22948
|
return void 0;
|
|
22426
22949
|
}
|
|
22427
|
-
function getParseErrorMessage(
|
|
22428
|
-
if (
|
|
22429
|
-
if ("message" in
|
|
22430
|
-
return
|
|
22950
|
+
function getParseErrorMessage(error51) {
|
|
22951
|
+
if (error51 && typeof error51 === "object") {
|
|
22952
|
+
if ("message" in error51 && typeof error51.message === "string") {
|
|
22953
|
+
return error51.message;
|
|
22431
22954
|
}
|
|
22432
|
-
if ("issues" in
|
|
22433
|
-
const firstIssue =
|
|
22955
|
+
if ("issues" in error51 && Array.isArray(error51.issues) && error51.issues.length > 0) {
|
|
22956
|
+
const firstIssue = error51.issues[0];
|
|
22434
22957
|
if (firstIssue && typeof firstIssue === "object" && "message" in firstIssue) {
|
|
22435
22958
|
return String(firstIssue.message);
|
|
22436
22959
|
}
|
|
22437
22960
|
}
|
|
22438
22961
|
try {
|
|
22439
|
-
return JSON.stringify(
|
|
22962
|
+
return JSON.stringify(error51);
|
|
22440
22963
|
} catch {
|
|
22441
|
-
return String(
|
|
22964
|
+
return String(error51);
|
|
22442
22965
|
}
|
|
22443
22966
|
}
|
|
22444
|
-
return String(
|
|
22967
|
+
return String(error51);
|
|
22445
22968
|
}
|
|
22446
22969
|
function getSchemaDescription(schema) {
|
|
22447
22970
|
return schema.description;
|
|
@@ -22485,8 +23008,8 @@ function getLiteralValue(schema) {
|
|
|
22485
23008
|
}
|
|
22486
23009
|
|
|
22487
23010
|
// node_modules/zod/v4/classic/external.js
|
|
22488
|
-
var
|
|
22489
|
-
__export(
|
|
23011
|
+
var external_exports = {};
|
|
23012
|
+
__export(external_exports, {
|
|
22490
23013
|
$brand: () => $brand,
|
|
22491
23014
|
$input: () => $input,
|
|
22492
23015
|
$output: () => $output,
|
|
@@ -22546,6 +23069,7 @@ __export(external_exports3, {
|
|
|
22546
23069
|
ZodOptional: () => ZodOptional2,
|
|
22547
23070
|
ZodPipe: () => ZodPipe,
|
|
22548
23071
|
ZodPrefault: () => ZodPrefault,
|
|
23072
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
22549
23073
|
ZodPromise: () => ZodPromise2,
|
|
22550
23074
|
ZodReadonly: () => ZodReadonly2,
|
|
22551
23075
|
ZodRealError: () => ZodRealError,
|
|
@@ -22624,6 +23148,7 @@ __export(external_exports3, {
|
|
|
22624
23148
|
int32: () => int32,
|
|
22625
23149
|
int64: () => int64,
|
|
22626
23150
|
intersection: () => intersection,
|
|
23151
|
+
invertCodec: () => invertCodec,
|
|
22627
23152
|
ipv4: () => ipv42,
|
|
22628
23153
|
ipv6: () => ipv62,
|
|
22629
23154
|
iso: () => iso_exports2,
|
|
@@ -22726,8 +23251,8 @@ __export(external_exports3, {
|
|
|
22726
23251
|
});
|
|
22727
23252
|
|
|
22728
23253
|
// node_modules/zod/v4/classic/schemas.js
|
|
22729
|
-
var
|
|
22730
|
-
__export(
|
|
23254
|
+
var schemas_exports2 = {};
|
|
23255
|
+
__export(schemas_exports2, {
|
|
22731
23256
|
ZodAny: () => ZodAny2,
|
|
22732
23257
|
ZodArray: () => ZodArray2,
|
|
22733
23258
|
ZodBase64: () => ZodBase64,
|
|
@@ -22775,6 +23300,7 @@ __export(schemas_exports3, {
|
|
|
22775
23300
|
ZodOptional: () => ZodOptional2,
|
|
22776
23301
|
ZodPipe: () => ZodPipe,
|
|
22777
23302
|
ZodPrefault: () => ZodPrefault,
|
|
23303
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
22778
23304
|
ZodPromise: () => ZodPromise2,
|
|
22779
23305
|
ZodReadonly: () => ZodReadonly2,
|
|
22780
23306
|
ZodRecord: () => ZodRecord2,
|
|
@@ -22835,6 +23361,7 @@ __export(schemas_exports3, {
|
|
|
22835
23361
|
int32: () => int32,
|
|
22836
23362
|
int64: () => int64,
|
|
22837
23363
|
intersection: () => intersection,
|
|
23364
|
+
invertCodec: () => invertCodec,
|
|
22838
23365
|
ipv4: () => ipv42,
|
|
22839
23366
|
ipv6: () => ipv62,
|
|
22840
23367
|
json: () => json,
|
|
@@ -23004,8 +23531,8 @@ var initializer2 = (inst, issues) => {
|
|
|
23004
23531
|
}
|
|
23005
23532
|
});
|
|
23006
23533
|
};
|
|
23007
|
-
var ZodError2 = $constructor("ZodError", initializer2);
|
|
23008
|
-
var ZodRealError = $constructor("ZodError", initializer2, {
|
|
23534
|
+
var ZodError2 = /* @__PURE__ */ $constructor("ZodError", initializer2);
|
|
23535
|
+
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
|
|
23009
23536
|
Parent: Error
|
|
23010
23537
|
});
|
|
23011
23538
|
|
|
@@ -23024,6 +23551,43 @@ var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
|
23024
23551
|
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
23025
23552
|
|
|
23026
23553
|
// node_modules/zod/v4/classic/schemas.js
|
|
23554
|
+
var _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
23555
|
+
function _installLazyMethods(inst, group, methods) {
|
|
23556
|
+
const proto = Object.getPrototypeOf(inst);
|
|
23557
|
+
let installed = _installedGroups.get(proto);
|
|
23558
|
+
if (!installed) {
|
|
23559
|
+
installed = /* @__PURE__ */ new Set();
|
|
23560
|
+
_installedGroups.set(proto, installed);
|
|
23561
|
+
}
|
|
23562
|
+
if (installed.has(group))
|
|
23563
|
+
return;
|
|
23564
|
+
installed.add(group);
|
|
23565
|
+
for (const key in methods) {
|
|
23566
|
+
const fn = methods[key];
|
|
23567
|
+
Object.defineProperty(proto, key, {
|
|
23568
|
+
configurable: true,
|
|
23569
|
+
enumerable: false,
|
|
23570
|
+
get() {
|
|
23571
|
+
const bound = fn.bind(this);
|
|
23572
|
+
Object.defineProperty(this, key, {
|
|
23573
|
+
configurable: true,
|
|
23574
|
+
writable: true,
|
|
23575
|
+
enumerable: true,
|
|
23576
|
+
value: bound
|
|
23577
|
+
});
|
|
23578
|
+
return bound;
|
|
23579
|
+
},
|
|
23580
|
+
set(v) {
|
|
23581
|
+
Object.defineProperty(this, key, {
|
|
23582
|
+
configurable: true,
|
|
23583
|
+
writable: true,
|
|
23584
|
+
enumerable: true,
|
|
23585
|
+
value: v
|
|
23586
|
+
});
|
|
23587
|
+
}
|
|
23588
|
+
});
|
|
23589
|
+
}
|
|
23590
|
+
}
|
|
23027
23591
|
var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
23028
23592
|
$ZodType.init(inst, def);
|
|
23029
23593
|
Object.assign(inst["~standard"], {
|
|
@@ -23036,23 +23600,6 @@ var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
23036
23600
|
inst.def = def;
|
|
23037
23601
|
inst.type = def.type;
|
|
23038
23602
|
Object.defineProperty(inst, "_def", { value: def });
|
|
23039
|
-
inst.check = (...checks) => {
|
|
23040
|
-
return inst.clone(util_exports.mergeDefs(def, {
|
|
23041
|
-
checks: [
|
|
23042
|
-
...def.checks ?? [],
|
|
23043
|
-
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
23044
|
-
]
|
|
23045
|
-
}), {
|
|
23046
|
-
parent: true
|
|
23047
|
-
});
|
|
23048
|
-
};
|
|
23049
|
-
inst.with = inst.check;
|
|
23050
|
-
inst.clone = (def2, params) => clone(inst, def2, params);
|
|
23051
|
-
inst.brand = () => inst;
|
|
23052
|
-
inst.register = ((reg, meta3) => {
|
|
23053
|
-
reg.add(inst, meta3);
|
|
23054
|
-
return inst;
|
|
23055
|
-
});
|
|
23056
23603
|
inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
|
|
23057
23604
|
inst.safeParse = (data, params) => safeParse3(inst, data, params);
|
|
23058
23605
|
inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
|
|
@@ -23066,45 +23613,108 @@ var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
23066
23613
|
inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
|
|
23067
23614
|
inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
|
|
23068
23615
|
inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
|
|
23069
|
-
inst
|
|
23070
|
-
|
|
23071
|
-
|
|
23072
|
-
|
|
23073
|
-
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
|
|
23077
|
-
|
|
23078
|
-
|
|
23079
|
-
|
|
23080
|
-
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23616
|
+
_installLazyMethods(inst, "ZodType", {
|
|
23617
|
+
check(...chks) {
|
|
23618
|
+
const def2 = this.def;
|
|
23619
|
+
return this.clone(util_exports.mergeDefs(def2, {
|
|
23620
|
+
checks: [
|
|
23621
|
+
...def2.checks ?? [],
|
|
23622
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
23623
|
+
]
|
|
23624
|
+
}), { parent: true });
|
|
23625
|
+
},
|
|
23626
|
+
with(...chks) {
|
|
23627
|
+
return this.check(...chks);
|
|
23628
|
+
},
|
|
23629
|
+
clone(def2, params) {
|
|
23630
|
+
return clone(this, def2, params);
|
|
23631
|
+
},
|
|
23632
|
+
brand() {
|
|
23633
|
+
return this;
|
|
23634
|
+
},
|
|
23635
|
+
register(reg, meta3) {
|
|
23636
|
+
reg.add(this, meta3);
|
|
23637
|
+
return this;
|
|
23638
|
+
},
|
|
23639
|
+
refine(check2, params) {
|
|
23640
|
+
return this.check(refine(check2, params));
|
|
23641
|
+
},
|
|
23642
|
+
superRefine(refinement, params) {
|
|
23643
|
+
return this.check(superRefine(refinement, params));
|
|
23644
|
+
},
|
|
23645
|
+
overwrite(fn) {
|
|
23646
|
+
return this.check(_overwrite(fn));
|
|
23647
|
+
},
|
|
23648
|
+
optional() {
|
|
23649
|
+
return optional(this);
|
|
23650
|
+
},
|
|
23651
|
+
exactOptional() {
|
|
23652
|
+
return exactOptional(this);
|
|
23653
|
+
},
|
|
23654
|
+
nullable() {
|
|
23655
|
+
return nullable(this);
|
|
23656
|
+
},
|
|
23657
|
+
nullish() {
|
|
23658
|
+
return optional(nullable(this));
|
|
23659
|
+
},
|
|
23660
|
+
nonoptional(params) {
|
|
23661
|
+
return nonoptional(this, params);
|
|
23662
|
+
},
|
|
23663
|
+
array() {
|
|
23664
|
+
return array(this);
|
|
23665
|
+
},
|
|
23666
|
+
or(arg) {
|
|
23667
|
+
return union([this, arg]);
|
|
23668
|
+
},
|
|
23669
|
+
and(arg) {
|
|
23670
|
+
return intersection(this, arg);
|
|
23671
|
+
},
|
|
23672
|
+
transform(tx) {
|
|
23673
|
+
return pipe(this, transform(tx));
|
|
23674
|
+
},
|
|
23675
|
+
default(d) {
|
|
23676
|
+
return _default2(this, d);
|
|
23677
|
+
},
|
|
23678
|
+
prefault(d) {
|
|
23679
|
+
return prefault(this, d);
|
|
23680
|
+
},
|
|
23681
|
+
catch(params) {
|
|
23682
|
+
return _catch2(this, params);
|
|
23683
|
+
},
|
|
23684
|
+
pipe(target) {
|
|
23685
|
+
return pipe(this, target);
|
|
23686
|
+
},
|
|
23687
|
+
readonly() {
|
|
23688
|
+
return readonly(this);
|
|
23689
|
+
},
|
|
23690
|
+
describe(description) {
|
|
23691
|
+
const cl = this.clone();
|
|
23692
|
+
globalRegistry.add(cl, { description });
|
|
23693
|
+
return cl;
|
|
23694
|
+
},
|
|
23695
|
+
meta(...args) {
|
|
23696
|
+
if (args.length === 0)
|
|
23697
|
+
return globalRegistry.get(this);
|
|
23698
|
+
const cl = this.clone();
|
|
23699
|
+
globalRegistry.add(cl, args[0]);
|
|
23700
|
+
return cl;
|
|
23701
|
+
},
|
|
23702
|
+
isOptional() {
|
|
23703
|
+
return this.safeParse(void 0).success;
|
|
23704
|
+
},
|
|
23705
|
+
isNullable() {
|
|
23706
|
+
return this.safeParse(null).success;
|
|
23707
|
+
},
|
|
23708
|
+
apply(fn) {
|
|
23709
|
+
return fn(this);
|
|
23710
|
+
}
|
|
23711
|
+
});
|
|
23091
23712
|
Object.defineProperty(inst, "description", {
|
|
23092
23713
|
get() {
|
|
23093
23714
|
return globalRegistry.get(inst)?.description;
|
|
23094
23715
|
},
|
|
23095
23716
|
configurable: true
|
|
23096
23717
|
});
|
|
23097
|
-
inst.meta = (...args) => {
|
|
23098
|
-
if (args.length === 0) {
|
|
23099
|
-
return globalRegistry.get(inst);
|
|
23100
|
-
}
|
|
23101
|
-
const cl = inst.clone();
|
|
23102
|
-
globalRegistry.add(cl, args[0]);
|
|
23103
|
-
return cl;
|
|
23104
|
-
};
|
|
23105
|
-
inst.isOptional = () => inst.safeParse(void 0).success;
|
|
23106
|
-
inst.isNullable = () => inst.safeParse(null).success;
|
|
23107
|
-
inst.apply = (fn) => fn(inst);
|
|
23108
23718
|
return inst;
|
|
23109
23719
|
});
|
|
23110
23720
|
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
@@ -23115,21 +23725,53 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
23115
23725
|
inst.format = bag.format ?? null;
|
|
23116
23726
|
inst.minLength = bag.minimum ?? null;
|
|
23117
23727
|
inst.maxLength = bag.maximum ?? null;
|
|
23118
|
-
inst
|
|
23119
|
-
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23728
|
+
_installLazyMethods(inst, "_ZodString", {
|
|
23729
|
+
regex(...args) {
|
|
23730
|
+
return this.check(_regex(...args));
|
|
23731
|
+
},
|
|
23732
|
+
includes(...args) {
|
|
23733
|
+
return this.check(_includes(...args));
|
|
23734
|
+
},
|
|
23735
|
+
startsWith(...args) {
|
|
23736
|
+
return this.check(_startsWith(...args));
|
|
23737
|
+
},
|
|
23738
|
+
endsWith(...args) {
|
|
23739
|
+
return this.check(_endsWith(...args));
|
|
23740
|
+
},
|
|
23741
|
+
min(...args) {
|
|
23742
|
+
return this.check(_minLength(...args));
|
|
23743
|
+
},
|
|
23744
|
+
max(...args) {
|
|
23745
|
+
return this.check(_maxLength(...args));
|
|
23746
|
+
},
|
|
23747
|
+
length(...args) {
|
|
23748
|
+
return this.check(_length(...args));
|
|
23749
|
+
},
|
|
23750
|
+
nonempty(...args) {
|
|
23751
|
+
return this.check(_minLength(1, ...args));
|
|
23752
|
+
},
|
|
23753
|
+
lowercase(params) {
|
|
23754
|
+
return this.check(_lowercase(params));
|
|
23755
|
+
},
|
|
23756
|
+
uppercase(params) {
|
|
23757
|
+
return this.check(_uppercase(params));
|
|
23758
|
+
},
|
|
23759
|
+
trim() {
|
|
23760
|
+
return this.check(_trim());
|
|
23761
|
+
},
|
|
23762
|
+
normalize(...args) {
|
|
23763
|
+
return this.check(_normalize(...args));
|
|
23764
|
+
},
|
|
23765
|
+
toLowerCase() {
|
|
23766
|
+
return this.check(_toLowerCase());
|
|
23767
|
+
},
|
|
23768
|
+
toUpperCase() {
|
|
23769
|
+
return this.check(_toUpperCase());
|
|
23770
|
+
},
|
|
23771
|
+
slugify() {
|
|
23772
|
+
return this.check(_slugify());
|
|
23773
|
+
}
|
|
23774
|
+
});
|
|
23133
23775
|
});
|
|
23134
23776
|
var ZodString2 = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
23135
23777
|
$ZodString.init(inst, def);
|
|
@@ -23208,7 +23850,7 @@ function url(params) {
|
|
|
23208
23850
|
}
|
|
23209
23851
|
function httpUrl(params) {
|
|
23210
23852
|
return _url(ZodURL, {
|
|
23211
|
-
protocol:
|
|
23853
|
+
protocol: regexes_exports.httpProtocol,
|
|
23212
23854
|
hostname: regexes_exports.domain,
|
|
23213
23855
|
...util_exports.normalizeParams(params)
|
|
23214
23856
|
});
|
|
@@ -23350,21 +23992,53 @@ var ZodNumber2 = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
23350
23992
|
$ZodNumber.init(inst, def);
|
|
23351
23993
|
ZodType2.init(inst, def);
|
|
23352
23994
|
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
23353
|
-
inst
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23995
|
+
_installLazyMethods(inst, "ZodNumber", {
|
|
23996
|
+
gt(value, params) {
|
|
23997
|
+
return this.check(_gt(value, params));
|
|
23998
|
+
},
|
|
23999
|
+
gte(value, params) {
|
|
24000
|
+
return this.check(_gte(value, params));
|
|
24001
|
+
},
|
|
24002
|
+
min(value, params) {
|
|
24003
|
+
return this.check(_gte(value, params));
|
|
24004
|
+
},
|
|
24005
|
+
lt(value, params) {
|
|
24006
|
+
return this.check(_lt(value, params));
|
|
24007
|
+
},
|
|
24008
|
+
lte(value, params) {
|
|
24009
|
+
return this.check(_lte(value, params));
|
|
24010
|
+
},
|
|
24011
|
+
max(value, params) {
|
|
24012
|
+
return this.check(_lte(value, params));
|
|
24013
|
+
},
|
|
24014
|
+
int(params) {
|
|
24015
|
+
return this.check(int(params));
|
|
24016
|
+
},
|
|
24017
|
+
safe(params) {
|
|
24018
|
+
return this.check(int(params));
|
|
24019
|
+
},
|
|
24020
|
+
positive(params) {
|
|
24021
|
+
return this.check(_gt(0, params));
|
|
24022
|
+
},
|
|
24023
|
+
nonnegative(params) {
|
|
24024
|
+
return this.check(_gte(0, params));
|
|
24025
|
+
},
|
|
24026
|
+
negative(params) {
|
|
24027
|
+
return this.check(_lt(0, params));
|
|
24028
|
+
},
|
|
24029
|
+
nonpositive(params) {
|
|
24030
|
+
return this.check(_lte(0, params));
|
|
24031
|
+
},
|
|
24032
|
+
multipleOf(value, params) {
|
|
24033
|
+
return this.check(_multipleOf(value, params));
|
|
24034
|
+
},
|
|
24035
|
+
step(value, params) {
|
|
24036
|
+
return this.check(_multipleOf(value, params));
|
|
24037
|
+
},
|
|
24038
|
+
finite() {
|
|
24039
|
+
return this;
|
|
24040
|
+
}
|
|
24041
|
+
});
|
|
23368
24042
|
const bag = inst._zod.bag;
|
|
23369
24043
|
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
23370
24044
|
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
@@ -23511,11 +24185,23 @@ var ZodArray2 = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
23511
24185
|
ZodType2.init(inst, def);
|
|
23512
24186
|
inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
|
|
23513
24187
|
inst.element = def.element;
|
|
23514
|
-
inst
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
24188
|
+
_installLazyMethods(inst, "ZodArray", {
|
|
24189
|
+
min(n, params) {
|
|
24190
|
+
return this.check(_minLength(n, params));
|
|
24191
|
+
},
|
|
24192
|
+
nonempty(params) {
|
|
24193
|
+
return this.check(_minLength(1, params));
|
|
24194
|
+
},
|
|
24195
|
+
max(n, params) {
|
|
24196
|
+
return this.check(_maxLength(n, params));
|
|
24197
|
+
},
|
|
24198
|
+
length(n, params) {
|
|
24199
|
+
return this.check(_length(n, params));
|
|
24200
|
+
},
|
|
24201
|
+
unwrap() {
|
|
24202
|
+
return this.element;
|
|
24203
|
+
}
|
|
24204
|
+
});
|
|
23519
24205
|
});
|
|
23520
24206
|
function array(element, params) {
|
|
23521
24207
|
return _array(ZodArray2, element, params);
|
|
@@ -23531,23 +24217,47 @@ var ZodObject2 = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
23531
24217
|
util_exports.defineLazy(inst, "shape", () => {
|
|
23532
24218
|
return def.shape;
|
|
23533
24219
|
});
|
|
23534
|
-
inst
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
|
|
23546
|
-
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
|
|
24220
|
+
_installLazyMethods(inst, "ZodObject", {
|
|
24221
|
+
keyof() {
|
|
24222
|
+
return _enum2(Object.keys(this._zod.def.shape));
|
|
24223
|
+
},
|
|
24224
|
+
catchall(catchall) {
|
|
24225
|
+
return this.clone({ ...this._zod.def, catchall });
|
|
24226
|
+
},
|
|
24227
|
+
passthrough() {
|
|
24228
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
24229
|
+
},
|
|
24230
|
+
loose() {
|
|
24231
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
24232
|
+
},
|
|
24233
|
+
strict() {
|
|
24234
|
+
return this.clone({ ...this._zod.def, catchall: never() });
|
|
24235
|
+
},
|
|
24236
|
+
strip() {
|
|
24237
|
+
return this.clone({ ...this._zod.def, catchall: void 0 });
|
|
24238
|
+
},
|
|
24239
|
+
extend(incoming) {
|
|
24240
|
+
return util_exports.extend(this, incoming);
|
|
24241
|
+
},
|
|
24242
|
+
safeExtend(incoming) {
|
|
24243
|
+
return util_exports.safeExtend(this, incoming);
|
|
24244
|
+
},
|
|
24245
|
+
merge(other) {
|
|
24246
|
+
return util_exports.merge(this, other);
|
|
24247
|
+
},
|
|
24248
|
+
pick(mask) {
|
|
24249
|
+
return util_exports.pick(this, mask);
|
|
24250
|
+
},
|
|
24251
|
+
omit(mask) {
|
|
24252
|
+
return util_exports.omit(this, mask);
|
|
24253
|
+
},
|
|
24254
|
+
partial(...args) {
|
|
24255
|
+
return util_exports.partial(ZodOptional2, this, args[0]);
|
|
24256
|
+
},
|
|
24257
|
+
required(...args) {
|
|
24258
|
+
return util_exports.required(ZodNonOptional, this, args[0]);
|
|
24259
|
+
}
|
|
24260
|
+
});
|
|
23551
24261
|
});
|
|
23552
24262
|
function object2(shape, params) {
|
|
23553
24263
|
const def = {
|
|
@@ -23652,6 +24362,14 @@ var ZodRecord2 = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
|
23652
24362
|
inst.valueType = def.valueType;
|
|
23653
24363
|
});
|
|
23654
24364
|
function record(keyType, valueType, params) {
|
|
24365
|
+
if (!valueType || !valueType._zod) {
|
|
24366
|
+
return new ZodRecord2({
|
|
24367
|
+
type: "record",
|
|
24368
|
+
keyType: string2(),
|
|
24369
|
+
valueType: keyType,
|
|
24370
|
+
...util_exports.normalizeParams(valueType)
|
|
24371
|
+
});
|
|
24372
|
+
}
|
|
23655
24373
|
return new ZodRecord2({
|
|
23656
24374
|
type: "record",
|
|
23657
24375
|
keyType,
|
|
@@ -23981,6 +24699,20 @@ function codec(in_, out, params) {
|
|
|
23981
24699
|
reverseTransform: params.encode
|
|
23982
24700
|
});
|
|
23983
24701
|
}
|
|
24702
|
+
function invertCodec(codec2) {
|
|
24703
|
+
const def = codec2._zod.def;
|
|
24704
|
+
return new ZodCodec({
|
|
24705
|
+
type: "pipe",
|
|
24706
|
+
in: def.out,
|
|
24707
|
+
out: def.in,
|
|
24708
|
+
transform: def.reverseTransform,
|
|
24709
|
+
reverseTransform: def.transform
|
|
24710
|
+
});
|
|
24711
|
+
}
|
|
24712
|
+
var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
|
|
24713
|
+
ZodPipe.init(inst, def);
|
|
24714
|
+
$ZodPreprocess.init(inst, def);
|
|
24715
|
+
});
|
|
23984
24716
|
var ZodReadonly2 = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
23985
24717
|
$ZodReadonly.init(inst, def);
|
|
23986
24718
|
ZodType2.init(inst, def);
|
|
@@ -24060,8 +24792,8 @@ function custom(fn, _params) {
|
|
|
24060
24792
|
function refine(fn, _params = {}) {
|
|
24061
24793
|
return _refine(ZodCustom, fn, _params);
|
|
24062
24794
|
}
|
|
24063
|
-
function superRefine(fn) {
|
|
24064
|
-
return _superRefine(fn);
|
|
24795
|
+
function superRefine(fn, params) {
|
|
24796
|
+
return _superRefine(fn, params);
|
|
24065
24797
|
}
|
|
24066
24798
|
var describe2 = describe;
|
|
24067
24799
|
var meta2 = meta;
|
|
@@ -24099,7 +24831,11 @@ function json(params) {
|
|
|
24099
24831
|
return jsonSchema;
|
|
24100
24832
|
}
|
|
24101
24833
|
function preprocess(fn, schema) {
|
|
24102
|
-
return
|
|
24834
|
+
return new ZodPreprocess({
|
|
24835
|
+
type: "pipe",
|
|
24836
|
+
in: transform(fn),
|
|
24837
|
+
out: schema
|
|
24838
|
+
});
|
|
24103
24839
|
}
|
|
24104
24840
|
|
|
24105
24841
|
// node_modules/zod/v4/classic/compat.js
|
|
@@ -24130,7 +24866,7 @@ var ZodFirstPartyTypeKind2;
|
|
|
24130
24866
|
|
|
24131
24867
|
// node_modules/zod/v4/classic/from-json-schema.js
|
|
24132
24868
|
var z = {
|
|
24133
|
-
...
|
|
24869
|
+
...schemas_exports2,
|
|
24134
24870
|
...checks_exports2,
|
|
24135
24871
|
iso: iso_exports2
|
|
24136
24872
|
};
|
|
@@ -24520,12 +25256,6 @@ function convertBaseSchema(schema, ctx) {
|
|
|
24520
25256
|
default:
|
|
24521
25257
|
throw new Error(`Unsupported type: ${type}`);
|
|
24522
25258
|
}
|
|
24523
|
-
if (schema.description) {
|
|
24524
|
-
zodSchema = zodSchema.describe(schema.description);
|
|
24525
|
-
}
|
|
24526
|
-
if (schema.default !== void 0) {
|
|
24527
|
-
zodSchema = zodSchema.default(schema.default);
|
|
24528
|
-
}
|
|
24529
25259
|
return zodSchema;
|
|
24530
25260
|
}
|
|
24531
25261
|
function convertSchema(schema, ctx) {
|
|
@@ -24562,6 +25292,9 @@ function convertSchema(schema, ctx) {
|
|
|
24562
25292
|
if (schema.readOnly === true) {
|
|
24563
25293
|
baseSchema = z.readonly(baseSchema);
|
|
24564
25294
|
}
|
|
25295
|
+
if (schema.default !== void 0) {
|
|
25296
|
+
baseSchema = baseSchema.default(schema.default);
|
|
25297
|
+
}
|
|
24565
25298
|
const extraMeta = {};
|
|
24566
25299
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
24567
25300
|
for (const key of coreMetadataKeys) {
|
|
@@ -24583,23 +25316,32 @@ function convertSchema(schema, ctx) {
|
|
|
24583
25316
|
if (Object.keys(extraMeta).length > 0) {
|
|
24584
25317
|
ctx.registry.add(baseSchema, extraMeta);
|
|
24585
25318
|
}
|
|
25319
|
+
if (schema.description) {
|
|
25320
|
+
baseSchema = baseSchema.describe(schema.description);
|
|
25321
|
+
}
|
|
24586
25322
|
return baseSchema;
|
|
24587
25323
|
}
|
|
24588
25324
|
function fromJSONSchema(schema, params) {
|
|
24589
25325
|
if (typeof schema === "boolean") {
|
|
24590
25326
|
return schema ? z.any() : z.never();
|
|
24591
25327
|
}
|
|
24592
|
-
|
|
24593
|
-
|
|
25328
|
+
let normalized;
|
|
25329
|
+
try {
|
|
25330
|
+
normalized = JSON.parse(JSON.stringify(schema));
|
|
25331
|
+
} catch {
|
|
25332
|
+
throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
|
|
25333
|
+
}
|
|
25334
|
+
const version2 = detectVersion(normalized, params?.defaultTarget);
|
|
25335
|
+
const defs = normalized.$defs || normalized.definitions || {};
|
|
24594
25336
|
const ctx = {
|
|
24595
25337
|
version: version2,
|
|
24596
25338
|
defs,
|
|
24597
25339
|
refs: /* @__PURE__ */ new Map(),
|
|
24598
25340
|
processing: /* @__PURE__ */ new Set(),
|
|
24599
|
-
rootSchema:
|
|
25341
|
+
rootSchema: normalized,
|
|
24600
25342
|
registry: params?.registry ?? globalRegistry
|
|
24601
25343
|
};
|
|
24602
|
-
return convertSchema(
|
|
25344
|
+
return convertSchema(normalized, ctx);
|
|
24603
25345
|
}
|
|
24604
25346
|
|
|
24605
25347
|
// node_modules/zod/v4/classic/coerce.js
|
|
@@ -27546,8 +28288,8 @@ var Protocol = class {
|
|
|
27546
28288
|
resolver(message);
|
|
27547
28289
|
} else {
|
|
27548
28290
|
const errorMessage = message;
|
|
27549
|
-
const
|
|
27550
|
-
resolver(
|
|
28291
|
+
const error51 = new McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data);
|
|
28292
|
+
resolver(error51);
|
|
27551
28293
|
}
|
|
27552
28294
|
} else {
|
|
27553
28295
|
const messageType = queuedMessage.type === "response" ? "Response" : "Error";
|
|
@@ -27591,8 +28333,8 @@ var Protocol = class {
|
|
|
27591
28333
|
nextCursor,
|
|
27592
28334
|
_meta: {}
|
|
27593
28335
|
};
|
|
27594
|
-
} catch (
|
|
27595
|
-
throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${
|
|
28336
|
+
} catch (error51) {
|
|
28337
|
+
throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
27596
28338
|
}
|
|
27597
28339
|
});
|
|
27598
28340
|
this.setRequestHandler(CancelTaskRequestSchema, async (request, extra) => {
|
|
@@ -27614,11 +28356,11 @@ var Protocol = class {
|
|
|
27614
28356
|
_meta: {},
|
|
27615
28357
|
...cancelledTask
|
|
27616
28358
|
};
|
|
27617
|
-
} catch (
|
|
27618
|
-
if (
|
|
27619
|
-
throw
|
|
28359
|
+
} catch (error51) {
|
|
28360
|
+
if (error51 instanceof McpError) {
|
|
28361
|
+
throw error51;
|
|
27620
28362
|
}
|
|
27621
|
-
throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${
|
|
28363
|
+
throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
27622
28364
|
}
|
|
27623
28365
|
});
|
|
27624
28366
|
}
|
|
@@ -27679,9 +28421,9 @@ var Protocol = class {
|
|
|
27679
28421
|
this._onclose();
|
|
27680
28422
|
};
|
|
27681
28423
|
const _onerror = this.transport?.onerror;
|
|
27682
|
-
this._transport.onerror = (
|
|
27683
|
-
_onerror?.(
|
|
27684
|
-
this._onerror(
|
|
28424
|
+
this._transport.onerror = (error51) => {
|
|
28425
|
+
_onerror?.(error51);
|
|
28426
|
+
this._onerror(error51);
|
|
27685
28427
|
};
|
|
27686
28428
|
const _onmessage = this._transport?.onmessage;
|
|
27687
28429
|
this._transport.onmessage = (message, extra) => {
|
|
@@ -27712,22 +28454,22 @@ var Protocol = class {
|
|
|
27712
28454
|
controller.abort();
|
|
27713
28455
|
}
|
|
27714
28456
|
this._requestHandlerAbortControllers.clear();
|
|
27715
|
-
const
|
|
28457
|
+
const error51 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
|
|
27716
28458
|
this._transport = void 0;
|
|
27717
28459
|
this.onclose?.();
|
|
27718
28460
|
for (const handler of responseHandlers.values()) {
|
|
27719
|
-
handler(
|
|
28461
|
+
handler(error51);
|
|
27720
28462
|
}
|
|
27721
28463
|
}
|
|
27722
|
-
_onerror(
|
|
27723
|
-
this.onerror?.(
|
|
28464
|
+
_onerror(error51) {
|
|
28465
|
+
this.onerror?.(error51);
|
|
27724
28466
|
}
|
|
27725
28467
|
_onnotification(notification) {
|
|
27726
28468
|
const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
|
|
27727
28469
|
if (handler === void 0) {
|
|
27728
28470
|
return;
|
|
27729
28471
|
}
|
|
27730
|
-
Promise.resolve().then(() => handler(notification)).catch((
|
|
28472
|
+
Promise.resolve().then(() => handler(notification)).catch((error51) => this._onerror(new Error(`Uncaught error in notification handler: ${error51}`)));
|
|
27731
28473
|
}
|
|
27732
28474
|
_onrequest(request, extra) {
|
|
27733
28475
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
@@ -27747,9 +28489,9 @@ var Protocol = class {
|
|
|
27747
28489
|
type: "error",
|
|
27748
28490
|
message: errorResponse,
|
|
27749
28491
|
timestamp: Date.now()
|
|
27750
|
-
}, capturedTransport?.sessionId).catch((
|
|
28492
|
+
}, capturedTransport?.sessionId).catch((error51) => this._onerror(new Error(`Failed to enqueue error response: ${error51}`)));
|
|
27751
28493
|
} else {
|
|
27752
|
-
capturedTransport?.send(errorResponse).catch((
|
|
28494
|
+
capturedTransport?.send(errorResponse).catch((error51) => this._onerror(new Error(`Failed to send an error response: ${error51}`)));
|
|
27753
28495
|
}
|
|
27754
28496
|
return;
|
|
27755
28497
|
}
|
|
@@ -27815,7 +28557,7 @@ var Protocol = class {
|
|
|
27815
28557
|
} else {
|
|
27816
28558
|
await capturedTransport?.send(response);
|
|
27817
28559
|
}
|
|
27818
|
-
}, async (
|
|
28560
|
+
}, async (error51) => {
|
|
27819
28561
|
if (abortController.signal.aborted) {
|
|
27820
28562
|
return;
|
|
27821
28563
|
}
|
|
@@ -27823,9 +28565,9 @@ var Protocol = class {
|
|
|
27823
28565
|
jsonrpc: "2.0",
|
|
27824
28566
|
id: request.id,
|
|
27825
28567
|
error: {
|
|
27826
|
-
code: Number.isSafeInteger(
|
|
27827
|
-
message:
|
|
27828
|
-
...
|
|
28568
|
+
code: Number.isSafeInteger(error51["code"]) ? error51["code"] : ErrorCode.InternalError,
|
|
28569
|
+
message: error51.message ?? "Internal error",
|
|
28570
|
+
...error51["data"] !== void 0 && { data: error51["data"] }
|
|
27829
28571
|
}
|
|
27830
28572
|
};
|
|
27831
28573
|
if (relatedTaskId && this._taskMessageQueue) {
|
|
@@ -27837,7 +28579,7 @@ var Protocol = class {
|
|
|
27837
28579
|
} else {
|
|
27838
28580
|
await capturedTransport?.send(errorResponse);
|
|
27839
28581
|
}
|
|
27840
|
-
}).catch((
|
|
28582
|
+
}).catch((error51) => this._onerror(new Error(`Failed to send response: ${error51}`))).finally(() => {
|
|
27841
28583
|
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
27842
28584
|
this._requestHandlerAbortControllers.delete(request.id);
|
|
27843
28585
|
}
|
|
@@ -27856,11 +28598,11 @@ var Protocol = class {
|
|
|
27856
28598
|
if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {
|
|
27857
28599
|
try {
|
|
27858
28600
|
this._resetTimeout(messageId);
|
|
27859
|
-
} catch (
|
|
28601
|
+
} catch (error51) {
|
|
27860
28602
|
this._responseHandlers.delete(messageId);
|
|
27861
28603
|
this._progressHandlers.delete(messageId);
|
|
27862
28604
|
this._cleanupTimeout(messageId);
|
|
27863
|
-
responseHandler(
|
|
28605
|
+
responseHandler(error51);
|
|
27864
28606
|
return;
|
|
27865
28607
|
}
|
|
27866
28608
|
}
|
|
@@ -27874,8 +28616,8 @@ var Protocol = class {
|
|
|
27874
28616
|
if (isJSONRPCResultResponse(response)) {
|
|
27875
28617
|
resolver(response);
|
|
27876
28618
|
} else {
|
|
27877
|
-
const
|
|
27878
|
-
resolver(
|
|
28619
|
+
const error51 = new McpError(response.error.code, response.error.message, response.error.data);
|
|
28620
|
+
resolver(error51);
|
|
27879
28621
|
}
|
|
27880
28622
|
return;
|
|
27881
28623
|
}
|
|
@@ -27903,8 +28645,8 @@ var Protocol = class {
|
|
|
27903
28645
|
if (isJSONRPCResultResponse(response)) {
|
|
27904
28646
|
handler(response);
|
|
27905
28647
|
} else {
|
|
27906
|
-
const
|
|
27907
|
-
handler(
|
|
28648
|
+
const error51 = McpError.fromError(response.error.code, response.error.message, response.error.data);
|
|
28649
|
+
handler(error51);
|
|
27908
28650
|
}
|
|
27909
28651
|
}
|
|
27910
28652
|
get transport() {
|
|
@@ -27949,10 +28691,10 @@ var Protocol = class {
|
|
|
27949
28691
|
try {
|
|
27950
28692
|
const result = await this.request(request, resultSchema, options);
|
|
27951
28693
|
yield { type: "result", result };
|
|
27952
|
-
} catch (
|
|
28694
|
+
} catch (error51) {
|
|
27953
28695
|
yield {
|
|
27954
28696
|
type: "error",
|
|
27955
|
-
error:
|
|
28697
|
+
error: error51 instanceof McpError ? error51 : new McpError(ErrorCode.InternalError, String(error51))
|
|
27956
28698
|
};
|
|
27957
28699
|
}
|
|
27958
28700
|
return;
|
|
@@ -27995,10 +28737,10 @@ var Protocol = class {
|
|
|
27995
28737
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
27996
28738
|
options?.signal?.throwIfAborted();
|
|
27997
28739
|
}
|
|
27998
|
-
} catch (
|
|
28740
|
+
} catch (error51) {
|
|
27999
28741
|
yield {
|
|
28000
28742
|
type: "error",
|
|
28001
|
-
error:
|
|
28743
|
+
error: error51 instanceof McpError ? error51 : new McpError(ErrorCode.InternalError, String(error51))
|
|
28002
28744
|
};
|
|
28003
28745
|
}
|
|
28004
28746
|
}
|
|
@@ -28010,8 +28752,8 @@ var Protocol = class {
|
|
|
28010
28752
|
request(request, resultSchema, options) {
|
|
28011
28753
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
28012
28754
|
return new Promise((resolve, reject) => {
|
|
28013
|
-
const earlyReject = (
|
|
28014
|
-
reject(
|
|
28755
|
+
const earlyReject = (error51) => {
|
|
28756
|
+
reject(error51);
|
|
28015
28757
|
};
|
|
28016
28758
|
if (!this._transport) {
|
|
28017
28759
|
earlyReject(new Error("Not connected"));
|
|
@@ -28071,9 +28813,9 @@ var Protocol = class {
|
|
|
28071
28813
|
requestId: messageId,
|
|
28072
28814
|
reason: String(reason)
|
|
28073
28815
|
}
|
|
28074
|
-
}, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((
|
|
28075
|
-
const
|
|
28076
|
-
reject(
|
|
28816
|
+
}, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error52) => this._onerror(new Error(`Failed to send cancellation: ${error52}`)));
|
|
28817
|
+
const error51 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason));
|
|
28818
|
+
reject(error51);
|
|
28077
28819
|
};
|
|
28078
28820
|
this._responseHandlers.set(messageId, (response) => {
|
|
28079
28821
|
if (options?.signal?.aborted) {
|
|
@@ -28089,8 +28831,8 @@ var Protocol = class {
|
|
|
28089
28831
|
} else {
|
|
28090
28832
|
resolve(parseResult.data);
|
|
28091
28833
|
}
|
|
28092
|
-
} catch (
|
|
28093
|
-
reject(
|
|
28834
|
+
} catch (error51) {
|
|
28835
|
+
reject(error51);
|
|
28094
28836
|
}
|
|
28095
28837
|
});
|
|
28096
28838
|
options?.signal?.addEventListener("abort", () => {
|
|
@@ -28114,14 +28856,14 @@ var Protocol = class {
|
|
|
28114
28856
|
type: "request",
|
|
28115
28857
|
message: jsonrpcRequest,
|
|
28116
28858
|
timestamp: Date.now()
|
|
28117
|
-
}).catch((
|
|
28859
|
+
}).catch((error51) => {
|
|
28118
28860
|
this._cleanupTimeout(messageId);
|
|
28119
|
-
reject(
|
|
28861
|
+
reject(error51);
|
|
28120
28862
|
});
|
|
28121
28863
|
} else {
|
|
28122
|
-
this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((
|
|
28864
|
+
this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error51) => {
|
|
28123
28865
|
this._cleanupTimeout(messageId);
|
|
28124
|
-
reject(
|
|
28866
|
+
reject(error51);
|
|
28125
28867
|
});
|
|
28126
28868
|
}
|
|
28127
28869
|
});
|
|
@@ -28214,7 +28956,7 @@ var Protocol = class {
|
|
|
28214
28956
|
}
|
|
28215
28957
|
};
|
|
28216
28958
|
}
|
|
28217
|
-
this._transport?.send(jsonrpcNotification2, options).catch((
|
|
28959
|
+
this._transport?.send(jsonrpcNotification2, options).catch((error51) => this._onerror(error51));
|
|
28218
28960
|
});
|
|
28219
28961
|
return;
|
|
28220
28962
|
}
|
|
@@ -29076,11 +29818,11 @@ var Server = class extends Protocol {
|
|
|
29076
29818
|
if (!validationResult.valid) {
|
|
29077
29819
|
throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);
|
|
29078
29820
|
}
|
|
29079
|
-
} catch (
|
|
29080
|
-
if (
|
|
29081
|
-
throw
|
|
29821
|
+
} catch (error51) {
|
|
29822
|
+
if (error51 instanceof McpError) {
|
|
29823
|
+
throw error51;
|
|
29082
29824
|
}
|
|
29083
|
-
throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${
|
|
29825
|
+
throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
29084
29826
|
}
|
|
29085
29827
|
}
|
|
29086
29828
|
return result;
|
|
@@ -29339,13 +30081,13 @@ var McpServer = class {
|
|
|
29339
30081
|
}
|
|
29340
30082
|
await this.validateToolOutput(tool, result, request.params.name);
|
|
29341
30083
|
return result;
|
|
29342
|
-
} catch (
|
|
29343
|
-
if (
|
|
29344
|
-
if (
|
|
29345
|
-
throw
|
|
30084
|
+
} catch (error51) {
|
|
30085
|
+
if (error51 instanceof McpError) {
|
|
30086
|
+
if (error51.code === ErrorCode.UrlElicitationRequired) {
|
|
30087
|
+
throw error51;
|
|
29346
30088
|
}
|
|
29347
30089
|
}
|
|
29348
|
-
return this.createToolError(
|
|
30090
|
+
return this.createToolError(error51 instanceof Error ? error51.message : String(error51));
|
|
29349
30091
|
}
|
|
29350
30092
|
});
|
|
29351
30093
|
this._toolHandlersInitialized = true;
|
|
@@ -29378,8 +30120,8 @@ var McpServer = class {
|
|
|
29378
30120
|
const schemaToParse = inputObj ?? tool.inputSchema;
|
|
29379
30121
|
const parseResult = await safeParseAsync2(schemaToParse, args);
|
|
29380
30122
|
if (!parseResult.success) {
|
|
29381
|
-
const
|
|
29382
|
-
const errorMessage = getParseErrorMessage(
|
|
30123
|
+
const error51 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
30124
|
+
const errorMessage = getParseErrorMessage(error51);
|
|
29383
30125
|
throw new McpError(ErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${errorMessage}`);
|
|
29384
30126
|
}
|
|
29385
30127
|
return parseResult.data;
|
|
@@ -29403,8 +30145,8 @@ var McpServer = class {
|
|
|
29403
30145
|
const outputObj = normalizeObjectSchema(tool.outputSchema);
|
|
29404
30146
|
const parseResult = await safeParseAsync2(outputObj, result.structuredContent);
|
|
29405
30147
|
if (!parseResult.success) {
|
|
29406
|
-
const
|
|
29407
|
-
const errorMessage = getParseErrorMessage(
|
|
30148
|
+
const error51 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
30149
|
+
const errorMessage = getParseErrorMessage(error51);
|
|
29408
30150
|
throw new McpError(ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`);
|
|
29409
30151
|
}
|
|
29410
30152
|
}
|
|
@@ -29616,8 +30358,8 @@ var McpServer = class {
|
|
|
29616
30358
|
const argsObj = normalizeObjectSchema(prompt.argsSchema);
|
|
29617
30359
|
const parseResult = await safeParseAsync2(argsObj, request.params.arguments);
|
|
29618
30360
|
if (!parseResult.success) {
|
|
29619
|
-
const
|
|
29620
|
-
const errorMessage = getParseErrorMessage(
|
|
30361
|
+
const error51 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
30362
|
+
const errorMessage = getParseErrorMessage(error51);
|
|
29621
30363
|
throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${errorMessage}`);
|
|
29622
30364
|
}
|
|
29623
30365
|
const args = parseResult.data;
|
|
@@ -30063,8 +30805,8 @@ var StdioServerTransport = class {
|
|
|
30063
30805
|
this._readBuffer.append(chunk);
|
|
30064
30806
|
this.processReadBuffer();
|
|
30065
30807
|
};
|
|
30066
|
-
this._onerror = (
|
|
30067
|
-
this.onerror?.(
|
|
30808
|
+
this._onerror = (error51) => {
|
|
30809
|
+
this.onerror?.(error51);
|
|
30068
30810
|
};
|
|
30069
30811
|
}
|
|
30070
30812
|
/**
|
|
@@ -30086,8 +30828,8 @@ var StdioServerTransport = class {
|
|
|
30086
30828
|
break;
|
|
30087
30829
|
}
|
|
30088
30830
|
this.onmessage?.(message);
|
|
30089
|
-
} catch (
|
|
30090
|
-
this.onerror?.(
|
|
30831
|
+
} catch (error51) {
|
|
30832
|
+
this.onerror?.(error51);
|
|
30091
30833
|
}
|
|
30092
30834
|
}
|
|
30093
30835
|
}
|
|
@@ -30119,9 +30861,18 @@ import { fileURLToPath } from "url";
|
|
|
30119
30861
|
try {
|
|
30120
30862
|
const { config: config2 } = await import("dotenv");
|
|
30121
30863
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
30122
|
-
config2({ path: join(__dirname, "..", ".env"), override: false });
|
|
30864
|
+
config2({ path: join(__dirname, "..", ".env"), override: false, quiet: true });
|
|
30123
30865
|
} catch {
|
|
30124
30866
|
}
|
|
30867
|
+
function readVar(key) {
|
|
30868
|
+
const raw = process.env[key];
|
|
30869
|
+
if (typeof raw !== "string") return void 0;
|
|
30870
|
+
const trimmed = raw.trim();
|
|
30871
|
+
if (trimmed.length === 0) return void 0;
|
|
30872
|
+
if (trimmed === "undefined" || trimmed === "null") return void 0;
|
|
30873
|
+
if (/^\$\{[^}]*\}$/.test(trimmed)) return void 0;
|
|
30874
|
+
return trimmed;
|
|
30875
|
+
}
|
|
30125
30876
|
var BASE_URL = "https://ofw.ourfamilywizard.com";
|
|
30126
30877
|
var STATIC_HEADERS = {
|
|
30127
30878
|
"ofw-client": "WebApplication",
|
|
@@ -30176,8 +30927,8 @@ var OFWClient = class {
|
|
|
30176
30927
|
await this.login();
|
|
30177
30928
|
}
|
|
30178
30929
|
async login() {
|
|
30179
|
-
const username =
|
|
30180
|
-
const password =
|
|
30930
|
+
const username = readVar("OFW_USERNAME");
|
|
30931
|
+
const password = readVar("OFW_PASSWORD");
|
|
30181
30932
|
if (!username || !password) {
|
|
30182
30933
|
throw new Error("OFW_USERNAME and OFW_PASSWORD must be set");
|
|
30183
30934
|
}
|
|
@@ -30238,6 +30989,382 @@ function registerUserTools(server2, client2) {
|
|
|
30238
30989
|
});
|
|
30239
30990
|
}
|
|
30240
30991
|
|
|
30992
|
+
// src/cache.ts
|
|
30993
|
+
import { DatabaseSync } from "node:sqlite";
|
|
30994
|
+
import { mkdirSync } from "node:fs";
|
|
30995
|
+
import { dirname as dirname2 } from "node:path";
|
|
30996
|
+
|
|
30997
|
+
// src/config.ts
|
|
30998
|
+
import { createHash } from "node:crypto";
|
|
30999
|
+
import { homedir } from "node:os";
|
|
31000
|
+
import { join as join2 } from "node:path";
|
|
31001
|
+
function readUsername() {
|
|
31002
|
+
const raw = process.env.OFW_USERNAME;
|
|
31003
|
+
if (typeof raw !== "string" || raw.trim().length === 0) {
|
|
31004
|
+
throw new Error("OFW_USERNAME must be set to derive cache path");
|
|
31005
|
+
}
|
|
31006
|
+
return raw.trim();
|
|
31007
|
+
}
|
|
31008
|
+
function getCacheDir() {
|
|
31009
|
+
const override = process.env.OFW_CACHE_DIR;
|
|
31010
|
+
if (override && override.trim().length > 0) return override.trim();
|
|
31011
|
+
return join2(homedir(), ".cache", "ofw-mcp");
|
|
31012
|
+
}
|
|
31013
|
+
function getCacheDbPath() {
|
|
31014
|
+
const username = readUsername();
|
|
31015
|
+
const hash2 = createHash("sha256").update(username).digest("hex").slice(0, 16);
|
|
31016
|
+
return join2(getCacheDir(), `${hash2}.db`);
|
|
31017
|
+
}
|
|
31018
|
+
|
|
31019
|
+
// src/cache.ts
|
|
31020
|
+
var instance = null;
|
|
31021
|
+
var SCHEMA_V1 = `
|
|
31022
|
+
CREATE TABLE IF NOT EXISTS messages (
|
|
31023
|
+
id INTEGER PRIMARY KEY,
|
|
31024
|
+
folder TEXT NOT NULL,
|
|
31025
|
+
subject TEXT NOT NULL,
|
|
31026
|
+
from_user TEXT NOT NULL,
|
|
31027
|
+
sent_at TEXT NOT NULL,
|
|
31028
|
+
recipients_json TEXT NOT NULL,
|
|
31029
|
+
body TEXT,
|
|
31030
|
+
fetched_body_at TEXT,
|
|
31031
|
+
reply_to_id INTEGER,
|
|
31032
|
+
chain_root_id INTEGER,
|
|
31033
|
+
list_data_json TEXT NOT NULL,
|
|
31034
|
+
last_seen_at TEXT NOT NULL
|
|
31035
|
+
);
|
|
31036
|
+
CREATE INDEX IF NOT EXISTS idx_messages_folder_sent_at ON messages(folder, sent_at DESC);
|
|
31037
|
+
CREATE INDEX IF NOT EXISTS idx_messages_chain_root ON messages(chain_root_id);
|
|
31038
|
+
|
|
31039
|
+
CREATE TABLE IF NOT EXISTS drafts (
|
|
31040
|
+
id INTEGER PRIMARY KEY,
|
|
31041
|
+
subject TEXT NOT NULL,
|
|
31042
|
+
body TEXT NOT NULL,
|
|
31043
|
+
recipients_json TEXT NOT NULL,
|
|
31044
|
+
reply_to_id INTEGER,
|
|
31045
|
+
modified_at TEXT NOT NULL,
|
|
31046
|
+
list_data_json TEXT NOT NULL
|
|
31047
|
+
);
|
|
31048
|
+
|
|
31049
|
+
CREATE TABLE IF NOT EXISTS sync_state (
|
|
31050
|
+
folder TEXT PRIMARY KEY,
|
|
31051
|
+
last_sync_at TEXT NOT NULL,
|
|
31052
|
+
newest_id INTEGER
|
|
31053
|
+
);
|
|
31054
|
+
|
|
31055
|
+
CREATE TABLE IF NOT EXISTS meta (
|
|
31056
|
+
key TEXT PRIMARY KEY,
|
|
31057
|
+
value TEXT NOT NULL
|
|
31058
|
+
);
|
|
31059
|
+
`;
|
|
31060
|
+
function migrate(db) {
|
|
31061
|
+
db.exec(SCHEMA_V1);
|
|
31062
|
+
db.prepare("INSERT OR IGNORE INTO meta(key, value) VALUES(?, ?)").run("schema_version", "1");
|
|
31063
|
+
}
|
|
31064
|
+
function openCache() {
|
|
31065
|
+
if (instance) return instance;
|
|
31066
|
+
const path = getCacheDbPath();
|
|
31067
|
+
mkdirSync(dirname2(path), { recursive: true });
|
|
31068
|
+
const db = new DatabaseSync(path);
|
|
31069
|
+
db.exec("PRAGMA journal_mode = WAL");
|
|
31070
|
+
db.exec("PRAGMA foreign_keys = ON");
|
|
31071
|
+
migrate(db);
|
|
31072
|
+
instance = { db };
|
|
31073
|
+
return instance;
|
|
31074
|
+
}
|
|
31075
|
+
function rowFromDb(r) {
|
|
31076
|
+
return {
|
|
31077
|
+
id: r.id,
|
|
31078
|
+
folder: r.folder,
|
|
31079
|
+
subject: r.subject,
|
|
31080
|
+
fromUser: r.from_user,
|
|
31081
|
+
sentAt: r.sent_at,
|
|
31082
|
+
recipients: JSON.parse(r.recipients_json),
|
|
31083
|
+
body: r.body,
|
|
31084
|
+
fetchedBodyAt: r.fetched_body_at,
|
|
31085
|
+
replyToId: r.reply_to_id,
|
|
31086
|
+
chainRootId: r.chain_root_id,
|
|
31087
|
+
listData: JSON.parse(r.list_data_json)
|
|
31088
|
+
};
|
|
31089
|
+
}
|
|
31090
|
+
function upsertMessage(row) {
|
|
31091
|
+
const { db } = openCache();
|
|
31092
|
+
db.prepare(
|
|
31093
|
+
`INSERT INTO messages (
|
|
31094
|
+
id, folder, subject, from_user, sent_at, recipients_json,
|
|
31095
|
+
body, fetched_body_at, reply_to_id, chain_root_id, list_data_json, last_seen_at
|
|
31096
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
31097
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
31098
|
+
folder=excluded.folder,
|
|
31099
|
+
subject=excluded.subject,
|
|
31100
|
+
from_user=excluded.from_user,
|
|
31101
|
+
sent_at=excluded.sent_at,
|
|
31102
|
+
recipients_json=excluded.recipients_json,
|
|
31103
|
+
body=excluded.body,
|
|
31104
|
+
fetched_body_at=excluded.fetched_body_at,
|
|
31105
|
+
reply_to_id=excluded.reply_to_id,
|
|
31106
|
+
chain_root_id=excluded.chain_root_id,
|
|
31107
|
+
list_data_json=excluded.list_data_json,
|
|
31108
|
+
last_seen_at=excluded.last_seen_at`
|
|
31109
|
+
).run(
|
|
31110
|
+
row.id,
|
|
31111
|
+
row.folder,
|
|
31112
|
+
row.subject,
|
|
31113
|
+
row.fromUser,
|
|
31114
|
+
row.sentAt,
|
|
31115
|
+
JSON.stringify(row.recipients),
|
|
31116
|
+
row.body,
|
|
31117
|
+
row.fetchedBodyAt,
|
|
31118
|
+
row.replyToId,
|
|
31119
|
+
row.chainRootId,
|
|
31120
|
+
JSON.stringify(row.listData),
|
|
31121
|
+
(/* @__PURE__ */ new Date()).toISOString()
|
|
31122
|
+
);
|
|
31123
|
+
}
|
|
31124
|
+
function getMessage(id) {
|
|
31125
|
+
const { db } = openCache();
|
|
31126
|
+
const r = db.prepare("SELECT * FROM messages WHERE id = ?").get(id);
|
|
31127
|
+
return r ? rowFromDb(r) : null;
|
|
31128
|
+
}
|
|
31129
|
+
function listMessages(opts) {
|
|
31130
|
+
const { db } = openCache();
|
|
31131
|
+
const offset = (opts.page - 1) * opts.size;
|
|
31132
|
+
const rows = db.prepare(
|
|
31133
|
+
`SELECT * FROM messages WHERE folder = ?
|
|
31134
|
+
ORDER BY sent_at DESC, id DESC
|
|
31135
|
+
LIMIT ? OFFSET ?`
|
|
31136
|
+
).all(opts.folder, opts.size, offset);
|
|
31137
|
+
return rows.map(rowFromDb);
|
|
31138
|
+
}
|
|
31139
|
+
function draftFromDb(r) {
|
|
31140
|
+
return {
|
|
31141
|
+
id: r.id,
|
|
31142
|
+
subject: r.subject,
|
|
31143
|
+
body: r.body,
|
|
31144
|
+
recipients: JSON.parse(r.recipients_json),
|
|
31145
|
+
replyToId: r.reply_to_id,
|
|
31146
|
+
modifiedAt: r.modified_at,
|
|
31147
|
+
listData: JSON.parse(r.list_data_json)
|
|
31148
|
+
};
|
|
31149
|
+
}
|
|
31150
|
+
function upsertDraft(row) {
|
|
31151
|
+
const { db } = openCache();
|
|
31152
|
+
db.prepare(
|
|
31153
|
+
`INSERT INTO drafts (id, subject, body, recipients_json, reply_to_id, modified_at, list_data_json)
|
|
31154
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
31155
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
31156
|
+
subject=excluded.subject,
|
|
31157
|
+
body=excluded.body,
|
|
31158
|
+
recipients_json=excluded.recipients_json,
|
|
31159
|
+
reply_to_id=excluded.reply_to_id,
|
|
31160
|
+
modified_at=excluded.modified_at,
|
|
31161
|
+
list_data_json=excluded.list_data_json`
|
|
31162
|
+
).run(
|
|
31163
|
+
row.id,
|
|
31164
|
+
row.subject,
|
|
31165
|
+
row.body,
|
|
31166
|
+
JSON.stringify(row.recipients),
|
|
31167
|
+
row.replyToId,
|
|
31168
|
+
row.modifiedAt,
|
|
31169
|
+
JSON.stringify(row.listData)
|
|
31170
|
+
);
|
|
31171
|
+
}
|
|
31172
|
+
function getDraft(id) {
|
|
31173
|
+
const { db } = openCache();
|
|
31174
|
+
const r = db.prepare("SELECT * FROM drafts WHERE id = ?").get(id);
|
|
31175
|
+
return r ? draftFromDb(r) : null;
|
|
31176
|
+
}
|
|
31177
|
+
function listDrafts(opts) {
|
|
31178
|
+
const { db } = openCache();
|
|
31179
|
+
const offset = (opts.page - 1) * opts.size;
|
|
31180
|
+
const rows = db.prepare(
|
|
31181
|
+
"SELECT * FROM drafts ORDER BY modified_at DESC, id DESC LIMIT ? OFFSET ?"
|
|
31182
|
+
).all(opts.size, offset);
|
|
31183
|
+
return rows.map(draftFromDb);
|
|
31184
|
+
}
|
|
31185
|
+
function deleteDraft(id) {
|
|
31186
|
+
const { db } = openCache();
|
|
31187
|
+
db.prepare("DELETE FROM drafts WHERE id = ?").run(id);
|
|
31188
|
+
}
|
|
31189
|
+
function listDraftIds() {
|
|
31190
|
+
const { db } = openCache();
|
|
31191
|
+
const rows = db.prepare("SELECT id FROM drafts").all();
|
|
31192
|
+
return rows.map((r) => r.id);
|
|
31193
|
+
}
|
|
31194
|
+
function setSyncState(folder, state) {
|
|
31195
|
+
const { db } = openCache();
|
|
31196
|
+
db.prepare(
|
|
31197
|
+
`INSERT INTO sync_state (folder, last_sync_at, newest_id) VALUES (?, ?, ?)
|
|
31198
|
+
ON CONFLICT(folder) DO UPDATE SET
|
|
31199
|
+
last_sync_at = excluded.last_sync_at,
|
|
31200
|
+
newest_id = excluded.newest_id`
|
|
31201
|
+
).run(folder, state.lastSyncAt, state.newestId);
|
|
31202
|
+
}
|
|
31203
|
+
function setMeta(key, value) {
|
|
31204
|
+
const { db } = openCache();
|
|
31205
|
+
db.prepare(
|
|
31206
|
+
"INSERT INTO meta (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value"
|
|
31207
|
+
).run(key, value);
|
|
31208
|
+
}
|
|
31209
|
+
function findLatestReplyTip(replyToId) {
|
|
31210
|
+
const { db } = openCache();
|
|
31211
|
+
const parent = db.prepare(
|
|
31212
|
+
"SELECT id, folder, chain_root_id FROM messages WHERE id = ?"
|
|
31213
|
+
).get(replyToId);
|
|
31214
|
+
if (!parent) return replyToId;
|
|
31215
|
+
const chainRoot = parent.chain_root_id ?? parent.id;
|
|
31216
|
+
const tip = db.prepare(
|
|
31217
|
+
`SELECT id FROM messages
|
|
31218
|
+
WHERE folder = 'sent' AND chain_root_id = ?
|
|
31219
|
+
ORDER BY id DESC LIMIT 1`
|
|
31220
|
+
).get(chainRoot);
|
|
31221
|
+
return tip ? tip.id : replyToId;
|
|
31222
|
+
}
|
|
31223
|
+
|
|
31224
|
+
// src/sync.ts
|
|
31225
|
+
async function resolveFolderIds(client2) {
|
|
31226
|
+
const data = await client2.request(
|
|
31227
|
+
"GET",
|
|
31228
|
+
"/pub/v1/messageFolders?includeFolderCounts=true"
|
|
31229
|
+
);
|
|
31230
|
+
const sys = data.systemFolders ?? [];
|
|
31231
|
+
const find = (type) => {
|
|
31232
|
+
const f = sys.find((x) => x.folderType === type);
|
|
31233
|
+
if (!f) throw new Error(`OFW system folder not found: ${type}`);
|
|
31234
|
+
return f.id;
|
|
31235
|
+
};
|
|
31236
|
+
const ids = {
|
|
31237
|
+
inbox: find("INBOX"),
|
|
31238
|
+
sent: find("SENT_MESSAGES"),
|
|
31239
|
+
drafts: find("DRAFTS")
|
|
31240
|
+
};
|
|
31241
|
+
setMeta("drafts_folder_id", ids.drafts);
|
|
31242
|
+
return ids;
|
|
31243
|
+
}
|
|
31244
|
+
function recipientsFromList(item) {
|
|
31245
|
+
return (item.recipients ?? []).map((r) => ({
|
|
31246
|
+
userId: r.user.id,
|
|
31247
|
+
name: r.user.name,
|
|
31248
|
+
viewedAt: r.viewed?.dateTime ?? null
|
|
31249
|
+
}));
|
|
31250
|
+
}
|
|
31251
|
+
async function syncMessageFolder(client2, folder, folderId, opts) {
|
|
31252
|
+
let page = 1;
|
|
31253
|
+
let synced = 0;
|
|
31254
|
+
let newestId = null;
|
|
31255
|
+
const unread = [];
|
|
31256
|
+
while (true) {
|
|
31257
|
+
const path = `/pub/v3/messages?folders=${encodeURIComponent(folderId)}&page=${page}&size=50&sort=date&sortDirection=desc`;
|
|
31258
|
+
const list = await client2.request("GET", path);
|
|
31259
|
+
const items = list.data ?? [];
|
|
31260
|
+
if (items.length === 0) break;
|
|
31261
|
+
let pageSawKnownItem = false;
|
|
31262
|
+
for (const item of items) {
|
|
31263
|
+
if (newestId === null || item.id > newestId) newestId = item.id;
|
|
31264
|
+
const existing = getMessage(item.id);
|
|
31265
|
+
if (existing) {
|
|
31266
|
+
pageSawKnownItem = true;
|
|
31267
|
+
continue;
|
|
31268
|
+
}
|
|
31269
|
+
const isInboxUnread = folder === "inbox" && item.showNeverViewed === true;
|
|
31270
|
+
const shouldFetchBody = !isInboxUnread || opts.fetchUnreadBodies;
|
|
31271
|
+
let body = null;
|
|
31272
|
+
let fetchedBodyAt = null;
|
|
31273
|
+
if (shouldFetchBody) {
|
|
31274
|
+
const detail = await client2.request("GET", `/pub/v3/messages/${item.id}`);
|
|
31275
|
+
body = detail.body ?? "";
|
|
31276
|
+
fetchedBodyAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
31277
|
+
} else {
|
|
31278
|
+
unread.push({
|
|
31279
|
+
id: item.id,
|
|
31280
|
+
subject: item.subject,
|
|
31281
|
+
from: item.from?.name ?? "",
|
|
31282
|
+
sentAt: item.date.dateTime
|
|
31283
|
+
});
|
|
31284
|
+
}
|
|
31285
|
+
const row = {
|
|
31286
|
+
id: item.id,
|
|
31287
|
+
folder,
|
|
31288
|
+
subject: item.subject,
|
|
31289
|
+
fromUser: item.from?.name ?? "",
|
|
31290
|
+
sentAt: item.date.dateTime,
|
|
31291
|
+
recipients: recipientsFromList(item),
|
|
31292
|
+
body,
|
|
31293
|
+
fetchedBodyAt,
|
|
31294
|
+
replyToId: null,
|
|
31295
|
+
chainRootId: null,
|
|
31296
|
+
listData: item
|
|
31297
|
+
};
|
|
31298
|
+
upsertMessage(row);
|
|
31299
|
+
synced++;
|
|
31300
|
+
}
|
|
31301
|
+
if (pageSawKnownItem) break;
|
|
31302
|
+
page++;
|
|
31303
|
+
}
|
|
31304
|
+
setSyncState(folder, {
|
|
31305
|
+
lastSyncAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31306
|
+
newestId
|
|
31307
|
+
});
|
|
31308
|
+
return { synced, unread };
|
|
31309
|
+
}
|
|
31310
|
+
async function syncDrafts(client2, draftsFolderId) {
|
|
31311
|
+
const path = `/pub/v3/messages?folders=${encodeURIComponent(draftsFolderId)}&page=1&size=50&sort=date&sortDirection=desc`;
|
|
31312
|
+
const list = await client2.request("GET", path);
|
|
31313
|
+
const items = list.data ?? [];
|
|
31314
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
31315
|
+
let synced = 0;
|
|
31316
|
+
for (const item of items) {
|
|
31317
|
+
seenIds.add(item.id);
|
|
31318
|
+
const existing = getDraft(item.id);
|
|
31319
|
+
if (existing && existing.modifiedAt === item.date.dateTime) {
|
|
31320
|
+
continue;
|
|
31321
|
+
}
|
|
31322
|
+
const detail = await client2.request("GET", `/pub/v3/messages/${item.id}`);
|
|
31323
|
+
const row = {
|
|
31324
|
+
id: item.id,
|
|
31325
|
+
subject: detail.subject ?? item.subject,
|
|
31326
|
+
body: detail.body ?? "",
|
|
31327
|
+
recipients: (item.recipients ?? []).map((r) => ({
|
|
31328
|
+
userId: r.user.id,
|
|
31329
|
+
name: r.user.name,
|
|
31330
|
+
viewedAt: r.viewed?.dateTime ?? null
|
|
31331
|
+
})),
|
|
31332
|
+
replyToId: item.replyToId,
|
|
31333
|
+
modifiedAt: item.date.dateTime,
|
|
31334
|
+
listData: item
|
|
31335
|
+
};
|
|
31336
|
+
upsertDraft(row);
|
|
31337
|
+
synced++;
|
|
31338
|
+
}
|
|
31339
|
+
for (const id of listDraftIds()) {
|
|
31340
|
+
if (!seenIds.has(id)) deleteDraft(id);
|
|
31341
|
+
}
|
|
31342
|
+
return { synced };
|
|
31343
|
+
}
|
|
31344
|
+
async function syncAll(client2, opts) {
|
|
31345
|
+
const folders = opts.folders ?? ["inbox", "sent", "drafts"];
|
|
31346
|
+
const ids = await resolveFolderIds(client2);
|
|
31347
|
+
const synced = {};
|
|
31348
|
+
let unreadInbox = [];
|
|
31349
|
+
for (const folder of folders) {
|
|
31350
|
+
if (folder === "inbox") {
|
|
31351
|
+
const r = await syncMessageFolder(client2, "inbox", ids.inbox, {
|
|
31352
|
+
fetchUnreadBodies: opts.fetchUnreadBodies ?? false
|
|
31353
|
+
});
|
|
31354
|
+
synced.inbox = r.synced;
|
|
31355
|
+
unreadInbox = r.unread;
|
|
31356
|
+
} else if (folder === "sent") {
|
|
31357
|
+
const r = await syncMessageFolder(client2, "sent", ids.sent, { fetchUnreadBodies: false });
|
|
31358
|
+
synced.sent = r.synced;
|
|
31359
|
+
} else if (folder === "drafts") {
|
|
31360
|
+
const r = await syncDrafts(client2, ids.drafts);
|
|
31361
|
+
synced.drafts = r.synced;
|
|
31362
|
+
}
|
|
31363
|
+
}
|
|
31364
|
+
const note = unreadInbox.length > 0 ? `${unreadInbox.length} unread inbox messages cached without bodies. Call ofw_get_message(id) to read them \u2014 this will mark them as read on OFW.` : void 0;
|
|
31365
|
+
return { synced, unreadInbox, ...note ? { note } : {} };
|
|
31366
|
+
}
|
|
31367
|
+
|
|
30241
31368
|
// src/tools/messages.ts
|
|
30242
31369
|
function registerMessageTools(server2, client2) {
|
|
30243
31370
|
server2.registerTool("ofw_list_message_folders", {
|
|
@@ -30248,146 +31375,258 @@ function registerMessageTools(server2, client2) {
|
|
|
30248
31375
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
30249
31376
|
});
|
|
30250
31377
|
server2.registerTool("ofw_list_messages", {
|
|
30251
|
-
description:
|
|
31378
|
+
description: 'List messages from the local OurFamilyWizard cache. folderId accepts "inbox" or "sent". Call ofw_sync_messages first if the cache is empty or stale.',
|
|
30252
31379
|
annotations: { readOnlyHint: true },
|
|
30253
31380
|
inputSchema: {
|
|
30254
|
-
folderId:
|
|
30255
|
-
page:
|
|
30256
|
-
size:
|
|
31381
|
+
folderId: external_exports.string().describe('Folder name: "inbox" or "sent"'),
|
|
31382
|
+
page: external_exports.number().describe("Page number (default 1)").optional(),
|
|
31383
|
+
size: external_exports.number().describe("Messages per page (default 50)").optional()
|
|
30257
31384
|
}
|
|
30258
31385
|
}, async (args) => {
|
|
30259
31386
|
const page = args.page ?? 1;
|
|
30260
31387
|
const size = args.size ?? 50;
|
|
30261
|
-
|
|
30262
|
-
|
|
30263
|
-
|
|
31388
|
+
let folder = null;
|
|
31389
|
+
if (args.folderId === "inbox") folder = "inbox";
|
|
31390
|
+
else if (args.folderId === "sent") folder = "sent";
|
|
31391
|
+
else {
|
|
31392
|
+
return {
|
|
31393
|
+
content: [{
|
|
31394
|
+
type: "text",
|
|
31395
|
+
text: JSON.stringify({
|
|
31396
|
+
messages: [],
|
|
31397
|
+
note: 'Cache is keyed by folder name. Pass folderId: "inbox" or "sent" (numeric folder IDs are not yet supported by the cache layer).'
|
|
31398
|
+
}, null, 2)
|
|
31399
|
+
}]
|
|
31400
|
+
};
|
|
31401
|
+
}
|
|
31402
|
+
const messages = listMessages({ folder, page, size });
|
|
31403
|
+
const payload = messages.length === 0 ? { messages: [], note: "Cache empty for this folder. Call ofw_sync_messages to populate." } : { messages };
|
|
31404
|
+
return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
|
|
30264
31405
|
});
|
|
30265
31406
|
server2.registerTool("ofw_get_message", {
|
|
30266
|
-
description: "Get a single OurFamilyWizard message by ID.
|
|
31407
|
+
description: "Get a single OurFamilyWizard message by ID. Reads from local cache when available; otherwise fetches from OFW (which will mark unread inbox messages as read on OFW).",
|
|
30267
31408
|
annotations: { readOnlyHint: false },
|
|
30268
31409
|
inputSchema: {
|
|
30269
|
-
messageId:
|
|
31410
|
+
messageId: external_exports.string().describe("Message ID")
|
|
30270
31411
|
}
|
|
30271
31412
|
}, async (args) => {
|
|
30272
|
-
const
|
|
30273
|
-
|
|
31413
|
+
const id = Number(args.messageId);
|
|
31414
|
+
const cached2 = getMessage(id);
|
|
31415
|
+
if (cached2 && cached2.body !== null) {
|
|
31416
|
+
return { content: [{ type: "text", text: JSON.stringify(cached2, null, 2) }] };
|
|
31417
|
+
}
|
|
31418
|
+
const detail = await client2.request("GET", `/pub/v3/messages/${encodeURIComponent(args.messageId)}`);
|
|
31419
|
+
const recipients = (detail.recipients ?? []).map((r) => ({
|
|
31420
|
+
userId: r.user.id,
|
|
31421
|
+
name: r.user.name,
|
|
31422
|
+
viewedAt: r.viewed?.dateTime ?? null
|
|
31423
|
+
}));
|
|
31424
|
+
const folder = cached2?.folder ?? "inbox";
|
|
31425
|
+
const row = {
|
|
31426
|
+
id: detail.id,
|
|
31427
|
+
folder,
|
|
31428
|
+
subject: detail.subject,
|
|
31429
|
+
fromUser: detail.from?.name ?? "",
|
|
31430
|
+
sentAt: detail.date.dateTime,
|
|
31431
|
+
recipients,
|
|
31432
|
+
body: detail.body ?? "",
|
|
31433
|
+
fetchedBodyAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31434
|
+
replyToId: cached2?.replyToId ?? null,
|
|
31435
|
+
chainRootId: cached2?.chainRootId ?? null,
|
|
31436
|
+
listData: cached2?.listData ?? detail
|
|
31437
|
+
};
|
|
31438
|
+
upsertMessage(row);
|
|
31439
|
+
return { content: [{ type: "text", text: JSON.stringify(row, null, 2) }] };
|
|
30274
31440
|
});
|
|
30275
31441
|
server2.registerTool("ofw_send_message", {
|
|
30276
|
-
description: "Send a message via OurFamilyWizard. If sending from a draft, pass draftId to
|
|
31442
|
+
description: "Send a message via OurFamilyWizard. If sending from a draft, pass draftId to delete the draft after sending. If replyToId is provided, the cache may rewrite it to the latest reply in the same thread (a note is included in the response when this happens).",
|
|
30277
31443
|
annotations: { destructiveHint: true },
|
|
30278
31444
|
inputSchema: {
|
|
30279
|
-
subject:
|
|
30280
|
-
body:
|
|
30281
|
-
recipientIds:
|
|
30282
|
-
replyToId:
|
|
30283
|
-
draftId:
|
|
31445
|
+
subject: external_exports.string().describe("Message subject"),
|
|
31446
|
+
body: external_exports.string().describe("Message body text"),
|
|
31447
|
+
recipientIds: external_exports.array(external_exports.number()).describe("Array of recipient user IDs (get from ofw_get_profile)"),
|
|
31448
|
+
replyToId: external_exports.number().describe("ID of the message being replied to").optional(),
|
|
31449
|
+
draftId: external_exports.number().describe("ID of the draft to delete after sending (omit if not sending from a draft)").optional()
|
|
30284
31450
|
}
|
|
30285
31451
|
}, async (args) => {
|
|
30286
|
-
const
|
|
31452
|
+
const requestedReplyTo = args.replyToId ?? null;
|
|
31453
|
+
let resolvedReplyTo = requestedReplyTo;
|
|
31454
|
+
let chainRootId = null;
|
|
31455
|
+
let rewriteNote = null;
|
|
31456
|
+
if (requestedReplyTo !== null) {
|
|
31457
|
+
resolvedReplyTo = findLatestReplyTip(requestedReplyTo);
|
|
31458
|
+
if (resolvedReplyTo !== requestedReplyTo) {
|
|
31459
|
+
rewriteNote = `replyToId rewritten from ${requestedReplyTo} to ${resolvedReplyTo} (later reply in same thread found in sent cache).`;
|
|
31460
|
+
}
|
|
31461
|
+
const parent = getMessage(resolvedReplyTo);
|
|
31462
|
+
chainRootId = parent?.chainRootId ?? parent?.id ?? requestedReplyTo;
|
|
31463
|
+
}
|
|
30287
31464
|
const data = await client2.request("POST", "/pub/v3/messages", {
|
|
30288
31465
|
subject: args.subject,
|
|
30289
31466
|
body: args.body,
|
|
30290
31467
|
recipientIds: args.recipientIds,
|
|
30291
31468
|
attachments: { myFileIDs: [] },
|
|
30292
31469
|
draft: false,
|
|
30293
|
-
includeOriginal:
|
|
30294
|
-
replyToId
|
|
31470
|
+
includeOriginal: resolvedReplyTo !== null,
|
|
31471
|
+
replyToId: resolvedReplyTo
|
|
30295
31472
|
});
|
|
31473
|
+
if (data && typeof data.id === "number") {
|
|
31474
|
+
const recipients = (data.recipients ?? []).map((r) => ({
|
|
31475
|
+
userId: r.user.id,
|
|
31476
|
+
name: r.user.name,
|
|
31477
|
+
viewedAt: r.viewed?.dateTime ?? null
|
|
31478
|
+
}));
|
|
31479
|
+
const row = {
|
|
31480
|
+
id: data.id,
|
|
31481
|
+
folder: "sent",
|
|
31482
|
+
subject: data.subject ?? args.subject,
|
|
31483
|
+
fromUser: data.from?.name ?? "",
|
|
31484
|
+
sentAt: data.date?.dateTime ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
31485
|
+
recipients,
|
|
31486
|
+
body: data.body ?? args.body,
|
|
31487
|
+
fetchedBodyAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31488
|
+
replyToId: resolvedReplyTo,
|
|
31489
|
+
chainRootId,
|
|
31490
|
+
listData: data
|
|
31491
|
+
};
|
|
31492
|
+
upsertMessage(row);
|
|
31493
|
+
}
|
|
30296
31494
|
if (args.draftId !== void 0) {
|
|
30297
31495
|
const form = new FormData();
|
|
30298
31496
|
form.append("messageIds", String(args.draftId));
|
|
30299
31497
|
await client2.request("DELETE", "/pub/v1/messages", form);
|
|
31498
|
+
deleteDraft(args.draftId);
|
|
30300
31499
|
}
|
|
30301
|
-
|
|
31500
|
+
const text = data ? JSON.stringify(data, null, 2) : "Message sent successfully.";
|
|
31501
|
+
const finalText = rewriteNote ? `${rewriteNote}
|
|
31502
|
+
|
|
31503
|
+
${text}` : text;
|
|
31504
|
+
return { content: [{ type: "text", text: finalText }] };
|
|
30302
31505
|
});
|
|
30303
31506
|
server2.registerTool("ofw_list_drafts", {
|
|
30304
|
-
description: "List
|
|
31507
|
+
description: "List draft messages from the local OurFamilyWizard cache. Call ofw_sync_messages first if the cache is empty.",
|
|
30305
31508
|
annotations: { readOnlyHint: true },
|
|
30306
31509
|
inputSchema: {
|
|
30307
|
-
page:
|
|
30308
|
-
size:
|
|
31510
|
+
page: external_exports.number().describe("Page number (default 1)").optional(),
|
|
31511
|
+
size: external_exports.number().describe("Drafts per page (default 50)").optional()
|
|
30309
31512
|
}
|
|
30310
31513
|
}, async (args) => {
|
|
30311
31514
|
const page = args.page ?? 1;
|
|
30312
31515
|
const size = args.size ?? 50;
|
|
30313
|
-
const
|
|
30314
|
-
const
|
|
30315
|
-
return { content: [{ type: "text", text: JSON.stringify(
|
|
31516
|
+
const drafts = listDrafts({ page, size });
|
|
31517
|
+
const payload = drafts.length === 0 ? { drafts: [], note: "Cache empty. Call ofw_sync_messages to populate." } : { drafts };
|
|
31518
|
+
return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
|
|
30316
31519
|
});
|
|
30317
31520
|
server2.registerTool("ofw_save_draft", {
|
|
30318
|
-
description: "Save a message as a draft in OurFamilyWizard. Recipients are optional
|
|
31521
|
+
description: "Save a message as a draft in OurFamilyWizard. Recipients are optional. To update an existing draft, provide its messageId. If replyToId is provided, the cache may rewrite it to the latest reply in the thread (note included in response).",
|
|
30319
31522
|
annotations: { readOnlyHint: false },
|
|
30320
31523
|
inputSchema: {
|
|
30321
|
-
subject:
|
|
30322
|
-
body:
|
|
30323
|
-
recipientIds:
|
|
30324
|
-
messageId:
|
|
30325
|
-
replyToId:
|
|
31524
|
+
subject: external_exports.string().describe("Message subject"),
|
|
31525
|
+
body: external_exports.string().describe("Message body text"),
|
|
31526
|
+
recipientIds: external_exports.array(external_exports.number()).describe("Array of recipient user IDs (optional for drafts)").optional(),
|
|
31527
|
+
messageId: external_exports.number().describe("ID of an existing draft to update (omit to create a new draft)").optional(),
|
|
31528
|
+
replyToId: external_exports.number().describe("ID of the message this draft replies to").optional()
|
|
30326
31529
|
}
|
|
30327
31530
|
}, async (args) => {
|
|
30328
|
-
const
|
|
31531
|
+
const requestedReplyTo = args.replyToId ?? null;
|
|
31532
|
+
let resolvedReplyTo = requestedReplyTo;
|
|
31533
|
+
let rewriteNote = null;
|
|
31534
|
+
if (requestedReplyTo !== null) {
|
|
31535
|
+
resolvedReplyTo = findLatestReplyTip(requestedReplyTo);
|
|
31536
|
+
if (resolvedReplyTo !== requestedReplyTo) {
|
|
31537
|
+
rewriteNote = `replyToId rewritten from ${requestedReplyTo} to ${resolvedReplyTo} (later reply in same thread found in sent cache).`;
|
|
31538
|
+
}
|
|
31539
|
+
}
|
|
30329
31540
|
const payload = {
|
|
30330
31541
|
subject: args.subject,
|
|
30331
31542
|
body: args.body,
|
|
30332
31543
|
recipientIds: args.recipientIds ?? [],
|
|
30333
31544
|
attachments: { myFileIDs: [] },
|
|
30334
31545
|
draft: true,
|
|
30335
|
-
includeOriginal:
|
|
30336
|
-
replyToId
|
|
31546
|
+
includeOriginal: resolvedReplyTo !== null,
|
|
31547
|
+
replyToId: resolvedReplyTo
|
|
30337
31548
|
};
|
|
30338
31549
|
if (args.messageId !== void 0) payload.messageId = args.messageId;
|
|
30339
31550
|
const data = await client2.request("POST", "/pub/v3/messages", payload);
|
|
30340
|
-
|
|
31551
|
+
if (data && typeof data.id === "number") {
|
|
31552
|
+
const draft = {
|
|
31553
|
+
id: data.id,
|
|
31554
|
+
subject: data.subject ?? args.subject,
|
|
31555
|
+
body: data.body ?? args.body,
|
|
31556
|
+
recipients: (data.recipients ?? []).map((r) => ({
|
|
31557
|
+
userId: r.user.id,
|
|
31558
|
+
name: r.user.name,
|
|
31559
|
+
viewedAt: r.viewed?.dateTime ?? null
|
|
31560
|
+
})),
|
|
31561
|
+
replyToId: data.replyToId ?? resolvedReplyTo,
|
|
31562
|
+
modifiedAt: data.date?.dateTime ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
31563
|
+
listData: data
|
|
31564
|
+
};
|
|
31565
|
+
upsertDraft(draft);
|
|
31566
|
+
}
|
|
31567
|
+
const text = data ? JSON.stringify(data, null, 2) : "Draft saved.";
|
|
31568
|
+
const finalText = rewriteNote ? `${rewriteNote}
|
|
31569
|
+
|
|
31570
|
+
${text}` : text;
|
|
31571
|
+
return { content: [{ type: "text", text: finalText }] };
|
|
30341
31572
|
});
|
|
30342
31573
|
server2.registerTool("ofw_delete_draft", {
|
|
30343
|
-
description: "Delete a draft message from OurFamilyWizard",
|
|
31574
|
+
description: "Delete a draft message from OurFamilyWizard. Also removes the draft from the local cache.",
|
|
30344
31575
|
annotations: { destructiveHint: true },
|
|
30345
31576
|
inputSchema: {
|
|
30346
|
-
messageId:
|
|
31577
|
+
messageId: external_exports.number().describe("Draft message ID to delete")
|
|
30347
31578
|
}
|
|
30348
31579
|
}, async (args) => {
|
|
30349
31580
|
const form = new FormData();
|
|
30350
31581
|
form.append("messageIds", String(args.messageId));
|
|
30351
31582
|
const data = await client2.request("DELETE", "/pub/v1/messages", form);
|
|
30352
|
-
|
|
31583
|
+
deleteDraft(args.messageId);
|
|
31584
|
+
return { content: [{ type: "text", text: data ? JSON.stringify(data, null, 2) : "Draft deleted." }] };
|
|
30353
31585
|
});
|
|
30354
31586
|
server2.registerTool("ofw_get_unread_sent", {
|
|
30355
|
-
description: "List sent messages that have not been read by one or more recipients.
|
|
31587
|
+
description: "List sent messages that have not been read by one or more recipients. Reads from local cache; call ofw_sync_messages first if cache is stale.",
|
|
30356
31588
|
annotations: { readOnlyHint: true },
|
|
30357
31589
|
inputSchema: {
|
|
30358
|
-
page:
|
|
30359
|
-
size:
|
|
31590
|
+
page: external_exports.number().describe("Page (default 1)").optional(),
|
|
31591
|
+
size: external_exports.number().describe("Per page (default 50)").optional()
|
|
30360
31592
|
}
|
|
30361
31593
|
}, async (args) => {
|
|
30362
31594
|
const page = args.page ?? 1;
|
|
30363
|
-
const size = args.size ??
|
|
30364
|
-
const
|
|
30365
|
-
|
|
30366
|
-
"
|
|
30367
|
-
|
|
30368
|
-
|
|
30369
|
-
|
|
30370
|
-
const listPath = `/pub/v3/messages?folders=${encodeURIComponent(sentFolder.id)}&page=${page}&size=${size}&sort=date&sortDirection=desc`;
|
|
30371
|
-
const listData = await client2.request("GET", listPath);
|
|
30372
|
-
const messages = listData.data ?? [];
|
|
31595
|
+
const size = args.size ?? 50;
|
|
31596
|
+
const sent = listMessages({ folder: "sent", page, size });
|
|
31597
|
+
if (sent.length === 0) {
|
|
31598
|
+
return { content: [{ type: "text", text: JSON.stringify({
|
|
31599
|
+
note: "Sent cache is empty. Call ofw_sync_messages to populate."
|
|
31600
|
+
}, null, 2) }] };
|
|
31601
|
+
}
|
|
30373
31602
|
const unread = [];
|
|
30374
|
-
for (const msg of
|
|
30375
|
-
|
|
30376
|
-
|
|
30377
|
-
|
|
30378
|
-
unread.push({
|
|
30379
|
-
id: msg.id,
|
|
30380
|
-
subject: msg.subject,
|
|
30381
|
-
sentAt: msg.date.dateTime,
|
|
30382
|
-
unreadBy: unreadRecipients
|
|
30383
|
-
});
|
|
31603
|
+
for (const msg of sent) {
|
|
31604
|
+
const unreadBy = msg.recipients.filter((r) => r.viewedAt === null).map((r) => r.name);
|
|
31605
|
+
if (unreadBy.length > 0) {
|
|
31606
|
+
unread.push({ id: msg.id, subject: msg.subject, sentAt: msg.sentAt, unreadBy });
|
|
30384
31607
|
}
|
|
30385
31608
|
}
|
|
30386
31609
|
if (unread.length === 0) {
|
|
30387
|
-
return { content: [{ type: "text", text: JSON.stringify({
|
|
31610
|
+
return { content: [{ type: "text", text: JSON.stringify({
|
|
31611
|
+
message: "All scanned sent messages have been read."
|
|
31612
|
+
}, null, 2) }] };
|
|
30388
31613
|
}
|
|
30389
31614
|
return { content: [{ type: "text", text: JSON.stringify(unread, null, 2) }] };
|
|
30390
31615
|
});
|
|
31616
|
+
server2.registerTool("ofw_sync_messages", {
|
|
31617
|
+
description: "Sync messages from OurFamilyWizard into the local cache. Returns counts per folder and a list of unread inbox messages whose bodies were NOT fetched (to avoid mark-as-read on OFW). Call ofw_get_message(id) on those to read them.",
|
|
31618
|
+
annotations: { readOnlyHint: false },
|
|
31619
|
+
inputSchema: {
|
|
31620
|
+
folders: external_exports.array(external_exports.enum(["inbox", "sent", "drafts"])).describe("Folders to sync (default: all three)").optional(),
|
|
31621
|
+
fetchUnreadBodies: external_exports.boolean().describe("If true, also fetch bodies for unread inbox messages (will mark them as read on OFW). Default false.").optional()
|
|
31622
|
+
}
|
|
31623
|
+
}, async (args) => {
|
|
31624
|
+
const result = await syncAll(client2, {
|
|
31625
|
+
folders: args.folders,
|
|
31626
|
+
fetchUnreadBodies: args.fetchUnreadBodies
|
|
31627
|
+
});
|
|
31628
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
31629
|
+
});
|
|
30391
31630
|
}
|
|
30392
31631
|
|
|
30393
31632
|
// src/tools/calendar.ts
|
|
@@ -30396,9 +31635,9 @@ function registerCalendarTools(server2, client2) {
|
|
|
30396
31635
|
description: "List OurFamilyWizard calendar events in a date range",
|
|
30397
31636
|
annotations: { readOnlyHint: true },
|
|
30398
31637
|
inputSchema: {
|
|
30399
|
-
startDate:
|
|
30400
|
-
endDate:
|
|
30401
|
-
detailed:
|
|
31638
|
+
startDate: external_exports.string().describe("Start date YYYY-MM-DD"),
|
|
31639
|
+
endDate: external_exports.string().describe("End date YYYY-MM-DD"),
|
|
31640
|
+
detailed: external_exports.boolean().describe("Return full event details (default false)").optional()
|
|
30402
31641
|
}
|
|
30403
31642
|
}, async (args) => {
|
|
30404
31643
|
const variant = args.detailed ? "detailed" : "basic";
|
|
@@ -30412,17 +31651,17 @@ function registerCalendarTools(server2, client2) {
|
|
|
30412
31651
|
description: "Create a calendar event in OurFamilyWizard",
|
|
30413
31652
|
annotations: { destructiveHint: false },
|
|
30414
31653
|
inputSchema: {
|
|
30415
|
-
title:
|
|
30416
|
-
startDate:
|
|
30417
|
-
endDate:
|
|
30418
|
-
allDay:
|
|
30419
|
-
location:
|
|
30420
|
-
reminder:
|
|
30421
|
-
privateEvent:
|
|
30422
|
-
eventFor:
|
|
30423
|
-
dropOffParent:
|
|
30424
|
-
pickUpParent:
|
|
30425
|
-
children:
|
|
31654
|
+
title: external_exports.string(),
|
|
31655
|
+
startDate: external_exports.string().describe("ISO datetime string"),
|
|
31656
|
+
endDate: external_exports.string().describe("ISO datetime string"),
|
|
31657
|
+
allDay: external_exports.boolean().optional(),
|
|
31658
|
+
location: external_exports.string().optional(),
|
|
31659
|
+
reminder: external_exports.string().describe('Reminder setting (e.g. "1 hour before")').optional(),
|
|
31660
|
+
privateEvent: external_exports.boolean().optional(),
|
|
31661
|
+
eventFor: external_exports.string().describe("neither | parent1 | parent2").optional(),
|
|
31662
|
+
dropOffParent: external_exports.string().optional(),
|
|
31663
|
+
pickUpParent: external_exports.string().optional(),
|
|
31664
|
+
children: external_exports.array(external_exports.number()).describe("Array of child IDs").optional()
|
|
30426
31665
|
}
|
|
30427
31666
|
}, async (args) => {
|
|
30428
31667
|
const data = await client2.request("POST", "/pub/v1/calendar/events", args);
|
|
@@ -30432,14 +31671,14 @@ function registerCalendarTools(server2, client2) {
|
|
|
30432
31671
|
description: "Update an existing OurFamilyWizard calendar event",
|
|
30433
31672
|
annotations: { destructiveHint: false },
|
|
30434
31673
|
inputSchema: {
|
|
30435
|
-
eventId:
|
|
30436
|
-
title:
|
|
30437
|
-
startDate:
|
|
30438
|
-
endDate:
|
|
30439
|
-
allDay:
|
|
30440
|
-
location:
|
|
30441
|
-
reminder:
|
|
30442
|
-
privateEvent:
|
|
31674
|
+
eventId: external_exports.string(),
|
|
31675
|
+
title: external_exports.string().optional(),
|
|
31676
|
+
startDate: external_exports.string().optional(),
|
|
31677
|
+
endDate: external_exports.string().optional(),
|
|
31678
|
+
allDay: external_exports.boolean().optional(),
|
|
31679
|
+
location: external_exports.string().optional(),
|
|
31680
|
+
reminder: external_exports.string().optional(),
|
|
31681
|
+
privateEvent: external_exports.boolean().optional()
|
|
30443
31682
|
}
|
|
30444
31683
|
}, async (args) => {
|
|
30445
31684
|
const { eventId, ...updateData } = args;
|
|
@@ -30450,7 +31689,7 @@ function registerCalendarTools(server2, client2) {
|
|
|
30450
31689
|
description: "Delete an OurFamilyWizard calendar event",
|
|
30451
31690
|
annotations: { destructiveHint: true },
|
|
30452
31691
|
inputSchema: {
|
|
30453
|
-
eventId:
|
|
31692
|
+
eventId: external_exports.string().describe("Event ID to delete")
|
|
30454
31693
|
}
|
|
30455
31694
|
}, async (args) => {
|
|
30456
31695
|
await client2.request("DELETE", `/pub/v1/calendar/events/${encodeURIComponent(args.eventId)}`);
|
|
@@ -30471,8 +31710,8 @@ function registerExpenseTools(server2, client2) {
|
|
|
30471
31710
|
description: "List OurFamilyWizard expenses with pagination",
|
|
30472
31711
|
annotations: { readOnlyHint: true },
|
|
30473
31712
|
inputSchema: {
|
|
30474
|
-
start:
|
|
30475
|
-
max:
|
|
31713
|
+
start: external_exports.number().describe("Start offset (default 0)").optional(),
|
|
31714
|
+
max: external_exports.number().describe("Max results (default 20)").optional()
|
|
30476
31715
|
}
|
|
30477
31716
|
}, async (args) => {
|
|
30478
31717
|
const start = args.start ?? 0;
|
|
@@ -30484,8 +31723,8 @@ function registerExpenseTools(server2, client2) {
|
|
|
30484
31723
|
description: "Log a new expense in OurFamilyWizard",
|
|
30485
31724
|
annotations: { destructiveHint: false },
|
|
30486
31725
|
inputSchema: {
|
|
30487
|
-
amount:
|
|
30488
|
-
description:
|
|
31726
|
+
amount: external_exports.number().describe("Expense amount"),
|
|
31727
|
+
description: external_exports.string().describe("Expense description")
|
|
30489
31728
|
}
|
|
30490
31729
|
}, async (args) => {
|
|
30491
31730
|
const data = await client2.request("POST", "/pub/v2/expense/expenses", args);
|
|
@@ -30499,8 +31738,8 @@ function registerJournalTools(server2, client2) {
|
|
|
30499
31738
|
description: "List OurFamilyWizard journal entries",
|
|
30500
31739
|
annotations: { readOnlyHint: true },
|
|
30501
31740
|
inputSchema: {
|
|
30502
|
-
start:
|
|
30503
|
-
max:
|
|
31741
|
+
start: external_exports.number().describe("Start offset (default 1)").optional(),
|
|
31742
|
+
max: external_exports.number().describe("Max results (default 10)").optional()
|
|
30504
31743
|
}
|
|
30505
31744
|
}, async (args) => {
|
|
30506
31745
|
const start = args.start ?? 1;
|
|
@@ -30512,8 +31751,8 @@ function registerJournalTools(server2, client2) {
|
|
|
30512
31751
|
description: "Create a new journal entry in OurFamilyWizard",
|
|
30513
31752
|
annotations: { destructiveHint: false },
|
|
30514
31753
|
inputSchema: {
|
|
30515
|
-
title:
|
|
30516
|
-
body:
|
|
31754
|
+
title: external_exports.string().describe("Entry title"),
|
|
31755
|
+
body: external_exports.string().describe("Entry text content")
|
|
30517
31756
|
}
|
|
30518
31757
|
}, async (args) => {
|
|
30519
31758
|
const data = await client2.request("POST", "/pub/v1/journals", args);
|
|
@@ -30522,7 +31761,17 @@ function registerJournalTools(server2, client2) {
|
|
|
30522
31761
|
}
|
|
30523
31762
|
|
|
30524
31763
|
// src/index.ts
|
|
30525
|
-
var
|
|
31764
|
+
var originalEmit = process.emit.bind(process);
|
|
31765
|
+
process.emit = function(event, ...args) {
|
|
31766
|
+
if (event === "warning") {
|
|
31767
|
+
const w = args[0];
|
|
31768
|
+
if (w?.name === "ExperimentalWarning" && /SQLite/i.test(w.message ?? "")) {
|
|
31769
|
+
return false;
|
|
31770
|
+
}
|
|
31771
|
+
}
|
|
31772
|
+
return originalEmit(event, ...args);
|
|
31773
|
+
};
|
|
31774
|
+
var server = new McpServer({ name: "ofw", version: "2.0.5" });
|
|
30526
31775
|
registerUserTools(server, client);
|
|
30527
31776
|
registerMessageTools(server, client);
|
|
30528
31777
|
registerCalendarTools(server, client);
|