@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.js
CHANGED
|
@@ -17,7 +17,7 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
17
17
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
18
|
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
19
19
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
20
|
-
var __export
|
|
20
|
+
var __export = (all, symbols) => {
|
|
21
21
|
let target = {};
|
|
22
22
|
for (var name in all) {
|
|
23
23
|
__defProp(target, name, {
|
|
@@ -32,8 +32,8 @@ var __export$1 = (all, symbols) => {
|
|
|
32
32
|
};
|
|
33
33
|
var __copyProps = (to, from, except, desc) => {
|
|
34
34
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
35
|
-
for (var keys = __getOwnPropNames(from), i
|
|
36
|
-
key = keys[i
|
|
35
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
36
|
+
key = keys[i];
|
|
37
37
|
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
38
38
|
__defProp(to, key, {
|
|
39
39
|
get: ((k) => from[k]).bind(null, key),
|
|
@@ -125,7 +125,7 @@ function camelCase$1(input, options) {
|
|
|
125
125
|
function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
126
126
|
if (isFile) {
|
|
127
127
|
const splitArray = text.split(".");
|
|
128
|
-
return splitArray.map((item, i
|
|
128
|
+
return splitArray.map((item, i) => i === splitArray.length - 1 ? camelCase(item, {
|
|
129
129
|
prefix,
|
|
130
130
|
suffix
|
|
131
131
|
}) : camelCase(item)).join("/");
|
|
@@ -240,7 +240,7 @@ var URLPath = class {
|
|
|
240
240
|
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
243
|
-
var tslib_es6_exports = /* @__PURE__ */ __export
|
|
243
|
+
var tslib_es6_exports = /* @__PURE__ */ __export({
|
|
244
244
|
__addDisposableResource: () => __addDisposableResource,
|
|
245
245
|
__assign: () => __assign,
|
|
246
246
|
__asyncDelegator: () => __asyncDelegator,
|
|
@@ -287,14 +287,14 @@ function __rest(s, e) {
|
|
|
287
287
|
var t = {};
|
|
288
288
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
289
289
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") {
|
|
290
|
-
for (var i
|
|
290
|
+
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]];
|
|
291
291
|
}
|
|
292
292
|
return t;
|
|
293
293
|
}
|
|
294
294
|
function __decorate(decorators, target, key, desc) {
|
|
295
295
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
296
296
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
297
|
-
else for (var i
|
|
297
|
+
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;
|
|
298
298
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
299
299
|
}
|
|
300
300
|
function __param(paramIndex, decorator) {
|
|
@@ -311,7 +311,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
311
311
|
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
312
312
|
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
313
313
|
var _, done = false;
|
|
314
|
-
for (var i
|
|
314
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
315
315
|
var context = {};
|
|
316
316
|
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
317
317
|
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
@@ -319,7 +319,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
319
319
|
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
320
320
|
extraInitializers.push(accept(f || null));
|
|
321
321
|
};
|
|
322
|
-
var result = (0, decorators[i
|
|
322
|
+
var result = (0, decorators[i])(kind === "accessor" ? {
|
|
323
323
|
get: descriptor.get,
|
|
324
324
|
set: descriptor.set
|
|
325
325
|
} : descriptor[key], context);
|
|
@@ -337,7 +337,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
337
337
|
}
|
|
338
338
|
function __runInitializers(thisArg, initializers, value) {
|
|
339
339
|
var useValue = arguments.length > 2;
|
|
340
|
-
for (var i
|
|
340
|
+
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
341
341
|
return useValue ? value : void 0;
|
|
342
342
|
}
|
|
343
343
|
function __propKey(x) {
|
|
@@ -464,12 +464,12 @@ function __exportStar(m, o) {
|
|
|
464
464
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
465
465
|
}
|
|
466
466
|
function __values(o) {
|
|
467
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i
|
|
467
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
468
468
|
if (m) return m.call(o);
|
|
469
469
|
if (o && typeof o.length === "number") return { next: function() {
|
|
470
|
-
if (o && i
|
|
470
|
+
if (o && i >= o.length) o = void 0;
|
|
471
471
|
return {
|
|
472
|
-
value: o && o[i
|
|
472
|
+
value: o && o[i++],
|
|
473
473
|
done: !o
|
|
474
474
|
};
|
|
475
475
|
} };
|
|
@@ -478,14 +478,14 @@ function __values(o) {
|
|
|
478
478
|
function __read(o, n) {
|
|
479
479
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
480
480
|
if (!m) return o;
|
|
481
|
-
var i
|
|
481
|
+
var i = m.call(o), r, ar = [], e;
|
|
482
482
|
try {
|
|
483
|
-
while ((n === void 0 || n-- > 0) && !(r = i
|
|
483
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
484
484
|
} catch (error) {
|
|
485
485
|
e = { error };
|
|
486
486
|
} finally {
|
|
487
487
|
try {
|
|
488
|
-
if (r && !r.done && (m = i
|
|
488
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
489
489
|
} finally {
|
|
490
490
|
if (e) throw e.error;
|
|
491
491
|
}
|
|
@@ -494,20 +494,20 @@ function __read(o, n) {
|
|
|
494
494
|
}
|
|
495
495
|
/** @deprecated */
|
|
496
496
|
function __spread() {
|
|
497
|
-
for (var ar = [], i
|
|
497
|
+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
498
498
|
return ar;
|
|
499
499
|
}
|
|
500
500
|
/** @deprecated */
|
|
501
501
|
function __spreadArrays() {
|
|
502
|
-
for (var s = 0, i
|
|
503
|
-
for (var r = Array(s), k = 0, i
|
|
502
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
503
|
+
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];
|
|
504
504
|
return r;
|
|
505
505
|
}
|
|
506
506
|
function __spreadArray(to, from, pack) {
|
|
507
507
|
if (pack || arguments.length === 2) {
|
|
508
|
-
for (var i
|
|
509
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i
|
|
510
|
-
ar[i
|
|
508
|
+
for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
|
|
509
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
510
|
+
ar[i] = from[i];
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
@@ -517,10 +517,10 @@ function __await(v) {
|
|
|
517
517
|
}
|
|
518
518
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
519
519
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
520
|
-
var g = generator.apply(thisArg, _arguments || []), i
|
|
521
|
-
return i
|
|
520
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
521
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
522
522
|
return this;
|
|
523
|
-
}, i
|
|
523
|
+
}, i;
|
|
524
524
|
function awaitReturn(f) {
|
|
525
525
|
return function(v) {
|
|
526
526
|
return Promise.resolve(v).then(f, reject);
|
|
@@ -528,7 +528,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
528
528
|
}
|
|
529
529
|
function verb(n, f) {
|
|
530
530
|
if (g[n]) {
|
|
531
|
-
i
|
|
531
|
+
i[n] = function(v) {
|
|
532
532
|
return new Promise(function(a, b) {
|
|
533
533
|
q.push([
|
|
534
534
|
n,
|
|
@@ -538,7 +538,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
538
538
|
]) > 1 || resume(n, v);
|
|
539
539
|
});
|
|
540
540
|
};
|
|
541
|
-
if (f) i
|
|
541
|
+
if (f) i[n] = f(i[n]);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
function resume(n, v) {
|
|
@@ -562,14 +562,14 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
function __asyncDelegator(o) {
|
|
565
|
-
var i
|
|
566
|
-
return i
|
|
565
|
+
var i, p;
|
|
566
|
+
return i = {}, verb("next"), verb("throw", function(e) {
|
|
567
567
|
throw e;
|
|
568
|
-
}), verb("return"), i
|
|
568
|
+
}), verb("return"), i[Symbol.iterator] = function() {
|
|
569
569
|
return this;
|
|
570
|
-
}, i
|
|
570
|
+
}, i;
|
|
571
571
|
function verb(n, f) {
|
|
572
|
-
i
|
|
572
|
+
i[n] = o[n] ? function(v) {
|
|
573
573
|
return (p = !p) ? {
|
|
574
574
|
value: __await(o[n](v)),
|
|
575
575
|
done: false
|
|
@@ -579,12 +579,12 @@ function __asyncDelegator(o) {
|
|
|
579
579
|
}
|
|
580
580
|
function __asyncValues(o) {
|
|
581
581
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
582
|
-
var m = o[Symbol.asyncIterator], i
|
|
583
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i
|
|
582
|
+
var m = o[Symbol.asyncIterator], i;
|
|
583
|
+
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() {
|
|
584
584
|
return this;
|
|
585
|
-
}, i
|
|
585
|
+
}, i);
|
|
586
586
|
function verb(n) {
|
|
587
|
-
i
|
|
587
|
+
i[n] = o[n] && function(v) {
|
|
588
588
|
return new Promise(function(resolve, reject) {
|
|
589
589
|
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
590
590
|
});
|
|
@@ -608,7 +608,7 @@ function __importStar(mod) {
|
|
|
608
608
|
if (mod && mod.__esModule) return mod;
|
|
609
609
|
var result = {};
|
|
610
610
|
if (mod != null) {
|
|
611
|
-
for (var k = ownKeys(mod), i
|
|
611
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
612
612
|
}
|
|
613
613
|
__setModuleDefault(result, mod);
|
|
614
614
|
return result;
|
|
@@ -702,8 +702,8 @@ var init_tslib_es6 = __esmMin((() => {
|
|
|
702
702
|
};
|
|
703
703
|
__assign = function() {
|
|
704
704
|
__assign = Object.assign || function __assign$1(t) {
|
|
705
|
-
for (var s, i
|
|
706
|
-
s = arguments[i
|
|
705
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
706
|
+
s = arguments[i];
|
|
707
707
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
708
708
|
}
|
|
709
709
|
return t;
|
|
@@ -785,13 +785,13 @@ var init_tslib_es6 = __esmMin((() => {
|
|
|
785
785
|
var require_yamlAST = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
786
786
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
787
787
|
var Kind;
|
|
788
|
-
(function(Kind
|
|
789
|
-
Kind
|
|
790
|
-
Kind
|
|
791
|
-
Kind
|
|
792
|
-
Kind
|
|
793
|
-
Kind
|
|
794
|
-
Kind
|
|
788
|
+
(function(Kind) {
|
|
789
|
+
Kind[Kind["SCALAR"] = 0] = "SCALAR";
|
|
790
|
+
Kind[Kind["MAPPING"] = 1] = "MAPPING";
|
|
791
|
+
Kind[Kind["MAP"] = 2] = "MAP";
|
|
792
|
+
Kind[Kind["SEQ"] = 3] = "SEQ";
|
|
793
|
+
Kind[Kind["ANCHOR_REF"] = 4] = "ANCHOR_REF";
|
|
794
|
+
Kind[Kind["INCLUDE_REF"] = 5] = "INCLUDE_REF";
|
|
795
795
|
})(Kind = exports.Kind || (exports.Kind = {}));
|
|
796
796
|
function newMapping(key, value) {
|
|
797
797
|
var end = value ? value.endPosition : key.endPosition + 1;
|
|
@@ -869,10 +869,10 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
869
869
|
return typeof subject === "undefined" || null === subject;
|
|
870
870
|
}
|
|
871
871
|
exports.isNothing = isNothing;
|
|
872
|
-
function isObject
|
|
872
|
+
function isObject(subject) {
|
|
873
873
|
return typeof subject === "object" && null !== subject;
|
|
874
874
|
}
|
|
875
|
-
exports.isObject = isObject
|
|
875
|
+
exports.isObject = isObject;
|
|
876
876
|
function toArray(sequence) {
|
|
877
877
|
if (Array.isArray(sequence)) return sequence;
|
|
878
878
|
else if (isNothing(sequence)) return [];
|
|
@@ -906,7 +906,7 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
906
906
|
//#endregion
|
|
907
907
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js
|
|
908
908
|
var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
909
|
-
var YAMLException
|
|
909
|
+
var YAMLException = class YAMLException {
|
|
910
910
|
constructor(reason, mark = null, isWarning = false) {
|
|
911
911
|
this.name = "YAMLException";
|
|
912
912
|
this.reason = reason;
|
|
@@ -916,12 +916,12 @@ var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
916
916
|
}
|
|
917
917
|
static isInstance(instance) {
|
|
918
918
|
if (instance != null && instance.getClassIdentifier && typeof instance.getClassIdentifier == "function") {
|
|
919
|
-
for (let currentIdentifier of instance.getClassIdentifier()) if (currentIdentifier == YAMLException
|
|
919
|
+
for (let currentIdentifier of instance.getClassIdentifier()) if (currentIdentifier == YAMLException.CLASS_IDENTIFIER) return true;
|
|
920
920
|
}
|
|
921
921
|
return false;
|
|
922
922
|
}
|
|
923
923
|
getClassIdentifier() {
|
|
924
|
-
return [].concat(YAMLException
|
|
924
|
+
return [].concat(YAMLException.CLASS_IDENTIFIER);
|
|
925
925
|
}
|
|
926
926
|
toString(compact = false) {
|
|
927
927
|
var result = "JS-YAML: " + (this.reason || "(unknown reason)");
|
|
@@ -929,15 +929,15 @@ var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
929
929
|
return result;
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
|
-
YAMLException
|
|
933
|
-
module.exports = YAMLException
|
|
932
|
+
YAMLException.CLASS_IDENTIFIER = "yaml-ast-parser.YAMLException";
|
|
933
|
+
module.exports = YAMLException;
|
|
934
934
|
}));
|
|
935
935
|
|
|
936
936
|
//#endregion
|
|
937
937
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js
|
|
938
938
|
var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
939
|
-
const common
|
|
940
|
-
var Mark
|
|
939
|
+
const common = require_common();
|
|
940
|
+
var Mark = class {
|
|
941
941
|
constructor(name, buffer, position, line, column) {
|
|
942
942
|
this.name = name;
|
|
943
943
|
this.buffer = buffer;
|
|
@@ -971,7 +971,7 @@ var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
973
|
snippet = this.buffer.slice(start, end);
|
|
974
|
-
return common
|
|
974
|
+
return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
|
|
975
975
|
}
|
|
976
976
|
toString(compact = true) {
|
|
977
977
|
var snippet, where = "";
|
|
@@ -984,14 +984,14 @@ var require_mark = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
984
984
|
return where;
|
|
985
985
|
}
|
|
986
986
|
};
|
|
987
|
-
module.exports = Mark
|
|
987
|
+
module.exports = Mark;
|
|
988
988
|
}));
|
|
989
989
|
|
|
990
990
|
//#endregion
|
|
991
991
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type.js
|
|
992
992
|
var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
993
993
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
994
|
-
const YAMLException
|
|
994
|
+
const YAMLException = require_exception();
|
|
995
995
|
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
996
996
|
"kind",
|
|
997
997
|
"resolve",
|
|
@@ -1020,7 +1020,7 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1020
1020
|
constructor(tag, options) {
|
|
1021
1021
|
options = options || {};
|
|
1022
1022
|
Object.keys(options).forEach(function(name) {
|
|
1023
|
-
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException
|
|
1023
|
+
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type.");
|
|
1024
1024
|
});
|
|
1025
1025
|
this.tag = tag;
|
|
1026
1026
|
this.kind = options["kind"] || null;
|
|
@@ -1035,7 +1035,7 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1035
1035
|
this.represent = options["represent"] || null;
|
|
1036
1036
|
this.defaultStyle = options["defaultStyle"] || null;
|
|
1037
1037
|
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
1038
|
-
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException
|
|
1038
|
+
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type.");
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
1041
|
exports.Type = Type;
|
|
@@ -1045,15 +1045,15 @@ var require_type = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1045
1045
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js
|
|
1046
1046
|
var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1047
1047
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1048
|
-
const common
|
|
1049
|
-
const YAMLException
|
|
1050
|
-
const type_1
|
|
1051
|
-
function compileList(schema
|
|
1048
|
+
const common = require_common();
|
|
1049
|
+
const YAMLException = require_exception();
|
|
1050
|
+
const type_1 = require_type();
|
|
1051
|
+
function compileList(schema, name, result) {
|
|
1052
1052
|
var exclude = [];
|
|
1053
|
-
schema
|
|
1053
|
+
schema.include.forEach(function(includedSchema) {
|
|
1054
1054
|
result = compileList(includedSchema, name, result);
|
|
1055
1055
|
});
|
|
1056
|
-
schema
|
|
1056
|
+
schema[name].forEach(function(currentType) {
|
|
1057
1057
|
result.forEach(function(previousType, previousIndex) {
|
|
1058
1058
|
if (previousType.tag === currentType.tag) exclude.push(previousIndex);
|
|
1059
1059
|
});
|
|
@@ -1077,7 +1077,7 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1077
1077
|
this.implicit = definition.implicit || [];
|
|
1078
1078
|
this.explicit = definition.explicit || [];
|
|
1079
1079
|
this.implicit.forEach(function(type) {
|
|
1080
|
-
if (type.loadKind && "scalar" !== type.loadKind) throw new YAMLException
|
|
1080
|
+
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.");
|
|
1081
1081
|
});
|
|
1082
1082
|
this.compiledImplicit = compileList(this, "implicit", []);
|
|
1083
1083
|
this.compiledExplicit = compileList(this, "explicit", []);
|
|
@@ -1097,16 +1097,16 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1097
1097
|
schemas = arguments[0];
|
|
1098
1098
|
types = arguments[1];
|
|
1099
1099
|
break;
|
|
1100
|
-
default: throw new YAMLException
|
|
1100
|
+
default: throw new YAMLException("Wrong number of arguments for Schema.create function");
|
|
1101
1101
|
}
|
|
1102
|
-
schemas = common
|
|
1103
|
-
types = common
|
|
1104
|
-
if (!schemas.every(function(schema
|
|
1105
|
-
return schema
|
|
1106
|
-
})) throw new YAMLException
|
|
1102
|
+
schemas = common.toArray(schemas);
|
|
1103
|
+
types = common.toArray(types);
|
|
1104
|
+
if (!schemas.every(function(schema) {
|
|
1105
|
+
return schema instanceof Schema;
|
|
1106
|
+
})) throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
1107
1107
|
if (!types.every(function(type) {
|
|
1108
|
-
return type instanceof type_1
|
|
1109
|
-
})) throw new YAMLException
|
|
1108
|
+
return type instanceof type_1.Type;
|
|
1109
|
+
})) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1110
1110
|
return new Schema({
|
|
1111
1111
|
include: schemas,
|
|
1112
1112
|
explicit: types
|
|
@@ -1117,8 +1117,8 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1117
1117
|
//#endregion
|
|
1118
1118
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js
|
|
1119
1119
|
var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1120
|
-
const type_1
|
|
1121
|
-
module.exports = new type_1
|
|
1120
|
+
const type_1 = require_type();
|
|
1121
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:str", {
|
|
1122
1122
|
kind: "scalar",
|
|
1123
1123
|
construct: function(data) {
|
|
1124
1124
|
return null !== data ? data : "";
|
|
@@ -1129,8 +1129,8 @@ var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1129
1129
|
//#endregion
|
|
1130
1130
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js
|
|
1131
1131
|
var require_seq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1132
|
-
const type_1
|
|
1133
|
-
module.exports = new type_1
|
|
1132
|
+
const type_1 = require_type();
|
|
1133
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:seq", {
|
|
1134
1134
|
kind: "sequence",
|
|
1135
1135
|
construct: function(data) {
|
|
1136
1136
|
return null !== data ? data : [];
|
|
@@ -1141,8 +1141,8 @@ var require_seq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1141
1141
|
//#endregion
|
|
1142
1142
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js
|
|
1143
1143
|
var require_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1144
|
-
const type_1
|
|
1145
|
-
module.exports = new type_1
|
|
1144
|
+
const type_1 = require_type();
|
|
1145
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:map", {
|
|
1146
1146
|
kind: "mapping",
|
|
1147
1147
|
construct: function(data) {
|
|
1148
1148
|
return null !== data ? data : {};
|
|
@@ -1153,8 +1153,8 @@ var require_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1153
1153
|
//#endregion
|
|
1154
1154
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js
|
|
1155
1155
|
var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1156
|
-
const schema_1
|
|
1157
|
-
module.exports = new schema_1
|
|
1156
|
+
const schema_1 = require_schema();
|
|
1157
|
+
module.exports = new schema_1.Schema({ explicit: [
|
|
1158
1158
|
require_str(),
|
|
1159
1159
|
require_seq(),
|
|
1160
1160
|
require_map()
|
|
@@ -1164,7 +1164,7 @@ var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1164
1164
|
//#endregion
|
|
1165
1165
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js
|
|
1166
1166
|
var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1167
|
-
const type_1
|
|
1167
|
+
const type_1 = require_type();
|
|
1168
1168
|
function resolveYamlNull(data) {
|
|
1169
1169
|
if (null === data) return true;
|
|
1170
1170
|
var max = data.length;
|
|
@@ -1176,7 +1176,7 @@ var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1176
1176
|
function isNull(object) {
|
|
1177
1177
|
return null === object;
|
|
1178
1178
|
}
|
|
1179
|
-
module.exports = new type_1
|
|
1179
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:null", {
|
|
1180
1180
|
kind: "scalar",
|
|
1181
1181
|
resolve: resolveYamlNull,
|
|
1182
1182
|
construct: constructYamlNull,
|
|
@@ -1202,7 +1202,7 @@ var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1202
1202
|
//#endregion
|
|
1203
1203
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js
|
|
1204
1204
|
var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1205
|
-
const type_1
|
|
1205
|
+
const type_1 = require_type();
|
|
1206
1206
|
function resolveYamlBoolean(data) {
|
|
1207
1207
|
if (null === data) return false;
|
|
1208
1208
|
var max = data.length;
|
|
@@ -1214,7 +1214,7 @@ var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1214
1214
|
function isBoolean(object) {
|
|
1215
1215
|
return "[object Boolean]" === Object.prototype.toString.call(object);
|
|
1216
1216
|
}
|
|
1217
|
-
module.exports = new type_1
|
|
1217
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:bool", {
|
|
1218
1218
|
kind: "scalar",
|
|
1219
1219
|
resolve: resolveYamlBoolean,
|
|
1220
1220
|
construct: constructYamlBoolean,
|
|
@@ -1237,8 +1237,8 @@ var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1237
1237
|
//#endregion
|
|
1238
1238
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js
|
|
1239
1239
|
var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1240
|
-
const common
|
|
1241
|
-
const type_1
|
|
1240
|
+
const common = require_common();
|
|
1241
|
+
const type_1 = require_type();
|
|
1242
1242
|
function isHexCode(c) {
|
|
1243
1243
|
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
1244
1244
|
}
|
|
@@ -1330,9 +1330,9 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
function isInteger(object) {
|
|
1332
1332
|
const type = Object.prototype.toString.call(object);
|
|
1333
|
-
return "[object Number]" === type && 0 === object % 1 && !common
|
|
1333
|
+
return "[object Number]" === type && 0 === object % 1 && !common.isNegativeZero(object) || "[object BigInt]" === type;
|
|
1334
1334
|
}
|
|
1335
|
-
module.exports = new type_1
|
|
1335
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:int", {
|
|
1336
1336
|
kind: "scalar",
|
|
1337
1337
|
resolve: resolveYamlInteger,
|
|
1338
1338
|
construct: constructYamlInteger,
|
|
@@ -1364,8 +1364,8 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1364
1364
|
//#endregion
|
|
1365
1365
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js
|
|
1366
1366
|
var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1367
|
-
const common
|
|
1368
|
-
const type_1
|
|
1367
|
+
const common = require_common();
|
|
1368
|
+
const type_1 = require_type();
|
|
1369
1369
|
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))$");
|
|
1370
1370
|
function resolveYamlFloat(data) {
|
|
1371
1371
|
if (null === data) return false;
|
|
@@ -1407,13 +1407,13 @@ var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1407
1407
|
case "uppercase": return "-.INF";
|
|
1408
1408
|
case "camelcase": return "-.Inf";
|
|
1409
1409
|
}
|
|
1410
|
-
else if (common
|
|
1410
|
+
else if (common.isNegativeZero(object)) return "-0.0";
|
|
1411
1411
|
return object.toString(10);
|
|
1412
1412
|
}
|
|
1413
1413
|
function isFloat(object) {
|
|
1414
|
-
return "[object Number]" === Object.prototype.toString.call(object) && (0 !== object % 1 || common
|
|
1414
|
+
return "[object Number]" === Object.prototype.toString.call(object) && (0 !== object % 1 || common.isNegativeZero(object));
|
|
1415
1415
|
}
|
|
1416
|
-
module.exports = new type_1
|
|
1416
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:float", {
|
|
1417
1417
|
kind: "scalar",
|
|
1418
1418
|
resolve: resolveYamlFloat,
|
|
1419
1419
|
construct: constructYamlFloat,
|
|
@@ -1426,8 +1426,8 @@ var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1426
1426
|
//#endregion
|
|
1427
1427
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js
|
|
1428
1428
|
var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1429
|
-
const schema_1
|
|
1430
|
-
module.exports = new schema_1
|
|
1429
|
+
const schema_1 = require_schema();
|
|
1430
|
+
module.exports = new schema_1.Schema({
|
|
1431
1431
|
include: [require_failsafe()],
|
|
1432
1432
|
implicit: [
|
|
1433
1433
|
require_null(),
|
|
@@ -1441,14 +1441,14 @@ var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1441
1441
|
//#endregion
|
|
1442
1442
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js
|
|
1443
1443
|
var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1444
|
-
const schema_1
|
|
1445
|
-
module.exports = new schema_1
|
|
1444
|
+
const schema_1 = require_schema();
|
|
1445
|
+
module.exports = new schema_1.Schema({ include: [require_json()] });
|
|
1446
1446
|
}));
|
|
1447
1447
|
|
|
1448
1448
|
//#endregion
|
|
1449
1449
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js
|
|
1450
1450
|
var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1451
|
-
const type_1
|
|
1451
|
+
const type_1 = require_type();
|
|
1452
1452
|
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]))?))?)?$");
|
|
1453
1453
|
function resolveYamlTimestamp(data) {
|
|
1454
1454
|
if (null === data) return false;
|
|
@@ -1484,7 +1484,7 @@ var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1484
1484
|
function representYamlTimestamp(object) {
|
|
1485
1485
|
return object.toISOString();
|
|
1486
1486
|
}
|
|
1487
|
-
module.exports = new type_1
|
|
1487
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:timestamp", {
|
|
1488
1488
|
kind: "scalar",
|
|
1489
1489
|
resolve: resolveYamlTimestamp,
|
|
1490
1490
|
construct: constructYamlTimestamp,
|
|
@@ -1496,11 +1496,11 @@ var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1496
1496
|
//#endregion
|
|
1497
1497
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js
|
|
1498
1498
|
var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1499
|
-
const type_1
|
|
1499
|
+
const type_1 = require_type();
|
|
1500
1500
|
function resolveYamlMerge(data) {
|
|
1501
1501
|
return "<<" === data || null === data;
|
|
1502
1502
|
}
|
|
1503
|
-
module.exports = new type_1
|
|
1503
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:merge", {
|
|
1504
1504
|
kind: "scalar",
|
|
1505
1505
|
resolve: resolveYamlMerge
|
|
1506
1506
|
});
|
|
@@ -1510,7 +1510,7 @@ var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1510
1510
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js
|
|
1511
1511
|
var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1512
1512
|
var NodeBuffer = __require("buffer").Buffer;
|
|
1513
|
-
const type_1
|
|
1513
|
+
const type_1 = require_type();
|
|
1514
1514
|
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
1515
1515
|
function resolveYamlBinary(data) {
|
|
1516
1516
|
if (null === data) return false;
|
|
@@ -1578,7 +1578,7 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1578
1578
|
function isBinary(object) {
|
|
1579
1579
|
return NodeBuffer && NodeBuffer.isBuffer(object);
|
|
1580
1580
|
}
|
|
1581
|
-
module.exports = new type_1
|
|
1581
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:binary", {
|
|
1582
1582
|
kind: "scalar",
|
|
1583
1583
|
resolve: resolveYamlBinary,
|
|
1584
1584
|
construct: constructYamlBinary,
|
|
@@ -1590,17 +1590,17 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1590
1590
|
//#endregion
|
|
1591
1591
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js
|
|
1592
1592
|
var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1593
|
-
const type_1
|
|
1594
|
-
var _hasOwnProperty
|
|
1595
|
-
var _toString
|
|
1593
|
+
const type_1 = require_type();
|
|
1594
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1595
|
+
var _toString = Object.prototype.toString;
|
|
1596
1596
|
function resolveYamlOmap(data) {
|
|
1597
1597
|
if (null === data) return true;
|
|
1598
1598
|
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
1599
1599
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1600
1600
|
pair = object[index];
|
|
1601
1601
|
pairHasKey = false;
|
|
1602
|
-
if ("[object Object]" !== _toString
|
|
1603
|
-
for (pairKey in pair) if (_hasOwnProperty
|
|
1602
|
+
if ("[object Object]" !== _toString.call(pair)) return false;
|
|
1603
|
+
for (pairKey in pair) if (_hasOwnProperty.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true;
|
|
1604
1604
|
else return false;
|
|
1605
1605
|
if (!pairHasKey) return false;
|
|
1606
1606
|
if (-1 === objectKeys.indexOf(pairKey)) objectKeys.push(pairKey);
|
|
@@ -1611,7 +1611,7 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1611
1611
|
function constructYamlOmap(data) {
|
|
1612
1612
|
return null !== data ? data : [];
|
|
1613
1613
|
}
|
|
1614
|
-
module.exports = new type_1
|
|
1614
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:omap", {
|
|
1615
1615
|
kind: "sequence",
|
|
1616
1616
|
resolve: resolveYamlOmap,
|
|
1617
1617
|
construct: constructYamlOmap
|
|
@@ -1621,16 +1621,16 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1621
1621
|
//#endregion
|
|
1622
1622
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js
|
|
1623
1623
|
var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1624
|
-
const type_1
|
|
1625
|
-
const ast
|
|
1626
|
-
var _toString
|
|
1624
|
+
const type_1 = require_type();
|
|
1625
|
+
const ast = require_yamlAST();
|
|
1626
|
+
var _toString = Object.prototype.toString;
|
|
1627
1627
|
function resolveYamlPairs(data) {
|
|
1628
1628
|
if (null === data) return true;
|
|
1629
|
-
if (data.kind != ast
|
|
1629
|
+
if (data.kind != ast.Kind.SEQ) return false;
|
|
1630
1630
|
var index, length, pair, object = data.items;
|
|
1631
1631
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1632
1632
|
pair = object[index];
|
|
1633
|
-
if ("[object Object]" !== _toString
|
|
1633
|
+
if ("[object Object]" !== _toString.call(pair)) return false;
|
|
1634
1634
|
if (!Array.isArray(pair.mappings)) return false;
|
|
1635
1635
|
if (1 !== pair.mappings.length) return false;
|
|
1636
1636
|
}
|
|
@@ -1639,13 +1639,13 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1639
1639
|
function constructYamlPairs(data) {
|
|
1640
1640
|
if (null === data || !Array.isArray(data.items)) return [];
|
|
1641
1641
|
let index, length, result, object = data.items;
|
|
1642
|
-
result = ast
|
|
1642
|
+
result = ast.newItems();
|
|
1643
1643
|
result.parent = data.parent;
|
|
1644
1644
|
result.startPosition = data.startPosition;
|
|
1645
1645
|
result.endPosition = data.endPosition;
|
|
1646
1646
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1647
1647
|
let mapping = object[index].mappings[0];
|
|
1648
|
-
let pairSeq = ast
|
|
1648
|
+
let pairSeq = ast.newItems();
|
|
1649
1649
|
pairSeq.parent = result;
|
|
1650
1650
|
pairSeq.startPosition = mapping.key.startPosition;
|
|
1651
1651
|
pairSeq.endPosition = mapping.value.startPosition;
|
|
@@ -1656,7 +1656,7 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
return result;
|
|
1658
1658
|
}
|
|
1659
|
-
module.exports = new type_1
|
|
1659
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:pairs", {
|
|
1660
1660
|
kind: "sequence",
|
|
1661
1661
|
resolve: resolveYamlPairs,
|
|
1662
1662
|
construct: constructYamlPairs
|
|
@@ -1666,17 +1666,17 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1666
1666
|
//#endregion
|
|
1667
1667
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js
|
|
1668
1668
|
var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1669
|
-
const type_1
|
|
1670
|
-
const ast
|
|
1669
|
+
const type_1 = require_type();
|
|
1670
|
+
const ast = require_yamlAST();
|
|
1671
1671
|
function resolveYamlSet(data) {
|
|
1672
1672
|
if (null === data) return true;
|
|
1673
|
-
if (data.kind != ast
|
|
1673
|
+
if (data.kind != ast.Kind.MAP) return false;
|
|
1674
1674
|
return true;
|
|
1675
1675
|
}
|
|
1676
1676
|
function constructYamlSet(data) {
|
|
1677
1677
|
return null !== data ? data : {};
|
|
1678
1678
|
}
|
|
1679
|
-
module.exports = new type_1
|
|
1679
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:set", {
|
|
1680
1680
|
kind: "mapping",
|
|
1681
1681
|
resolve: resolveYamlSet,
|
|
1682
1682
|
construct: constructYamlSet
|
|
@@ -1686,7 +1686,7 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1686
1686
|
//#endregion
|
|
1687
1687
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js
|
|
1688
1688
|
var require_default_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1689
|
-
var schema
|
|
1689
|
+
var schema = new (require_schema()).Schema({
|
|
1690
1690
|
include: [require_core()],
|
|
1691
1691
|
implicit: [require_timestamp(), require_merge()],
|
|
1692
1692
|
explicit: [
|
|
@@ -1696,13 +1696,13 @@ var require_default_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1696
1696
|
require_set()
|
|
1697
1697
|
]
|
|
1698
1698
|
});
|
|
1699
|
-
module.exports = schema
|
|
1699
|
+
module.exports = schema;
|
|
1700
1700
|
}));
|
|
1701
1701
|
|
|
1702
1702
|
//#endregion
|
|
1703
1703
|
//#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js
|
|
1704
1704
|
var require_undefined = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1705
|
-
const type_1
|
|
1705
|
+
const type_1 = require_type();
|
|
1706
1706
|
function resolveJavascriptUndefined() {
|
|
1707
1707
|
return true;
|
|
1708
1708
|
}
|
|
@@ -1713,7 +1713,7 @@ var require_undefined = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1713
1713
|
function isUndefined(object) {
|
|
1714
1714
|
return "undefined" === typeof object;
|
|
1715
1715
|
}
|
|
1716
|
-
module.exports = new type_1
|
|
1716
|
+
module.exports = new type_1.Type("tag:yaml.org,2002:js/undefined", {
|
|
1717
1717
|
kind: "scalar",
|
|
1718
1718
|
resolve: resolveJavascriptUndefined,
|
|
1719
1719
|
construct: constructJavascriptUndefined,
|
|
@@ -1786,12 +1786,12 @@ var require_default_full = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1786
1786
|
var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1787
1787
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1788
1788
|
const ast = require_yamlAST();
|
|
1789
|
-
const common
|
|
1790
|
-
const YAMLException
|
|
1789
|
+
const common = require_common();
|
|
1790
|
+
const YAMLException = require_exception();
|
|
1791
1791
|
const Mark = require_mark();
|
|
1792
|
-
const DEFAULT_SAFE_SCHEMA
|
|
1793
|
-
const DEFAULT_FULL_SCHEMA
|
|
1794
|
-
var _hasOwnProperty
|
|
1792
|
+
const DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
1793
|
+
const DEFAULT_FULL_SCHEMA = require_default_full();
|
|
1794
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1795
1795
|
var CONTEXT_FLOW_IN = 1;
|
|
1796
1796
|
var CONTEXT_FLOW_OUT = 2;
|
|
1797
1797
|
var CONTEXT_BLOCK_IN = 3;
|
|
@@ -1850,14 +1850,14 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1850
1850
|
customEscapeCheck[i] = 1;
|
|
1851
1851
|
if (!simpleEscapeCheck[i]) customEscapeMap[i] = "\\" + String.fromCharCode(i);
|
|
1852
1852
|
}
|
|
1853
|
-
var State
|
|
1853
|
+
var State = class {
|
|
1854
1854
|
constructor(input, options) {
|
|
1855
1855
|
this.errorMap = {};
|
|
1856
1856
|
this.errors = [];
|
|
1857
1857
|
this.lines = [];
|
|
1858
1858
|
this.input = input;
|
|
1859
1859
|
this.filename = options["filename"] || null;
|
|
1860
|
-
this.schema = options["schema"] || DEFAULT_FULL_SCHEMA
|
|
1860
|
+
this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
|
|
1861
1861
|
this.onWarning = options["onWarning"] || null;
|
|
1862
1862
|
this.legacy = options["legacy"] || false;
|
|
1863
1863
|
this.allowAnyEscape = options["allowAnyEscape"] || false;
|
|
@@ -1873,7 +1873,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
};
|
|
1875
1875
|
function generateError(state, message, isWarning = false) {
|
|
1876
|
-
return new YAMLException
|
|
1876
|
+
return new YAMLException(message, new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart), isWarning);
|
|
1877
1877
|
}
|
|
1878
1878
|
function throwErrorFromPosition(state, position, message, isWarning = false, toLineEnd = false) {
|
|
1879
1879
|
var line = positionToLine(state, position);
|
|
@@ -1882,7 +1882,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1882
1882
|
if (state.errorMap[hash]) return;
|
|
1883
1883
|
var mark = new Mark(state.filename, state.input, position, line.line, position - line.start);
|
|
1884
1884
|
if (toLineEnd) mark.toLineEnd = true;
|
|
1885
|
-
var error = new YAMLException
|
|
1885
|
+
var error = new YAMLException(message, mark, isWarning);
|
|
1886
1886
|
state.errors.push(error);
|
|
1887
1887
|
}
|
|
1888
1888
|
function throwError(state, message) {
|
|
@@ -1932,7 +1932,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1932
1932
|
handle = args[0];
|
|
1933
1933
|
prefix = args[1];
|
|
1934
1934
|
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
1935
|
-
if (_hasOwnProperty
|
|
1935
|
+
if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle");
|
|
1936
1936
|
if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1937
1937
|
state.tagMap[handle] = prefix;
|
|
1938
1938
|
}
|
|
@@ -1992,9 +1992,9 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1992
1992
|
}
|
|
1993
1993
|
function positionToLine(state, position) {
|
|
1994
1994
|
var line;
|
|
1995
|
-
for (var i
|
|
1996
|
-
if (state.lines[i
|
|
1997
|
-
line = state.lines[i
|
|
1995
|
+
for (var i = 0; i < state.lines.length; i++) {
|
|
1996
|
+
if (state.lines[i].start > position) break;
|
|
1997
|
+
line = state.lines[i];
|
|
1998
1998
|
}
|
|
1999
1999
|
if (!line) return {
|
|
2000
2000
|
start: 0,
|
|
@@ -2049,7 +2049,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2049
2049
|
}
|
|
2050
2050
|
function writeFoldedLines(state, scalar, count) {
|
|
2051
2051
|
if (1 === count) scalar.value += " ";
|
|
2052
|
-
else if (count > 1) scalar.value += common
|
|
2052
|
+
else if (count > 1) scalar.value += common.repeat("\n", count - 1);
|
|
2053
2053
|
}
|
|
2054
2054
|
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
2055
2055
|
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
@@ -2304,7 +2304,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2304
2304
|
continue;
|
|
2305
2305
|
}
|
|
2306
2306
|
if (state.lineIndent < textIndent) {
|
|
2307
|
-
if (chomping === CHOMPING_KEEP) sc.value += common
|
|
2307
|
+
if (chomping === CHOMPING_KEEP) sc.value += common.repeat("\n", emptyLines);
|
|
2308
2308
|
else if (chomping === CHOMPING_CLIP) {
|
|
2309
2309
|
if (detectedIndent) sc.value += "\n";
|
|
2310
2310
|
}
|
|
@@ -2312,14 +2312,14 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
if (folding) if (is_WHITE_SPACE(ch)) {
|
|
2314
2314
|
atMoreIndented = true;
|
|
2315
|
-
sc.value += common
|
|
2315
|
+
sc.value += common.repeat("\n", emptyLines + 1);
|
|
2316
2316
|
} else if (atMoreIndented) {
|
|
2317
2317
|
atMoreIndented = false;
|
|
2318
|
-
sc.value += common
|
|
2318
|
+
sc.value += common.repeat("\n", emptyLines + 1);
|
|
2319
2319
|
} else if (0 === emptyLines) {
|
|
2320
2320
|
if (detectedIndent) sc.value += " ";
|
|
2321
|
-
} else sc.value += common
|
|
2322
|
-
else if (detectedIndent) sc.value += common
|
|
2321
|
+
} else sc.value += common.repeat("\n", emptyLines);
|
|
2322
|
+
else if (detectedIndent) sc.value += common.repeat("\n", emptyLines + 1);
|
|
2323
2323
|
detectedIndent = true;
|
|
2324
2324
|
emptyLines = 0;
|
|
2325
2325
|
captureStart = state.position;
|
|
@@ -2327,18 +2327,18 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2327
2327
|
captureSegment(state, captureStart, state.position, false);
|
|
2328
2328
|
}
|
|
2329
2329
|
sc.endPosition = state.position;
|
|
2330
|
-
var i
|
|
2330
|
+
var i = state.position - 1;
|
|
2331
2331
|
var needMinus = false;
|
|
2332
2332
|
while (true) {
|
|
2333
|
-
var c = state.input[i
|
|
2333
|
+
var c = state.input[i];
|
|
2334
2334
|
if (c == "\r" || c == "\n") {
|
|
2335
|
-
if (needMinus) i
|
|
2335
|
+
if (needMinus) i--;
|
|
2336
2336
|
break;
|
|
2337
2337
|
}
|
|
2338
2338
|
if (c != " " && c != " ") break;
|
|
2339
|
-
i
|
|
2339
|
+
i--;
|
|
2340
2340
|
}
|
|
2341
|
-
sc.endPosition = i
|
|
2341
|
+
sc.endPosition = i;
|
|
2342
2342
|
sc.rawValue = state.input.substring(sc.startPosition, sc.endPosition);
|
|
2343
2343
|
return true;
|
|
2344
2344
|
}
|
|
@@ -2507,7 +2507,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2507
2507
|
}
|
|
2508
2508
|
if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
2509
2509
|
if (isVerbatim) state.tag = tagName;
|
|
2510
|
-
else if (_hasOwnProperty
|
|
2510
|
+
else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
|
|
2511
2511
|
else if ("!" === tagHandle) state.tag = "!" + tagName;
|
|
2512
2512
|
else if ("!!" === tagHandle) state.tag = "tag:yaml.org,2002:" + tagName;
|
|
2513
2513
|
else throwError(state, "undeclared tag handle \"" + tagHandle + "\"");
|
|
@@ -2613,7 +2613,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2613
2613
|
break;
|
|
2614
2614
|
}
|
|
2615
2615
|
}
|
|
2616
|
-
else if (_hasOwnProperty
|
|
2616
|
+
else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
|
|
2617
2617
|
type = state.typeMap[state.tag];
|
|
2618
2618
|
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 + "\"");
|
|
2619
2619
|
if (!type.resolve(state.result)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
@@ -2658,7 +2658,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2658
2658
|
directiveArgs.push(state.input.slice(_position, state.position));
|
|
2659
2659
|
}
|
|
2660
2660
|
if (0 !== ch) readLineBreak(state);
|
|
2661
|
-
if (_hasOwnProperty
|
|
2661
|
+
if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
2662
2662
|
else {
|
|
2663
2663
|
throwWarning(state, "unknown document directive \"" + directiveName + "\"");
|
|
2664
2664
|
state.position++;
|
|
@@ -2692,7 +2692,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2692
2692
|
if (10 !== input.charCodeAt(inputLength - 1) && 13 !== input.charCodeAt(inputLength - 1)) input += "\n";
|
|
2693
2693
|
if (input.charCodeAt(0) === 65279) input = input.slice(1);
|
|
2694
2694
|
}
|
|
2695
|
-
var state = new State
|
|
2695
|
+
var state = new State(input, options);
|
|
2696
2696
|
state.input += "\0";
|
|
2697
2697
|
while (32 === state.input.charCodeAt(state.position)) {
|
|
2698
2698
|
state.lineIndent += 1;
|
|
@@ -2723,7 +2723,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2723
2723
|
var documents = loadDocuments(input, options);
|
|
2724
2724
|
if (0 === documents.length) return;
|
|
2725
2725
|
else if (1 === documents.length) return documents[0];
|
|
2726
|
-
var e = new YAMLException
|
|
2726
|
+
var e = new YAMLException("expected a single document in the stream, but found more");
|
|
2727
2727
|
e.mark = new Mark("", "", 0, 0, 0);
|
|
2728
2728
|
e.mark.position = documents[0].endPosition;
|
|
2729
2729
|
documents[0].errors.push(e);
|
|
@@ -2731,11 +2731,11 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2731
2731
|
}
|
|
2732
2732
|
exports.load = load;
|
|
2733
2733
|
function safeLoadAll(input, output, options = {}) {
|
|
2734
|
-
loadAll(input, output, common
|
|
2734
|
+
loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2735
2735
|
}
|
|
2736
2736
|
exports.safeLoadAll = safeLoadAll;
|
|
2737
2737
|
function safeLoad(input, options = {}) {
|
|
2738
|
-
return load(input, common
|
|
2738
|
+
return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
2739
2739
|
}
|
|
2740
2740
|
exports.safeLoad = safeLoad;
|
|
2741
2741
|
module.exports.loadAll = loadAll;
|
|
@@ -2812,7 +2812,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2812
2812
|
"Off",
|
|
2813
2813
|
"OFF"
|
|
2814
2814
|
];
|
|
2815
|
-
function compileStyleMap(schema
|
|
2815
|
+
function compileStyleMap(schema, map) {
|
|
2816
2816
|
var result, keys, index, length, tag, style, type;
|
|
2817
2817
|
if (map === null) return {};
|
|
2818
2818
|
result = {};
|
|
@@ -2821,7 +2821,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2821
2821
|
tag = keys[index];
|
|
2822
2822
|
style = String(map[tag]);
|
|
2823
2823
|
if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
2824
|
-
type = schema
|
|
2824
|
+
type = schema.compiledTypeMap["fallback"][tag];
|
|
2825
2825
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
|
|
2826
2826
|
result[tag] = style;
|
|
2827
2827
|
}
|
|
@@ -2908,33 +2908,33 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2908
2908
|
}
|
|
2909
2909
|
var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
|
|
2910
2910
|
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
|
2911
|
-
var i
|
|
2911
|
+
var i;
|
|
2912
2912
|
var char, prev_char;
|
|
2913
2913
|
var hasLineBreak = false;
|
|
2914
2914
|
var hasFoldableLine = false;
|
|
2915
2915
|
var shouldTrackWidth = lineWidth !== -1;
|
|
2916
2916
|
var previousLineBreak = -1;
|
|
2917
2917
|
var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
|
|
2918
|
-
if (singleLineOnly) for (i
|
|
2919
|
-
char = string.charCodeAt(i
|
|
2918
|
+
if (singleLineOnly) for (i = 0; i < string.length; i++) {
|
|
2919
|
+
char = string.charCodeAt(i);
|
|
2920
2920
|
if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
2921
|
-
prev_char = i
|
|
2921
|
+
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2922
2922
|
plain = plain && isPlainSafe(char, prev_char);
|
|
2923
2923
|
}
|
|
2924
2924
|
else {
|
|
2925
|
-
for (i
|
|
2926
|
-
char = string.charCodeAt(i
|
|
2925
|
+
for (i = 0; i < string.length; i++) {
|
|
2926
|
+
char = string.charCodeAt(i);
|
|
2927
2927
|
if (char === CHAR_LINE_FEED) {
|
|
2928
2928
|
hasLineBreak = true;
|
|
2929
2929
|
if (shouldTrackWidth) {
|
|
2930
|
-
hasFoldableLine = hasFoldableLine || i
|
|
2931
|
-
previousLineBreak = i
|
|
2930
|
+
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
2931
|
+
previousLineBreak = i;
|
|
2932
2932
|
}
|
|
2933
2933
|
} else if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
2934
|
-
prev_char = i
|
|
2934
|
+
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2935
2935
|
plain = plain && isPlainSafe(char, prev_char);
|
|
2936
2936
|
}
|
|
2937
|
-
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i
|
|
2937
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
2938
2938
|
}
|
|
2939
2939
|
if (!hasLineBreak && !hasFoldableLine) return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
|
|
2940
2940
|
if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
|
|
@@ -2960,7 +2960,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
2960
2960
|
}
|
|
2961
2961
|
}();
|
|
2962
2962
|
if (!iskey) {
|
|
2963
|
-
let comment = new Comments
|
|
2963
|
+
let comment = new Comments(state, pointer).write(level, "before-eol");
|
|
2964
2964
|
if (comment !== "") _result += " " + comment;
|
|
2965
2965
|
}
|
|
2966
2966
|
state.dump = _result;
|
|
@@ -3016,18 +3016,18 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3016
3016
|
var result = "";
|
|
3017
3017
|
var char, nextChar;
|
|
3018
3018
|
var escapeSeq;
|
|
3019
|
-
for (var i
|
|
3020
|
-
char = string.charCodeAt(i
|
|
3019
|
+
for (var i = 0; i < string.length; i++) {
|
|
3020
|
+
char = string.charCodeAt(i);
|
|
3021
3021
|
if (char >= 55296 && char <= 56319) {
|
|
3022
|
-
nextChar = string.charCodeAt(i
|
|
3022
|
+
nextChar = string.charCodeAt(i + 1);
|
|
3023
3023
|
if (nextChar >= 56320 && nextChar <= 57343) {
|
|
3024
3024
|
result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
|
|
3025
|
-
i
|
|
3025
|
+
i++;
|
|
3026
3026
|
continue;
|
|
3027
3027
|
}
|
|
3028
3028
|
}
|
|
3029
3029
|
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
3030
|
-
result += !escapeSeq && isPrintable(char) ? string[i
|
|
3030
|
+
result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
|
|
3031
3031
|
}
|
|
3032
3032
|
return result;
|
|
3033
3033
|
}
|
|
@@ -3042,7 +3042,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
function writeBlockSequence(state, level, object, compact, pointer) {
|
|
3044
3044
|
var _result = "", _tag = state.tag, index, length;
|
|
3045
|
-
var comments = new Comments
|
|
3045
|
+
var comments = new Comments(state, pointer);
|
|
3046
3046
|
_result += comments.write(level, "before-eol");
|
|
3047
3047
|
_result += comments.write(level, "leading");
|
|
3048
3048
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
@@ -3082,7 +3082,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3082
3082
|
if (state.sortKeys === true) objectKeyList.sort();
|
|
3083
3083
|
else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys);
|
|
3084
3084
|
else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function");
|
|
3085
|
-
var comments = new Comments
|
|
3085
|
+
var comments = new Comments(state, pointer);
|
|
3086
3086
|
_result += comments.write(level, "before-eol");
|
|
3087
3087
|
_result += comments.write(level, "leading");
|
|
3088
3088
|
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
@@ -3097,7 +3097,7 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3097
3097
|
else pairBuffer += "? ";
|
|
3098
3098
|
pairBuffer += state.dump;
|
|
3099
3099
|
if (explicitPair) pairBuffer += generateNextLine(state, level);
|
|
3100
|
-
if (!writeNode(state, level + 1, objectValue, true, explicitPair, false, `${pointer}/${encodeSegment
|
|
3100
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair, false, `${pointer}/${encodeSegment(objectKey)}`)) continue;
|
|
3101
3101
|
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
|
|
3102
3102
|
else pairBuffer += ": ";
|
|
3103
3103
|
pairBuffer += state.dump;
|
|
@@ -3202,12 +3202,12 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3202
3202
|
return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
3203
3203
|
}
|
|
3204
3204
|
exports.safeDump = safeDump;
|
|
3205
|
-
const TILDE_REGEXP
|
|
3206
|
-
const SLASH_REGEXP
|
|
3207
|
-
function encodeSegment
|
|
3208
|
-
return input.replace(TILDE_REGEXP
|
|
3205
|
+
const TILDE_REGEXP = /~/g;
|
|
3206
|
+
const SLASH_REGEXP = /\//g;
|
|
3207
|
+
function encodeSegment(input) {
|
|
3208
|
+
return input.replace(TILDE_REGEXP, "~0").replace(SLASH_REGEXP, "~1");
|
|
3209
3209
|
}
|
|
3210
|
-
function Comments
|
|
3210
|
+
function Comments(state, pointer) {
|
|
3211
3211
|
this.state = state;
|
|
3212
3212
|
this.comments = {
|
|
3213
3213
|
"before-eol": /* @__PURE__ */ new Set(),
|
|
@@ -3233,18 +3233,18 @@ var require_dumper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3233
3233
|
break;
|
|
3234
3234
|
}
|
|
3235
3235
|
}
|
|
3236
|
-
Comments
|
|
3236
|
+
Comments.prototype.write = function(level, placement) {
|
|
3237
3237
|
let result = "";
|
|
3238
3238
|
for (let comment of this.comments[placement]) result += this._write(comment, level);
|
|
3239
3239
|
return result;
|
|
3240
3240
|
};
|
|
3241
|
-
Comments
|
|
3241
|
+
Comments.prototype.writeAt = function(key, level, placement) {
|
|
3242
3242
|
let result = "";
|
|
3243
3243
|
let comments = this.comments[placement].get(key);
|
|
3244
3244
|
if (comments) for (let comment of comments) result += this._write(comment, level);
|
|
3245
3245
|
return result;
|
|
3246
3246
|
};
|
|
3247
|
-
Comments
|
|
3247
|
+
Comments.prototype._write = function(comment, level) {
|
|
3248
3248
|
if (this.written.has(comment)) return "";
|
|
3249
3249
|
this.written.add(comment);
|
|
3250
3250
|
let result = "#" + comment.value;
|
|
@@ -3302,12 +3302,12 @@ var require_scalarInference = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3302
3302
|
}
|
|
3303
3303
|
exports.parseYamlFloat = parseYamlFloat;
|
|
3304
3304
|
var ScalarType;
|
|
3305
|
-
(function(ScalarType
|
|
3306
|
-
ScalarType
|
|
3307
|
-
ScalarType
|
|
3308
|
-
ScalarType
|
|
3309
|
-
ScalarType
|
|
3310
|
-
ScalarType
|
|
3305
|
+
(function(ScalarType) {
|
|
3306
|
+
ScalarType[ScalarType["null"] = 0] = "null";
|
|
3307
|
+
ScalarType[ScalarType["bool"] = 1] = "bool";
|
|
3308
|
+
ScalarType[ScalarType["int"] = 2] = "int";
|
|
3309
|
+
ScalarType[ScalarType["float"] = 3] = "float";
|
|
3310
|
+
ScalarType[ScalarType["string"] = 4] = "string";
|
|
3311
3311
|
})(ScalarType = exports.ScalarType || (exports.ScalarType = {}));
|
|
3312
3312
|
function determineScalarType(node) {
|
|
3313
3313
|
if (node === void 0) return ScalarType.null;
|
|
@@ -3364,9 +3364,9 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3364
3364
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/types.js
|
|
3365
3365
|
var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3366
3366
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3367
|
-
const yaml_ast_parser_1
|
|
3368
|
-
exports.Kind = yaml_ast_parser_1
|
|
3369
|
-
exports.ScalarType = yaml_ast_parser_1
|
|
3367
|
+
const yaml_ast_parser_1 = require_src$1();
|
|
3368
|
+
exports.Kind = yaml_ast_parser_1.Kind;
|
|
3369
|
+
exports.ScalarType = yaml_ast_parser_1.ScalarType;
|
|
3370
3370
|
}));
|
|
3371
3371
|
|
|
3372
3372
|
//#endregion
|
|
@@ -3380,24 +3380,24 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3380
3380
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/buildJsonPath.js
|
|
3381
3381
|
var require_buildJsonPath = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3382
3382
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3383
|
-
const types_1
|
|
3384
|
-
const utils_1
|
|
3383
|
+
const types_1 = require_types();
|
|
3384
|
+
const utils_1 = require_utils();
|
|
3385
3385
|
function buildJsonPath(node) {
|
|
3386
3386
|
const path$1 = [];
|
|
3387
3387
|
let prevNode = node;
|
|
3388
3388
|
while (node) {
|
|
3389
3389
|
switch (node.kind) {
|
|
3390
|
-
case types_1
|
|
3390
|
+
case types_1.Kind.SCALAR:
|
|
3391
3391
|
path$1.unshift(node.value);
|
|
3392
3392
|
break;
|
|
3393
|
-
case types_1
|
|
3394
|
-
if (prevNode !== node.key) if (path$1.length > 0 && utils_1
|
|
3393
|
+
case types_1.Kind.MAPPING:
|
|
3394
|
+
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;
|
|
3395
3395
|
else path$1.unshift(node.key.value);
|
|
3396
3396
|
break;
|
|
3397
|
-
case types_1
|
|
3397
|
+
case types_1.Kind.SEQ:
|
|
3398
3398
|
if (prevNode) {
|
|
3399
3399
|
const index = node.items.indexOf(prevNode);
|
|
3400
|
-
if (prevNode.kind === types_1
|
|
3400
|
+
if (prevNode.kind === types_1.Kind.SCALAR) path$1[0] = index;
|
|
3401
3401
|
else if (index !== -1) path$1.unshift(index);
|
|
3402
3402
|
}
|
|
3403
3403
|
break;
|
|
@@ -3414,18 +3414,18 @@ var require_buildJsonPath = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3414
3414
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/dereferenceAnchor.js
|
|
3415
3415
|
var require_dereferenceAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3416
3416
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3417
|
-
const types_1
|
|
3418
|
-
const utils_1
|
|
3417
|
+
const types_1 = require_types();
|
|
3418
|
+
const utils_1 = require_utils();
|
|
3419
3419
|
exports.dereferenceAnchor = (node, anchorId) => {
|
|
3420
|
-
if (!utils_1
|
|
3421
|
-
if (node.kind === types_1
|
|
3420
|
+
if (!utils_1.isObject(node)) return node;
|
|
3421
|
+
if (node.kind === types_1.Kind.ANCHOR_REF && node.referencesAnchor === anchorId) return null;
|
|
3422
3422
|
switch (node.kind) {
|
|
3423
|
-
case types_1
|
|
3424
|
-
case types_1
|
|
3425
|
-
case types_1
|
|
3426
|
-
case types_1
|
|
3427
|
-
case types_1
|
|
3428
|
-
if (utils_1
|
|
3423
|
+
case types_1.Kind.MAP: return Object.assign({}, node, { mappings: node.mappings.map((mapping) => exports.dereferenceAnchor(mapping, anchorId)) });
|
|
3424
|
+
case types_1.Kind.SEQ: return Object.assign({}, node, { items: node.items.map((item) => exports.dereferenceAnchor(item, anchorId)) });
|
|
3425
|
+
case types_1.Kind.MAPPING: return Object.assign({}, node, { value: exports.dereferenceAnchor(node.value, anchorId) });
|
|
3426
|
+
case types_1.Kind.SCALAR: return node;
|
|
3427
|
+
case types_1.Kind.ANCHOR_REF:
|
|
3428
|
+
if (utils_1.isObject(node.value) && isSelfReferencingAnchorRef(node)) return null;
|
|
3429
3429
|
return node;
|
|
3430
3430
|
default: return node;
|
|
3431
3431
|
}
|
|
@@ -3442,35 +3442,35 @@ var require_dereferenceAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3442
3442
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getJsonPathForPosition.js
|
|
3443
3443
|
var require_getJsonPathForPosition = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3444
3444
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3445
|
-
const buildJsonPath_1
|
|
3446
|
-
const types_1
|
|
3447
|
-
const utils_1
|
|
3448
|
-
exports.getJsonPathForPosition = ({ ast
|
|
3445
|
+
const buildJsonPath_1 = require_buildJsonPath();
|
|
3446
|
+
const types_1 = require_types();
|
|
3447
|
+
const utils_1 = require_utils();
|
|
3448
|
+
exports.getJsonPathForPosition = ({ ast, lineMap }, { line, character }) => {
|
|
3449
3449
|
if (line >= lineMap.length || character >= lineMap[line]) return;
|
|
3450
3450
|
const startOffset = line === 0 ? 0 : lineMap[line - 1] + 1;
|
|
3451
|
-
const node = findClosestScalar(ast
|
|
3452
|
-
if (!utils_1
|
|
3453
|
-
const path$1 = buildJsonPath_1
|
|
3451
|
+
const node = findClosestScalar(ast, Math.min(lineMap[line] - 1, startOffset + character), line, lineMap);
|
|
3452
|
+
if (!utils_1.isObject(node)) return;
|
|
3453
|
+
const path$1 = buildJsonPath_1.buildJsonPath(node);
|
|
3454
3454
|
if (path$1.length === 0) return;
|
|
3455
3455
|
return path$1;
|
|
3456
3456
|
};
|
|
3457
3457
|
function* walk(node) {
|
|
3458
3458
|
switch (node.kind) {
|
|
3459
|
-
case types_1
|
|
3459
|
+
case types_1.Kind.MAP:
|
|
3460
3460
|
if (node.mappings.length !== 0) {
|
|
3461
|
-
for (const mapping of node.mappings) if (utils_1
|
|
3461
|
+
for (const mapping of node.mappings) if (utils_1.isObject(mapping)) yield mapping;
|
|
3462
3462
|
}
|
|
3463
3463
|
break;
|
|
3464
|
-
case types_1
|
|
3465
|
-
if (utils_1
|
|
3466
|
-
if (utils_1
|
|
3464
|
+
case types_1.Kind.MAPPING:
|
|
3465
|
+
if (utils_1.isObject(node.key)) yield node.key;
|
|
3466
|
+
if (utils_1.isObject(node.value)) yield node.value;
|
|
3467
3467
|
break;
|
|
3468
|
-
case types_1
|
|
3468
|
+
case types_1.Kind.SEQ:
|
|
3469
3469
|
if (node.items.length !== 0) {
|
|
3470
|
-
for (const item of node.items) if (utils_1
|
|
3470
|
+
for (const item of node.items) if (utils_1.isObject(item)) yield item;
|
|
3471
3471
|
}
|
|
3472
3472
|
break;
|
|
3473
|
-
case types_1
|
|
3473
|
+
case types_1.Kind.SCALAR:
|
|
3474
3474
|
yield node;
|
|
3475
3475
|
break;
|
|
3476
3476
|
}
|
|
@@ -3479,13 +3479,13 @@ var require_getJsonPathForPosition = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3479
3479
|
const startOffset = lineMap[line - 1] + 1;
|
|
3480
3480
|
const endOffset = lineMap[line];
|
|
3481
3481
|
switch (node.kind) {
|
|
3482
|
-
case types_1
|
|
3483
|
-
case types_1
|
|
3482
|
+
case types_1.Kind.MAPPING: return node.key;
|
|
3483
|
+
case types_1.Kind.MAP:
|
|
3484
3484
|
if (node.mappings.length !== 0) {
|
|
3485
3485
|
for (const mapping of node.mappings) if (mapping.startPosition > startOffset && mapping.startPosition <= endOffset) return getFirstScalarChild(mapping, line, lineMap);
|
|
3486
3486
|
}
|
|
3487
3487
|
break;
|
|
3488
|
-
case types_1
|
|
3488
|
+
case types_1.Kind.SEQ:
|
|
3489
3489
|
if (node.items.length !== 0) {
|
|
3490
3490
|
for (const item of node.items) if (item !== null && item.startPosition > startOffset && item.startPosition <= endOffset) return getFirstScalarChild(item, line, lineMap);
|
|
3491
3491
|
}
|
|
@@ -3494,10 +3494,10 @@ var require_getJsonPathForPosition = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3494
3494
|
return node;
|
|
3495
3495
|
}
|
|
3496
3496
|
function findClosestScalar(container, offset, line, lineMap) {
|
|
3497
|
-
for (const node of walk(container)) if (node.startPosition <= offset && offset <= node.endPosition) return node.kind === types_1
|
|
3497
|
+
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);
|
|
3498
3498
|
if (lineMap[line - 1] === lineMap[line] - 1) return container;
|
|
3499
3499
|
if (container.startPosition < lineMap[line - 1] && offset <= container.endPosition) {
|
|
3500
|
-
if (container.kind !== types_1
|
|
3500
|
+
if (container.kind !== types_1.Kind.MAPPING) return getFirstScalarChild(container, line, lineMap);
|
|
3501
3501
|
if (container.value && container.key.endPosition < offset) return getFirstScalarChild(container.value, line, lineMap);
|
|
3502
3502
|
}
|
|
3503
3503
|
return container;
|
|
@@ -3528,11 +3528,11 @@ var require_lineForPosition = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3528
3528
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getLocationForJsonPath.js
|
|
3529
3529
|
var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3530
3530
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3531
|
-
const lineForPosition_1
|
|
3532
|
-
const types_1
|
|
3533
|
-
const utils_1
|
|
3534
|
-
exports.getLocationForJsonPath = ({ ast
|
|
3535
|
-
const node = findNodeAtPath(ast
|
|
3531
|
+
const lineForPosition_1 = require_lineForPosition();
|
|
3532
|
+
const types_1 = require_types();
|
|
3533
|
+
const utils_1 = require_utils();
|
|
3534
|
+
exports.getLocationForJsonPath = ({ ast, lineMap, metadata }, path$1, closest = false) => {
|
|
3535
|
+
const node = findNodeAtPath(ast, path$1, {
|
|
3536
3536
|
closest,
|
|
3537
3537
|
mergeKeys: metadata !== void 0 && metadata.mergeKeys === true
|
|
3538
3538
|
});
|
|
@@ -3543,42 +3543,42 @@ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3543
3543
|
});
|
|
3544
3544
|
};
|
|
3545
3545
|
function getStartPosition(node, offset) {
|
|
3546
|
-
if (node.parent && node.parent.kind === types_1
|
|
3546
|
+
if (node.parent && node.parent.kind === types_1.Kind.MAPPING) {
|
|
3547
3547
|
if (node.parent.value === null) return node.parent.endPosition;
|
|
3548
|
-
if (node.kind !== types_1
|
|
3548
|
+
if (node.kind !== types_1.Kind.SCALAR) return node.parent.key.endPosition + 1;
|
|
3549
3549
|
}
|
|
3550
3550
|
if (node.parent === null && offset - node.startPosition === 0) return 0;
|
|
3551
3551
|
return node.startPosition;
|
|
3552
3552
|
}
|
|
3553
3553
|
function getEndPosition(node) {
|
|
3554
3554
|
switch (node.kind) {
|
|
3555
|
-
case types_1
|
|
3555
|
+
case types_1.Kind.SEQ:
|
|
3556
3556
|
const { items } = node;
|
|
3557
3557
|
if (items.length !== 0) {
|
|
3558
3558
|
const lastItem = items[items.length - 1];
|
|
3559
3559
|
if (lastItem !== null) return getEndPosition(lastItem);
|
|
3560
3560
|
}
|
|
3561
3561
|
break;
|
|
3562
|
-
case types_1
|
|
3562
|
+
case types_1.Kind.MAPPING:
|
|
3563
3563
|
if (node.value !== null) return getEndPosition(node.value);
|
|
3564
3564
|
break;
|
|
3565
|
-
case types_1
|
|
3565
|
+
case types_1.Kind.MAP:
|
|
3566
3566
|
if (node.value !== null && node.mappings.length !== 0) return getEndPosition(node.mappings[node.mappings.length - 1]);
|
|
3567
3567
|
break;
|
|
3568
|
-
case types_1
|
|
3569
|
-
if (node.parent !== null && node.parent.kind === types_1
|
|
3568
|
+
case types_1.Kind.SCALAR:
|
|
3569
|
+
if (node.parent !== null && node.parent.kind === types_1.Kind.MAPPING && node.parent.value === null) return node.parent.endPosition;
|
|
3570
3570
|
break;
|
|
3571
3571
|
}
|
|
3572
3572
|
return node.endPosition;
|
|
3573
3573
|
}
|
|
3574
3574
|
function findNodeAtPath(node, path$1, { closest, mergeKeys }) {
|
|
3575
3575
|
pathLoop: for (const segment of path$1) {
|
|
3576
|
-
if (!utils_1
|
|
3576
|
+
if (!utils_1.isObject(node)) return closest ? node : void 0;
|
|
3577
3577
|
switch (node.kind) {
|
|
3578
|
-
case types_1
|
|
3578
|
+
case types_1.Kind.MAP:
|
|
3579
3579
|
const mappings = getMappings(node.mappings, mergeKeys);
|
|
3580
|
-
for (let i
|
|
3581
|
-
const item = mappings[i
|
|
3580
|
+
for (let i = mappings.length - 1; i >= 0; i--) {
|
|
3581
|
+
const item = mappings[i];
|
|
3582
3582
|
if (item.key.value === segment) {
|
|
3583
3583
|
if (item.value === null) node = item.key;
|
|
3584
3584
|
else node = item.value;
|
|
@@ -3586,9 +3586,9 @@ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3586
3586
|
}
|
|
3587
3587
|
}
|
|
3588
3588
|
return closest ? node : void 0;
|
|
3589
|
-
case types_1
|
|
3590
|
-
for (let i
|
|
3591
|
-
const item = node.items[i
|
|
3589
|
+
case types_1.Kind.SEQ:
|
|
3590
|
+
for (let i = 0; i < node.items.length; i++) if (i === Number(segment)) {
|
|
3591
|
+
const item = node.items[i];
|
|
3592
3592
|
if (item === null) break;
|
|
3593
3593
|
node = item;
|
|
3594
3594
|
continue pathLoop;
|
|
@@ -3602,26 +3602,26 @@ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
3602
3602
|
function getMappings(mappings, mergeKeys) {
|
|
3603
3603
|
if (!mergeKeys) return mappings;
|
|
3604
3604
|
return mappings.reduce((mergedMappings, mapping) => {
|
|
3605
|
-
if (utils_1
|
|
3605
|
+
if (utils_1.isObject(mapping)) if (mapping.key.value === "<<") mergedMappings.push(...reduceMergeKeys(mapping.value));
|
|
3606
3606
|
else mergedMappings.push(mapping);
|
|
3607
3607
|
return mergedMappings;
|
|
3608
3608
|
}, []);
|
|
3609
3609
|
}
|
|
3610
|
-
function reduceMergeKeys
|
|
3611
|
-
if (!utils_1
|
|
3610
|
+
function reduceMergeKeys(node) {
|
|
3611
|
+
if (!utils_1.isObject(node)) return [];
|
|
3612
3612
|
switch (node.kind) {
|
|
3613
|
-
case types_1
|
|
3614
|
-
items.push(...reduceMergeKeys
|
|
3613
|
+
case types_1.Kind.SEQ: return node.items.reduceRight((items, item) => {
|
|
3614
|
+
items.push(...reduceMergeKeys(item));
|
|
3615
3615
|
return items;
|
|
3616
3616
|
}, []);
|
|
3617
|
-
case types_1
|
|
3618
|
-
case types_1
|
|
3617
|
+
case types_1.Kind.MAP: return node.mappings;
|
|
3618
|
+
case types_1.Kind.ANCHOR_REF: return reduceMergeKeys(node.value);
|
|
3619
3619
|
default: return [];
|
|
3620
3620
|
}
|
|
3621
3621
|
}
|
|
3622
3622
|
const getLoc = (lineMap, { start = 0, end = 0 }) => {
|
|
3623
|
-
const startLine = lineForPosition_1
|
|
3624
|
-
const endLine = lineForPosition_1
|
|
3623
|
+
const startLine = lineForPosition_1.lineForPosition(start, lineMap);
|
|
3624
|
+
const endLine = lineForPosition_1.lineForPosition(end, lineMap);
|
|
3625
3625
|
return { range: {
|
|
3626
3626
|
start: {
|
|
3627
3627
|
line: startLine,
|
|
@@ -3642,7 +3642,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3642
3642
|
const ORDER_KEY_ID = `__object_order_${Math.floor(Date.now() / 36e5)}__`;
|
|
3643
3643
|
const ORDER_KEY = Symbol.for(ORDER_KEY_ID);
|
|
3644
3644
|
const STRINGIFIED_ORDER_KEY = String(ORDER_KEY);
|
|
3645
|
-
const traps
|
|
3645
|
+
const traps = {
|
|
3646
3646
|
defineProperty(target, key, descriptor) {
|
|
3647
3647
|
if (!Object.prototype.hasOwnProperty.call(target, key) && ORDER_KEY in target) target[ORDER_KEY].push(key);
|
|
3648
3648
|
else if ("value" in descriptor && key === ORDER_KEY && descriptor.value.lastIndexOf(ORDER_KEY) === -1) descriptor.value.push(ORDER_KEY);
|
|
@@ -3670,7 +3670,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3670
3670
|
};
|
|
3671
3671
|
function createObj(target, order = Reflect.ownKeys(target)) {
|
|
3672
3672
|
assertObjectLiteral(target);
|
|
3673
|
-
const t = new Proxy(target, traps
|
|
3673
|
+
const t = new Proxy(target, traps);
|
|
3674
3674
|
setOrder(t, order);
|
|
3675
3675
|
return t;
|
|
3676
3676
|
}
|
|
@@ -3689,9 +3689,9 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3689
3689
|
}
|
|
3690
3690
|
function serializeArray(target) {
|
|
3691
3691
|
const newTarget = target.slice();
|
|
3692
|
-
for (let i
|
|
3693
|
-
const value = newTarget[i
|
|
3694
|
-
if (isObject(value)) newTarget[i
|
|
3692
|
+
for (let i = 0; i < newTarget.length; i += 1) {
|
|
3693
|
+
const value = newTarget[i];
|
|
3694
|
+
if (isObject(value)) newTarget[i] = Array.isArray(value) ? serializeArray(value) : serialize(value, true);
|
|
3695
3695
|
}
|
|
3696
3696
|
return newTarget;
|
|
3697
3697
|
}
|
|
@@ -3710,9 +3710,9 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3710
3710
|
return newTarget;
|
|
3711
3711
|
}
|
|
3712
3712
|
function deserializeArray(target) {
|
|
3713
|
-
for (let i
|
|
3714
|
-
const value = target[i
|
|
3715
|
-
if (isObject(value)) target[i
|
|
3713
|
+
for (let i = 0; i < target.length; i += 1) {
|
|
3714
|
+
const value = target[i];
|
|
3715
|
+
if (isObject(value)) target[i] = Array.isArray(value) ? deserializeArray(value) : deserialize(value, true);
|
|
3716
3716
|
}
|
|
3717
3717
|
return target;
|
|
3718
3718
|
}
|
|
@@ -3895,9 +3895,9 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3895
3895
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parseWithPointers.js
|
|
3896
3896
|
var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3897
3897
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3898
|
-
const ordered_object_literal_1
|
|
3898
|
+
const ordered_object_literal_1 = require_src();
|
|
3899
3899
|
const types_1 = require_dist();
|
|
3900
|
-
const yaml_ast_parser_1
|
|
3900
|
+
const yaml_ast_parser_1 = require_src$1();
|
|
3901
3901
|
const buildJsonPath_1 = require_buildJsonPath();
|
|
3902
3902
|
const dereferenceAnchor_1 = require_dereferenceAnchor();
|
|
3903
3903
|
const lineForPosition_1 = require_lineForPosition();
|
|
@@ -3905,23 +3905,23 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3905
3905
|
const utils_1 = require_utils();
|
|
3906
3906
|
exports.parseWithPointers = (value, options) => {
|
|
3907
3907
|
const lineMap = computeLineMap(value);
|
|
3908
|
-
const ast
|
|
3908
|
+
const ast = yaml_ast_parser_1.load(value, Object.assign({}, options, { ignoreDuplicateKeys: true }));
|
|
3909
3909
|
const parsed = {
|
|
3910
|
-
ast
|
|
3910
|
+
ast,
|
|
3911
3911
|
lineMap,
|
|
3912
3912
|
data: void 0,
|
|
3913
3913
|
diagnostics: [],
|
|
3914
3914
|
metadata: options,
|
|
3915
3915
|
comments: {}
|
|
3916
3916
|
};
|
|
3917
|
-
if (!ast
|
|
3917
|
+
if (!ast) return parsed;
|
|
3918
3918
|
const normalizedOptions = normalizeOptions(options);
|
|
3919
|
-
const comments = new Comments(parsed.comments, Comments.mapComments(normalizedOptions.attachComments && ast
|
|
3919
|
+
const comments = new Comments(parsed.comments, Comments.mapComments(normalizedOptions.attachComments && ast.comments ? ast.comments : [], lineMap), ast, lineMap, "#");
|
|
3920
3920
|
parsed.data = walkAST({
|
|
3921
3921
|
lineMap,
|
|
3922
3922
|
diagnostics: parsed.diagnostics
|
|
3923
|
-
}, ast
|
|
3924
|
-
if (ast
|
|
3923
|
+
}, ast, comments, normalizedOptions);
|
|
3924
|
+
if (ast.errors) parsed.diagnostics.push(...transformErrors(ast.errors, lineMap));
|
|
3925
3925
|
if (parsed.diagnostics.length > 0) parsed.diagnostics.sort((itemA, itemB) => itemA.range.start.line - itemB.range.start.line);
|
|
3926
3926
|
if (Array.isArray(parsed.ast.errors)) parsed.ast.errors.length = 0;
|
|
3927
3927
|
return parsed;
|
|
@@ -3964,9 +3964,9 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3964
3964
|
}
|
|
3965
3965
|
case types_2.Kind.SEQ: {
|
|
3966
3966
|
const nodeComments = comments.enter(node);
|
|
3967
|
-
const container = node.items.map((item, i
|
|
3967
|
+
const container = node.items.map((item, i) => {
|
|
3968
3968
|
if (item !== null) {
|
|
3969
|
-
const sequenceItemComments = nodeComments.enter(item, i
|
|
3969
|
+
const sequenceItemComments = nodeComments.enter(item, i);
|
|
3970
3970
|
const walked = walkAST(ctx, item, sequenceItemComments, options);
|
|
3971
3971
|
sequenceItemComments.attachComments();
|
|
3972
3972
|
return walked;
|
|
@@ -3987,19 +3987,19 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3987
3987
|
return node;
|
|
3988
3988
|
};
|
|
3989
3989
|
function getScalarValue(node) {
|
|
3990
|
-
switch (yaml_ast_parser_1
|
|
3990
|
+
switch (yaml_ast_parser_1.determineScalarType(node)) {
|
|
3991
3991
|
case types_2.ScalarType.null: return null;
|
|
3992
3992
|
case types_2.ScalarType.string: return String(node.value);
|
|
3993
|
-
case types_2.ScalarType.bool: return yaml_ast_parser_1
|
|
3994
|
-
case types_2.ScalarType.int: return yaml_ast_parser_1
|
|
3995
|
-
case types_2.ScalarType.float: return yaml_ast_parser_1
|
|
3993
|
+
case types_2.ScalarType.bool: return yaml_ast_parser_1.parseYamlBoolean(node.value);
|
|
3994
|
+
case types_2.ScalarType.int: return yaml_ast_parser_1.parseYamlBigInteger(node.value);
|
|
3995
|
+
case types_2.ScalarType.float: return yaml_ast_parser_1.parseYamlFloat(node.value);
|
|
3996
3996
|
}
|
|
3997
3997
|
}
|
|
3998
3998
|
const computeLineMap = (input) => {
|
|
3999
3999
|
const lineMap = [];
|
|
4000
|
-
let i
|
|
4001
|
-
for (; i
|
|
4002
|
-
lineMap.push(i
|
|
4000
|
+
let i = 0;
|
|
4001
|
+
for (; i < input.length; i++) if (input[i] === "\n") lineMap.push(i + 1);
|
|
4002
|
+
lineMap.push(i + 1);
|
|
4003
4003
|
return lineMap;
|
|
4004
4004
|
};
|
|
4005
4005
|
function getLineLength(lineMap, line) {
|
|
@@ -4009,7 +4009,7 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4009
4009
|
const transformErrors = (errors, lineMap) => {
|
|
4010
4010
|
const validations = [];
|
|
4011
4011
|
let possiblyUnexpectedFlow = -1;
|
|
4012
|
-
let i
|
|
4012
|
+
let i = 0;
|
|
4013
4013
|
for (const error of errors) {
|
|
4014
4014
|
const validation = {
|
|
4015
4015
|
code: error.name,
|
|
@@ -4026,16 +4026,16 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4026
4026
|
}
|
|
4027
4027
|
}
|
|
4028
4028
|
};
|
|
4029
|
-
if (error.reason === "missed comma between flow collection entries") possiblyUnexpectedFlow = possiblyUnexpectedFlow === -1 ? i
|
|
4029
|
+
if (error.reason === "missed comma between flow collection entries") possiblyUnexpectedFlow = possiblyUnexpectedFlow === -1 ? i : possiblyUnexpectedFlow;
|
|
4030
4030
|
else if (possiblyUnexpectedFlow !== -1) {
|
|
4031
4031
|
validations[possiblyUnexpectedFlow].range.end = validation.range.end;
|
|
4032
4032
|
validations[possiblyUnexpectedFlow].message = "invalid mixed usage of block and flow styles";
|
|
4033
4033
|
validations.length = possiblyUnexpectedFlow + 1;
|
|
4034
|
-
i
|
|
4034
|
+
i = validations.length;
|
|
4035
4035
|
possiblyUnexpectedFlow = -1;
|
|
4036
4036
|
}
|
|
4037
4037
|
validations.push(validation);
|
|
4038
|
-
i
|
|
4038
|
+
i++;
|
|
4039
4039
|
}
|
|
4040
4040
|
return validations;
|
|
4041
4041
|
};
|
|
@@ -4043,27 +4043,27 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4043
4043
|
if (Array.isArray(items)) return items.reduceRight(preserveKeyOrder ? (merged, item) => {
|
|
4044
4044
|
const keys = Object.keys(item);
|
|
4045
4045
|
Object.assign(merged, item);
|
|
4046
|
-
for (let i
|
|
4046
|
+
for (let i = keys.length - 1; i >= 0; i--) unshiftKey(merged, keys[i]);
|
|
4047
4047
|
return merged;
|
|
4048
4048
|
} : (merged, item) => Object.assign(merged, item), createMapContainer(preserveKeyOrder));
|
|
4049
4049
|
return typeof items !== "object" || items === null ? null : Object(items);
|
|
4050
4050
|
};
|
|
4051
4051
|
function createMapContainer(preserveKeyOrder) {
|
|
4052
|
-
return preserveKeyOrder ? ordered_object_literal_1
|
|
4052
|
+
return preserveKeyOrder ? ordered_object_literal_1.default({}) : {};
|
|
4053
4053
|
}
|
|
4054
4054
|
function deleteKey(container, key) {
|
|
4055
4055
|
if (!(key in container)) return;
|
|
4056
|
-
const order = ordered_object_literal_1
|
|
4056
|
+
const order = ordered_object_literal_1.getOrder(container);
|
|
4057
4057
|
const index = order.indexOf(key);
|
|
4058
4058
|
if (index !== -1) order.splice(index, 1);
|
|
4059
4059
|
}
|
|
4060
4060
|
function unshiftKey(container, key) {
|
|
4061
4061
|
deleteKey(container, key);
|
|
4062
|
-
ordered_object_literal_1
|
|
4062
|
+
ordered_object_literal_1.getOrder(container).unshift(key);
|
|
4063
4063
|
}
|
|
4064
4064
|
function pushKey(container, key) {
|
|
4065
4065
|
deleteKey(container, key);
|
|
4066
|
-
ordered_object_literal_1
|
|
4066
|
+
ordered_object_literal_1.getOrder(container).push(key);
|
|
4067
4067
|
}
|
|
4068
4068
|
function validateMappingKey(mapping, lineMap, diagnostics, yamlMode) {
|
|
4069
4069
|
if (mapping.key.kind !== types_2.Kind.SCALAR) {
|
|
@@ -4118,11 +4118,11 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4118
4118
|
const startLine = lineForPosition_1.lineForPosition(startPosition, this.lineMap);
|
|
4119
4119
|
const endLine = lineForPosition_1.lineForPosition(endPosition, this.lineMap);
|
|
4120
4120
|
const matchingComments = [];
|
|
4121
|
-
for (let i
|
|
4122
|
-
const comment = comments[i
|
|
4121
|
+
for (let i = comments.length - 1; i >= 0; i--) {
|
|
4122
|
+
const comment = comments[i];
|
|
4123
4123
|
if (comment.range.start.line >= startLine && comment.range.end.line <= endLine) {
|
|
4124
4124
|
matchingComments.push(comment);
|
|
4125
|
-
comments.splice(i
|
|
4125
|
+
comments.splice(i, 1);
|
|
4126
4126
|
}
|
|
4127
4127
|
}
|
|
4128
4128
|
this.comments = matchingComments;
|
|
@@ -4188,11 +4188,11 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4188
4188
|
}
|
|
4189
4189
|
case types_2.Kind.SEQ: {
|
|
4190
4190
|
let left;
|
|
4191
|
-
for (let i
|
|
4192
|
-
const item = node.items[i
|
|
4191
|
+
for (let i = 0; i < node.items.length; i++) {
|
|
4192
|
+
const item = node.items[i];
|
|
4193
4193
|
if (item === null) continue;
|
|
4194
|
-
if (startPosition > item.startPosition) left = String(i
|
|
4195
|
-
else if (left !== void 0 && item.startPosition > endPosition) return [left, String(i
|
|
4194
|
+
if (startPosition > item.startPosition) left = String(i);
|
|
4195
|
+
else if (left !== void 0 && item.startPosition > endPosition) return [left, String(i)];
|
|
4196
4196
|
}
|
|
4197
4197
|
return null;
|
|
4198
4198
|
}
|
|
@@ -4255,8 +4255,8 @@ var require_parseWithPointers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4255
4255
|
//#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parse.js
|
|
4256
4256
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4257
4257
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4258
|
-
const parseWithPointers_1
|
|
4259
|
-
exports.parse = (value) => parseWithPointers_1
|
|
4258
|
+
const parseWithPointers_1 = require_parseWithPointers();
|
|
4259
|
+
exports.parse = (value) => parseWithPointers_1.parseWithPointers(value).data;
|
|
4260
4260
|
}));
|
|
4261
4261
|
|
|
4262
4262
|
//#endregion
|
|
@@ -4316,8 +4316,8 @@ function isParameterObject(obj) {
|
|
|
4316
4316
|
* @param schema - The schema object to check.
|
|
4317
4317
|
* @returns `true` if the schema is marked as nullable; otherwise, `false`.
|
|
4318
4318
|
*/
|
|
4319
|
-
function isNullable(schema
|
|
4320
|
-
return schema
|
|
4319
|
+
function isNullable(schema) {
|
|
4320
|
+
return schema?.nullable ?? schema?.["x-nullable"] ?? false;
|
|
4321
4321
|
}
|
|
4322
4322
|
/**
|
|
4323
4323
|
* Determines if the given object is an OpenAPI ReferenceObject.
|
|
@@ -4343,12 +4343,12 @@ function isDiscriminator(obj) {
|
|
|
4343
4343
|
* @param schema - The schema object to check.
|
|
4344
4344
|
* @returns True if the schema is required; otherwise, false.
|
|
4345
4345
|
*/
|
|
4346
|
-
function isRequired(schema
|
|
4347
|
-
if (!schema
|
|
4348
|
-
return Array.isArray(schema
|
|
4346
|
+
function isRequired(schema) {
|
|
4347
|
+
if (!schema) return false;
|
|
4348
|
+
return Array.isArray(schema.required) ? !!schema.required?.length : !!schema.required;
|
|
4349
4349
|
}
|
|
4350
|
-
function isOptional(schema
|
|
4351
|
-
return !isRequired(schema
|
|
4350
|
+
function isOptional(schema) {
|
|
4351
|
+
return !isRequired(schema);
|
|
4352
4352
|
}
|
|
4353
4353
|
async function parse(pathOrApi, { oasClass = Oas, canBundle = true, enablePaths = true } = {}) {
|
|
4354
4354
|
const { loadConfig, bundle } = await import("@redocly/openapi-core");
|
|
@@ -4392,7 +4392,7 @@ async function merge(pathOrApi, { oasClass = Oas } = {}) {
|
|
|
4392
4392
|
}
|
|
4393
4393
|
function parseFromConfig(config, oasClass = Oas) {
|
|
4394
4394
|
if ("data" in config.input) {
|
|
4395
|
-
if (typeof config.input.data === "object") return parse(
|
|
4395
|
+
if (typeof config.input.data === "object") return parse(structuredClone(config.input.data), { oasClass });
|
|
4396
4396
|
try {
|
|
4397
4397
|
return parse(import_yaml.parse(config.input.data), { oasClass });
|
|
4398
4398
|
} catch (_e) {
|
|
@@ -4446,8 +4446,8 @@ var Oas = class extends BaseOas {
|
|
|
4446
4446
|
jsonpointer.set(this.api, $ref, value);
|
|
4447
4447
|
}
|
|
4448
4448
|
}
|
|
4449
|
-
#setDiscriminator(schema
|
|
4450
|
-
const { mapping = {}, propertyName } = schema
|
|
4449
|
+
#setDiscriminator(schema) {
|
|
4450
|
+
const { mapping = {}, propertyName } = schema.discriminator;
|
|
4451
4451
|
if (this.#options.discriminator === "inherit") Object.entries(mapping).forEach(([mappingKey, mappingValue]) => {
|
|
4452
4452
|
if (mappingValue) {
|
|
4453
4453
|
const childSchema = this.get(mappingValue);
|
|
@@ -4464,39 +4464,39 @@ var Oas = class extends BaseOas {
|
|
|
4464
4464
|
}
|
|
4465
4465
|
});
|
|
4466
4466
|
}
|
|
4467
|
-
getDiscriminator(schema
|
|
4468
|
-
if (!isDiscriminator(schema
|
|
4469
|
-
const { mapping = {}, propertyName } = schema
|
|
4470
|
-
if (schema
|
|
4471
|
-
if (isReference(schema$
|
|
4472
|
-
const key = this.getKey(schema$
|
|
4473
|
-
const propertySchema = this.get(schema$
|
|
4474
|
-
const canAdd = key && !Object.values(mapping).includes(schema$
|
|
4475
|
-
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$
|
|
4476
|
-
else if (canAdd) mapping[key] = schema$
|
|
4467
|
+
getDiscriminator(schema) {
|
|
4468
|
+
if (!isDiscriminator(schema)) return;
|
|
4469
|
+
const { mapping = {}, propertyName } = schema.discriminator;
|
|
4470
|
+
if (schema.oneOf) schema.oneOf.forEach((schema$1) => {
|
|
4471
|
+
if (isReference(schema$1)) {
|
|
4472
|
+
const key = this.getKey(schema$1.$ref);
|
|
4473
|
+
const propertySchema = this.get(schema$1.$ref).properties?.[propertyName];
|
|
4474
|
+
const canAdd = key && !Object.values(mapping).includes(schema$1.$ref);
|
|
4475
|
+
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$1.$ref;
|
|
4476
|
+
else if (canAdd) mapping[key] = schema$1.$ref;
|
|
4477
4477
|
}
|
|
4478
4478
|
});
|
|
4479
|
-
if (schema
|
|
4480
|
-
if (isReference(schema$
|
|
4481
|
-
const key = this.getKey(schema$
|
|
4482
|
-
const propertySchema = this.get(schema$
|
|
4483
|
-
const canAdd = key && !Object.values(mapping).includes(schema$
|
|
4484
|
-
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$
|
|
4485
|
-
else if (canAdd) mapping[key] = schema$
|
|
4479
|
+
if (schema.anyOf) schema.anyOf.forEach((schema$1) => {
|
|
4480
|
+
if (isReference(schema$1)) {
|
|
4481
|
+
const key = this.getKey(schema$1.$ref);
|
|
4482
|
+
const propertySchema = this.get(schema$1.$ref).properties?.[propertyName];
|
|
4483
|
+
const canAdd = key && !Object.values(mapping).includes(schema$1.$ref);
|
|
4484
|
+
if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$1.$ref;
|
|
4485
|
+
else if (canAdd) mapping[key] = schema$1.$ref;
|
|
4486
4486
|
}
|
|
4487
4487
|
});
|
|
4488
4488
|
return {
|
|
4489
|
-
...schema
|
|
4489
|
+
...schema.discriminator,
|
|
4490
4490
|
mapping
|
|
4491
4491
|
};
|
|
4492
4492
|
}
|
|
4493
|
-
dereferenceWithRef(schema
|
|
4494
|
-
if (isReference(schema
|
|
4495
|
-
...schema
|
|
4496
|
-
...this.get(schema
|
|
4497
|
-
$ref: schema
|
|
4493
|
+
dereferenceWithRef(schema) {
|
|
4494
|
+
if (isReference(schema)) return {
|
|
4495
|
+
...schema,
|
|
4496
|
+
...this.get(schema.$ref),
|
|
4497
|
+
$ref: schema.$ref
|
|
4498
4498
|
};
|
|
4499
|
-
return schema
|
|
4499
|
+
return schema;
|
|
4500
4500
|
}
|
|
4501
4501
|
#applyDiscriminatorInheritance() {
|
|
4502
4502
|
const components = this.api.components;
|
|
@@ -4510,13 +4510,13 @@ var Oas = class extends BaseOas {
|
|
|
4510
4510
|
}
|
|
4511
4511
|
if (typeof value === "object") visit(value);
|
|
4512
4512
|
};
|
|
4513
|
-
const visit = (schema
|
|
4514
|
-
if (!schema
|
|
4515
|
-
if (isReference(schema
|
|
4516
|
-
visit(this.get(schema
|
|
4513
|
+
const visit = (schema) => {
|
|
4514
|
+
if (!schema || typeof schema !== "object") return;
|
|
4515
|
+
if (isReference(schema)) {
|
|
4516
|
+
visit(this.get(schema.$ref));
|
|
4517
4517
|
return;
|
|
4518
4518
|
}
|
|
4519
|
-
const schemaObject = schema
|
|
4519
|
+
const schemaObject = schema;
|
|
4520
4520
|
if (visited.has(schemaObject)) return;
|
|
4521
4521
|
visited.add(schemaObject);
|
|
4522
4522
|
if (isDiscriminator(schemaObject)) this.#setDiscriminator(schemaObject);
|
|
@@ -4529,7 +4529,7 @@ var Oas = class extends BaseOas {
|
|
|
4529
4529
|
if (schemaObject.properties) enqueue(Object.values(schemaObject.properties));
|
|
4530
4530
|
if (schemaObject.additionalProperties && typeof schemaObject.additionalProperties === "object") enqueue(schemaObject.additionalProperties);
|
|
4531
4531
|
};
|
|
4532
|
-
for (const schema
|
|
4532
|
+
for (const schema of Object.values(components.schemas)) visit(schema);
|
|
4533
4533
|
}
|
|
4534
4534
|
/**
|
|
4535
4535
|
* Oas does not have a getResponseBody(contentType)
|
|
@@ -4564,36 +4564,36 @@ var Oas = class extends BaseOas {
|
|
|
4564
4564
|
}
|
|
4565
4565
|
getResponseSchema(operation, statusCode) {
|
|
4566
4566
|
if (operation.schema.responses) Object.keys(operation.schema.responses).forEach((key) => {
|
|
4567
|
-
const schema$
|
|
4568
|
-
const $ref = isReference(schema$
|
|
4569
|
-
if (schema$
|
|
4567
|
+
const schema$1 = operation.schema.responses[key];
|
|
4568
|
+
const $ref = isReference(schema$1) ? schema$1.$ref : void 0;
|
|
4569
|
+
if (schema$1 && $ref) operation.schema.responses[key] = this.get($ref);
|
|
4570
4570
|
});
|
|
4571
4571
|
const getResponseBody = this.#getResponseBodyFactory(operation.getResponseByStatusCode(statusCode));
|
|
4572
4572
|
const { contentType } = this.#options;
|
|
4573
4573
|
const responseBody = getResponseBody(contentType);
|
|
4574
4574
|
if (responseBody === false) return {};
|
|
4575
|
-
const schema
|
|
4576
|
-
if (!schema
|
|
4577
|
-
return this.dereferenceWithRef(schema
|
|
4575
|
+
const schema = Array.isArray(responseBody) ? responseBody[1].schema : responseBody.schema;
|
|
4576
|
+
if (!schema) return {};
|
|
4577
|
+
return this.dereferenceWithRef(schema);
|
|
4578
4578
|
}
|
|
4579
4579
|
getRequestSchema(operation) {
|
|
4580
4580
|
const { contentType } = this.#options;
|
|
4581
4581
|
if (operation.schema.requestBody) operation.schema.requestBody = this.dereferenceWithRef(operation.schema.requestBody);
|
|
4582
4582
|
const requestBody = operation.getRequestBody(contentType);
|
|
4583
4583
|
if (requestBody === false) return;
|
|
4584
|
-
const schema
|
|
4585
|
-
if (!schema
|
|
4586
|
-
return this.dereferenceWithRef(schema
|
|
4584
|
+
const schema = Array.isArray(requestBody) ? requestBody[1].schema : requestBody.schema;
|
|
4585
|
+
if (!schema) return;
|
|
4586
|
+
return this.dereferenceWithRef(schema);
|
|
4587
4587
|
}
|
|
4588
4588
|
getParametersSchema(operation, inKey) {
|
|
4589
4589
|
const { contentType = operation.getContentType() } = this.#options;
|
|
4590
|
-
const params = operation.getParameters().map((schema
|
|
4591
|
-
return this.dereferenceWithRef(schema
|
|
4590
|
+
const params = operation.getParameters().map((schema) => {
|
|
4591
|
+
return this.dereferenceWithRef(schema);
|
|
4592
4592
|
}).filter((v) => v.in === inKey);
|
|
4593
4593
|
if (!params.length) return null;
|
|
4594
|
-
return params.reduce((schema
|
|
4594
|
+
return params.reduce((schema, pathParameters) => {
|
|
4595
4595
|
const property = pathParameters.content?.[contentType]?.schema ?? pathParameters.schema;
|
|
4596
|
-
const required = [...schema
|
|
4596
|
+
const required = [...schema.required || [], pathParameters.required ? pathParameters.name : void 0].filter(Boolean);
|
|
4597
4597
|
const getDefaultStyle = (location) => {
|
|
4598
4598
|
if (location === "query") return "form";
|
|
4599
4599
|
if (location === "path") return "simple";
|
|
@@ -4602,20 +4602,20 @@ var Oas = class extends BaseOas {
|
|
|
4602
4602
|
const style = pathParameters.style || getDefaultStyle(inKey);
|
|
4603
4603
|
const explode = pathParameters.explode !== void 0 ? pathParameters.explode : style === "form";
|
|
4604
4604
|
if (inKey === "query" && style === "form" && explode === true && property?.type === "object" && property?.additionalProperties && !property?.properties) return {
|
|
4605
|
-
...schema
|
|
4606
|
-
description: pathParameters.description || schema
|
|
4607
|
-
deprecated: schema
|
|
4608
|
-
example: property.example || schema
|
|
4605
|
+
...schema,
|
|
4606
|
+
description: pathParameters.description || schema.description,
|
|
4607
|
+
deprecated: schema.deprecated,
|
|
4608
|
+
example: property.example || schema.example,
|
|
4609
4609
|
additionalProperties: property.additionalProperties
|
|
4610
4610
|
};
|
|
4611
4611
|
return {
|
|
4612
|
-
...schema
|
|
4613
|
-
description: schema
|
|
4614
|
-
deprecated: schema
|
|
4615
|
-
example: schema
|
|
4612
|
+
...schema,
|
|
4613
|
+
description: schema.description,
|
|
4614
|
+
deprecated: schema.deprecated,
|
|
4615
|
+
example: schema.example,
|
|
4616
4616
|
required,
|
|
4617
4617
|
properties: {
|
|
4618
|
-
...schema
|
|
4618
|
+
...schema.properties,
|
|
4619
4619
|
[pathParameters.name]: {
|
|
4620
4620
|
description: pathParameters.description,
|
|
4621
4621
|
...property
|