@kubb/oas 4.12.3 → 4.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +367 -367
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +367 -367
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/utils.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
9
9
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
|
-
var __export
|
|
10
|
+
var __export = (all, symbols) => {
|
|
11
11
|
let target = {};
|
|
12
12
|
for (var name in all) {
|
|
13
13
|
__defProp(target, name, {
|
|
@@ -22,8 +22,8 @@ var __export$1 = (all, symbols) => {
|
|
|
22
22
|
};
|
|
23
23
|
var __copyProps = (to, from, except, desc) => {
|
|
24
24
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
25
|
-
for (var keys = __getOwnPropNames(from), i
|
|
26
|
-
key = keys[i
|
|
25
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
26
|
+
key = keys[i];
|
|
27
27
|
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
28
28
|
__defProp(to, key, {
|
|
29
29
|
get: ((k) => from[k]).bind(null, key),
|
|
@@ -128,7 +128,7 @@ function camelCase$1(input, options) {
|
|
|
128
128
|
function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
129
129
|
if (isFile) {
|
|
130
130
|
const splitArray = text.split(".");
|
|
131
|
-
return splitArray.map((item, i
|
|
131
|
+
return splitArray.map((item, i) => i === splitArray.length - 1 ? camelCase(item, {
|
|
132
132
|
prefix,
|
|
133
133
|
suffix
|
|
134
134
|
}) : camelCase(item)).join("/");
|
|
@@ -243,7 +243,7 @@ var URLPath = class {
|
|
|
243
243
|
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
246
|
-
var tslib_es6_exports = /* @__PURE__ */ __export
|
|
246
|
+
var tslib_es6_exports = /* @__PURE__ */ __export({
|
|
247
247
|
__addDisposableResource: () => __addDisposableResource,
|
|
248
248
|
__assign: () => __assign,
|
|
249
249
|
__asyncDelegator: () => __asyncDelegator,
|
|
@@ -290,14 +290,14 @@ function __rest(s, e) {
|
|
|
290
290
|
var t = {};
|
|
291
291
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
292
292
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") {
|
|
293
|
-
for (var i
|
|
293
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
294
294
|
}
|
|
295
295
|
return t;
|
|
296
296
|
}
|
|
297
297
|
function __decorate(decorators, target, key, desc) {
|
|
298
298
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
299
299
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
300
|
-
else for (var i
|
|
300
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
301
301
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
302
302
|
}
|
|
303
303
|
function __param(paramIndex, decorator) {
|
|
@@ -314,7 +314,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
314
314
|
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
315
315
|
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
316
316
|
var _, done = false;
|
|
317
|
-
for (var i
|
|
317
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
318
318
|
var context = {};
|
|
319
319
|
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
320
320
|
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
@@ -322,7 +322,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
322
322
|
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
323
323
|
extraInitializers.push(accept(f || null));
|
|
324
324
|
};
|
|
325
|
-
var result = (0, decorators[i
|
|
325
|
+
var result = (0, decorators[i])(kind === "accessor" ? {
|
|
326
326
|
get: descriptor.get,
|
|
327
327
|
set: descriptor.set
|
|
328
328
|
} : descriptor[key], context);
|
|
@@ -340,7 +340,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
340
340
|
}
|
|
341
341
|
function __runInitializers(thisArg, initializers, value) {
|
|
342
342
|
var useValue = arguments.length > 2;
|
|
343
|
-
for (var i
|
|
343
|
+
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
344
344
|
return useValue ? value : void 0;
|
|
345
345
|
}
|
|
346
346
|
function __propKey(x) {
|
|
@@ -467,12 +467,12 @@ function __exportStar(m, o) {
|
|
|
467
467
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
468
468
|
}
|
|
469
469
|
function __values(o) {
|
|
470
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i
|
|
470
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
471
471
|
if (m) return m.call(o);
|
|
472
472
|
if (o && typeof o.length === "number") return { next: function() {
|
|
473
|
-
if (o && i
|
|
473
|
+
if (o && i >= o.length) o = void 0;
|
|
474
474
|
return {
|
|
475
|
-
value: o && o[i
|
|
475
|
+
value: o && o[i++],
|
|
476
476
|
done: !o
|
|
477
477
|
};
|
|
478
478
|
} };
|
|
@@ -481,14 +481,14 @@ function __values(o) {
|
|
|
481
481
|
function __read(o, n) {
|
|
482
482
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
483
483
|
if (!m) return o;
|
|
484
|
-
var i
|
|
484
|
+
var i = m.call(o), r, ar = [], e;
|
|
485
485
|
try {
|
|
486
|
-
while ((n === void 0 || n-- > 0) && !(r = i
|
|
486
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
487
487
|
} catch (error) {
|
|
488
488
|
e = { error };
|
|
489
489
|
} finally {
|
|
490
490
|
try {
|
|
491
|
-
if (r && !r.done && (m = i
|
|
491
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
492
492
|
} finally {
|
|
493
493
|
if (e) throw e.error;
|
|
494
494
|
}
|
|
@@ -497,20 +497,20 @@ function __read(o, n) {
|
|
|
497
497
|
}
|
|
498
498
|
/** @deprecated */
|
|
499
499
|
function __spread() {
|
|
500
|
-
for (var ar = [], i
|
|
500
|
+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
501
501
|
return ar;
|
|
502
502
|
}
|
|
503
503
|
/** @deprecated */
|
|
504
504
|
function __spreadArrays() {
|
|
505
|
-
for (var s = 0, i
|
|
506
|
-
for (var r = Array(s), k = 0, i
|
|
505
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
506
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
507
507
|
return r;
|
|
508
508
|
}
|
|
509
509
|
function __spreadArray(to, from, pack) {
|
|
510
510
|
if (pack || arguments.length === 2) {
|
|
511
|
-
for (var i
|
|
512
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i
|
|
513
|
-
ar[i
|
|
511
|
+
for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
|
|
512
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
513
|
+
ar[i] = from[i];
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
@@ -520,10 +520,10 @@ function __await(v) {
|
|
|
520
520
|
}
|
|
521
521
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
522
522
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
523
|
-
var g = generator.apply(thisArg, _arguments || []), i
|
|
524
|
-
return i
|
|
523
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
524
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
525
525
|
return this;
|
|
526
|
-
}, i
|
|
526
|
+
}, i;
|
|
527
527
|
function awaitReturn(f) {
|
|
528
528
|
return function(v) {
|
|
529
529
|
return Promise.resolve(v).then(f, reject);
|
|
@@ -531,7 +531,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
531
531
|
}
|
|
532
532
|
function verb(n, f) {
|
|
533
533
|
if (g[n]) {
|
|
534
|
-
i
|
|
534
|
+
i[n] = function(v) {
|
|
535
535
|
return new Promise(function(a, b) {
|
|
536
536
|
q.push([
|
|
537
537
|
n,
|
|
@@ -541,7 +541,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
541
541
|
]) > 1 || resume(n, v);
|
|
542
542
|
});
|
|
543
543
|
};
|
|
544
|
-
if (f) i
|
|
544
|
+
if (f) i[n] = f(i[n]);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
function resume(n, v) {
|
|
@@ -565,14 +565,14 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
function __asyncDelegator(o) {
|
|
568
|
-
var i
|
|
569
|
-
return i
|
|
568
|
+
var i, p;
|
|
569
|
+
return i = {}, verb("next"), verb("throw", function(e) {
|
|
570
570
|
throw e;
|
|
571
|
-
}), verb("return"), i
|
|
571
|
+
}), verb("return"), i[Symbol.iterator] = function() {
|
|
572
572
|
return this;
|
|
573
|
-
}, i
|
|
573
|
+
}, i;
|
|
574
574
|
function verb(n, f) {
|
|
575
|
-
i
|
|
575
|
+
i[n] = o[n] ? function(v) {
|
|
576
576
|
return (p = !p) ? {
|
|
577
577
|
value: __await(o[n](v)),
|
|
578
578
|
done: false
|
|
@@ -582,12 +582,12 @@ function __asyncDelegator(o) {
|
|
|
582
582
|
}
|
|
583
583
|
function __asyncValues(o) {
|
|
584
584
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
585
|
-
var m = o[Symbol.asyncIterator], i
|
|
586
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i
|
|
585
|
+
var m = o[Symbol.asyncIterator], i;
|
|
586
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
587
587
|
return this;
|
|
588
|
-
}, i
|
|
588
|
+
}, i);
|
|
589
589
|
function verb(n) {
|
|
590
|
-
i
|
|
590
|
+
i[n] = o[n] && function(v) {
|
|
591
591
|
return new Promise(function(resolve, reject) {
|
|
592
592
|
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
593
593
|
});
|
|
@@ -611,7 +611,7 @@ function __importStar(mod) {
|
|
|
611
611
|
if (mod && mod.__esModule) return mod;
|
|
612
612
|
var result = {};
|
|
613
613
|
if (mod != null) {
|
|
614
|
-
for (var k = ownKeys(mod), i
|
|
614
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
615
615
|
}
|
|
616
616
|
__setModuleDefault(result, mod);
|
|
617
617
|
return result;
|
|
@@ -705,8 +705,8 @@ var init_tslib_es6 = __esmMin((() => {
|
|
|
705
705
|
};
|
|
706
706
|
__assign = function() {
|
|
707
707
|
__assign = Object.assign || function __assign$1(t) {
|
|
708
|
-
for (var s, i
|
|
709
|
-
s = arguments[i
|
|
708
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
709
|
+
s = arguments[i];
|
|
710
710
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
711
711
|
}
|
|
712
712
|
return t;
|
|
@@ -788,13 +788,13 @@ var init_tslib_es6 = __esmMin((() => {
|
|
|
788
788
|
var require_yamlAST = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
789
789
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
790
790
|
var Kind;
|
|
791
|
-
(function(Kind
|
|
792
|
-
Kind
|
|
793
|
-
Kind
|
|
794
|
-
Kind
|
|
795
|
-
Kind
|
|
796
|
-
Kind
|
|
797
|
-
Kind
|
|
791
|
+
(function(Kind) {
|
|
792
|
+
Kind[Kind["SCALAR"] = 0] = "SCALAR";
|
|
793
|
+
Kind[Kind["MAPPING"] = 1] = "MAPPING";
|
|
794
|
+
Kind[Kind["MAP"] = 2] = "MAP";
|
|
795
|
+
Kind[Kind["SEQ"] = 3] = "SEQ";
|
|
796
|
+
Kind[Kind["ANCHOR_REF"] = 4] = "ANCHOR_REF";
|
|
797
|
+
Kind[Kind["INCLUDE_REF"] = 5] = "INCLUDE_REF";
|
|
798
798
|
})(Kind = exports.Kind || (exports.Kind = {}));
|
|
799
799
|
function newMapping(key, value) {
|
|
800
800
|
var end = value ? value.endPosition : key.endPosition + 1;
|
|
@@ -872,10 +872,10 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
872
872
|
return typeof subject === "undefined" || null === subject;
|
|
873
873
|
}
|
|
874
874
|
exports.isNothing = isNothing;
|
|
875
|
-
function isObject
|
|
875
|
+
function isObject(subject) {
|
|
876
876
|
return typeof subject === "object" && null !== subject;
|
|
877
877
|
}
|
|
878
|
-
exports.isObject = isObject
|
|
878
|
+
exports.isObject = isObject;
|
|
879
879
|
function toArray(sequence) {
|
|
880
880
|
if (Array.isArray(sequence)) return sequence;
|
|
881
881
|
else if (isNothing(sequence)) return [];
|
|
@@ -909,7 +909,7 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
909
909
|
//#endregion
|
|
910
910
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js
|
|
911
911
|
var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
912
|
-
var YAMLException
|
|
912
|
+
var YAMLException = class YAMLException {
|
|
913
913
|
constructor(reason, mark = null, isWarning = false) {
|
|
914
914
|
this.name = "YAMLException";
|
|
915
915
|
this.reason = reason;
|
|
@@ -919,12 +919,12 @@ var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
919
919
|
}
|
|
920
920
|
static isInstance(instance) {
|
|
921
921
|
if (instance != null && instance.getClassIdentifier && typeof instance.getClassIdentifier == "function") {
|
|
922
|
-
for (let currentIdentifier of instance.getClassIdentifier()) if (currentIdentifier == YAMLException
|
|
922
|
+
for (let currentIdentifier of instance.getClassIdentifier()) if (currentIdentifier == YAMLException.CLASS_IDENTIFIER) return true;
|
|
923
923
|
}
|
|
924
924
|
return false;
|
|
925
925
|
}
|
|
926
926
|
getClassIdentifier() {
|
|
927
|
-
return [].concat(YAMLException
|
|
927
|
+
return [].concat(YAMLException.CLASS_IDENTIFIER);
|
|
928
928
|
}
|
|
929
929
|
toString(compact = false) {
|
|
930
930
|
var result = "JS-YAML: " + (this.reason || "(unknown reason)");
|
|
@@ -932,15 +932,15 @@ var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
932
932
|
return result;
|
|
933
933
|
}
|
|
934
934
|
};
|
|
935
|
-
YAMLException
|
|
936
|
-
module.exports = YAMLException
|
|
935
|
+
YAMLException.CLASS_IDENTIFIER = "yaml-ast-parser.YAMLException";
|
|
936
|
+
module.exports = YAMLException;
|
|
937
937
|
}));
|
|
938
938
|
|
|
939
939
|
//#endregion
|
|
940
940
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js
|
|
941
941
|
var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
942
|
-
const common
|
|
943
|
-
var Mark
|
|
942
|
+
const common = require_common();
|
|
943
|
+
var Mark = class {
|
|
944
944
|
constructor(name, buffer, position, line, column) {
|
|
945
945
|
this.name = name;
|
|
946
946
|
this.buffer = buffer;
|
|
@@ -974,7 +974,7 @@ var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
976
|
snippet = this.buffer.slice(start, end);
|
|
977
|
-
return common
|
|
977
|
+
return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
|
|
978
978
|
}
|
|
979
979
|
toString(compact = true) {
|
|
980
980
|
var snippet, where = "";
|
|
@@ -987,14 +987,14 @@ var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
987
987
|
return where;
|
|
988
988
|
}
|
|
989
989
|
};
|
|
990
|
-
module.exports = Mark
|
|
990
|
+
module.exports = Mark;
|
|
991
991
|
}));
|
|
992
992
|
|
|
993
993
|
//#endregion
|
|
994
994
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type.js
|
|
995
995
|
var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
996
996
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
997
|
-
const YAMLException
|
|
997
|
+
const YAMLException = require_exception();
|
|
998
998
|
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
999
999
|
"kind",
|
|
1000
1000
|
"resolve",
|
|
@@ -1023,7 +1023,7 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1023
1023
|
constructor(tag, options) {
|
|
1024
1024
|
options = options || {};
|
|
1025
1025
|
Object.keys(options).forEach(function(name) {
|
|
1026
|
-
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException
|
|
1026
|
+
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type.");
|
|
1027
1027
|
});
|
|
1028
1028
|
this.tag = tag;
|
|
1029
1029
|
this.kind = options["kind"] || null;
|
|
@@ -1038,7 +1038,7 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1038
1038
|
this.represent = options["represent"] || null;
|
|
1039
1039
|
this.defaultStyle = options["defaultStyle"] || null;
|
|
1040
1040
|
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
1041
|
-
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException
|
|
1041
|
+
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type.");
|
|
1042
1042
|
}
|
|
1043
1043
|
};
|
|
1044
1044
|
exports.Type = Type;
|
|
@@ -1048,15 +1048,15 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1048
1048
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js
|
|
1049
1049
|
var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1050
1050
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1051
|
-
const common
|
|
1052
|
-
const YAMLException
|
|
1053
|
-
const type_1
|
|
1054
|
-
function compileList(schema
|
|
1051
|
+
const common = require_common();
|
|
1052
|
+
const YAMLException = require_exception();
|
|
1053
|
+
const type_1 = require_type();
|
|
1054
|
+
function compileList(schema, name, result) {
|
|
1055
1055
|
var exclude = [];
|
|
1056
|
-
schema
|
|
1056
|
+
schema.include.forEach(function(includedSchema) {
|
|
1057
1057
|
result = compileList(includedSchema, name, result);
|
|
1058
1058
|
});
|
|
1059
|
-
schema
|
|
1059
|
+
schema[name].forEach(function(currentType) {
|
|
1060
1060
|
result.forEach(function(previousType, previousIndex) {
|
|
1061
1061
|
if (previousType.tag === currentType.tag) exclude.push(previousIndex);
|
|
1062
1062
|
});
|
|
@@ -1080,7 +1080,7 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1080
1080
|
this.implicit = definition.implicit || [];
|
|
1081
1081
|
this.explicit = definition.explicit || [];
|
|
1082
1082
|
this.implicit.forEach(function(type) {
|
|
1083
|
-
if (type.loadKind && "scalar" !== type.loadKind) throw new YAMLException
|
|
1083
|
+
if (type.loadKind && "scalar" !== type.loadKind) throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
1084
1084
|
});
|
|
1085
1085
|
this.compiledImplicit = compileList(this, "implicit", []);
|
|
1086
1086
|
this.compiledExplicit = compileList(this, "explicit", []);
|
|
@@ -1100,16 +1100,16 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1100
1100
|
schemas = arguments[0];
|
|
1101
1101
|
types = arguments[1];
|
|
1102
1102
|
break;
|
|
1103
|
-
default: throw new YAMLException
|
|
1103
|
+
default: throw new YAMLException("Wrong number of arguments for Schema.create function");
|
|
1104
1104
|
}
|
|
1105
|
-
schemas = common
|
|
1106
|
-
types = common
|
|
1107
|
-
if (!schemas.every(function(schema
|
|
1108
|
-
return schema
|
|
1109
|
-
})) throw new YAMLException
|
|
1105
|
+
schemas = common.toArray(schemas);
|
|
1106
|
+
types = common.toArray(types);
|
|
1107
|
+
if (!schemas.every(function(schema) {
|
|
1108
|
+
return schema instanceof Schema;
|
|
1109
|
+
})) throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
1110
1110
|
if (!types.every(function(type) {
|
|
1111
|
-
return type instanceof type_1
|
|
1112
|
-
})) throw new YAMLException
|
|
1111
|
+
return type instanceof type_1.Type;
|
|
1112
|
+
})) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1113
1113
|
return new Schema({
|
|
1114
1114
|
include: schemas,
|
|
1115
1115
|
explicit: types
|
|
@@ -1120,8 +1120,8 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1120
1120
|
//#endregion
|
|
1121
1121
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js
|
|
1122
1122
|
var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1123
|
-
const type_1
|
|
1124
|
-
module.exports = new type_1
|
|
1123
|
+
const type_1 = require_type();
|
|
1124
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:str", {
|
|
1125
1125
|
kind: "scalar",
|
|
1126
1126
|
construct: function(data) {
|
|
1127
1127
|
return null !== data ? data : "";
|
|
@@ -1132,8 +1132,8 @@ var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1132
1132
|
//#endregion
|
|
1133
1133
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js
|
|
1134
1134
|
var require_seq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1135
|
-
const type_1
|
|
1136
|
-
module.exports = new type_1
|
|
1135
|
+
const type_1 = require_type();
|
|
1136
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:seq", {
|
|
1137
1137
|
kind: "sequence",
|
|
1138
1138
|
construct: function(data) {
|
|
1139
1139
|
return null !== data ? data : [];
|
|
@@ -1144,8 +1144,8 @@ var require_seq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1144
1144
|
//#endregion
|
|
1145
1145
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js
|
|
1146
1146
|
var require_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1147
|
-
const type_1
|
|
1148
|
-
module.exports = new type_1
|
|
1147
|
+
const type_1 = require_type();
|
|
1148
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:map", {
|
|
1149
1149
|
kind: "mapping",
|
|
1150
1150
|
construct: function(data) {
|
|
1151
1151
|
return null !== data ? data : {};
|
|
@@ -1156,8 +1156,8 @@ var require_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1156
1156
|
//#endregion
|
|
1157
1157
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js
|
|
1158
1158
|
var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1159
|
-
const schema_1
|
|
1160
|
-
module.exports = new schema_1
|
|
1159
|
+
const schema_1 = require_schema();
|
|
1160
|
+
module.exports = new schema_1.Schema({ explicit: [
|
|
1161
1161
|
require_str(),
|
|
1162
1162
|
require_seq(),
|
|
1163
1163
|
require_map()
|
|
@@ -1167,7 +1167,7 @@ var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1167
1167
|
//#endregion
|
|
1168
1168
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js
|
|
1169
1169
|
var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1170
|
-
const type_1
|
|
1170
|
+
const type_1 = require_type();
|
|
1171
1171
|
function resolveYamlNull(data) {
|
|
1172
1172
|
if (null === data) return true;
|
|
1173
1173
|
var max = data.length;
|
|
@@ -1179,7 +1179,7 @@ var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1179
1179
|
function isNull(object) {
|
|
1180
1180
|
return null === object;
|
|
1181
1181
|
}
|
|
1182
|
-
module.exports = new type_1
|
|
1182
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:null", {
|
|
1183
1183
|
kind: "scalar",
|
|
1184
1184
|
resolve: resolveYamlNull,
|
|
1185
1185
|
construct: constructYamlNull,
|
|
@@ -1205,7 +1205,7 @@ var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1205
1205
|
//#endregion
|
|
1206
1206
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js
|
|
1207
1207
|
var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1208
|
-
const type_1
|
|
1208
|
+
const type_1 = require_type();
|
|
1209
1209
|
function resolveYamlBoolean(data) {
|
|
1210
1210
|
if (null === data) return false;
|
|
1211
1211
|
var max = data.length;
|
|
@@ -1217,7 +1217,7 @@ var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1217
1217
|
function isBoolean(object) {
|
|
1218
1218
|
return "[object Boolean]" === Object.prototype.toString.call(object);
|
|
1219
1219
|
}
|
|
1220
|
-
module.exports = new type_1
|
|
1220
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:bool", {
|
|
1221
1221
|
kind: "scalar",
|
|
1222
1222
|
resolve: resolveYamlBoolean,
|
|
1223
1223
|
construct: constructYamlBoolean,
|
|
@@ -1240,8 +1240,8 @@ var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1240
1240
|
//#endregion
|
|
1241
1241
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js
|
|
1242
1242
|
var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1243
|
-
const common
|
|
1244
|
-
const type_1
|
|
1243
|
+
const common = require_common();
|
|
1244
|
+
const type_1 = require_type();
|
|
1245
1245
|
function isHexCode(c) {
|
|
1246
1246
|
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
1247
1247
|
}
|
|
@@ -1333,9 +1333,9 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
function isInteger(object) {
|
|
1335
1335
|
const type = Object.prototype.toString.call(object);
|
|
1336
|
-
return "[object Number]" === type && 0 === object % 1 && !common
|
|
1336
|
+
return "[object Number]" === type && 0 === object % 1 && !common.isNegativeZero(object) || "[object BigInt]" === type;
|
|
1337
1337
|
}
|
|
1338
|
-
module.exports = new type_1
|
|
1338
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:int", {
|
|
1339
1339
|
kind: "scalar",
|
|
1340
1340
|
resolve: resolveYamlInteger,
|
|
1341
1341
|
construct: constructYamlInteger,
|
|
@@ -1367,8 +1367,8 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1367
1367
|
//#endregion
|
|
1368
1368
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js
|
|
1369
1369
|
var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1370
|
-
const common
|
|
1371
|
-
const type_1
|
|
1370
|
+
const common = require_common();
|
|
1371
|
+
const type_1 = require_type();
|
|
1372
1372
|
var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
1373
1373
|
function resolveYamlFloat(data) {
|
|
1374
1374
|
if (null === data) return false;
|
|
@@ -1410,13 +1410,13 @@ var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1410
1410
|
case "uppercase": return "-.INF";
|
|
1411
1411
|
case "camelcase": return "-.Inf";
|
|
1412
1412
|
}
|
|
1413
|
-
else if (common
|
|
1413
|
+
else if (common.isNegativeZero(object)) return "-0.0";
|
|
1414
1414
|
return object.toString(10);
|
|
1415
1415
|
}
|
|
1416
1416
|
function isFloat(object) {
|
|
1417
|
-
return "[object Number]" === Object.prototype.toString.call(object) && (0 !== object % 1 || common
|
|
1417
|
+
return "[object Number]" === Object.prototype.toString.call(object) && (0 !== object % 1 || common.isNegativeZero(object));
|
|
1418
1418
|
}
|
|
1419
|
-
module.exports = new type_1
|
|
1419
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:float", {
|
|
1420
1420
|
kind: "scalar",
|
|
1421
1421
|
resolve: resolveYamlFloat,
|
|
1422
1422
|
construct: constructYamlFloat,
|
|
@@ -1429,8 +1429,8 @@ var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1429
1429
|
//#endregion
|
|
1430
1430
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js
|
|
1431
1431
|
var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1432
|
-
const schema_1
|
|
1433
|
-
module.exports = new schema_1
|
|
1432
|
+
const schema_1 = require_schema();
|
|
1433
|
+
module.exports = new schema_1.Schema({
|
|
1434
1434
|
include: [require_failsafe()],
|
|
1435
1435
|
implicit: [
|
|
1436
1436
|
require_null(),
|
|
@@ -1444,14 +1444,14 @@ var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1444
1444
|
//#endregion
|
|
1445
1445
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js
|
|
1446
1446
|
var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1447
|
-
const schema_1
|
|
1448
|
-
module.exports = new schema_1
|
|
1447
|
+
const schema_1 = require_schema();
|
|
1448
|
+
module.exports = new schema_1.Schema({ include: [require_json()] });
|
|
1449
1449
|
}));
|
|
1450
1450
|
|
|
1451
1451
|
//#endregion
|
|
1452
1452
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js
|
|
1453
1453
|
var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1454
|
-
const type_1
|
|
1454
|
+
const type_1 = require_type();
|
|
1455
1455
|
var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");
|
|
1456
1456
|
function resolveYamlTimestamp(data) {
|
|
1457
1457
|
if (null === data) return false;
|
|
@@ -1487,7 +1487,7 @@ var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1487
1487
|
function representYamlTimestamp(object) {
|
|
1488
1488
|
return object.toISOString();
|
|
1489
1489
|
}
|
|
1490
|
-
module.exports = new type_1
|
|
1490
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:timestamp", {
|
|
1491
1491
|
kind: "scalar",
|
|
1492
1492
|
resolve: resolveYamlTimestamp,
|
|
1493
1493
|
construct: constructYamlTimestamp,
|
|
@@ -1499,11 +1499,11 @@ var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1499
1499
|
//#endregion
|
|
1500
1500
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js
|
|
1501
1501
|
var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1502
|
-
const type_1
|
|
1502
|
+
const type_1 = require_type();
|
|
1503
1503
|
function resolveYamlMerge(data) {
|
|
1504
1504
|
return "<<" === data || null === data;
|
|
1505
1505
|
}
|
|
1506
|
-
module.exports = new type_1
|
|
1506
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:merge", {
|
|
1507
1507
|
kind: "scalar",
|
|
1508
1508
|
resolve: resolveYamlMerge
|
|
1509
1509
|
});
|
|
@@ -1513,7 +1513,7 @@ var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1513
1513
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js
|
|
1514
1514
|
var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1515
1515
|
var NodeBuffer = require("buffer").Buffer;
|
|
1516
|
-
const type_1
|
|
1516
|
+
const type_1 = require_type();
|
|
1517
1517
|
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
1518
1518
|
function resolveYamlBinary(data) {
|
|
1519
1519
|
if (null === data) return false;
|
|
@@ -1581,7 +1581,7 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1581
1581
|
function isBinary(object) {
|
|
1582
1582
|
return NodeBuffer && NodeBuffer.isBuffer(object);
|
|
1583
1583
|
}
|
|
1584
|
-
module.exports = new type_1
|
|
1584
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:binary", {
|
|
1585
1585
|
kind: "scalar",
|
|
1586
1586
|
resolve: resolveYamlBinary,
|
|
1587
1587
|
construct: constructYamlBinary,
|
|
@@ -1593,17 +1593,17 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1593
1593
|
//#endregion
|
|
1594
1594
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js
|
|
1595
1595
|
var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1596
|
-
const type_1
|
|
1597
|
-
var _hasOwnProperty
|
|
1598
|
-
var _toString
|
|
1596
|
+
const type_1 = require_type();
|
|
1597
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1598
|
+
var _toString = Object.prototype.toString;
|
|
1599
1599
|
function resolveYamlOmap(data) {
|
|
1600
1600
|
if (null === data) return true;
|
|
1601
1601
|
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
1602
1602
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1603
1603
|
pair = object[index];
|
|
1604
1604
|
pairHasKey = false;
|
|
1605
|
-
if ("[object Object]" !== _toString
|
|
1606
|
-
for (pairKey in pair) if (_hasOwnProperty
|
|
1605
|
+
if ("[object Object]" !== _toString.call(pair)) return false;
|
|
1606
|
+
for (pairKey in pair) if (_hasOwnProperty.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true;
|
|
1607
1607
|
else return false;
|
|
1608
1608
|
if (!pairHasKey) return false;
|
|
1609
1609
|
if (-1 === objectKeys.indexOf(pairKey)) objectKeys.push(pairKey);
|
|
@@ -1614,7 +1614,7 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1614
1614
|
function constructYamlOmap(data) {
|
|
1615
1615
|
return null !== data ? data : [];
|
|
1616
1616
|
}
|
|
1617
|
-
module.exports = new type_1
|
|
1617
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:omap", {
|
|
1618
1618
|
kind: "sequence",
|
|
1619
1619
|
resolve: resolveYamlOmap,
|
|
1620
1620
|
construct: constructYamlOmap
|
|
@@ -1624,16 +1624,16 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1624
1624
|
//#endregion
|
|
1625
1625
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js
|
|
1626
1626
|
var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1627
|
-
const type_1
|
|
1628
|
-
const ast
|
|
1629
|
-
var _toString
|
|
1627
|
+
const type_1 = require_type();
|
|
1628
|
+
const ast = require_yamlAST();
|
|
1629
|
+
var _toString = Object.prototype.toString;
|
|
1630
1630
|
function resolveYamlPairs(data) {
|
|
1631
1631
|
if (null === data) return true;
|
|
1632
|
-
if (data.kind != ast
|
|
1632
|
+
if (data.kind != ast.Kind.SEQ) return false;
|
|
1633
1633
|
var index, length, pair, object = data.items;
|
|
1634
1634
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1635
1635
|
pair = object[index];
|
|
1636
|
-
if ("[object Object]" !== _toString
|
|
1636
|
+
if ("[object Object]" !== _toString.call(pair)) return false;
|
|
1637
1637
|
if (!Array.isArray(pair.mappings)) return false;
|
|
1638
1638
|
if (1 !== pair.mappings.length) return false;
|
|
1639
1639
|
}
|
|
@@ -1642,13 +1642,13 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1642
1642
|
function constructYamlPairs(data) {
|
|
1643
1643
|
if (null === data || !Array.isArray(data.items)) return [];
|
|
1644
1644
|
let index, length, result, object = data.items;
|
|
1645
|
-
result = ast
|
|
1645
|
+
result = ast.newItems();
|
|
1646
1646
|
result.parent = data.parent;
|
|
1647
1647
|
result.startPosition = data.startPosition;
|
|
1648
1648
|
result.endPosition = data.endPosition;
|
|
1649
1649
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1650
1650
|
let mapping = object[index].mappings[0];
|
|
1651
|
-
let pairSeq = ast
|
|
1651
|
+
let pairSeq = ast.newItems();
|
|
1652
1652
|
pairSeq.parent = result;
|
|
1653
1653
|
pairSeq.startPosition = mapping.key.startPosition;
|
|
1654
1654
|
pairSeq.endPosition = mapping.value.startPosition;
|
|
@@ -1659,7 +1659,7 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
return result;
|
|
1661
1661
|
}
|
|
1662
|
-
module.exports = new type_1
|
|
1662
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:pairs", {
|
|
1663
1663
|
kind: "sequence",
|
|
1664
1664
|
resolve: resolveYamlPairs,
|
|
1665
1665
|
construct: constructYamlPairs
|
|
@@ -1669,17 +1669,17 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1669
1669
|
//#endregion
|
|
1670
1670
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js
|
|
1671
1671
|
var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1672
|
-
const type_1
|
|
1673
|
-
const ast
|
|
1672
|
+
const type_1 = require_type();
|
|
1673
|
+
const ast = require_yamlAST();
|
|
1674
1674
|
function resolveYamlSet(data) {
|
|
1675
1675
|
if (null === data) return true;
|
|
1676
|
-
if (data.kind != ast
|
|
1676
|
+
if (data.kind != ast.Kind.MAP) return false;
|
|
1677
1677
|
return true;
|
|
1678
1678
|
}
|
|
1679
1679
|
function constructYamlSet(data) {
|
|
1680
1680
|
return null !== data ? data : {};
|
|
1681
1681
|
}
|
|
1682
|
-
module.exports = new type_1
|
|
1682
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:set", {
|
|
1683
1683
|
kind: "mapping",
|
|
1684
1684
|
resolve: resolveYamlSet,
|
|
1685
1685
|
construct: constructYamlSet
|
|
@@ -1689,7 +1689,7 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1689
1689
|
//#endregion
|
|
1690
1690
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js
|
|
1691
1691
|
var require_default_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1692
|
-
var schema
|
|
1692
|
+
var schema = new (require_schema()).Schema({
|
|
1693
1693
|
include: [require_core()],
|
|
1694
1694
|
implicit: [require_timestamp(), require_merge()],
|
|
1695
1695
|
explicit: [
|
|
@@ -1699,13 +1699,13 @@ var require_default_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1699
1699
|
require_set()
|
|
1700
1700
|
]
|
|
1701
1701
|
});
|
|
1702
|
-
module.exports = schema
|
|
1702
|
+
module.exports = schema;
|
|
1703
1703
|
}));
|
|
1704
1704
|
|
|
1705
1705
|
//#endregion
|
|
1706
1706
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js
|
|
1707
1707
|
var require_undefined = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1708
|
-
const type_1
|
|
1708
|
+
const type_1 = require_type();
|
|
1709
1709
|
function resolveJavascriptUndefined() {
|
|
1710
1710
|
return true;
|
|
1711
1711
|
}
|
|
@@ -1716,7 +1716,7 @@ var require_undefined = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1716
1716
|
function isUndefined(object) {
|
|
1717
1717
|
return "undefined" === typeof object;
|
|
1718
1718
|
}
|
|
1719
|
-
module.exports = new type_1
|
|
1719
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:js/undefined", {
|
|
1720
1720
|
kind: "scalar",
|
|
1721
1721
|
resolve: resolveJavascriptUndefined,
|
|
1722
1722
|
construct: constructJavascriptUndefined,
|
|
@@ -1789,12 +1789,12 @@ var require_default_full = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1789
1789
|
var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1790
1790
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1791
1791
|
const ast = require_yamlAST();
|
|
1792
|
-
const common
|
|
1793
|
-
const YAMLException
|
|
1792
|
+
const common = require_common();
|
|
1793
|
+
const YAMLException = require_exception();
|
|
1794
1794
|
const Mark = require_mark();
|
|
1795
|
-
const DEFAULT_SAFE_SCHEMA
|
|
1796
|
-
const DEFAULT_FULL_SCHEMA
|
|
1797
|
-
var _hasOwnProperty
|
|
1795
|
+
const DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
1796
|
+
const DEFAULT_FULL_SCHEMA = require_default_full();
|
|
1797
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1798
1798
|
var CONTEXT_FLOW_IN = 1;
|
|
1799
1799
|
var CONTEXT_FLOW_OUT = 2;
|
|
1800
1800
|
var CONTEXT_BLOCK_IN = 3;
|
|
@@ -1853,14 +1853,14 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1853
1853
|
customEscapeCheck[i] = 1;
|
|
1854
1854
|
if (!simpleEscapeCheck[i]) customEscapeMap[i] = "\\" + String.fromCharCode(i);
|
|
1855
1855
|
}
|
|
1856
|
-
var State
|
|
1856
|
+
var State = class {
|
|
1857
1857
|
constructor(input, options) {
|
|
1858
1858
|
this.errorMap = {};
|
|
1859
1859
|
this.errors = [];
|
|
1860
1860
|
this.lines = [];
|
|
1861
1861
|
this.input = input;
|
|
1862
1862
|
this.filename = options["filename"] || null;
|
|
1863
|
-
this.schema = options["schema"] || DEFAULT_FULL_SCHEMA
|
|
1863
|
+
this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
|
|
1864
1864
|
this.onWarning = options["onWarning"] || null;
|
|
1865
1865
|
this.legacy = options["legacy"] || false;
|
|
1866
1866
|
this.allowAnyEscape = options["allowAnyEscape"] || false;
|
|
@@ -1876,7 +1876,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1876
1876
|
}
|
|
1877
1877
|
};
|
|
1878
1878
|
function generateError(state, message, isWarning = false) {
|
|
1879
|
-
return new YAMLException
|
|
1879
|
+
return new YAMLException(message, new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart), isWarning);
|
|
1880
1880
|
}
|
|
1881
1881
|
function throwErrorFromPosition(state, position, message, isWarning = false, toLineEnd = false) {
|
|
1882
1882
|
var line = positionToLine(state, position);
|
|
@@ -1885,7 +1885,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1885
1885
|
if (state.errorMap[hash]) return;
|
|
1886
1886
|
var mark = new Mark(state.filename, state.input, position, line.line, position - line.start);
|
|
1887
1887
|
if (toLineEnd) mark.toLineEnd = true;
|
|
1888
|
-
var error = new YAMLException
|
|
1888
|
+
var error = new YAMLException(message, mark, isWarning);
|
|
1889
1889
|
state.errors.push(error);
|
|
1890
1890
|
}
|
|
1891
1891
|
function throwError(state, message) {
|
|
@@ -1935,7 +1935,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1935
1935
|
handle = args[0];
|
|
1936
1936
|
prefix = args[1];
|
|
1937
1937
|
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
1938
|
-
if (_hasOwnProperty
|
|
1938
|
+
if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle");
|
|
1939
1939
|
if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1940
1940
|
state.tagMap[handle] = prefix;
|
|
1941
1941
|
}
|
|
@@ -1995,9 +1995,9 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
function positionToLine(state, position) {
|
|
1997
1997
|
var line;
|
|
1998
|
-
for (var i
|
|
1999
|
-
if (state.lines[i
|
|
2000
|
-
line = state.lines[i
|
|
1998
|
+
for (var i = 0; i < state.lines.length; i++) {
|
|
1999
|
+
if (state.lines[i].start > position) break;
|
|
2000
|
+
line = state.lines[i];
|
|
2001
2001
|
}
|
|
2002
2002
|
if (!line) return {
|
|
2003
2003
|
start: 0,
|
|
@@ -2052,7 +2052,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
function writeFoldedLines(state, scalar, count) {
|
|
2054
2054
|
if (1 === count) scalar.value += " ";
|
|
2055
|
-
else if (count > 1) scalar.value += common
|
|
2055
|
+
else if (count > 1) scalar.value += common.repeat("\n", count - 1);
|
|
2056
2056
|
}
|
|
2057
2057
|
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
2058
2058
|
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
@@ -2307,7 +2307,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2307
2307
|
continue;
|
|
2308
2308
|
}
|
|
2309
2309
|
if (state.lineIndent < textIndent) {
|
|
2310
|
-
if (chomping === CHOMPING_KEEP) sc.value += common
|
|
2310
|
+
if (chomping === CHOMPING_KEEP) sc.value += common.repeat("\n", emptyLines);
|
|
2311
2311
|
else if (chomping === CHOMPING_CLIP) {
|
|
2312
2312
|
if (detectedIndent) sc.value += "\n";
|
|
2313
2313
|
}
|
|
@@ -2315,14 +2315,14 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
if (folding) if (is_WHITE_SPACE(ch)) {
|
|
2317
2317
|
atMoreIndented = true;
|
|
2318
|
-
sc.value += common
|
|
2318
|
+
sc.value += common.repeat("\n", emptyLines + 1);
|
|
2319
2319
|
} else if (atMoreIndented) {
|
|
2320
2320
|
atMoreIndented = false;
|
|
2321
|
-
sc.value += common
|
|
2321
|
+
sc.value += common.repeat("\n", emptyLines + 1);
|
|
2322
2322
|
} else if (0 === emptyLines) {
|
|
2323
2323
|
if (detectedIndent) sc.value += " ";
|
|
2324
|
-
} else sc.value += common
|
|
2325
|
-
else if (detectedIndent) sc.value += common
|
|
2324
|
+
} else sc.value += common.repeat("\n", emptyLines);
|
|
2325
|
+
else if (detectedIndent) sc.value += common.repeat("\n", emptyLines + 1);
|
|
2326
2326
|
detectedIndent = true;
|
|
2327
2327
|
emptyLines = 0;
|
|
2328
2328
|
captureStart = state.position;
|
|
@@ -2330,18 +2330,18 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2330
2330
|
captureSegment(state, captureStart, state.position, false);
|
|
2331
2331
|
}
|
|
2332
2332
|
sc.endPosition = state.position;
|
|
2333
|
-
var i
|
|
2333
|
+
var i = state.position - 1;
|
|
2334
2334
|
var needMinus = false;
|
|
2335
2335
|
while (true) {
|
|
2336
|
-
var c = state.input[i
|
|
2336
|
+
var c = state.input[i];
|
|
2337
2337
|
if (c == "\r" || c == "\n") {
|
|
2338
|
-
if (needMinus) i
|
|
2338
|
+
if (needMinus) i--;
|
|
2339
2339
|
break;
|
|
2340
2340
|
}
|
|
2341
2341
|
if (c != " " && c != " ") break;
|
|
2342
|
-
i
|
|
2342
|
+
i--;
|
|
2343
2343
|
}
|
|
2344
|
-
sc.endPosition = i
|
|
2344
|
+
sc.endPosition = i;
|
|
2345
2345
|
sc.rawValue = state.input.substring(sc.startPosition, sc.endPosition);
|
|
2346
2346
|
return true;
|
|
2347
2347
|
}
|
|
@@ -2510,7 +2510,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2510
2510
|
}
|
|
2511
2511
|
if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
2512
2512
|
if (isVerbatim) state.tag = tagName;
|
|
2513
|
-
else if (_hasOwnProperty
|
|
2513
|
+
else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
|
|
2514
2514
|
else if ("!" === tagHandle) state.tag = "!" + tagName;
|
|
2515
2515
|
else if ("!!" === tagHandle) state.tag = "tag:yaml.org,2002:" + tagName;
|
|
2516
2516
|
else throwError(state, "undeclared tag handle \"" + tagHandle + "\"");
|
|
@@ -2616,7 +2616,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2616
2616
|
break;
|
|
2617
2617
|
}
|
|
2618
2618
|
}
|
|
2619
|
-
else if (_hasOwnProperty
|
|
2619
|
+
else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
|
|
2620
2620
|
type = state.typeMap[state.tag];
|
|
2621
2621
|
if (null !== state.result && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\"");
|
|
2622
2622
|
if (!type.resolve(state.result)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
@@ -2661,7 +2661,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2661
2661
|
directiveArgs.push(state.input.slice(_position, state.position));
|
|
2662
2662
|
}
|
|
2663
2663
|
if (0 !== ch) readLineBreak(state);
|
|
2664
|
-
if (_hasOwnProperty
|
|
2664
|
+
if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
2665
2665
|
else {
|
|
2666
2666
|
throwWarning(state, "unknown document directive \"" + directiveName + "\"");
|
|
2667
2667
|
state.position++;
|
|
@@ -2695,7 +2695,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2695
2695
|
if (10 !== input.charCodeAt(inputLength - 1) && 13 !== input.charCodeAt(inputLength - 1)) input += "\n";
|
|
2696
2696
|
if (input.charCodeAt(0) === 65279) input = input.slice(1);
|
|
2697
2697
|
}
|
|
2698
|
-
var state = new State
|
|
2698
|
+
var state = new State(input, options);
|
|
2699
2699
|
state.input += "\0";
|
|
2700
2700
|
while (32 === state.input.charCodeAt(state.position)) {
|
|
2701
2701
|
state.lineIndent += 1;
|
|
@@ -2726,7 +2726,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2726
2726
|
var documents = loadDocuments(input, options);
|
|
2727
2727
|
if (0 === documents.length) return;
|
|
2728
2728
|
else if (1 === documents.length) return documents[0];
|
|
2729
|
-
var e = new YAMLException
|
|
2729
|
+
var e = new YAMLException("expected a single document in the stream, but found more");
|
|
2730
2730
|
e.mark = new Mark("", "", 0, 0, 0);
|
|
2731
2731
|
e.mark.position = documents[0].endPosition;
|
|
2732
2732
|
documents[0].errors.push(e);
|
|
@@ -2734,11 +2734,11 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2734
2734
|
}
|
|
2735
2735
|
exports.load = load;
|
|
2736
2736
|
function safeLoadAll(input, output, options = {}) {
|
|
2737
|
-
loadAll(input, output, common
|
|
2737
|
+
loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2738
2738
|
}
|
|
2739
2739
|
exports.safeLoadAll = safeLoadAll;
|
|
2740
2740
|
function safeLoad(input, options = {}) {
|
|
2741
|
-
return load(input, common
|
|
2741
|
+
return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2742
2742
|
}
|
|
2743
2743
|
exports.safeLoad = safeLoad;
|
|
2744
2744
|
module.exports.loadAll = loadAll;
|
|
@@ -2815,7 +2815,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2815
2815
|
"Off",
|
|
2816
2816
|
"OFF"
|
|
2817
2817
|
];
|
|
2818
|
-
function compileStyleMap(schema
|
|
2818
|
+
function compileStyleMap(schema, map) {
|
|
2819
2819
|
var result, keys, index, length, tag, style, type;
|
|
2820
2820
|
if (map === null) return {};
|
|
2821
2821
|
result = {};
|
|
@@ -2824,7 +2824,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2824
2824
|
tag = keys[index];
|
|
2825
2825
|
style = String(map[tag]);
|
|
2826
2826
|
if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
2827
|
-
type = schema
|
|
2827
|
+
type = schema.compiledTypeMap["fallback"][tag];
|
|
2828
2828
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
|
|
2829
2829
|
result[tag] = style;
|
|
2830
2830
|
}
|
|
@@ -2911,33 +2911,33 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2911
2911
|
}
|
|
2912
2912
|
var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
|
|
2913
2913
|
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
|
2914
|
-
var i
|
|
2914
|
+
var i;
|
|
2915
2915
|
var char, prev_char;
|
|
2916
2916
|
var hasLineBreak = false;
|
|
2917
2917
|
var hasFoldableLine = false;
|
|
2918
2918
|
var shouldTrackWidth = lineWidth !== -1;
|
|
2919
2919
|
var previousLineBreak = -1;
|
|
2920
2920
|
var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
|
|
2921
|
-
if (singleLineOnly) for (i
|
|
2922
|
-
char = string.charCodeAt(i
|
|
2921
|
+
if (singleLineOnly) for (i = 0; i < string.length; i++) {
|
|
2922
|
+
char = string.charCodeAt(i);
|
|
2923
2923
|
if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
2924
|
-
prev_char = i
|
|
2924
|
+
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2925
2925
|
plain = plain && isPlainSafe(char, prev_char);
|
|
2926
2926
|
}
|
|
2927
2927
|
else {
|
|
2928
|
-
for (i
|
|
2929
|
-
char = string.charCodeAt(i
|
|
2928
|
+
for (i = 0; i < string.length; i++) {
|
|
2929
|
+
char = string.charCodeAt(i);
|
|
2930
2930
|
if (char === CHAR_LINE_FEED) {
|
|
2931
2931
|
hasLineBreak = true;
|
|
2932
2932
|
if (shouldTrackWidth) {
|
|
2933
|
-
hasFoldableLine = hasFoldableLine || i
|
|
2934
|
-
previousLineBreak = i
|
|
2933
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
2934
|
+
previousLineBreak = i;
|
|
2935
2935
|
}
|
|
2936
2936
|
} else if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
2937
|
-
prev_char = i
|
|
2937
|
+
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2938
2938
|
plain = plain && isPlainSafe(char, prev_char);
|
|
2939
2939
|
}
|
|
2940
|
-
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i
|
|
2940
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
2941
2941
|
}
|
|
2942
2942
|
if (!hasLineBreak && !hasFoldableLine) return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
|
|
2943
2943
|
if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
|
|
@@ -2963,7 +2963,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2963
2963
|
}
|
|
2964
2964
|
}();
|
|
2965
2965
|
if (!iskey) {
|
|
2966
|
-
let comment = new Comments
|
|
2966
|
+
let comment = new Comments(state, pointer).write(level, "before-eol");
|
|
2967
2967
|
if (comment !== "") _result += " " + comment;
|
|
2968
2968
|
}
|
|
2969
2969
|
state.dump = _result;
|
|
@@ -3019,18 +3019,18 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3019
3019
|
var result = "";
|
|
3020
3020
|
var char, nextChar;
|
|
3021
3021
|
var escapeSeq;
|
|
3022
|
-
for (var i
|
|
3023
|
-
char = string.charCodeAt(i
|
|
3022
|
+
for (var i = 0; i < string.length; i++) {
|
|
3023
|
+
char = string.charCodeAt(i);
|
|
3024
3024
|
if (char >= 55296 && char <= 56319) {
|
|
3025
|
-
nextChar = string.charCodeAt(i
|
|
3025
|
+
nextChar = string.charCodeAt(i + 1);
|
|
3026
3026
|
if (nextChar >= 56320 && nextChar <= 57343) {
|
|
3027
3027
|
result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
|
|
3028
|
-
i
|
|
3028
|
+
i++;
|
|
3029
3029
|
continue;
|
|
3030
3030
|
}
|
|
3031
3031
|
}
|
|
3032
3032
|
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
3033
|
-
result += !escapeSeq && isPrintable(char) ? string[i
|
|
3033
|
+
result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
|
|
3034
3034
|
}
|
|
3035
3035
|
return result;
|
|
3036
3036
|
}
|
|
@@ -3045,7 +3045,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3045
3045
|
}
|
|
3046
3046
|
function writeBlockSequence(state, level, object, compact, pointer) {
|
|
3047
3047
|
var _result = "", _tag = state.tag, index, length;
|
|
3048
|
-
var comments = new Comments
|
|
3048
|
+
var comments = new Comments(state, pointer);
|
|
3049
3049
|
_result += comments.write(level, "before-eol");
|
|
3050
3050
|
_result += comments.write(level, "leading");
|
|
3051
3051
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
@@ -3085,7 +3085,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3085
3085
|
if (state.sortKeys === true) objectKeyList.sort();
|
|
3086
3086
|
else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys);
|
|
3087
3087
|
else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function");
|
|
3088
|
-
var comments = new Comments
|
|
3088
|
+
var comments = new Comments(state, pointer);
|
|
3089
3089
|
_result += comments.write(level, "before-eol");
|
|
3090
3090
|
_result += comments.write(level, "leading");
|
|
3091
3091
|
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
@@ -3100,7 +3100,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3100
3100
|
else pairBuffer += "? ";
|
|
3101
3101
|
pairBuffer += state.dump;
|
|
3102
3102
|
if (explicitPair) pairBuffer += generateNextLine(state, level);
|
|
3103
|
-
if (!writeNode(state, level + 1, objectValue, true, explicitPair, false, `${pointer}/${encodeSegment
|
|
3103
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair, false, `${pointer}/${encodeSegment(objectKey)}`)) continue;
|
|
3104
3104
|
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
|
|
3105
3105
|
else pairBuffer += ": ";
|
|
3106
3106
|
pairBuffer += state.dump;
|
|
@@ -3205,12 +3205,12 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3205
3205
|
return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
3206
3206
|
}
|
|
3207
3207
|
exports.safeDump = safeDump;
|
|
3208
|
-
const TILDE_REGEXP
|
|
3209
|
-
const SLASH_REGEXP
|
|
3210
|
-
function encodeSegment
|
|
3211
|
-
return input.replace(TILDE_REGEXP
|
|
3208
|
+
const TILDE_REGEXP = /~/g;
|
|
3209
|
+
const SLASH_REGEXP = /\//g;
|
|
3210
|
+
function encodeSegment(input) {
|
|
3211
|
+
return input.replace(TILDE_REGEXP, "~0").replace(SLASH_REGEXP, "~1");
|
|
3212
3212
|
}
|
|
3213
|
-
function Comments
|
|
3213
|
+
function Comments(state, pointer) {
|
|
3214
3214
|
this.state = state;
|
|
3215
3215
|
this.comments = {
|
|
3216
3216
|
"before-eol": /* @__PURE__ */ new Set(),
|
|
@@ -3236,18 +3236,18 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3236
3236
|
break;
|
|
3237
3237
|
}
|
|
3238
3238
|
}
|
|
3239
|
-
Comments
|
|
3239
|
+
Comments.prototype.write = function(level, placement) {
|
|
3240
3240
|
let result = "";
|
|
3241
3241
|
for (let comment of this.comments[placement]) result += this._write(comment, level);
|
|
3242
3242
|
return result;
|
|
3243
3243
|
};
|
|
3244
|
-
Comments
|
|
3244
|
+
Comments.prototype.writeAt = function(key, level, placement) {
|
|
3245
3245
|
let result = "";
|
|
3246
3246
|
let comments = this.comments[placement].get(key);
|
|
3247
3247
|
if (comments) for (let comment of comments) result += this._write(comment, level);
|
|
3248
3248
|
return result;
|
|
3249
3249
|
};
|
|
3250
|
-
Comments
|
|
3250
|
+
Comments.prototype._write = function(comment, level) {
|
|
3251
3251
|
if (this.written.has(comment)) return "";
|
|
3252
3252
|
this.written.add(comment);
|
|
3253
3253
|
let result = "#" + comment.value;
|
|
@@ -3305,12 +3305,12 @@ var require_scalarInference = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3305
3305
|
}
|
|
3306
3306
|
exports.parseYamlFloat = parseYamlFloat;
|
|
3307
3307
|
var ScalarType;
|
|
3308
|
-
(function(ScalarType
|
|
3309
|
-
ScalarType
|
|
3310
|
-
ScalarType
|
|
3311
|
-
ScalarType
|
|
3312
|
-
ScalarType
|
|
3313
|
-
ScalarType
|
|
3308
|
+
(function(ScalarType) {
|
|
3309
|
+
ScalarType[ScalarType["null"] = 0] = "null";
|
|
3310
|
+
ScalarType[ScalarType["bool"] = 1] = "bool";
|
|
3311
|
+
ScalarType[ScalarType["int"] = 2] = "int";
|
|
3312
|
+
ScalarType[ScalarType["float"] = 3] = "float";
|
|
3313
|
+
ScalarType[ScalarType["string"] = 4] = "string";
|
|
3314
3314
|
})(ScalarType = exports.ScalarType || (exports.ScalarType = {}));
|
|
3315
3315
|
function determineScalarType(node) {
|
|
3316
3316
|
if (node === void 0) return ScalarType.null;
|
|
@@ -3367,9 +3367,9 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3367
3367
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/types.js
|
|
3368
3368
|
var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3369
3369
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3370
|
-
const yaml_ast_parser_1
|
|
3371
|
-
exports.Kind = yaml_ast_parser_1
|
|
3372
|
-
exports.ScalarType = yaml_ast_parser_1
|
|
3370
|
+
const yaml_ast_parser_1 = require_src$1();
|
|
3371
|
+
exports.Kind = yaml_ast_parser_1.Kind;
|
|
3372
|
+
exports.ScalarType = yaml_ast_parser_1.ScalarType;
|
|
3373
3373
|
}));
|
|
3374
3374
|
|
|
3375
3375
|
//#endregion
|
|
@@ -3383,24 +3383,24 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3383
3383
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/buildJsonPath.js
|
|
3384
3384
|
var require_buildJsonPath = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3385
3385
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3386
|
-
const types_1
|
|
3387
|
-
const utils_1
|
|
3386
|
+
const types_1 = require_types();
|
|
3387
|
+
const utils_1 = require_utils();
|
|
3388
3388
|
function buildJsonPath(node) {
|
|
3389
3389
|
const path$1 = [];
|
|
3390
3390
|
let prevNode = node;
|
|
3391
3391
|
while (node) {
|
|
3392
3392
|
switch (node.kind) {
|
|
3393
|
-
case types_1
|
|
3393
|
+
case types_1.Kind.SCALAR:
|
|
3394
3394
|
path$1.unshift(node.value);
|
|
3395
3395
|
break;
|
|
3396
|
-
case types_1
|
|
3397
|
-
if (prevNode !== node.key) if (path$1.length > 0 && utils_1
|
|
3396
|
+
case types_1.Kind.MAPPING:
|
|
3397
|
+
if (prevNode !== node.key) if (path$1.length > 0 && utils_1.isObject(node.value) && node.value.value === path$1[0]) path$1[0] = node.key.value;
|
|
3398
3398
|
else path$1.unshift(node.key.value);
|
|
3399
3399
|
break;
|
|
3400
|
-
case types_1
|
|
3400
|
+
case types_1.Kind.SEQ:
|
|
3401
3401
|
if (prevNode) {
|
|
3402
3402
|
const index = node.items.indexOf(prevNode);
|
|
3403
|
-
if (prevNode.kind === types_1
|
|
3403
|
+
if (prevNode.kind === types_1.Kind.SCALAR) path$1[0] = index;
|
|
3404
3404
|
else if (index !== -1) path$1.unshift(index);
|
|
3405
3405
|
}
|
|
3406
3406
|
break;
|
|
@@ -3417,18 +3417,18 @@ var require_buildJsonPath = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3417
3417
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/dereferenceAnchor.js
|
|
3418
3418
|
var require_dereferenceAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3419
3419
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3420
|
-
const types_1
|
|
3421
|
-
const utils_1
|
|
3420
|
+
const types_1 = require_types();
|
|
3421
|
+
const utils_1 = require_utils();
|
|
3422
3422
|
exports.dereferenceAnchor = (node, anchorId) => {
|
|
3423
|
-
if (!utils_1
|
|
3424
|
-
if (node.kind === types_1
|
|
3423
|
+
if (!utils_1.isObject(node)) return node;
|
|
3424
|
+
if (node.kind === types_1.Kind.ANCHOR_REF && node.referencesAnchor === anchorId) return null;
|
|
3425
3425
|
switch (node.kind) {
|
|
3426
|
-
case types_1
|
|
3427
|
-
case types_1
|
|
3428
|
-
case types_1
|
|
3429
|
-
case types_1
|
|
3430
|
-
case types_1
|
|
3431
|
-
if (utils_1
|
|
3426
|
+
case types_1.Kind.MAP: return Object.assign({}, node, { mappings: node.mappings.map((mapping) => exports.dereferenceAnchor(mapping, anchorId)) });
|
|
3427
|
+
case types_1.Kind.SEQ: return Object.assign({}, node, { items: node.items.map((item) => exports.dereferenceAnchor(item, anchorId)) });
|
|
3428
|
+
case types_1.Kind.MAPPING: return Object.assign({}, node, { value: exports.dereferenceAnchor(node.value, anchorId) });
|
|
3429
|
+
case types_1.Kind.SCALAR: return node;
|
|
3430
|
+
case types_1.Kind.ANCHOR_REF:
|
|
3431
|
+
if (utils_1.isObject(node.value) && isSelfReferencingAnchorRef(node)) return null;
|
|
3432
3432
|
return node;
|
|
3433
3433
|
default: return node;
|
|
3434
3434
|
}
|
|
@@ -3445,35 +3445,35 @@ var require_dereferenceAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3445
3445
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getJsonPathForPosition.js
|
|
3446
3446
|
var require_getJsonPathForPosition = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3447
3447
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3448
|
-
const buildJsonPath_1
|
|
3449
|
-
const types_1
|
|
3450
|
-
const utils_1
|
|
3451
|
-
exports.getJsonPathForPosition = ({ ast
|
|
3448
|
+
const buildJsonPath_1 = require_buildJsonPath();
|
|
3449
|
+
const types_1 = require_types();
|
|
3450
|
+
const utils_1 = require_utils();
|
|
3451
|
+
exports.getJsonPathForPosition = ({ ast, lineMap }, { line, character }) => {
|
|
3452
3452
|
if (line >= lineMap.length || character >= lineMap[line]) return;
|
|
3453
3453
|
const startOffset = line === 0 ? 0 : lineMap[line - 1] + 1;
|
|
3454
|
-
const node = findClosestScalar(ast
|
|
3455
|
-
if (!utils_1
|
|
3456
|
-
const path$1 = buildJsonPath_1
|
|
3454
|
+
const node = findClosestScalar(ast, Math.min(lineMap[line] - 1, startOffset + character), line, lineMap);
|
|
3455
|
+
if (!utils_1.isObject(node)) return;
|
|
3456
|
+
const path$1 = buildJsonPath_1.buildJsonPath(node);
|
|
3457
3457
|
if (path$1.length === 0) return;
|
|
3458
3458
|
return path$1;
|
|
3459
3459
|
};
|
|
3460
3460
|
function* walk(node) {
|
|
3461
3461
|
switch (node.kind) {
|
|
3462
|
-
case types_1
|
|
3462
|
+
case types_1.Kind.MAP:
|
|
3463
3463
|
if (node.mappings.length !== 0) {
|
|
3464
|
-
for (const mapping of node.mappings) if (utils_1
|
|
3464
|
+
for (const mapping of node.mappings) if (utils_1.isObject(mapping)) yield mapping;
|
|
3465
3465
|
}
|
|
3466
3466
|
break;
|
|
3467
|
-
case types_1
|
|
3468
|
-
if (utils_1
|
|
3469
|
-
if (utils_1
|
|
3467
|
+
case types_1.Kind.MAPPING:
|
|
3468
|
+
if (utils_1.isObject(node.key)) yield node.key;
|
|
3469
|
+
if (utils_1.isObject(node.value)) yield node.value;
|
|
3470
3470
|
break;
|
|
3471
|
-
case types_1
|
|
3471
|
+
case types_1.Kind.SEQ:
|
|
3472
3472
|
if (node.items.length !== 0) {
|
|
3473
|
-
for (const item of node.items) if (utils_1
|
|
3473
|
+
for (const item of node.items) if (utils_1.isObject(item)) yield item;
|
|
3474
3474
|
}
|
|
3475
3475
|
break;
|
|
3476
|
-
case types_1
|
|
3476
|
+
case types_1.Kind.SCALAR:
|
|
3477
3477
|
yield node;
|
|
3478
3478
|
break;
|
|
3479
3479
|
}
|
|
@@ -3482,13 +3482,13 @@ var require_getJsonPathForPosition = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3482
3482
|
const startOffset = lineMap[line - 1] + 1;
|
|
3483
3483
|
const endOffset = lineMap[line];
|
|
3484
3484
|
switch (node.kind) {
|
|
3485
|
-
case types_1
|
|
3486
|
-
case types_1
|
|
3485
|
+
case types_1.Kind.MAPPING: return node.key;
|
|
3486
|
+
case types_1.Kind.MAP:
|
|
3487
3487
|
if (node.mappings.length !== 0) {
|
|
3488
3488
|
for (const mapping of node.mappings) if (mapping.startPosition > startOffset && mapping.startPosition <= endOffset) return getFirstScalarChild(mapping, line, lineMap);
|
|
3489
3489
|
}
|
|
3490
3490
|
break;
|
|
3491
|
-
case types_1
|
|
3491
|
+
case types_1.Kind.SEQ:
|
|
3492
3492
|
if (node.items.length !== 0) {
|
|
3493
3493
|
for (const item of node.items) if (item !== null && item.startPosition > startOffset && item.startPosition <= endOffset) return getFirstScalarChild(item, line, lineMap);
|
|
3494
3494
|
}
|
|
@@ -3497,10 +3497,10 @@ var require_getJsonPathForPosition = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3497
3497
|
return node;
|
|
3498
3498
|
}
|
|
3499
3499
|
function findClosestScalar(container, offset, line, lineMap) {
|
|
3500
|
-
for (const node of walk(container)) if (node.startPosition <= offset && offset <= node.endPosition) return node.kind === types_1
|
|
3500
|
+
for (const node of walk(container)) if (node.startPosition <= offset && offset <= node.endPosition) return node.kind === types_1.Kind.SCALAR ? node : findClosestScalar(node, offset, line, lineMap);
|
|
3501
3501
|
if (lineMap[line - 1] === lineMap[line] - 1) return container;
|
|
3502
3502
|
if (container.startPosition < lineMap[line - 1] && offset <= container.endPosition) {
|
|
3503
|
-
if (container.kind !== types_1
|
|
3503
|
+
if (container.kind !== types_1.Kind.MAPPING) return getFirstScalarChild(container, line, lineMap);
|
|
3504
3504
|
if (container.value && container.key.endPosition < offset) return getFirstScalarChild(container.value, line, lineMap);
|
|
3505
3505
|
}
|
|
3506
3506
|
return container;
|
|
@@ -3531,11 +3531,11 @@ var require_lineForPosition = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3531
3531
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getLocationForJsonPath.js
|
|
3532
3532
|
var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3533
3533
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3534
|
-
const lineForPosition_1
|
|
3535
|
-
const types_1
|
|
3536
|
-
const utils_1
|
|
3537
|
-
exports.getLocationForJsonPath = ({ ast
|
|
3538
|
-
const node = findNodeAtPath(ast
|
|
3534
|
+
const lineForPosition_1 = require_lineForPosition();
|
|
3535
|
+
const types_1 = require_types();
|
|
3536
|
+
const utils_1 = require_utils();
|
|
3537
|
+
exports.getLocationForJsonPath = ({ ast, lineMap, metadata }, path$1, closest = false) => {
|
|
3538
|
+
const node = findNodeAtPath(ast, path$1, {
|
|
3539
3539
|
closest,
|
|
3540
3540
|
mergeKeys: metadata !== void 0 && metadata.mergeKeys === true
|
|
3541
3541
|
});
|
|
@@ -3546,42 +3546,42 @@ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3546
3546
|
});
|
|
3547
3547
|
};
|
|
3548
3548
|
function getStartPosition(node, offset) {
|
|
3549
|
-
if (node.parent && node.parent.kind === types_1
|
|
3549
|
+
if (node.parent && node.parent.kind === types_1.Kind.MAPPING) {
|
|
3550
3550
|
if (node.parent.value === null) return node.parent.endPosition;
|
|
3551
|
-
if (node.kind !== types_1
|
|
3551
|
+
if (node.kind !== types_1.Kind.SCALAR) return node.parent.key.endPosition + 1;
|
|
3552
3552
|
}
|
|
3553
3553
|
if (node.parent === null && offset - node.startPosition === 0) return 0;
|
|
3554
3554
|
return node.startPosition;
|
|
3555
3555
|
}
|
|
3556
3556
|
function getEndPosition(node) {
|
|
3557
3557
|
switch (node.kind) {
|
|
3558
|
-
case types_1
|
|
3558
|
+
case types_1.Kind.SEQ:
|
|
3559
3559
|
const { items } = node;
|
|
3560
3560
|
if (items.length !== 0) {
|
|
3561
3561
|
const lastItem = items[items.length - 1];
|
|
3562
3562
|
if (lastItem !== null) return getEndPosition(lastItem);
|
|
3563
3563
|
}
|
|
3564
3564
|
break;
|
|
3565
|
-
case types_1
|
|
3565
|
+
case types_1.Kind.MAPPING:
|
|
3566
3566
|
if (node.value !== null) return getEndPosition(node.value);
|
|
3567
3567
|
break;
|
|
3568
|
-
case types_1
|
|
3568
|
+
case types_1.Kind.MAP:
|
|
3569
3569
|
if (node.value !== null && node.mappings.length !== 0) return getEndPosition(node.mappings[node.mappings.length - 1]);
|
|
3570
3570
|
break;
|
|
3571
|
-
case types_1
|
|
3572
|
-
if (node.parent !== null && node.parent.kind === types_1
|
|
3571
|
+
case types_1.Kind.SCALAR:
|
|
3572
|
+
if (node.parent !== null && node.parent.kind === types_1.Kind.MAPPING && node.parent.value === null) return node.parent.endPosition;
|
|
3573
3573
|
break;
|
|
3574
3574
|
}
|
|
3575
3575
|
return node.endPosition;
|
|
3576
3576
|
}
|
|
3577
3577
|
function findNodeAtPath(node, path$1, { closest, mergeKeys }) {
|
|
3578
3578
|
pathLoop: for (const segment of path$1) {
|
|
3579
|
-
if (!utils_1
|
|
3579
|
+
if (!utils_1.isObject(node)) return closest ? node : void 0;
|
|
3580
3580
|
switch (node.kind) {
|
|
3581
|
-
case types_1
|
|
3581
|
+
case types_1.Kind.MAP:
|
|
3582
3582
|
const mappings = getMappings(node.mappings, mergeKeys);
|
|
3583
|
-
for (let i
|
|
3584
|
-
const item = mappings[i
|
|
3583
|
+
for (let i = mappings.length - 1; i >= 0; i--) {
|
|
3584
|
+
const item = mappings[i];
|
|
3585
3585
|
if (item.key.value === segment) {
|
|
3586
3586
|
if (item.value === null) node = item.key;
|
|
3587
3587
|
else node = item.value;
|
|
@@ -3589,9 +3589,9 @@ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3589
3589
|
}
|
|
3590
3590
|
}
|
|
3591
3591
|
return closest ? node : void 0;
|
|
3592
|
-
case types_1
|
|
3593
|
-
for (let i
|
|
3594
|
-
const item = node.items[i
|
|
3592
|
+
case types_1.Kind.SEQ:
|
|
3593
|
+
for (let i = 0; i < node.items.length; i++) if (i === Number(segment)) {
|
|
3594
|
+
const item = node.items[i];
|
|
3595
3595
|
if (item === null) break;
|
|
3596
3596
|
node = item;
|
|
3597
3597
|
continue pathLoop;
|
|
@@ -3605,26 +3605,26 @@ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3605
3605
|
function getMappings(mappings, mergeKeys) {
|
|
3606
3606
|
if (!mergeKeys) return mappings;
|
|
3607
3607
|
return mappings.reduce((mergedMappings, mapping) => {
|
|
3608
|
-
if (utils_1
|
|
3608
|
+
if (utils_1.isObject(mapping)) if (mapping.key.value === "<<") mergedMappings.push(...reduceMergeKeys(mapping.value));
|
|
3609
3609
|
else mergedMappings.push(mapping);
|
|
3610
3610
|
return mergedMappings;
|
|
3611
3611
|
}, []);
|
|
3612
3612
|
}
|
|
3613
|
-
function reduceMergeKeys
|
|
3614
|
-
if (!utils_1
|
|
3613
|
+
function reduceMergeKeys(node) {
|
|
3614
|
+
if (!utils_1.isObject(node)) return [];
|
|
3615
3615
|
switch (node.kind) {
|
|
3616
|
-
case types_1
|
|
3617
|
-
items.push(...reduceMergeKeys
|
|
3616
|
+
case types_1.Kind.SEQ: return node.items.reduceRight((items, item) => {
|
|
3617
|
+
items.push(...reduceMergeKeys(item));
|
|
3618
3618
|
return items;
|
|
3619
3619
|
}, []);
|
|
3620
|
-
case types_1
|
|
3621
|
-
case types_1
|
|
3620
|
+
case types_1.Kind.MAP: return node.mappings;
|
|
3621
|
+
case types_1.Kind.ANCHOR_REF: return reduceMergeKeys(node.value);
|
|
3622
3622
|
default: return [];
|
|
3623
3623
|
}
|
|
3624
3624
|
}
|
|
3625
3625
|
const getLoc = (lineMap, { start = 0, end = 0 }) => {
|
|
3626
|
-
const startLine = lineForPosition_1
|
|
3627
|
-
const endLine = lineForPosition_1
|
|
3626
|
+
const startLine = lineForPosition_1.lineForPosition(start, lineMap);
|
|
3627
|
+
const endLine = lineForPosition_1.lineForPosition(end, lineMap);
|
|
3628
3628
|
return { range: {
|
|
3629
3629
|
start: {
|
|
3630
3630
|
line: startLine,
|
|
@@ -3645,7 +3645,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3645
3645
|
const ORDER_KEY_ID = `__object_order_${Math.floor(Date.now() / 36e5)}__`;
|
|
3646
3646
|
const ORDER_KEY = Symbol.for(ORDER_KEY_ID);
|
|
3647
3647
|
const STRINGIFIED_ORDER_KEY = String(ORDER_KEY);
|
|
3648
|
-
const traps
|
|
3648
|
+
const traps = {
|
|
3649
3649
|
defineProperty(target, key, descriptor) {
|
|
3650
3650
|
if (!Object.prototype.hasOwnProperty.call(target, key) && ORDER_KEY in target) target[ORDER_KEY].push(key);
|
|
3651
3651
|
else if ("value" in descriptor && key === ORDER_KEY && descriptor.value.lastIndexOf(ORDER_KEY) === -1) descriptor.value.push(ORDER_KEY);
|
|
@@ -3673,7 +3673,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3673
3673
|
};
|
|
3674
3674
|
function createObj(target, order = Reflect.ownKeys(target)) {
|
|
3675
3675
|
assertObjectLiteral(target);
|
|
3676
|
-
const t = new Proxy(target, traps
|
|
3676
|
+
const t = new Proxy(target, traps);
|
|
3677
3677
|
setOrder(t, order);
|
|
3678
3678
|
return t;
|
|
3679
3679
|
}
|
|
@@ -3692,9 +3692,9 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3692
3692
|
}
|
|
3693
3693
|
function serializeArray(target) {
|
|
3694
3694
|
const newTarget = target.slice();
|
|
3695
|
-
for (let i
|
|
3696
|
-
const value = newTarget[i
|
|
3697
|
-
if (isObject(value)) newTarget[i
|
|
3695
|
+
for (let i = 0; i < newTarget.length; i += 1) {
|
|
3696
|
+
const value = newTarget[i];
|
|
3697
|
+
if (isObject(value)) newTarget[i] = Array.isArray(value) ? serializeArray(value) : serialize(value, true);
|
|
3698
3698
|
}
|
|
3699
3699
|
return newTarget;
|
|
3700
3700
|
}
|
|
@@ -3713,9 +3713,9 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3713
3713
|
return newTarget;
|
|
3714
3714
|
}
|
|
3715
3715
|
function deserializeArray(target) {
|
|
3716
|
-
for (let i
|
|
3717
|
-
const value = target[i
|
|
3718
|
-
if (isObject(value)) target[i
|
|
3716
|
+
for (let i = 0; i < target.length; i += 1) {
|
|
3717
|
+
const value = target[i];
|
|
3718
|
+
if (isObject(value)) target[i] = Array.isArray(value) ? deserializeArray(value) : deserialize(value, true);
|
|
3719
3719
|
}
|
|
3720
3720
|
return target;
|
|
3721
3721
|
}
|
|
@@ -3898,9 +3898,9 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3898
3898
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parseWithPointers.js
|
|
3899
3899
|
var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3900
3900
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3901
|
-
const ordered_object_literal_1
|
|
3901
|
+
const ordered_object_literal_1 = require_src();
|
|
3902
3902
|
const types_1 = require_dist();
|
|
3903
|
-
const yaml_ast_parser_1
|
|
3903
|
+
const yaml_ast_parser_1 = require_src$1();
|
|
3904
3904
|
const buildJsonPath_1 = require_buildJsonPath();
|
|
3905
3905
|
const dereferenceAnchor_1 = require_dereferenceAnchor();
|
|
3906
3906
|
const lineForPosition_1 = require_lineForPosition();
|
|
@@ -3908,23 +3908,23 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3908
3908
|
const utils_1 = require_utils();
|
|
3909
3909
|
exports.parseWithPointers = (value, options) => {
|
|
3910
3910
|
const lineMap = computeLineMap(value);
|
|
3911
|
-
const ast
|
|
3911
|
+
const ast = yaml_ast_parser_1.load(value, Object.assign({}, options, { ignoreDuplicateKeys: true }));
|
|
3912
3912
|
const parsed = {
|
|
3913
|
-
ast
|
|
3913
|
+
ast,
|
|
3914
3914
|
lineMap,
|
|
3915
3915
|
data: void 0,
|
|
3916
3916
|
diagnostics: [],
|
|
3917
3917
|
metadata: options,
|
|
3918
3918
|
comments: {}
|
|
3919
3919
|
};
|
|
3920
|
-
if (!ast
|
|
3920
|
+
if (!ast) return parsed;
|
|
3921
3921
|
const normalizedOptions = normalizeOptions(options);
|
|
3922
|
-
const comments = new Comments(parsed.comments, Comments.mapComments(normalizedOptions.attachComments && ast
|
|
3922
|
+
const comments = new Comments(parsed.comments, Comments.mapComments(normalizedOptions.attachComments && ast.comments ? ast.comments : [], lineMap), ast, lineMap, "#");
|
|
3923
3923
|
parsed.data = walkAST({
|
|
3924
3924
|
lineMap,
|
|
3925
3925
|
diagnostics: parsed.diagnostics
|
|
3926
|
-
}, ast
|
|
3927
|
-
if (ast
|
|
3926
|
+
}, ast, comments, normalizedOptions);
|
|
3927
|
+
if (ast.errors) parsed.diagnostics.push(...transformErrors(ast.errors, lineMap));
|
|
3928
3928
|
if (parsed.diagnostics.length > 0) parsed.diagnostics.sort((itemA, itemB) => itemA.range.start.line - itemB.range.start.line);
|
|
3929
3929
|
if (Array.isArray(parsed.ast.errors)) parsed.ast.errors.length = 0;
|
|
3930
3930
|
return parsed;
|
|
@@ -3967,9 +3967,9 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3967
3967
|
}
|
|
3968
3968
|
case types_2.Kind.SEQ: {
|
|
3969
3969
|
const nodeComments = comments.enter(node);
|
|
3970
|
-
const container = node.items.map((item, i
|
|
3970
|
+
const container = node.items.map((item, i) => {
|
|
3971
3971
|
if (item !== null) {
|
|
3972
|
-
const sequenceItemComments = nodeComments.enter(item, i
|
|
3972
|
+
const sequenceItemComments = nodeComments.enter(item, i);
|
|
3973
3973
|
const walked = walkAST(ctx, item, sequenceItemComments, options);
|
|
3974
3974
|
sequenceItemComments.attachComments();
|
|
3975
3975
|
return walked;
|
|
@@ -3990,19 +3990,19 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3990
3990
|
return node;
|
|
3991
3991
|
};
|
|
3992
3992
|
function getScalarValue(node) {
|
|
3993
|
-
switch (yaml_ast_parser_1
|
|
3993
|
+
switch (yaml_ast_parser_1.determineScalarType(node)) {
|
|
3994
3994
|
case types_2.ScalarType.null: return null;
|
|
3995
3995
|
case types_2.ScalarType.string: return String(node.value);
|
|
3996
|
-
case types_2.ScalarType.bool: return yaml_ast_parser_1
|
|
3997
|
-
case types_2.ScalarType.int: return yaml_ast_parser_1
|
|
3998
|
-
case types_2.ScalarType.float: return yaml_ast_parser_1
|
|
3996
|
+
case types_2.ScalarType.bool: return yaml_ast_parser_1.parseYamlBoolean(node.value);
|
|
3997
|
+
case types_2.ScalarType.int: return yaml_ast_parser_1.parseYamlBigInteger(node.value);
|
|
3998
|
+
case types_2.ScalarType.float: return yaml_ast_parser_1.parseYamlFloat(node.value);
|
|
3999
3999
|
}
|
|
4000
4000
|
}
|
|
4001
4001
|
const computeLineMap = (input) => {
|
|
4002
4002
|
const lineMap = [];
|
|
4003
|
-
let i
|
|
4004
|
-
for (; i
|
|
4005
|
-
lineMap.push(i
|
|
4003
|
+
let i = 0;
|
|
4004
|
+
for (; i < input.length; i++) if (input[i] === "\n") lineMap.push(i + 1);
|
|
4005
|
+
lineMap.push(i + 1);
|
|
4006
4006
|
return lineMap;
|
|
4007
4007
|
};
|
|
4008
4008
|
function getLineLength(lineMap, line) {
|
|
@@ -4012,7 +4012,7 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4012
4012
|
const transformErrors = (errors, lineMap) => {
|
|
4013
4013
|
const validations = [];
|
|
4014
4014
|
let possiblyUnexpectedFlow = -1;
|
|
4015
|
-
let i
|
|
4015
|
+
let i = 0;
|
|
4016
4016
|
for (const error of errors) {
|
|
4017
4017
|
const validation = {
|
|
4018
4018
|
code: error.name,
|
|
@@ -4029,16 +4029,16 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4029
4029
|
}
|
|
4030
4030
|
}
|
|
4031
4031
|
};
|
|
4032
|
-
if (error.reason === "missed comma between flow collection entries") possiblyUnexpectedFlow = possiblyUnexpectedFlow === -1 ? i
|
|
4032
|
+
if (error.reason === "missed comma between flow collection entries") possiblyUnexpectedFlow = possiblyUnexpectedFlow === -1 ? i : possiblyUnexpectedFlow;
|
|
4033
4033
|
else if (possiblyUnexpectedFlow !== -1) {
|
|
4034
4034
|
validations[possiblyUnexpectedFlow].range.end = validation.range.end;
|
|
4035
4035
|
validations[possiblyUnexpectedFlow].message = "invalid mixed usage of block and flow styles";
|
|
4036
4036
|
validations.length = possiblyUnexpectedFlow + 1;
|
|
4037
|
-
i
|
|
4037
|
+
i = validations.length;
|
|
4038
4038
|
possiblyUnexpectedFlow = -1;
|
|
4039
4039
|
}
|
|
4040
4040
|
validations.push(validation);
|
|
4041
|
-
i
|
|
4041
|
+
i++;
|
|
4042
4042
|
}
|
|
4043
4043
|
return validations;
|
|
4044
4044
|
};
|
|
@@ -4046,27 +4046,27 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4046
4046
|
if (Array.isArray(items)) return items.reduceRight(preserveKeyOrder ? (merged, item) => {
|
|
4047
4047
|
const keys = Object.keys(item);
|
|
4048
4048
|
Object.assign(merged, item);
|
|
4049
|
-
for (let i
|
|
4049
|
+
for (let i = keys.length - 1; i >= 0; i--) unshiftKey(merged, keys[i]);
|
|
4050
4050
|
return merged;
|
|
4051
4051
|
} : (merged, item) => Object.assign(merged, item), createMapContainer(preserveKeyOrder));
|
|
4052
4052
|
return typeof items !== "object" || items === null ? null : Object(items);
|
|
4053
4053
|
};
|
|
4054
4054
|
function createMapContainer(preserveKeyOrder) {
|
|
4055
|
-
return preserveKeyOrder ? ordered_object_literal_1
|
|
4055
|
+
return preserveKeyOrder ? ordered_object_literal_1.default({}) : {};
|
|
4056
4056
|
}
|
|
4057
4057
|
function deleteKey(container, key) {
|
|
4058
4058
|
if (!(key in container)) return;
|
|
4059
|
-
const order = ordered_object_literal_1
|
|
4059
|
+
const order = ordered_object_literal_1.getOrder(container);
|
|
4060
4060
|
const index = order.indexOf(key);
|
|
4061
4061
|
if (index !== -1) order.splice(index, 1);
|
|
4062
4062
|
}
|
|
4063
4063
|
function unshiftKey(container, key) {
|
|
4064
4064
|
deleteKey(container, key);
|
|
4065
|
-
ordered_object_literal_1
|
|
4065
|
+
ordered_object_literal_1.getOrder(container).unshift(key);
|
|
4066
4066
|
}
|
|
4067
4067
|
function pushKey(container, key) {
|
|
4068
4068
|
deleteKey(container, key);
|
|
4069
|
-
ordered_object_literal_1
|
|
4069
|
+
ordered_object_literal_1.getOrder(container).push(key);
|
|
4070
4070
|
}
|
|
4071
4071
|
function validateMappingKey(mapping, lineMap, diagnostics, yamlMode) {
|
|
4072
4072
|
if (mapping.key.kind !== types_2.Kind.SCALAR) {
|
|
@@ -4121,11 +4121,11 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4121
4121
|
const startLine = lineForPosition_1.lineForPosition(startPosition, this.lineMap);
|
|
4122
4122
|
const endLine = lineForPosition_1.lineForPosition(endPosition, this.lineMap);
|
|
4123
4123
|
const matchingComments = [];
|
|
4124
|
-
for (let i
|
|
4125
|
-
const comment = comments[i
|
|
4124
|
+
for (let i = comments.length - 1; i >= 0; i--) {
|
|
4125
|
+
const comment = comments[i];
|
|
4126
4126
|
if (comment.range.start.line >= startLine && comment.range.end.line <= endLine) {
|
|
4127
4127
|
matchingComments.push(comment);
|
|
4128
|
-
comments.splice(i
|
|
4128
|
+
comments.splice(i, 1);
|
|
4129
4129
|
}
|
|
4130
4130
|
}
|
|
4131
4131
|
this.comments = matchingComments;
|
|
@@ -4191,11 +4191,11 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4191
4191
|
}
|
|
4192
4192
|
case types_2.Kind.SEQ: {
|
|
4193
4193
|
let left;
|
|
4194
|
-
for (let i
|
|
4195
|
-
const item = node.items[i
|
|
4194
|
+
for (let i = 0; i < node.items.length; i++) {
|
|
4195
|
+
const item = node.items[i];
|
|
4196
4196
|
if (item === null) continue;
|
|
4197
|
-
if (startPosition > item.startPosition) left = String(i
|
|
4198
|
-
else if (left !== void 0 && item.startPosition > endPosition) return [left, String(i
|
|
4197
|
+
if (startPosition > item.startPosition) left = String(i);
|
|
4198
|
+
else if (left !== void 0 && item.startPosition > endPosition) return [left, String(i)];
|
|
4199
4199
|
}
|
|
4200
4200
|
return null;
|
|
4201
4201
|
}
|
|
@@ -4258,8 +4258,8 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4258
4258
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parse.js
|
|
4259
4259
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4260
4260
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4261
|
-
const parseWithPointers_1
|
|
4262
|
-
exports.parse = (value) => parseWithPointers_1
|
|
4261
|
+
const parseWithPointers_1 = require_parseWithPointers();
|
|
4262
|
+
exports.parse = (value) => parseWithPointers_1.parseWithPointers(value).data;
|
|
4263
4263
|
}));
|
|
4264
4264
|
|
|
4265
4265
|
//#endregion
|
|
@@ -4319,8 +4319,8 @@ function isParameterObject(obj) {
|
|
|
4319
4319
|
* @param schema - The schema object to check.
|
|
4320
4320
|
* @returns `true` if the schema is marked as nullable; otherwise, `false`.
|
|
4321
4321
|
*/
|
|
4322
|
-
function isNullable(schema
|
|
4323
|
-
return schema
|
|
4322
|
+
function isNullable(schema) {
|
|
4323
|
+
return schema?.nullable ?? schema?.["x-nullable"] ?? false;
|
|
4324
4324
|
}
|
|
4325
4325
|
/**
|
|
4326
4326
|
* Determines if the given object is an OpenAPI ReferenceObject.
|
|
@@ -4346,12 +4346,12 @@ function isDiscriminator(obj) {
|
|
|
4346
4346
|
* @param schema - The schema object to check.
|
|
4347
4347
|
* @returns True if the schema is required; otherwise, false.
|
|
4348
4348
|
*/
|
|
4349
|
-
function isRequired(schema
|
|
4350
|
-
if (!schema
|
|
4351
|
-
return Array.isArray(schema
|
|
4349
|
+
function isRequired(schema) {
|
|
4350
|
+
if (!schema) return false;
|
|
4351
|
+
return Array.isArray(schema.required) ? !!schema.required?.length : !!schema.required;
|
|
4352
4352
|
}
|
|
4353
|
-
function isOptional(schema
|
|
4354
|
-
return !isRequired(schema
|
|
4353
|
+
function isOptional(schema) {
|
|
4354
|
+
return !isRequired(schema);
|
|
4355
4355
|
}
|
|
4356
4356
|
async function parse(pathOrApi, { oasClass = Oas, canBundle = true, enablePaths = true } = {}) {
|
|
4357
4357
|
const { loadConfig, bundle } = await import("@redocly/openapi-core");
|
|
@@ -4395,7 +4395,7 @@ async function merge(pathOrApi, { oasClass = Oas } = {}) {
|
|
|
4395
4395
|
}
|
|
4396
4396
|
function parseFromConfig(config, oasClass = Oas) {
|
|
4397
4397
|
if ("data" in config.input) {
|
|
4398
|
-
if (typeof config.input.data === "object") return parse(
|
|
4398
|
+
if (typeof config.input.data === "object") return parse(structuredClone(config.input.data), { oasClass });
|
|
4399
4399
|
try {
|
|
4400
4400
|
return parse(import_yaml.parse(config.input.data), { oasClass });
|
|
4401
4401
|
} catch (_e) {
|
|
@@ -4449,8 +4449,8 @@ var Oas = class extends oas.default {
|
|
|
4449
4449
|
jsonpointer.default.set(this.api, $ref, value);
|
|
4450
4450
|
}
|
|
4451
4451
|
}
|
|
4452
|
-
#setDiscriminator(schema
|
|
4453
|
-
const { mapping = {}, propertyName } = schema
|
|
4452
|
+
#setDiscriminator(schema) {
|
|
4453
|
+
const { mapping = {}, propertyName } = schema.discriminator;
|
|
4454
4454
|
if (this.#options.discriminator === "inherit") Object.entries(mapping).forEach(([mappingKey, mappingValue]) => {
|
|
4455
4455
|
if (mappingValue) {
|
|
4456
4456
|
const childSchema = this.get(mappingValue);
|
|
@@ -4467,39 +4467,39 @@ var Oas = class extends oas.default {
|
|
|
4467
4467
|
}
|
|
4468
4468
|
});
|
|
4469
4469
|
}
|
|
4470
|
-
getDiscriminator(schema
|
|
4471
|
-
if (!isDiscriminator(schema
|
|
4472
|
-
const { mapping = {}, propertyName } = schema
|
|
4473
|
-
if (schema
|
|
4474
|
-
if (isReference(schema$
|
|
4475
|
-
const key = this.getKey(schema$
|
|
4476
|
-
const propertySchema = this.get(schema$
|
|
4477
|
-
const canAdd = key && !Object.values(mapping).includes(schema$
|
|
4478
|
-
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$
|
|
4479
|
-
else if (canAdd) mapping[key] = schema$
|
|
4470
|
+
getDiscriminator(schema) {
|
|
4471
|
+
if (!isDiscriminator(schema)) return;
|
|
4472
|
+
const { mapping = {}, propertyName } = schema.discriminator;
|
|
4473
|
+
if (schema.oneOf) schema.oneOf.forEach((schema$1) => {
|
|
4474
|
+
if (isReference(schema$1)) {
|
|
4475
|
+
const key = this.getKey(schema$1.$ref);
|
|
4476
|
+
const propertySchema = this.get(schema$1.$ref).properties?.[propertyName];
|
|
4477
|
+
const canAdd = key && !Object.values(mapping).includes(schema$1.$ref);
|
|
4478
|
+
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$1.$ref;
|
|
4479
|
+
else if (canAdd) mapping[key] = schema$1.$ref;
|
|
4480
4480
|
}
|
|
4481
4481
|
});
|
|
4482
|
-
if (schema
|
|
4483
|
-
if (isReference(schema$
|
|
4484
|
-
const key = this.getKey(schema$
|
|
4485
|
-
const propertySchema = this.get(schema$
|
|
4486
|
-
const canAdd = key && !Object.values(mapping).includes(schema$
|
|
4487
|
-
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$
|
|
4488
|
-
else if (canAdd) mapping[key] = schema$
|
|
4482
|
+
if (schema.anyOf) schema.anyOf.forEach((schema$1) => {
|
|
4483
|
+
if (isReference(schema$1)) {
|
|
4484
|
+
const key = this.getKey(schema$1.$ref);
|
|
4485
|
+
const propertySchema = this.get(schema$1.$ref).properties?.[propertyName];
|
|
4486
|
+
const canAdd = key && !Object.values(mapping).includes(schema$1.$ref);
|
|
4487
|
+
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$1.$ref;
|
|
4488
|
+
else if (canAdd) mapping[key] = schema$1.$ref;
|
|
4489
4489
|
}
|
|
4490
4490
|
});
|
|
4491
4491
|
return {
|
|
4492
|
-
...schema
|
|
4492
|
+
...schema.discriminator,
|
|
4493
4493
|
mapping
|
|
4494
4494
|
};
|
|
4495
4495
|
}
|
|
4496
|
-
dereferenceWithRef(schema
|
|
4497
|
-
if (isReference(schema
|
|
4498
|
-
...schema
|
|
4499
|
-
...this.get(schema
|
|
4500
|
-
$ref: schema
|
|
4496
|
+
dereferenceWithRef(schema) {
|
|
4497
|
+
if (isReference(schema)) return {
|
|
4498
|
+
...schema,
|
|
4499
|
+
...this.get(schema.$ref),
|
|
4500
|
+
$ref: schema.$ref
|
|
4501
4501
|
};
|
|
4502
|
-
return schema
|
|
4502
|
+
return schema;
|
|
4503
4503
|
}
|
|
4504
4504
|
#applyDiscriminatorInheritance() {
|
|
4505
4505
|
const components = this.api.components;
|
|
@@ -4513,13 +4513,13 @@ var Oas = class extends oas.default {
|
|
|
4513
4513
|
}
|
|
4514
4514
|
if (typeof value === "object") visit(value);
|
|
4515
4515
|
};
|
|
4516
|
-
const visit = (schema
|
|
4517
|
-
if (!schema
|
|
4518
|
-
if (isReference(schema
|
|
4519
|
-
visit(this.get(schema
|
|
4516
|
+
const visit = (schema) => {
|
|
4517
|
+
if (!schema || typeof schema !== "object") return;
|
|
4518
|
+
if (isReference(schema)) {
|
|
4519
|
+
visit(this.get(schema.$ref));
|
|
4520
4520
|
return;
|
|
4521
4521
|
}
|
|
4522
|
-
const schemaObject = schema
|
|
4522
|
+
const schemaObject = schema;
|
|
4523
4523
|
if (visited.has(schemaObject)) return;
|
|
4524
4524
|
visited.add(schemaObject);
|
|
4525
4525
|
if (isDiscriminator(schemaObject)) this.#setDiscriminator(schemaObject);
|
|
@@ -4532,7 +4532,7 @@ var Oas = class extends oas.default {
|
|
|
4532
4532
|
if (schemaObject.properties) enqueue(Object.values(schemaObject.properties));
|
|
4533
4533
|
if (schemaObject.additionalProperties && typeof schemaObject.additionalProperties === "object") enqueue(schemaObject.additionalProperties);
|
|
4534
4534
|
};
|
|
4535
|
-
for (const schema
|
|
4535
|
+
for (const schema of Object.values(components.schemas)) visit(schema);
|
|
4536
4536
|
}
|
|
4537
4537
|
/**
|
|
4538
4538
|
* Oas does not have a getResponseBody(contentType)
|
|
@@ -4567,36 +4567,36 @@ var Oas = class extends oas.default {
|
|
|
4567
4567
|
}
|
|
4568
4568
|
getResponseSchema(operation, statusCode) {
|
|
4569
4569
|
if (operation.schema.responses) Object.keys(operation.schema.responses).forEach((key) => {
|
|
4570
|
-
const schema$
|
|
4571
|
-
const $ref = isReference(schema$
|
|
4572
|
-
if (schema$
|
|
4570
|
+
const schema$1 = operation.schema.responses[key];
|
|
4571
|
+
const $ref = isReference(schema$1) ? schema$1.$ref : void 0;
|
|
4572
|
+
if (schema$1 && $ref) operation.schema.responses[key] = this.get($ref);
|
|
4573
4573
|
});
|
|
4574
4574
|
const getResponseBody = this.#getResponseBodyFactory(operation.getResponseByStatusCode(statusCode));
|
|
4575
4575
|
const { contentType } = this.#options;
|
|
4576
4576
|
const responseBody = getResponseBody(contentType);
|
|
4577
4577
|
if (responseBody === false) return {};
|
|
4578
|
-
const schema
|
|
4579
|
-
if (!schema
|
|
4580
|
-
return this.dereferenceWithRef(schema
|
|
4578
|
+
const schema = Array.isArray(responseBody) ? responseBody[1].schema : responseBody.schema;
|
|
4579
|
+
if (!schema) return {};
|
|
4580
|
+
return this.dereferenceWithRef(schema);
|
|
4581
4581
|
}
|
|
4582
4582
|
getRequestSchema(operation) {
|
|
4583
4583
|
const { contentType } = this.#options;
|
|
4584
4584
|
if (operation.schema.requestBody) operation.schema.requestBody = this.dereferenceWithRef(operation.schema.requestBody);
|
|
4585
4585
|
const requestBody = operation.getRequestBody(contentType);
|
|
4586
4586
|
if (requestBody === false) return;
|
|
4587
|
-
const schema
|
|
4588
|
-
if (!schema
|
|
4589
|
-
return this.dereferenceWithRef(schema
|
|
4587
|
+
const schema = Array.isArray(requestBody) ? requestBody[1].schema : requestBody.schema;
|
|
4588
|
+
if (!schema) return;
|
|
4589
|
+
return this.dereferenceWithRef(schema);
|
|
4590
4590
|
}
|
|
4591
4591
|
getParametersSchema(operation, inKey) {
|
|
4592
4592
|
const { contentType = operation.getContentType() } = this.#options;
|
|
4593
|
-
const params = operation.getParameters().map((schema
|
|
4594
|
-
return this.dereferenceWithRef(schema
|
|
4593
|
+
const params = operation.getParameters().map((schema) => {
|
|
4594
|
+
return this.dereferenceWithRef(schema);
|
|
4595
4595
|
}).filter((v) => v.in === inKey);
|
|
4596
4596
|
if (!params.length) return null;
|
|
4597
|
-
return params.reduce((schema
|
|
4597
|
+
return params.reduce((schema, pathParameters) => {
|
|
4598
4598
|
const property = pathParameters.content?.[contentType]?.schema ?? pathParameters.schema;
|
|
4599
|
-
const required = [...schema
|
|
4599
|
+
const required = [...schema.required || [], pathParameters.required ? pathParameters.name : void 0].filter(Boolean);
|
|
4600
4600
|
const getDefaultStyle = (location) => {
|
|
4601
4601
|
if (location === "query") return "form";
|
|
4602
4602
|
if (location === "path") return "simple";
|
|
@@ -4605,20 +4605,20 @@ var Oas = class extends oas.default {
|
|
|
4605
4605
|
const style = pathParameters.style || getDefaultStyle(inKey);
|
|
4606
4606
|
const explode = pathParameters.explode !== void 0 ? pathParameters.explode : style === "form";
|
|
4607
4607
|
if (inKey === "query" && style === "form" && explode === true && property?.type === "object" && property?.additionalProperties && !property?.properties) return {
|
|
4608
|
-
...schema
|
|
4609
|
-
description: pathParameters.description || schema
|
|
4610
|
-
deprecated: schema
|
|
4611
|
-
example: property.example || schema
|
|
4608
|
+
...schema,
|
|
4609
|
+
description: pathParameters.description || schema.description,
|
|
4610
|
+
deprecated: schema.deprecated,
|
|
4611
|
+
example: property.example || schema.example,
|
|
4612
4612
|
additionalProperties: property.additionalProperties
|
|
4613
4613
|
};
|
|
4614
4614
|
return {
|
|
4615
|
-
...schema
|
|
4616
|
-
description: schema
|
|
4617
|
-
deprecated: schema
|
|
4618
|
-
example: schema
|
|
4615
|
+
...schema,
|
|
4616
|
+
description: schema.description,
|
|
4617
|
+
deprecated: schema.deprecated,
|
|
4618
|
+
example: schema.example,
|
|
4619
4619
|
required,
|
|
4620
4620
|
properties: {
|
|
4621
|
-
...schema
|
|
4621
|
+
...schema.properties,
|
|
4622
4622
|
[pathParameters.name]: {
|
|
4623
4623
|
description: pathParameters.description,
|
|
4624
4624
|
...property
|