@mastra/schema-compat 1.2.9-alpha.0 → 1.2.9

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.
@@ -6299,8 +6299,817 @@ var require_ajv = __commonJS({
6299
6299
  }
6300
6300
  });
6301
6301
 
6302
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js
6303
+ var require_dynamicAnchor = __commonJS({
6304
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports$1) {
6305
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6306
+ exports$1.dynamicAnchor = void 0;
6307
+ var codegen_1 = require_codegen();
6308
+ var names_1 = require_names();
6309
+ var compile_1 = require_compile();
6310
+ var ref_1 = require_ref();
6311
+ var def = {
6312
+ keyword: "$dynamicAnchor",
6313
+ schemaType: "string",
6314
+ code: (cxt) => dynamicAnchor(cxt, cxt.schema)
6315
+ };
6316
+ function dynamicAnchor(cxt, anchor) {
6317
+ const { gen, it } = cxt;
6318
+ it.schemaEnv.root.dynamicAnchors[anchor] = true;
6319
+ const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
6320
+ const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
6321
+ gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
6322
+ }
6323
+ exports$1.dynamicAnchor = dynamicAnchor;
6324
+ function _getValidate(cxt) {
6325
+ const { schemaEnv, schema, self } = cxt.it;
6326
+ const { root, baseId, localRefs, meta } = schemaEnv.root;
6327
+ const { schemaId } = self.opts;
6328
+ const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
6329
+ compile_1.compileSchema.call(self, sch);
6330
+ return (0, ref_1.getValidate)(cxt, sch);
6331
+ }
6332
+ exports$1.default = def;
6333
+ }
6334
+ });
6335
+
6336
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
6337
+ var require_dynamicRef = __commonJS({
6338
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports$1) {
6339
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6340
+ exports$1.dynamicRef = void 0;
6341
+ var codegen_1 = require_codegen();
6342
+ var names_1 = require_names();
6343
+ var ref_1 = require_ref();
6344
+ var def = {
6345
+ keyword: "$dynamicRef",
6346
+ schemaType: "string",
6347
+ code: (cxt) => dynamicRef(cxt, cxt.schema)
6348
+ };
6349
+ function dynamicRef(cxt, ref) {
6350
+ const { gen, keyword, it } = cxt;
6351
+ if (ref[0] !== "#")
6352
+ throw new Error(`"${keyword}" only supports hash fragment reference`);
6353
+ const anchor = ref.slice(1);
6354
+ if (it.allErrors) {
6355
+ _dynamicRef();
6356
+ } else {
6357
+ const valid = gen.let("valid", false);
6358
+ _dynamicRef(valid);
6359
+ cxt.ok(valid);
6360
+ }
6361
+ function _dynamicRef(valid) {
6362
+ if (it.schemaEnv.root.dynamicAnchors[anchor]) {
6363
+ const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
6364
+ gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
6365
+ } else {
6366
+ _callRef(it.validateName, valid)();
6367
+ }
6368
+ }
6369
+ function _callRef(validate, valid) {
6370
+ return valid ? () => gen.block(() => {
6371
+ (0, ref_1.callRef)(cxt, validate);
6372
+ gen.let(valid, true);
6373
+ }) : () => (0, ref_1.callRef)(cxt, validate);
6374
+ }
6375
+ }
6376
+ exports$1.dynamicRef = dynamicRef;
6377
+ exports$1.default = def;
6378
+ }
6379
+ });
6380
+
6381
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js
6382
+ var require_recursiveAnchor = __commonJS({
6383
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports$1) {
6384
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6385
+ var dynamicAnchor_1 = require_dynamicAnchor();
6386
+ var util_1 = require_util();
6387
+ var def = {
6388
+ keyword: "$recursiveAnchor",
6389
+ schemaType: "boolean",
6390
+ code(cxt) {
6391
+ if (cxt.schema)
6392
+ (0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
6393
+ else
6394
+ (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
6395
+ }
6396
+ };
6397
+ exports$1.default = def;
6398
+ }
6399
+ });
6400
+
6401
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
6402
+ var require_recursiveRef = __commonJS({
6403
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports$1) {
6404
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6405
+ var dynamicRef_1 = require_dynamicRef();
6406
+ var def = {
6407
+ keyword: "$recursiveRef",
6408
+ schemaType: "string",
6409
+ code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
6410
+ };
6411
+ exports$1.default = def;
6412
+ }
6413
+ });
6414
+
6415
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/index.js
6416
+ var require_dynamic = __commonJS({
6417
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports$1) {
6418
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6419
+ var dynamicAnchor_1 = require_dynamicAnchor();
6420
+ var dynamicRef_1 = require_dynamicRef();
6421
+ var recursiveAnchor_1 = require_recursiveAnchor();
6422
+ var recursiveRef_1 = require_recursiveRef();
6423
+ var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
6424
+ exports$1.default = dynamic;
6425
+ }
6426
+ });
6427
+
6428
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
6429
+ var require_dependentRequired = __commonJS({
6430
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports$1) {
6431
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6432
+ var dependencies_1 = require_dependencies();
6433
+ var def = {
6434
+ keyword: "dependentRequired",
6435
+ type: "object",
6436
+ schemaType: "object",
6437
+ error: dependencies_1.error,
6438
+ code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
6439
+ };
6440
+ exports$1.default = def;
6441
+ }
6442
+ });
6443
+
6444
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
6445
+ var require_dependentSchemas = __commonJS({
6446
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports$1) {
6447
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6448
+ var dependencies_1 = require_dependencies();
6449
+ var def = {
6450
+ keyword: "dependentSchemas",
6451
+ type: "object",
6452
+ schemaType: "object",
6453
+ code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)
6454
+ };
6455
+ exports$1.default = def;
6456
+ }
6457
+ });
6458
+
6459
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js
6460
+ var require_limitContains = __commonJS({
6461
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports$1) {
6462
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6463
+ var util_1 = require_util();
6464
+ var def = {
6465
+ keyword: ["maxContains", "minContains"],
6466
+ type: "array",
6467
+ schemaType: "number",
6468
+ code({ keyword, parentSchema, it }) {
6469
+ if (parentSchema.contains === void 0) {
6470
+ (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
6471
+ }
6472
+ }
6473
+ };
6474
+ exports$1.default = def;
6475
+ }
6476
+ });
6477
+
6478
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/next.js
6479
+ var require_next = __commonJS({
6480
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/next.js"(exports$1) {
6481
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6482
+ var dependentRequired_1 = require_dependentRequired();
6483
+ var dependentSchemas_1 = require_dependentSchemas();
6484
+ var limitContains_1 = require_limitContains();
6485
+ var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
6486
+ exports$1.default = next;
6487
+ }
6488
+ });
6489
+
6490
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
6491
+ var require_unevaluatedProperties = __commonJS({
6492
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports$1) {
6493
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6494
+ var codegen_1 = require_codegen();
6495
+ var util_1 = require_util();
6496
+ var names_1 = require_names();
6497
+ var error = {
6498
+ message: "must NOT have unevaluated properties",
6499
+ params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`
6500
+ };
6501
+ var def = {
6502
+ keyword: "unevaluatedProperties",
6503
+ type: "object",
6504
+ schemaType: ["boolean", "object"],
6505
+ trackErrors: true,
6506
+ error,
6507
+ code(cxt) {
6508
+ const { gen, schema, data, errsCount, it } = cxt;
6509
+ if (!errsCount)
6510
+ throw new Error("ajv implementation error");
6511
+ const { allErrors, props } = it;
6512
+ if (props instanceof codegen_1.Name) {
6513
+ gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
6514
+ } else if (props !== true) {
6515
+ gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
6516
+ }
6517
+ it.props = true;
6518
+ cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
6519
+ function unevaluatedPropCode(key) {
6520
+ if (schema === false) {
6521
+ cxt.setParams({ unevaluatedProperty: key });
6522
+ cxt.error();
6523
+ if (!allErrors)
6524
+ gen.break();
6525
+ return;
6526
+ }
6527
+ if (!(0, util_1.alwaysValidSchema)(it, schema)) {
6528
+ const valid = gen.name("valid");
6529
+ cxt.subschema({
6530
+ keyword: "unevaluatedProperties",
6531
+ dataProp: key,
6532
+ dataPropType: util_1.Type.Str
6533
+ }, valid);
6534
+ if (!allErrors)
6535
+ gen.if((0, codegen_1.not)(valid), () => gen.break());
6536
+ }
6537
+ }
6538
+ function unevaluatedDynamic(evaluatedProps, key) {
6539
+ return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;
6540
+ }
6541
+ function unevaluatedStatic(evaluatedProps, key) {
6542
+ const ps = [];
6543
+ for (const p in evaluatedProps) {
6544
+ if (evaluatedProps[p] === true)
6545
+ ps.push((0, codegen_1._)`${key} !== ${p}`);
6546
+ }
6547
+ return (0, codegen_1.and)(...ps);
6548
+ }
6549
+ }
6550
+ };
6551
+ exports$1.default = def;
6552
+ }
6553
+ });
6554
+
6555
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
6556
+ var require_unevaluatedItems = __commonJS({
6557
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports$1) {
6558
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6559
+ var codegen_1 = require_codegen();
6560
+ var util_1 = require_util();
6561
+ var error = {
6562
+ message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
6563
+ params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
6564
+ };
6565
+ var def = {
6566
+ keyword: "unevaluatedItems",
6567
+ type: "array",
6568
+ schemaType: ["boolean", "object"],
6569
+ error,
6570
+ code(cxt) {
6571
+ const { gen, schema, data, it } = cxt;
6572
+ const items = it.items || 0;
6573
+ if (items === true)
6574
+ return;
6575
+ const len = gen.const("len", (0, codegen_1._)`${data}.length`);
6576
+ if (schema === false) {
6577
+ cxt.setParams({ len: items });
6578
+ cxt.fail((0, codegen_1._)`${len} > ${items}`);
6579
+ } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
6580
+ const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
6581
+ gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
6582
+ cxt.ok(valid);
6583
+ }
6584
+ it.items = true;
6585
+ function validateItems(valid, from) {
6586
+ gen.forRange("i", from, len, (i) => {
6587
+ cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
6588
+ if (!it.allErrors)
6589
+ gen.if((0, codegen_1.not)(valid), () => gen.break());
6590
+ });
6591
+ }
6592
+ }
6593
+ };
6594
+ exports$1.default = def;
6595
+ }
6596
+ });
6597
+
6598
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js
6599
+ var require_unevaluated = __commonJS({
6600
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports$1) {
6601
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6602
+ var unevaluatedProperties_1 = require_unevaluatedProperties();
6603
+ var unevaluatedItems_1 = require_unevaluatedItems();
6604
+ var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
6605
+ exports$1.default = unevaluated;
6606
+ }
6607
+ });
6608
+
6609
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft2020.js
6610
+ var require_draft2020 = __commonJS({
6611
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft2020.js"(exports$1) {
6612
+ Object.defineProperty(exports$1, "__esModule", { value: true });
6613
+ var core_1 = require_core2();
6614
+ var validation_1 = require_validation();
6615
+ var applicator_1 = require_applicator();
6616
+ var dynamic_1 = require_dynamic();
6617
+ var next_1 = require_next();
6618
+ var unevaluated_1 = require_unevaluated();
6619
+ var format_1 = require_format2();
6620
+ var metadata_1 = require_metadata();
6621
+ var draft2020Vocabularies = [
6622
+ dynamic_1.default,
6623
+ core_1.default,
6624
+ validation_1.default,
6625
+ (0, applicator_1.default)(true),
6626
+ format_1.default,
6627
+ metadata_1.metadataVocabulary,
6628
+ metadata_1.contentVocabulary,
6629
+ next_1.default,
6630
+ unevaluated_1.default
6631
+ ];
6632
+ exports$1.default = draft2020Vocabularies;
6633
+ }
6634
+ });
6635
+
6636
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json
6637
+ var require_schema = __commonJS({
6638
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json"(exports$1, module) {
6639
+ module.exports = {
6640
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6641
+ $id: "https://json-schema.org/draft/2020-12/schema",
6642
+ $vocabulary: {
6643
+ "https://json-schema.org/draft/2020-12/vocab/core": true,
6644
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true,
6645
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
6646
+ "https://json-schema.org/draft/2020-12/vocab/validation": true,
6647
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
6648
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
6649
+ "https://json-schema.org/draft/2020-12/vocab/content": true
6650
+ },
6651
+ $dynamicAnchor: "meta",
6652
+ title: "Core and Validation specifications meta-schema",
6653
+ allOf: [
6654
+ { $ref: "meta/core" },
6655
+ { $ref: "meta/applicator" },
6656
+ { $ref: "meta/unevaluated" },
6657
+ { $ref: "meta/validation" },
6658
+ { $ref: "meta/meta-data" },
6659
+ { $ref: "meta/format-annotation" },
6660
+ { $ref: "meta/content" }
6661
+ ],
6662
+ type: ["object", "boolean"],
6663
+ $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.",
6664
+ properties: {
6665
+ definitions: {
6666
+ $comment: '"definitions" has been replaced by "$defs".',
6667
+ type: "object",
6668
+ additionalProperties: { $dynamicRef: "#meta" },
6669
+ deprecated: true,
6670
+ default: {}
6671
+ },
6672
+ dependencies: {
6673
+ $comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',
6674
+ type: "object",
6675
+ additionalProperties: {
6676
+ anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }]
6677
+ },
6678
+ deprecated: true,
6679
+ default: {}
6680
+ },
6681
+ $recursiveAnchor: {
6682
+ $comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".',
6683
+ $ref: "meta/core#/$defs/anchorString",
6684
+ deprecated: true
6685
+ },
6686
+ $recursiveRef: {
6687
+ $comment: '"$recursiveRef" has been replaced by "$dynamicRef".',
6688
+ $ref: "meta/core#/$defs/uriReferenceString",
6689
+ deprecated: true
6690
+ }
6691
+ }
6692
+ };
6693
+ }
6694
+ });
6695
+
6696
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json
6697
+ var require_applicator2 = __commonJS({
6698
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json"(exports$1, module) {
6699
+ module.exports = {
6700
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6701
+ $id: "https://json-schema.org/draft/2020-12/meta/applicator",
6702
+ $vocabulary: {
6703
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true
6704
+ },
6705
+ $dynamicAnchor: "meta",
6706
+ title: "Applicator vocabulary meta-schema",
6707
+ type: ["object", "boolean"],
6708
+ properties: {
6709
+ prefixItems: { $ref: "#/$defs/schemaArray" },
6710
+ items: { $dynamicRef: "#meta" },
6711
+ contains: { $dynamicRef: "#meta" },
6712
+ additionalProperties: { $dynamicRef: "#meta" },
6713
+ properties: {
6714
+ type: "object",
6715
+ additionalProperties: { $dynamicRef: "#meta" },
6716
+ default: {}
6717
+ },
6718
+ patternProperties: {
6719
+ type: "object",
6720
+ additionalProperties: { $dynamicRef: "#meta" },
6721
+ propertyNames: { format: "regex" },
6722
+ default: {}
6723
+ },
6724
+ dependentSchemas: {
6725
+ type: "object",
6726
+ additionalProperties: { $dynamicRef: "#meta" },
6727
+ default: {}
6728
+ },
6729
+ propertyNames: { $dynamicRef: "#meta" },
6730
+ if: { $dynamicRef: "#meta" },
6731
+ then: { $dynamicRef: "#meta" },
6732
+ else: { $dynamicRef: "#meta" },
6733
+ allOf: { $ref: "#/$defs/schemaArray" },
6734
+ anyOf: { $ref: "#/$defs/schemaArray" },
6735
+ oneOf: { $ref: "#/$defs/schemaArray" },
6736
+ not: { $dynamicRef: "#meta" }
6737
+ },
6738
+ $defs: {
6739
+ schemaArray: {
6740
+ type: "array",
6741
+ minItems: 1,
6742
+ items: { $dynamicRef: "#meta" }
6743
+ }
6744
+ }
6745
+ };
6746
+ }
6747
+ });
6748
+
6749
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json
6750
+ var require_unevaluated2 = __commonJS({
6751
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json"(exports$1, module) {
6752
+ module.exports = {
6753
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6754
+ $id: "https://json-schema.org/draft/2020-12/meta/unevaluated",
6755
+ $vocabulary: {
6756
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
6757
+ },
6758
+ $dynamicAnchor: "meta",
6759
+ title: "Unevaluated applicator vocabulary meta-schema",
6760
+ type: ["object", "boolean"],
6761
+ properties: {
6762
+ unevaluatedItems: { $dynamicRef: "#meta" },
6763
+ unevaluatedProperties: { $dynamicRef: "#meta" }
6764
+ }
6765
+ };
6766
+ }
6767
+ });
6768
+
6769
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json
6770
+ var require_content = __commonJS({
6771
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json"(exports$1, module) {
6772
+ module.exports = {
6773
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6774
+ $id: "https://json-schema.org/draft/2020-12/meta/content",
6775
+ $vocabulary: {
6776
+ "https://json-schema.org/draft/2020-12/vocab/content": true
6777
+ },
6778
+ $dynamicAnchor: "meta",
6779
+ title: "Content vocabulary meta-schema",
6780
+ type: ["object", "boolean"],
6781
+ properties: {
6782
+ contentEncoding: { type: "string" },
6783
+ contentMediaType: { type: "string" },
6784
+ contentSchema: { $dynamicRef: "#meta" }
6785
+ }
6786
+ };
6787
+ }
6788
+ });
6789
+
6790
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json
6791
+ var require_core3 = __commonJS({
6792
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json"(exports$1, module) {
6793
+ module.exports = {
6794
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6795
+ $id: "https://json-schema.org/draft/2020-12/meta/core",
6796
+ $vocabulary: {
6797
+ "https://json-schema.org/draft/2020-12/vocab/core": true
6798
+ },
6799
+ $dynamicAnchor: "meta",
6800
+ title: "Core vocabulary meta-schema",
6801
+ type: ["object", "boolean"],
6802
+ properties: {
6803
+ $id: {
6804
+ $ref: "#/$defs/uriReferenceString",
6805
+ $comment: "Non-empty fragments not allowed.",
6806
+ pattern: "^[^#]*#?$"
6807
+ },
6808
+ $schema: { $ref: "#/$defs/uriString" },
6809
+ $ref: { $ref: "#/$defs/uriReferenceString" },
6810
+ $anchor: { $ref: "#/$defs/anchorString" },
6811
+ $dynamicRef: { $ref: "#/$defs/uriReferenceString" },
6812
+ $dynamicAnchor: { $ref: "#/$defs/anchorString" },
6813
+ $vocabulary: {
6814
+ type: "object",
6815
+ propertyNames: { $ref: "#/$defs/uriString" },
6816
+ additionalProperties: {
6817
+ type: "boolean"
6818
+ }
6819
+ },
6820
+ $comment: {
6821
+ type: "string"
6822
+ },
6823
+ $defs: {
6824
+ type: "object",
6825
+ additionalProperties: { $dynamicRef: "#meta" }
6826
+ }
6827
+ },
6828
+ $defs: {
6829
+ anchorString: {
6830
+ type: "string",
6831
+ pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
6832
+ },
6833
+ uriString: {
6834
+ type: "string",
6835
+ format: "uri"
6836
+ },
6837
+ uriReferenceString: {
6838
+ type: "string",
6839
+ format: "uri-reference"
6840
+ }
6841
+ }
6842
+ };
6843
+ }
6844
+ });
6845
+
6846
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json
6847
+ var require_format_annotation = __commonJS({
6848
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json"(exports$1, module) {
6849
+ module.exports = {
6850
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6851
+ $id: "https://json-schema.org/draft/2020-12/meta/format-annotation",
6852
+ $vocabulary: {
6853
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
6854
+ },
6855
+ $dynamicAnchor: "meta",
6856
+ title: "Format vocabulary meta-schema for annotation results",
6857
+ type: ["object", "boolean"],
6858
+ properties: {
6859
+ format: { type: "string" }
6860
+ }
6861
+ };
6862
+ }
6863
+ });
6864
+
6865
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json
6866
+ var require_meta_data = __commonJS({
6867
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json"(exports$1, module) {
6868
+ module.exports = {
6869
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6870
+ $id: "https://json-schema.org/draft/2020-12/meta/meta-data",
6871
+ $vocabulary: {
6872
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true
6873
+ },
6874
+ $dynamicAnchor: "meta",
6875
+ title: "Meta-data vocabulary meta-schema",
6876
+ type: ["object", "boolean"],
6877
+ properties: {
6878
+ title: {
6879
+ type: "string"
6880
+ },
6881
+ description: {
6882
+ type: "string"
6883
+ },
6884
+ default: true,
6885
+ deprecated: {
6886
+ type: "boolean",
6887
+ default: false
6888
+ },
6889
+ readOnly: {
6890
+ type: "boolean",
6891
+ default: false
6892
+ },
6893
+ writeOnly: {
6894
+ type: "boolean",
6895
+ default: false
6896
+ },
6897
+ examples: {
6898
+ type: "array",
6899
+ items: true
6900
+ }
6901
+ }
6902
+ };
6903
+ }
6904
+ });
6905
+
6906
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
6907
+ var require_validation2 = __commonJS({
6908
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json"(exports$1, module) {
6909
+ module.exports = {
6910
+ $schema: "https://json-schema.org/draft/2020-12/schema",
6911
+ $id: "https://json-schema.org/draft/2020-12/meta/validation",
6912
+ $vocabulary: {
6913
+ "https://json-schema.org/draft/2020-12/vocab/validation": true
6914
+ },
6915
+ $dynamicAnchor: "meta",
6916
+ title: "Validation vocabulary meta-schema",
6917
+ type: ["object", "boolean"],
6918
+ properties: {
6919
+ type: {
6920
+ anyOf: [
6921
+ { $ref: "#/$defs/simpleTypes" },
6922
+ {
6923
+ type: "array",
6924
+ items: { $ref: "#/$defs/simpleTypes" },
6925
+ minItems: 1,
6926
+ uniqueItems: true
6927
+ }
6928
+ ]
6929
+ },
6930
+ const: true,
6931
+ enum: {
6932
+ type: "array",
6933
+ items: true
6934
+ },
6935
+ multipleOf: {
6936
+ type: "number",
6937
+ exclusiveMinimum: 0
6938
+ },
6939
+ maximum: {
6940
+ type: "number"
6941
+ },
6942
+ exclusiveMaximum: {
6943
+ type: "number"
6944
+ },
6945
+ minimum: {
6946
+ type: "number"
6947
+ },
6948
+ exclusiveMinimum: {
6949
+ type: "number"
6950
+ },
6951
+ maxLength: { $ref: "#/$defs/nonNegativeInteger" },
6952
+ minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
6953
+ pattern: {
6954
+ type: "string",
6955
+ format: "regex"
6956
+ },
6957
+ maxItems: { $ref: "#/$defs/nonNegativeInteger" },
6958
+ minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
6959
+ uniqueItems: {
6960
+ type: "boolean",
6961
+ default: false
6962
+ },
6963
+ maxContains: { $ref: "#/$defs/nonNegativeInteger" },
6964
+ minContains: {
6965
+ $ref: "#/$defs/nonNegativeInteger",
6966
+ default: 1
6967
+ },
6968
+ maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
6969
+ minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
6970
+ required: { $ref: "#/$defs/stringArray" },
6971
+ dependentRequired: {
6972
+ type: "object",
6973
+ additionalProperties: {
6974
+ $ref: "#/$defs/stringArray"
6975
+ }
6976
+ }
6977
+ },
6978
+ $defs: {
6979
+ nonNegativeInteger: {
6980
+ type: "integer",
6981
+ minimum: 0
6982
+ },
6983
+ nonNegativeIntegerDefault0: {
6984
+ $ref: "#/$defs/nonNegativeInteger",
6985
+ default: 0
6986
+ },
6987
+ simpleTypes: {
6988
+ enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
6989
+ },
6990
+ stringArray: {
6991
+ type: "array",
6992
+ items: { type: "string" },
6993
+ uniqueItems: true,
6994
+ default: []
6995
+ }
6996
+ }
6997
+ };
6998
+ }
6999
+ });
7000
+
7001
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js
7002
+ var require_json_schema_2020_12 = __commonJS({
7003
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js"(exports$1) {
7004
+ Object.defineProperty(exports$1, "__esModule", { value: true });
7005
+ var metaSchema = require_schema();
7006
+ var applicator = require_applicator2();
7007
+ var unevaluated = require_unevaluated2();
7008
+ var content = require_content();
7009
+ var core = require_core3();
7010
+ var format = require_format_annotation();
7011
+ var metadata = require_meta_data();
7012
+ var validation = require_validation2();
7013
+ var META_SUPPORT_DATA = ["/properties"];
7014
+ function addMetaSchema2020($data) {
7015
+ [
7016
+ metaSchema,
7017
+ applicator,
7018
+ unevaluated,
7019
+ content,
7020
+ core,
7021
+ with$data(this, format),
7022
+ metadata,
7023
+ with$data(this, validation)
7024
+ ].forEach((sch) => this.addMetaSchema(sch, void 0, false));
7025
+ return this;
7026
+ function with$data(ajv, sch) {
7027
+ return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
7028
+ }
7029
+ }
7030
+ exports$1.default = addMetaSchema2020;
7031
+ }
7032
+ });
7033
+
7034
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/2020.js
7035
+ var require__ = __commonJS({
7036
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/2020.js"(exports$1, module) {
7037
+ Object.defineProperty(exports$1, "__esModule", { value: true });
7038
+ exports$1.MissingRefError = exports$1.ValidationError = exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = exports$1.Ajv2020 = void 0;
7039
+ var core_1 = require_core();
7040
+ var draft2020_1 = require_draft2020();
7041
+ var discriminator_1 = require_discriminator();
7042
+ var json_schema_2020_12_1 = require_json_schema_2020_12();
7043
+ var META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema";
7044
+ var Ajv20202 = class extends core_1.default {
7045
+ constructor(opts = {}) {
7046
+ super({
7047
+ ...opts,
7048
+ dynamicRef: true,
7049
+ next: true,
7050
+ unevaluated: true
7051
+ });
7052
+ }
7053
+ _addVocabularies() {
7054
+ super._addVocabularies();
7055
+ draft2020_1.default.forEach((v) => this.addVocabulary(v));
7056
+ if (this.opts.discriminator)
7057
+ this.addKeyword(discriminator_1.default);
7058
+ }
7059
+ _addDefaultMetaSchema() {
7060
+ super._addDefaultMetaSchema();
7061
+ const { $data, meta } = this.opts;
7062
+ if (!meta)
7063
+ return;
7064
+ json_schema_2020_12_1.default.call(this, $data);
7065
+ this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
7066
+ }
7067
+ defaultMeta() {
7068
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
7069
+ }
7070
+ };
7071
+ exports$1.Ajv2020 = Ajv20202;
7072
+ module.exports = exports$1 = Ajv20202;
7073
+ module.exports.Ajv2020 = Ajv20202;
7074
+ Object.defineProperty(exports$1, "__esModule", { value: true });
7075
+ exports$1.default = Ajv20202;
7076
+ var validate_1 = require_validate();
7077
+ Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
7078
+ return validate_1.KeywordCxt;
7079
+ } });
7080
+ var codegen_1 = require_codegen();
7081
+ Object.defineProperty(exports$1, "_", { enumerable: true, get: function() {
7082
+ return codegen_1._;
7083
+ } });
7084
+ Object.defineProperty(exports$1, "str", { enumerable: true, get: function() {
7085
+ return codegen_1.str;
7086
+ } });
7087
+ Object.defineProperty(exports$1, "stringify", { enumerable: true, get: function() {
7088
+ return codegen_1.stringify;
7089
+ } });
7090
+ Object.defineProperty(exports$1, "nil", { enumerable: true, get: function() {
7091
+ return codegen_1.nil;
7092
+ } });
7093
+ Object.defineProperty(exports$1, "Name", { enumerable: true, get: function() {
7094
+ return codegen_1.Name;
7095
+ } });
7096
+ Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
7097
+ return codegen_1.CodeGen;
7098
+ } });
7099
+ var validation_error_1 = require_validation_error();
7100
+ Object.defineProperty(exports$1, "ValidationError", { enumerable: true, get: function() {
7101
+ return validation_error_1.default;
7102
+ } });
7103
+ var ref_error_1 = require_ref_error();
7104
+ Object.defineProperty(exports$1, "MissingRefError", { enumerable: true, get: function() {
7105
+ return ref_error_1.default;
7106
+ } });
7107
+ }
7108
+ });
7109
+
6302
7110
  // src/standard-schema/adapters/json-schema.ts
6303
7111
  var import_ajv = __toESM(require_ajv(), 1);
7112
+ var import__ = __toESM(require__(), 1);
6304
7113
  var import_json_schema_traverse = __toESM(require_json_schema_traverse(), 1);
6305
7114
  var VENDOR = "json-schema";
6306
7115
  var JsonSchemaWrapper = class {
@@ -6418,11 +7227,11 @@ var JsonSchemaWrapper = class {
6418
7227
  */
6419
7228
  #getAjvValidator() {
6420
7229
  if (!this.#ajvValidateCache) {
6421
- this.#ajvInstance = new import_ajv.default({
7230
+ const is2020 = typeof this.#schema.$schema === "string" && this.#schema.$schema.includes("2020-12");
7231
+ const AjvClass = is2020 ? import__.default : import_ajv.default;
7232
+ this.#ajvInstance = new AjvClass({
6422
7233
  allErrors: true,
6423
- // Report all errors, not just the first one
6424
7234
  strict: false,
6425
- // Be lenient with schema keywords
6426
7235
  ...this.#options.ajvOptions
6427
7236
  });
6428
7237
  this.#ajvValidateCache = this.#ajvInstance.compile(this.#schema);
@@ -6449,5 +7258,5 @@ function toStandardSchema(schema, options) {
6449
7258
  }
6450
7259
 
6451
7260
  export { JsonSchemaWrapper, toStandardSchema };
6452
- //# sourceMappingURL=chunk-QDRBTCDV.js.map
6453
- //# sourceMappingURL=chunk-QDRBTCDV.js.map
7261
+ //# sourceMappingURL=chunk-KGSZKLQN.js.map
7262
+ //# sourceMappingURL=chunk-KGSZKLQN.js.map