@codewithagents/openapi-server 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -26,9 +26,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
 
29
- // ../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/util.js
29
+ // ../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/util.js
30
30
  var require_util = __commonJS({
31
- "../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/util.js"(exports2) {
31
+ "../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/util.js"(exports2) {
32
32
  "use strict";
33
33
  var util = require("util");
34
34
  exports2.format = util.format;
@@ -45,7 +45,7 @@ var require_util = __commonJS({
45
45
  }
46
46
  }
47
47
  function fixOasRelativeServers(schema, filePath) {
48
- if (schema.openapi && (filePath && (filePath.startsWith("http:") || filePath.startsWith("https:")))) {
48
+ if (schema.openapi && filePath && (filePath.startsWith("http:") || filePath.startsWith("https:"))) {
49
49
  if (schema.servers) {
50
50
  schema.servers.map((server) => fixServers(server, filePath));
51
51
  }
@@ -70,361 +70,6 @@ var require_util = __commonJS({
70
70
  }
71
71
  });
72
72
 
73
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/to-json.js
74
- var require_to_json = __commonJS({
75
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/to-json.js"(exports2) {
76
- "use strict";
77
- Object.defineProperty(exports2, "__esModule", { value: true });
78
- exports2.getDeepKeys = exports2.toJSON = void 0;
79
- var nonJsonTypes = ["function", "symbol", "undefined"];
80
- var protectedProps = ["constructor", "prototype", "__proto__"];
81
- var objectPrototype = Object.getPrototypeOf({});
82
- function toJSON() {
83
- let pojo = {};
84
- let error = this;
85
- for (let key of getDeepKeys(error)) {
86
- if (typeof key === "string") {
87
- let value = error[key];
88
- let type = typeof value;
89
- if (!nonJsonTypes.includes(type)) {
90
- pojo[key] = value;
91
- }
92
- }
93
- }
94
- return pojo;
95
- }
96
- exports2.toJSON = toJSON;
97
- function getDeepKeys(obj, omit = []) {
98
- let keys = [];
99
- while (obj && obj !== objectPrototype) {
100
- keys = keys.concat(Object.getOwnPropertyNames(obj), Object.getOwnPropertySymbols(obj));
101
- obj = Object.getPrototypeOf(obj);
102
- }
103
- let uniqueKeys = new Set(keys);
104
- for (let key of omit.concat(protectedProps)) {
105
- uniqueKeys.delete(key);
106
- }
107
- return uniqueKeys;
108
- }
109
- exports2.getDeepKeys = getDeepKeys;
110
- }
111
- });
112
-
113
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/isomorphic.node.js
114
- var require_isomorphic_node = __commonJS({
115
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/isomorphic.node.js"(exports2) {
116
- "use strict";
117
- Object.defineProperty(exports2, "__esModule", { value: true });
118
- exports2.addInspectMethod = exports2.format = void 0;
119
- var util = require("util");
120
- var to_json_1 = require_to_json();
121
- var inspectMethod = util.inspect.custom || Symbol.for("nodejs.util.inspect.custom");
122
- exports2.format = util.format;
123
- function addInspectMethod(newError) {
124
- newError[inspectMethod] = inspect;
125
- }
126
- exports2.addInspectMethod = addInspectMethod;
127
- function inspect() {
128
- let pojo = {};
129
- let error = this;
130
- for (let key of to_json_1.getDeepKeys(error)) {
131
- let value = error[key];
132
- pojo[key] = value;
133
- }
134
- delete pojo[inspectMethod];
135
- return pojo;
136
- }
137
- }
138
- });
139
-
140
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/stack.js
141
- var require_stack = __commonJS({
142
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/stack.js"(exports2) {
143
- "use strict";
144
- Object.defineProperty(exports2, "__esModule", { value: true });
145
- exports2.lazyJoinStacks = exports2.joinStacks = exports2.isWritableStack = exports2.isLazyStack = void 0;
146
- var newline = /\r?\n/;
147
- var onoCall = /\bono[ @]/;
148
- function isLazyStack(stackProp) {
149
- return Boolean(stackProp && stackProp.configurable && typeof stackProp.get === "function");
150
- }
151
- exports2.isLazyStack = isLazyStack;
152
- function isWritableStack(stackProp) {
153
- return Boolean(
154
- // If there is no stack property, then it's writable, since assigning it will create it
155
- !stackProp || stackProp.writable || typeof stackProp.set === "function"
156
- );
157
- }
158
- exports2.isWritableStack = isWritableStack;
159
- function joinStacks(newError, originalError) {
160
- let newStack = popStack(newError.stack);
161
- let originalStack = originalError ? originalError.stack : void 0;
162
- if (newStack && originalStack) {
163
- return newStack + "\n\n" + originalStack;
164
- } else {
165
- return newStack || originalStack;
166
- }
167
- }
168
- exports2.joinStacks = joinStacks;
169
- function lazyJoinStacks(lazyStack, newError, originalError) {
170
- if (originalError) {
171
- Object.defineProperty(newError, "stack", {
172
- get: () => {
173
- let newStack = lazyStack.get.apply(newError);
174
- return joinStacks({ stack: newStack }, originalError);
175
- },
176
- enumerable: false,
177
- configurable: true
178
- });
179
- } else {
180
- lazyPopStack(newError, lazyStack);
181
- }
182
- }
183
- exports2.lazyJoinStacks = lazyJoinStacks;
184
- function popStack(stack) {
185
- if (stack) {
186
- let lines = stack.split(newline);
187
- let onoStart;
188
- for (let i = 0; i < lines.length; i++) {
189
- let line = lines[i];
190
- if (onoCall.test(line)) {
191
- if (onoStart === void 0) {
192
- onoStart = i;
193
- }
194
- } else if (onoStart !== void 0) {
195
- lines.splice(onoStart, i - onoStart);
196
- break;
197
- }
198
- }
199
- if (lines.length > 0) {
200
- return lines.join("\n");
201
- }
202
- }
203
- return stack;
204
- }
205
- function lazyPopStack(error, lazyStack) {
206
- Object.defineProperty(error, "stack", {
207
- get: () => popStack(lazyStack.get.apply(error)),
208
- enumerable: false,
209
- configurable: true
210
- });
211
- }
212
- }
213
- });
214
-
215
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/extend-error.js
216
- var require_extend_error = __commonJS({
217
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/extend-error.js"(exports2) {
218
- "use strict";
219
- Object.defineProperty(exports2, "__esModule", { value: true });
220
- exports2.extendError = void 0;
221
- var isomorphic_node_1 = require_isomorphic_node();
222
- var stack_1 = require_stack();
223
- var to_json_1 = require_to_json();
224
- var protectedProps = ["name", "message", "stack"];
225
- function extendError(error, originalError, props) {
226
- let onoError = error;
227
- extendStack(onoError, originalError);
228
- if (originalError && typeof originalError === "object") {
229
- mergeErrors(onoError, originalError);
230
- }
231
- onoError.toJSON = to_json_1.toJSON;
232
- if (isomorphic_node_1.addInspectMethod) {
233
- isomorphic_node_1.addInspectMethod(onoError);
234
- }
235
- if (props && typeof props === "object") {
236
- Object.assign(onoError, props);
237
- }
238
- return onoError;
239
- }
240
- exports2.extendError = extendError;
241
- function extendStack(newError, originalError) {
242
- let stackProp = Object.getOwnPropertyDescriptor(newError, "stack");
243
- if (stack_1.isLazyStack(stackProp)) {
244
- stack_1.lazyJoinStacks(stackProp, newError, originalError);
245
- } else if (stack_1.isWritableStack(stackProp)) {
246
- newError.stack = stack_1.joinStacks(newError, originalError);
247
- }
248
- }
249
- function mergeErrors(newError, originalError) {
250
- let keys = to_json_1.getDeepKeys(originalError, protectedProps);
251
- let _newError = newError;
252
- let _originalError = originalError;
253
- for (let key of keys) {
254
- if (_newError[key] === void 0) {
255
- try {
256
- _newError[key] = _originalError[key];
257
- } catch (e) {
258
- }
259
- }
260
- }
261
- }
262
- }
263
- });
264
-
265
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/normalize.js
266
- var require_normalize = __commonJS({
267
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/normalize.js"(exports2) {
268
- "use strict";
269
- Object.defineProperty(exports2, "__esModule", { value: true });
270
- exports2.normalizeArgs = exports2.normalizeOptions = void 0;
271
- var isomorphic_node_1 = require_isomorphic_node();
272
- function normalizeOptions(options) {
273
- options = options || {};
274
- return {
275
- concatMessages: options.concatMessages === void 0 ? true : Boolean(options.concatMessages),
276
- format: options.format === void 0 ? isomorphic_node_1.format : typeof options.format === "function" ? options.format : false
277
- };
278
- }
279
- exports2.normalizeOptions = normalizeOptions;
280
- function normalizeArgs(args, options) {
281
- let originalError;
282
- let props;
283
- let formatArgs;
284
- let message = "";
285
- if (typeof args[0] === "string") {
286
- formatArgs = args;
287
- } else if (typeof args[1] === "string") {
288
- if (args[0] instanceof Error) {
289
- originalError = args[0];
290
- } else {
291
- props = args[0];
292
- }
293
- formatArgs = args.slice(1);
294
- } else {
295
- originalError = args[0];
296
- props = args[1];
297
- formatArgs = args.slice(2);
298
- }
299
- if (formatArgs.length > 0) {
300
- if (options.format) {
301
- message = options.format.apply(void 0, formatArgs);
302
- } else {
303
- message = formatArgs.join(" ");
304
- }
305
- }
306
- if (options.concatMessages && originalError && originalError.message) {
307
- message += (message ? " \n" : "") + originalError.message;
308
- }
309
- return { originalError, props, message };
310
- }
311
- exports2.normalizeArgs = normalizeArgs;
312
- }
313
- });
314
-
315
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/constructor.js
316
- var require_constructor = __commonJS({
317
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/constructor.js"(exports2) {
318
- "use strict";
319
- Object.defineProperty(exports2, "__esModule", { value: true });
320
- exports2.Ono = void 0;
321
- var extend_error_1 = require_extend_error();
322
- var normalize_1 = require_normalize();
323
- var to_json_1 = require_to_json();
324
- var constructor = Ono;
325
- exports2.Ono = constructor;
326
- function Ono(ErrorConstructor, options) {
327
- options = normalize_1.normalizeOptions(options);
328
- function ono(...args) {
329
- let { originalError, props, message } = normalize_1.normalizeArgs(args, options);
330
- let newError = new ErrorConstructor(message);
331
- return extend_error_1.extendError(newError, originalError, props);
332
- }
333
- ono[Symbol.species] = ErrorConstructor;
334
- return ono;
335
- }
336
- Ono.toJSON = function toJSON(error) {
337
- return to_json_1.toJSON.call(error);
338
- };
339
- Ono.extend = function extend(error, originalError, props) {
340
- if (props || originalError instanceof Error) {
341
- return extend_error_1.extendError(error, originalError, props);
342
- } else if (originalError) {
343
- return extend_error_1.extendError(error, void 0, originalError);
344
- } else {
345
- return extend_error_1.extendError(error);
346
- }
347
- };
348
- }
349
- });
350
-
351
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/singleton.js
352
- var require_singleton = __commonJS({
353
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/singleton.js"(exports2) {
354
- "use strict";
355
- Object.defineProperty(exports2, "__esModule", { value: true });
356
- exports2.ono = void 0;
357
- var constructor_1 = require_constructor();
358
- var singleton = ono;
359
- exports2.ono = singleton;
360
- ono.error = new constructor_1.Ono(Error);
361
- ono.eval = new constructor_1.Ono(EvalError);
362
- ono.range = new constructor_1.Ono(RangeError);
363
- ono.reference = new constructor_1.Ono(ReferenceError);
364
- ono.syntax = new constructor_1.Ono(SyntaxError);
365
- ono.type = new constructor_1.Ono(TypeError);
366
- ono.uri = new constructor_1.Ono(URIError);
367
- var onoMap = ono;
368
- function ono(...args) {
369
- let originalError = args[0];
370
- if (typeof originalError === "object" && typeof originalError.name === "string") {
371
- for (let typedOno of Object.values(onoMap)) {
372
- if (typeof typedOno === "function" && typedOno.name === "ono") {
373
- let species = typedOno[Symbol.species];
374
- if (species && species !== Error && (originalError instanceof species || originalError.name === species.name)) {
375
- return typedOno.apply(void 0, args);
376
- }
377
- }
378
- }
379
- }
380
- return ono.error.apply(void 0, args);
381
- }
382
- }
383
- });
384
-
385
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/types.js
386
- var require_types = __commonJS({
387
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/types.js"(exports2) {
388
- "use strict";
389
- Object.defineProperty(exports2, "__esModule", { value: true });
390
- var util_1 = require("util");
391
- }
392
- });
393
-
394
- // ../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/index.js
395
- var require_cjs = __commonJS({
396
- "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/cjs/index.js"(exports2, module2) {
397
- "use strict";
398
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
399
- if (k2 === void 0) k2 = k;
400
- Object.defineProperty(o, k2, { enumerable: true, get: function() {
401
- return m[k];
402
- } });
403
- }) : (function(o, m, k, k2) {
404
- if (k2 === void 0) k2 = k;
405
- o[k2] = m[k];
406
- }));
407
- var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
408
- for (var p in m) if (p !== "default" && !exports3.hasOwnProperty(p)) __createBinding(exports3, m, p);
409
- };
410
- Object.defineProperty(exports2, "__esModule", { value: true });
411
- exports2.ono = void 0;
412
- var singleton_1 = require_singleton();
413
- Object.defineProperty(exports2, "ono", { enumerable: true, get: function() {
414
- return singleton_1.ono;
415
- } });
416
- var constructor_1 = require_constructor();
417
- Object.defineProperty(exports2, "Ono", { enumerable: true, get: function() {
418
- return constructor_1.Ono;
419
- } });
420
- __exportStar(require_types(), exports2);
421
- exports2.default = singleton_1.ono;
422
- if (typeof module2 === "object" && typeof module2.exports === "object") {
423
- module2.exports = Object.assign(module2.exports.default, module2.exports);
424
- }
425
- }
426
- });
427
-
428
73
  // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
