@forgeax/engine-profiler 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli.mjs +1991 -2154
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1991 -2154
- package/dist/index.mjs.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/schema.ts +41 -5
package/dist/index.mjs
CHANGED
|
@@ -4498,1121 +4498,811 @@ var require_core = __commonJS({
|
|
|
4498
4498
|
}
|
|
4499
4499
|
});
|
|
4500
4500
|
|
|
4501
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4502
|
-
var
|
|
4503
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
}
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
schema: sch,
|
|
4556
|
-
dataTypes: [],
|
|
4557
|
-
schemaPath: codegen_1.nil,
|
|
4558
|
-
topSchemaRef: schName,
|
|
4559
|
-
errSchemaPath: $ref
|
|
4560
|
-
}, valid);
|
|
4561
|
-
cxt.mergeEvaluated(schCxt);
|
|
4562
|
-
cxt.ok(valid);
|
|
4563
|
-
}
|
|
4564
|
-
}
|
|
4565
|
-
};
|
|
4566
|
-
function getValidate(cxt, sch) {
|
|
4567
|
-
const { gen } = cxt;
|
|
4568
|
-
return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
|
|
4569
|
-
}
|
|
4570
|
-
exports.getValidate = getValidate;
|
|
4571
|
-
function callRef(cxt, v, sch, $async) {
|
|
4572
|
-
const { gen, it } = cxt;
|
|
4573
|
-
const { allErrors, schemaEnv: env, opts } = it;
|
|
4574
|
-
const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
|
|
4575
|
-
if ($async)
|
|
4576
|
-
callAsyncRef();
|
|
4577
|
-
else
|
|
4578
|
-
callSyncRef();
|
|
4579
|
-
function callAsyncRef() {
|
|
4580
|
-
if (!env.$async)
|
|
4581
|
-
throw new Error("async schema referenced by sync schema");
|
|
4582
|
-
const valid = gen.let("valid");
|
|
4583
|
-
gen.try(() => {
|
|
4584
|
-
gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
|
|
4585
|
-
addEvaluatedFrom(v);
|
|
4586
|
-
if (!allErrors)
|
|
4587
|
-
gen.assign(valid, true);
|
|
4588
|
-
}, (e) => {
|
|
4589
|
-
gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
|
|
4590
|
-
addErrorsFrom(e);
|
|
4591
|
-
if (!allErrors)
|
|
4592
|
-
gen.assign(valid, false);
|
|
4593
|
-
});
|
|
4594
|
-
cxt.ok(valid);
|
|
4595
|
-
}
|
|
4596
|
-
function callSyncRef() {
|
|
4597
|
-
cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
|
|
4598
|
-
}
|
|
4599
|
-
function addErrorsFrom(source) {
|
|
4600
|
-
const errs = (0, codegen_1._)`${source}.errors`;
|
|
4601
|
-
gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
|
|
4602
|
-
gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
|
|
4603
|
-
}
|
|
4604
|
-
function addEvaluatedFrom(source) {
|
|
4605
|
-
var _a;
|
|
4606
|
-
if (!it.opts.unevaluated)
|
|
4607
|
-
return;
|
|
4608
|
-
const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
|
|
4609
|
-
if (it.props !== true) {
|
|
4610
|
-
if (schEvaluated && !schEvaluated.dynamicProps) {
|
|
4611
|
-
if (schEvaluated.props !== void 0) {
|
|
4612
|
-
it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
|
|
4613
|
-
}
|
|
4614
|
-
} else {
|
|
4615
|
-
const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`);
|
|
4616
|
-
it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
|
|
4617
|
-
}
|
|
4618
|
-
}
|
|
4619
|
-
if (it.items !== true) {
|
|
4620
|
-
if (schEvaluated && !schEvaluated.dynamicItems) {
|
|
4621
|
-
if (schEvaluated.items !== void 0) {
|
|
4622
|
-
it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
|
|
4623
|
-
}
|
|
4624
|
-
} else {
|
|
4625
|
-
const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
|
|
4626
|
-
it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
|
|
4627
|
-
}
|
|
4501
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json
|
|
4502
|
+
var require_schema = __commonJS({
|
|
4503
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json"(exports, module) {
|
|
4504
|
+
module.exports = {
|
|
4505
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4506
|
+
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
4507
|
+
$vocabulary: {
|
|
4508
|
+
"https://json-schema.org/draft/2020-12/vocab/core": true,
|
|
4509
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
|
|
4510
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
|
|
4511
|
+
"https://json-schema.org/draft/2020-12/vocab/validation": true,
|
|
4512
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
|
|
4513
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
|
|
4514
|
+
"https://json-schema.org/draft/2020-12/vocab/content": true
|
|
4515
|
+
},
|
|
4516
|
+
$dynamicAnchor: "meta",
|
|
4517
|
+
title: "Core and Validation specifications meta-schema",
|
|
4518
|
+
allOf: [
|
|
4519
|
+
{ $ref: "meta/core" },
|
|
4520
|
+
{ $ref: "meta/applicator" },
|
|
4521
|
+
{ $ref: "meta/unevaluated" },
|
|
4522
|
+
{ $ref: "meta/validation" },
|
|
4523
|
+
{ $ref: "meta/meta-data" },
|
|
4524
|
+
{ $ref: "meta/format-annotation" },
|
|
4525
|
+
{ $ref: "meta/content" }
|
|
4526
|
+
],
|
|
4527
|
+
type: ["object", "boolean"],
|
|
4528
|
+
$comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
|
|
4529
|
+
properties: {
|
|
4530
|
+
definitions: {
|
|
4531
|
+
$comment: '"definitions" has been replaced by "$defs".',
|
|
4532
|
+
type: "object",
|
|
4533
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4534
|
+
deprecated: true,
|
|
4535
|
+
default: {}
|
|
4536
|
+
},
|
|
4537
|
+
dependencies: {
|
|
4538
|
+
$comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
|
|
4539
|
+
type: "object",
|
|
4540
|
+
additionalProperties: {
|
|
4541
|
+
anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }]
|
|
4542
|
+
},
|
|
4543
|
+
deprecated: true,
|
|
4544
|
+
default: {}
|
|
4545
|
+
},
|
|
4546
|
+
$recursiveAnchor: {
|
|
4547
|
+
$comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
|
|
4548
|
+
$ref: "meta/core#/$defs/anchorString",
|
|
4549
|
+
deprecated: true
|
|
4550
|
+
},
|
|
4551
|
+
$recursiveRef: {
|
|
4552
|
+
$comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
|
|
4553
|
+
$ref: "meta/core#/$defs/uriReferenceString",
|
|
4554
|
+
deprecated: true
|
|
4628
4555
|
}
|
|
4629
4556
|
}
|
|
4630
|
-
}
|
|
4631
|
-
exports.callRef = callRef;
|
|
4632
|
-
exports.default = def;
|
|
4633
|
-
}
|
|
4634
|
-
});
|
|
4635
|
-
|
|
4636
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js
|
|
4637
|
-
var require_core2 = __commonJS({
|
|
4638
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
|
|
4639
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4640
|
-
var id_1 = require_id();
|
|
4641
|
-
var ref_1 = require_ref();
|
|
4642
|
-
var core = [
|
|
4643
|
-
"$schema",
|
|
4644
|
-
"$id",
|
|
4645
|
-
"$defs",
|
|
4646
|
-
"$vocabulary",
|
|
4647
|
-
{ keyword: "$comment" },
|
|
4648
|
-
"definitions",
|
|
4649
|
-
id_1.default,
|
|
4650
|
-
ref_1.default
|
|
4651
|
-
];
|
|
4652
|
-
exports.default = core;
|
|
4653
|
-
}
|
|
4654
|
-
});
|
|
4655
|
-
|
|
4656
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
|
|
4657
|
-
var require_limitNumber = __commonJS({
|
|
4658
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
|
|
4659
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4660
|
-
var codegen_1 = require_codegen();
|
|
4661
|
-
var ops = codegen_1.operators;
|
|
4662
|
-
var KWDs = {
|
|
4663
|
-
maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
|
|
4664
|
-
minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
|
|
4665
|
-
exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
4666
|
-
exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
4667
|
-
};
|
|
4668
|
-
var error2 = {
|
|
4669
|
-
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
4670
|
-
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
4671
|
-
};
|
|
4672
|
-
var def = {
|
|
4673
|
-
keyword: Object.keys(KWDs),
|
|
4674
|
-
type: "number",
|
|
4675
|
-
schemaType: "number",
|
|
4676
|
-
$data: true,
|
|
4677
|
-
error: error2,
|
|
4678
|
-
code(cxt) {
|
|
4679
|
-
const { keyword, data, schemaCode } = cxt;
|
|
4680
|
-
cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
|
|
4681
|
-
}
|
|
4682
|
-
};
|
|
4683
|
-
exports.default = def;
|
|
4684
|
-
}
|
|
4685
|
-
});
|
|
4686
|
-
|
|
4687
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
|
|
4688
|
-
var require_multipleOf = __commonJS({
|
|
4689
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
|
|
4690
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4691
|
-
var codegen_1 = require_codegen();
|
|
4692
|
-
var error2 = {
|
|
4693
|
-
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
4694
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
4695
|
-
};
|
|
4696
|
-
var def = {
|
|
4697
|
-
keyword: "multipleOf",
|
|
4698
|
-
type: "number",
|
|
4699
|
-
schemaType: "number",
|
|
4700
|
-
$data: true,
|
|
4701
|
-
error: error2,
|
|
4702
|
-
code(cxt) {
|
|
4703
|
-
const { gen, data, schemaCode, it } = cxt;
|
|
4704
|
-
const prec = it.opts.multipleOfPrecision;
|
|
4705
|
-
const res = gen.let("res");
|
|
4706
|
-
const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
|
|
4707
|
-
cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
|
|
4708
|
-
}
|
|
4709
4557
|
};
|
|
4710
|
-
exports.default = def;
|
|
4711
4558
|
}
|
|
4712
4559
|
});
|
|
4713
4560
|
|
|
4714
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4715
|
-
var
|
|
4716
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
let value;
|
|
4723
|
-
while (pos < len) {
|
|
4724
|
-
length++;
|
|
4725
|
-
value = str.charCodeAt(pos++);
|
|
4726
|
-
if (value >= 55296 && value <= 56319 && pos < len) {
|
|
4727
|
-
value = str.charCodeAt(pos);
|
|
4728
|
-
if ((value & 64512) === 56320)
|
|
4729
|
-
pos++;
|
|
4730
|
-
}
|
|
4731
|
-
}
|
|
4732
|
-
return length;
|
|
4733
|
-
}
|
|
4734
|
-
exports.default = ucs2length;
|
|
4735
|
-
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
4736
|
-
}
|
|
4737
|
-
});
|
|
4738
|
-
|
|
4739
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js
|
|
4740
|
-
var require_limitLength = __commonJS({
|
|
4741
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
|
|
4742
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4743
|
-
var codegen_1 = require_codegen();
|
|
4744
|
-
var util_1 = require_util();
|
|
4745
|
-
var ucs2length_1 = require_ucs2length();
|
|
4746
|
-
var error2 = {
|
|
4747
|
-
message({ keyword, schemaCode }) {
|
|
4748
|
-
const comp = keyword === "maxLength" ? "more" : "fewer";
|
|
4749
|
-
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
|
|
4561
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json
|
|
4562
|
+
var require_applicator = __commonJS({
|
|
4563
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json"(exports, module) {
|
|
4564
|
+
module.exports = {
|
|
4565
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4566
|
+
$id: "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
4567
|
+
$vocabulary: {
|
|
4568
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator": true
|
|
4750
4569
|
},
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
}
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
4790
|
-
if ($data) {
|
|
4791
|
-
const { regExp } = it.opts.code;
|
|
4792
|
-
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
4793
|
-
const valid = gen.let("valid");
|
|
4794
|
-
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
4795
|
-
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
4796
|
-
} else {
|
|
4797
|
-
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
4798
|
-
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
4570
|
+
$dynamicAnchor: "meta",
|
|
4571
|
+
title: "Applicator vocabulary meta-schema",
|
|
4572
|
+
type: ["object", "boolean"],
|
|
4573
|
+
properties: {
|
|
4574
|
+
prefixItems: { $ref: "#/$defs/schemaArray" },
|
|
4575
|
+
items: { $dynamicRef: "#meta" },
|
|
4576
|
+
contains: { $dynamicRef: "#meta" },
|
|
4577
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4578
|
+
properties: {
|
|
4579
|
+
type: "object",
|
|
4580
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4581
|
+
default: {}
|
|
4582
|
+
},
|
|
4583
|
+
patternProperties: {
|
|
4584
|
+
type: "object",
|
|
4585
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4586
|
+
propertyNames: { format: "regex" },
|
|
4587
|
+
default: {}
|
|
4588
|
+
},
|
|
4589
|
+
dependentSchemas: {
|
|
4590
|
+
type: "object",
|
|
4591
|
+
additionalProperties: { $dynamicRef: "#meta" },
|
|
4592
|
+
default: {}
|
|
4593
|
+
},
|
|
4594
|
+
propertyNames: { $dynamicRef: "#meta" },
|
|
4595
|
+
if: { $dynamicRef: "#meta" },
|
|
4596
|
+
then: { $dynamicRef: "#meta" },
|
|
4597
|
+
else: { $dynamicRef: "#meta" },
|
|
4598
|
+
allOf: { $ref: "#/$defs/schemaArray" },
|
|
4599
|
+
anyOf: { $ref: "#/$defs/schemaArray" },
|
|
4600
|
+
oneOf: { $ref: "#/$defs/schemaArray" },
|
|
4601
|
+
not: { $dynamicRef: "#meta" }
|
|
4602
|
+
},
|
|
4603
|
+
$defs: {
|
|
4604
|
+
schemaArray: {
|
|
4605
|
+
type: "array",
|
|
4606
|
+
minItems: 1,
|
|
4607
|
+
items: { $dynamicRef: "#meta" }
|
|
4799
4608
|
}
|
|
4800
4609
|
}
|
|
4801
4610
|
};
|
|
4802
|
-
exports.default = def;
|
|
4803
4611
|
}
|
|
4804
4612
|
});
|
|
4805
4613
|
|
|
4806
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4807
|
-
var
|
|
4808
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
|
|
4614
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json
|
|
4615
|
+
var require_unevaluated = __commonJS({
|
|
4616
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json"(exports, module) {
|
|
4617
|
+
module.exports = {
|
|
4618
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4619
|
+
$id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
4620
|
+
$vocabulary: {
|
|
4621
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true
|
|
4815
4622
|
},
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
$data: true,
|
|
4823
|
-
error: error2,
|
|
4824
|
-
code(cxt) {
|
|
4825
|
-
const { keyword, data, schemaCode } = cxt;
|
|
4826
|
-
const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
4827
|
-
cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);
|
|
4828
|
-
}
|
|
4829
|
-
};
|
|
4830
|
-
exports.default = def;
|
|
4831
|
-
}
|
|
4832
|
-
});
|
|
4833
|
-
|
|
4834
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js
|
|
4835
|
-
var require_required = __commonJS({
|
|
4836
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
|
|
4837
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4838
|
-
var code_1 = require_code2();
|
|
4839
|
-
var codegen_1 = require_codegen();
|
|
4840
|
-
var util_1 = require_util();
|
|
4841
|
-
var error2 = {
|
|
4842
|
-
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
4843
|
-
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
4844
|
-
};
|
|
4845
|
-
var def = {
|
|
4846
|
-
keyword: "required",
|
|
4847
|
-
type: "object",
|
|
4848
|
-
schemaType: "array",
|
|
4849
|
-
$data: true,
|
|
4850
|
-
error: error2,
|
|
4851
|
-
code(cxt) {
|
|
4852
|
-
const { gen, schema, schemaCode, data, $data, it } = cxt;
|
|
4853
|
-
const { opts } = it;
|
|
4854
|
-
if (!$data && schema.length === 0)
|
|
4855
|
-
return;
|
|
4856
|
-
const useLoop = schema.length >= opts.loopRequired;
|
|
4857
|
-
if (it.allErrors)
|
|
4858
|
-
allErrorsMode();
|
|
4859
|
-
else
|
|
4860
|
-
exitOnErrorMode();
|
|
4861
|
-
if (opts.strictRequired) {
|
|
4862
|
-
const props = cxt.parentSchema.properties;
|
|
4863
|
-
const { definedProperties } = cxt.it;
|
|
4864
|
-
for (const requiredKey of schema) {
|
|
4865
|
-
if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {
|
|
4866
|
-
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
|
|
4867
|
-
const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
|
|
4868
|
-
(0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
|
|
4869
|
-
}
|
|
4870
|
-
}
|
|
4871
|
-
}
|
|
4872
|
-
function allErrorsMode() {
|
|
4873
|
-
if (useLoop || $data) {
|
|
4874
|
-
cxt.block$data(codegen_1.nil, loopAllRequired);
|
|
4875
|
-
} else {
|
|
4876
|
-
for (const prop of schema) {
|
|
4877
|
-
(0, code_1.checkReportMissingProp)(cxt, prop);
|
|
4878
|
-
}
|
|
4879
|
-
}
|
|
4880
|
-
}
|
|
4881
|
-
function exitOnErrorMode() {
|
|
4882
|
-
const missing = gen.let("missing");
|
|
4883
|
-
if (useLoop || $data) {
|
|
4884
|
-
const valid = gen.let("valid", true);
|
|
4885
|
-
cxt.block$data(valid, () => loopUntilMissing(missing, valid));
|
|
4886
|
-
cxt.ok(valid);
|
|
4887
|
-
} else {
|
|
4888
|
-
gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
|
|
4889
|
-
(0, code_1.reportMissingProp)(cxt, missing);
|
|
4890
|
-
gen.else();
|
|
4891
|
-
}
|
|
4892
|
-
}
|
|
4893
|
-
function loopAllRequired() {
|
|
4894
|
-
gen.forOf("prop", schemaCode, (prop) => {
|
|
4895
|
-
cxt.setParams({ missingProperty: prop });
|
|
4896
|
-
gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
|
|
4897
|
-
});
|
|
4898
|
-
}
|
|
4899
|
-
function loopUntilMissing(missing, valid) {
|
|
4900
|
-
cxt.setParams({ missingProperty: missing });
|
|
4901
|
-
gen.forOf(missing, schemaCode, () => {
|
|
4902
|
-
gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
|
|
4903
|
-
gen.if((0, codegen_1.not)(valid), () => {
|
|
4904
|
-
cxt.error();
|
|
4905
|
-
gen.break();
|
|
4906
|
-
});
|
|
4907
|
-
}, codegen_1.nil);
|
|
4908
|
-
}
|
|
4623
|
+
$dynamicAnchor: "meta",
|
|
4624
|
+
title: "Unevaluated applicator vocabulary meta-schema",
|
|
4625
|
+
type: ["object", "boolean"],
|
|
4626
|
+
properties: {
|
|
4627
|
+
unevaluatedItems: { $dynamicRef: "#meta" },
|
|
4628
|
+
unevaluatedProperties: { $dynamicRef: "#meta" }
|
|
4909
4629
|
}
|
|
4910
4630
|
};
|
|
4911
|
-
exports.default = def;
|
|
4912
4631
|
}
|
|
4913
4632
|
});
|
|
4914
4633
|
|
|
4915
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4916
|
-
var
|
|
4917
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
|
|
4634
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json
|
|
4635
|
+
var require_content = __commonJS({
|
|
4636
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json"(exports, module) {
|
|
4637
|
+
module.exports = {
|
|
4638
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4639
|
+
$id: "https://json-schema.org/draft/2020-12/meta/content",
|
|
4640
|
+
$vocabulary: {
|
|
4641
|
+
"https://json-schema.org/draft/2020-12/vocab/content": true
|
|
4924
4642
|
},
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
error: error2,
|
|
4933
|
-
code(cxt) {
|
|
4934
|
-
const { keyword, data, schemaCode } = cxt;
|
|
4935
|
-
const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
4936
|
-
cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);
|
|
4643
|
+
$dynamicAnchor: "meta",
|
|
4644
|
+
title: "Content vocabulary meta-schema",
|
|
4645
|
+
type: ["object", "boolean"],
|
|
4646
|
+
properties: {
|
|
4647
|
+
contentEncoding: { type: "string" },
|
|
4648
|
+
contentMediaType: { type: "string" },
|
|
4649
|
+
contentSchema: { $dynamicRef: "#meta" }
|
|
4937
4650
|
}
|
|
4938
4651
|
};
|
|
4939
|
-
exports.default = def;
|
|
4940
|
-
}
|
|
4941
|
-
});
|
|
4942
|
-
|
|
4943
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js
|
|
4944
|
-
var require_equal = __commonJS({
|
|
4945
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js"(exports) {
|
|
4946
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4947
|
-
var equal = require_fast_deep_equal();
|
|
4948
|
-
equal.code = 'require("ajv/dist/runtime/equal").default';
|
|
4949
|
-
exports.default = equal;
|
|
4950
4652
|
}
|
|
4951
4653
|
});
|
|
4952
4654
|
|
|
4953
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4954
|
-
var
|
|
4955
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
}
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
});
|
|
5004
|
-
}
|
|
5005
|
-
function loopN2(i, j) {
|
|
5006
|
-
const eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
5007
|
-
const outer = gen.name("outer");
|
|
5008
|
-
gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
|
|
5009
|
-
cxt.error();
|
|
5010
|
-
gen.assign(valid, false).break(outer);
|
|
5011
|
-
})));
|
|
4655
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json
|
|
4656
|
+
var require_core2 = __commonJS({
|
|
4657
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json"(exports, module) {
|
|
4658
|
+
module.exports = {
|
|
4659
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4660
|
+
$id: "https://json-schema.org/draft/2020-12/meta/core",
|
|
4661
|
+
$vocabulary: {
|
|
4662
|
+
"https://json-schema.org/draft/2020-12/vocab/core": true
|
|
4663
|
+
},
|
|
4664
|
+
$dynamicAnchor: "meta",
|
|
4665
|
+
title: "Core vocabulary meta-schema",
|
|
4666
|
+
type: ["object", "boolean"],
|
|
4667
|
+
properties: {
|
|
4668
|
+
$id: {
|
|
4669
|
+
$ref: "#/$defs/uriReferenceString",
|
|
4670
|
+
$comment: "Non-empty fragments not allowed.",
|
|
4671
|
+
pattern: "^[^#]*#?$"
|
|
4672
|
+
},
|
|
4673
|
+
$schema: { $ref: "#/$defs/uriString" },
|
|
4674
|
+
$ref: { $ref: "#/$defs/uriReferenceString" },
|
|
4675
|
+
$anchor: { $ref: "#/$defs/anchorString" },
|
|
4676
|
+
$dynamicRef: { $ref: "#/$defs/uriReferenceString" },
|
|
4677
|
+
$dynamicAnchor: { $ref: "#/$defs/anchorString" },
|
|
4678
|
+
$vocabulary: {
|
|
4679
|
+
type: "object",
|
|
4680
|
+
propertyNames: { $ref: "#/$defs/uriString" },
|
|
4681
|
+
additionalProperties: {
|
|
4682
|
+
type: "boolean"
|
|
4683
|
+
}
|
|
4684
|
+
},
|
|
4685
|
+
$comment: {
|
|
4686
|
+
type: "string"
|
|
4687
|
+
},
|
|
4688
|
+
$defs: {
|
|
4689
|
+
type: "object",
|
|
4690
|
+
additionalProperties: { $dynamicRef: "#meta" }
|
|
4691
|
+
}
|
|
4692
|
+
},
|
|
4693
|
+
$defs: {
|
|
4694
|
+
anchorString: {
|
|
4695
|
+
type: "string",
|
|
4696
|
+
pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
|
|
4697
|
+
},
|
|
4698
|
+
uriString: {
|
|
4699
|
+
type: "string",
|
|
4700
|
+
format: "uri"
|
|
4701
|
+
},
|
|
4702
|
+
uriReferenceString: {
|
|
4703
|
+
type: "string",
|
|
4704
|
+
format: "uri-reference"
|
|
5012
4705
|
}
|
|
5013
4706
|
}
|
|
5014
4707
|
};
|
|
5015
|
-
exports.default = def;
|
|
5016
4708
|
}
|
|
5017
4709
|
});
|
|
5018
4710
|
|
|
5019
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5020
|
-
var
|
|
5021
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
error: error2,
|
|
5034
|
-
code(cxt) {
|
|
5035
|
-
const { gen, data, $data, schemaCode, schema } = cxt;
|
|
5036
|
-
if ($data || schema && typeof schema == "object") {
|
|
5037
|
-
cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
|
|
5038
|
-
} else {
|
|
5039
|
-
cxt.fail((0, codegen_1._)`${schema} !== ${data}`);
|
|
5040
|
-
}
|
|
4711
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json
|
|
4712
|
+
var require_format_annotation = __commonJS({
|
|
4713
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json"(exports, module) {
|
|
4714
|
+
module.exports = {
|
|
4715
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4716
|
+
$id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
4717
|
+
$vocabulary: {
|
|
4718
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true
|
|
4719
|
+
},
|
|
4720
|
+
$dynamicAnchor: "meta",
|
|
4721
|
+
title: "Format vocabulary meta-schema for annotation results",
|
|
4722
|
+
type: ["object", "boolean"],
|
|
4723
|
+
properties: {
|
|
4724
|
+
format: { type: "string" }
|
|
5041
4725
|
}
|
|
5042
4726
|
};
|
|
5043
|
-
exports.default = def;
|
|
5044
4727
|
}
|
|
5045
4728
|
});
|
|
5046
4729
|
|
|
5047
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5048
|
-
var
|
|
5049
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
}
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
gen.assign(valid, false);
|
|
5083
|
-
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
5084
|
-
}
|
|
5085
|
-
function equalCode(vSchema, i) {
|
|
5086
|
-
const sch = schema[i];
|
|
5087
|
-
return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
|
|
4730
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json
|
|
4731
|
+
var require_meta_data = __commonJS({
|
|
4732
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json"(exports, module) {
|
|
4733
|
+
module.exports = {
|
|
4734
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4735
|
+
$id: "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
4736
|
+
$vocabulary: {
|
|
4737
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true
|
|
4738
|
+
},
|
|
4739
|
+
$dynamicAnchor: "meta",
|
|
4740
|
+
title: "Meta-data vocabulary meta-schema",
|
|
4741
|
+
type: ["object", "boolean"],
|
|
4742
|
+
properties: {
|
|
4743
|
+
title: {
|
|
4744
|
+
type: "string"
|
|
4745
|
+
},
|
|
4746
|
+
description: {
|
|
4747
|
+
type: "string"
|
|
4748
|
+
},
|
|
4749
|
+
default: true,
|
|
4750
|
+
deprecated: {
|
|
4751
|
+
type: "boolean",
|
|
4752
|
+
default: false
|
|
4753
|
+
},
|
|
4754
|
+
readOnly: {
|
|
4755
|
+
type: "boolean",
|
|
4756
|
+
default: false
|
|
4757
|
+
},
|
|
4758
|
+
writeOnly: {
|
|
4759
|
+
type: "boolean",
|
|
4760
|
+
default: false
|
|
4761
|
+
},
|
|
4762
|
+
examples: {
|
|
4763
|
+
type: "array",
|
|
4764
|
+
items: true
|
|
5088
4765
|
}
|
|
5089
4766
|
}
|
|
5090
4767
|
};
|
|
5091
|
-
exports.default = def;
|
|
5092
4768
|
}
|
|
5093
4769
|
});
|
|
5094
4770
|
|
|
5095
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4771
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
|
|
5096
4772
|
var require_validation = __commonJS({
|
|
5097
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
4773
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json"(exports, module) {
|
|
4774
|
+
module.exports = {
|
|
4775
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4776
|
+
$id: "https://json-schema.org/draft/2020-12/meta/validation",
|
|
4777
|
+
$vocabulary: {
|
|
4778
|
+
"https://json-schema.org/draft/2020-12/vocab/validation": true
|
|
4779
|
+
},
|
|
4780
|
+
$dynamicAnchor: "meta",
|
|
4781
|
+
title: "Validation vocabulary meta-schema",
|
|
4782
|
+
type: ["object", "boolean"],
|
|
4783
|
+
properties: {
|
|
4784
|
+
type: {
|
|
4785
|
+
anyOf: [
|
|
4786
|
+
{ $ref: "#/$defs/simpleTypes" },
|
|
4787
|
+
{
|
|
4788
|
+
type: "array",
|
|
4789
|
+
items: { $ref: "#/$defs/simpleTypes" },
|
|
4790
|
+
minItems: 1,
|
|
4791
|
+
uniqueItems: true
|
|
4792
|
+
}
|
|
4793
|
+
]
|
|
4794
|
+
},
|
|
4795
|
+
const: true,
|
|
4796
|
+
enum: {
|
|
4797
|
+
type: "array",
|
|
4798
|
+
items: true
|
|
4799
|
+
},
|
|
4800
|
+
multipleOf: {
|
|
4801
|
+
type: "number",
|
|
4802
|
+
exclusiveMinimum: 0
|
|
4803
|
+
},
|
|
4804
|
+
maximum: {
|
|
4805
|
+
type: "number"
|
|
4806
|
+
},
|
|
4807
|
+
exclusiveMaximum: {
|
|
4808
|
+
type: "number"
|
|
4809
|
+
},
|
|
4810
|
+
minimum: {
|
|
4811
|
+
type: "number"
|
|
4812
|
+
},
|
|
4813
|
+
exclusiveMinimum: {
|
|
4814
|
+
type: "number"
|
|
4815
|
+
},
|
|
4816
|
+
maxLength: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4817
|
+
minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
4818
|
+
pattern: {
|
|
4819
|
+
type: "string",
|
|
4820
|
+
format: "regex"
|
|
4821
|
+
},
|
|
4822
|
+
maxItems: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4823
|
+
minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
4824
|
+
uniqueItems: {
|
|
4825
|
+
type: "boolean",
|
|
4826
|
+
default: false
|
|
4827
|
+
},
|
|
4828
|
+
maxContains: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4829
|
+
minContains: {
|
|
4830
|
+
$ref: "#/$defs/nonNegativeInteger",
|
|
4831
|
+
default: 1
|
|
4832
|
+
},
|
|
4833
|
+
maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
|
|
4834
|
+
minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
4835
|
+
required: { $ref: "#/$defs/stringArray" },
|
|
4836
|
+
dependentRequired: {
|
|
4837
|
+
type: "object",
|
|
4838
|
+
additionalProperties: {
|
|
4839
|
+
$ref: "#/$defs/stringArray"
|
|
4840
|
+
}
|
|
4841
|
+
}
|
|
4842
|
+
},
|
|
4843
|
+
$defs: {
|
|
4844
|
+
nonNegativeInteger: {
|
|
4845
|
+
type: "integer",
|
|
4846
|
+
minimum: 0
|
|
4847
|
+
},
|
|
4848
|
+
nonNegativeIntegerDefault0: {
|
|
4849
|
+
$ref: "#/$defs/nonNegativeInteger",
|
|
4850
|
+
default: 0
|
|
4851
|
+
},
|
|
4852
|
+
simpleTypes: {
|
|
4853
|
+
enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
|
|
4854
|
+
},
|
|
4855
|
+
stringArray: {
|
|
4856
|
+
type: "array",
|
|
4857
|
+
items: { type: "string" },
|
|
4858
|
+
uniqueItems: true,
|
|
4859
|
+
default: []
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
};
|
|
5129
4863
|
}
|
|
5130
4864
|
});
|
|
5131
4865
|
|
|
5132
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5133
|
-
var
|
|
5134
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
4866
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js
|
|
4867
|
+
var require_json_schema_2020_12 = __commonJS({
|
|
4868
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js"(exports) {
|
|
4869
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4870
|
+
var metaSchema = require_schema();
|
|
4871
|
+
var applicator = require_applicator();
|
|
4872
|
+
var unevaluated = require_unevaluated();
|
|
4873
|
+
var content = require_content();
|
|
4874
|
+
var core = require_core2();
|
|
4875
|
+
var format = require_format_annotation();
|
|
4876
|
+
var metadata = require_meta_data();
|
|
4877
|
+
var validation = require_validation();
|
|
4878
|
+
var META_SUPPORT_DATA = ["/properties"];
|
|
4879
|
+
function addMetaSchema20202($data) {
|
|
4880
|
+
[
|
|
4881
|
+
metaSchema,
|
|
4882
|
+
applicator,
|
|
4883
|
+
unevaluated,
|
|
4884
|
+
content,
|
|
4885
|
+
core,
|
|
4886
|
+
with$data(this, format),
|
|
4887
|
+
metadata,
|
|
4888
|
+
with$data(this, validation)
|
|
4889
|
+
].forEach((sch) => this.addMetaSchema(sch, void 0, false));
|
|
4890
|
+
return this;
|
|
4891
|
+
function with$data(ajv2, sch) {
|
|
4892
|
+
return $data ? ajv2.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
|
|
4893
|
+
}
|
|
4894
|
+
}
|
|
4895
|
+
exports.default = addMetaSchema20202;
|
|
4896
|
+
}
|
|
4897
|
+
});
|
|
4898
|
+
|
|
4899
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js
|
|
4900
|
+
var require_id = __commonJS({
|
|
4901
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports) {
|
|
5135
4902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5136
|
-
exports.validateAdditionalItems = void 0;
|
|
5137
|
-
var codegen_1 = require_codegen();
|
|
5138
|
-
var util_1 = require_util();
|
|
5139
|
-
var error2 = {
|
|
5140
|
-
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5141
|
-
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5142
|
-
};
|
|
5143
4903
|
var def = {
|
|
5144
|
-
keyword: "
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
before: "uniqueItems",
|
|
5148
|
-
error: error2,
|
|
5149
|
-
code(cxt) {
|
|
5150
|
-
const { parentSchema, it } = cxt;
|
|
5151
|
-
const { items } = parentSchema;
|
|
5152
|
-
if (!Array.isArray(items)) {
|
|
5153
|
-
(0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
5154
|
-
return;
|
|
5155
|
-
}
|
|
5156
|
-
validateAdditionalItems(cxt, items);
|
|
4904
|
+
keyword: "id",
|
|
4905
|
+
code() {
|
|
4906
|
+
throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
|
|
5157
4907
|
}
|
|
5158
4908
|
};
|
|
5159
|
-
function validateAdditionalItems(cxt, items) {
|
|
5160
|
-
const { gen, schema, data, keyword, it } = cxt;
|
|
5161
|
-
it.items = true;
|
|
5162
|
-
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
5163
|
-
if (schema === false) {
|
|
5164
|
-
cxt.setParams({ len: items.length });
|
|
5165
|
-
cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
|
|
5166
|
-
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5167
|
-
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
|
|
5168
|
-
gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
|
|
5169
|
-
cxt.ok(valid);
|
|
5170
|
-
}
|
|
5171
|
-
function validateItems(valid) {
|
|
5172
|
-
gen.forRange("i", items.length, len, (i) => {
|
|
5173
|
-
cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
|
|
5174
|
-
if (!it.allErrors)
|
|
5175
|
-
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5176
|
-
});
|
|
5177
|
-
}
|
|
5178
|
-
}
|
|
5179
|
-
exports.validateAdditionalItems = validateAdditionalItems;
|
|
5180
4909
|
exports.default = def;
|
|
5181
4910
|
}
|
|
5182
4911
|
});
|
|
5183
4912
|
|
|
5184
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5185
|
-
var
|
|
5186
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
4913
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js
|
|
4914
|
+
var require_ref = __commonJS({
|
|
4915
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js"(exports) {
|
|
5187
4916
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5188
|
-
exports.
|
|
4917
|
+
exports.callRef = exports.getValidate = void 0;
|
|
4918
|
+
var ref_error_1 = require_ref_error();
|
|
4919
|
+
var code_1 = require_code2();
|
|
5189
4920
|
var codegen_1 = require_codegen();
|
|
4921
|
+
var names_1 = require_names();
|
|
4922
|
+
var compile_1 = require_compile();
|
|
5190
4923
|
var util_1 = require_util();
|
|
5191
|
-
var code_1 = require_code2();
|
|
5192
4924
|
var def = {
|
|
5193
|
-
keyword: "
|
|
5194
|
-
|
|
5195
|
-
schemaType: ["object", "array", "boolean"],
|
|
5196
|
-
before: "uniqueItems",
|
|
4925
|
+
keyword: "$ref",
|
|
4926
|
+
schemaType: "string",
|
|
5197
4927
|
code(cxt) {
|
|
5198
|
-
const { schema, it } = cxt;
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
4928
|
+
const { gen, schema: $ref, it } = cxt;
|
|
4929
|
+
const { baseId, schemaEnv: env, validateName, opts, self } = it;
|
|
4930
|
+
const { root } = env;
|
|
4931
|
+
if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
|
|
4932
|
+
return callRootRef();
|
|
4933
|
+
const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
|
|
4934
|
+
if (schOrEnv === void 0)
|
|
4935
|
+
throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
|
|
4936
|
+
if (schOrEnv instanceof compile_1.SchemaEnv)
|
|
4937
|
+
return callValidate(schOrEnv);
|
|
4938
|
+
return inlineRefSchema(schOrEnv);
|
|
4939
|
+
function callRootRef() {
|
|
4940
|
+
if (env === root)
|
|
4941
|
+
return callRef(cxt, validateName, env, env.$async);
|
|
4942
|
+
const rootName = gen.scopeValue("root", { ref: root });
|
|
4943
|
+
return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
|
|
4944
|
+
}
|
|
4945
|
+
function callValidate(sch) {
|
|
4946
|
+
const v = getValidate(cxt, sch);
|
|
4947
|
+
callRef(cxt, v, sch, sch.$async);
|
|
4948
|
+
}
|
|
4949
|
+
function inlineRefSchema(sch) {
|
|
4950
|
+
const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
|
|
4951
|
+
const valid = gen.name("valid");
|
|
4952
|
+
const schCxt = cxt.subschema({
|
|
4953
|
+
schema: sch,
|
|
4954
|
+
dataTypes: [],
|
|
4955
|
+
schemaPath: codegen_1.nil,
|
|
4956
|
+
topSchemaRef: schName,
|
|
4957
|
+
errSchemaPath: $ref
|
|
4958
|
+
}, valid);
|
|
4959
|
+
cxt.mergeEvaluated(schCxt);
|
|
4960
|
+
cxt.ok(valid);
|
|
4961
|
+
}
|
|
5205
4962
|
}
|
|
5206
4963
|
};
|
|
5207
|
-
function
|
|
5208
|
-
const { gen
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
4964
|
+
function getValidate(cxt, sch) {
|
|
4965
|
+
const { gen } = cxt;
|
|
4966
|
+
return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
|
|
4967
|
+
}
|
|
4968
|
+
exports.getValidate = getValidate;
|
|
4969
|
+
function callRef(cxt, v, sch, $async) {
|
|
4970
|
+
const { gen, it } = cxt;
|
|
4971
|
+
const { allErrors, schemaEnv: env, opts } = it;
|
|
4972
|
+
const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
|
|
4973
|
+
if ($async)
|
|
4974
|
+
callAsyncRef();
|
|
4975
|
+
else
|
|
4976
|
+
callSyncRef();
|
|
4977
|
+
function callAsyncRef() {
|
|
4978
|
+
if (!env.$async)
|
|
4979
|
+
throw new Error("async schema referenced by sync schema");
|
|
4980
|
+
const valid = gen.let("valid");
|
|
4981
|
+
gen.try(() => {
|
|
4982
|
+
gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
|
|
4983
|
+
addEvaluatedFrom(v);
|
|
4984
|
+
if (!allErrors)
|
|
4985
|
+
gen.assign(valid, true);
|
|
4986
|
+
}, (e) => {
|
|
4987
|
+
gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
|
|
4988
|
+
addErrorsFrom(e);
|
|
4989
|
+
if (!allErrors)
|
|
4990
|
+
gen.assign(valid, false);
|
|
4991
|
+
});
|
|
4992
|
+
cxt.ok(valid);
|
|
5212
4993
|
}
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
4994
|
+
function callSyncRef() {
|
|
4995
|
+
cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
|
|
4996
|
+
}
|
|
4997
|
+
function addErrorsFrom(source) {
|
|
4998
|
+
const errs = (0, codegen_1._)`${source}.errors`;
|
|
4999
|
+
gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
|
|
5000
|
+
gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
|
|
5001
|
+
}
|
|
5002
|
+
function addEvaluatedFrom(source) {
|
|
5003
|
+
var _a;
|
|
5004
|
+
if (!it.opts.unevaluated)
|
|
5217
5005
|
return;
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
if (
|
|
5230
|
-
|
|
5231
|
-
|
|
5006
|
+
const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
|
|
5007
|
+
if (it.props !== true) {
|
|
5008
|
+
if (schEvaluated && !schEvaluated.dynamicProps) {
|
|
5009
|
+
if (schEvaluated.props !== void 0) {
|
|
5010
|
+
it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
|
|
5011
|
+
}
|
|
5012
|
+
} else {
|
|
5013
|
+
const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`);
|
|
5014
|
+
it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
if (it.items !== true) {
|
|
5018
|
+
if (schEvaluated && !schEvaluated.dynamicItems) {
|
|
5019
|
+
if (schEvaluated.items !== void 0) {
|
|
5020
|
+
it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
|
|
5021
|
+
}
|
|
5022
|
+
} else {
|
|
5023
|
+
const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
|
|
5024
|
+
it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
|
|
5025
|
+
}
|
|
5232
5026
|
}
|
|
5233
5027
|
}
|
|
5234
5028
|
}
|
|
5235
|
-
exports.
|
|
5029
|
+
exports.callRef = callRef;
|
|
5236
5030
|
exports.default = def;
|
|
5237
5031
|
}
|
|
5238
5032
|
});
|
|
5239
5033
|
|
|
5240
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5241
|
-
var
|
|
5242
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5034
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js
|
|
5035
|
+
var require_core3 = __commonJS({
|
|
5036
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports) {
|
|
5243
5037
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5244
|
-
var
|
|
5038
|
+
var id_1 = require_id();
|
|
5039
|
+
var ref_1 = require_ref();
|
|
5040
|
+
var core = [
|
|
5041
|
+
"$schema",
|
|
5042
|
+
"$id",
|
|
5043
|
+
"$defs",
|
|
5044
|
+
"$vocabulary",
|
|
5045
|
+
{ keyword: "$comment" },
|
|
5046
|
+
"definitions",
|
|
5047
|
+
id_1.default,
|
|
5048
|
+
ref_1.default
|
|
5049
|
+
];
|
|
5050
|
+
exports.default = core;
|
|
5051
|
+
}
|
|
5052
|
+
});
|
|
5053
|
+
|
|
5054
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
|
|
5055
|
+
var require_limitNumber = __commonJS({
|
|
5056
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports) {
|
|
5057
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5058
|
+
var codegen_1 = require_codegen();
|
|
5059
|
+
var ops = codegen_1.operators;
|
|
5060
|
+
var KWDs = {
|
|
5061
|
+
maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
|
|
5062
|
+
minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
|
|
5063
|
+
exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
5064
|
+
exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
5065
|
+
};
|
|
5066
|
+
var error2 = {
|
|
5067
|
+
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
5068
|
+
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
5069
|
+
};
|
|
5245
5070
|
var def = {
|
|
5246
|
-
keyword:
|
|
5247
|
-
type: "
|
|
5248
|
-
schemaType:
|
|
5249
|
-
|
|
5250
|
-
|
|
5071
|
+
keyword: Object.keys(KWDs),
|
|
5072
|
+
type: "number",
|
|
5073
|
+
schemaType: "number",
|
|
5074
|
+
$data: true,
|
|
5075
|
+
error: error2,
|
|
5076
|
+
code(cxt) {
|
|
5077
|
+
const { keyword, data, schemaCode } = cxt;
|
|
5078
|
+
cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
|
|
5079
|
+
}
|
|
5251
5080
|
};
|
|
5252
5081
|
exports.default = def;
|
|
5253
5082
|
}
|
|
5254
5083
|
});
|
|
5255
5084
|
|
|
5256
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5257
|
-
var
|
|
5258
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5085
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
|
|
5086
|
+
var require_multipleOf = __commonJS({
|
|
5087
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports) {
|
|
5259
5088
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5260
5089
|
var codegen_1 = require_codegen();
|
|
5261
|
-
var util_1 = require_util();
|
|
5262
|
-
var code_1 = require_code2();
|
|
5263
|
-
var additionalItems_1 = require_additionalItems();
|
|
5264
5090
|
var error2 = {
|
|
5265
|
-
message: ({
|
|
5266
|
-
params: ({
|
|
5091
|
+
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
5092
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
5267
5093
|
};
|
|
5268
5094
|
var def = {
|
|
5269
|
-
keyword: "
|
|
5270
|
-
type: "
|
|
5271
|
-
schemaType:
|
|
5272
|
-
|
|
5095
|
+
keyword: "multipleOf",
|
|
5096
|
+
type: "number",
|
|
5097
|
+
schemaType: "number",
|
|
5098
|
+
$data: true,
|
|
5273
5099
|
error: error2,
|
|
5274
5100
|
code(cxt) {
|
|
5275
|
-
const {
|
|
5276
|
-
const
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
if (prefixItems)
|
|
5281
|
-
(0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
|
|
5282
|
-
else
|
|
5283
|
-
cxt.ok((0, code_1.validateArray)(cxt));
|
|
5101
|
+
const { gen, data, schemaCode, it } = cxt;
|
|
5102
|
+
const prec = it.opts.multipleOfPrecision;
|
|
5103
|
+
const res = gen.let("res");
|
|
5104
|
+
const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
|
|
5105
|
+
cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
|
|
5284
5106
|
}
|
|
5285
5107
|
};
|
|
5286
5108
|
exports.default = def;
|
|
5287
5109
|
}
|
|
5288
5110
|
});
|
|
5289
5111
|
|
|
5290
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5291
|
-
var
|
|
5292
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5112
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js
|
|
5113
|
+
var require_ucs2length = __commonJS({
|
|
5114
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
|
|
5115
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5116
|
+
function ucs2length(str) {
|
|
5117
|
+
const len = str.length;
|
|
5118
|
+
let length = 0;
|
|
5119
|
+
let pos = 0;
|
|
5120
|
+
let value;
|
|
5121
|
+
while (pos < len) {
|
|
5122
|
+
length++;
|
|
5123
|
+
value = str.charCodeAt(pos++);
|
|
5124
|
+
if (value >= 55296 && value <= 56319 && pos < len) {
|
|
5125
|
+
value = str.charCodeAt(pos);
|
|
5126
|
+
if ((value & 64512) === 56320)
|
|
5127
|
+
pos++;
|
|
5128
|
+
}
|
|
5129
|
+
}
|
|
5130
|
+
return length;
|
|
5131
|
+
}
|
|
5132
|
+
exports.default = ucs2length;
|
|
5133
|
+
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
5134
|
+
}
|
|
5135
|
+
});
|
|
5136
|
+
|
|
5137
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js
|
|
5138
|
+
var require_limitLength = __commonJS({
|
|
5139
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports) {
|
|
5293
5140
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5294
5141
|
var codegen_1 = require_codegen();
|
|
5295
5142
|
var util_1 = require_util();
|
|
5143
|
+
var ucs2length_1 = require_ucs2length();
|
|
5296
5144
|
var error2 = {
|
|
5297
|
-
message
|
|
5298
|
-
|
|
5145
|
+
message({ keyword, schemaCode }) {
|
|
5146
|
+
const comp = keyword === "maxLength" ? "more" : "fewer";
|
|
5147
|
+
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
|
|
5148
|
+
},
|
|
5149
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
|
|
5299
5150
|
};
|
|
5300
5151
|
var def = {
|
|
5301
|
-
keyword: "
|
|
5302
|
-
type: "
|
|
5303
|
-
schemaType:
|
|
5304
|
-
|
|
5305
|
-
trackErrors: true,
|
|
5152
|
+
keyword: ["maxLength", "minLength"],
|
|
5153
|
+
type: "string",
|
|
5154
|
+
schemaType: "number",
|
|
5155
|
+
$data: true,
|
|
5306
5156
|
error: error2,
|
|
5307
5157
|
code(cxt) {
|
|
5308
|
-
const {
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
if (it.opts.next) {
|
|
5313
|
-
min = minContains === void 0 ? 1 : minContains;
|
|
5314
|
-
max = maxContains;
|
|
5315
|
-
} else {
|
|
5316
|
-
min = 1;
|
|
5317
|
-
}
|
|
5318
|
-
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
5319
|
-
cxt.setParams({ min, max });
|
|
5320
|
-
if (max === void 0 && min === 0) {
|
|
5321
|
-
(0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
|
|
5322
|
-
return;
|
|
5323
|
-
}
|
|
5324
|
-
if (max !== void 0 && min > max) {
|
|
5325
|
-
(0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
|
|
5326
|
-
cxt.fail();
|
|
5327
|
-
return;
|
|
5328
|
-
}
|
|
5329
|
-
if ((0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5330
|
-
let cond = (0, codegen_1._)`${len} >= ${min}`;
|
|
5331
|
-
if (max !== void 0)
|
|
5332
|
-
cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
|
|
5333
|
-
cxt.pass(cond);
|
|
5334
|
-
return;
|
|
5335
|
-
}
|
|
5336
|
-
it.items = true;
|
|
5337
|
-
const valid = gen.name("valid");
|
|
5338
|
-
if (max === void 0 && min === 1) {
|
|
5339
|
-
validateItems(valid, () => gen.if(valid, () => gen.break()));
|
|
5340
|
-
} else if (min === 0) {
|
|
5341
|
-
gen.let(valid, true);
|
|
5342
|
-
if (max !== void 0)
|
|
5343
|
-
gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);
|
|
5344
|
-
} else {
|
|
5345
|
-
gen.let(valid, false);
|
|
5346
|
-
validateItemsWithCount();
|
|
5347
|
-
}
|
|
5348
|
-
cxt.result(valid, () => cxt.reset());
|
|
5349
|
-
function validateItemsWithCount() {
|
|
5350
|
-
const schValid = gen.name("_valid");
|
|
5351
|
-
const count = gen.let("count", 0);
|
|
5352
|
-
validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
|
|
5353
|
-
}
|
|
5354
|
-
function validateItems(_valid, block) {
|
|
5355
|
-
gen.forRange("i", 0, len, (i) => {
|
|
5356
|
-
cxt.subschema({
|
|
5357
|
-
keyword: "contains",
|
|
5358
|
-
dataProp: i,
|
|
5359
|
-
dataPropType: util_1.Type.Num,
|
|
5360
|
-
compositeRule: true
|
|
5361
|
-
}, _valid);
|
|
5362
|
-
block();
|
|
5363
|
-
});
|
|
5364
|
-
}
|
|
5365
|
-
function checkLimits(count) {
|
|
5366
|
-
gen.code((0, codegen_1._)`${count}++`);
|
|
5367
|
-
if (max === void 0) {
|
|
5368
|
-
gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
|
|
5369
|
-
} else {
|
|
5370
|
-
gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
|
|
5371
|
-
if (min === 1)
|
|
5372
|
-
gen.assign(valid, true);
|
|
5373
|
-
else
|
|
5374
|
-
gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
|
|
5375
|
-
}
|
|
5376
|
-
}
|
|
5158
|
+
const { keyword, data, schemaCode, it } = cxt;
|
|
5159
|
+
const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
5160
|
+
const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
|
|
5161
|
+
cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`);
|
|
5377
5162
|
}
|
|
5378
5163
|
};
|
|
5379
5164
|
exports.default = def;
|
|
5380
5165
|
}
|
|
5381
5166
|
});
|
|
5382
5167
|
|
|
5383
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5384
|
-
var
|
|
5385
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5168
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js
|
|
5169
|
+
var require_pattern = __commonJS({
|
|
5170
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports) {
|
|
5386
5171
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5387
|
-
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
5388
|
-
var codegen_1 = require_codegen();
|
|
5389
|
-
var util_1 = require_util();
|
|
5390
5172
|
var code_1 = require_code2();
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
},
|
|
5396
|
-
params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
|
|
5397
|
-
missingProperty: ${missingProperty},
|
|
5398
|
-
depsCount: ${depsCount},
|
|
5399
|
-
deps: ${deps}}`
|
|
5400
|
-
// TODO change to reference
|
|
5173
|
+
var util_1 = require_util();
|
|
5174
|
+
var codegen_1 = require_codegen();
|
|
5175
|
+
var error2 = {
|
|
5176
|
+
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
5177
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
|
|
5401
5178
|
};
|
|
5402
5179
|
var def = {
|
|
5403
|
-
keyword: "
|
|
5404
|
-
type: "
|
|
5405
|
-
schemaType: "
|
|
5406
|
-
|
|
5180
|
+
keyword: "pattern",
|
|
5181
|
+
type: "string",
|
|
5182
|
+
schemaType: "string",
|
|
5183
|
+
$data: true,
|
|
5184
|
+
error: error2,
|
|
5407
5185
|
code(cxt) {
|
|
5408
|
-
const
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
for (const key in schema) {
|
|
5417
|
-
if (key === "__proto__")
|
|
5418
|
-
continue;
|
|
5419
|
-
const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
|
|
5420
|
-
deps[key] = schema[key];
|
|
5421
|
-
}
|
|
5422
|
-
return [propertyDeps, schemaDeps];
|
|
5423
|
-
}
|
|
5424
|
-
function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
|
|
5425
|
-
const { gen, data, it } = cxt;
|
|
5426
|
-
if (Object.keys(propertyDeps).length === 0)
|
|
5427
|
-
return;
|
|
5428
|
-
const missing = gen.let("missing");
|
|
5429
|
-
for (const prop in propertyDeps) {
|
|
5430
|
-
const deps = propertyDeps[prop];
|
|
5431
|
-
if (deps.length === 0)
|
|
5432
|
-
continue;
|
|
5433
|
-
const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
|
|
5434
|
-
cxt.setParams({
|
|
5435
|
-
property: prop,
|
|
5436
|
-
depsCount: deps.length,
|
|
5437
|
-
deps: deps.join(", ")
|
|
5438
|
-
});
|
|
5439
|
-
if (it.allErrors) {
|
|
5440
|
-
gen.if(hasProperty, () => {
|
|
5441
|
-
for (const depProp of deps) {
|
|
5442
|
-
(0, code_1.checkReportMissingProp)(cxt, depProp);
|
|
5443
|
-
}
|
|
5444
|
-
});
|
|
5186
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5187
|
+
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
5188
|
+
if ($data) {
|
|
5189
|
+
const { regExp } = it.opts.code;
|
|
5190
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
5191
|
+
const valid = gen.let("valid");
|
|
5192
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
5193
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
5445
5194
|
} else {
|
|
5446
|
-
|
|
5447
|
-
(0,
|
|
5448
|
-
gen.else();
|
|
5195
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
5196
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
5449
5197
|
}
|
|
5450
5198
|
}
|
|
5451
|
-
}
|
|
5452
|
-
exports.validatePropertyDeps = validatePropertyDeps;
|
|
5453
|
-
function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
|
|
5454
|
-
const { gen, data, keyword, it } = cxt;
|
|
5455
|
-
const valid = gen.name("valid");
|
|
5456
|
-
for (const prop in schemaDeps) {
|
|
5457
|
-
if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
|
|
5458
|
-
continue;
|
|
5459
|
-
gen.if(
|
|
5460
|
-
(0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties),
|
|
5461
|
-
() => {
|
|
5462
|
-
const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
|
|
5463
|
-
cxt.mergeValidEvaluated(schCxt, valid);
|
|
5464
|
-
},
|
|
5465
|
-
() => gen.var(valid, true)
|
|
5466
|
-
// TODO var
|
|
5467
|
-
);
|
|
5468
|
-
cxt.ok(valid);
|
|
5469
|
-
}
|
|
5470
|
-
}
|
|
5471
|
-
exports.validateSchemaDeps = validateSchemaDeps;
|
|
5199
|
+
};
|
|
5472
5200
|
exports.default = def;
|
|
5473
5201
|
}
|
|
5474
5202
|
});
|
|
5475
5203
|
|
|
5476
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5477
|
-
var
|
|
5478
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5204
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
|
|
5205
|
+
var require_limitProperties = __commonJS({
|
|
5206
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports) {
|
|
5479
5207
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5480
5208
|
var codegen_1 = require_codegen();
|
|
5481
|
-
var util_1 = require_util();
|
|
5482
5209
|
var error2 = {
|
|
5483
|
-
message
|
|
5484
|
-
|
|
5210
|
+
message({ keyword, schemaCode }) {
|
|
5211
|
+
const comp = keyword === "maxProperties" ? "more" : "fewer";
|
|
5212
|
+
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
|
|
5213
|
+
},
|
|
5214
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
|
|
5485
5215
|
};
|
|
5486
5216
|
var def = {
|
|
5487
|
-
keyword: "
|
|
5217
|
+
keyword: ["maxProperties", "minProperties"],
|
|
5488
5218
|
type: "object",
|
|
5489
|
-
schemaType:
|
|
5219
|
+
schemaType: "number",
|
|
5220
|
+
$data: true,
|
|
5490
5221
|
error: error2,
|
|
5491
5222
|
code(cxt) {
|
|
5492
|
-
const {
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
const valid = gen.name("valid");
|
|
5496
|
-
gen.forIn("key", data, (key) => {
|
|
5497
|
-
cxt.setParams({ propertyName: key });
|
|
5498
|
-
cxt.subschema({
|
|
5499
|
-
keyword: "propertyNames",
|
|
5500
|
-
data: key,
|
|
5501
|
-
dataTypes: ["string"],
|
|
5502
|
-
propertyName: key,
|
|
5503
|
-
compositeRule: true
|
|
5504
|
-
}, valid);
|
|
5505
|
-
gen.if((0, codegen_1.not)(valid), () => {
|
|
5506
|
-
cxt.error(true);
|
|
5507
|
-
if (!it.allErrors)
|
|
5508
|
-
gen.break();
|
|
5509
|
-
});
|
|
5510
|
-
});
|
|
5511
|
-
cxt.ok(valid);
|
|
5223
|
+
const { keyword, data, schemaCode } = cxt;
|
|
5224
|
+
const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
5225
|
+
cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);
|
|
5512
5226
|
}
|
|
5513
5227
|
};
|
|
5514
5228
|
exports.default = def;
|
|
5515
5229
|
}
|
|
5516
5230
|
});
|
|
5517
5231
|
|
|
5518
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5519
|
-
var
|
|
5520
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5232
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js
|
|
5233
|
+
var require_required = __commonJS({
|
|
5234
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js"(exports) {
|
|
5521
5235
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5522
5236
|
var code_1 = require_code2();
|
|
5523
5237
|
var codegen_1 = require_codegen();
|
|
5524
|
-
var names_1 = require_names();
|
|
5525
5238
|
var util_1 = require_util();
|
|
5526
5239
|
var error2 = {
|
|
5527
|
-
message:
|
|
5528
|
-
params: ({ params }) => (0, codegen_1._)`{
|
|
5240
|
+
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
5241
|
+
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
5529
5242
|
};
|
|
5530
5243
|
var def = {
|
|
5531
|
-
keyword: "
|
|
5532
|
-
type:
|
|
5533
|
-
schemaType:
|
|
5534
|
-
|
|
5535
|
-
trackErrors: true,
|
|
5244
|
+
keyword: "required",
|
|
5245
|
+
type: "object",
|
|
5246
|
+
schemaType: "array",
|
|
5247
|
+
$data: true,
|
|
5536
5248
|
error: error2,
|
|
5537
5249
|
code(cxt) {
|
|
5538
|
-
const { gen, schema,
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
const { allErrors, opts } = it;
|
|
5542
|
-
it.props = true;
|
|
5543
|
-
if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
|
|
5250
|
+
const { gen, schema, schemaCode, data, $data, it } = cxt;
|
|
5251
|
+
const { opts } = it;
|
|
5252
|
+
if (!$data && schema.length === 0)
|
|
5544
5253
|
return;
|
|
5545
|
-
const
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5254
|
+
const useLoop = schema.length >= opts.loopRequired;
|
|
5255
|
+
if (it.allErrors)
|
|
5256
|
+
allErrorsMode();
|
|
5257
|
+
else
|
|
5258
|
+
exitOnErrorMode();
|
|
5259
|
+
if (opts.strictRequired) {
|
|
5260
|
+
const props = cxt.parentSchema.properties;
|
|
5261
|
+
const { definedProperties } = cxt.it;
|
|
5262
|
+
for (const requiredKey of schema) {
|
|
5263
|
+
if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {
|
|
5264
|
+
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
|
|
5265
|
+
const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
|
|
5266
|
+
(0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
|
|
5267
|
+
}
|
|
5268
|
+
}
|
|
5556
5269
|
}
|
|
5557
|
-
function
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
5561
|
-
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
|
|
5562
|
-
} else if (props.length) {
|
|
5563
|
-
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
|
|
5270
|
+
function allErrorsMode() {
|
|
5271
|
+
if (useLoop || $data) {
|
|
5272
|
+
cxt.block$data(codegen_1.nil, loopAllRequired);
|
|
5564
5273
|
} else {
|
|
5565
|
-
|
|
5274
|
+
for (const prop of schema) {
|
|
5275
|
+
(0, code_1.checkReportMissingProp)(cxt, prop);
|
|
5276
|
+
}
|
|
5566
5277
|
}
|
|
5567
|
-
|
|
5568
|
-
|
|
5278
|
+
}
|
|
5279
|
+
function exitOnErrorMode() {
|
|
5280
|
+
const missing = gen.let("missing");
|
|
5281
|
+
if (useLoop || $data) {
|
|
5282
|
+
const valid = gen.let("valid", true);
|
|
5283
|
+
cxt.block$data(valid, () => loopUntilMissing(missing, valid));
|
|
5284
|
+
cxt.ok(valid);
|
|
5285
|
+
} else {
|
|
5286
|
+
gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
|
|
5287
|
+
(0, code_1.reportMissingProp)(cxt, missing);
|
|
5288
|
+
gen.else();
|
|
5569
5289
|
}
|
|
5570
|
-
return (0, codegen_1.not)(definedProp);
|
|
5571
5290
|
}
|
|
5572
|
-
function
|
|
5573
|
-
gen.
|
|
5291
|
+
function loopAllRequired() {
|
|
5292
|
+
gen.forOf("prop", schemaCode, (prop) => {
|
|
5293
|
+
cxt.setParams({ missingProperty: prop });
|
|
5294
|
+
gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
|
|
5295
|
+
});
|
|
5574
5296
|
}
|
|
5575
|
-
function
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
cxt.setParams({ additionalProperty: key });
|
|
5582
|
-
cxt.error();
|
|
5583
|
-
if (!allErrors)
|
|
5297
|
+
function loopUntilMissing(missing, valid) {
|
|
5298
|
+
cxt.setParams({ missingProperty: missing });
|
|
5299
|
+
gen.forOf(missing, schemaCode, () => {
|
|
5300
|
+
gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
|
|
5301
|
+
gen.if((0, codegen_1.not)(valid), () => {
|
|
5302
|
+
cxt.error();
|
|
5584
5303
|
gen.break();
|
|
5585
|
-
return;
|
|
5586
|
-
}
|
|
5587
|
-
if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5588
|
-
const valid = gen.name("valid");
|
|
5589
|
-
if (opts.removeAdditional === "failing") {
|
|
5590
|
-
applyAdditionalSchema(key, valid, false);
|
|
5591
|
-
gen.if((0, codegen_1.not)(valid), () => {
|
|
5592
|
-
cxt.reset();
|
|
5593
|
-
deleteAdditional(key);
|
|
5594
|
-
});
|
|
5595
|
-
} else {
|
|
5596
|
-
applyAdditionalSchema(key, valid);
|
|
5597
|
-
if (!allErrors)
|
|
5598
|
-
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5599
|
-
}
|
|
5600
|
-
}
|
|
5601
|
-
}
|
|
5602
|
-
function applyAdditionalSchema(key, valid, errors) {
|
|
5603
|
-
const subschema = {
|
|
5604
|
-
keyword: "additionalProperties",
|
|
5605
|
-
dataProp: key,
|
|
5606
|
-
dataPropType: util_1.Type.Str
|
|
5607
|
-
};
|
|
5608
|
-
if (errors === false) {
|
|
5609
|
-
Object.assign(subschema, {
|
|
5610
|
-
compositeRule: true,
|
|
5611
|
-
createErrors: false,
|
|
5612
|
-
allErrors: false
|
|
5613
5304
|
});
|
|
5614
|
-
}
|
|
5615
|
-
cxt.subschema(subschema, valid);
|
|
5305
|
+
}, codegen_1.nil);
|
|
5616
5306
|
}
|
|
5617
5307
|
}
|
|
5618
5308
|
};
|
|
@@ -5620,232 +5310,179 @@ var require_additionalProperties = __commonJS({
|
|
|
5620
5310
|
}
|
|
5621
5311
|
});
|
|
5622
5312
|
|
|
5623
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5624
|
-
var
|
|
5625
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5313
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js
|
|
5314
|
+
var require_limitItems = __commonJS({
|
|
5315
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports) {
|
|
5626
5316
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5627
|
-
var
|
|
5628
|
-
var
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
5646
|
-
}
|
|
5647
|
-
const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
5648
|
-
if (properties.length === 0)
|
|
5649
|
-
return;
|
|
5650
|
-
const valid = gen.name("valid");
|
|
5651
|
-
for (const prop of properties) {
|
|
5652
|
-
if (hasDefault(prop)) {
|
|
5653
|
-
applyPropertySchema(prop);
|
|
5654
|
-
} else {
|
|
5655
|
-
gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
|
|
5656
|
-
applyPropertySchema(prop);
|
|
5657
|
-
if (!it.allErrors)
|
|
5658
|
-
gen.else().var(valid, true);
|
|
5659
|
-
gen.endIf();
|
|
5660
|
-
}
|
|
5661
|
-
cxt.it.definedProperties.add(prop);
|
|
5662
|
-
cxt.ok(valid);
|
|
5663
|
-
}
|
|
5664
|
-
function hasDefault(prop) {
|
|
5665
|
-
return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
|
|
5666
|
-
}
|
|
5667
|
-
function applyPropertySchema(prop) {
|
|
5668
|
-
cxt.subschema({
|
|
5669
|
-
keyword: "properties",
|
|
5670
|
-
schemaProp: prop,
|
|
5671
|
-
dataProp: prop
|
|
5672
|
-
}, valid);
|
|
5673
|
-
}
|
|
5317
|
+
var codegen_1 = require_codegen();
|
|
5318
|
+
var error2 = {
|
|
5319
|
+
message({ keyword, schemaCode }) {
|
|
5320
|
+
const comp = keyword === "maxItems" ? "more" : "fewer";
|
|
5321
|
+
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
|
|
5322
|
+
},
|
|
5323
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
|
|
5324
|
+
};
|
|
5325
|
+
var def = {
|
|
5326
|
+
keyword: ["maxItems", "minItems"],
|
|
5327
|
+
type: "array",
|
|
5328
|
+
schemaType: "number",
|
|
5329
|
+
$data: true,
|
|
5330
|
+
error: error2,
|
|
5331
|
+
code(cxt) {
|
|
5332
|
+
const { keyword, data, schemaCode } = cxt;
|
|
5333
|
+
const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
5334
|
+
cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);
|
|
5674
5335
|
}
|
|
5675
5336
|
};
|
|
5676
5337
|
exports.default = def;
|
|
5677
5338
|
}
|
|
5678
5339
|
});
|
|
5679
5340
|
|
|
5680
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5681
|
-
var
|
|
5682
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
5341
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js
|
|
5342
|
+
var require_equal = __commonJS({
|
|
5343
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js"(exports) {
|
|
5683
5344
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5684
|
-
var
|
|
5345
|
+
var equal = require_fast_deep_equal();
|
|
5346
|
+
equal.code = 'require("ajv/dist/runtime/equal").default';
|
|
5347
|
+
exports.default = equal;
|
|
5348
|
+
}
|
|
5349
|
+
});
|
|
5350
|
+
|
|
5351
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
|
|
5352
|
+
var require_uniqueItems = __commonJS({
|
|
5353
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports) {
|
|
5354
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5355
|
+
var dataType_1 = require_dataType();
|
|
5685
5356
|
var codegen_1 = require_codegen();
|
|
5686
5357
|
var util_1 = require_util();
|
|
5687
|
-
var
|
|
5358
|
+
var equal_1 = require_equal();
|
|
5359
|
+
var error2 = {
|
|
5360
|
+
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
5361
|
+
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
5362
|
+
};
|
|
5688
5363
|
var def = {
|
|
5689
|
-
keyword: "
|
|
5690
|
-
type: "
|
|
5691
|
-
schemaType: "
|
|
5364
|
+
keyword: "uniqueItems",
|
|
5365
|
+
type: "array",
|
|
5366
|
+
schemaType: "boolean",
|
|
5367
|
+
$data: true,
|
|
5368
|
+
error: error2,
|
|
5692
5369
|
code(cxt) {
|
|
5693
|
-
const { gen,
|
|
5694
|
-
|
|
5695
|
-
const patterns = (0, code_1.allSchemaProperties)(schema);
|
|
5696
|
-
const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
5697
|
-
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
|
|
5370
|
+
const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
|
|
5371
|
+
if (!$data && !schema)
|
|
5698
5372
|
return;
|
|
5373
|
+
const valid = gen.let("valid");
|
|
5374
|
+
const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
|
|
5375
|
+
cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`);
|
|
5376
|
+
cxt.ok(valid);
|
|
5377
|
+
function validateUniqueItems() {
|
|
5378
|
+
const i = gen.let("i", (0, codegen_1._)`${data}.length`);
|
|
5379
|
+
const j = gen.let("j");
|
|
5380
|
+
cxt.setParams({ i, j });
|
|
5381
|
+
gen.assign(valid, true);
|
|
5382
|
+
gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
|
|
5699
5383
|
}
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
|
|
5703
|
-
it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
|
|
5704
|
-
}
|
|
5705
|
-
const { props } = it;
|
|
5706
|
-
validatePatternProperties();
|
|
5707
|
-
function validatePatternProperties() {
|
|
5708
|
-
for (const pat of patterns) {
|
|
5709
|
-
if (checkProperties)
|
|
5710
|
-
checkMatchingProperties(pat);
|
|
5711
|
-
if (it.allErrors) {
|
|
5712
|
-
validateProperties(pat);
|
|
5713
|
-
} else {
|
|
5714
|
-
gen.var(valid, true);
|
|
5715
|
-
validateProperties(pat);
|
|
5716
|
-
gen.if(valid);
|
|
5717
|
-
}
|
|
5718
|
-
}
|
|
5719
|
-
}
|
|
5720
|
-
function checkMatchingProperties(pat) {
|
|
5721
|
-
for (const prop in checkProperties) {
|
|
5722
|
-
if (new RegExp(pat).test(prop)) {
|
|
5723
|
-
(0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
|
|
5724
|
-
}
|
|
5725
|
-
}
|
|
5384
|
+
function canOptimize() {
|
|
5385
|
+
return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
|
|
5726
5386
|
}
|
|
5727
|
-
function
|
|
5728
|
-
gen.
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
} else if (!alwaysValid && !it.allErrors) {
|
|
5742
|
-
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5743
|
-
}
|
|
5744
|
-
});
|
|
5387
|
+
function loopN(i, j) {
|
|
5388
|
+
const item = gen.name("item");
|
|
5389
|
+
const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
|
|
5390
|
+
const indices = gen.const("indices", (0, codegen_1._)`{}`);
|
|
5391
|
+
gen.for((0, codegen_1._)`;${i}--;`, () => {
|
|
5392
|
+
gen.let(item, (0, codegen_1._)`${data}[${i}]`);
|
|
5393
|
+
gen.if(wrongType, (0, codegen_1._)`continue`);
|
|
5394
|
+
if (itemTypes.length > 1)
|
|
5395
|
+
gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
|
|
5396
|
+
gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
|
|
5397
|
+
gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
|
|
5398
|
+
cxt.error();
|
|
5399
|
+
gen.assign(valid, false).break();
|
|
5400
|
+
}).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
|
|
5745
5401
|
});
|
|
5746
5402
|
}
|
|
5403
|
+
function loopN2(i, j) {
|
|
5404
|
+
const eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
5405
|
+
const outer = gen.name("outer");
|
|
5406
|
+
gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
|
|
5407
|
+
cxt.error();
|
|
5408
|
+
gen.assign(valid, false).break(outer);
|
|
5409
|
+
})));
|
|
5410
|
+
}
|
|
5747
5411
|
}
|
|
5748
5412
|
};
|
|
5749
5413
|
exports.default = def;
|
|
5750
5414
|
}
|
|
5751
5415
|
});
|
|
5752
5416
|
|
|
5753
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5754
|
-
var
|
|
5755
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5417
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js
|
|
5418
|
+
var require_const = __commonJS({
|
|
5419
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js"(exports) {
|
|
5756
5420
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5421
|
+
var codegen_1 = require_codegen();
|
|
5757
5422
|
var util_1 = require_util();
|
|
5423
|
+
var equal_1 = require_equal();
|
|
5424
|
+
var error2 = {
|
|
5425
|
+
message: "must be equal to constant",
|
|
5426
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
|
|
5427
|
+
};
|
|
5758
5428
|
var def = {
|
|
5759
|
-
keyword: "
|
|
5760
|
-
|
|
5761
|
-
|
|
5429
|
+
keyword: "const",
|
|
5430
|
+
$data: true,
|
|
5431
|
+
error: error2,
|
|
5762
5432
|
code(cxt) {
|
|
5763
|
-
const { gen,
|
|
5764
|
-
if (
|
|
5765
|
-
cxt.fail();
|
|
5766
|
-
|
|
5433
|
+
const { gen, data, $data, schemaCode, schema } = cxt;
|
|
5434
|
+
if ($data || schema && typeof schema == "object") {
|
|
5435
|
+
cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
|
|
5436
|
+
} else {
|
|
5437
|
+
cxt.fail((0, codegen_1._)`${schema} !== ${data}`);
|
|
5767
5438
|
}
|
|
5768
|
-
|
|
5769
|
-
cxt.subschema({
|
|
5770
|
-
keyword: "not",
|
|
5771
|
-
compositeRule: true,
|
|
5772
|
-
createErrors: false,
|
|
5773
|
-
allErrors: false
|
|
5774
|
-
}, valid);
|
|
5775
|
-
cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
|
|
5776
|
-
},
|
|
5777
|
-
error: { message: "must NOT be valid" }
|
|
5778
|
-
};
|
|
5779
|
-
exports.default = def;
|
|
5780
|
-
}
|
|
5781
|
-
});
|
|
5782
|
-
|
|
5783
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
|
|
5784
|
-
var require_anyOf = __commonJS({
|
|
5785
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
|
|
5786
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5787
|
-
var code_1 = require_code2();
|
|
5788
|
-
var def = {
|
|
5789
|
-
keyword: "anyOf",
|
|
5790
|
-
schemaType: "array",
|
|
5791
|
-
trackErrors: true,
|
|
5792
|
-
code: code_1.validateUnion,
|
|
5793
|
-
error: { message: "must match a schema in anyOf" }
|
|
5439
|
+
}
|
|
5794
5440
|
};
|
|
5795
5441
|
exports.default = def;
|
|
5796
5442
|
}
|
|
5797
5443
|
});
|
|
5798
5444
|
|
|
5799
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5800
|
-
var
|
|
5801
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5445
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js
|
|
5446
|
+
var require_enum = __commonJS({
|
|
5447
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports) {
|
|
5802
5448
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5803
5449
|
var codegen_1 = require_codegen();
|
|
5804
5450
|
var util_1 = require_util();
|
|
5451
|
+
var equal_1 = require_equal();
|
|
5805
5452
|
var error2 = {
|
|
5806
|
-
message: "must
|
|
5807
|
-
params: ({
|
|
5453
|
+
message: "must be equal to one of the allowed values",
|
|
5454
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
|
|
5808
5455
|
};
|
|
5809
5456
|
var def = {
|
|
5810
|
-
keyword: "
|
|
5457
|
+
keyword: "enum",
|
|
5811
5458
|
schemaType: "array",
|
|
5812
|
-
|
|
5459
|
+
$data: true,
|
|
5813
5460
|
error: error2,
|
|
5814
5461
|
code(cxt) {
|
|
5815
|
-
const { gen, schema,
|
|
5816
|
-
if (
|
|
5817
|
-
throw new Error("
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
const
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
if (i > 0) {
|
|
5840
|
-
gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();
|
|
5841
|
-
}
|
|
5842
|
-
gen.if(schValid, () => {
|
|
5843
|
-
gen.assign(valid, true);
|
|
5844
|
-
gen.assign(passing, i);
|
|
5845
|
-
if (schCxt)
|
|
5846
|
-
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
5847
|
-
});
|
|
5848
|
-
});
|
|
5462
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5463
|
+
if (!$data && schema.length === 0)
|
|
5464
|
+
throw new Error("enum must have non-empty array");
|
|
5465
|
+
const useLoop = schema.length >= it.opts.loopEnum;
|
|
5466
|
+
let eql;
|
|
5467
|
+
const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
5468
|
+
let valid;
|
|
5469
|
+
if (useLoop || $data) {
|
|
5470
|
+
valid = gen.let("valid");
|
|
5471
|
+
cxt.block$data(valid, loopEnum);
|
|
5472
|
+
} else {
|
|
5473
|
+
if (!Array.isArray(schema))
|
|
5474
|
+
throw new Error("ajv implementation error");
|
|
5475
|
+
const vSchema = gen.const("vSchema", schemaCode);
|
|
5476
|
+
valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
|
|
5477
|
+
}
|
|
5478
|
+
cxt.pass(valid);
|
|
5479
|
+
function loopEnum() {
|
|
5480
|
+
gen.assign(valid, false);
|
|
5481
|
+
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
5482
|
+
}
|
|
5483
|
+
function equalCode(vSchema, i) {
|
|
5484
|
+
const sch = schema[i];
|
|
5485
|
+
return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
|
|
5849
5486
|
}
|
|
5850
5487
|
}
|
|
5851
5488
|
};
|
|
@@ -5853,410 +5490,584 @@ var require_oneOf = __commonJS({
|
|
|
5853
5490
|
}
|
|
5854
5491
|
});
|
|
5855
5492
|
|
|
5856
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5857
|
-
var
|
|
5858
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5493
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js
|
|
5494
|
+
var require_validation2 = __commonJS({
|
|
5495
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports) {
|
|
5859
5496
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5860
|
-
var
|
|
5861
|
-
var
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5497
|
+
var limitNumber_1 = require_limitNumber();
|
|
5498
|
+
var multipleOf_1 = require_multipleOf();
|
|
5499
|
+
var limitLength_1 = require_limitLength();
|
|
5500
|
+
var pattern_1 = require_pattern();
|
|
5501
|
+
var limitProperties_1 = require_limitProperties();
|
|
5502
|
+
var required_1 = require_required();
|
|
5503
|
+
var limitItems_1 = require_limitItems();
|
|
5504
|
+
var uniqueItems_1 = require_uniqueItems();
|
|
5505
|
+
var const_1 = require_const();
|
|
5506
|
+
var enum_1 = require_enum();
|
|
5507
|
+
var validation = [
|
|
5508
|
+
// number
|
|
5509
|
+
limitNumber_1.default,
|
|
5510
|
+
multipleOf_1.default,
|
|
5511
|
+
// string
|
|
5512
|
+
limitLength_1.default,
|
|
5513
|
+
pattern_1.default,
|
|
5514
|
+
// object
|
|
5515
|
+
limitProperties_1.default,
|
|
5516
|
+
required_1.default,
|
|
5517
|
+
// array
|
|
5518
|
+
limitItems_1.default,
|
|
5519
|
+
uniqueItems_1.default,
|
|
5520
|
+
// any
|
|
5521
|
+
{ keyword: "type", schemaType: ["string", "array"] },
|
|
5522
|
+
{ keyword: "nullable", schemaType: "boolean" },
|
|
5523
|
+
const_1.default,
|
|
5524
|
+
enum_1.default
|
|
5525
|
+
];
|
|
5526
|
+
exports.default = validation;
|
|
5879
5527
|
}
|
|
5880
5528
|
});
|
|
5881
5529
|
|
|
5882
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/
|
|
5883
|
-
var
|
|
5884
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/
|
|
5530
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
|
|
5531
|
+
var require_additionalItems = __commonJS({
|
|
5532
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports) {
|
|
5885
5533
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5534
|
+
exports.validateAdditionalItems = void 0;
|
|
5886
5535
|
var codegen_1 = require_codegen();
|
|
5887
5536
|
var util_1 = require_util();
|
|
5888
5537
|
var error2 = {
|
|
5889
|
-
message: ({ params }) => (0, codegen_1.str)`must
|
|
5890
|
-
params: ({ params }) => (0, codegen_1._)`{
|
|
5538
|
+
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5539
|
+
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5891
5540
|
};
|
|
5892
5541
|
var def = {
|
|
5893
|
-
keyword: "
|
|
5894
|
-
|
|
5895
|
-
|
|
5542
|
+
keyword: "additionalItems",
|
|
5543
|
+
type: "array",
|
|
5544
|
+
schemaType: ["boolean", "object"],
|
|
5545
|
+
before: "uniqueItems",
|
|
5896
5546
|
error: error2,
|
|
5897
5547
|
code(cxt) {
|
|
5898
|
-
const {
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
const hasThen = hasSchema(it, "then");
|
|
5903
|
-
const hasElse = hasSchema(it, "else");
|
|
5904
|
-
if (!hasThen && !hasElse)
|
|
5548
|
+
const { parentSchema, it } = cxt;
|
|
5549
|
+
const { items } = parentSchema;
|
|
5550
|
+
if (!Array.isArray(items)) {
|
|
5551
|
+
(0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
5905
5552
|
return;
|
|
5906
|
-
const valid = gen.let("valid", true);
|
|
5907
|
-
const schValid = gen.name("_valid");
|
|
5908
|
-
validateIf();
|
|
5909
|
-
cxt.reset();
|
|
5910
|
-
if (hasThen && hasElse) {
|
|
5911
|
-
const ifClause = gen.let("ifClause");
|
|
5912
|
-
cxt.setParams({ ifClause });
|
|
5913
|
-
gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
|
|
5914
|
-
} else if (hasThen) {
|
|
5915
|
-
gen.if(schValid, validateClause("then"));
|
|
5916
|
-
} else {
|
|
5917
|
-
gen.if((0, codegen_1.not)(schValid), validateClause("else"));
|
|
5918
|
-
}
|
|
5919
|
-
cxt.pass(valid, () => cxt.error(true));
|
|
5920
|
-
function validateIf() {
|
|
5921
|
-
const schCxt = cxt.subschema({
|
|
5922
|
-
keyword: "if",
|
|
5923
|
-
compositeRule: true,
|
|
5924
|
-
createErrors: false,
|
|
5925
|
-
allErrors: false
|
|
5926
|
-
}, schValid);
|
|
5927
|
-
cxt.mergeEvaluated(schCxt);
|
|
5928
|
-
}
|
|
5929
|
-
function validateClause(keyword, ifClause) {
|
|
5930
|
-
return () => {
|
|
5931
|
-
const schCxt = cxt.subschema({ keyword }, schValid);
|
|
5932
|
-
gen.assign(valid, schValid);
|
|
5933
|
-
cxt.mergeValidEvaluated(schCxt, valid);
|
|
5934
|
-
if (ifClause)
|
|
5935
|
-
gen.assign(ifClause, (0, codegen_1._)`${keyword}`);
|
|
5936
|
-
else
|
|
5937
|
-
cxt.setParams({ ifClause: keyword });
|
|
5938
|
-
};
|
|
5939
5553
|
}
|
|
5554
|
+
validateAdditionalItems(cxt, items);
|
|
5940
5555
|
}
|
|
5941
5556
|
};
|
|
5942
|
-
function
|
|
5943
|
-
const schema =
|
|
5944
|
-
|
|
5557
|
+
function validateAdditionalItems(cxt, items) {
|
|
5558
|
+
const { gen, schema, data, keyword, it } = cxt;
|
|
5559
|
+
it.items = true;
|
|
5560
|
+
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
5561
|
+
if (schema === false) {
|
|
5562
|
+
cxt.setParams({ len: items.length });
|
|
5563
|
+
cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
|
|
5564
|
+
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5565
|
+
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
|
|
5566
|
+
gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
|
|
5567
|
+
cxt.ok(valid);
|
|
5568
|
+
}
|
|
5569
|
+
function validateItems(valid) {
|
|
5570
|
+
gen.forRange("i", items.length, len, (i) => {
|
|
5571
|
+
cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
|
|
5572
|
+
if (!it.allErrors)
|
|
5573
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5574
|
+
});
|
|
5575
|
+
}
|
|
5945
5576
|
}
|
|
5577
|
+
exports.validateAdditionalItems = validateAdditionalItems;
|
|
5946
5578
|
exports.default = def;
|
|
5947
5579
|
}
|
|
5948
5580
|
});
|
|
5949
5581
|
|
|
5950
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/
|
|
5951
|
-
var
|
|
5952
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/
|
|
5582
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js
|
|
5583
|
+
var require_items = __commonJS({
|
|
5584
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports) {
|
|
5953
5585
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5586
|
+
exports.validateTuple = void 0;
|
|
5587
|
+
var codegen_1 = require_codegen();
|
|
5954
5588
|
var util_1 = require_util();
|
|
5589
|
+
var code_1 = require_code2();
|
|
5955
5590
|
var def = {
|
|
5956
|
-
keyword:
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5591
|
+
keyword: "items",
|
|
5592
|
+
type: "array",
|
|
5593
|
+
schemaType: ["object", "array", "boolean"],
|
|
5594
|
+
before: "uniqueItems",
|
|
5595
|
+
code(cxt) {
|
|
5596
|
+
const { schema, it } = cxt;
|
|
5597
|
+
if (Array.isArray(schema))
|
|
5598
|
+
return validateTuple(cxt, "additionalItems", schema);
|
|
5599
|
+
it.items = true;
|
|
5600
|
+
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
5601
|
+
return;
|
|
5602
|
+
cxt.ok((0, code_1.validateArray)(cxt));
|
|
5961
5603
|
}
|
|
5962
5604
|
};
|
|
5605
|
+
function validateTuple(cxt, extraItems, schArr = cxt.schema) {
|
|
5606
|
+
const { gen, parentSchema, data, keyword, it } = cxt;
|
|
5607
|
+
checkStrictTuple(parentSchema);
|
|
5608
|
+
if (it.opts.unevaluated && schArr.length && it.items !== true) {
|
|
5609
|
+
it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
|
|
5610
|
+
}
|
|
5611
|
+
const valid = gen.name("valid");
|
|
5612
|
+
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
5613
|
+
schArr.forEach((sch, i) => {
|
|
5614
|
+
if ((0, util_1.alwaysValidSchema)(it, sch))
|
|
5615
|
+
return;
|
|
5616
|
+
gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({
|
|
5617
|
+
keyword,
|
|
5618
|
+
schemaProp: i,
|
|
5619
|
+
dataProp: i
|
|
5620
|
+
}, valid));
|
|
5621
|
+
cxt.ok(valid);
|
|
5622
|
+
});
|
|
5623
|
+
function checkStrictTuple(sch) {
|
|
5624
|
+
const { opts, errSchemaPath } = it;
|
|
5625
|
+
const l = schArr.length;
|
|
5626
|
+
const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
|
|
5627
|
+
if (opts.strictTuples && !fullTuple) {
|
|
5628
|
+
const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
|
|
5629
|
+
(0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
|
|
5630
|
+
}
|
|
5631
|
+
}
|
|
5632
|
+
}
|
|
5633
|
+
exports.validateTuple = validateTuple;
|
|
5963
5634
|
exports.default = def;
|
|
5964
5635
|
}
|
|
5965
5636
|
});
|
|
5966
5637
|
|
|
5967
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/
|
|
5968
|
-
var
|
|
5969
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/
|
|
5638
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
|
|
5639
|
+
var require_prefixItems = __commonJS({
|
|
5640
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports) {
|
|
5970
5641
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5971
|
-
var additionalItems_1 = require_additionalItems();
|
|
5972
|
-
var prefixItems_1 = require_prefixItems();
|
|
5973
5642
|
var items_1 = require_items();
|
|
5974
|
-
var
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
var anyOf_1 = require_anyOf();
|
|
5983
|
-
var oneOf_1 = require_oneOf();
|
|
5984
|
-
var allOf_1 = require_allOf();
|
|
5985
|
-
var if_1 = require_if();
|
|
5986
|
-
var thenElse_1 = require_thenElse();
|
|
5987
|
-
function getApplicator(draft2020 = false) {
|
|
5988
|
-
const applicator = [
|
|
5989
|
-
// any
|
|
5990
|
-
not_1.default,
|
|
5991
|
-
anyOf_1.default,
|
|
5992
|
-
oneOf_1.default,
|
|
5993
|
-
allOf_1.default,
|
|
5994
|
-
if_1.default,
|
|
5995
|
-
thenElse_1.default,
|
|
5996
|
-
// object
|
|
5997
|
-
propertyNames_1.default,
|
|
5998
|
-
additionalProperties_1.default,
|
|
5999
|
-
dependencies_1.default,
|
|
6000
|
-
properties_1.default,
|
|
6001
|
-
patternProperties_1.default
|
|
6002
|
-
];
|
|
6003
|
-
if (draft2020)
|
|
6004
|
-
applicator.push(prefixItems_1.default, items2020_1.default);
|
|
6005
|
-
else
|
|
6006
|
-
applicator.push(additionalItems_1.default, items_1.default);
|
|
6007
|
-
applicator.push(contains_1.default);
|
|
6008
|
-
return applicator;
|
|
6009
|
-
}
|
|
6010
|
-
exports.default = getApplicator;
|
|
5643
|
+
var def = {
|
|
5644
|
+
keyword: "prefixItems",
|
|
5645
|
+
type: "array",
|
|
5646
|
+
schemaType: ["array"],
|
|
5647
|
+
before: "uniqueItems",
|
|
5648
|
+
code: (cxt) => (0, items_1.validateTuple)(cxt, "items")
|
|
5649
|
+
};
|
|
5650
|
+
exports.default = def;
|
|
6011
5651
|
}
|
|
6012
5652
|
});
|
|
6013
|
-
|
|
6014
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6015
|
-
var
|
|
6016
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5653
|
+
|
|
5654
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js
|
|
5655
|
+
var require_items2020 = __commonJS({
|
|
5656
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports) {
|
|
6017
5657
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6018
|
-
exports.dynamicAnchor = void 0;
|
|
6019
5658
|
var codegen_1 = require_codegen();
|
|
6020
|
-
var
|
|
6021
|
-
var
|
|
6022
|
-
var
|
|
5659
|
+
var util_1 = require_util();
|
|
5660
|
+
var code_1 = require_code2();
|
|
5661
|
+
var additionalItems_1 = require_additionalItems();
|
|
5662
|
+
var error2 = {
|
|
5663
|
+
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5664
|
+
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5665
|
+
};
|
|
6023
5666
|
var def = {
|
|
6024
|
-
keyword: "
|
|
6025
|
-
|
|
6026
|
-
|
|
5667
|
+
keyword: "items",
|
|
5668
|
+
type: "array",
|
|
5669
|
+
schemaType: ["object", "boolean"],
|
|
5670
|
+
before: "uniqueItems",
|
|
5671
|
+
error: error2,
|
|
5672
|
+
code(cxt) {
|
|
5673
|
+
const { schema, parentSchema, it } = cxt;
|
|
5674
|
+
const { prefixItems } = parentSchema;
|
|
5675
|
+
it.items = true;
|
|
5676
|
+
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
5677
|
+
return;
|
|
5678
|
+
if (prefixItems)
|
|
5679
|
+
(0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
|
|
5680
|
+
else
|
|
5681
|
+
cxt.ok((0, code_1.validateArray)(cxt));
|
|
5682
|
+
}
|
|
6027
5683
|
};
|
|
6028
|
-
function dynamicAnchor(cxt, anchor) {
|
|
6029
|
-
const { gen, it } = cxt;
|
|
6030
|
-
it.schemaEnv.root.dynamicAnchors[anchor] = true;
|
|
6031
|
-
const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
|
|
6032
|
-
const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
|
|
6033
|
-
gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
|
|
6034
|
-
}
|
|
6035
|
-
exports.dynamicAnchor = dynamicAnchor;
|
|
6036
|
-
function _getValidate(cxt) {
|
|
6037
|
-
const { schemaEnv, schema, self } = cxt.it;
|
|
6038
|
-
const { root, baseId, localRefs, meta } = schemaEnv.root;
|
|
6039
|
-
const { schemaId } = self.opts;
|
|
6040
|
-
const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
|
|
6041
|
-
compile_1.compileSchema.call(self, sch);
|
|
6042
|
-
return (0, ref_1.getValidate)(cxt, sch);
|
|
6043
|
-
}
|
|
6044
5684
|
exports.default = def;
|
|
6045
5685
|
}
|
|
6046
5686
|
});
|
|
6047
5687
|
|
|
6048
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6049
|
-
var
|
|
6050
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5688
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js
|
|
5689
|
+
var require_contains = __commonJS({
|
|
5690
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports) {
|
|
6051
5691
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6052
|
-
exports.dynamicRef = void 0;
|
|
6053
5692
|
var codegen_1 = require_codegen();
|
|
6054
|
-
var
|
|
6055
|
-
var
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
schemaType: "string",
|
|
6059
|
-
code: (cxt) => dynamicRef(cxt, cxt.schema)
|
|
5693
|
+
var util_1 = require_util();
|
|
5694
|
+
var error2 = {
|
|
5695
|
+
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)`,
|
|
5696
|
+
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
|
|
6060
5697
|
};
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
const
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
|
|
5698
|
+
var def = {
|
|
5699
|
+
keyword: "contains",
|
|
5700
|
+
type: "array",
|
|
5701
|
+
schemaType: ["object", "boolean"],
|
|
5702
|
+
before: "uniqueItems",
|
|
5703
|
+
trackErrors: true,
|
|
5704
|
+
error: error2,
|
|
5705
|
+
code(cxt) {
|
|
5706
|
+
const { gen, schema, parentSchema, data, it } = cxt;
|
|
5707
|
+
let min;
|
|
5708
|
+
let max;
|
|
5709
|
+
const { minContains, maxContains } = parentSchema;
|
|
5710
|
+
if (it.opts.next) {
|
|
5711
|
+
min = minContains === void 0 ? 1 : minContains;
|
|
5712
|
+
max = maxContains;
|
|
6077
5713
|
} else {
|
|
6078
|
-
|
|
5714
|
+
min = 1;
|
|
6079
5715
|
}
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
(0,
|
|
5716
|
+
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
5717
|
+
cxt.setParams({ min, max });
|
|
5718
|
+
if (max === void 0 && min === 0) {
|
|
5719
|
+
(0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
|
|
5720
|
+
return;
|
|
5721
|
+
}
|
|
5722
|
+
if (max !== void 0 && min > max) {
|
|
5723
|
+
(0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
|
|
5724
|
+
cxt.fail();
|
|
5725
|
+
return;
|
|
5726
|
+
}
|
|
5727
|
+
if ((0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5728
|
+
let cond = (0, codegen_1._)`${len} >= ${min}`;
|
|
5729
|
+
if (max !== void 0)
|
|
5730
|
+
cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
|
|
5731
|
+
cxt.pass(cond);
|
|
5732
|
+
return;
|
|
5733
|
+
}
|
|
5734
|
+
it.items = true;
|
|
5735
|
+
const valid = gen.name("valid");
|
|
5736
|
+
if (max === void 0 && min === 1) {
|
|
5737
|
+
validateItems(valid, () => gen.if(valid, () => gen.break()));
|
|
5738
|
+
} else if (min === 0) {
|
|
6084
5739
|
gen.let(valid, true);
|
|
6085
|
-
|
|
5740
|
+
if (max !== void 0)
|
|
5741
|
+
gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);
|
|
5742
|
+
} else {
|
|
5743
|
+
gen.let(valid, false);
|
|
5744
|
+
validateItemsWithCount();
|
|
5745
|
+
}
|
|
5746
|
+
cxt.result(valid, () => cxt.reset());
|
|
5747
|
+
function validateItemsWithCount() {
|
|
5748
|
+
const schValid = gen.name("_valid");
|
|
5749
|
+
const count = gen.let("count", 0);
|
|
5750
|
+
validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
|
|
5751
|
+
}
|
|
5752
|
+
function validateItems(_valid, block) {
|
|
5753
|
+
gen.forRange("i", 0, len, (i) => {
|
|
5754
|
+
cxt.subschema({
|
|
5755
|
+
keyword: "contains",
|
|
5756
|
+
dataProp: i,
|
|
5757
|
+
dataPropType: util_1.Type.Num,
|
|
5758
|
+
compositeRule: true
|
|
5759
|
+
}, _valid);
|
|
5760
|
+
block();
|
|
5761
|
+
});
|
|
5762
|
+
}
|
|
5763
|
+
function checkLimits(count) {
|
|
5764
|
+
gen.code((0, codegen_1._)`${count}++`);
|
|
5765
|
+
if (max === void 0) {
|
|
5766
|
+
gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
|
|
5767
|
+
} else {
|
|
5768
|
+
gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
|
|
5769
|
+
if (min === 1)
|
|
5770
|
+
gen.assign(valid, true);
|
|
5771
|
+
else
|
|
5772
|
+
gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
|
|
5773
|
+
}
|
|
5774
|
+
}
|
|
6086
5775
|
}
|
|
6087
|
-
}
|
|
6088
|
-
exports.dynamicRef = dynamicRef;
|
|
5776
|
+
};
|
|
6089
5777
|
exports.default = def;
|
|
6090
5778
|
}
|
|
6091
5779
|
});
|
|
6092
5780
|
|
|
6093
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6094
|
-
var
|
|
6095
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
5781
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
|
|
5782
|
+
var require_dependencies = __commonJS({
|
|
5783
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports) {
|
|
6096
5784
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6097
|
-
|
|
5785
|
+
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
5786
|
+
var codegen_1 = require_codegen();
|
|
6098
5787
|
var util_1 = require_util();
|
|
5788
|
+
var code_1 = require_code2();
|
|
5789
|
+
exports.error = {
|
|
5790
|
+
message: ({ params: { property, depsCount, deps } }) => {
|
|
5791
|
+
const property_ies = depsCount === 1 ? "property" : "properties";
|
|
5792
|
+
return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;
|
|
5793
|
+
},
|
|
5794
|
+
params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
|
|
5795
|
+
missingProperty: ${missingProperty},
|
|
5796
|
+
depsCount: ${depsCount},
|
|
5797
|
+
deps: ${deps}}`
|
|
5798
|
+
// TODO change to reference
|
|
5799
|
+
};
|
|
6099
5800
|
var def = {
|
|
6100
|
-
keyword: "
|
|
6101
|
-
|
|
5801
|
+
keyword: "dependencies",
|
|
5802
|
+
type: "object",
|
|
5803
|
+
schemaType: "object",
|
|
5804
|
+
error: exports.error,
|
|
6102
5805
|
code(cxt) {
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
5806
|
+
const [propDeps, schDeps] = splitDependencies(cxt);
|
|
5807
|
+
validatePropertyDeps(cxt, propDeps);
|
|
5808
|
+
validateSchemaDeps(cxt, schDeps);
|
|
5809
|
+
}
|
|
5810
|
+
};
|
|
5811
|
+
function splitDependencies({ schema }) {
|
|
5812
|
+
const propertyDeps = {};
|
|
5813
|
+
const schemaDeps = {};
|
|
5814
|
+
for (const key in schema) {
|
|
5815
|
+
if (key === "__proto__")
|
|
5816
|
+
continue;
|
|
5817
|
+
const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
|
|
5818
|
+
deps[key] = schema[key];
|
|
5819
|
+
}
|
|
5820
|
+
return [propertyDeps, schemaDeps];
|
|
5821
|
+
}
|
|
5822
|
+
function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
|
|
5823
|
+
const { gen, data, it } = cxt;
|
|
5824
|
+
if (Object.keys(propertyDeps).length === 0)
|
|
5825
|
+
return;
|
|
5826
|
+
const missing = gen.let("missing");
|
|
5827
|
+
for (const prop in propertyDeps) {
|
|
5828
|
+
const deps = propertyDeps[prop];
|
|
5829
|
+
if (deps.length === 0)
|
|
5830
|
+
continue;
|
|
5831
|
+
const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
|
|
5832
|
+
cxt.setParams({
|
|
5833
|
+
property: prop,
|
|
5834
|
+
depsCount: deps.length,
|
|
5835
|
+
deps: deps.join(", ")
|
|
5836
|
+
});
|
|
5837
|
+
if (it.allErrors) {
|
|
5838
|
+
gen.if(hasProperty, () => {
|
|
5839
|
+
for (const depProp of deps) {
|
|
5840
|
+
(0, code_1.checkReportMissingProp)(cxt, depProp);
|
|
5841
|
+
}
|
|
5842
|
+
});
|
|
5843
|
+
} else {
|
|
5844
|
+
gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
|
|
5845
|
+
(0, code_1.reportMissingProp)(cxt, missing);
|
|
5846
|
+
gen.else();
|
|
5847
|
+
}
|
|
5848
|
+
}
|
|
5849
|
+
}
|
|
5850
|
+
exports.validatePropertyDeps = validatePropertyDeps;
|
|
5851
|
+
function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
|
|
5852
|
+
const { gen, data, keyword, it } = cxt;
|
|
5853
|
+
const valid = gen.name("valid");
|
|
5854
|
+
for (const prop in schemaDeps) {
|
|
5855
|
+
if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
|
|
5856
|
+
continue;
|
|
5857
|
+
gen.if(
|
|
5858
|
+
(0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties),
|
|
5859
|
+
() => {
|
|
5860
|
+
const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
|
|
5861
|
+
cxt.mergeValidEvaluated(schCxt, valid);
|
|
5862
|
+
},
|
|
5863
|
+
() => gen.var(valid, true)
|
|
5864
|
+
// TODO var
|
|
5865
|
+
);
|
|
5866
|
+
cxt.ok(valid);
|
|
6107
5867
|
}
|
|
6108
|
-
}
|
|
6109
|
-
exports.
|
|
6110
|
-
}
|
|
6111
|
-
});
|
|
6112
|
-
|
|
6113
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
|
|
6114
|
-
var require_recursiveRef = __commonJS({
|
|
6115
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports) {
|
|
6116
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6117
|
-
var dynamicRef_1 = require_dynamicRef();
|
|
6118
|
-
var def = {
|
|
6119
|
-
keyword: "$recursiveRef",
|
|
6120
|
-
schemaType: "string",
|
|
6121
|
-
code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
|
|
6122
|
-
};
|
|
5868
|
+
}
|
|
5869
|
+
exports.validateSchemaDeps = validateSchemaDeps;
|
|
6123
5870
|
exports.default = def;
|
|
6124
5871
|
}
|
|
6125
5872
|
});
|
|
6126
5873
|
|
|
6127
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6128
|
-
var
|
|
6129
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6130
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6131
|
-
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
6132
|
-
var dynamicRef_1 = require_dynamicRef();
|
|
6133
|
-
var recursiveAnchor_1 = require_recursiveAnchor();
|
|
6134
|
-
var recursiveRef_1 = require_recursiveRef();
|
|
6135
|
-
var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
|
|
6136
|
-
exports.default = dynamic;
|
|
6137
|
-
}
|
|
6138
|
-
});
|
|
6139
|
-
|
|
6140
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
|
|
6141
|
-
var require_dependentRequired = __commonJS({
|
|
6142
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports) {
|
|
5874
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
|
|
5875
|
+
var require_propertyNames = __commonJS({
|
|
5876
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports) {
|
|
6143
5877
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6144
|
-
var
|
|
6145
|
-
var
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
error: dependencies_1.error,
|
|
6150
|
-
code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
|
|
5878
|
+
var codegen_1 = require_codegen();
|
|
5879
|
+
var util_1 = require_util();
|
|
5880
|
+
var error2 = {
|
|
5881
|
+
message: "property name must be valid",
|
|
5882
|
+
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
|
|
6151
5883
|
};
|
|
6152
|
-
exports.default = def;
|
|
6153
|
-
}
|
|
6154
|
-
});
|
|
6155
|
-
|
|
6156
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
|
|
6157
|
-
var require_dependentSchemas = __commonJS({
|
|
6158
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports) {
|
|
6159
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6160
|
-
var dependencies_1 = require_dependencies();
|
|
6161
5884
|
var def = {
|
|
6162
|
-
keyword: "
|
|
5885
|
+
keyword: "propertyNames",
|
|
6163
5886
|
type: "object",
|
|
6164
|
-
schemaType: "object",
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
5887
|
+
schemaType: ["object", "boolean"],
|
|
5888
|
+
error: error2,
|
|
5889
|
+
code(cxt) {
|
|
5890
|
+
const { gen, schema, data, it } = cxt;
|
|
5891
|
+
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
5892
|
+
return;
|
|
5893
|
+
const valid = gen.name("valid");
|
|
5894
|
+
gen.forIn("key", data, (key) => {
|
|
5895
|
+
cxt.setParams({ propertyName: key });
|
|
5896
|
+
cxt.subschema({
|
|
5897
|
+
keyword: "propertyNames",
|
|
5898
|
+
data: key,
|
|
5899
|
+
dataTypes: ["string"],
|
|
5900
|
+
propertyName: key,
|
|
5901
|
+
compositeRule: true
|
|
5902
|
+
}, valid);
|
|
5903
|
+
gen.if((0, codegen_1.not)(valid), () => {
|
|
5904
|
+
cxt.error(true);
|
|
5905
|
+
if (!it.allErrors)
|
|
5906
|
+
gen.break();
|
|
5907
|
+
});
|
|
5908
|
+
});
|
|
5909
|
+
cxt.ok(valid);
|
|
6184
5910
|
}
|
|
6185
5911
|
};
|
|
6186
5912
|
exports.default = def;
|
|
6187
5913
|
}
|
|
6188
5914
|
});
|
|
6189
5915
|
|
|
6190
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6191
|
-
var
|
|
6192
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6193
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6194
|
-
var dependentRequired_1 = require_dependentRequired();
|
|
6195
|
-
var dependentSchemas_1 = require_dependentSchemas();
|
|
6196
|
-
var limitContains_1 = require_limitContains();
|
|
6197
|
-
var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
|
|
6198
|
-
exports.default = next;
|
|
6199
|
-
}
|
|
6200
|
-
});
|
|
6201
|
-
|
|
6202
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
|
|
6203
|
-
var require_unevaluatedProperties = __commonJS({
|
|
6204
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports) {
|
|
5916
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
|
|
5917
|
+
var require_additionalProperties = __commonJS({
|
|
5918
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports) {
|
|
6205
5919
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5920
|
+
var code_1 = require_code2();
|
|
6206
5921
|
var codegen_1 = require_codegen();
|
|
6207
|
-
var util_1 = require_util();
|
|
6208
5922
|
var names_1 = require_names();
|
|
5923
|
+
var util_1 = require_util();
|
|
6209
5924
|
var error2 = {
|
|
6210
|
-
message: "must NOT have
|
|
6211
|
-
params: ({ params }) => (0, codegen_1._)`{
|
|
5925
|
+
message: "must NOT have additional properties",
|
|
5926
|
+
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
|
|
6212
5927
|
};
|
|
6213
5928
|
var def = {
|
|
6214
|
-
keyword: "
|
|
6215
|
-
type: "object",
|
|
5929
|
+
keyword: "additionalProperties",
|
|
5930
|
+
type: ["object"],
|
|
6216
5931
|
schemaType: ["boolean", "object"],
|
|
5932
|
+
allowUndefined: true,
|
|
6217
5933
|
trackErrors: true,
|
|
6218
5934
|
error: error2,
|
|
6219
5935
|
code(cxt) {
|
|
6220
|
-
const { gen, schema, data, errsCount, it } = cxt;
|
|
5936
|
+
const { gen, schema, parentSchema, data, errsCount, it } = cxt;
|
|
6221
5937
|
if (!errsCount)
|
|
6222
5938
|
throw new Error("ajv implementation error");
|
|
6223
|
-
const { allErrors,
|
|
6224
|
-
if (props instanceof codegen_1.Name) {
|
|
6225
|
-
gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
|
|
6226
|
-
} else if (props !== true) {
|
|
6227
|
-
gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
|
|
6228
|
-
}
|
|
5939
|
+
const { allErrors, opts } = it;
|
|
6229
5940
|
it.props = true;
|
|
5941
|
+
if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
|
|
5942
|
+
return;
|
|
5943
|
+
const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
|
|
5944
|
+
const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
|
|
5945
|
+
checkAdditionalProperties();
|
|
6230
5946
|
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
6231
|
-
function
|
|
5947
|
+
function checkAdditionalProperties() {
|
|
5948
|
+
gen.forIn("key", data, (key) => {
|
|
5949
|
+
if (!props.length && !patProps.length)
|
|
5950
|
+
additionalPropertyCode(key);
|
|
5951
|
+
else
|
|
5952
|
+
gen.if(isAdditional(key), () => additionalPropertyCode(key));
|
|
5953
|
+
});
|
|
5954
|
+
}
|
|
5955
|
+
function isAdditional(key) {
|
|
5956
|
+
let definedProp;
|
|
5957
|
+
if (props.length > 8) {
|
|
5958
|
+
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
5959
|
+
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
|
|
5960
|
+
} else if (props.length) {
|
|
5961
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
|
|
5962
|
+
} else {
|
|
5963
|
+
definedProp = codegen_1.nil;
|
|
5964
|
+
}
|
|
5965
|
+
if (patProps.length) {
|
|
5966
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
|
|
5967
|
+
}
|
|
5968
|
+
return (0, codegen_1.not)(definedProp);
|
|
5969
|
+
}
|
|
5970
|
+
function deleteAdditional(key) {
|
|
5971
|
+
gen.code((0, codegen_1._)`delete ${data}[${key}]`);
|
|
5972
|
+
}
|
|
5973
|
+
function additionalPropertyCode(key) {
|
|
5974
|
+
if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
|
|
5975
|
+
deleteAdditional(key);
|
|
5976
|
+
return;
|
|
5977
|
+
}
|
|
6232
5978
|
if (schema === false) {
|
|
6233
|
-
cxt.setParams({
|
|
5979
|
+
cxt.setParams({ additionalProperty: key });
|
|
6234
5980
|
cxt.error();
|
|
6235
5981
|
if (!allErrors)
|
|
6236
5982
|
gen.break();
|
|
6237
5983
|
return;
|
|
6238
5984
|
}
|
|
6239
|
-
if (!(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5985
|
+
if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
6240
5986
|
const valid = gen.name("valid");
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
5987
|
+
if (opts.removeAdditional === "failing") {
|
|
5988
|
+
applyAdditionalSchema(key, valid, false);
|
|
5989
|
+
gen.if((0, codegen_1.not)(valid), () => {
|
|
5990
|
+
cxt.reset();
|
|
5991
|
+
deleteAdditional(key);
|
|
5992
|
+
});
|
|
5993
|
+
} else {
|
|
5994
|
+
applyAdditionalSchema(key, valid);
|
|
5995
|
+
if (!allErrors)
|
|
5996
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
}
|
|
6000
|
+
function applyAdditionalSchema(key, valid, errors) {
|
|
6001
|
+
const subschema = {
|
|
6002
|
+
keyword: "additionalProperties",
|
|
6003
|
+
dataProp: key,
|
|
6004
|
+
dataPropType: util_1.Type.Str
|
|
6005
|
+
};
|
|
6006
|
+
if (errors === false) {
|
|
6007
|
+
Object.assign(subschema, {
|
|
6008
|
+
compositeRule: true,
|
|
6009
|
+
createErrors: false,
|
|
6010
|
+
allErrors: false
|
|
6011
|
+
});
|
|
6012
|
+
}
|
|
6013
|
+
cxt.subschema(subschema, valid);
|
|
6014
|
+
}
|
|
6015
|
+
}
|
|
6016
|
+
};
|
|
6017
|
+
exports.default = def;
|
|
6018
|
+
}
|
|
6019
|
+
});
|
|
6020
|
+
|
|
6021
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js
|
|
6022
|
+
var require_properties = __commonJS({
|
|
6023
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports) {
|
|
6024
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6025
|
+
var validate_1 = require_validate();
|
|
6026
|
+
var code_1 = require_code2();
|
|
6027
|
+
var util_1 = require_util();
|
|
6028
|
+
var additionalProperties_1 = require_additionalProperties();
|
|
6029
|
+
var def = {
|
|
6030
|
+
keyword: "properties",
|
|
6031
|
+
type: "object",
|
|
6032
|
+
schemaType: "object",
|
|
6033
|
+
code(cxt) {
|
|
6034
|
+
const { gen, schema, parentSchema, data, it } = cxt;
|
|
6035
|
+
if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) {
|
|
6036
|
+
additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
|
|
6037
|
+
}
|
|
6038
|
+
const allProps = (0, code_1.allSchemaProperties)(schema);
|
|
6039
|
+
for (const prop of allProps) {
|
|
6040
|
+
it.definedProperties.add(prop);
|
|
6041
|
+
}
|
|
6042
|
+
if (it.opts.unevaluated && allProps.length && it.props !== true) {
|
|
6043
|
+
it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
6044
|
+
}
|
|
6045
|
+
const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
6046
|
+
if (properties.length === 0)
|
|
6047
|
+
return;
|
|
6048
|
+
const valid = gen.name("valid");
|
|
6049
|
+
for (const prop of properties) {
|
|
6050
|
+
if (hasDefault(prop)) {
|
|
6051
|
+
applyPropertySchema(prop);
|
|
6052
|
+
} else {
|
|
6053
|
+
gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
|
|
6054
|
+
applyPropertySchema(prop);
|
|
6055
|
+
if (!it.allErrors)
|
|
6056
|
+
gen.else().var(valid, true);
|
|
6057
|
+
gen.endIf();
|
|
6248
6058
|
}
|
|
6059
|
+
cxt.it.definedProperties.add(prop);
|
|
6060
|
+
cxt.ok(valid);
|
|
6249
6061
|
}
|
|
6250
|
-
function
|
|
6251
|
-
return
|
|
6062
|
+
function hasDefault(prop) {
|
|
6063
|
+
return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
|
|
6252
6064
|
}
|
|
6253
|
-
function
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
}
|
|
6259
|
-
return (0, codegen_1.and)(...ps);
|
|
6065
|
+
function applyPropertySchema(prop) {
|
|
6066
|
+
cxt.subschema({
|
|
6067
|
+
keyword: "properties",
|
|
6068
|
+
schemaProp: prop,
|
|
6069
|
+
dataProp: prop
|
|
6070
|
+
}, valid);
|
|
6260
6071
|
}
|
|
6261
6072
|
}
|
|
6262
6073
|
};
|
|
@@ -6264,318 +6075,175 @@ var require_unevaluatedProperties = __commonJS({
|
|
|
6264
6075
|
}
|
|
6265
6076
|
});
|
|
6266
6077
|
|
|
6267
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6268
|
-
var
|
|
6269
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6078
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
|
|
6079
|
+
var require_patternProperties = __commonJS({
|
|
6080
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports) {
|
|
6270
6081
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6082
|
+
var code_1 = require_code2();
|
|
6271
6083
|
var codegen_1 = require_codegen();
|
|
6272
6084
|
var util_1 = require_util();
|
|
6273
|
-
var
|
|
6274
|
-
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
6275
|
-
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
6276
|
-
};
|
|
6085
|
+
var util_2 = require_util();
|
|
6277
6086
|
var def = {
|
|
6278
|
-
keyword: "
|
|
6279
|
-
type: "
|
|
6280
|
-
schemaType:
|
|
6281
|
-
error: error2,
|
|
6087
|
+
keyword: "patternProperties",
|
|
6088
|
+
type: "object",
|
|
6089
|
+
schemaType: "object",
|
|
6282
6090
|
code(cxt) {
|
|
6283
|
-
const { gen, schema, data, it } = cxt;
|
|
6284
|
-
const
|
|
6285
|
-
|
|
6091
|
+
const { gen, schema, data, parentSchema, it } = cxt;
|
|
6092
|
+
const { opts } = it;
|
|
6093
|
+
const patterns = (0, code_1.allSchemaProperties)(schema);
|
|
6094
|
+
const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
|
|
6095
|
+
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
|
|
6286
6096
|
return;
|
|
6287
|
-
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
6288
|
-
if (schema === false) {
|
|
6289
|
-
cxt.setParams({ len: items });
|
|
6290
|
-
cxt.fail((0, codegen_1._)`${len} > ${items}`);
|
|
6291
|
-
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
6292
|
-
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
|
|
6293
|
-
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
|
|
6294
|
-
cxt.ok(valid);
|
|
6295
|
-
}
|
|
6296
|
-
it.items = true;
|
|
6297
|
-
function validateItems(valid, from) {
|
|
6298
|
-
gen.forRange("i", from, len, (i) => {
|
|
6299
|
-
cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
|
|
6300
|
-
if (!it.allErrors)
|
|
6301
|
-
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
6302
|
-
});
|
|
6303
6097
|
}
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
});
|
|
6309
|
-
|
|
6310
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js
|
|
6311
|
-
var require_unevaluated = __commonJS({
|
|
6312
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports) {
|
|
6313
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6314
|
-
var unevaluatedProperties_1 = require_unevaluatedProperties();
|
|
6315
|
-
var unevaluatedItems_1 = require_unevaluatedItems();
|
|
6316
|
-
var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
|
|
6317
|
-
exports.default = unevaluated;
|
|
6318
|
-
}
|
|
6319
|
-
});
|
|
6320
|
-
|
|
6321
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js
|
|
6322
|
-
var require_format = __commonJS({
|
|
6323
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
|
|
6324
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6325
|
-
var codegen_1 = require_codegen();
|
|
6326
|
-
var error2 = {
|
|
6327
|
-
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
6328
|
-
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
6329
|
-
};
|
|
6330
|
-
var def = {
|
|
6331
|
-
keyword: "format",
|
|
6332
|
-
type: ["number", "string"],
|
|
6333
|
-
schemaType: "string",
|
|
6334
|
-
$data: true,
|
|
6335
|
-
error: error2,
|
|
6336
|
-
code(cxt, ruleType) {
|
|
6337
|
-
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
6338
|
-
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
6339
|
-
if (!opts.validateFormats)
|
|
6340
|
-
return;
|
|
6341
|
-
if ($data)
|
|
6342
|
-
validate$DataFormat();
|
|
6343
|
-
else
|
|
6344
|
-
validateFormat();
|
|
6345
|
-
function validate$DataFormat() {
|
|
6346
|
-
const fmts = gen.scopeValue("formats", {
|
|
6347
|
-
ref: self.formats,
|
|
6348
|
-
code: opts.code.formats
|
|
6349
|
-
});
|
|
6350
|
-
const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
|
|
6351
|
-
const fType = gen.let("fType");
|
|
6352
|
-
const format = gen.let("format");
|
|
6353
|
-
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef));
|
|
6354
|
-
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
6355
|
-
function unknownFmt() {
|
|
6356
|
-
if (opts.strictSchema === false)
|
|
6357
|
-
return codegen_1.nil;
|
|
6358
|
-
return (0, codegen_1._)`${schemaCode} && !${format}`;
|
|
6359
|
-
}
|
|
6360
|
-
function invalidFmt() {
|
|
6361
|
-
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
|
|
6362
|
-
const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
|
|
6363
|
-
return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
6364
|
-
}
|
|
6098
|
+
const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
|
|
6099
|
+
const valid = gen.name("valid");
|
|
6100
|
+
if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
|
|
6101
|
+
it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
|
|
6365
6102
|
}
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
if (opts.strictSchema === false) {
|
|
6379
|
-
self.logger.warn(unknownMsg());
|
|
6380
|
-
return;
|
|
6381
|
-
}
|
|
6382
|
-
throw new Error(unknownMsg());
|
|
6383
|
-
function unknownMsg() {
|
|
6384
|
-
return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
|
|
6385
|
-
}
|
|
6386
|
-
}
|
|
6387
|
-
function getFormat(fmtDef) {
|
|
6388
|
-
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
|
|
6389
|
-
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
|
|
6390
|
-
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
|
|
6391
|
-
return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
|
|
6103
|
+
const { props } = it;
|
|
6104
|
+
validatePatternProperties();
|
|
6105
|
+
function validatePatternProperties() {
|
|
6106
|
+
for (const pat of patterns) {
|
|
6107
|
+
if (checkProperties)
|
|
6108
|
+
checkMatchingProperties(pat);
|
|
6109
|
+
if (it.allErrors) {
|
|
6110
|
+
validateProperties(pat);
|
|
6111
|
+
} else {
|
|
6112
|
+
gen.var(valid, true);
|
|
6113
|
+
validateProperties(pat);
|
|
6114
|
+
gen.if(valid);
|
|
6392
6115
|
}
|
|
6393
|
-
return ["string", fmtDef, fmt];
|
|
6394
6116
|
}
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6117
|
+
}
|
|
6118
|
+
function checkMatchingProperties(pat) {
|
|
6119
|
+
for (const prop in checkProperties) {
|
|
6120
|
+
if (new RegExp(pat).test(prop)) {
|
|
6121
|
+
(0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
|
|
6400
6122
|
}
|
|
6401
|
-
return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
|
|
6402
6123
|
}
|
|
6403
6124
|
}
|
|
6125
|
+
function validateProperties(pat) {
|
|
6126
|
+
gen.forIn("key", data, (key) => {
|
|
6127
|
+
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
|
|
6128
|
+
const alwaysValid = alwaysValidPatterns.includes(pat);
|
|
6129
|
+
if (!alwaysValid) {
|
|
6130
|
+
cxt.subschema({
|
|
6131
|
+
keyword: "patternProperties",
|
|
6132
|
+
schemaProp: pat,
|
|
6133
|
+
dataProp: key,
|
|
6134
|
+
dataPropType: util_2.Type.Str
|
|
6135
|
+
}, valid);
|
|
6136
|
+
}
|
|
6137
|
+
if (it.opts.unevaluated && props !== true) {
|
|
6138
|
+
gen.assign((0, codegen_1._)`${props}[${key}]`, true);
|
|
6139
|
+
} else if (!alwaysValid && !it.allErrors) {
|
|
6140
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
6141
|
+
}
|
|
6142
|
+
});
|
|
6143
|
+
});
|
|
6144
|
+
}
|
|
6404
6145
|
}
|
|
6405
6146
|
};
|
|
6406
6147
|
exports.default = def;
|
|
6407
6148
|
}
|
|
6408
6149
|
});
|
|
6409
|
-
|
|
6410
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6411
|
-
var
|
|
6412
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6413
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6414
|
-
var
|
|
6415
|
-
var
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
"contentSchema"
|
|
6438
|
-
];
|
|
6439
|
-
}
|
|
6440
|
-
});
|
|
6441
|
-
|
|
6442
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js
|
|
6443
|
-
var require_draft2020 = __commonJS({
|
|
6444
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js"(exports) {
|
|
6445
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6446
|
-
var core_1 = require_core2();
|
|
6447
|
-
var validation_1 = require_validation();
|
|
6448
|
-
var applicator_1 = require_applicator();
|
|
6449
|
-
var dynamic_1 = require_dynamic();
|
|
6450
|
-
var next_1 = require_next();
|
|
6451
|
-
var unevaluated_1 = require_unevaluated();
|
|
6452
|
-
var format_1 = require_format2();
|
|
6453
|
-
var metadata_1 = require_metadata();
|
|
6454
|
-
var draft2020Vocabularies = [
|
|
6455
|
-
dynamic_1.default,
|
|
6456
|
-
core_1.default,
|
|
6457
|
-
validation_1.default,
|
|
6458
|
-
(0, applicator_1.default)(true),
|
|
6459
|
-
format_1.default,
|
|
6460
|
-
metadata_1.metadataVocabulary,
|
|
6461
|
-
metadata_1.contentVocabulary,
|
|
6462
|
-
next_1.default,
|
|
6463
|
-
unevaluated_1.default
|
|
6464
|
-
];
|
|
6465
|
-
exports.default = draft2020Vocabularies;
|
|
6150
|
+
|
|
6151
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js
|
|
6152
|
+
var require_not = __commonJS({
|
|
6153
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports) {
|
|
6154
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6155
|
+
var util_1 = require_util();
|
|
6156
|
+
var def = {
|
|
6157
|
+
keyword: "not",
|
|
6158
|
+
schemaType: ["object", "boolean"],
|
|
6159
|
+
trackErrors: true,
|
|
6160
|
+
code(cxt) {
|
|
6161
|
+
const { gen, schema, it } = cxt;
|
|
6162
|
+
if ((0, util_1.alwaysValidSchema)(it, schema)) {
|
|
6163
|
+
cxt.fail();
|
|
6164
|
+
return;
|
|
6165
|
+
}
|
|
6166
|
+
const valid = gen.name("valid");
|
|
6167
|
+
cxt.subschema({
|
|
6168
|
+
keyword: "not",
|
|
6169
|
+
compositeRule: true,
|
|
6170
|
+
createErrors: false,
|
|
6171
|
+
allErrors: false
|
|
6172
|
+
}, valid);
|
|
6173
|
+
cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
|
|
6174
|
+
},
|
|
6175
|
+
error: { message: "must NOT be valid" }
|
|
6176
|
+
};
|
|
6177
|
+
exports.default = def;
|
|
6466
6178
|
}
|
|
6467
6179
|
});
|
|
6468
6180
|
|
|
6469
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6470
|
-
var
|
|
6471
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6181
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
|
|
6182
|
+
var require_anyOf = __commonJS({
|
|
6183
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports) {
|
|
6472
6184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6473
|
-
|
|
6474
|
-
var
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6185
|
+
var code_1 = require_code2();
|
|
6186
|
+
var def = {
|
|
6187
|
+
keyword: "anyOf",
|
|
6188
|
+
schemaType: "array",
|
|
6189
|
+
trackErrors: true,
|
|
6190
|
+
code: code_1.validateUnion,
|
|
6191
|
+
error: { message: "must match a schema in anyOf" }
|
|
6192
|
+
};
|
|
6193
|
+
exports.default = def;
|
|
6479
6194
|
}
|
|
6480
6195
|
});
|
|
6481
6196
|
|
|
6482
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6483
|
-
var
|
|
6484
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/
|
|
6197
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
|
|
6198
|
+
var require_oneOf = __commonJS({
|
|
6199
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports) {
|
|
6485
6200
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6486
6201
|
var codegen_1 = require_codegen();
|
|
6487
|
-
var types_1 = require_types();
|
|
6488
|
-
var compile_1 = require_compile();
|
|
6489
|
-
var ref_error_1 = require_ref_error();
|
|
6490
6202
|
var util_1 = require_util();
|
|
6491
6203
|
var error2 = {
|
|
6492
|
-
message:
|
|
6493
|
-
params: ({ params
|
|
6204
|
+
message: "must match exactly one schema in oneOf",
|
|
6205
|
+
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
|
|
6494
6206
|
};
|
|
6495
6207
|
var def = {
|
|
6496
|
-
keyword: "
|
|
6497
|
-
|
|
6498
|
-
|
|
6208
|
+
keyword: "oneOf",
|
|
6209
|
+
schemaType: "array",
|
|
6210
|
+
trackErrors: true,
|
|
6499
6211
|
error: error2,
|
|
6500
6212
|
code(cxt) {
|
|
6501
|
-
const { gen,
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
const
|
|
6507
|
-
if (typeof tagName != "string")
|
|
6508
|
-
throw new Error("discriminator: requires propertyName");
|
|
6509
|
-
if (schema.mapping)
|
|
6510
|
-
throw new Error("discriminator: mapping is not supported");
|
|
6511
|
-
if (!oneOf)
|
|
6512
|
-
throw new Error("discriminator: requires oneOf keyword");
|
|
6213
|
+
const { gen, schema, parentSchema, it } = cxt;
|
|
6214
|
+
if (!Array.isArray(schema))
|
|
6215
|
+
throw new Error("ajv implementation error");
|
|
6216
|
+
if (it.opts.discriminator && parentSchema.discriminator)
|
|
6217
|
+
return;
|
|
6218
|
+
const schArr = schema;
|
|
6513
6219
|
const valid = gen.let("valid", false);
|
|
6514
|
-
const
|
|
6515
|
-
gen.
|
|
6516
|
-
cxt.
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
gen.else();
|
|
6525
|
-
cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
|
|
6526
|
-
gen.endIf();
|
|
6527
|
-
}
|
|
6528
|
-
function applyTagSchema(schemaProp) {
|
|
6529
|
-
const _valid = gen.name("valid");
|
|
6530
|
-
const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
|
|
6531
|
-
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
6532
|
-
return _valid;
|
|
6533
|
-
}
|
|
6534
|
-
function getMapping() {
|
|
6535
|
-
var _a;
|
|
6536
|
-
const oneOfMapping = {};
|
|
6537
|
-
const topRequired = hasRequired(parentSchema);
|
|
6538
|
-
let tagRequired = true;
|
|
6539
|
-
for (let i = 0; i < oneOf.length; i++) {
|
|
6540
|
-
let sch = oneOf[i];
|
|
6541
|
-
if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
6542
|
-
const ref = sch.$ref;
|
|
6543
|
-
sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
|
|
6544
|
-
if (sch instanceof compile_1.SchemaEnv)
|
|
6545
|
-
sch = sch.schema;
|
|
6546
|
-
if (sch === void 0)
|
|
6547
|
-
throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
|
|
6548
|
-
}
|
|
6549
|
-
const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
|
|
6550
|
-
if (typeof propSch != "object") {
|
|
6551
|
-
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
|
|
6552
|
-
}
|
|
6553
|
-
tagRequired = tagRequired && (topRequired || hasRequired(sch));
|
|
6554
|
-
addMappings(propSch, i);
|
|
6555
|
-
}
|
|
6556
|
-
if (!tagRequired)
|
|
6557
|
-
throw new Error(`discriminator: "${tagName}" must be required`);
|
|
6558
|
-
return oneOfMapping;
|
|
6559
|
-
function hasRequired({ required }) {
|
|
6560
|
-
return Array.isArray(required) && required.includes(tagName);
|
|
6561
|
-
}
|
|
6562
|
-
function addMappings(sch, i) {
|
|
6563
|
-
if (sch.const) {
|
|
6564
|
-
addMapping(sch.const, i);
|
|
6565
|
-
} else if (sch.enum) {
|
|
6566
|
-
for (const tagValue of sch.enum) {
|
|
6567
|
-
addMapping(tagValue, i);
|
|
6568
|
-
}
|
|
6220
|
+
const passing = gen.let("passing", null);
|
|
6221
|
+
const schValid = gen.name("_valid");
|
|
6222
|
+
cxt.setParams({ passing });
|
|
6223
|
+
gen.block(validateOneOf);
|
|
6224
|
+
cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
|
|
6225
|
+
function validateOneOf() {
|
|
6226
|
+
schArr.forEach((sch, i) => {
|
|
6227
|
+
let schCxt;
|
|
6228
|
+
if ((0, util_1.alwaysValidSchema)(it, sch)) {
|
|
6229
|
+
gen.var(schValid, true);
|
|
6569
6230
|
} else {
|
|
6570
|
-
|
|
6231
|
+
schCxt = cxt.subschema({
|
|
6232
|
+
keyword: "oneOf",
|
|
6233
|
+
schemaProp: i,
|
|
6234
|
+
compositeRule: true
|
|
6235
|
+
}, schValid);
|
|
6571
6236
|
}
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
if (typeof tagValue != "string" || tagValue in oneOfMapping) {
|
|
6575
|
-
throw new Error(`discriminator: "${tagName}" values must be unique strings`);
|
|
6237
|
+
if (i > 0) {
|
|
6238
|
+
gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();
|
|
6576
6239
|
}
|
|
6577
|
-
|
|
6578
|
-
|
|
6240
|
+
gen.if(schValid, () => {
|
|
6241
|
+
gen.assign(valid, true);
|
|
6242
|
+
gen.assign(passing, i);
|
|
6243
|
+
if (schCxt)
|
|
6244
|
+
cxt.mergeEvaluated(schCxt, codegen_1.Name);
|
|
6245
|
+
});
|
|
6246
|
+
});
|
|
6579
6247
|
}
|
|
6580
6248
|
}
|
|
6581
6249
|
};
|
|
@@ -6583,477 +6251,616 @@ var require_discriminator = __commonJS({
|
|
|
6583
6251
|
}
|
|
6584
6252
|
});
|
|
6585
6253
|
|
|
6586
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6587
|
-
var
|
|
6588
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
{ $ref: "meta/unevaluated" },
|
|
6607
|
-
{ $ref: "meta/validation" },
|
|
6608
|
-
{ $ref: "meta/meta-data" },
|
|
6609
|
-
{ $ref: "meta/format-annotation" },
|
|
6610
|
-
{ $ref: "meta/content" }
|
|
6611
|
-
],
|
|
6612
|
-
type: ["object", "boolean"],
|
|
6613
|
-
$comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
|
|
6614
|
-
properties: {
|
|
6615
|
-
definitions: {
|
|
6616
|
-
$comment: '"definitions" has been replaced by "$defs".',
|
|
6617
|
-
type: "object",
|
|
6618
|
-
additionalProperties: { $dynamicRef: "#meta" },
|
|
6619
|
-
deprecated: true,
|
|
6620
|
-
default: {}
|
|
6621
|
-
},
|
|
6622
|
-
dependencies: {
|
|
6623
|
-
$comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
|
|
6624
|
-
type: "object",
|
|
6625
|
-
additionalProperties: {
|
|
6626
|
-
anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }]
|
|
6627
|
-
},
|
|
6628
|
-
deprecated: true,
|
|
6629
|
-
default: {}
|
|
6630
|
-
},
|
|
6631
|
-
$recursiveAnchor: {
|
|
6632
|
-
$comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
|
|
6633
|
-
$ref: "meta/core#/$defs/anchorString",
|
|
6634
|
-
deprecated: true
|
|
6635
|
-
},
|
|
6636
|
-
$recursiveRef: {
|
|
6637
|
-
$comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
|
|
6638
|
-
$ref: "meta/core#/$defs/uriReferenceString",
|
|
6639
|
-
deprecated: true
|
|
6640
|
-
}
|
|
6254
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js
|
|
6255
|
+
var require_allOf = __commonJS({
|
|
6256
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports) {
|
|
6257
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6258
|
+
var util_1 = require_util();
|
|
6259
|
+
var def = {
|
|
6260
|
+
keyword: "allOf",
|
|
6261
|
+
schemaType: "array",
|
|
6262
|
+
code(cxt) {
|
|
6263
|
+
const { gen, schema, it } = cxt;
|
|
6264
|
+
if (!Array.isArray(schema))
|
|
6265
|
+
throw new Error("ajv implementation error");
|
|
6266
|
+
const valid = gen.name("valid");
|
|
6267
|
+
schema.forEach((sch, i) => {
|
|
6268
|
+
if ((0, util_1.alwaysValidSchema)(it, sch))
|
|
6269
|
+
return;
|
|
6270
|
+
const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
|
|
6271
|
+
cxt.ok(valid);
|
|
6272
|
+
cxt.mergeEvaluated(schCxt);
|
|
6273
|
+
});
|
|
6641
6274
|
}
|
|
6642
6275
|
};
|
|
6276
|
+
exports.default = def;
|
|
6643
6277
|
}
|
|
6644
6278
|
});
|
|
6645
6279
|
|
|
6646
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6647
|
-
var
|
|
6648
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
},
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
}
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6280
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js
|
|
6281
|
+
var require_if = __commonJS({
|
|
6282
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports) {
|
|
6283
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6284
|
+
var codegen_1 = require_codegen();
|
|
6285
|
+
var util_1 = require_util();
|
|
6286
|
+
var error2 = {
|
|
6287
|
+
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
6288
|
+
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
|
|
6289
|
+
};
|
|
6290
|
+
var def = {
|
|
6291
|
+
keyword: "if",
|
|
6292
|
+
schemaType: ["object", "boolean"],
|
|
6293
|
+
trackErrors: true,
|
|
6294
|
+
error: error2,
|
|
6295
|
+
code(cxt) {
|
|
6296
|
+
const { gen, parentSchema, it } = cxt;
|
|
6297
|
+
if (parentSchema.then === void 0 && parentSchema.else === void 0) {
|
|
6298
|
+
(0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
|
|
6299
|
+
}
|
|
6300
|
+
const hasThen = hasSchema(it, "then");
|
|
6301
|
+
const hasElse = hasSchema(it, "else");
|
|
6302
|
+
if (!hasThen && !hasElse)
|
|
6303
|
+
return;
|
|
6304
|
+
const valid = gen.let("valid", true);
|
|
6305
|
+
const schValid = gen.name("_valid");
|
|
6306
|
+
validateIf();
|
|
6307
|
+
cxt.reset();
|
|
6308
|
+
if (hasThen && hasElse) {
|
|
6309
|
+
const ifClause = gen.let("ifClause");
|
|
6310
|
+
cxt.setParams({ ifClause });
|
|
6311
|
+
gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
|
|
6312
|
+
} else if (hasThen) {
|
|
6313
|
+
gen.if(schValid, validateClause("then"));
|
|
6314
|
+
} else {
|
|
6315
|
+
gen.if((0, codegen_1.not)(schValid), validateClause("else"));
|
|
6316
|
+
}
|
|
6317
|
+
cxt.pass(valid, () => cxt.error(true));
|
|
6318
|
+
function validateIf() {
|
|
6319
|
+
const schCxt = cxt.subschema({
|
|
6320
|
+
keyword: "if",
|
|
6321
|
+
compositeRule: true,
|
|
6322
|
+
createErrors: false,
|
|
6323
|
+
allErrors: false
|
|
6324
|
+
}, schValid);
|
|
6325
|
+
cxt.mergeEvaluated(schCxt);
|
|
6326
|
+
}
|
|
6327
|
+
function validateClause(keyword, ifClause) {
|
|
6328
|
+
return () => {
|
|
6329
|
+
const schCxt = cxt.subschema({ keyword }, schValid);
|
|
6330
|
+
gen.assign(valid, schValid);
|
|
6331
|
+
cxt.mergeValidEvaluated(schCxt, valid);
|
|
6332
|
+
if (ifClause)
|
|
6333
|
+
gen.assign(ifClause, (0, codegen_1._)`${keyword}`);
|
|
6334
|
+
else
|
|
6335
|
+
cxt.setParams({ ifClause: keyword });
|
|
6336
|
+
};
|
|
6693
6337
|
}
|
|
6694
6338
|
}
|
|
6695
6339
|
};
|
|
6340
|
+
function hasSchema(it, keyword) {
|
|
6341
|
+
const schema = it.schema[keyword];
|
|
6342
|
+
return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);
|
|
6343
|
+
}
|
|
6344
|
+
exports.default = def;
|
|
6696
6345
|
}
|
|
6697
6346
|
});
|
|
6698
6347
|
|
|
6699
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6700
|
-
var
|
|
6701
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
}
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
type: ["object", "boolean"],
|
|
6711
|
-
properties: {
|
|
6712
|
-
unevaluatedItems: { $dynamicRef: "#meta" },
|
|
6713
|
-
unevaluatedProperties: { $dynamicRef: "#meta" }
|
|
6348
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
|
|
6349
|
+
var require_thenElse = __commonJS({
|
|
6350
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports) {
|
|
6351
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6352
|
+
var util_1 = require_util();
|
|
6353
|
+
var def = {
|
|
6354
|
+
keyword: ["then", "else"],
|
|
6355
|
+
schemaType: ["object", "boolean"],
|
|
6356
|
+
code({ keyword, parentSchema, it }) {
|
|
6357
|
+
if (parentSchema.if === void 0)
|
|
6358
|
+
(0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
|
|
6714
6359
|
}
|
|
6715
6360
|
};
|
|
6361
|
+
exports.default = def;
|
|
6716
6362
|
}
|
|
6717
6363
|
});
|
|
6718
6364
|
|
|
6719
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6720
|
-
var
|
|
6721
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6365
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js
|
|
6366
|
+
var require_applicator2 = __commonJS({
|
|
6367
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports) {
|
|
6368
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6369
|
+
var additionalItems_1 = require_additionalItems();
|
|
6370
|
+
var prefixItems_1 = require_prefixItems();
|
|
6371
|
+
var items_1 = require_items();
|
|
6372
|
+
var items2020_1 = require_items2020();
|
|
6373
|
+
var contains_1 = require_contains();
|
|
6374
|
+
var dependencies_1 = require_dependencies();
|
|
6375
|
+
var propertyNames_1 = require_propertyNames();
|
|
6376
|
+
var additionalProperties_1 = require_additionalProperties();
|
|
6377
|
+
var properties_1 = require_properties();
|
|
6378
|
+
var patternProperties_1 = require_patternProperties();
|
|
6379
|
+
var not_1 = require_not();
|
|
6380
|
+
var anyOf_1 = require_anyOf();
|
|
6381
|
+
var oneOf_1 = require_oneOf();
|
|
6382
|
+
var allOf_1 = require_allOf();
|
|
6383
|
+
var if_1 = require_if();
|
|
6384
|
+
var thenElse_1 = require_thenElse();
|
|
6385
|
+
function getApplicator(draft20202 = false) {
|
|
6386
|
+
const applicator = [
|
|
6387
|
+
// any
|
|
6388
|
+
not_1.default,
|
|
6389
|
+
anyOf_1.default,
|
|
6390
|
+
oneOf_1.default,
|
|
6391
|
+
allOf_1.default,
|
|
6392
|
+
if_1.default,
|
|
6393
|
+
thenElse_1.default,
|
|
6394
|
+
// object
|
|
6395
|
+
propertyNames_1.default,
|
|
6396
|
+
additionalProperties_1.default,
|
|
6397
|
+
dependencies_1.default,
|
|
6398
|
+
properties_1.default,
|
|
6399
|
+
patternProperties_1.default
|
|
6400
|
+
];
|
|
6401
|
+
if (draft20202)
|
|
6402
|
+
applicator.push(prefixItems_1.default, items2020_1.default);
|
|
6403
|
+
else
|
|
6404
|
+
applicator.push(additionalItems_1.default, items_1.default);
|
|
6405
|
+
applicator.push(contains_1.default);
|
|
6406
|
+
return applicator;
|
|
6407
|
+
}
|
|
6408
|
+
exports.default = getApplicator;
|
|
6409
|
+
}
|
|
6410
|
+
});
|
|
6411
|
+
|
|
6412
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js
|
|
6413
|
+
var require_dynamicAnchor = __commonJS({
|
|
6414
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports) {
|
|
6415
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6416
|
+
exports.dynamicAnchor = void 0;
|
|
6417
|
+
var codegen_1 = require_codegen();
|
|
6418
|
+
var names_1 = require_names();
|
|
6419
|
+
var compile_1 = require_compile();
|
|
6420
|
+
var ref_1 = require_ref();
|
|
6421
|
+
var def = {
|
|
6422
|
+
keyword: "$dynamicAnchor",
|
|
6423
|
+
schemaType: "string",
|
|
6424
|
+
code: (cxt) => dynamicAnchor(cxt, cxt.schema)
|
|
6736
6425
|
};
|
|
6426
|
+
function dynamicAnchor(cxt, anchor) {
|
|
6427
|
+
const { gen, it } = cxt;
|
|
6428
|
+
it.schemaEnv.root.dynamicAnchors[anchor] = true;
|
|
6429
|
+
const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
|
|
6430
|
+
const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
|
|
6431
|
+
gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
|
|
6432
|
+
}
|
|
6433
|
+
exports.dynamicAnchor = dynamicAnchor;
|
|
6434
|
+
function _getValidate(cxt) {
|
|
6435
|
+
const { schemaEnv, schema, self } = cxt.it;
|
|
6436
|
+
const { root, baseId, localRefs, meta } = schemaEnv.root;
|
|
6437
|
+
const { schemaId } = self.opts;
|
|
6438
|
+
const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
|
|
6439
|
+
compile_1.compileSchema.call(self, sch);
|
|
6440
|
+
return (0, ref_1.getValidate)(cxt, sch);
|
|
6441
|
+
}
|
|
6442
|
+
exports.default = def;
|
|
6737
6443
|
}
|
|
6738
6444
|
});
|
|
6739
6445
|
|
|
6740
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6741
|
-
var
|
|
6742
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
}
|
|
6770
|
-
|
|
6771
|
-
type: "string"
|
|
6772
|
-
},
|
|
6773
|
-
$defs: {
|
|
6774
|
-
type: "object",
|
|
6775
|
-
additionalProperties: { $dynamicRef: "#meta" }
|
|
6776
|
-
}
|
|
6777
|
-
},
|
|
6778
|
-
$defs: {
|
|
6779
|
-
anchorString: {
|
|
6780
|
-
type: "string",
|
|
6781
|
-
pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
|
|
6782
|
-
},
|
|
6783
|
-
uriString: {
|
|
6784
|
-
type: "string",
|
|
6785
|
-
format: "uri"
|
|
6786
|
-
},
|
|
6787
|
-
uriReferenceString: {
|
|
6788
|
-
type: "string",
|
|
6789
|
-
format: "uri-reference"
|
|
6446
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
|
|
6447
|
+
var require_dynamicRef = __commonJS({
|
|
6448
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports) {
|
|
6449
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6450
|
+
exports.dynamicRef = void 0;
|
|
6451
|
+
var codegen_1 = require_codegen();
|
|
6452
|
+
var names_1 = require_names();
|
|
6453
|
+
var ref_1 = require_ref();
|
|
6454
|
+
var def = {
|
|
6455
|
+
keyword: "$dynamicRef",
|
|
6456
|
+
schemaType: "string",
|
|
6457
|
+
code: (cxt) => dynamicRef(cxt, cxt.schema)
|
|
6458
|
+
};
|
|
6459
|
+
function dynamicRef(cxt, ref) {
|
|
6460
|
+
const { gen, keyword, it } = cxt;
|
|
6461
|
+
if (ref[0] !== "#")
|
|
6462
|
+
throw new Error(`"${keyword}" only supports hash fragment reference`);
|
|
6463
|
+
const anchor = ref.slice(1);
|
|
6464
|
+
if (it.allErrors) {
|
|
6465
|
+
_dynamicRef();
|
|
6466
|
+
} else {
|
|
6467
|
+
const valid = gen.let("valid", false);
|
|
6468
|
+
_dynamicRef(valid);
|
|
6469
|
+
cxt.ok(valid);
|
|
6470
|
+
}
|
|
6471
|
+
function _dynamicRef(valid) {
|
|
6472
|
+
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
|
|
6473
|
+
const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
|
|
6474
|
+
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
|
|
6475
|
+
} else {
|
|
6476
|
+
_callRef(it.validateName, valid)();
|
|
6790
6477
|
}
|
|
6791
6478
|
}
|
|
6479
|
+
function _callRef(validate, valid) {
|
|
6480
|
+
return valid ? () => gen.block(() => {
|
|
6481
|
+
(0, ref_1.callRef)(cxt, validate);
|
|
6482
|
+
gen.let(valid, true);
|
|
6483
|
+
}) : () => (0, ref_1.callRef)(cxt, validate);
|
|
6484
|
+
}
|
|
6485
|
+
}
|
|
6486
|
+
exports.dynamicRef = dynamicRef;
|
|
6487
|
+
exports.default = def;
|
|
6488
|
+
}
|
|
6489
|
+
});
|
|
6490
|
+
|
|
6491
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js
|
|
6492
|
+
var require_recursiveAnchor = __commonJS({
|
|
6493
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports) {
|
|
6494
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6495
|
+
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
6496
|
+
var util_1 = require_util();
|
|
6497
|
+
var def = {
|
|
6498
|
+
keyword: "$recursiveAnchor",
|
|
6499
|
+
schemaType: "boolean",
|
|
6500
|
+
code(cxt) {
|
|
6501
|
+
if (cxt.schema)
|
|
6502
|
+
(0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
|
|
6503
|
+
else
|
|
6504
|
+
(0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
|
|
6505
|
+
}
|
|
6506
|
+
};
|
|
6507
|
+
exports.default = def;
|
|
6508
|
+
}
|
|
6509
|
+
});
|
|
6510
|
+
|
|
6511
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
|
|
6512
|
+
var require_recursiveRef = __commonJS({
|
|
6513
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports) {
|
|
6514
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6515
|
+
var dynamicRef_1 = require_dynamicRef();
|
|
6516
|
+
var def = {
|
|
6517
|
+
keyword: "$recursiveRef",
|
|
6518
|
+
schemaType: "string",
|
|
6519
|
+
code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
|
|
6792
6520
|
};
|
|
6521
|
+
exports.default = def;
|
|
6793
6522
|
}
|
|
6794
6523
|
});
|
|
6795
6524
|
|
|
6796
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6797
|
-
var
|
|
6798
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6525
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js
|
|
6526
|
+
var require_dynamic = __commonJS({
|
|
6527
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports) {
|
|
6528
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6529
|
+
var dynamicAnchor_1 = require_dynamicAnchor();
|
|
6530
|
+
var dynamicRef_1 = require_dynamicRef();
|
|
6531
|
+
var recursiveAnchor_1 = require_recursiveAnchor();
|
|
6532
|
+
var recursiveRef_1 = require_recursiveRef();
|
|
6533
|
+
var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
|
|
6534
|
+
exports.default = dynamic;
|
|
6535
|
+
}
|
|
6536
|
+
});
|
|
6537
|
+
|
|
6538
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
|
|
6539
|
+
var require_dependentRequired = __commonJS({
|
|
6540
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports) {
|
|
6541
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6542
|
+
var dependencies_1 = require_dependencies();
|
|
6543
|
+
var def = {
|
|
6544
|
+
keyword: "dependentRequired",
|
|
6545
|
+
type: "object",
|
|
6546
|
+
schemaType: "object",
|
|
6547
|
+
error: dependencies_1.error,
|
|
6548
|
+
code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
|
|
6811
6549
|
};
|
|
6550
|
+
exports.default = def;
|
|
6812
6551
|
}
|
|
6813
6552
|
});
|
|
6814
6553
|
|
|
6815
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6816
|
-
var
|
|
6817
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
},
|
|
6843
|
-
writeOnly: {
|
|
6844
|
-
type: "boolean",
|
|
6845
|
-
default: false
|
|
6846
|
-
},
|
|
6847
|
-
examples: {
|
|
6848
|
-
type: "array",
|
|
6849
|
-
items: true
|
|
6554
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
|
|
6555
|
+
var require_dependentSchemas = __commonJS({
|
|
6556
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports) {
|
|
6557
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6558
|
+
var dependencies_1 = require_dependencies();
|
|
6559
|
+
var def = {
|
|
6560
|
+
keyword: "dependentSchemas",
|
|
6561
|
+
type: "object",
|
|
6562
|
+
schemaType: "object",
|
|
6563
|
+
code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)
|
|
6564
|
+
};
|
|
6565
|
+
exports.default = def;
|
|
6566
|
+
}
|
|
6567
|
+
});
|
|
6568
|
+
|
|
6569
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js
|
|
6570
|
+
var require_limitContains = __commonJS({
|
|
6571
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports) {
|
|
6572
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6573
|
+
var util_1 = require_util();
|
|
6574
|
+
var def = {
|
|
6575
|
+
keyword: ["maxContains", "minContains"],
|
|
6576
|
+
type: "array",
|
|
6577
|
+
schemaType: "number",
|
|
6578
|
+
code({ keyword, parentSchema, it }) {
|
|
6579
|
+
if (parentSchema.contains === void 0) {
|
|
6580
|
+
(0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
|
|
6850
6581
|
}
|
|
6851
6582
|
}
|
|
6852
6583
|
};
|
|
6584
|
+
exports.default = def;
|
|
6853
6585
|
}
|
|
6854
6586
|
});
|
|
6855
6587
|
|
|
6856
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6857
|
-
var
|
|
6858
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
},
|
|
6895
|
-
minimum: {
|
|
6896
|
-
type: "number"
|
|
6897
|
-
},
|
|
6898
|
-
exclusiveMinimum: {
|
|
6899
|
-
type: "number"
|
|
6900
|
-
},
|
|
6901
|
-
maxLength: { $ref: "#/$defs/nonNegativeInteger" },
|
|
6902
|
-
minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
6903
|
-
pattern: {
|
|
6904
|
-
type: "string",
|
|
6905
|
-
format: "regex"
|
|
6906
|
-
},
|
|
6907
|
-
maxItems: { $ref: "#/$defs/nonNegativeInteger" },
|
|
6908
|
-
minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
6909
|
-
uniqueItems: {
|
|
6910
|
-
type: "boolean",
|
|
6911
|
-
default: false
|
|
6912
|
-
},
|
|
6913
|
-
maxContains: { $ref: "#/$defs/nonNegativeInteger" },
|
|
6914
|
-
minContains: {
|
|
6915
|
-
$ref: "#/$defs/nonNegativeInteger",
|
|
6916
|
-
default: 1
|
|
6917
|
-
},
|
|
6918
|
-
maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
|
|
6919
|
-
minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
|
|
6920
|
-
required: { $ref: "#/$defs/stringArray" },
|
|
6921
|
-
dependentRequired: {
|
|
6922
|
-
type: "object",
|
|
6923
|
-
additionalProperties: {
|
|
6924
|
-
$ref: "#/$defs/stringArray"
|
|
6925
|
-
}
|
|
6588
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js
|
|
6589
|
+
var require_next = __commonJS({
|
|
6590
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js"(exports) {
|
|
6591
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6592
|
+
var dependentRequired_1 = require_dependentRequired();
|
|
6593
|
+
var dependentSchemas_1 = require_dependentSchemas();
|
|
6594
|
+
var limitContains_1 = require_limitContains();
|
|
6595
|
+
var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
|
|
6596
|
+
exports.default = next;
|
|
6597
|
+
}
|
|
6598
|
+
});
|
|
6599
|
+
|
|
6600
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
|
|
6601
|
+
var require_unevaluatedProperties = __commonJS({
|
|
6602
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports) {
|
|
6603
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6604
|
+
var codegen_1 = require_codegen();
|
|
6605
|
+
var util_1 = require_util();
|
|
6606
|
+
var names_1 = require_names();
|
|
6607
|
+
var error2 = {
|
|
6608
|
+
message: "must NOT have unevaluated properties",
|
|
6609
|
+
params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`
|
|
6610
|
+
};
|
|
6611
|
+
var def = {
|
|
6612
|
+
keyword: "unevaluatedProperties",
|
|
6613
|
+
type: "object",
|
|
6614
|
+
schemaType: ["boolean", "object"],
|
|
6615
|
+
trackErrors: true,
|
|
6616
|
+
error: error2,
|
|
6617
|
+
code(cxt) {
|
|
6618
|
+
const { gen, schema, data, errsCount, it } = cxt;
|
|
6619
|
+
if (!errsCount)
|
|
6620
|
+
throw new Error("ajv implementation error");
|
|
6621
|
+
const { allErrors, props } = it;
|
|
6622
|
+
if (props instanceof codegen_1.Name) {
|
|
6623
|
+
gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
|
|
6624
|
+
} else if (props !== true) {
|
|
6625
|
+
gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
|
|
6926
6626
|
}
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6627
|
+
it.props = true;
|
|
6628
|
+
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
6629
|
+
function unevaluatedPropCode(key) {
|
|
6630
|
+
if (schema === false) {
|
|
6631
|
+
cxt.setParams({ unevaluatedProperty: key });
|
|
6632
|
+
cxt.error();
|
|
6633
|
+
if (!allErrors)
|
|
6634
|
+
gen.break();
|
|
6635
|
+
return;
|
|
6636
|
+
}
|
|
6637
|
+
if (!(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
6638
|
+
const valid = gen.name("valid");
|
|
6639
|
+
cxt.subschema({
|
|
6640
|
+
keyword: "unevaluatedProperties",
|
|
6641
|
+
dataProp: key,
|
|
6642
|
+
dataPropType: util_1.Type.Str
|
|
6643
|
+
}, valid);
|
|
6644
|
+
if (!allErrors)
|
|
6645
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
6646
|
+
}
|
|
6647
|
+
}
|
|
6648
|
+
function unevaluatedDynamic(evaluatedProps, key) {
|
|
6649
|
+
return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;
|
|
6650
|
+
}
|
|
6651
|
+
function unevaluatedStatic(evaluatedProps, key) {
|
|
6652
|
+
const ps = [];
|
|
6653
|
+
for (const p in evaluatedProps) {
|
|
6654
|
+
if (evaluatedProps[p] === true)
|
|
6655
|
+
ps.push((0, codegen_1._)`${key} !== ${p}`);
|
|
6656
|
+
}
|
|
6657
|
+
return (0, codegen_1.and)(...ps);
|
|
6945
6658
|
}
|
|
6946
6659
|
}
|
|
6947
6660
|
};
|
|
6661
|
+
exports.default = def;
|
|
6948
6662
|
}
|
|
6949
6663
|
});
|
|
6950
6664
|
|
|
6951
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6952
|
-
var
|
|
6953
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6665
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
|
|
6666
|
+
var require_unevaluatedItems = __commonJS({
|
|
6667
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports) {
|
|
6954
6668
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6955
|
-
var
|
|
6956
|
-
var
|
|
6957
|
-
var
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
var
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6669
|
+
var codegen_1 = require_codegen();
|
|
6670
|
+
var util_1 = require_util();
|
|
6671
|
+
var error2 = {
|
|
6672
|
+
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
6673
|
+
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
6674
|
+
};
|
|
6675
|
+
var def = {
|
|
6676
|
+
keyword: "unevaluatedItems",
|
|
6677
|
+
type: "array",
|
|
6678
|
+
schemaType: ["boolean", "object"],
|
|
6679
|
+
error: error2,
|
|
6680
|
+
code(cxt) {
|
|
6681
|
+
const { gen, schema, data, it } = cxt;
|
|
6682
|
+
const items = it.items || 0;
|
|
6683
|
+
if (items === true)
|
|
6684
|
+
return;
|
|
6685
|
+
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
6686
|
+
if (schema === false) {
|
|
6687
|
+
cxt.setParams({ len: items });
|
|
6688
|
+
cxt.fail((0, codegen_1._)`${len} > ${items}`);
|
|
6689
|
+
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
6690
|
+
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
|
|
6691
|
+
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
|
|
6692
|
+
cxt.ok(valid);
|
|
6693
|
+
}
|
|
6694
|
+
it.items = true;
|
|
6695
|
+
function validateItems(valid, from) {
|
|
6696
|
+
gen.forRange("i", from, len, (i) => {
|
|
6697
|
+
cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
|
|
6698
|
+
if (!it.allErrors)
|
|
6699
|
+
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
6700
|
+
});
|
|
6701
|
+
}
|
|
6978
6702
|
}
|
|
6979
|
-
}
|
|
6980
|
-
exports.default =
|
|
6703
|
+
};
|
|
6704
|
+
exports.default = def;
|
|
6981
6705
|
}
|
|
6982
6706
|
});
|
|
6983
6707
|
|
|
6984
|
-
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6985
|
-
var
|
|
6986
|
-
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/
|
|
6708
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js
|
|
6709
|
+
var require_unevaluated2 = __commonJS({
|
|
6710
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports) {
|
|
6987
6711
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6988
|
-
|
|
6989
|
-
var
|
|
6990
|
-
var
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
}
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
const { $data,
|
|
7012
|
-
|
|
6712
|
+
var unevaluatedProperties_1 = require_unevaluatedProperties();
|
|
6713
|
+
var unevaluatedItems_1 = require_unevaluatedItems();
|
|
6714
|
+
var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
|
|
6715
|
+
exports.default = unevaluated;
|
|
6716
|
+
}
|
|
6717
|
+
});
|
|
6718
|
+
|
|
6719
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js
|
|
6720
|
+
var require_format = __commonJS({
|
|
6721
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports) {
|
|
6722
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6723
|
+
var codegen_1 = require_codegen();
|
|
6724
|
+
var error2 = {
|
|
6725
|
+
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
6726
|
+
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
6727
|
+
};
|
|
6728
|
+
var def = {
|
|
6729
|
+
keyword: "format",
|
|
6730
|
+
type: ["number", "string"],
|
|
6731
|
+
schemaType: "string",
|
|
6732
|
+
$data: true,
|
|
6733
|
+
error: error2,
|
|
6734
|
+
code(cxt, ruleType) {
|
|
6735
|
+
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
6736
|
+
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
6737
|
+
if (!opts.validateFormats)
|
|
7013
6738
|
return;
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
6739
|
+
if ($data)
|
|
6740
|
+
validate$DataFormat();
|
|
6741
|
+
else
|
|
6742
|
+
validateFormat();
|
|
6743
|
+
function validate$DataFormat() {
|
|
6744
|
+
const fmts = gen.scopeValue("formats", {
|
|
6745
|
+
ref: self.formats,
|
|
6746
|
+
code: opts.code.formats
|
|
6747
|
+
});
|
|
6748
|
+
const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
|
|
6749
|
+
const fType = gen.let("fType");
|
|
6750
|
+
const format = gen.let("format");
|
|
6751
|
+
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef));
|
|
6752
|
+
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
6753
|
+
function unknownFmt() {
|
|
6754
|
+
if (opts.strictSchema === false)
|
|
6755
|
+
return codegen_1.nil;
|
|
6756
|
+
return (0, codegen_1._)`${schemaCode} && !${format}`;
|
|
6757
|
+
}
|
|
6758
|
+
function invalidFmt() {
|
|
6759
|
+
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
|
|
6760
|
+
const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
|
|
6761
|
+
return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
6762
|
+
}
|
|
6763
|
+
}
|
|
6764
|
+
function validateFormat() {
|
|
6765
|
+
const formatDef = self.formats[schema];
|
|
6766
|
+
if (!formatDef) {
|
|
6767
|
+
unknownFormat();
|
|
6768
|
+
return;
|
|
6769
|
+
}
|
|
6770
|
+
if (formatDef === true)
|
|
6771
|
+
return;
|
|
6772
|
+
const [fmtType, format, fmtRef] = getFormat(formatDef);
|
|
6773
|
+
if (fmtType === ruleType)
|
|
6774
|
+
cxt.pass(validCondition());
|
|
6775
|
+
function unknownFormat() {
|
|
6776
|
+
if (opts.strictSchema === false) {
|
|
6777
|
+
self.logger.warn(unknownMsg());
|
|
6778
|
+
return;
|
|
6779
|
+
}
|
|
6780
|
+
throw new Error(unknownMsg());
|
|
6781
|
+
function unknownMsg() {
|
|
6782
|
+
return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
|
|
6783
|
+
}
|
|
6784
|
+
}
|
|
6785
|
+
function getFormat(fmtDef) {
|
|
6786
|
+
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
|
|
6787
|
+
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
|
|
6788
|
+
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
|
|
6789
|
+
return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
|
|
6790
|
+
}
|
|
6791
|
+
return ["string", fmtDef, fmt];
|
|
6792
|
+
}
|
|
6793
|
+
function validCondition() {
|
|
6794
|
+
if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
|
|
6795
|
+
if (!schemaEnv.$async)
|
|
6796
|
+
throw new Error("async format in sync schema");
|
|
6797
|
+
return (0, codegen_1._)`await ${fmtRef}(${data})`;
|
|
6798
|
+
}
|
|
6799
|
+
return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
|
|
6800
|
+
}
|
|
6801
|
+
}
|
|
7019
6802
|
}
|
|
7020
6803
|
};
|
|
7021
|
-
exports.
|
|
7022
|
-
|
|
7023
|
-
|
|
6804
|
+
exports.default = def;
|
|
6805
|
+
}
|
|
6806
|
+
});
|
|
6807
|
+
|
|
6808
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js
|
|
6809
|
+
var require_format2 = __commonJS({
|
|
6810
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports) {
|
|
7024
6811
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7025
|
-
|
|
7026
|
-
var
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
Object.defineProperty(exports, "
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
6812
|
+
var format_1 = require_format();
|
|
6813
|
+
var format = [format_1.default];
|
|
6814
|
+
exports.default = format;
|
|
6815
|
+
}
|
|
6816
|
+
});
|
|
6817
|
+
|
|
6818
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js
|
|
6819
|
+
var require_metadata = __commonJS({
|
|
6820
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports) {
|
|
6821
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6822
|
+
exports.contentVocabulary = exports.metadataVocabulary = void 0;
|
|
6823
|
+
exports.metadataVocabulary = [
|
|
6824
|
+
"title",
|
|
6825
|
+
"description",
|
|
6826
|
+
"default",
|
|
6827
|
+
"deprecated",
|
|
6828
|
+
"readOnly",
|
|
6829
|
+
"writeOnly",
|
|
6830
|
+
"examples"
|
|
6831
|
+
];
|
|
6832
|
+
exports.contentVocabulary = [
|
|
6833
|
+
"contentMediaType",
|
|
6834
|
+
"contentEncoding",
|
|
6835
|
+
"contentSchema"
|
|
6836
|
+
];
|
|
6837
|
+
}
|
|
6838
|
+
});
|
|
6839
|
+
|
|
6840
|
+
// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js
|
|
6841
|
+
var require_draft2020 = __commonJS({
|
|
6842
|
+
"../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js"(exports) {
|
|
6843
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6844
|
+
var core_1 = require_core3();
|
|
6845
|
+
var validation_1 = require_validation2();
|
|
6846
|
+
var applicator_1 = require_applicator2();
|
|
6847
|
+
var dynamic_1 = require_dynamic();
|
|
6848
|
+
var next_1 = require_next();
|
|
6849
|
+
var unevaluated_1 = require_unevaluated2();
|
|
6850
|
+
var format_1 = require_format2();
|
|
6851
|
+
var metadata_1 = require_metadata();
|
|
6852
|
+
var draft2020Vocabularies = [
|
|
6853
|
+
dynamic_1.default,
|
|
6854
|
+
core_1.default,
|
|
6855
|
+
validation_1.default,
|
|
6856
|
+
(0, applicator_1.default)(true),
|
|
6857
|
+
format_1.default,
|
|
6858
|
+
metadata_1.metadataVocabulary,
|
|
6859
|
+
metadata_1.contentVocabulary,
|
|
6860
|
+
next_1.default,
|
|
6861
|
+
unevaluated_1.default
|
|
6862
|
+
];
|
|
6863
|
+
exports.default = draft2020Vocabularies;
|
|
7057
6864
|
}
|
|
7058
6865
|
});
|
|
7059
6866
|
|
|
@@ -7205,7 +7012,9 @@ function defaultReadMicros() {
|
|
|
7205
7012
|
}
|
|
7206
7013
|
|
|
7207
7014
|
// src/schema.ts
|
|
7208
|
-
var
|
|
7015
|
+
var AjvCoreModule = __toESM(require_core());
|
|
7016
|
+
var AddMetaSchema2020Module = __toESM(require_json_schema_2020_12());
|
|
7017
|
+
var Draft2020Module = __toESM(require_draft2020());
|
|
7209
7018
|
|
|
7210
7019
|
// schema/profile-capture.schema.json
|
|
7211
7020
|
var profile_capture_schema_default = {
|
|
@@ -7281,7 +7090,35 @@ var profile_capture_schema_default = {
|
|
|
7281
7090
|
};
|
|
7282
7091
|
|
|
7283
7092
|
// src/schema.ts
|
|
7284
|
-
|
|
7093
|
+
function resolveCommonJsDefault(moduleDefault, isExpected) {
|
|
7094
|
+
if (isExpected(moduleDefault)) return moduleDefault;
|
|
7095
|
+
const nestedDefault = moduleDefault?.default;
|
|
7096
|
+
if (isExpected(nestedDefault)) return nestedDefault;
|
|
7097
|
+
throw new TypeError("Ajv CommonJS export shape is unsupported");
|
|
7098
|
+
}
|
|
7099
|
+
var AjvCore = resolveCommonJsDefault(
|
|
7100
|
+
AjvCoreModule.default,
|
|
7101
|
+
(value) => typeof value === "function"
|
|
7102
|
+
);
|
|
7103
|
+
var addMetaSchema2020 = resolveCommonJsDefault(
|
|
7104
|
+
AddMetaSchema2020Module.default,
|
|
7105
|
+
(value) => typeof value === "function"
|
|
7106
|
+
);
|
|
7107
|
+
var draft2020 = resolveCommonJsDefault(
|
|
7108
|
+
Draft2020Module.default,
|
|
7109
|
+
(value) => Array.isArray(value)
|
|
7110
|
+
);
|
|
7111
|
+
var ajv = new AjvCore({
|
|
7112
|
+
allErrors: true,
|
|
7113
|
+
dynamicRef: true,
|
|
7114
|
+
meta: false,
|
|
7115
|
+
next: true,
|
|
7116
|
+
strict: true,
|
|
7117
|
+
unevaluated: true
|
|
7118
|
+
});
|
|
7119
|
+
for (const vocabulary of draft2020) ajv.addVocabulary(vocabulary);
|
|
7120
|
+
addMetaSchema2020.call(ajv, false);
|
|
7121
|
+
var validator = ajv.compile(profile_capture_schema_default);
|
|
7285
7122
|
function error(code, path, message) {
|
|
7286
7123
|
return {
|
|
7287
7124
|
ok: false,
|