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