429
74
  var require_code = __commonJS({
430
75
  "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js"(exports2) {
@@ -4926,6 +4571,21 @@ var require_core = __commonJS({
4926
4571
  }
4927
4572
  });
4928
4573
 
4574
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js
4575
+ var require_id = __commonJS({
4576
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) {
4577
+ "use strict";
4578
+ Object.defineProperty(exports2, "__esModule", { value: true });
4579
+ var def = {
4580
+ keyword: "id",
4581
+ code() {
4582
+ throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
4583
+ }
4584
+ };
4585
+ exports2.default = def;
4586
+ }
4587
+ });
4588
+
4929
4589
  // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js
4930
4590
  var require_ref = __commonJS({
4931
4591
  "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js"(exports2) {
@@ -5048,51 +4708,43 @@ var require_ref = __commonJS({
5048
4708
  }
5049
4709
  });
5050
4710
 
5051
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/core.js
4711
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js
5052
4712
  var require_core2 = __commonJS({
5053
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/core.js"(exports2) {
4713
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) {
5054
4714
  "use strict";
5055
4715
  Object.defineProperty(exports2, "__esModule", { value: true });
4716
+ var id_1 = require_id();
5056
4717
  var ref_1 = require_ref();
5057
4718
  var core = [
5058
4719
  "$schema",
5059
- "id",
4720
+ "$id",
5060
4721
  "$defs",
4722
+ "$vocabulary",
5061
4723
  { keyword: "$comment" },
5062
4724
  "definitions",
4725
+ id_1.default,
5063
4726
  ref_1.default
5064
4727
  ];
5065
4728
  exports2.default = core;
5066
4729
  }
5067
4730
  });
5068
4731
 
5069
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js
4732
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
5070
4733
  var require_limitNumber = __commonJS({
5071
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js"(exports2) {
4734
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) {
5072
4735
  "use strict";
5073
4736
  Object.defineProperty(exports2, "__esModule", { value: true });
5074
- var core_1 = require_core();
5075
4737
  var codegen_1 = require_codegen();
5076
4738
  var ops = codegen_1.operators;
5077
4739
  var KWDs = {
5078
- maximum: {
5079
- exclusive: "exclusiveMaximum",
5080
- ops: [
5081
- { okStr: "<=", ok: ops.LTE, fail: ops.GT },
5082
- { okStr: "<", ok: ops.LT, fail: ops.GTE }
5083
- ]
5084
- },
5085
- minimum: {
5086
- exclusive: "exclusiveMinimum",
5087
- ops: [
5088
- { okStr: ">=", ok: ops.GTE, fail: ops.LT },
5089
- { okStr: ">", ok: ops.GT, fail: ops.LTE }
5090
- ]
5091
- }
4740
+ maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
4741
+ minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
4742
+ exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
4743
+ exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
5092
4744
  };
5093
4745
  var error = {
5094
- message: (cxt) => core_1.str`must be ${kwdOp(cxt).okStr} ${cxt.schemaCode}`,
5095
- params: (cxt) => core_1._`{comparison: ${kwdOp(cxt).okStr}, limit: ${cxt.schemaCode}}`
4746
+ message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
4747
+ params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
5096
4748
  };
5097
4749
  var def = {
5098
4750
  keyword: Object.keys(KWDs),
@@ -5101,38 +4753,8 @@ var require_limitNumber = __commonJS({
5101
4753
  $data: true,
5102
4754
  error,
5103
4755
  code(cxt) {
5104
- const { data, schemaCode } = cxt;
5105
- cxt.fail$data(core_1._`${data} ${kwdOp(cxt).fail} ${schemaCode} || isNaN(${data})`);
5106
- }
5107
- };
5108
- function kwdOp(cxt) {
5109
- var _a;
5110
- const keyword = cxt.keyword;
5111
- const opsIdx = ((_a = cxt.parentSchema) === null || _a === void 0 ? void 0 : _a[KWDs[keyword].exclusive]) ? 1 : 0;
5112
- return KWDs[keyword].ops[opsIdx];
5113
- }
5114
- exports2.default = def;
5115
- }
5116
- });
5117
-
5118
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js
5119
- var require_limitNumberExclusive = __commonJS({
5120
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js"(exports2) {
5121
- "use strict";
5122
- Object.defineProperty(exports2, "__esModule", { value: true });
5123
- var KWDs = {
5124
- exclusiveMaximum: "maximum",
5125
- exclusiveMinimum: "minimum"
5126
- };
5127
- var def = {
5128
- keyword: Object.keys(KWDs),
5129
- type: "number",
5130
- schemaType: "boolean",
5131
- code({ keyword, parentSchema }) {
5132
- const limitKwd = KWDs[keyword];
5133
- if (parentSchema[limitKwd] === void 0) {
5134
- throw new Error(`${keyword} can only be used with ${limitKwd}`);
5135
- }
4756
+ const { keyword, data, schemaCode } = cxt;
4757
+ cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
5136
4758
  }
5137
4759
  };
5138
4760
  exports2.default = def;
@@ -5558,13 +5180,12 @@ var require_enum = __commonJS({
5558
5180
  }
5559
5181
  });
5560
5182
 
5561
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/index.js
5183
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js
5562
5184
  var require_validation = __commonJS({
5563
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/index.js"(exports2) {
5185
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) {
5564
5186
  "use strict";
5565
5187
  Object.defineProperty(exports2, "__esModule", { value: true });
5566
5188
  var limitNumber_1 = require_limitNumber();
5567
- var limitNumberExclusive_1 = require_limitNumberExclusive();
5568
5189
  var multipleOf_1 = require_multipleOf();
5569
5190
  var limitLength_1 = require_limitLength();
5570
5191
  var pattern_1 = require_pattern();
@@ -5577,7 +5198,6 @@ var require_validation = __commonJS({
5577
5198
  var validation = [
5578
5199
  // number
5579
5200
  limitNumber_1.default,
5580
- limitNumberExclusive_1.default,
5581
5201
  multipleOf_1.default,
5582
5202
  // string
5583
5203
  limitLength_1.default,
@@ -6497,240 +6117,183 @@ var require_applicator = __commonJS({
6497
6117
  }
6498
6118
  });
6499
6119
 
6500
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js
6501
- var require_format = __commonJS({
6502
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) {
6120
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js
6121
+ var require_dynamicAnchor = __commonJS({
6122
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports2) {
6503
6123
  "use strict";
6504
6124
  Object.defineProperty(exports2, "__esModule", { value: true });
6125
+ exports2.dynamicAnchor = void 0;
6505
6126
  var codegen_1 = require_codegen();
6506
- var error = {
6507
- message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
6508
- params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
6509
- };
6127
+ var names_1 = require_names();
6128
+ var compile_1 = require_compile();
6129
+ var ref_1 = require_ref();
6510
6130
  var def = {
6511
- keyword: "format",
6512
- type: ["number", "string"],
6131
+ keyword: "$dynamicAnchor",
6513
6132
  schemaType: "string",
6514
- $data: true,
6515
- error,
6516
- code(cxt, ruleType) {
6517
- const { gen, data, $data, schema, schemaCode, it } = cxt;
6518
- const { opts, errSchemaPath, schemaEnv, self } = it;
6519
- if (!opts.validateFormats)
6520
- return;
6521
- if ($data)
6522
- validate$DataFormat();
6523
- else
6524
- validateFormat();
6525
- function validate$DataFormat() {
6526
- const fmts = gen.scopeValue("formats", {
6527
- ref: self.formats,
6528
- code: opts.code.formats
6529
- });
6530
- const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
6531
- const fType = gen.let("fType");
6532
- const format = gen.let("format");
6533
- 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));
6534
- cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
6535
- function unknownFmt() {
6536
- if (opts.strictSchema === false)
6537
- return codegen_1.nil;
6538
- return (0, codegen_1._)`${schemaCode} && !${format}`;
6539
- }
6540
- function invalidFmt() {
6541
- const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
6542
- const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
6543
- return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
6544
- }
6545
- }
6546
- function validateFormat() {
6547
- const formatDef = self.formats[schema];
6548
- if (!formatDef) {
6549
- unknownFormat();
6550
- return;
6551
- }
6552
- if (formatDef === true)
6553
- return;
6554
- const [fmtType, format, fmtRef] = getFormat(formatDef);
6555
- if (fmtType === ruleType)
6556
- cxt.pass(validCondition());
6557
- function unknownFormat() {
6558
- if (opts.strictSchema === false) {
6559
- self.logger.warn(unknownMsg());
6560
- return;
6561
- }
6562
- throw new Error(unknownMsg());
6563
- function unknownMsg() {
6564
- return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
6565
- }
6566
- }
6567
- function getFormat(fmtDef) {
6568
- 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;
6569
- const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
6570
- if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
6571
- return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
6572
- }
6573
- return ["string", fmtDef, fmt];
6574
- }
6575
- function validCondition() {
6576
- if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
6577
- if (!schemaEnv.$async)
6578
- throw new Error("async format in sync schema");
6579
- return (0, codegen_1._)`await ${fmtRef}(${data})`;
6580
- }
6581
- return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
6582
- }
6133
+ code: (cxt) => dynamicAnchor(cxt, cxt.schema)
6134
+ };
6135
+ function dynamicAnchor(cxt, anchor) {
6136
+ const { gen, it } = cxt;
6137
+ it.schemaEnv.root.dynamicAnchors[anchor] = true;
6138
+ const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
6139
+ const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
6140
+ gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
6141
+ }
6142
+ exports2.dynamicAnchor = dynamicAnchor;
6143
+ function _getValidate(cxt) {
6144
+ const { schemaEnv, schema, self } = cxt.it;
6145
+ const { root, baseId, localRefs, meta } = schemaEnv.root;
6146
+ const { schemaId } = self.opts;
6147
+ const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
6148
+ compile_1.compileSchema.call(self, sch);
6149
+ return (0, ref_1.getValidate)(cxt, sch);
6150
+ }
6151
+ exports2.default = def;
6152
+ }
6153
+ });
6154
+
6155
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
6156
+ var require_dynamicRef = __commonJS({
6157
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports2) {
6158
+ "use strict";
6159
+ Object.defineProperty(exports2, "__esModule", { value: true });
6160
+ exports2.dynamicRef = void 0;
6161
+ var codegen_1 = require_codegen();
6162
+ var names_1 = require_names();
6163
+ var ref_1 = require_ref();
6164
+ var def = {
6165
+ keyword: "$dynamicRef",
6166
+ schemaType: "string",
6167
+ code: (cxt) => dynamicRef(cxt, cxt.schema)
6168
+ };
6169
+ function dynamicRef(cxt, ref) {
6170
+ const { gen, keyword, it } = cxt;
6171
+ if (ref[0] !== "#")
6172
+ throw new Error(`"${keyword}" only supports hash fragment reference`);
6173
+ const anchor = ref.slice(1);
6174
+ if (it.allErrors) {
6175
+ _dynamicRef();
6176
+ } else {
6177
+ const valid = gen.let("valid", false);
6178
+ _dynamicRef(valid);
6179
+ cxt.ok(valid);
6180
+ }
6181
+ function _dynamicRef(valid) {
6182
+ if (it.schemaEnv.root.dynamicAnchors[anchor]) {
6183
+ const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
6184
+ gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
6185
+ } else {
6186
+ _callRef(it.validateName, valid)();
6583
6187
  }
6584
6188
  }
6585
- };
6189
+ function _callRef(validate, valid) {
6190
+ return valid ? () => gen.block(() => {
6191
+ (0, ref_1.callRef)(cxt, validate);
6192
+ gen.let(valid, true);
6193
+ }) : () => (0, ref_1.callRef)(cxt, validate);
6194
+ }
6195
+ }
6196
+ exports2.dynamicRef = dynamicRef;
6586
6197
  exports2.default = def;
6587
6198
  }
6588
6199
  });
6589
6200
 
6590
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js
6591
- var require_format2 = __commonJS({
6592
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) {
6201
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js
6202
+ var require_recursiveAnchor = __commonJS({
6203
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports2) {
6593
6204
  "use strict";
6594
6205
  Object.defineProperty(exports2, "__esModule", { value: true });
6595
- var format_1 = require_format();
6596
- var format = [format_1.default];
6597
- exports2.default = format;
6206
+ var dynamicAnchor_1 = require_dynamicAnchor();
6207
+ var util_1 = require_util2();
6208
+ var def = {
6209
+ keyword: "$recursiveAnchor",
6210
+ schemaType: "boolean",
6211
+ code(cxt) {
6212
+ if (cxt.schema)
6213
+ (0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
6214
+ else
6215
+ (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
6216
+ }
6217
+ };
6218
+ exports2.default = def;
6598
6219
  }
6599
6220
  });
6600
6221
 
6601
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/draft4.js
6602
- var require_draft4 = __commonJS({
6603
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/draft4.js"(exports2) {
6222
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
6223
+ var require_recursiveRef = __commonJS({
6224
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports2) {
6604
6225
  "use strict";
6605
6226
  Object.defineProperty(exports2, "__esModule", { value: true });
6606
- var core_1 = require_core2();
6607
- var validation_1 = require_validation();
6608
- var applicator_1 = require_applicator();
6609
- var format_1 = require_format2();
6610
- var metadataVocabulary = ["title", "description", "default"];
6611
- var draft4Vocabularies = [
6612
- core_1.default,
6613
- validation_1.default,
6614
- applicator_1.default(),
6615
- format_1.default,
6616
- metadataVocabulary
6617
- ];
6618
- exports2.default = draft4Vocabularies;
6227
+ var dynamicRef_1 = require_dynamicRef();
6228
+ var def = {
6229
+ keyword: "$recursiveRef",
6230
+ schemaType: "string",
6231
+ code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
6232
+ };
6233
+ exports2.default = def;
6619
6234
  }
6620
6235
  });
6621
6236
 
6622
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js
6623
- var require_types2 = __commonJS({
6624
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) {
6237
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js
6238
+ var require_dynamic = __commonJS({
6239
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports2) {
6625
6240
  "use strict";
6626
6241
  Object.defineProperty(exports2, "__esModule", { value: true });
6627
- exports2.DiscrError = void 0;
6628
- var DiscrError;
6629
- (function(DiscrError2) {
6630
- DiscrError2["Tag"] = "tag";
6631
- DiscrError2["Mapping"] = "mapping";
6632
- })(DiscrError || (exports2.DiscrError = DiscrError = {}));
6242
+ var dynamicAnchor_1 = require_dynamicAnchor();
6243
+ var dynamicRef_1 = require_dynamicRef();
6244
+ var recursiveAnchor_1 = require_recursiveAnchor();
6245
+ var recursiveRef_1 = require_recursiveRef();
6246
+ var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
6247
+ exports2.default = dynamic;
6633
6248
  }
6634
6249
  });
6635
6250
 
6636
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js
6637
- var require_discriminator = __commonJS({
6638
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) {
6251
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
6252
+ var require_dependentRequired = __commonJS({
6253
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports2) {
6639
6254
  "use strict";
6640
6255
  Object.defineProperty(exports2, "__esModule", { value: true });
6641
- var codegen_1 = require_codegen();
6642
- var types_1 = require_types2();
6643
- var compile_1 = require_compile();
6644
- var ref_error_1 = require_ref_error();
6645
- var util_1 = require_util2();
6646
- var error = {
6647
- message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
6648
- params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
6256
+ var dependencies_1 = require_dependencies();
6257
+ var def = {
6258
+ keyword: "dependentRequired",
6259
+ type: "object",
6260
+ schemaType: "object",
6261
+ error: dependencies_1.error,
6262
+ code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
6649
6263
  };
6264
+ exports2.default = def;
6265
+ }
6266
+ });
6267
+
6268
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
6269
+ var require_dependentSchemas = __commonJS({
6270
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports2) {
6271
+ "use strict";
6272
+ Object.defineProperty(exports2, "__esModule", { value: true });
6273
+ var dependencies_1 = require_dependencies();
6650
6274
  var def = {
6651
- keyword: "discriminator",
6275
+ keyword: "dependentSchemas",
6652
6276
  type: "object",
6653
6277
  schemaType: "object",
6654
- error,
6655
- code(cxt) {
6656
- const { gen, data, schema, parentSchema, it } = cxt;
6657
- const { oneOf } = parentSchema;
6658
- if (!it.opts.discriminator) {
6659
- throw new Error("discriminator: requires discriminator option");
6660
- }
6661
- const tagName = schema.propertyName;
6662
- if (typeof tagName != "string")
6663
- throw new Error("discriminator: requires propertyName");
6664
- if (schema.mapping)
6665
- throw new Error("discriminator: mapping is not supported");
6666
- if (!oneOf)
6667
- throw new Error("discriminator: requires oneOf keyword");
6668
- const valid = gen.let("valid", false);
6669
- const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
6670
- gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
6671
- cxt.ok(valid);
6672
- function validateMapping() {
6673
- const mapping = getMapping();
6674
- gen.if(false);
6675
- for (const tagValue in mapping) {
6676
- gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
6677
- gen.assign(valid, applyTagSchema(mapping[tagValue]));
6678
- }
6679
- gen.else();
6680
- cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
6681
- gen.endIf();
6682
- }
6683
- function applyTagSchema(schemaProp) {
6684
- const _valid = gen.name("valid");
6685
- const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
6686
- cxt.mergeEvaluated(schCxt, codegen_1.Name);
6687
- return _valid;
6688
- }
6689
- function getMapping() {
6690
- var _a;
6691
- const oneOfMapping = {};
6692
- const topRequired = hasRequired(parentSchema);
6693
- let tagRequired = true;
6694
- for (let i = 0; i < oneOf.length; i++) {
6695
- let sch = oneOf[i];
6696
- if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
6697
- const ref = sch.$ref;
6698
- sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
6699
- if (sch instanceof compile_1.SchemaEnv)
6700
- sch = sch.schema;
6701
- if (sch === void 0)
6702
- throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
6703
- }
6704
- const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
6705
- if (typeof propSch != "object") {
6706
- throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
6707
- }
6708
- tagRequired = tagRequired && (topRequired || hasRequired(sch));
6709
- addMappings(propSch, i);
6710
- }
6711
- if (!tagRequired)
6712
- throw new Error(`discriminator: "${tagName}" must be required`);
6713
- return oneOfMapping;
6714
- function hasRequired({ required }) {
6715
- return Array.isArray(required) && required.includes(tagName);
6716
- }
6717
- function addMappings(sch, i) {
6718
- if (sch.const) {
6719
- addMapping(sch.const, i);
6720
- } else if (sch.enum) {
6721
- for (const tagValue of sch.enum) {
6722
- addMapping(tagValue, i);
6723
- }
6724
- } else {
6725
- throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
6726
- }
6727
- }
6728
- function addMapping(tagValue, i) {
6729
- if (typeof tagValue != "string" || tagValue in oneOfMapping) {
6730
- throw new Error(`discriminator: "${tagName}" values must be unique strings`);
6731
- }
6732
- oneOfMapping[tagValue] = i;
6733
- }
6278
+ code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)
6279
+ };
6280
+ exports2.default = def;
6281
+ }
6282
+ });
6283
+
6284
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js
6285
+ var require_limitContains = __commonJS({
6286
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports2) {
6287
+ "use strict";
6288
+ Object.defineProperty(exports2, "__esModule", { value: true });
6289
+ var util_1 = require_util2();
6290
+ var def = {
6291
+ keyword: ["maxContains", "minContains"],
6292
+ type: "array",
6293
+ schemaType: "number",
6294
+ code({ keyword, parentSchema, it }) {
6295
+ if (parentSchema.contains === void 0) {
6296
+ (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
6734
6297
  }
6735
6298
  }
6736
6299
  };
@@ -6738,692 +6301,412 @@ var require_discriminator = __commonJS({
6738
6301
  }
6739
6302
  });
6740
6303
 
6741
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json
6742
- var require_json_schema_draft_04 = __commonJS({
6743
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json"(exports2, module2) {
6744
- module2.exports = {
6745
- id: "http://json-schema.org/draft-04/schema#",
6746
- $schema: "http://json-schema.org/draft-04/schema#",
6747
- description: "Core schema meta-schema",
6748
- definitions: {
6749
- schemaArray: {
6750
- type: "array",
6751
- minItems: 1,
6752
- items: { $ref: "#" }
6753
- },
6754
- positiveInteger: {
6755
- type: "integer",
6756
- minimum: 0
6757
- },
6758
- positiveIntegerDefault0: {
6759
- allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]
6760
- },
6761
- simpleTypes: {
6762
- enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
6763
- },
6764
- stringArray: {
6765
- type: "array",
6766
- items: { type: "string" },
6767
- minItems: 1,
6768
- uniqueItems: true
6769
- }
6770
- },
6771
- type: "object",
6772
- properties: {
6773
- id: {
6774
- type: "string",
6775
- format: "uri"
6776
- },
6777
- $schema: {
6778
- type: "string",
6779
- format: "uri"
6780
- },
6781
- title: {
6782
- type: "string"
6783
- },
6784
- description: {
6785
- type: "string"
6786
- },
6787
- default: {},
6788
- multipleOf: {
6789
- type: "number",
6790
- minimum: 0,
6791
- exclusiveMinimum: true
6792
- },
6793
- maximum: {
6794
- type: "number"
6795
- },
6796
- exclusiveMaximum: {
6797
- type: "boolean",
6798
- default: false
6799
- },
6800
- minimum: {
6801
- type: "number"
6802
- },
6803
- exclusiveMinimum: {
6804
- type: "boolean",
6805
- default: false
6806
- },
6807
- maxLength: { $ref: "#/definitions/positiveInteger" },
6808
- minLength: { $ref: "#/definitions/positiveIntegerDefault0" },
6809
- pattern: {
6810
- type: "string",
6811
- format: "regex"
6812
- },
6813
- additionalItems: {
6814
- anyOf: [{ type: "boolean" }, { $ref: "#" }],
6815
- default: {}
6816
- },
6817
- items: {
6818
- anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
6819
- default: {}
6820
- },
6821
- maxItems: { $ref: "#/definitions/positiveInteger" },
6822
- minItems: { $ref: "#/definitions/positiveIntegerDefault0" },
6823
- uniqueItems: {
6824
- type: "boolean",
6825
- default: false
6826
- },
6827
- maxProperties: { $ref: "#/definitions/positiveInteger" },
6828
- minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },
6829
- required: { $ref: "#/definitions/stringArray" },
6830
- additionalProperties: {
6831
- anyOf: [{ type: "boolean" }, { $ref: "#" }],
6832
- default: {}
6833
- },
6834
- definitions: {
6835
- type: "object",
6836
- additionalProperties: { $ref: "#" },
6837
- default: {}
6838
- },
6839
- properties: {
6840
- type: "object",
6841
- additionalProperties: { $ref: "#" },
6842
- default: {}
6843
- },
6844
- patternProperties: {
6845
- type: "object",
6846
- additionalProperties: { $ref: "#" },
6847
- default: {}
6848
- },
6849
- dependencies: {
6850
- type: "object",
6851
- additionalProperties: {
6852
- anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }]
6853
- }
6854
- },
6855
- enum: {
6856
- type: "array",
6857
- minItems: 1,
6858
- uniqueItems: true
6859
- },
6860
- type: {
6861
- anyOf: [
6862
- { $ref: "#/definitions/simpleTypes" },
6863
- {
6864
- type: "array",
6865
- items: { $ref: "#/definitions/simpleTypes" },
6866
- minItems: 1,
6867
- uniqueItems: true
6868
- }
6869
- ]
6870
- },
6871
- allOf: { $ref: "#/definitions/schemaArray" },
6872
- anyOf: { $ref: "#/definitions/schemaArray" },
6873
- oneOf: { $ref: "#/definitions/schemaArray" },
6874
- not: { $ref: "#" }
6875
- },
6876
- dependencies: {
6877
- exclusiveMaximum: ["maximum"],
6878
- exclusiveMinimum: ["minimum"]
6879
- },
6880
- default: {}
6881
- };
6304
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js
6305
+ var require_next = __commonJS({
6306
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js"(exports2) {
6307
+ "use strict";
6308
+ Object.defineProperty(exports2, "__esModule", { value: true });
6309
+ var dependentRequired_1 = require_dependentRequired();
6310
+ var dependentSchemas_1 = require_dependentSchemas();
6311
+ var limitContains_1 = require_limitContains();
6312
+ var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
6313
+ exports2.default = next;
6882
6314
  }
6883
6315
  });
6884
6316
 
6885
- // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/index.js
6886
- var require_dist = __commonJS({
6887
- "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/index.js"(exports2, module2) {
6317
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
6318
+ var require_unevaluatedProperties = __commonJS({
6319
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports2) {
6888
6320
  "use strict";
6889
6321
  Object.defineProperty(exports2, "__esModule", { value: true });
6890
- exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0;
6891
- var core_1 = require_core();
6892
- var draft4_1 = require_draft4();
6893
- var discriminator_1 = require_discriminator();
6894
- var draft4MetaSchema = require_json_schema_draft_04();
6895
- var META_SUPPORT_DATA = ["/properties"];
6896
- var META_SCHEMA_ID = "http://json-schema.org/draft-04/schema";
6897
- var Ajv = class extends core_1.default {
6898
- constructor(opts = {}) {
6899
- super({
6900
- ...opts,
6901
- schemaId: "id"
6902
- });
6903
- }
6904
- _addVocabularies() {
6905
- super._addVocabularies();
6906
- draft4_1.default.forEach((v) => this.addVocabulary(v));
6907
- if (this.opts.discriminator)
6908
- this.addKeyword(discriminator_1.default);
6909
- }
6910
- _addDefaultMetaSchema() {
6911
- super._addDefaultMetaSchema();
6912
- if (!this.opts.meta)
6913
- return;
6914
- const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft4MetaSchema, META_SUPPORT_DATA) : draft4MetaSchema;
6915
- this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
6916
- this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
6917
- }
6918
- defaultMeta() {
6919
- return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
6920
- }
6322
+ var codegen_1 = require_codegen();
6323
+ var util_1 = require_util2();
6324
+ var names_1 = require_names();
6325
+ var error = {
6326
+ message: "must NOT have unevaluated properties",
6327
+ params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`
6921
6328
  };
6922
- module2.exports = exports2 = Ajv;
6923
- Object.defineProperty(exports2, "__esModule", { value: true });
6924
- exports2.default = Ajv;
6925
- var core_2 = require_core();
6926
- Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() {
6927
- return core_2.KeywordCxt;
6928
- } });
6929
- var core_3 = require_core();
6930
- Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
6931
- return core_3._;
6932
- } });
6933
- Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
6934
- return core_3.str;
6935
- } });
6936
- Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
6937
- return core_3.stringify;
6938
- } });
6939
- Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
6940
- return core_3.nil;
6941
- } });
6942
- Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
6943
- return core_3.Name;
6944
- } });
6945
- Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() {
6946
- return core_3.CodeGen;
6947
- } });
6329
+ var def = {
6330
+ keyword: "unevaluatedProperties",
6331
+ type: "object",
6332
+ schemaType: ["boolean", "object"],
6333
+ trackErrors: true,
6334
+ error,
6335
+ code(cxt) {
6336
+ const { gen, schema, data, errsCount, it } = cxt;
6337
+ if (!errsCount)
6338
+ throw new Error("ajv implementation error");
6339
+ const { allErrors, props } = it;
6340
+ if (props instanceof codegen_1.Name) {
6341
+ gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
6342
+ } else if (props !== true) {
6343
+ gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
6344
+ }
6345
+ it.props = true;
6346
+ cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
6347
+ function unevaluatedPropCode(key) {
6348
+ if (schema === false) {
6349
+ cxt.setParams({ unevaluatedProperty: key });
6350
+ cxt.error();
6351
+ if (!allErrors)
6352
+ gen.break();
6353
+ return;
6354
+ }
6355
+ if (!(0, util_1.alwaysValidSchema)(it, schema)) {
6356
+ const valid = gen.name("valid");
6357
+ cxt.subschema({
6358
+ keyword: "unevaluatedProperties",
6359
+ dataProp: key,
6360
+ dataPropType: util_1.Type.Str
6361
+ }, valid);
6362
+ if (!allErrors)
6363
+ gen.if((0, codegen_1.not)(valid), () => gen.break());
6364
+ }
6365
+ }
6366
+ function unevaluatedDynamic(evaluatedProps, key) {
6367
+ return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;
6368
+ }
6369
+ function unevaluatedStatic(evaluatedProps, key) {
6370
+ const ps = [];
6371
+ for (const p in evaluatedProps) {
6372
+ if (evaluatedProps[p] === true)
6373
+ ps.push((0, codegen_1._)`${key} !== ${p}`);
6374
+ }
6375
+ return (0, codegen_1.and)(...ps);
6376
+ }
6377
+ }
6378
+ };
6379
+ exports2.default = def;
6948
6380
  }
6949
6381
  });
6950
6382
 
6951
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js
6952
- var require_id = __commonJS({
6953
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) {
6383
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
6384
+ var require_unevaluatedItems = __commonJS({
6385
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports2) {
6954
6386
  "use strict";
6955
6387
  Object.defineProperty(exports2, "__esModule", { value: true });
6388
+ var codegen_1 = require_codegen();
6389
+ var util_1 = require_util2();
6390
+ var error = {
6391
+ message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
6392
+ params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
6393
+ };
6956
6394
  var def = {
6957
- keyword: "id",
6958
- code() {
6959
- throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
6395
+ keyword: "unevaluatedItems",
6396
+ type: "array",
6397
+ schemaType: ["boolean", "object"],
6398
+ error,
6399
+ code(cxt) {
6400
+ const { gen, schema, data, it } = cxt;
6401
+ const items = it.items || 0;
6402
+ if (items === true)
6403
+ return;
6404
+ const len = gen.const("len", (0, codegen_1._)`${data}.length`);
6405
+ if (schema === false) {
6406
+ cxt.setParams({ len: items });
6407
+ cxt.fail((0, codegen_1._)`${len} > ${items}`);
6408
+ } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
6409
+ const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
6410
+ gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
6411
+ cxt.ok(valid);
6412
+ }
6413
+ it.items = true;
6414
+ function validateItems(valid, from) {
6415
+ gen.forRange("i", from, len, (i) => {
6416
+ cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
6417
+ if (!it.allErrors)
6418
+ gen.if((0, codegen_1.not)(valid), () => gen.break());
6419
+ });
6420
+ }
6960
6421
  }
6961
6422
  };
6962
6423
  exports2.default = def;
6963
6424
  }
6964
6425
  });
6965
6426
 
6966
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js
6967
- var require_core3 = __commonJS({
6968
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) {
6427
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js
6428
+ var require_unevaluated = __commonJS({
6429
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports2) {
6969
6430
  "use strict";
6970
6431
  Object.defineProperty(exports2, "__esModule", { value: true });
6971
- var id_1 = require_id();
6972
- var ref_1 = require_ref();
6973
- var core = [
6974
- "$schema",
6975
- "$id",
6976
- "$defs",
6977
- "$vocabulary",
6978
- { keyword: "$comment" },
6979
- "definitions",
6980
- id_1.default,
6981
- ref_1.default
6982
- ];
6983
- exports2.default = core;
6432
+ var unevaluatedProperties_1 = require_unevaluatedProperties();
6433
+ var unevaluatedItems_1 = require_unevaluatedItems();
6434
+ var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
6435
+ exports2.default = unevaluated;
6984
6436
  }
6985
6437
  });
6986
6438
 
6987
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
6988
- var require_limitNumber2 = __commonJS({
6989
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) {
6439
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js
6440
+ var require_format = __commonJS({
6441
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) {
6990
6442
  "use strict";
6991
6443
  Object.defineProperty(exports2, "__esModule", { value: true });
6992
6444
  var codegen_1 = require_codegen();
6993
- var ops = codegen_1.operators;
6994
- var KWDs = {
6995
- maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
6996
- minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
6997
- exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
6998
- exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
6999
- };
7000
6445
  var error = {
7001
- message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
7002
- params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
6446
+ message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
6447
+ params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
7003
6448
  };
7004
6449
  var def = {
7005
- keyword: Object.keys(KWDs),
7006
- type: "number",
7007
- schemaType: "number",
6450
+ keyword: "format",
6451
+ type: ["number", "string"],
6452
+ schemaType: "string",
7008
6453
  $data: true,
7009
6454
  error,
7010
- code(cxt) {
7011
- const { keyword, data, schemaCode } = cxt;
7012
- cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
6455
+ code(cxt, ruleType) {
6456
+ const { gen, data, $data, schema, schemaCode, it } = cxt;
6457
+ const { opts, errSchemaPath, schemaEnv, self } = it;
6458
+ if (!opts.validateFormats)
6459
+ return;
6460
+ if ($data)
6461
+ validate$DataFormat();
6462
+ else
6463
+ validateFormat();
6464
+ function validate$DataFormat() {
6465
+ const fmts = gen.scopeValue("formats", {
6466
+ ref: self.formats,
6467
+ code: opts.code.formats
6468
+ });
6469
+ const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
6470
+ const fType = gen.let("fType");
6471
+ const format = gen.let("format");
6472
+ 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));
6473
+ cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
6474
+ function unknownFmt() {
6475
+ if (opts.strictSchema === false)
6476
+ return codegen_1.nil;
6477
+ return (0, codegen_1._)`${schemaCode} && !${format}`;
6478
+ }
6479
+ function invalidFmt() {
6480
+ const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
6481
+ const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
6482
+ return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
6483
+ }
6484
+ }
6485
+ function validateFormat() {
6486
+ const formatDef = self.formats[schema];
6487
+ if (!formatDef) {
6488
+ unknownFormat();
6489
+ return;
6490
+ }
6491
+ if (formatDef === true)
6492
+ return;
6493
+ const [fmtType, format, fmtRef] = getFormat(formatDef);
6494
+ if (fmtType === ruleType)
6495
+ cxt.pass(validCondition());
6496
+ function unknownFormat() {
6497
+ if (opts.strictSchema === false) {
6498
+ self.logger.warn(unknownMsg());
6499
+ return;
6500
+ }
6501
+ throw new Error(unknownMsg());
6502
+ function unknownMsg() {
6503
+ return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
6504
+ }
6505
+ }
6506
+ function getFormat(fmtDef) {
6507
+ 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;
6508
+ const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
6509
+ if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
6510
+ return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
6511
+ }
6512
+ return ["string", fmtDef, fmt];
6513
+ }
6514
+ function validCondition() {
6515
+ if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
6516
+ if (!schemaEnv.$async)
6517
+ throw new Error("async format in sync schema");
6518
+ return (0, codegen_1._)`await ${fmtRef}(${data})`;
6519
+ }
6520
+ return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
6521
+ }
6522
+ }
7013
6523
  }
7014
6524
  };
7015
6525
  exports2.default = def;
7016
6526
  }
7017
6527
  });
7018
6528
 
7019
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js
7020
- var require_validation2 = __commonJS({
7021
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) {
6529
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js
6530
+ var require_format2 = __commonJS({
6531
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) {
7022
6532
  "use strict";
7023
6533
  Object.defineProperty(exports2, "__esModule", { value: true });
7024
- var limitNumber_1 = require_limitNumber2();
7025
- var multipleOf_1 = require_multipleOf();
7026
- var limitLength_1 = require_limitLength();
7027
- var pattern_1 = require_pattern();
7028
- var limitProperties_1 = require_limitProperties();
7029
- var required_1 = require_required();
7030
- var limitItems_1 = require_limitItems();
7031
- var uniqueItems_1 = require_uniqueItems();
7032
- var const_1 = require_const();
7033
- var enum_1 = require_enum();
7034
- var validation = [
7035
- // number
7036
- limitNumber_1.default,
7037
- multipleOf_1.default,
7038
- // string
7039
- limitLength_1.default,
7040
- pattern_1.default,
7041
- // object
7042
- limitProperties_1.default,
7043
- required_1.default,
7044
- // array
7045
- limitItems_1.default,
7046
- uniqueItems_1.default,
7047
- // any
7048
- { keyword: "type", schemaType: ["string", "array"] },
7049
- { keyword: "nullable", schemaType: "boolean" },
7050
- const_1.default,
7051
- enum_1.default
7052
- ];
7053
- exports2.default = validation;
6534
+ var format_1 = require_format();
6535
+ var format = [format_1.default];
6536
+ exports2.default = format;
7054
6537
  }
7055
6538
  });
7056
6539
 
7057
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js
7058
- var require_dynamicAnchor = __commonJS({
7059
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports2) {
6540
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js
6541
+ var require_metadata = __commonJS({
6542
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) {
7060
6543
  "use strict";
7061
6544
  Object.defineProperty(exports2, "__esModule", { value: true });
7062
- exports2.dynamicAnchor = void 0;
7063
- var codegen_1 = require_codegen();
7064
- var names_1 = require_names();
7065
- var compile_1 = require_compile();
7066
- var ref_1 = require_ref();
7067
- var def = {
7068
- keyword: "$dynamicAnchor",
7069
- schemaType: "string",
7070
- code: (cxt) => dynamicAnchor(cxt, cxt.schema)
7071
- };
7072
- function dynamicAnchor(cxt, anchor) {
7073
- const { gen, it } = cxt;
7074
- it.schemaEnv.root.dynamicAnchors[anchor] = true;
7075
- const v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
7076
- const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
7077
- gen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));
7078
- }
7079
- exports2.dynamicAnchor = dynamicAnchor;
7080
- function _getValidate(cxt) {
7081
- const { schemaEnv, schema, self } = cxt.it;
7082
- const { root, baseId, localRefs, meta } = schemaEnv.root;
7083
- const { schemaId } = self.opts;
7084
- const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
7085
- compile_1.compileSchema.call(self, sch);
7086
- return (0, ref_1.getValidate)(cxt, sch);
7087
- }
7088
- exports2.default = def;
6545
+ exports2.contentVocabulary = exports2.metadataVocabulary = void 0;
6546
+ exports2.metadataVocabulary = [
6547
+ "title",
6548
+ "description",
6549
+ "default",
6550
+ "deprecated",
6551
+ "readOnly",
6552
+ "writeOnly",
6553
+ "examples"
6554
+ ];
6555
+ exports2.contentVocabulary = [
6556
+ "contentMediaType",
6557
+ "contentEncoding",
6558
+ "contentSchema"
6559
+ ];
7089
6560
  }
7090
6561
  });
7091
6562
 
7092
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
7093
- var require_dynamicRef = __commonJS({
7094
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports2) {
6563
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js
6564
+ var require_draft2020 = __commonJS({
6565
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js"(exports2) {
7095
6566
  "use strict";
7096
6567
  Object.defineProperty(exports2, "__esModule", { value: true });
7097
- exports2.dynamicRef = void 0;
7098
- var codegen_1 = require_codegen();
7099
- var names_1 = require_names();
7100
- var ref_1 = require_ref();
7101
- var def = {
7102
- keyword: "$dynamicRef",
7103
- schemaType: "string",
7104
- code: (cxt) => dynamicRef(cxt, cxt.schema)
7105
- };
7106
- function dynamicRef(cxt, ref) {
7107
- const { gen, keyword, it } = cxt;
7108
- if (ref[0] !== "#")
7109
- throw new Error(`"${keyword}" only supports hash fragment reference`);
7110
- const anchor = ref.slice(1);
7111
- if (it.allErrors) {
7112
- _dynamicRef();
7113
- } else {
7114
- const valid = gen.let("valid", false);
7115
- _dynamicRef(valid);
7116
- cxt.ok(valid);
7117
- }
7118
- function _dynamicRef(valid) {
7119
- if (it.schemaEnv.root.dynamicAnchors[anchor]) {
7120
- const v = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
7121
- gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
7122
- } else {
7123
- _callRef(it.validateName, valid)();
7124
- }
7125
- }
7126
- function _callRef(validate, valid) {
7127
- return valid ? () => gen.block(() => {
7128
- (0, ref_1.callRef)(cxt, validate);
7129
- gen.let(valid, true);
7130
- }) : () => (0, ref_1.callRef)(cxt, validate);
7131
- }
7132
- }
7133
- exports2.dynamicRef = dynamicRef;
7134
- exports2.default = def;
6568
+ var core_1 = require_core2();
6569
+ var validation_1 = require_validation();
6570
+ var applicator_1 = require_applicator();
6571
+ var dynamic_1 = require_dynamic();
6572
+ var next_1 = require_next();
6573
+ var unevaluated_1 = require_unevaluated();
6574
+ var format_1 = require_format2();
6575
+ var metadata_1 = require_metadata();
6576
+ var draft2020Vocabularies = [
6577
+ dynamic_1.default,
6578
+ core_1.default,
6579
+ validation_1.default,
6580
+ (0, applicator_1.default)(true),
6581
+ format_1.default,
6582
+ metadata_1.metadataVocabulary,
6583
+ metadata_1.contentVocabulary,
6584
+ next_1.default,
6585
+ unevaluated_1.default
6586
+ ];
6587
+ exports2.default = draft2020Vocabularies;
7135
6588
  }
7136
6589
  });
7137
6590
 
7138
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js
7139
- var require_recursiveAnchor = __commonJS({
7140
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports2) {
6591
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js
6592
+ var require_types = __commonJS({
6593
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) {
7141
6594
  "use strict";
7142
6595
  Object.defineProperty(exports2, "__esModule", { value: true });
7143
- var dynamicAnchor_1 = require_dynamicAnchor();
7144
- var util_1 = require_util2();
7145
- var def = {
7146
- keyword: "$recursiveAnchor",
7147
- schemaType: "boolean",
7148
- code(cxt) {
7149
- if (cxt.schema)
7150
- (0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
7151
- else
7152
- (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
7153
- }
7154
- };
7155
- exports2.default = def;
6596
+ exports2.DiscrError = void 0;
6597
+ var DiscrError;
6598
+ (function(DiscrError2) {
6599
+ DiscrError2["Tag"] = "tag";
6600
+ DiscrError2["Mapping"] = "mapping";
6601
+ })(DiscrError || (exports2.DiscrError = DiscrError = {}));
7156
6602
  }
7157
6603
  });
7158
6604
 
7159
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
7160
- var require_recursiveRef = __commonJS({
7161
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports2) {
6605
+ // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js
6606
+ var require_discriminator = __commonJS({
6607
+ "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) {
7162
6608
  "use strict";
7163
6609
  Object.defineProperty(exports2, "__esModule", { value: true });
7164
- var dynamicRef_1 = require_dynamicRef();
6610
+ var codegen_1 = require_codegen();
6611
+ var types_1 = require_types();
6612
+ var compile_1 = require_compile();
6613
+ var ref_error_1 = require_ref_error();
6614
+ var util_1 = require_util2();
6615
+ var error = {
6616
+ message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
6617
+ params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
6618
+ };
7165
6619
  var def = {
7166
- keyword: "$recursiveRef",
7167
- schemaType: "string",
7168
- code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)
6620
+ keyword: "discriminator",
6621
+ type: "object",
6622
+ schemaType: "object",
6623
+ error,
6624
+ code(cxt) {
6625
+ const { gen, data, schema, parentSchema, it } = cxt;
6626
+ const { oneOf } = parentSchema;
6627
+ if (!it.opts.discriminator) {
6628
+ throw new Error("discriminator: requires discriminator option");
6629
+ }
6630
+ const tagName = schema.propertyName;
6631
+ if (typeof tagName != "string")
6632
+ throw new Error("discriminator: requires propertyName");
6633
+ if (schema.mapping)
6634
+ throw new Error("discriminator: mapping is not supported");
6635
+ if (!oneOf)
6636
+ throw new Error("discriminator: requires oneOf keyword");
6637
+ const valid = gen.let("valid", false);
6638
+ const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
6639
+ gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
6640
+ cxt.ok(valid);
6641
+ function validateMapping() {
6642
+ const mapping = getMapping();
6643
+ gen.if(false);
6644
+ for (const tagValue in mapping) {
6645
+ gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
6646
+ gen.assign(valid, applyTagSchema(mapping[tagValue]));
6647
+ }
6648
+ gen.else();
6649
+ cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
6650
+ gen.endIf();
6651
+ }
6652
+ function applyTagSchema(schemaProp) {
6653
+ const _valid = gen.name("valid");
6654
+ const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
6655
+ cxt.mergeEvaluated(schCxt, codegen_1.Name);
6656
+ return _valid;
6657
+ }
6658
+ function getMapping() {
6659
+ var _a;
6660
+ const oneOfMapping = {};
6661
+ const topRequired = hasRequired(parentSchema);
6662
+ let tagRequired = true;
6663
+ for (let i = 0; i < oneOf.length; i++) {
6664
+ let sch = oneOf[i];
6665
+ if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
6666
+ const ref = sch.$ref;
6667
+ sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
6668
+ if (sch instanceof compile_1.SchemaEnv)
6669
+ sch = sch.schema;
6670
+ if (sch === void 0)
6671
+ throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
6672
+ }
6673
+ const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
6674
+ if (typeof propSch != "object") {
6675
+ throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
6676
+ }
6677
+ tagRequired = tagRequired && (topRequired || hasRequired(sch));
6678
+ addMappings(propSch, i);
6679
+ }
6680
+ if (!tagRequired)
6681
+ throw new Error(`discriminator: "${tagName}" must be required`);
6682
+ return oneOfMapping;
6683
+ function hasRequired({ required }) {
6684
+ return Array.isArray(required) && required.includes(tagName);
6685
+ }
6686
+ function addMappings(sch, i) {
6687
+ if (sch.const) {
6688
+ addMapping(sch.const, i);
6689
+ } else if (sch.enum) {
6690
+ for (const tagValue of sch.enum) {
6691
+ addMapping(tagValue, i);
6692
+ }
6693
+ } else {
6694
+ throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
6695
+ }
6696
+ }
6697
+ function addMapping(tagValue, i) {
6698
+ if (typeof tagValue != "string" || tagValue in oneOfMapping) {
6699
+ throw new Error(`discriminator: "${tagName}" values must be unique strings`);
6700
+ }
6701
+ oneOfMapping[tagValue] = i;
6702
+ }
6703
+ }
6704
+ }
7169
6705
  };
7170
6706
  exports2.default = def;
7171
6707
  }
7172
6708
  });
7173
6709
 
7174
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js
7175
- var require_dynamic = __commonJS({
7176
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports2) {
7177
- "use strict";
7178
- Object.defineProperty(exports2, "__esModule", { value: true });
7179
- var dynamicAnchor_1 = require_dynamicAnchor();
7180
- var dynamicRef_1 = require_dynamicRef();
7181
- var recursiveAnchor_1 = require_recursiveAnchor();
7182
- var recursiveRef_1 = require_recursiveRef();
7183
- var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
7184
- exports2.default = dynamic;
7185
- }
7186
- });
7187
-
7188
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
7189
- var require_dependentRequired = __commonJS({
7190
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports2) {
7191
- "use strict";
7192
- Object.defineProperty(exports2, "__esModule", { value: true });
7193
- var dependencies_1 = require_dependencies();
7194
- var def = {
7195
- keyword: "dependentRequired",
7196
- type: "object",
7197
- schemaType: "object",
7198
- error: dependencies_1.error,
7199
- code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)
7200
- };
7201
- exports2.default = def;
7202
- }
7203
- });
7204
-
7205
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
7206
- var require_dependentSchemas = __commonJS({
7207
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports2) {
7208
- "use strict";
7209
- Object.defineProperty(exports2, "__esModule", { value: true });
7210
- var dependencies_1 = require_dependencies();
7211
- var def = {
7212
- keyword: "dependentSchemas",
7213
- type: "object",
7214
- schemaType: "object",
7215
- code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)
7216
- };
7217
- exports2.default = def;
7218
- }
7219
- });
7220
-
7221
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js
7222
- var require_limitContains = __commonJS({
7223
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports2) {
7224
- "use strict";
7225
- Object.defineProperty(exports2, "__esModule", { value: true });
7226
- var util_1 = require_util2();
7227
- var def = {
7228
- keyword: ["maxContains", "minContains"],
7229
- type: "array",
7230
- schemaType: "number",
7231
- code({ keyword, parentSchema, it }) {
7232
- if (parentSchema.contains === void 0) {
7233
- (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
7234
- }
7235
- }
7236
- };
7237
- exports2.default = def;
7238
- }
7239
- });
7240
-
7241
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js
7242
- var require_next = __commonJS({
7243
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js"(exports2) {
7244
- "use strict";
7245
- Object.defineProperty(exports2, "__esModule", { value: true });
7246
- var dependentRequired_1 = require_dependentRequired();
7247
- var dependentSchemas_1 = require_dependentSchemas();
7248
- var limitContains_1 = require_limitContains();
7249
- var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
7250
- exports2.default = next;
7251
- }
7252
- });
7253
-
7254
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
7255
- var require_unevaluatedProperties = __commonJS({
7256
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports2) {
7257
- "use strict";
7258
- Object.defineProperty(exports2, "__esModule", { value: true });
7259
- var codegen_1 = require_codegen();
7260
- var util_1 = require_util2();
7261
- var names_1 = require_names();
7262
- var error = {
7263
- message: "must NOT have unevaluated properties",
7264
- params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`
7265
- };
7266
- var def = {
7267
- keyword: "unevaluatedProperties",
7268
- type: "object",
7269
- schemaType: ["boolean", "object"],
7270
- trackErrors: true,
7271
- error,
7272
- code(cxt) {
7273
- const { gen, schema, data, errsCount, it } = cxt;
7274
- if (!errsCount)
7275
- throw new Error("ajv implementation error");
7276
- const { allErrors, props } = it;
7277
- if (props instanceof codegen_1.Name) {
7278
- gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
7279
- } else if (props !== true) {
7280
- gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
7281
- }
7282
- it.props = true;
7283
- cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
7284
- function unevaluatedPropCode(key) {
7285
- if (schema === false) {
7286
- cxt.setParams({ unevaluatedProperty: key });
7287
- cxt.error();
7288
- if (!allErrors)
7289
- gen.break();
7290
- return;
7291
- }
7292
- if (!(0, util_1.alwaysValidSchema)(it, schema)) {
7293
- const valid = gen.name("valid");
7294
- cxt.subschema({
7295
- keyword: "unevaluatedProperties",
7296
- dataProp: key,
7297
- dataPropType: util_1.Type.Str
7298
- }, valid);
7299
- if (!allErrors)
7300
- gen.if((0, codegen_1.not)(valid), () => gen.break());
7301
- }
7302
- }
7303
- function unevaluatedDynamic(evaluatedProps, key) {
7304
- return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;
7305
- }
7306
- function unevaluatedStatic(evaluatedProps, key) {
7307
- const ps = [];
7308
- for (const p in evaluatedProps) {
7309
- if (evaluatedProps[p] === true)
7310
- ps.push((0, codegen_1._)`${key} !== ${p}`);
7311
- }
7312
- return (0, codegen_1.and)(...ps);
7313
- }
7314
- }
7315
- };
7316
- exports2.default = def;
7317
- }
7318
- });
7319
-
7320
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
7321
- var require_unevaluatedItems = __commonJS({
7322
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports2) {
7323
- "use strict";
7324
- Object.defineProperty(exports2, "__esModule", { value: true });
7325
- var codegen_1 = require_codegen();
7326
- var util_1 = require_util2();
7327
- var error = {
7328
- message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
7329
- params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
7330
- };
7331
- var def = {
7332
- keyword: "unevaluatedItems",
7333
- type: "array",
7334
- schemaType: ["boolean", "object"],
7335
- error,
7336
- code(cxt) {
7337
- const { gen, schema, data, it } = cxt;
7338
- const items = it.items || 0;
7339
- if (items === true)
7340
- return;
7341
- const len = gen.const("len", (0, codegen_1._)`${data}.length`);
7342
- if (schema === false) {
7343
- cxt.setParams({ len: items });
7344
- cxt.fail((0, codegen_1._)`${len} > ${items}`);
7345
- } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
7346
- const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`);
7347
- gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
7348
- cxt.ok(valid);
7349
- }
7350
- it.items = true;
7351
- function validateItems(valid, from) {
7352
- gen.forRange("i", from, len, (i) => {
7353
- cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
7354
- if (!it.allErrors)
7355
- gen.if((0, codegen_1.not)(valid), () => gen.break());
7356
- });
7357
- }
7358
- }
7359
- };
7360
- exports2.default = def;
7361
- }
7362
- });
7363
-
7364
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js
7365
- var require_unevaluated = __commonJS({
7366
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports2) {
7367
- "use strict";
7368
- Object.defineProperty(exports2, "__esModule", { value: true });
7369
- var unevaluatedProperties_1 = require_unevaluatedProperties();
7370
- var unevaluatedItems_1 = require_unevaluatedItems();
7371
- var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
7372
- exports2.default = unevaluated;
7373
- }
7374
- });
7375
-
7376
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js
7377
- var require_metadata = __commonJS({
7378
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) {
7379
- "use strict";
7380
- Object.defineProperty(exports2, "__esModule", { value: true });
7381
- exports2.contentVocabulary = exports2.metadataVocabulary = void 0;
7382
- exports2.metadataVocabulary = [
7383
- "title",
7384
- "description",
7385
- "default",
7386
- "deprecated",
7387
- "readOnly",
7388
- "writeOnly",
7389
- "examples"
7390
- ];
7391
- exports2.contentVocabulary = [
7392
- "contentMediaType",
7393
- "contentEncoding",
7394
- "contentSchema"
7395
- ];
7396
- }
7397
- });
7398
-
7399
- // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js
7400
- var require_draft2020 = __commonJS({
7401
- "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js"(exports2) {
7402
- "use strict";
7403
- Object.defineProperty(exports2, "__esModule", { value: true });
7404
- var core_1 = require_core3();
7405
- var validation_1 = require_validation2();
7406
- var applicator_1 = require_applicator();
7407
- var dynamic_1 = require_dynamic();
7408
- var next_1 = require_next();
7409
- var unevaluated_1 = require_unevaluated();
7410
- var format_1 = require_format2();
7411
- var metadata_1 = require_metadata();
7412
- var draft2020Vocabularies = [
7413
- dynamic_1.default,
7414
- core_1.default,
7415
- validation_1.default,
7416
- (0, applicator_1.default)(true),
7417
- format_1.default,
7418
- metadata_1.metadataVocabulary,
7419
- metadata_1.contentVocabulary,
7420
- next_1.default,
7421
- unevaluated_1.default
7422
- ];
7423
- exports2.default = draft2020Vocabularies;
7424
- }
7425
- });
7426
-
7427
6710
  // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json
7428
6711
  var require_schema = __commonJS({
7429
6712
  "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json"(exports2, module2) {
@@ -7579,7 +6862,7 @@ var require_content = __commonJS({
7579
6862
  });
7580
6863
 
7581
6864
  // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json
7582
- var require_core4 = __commonJS({
6865
+ var require_core3 = __commonJS({
7583
6866
  "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json"(exports2, module2) {
7584
6867
  module2.exports = {
7585
6868
  $schema: "https://json-schema.org/draft/2020-12/schema",
@@ -7695,7 +6978,7 @@ var require_meta_data = __commonJS({
7695
6978
  });
7696
6979
 
7697
6980
  // ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
7698
- var require_validation3 = __commonJS({
6981
+ var require_validation2 = __commonJS({
7699
6982
  "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json"(exports2, module2) {
7700
6983
  module2.exports = {
7701
6984
  $schema: "https://json-schema.org/draft/2020-12/schema",
@@ -7798,10 +7081,10 @@ var require_json_schema_2020_12 = __commonJS({
7798
7081
  var applicator = require_applicator2();
7799
7082
  var unevaluated = require_unevaluated2();
7800
7083
  var content = require_content();
7801
- var core = require_core4();
7084
+ var core = require_core3();
7802
7085
  var format = require_format_annotation();
7803
7086
  var metadata = require_meta_data();
7804
- var validation = require_validation3();
7087
+ var validation = require_validation2();
7805
7088
  var META_SUPPORT_DATA = ["/properties"];
7806
7089
  function addMetaSchema2020($data) {
7807
7090
  ;
@@ -12391,194 +11674,554 @@ var require_schema4 = __commonJS({
12391
11674
  }
12392
11675
  }
12393
11676
  },
12394
- "security-scheme-or-reference": {
12395
- if: {
12396
- required: [
12397
- "$ref"
12398
- ]
12399
- },
12400
- then: {
12401
- $ref: "#/$defs/reference"
12402
- },
12403
- else: {
12404
- $ref: "#/$defs/security-scheme"
12405
- }
11677
+ "security-scheme-or-reference": {
11678
+ if: {
11679
+ required: [
11680
+ "$ref"
11681
+ ]
11682
+ },
11683
+ then: {
11684
+ $ref: "#/$defs/reference"
11685
+ },
11686
+ else: {
11687
+ $ref: "#/$defs/security-scheme"
11688
+ }
11689
+ },
11690
+ "oauth-flows": {
11691
+ type: "object",
11692
+ properties: {
11693
+ implicit: {
11694
+ $ref: "#/$defs/oauth-flows/$defs/implicit"
11695
+ },
11696
+ password: {
11697
+ $ref: "#/$defs/oauth-flows/$defs/password"
11698
+ },
11699
+ clientCredentials: {
11700
+ $ref: "#/$defs/oauth-flows/$defs/client-credentials"
11701
+ },
11702
+ authorizationCode: {
11703
+ $ref: "#/$defs/oauth-flows/$defs/authorization-code"
11704
+ }
11705
+ },
11706
+ $ref: "#/$defs/specification-extensions",
11707
+ unevaluatedProperties: false,
11708
+ $defs: {
11709
+ implicit: {
11710
+ type: "object",
11711
+ properties: {
11712
+ authorizationUrl: {
11713
+ type: "string"
11714
+ },
11715
+ refreshUrl: {
11716
+ type: "string"
11717
+ },
11718
+ scopes: {
11719
+ $ref: "#/$defs/map-of-strings"
11720
+ }
11721
+ },
11722
+ required: [
11723
+ "authorizationUrl",
11724
+ "scopes"
11725
+ ],
11726
+ $ref: "#/$defs/specification-extensions",
11727
+ unevaluatedProperties: false
11728
+ },
11729
+ password: {
11730
+ type: "object",
11731
+ properties: {
11732
+ tokenUrl: {
11733
+ type: "string"
11734
+ },
11735
+ refreshUrl: {
11736
+ type: "string"
11737
+ },
11738
+ scopes: {
11739
+ $ref: "#/$defs/map-of-strings"
11740
+ }
11741
+ },
11742
+ required: [
11743
+ "tokenUrl",
11744
+ "scopes"
11745
+ ],
11746
+ $ref: "#/$defs/specification-extensions",
11747
+ unevaluatedProperties: false
11748
+ },
11749
+ "client-credentials": {
11750
+ type: "object",
11751
+ properties: {
11752
+ tokenUrl: {
11753
+ type: "string"
11754
+ },
11755
+ refreshUrl: {
11756
+ type: "string"
11757
+ },
11758
+ scopes: {
11759
+ $ref: "#/$defs/map-of-strings"
11760
+ }
11761
+ },
11762
+ required: [
11763
+ "tokenUrl",
11764
+ "scopes"
11765
+ ],
11766
+ $ref: "#/$defs/specification-extensions",
11767
+ unevaluatedProperties: false
11768
+ },
11769
+ "authorization-code": {
11770
+ type: "object",
11771
+ properties: {
11772
+ authorizationUrl: {
11773
+ type: "string"
11774
+ },
11775
+ tokenUrl: {
11776
+ type: "string"
11777
+ },
11778
+ refreshUrl: {
11779
+ type: "string"
11780
+ },
11781
+ scopes: {
11782
+ $ref: "#/$defs/map-of-strings"
11783
+ }
11784
+ },
11785
+ required: [
11786
+ "authorizationUrl",
11787
+ "tokenUrl",
11788
+ "scopes"
11789
+ ],
11790
+ $ref: "#/$defs/specification-extensions",
11791
+ unevaluatedProperties: false
11792
+ }
11793
+ }
11794
+ },
11795
+ "security-requirement": {
11796
+ type: "object",
11797
+ additionalProperties: {
11798
+ type: "array",
11799
+ items: {
11800
+ type: "string"
11801
+ }
11802
+ }
11803
+ },
11804
+ "specification-extensions": {
11805
+ patternProperties: {
11806
+ "^x-": true
11807
+ }
11808
+ },
11809
+ examples: {
11810
+ properties: {
11811
+ example: true,
11812
+ examples: {
11813
+ type: "object",
11814
+ additionalProperties: {
11815
+ $ref: "#/$defs/example-or-reference"
11816
+ }
11817
+ }
11818
+ }
11819
+ },
11820
+ uri: {
11821
+ type: "string",
11822
+ format: "uri"
11823
+ },
11824
+ "map-of-strings": {
11825
+ type: "object",
11826
+ additionalProperties: {
11827
+ type: "string"
11828
+ }
11829
+ }
11830
+ }
11831
+ };
11832
+ }
11833
+ });
11834
+
11835
+ // ../../node_modules/.pnpm/@apidevtools+openapi-schemas@2.1.0/node_modules/@apidevtools/openapi-schemas/lib/index.js
11836
+ var require_lib = __commonJS({
11837
+ "../../node_modules/.pnpm/@apidevtools+openapi-schemas@2.1.0/node_modules/@apidevtools/openapi-schemas/lib/index.js"(exports2, module2) {
11838
+ "use strict";
11839
+ Object.defineProperty(exports2, "__esModule", { value: true });
11840
+ exports2.openapi = exports2.openapiV31 = exports2.openapiV3 = exports2.openapiV2 = exports2.openapiV1 = void 0;
11841
+ exports2.openapiV1 = require_apiDeclaration();
11842
+ exports2.openapiV2 = require_schema2();
11843
+ exports2.openapiV3 = require_schema3();
11844
+ exports2.openapiV31 = require_schema4();
11845
+ exports2.openapi = {
11846
+ v1: exports2.openapiV1,
11847
+ v2: exports2.openapiV2,
11848
+ v3: exports2.openapiV3,
11849
+ v31: exports2.openapiV31
11850
+ };
11851
+ exports2.default = exports2.openapi;
11852
+ if (typeof module2 === "object" && typeof module2.exports === "object") {
11853
+ module2.exports = Object.assign(module2.exports.default, module2.exports);
11854
+ }
11855
+ }
11856
+ });
11857
+
11858
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/core.js
11859
+ var require_core4 = __commonJS({
11860
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/core.js"(exports2) {
11861
+ "use strict";
11862
+ Object.defineProperty(exports2, "__esModule", { value: true });
11863
+ var ref_1 = require_ref();
11864
+ var core = [
11865
+ "$schema",
11866
+ "id",
11867
+ "$defs",
11868
+ { keyword: "$comment" },
11869
+ "definitions",
11870
+ ref_1.default
11871
+ ];
11872
+ exports2.default = core;
11873
+ }
11874
+ });
11875
+
11876
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js
11877
+ var require_limitNumber2 = __commonJS({
11878
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js"(exports2) {
11879
+ "use strict";
11880
+ Object.defineProperty(exports2, "__esModule", { value: true });
11881
+ var core_1 = require_core();
11882
+ var codegen_1 = require_codegen();
11883
+ var ops = codegen_1.operators;
11884
+ var KWDs = {
11885
+ maximum: {
11886
+ exclusive: "exclusiveMaximum",
11887
+ ops: [
11888
+ { okStr: "<=", ok: ops.LTE, fail: ops.GT },
11889
+ { okStr: "<", ok: ops.LT, fail: ops.GTE }
11890
+ ]
11891
+ },
11892
+ minimum: {
11893
+ exclusive: "exclusiveMinimum",
11894
+ ops: [
11895
+ { okStr: ">=", ok: ops.GTE, fail: ops.LT },
11896
+ { okStr: ">", ok: ops.GT, fail: ops.LTE }
11897
+ ]
11898
+ }
11899
+ };
11900
+ var error = {
11901
+ message: (cxt) => core_1.str`must be ${kwdOp(cxt).okStr} ${cxt.schemaCode}`,
11902
+ params: (cxt) => core_1._`{comparison: ${kwdOp(cxt).okStr}, limit: ${cxt.schemaCode}}`
11903
+ };
11904
+ var def = {
11905
+ keyword: Object.keys(KWDs),
11906
+ type: "number",
11907
+ schemaType: "number",
11908
+ $data: true,
11909
+ error,
11910
+ code(cxt) {
11911
+ const { data, schemaCode } = cxt;
11912
+ cxt.fail$data(core_1._`${data} ${kwdOp(cxt).fail} ${schemaCode} || isNaN(${data})`);
11913
+ }
11914
+ };
11915
+ function kwdOp(cxt) {
11916
+ var _a;
11917
+ const keyword = cxt.keyword;
11918
+ const opsIdx = ((_a = cxt.parentSchema) === null || _a === void 0 ? void 0 : _a[KWDs[keyword].exclusive]) ? 1 : 0;
11919
+ return KWDs[keyword].ops[opsIdx];
11920
+ }
11921
+ exports2.default = def;
11922
+ }
11923
+ });
11924
+
11925
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js
11926
+ var require_limitNumberExclusive = __commonJS({
11927
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js"(exports2) {
11928
+ "use strict";
11929
+ Object.defineProperty(exports2, "__esModule", { value: true });
11930
+ var KWDs = {
11931
+ exclusiveMaximum: "maximum",
11932
+ exclusiveMinimum: "minimum"
11933
+ };
11934
+ var def = {
11935
+ keyword: Object.keys(KWDs),
11936
+ type: "number",
11937
+ schemaType: "boolean",
11938
+ code({ keyword, parentSchema }) {
11939
+ const limitKwd = KWDs[keyword];
11940
+ if (parentSchema[limitKwd] === void 0) {
11941
+ throw new Error(`${keyword} can only be used with ${limitKwd}`);
11942
+ }
11943
+ }
11944
+ };
11945
+ exports2.default = def;
11946
+ }
11947
+ });
11948
+
11949
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/index.js
11950
+ var require_validation3 = __commonJS({
11951
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/validation/index.js"(exports2) {
11952
+ "use strict";
11953
+ Object.defineProperty(exports2, "__esModule", { value: true });
11954
+ var limitNumber_1 = require_limitNumber2();
11955
+ var limitNumberExclusive_1 = require_limitNumberExclusive();
11956
+ var multipleOf_1 = require_multipleOf();
11957
+ var limitLength_1 = require_limitLength();
11958
+ var pattern_1 = require_pattern();
11959
+ var limitProperties_1 = require_limitProperties();
11960
+ var required_1 = require_required();
11961
+ var limitItems_1 = require_limitItems();
11962
+ var uniqueItems_1 = require_uniqueItems();
11963
+ var const_1 = require_const();
11964
+ var enum_1 = require_enum();
11965
+ var validation = [
11966
+ // number
11967
+ limitNumber_1.default,
11968
+ limitNumberExclusive_1.default,
11969
+ multipleOf_1.default,
11970
+ // string
11971
+ limitLength_1.default,
11972
+ pattern_1.default,
11973
+ // object
11974
+ limitProperties_1.default,
11975
+ required_1.default,
11976
+ // array
11977
+ limitItems_1.default,
11978
+ uniqueItems_1.default,
11979
+ // any
11980
+ { keyword: "type", schemaType: ["string", "array"] },
11981
+ { keyword: "nullable", schemaType: "boolean" },
11982
+ const_1.default,
11983
+ enum_1.default
11984
+ ];
11985
+ exports2.default = validation;
11986
+ }
11987
+ });
11988
+
11989
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/draft4.js
11990
+ var require_draft4 = __commonJS({
11991
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/vocabulary/draft4.js"(exports2) {
11992
+ "use strict";
11993
+ Object.defineProperty(exports2, "__esModule", { value: true });
11994
+ var core_1 = require_core4();
11995
+ var validation_1 = require_validation3();
11996
+ var applicator_1 = require_applicator();
11997
+ var format_1 = require_format2();
11998
+ var metadataVocabulary = ["title", "description", "default"];
11999
+ var draft4Vocabularies = [
12000
+ core_1.default,
12001
+ validation_1.default,
12002
+ applicator_1.default(),
12003
+ format_1.default,
12004
+ metadataVocabulary
12005
+ ];
12006
+ exports2.default = draft4Vocabularies;
12007
+ }
12008
+ });
12009
+
12010
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json
12011
+ var require_json_schema_draft_04 = __commonJS({
12012
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json"(exports2, module2) {
12013
+ module2.exports = {
12014
+ id: "http://json-schema.org/draft-04/schema#",
12015
+ $schema: "http://json-schema.org/draft-04/schema#",
12016
+ description: "Core schema meta-schema",
12017
+ definitions: {
12018
+ schemaArray: {
12019
+ type: "array",
12020
+ minItems: 1,
12021
+ items: { $ref: "#" }
12022
+ },
12023
+ positiveInteger: {
12024
+ type: "integer",
12025
+ minimum: 0
12026
+ },
12027
+ positiveIntegerDefault0: {
12028
+ allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]
12029
+ },
12030
+ simpleTypes: {
12031
+ enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
12032
+ },
12033
+ stringArray: {
12034
+ type: "array",
12035
+ items: { type: "string" },
12036
+ minItems: 1,
12037
+ uniqueItems: true
12038
+ }
12039
+ },
12040
+ type: "object",
12041
+ properties: {
12042
+ id: {
12043
+ type: "string",
12044
+ format: "uri"
12045
+ },
12046
+ $schema: {
12047
+ type: "string",
12048
+ format: "uri"
12049
+ },
12050
+ title: {
12051
+ type: "string"
12052
+ },
12053
+ description: {
12054
+ type: "string"
12055
+ },
12056
+ default: {},
12057
+ multipleOf: {
12058
+ type: "number",
12059
+ minimum: 0,
12060
+ exclusiveMinimum: true
12061
+ },
12062
+ maximum: {
12063
+ type: "number"
12064
+ },
12065
+ exclusiveMaximum: {
12066
+ type: "boolean",
12067
+ default: false
12068
+ },
12069
+ minimum: {
12070
+ type: "number"
12071
+ },
12072
+ exclusiveMinimum: {
12073
+ type: "boolean",
12074
+ default: false
12075
+ },
12076
+ maxLength: { $ref: "#/definitions/positiveInteger" },
12077
+ minLength: { $ref: "#/definitions/positiveIntegerDefault0" },
12078
+ pattern: {
12079
+ type: "string",
12080
+ format: "regex"
12081
+ },
12082
+ additionalItems: {
12083
+ anyOf: [{ type: "boolean" }, { $ref: "#" }],
12084
+ default: {}
12085
+ },
12086
+ items: {
12087
+ anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
12088
+ default: {}
12089
+ },
12090
+ maxItems: { $ref: "#/definitions/positiveInteger" },
12091
+ minItems: { $ref: "#/definitions/positiveIntegerDefault0" },
12092
+ uniqueItems: {
12093
+ type: "boolean",
12094
+ default: false
12406
12095
  },
12407
- "oauth-flows": {
12096
+ maxProperties: { $ref: "#/definitions/positiveInteger" },
12097
+ minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },
12098
+ required: { $ref: "#/definitions/stringArray" },
12099
+ additionalProperties: {
12100
+ anyOf: [{ type: "boolean" }, { $ref: "#" }],
12101
+ default: {}
12102
+ },
12103
+ definitions: {
12408
12104
  type: "object",
12409
- properties: {
12410
- implicit: {
12411
- $ref: "#/$defs/oauth-flows/$defs/implicit"
12412
- },
12413
- password: {
12414
- $ref: "#/$defs/oauth-flows/$defs/password"
12415
- },
12416
- clientCredentials: {
12417
- $ref: "#/$defs/oauth-flows/$defs/client-credentials"
12418
- },
12419
- authorizationCode: {
12420
- $ref: "#/$defs/oauth-flows/$defs/authorization-code"
12421
- }
12422
- },
12423
- $ref: "#/$defs/specification-extensions",
12424
- unevaluatedProperties: false,
12425
- $defs: {
12426
- implicit: {
12427
- type: "object",
12428
- properties: {
12429
- authorizationUrl: {
12430
- type: "string"
12431
- },
12432
- refreshUrl: {
12433
- type: "string"
12434
- },
12435
- scopes: {
12436
- $ref: "#/$defs/map-of-strings"
12437
- }
12438
- },
12439
- required: [
12440
- "authorizationUrl",
12441
- "scopes"
12442
- ],
12443
- $ref: "#/$defs/specification-extensions",
12444
- unevaluatedProperties: false
12445
- },
12446
- password: {
12447
- type: "object",
12448
- properties: {
12449
- tokenUrl: {
12450
- type: "string"
12451
- },
12452
- refreshUrl: {
12453
- type: "string"
12454
- },
12455
- scopes: {
12456
- $ref: "#/$defs/map-of-strings"
12457
- }
12458
- },
12459
- required: [
12460
- "tokenUrl",
12461
- "scopes"
12462
- ],
12463
- $ref: "#/$defs/specification-extensions",
12464
- unevaluatedProperties: false
12465
- },
12466
- "client-credentials": {
12467
- type: "object",
12468
- properties: {
12469
- tokenUrl: {
12470
- type: "string"
12471
- },
12472
- refreshUrl: {
12473
- type: "string"
12474
- },
12475
- scopes: {
12476
- $ref: "#/$defs/map-of-strings"
12477
- }
12478
- },
12479
- required: [
12480
- "tokenUrl",
12481
- "scopes"
12482
- ],
12483
- $ref: "#/$defs/specification-extensions",
12484
- unevaluatedProperties: false
12485
- },
12486
- "authorization-code": {
12487
- type: "object",
12488
- properties: {
12489
- authorizationUrl: {
12490
- type: "string"
12491
- },
12492
- tokenUrl: {
12493
- type: "string"
12494
- },
12495
- refreshUrl: {
12496
- type: "string"
12497
- },
12498
- scopes: {
12499
- $ref: "#/$defs/map-of-strings"
12500
- }
12501
- },
12502
- required: [
12503
- "authorizationUrl",
12504
- "tokenUrl",
12505
- "scopes"
12506
- ],
12507
- $ref: "#/$defs/specification-extensions",
12508
- unevaluatedProperties: false
12509
- }
12510
- }
12105
+ additionalProperties: { $ref: "#" },
12106
+ default: {}
12511
12107
  },
12512
- "security-requirement": {
12108
+ properties: {
12109
+ type: "object",
12110
+ additionalProperties: { $ref: "#" },
12111
+ default: {}
12112
+ },
12113
+ patternProperties: {
12114
+ type: "object",
12115
+ additionalProperties: { $ref: "#" },
12116
+ default: {}
12117
+ },
12118
+ dependencies: {
12513
12119
  type: "object",
12514
12120
  additionalProperties: {
12515
- type: "array",
12516
- items: {
12517
- type: "string"
12518
- }
12121
+ anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }]
12519
12122
  }
12520
12123
  },
12521
- "specification-extensions": {
12522
- patternProperties: {
12523
- "^x-": true
12524
- }
12124
+ enum: {
12125
+ type: "array",
12126
+ minItems: 1,
12127
+ uniqueItems: true
12525
12128
  },
12526
- examples: {
12527
- properties: {
12528
- example: true,
12529
- examples: {
12530
- type: "object",
12531
- additionalProperties: {
12532
- $ref: "#/$defs/example-or-reference"
12533
- }
12129
+ type: {
12130
+ anyOf: [
12131
+ { $ref: "#/definitions/simpleTypes" },
12132
+ {
12133
+ type: "array",
12134
+ items: { $ref: "#/definitions/simpleTypes" },
12135
+ minItems: 1,
12136
+ uniqueItems: true
12534
12137
  }
12535
- }
12536
- },
12537
- uri: {
12538
- type: "string",
12539
- format: "uri"
12138
+ ]
12540
12139
  },
12541
- "map-of-strings": {
12542
- type: "object",
12543
- additionalProperties: {
12544
- type: "string"
12545
- }
12546
- }
12547
- }
12140
+ allOf: { $ref: "#/definitions/schemaArray" },
12141
+ anyOf: { $ref: "#/definitions/schemaArray" },
12142
+ oneOf: { $ref: "#/definitions/schemaArray" },
12143
+ not: { $ref: "#" }
12144
+ },
12145
+ dependencies: {
12146
+ exclusiveMaximum: ["maximum"],
12147
+ exclusiveMinimum: ["minimum"]
12148
+ },
12149
+ default: {}
12548
12150
  };
12549
12151
  }
12550
12152
  });
12551
12153
 
12552
- // ../../node_modules/.pnpm/@apidevtools+openapi-schemas@2.1.0/node_modules/@apidevtools/openapi-schemas/lib/index.js
12553
- var require_lib = __commonJS({
12554
- "../../node_modules/.pnpm/@apidevtools+openapi-schemas@2.1.0/node_modules/@apidevtools/openapi-schemas/lib/index.js"(exports2, module2) {
12154
+ // ../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/index.js
12155
+ var require_dist = __commonJS({
12156
+ "../../node_modules/.pnpm/ajv-draft-04@1.0.0_ajv@8.20.0/node_modules/ajv-draft-04/dist/index.js"(exports2, module2) {
12555
12157
  "use strict";
12556
12158
  Object.defineProperty(exports2, "__esModule", { value: true });
12557
- exports2.openapi = exports2.openapiV31 = exports2.openapiV3 = exports2.openapiV2 = exports2.openapiV1 = void 0;
12558
- exports2.openapiV1 = require_apiDeclaration();
12559
- exports2.openapiV2 = require_schema2();
12560
- exports2.openapiV3 = require_schema3();
12561
- exports2.openapiV31 = require_schema4();
12562
- exports2.openapi = {
12563
- v1: exports2.openapiV1,
12564
- v2: exports2.openapiV2,
12565
- v3: exports2.openapiV3,
12566
- v31: exports2.openapiV31
12159
+ exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0;
12160
+ var core_1 = require_core();
12161
+ var draft4_1 = require_draft4();
12162
+ var discriminator_1 = require_discriminator();
12163
+ var draft4MetaSchema = require_json_schema_draft_04();
12164
+ var META_SUPPORT_DATA = ["/properties"];
12165
+ var META_SCHEMA_ID = "http://json-schema.org/draft-04/schema";
12166
+ var Ajv = class extends core_1.default {
12167
+ constructor(opts = {}) {
12168
+ super({
12169
+ ...opts,
12170
+ schemaId: "id"
12171
+ });
12172
+ }
12173
+ _addVocabularies() {
12174
+ super._addVocabularies();
12175
+ draft4_1.default.forEach((v) => this.addVocabulary(v));
12176
+ if (this.opts.discriminator)
12177
+ this.addKeyword(discriminator_1.default);
12178
+ }
12179
+ _addDefaultMetaSchema() {
12180
+ super._addDefaultMetaSchema();
12181
+ if (!this.opts.meta)
12182
+ return;
12183
+ const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft4MetaSchema, META_SUPPORT_DATA) : draft4MetaSchema;
12184
+ this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
12185
+ this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
12186
+ }
12187
+ defaultMeta() {
12188
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
12189
+ }
12567
12190
  };
12568
- exports2.default = exports2.openapi;
12569
- if (typeof module2 === "object" && typeof module2.exports === "object") {
12570
- module2.exports = Object.assign(module2.exports.default, module2.exports);
12571
- }
12191
+ module2.exports = exports2 = Ajv;
12192
+ Object.defineProperty(exports2, "__esModule", { value: true });
12193
+ exports2.default = Ajv;
12194
+ var core_2 = require_core();
12195
+ Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() {
12196
+ return core_2.KeywordCxt;
12197
+ } });
12198
+ var core_3 = require_core();
12199
+ Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
12200
+ return core_3._;
12201
+ } });
12202
+ Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
12203
+ return core_3.str;
12204
+ } });
12205
+ Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
12206
+ return core_3.stringify;
12207
+ } });
12208
+ Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
12209
+ return core_3.nil;
12210
+ } });
12211
+ Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
12212
+ return core_3.Name;
12213
+ } });
12214
+ Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() {
12215
+ return core_3.CodeGen;
12216
+ } });
12572
12217
  }
12573
12218
  });
12574
12219
 
12575
- // ../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/schema.js
12220
+ // ../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/schema.js
12576
12221
  var require_schema5 = __commonJS({
12577
- "../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/schema.js"(exports2, module2) {
12222
+ "../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/schema.js"(exports2, module2) {
12578
12223
  "use strict";
12579
12224
  var util = require_util();
12580
- var { ono } = require_cjs();
12581
- var AjvDraft4 = require_dist();
12582
12225
  var Ajv = require__();
12583
12226
  var { openapi } = require_lib();
12584
12227
  module2.exports = validateSchema;
@@ -12607,7 +12250,9 @@ var require_schema5 = __commonJS({
12607
12250
  if (!isValid) {
12608
12251
  let err = ajv.errors;
12609
12252
  let message = "Swagger schema validation failed.\n" + formatAjvError(err);
12610
- throw ono.syntax(err, { details: err }, message);
12253
+ const error = new SyntaxError(message);
12254
+ error.details = err;
12255
+ throw error;
12611
12256
  }
12612
12257
  }
12613
12258
  function initializeAjv(draft04 = true) {
@@ -12617,6 +12262,7 @@ var require_schema5 = __commonJS({
12617
12262
  validateFormats: false
12618
12263
  };
12619
12264
  if (draft04) {
12265
+ const AjvDraft4 = require_dist();
12620
12266
  return new AjvDraft4(opts);
12621
12267
  }
12622
12268
  return new Ajv(opts);
@@ -12649,12 +12295,11 @@ var require_lib2 = __commonJS({
12649
12295
  }
12650
12296
  });
12651
12297
 
12652
- // ../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/spec.js
12298
+ // ../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/spec.js
12653
12299
  var require_spec = __commonJS({
12654
- "../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/spec.js"(exports2, module2) {
12300
+ "../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/validators/spec.js"(exports2, module2) {
12655
12301
  "use strict";
12656
12302
  var util = require_util();
12657
- var { ono } = require_cjs();
12658
12303
  var swaggerMethods = require_lib2();
12659
12304
  var primitiveTypes = ["array", "boolean", "integer", "number", "string"];
12660
12305
  var schemaTypes = ["array", "boolean", "integer", "number", "string", "object", "null", void 0];
@@ -12689,7 +12334,7 @@ var require_spec = __commonJS({
12689
12334
  if (operationIds.indexOf(declaredOperationId) === -1) {
12690
12335
  operationIds.push(declaredOperationId);
12691
12336
  } else {
12692
- throw ono.syntax(`Validation failed. Duplicate operation id '${declaredOperationId}'`);
12337
+ throw new SyntaxError(`Validation failed. Duplicate operation id '${declaredOperationId}'`);
12693
12338
  }
12694
12339
  }
12695
12340
  validateParameters(api, path, pathId, operation, operationId);
@@ -12708,12 +12353,12 @@ var require_spec = __commonJS({
12708
12353
  try {
12709
12354
  checkForDuplicates(pathParams);
12710
12355
  } catch (e) {
12711
- throw ono.syntax(e, `Validation failed. ${pathId} has duplicate parameters`);
12356
+ throw new SyntaxError(e, `Validation failed. ${pathId} has duplicate parameters`);
12712
12357
  }
12713
12358
  try {
12714
12359
  checkForDuplicates(operationParams);
12715
12360
  } catch (e) {
12716
- throw ono.syntax(e, `Validation failed. ${operationId} has duplicate parameters`);
12361
+ throw new SyntaxError(e, `Validation failed. ${operationId} has duplicate parameters`);
12717
12362
  }
12718
12363
  let params = pathParams.reduce((combinedParams, value) => {
12719
12364
  let duplicate = combinedParams.some((param) => {
@@ -12736,11 +12381,11 @@ var require_spec = __commonJS({
12736
12381
  return param.in === "formData";
12737
12382
  });
12738
12383
  if (bodyParams.length > 1) {
12739
- throw ono.syntax(
12384
+ throw new SyntaxError(
12740
12385
  `Validation failed. ${operationId} has ${bodyParams.length} body parameters. Only one is allowed.`
12741
12386
  );
12742
12387
  } else if (bodyParams.length > 0 && formParams.length > 0) {
12743
- throw ono.syntax(
12388
+ throw new SyntaxError(
12744
12389
  `Validation failed. ${operationId} has body parameters and formData parameters. Only one or the other is allowed.`
12745
12390
  );
12746
12391
  }
@@ -12750,7 +12395,7 @@ var require_spec = __commonJS({
12750
12395
  for (let i = 0; i < placeholders.length; i++) {
12751
12396
  for (let j = i + 1; j < placeholders.length; j++) {
12752
12397
  if (placeholders[i] === placeholders[j]) {
12753
- throw ono.syntax(
12398
+ throw new SyntaxError(
12754
12399
  `Validation failed. ${operationId} has multiple path placeholders named ${placeholders[i]}`
12755
12400
  );
12756
12401
  }
@@ -12761,20 +12406,20 @@ var require_spec = __commonJS({
12761
12406
  });
12762
12407
  for (let param of params) {
12763
12408
  if (param.required !== true) {
12764
- throw ono.syntax(
12409
+ throw new SyntaxError(
12765
12410
  `Validation failed. Path parameters cannot be optional. Set required=true for the "${param.name}" parameter at ${operationId}`
12766
12411
  );
12767
12412
  }
12768
12413
  let match = placeholders.indexOf("{" + param.name + "}");
12769
12414
  if (match === -1) {
12770
- throw ono.syntax(
12415
+ throw new SyntaxError(
12771
12416
  `Validation failed. ${operationId} has a path parameter named "${param.name}", but there is no corresponding {${param.name}} in the path string`
12772
12417
  );
12773
12418
  }
12774
12419
  placeholders.splice(match, 1);
12775
12420
  }
12776
12421
  if (placeholders.length > 0) {
12777
- throw ono.syntax(`Validation failed. ${operationId} is missing path parameter(s) for ${placeholders}`);
12422
+ throw new SyntaxError(`Validation failed. ${operationId} is missing path parameter(s) for ${placeholders}`);
12778
12423
  }
12779
12424
  }
12780
12425
  function validateParameterTypes(params, api, operation, operationId) {
@@ -12804,7 +12449,7 @@ var require_spec = __commonJS({
12804
12449
  return formData.test(consume) || urlEncoded.test(consume);
12805
12450
  });
12806
12451
  if (!hasValidMimeType) {
12807
- throw ono.syntax(
12452
+ throw new SyntaxError(
12808
12453
  `Validation failed. ${operationId} has a file parameter, so it must consume multipart/form-data or application/x-www-form-urlencoded`
12809
12454
  );
12810
12455
  }
@@ -12817,14 +12462,14 @@ var require_spec = __commonJS({
12817
12462
  for (let j = i + 1; j < params.length; j++) {
12818
12463
  let inner = params[j];
12819
12464
  if (outer.name === inner.name && outer.in === inner.in) {
12820
- throw ono.syntax(`Validation failed. Found multiple ${outer.in} parameters named "${outer.name}"`);
12465
+ throw new SyntaxError(`Validation failed. Found multiple ${outer.in} parameters named "${outer.name}"`);
12821
12466
  }
12822
12467
  }
12823
12468
  }
12824
12469
  }
12825
12470
  function validateResponse(code, response, responseId) {
12826
12471
  if (code !== "default" && (code < 100 || code > 599)) {
12827
- throw ono.syntax(`Validation failed. ${responseId} has an invalid response code (${code})`);
12472
+ throw new SyntaxError(`Validation failed. ${responseId} has an invalid response code (${code})`);
12828
12473
  }
12829
12474
  let headers = Object.keys(response.headers || {});
12830
12475
  for (let headerName of headers) {
@@ -12835,7 +12480,7 @@ var require_spec = __commonJS({
12835
12480
  if (response.schema) {
12836
12481
  let validTypes = schemaTypes.concat("file");
12837
12482
  if (validTypes.indexOf(response.schema.type) === -1) {
12838
- throw ono.syntax(
12483
+ throw new SyntaxError(
12839
12484
  `Validation failed. ${responseId} has an invalid response schema type (${response.schema.type})`
12840
12485
  );
12841
12486
  } else {
@@ -12845,12 +12490,10 @@ var require_spec = __commonJS({
12845
12490
  }
12846
12491
  function validateSchema(schema, schemaId, validTypes) {
12847
12492
  if (validTypes.indexOf(schema.type) === -1) {
12848
- throw ono.syntax(
12849
- `Validation failed. ${schemaId} has an invalid type (${schema.type})`
12850
- );
12493
+ throw new SyntaxError(`Validation failed. ${schemaId} has an invalid type (${schema.type})`);
12851
12494
  }
12852
12495
  if (schema.type === "array" && !schema.items) {
12853
- throw ono.syntax(`Validation failed. ${schemaId} is an array, so it must include an "items" schema`);
12496
+ throw new SyntaxError(`Validation failed. ${schemaId} is an array, so it must include an "items" schema`);
12854
12497
  }
12855
12498
  }
12856
12499
  function validateRequiredPropertiesExist(schema, schemaId) {
@@ -12878,7 +12521,7 @@ var require_spec = __commonJS({
12878
12521
  collectProperties(schema, props);
12879
12522
  for (let requiredProperty of schema.required) {
12880
12523
  if (!props[requiredProperty]) {
12881
- throw ono.syntax(
12524
+ throw new SyntaxError(
12882
12525
  `Validation failed. Property '${requiredProperty}' listed as required but does not exist in '${schemaId}'`
12883
12526
  );
12884
12527
  }
@@ -12888,9 +12531,9 @@ var require_spec = __commonJS({
12888
12531
  }
12889
12532
  });
12890
12533
 
12891
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js
12534
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js
12892
12535
  var require_convert_path_to_posix = __commonJS({
12893
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js"(exports2) {
12536
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js"(exports2) {
12894
12537
  "use strict";
12895
12538
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
12896
12539
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -12908,9 +12551,9 @@ var require_convert_path_to_posix = __commonJS({
12908
12551
  }
12909
12552
  });
12910
12553
 
12911
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js
12554
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js
12912
12555
  var require_is_windows = __commonJS({
12913
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js"(exports2) {
12556
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js"(exports2) {
12914
12557
  "use strict";
12915
12558
  Object.defineProperty(exports2, "__esModule", { value: true });
12916
12559
  exports2.isWindows = void 0;
@@ -12920,9 +12563,9 @@ var require_is_windows = __commonJS({
12920
12563
  }
12921
12564
  });
12922
12565
 
12923
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js
12566
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js
12924
12567
  var require_url = __commonJS({
12925
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js"(exports2) {
12568
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js"(exports2) {
12926
12569
  "use strict";
12927
12570
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
12928
12571
  if (k2 === void 0) k2 = k;
@@ -12942,15 +12585,25 @@ var require_url = __commonJS({
12942
12585
  }) : function(o, v) {
12943
12586
  o["default"] = v;
12944
12587
  });
12945
- var __importStar = exports2 && exports2.__importStar || function(mod) {
12946
- if (mod && mod.__esModule) return mod;
12947
- var result = {};
12948
- if (mod != null) {
12949
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12950
- }
12951
- __setModuleDefault(result, mod);
12952
- return result;
12953
- };
12588
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
12589
+ var ownKeys = function(o) {
12590
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
12591
+ var ar = [];
12592
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
12593
+ return ar;
12594
+ };
12595
+ return ownKeys(o);
12596
+ };
12597
+ return function(mod) {
12598
+ if (mod && mod.__esModule) return mod;
12599
+ var result = {};
12600
+ if (mod != null) {
12601
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
12602
+ }
12603
+ __setModuleDefault(result, mod);
12604
+ return result;
12605
+ };
12606
+ })();
12954
12607
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
12955
12608
  return mod && mod.__esModule ? mod : { "default": mod };
12956
12609
  };
@@ -12964,6 +12617,7 @@ var require_url = __commonJS({
12964
12617
  exports2.getHash = getHash;
12965
12618
  exports2.stripHash = stripHash;
12966
12619
  exports2.isHttp = isHttp;
12620
+ exports2.isUnsafeUrl = isUnsafeUrl;
12967
12621
  exports2.isFileSystemPath = isFileSystemPath;
12968
12622
  exports2.fromFileSystemPath = fromFileSystemPath;
12969
12623
  exports2.toFileSystemPath = toFileSystemPath;
@@ -12985,26 +12639,38 @@ var require_url = __commonJS({
12985
12639
  var parse = (u) => new URL(u);
12986
12640
  exports2.parse = parse;
12987
12641
  function resolve4(from, to) {
12988
- const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "resolve://");
12642
+ const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
12989
12643
  const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to), fromUrl);
12990
12644
  const endSpaces = to.match(/(\s*)$/)?.[1] || "";
12991
- if (resolvedUrl.protocol === "resolve:") {
12645
+ if (resolvedUrl.hostname === "aaa.nonexistanturl.com") {
12992
12646
  const { pathname, search, hash } = resolvedUrl;
12993
12647
  return pathname + search + hash + endSpaces;
12994
12648
  }
12995
12649
  return resolvedUrl.toString() + endSpaces;
12996
12650
  }
12997
12651
  function cwd() {
12998
- if (typeof window !== "undefined") {
12999
- return location.href;
12652
+ if (typeof window !== "undefined" && window.location && window.location.href) {
12653
+ const href = window.location.href;
12654
+ if (!href || !href.startsWith("http")) {
12655
+ try {
12656
+ new URL(href);
12657
+ return href;
12658
+ } catch {
12659
+ return "/";
12660
+ }
12661
+ }
12662
+ return href;
13000
12663
  }
13001
- const path = process.cwd();
13002
- const lastChar = path.slice(-1);
13003
- if (lastChar === "/" || lastChar === "\\") {
13004
- return path;
13005
- } else {
13006
- return path + "/";
12664
+ if (typeof process !== "undefined" && process.cwd) {
12665
+ const path = process.cwd();
12666
+ const lastChar = path.slice(-1);
12667
+ if (lastChar === "/" || lastChar === "\\") {
12668
+ return path;
12669
+ } else {
12670
+ return path + "/";
12671
+ }
13007
12672
  }
12673
+ return "/";
13008
12674
  }
13009
12675
  function getProtocol(path) {
13010
12676
  const match = protocolPattern.exec(path || "");
@@ -13057,6 +12723,141 @@ var require_url = __commonJS({
13057
12723
  return false;
13058
12724
  }
13059
12725
  }
12726
+ function isUnsafeUrl(path) {
12727
+ if (!path || typeof path !== "string") {
12728
+ return true;
12729
+ }
12730
+ const normalizedPath = path.trim().toLowerCase();
12731
+ if (!normalizedPath) {
12732
+ return true;
12733
+ }
12734
+ if (normalizedPath.startsWith("javascript:") || normalizedPath.startsWith("vbscript:") || normalizedPath.startsWith("data:")) {
12735
+ return true;
12736
+ }
12737
+ if (normalizedPath.startsWith("file:")) {
12738
+ return true;
12739
+ }
12740
+ if (typeof window !== "undefined" && window.location && window.location.href) {
12741
+ return false;
12742
+ }
12743
+ const localPatterns = [
12744
+ // Localhost variations
12745
+ "localhost",
12746
+ "127.0.0.1",
12747
+ "::1",
12748
+ // Private IP ranges (RFC 1918)
12749
+ "10.",
12750
+ "172.16.",
12751
+ "172.17.",
12752
+ "172.18.",
12753
+ "172.19.",
12754
+ "172.20.",
12755
+ "172.21.",
12756
+ "172.22.",
12757
+ "172.23.",
12758
+ "172.24.",
12759
+ "172.25.",
12760
+ "172.26.",
12761
+ "172.27.",
12762
+ "172.28.",
12763
+ "172.29.",
12764
+ "172.30.",
12765
+ "172.31.",
12766
+ "192.168.",
12767
+ // Link-local addresses
12768
+ "169.254.",
12769
+ // Internal domains
12770
+ ".local",
12771
+ ".internal",
12772
+ ".intranet",
12773
+ ".corp",
12774
+ ".home",
12775
+ ".lan"
12776
+ ];
12777
+ try {
12778
+ const url = new URL(normalizedPath.startsWith("//") ? "http:" + normalizedPath : normalizedPath);
12779
+ const hostname = url.hostname.toLowerCase();
12780
+ for (const pattern of localPatterns) {
12781
+ if (hostname === pattern || hostname.startsWith(pattern) || hostname.endsWith(pattern)) {
12782
+ return true;
12783
+ }
12784
+ }
12785
+ if (isPrivateIP(hostname)) {
12786
+ return true;
12787
+ }
12788
+ const port = url.port;
12789
+ if (port && isInternalPort(parseInt(port))) {
12790
+ return true;
12791
+ }
12792
+ } catch (e) {
12793
+ if (normalizedPath.startsWith("/") && !normalizedPath.startsWith("//")) {
12794
+ return false;
12795
+ }
12796
+ for (const pattern of localPatterns) {
12797
+ if (normalizedPath.includes(pattern)) {
12798
+ return true;
12799
+ }
12800
+ }
12801
+ }
12802
+ return false;
12803
+ }
12804
+ function isPrivateIP(ip) {
12805
+ const ipRegex = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
12806
+ const match = ip.match(ipRegex);
12807
+ if (!match) {
12808
+ return false;
12809
+ }
12810
+ const [, a, b, c, d] = match.map(Number);
12811
+ if (a > 255 || b > 255 || c > 255 || d > 255) {
12812
+ return false;
12813
+ }
12814
+ return a === 10 || a === 127 || a === 172 && b >= 16 && b <= 31 || a === 192 && b === 168 || a === 169 && b === 254;
12815
+ }
12816
+ function isInternalPort(port) {
12817
+ const internalPorts = [
12818
+ 22,
12819
+ // SSH
12820
+ 23,
12821
+ // Telnet
12822
+ 25,
12823
+ // SMTP
12824
+ 53,
12825
+ // DNS
12826
+ 135,
12827
+ // RPC
12828
+ 139,
12829
+ // NetBIOS
12830
+ 445,
12831
+ // SMB
12832
+ 993,
12833
+ // IMAPS
12834
+ 995,
12835
+ // POP3S
12836
+ 1433,
12837
+ // SQL Server
12838
+ 1521,
12839
+ // Oracle
12840
+ 3306,
12841
+ // MySQL
12842
+ 3389,
12843
+ // RDP
12844
+ 5432,
12845
+ // PostgreSQL
12846
+ 5900,
12847
+ // VNC
12848
+ 6379,
12849
+ // Redis
12850
+ 8080,
12851
+ // Common internal web
12852
+ 8443,
12853
+ // Common internal HTTPS
12854
+ 9200,
12855
+ // Elasticsearch
12856
+ 27017
12857
+ // MongoDB
12858
+ ];
12859
+ return internalPorts.includes(port);
12860
+ }
13060
12861
  function isFileSystemPath(path) {
13061
12862
  if (typeof window !== "undefined" || typeof process !== "undefined" && process.browser) {
13062
12863
  return false;
@@ -13130,25 +12931,55 @@ var require_url = __commonJS({
13130
12931
  }
13131
12932
  });
13132
12933
 
13133
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js
12934
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js
13134
12935
  var require_errors2 = __commonJS({
13135
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js"(exports2) {
12936
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js"(exports2) {
13136
12937
  "use strict";
13137
12938
  Object.defineProperty(exports2, "__esModule", { value: true });
13138
12939
  exports2.InvalidPointerError = exports2.TimeoutError = exports2.MissingPointerError = exports2.UnmatchedResolverError = exports2.ResolverError = exports2.UnmatchedParserError = exports2.ParserError = exports2.JSONParserErrorGroup = exports2.JSONParserError = void 0;
12940
+ exports2.toJSON = toJSON;
12941
+ exports2.getDeepKeys = getDeepKeys;
13139
12942
  exports2.isHandledError = isHandledError;
13140
12943
  exports2.normalizeError = normalizeError;
13141
- var ono_1 = require_cjs();
13142
12944
  var url_js_1 = require_url();
12945
+ var nonJsonTypes = ["function", "symbol", "undefined"];
12946
+ var protectedProps = ["constructor", "prototype", "__proto__"];
12947
+ var objectPrototype = Object.getPrototypeOf({});
12948
+ function toJSON() {
12949
+ const pojo = {};
12950
+ const error = this;
12951
+ for (const key of getDeepKeys(error)) {
12952
+ if (typeof key === "string") {
12953
+ const value = error[key];
12954
+ const type = typeof value;
12955
+ if (!nonJsonTypes.includes(type)) {
12956
+ pojo[key] = value;
12957
+ }
12958
+ }
12959
+ }
12960
+ return pojo;
12961
+ }
12962
+ function getDeepKeys(obj, omit = []) {
12963
+ let keys = [];
12964
+ while (obj && obj !== objectPrototype) {
12965
+ keys = keys.concat(Object.getOwnPropertyNames(obj), Object.getOwnPropertySymbols(obj));
12966
+ obj = Object.getPrototypeOf(obj);
12967
+ }
12968
+ const uniqueKeys = new Set(keys);
12969
+ for (const key of omit.concat(protectedProps)) {
12970
+ uniqueKeys.delete(key);
12971
+ }
12972
+ return uniqueKeys;
12973
+ }
13143
12974
  var JSONParserError = class extends Error {
13144
12975
  constructor(message, source) {
13145
12976
  super();
12977
+ this.toJSON = toJSON.bind(this);
13146
12978
  this.code = "EUNKNOWN";
13147
12979
  this.name = "JSONParserError";
13148
12980
  this.message = message;
13149
12981
  this.source = source;
13150
12982
  this.path = null;
13151
- ono_1.Ono.extend(this);
13152
12983
  }
13153
12984
  get footprint() {
13154
12985
  return `${this.path}+${this.source}+${this.code}+${this.message}`;
@@ -13158,10 +12989,10 @@ var require_errors2 = __commonJS({
13158
12989
  var JSONParserErrorGroup = class _JSONParserErrorGroup extends Error {
13159
12990
  constructor(parser) {
13160
12991
  super();
12992
+ this.toJSON = toJSON.bind(this);
13161
12993
  this.files = parser;
13162
12994
  this.name = "JSONParserErrorGroup";
13163
12995
  this.message = `${this.errors.length} error${this.errors.length > 1 ? "s" : ""} occurred while reading '${(0, url_js_1.toFileSystemPath)(parser.$refs._root$Ref.path)}'`;
13164
- ono_1.Ono.extend(this);
13165
12996
  }
13166
12997
  static getParserErrors(parser) {
13167
12998
  const errors = [];
@@ -13213,10 +13044,14 @@ var require_errors2 = __commonJS({
13213
13044
  };
13214
13045
  exports2.UnmatchedResolverError = UnmatchedResolverError;
13215
13046
  var MissingPointerError = class extends JSONParserError {
13216
- constructor(token, path) {
13217
- super(`Token "${token}" does not exist.`, (0, url_js_1.stripHash)(path));
13218
- this.code = "EUNMATCHEDRESOLVER";
13047
+ constructor(token, path, targetRef, targetFound, parentPath) {
13048
+ super(`Missing $ref pointer "${(0, url_js_1.getHash)(path)}". Token "${token}" does not exist.`, (0, url_js_1.stripHash)(path));
13049
+ this.code = "EMISSINGPOINTER";
13219
13050
  this.name = "MissingPointerError";
13051
+ this.targetToken = token;
13052
+ this.targetRef = targetRef;
13053
+ this.targetFound = targetFound;
13054
+ this.parentPath = parentPath;
13220
13055
  }
13221
13056
  };
13222
13057
  exports2.MissingPointerError = MissingPointerError;
@@ -13248,9 +13083,9 @@ var require_errors2 = __commonJS({
13248
13083
  }
13249
13084
  });
13250
13085
 
13251
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js
13086
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js
13252
13087
  var require_pointer = __commonJS({
13253
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js"(exports2) {
13088
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js"(exports2) {
13254
13089
  "use strict";
13255
13090
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
13256
13091
  if (k2 === void 0) k2 = k;
@@ -13270,22 +13105,34 @@ var require_pointer = __commonJS({
13270
13105
  }) : function(o, v) {
13271
13106
  o["default"] = v;
13272
13107
  });
13273
- var __importStar = exports2 && exports2.__importStar || function(mod) {
13274
- if (mod && mod.__esModule) return mod;
13275
- var result = {};
13276
- if (mod != null) {
13277
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13278
- }
13279
- __setModuleDefault(result, mod);
13280
- return result;
13281
- };
13108
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
13109
+ var ownKeys = function(o) {
13110
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
13111
+ var ar = [];
13112
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
13113
+ return ar;
13114
+ };
13115
+ return ownKeys(o);
13116
+ };
13117
+ return function(mod) {
13118
+ if (mod && mod.__esModule) return mod;
13119
+ var result = {};
13120
+ if (mod != null) {
13121
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
13122
+ }
13123
+ __setModuleDefault(result, mod);
13124
+ return result;
13125
+ };
13126
+ })();
13282
13127
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
13283
13128
  return mod && mod.__esModule ? mod : { "default": mod };
13284
13129
  };
13285
13130
  Object.defineProperty(exports2, "__esModule", { value: true });
13131
+ exports2.nullSymbol = void 0;
13286
13132
  var ref_js_1 = __importDefault(require_ref2());
13287
13133
  var url = __importStar(require_url());
13288
13134
  var errors_js_1 = require_errors2();
13135
+ exports2.nullSymbol = /* @__PURE__ */ Symbol("null");
13289
13136
  var slashes = /\//g;
13290
13137
  var tildes = /~/g;
13291
13138
  var escapedSlash = /~1/g;
@@ -13321,14 +13168,12 @@ var require_pointer = __commonJS({
13321
13168
  */
13322
13169
  resolve(obj, options, pathFromRoot) {
13323
13170
  const tokens = _Pointer.parse(this.path, this.originalPath);
13171
+ const found = [];
13324
13172
  this.value = unwrapOrThrow(obj);
13325
13173
  for (let i = 0; i < tokens.length; i++) {
13326
13174
  if (resolveIf$Ref(this, options, pathFromRoot)) {
13327
13175
  this.path = _Pointer.join(this.path, tokens.slice(i));
13328
13176
  }
13329
- if (typeof this.value === "object" && this.value !== null && !isRootPath(pathFromRoot) && "$ref" in this.value) {
13330
- return this;
13331
- }
13332
13177
  const token = tokens[i];
13333
13178
  if (this.value[token] === void 0 || this.value[token] === null && i === tokens.length - 1) {
13334
13179
  let didFindSubstringSlashMatch = false;
@@ -13344,11 +13189,20 @@ var require_pointer = __commonJS({
13344
13189
  if (didFindSubstringSlashMatch) {
13345
13190
  continue;
13346
13191
  }
13192
+ if (token in this.value && this.value[token] === null) {
13193
+ this.value = exports2.nullSymbol;
13194
+ continue;
13195
+ }
13347
13196
  this.value = null;
13348
- throw new errors_js_1.MissingPointerError(token, decodeURI(this.originalPath));
13197
+ const path = this.$ref.path || "";
13198
+ const targetRef = this.path.replace(path, "");
13199
+ const targetFound = _Pointer.join("", found);
13200
+ const parentPath = pathFromRoot?.replace(path, "");
13201
+ throw new errors_js_1.MissingPointerError(token, decodeURI(this.originalPath), targetRef, targetFound, parentPath);
13349
13202
  } else {
13350
13203
  this.value = this.value[token];
13351
13204
  }
13205
+ found.push(token);
13352
13206
  }
13353
13207
  if (!this.value || this.value.$ref && url.resolve(this.path, this.value.$ref) !== pathFromRoot) {
13354
13208
  resolveIf$Ref(this, options, pathFromRoot);
@@ -13409,7 +13263,7 @@ var require_pointer = __commonJS({
13409
13263
  split[i] = safeDecodeURIComponent(split[i].replace(escapedSlash, "/").replace(escapedTilde, "~"));
13410
13264
  }
13411
13265
  if (split[0] !== "") {
13412
- throw new errors_js_1.InvalidPointerError(split, originalPath === void 0 ? path : originalPath);
13266
+ throw new errors_js_1.InvalidPointerError(pointer, originalPath === void 0 ? path : originalPath);
13413
13267
  }
13414
13268
  return split.slice(1);
13415
13269
  }
@@ -13482,15 +13336,49 @@ Cannot set "${token}" of a non-object.`);
13482
13336
  }
13483
13337
  });
13484
13338
 
13485
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js
13339
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js
13486
13340
  var require_ref2 = __commonJS({
13487
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js"(exports2) {
13341
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js"(exports2) {
13488
13342
  "use strict";
13489
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
13490
- return mod && mod.__esModule ? mod : { "default": mod };
13491
- };
13343
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
13344
+ if (k2 === void 0) k2 = k;
13345
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13346
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13347
+ desc = { enumerable: true, get: function() {
13348
+ return m[k];
13349
+ } };
13350
+ }
13351
+ Object.defineProperty(o, k2, desc);
13352
+ }) : (function(o, m, k, k2) {
13353
+ if (k2 === void 0) k2 = k;
13354
+ o[k2] = m[k];
13355
+ }));
13356
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
13357
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
13358
+ }) : function(o, v) {
13359
+ o["default"] = v;
13360
+ });
13361
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
13362
+ var ownKeys = function(o) {
13363
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
13364
+ var ar = [];
13365
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
13366
+ return ar;
13367
+ };
13368
+ return ownKeys(o);
13369
+ };
13370
+ return function(mod) {
13371
+ if (mod && mod.__esModule) return mod;
13372
+ var result = {};
13373
+ if (mod != null) {
13374
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
13375
+ }
13376
+ __setModuleDefault(result, mod);
13377
+ return result;
13378
+ };
13379
+ })();
13492
13380
  Object.defineProperty(exports2, "__esModule", { value: true });
13493
- var pointer_js_1 = __importDefault(require_pointer());
13381
+ var pointer_js_1 = __importStar(require_pointer());
13494
13382
  var errors_js_1 = require_errors2();
13495
13383
  var url_js_1 = require_url();
13496
13384
  var $Ref = class _$Ref {
@@ -13552,7 +13440,11 @@ var require_ref2 = __commonJS({
13552
13440
  resolve(path, options, friendlyPath, pathFromRoot) {
13553
13441
  const pointer = new pointer_js_1.default(this, path, friendlyPath);
13554
13442
  try {
13555
- return pointer.resolve(this.value, options, pathFromRoot);
13443
+ const resolved = pointer.resolve(this.value, options, pathFromRoot);
13444
+ if (resolved.value === pointer_js_1.nullSymbol) {
13445
+ resolved.value = null;
13446
+ }
13447
+ return resolved;
13556
13448
  } catch (err) {
13557
13449
  if (!options || !options.continueOnError || !(0, errors_js_1.isHandledError)(err)) {
13558
13450
  throw err;
@@ -13577,6 +13469,9 @@ var require_ref2 = __commonJS({
13577
13469
  set(path, value) {
13578
13470
  const pointer = new pointer_js_1.default(this, path);
13579
13471
  this.value = pointer.set(this.value, value);
13472
+ if (this.value === pointer_js_1.nullSymbol) {
13473
+ this.value = null;
13474
+ }
13580
13475
  }
13581
13476
  /**
13582
13477
  * Determines whether the given value is a JSON reference.
@@ -13705,9 +13600,9 @@ var require_ref2 = __commonJS({
13705
13600
  }
13706
13601
  });
13707
13602
 
13708
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js
13603
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js
13709
13604
  var require_refs = __commonJS({
13710
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js"(exports2) {
13605
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js"(exports2) {
13711
13606
  "use strict";
13712
13607
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
13713
13608
  if (k2 === void 0) k2 = k;
@@ -13727,20 +13622,29 @@ var require_refs = __commonJS({
13727
13622
  }) : function(o, v) {
13728
13623
  o["default"] = v;
13729
13624
  });
13730
- var __importStar = exports2 && exports2.__importStar || function(mod) {
13731
- if (mod && mod.__esModule) return mod;
13732
- var result = {};
13733
- if (mod != null) {
13734
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13735
- }
13736
- __setModuleDefault(result, mod);
13737
- return result;
13738
- };
13625
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
13626
+ var ownKeys = function(o) {
13627
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
13628
+ var ar = [];
13629
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
13630
+ return ar;
13631
+ };
13632
+ return ownKeys(o);
13633
+ };
13634
+ return function(mod) {
13635
+ if (mod && mod.__esModule) return mod;
13636
+ var result = {};
13637
+ if (mod != null) {
13638
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
13639
+ }
13640
+ __setModuleDefault(result, mod);
13641
+ return result;
13642
+ };
13643
+ })();
13739
13644
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
13740
13645
  return mod && mod.__esModule ? mod : { "default": mod };
13741
13646
  };
13742
13647
  Object.defineProperty(exports2, "__esModule", { value: true });
13743
- var ono_1 = require_cjs();
13744
13648
  var ref_js_1 = __importDefault(require_ref2());
13745
13649
  var url = __importStar(require_url());
13746
13650
  var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
@@ -13748,7 +13652,7 @@ var require_refs = __commonJS({
13748
13652
  /**
13749
13653
  * Returns the paths/URLs of all the files in your schema (including the main schema file).
13750
13654
  *
13751
- * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#pathstypes
13655
+ * See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#pathstypes
13752
13656
  *
13753
13657
  * @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
13754
13658
  */
@@ -13761,7 +13665,7 @@ var require_refs = __commonJS({
13761
13665
  /**
13762
13666
  * Returns a map of paths/URLs and their correspond values.
13763
13667
  *
13764
- * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#valuestypes
13668
+ * See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#valuestypes
13765
13669
  *
13766
13670
  * @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
13767
13671
  */
@@ -13776,7 +13680,7 @@ var require_refs = __commonJS({
13776
13680
  /**
13777
13681
  * Returns `true` if the given path exists in the schema; otherwise, returns `false`
13778
13682
  *
13779
- * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#existsref
13683
+ * See https://apidevtools.com/json-schema-ref-parser/docs/refs.html#existsref
13780
13684
  *
13781
13685
  * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash
13782
13686
  */
@@ -13816,7 +13720,7 @@ var require_refs = __commonJS({
13816
13720
  const withoutHash = url.stripHash(absPath);
13817
13721
  const $ref = this._$refs[withoutHash];
13818
13722
  if (!$ref) {
13819
- throw (0, ono_1.ono)(`Error resolving $ref pointer "${path}".
13723
+ throw new Error(`Error resolving $ref pointer "${path}".
13820
13724
  "${withoutHash}" not found.`);
13821
13725
  }
13822
13726
  $ref.set(absPath, value);
@@ -13860,7 +13764,7 @@ var require_refs = __commonJS({
13860
13764
  const withoutHash = url.stripHash(absPath);
13861
13765
  const $ref = this._$refs[withoutHash];
13862
13766
  if (!$ref) {
13863
- throw (0, ono_1.ono)(`Error resolving $ref pointer "${path}".
13767
+ throw new Error(`Error resolving $ref pointer "${path}".
13864
13768
  "${withoutHash}" not found.`);
13865
13769
  }
13866
13770
  return $ref.resolve(absPath, options, path, pathFromRoot);
@@ -13892,9 +13796,9 @@ var require_refs = __commonJS({
13892
13796
  }
13893
13797
  });
13894
13798
 
13895
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js
13799
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js
13896
13800
  var require_plugins = __commonJS({
13897
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js"(exports2) {
13801
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js"(exports2) {
13898
13802
  "use strict";
13899
13803
  Object.defineProperty(exports2, "__esModule", { value: true });
13900
13804
  exports2.all = all;
@@ -13987,9 +13891,9 @@ var require_plugins = __commonJS({
13987
13891
  }
13988
13892
  });
13989
13893
 
13990
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js
13894
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js
13991
13895
  var require_parse = __commonJS({
13992
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js"(exports2) {
13896
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js"(exports2) {
13993
13897
  "use strict";
13994
13898
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
13995
13899
  if (k2 === void 0) k2 = k;
@@ -14009,17 +13913,26 @@ var require_parse = __commonJS({
14009
13913
  }) : function(o, v) {
14010
13914
  o["default"] = v;
14011
13915
  });
14012
- var __importStar = exports2 && exports2.__importStar || function(mod) {
14013
- if (mod && mod.__esModule) return mod;
14014
- var result = {};
14015
- if (mod != null) {
14016
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14017
- }
14018
- __setModuleDefault(result, mod);
14019
- return result;
14020
- };
13916
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
13917
+ var ownKeys = function(o) {
13918
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
13919
+ var ar = [];
13920
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
13921
+ return ar;
13922
+ };
13923
+ return ownKeys(o);
13924
+ };
13925
+ return function(mod) {
13926
+ if (mod && mod.__esModule) return mod;
13927
+ var result = {};
13928
+ if (mod != null) {
13929
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
13930
+ }
13931
+ __setModuleDefault(result, mod);
13932
+ return result;
13933
+ };
13934
+ })();
14021
13935
  Object.defineProperty(exports2, "__esModule", { value: true });
14022
- var ono_1 = require_cjs();
14023
13936
  var url = __importStar(require_url());
14024
13937
  var plugins = __importStar(require_plugins());
14025
13938
  var errors_js_1 = require_errors2();
@@ -14061,7 +13974,7 @@ var require_parse = __commonJS({
14061
13974
  if (!err && options.continueOnError) {
14062
13975
  throw new errors_js_1.UnmatchedResolverError(file.url);
14063
13976
  } else if (!err || !("error" in err)) {
14064
- throw ono_1.ono.syntax(`Unable to resolve $ref pointer "${file.url}"`);
13977
+ throw new SyntaxError(`Unable to resolve $ref pointer "${file.url}"`);
14065
13978
  } else if (err.error instanceof errors_js_1.ResolverError) {
14066
13979
  throw err.error;
14067
13980
  } else {
@@ -14077,7 +13990,7 @@ var require_parse = __commonJS({
14077
13990
  try {
14078
13991
  const parser = await plugins.run(parsers, "parse", file, $refs);
14079
13992
  if (!parser.plugin.allowEmpty && isEmpty(parser.result)) {
14080
- throw ono_1.ono.syntax(`Error parsing "${file.url}" as ${parser.plugin.name}.
13993
+ throw new SyntaxError(`Error parsing "${file.url}" as ${parser.plugin.name}.
14081
13994
  Parsed value is empty`);
14082
13995
  } else {
14083
13996
  return parser;
@@ -14088,7 +14001,7 @@ Parsed value is empty`);
14088
14001
  } else if (err && err.message && err.message.startsWith("Error parsing")) {
14089
14002
  throw err;
14090
14003
  } else if (!err || !("error" in err)) {
14091
- throw ono_1.ono.syntax(`Unable to parse ${file.url}`);
14004
+ throw new SyntaxError(`Unable to parse ${file.url}`);
14092
14005
  } else if (err.error instanceof errors_js_1.ParserError) {
14093
14006
  throw err.error;
14094
14007
  } else {
@@ -14103,9 +14016,9 @@ Parsed value is empty`);
14103
14016
  }
14104
14017
  });
14105
14018
 
14106
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js
14019
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js
14107
14020
  var require_json = __commonJS({
14108
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js"(exports2) {
14021
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js"(exports2) {
14109
14022
  "use strict";
14110
14023
  Object.defineProperty(exports2, "__esModule", { value: true });
14111
14024
  var errors_js_1 = require_errors2();
@@ -16959,9 +16872,9 @@ var require_js_yaml = __commonJS({
16959
16872
  }
16960
16873
  });
16961
16874
 
16962
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js
16875
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js
16963
16876
  var require_yaml = __commonJS({
16964
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js"(exports2) {
16877
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js"(exports2) {
16965
16878
  "use strict";
16966
16879
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
16967
16880
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -17015,9 +16928,9 @@ var require_yaml = __commonJS({
17015
16928
  }
17016
16929
  });
17017
16930
 
17018
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js
16931
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js
17019
16932
  var require_text = __commonJS({
17020
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js"(exports2) {
16933
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js"(exports2) {
17021
16934
  "use strict";
17022
16935
  Object.defineProperty(exports2, "__esModule", { value: true });
17023
16936
  var errors_js_1 = require_errors2();
@@ -17060,9 +16973,9 @@ var require_text = __commonJS({
17060
16973
  }
17061
16974
  });
17062
16975
 
17063
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js
16976
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js
17064
16977
  var require_binary2 = __commonJS({
17065
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js"(exports2) {
16978
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js"(exports2) {
17066
16979
  "use strict";
17067
16980
  Object.defineProperty(exports2, "__esModule", { value: true });
17068
16981
  var BINARY_REGEXP = /\.(jpeg|jpg|gif|png|bmp|ico)$/i;
@@ -17098,9 +17011,9 @@ var require_binary2 = __commonJS({
17098
17011
  }
17099
17012
  });
17100
17013
 
17101
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js
17014
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js
17102
17015
  var require_file = __commonJS({
17103
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js"(exports2) {
17016
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js"(exports2) {
17104
17017
  "use strict";
17105
17018
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17106
17019
  if (k2 === void 0) k2 = k;
@@ -17120,21 +17033,30 @@ var require_file = __commonJS({
17120
17033
  }) : function(o, v) {
17121
17034
  o["default"] = v;
17122
17035
  });
17123
- var __importStar = exports2 && exports2.__importStar || function(mod) {
17124
- if (mod && mod.__esModule) return mod;
17125
- var result = {};
17126
- if (mod != null) {
17127
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17128
- }
17129
- __setModuleDefault(result, mod);
17130
- return result;
17131
- };
17036
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
17037
+ var ownKeys = function(o) {
17038
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
17039
+ var ar = [];
17040
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
17041
+ return ar;
17042
+ };
17043
+ return ownKeys(o);
17044
+ };
17045
+ return function(mod) {
17046
+ if (mod && mod.__esModule) return mod;
17047
+ var result = {};
17048
+ if (mod != null) {
17049
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
17050
+ }
17051
+ __setModuleDefault(result, mod);
17052
+ return result;
17053
+ };
17054
+ })();
17132
17055
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17133
17056
  return mod && mod.__esModule ? mod : { "default": mod };
17134
17057
  };
17135
17058
  Object.defineProperty(exports2, "__esModule", { value: true });
17136
17059
  var fs_1 = __importDefault(require("fs"));
17137
- var ono_1 = require_cjs();
17138
17060
  var url = __importStar(require_url());
17139
17061
  var errors_js_1 = require_errors2();
17140
17062
  exports2.default = {
@@ -17158,21 +17080,25 @@ var require_file = __commonJS({
17158
17080
  try {
17159
17081
  path = url.toFileSystemPath(file.url);
17160
17082
  } catch (err) {
17161
- throw new errors_js_1.ResolverError(ono_1.ono.uri(err, `Malformed URI: ${file.url}`), file.url);
17083
+ const e = err;
17084
+ e.message = `Malformed URI: ${file.url}: ${e.message}`;
17085
+ throw new errors_js_1.ResolverError(e, file.url);
17162
17086
  }
17163
17087
  try {
17164
17088
  return await fs_1.default.promises.readFile(path);
17165
17089
  } catch (err) {
17166
- throw new errors_js_1.ResolverError((0, ono_1.ono)(err, `Error opening file "${path}"`), path);
17090
+ const e = err;
17091
+ e.message = `Error opening file ${path}: ${e.message}`;
17092
+ throw new errors_js_1.ResolverError(e, path);
17167
17093
  }
17168
17094
  }
17169
17095
  };
17170
17096
  }
17171
17097
  });
17172
17098
 
17173
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js
17099
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js
17174
17100
  var require_http = __commonJS({
17175
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js"(exports2) {
17101
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js"(exports2) {
17176
17102
  "use strict";
17177
17103
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17178
17104
  if (k2 === void 0) k2 = k;
@@ -17192,17 +17118,26 @@ var require_http = __commonJS({
17192
17118
  }) : function(o, v) {
17193
17119
  o["default"] = v;
17194
17120
  });
17195
- var __importStar = exports2 && exports2.__importStar || function(mod) {
17196
- if (mod && mod.__esModule) return mod;
17197
- var result = {};
17198
- if (mod != null) {
17199
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17200
- }
17201
- __setModuleDefault(result, mod);
17202
- return result;
17203
- };
17121
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
17122
+ var ownKeys = function(o) {
17123
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
17124
+ var ar = [];
17125
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
17126
+ return ar;
17127
+ };
17128
+ return ownKeys(o);
17129
+ };
17130
+ return function(mod) {
17131
+ if (mod && mod.__esModule) return mod;
17132
+ var result = {};
17133
+ if (mod != null) {
17134
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
17135
+ }
17136
+ __setModuleDefault(result, mod);
17137
+ return result;
17138
+ };
17139
+ })();
17204
17140
  Object.defineProperty(exports2, "__esModule", { value: true });
17205
- var ono_1 = require_cjs();
17206
17141
  var url = __importStar(require_url());
17207
17142
  var errors_js_1 = require_errors2();
17208
17143
  exports2.default = {
@@ -17235,13 +17170,17 @@ var require_http = __commonJS({
17235
17170
  * Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication
17236
17171
  */
17237
17172
  withCredentials: false,
17173
+ /**
17174
+ * Set this to `false` if you want to allow unsafe URLs (e.g., `127.0.0.1`, localhost, and other internal URLs).
17175
+ */
17176
+ safeUrlResolver: true,
17238
17177
  /**
17239
17178
  * Determines whether this resolver can read a given file reference.
17240
17179
  * Resolvers that return true will be tried in order, until one successfully resolves the file.
17241
17180
  * Resolvers that return false will not be given a chance to resolve the file.
17242
17181
  */
17243
17182
  canRead(file) {
17244
- return url.isHttp(file.url);
17183
+ return url.isHttp(file.url) && (!this.safeUrlResolver || !url.isUnsafeUrl(file.url));
17245
17184
  },
17246
17185
  /**
17247
17186
  * Reads the given URL and returns its raw contents as a Buffer.
@@ -17261,14 +17200,20 @@ var require_http = __commonJS({
17261
17200
  try {
17262
17201
  const res = await get(u, httpOptions);
17263
17202
  if (res.status >= 400) {
17264
- throw (0, ono_1.ono)({ status: res.status }, `HTTP ERROR ${res.status}`);
17203
+ const error = new Error(`HTTP ERROR ${res.status}`);
17204
+ error.status = res.status;
17205
+ throw error;
17265
17206
  } else if (res.status >= 300) {
17266
17207
  if (!Number.isNaN(httpOptions.redirects) && redirects.length > httpOptions.redirects) {
17267
- throw new errors_js_1.ResolverError((0, ono_1.ono)({ status: res.status }, `Error downloading ${redirects[0]}.
17208
+ const error = new Error(`Error downloading ${redirects[0]}.
17268
17209
  Too many redirects:
17269
- ${redirects.join(" \n ")}`));
17210
+ ${redirects.join(" \n ")}`);
17211
+ error.status = res.status;
17212
+ throw new errors_js_1.ResolverError(error);
17270
17213
  } else if (!("location" in res.headers) || !res.headers.location) {
17271
- throw (0, ono_1.ono)({ status: res.status }, `HTTP ${res.status} redirect with no location header`);
17214
+ const error = new Error(`HTTP ${res.status} redirect with no location header`);
17215
+ error.status = res.status;
17216
+ throw error;
17272
17217
  } else {
17273
17218
  const redirectTo = url.resolve(u.href, res.headers.location);
17274
17219
  return download(redirectTo, httpOptions, redirects);
@@ -17281,7 +17226,9 @@ Too many redirects:
17281
17226
  return Buffer.alloc(0);
17282
17227
  }
17283
17228
  } catch (err) {
17284
- throw new errors_js_1.ResolverError((0, ono_1.ono)(err, `Error downloading ${u.href}`), u.href);
17229
+ const e = err;
17230
+ e.message = `Error downloading ${u.href}: ${e.message}`;
17231
+ throw new errors_js_1.ResolverError(e, u.href);
17285
17232
  }
17286
17233
  }
17287
17234
  async function get(u, httpOptions) {
@@ -17305,9 +17252,9 @@ Too many redirects:
17305
17252
  }
17306
17253
  });
17307
17254
 
17308
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js
17255
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js
17309
17256
  var require_options = __commonJS({
17310
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js"(exports2) {
17257
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js"(exports2) {
17311
17258
  "use strict";
17312
17259
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17313
17260
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -17415,9 +17362,9 @@ var require_options = __commonJS({
17415
17362
  }
17416
17363
  });
17417
17364
 
17418
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js
17365
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js
17419
17366
  var require_normalize_args = __commonJS({
17420
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js"(exports2) {
17367
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js"(exports2) {
17421
17368
  "use strict";
17422
17369
  Object.defineProperty(exports2, "__esModule", { value: true });
17423
17370
  exports2.normalizeArgs = normalizeArgs;
@@ -17464,9 +17411,9 @@ var require_normalize_args = __commonJS({
17464
17411
  }
17465
17412
  });
17466
17413
 
17467
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js
17414
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js
17468
17415
  var require_resolve_external = __commonJS({
17469
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js"(exports2) {
17416
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js"(exports2) {
17470
17417
  "use strict";
17471
17418
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17472
17419
  if (k2 === void 0) k2 = k;
@@ -17486,15 +17433,25 @@ var require_resolve_external = __commonJS({
17486
17433
  }) : function(o, v) {
17487
17434
  o["default"] = v;
17488
17435
  });
17489
- var __importStar = exports2 && exports2.__importStar || function(mod) {
17490
- if (mod && mod.__esModule) return mod;
17491
- var result = {};
17492
- if (mod != null) {
17493
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17494
- }
17495
- __setModuleDefault(result, mod);
17496
- return result;
17497
- };
17436
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
17437
+ var ownKeys = function(o) {
17438
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
17439
+ var ar = [];
17440
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
17441
+ return ar;
17442
+ };
17443
+ return ownKeys(o);
17444
+ };
17445
+ return function(mod) {
17446
+ if (mod && mod.__esModule) return mod;
17447
+ var result = {};
17448
+ if (mod != null) {
17449
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
17450
+ }
17451
+ __setModuleDefault(result, mod);
17452
+ return result;
17453
+ };
17454
+ })();
17498
17455
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17499
17456
  return mod && mod.__esModule ? mod : { "default": mod };
17500
17457
  };
@@ -17559,9 +17516,9 @@ var require_resolve_external = __commonJS({
17559
17516
  }
17560
17517
  });
17561
17518
 
17562
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js
17519
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js
17563
17520
  var require_bundle = __commonJS({
17564
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js"(exports2) {
17521
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js"(exports2) {
17565
17522
  "use strict";
17566
17523
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17567
17524
  if (k2 === void 0) k2 = k;
@@ -17581,15 +17538,25 @@ var require_bundle = __commonJS({
17581
17538
  }) : function(o, v) {
17582
17539
  o["default"] = v;
17583
17540
  });
17584
- var __importStar = exports2 && exports2.__importStar || function(mod) {
17585
- if (mod && mod.__esModule) return mod;
17586
- var result = {};
17587
- if (mod != null) {
17588
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17589
- }
17590
- __setModuleDefault(result, mod);
17591
- return result;
17592
- };
17541
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
17542
+ var ownKeys = function(o) {
17543
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
17544
+ var ar = [];
17545
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
17546
+ return ar;
17547
+ };
17548
+ return ownKeys(o);
17549
+ };
17550
+ return function(mod) {
17551
+ if (mod && mod.__esModule) return mod;
17552
+ var result = {};
17553
+ if (mod != null) {
17554
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
17555
+ }
17556
+ __setModuleDefault(result, mod);
17557
+ return result;
17558
+ };
17559
+ })();
17593
17560
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17594
17561
  return mod && mod.__esModule ? mod : { "default": mod };
17595
17562
  };
@@ -17609,9 +17576,9 @@ var require_bundle = __commonJS({
17609
17576
  inventory$Ref(parent, key, path, pathFromRoot, indirections, inventory, $refs, options);
17610
17577
  } else {
17611
17578
  const keys = Object.keys(obj).sort((a, b) => {
17612
- if (a === "definitions") {
17579
+ if (a === "definitions" || a === "$defs") {
17613
17580
  return -1;
17614
- } else if (b === "definitions") {
17581
+ } else if (b === "definitions" || b === "$defs") {
17615
17582
  return 1;
17616
17583
  } else {
17617
17584
  return a.length - b.length;
@@ -17697,8 +17664,8 @@ var require_bundle = __commonJS({
17697
17664
  } else if (a.depth !== b.depth) {
17698
17665
  return a.depth - b.depth;
17699
17666
  } else {
17700
- const aDefinitionsIndex = a.pathFromRoot.lastIndexOf("/definitions");
17701
- const bDefinitionsIndex = b.pathFromRoot.lastIndexOf("/definitions");
17667
+ const aDefinitionsIndex = Math.max(a.pathFromRoot.lastIndexOf("/definitions"), a.pathFromRoot.lastIndexOf("/$defs"));
17668
+ const bDefinitionsIndex = Math.max(b.pathFromRoot.lastIndexOf("/definitions"), b.pathFromRoot.lastIndexOf("/$defs"));
17702
17669
  if (aDefinitionsIndex !== bDefinitionsIndex) {
17703
17670
  return bDefinitionsIndex - aDefinitionsIndex;
17704
17671
  } else {
@@ -17741,9 +17708,9 @@ var require_bundle = __commonJS({
17741
17708
  }
17742
17709
  });
17743
17710
 
17744
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js
17711
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js
17745
17712
  var require_dereference = __commonJS({
17746
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js"(exports2) {
17713
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js"(exports2) {
17747
17714
  "use strict";
17748
17715
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17749
17716
  if (k2 === void 0) k2 = k;
@@ -17763,22 +17730,31 @@ var require_dereference = __commonJS({
17763
17730
  }) : function(o, v) {
17764
17731
  o["default"] = v;
17765
17732
  });
17766
- var __importStar = exports2 && exports2.__importStar || function(mod) {
17767
- if (mod && mod.__esModule) return mod;
17768
- var result = {};
17769
- if (mod != null) {
17770
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17771
- }
17772
- __setModuleDefault(result, mod);
17773
- return result;
17774
- };
17733
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
17734
+ var ownKeys = function(o) {
17735
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
17736
+ var ar = [];
17737
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
17738
+ return ar;
17739
+ };
17740
+ return ownKeys(o);
17741
+ };
17742
+ return function(mod) {
17743
+ if (mod && mod.__esModule) return mod;
17744
+ var result = {};
17745
+ if (mod != null) {
17746
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
17747
+ }
17748
+ __setModuleDefault(result, mod);
17749
+ return result;
17750
+ };
17751
+ })();
17775
17752
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17776
17753
  return mod && mod.__esModule ? mod : { "default": mod };
17777
17754
  };
17778
17755
  Object.defineProperty(exports2, "__esModule", { value: true });
17779
17756
  var ref_js_1 = __importDefault(require_ref2());
17780
17757
  var pointer_js_1 = __importDefault(require_pointer());
17781
- var ono_1 = require_cjs();
17782
17758
  var url = __importStar(require_url());
17783
17759
  var errors_1 = require_errors2();
17784
17760
  exports2.default = dereference;
@@ -17794,11 +17770,7 @@ var require_dereference = __commonJS({
17794
17770
  value: obj,
17795
17771
  circular: false
17796
17772
  };
17797
- if (options && options.timeoutMs) {
17798
- if (Date.now() - startTime > options.timeoutMs) {
17799
- throw new errors_1.TimeoutError(options.timeoutMs);
17800
- }
17801
- }
17773
+ checkDereferenceTimeout(startTime, options);
17802
17774
  const derefOptions = options.dereference || {};
17803
17775
  const isExcludedPath = derefOptions.excludedPathMatcher || (() => false);
17804
17776
  if (derefOptions?.circular === "ignore" || !processedObjects.has(obj)) {
@@ -17811,6 +17783,7 @@ var require_dereference = __commonJS({
17811
17783
  result.value = dereferenced.value;
17812
17784
  } else {
17813
17785
  for (const key of Object.keys(obj)) {
17786
+ checkDereferenceTimeout(startTime, options);
17814
17787
  const keyPath = pointer_js_1.default.join(path, key);
17815
17788
  const keyPathFromRoot = pointer_js_1.default.join(pathFromRoot, key);
17816
17789
  if (isExcludedPath(keyPathFromRoot)) {
@@ -17822,7 +17795,24 @@ var require_dereference = __commonJS({
17822
17795
  dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime);
17823
17796
  circular = dereferenced.circular;
17824
17797
  if (obj[key] !== dereferenced.value) {
17798
+ const preserved = /* @__PURE__ */ new Map();
17799
+ if (derefOptions?.preservedProperties) {
17800
+ if (typeof obj[key] === "object" && !Array.isArray(obj[key])) {
17801
+ derefOptions?.preservedProperties.forEach((prop) => {
17802
+ if (prop in obj[key]) {
17803
+ preserved.set(prop, obj[key][prop]);
17804
+ }
17805
+ });
17806
+ }
17807
+ }
17825
17808
  obj[key] = dereferenced.value;
17809
+ if (derefOptions?.preservedProperties) {
17810
+ if (preserved.size && typeof obj[key] === "object" && !Array.isArray(obj[key])) {
17811
+ preserved.forEach((value2, prop) => {
17812
+ obj[key][prop] = value2;
17813
+ });
17814
+ }
17815
+ }
17826
17816
  derefOptions?.onDereference?.(value.$ref, obj[key], obj, key);
17827
17817
  }
17828
17818
  } else {
@@ -17849,21 +17839,31 @@ var require_dereference = __commonJS({
17849
17839
  const shouldResolveOnCwd = isExternalRef && options?.dereference?.externalReferenceResolution === "root";
17850
17840
  const $refPath = url.resolve(shouldResolveOnCwd ? url.cwd() : path, $ref.$ref);
17851
17841
  const cache = dereferencedCache.get($refPath);
17852
- if (cache && !cache.circular) {
17853
- const refKeys = Object.keys($ref);
17854
- if (refKeys.length > 1) {
17855
- const extraKeys = {};
17856
- for (const key of refKeys) {
17857
- if (key !== "$ref" && !(key in cache.value)) {
17858
- extraKeys[key] = $ref[key];
17842
+ if (cache) {
17843
+ if (!cache.circular) {
17844
+ const refKeys = Object.keys($ref);
17845
+ if (refKeys.length > 1) {
17846
+ const extraKeys = {};
17847
+ for (const key of refKeys) {
17848
+ if (key !== "$ref" && !(key in cache.value)) {
17849
+ extraKeys[key] = $ref[key];
17850
+ }
17859
17851
  }
17852
+ return {
17853
+ circular: cache.circular,
17854
+ value: Object.assign({}, cache.value, extraKeys)
17855
+ };
17860
17856
  }
17861
- return {
17862
- circular: cache.circular,
17863
- value: Object.assign({}, cache.value, extraKeys)
17864
- };
17857
+ return cache;
17858
+ }
17859
+ if (typeof cache.value === "object" && "$ref" in cache.value && "$ref" in $ref) {
17860
+ if (cache.value.$ref === $ref.$ref) {
17861
+ return cache;
17862
+ } else {
17863
+ }
17864
+ } else {
17865
+ return cache;
17865
17866
  }
17866
- return cache;
17867
17867
  }
17868
17868
  const pointer = $refs._resolve($refPath, path, options);
17869
17869
  if (pointer === null) {
@@ -17898,19 +17898,28 @@ var require_dereference = __commonJS({
17898
17898
  }
17899
17899
  return dereferencedObject;
17900
17900
  }
17901
+ function checkDereferenceTimeout(startTime, options) {
17902
+ if (options && options.timeoutMs) {
17903
+ if (Date.now() - startTime > options.timeoutMs) {
17904
+ throw new errors_1.TimeoutError(options.timeoutMs);
17905
+ }
17906
+ }
17907
+ }
17901
17908
  function foundCircularReference(keyPath, $refs, options) {
17902
17909
  $refs.circular = true;
17910
+ options?.dereference?.onCircular?.(keyPath);
17903
17911
  if (!options.dereference.circular) {
17904
- throw ono_1.ono.reference(`Circular $ref pointer found at ${keyPath}`);
17912
+ const error = new ReferenceError(`Circular $ref pointer found at ${keyPath}`);
17913
+ throw error;
17905
17914
  }
17906
17915
  return true;
17907
17916
  }
17908
17917
  }
17909
17918
  });
17910
17919
 
17911
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js
17920
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js
17912
17921
  var require_next2 = __commonJS({
17913
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js"(exports2) {
17922
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js"(exports2) {
17914
17923
  "use strict";
17915
17924
  Object.defineProperty(exports2, "__esModule", { value: true });
17916
17925
  function makeNext() {
@@ -17928,9 +17937,9 @@ var require_next2 = __commonJS({
17928
17937
  }
17929
17938
  });
17930
17939
 
17931
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js
17940
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js
17932
17941
  var require_maybe = __commonJS({
17933
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js"(exports2) {
17942
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js"(exports2) {
17934
17943
  "use strict";
17935
17944
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17936
17945
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -17957,9 +17966,9 @@ var require_maybe = __commonJS({
17957
17966
  }
17958
17967
  });
17959
17968
 
17960
- // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js
17969
+ // ../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js
17961
17970
  var require_lib3 = __commonJS({
17962
- "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.7.2/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js"(exports2) {
17971
+ "../../node_modules/.pnpm/@apidevtools+json-schema-ref-parser@14.0.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js"(exports2) {
17963
17972
  "use strict";
17964
17973
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17965
17974
  if (k2 === void 0) k2 = k;
@@ -17979,21 +17988,32 @@ var require_lib3 = __commonJS({
17979
17988
  }) : function(o, v) {
17980
17989
  o["default"] = v;
17981
17990
  });
17982
- var __importStar = exports2 && exports2.__importStar || function(mod) {
17983
- if (mod && mod.__esModule) return mod;
17984
- var result = {};
17985
- if (mod != null) {
17986
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17987
- }
17988
- __setModuleDefault(result, mod);
17989
- return result;
17990
- };
17991
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
17992
+ var ownKeys = function(o) {
17993
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
17994
+ var ar = [];
17995
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
17996
+ return ar;
17997
+ };
17998
+ return ownKeys(o);
17999
+ };
18000
+ return function(mod) {
18001
+ if (mod && mod.__esModule) return mod;
18002
+ var result = {};
18003
+ if (mod != null) {
18004
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
18005
+ }
18006
+ __setModuleDefault(result, mod);
18007
+ return result;
18008
+ };
18009
+ })();
17991
18010
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17992
18011
  return mod && mod.__esModule ? mod : { "default": mod };
17993
18012
  };
17994
18013
  Object.defineProperty(exports2, "__esModule", { value: true });
17995
- exports2.getJsonSchemaRefParserDefaultOptions = exports2.jsonSchemaParserNormalizeArgs = exports2.dereferenceInternal = exports2.JSONParserErrorGroup = exports2.isHandledError = exports2.UnmatchedParserError = exports2.ParserError = exports2.ResolverError = exports2.MissingPointerError = exports2.InvalidPointerError = exports2.JSONParserError = exports2.UnmatchedResolverError = exports2.dereference = exports2.bundle = exports2.resolve = exports2.parse = exports2.$RefParser = void 0;
18014
+ exports2.isUnsafeUrl = exports2.$Refs = exports2.getJsonSchemaRefParserDefaultOptions = exports2.jsonSchemaParserNormalizeArgs = exports2.dereferenceInternal = exports2.JSONParserErrorGroup = exports2.isHandledError = exports2.UnmatchedParserError = exports2.ParserError = exports2.ResolverError = exports2.MissingPointerError = exports2.InvalidPointerError = exports2.JSONParserError = exports2.UnmatchedResolverError = exports2.dereference = exports2.bundle = exports2.resolve = exports2.parse = exports2.$RefParser = void 0;
17996
18015
  var refs_js_1 = __importDefault(require_refs());
18016
+ exports2.$Refs = refs_js_1.default;
17997
18017
  var parse_js_1 = __importDefault(require_parse());
17998
18018
  var normalize_args_js_1 = __importDefault(require_normalize_args());
17999
18019
  exports2.jsonSchemaParserNormalizeArgs = normalize_args_js_1.default;
@@ -18030,12 +18050,15 @@ var require_lib3 = __commonJS({
18030
18050
  Object.defineProperty(exports2, "JSONParserErrorGroup", { enumerable: true, get: function() {
18031
18051
  return errors_js_1.JSONParserErrorGroup;
18032
18052
  } });
18033
- var ono_1 = require_cjs();
18034
18053
  var maybe_js_1 = __importDefault(require_maybe());
18035
18054
  var options_js_1 = require_options();
18036
18055
  Object.defineProperty(exports2, "getJsonSchemaRefParserDefaultOptions", { enumerable: true, get: function() {
18037
18056
  return options_js_1.getJsonSchemaRefParserDefaultOptions;
18038
18057
  } });
18058
+ var url_js_1 = require_url();
18059
+ Object.defineProperty(exports2, "isUnsafeUrl", { enumerable: true, get: function() {
18060
+ return url_js_1.isUnsafeUrl;
18061
+ } });
18039
18062
  var $RefParser = class _$RefParser {
18040
18063
  constructor() {
18041
18064
  this.schema = null;
@@ -18045,7 +18068,7 @@ var require_lib3 = __commonJS({
18045
18068
  const args = (0, normalize_args_js_1.default)(arguments);
18046
18069
  let promise;
18047
18070
  if (!args.path && !args.schema) {
18048
- const err = (0, ono_1.ono)(`Expected a file path, URL, or object. Got ${args.path || args.schema}`);
18071
+ const err = new Error(`Expected a file path, URL, or object. Got ${args.path || args.schema}`);
18049
18072
  return (0, maybe_js_1.default)(args.callback, Promise.reject(err));
18050
18073
  }
18051
18074
  this.schema = null;
@@ -18077,7 +18100,7 @@ var require_lib3 = __commonJS({
18077
18100
  this.schema = null;
18078
18101
  return (0, maybe_js_1.default)(args.callback, Promise.resolve(this.schema));
18079
18102
  } else {
18080
- throw ono_1.ono.syntax(`"${this.$refs._root$Ref.path || result}" is not a valid JSON Schema`);
18103
+ throw new SyntaxError(`"${this.$refs._root$Ref.path || result}" is not a valid JSON Schema`);
18081
18104
  }
18082
18105
  } catch (err) {
18083
18106
  if (!args.options.continueOnError || !(0, errors_js_1.isHandledError)(err)) {
@@ -18154,9 +18177,9 @@ var require_lib3 = __commonJS({
18154
18177
  }
18155
18178
  });
18156
18179
 
18157
- // ../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/options.js
18180
+ // ../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/options.js
18158
18181
  var require_options2 = __commonJS({
18159
- "../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/options.js"(exports2, module2) {
18182
+ "../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/options.js"(exports2, module2) {
18160
18183
  "use strict";
18161
18184
  var { getJsonSchemaRefParserDefaultOptions } = require_lib3();
18162
18185
  var schemaValidator = require_schema5();
@@ -18244,20 +18267,21 @@ var require_maybe2 = __commonJS({
18244
18267
  }
18245
18268
  });
18246
18269
 
18247
- // ../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/index.js
18270
+ // ../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/index.js
18248
18271
  var require_lib4 = __commonJS({
18249
- "../../node_modules/.pnpm/@apidevtools+swagger-parser@10.1.1_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/index.js"(exports2, module2) {
18272
+ "../../node_modules/.pnpm/@apidevtools+swagger-parser@12.1.0_openapi-types@12.1.3/node_modules/@apidevtools/swagger-parser/lib/index.js"(exports2, module2) {
18250
18273
  "use strict";
18251
18274
  var validateSchema = require_schema5();
18252
18275
  var validateSpec = require_spec();
18253
- var { jsonSchemaParserNormalizeArgs: normalizeArgs } = require_lib3();
18276
+ var {
18277
+ jsonSchemaParserNormalizeArgs: normalizeArgs,
18278
+ dereferenceInternal: dereference,
18279
+ $RefParser
18280
+ } = require_lib3();
18254
18281
  var util = require_util();
18255
18282
  var Options = require_options2();
18256
18283
  var maybe = require_maybe2();
18257
- var { ono } = require_cjs();
18258
- var { $RefParser } = require_lib3();
18259
- var { dereferenceInternal: dereference } = require_lib3();
18260
- var supported31Versions = ["3.1.0", "3.1.1"];
18284
+ var supported31Versions = ["3.1.0", "3.1.1", "3.1.2"];
18261
18285
  var supported30Versions = ["3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4"];
18262
18286
  var supportedVersions = [...supported31Versions, ...supported30Versions];
18263
18287
  var SwaggerParser2 = class extends $RefParser {
@@ -18278,32 +18302,28 @@ var require_lib4 = __commonJS({
18278
18302
  try {
18279
18303
  let schema = await super.parse(args.path, args.schema, args.options);
18280
18304
  if (schema.swagger) {
18281
- if (schema.swagger === void 0 || schema.info === void 0 || schema.paths === void 0) {
18282
- throw ono.syntax(`${args.path || args.schema} is not a valid Swagger API definition`);
18283
- } else if (typeof schema.swagger === "number") {
18284
- throw ono.syntax('Swagger version number must be a string (e.g. "2.0") not a number.');
18285
- } else if (typeof schema.info.version === "number") {
18286
- throw ono.syntax('API version number must be a string (e.g. "1.0.0") not a number.');
18305
+ if (typeof schema.swagger === "number") {
18306
+ throw new SyntaxError('Swagger version number must be a string (e.g. "2.0") not a number.');
18307
+ } else if (schema.info && typeof schema.info.version === "number") {
18308
+ throw new SyntaxError('API version number must be a string (e.g. "1.0.0") not a number.');
18287
18309
  } else if (schema.swagger !== "2.0") {
18288
- throw ono.syntax(`Unrecognized Swagger version: ${schema.swagger}. Expected 2.0`);
18310
+ throw new SyntaxError(`Unrecognized Swagger version: ${schema.swagger}. Expected 2.0`);
18289
18311
  }
18290
18312
  } else {
18291
- if (schema.openapi === void 0 || schema.info === void 0) {
18292
- throw ono.syntax(`${args.path || args.schema} is not a valid Openapi API definition`);
18293
- } else if (schema.paths === void 0) {
18313
+ if (schema.paths === void 0) {
18294
18314
  if (supported31Versions.indexOf(schema.openapi) !== -1) {
18295
18315
  if (schema.webhooks === void 0) {
18296
- throw ono.syntax(`${args.path || args.schema} is not a valid Openapi API definition`);
18316
+ throw new SyntaxError(`${args.path || args.schema} is not a valid Openapi API definition`);
18297
18317
  }
18298
18318
  } else {
18299
- throw ono.syntax(`${args.path || args.schema} is not a valid Openapi API definition`);
18319
+ throw new SyntaxError(`${args.path || args.schema} is not a valid Openapi API definition`);
18300
18320
  }
18301
18321
  } else if (typeof schema.openapi === "number") {
18302
- throw ono.syntax('Openapi version number must be a string (e.g. "3.0.0") not a number.');
18303
- } else if (typeof schema.info.version === "number") {
18304
- throw ono.syntax('API version number must be a string (e.g. "1.0.0") not a number.');
18322
+ throw new SyntaxError('Openapi version number must be a string (e.g. "3.0.0") not a number.');
18323
+ } else if (schema.info && typeof schema.info.version === "number") {
18324
+ throw new SyntaxError('API version number must be a string (e.g. "1.0.0") not a number.');
18305
18325
  } else if (supportedVersions.indexOf(schema.openapi) === -1) {
18306
- throw ono.syntax(
18326
+ throw new SyntaxError(
18307
18327
  `Unsupported OpenAPI version: ${schema.openapi}. Swagger Parser only supports versions ${supportedVersions.join(", ")}`
18308
18328
  );
18309
18329
  }
@@ -18339,7 +18359,7 @@ var require_lib4 = __commonJS({
18339
18359
  if (circular$RefOption === true) {
18340
18360
  dereference(me, args.options);
18341
18361
  } else if (circular$RefOption === false) {
18342
- throw ono.reference("The API contains circular references");
18362
+ throw new ReferenceError("The API contains circular references");
18343
18363
  }
18344
18364
  }
18345
18365
  }
@@ -18394,9 +18414,10 @@ var import_node_path4 = require("node:path");
18394
18414
  var import_promises2 = require("node:fs/promises");
18395
18415
  var import_node_path2 = require("node:path");
18396
18416
 
18397
- // src/config.ts
18417
+ // ../openapi-gen/dist/config-core.js
18398
18418
  var import_promises = require("node:fs/promises");
18399
18419
  var import_node_path = require("node:path");
18420
+ var import_node_url = require("node:url");
18400
18421
  var FORBIDDEN_OUTPUT_PREFIXES = [
18401
18422
  "/etc",
18402
18423
  "/usr",
@@ -18425,9 +18446,15 @@ var FORBIDDEN_INPUT_PREFIXES = [
18425
18446
  "C:\\Windows",
18426
18447
  "C:\\Program Files"
18427
18448
  ];
18449
+ var JS_CONFIG_EXTENSIONS = [".js", ".mjs", ".cjs"];
18450
+ function isJsConfigPath(configPath) {
18451
+ return JS_CONFIG_EXTENSIONS.some((ext) => configPath.endsWith(ext));
18452
+ }
18428
18453
  function validateConfigPath(configPath) {
18429
- if (!configPath.endsWith(".json")) {
18430
- throw new Error(`Config file must be a .json file, got: ${configPath}`);
18454
+ const isJson = configPath.endsWith(".json");
18455
+ const isJs = isJsConfigPath(configPath);
18456
+ if (!isJson && !isJs) {
18457
+ throw new Error(`Config file must be a .json, .js, .mjs, or .cjs file, got: ${configPath}`);
18431
18458
  }
18432
18459
  }
18433
18460
  function validateOutputPath(resolvedOutput) {
@@ -18435,9 +18462,7 @@ function validateOutputPath(resolvedOutput) {
18435
18462
  for (const forbidden of FORBIDDEN_OUTPUT_PREFIXES) {
18436
18463
  const normalizedForbidden = forbidden.replace(/\\/g, "/");
18437
18464
  if (normalized === normalizedForbidden || normalized.startsWith(normalizedForbidden + "/")) {
18438
- throw new Error(
18439
- `Output path resolves to a system directory: "${resolvedOutput}". This looks like a misconfiguration \u2014 please check your config file.`
18440
- );
18465
+ throw new Error(`Output path resolves to a system directory: "${resolvedOutput}". This looks like a misconfiguration. Please check your config file.`);
18441
18466
  }
18442
18467
  }
18443
18468
  }
@@ -18446,55 +18471,84 @@ function validateInputPath(resolvedInput) {
18446
18471
  for (const forbidden of FORBIDDEN_INPUT_PREFIXES) {
18447
18472
  const normalizedForbidden = forbidden.replace(/\\/g, "/");
18448
18473
  if (normalized === normalizedForbidden || normalized.startsWith(normalizedForbidden + "/")) {
18449
- throw new Error(
18450
- `Input spec path resolves to a system directory: "${resolvedInput}". This looks like a misconfiguration \u2014 please check your config file.`
18451
- );
18474
+ throw new Error(`Input spec path resolves to a system directory: "${resolvedInput}". This looks like a misconfiguration. Please check your config file.`);
18452
18475
  }
18453
18476
  }
18454
18477
  }
18455
- async function loadConfig(cwd, configPath) {
18456
- const resolvedConfigPath = configPath ?? (0, import_node_path.join)(cwd, "openapi-server.config.json");
18457
- if (configPath !== void 0) {
18458
- validateConfigPath(configPath);
18478
+ async function loadConfigFile(opts) {
18479
+ const resolvedConfigPath = opts.configPath ?? (0, import_node_path.join)(opts.cwd, opts.defaultFileName);
18480
+ if (opts.configPath !== void 0) {
18481
+ validateConfigPath(opts.configPath);
18459
18482
  }
18460
18483
  let raw;
18461
- try {
18462
- raw = await (0, import_promises.readFile)(resolvedConfigPath, "utf-8");
18463
- } catch {
18464
- throw new Error(`Config file not found: ${resolvedConfigPath}`);
18465
- }
18466
- let parsed2;
18467
- try {
18468
- parsed2 = JSON.parse(raw);
18469
- } catch {
18470
- throw new Error(`Config file is not valid JSON: ${resolvedConfigPath}`);
18471
- }
18472
- if (typeof parsed2 !== "object" || parsed2 === null) {
18473
- throw new Error("Config must be a JSON object");
18474
- }
18475
- const config = parsed2;
18476
- if (typeof config["input_openapi"] !== "string" || !config["input_openapi"]) {
18484
+ if (isJsConfigPath(resolvedConfigPath)) {
18485
+ let mod;
18486
+ try {
18487
+ mod = await import((0, import_node_url.pathToFileURL)(resolvedConfigPath).href);
18488
+ } catch (err) {
18489
+ const message = err instanceof Error ? err.message : String(err);
18490
+ throw new Error(`Failed to load JS config file: ${resolvedConfigPath}
18491
+ ${message}`);
18492
+ }
18493
+ const exported = mod["default"] ?? mod;
18494
+ if (typeof exported !== "object" || exported === null) {
18495
+ throw new Error("Config must be a JSON object");
18496
+ }
18497
+ raw = exported;
18498
+ } else {
18499
+ let fileContents;
18500
+ try {
18501
+ fileContents = await (0, import_promises.readFile)(resolvedConfigPath, "utf-8");
18502
+ } catch {
18503
+ throw new Error(`Config file not found: ${resolvedConfigPath}`);
18504
+ }
18505
+ let parsed2;
18506
+ try {
18507
+ parsed2 = JSON.parse(fileContents);
18508
+ } catch {
18509
+ throw new Error(`Config file is not valid JSON: ${resolvedConfigPath}`);
18510
+ }
18511
+ if (typeof parsed2 !== "object" || parsed2 === null) {
18512
+ throw new Error("Config must be a JSON object");
18513
+ }
18514
+ raw = parsed2;
18515
+ }
18516
+ if (typeof raw["input_openapi"] !== "string" || !raw["input_openapi"]) {
18477
18517
  throw new Error('Config missing required field: "input_openapi" (path to OpenAPI 3.1 spec)');
18478
18518
  }
18479
- if (typeof config["output"] !== "string" || !config["output"]) {
18519
+ if (typeof raw["output"] !== "string" || !raw["output"]) {
18480
18520
  throw new Error('Config missing required field: "output" (output directory)');
18481
18521
  }
18482
- if (config["framework"] !== void 0 && config["framework"] !== "hono" && config["framework"] !== "express" && config["framework"] !== "fastify" && config["framework"] !== "none") {
18483
- throw new Error('"framework" must be one of: "hono", "express", "fastify", or "none"');
18484
- }
18485
- if (config["input_schema"] !== void 0 && (typeof config["input_schema"] !== "string" || !config["input_schema"])) {
18486
- throw new Error('"input_schema" must be a non-empty string path to your Zod schema file');
18487
- }
18488
- const resolvedInput = (0, import_node_path.resolve)(cwd, config["input_openapi"]);
18489
- const resolvedOutput = (0, import_node_path.resolve)(cwd, config["output"]);
18490
- validateInputPath(resolvedInput);
18491
- validateOutputPath(resolvedOutput);
18492
- return {
18493
- input_openapi: config["input_openapi"],
18494
- output: config["output"],
18495
- framework: config["framework"],
18496
- input_schema: config["input_schema"]
18497
- };
18522
+ const input_openapi = raw["input_openapi"];
18523
+ const output = raw["output"];
18524
+ validateInputPath((0, import_node_path.resolve)(opts.cwd, input_openapi));
18525
+ validateOutputPath((0, import_node_path.resolve)(opts.cwd, output));
18526
+ const base = { input_openapi, output };
18527
+ return opts.parse(raw, base, opts.cwd);
18528
+ }
18529
+
18530
+ // src/config.ts
18531
+ async function loadConfig(cwd, configPath) {
18532
+ return loadConfigFile({
18533
+ cwd,
18534
+ configPath,
18535
+ defaultFileName: "openapi-server.config.json",
18536
+ parse: (raw) => {
18537
+ const framework = raw["framework"];
18538
+ if (framework !== void 0 && framework !== "hono" && framework !== "express" && framework !== "fastify" && framework !== "none") {
18539
+ throw new Error('"framework" must be one of: "hono", "express", "fastify", or "none"');
18540
+ }
18541
+ if (raw["input_schema"] !== void 0 && (typeof raw["input_schema"] !== "string" || !raw["input_schema"])) {
18542
+ throw new Error('"input_schema" must be a non-empty string path to your Zod schema file');
18543
+ }
18544
+ return {
18545
+ input_openapi: raw["input_openapi"],
18546
+ output: raw["output"],
18547
+ framework,
18548
+ input_schema: raw["input_schema"]
18549
+ };
18550
+ }
18551
+ });
18498
18552
  }
18499
18553
 
18500
18554
  // ../openapi-gen/dist/parser.js
@@ -18745,7 +18799,7 @@ function refToName(ref) {
18745
18799
  function extractPathParamsFromPath(path) {
18746
18800
  const matches = path.match(/\{([^}]+)\}/g);
18747
18801
  if (matches === null) return [];
18748
- return matches.map((m) => sanitizeOperationId(m.slice(1, -1)));
18802
+ return matches.map((m) => sanitizeOperationId2(m.slice(1, -1)));
18749
18803
  }
18750
18804
  function resolveParam(p, spec) {
18751
18805
  if (!isRef3(p)) return p;
@@ -18765,7 +18819,7 @@ function deriveServiceName(spec) {
18765
18819
  if (safePascal.endsWith("Service")) return safePascal;
18766
18820
  return `${safePascal}Service`;
18767
18821
  }
18768
- function sanitizeOperationId(id) {
18822
+ function sanitizeOperationId2(id) {
18769
18823
  const parts = id.replace(/'/g, "").split(/[^a-zA-Z0-9]+/).filter(Boolean);
18770
18824
  if (parts.length === 0) return "unknown";
18771
18825
  const [first = "", ...rest] = parts;
@@ -18774,11 +18828,11 @@ function sanitizeOperationId(id) {
18774
18828
  }
18775
18829
  function deriveMethodName(operationId, method, path) {
18776
18830
  if (operationId !== void 0 && operationId.length > 0) {
18777
- return sanitizeOperationId(operationId);
18831
+ return sanitizeOperationId2(operationId);
18778
18832
  }
18779
- return deriveOperationName(method, path);
18833
+ return deriveOperationName2(method, path);
18780
18834
  }
18781
- function deriveOperationName(method, path) {
18835
+ function deriveOperationName2(method, path) {
18782
18836
  const prefixMap = {
18783
18837
  get: "get",
18784
18838
  post: "create",
@@ -18792,13 +18846,13 @@ function deriveOperationName(method, path) {
18792
18846
  const paramMatches = seg.match(/\{([^}]+)\}/g);
18793
18847
  if (paramMatches !== null && !(seg.startsWith("{") && seg.endsWith("}"))) {
18794
18848
  return paramMatches.map((m) => {
18795
- const name = sanitizeOperationId(m.slice(1, -1));
18849
+ const name = sanitizeOperationId2(m.slice(1, -1));
18796
18850
  return "By" + name.charAt(0).toUpperCase() + name.slice(1);
18797
18851
  }).join("");
18798
18852
  }
18799
18853
  if (seg.startsWith("{") && seg.endsWith("}")) {
18800
18854
  const name = seg.slice(1, -1);
18801
- const sanitized = sanitizeOperationId(name);
18855
+ const sanitized = sanitizeOperationId2(name);
18802
18856
  return "By" + sanitized.charAt(0).toUpperCase() + sanitized.slice(1);
18803
18857
  }
18804
18858
  return toTypeName(seg);
@@ -19008,7 +19062,7 @@ function deriveServiceName2(spec) {
19008
19062
  if (safePascal.endsWith("Service")) return safePascal;
19009
19063
  return `${safePascal}Service`;
19010
19064
  }
19011
- function sanitizeOperationId2(id) {
19065
+ function sanitizeOperationId3(id) {
19012
19066
  const parts = id.replace(/'/g, "").split(/[^a-zA-Z0-9]+/).filter(Boolean);
19013
19067
  if (parts.length === 0) return "unknown";
19014
19068
  const [first = "", ...rest] = parts;
@@ -19017,11 +19071,11 @@ function sanitizeOperationId2(id) {
19017
19071
  }
19018
19072
  function deriveMethodName2(operationId, method, path) {
19019
19073
  if (operationId !== void 0 && operationId.length > 0) {
19020
- return sanitizeOperationId2(operationId);
19074
+ return sanitizeOperationId3(operationId);
19021
19075
  }
19022
- return deriveOperationName2(method, path);
19076
+ return deriveOperationName3(method, path);
19023
19077
  }
19024
- function deriveOperationName2(method, path) {
19078
+ function deriveOperationName3(method, path) {
19025
19079
  const prefixMap = {
19026
19080
  get: "get",
19027
19081
  post: "create",
@@ -19035,13 +19089,13 @@ function deriveOperationName2(method, path) {
19035
19089
  const paramMatches = seg.match(/\{([^}]+)\}/g);
19036
19090
  if (paramMatches !== null && !(seg.startsWith("{") && seg.endsWith("}"))) {
19037
19091
  return paramMatches.map((m) => {
19038
- const name = sanitizeOperationId2(m.slice(1, -1));
19092
+ const name = sanitizeOperationId3(m.slice(1, -1));
19039
19093
  return "By" + name.charAt(0).toUpperCase() + name.slice(1);
19040
19094
  }).join("");
19041
19095
  }
19042
19096
  if (seg.startsWith("{") && seg.endsWith("}")) {
19043
19097
  const name = seg.slice(1, -1);
19044
- const sanitized = sanitizeOperationId2(name);
19098
+ const sanitized = sanitizeOperationId3(name);
19045
19099
  return "By" + sanitized.charAt(0).toUpperCase() + sanitized.slice(1);
19046
19100
  }
19047
19101
  return toTypeName(seg);
@@ -19745,9 +19799,9 @@ async function generate2(cwd, configPath) {
19745
19799
  console.log(`Done! Generated ${generatedFiles.length} file(s).`);
19746
19800
  }
19747
19801
 
19748
- // src/cli-args.ts
19802
+ // ../openapi-gen/dist/cli-core.js
19749
19803
  var import_node_path3 = require("node:path");
19750
- function parseCliArgs(argv, cwd) {
19804
+ function parseBaseCliArgs(argv, cwd, usage) {
19751
19805
  const args = argv.slice(2);
19752
19806
  if (args.includes("--help") || args.includes("-h")) {
19753
19807
  return { action: "help" };
@@ -19761,10 +19815,7 @@ function parseCliArgs(argv, cwd) {
19761
19815
  if (next === void 0 || next.startsWith("--")) {
19762
19816
  return {
19763
19817
  action: "error",
19764
- message: [
19765
- "Error: --config requires a file path argument",
19766
- "Usage: openapi-server [--config <path-to-config.json>]"
19767
- ].join("\n")
19818
+ message: ["Error: --config requires a file path argument", usage].join("\n")
19768
19819
  };
19769
19820
  }
19770
19821
  const configFile = (0, import_node_path3.resolve)(cwd, next);
@@ -19773,6 +19824,12 @@ function parseCliArgs(argv, cwd) {
19773
19824
  return { action: "run", cwd };
19774
19825
  }
19775
19826
 
19827
+ // src/cli-args.ts
19828
+ var USAGE = "Usage: openapi-server [--config <path-to-config.json>]";
19829
+ function parseCliArgs(argv, cwd) {
19830
+ return parseBaseCliArgs(argv, cwd, USAGE);
19831
+ }
19832
+
19776
19833
  // src/cli.ts
19777
19834
  var parsed = parseCliArgs(process.argv, process.cwd());
19778
19835
  if (parsed.action === "help") {