@speclynx/apidom-reference 6.1.0 → 6.1.1
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/CHANGELOG.md +9 -0
- package/dist/apidom-reference.browser.js +424 -317
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +29 -29
- package/src/bundle/strategies/asyncapi-2/visitor.cjs +5 -0
- package/src/bundle/strategies/asyncapi-2/visitor.mjs +5 -0
- package/src/bundle/strategies/openapi-2/visitor.cjs +4 -0
- package/src/bundle/strategies/openapi-2/visitor.mjs +4 -0
- package/src/bundle/strategies/openapi-3-0/visitor.cjs +97 -82
- package/src/bundle/strategies/openapi-3-0/visitor.mjs +97 -82
- package/src/bundle/strategies/openapi-3-1/visitor.cjs +5 -0
- package/src/bundle/strategies/openapi-3-1/visitor.mjs +5 -0
- package/src/dereference/strategies/asyncapi-2/visitor.cjs +5 -0
- package/src/dereference/strategies/asyncapi-2/visitor.mjs +5 -0
- package/src/dereference/strategies/openapi-2/visitor.cjs +10 -0
- package/src/dereference/strategies/openapi-2/visitor.mjs +10 -0
- package/src/dereference/strategies/openapi-3-0/visitor.cjs +5 -0
- package/src/dereference/strategies/openapi-3-0/visitor.mjs +5 -0
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +5 -0
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +5 -0
- package/src/dereference/strategies/overlay-1/extends.cjs +52 -28
- package/src/dereference/strategies/overlay-1/extends.mjs +52 -28
- package/src/dereference/strategies/overlay-1/index.cjs +22 -10
- package/src/dereference/strategies/overlay-1/index.mjs +23 -11
- package/src/dereference/strategies/overlay-1/visitor.cjs +27 -2
- package/src/dereference/strategies/overlay-1/visitor.mjs +27 -3
- package/src/parse/parsers/overlay-json-1/extends.cjs +33 -13
- package/src/parse/parsers/overlay-json-1/extends.mjs +33 -14
- package/types/bundle/strategies/openapi-3-0/visitor.d.ts +8 -3
- package/types/dereference/strategies/overlay-1/visitor.d.ts +1 -1
|
@@ -298,7 +298,6 @@ class BundleStrategy {
|
|
|
298
298
|
|
|
299
299
|
"use strict";
|
|
300
300
|
__webpack_require__.r(__webpack_exports__);
|
|
301
|
-
/* empty/unused harmony star reexport */
|
|
302
301
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
303
302
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
304
303
|
/* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53787);
|
|
@@ -948,7 +947,6 @@ class Arazzo1BundleVisitor {
|
|
|
948
947
|
|
|
949
948
|
"use strict";
|
|
950
949
|
__webpack_require__.r(__webpack_exports__);
|
|
951
|
-
/* empty/unused harmony star reexport */
|
|
952
950
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
953
951
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
954
952
|
/* harmony import */ var _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46417);
|
|
@@ -1428,6 +1426,11 @@ class AsyncAPI2BundleVisitor {
|
|
|
1428
1426
|
}
|
|
1429
1427
|
async ReferenceElement(path) {
|
|
1430
1428
|
const referencingElement = path.node;
|
|
1429
|
+
|
|
1430
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
1431
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1431
1434
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
1432
1435
|
const retrievalURI = this.toBaseURI($ref);
|
|
1433
1436
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -1664,7 +1667,6 @@ class AsyncAPI2BundleVisitor {
|
|
|
1664
1667
|
|
|
1665
1668
|
"use strict";
|
|
1666
1669
|
__webpack_require__.r(__webpack_exports__);
|
|
1667
|
-
/* empty/unused harmony star reexport */
|
|
1668
1670
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
1669
1671
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
1670
1672
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3677);
|
|
@@ -2101,6 +2103,10 @@ class OpenAPI2BundleVisitor {
|
|
|
2101
2103
|
* and refraction helpers, so the shared logic is parameterized here.
|
|
2102
2104
|
*/
|
|
2103
2105
|
async bundleReference(path, referencingElement, isSemanticReference, isReferenceLike, refractReferenceFn, label) {
|
|
2106
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
2107
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2104
2110
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
2105
2111
|
const retrievalURI = this.toBaseURI($ref);
|
|
2106
2112
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -2357,7 +2363,6 @@ class OpenAPI2BundleVisitor {
|
|
|
2357
2363
|
|
|
2358
2364
|
"use strict";
|
|
2359
2365
|
__webpack_require__.r(__webpack_exports__);
|
|
2360
|
-
/* empty/unused harmony star reexport */
|
|
2361
2366
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
2362
2367
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
2363
2368
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
|
|
@@ -2812,6 +2817,11 @@ class OpenAPI3_0BundleVisitor {
|
|
|
2812
2817
|
}
|
|
2813
2818
|
async ReferenceElement(path) {
|
|
2814
2819
|
const referencingElement = path.node;
|
|
2820
|
+
|
|
2821
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
2822
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
2823
|
+
return;
|
|
2824
|
+
}
|
|
2815
2825
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
2816
2826
|
const retrievalURI = this.toBaseURI($ref);
|
|
2817
2827
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -2947,98 +2957,108 @@ class OpenAPI3_0BundleVisitor {
|
|
|
2947
2957
|
* Path Item Object is not a Components Object field in OpenAPI 3.0
|
|
2948
2958
|
* (unlike 3.1 which has `components.pathItems`). An external Path Item
|
|
2949
2959
|
* reference therefore cannot be hoisted; it is inlined in place instead,
|
|
2950
|
-
* after bundling its own external references.
|
|
2960
|
+
* after bundling its own external references. It is inlined on leave, once
|
|
2961
|
+
* the sibling fields of the referencing Path Item have been bundled, so the
|
|
2962
|
+
* traversal doesn't descend into the inlined copy and inline the `$ref` left
|
|
2963
|
+
* in it to break a cycle again.
|
|
2951
2964
|
*/
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
// ignore Path Item Objects without a $ref field
|
|
2956
|
-
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
|
|
2957
|
-
return;
|
|
2958
|
-
}
|
|
2959
|
-
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
|
|
2960
|
-
const retrievalURI = this.toBaseURI($ref);
|
|
2961
|
-
const isInternalReference = this.entryURI === retrievalURI;
|
|
2962
|
-
const isExternalReference = !isInternalReference;
|
|
2963
|
-
if (isInternalReference) {
|
|
2964
|
-
// normalize self-references to a bare fragment so the bundled
|
|
2965
|
-
// document stays transferable; bare fragments are left untouched
|
|
2966
|
-
pathItemElement.set('$ref', this.normalizeSelfReference($ref));
|
|
2967
|
-
return;
|
|
2968
|
-
}
|
|
2969
|
-
|
|
2970
|
-
// honor the resolve.external switch
|
|
2971
|
-
if (!this.options.resolve.external && isExternalReference) {
|
|
2972
|
-
return;
|
|
2973
|
-
}
|
|
2974
|
-
const $refBaseURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
|
|
2975
|
-
const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
2976
|
-
const canonicalKey = `${retrievalURI}#${jsonPointer}`;
|
|
2965
|
+
PathItemElement = {
|
|
2966
|
+
leave: async path => {
|
|
2967
|
+
const pathItemElement = path.node;
|
|
2977
2968
|
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2969
|
+
// ignore Path Item Objects without a $ref field
|
|
2970
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
|
|
2974
|
+
const retrievalURI = this.toBaseURI($ref);
|
|
2975
|
+
const isInternalReference = this.entryURI === retrievalURI;
|
|
2976
|
+
const isExternalReference = !isInternalReference;
|
|
2977
|
+
if (isInternalReference) {
|
|
2978
|
+
// normalize self-references to a bare fragment so the bundled
|
|
2979
|
+
// document stays transferable; bare fragments are left untouched
|
|
2980
|
+
pathItemElement.set('$ref', this.normalizeSelfReference($ref));
|
|
2981
|
+
return;
|
|
2990
2982
|
}
|
|
2991
|
-
const reference = await this.toReference($ref);
|
|
2992
|
-
let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
|
|
2993
2983
|
|
|
2994
|
-
//
|
|
2995
|
-
if (!
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
2984
|
+
// honor the resolve.external switch
|
|
2985
|
+
if (!this.options.resolve.external && isExternalReference) {
|
|
2986
|
+
return;
|
|
2987
|
+
}
|
|
2988
|
+
const $refBaseURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
|
|
2989
|
+
const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
2990
|
+
const canonicalKey = `${retrievalURI}#${jsonPointer}`;
|
|
2991
|
+
|
|
2992
|
+
// a circular external Path Item reference cannot be inlined without
|
|
2993
|
+
// recursing forever; leave the $ref in place to break the cycle. It ends
|
|
2994
|
+
// up in the entry document, so it has to resolve from there
|
|
2995
|
+
if (this.inlineStack.has(canonicalKey)) {
|
|
2996
|
+
const targetURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, $ref);
|
|
2997
|
+
if (_util_url_ts__WEBPACK_IMPORTED_MODULE_29__.resolve(this.entryURI, $ref) !== targetURI) {
|
|
2998
|
+
pathItemElement.set('$ref', _util_url_ts__WEBPACK_IMPORTED_MODULE_29__.relative(this.entryURI, targetURI));
|
|
3003
2999
|
}
|
|
3000
|
+
return;
|
|
3004
3001
|
}
|
|
3005
|
-
|
|
3006
|
-
// own a copy and bundle the external references it contains
|
|
3007
|
-
const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
|
|
3008
|
-
this.inlineStack.add(canonicalKey);
|
|
3009
|
-
const visitor = new OpenAPI3_0BundleVisitor({
|
|
3010
|
-
reference,
|
|
3011
|
-
options: this.options,
|
|
3012
|
-
assignments: this.assignments,
|
|
3013
|
-
reservedNames: this.reservedNames,
|
|
3014
|
-
refractCache: this.refractCache,
|
|
3015
|
-
inlineStack: this.inlineStack
|
|
3016
|
-
});
|
|
3017
|
-
let bundledElement;
|
|
3018
3002
|
try {
|
|
3019
|
-
|
|
3020
|
-
|
|
3003
|
+
// detect maximum depth of bundling
|
|
3004
|
+
if (this.reference.depth >= this.options.bundle.maxDepth) {
|
|
3005
|
+
throw new _errors_MaximumBundleDepthError_ts__WEBPACK_IMPORTED_MODULE_27__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
|
|
3006
|
+
maxDepth: this.options.bundle.maxDepth,
|
|
3007
|
+
uri: this.reference.uri
|
|
3008
|
+
});
|
|
3009
|
+
}
|
|
3010
|
+
const reference = await this.toReference($ref);
|
|
3011
|
+
let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
|
|
3012
|
+
|
|
3013
|
+
// apply Path Item semantics to the referenced fragment
|
|
3014
|
+
if (!(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.isPathItemElement)(referencedElement)) {
|
|
3015
|
+
const cached = this.getRefracted(referencedElement, 'pathItem');
|
|
3016
|
+
if (cached !== undefined) {
|
|
3017
|
+
referencedElement = cached;
|
|
3018
|
+
} else {
|
|
3019
|
+
const sourceElement = referencedElement;
|
|
3020
|
+
referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__.refractPathItem)(referencedElement);
|
|
3021
|
+
this.setRefracted(sourceElement, 'pathItem', referencedElement);
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
// own a copy and bundle the external references it contains
|
|
3026
|
+
const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
|
|
3027
|
+
this.inlineStack.add(canonicalKey);
|
|
3028
|
+
const visitor = new OpenAPI3_0BundleVisitor({
|
|
3029
|
+
reference,
|
|
3030
|
+
options: this.options,
|
|
3031
|
+
assignments: this.assignments,
|
|
3032
|
+
reservedNames: this.reservedNames,
|
|
3033
|
+
refractCache: this.refractCache,
|
|
3034
|
+
inlineStack: this.inlineStack
|
|
3021
3035
|
});
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3036
|
+
let bundledElement;
|
|
3037
|
+
try {
|
|
3038
|
+
bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(inlinedElement, visitor, {
|
|
3039
|
+
mutable: true
|
|
3040
|
+
});
|
|
3041
|
+
} finally {
|
|
3042
|
+
this.inlineStack.delete(canonicalKey);
|
|
3043
|
+
}
|
|
3025
3044
|
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3045
|
+
// merge sibling fields from the referencing Path Item over the referenced
|
|
3046
|
+
// one. The referencing `$ref` is being resolved away and is skipped; the
|
|
3047
|
+
// referenced element keeps its own `$ref` if one survived (i.e. it was
|
|
3048
|
+
// left in place to break a circular external Path Item chain).
|
|
3049
|
+
pathItemElement.forEach((_value, keyElement, item) => {
|
|
3050
|
+
const key = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(keyElement);
|
|
3051
|
+
if (key === '$ref') return;
|
|
3052
|
+
bundledElement.remove(key);
|
|
3053
|
+
bundledElement.content.push(item);
|
|
3054
|
+
});
|
|
3055
|
+
bundledElement.meta.set('ref-origin', reference.uri);
|
|
3056
|
+
path.replaceWith(bundledElement);
|
|
3057
|
+
} catch (error) {
|
|
3058
|
+
this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
|
|
3059
|
+
}
|
|
3040
3060
|
}
|
|
3041
|
-
}
|
|
3061
|
+
};
|
|
3042
3062
|
|
|
3043
3063
|
/**
|
|
3044
3064
|
* Example Object `externalValue` points at arbitrary external content that
|
|
@@ -3140,7 +3160,6 @@ class OpenAPI3_0BundleVisitor {
|
|
|
3140
3160
|
|
|
3141
3161
|
"use strict";
|
|
3142
3162
|
__webpack_require__.r(__webpack_exports__);
|
|
3143
|
-
/* empty/unused harmony star reexport */
|
|
3144
3163
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
3145
3164
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
3146
3165
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7822);
|
|
@@ -3701,6 +3720,11 @@ class OpenAPI3_1BundleVisitor {
|
|
|
3701
3720
|
};
|
|
3702
3721
|
async ReferenceElement(path) {
|
|
3703
3722
|
const referencingElement = path.node;
|
|
3723
|
+
|
|
3724
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
3725
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
|
|
3726
|
+
return;
|
|
3727
|
+
}
|
|
3704
3728
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(referencingElement.$ref);
|
|
3705
3729
|
const retrievalURI = this.toBaseURI($ref);
|
|
3706
3730
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -4490,7 +4514,6 @@ class DereferenceStrategy {
|
|
|
4490
4514
|
|
|
4491
4515
|
"use strict";
|
|
4492
4516
|
__webpack_require__.r(__webpack_exports__);
|
|
4493
|
-
/* empty/unused harmony star reexport */
|
|
4494
4517
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
4495
4518
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
4496
4519
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80796);
|
|
@@ -4595,7 +4618,6 @@ class ApiDOMDereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPORTE
|
|
|
4595
4618
|
|
|
4596
4619
|
"use strict";
|
|
4597
4620
|
__webpack_require__.r(__webpack_exports__);
|
|
4598
|
-
/* empty/unused harmony star reexport */
|
|
4599
4621
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33031);
|
|
4600
4622
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
4601
4623
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
@@ -4943,13 +4965,6 @@ class ApiDOMDereferenceVisitor {
|
|
|
4943
4965
|
|
|
4944
4966
|
"use strict";
|
|
4945
4967
|
__webpack_require__.r(__webpack_exports__);
|
|
4946
|
-
/* empty/unused harmony star reexport */
|
|
4947
|
-
/* empty/unused harmony star reexport */
|
|
4948
|
-
/* empty/unused harmony star reexport */
|
|
4949
|
-
/* empty/unused harmony star reexport */
|
|
4950
|
-
/* empty/unused harmony star reexport */
|
|
4951
|
-
/* empty/unused harmony star reexport */
|
|
4952
|
-
/* empty/unused harmony star reexport */
|
|
4953
4968
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96911);
|
|
4954
4969
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
4955
4970
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18252);
|
|
@@ -4960,8 +4975,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4960
4975
|
/* harmony import */ var _Reference_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98979);
|
|
4961
4976
|
/* harmony import */ var _ReferenceSet_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24131);
|
|
4962
4977
|
/* harmony import */ var _visitor_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31843);
|
|
4963
|
-
/* harmony import */ var
|
|
4964
|
-
/* harmony import */ var
|
|
4978
|
+
/* harmony import */ var _openapi_3_1_util_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(60888);
|
|
4979
|
+
/* harmony import */ var _source_descriptions_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(12586);
|
|
4965
4980
|
|
|
4966
4981
|
|
|
4967
4982
|
|
|
@@ -5027,7 +5042,7 @@ class Arazzo1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPORT
|
|
|
5027
5042
|
const visitor = new _visitor_ts__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
5028
5043
|
reference,
|
|
5029
5044
|
options,
|
|
5030
|
-
ancestorSchema$ids: (0,
|
|
5045
|
+
ancestorSchema$ids: (0,_openapi_3_1_util_ts__WEBPACK_IMPORTED_MODULE_10__.detachedRootSchema$ids)(refSet.rootRef.value.result)
|
|
5031
5046
|
});
|
|
5032
5047
|
const dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverseAsync)(refSet.rootRef.value, visitor, {
|
|
5033
5048
|
mutable: true,
|
|
@@ -5057,7 +5072,7 @@ class Arazzo1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPORT
|
|
|
5057
5072
|
// drop any existing parse-phase source description results before pushing
|
|
5058
5073
|
const cleaned = parseResult.reject(item => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(item) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses)(item, ['source-description']));
|
|
5059
5074
|
parseResult.content = cleaned.content;
|
|
5060
|
-
const sourceDescriptions = await (0,
|
|
5075
|
+
const sourceDescriptions = await (0,_source_descriptions_ts__WEBPACK_IMPORTED_MODULE_11__.dereferenceSourceDescriptions)(parseResult, reference.uri, options, this.name);
|
|
5061
5076
|
parseResult.push(...sourceDescriptions);
|
|
5062
5077
|
}
|
|
5063
5078
|
|
|
@@ -6153,7 +6168,6 @@ class Arazzo1DereferenceVisitor {
|
|
|
6153
6168
|
|
|
6154
6169
|
"use strict";
|
|
6155
6170
|
__webpack_require__.r(__webpack_exports__);
|
|
6156
|
-
/* empty/unused harmony star reexport */
|
|
6157
6171
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
6158
6172
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
6159
6173
|
/* harmony import */ var _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46417);
|
|
@@ -6486,6 +6500,11 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
6486
6500
|
async ReferenceElement(path) {
|
|
6487
6501
|
const referencingElement = path.node;
|
|
6488
6502
|
|
|
6503
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
6504
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
6505
|
+
return;
|
|
6506
|
+
}
|
|
6507
|
+
|
|
6489
6508
|
// skip current referencing element as it's already been access
|
|
6490
6509
|
if (this.indirections.includes(referencingElement)) {
|
|
6491
6510
|
path.skip();
|
|
@@ -6815,7 +6834,6 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
6815
6834
|
|
|
6816
6835
|
"use strict";
|
|
6817
6836
|
__webpack_require__.r(__webpack_exports__);
|
|
6818
|
-
/* empty/unused harmony star reexport */
|
|
6819
6837
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
6820
6838
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3677);
|
|
6821
6839
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26365);
|
|
@@ -7152,6 +7170,11 @@ class OpenAPI2DereferenceVisitor {
|
|
|
7152
7170
|
async ReferenceElement(path) {
|
|
7153
7171
|
const referencingElement = path.node;
|
|
7154
7172
|
|
|
7173
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
7174
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
7175
|
+
return;
|
|
7176
|
+
}
|
|
7177
|
+
|
|
7155
7178
|
// skip current referencing element as it's already been access
|
|
7156
7179
|
if (this.indirections.includes(referencingElement)) {
|
|
7157
7180
|
path.skip();
|
|
@@ -7455,6 +7478,11 @@ class OpenAPI2DereferenceVisitor {
|
|
|
7455
7478
|
async JSONReferenceElement(path) {
|
|
7456
7479
|
const referencingElement = path.node;
|
|
7457
7480
|
|
|
7481
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
7482
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
7483
|
+
return;
|
|
7484
|
+
}
|
|
7485
|
+
|
|
7458
7486
|
// skip current referencing element as it's already been access
|
|
7459
7487
|
if (this.indirections.includes(referencingElement)) {
|
|
7460
7488
|
path.skip();
|
|
@@ -7617,7 +7645,6 @@ class OpenAPI2DereferenceVisitor {
|
|
|
7617
7645
|
|
|
7618
7646
|
"use strict";
|
|
7619
7647
|
__webpack_require__.r(__webpack_exports__);
|
|
7620
|
-
/* empty/unused harmony star reexport */
|
|
7621
7648
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
7622
7649
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
7623
7650
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
|
|
@@ -7953,6 +7980,11 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
7953
7980
|
async ReferenceElement(path) {
|
|
7954
7981
|
const referencingElement = path.node;
|
|
7955
7982
|
|
|
7983
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
7984
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
|
|
7985
|
+
return;
|
|
7986
|
+
}
|
|
7987
|
+
|
|
7956
7988
|
// skip current referencing element as it's already been access
|
|
7957
7989
|
if (this.indirections.includes(referencingElement)) {
|
|
7958
7990
|
path.skip();
|
|
@@ -8402,10 +8434,6 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
8402
8434
|
|
|
8403
8435
|
"use strict";
|
|
8404
8436
|
__webpack_require__.r(__webpack_exports__);
|
|
8405
|
-
/* empty/unused harmony star reexport */
|
|
8406
|
-
/* empty/unused harmony star reexport */
|
|
8407
|
-
/* empty/unused harmony star reexport */
|
|
8408
|
-
/* empty/unused harmony star reexport */
|
|
8409
8437
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
|
|
8410
8438
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
8411
8439
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80796);
|
|
@@ -8415,7 +8443,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8415
8443
|
/* harmony import */ var _Reference_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98979);
|
|
8416
8444
|
/* harmony import */ var _ReferenceSet_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24131);
|
|
8417
8445
|
/* harmony import */ var _visitor_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4224);
|
|
8418
|
-
/* harmony import */ var
|
|
8446
|
+
/* harmony import */ var _util_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60888);
|
|
8419
8447
|
|
|
8420
8448
|
|
|
8421
8449
|
|
|
@@ -8481,7 +8509,7 @@ class OpenAPI3_1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMP
|
|
|
8481
8509
|
const visitor = new _visitor_ts__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
8482
8510
|
reference: reference,
|
|
8483
8511
|
options,
|
|
8484
|
-
ancestorSchema$ids: (0,
|
|
8512
|
+
ancestorSchema$ids: (0,_util_ts__WEBPACK_IMPORTED_MODULE_9__.detachedRootSchema$ids)(refSet.rootRef.value.result)
|
|
8485
8513
|
});
|
|
8486
8514
|
const dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__.traverseAsync)(refSet.rootRef.value, visitor, {
|
|
8487
8515
|
mutable: true,
|
|
@@ -9152,6 +9180,11 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
9152
9180
|
async ReferenceElement(path) {
|
|
9153
9181
|
const referencingElement = path.node;
|
|
9154
9182
|
|
|
9183
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
9184
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(referencingElement.$ref)) {
|
|
9185
|
+
return;
|
|
9186
|
+
}
|
|
9187
|
+
|
|
9155
9188
|
// skip current referencing element as it's already been accessed
|
|
9156
9189
|
if (this.indirections.includes(referencingElement)) {
|
|
9157
9190
|
path.skip();
|
|
@@ -9929,6 +9962,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9929
9962
|
|
|
9930
9963
|
|
|
9931
9964
|
|
|
9965
|
+
const STRATEGY_NAME = 'overlay-1';
|
|
9932
9966
|
|
|
9933
9967
|
/**
|
|
9934
9968
|
* Dereferences the `extends` target document from an Overlay document's ParseResult.
|
|
@@ -9971,39 +10005,61 @@ async function dereferenceExtends(parseResult, parseResultRetrievalURI, options)
|
|
|
9971
10005
|
const extendsDereferenceResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
9972
10006
|
extendsDereferenceResult.classes.push('extends');
|
|
9973
10007
|
extendsDereferenceResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
9974
|
-
try {
|
|
9975
|
-
let extendsDereferenced;
|
|
9976
10008
|
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
},
|
|
9985
|
-
resolve: {
|
|
9986
|
-
baseURI: retrievalURI
|
|
9987
|
-
}
|
|
9988
|
-
}));
|
|
9989
|
-
} else {
|
|
9990
|
-
// no existing parse result - fetch, parse, and dereference
|
|
9991
|
-
extendsDereferenced = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_10__["default"])(retrievalURI, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
9992
|
-
parse: {
|
|
9993
|
-
mediaType: 'text/plain' // allow parser plugin detection
|
|
10009
|
+
// URIs of the Overlays currently being dereferenced, from the root down to the current one
|
|
10010
|
+
const ancestors = [...(options?.dereference?.strategyOpts?.[STRATEGY_NAME]?.extendsAncestors ?? []), file.uri];
|
|
10011
|
+
const nestedOptions = {
|
|
10012
|
+
dereference: {
|
|
10013
|
+
strategyOpts: {
|
|
10014
|
+
[STRATEGY_NAME]: {
|
|
10015
|
+
extendsAncestors: ancestors
|
|
9994
10016
|
}
|
|
9995
|
-
}
|
|
10017
|
+
}
|
|
9996
10018
|
}
|
|
10019
|
+
};
|
|
9997
10020
|
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
} catch (error) {
|
|
10003
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
10004
|
-
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Error dereferencing extends target "${retrievalURI}": ${message}`);
|
|
10005
|
-
annotation.classes.push('error');
|
|
10021
|
+
// skip if the target is still being dereferenced higher up the chain (cycle detection)
|
|
10022
|
+
if (ancestors.includes(retrievalURI)) {
|
|
10023
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Extends target "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
10024
|
+
annotation.classes.push('warning');
|
|
10006
10025
|
extendsDereferenceResult.push(annotation);
|
|
10026
|
+
} else {
|
|
10027
|
+
try {
|
|
10028
|
+
let extendsDereferenced;
|
|
10029
|
+
|
|
10030
|
+
// check if extends was already parsed (e.g., during parse phase with extends: true)
|
|
10031
|
+
const existingParseResult = extendsElement.meta.get('parseResult');
|
|
10032
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement)(existingParseResult)) {
|
|
10033
|
+
// use existing parsed result - just dereference it (no re-fetch/re-parse)
|
|
10034
|
+
extendsDereferenced = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_10__.dereferenceApiDOM)(existingParseResult, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
10035
|
+
...nestedOptions,
|
|
10036
|
+
parse: {
|
|
10037
|
+
mediaType: 'text/plain' // allow dereference strategy detection via ApiDOM inspection
|
|
10038
|
+
},
|
|
10039
|
+
resolve: {
|
|
10040
|
+
baseURI: retrievalURI
|
|
10041
|
+
}
|
|
10042
|
+
}));
|
|
10043
|
+
} else {
|
|
10044
|
+
// no existing parse result - fetch, parse, and dereference
|
|
10045
|
+
extendsDereferenced = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_10__["default"])(retrievalURI, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
10046
|
+
...nestedOptions,
|
|
10047
|
+
parse: {
|
|
10048
|
+
mediaType: 'text/plain' // allow parser plugin detection
|
|
10049
|
+
}
|
|
10050
|
+
}));
|
|
10051
|
+
}
|
|
10052
|
+
|
|
10053
|
+
// merge dereferenced result into our wrapper
|
|
10054
|
+
for (const item of extendsDereferenced) {
|
|
10055
|
+
extendsDereferenceResult.push(item);
|
|
10056
|
+
}
|
|
10057
|
+
} catch (error) {
|
|
10058
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
10059
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Error dereferencing extends target "${retrievalURI}": ${message}`);
|
|
10060
|
+
annotation.classes.push('error');
|
|
10061
|
+
extendsDereferenceResult.push(annotation);
|
|
10062
|
+
}
|
|
10007
10063
|
}
|
|
10008
10064
|
|
|
10009
10065
|
// always attach result to extends element meta (even on failure - contains annotations)
|
|
@@ -10022,17 +10078,16 @@ async function dereferenceExtends(parseResult, parseResultRetrievalURI, options)
|
|
|
10022
10078
|
|
|
10023
10079
|
"use strict";
|
|
10024
10080
|
__webpack_require__.r(__webpack_exports__);
|
|
10025
|
-
/*
|
|
10026
|
-
/*
|
|
10027
|
-
/* harmony import */ var
|
|
10028
|
-
/* harmony import */ var
|
|
10029
|
-
/* harmony import */ var
|
|
10030
|
-
/* harmony import */ var
|
|
10031
|
-
/* harmony import */ var
|
|
10032
|
-
/* harmony import */ var
|
|
10033
|
-
/* harmony import */ var
|
|
10034
|
-
/* harmony import */ var
|
|
10035
|
-
/* harmony import */ var _visitor_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(47724);
|
|
10081
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96911);
|
|
10082
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
10083
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13786);
|
|
10084
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26432);
|
|
10085
|
+
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80796);
|
|
10086
|
+
/* harmony import */ var _DereferenceStrategy_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(40978);
|
|
10087
|
+
/* harmony import */ var _Reference_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98979);
|
|
10088
|
+
/* harmony import */ var _ReferenceSet_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24131);
|
|
10089
|
+
/* harmony import */ var _extends_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(66571);
|
|
10090
|
+
/* harmony import */ var _visitor_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(47724);
|
|
10036
10091
|
|
|
10037
10092
|
|
|
10038
10093
|
|
|
@@ -10049,7 +10104,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10049
10104
|
/**
|
|
10050
10105
|
* @public
|
|
10051
10106
|
*/
|
|
10052
|
-
class Overlay1DereferenceStrategy extends
|
|
10107
|
+
class Overlay1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPORTED_MODULE_5__["default"] {
|
|
10053
10108
|
constructor(options) {
|
|
10054
10109
|
super({
|
|
10055
10110
|
...(options ?? {}),
|
|
@@ -10059,18 +10114,18 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPOR
|
|
|
10059
10114
|
canDereference(file) {
|
|
10060
10115
|
// assert by media type
|
|
10061
10116
|
if (file.mediaType !== 'text/plain') {
|
|
10062
|
-
return
|
|
10117
|
+
return _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
|
|
10063
10118
|
}
|
|
10064
10119
|
|
|
10065
10120
|
// assert by inspecting ApiDOM
|
|
10066
|
-
return (0,
|
|
10121
|
+
return (0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_3__.isOverlay1Element)(file.parseResult?.result);
|
|
10067
10122
|
}
|
|
10068
10123
|
async dereference(file, options) {
|
|
10069
|
-
const immutableRefSet = options.dereference.refSet ?? new
|
|
10070
|
-
const mutableRefSet = new
|
|
10124
|
+
const immutableRefSet = options.dereference.refSet ?? new _ReferenceSet_ts__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
10125
|
+
const mutableRefSet = new _ReferenceSet_ts__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
10071
10126
|
let reference;
|
|
10072
10127
|
if (!immutableRefSet.has(file.uri)) {
|
|
10073
|
-
reference = new
|
|
10128
|
+
reference = new _Reference_ts__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
10074
10129
|
uri: file.uri,
|
|
10075
10130
|
value: file.parseResult
|
|
10076
10131
|
});
|
|
@@ -10085,39 +10140,51 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPOR
|
|
|
10085
10140
|
* We don't want to mutate the original refSet and the references.
|
|
10086
10141
|
*/
|
|
10087
10142
|
if (options.dereference.immutable) {
|
|
10088
|
-
immutableRefSet.refs.map(ref => new
|
|
10143
|
+
immutableRefSet.refs.map(ref => new _Reference_ts__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
10089
10144
|
...ref,
|
|
10090
|
-
value: (0,
|
|
10145
|
+
value: (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(ref.value)
|
|
10091
10146
|
})).forEach(ref => mutableRefSet.add(ref));
|
|
10092
10147
|
reference = mutableRefSet.find(ref => ref.uri === file.uri);
|
|
10093
10148
|
}
|
|
10094
|
-
const
|
|
10095
|
-
|
|
10096
|
-
/**
|
|
10097
|
-
* Reusable Action References only occur within `actions`, so the root element is never
|
|
10098
|
-
* replaced and traversing it keeps reported locations relative to the document.
|
|
10099
|
-
*/
|
|
10100
|
-
const visitor = new _visitor_ts__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
10149
|
+
const visitor = new _visitor_ts__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
10101
10150
|
reference,
|
|
10102
10151
|
options
|
|
10103
10152
|
});
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10153
|
+
/**
|
|
10154
|
+
* The reference for the dereferenced file is traversed rather than the refSet's root
|
|
10155
|
+
* reference: dereferencing the extends target shares the refSet, whose root is then
|
|
10156
|
+
* the extending Overlay. The reference may hold a lone element.
|
|
10157
|
+
*/
|
|
10158
|
+
let dereferencedElement = reference.value;
|
|
10159
|
+
|
|
10160
|
+
/**
|
|
10161
|
+
* A ParseResult may also carry the extends target parsed in the parse phase, whose
|
|
10162
|
+
* references belong to that document, so only its result is traversed. Reusable Action
|
|
10163
|
+
* References only occur within `actions`, so the result itself is never replaced.
|
|
10164
|
+
*/
|
|
10165
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(dereferencedElement)) {
|
|
10166
|
+
await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__.traverseAsync)(dereferencedElement.result, visitor, {
|
|
10167
|
+
mutable: true
|
|
10168
|
+
});
|
|
10169
|
+
} else {
|
|
10170
|
+
dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__.traverseAsync)(dereferencedElement, visitor, {
|
|
10171
|
+
mutable: true
|
|
10172
|
+
});
|
|
10173
|
+
}
|
|
10107
10174
|
|
|
10108
10175
|
/**
|
|
10109
10176
|
* Dereference extends target if option is enabled.
|
|
10110
10177
|
*/
|
|
10111
10178
|
const shouldDereferenceExtends = options?.dereference?.strategyOpts?.[this.name]?.extends ?? options?.dereference?.strategyOpts?.extends;
|
|
10112
|
-
if (shouldDereferenceExtends) {
|
|
10113
|
-
await (0,
|
|
10179
|
+
if (shouldDereferenceExtends && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(dereferencedElement)) {
|
|
10180
|
+
await (0,_extends_ts__WEBPACK_IMPORTED_MODULE_8__.dereferenceExtends)(dereferencedElement, reference.uri, options);
|
|
10114
10181
|
}
|
|
10115
10182
|
|
|
10116
10183
|
/**
|
|
10117
10184
|
* If immutable option is set, replay refs from the refSet.
|
|
10118
10185
|
*/
|
|
10119
10186
|
if (options.dereference.immutable) {
|
|
10120
|
-
mutableRefSet.refs.filter(ref => ref.uri.startsWith('immutable://')).map(ref => new
|
|
10187
|
+
mutableRefSet.refs.filter(ref => ref.uri.startsWith('immutable://')).map(ref => new _Reference_ts__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
10121
10188
|
...ref,
|
|
10122
10189
|
uri: ref.uri.replace(/^immutable:\/\//, '')
|
|
10123
10190
|
})).forEach(ref => immutableRefSet.add(ref));
|
|
@@ -10149,17 +10216,22 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_ts__WEBPACK_IMPOR
|
|
|
10149
10216
|
|
|
10150
10217
|
"use strict";
|
|
10151
10218
|
__webpack_require__.r(__webpack_exports__);
|
|
10152
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
10153
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
10154
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
10155
|
-
/* harmony import */ var
|
|
10156
|
-
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
10157
|
-
/* harmony import */ var
|
|
10158
|
-
/* harmony import */ var
|
|
10159
|
-
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
10160
|
-
/* harmony import */ var
|
|
10161
|
-
/* harmony import */ var
|
|
10162
|
-
/* harmony import */ var
|
|
10219
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
10220
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
10221
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18252);
|
|
10222
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25810);
|
|
10223
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44673);
|
|
10224
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16280);
|
|
10225
|
+
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44641);
|
|
10226
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12020);
|
|
10227
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(61198);
|
|
10228
|
+
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80796);
|
|
10229
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26432);
|
|
10230
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(35937);
|
|
10231
|
+
/* harmony import */ var _errors_UnresolvableReferenceError_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(8853);
|
|
10232
|
+
/* harmony import */ var _util_url_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(30658);
|
|
10233
|
+
|
|
10234
|
+
|
|
10163
10235
|
|
|
10164
10236
|
|
|
10165
10237
|
|
|
@@ -10192,25 +10264,32 @@ class Overlay1DereferenceVisitor {
|
|
|
10192
10264
|
path.skip();
|
|
10193
10265
|
return;
|
|
10194
10266
|
}
|
|
10195
|
-
const $ref = (0,
|
|
10196
|
-
|
|
10197
|
-
|
|
10267
|
+
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(referencingElement.$ref);
|
|
10268
|
+
// the reference may hold a lone element; same-document references resolve against the
|
|
10269
|
+
// document registered in the refSet under the reference's URI without fragment
|
|
10270
|
+
const {
|
|
10271
|
+
refSet
|
|
10272
|
+
} = this.reference;
|
|
10273
|
+
const documentURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_13__.stripHash(this.reference.uri);
|
|
10274
|
+
const documentReference = refSet.find(ref => ref.uri === documentURI) ?? this.reference;
|
|
10275
|
+
const overlayElement = documentReference.value.result;
|
|
10276
|
+
const actionElement = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__.ActionElement();
|
|
10198
10277
|
try {
|
|
10199
10278
|
if (typeof $ref !== 'string') {
|
|
10200
|
-
throw new
|
|
10279
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"]('Reusable Action Reference "$ref" field must be a string');
|
|
10201
10280
|
}
|
|
10202
10281
|
|
|
10203
10282
|
// only `target`, `description` and extensions may accompany `$ref`
|
|
10204
10283
|
const disallowedField = ['update', 'copy', 'remove'].find(field => referencingElement.hasKey(field));
|
|
10205
10284
|
if (disallowedField !== undefined) {
|
|
10206
|
-
throw new
|
|
10285
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" must not define "${disallowedField}"`, {
|
|
10207
10286
|
$ref
|
|
10208
10287
|
});
|
|
10209
10288
|
}
|
|
10210
10289
|
|
|
10211
10290
|
// same-document reference only; external references are not supported
|
|
10212
10291
|
if (!$ref.startsWith('#')) {
|
|
10213
|
-
throw new
|
|
10292
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" must be a same-document reference`, {
|
|
10214
10293
|
$ref
|
|
10215
10294
|
});
|
|
10216
10295
|
}
|
|
@@ -10221,25 +10300,25 @@ class Overlay1DereferenceVisitor {
|
|
|
10221
10300
|
*/
|
|
10222
10301
|
let reusableAction;
|
|
10223
10302
|
try {
|
|
10224
|
-
reusableAction = (0,
|
|
10303
|
+
reusableAction = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__.evaluate)(overlayElement, _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__.URIFragmentIdentifier.from($ref));
|
|
10225
10304
|
} catch {
|
|
10226
10305
|
reusableAction = undefined;
|
|
10227
10306
|
}
|
|
10228
|
-
if (!(0,
|
|
10229
|
-
throw new
|
|
10307
|
+
if (!(0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isReusableActionElement)(reusableAction)) {
|
|
10308
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" cannot be resolved`, {
|
|
10230
10309
|
$ref
|
|
10231
10310
|
});
|
|
10232
10311
|
}
|
|
10233
10312
|
const {
|
|
10234
10313
|
fields
|
|
10235
10314
|
} = reusableAction;
|
|
10236
|
-
if (fields !== undefined && !(0,
|
|
10237
|
-
throw new
|
|
10315
|
+
if (fields !== undefined && !(0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields)) {
|
|
10316
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action "${$ref}" must define "fields" as an object`, {
|
|
10238
10317
|
$ref
|
|
10239
10318
|
});
|
|
10240
10319
|
}
|
|
10241
|
-
if ((0,
|
|
10242
|
-
throw new
|
|
10320
|
+
if ((0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields) && fields.hasKey('target')) {
|
|
10321
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action "${$ref}" must not define "target" in its "fields"`, {
|
|
10243
10322
|
$ref
|
|
10244
10323
|
});
|
|
10245
10324
|
}
|
|
@@ -10250,26 +10329,41 @@ class Overlay1DereferenceVisitor {
|
|
|
10250
10329
|
description
|
|
10251
10330
|
} = referencingElement;
|
|
10252
10331
|
if (target !== undefined) {
|
|
10253
|
-
actionElement.set('target', (0,
|
|
10332
|
+
actionElement.set('target', (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(target));
|
|
10254
10333
|
}
|
|
10255
|
-
if ((0,
|
|
10334
|
+
if ((0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields)) {
|
|
10256
10335
|
fields.forEach((value, keyElement) => {
|
|
10257
|
-
actionElement.set((0,
|
|
10336
|
+
actionElement.set((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(keyElement), (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(value));
|
|
10258
10337
|
});
|
|
10259
10338
|
}
|
|
10260
10339
|
if (description !== undefined) {
|
|
10261
|
-
actionElement.set('description', (0,
|
|
10340
|
+
actionElement.set('description', (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(description));
|
|
10262
10341
|
}
|
|
10263
10342
|
} catch (error) {
|
|
10264
10343
|
const {
|
|
10265
10344
|
continueOnError
|
|
10266
10345
|
} = this.options.dereference;
|
|
10267
|
-
|
|
10346
|
+
|
|
10347
|
+
// find element location by identity in the document tree;
|
|
10348
|
+
// falls back to the visitor path when the document doesn't contain the element
|
|
10349
|
+
let location;
|
|
10350
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(overlayElement)) {
|
|
10351
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverse)(overlayElement, {
|
|
10352
|
+
enter: p => {
|
|
10353
|
+
if (p.node === referencingElement) {
|
|
10354
|
+
location = p.formatPath();
|
|
10355
|
+
p.stop();
|
|
10356
|
+
}
|
|
10357
|
+
}
|
|
10358
|
+
});
|
|
10359
|
+
}
|
|
10360
|
+
location ??= path.formatPath();
|
|
10361
|
+
const unresolvedError = new _errors_UnresolvableReferenceError_ts__WEBPACK_IMPORTED_MODULE_12__["default"](`Error while dereferencing Reusable Action Reference "${$ref}": ${error.message}`, {
|
|
10268
10362
|
cause: error,
|
|
10269
10363
|
type: referencingElement.element,
|
|
10270
10364
|
uri: this.reference.uri,
|
|
10271
|
-
location
|
|
10272
|
-
codeFrame: (0,
|
|
10365
|
+
location,
|
|
10366
|
+
codeFrame: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement),
|
|
10273
10367
|
refFieldName: '$ref',
|
|
10274
10368
|
refFieldValue: $ref,
|
|
10275
10369
|
trace: []
|
|
@@ -10281,14 +10375,14 @@ class Overlay1DereferenceVisitor {
|
|
|
10281
10375
|
}
|
|
10282
10376
|
|
|
10283
10377
|
// the action takes the place of the reference in `actions`, so it inherits its source position
|
|
10284
|
-
if ((0,
|
|
10285
|
-
|
|
10378
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap)(referencingElement)) {
|
|
10379
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(referencingElement, actionElement);
|
|
10286
10380
|
}
|
|
10287
10381
|
|
|
10288
10382
|
// annotate with info about original referencing element
|
|
10289
10383
|
actionElement.meta.set('ref-fields', {
|
|
10290
10384
|
$ref,
|
|
10291
|
-
description: (0,
|
|
10385
|
+
description: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(referencingElement.description)
|
|
10292
10386
|
});
|
|
10293
10387
|
// annotate with info about origin
|
|
10294
10388
|
actionElement.meta.set('ref-origin', this.reference.uri);
|
|
@@ -11551,7 +11645,6 @@ class ApiDOMJSONParser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["default"
|
|
|
11551
11645
|
|
|
11552
11646
|
"use strict";
|
|
11553
11647
|
__webpack_require__.r(__webpack_exports__);
|
|
11554
|
-
/* empty/unused harmony star reexport */
|
|
11555
11648
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
11556
11649
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6017);
|
|
11557
11650
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29028);
|
|
@@ -11866,7 +11959,6 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
11866
11959
|
|
|
11867
11960
|
"use strict";
|
|
11868
11961
|
__webpack_require__.r(__webpack_exports__);
|
|
11869
|
-
/* empty/unused harmony star reexport */
|
|
11870
11962
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
11871
11963
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16206);
|
|
11872
11964
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43195);
|
|
@@ -12653,6 +12745,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12653
12745
|
|
|
12654
12746
|
|
|
12655
12747
|
|
|
12748
|
+
// shared key for recursion state (works across JSON/YAML parsers)
|
|
12749
|
+
const OVERLAY_RECURSION_KEY = 'overlay-1';
|
|
12750
|
+
|
|
12656
12751
|
/**
|
|
12657
12752
|
* Parses the `extends` target document from an Overlay document's ParseResult.
|
|
12658
12753
|
*
|
|
@@ -12689,21 +12784,38 @@ async function parseExtends(parseResult, parseResultRetrievalURI, options) {
|
|
|
12689
12784
|
const extendsParseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
12690
12785
|
extendsParseResult.classes.push('extends');
|
|
12691
12786
|
extendsParseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12787
|
+
|
|
12788
|
+
// URIs of the Overlays currently being parsed, from the root down to the current one
|
|
12789
|
+
const ancestors = [...(options?.parse?.parserOpts?.[OVERLAY_RECURSION_KEY]?.extendsAncestors ?? []), file.uri];
|
|
12790
|
+
|
|
12791
|
+
// skip if the target is still being parsed higher up the chain (cycle detection)
|
|
12792
|
+
if (ancestors.includes(retrievalURI)) {
|
|
12793
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Extends target "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
12794
|
+
annotation.classes.push('warning');
|
|
12795
|
+
extendsParseResult.push(annotation);
|
|
12796
|
+
} else {
|
|
12797
|
+
try {
|
|
12798
|
+
const targetParseResult = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_8__["default"])(retrievalURI, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_7__.merge)(options, {
|
|
12799
|
+
parse: {
|
|
12800
|
+
mediaType: 'text/plain',
|
|
12801
|
+
// force auto-detection
|
|
12802
|
+
parserOpts: {
|
|
12803
|
+
[OVERLAY_RECURSION_KEY]: {
|
|
12804
|
+
extendsAncestors: ancestors
|
|
12805
|
+
}
|
|
12806
|
+
}
|
|
12807
|
+
}
|
|
12808
|
+
}));
|
|
12809
|
+
// merge parsed result into our wrapper
|
|
12810
|
+
for (const item of targetParseResult) {
|
|
12811
|
+
extendsParseResult.push(item);
|
|
12696
12812
|
}
|
|
12697
|
-
})
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
|
|
12813
|
+
} catch (error) {
|
|
12814
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
12815
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Error parsing extends target "${retrievalURI}": ${message}`);
|
|
12816
|
+
annotation.classes.push('error');
|
|
12817
|
+
extendsParseResult.push(annotation);
|
|
12701
12818
|
}
|
|
12702
|
-
} catch (error) {
|
|
12703
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
12704
|
-
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Error parsing extends target "${retrievalURI}": ${message}`);
|
|
12705
|
-
annotation.classes.push('error');
|
|
12706
|
-
extendsParseResult.push(annotation);
|
|
12707
12819
|
}
|
|
12708
12820
|
|
|
12709
12821
|
// always attach result to extends element meta (even on failure - contains annotations)
|
|
@@ -12718,7 +12830,6 @@ async function parseExtends(parseResult, parseResultRetrievalURI, options) {
|
|
|
12718
12830
|
|
|
12719
12831
|
"use strict";
|
|
12720
12832
|
__webpack_require__.r(__webpack_exports__);
|
|
12721
|
-
/* empty/unused harmony star reexport */
|
|
12722
12833
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
12723
12834
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_json_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85086);
|
|
12724
12835
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_json_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54827);
|
|
@@ -12802,7 +12913,6 @@ class OverlayJSON1Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defaul
|
|
|
12802
12913
|
|
|
12803
12914
|
"use strict";
|
|
12804
12915
|
__webpack_require__.r(__webpack_exports__);
|
|
12805
|
-
/* empty/unused harmony star reexport */
|
|
12806
12916
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
12807
12917
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_yaml_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98585);
|
|
12808
12918
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_yaml_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83004);
|
|
@@ -55925,11 +56035,8 @@ const serializer = (element, replacer, space, options) => {
|
|
|
55925
56035
|
__webpack_require__.r(__webpack_exports__);
|
|
55926
56036
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
55927
56037
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96911);
|
|
55928
|
-
/* harmony import */ var
|
|
55929
|
-
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10977);
|
|
56038
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10977);
|
|
55930
56039
|
|
|
55931
|
-
// an empty YAML node (YAML 1.2 §7.2) is a null parsed as an empty string with the yaml-e-node class
|
|
55932
|
-
const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(element) && element.toValue() === '' && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses)(element, ['yaml-e-node']);
|
|
55933
56040
|
|
|
55934
56041
|
/**
|
|
55935
56042
|
* Transforms the ApiDOM into JavaScript POJO.
|
|
@@ -55939,7 +56046,6 @@ const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_M
|
|
|
55939
56046
|
*/
|
|
55940
56047
|
const serializer = element => {
|
|
55941
56048
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(element)) return element;
|
|
55942
|
-
if (isEmptyNode(element)) return null;
|
|
55943
56049
|
|
|
55944
56050
|
// Shortcut optimization for primitive element types
|
|
55945
56051
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isNumberElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isBooleanElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isNullElement)(element)) {
|
|
@@ -55957,8 +56063,8 @@ const serializer = element => {
|
|
|
55957
56063
|
node.forEach((value, key) => {
|
|
55958
56064
|
const k = serialize(key);
|
|
55959
56065
|
const v = serialize(value);
|
|
55960
|
-
const name = (0,
|
|
55961
|
-
if (name !== undefined) (0,
|
|
56066
|
+
const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__.toPropertyName)(k);
|
|
56067
|
+
if (name !== undefined) (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, name, v);
|
|
55962
56068
|
});
|
|
55963
56069
|
return obj;
|
|
55964
56070
|
}
|
|
@@ -55973,7 +56079,6 @@ const serializer = element => {
|
|
|
55973
56079
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isLinkElement)(node)) {
|
|
55974
56080
|
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(node.href) ? node.href.toValue() : '';
|
|
55975
56081
|
}
|
|
55976
|
-
if (isEmptyNode(node)) return null;
|
|
55977
56082
|
return node.toValue();
|
|
55978
56083
|
};
|
|
55979
56084
|
return serialize(element);
|
|
@@ -56341,9 +56446,10 @@ const toYAMLNode = (element, context) => {
|
|
|
56341
56446
|
// scalar element (string, number, boolean, null)
|
|
56342
56447
|
const scalarType = style.scalarStyle ? scalarStyleMap[style.scalarStyle] : undefined;
|
|
56343
56448
|
const scalar = new yaml__WEBPACK_IMPORTED_MODULE_0__.Scalar((0,_value_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])(element));
|
|
56344
|
-
// an empty node (YAML 1.2 §7.2) is serialized to null
|
|
56345
|
-
// it was written: with no content, after its anchor and tag if it
|
|
56346
|
-
|
|
56449
|
+
// an empty node (YAML 1.2 §7.2) is serialized to null, or to the empty string as a key; while it's
|
|
56450
|
+
// still empty, write it back as it was written: with no content, after its anchor and tag if it
|
|
56451
|
+
// had them
|
|
56452
|
+
const isEmptyNode = (scalar.value === null || scalar.value === '' && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(element, ['yaml-e-key'])) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(element, ['yaml-e-node']);
|
|
56347
56453
|
if (isEmptyNode) {
|
|
56348
56454
|
const anchor = claimAnchor(style, context);
|
|
56349
56455
|
const properties = [anchor && `&${anchor}`, style.tag].filter(Boolean).join(' ');
|
|
@@ -58497,11 +58603,10 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
58497
58603
|
|
|
58498
58604
|
"use strict";
|
|
58499
58605
|
__webpack_require__.r(__webpack_exports__);
|
|
58500
|
-
/* empty/unused harmony star reexport */
|
|
58501
58606
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
58502
58607
|
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51844);
|
|
58503
|
-
/* harmony import */ var
|
|
58504
|
-
/* harmony import */ var
|
|
58608
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
58609
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38504);
|
|
58505
58610
|
|
|
58506
58611
|
|
|
58507
58612
|
|
|
@@ -58671,13 +58776,13 @@ class Element {
|
|
|
58671
58776
|
}
|
|
58672
58777
|
|
|
58673
58778
|
// KeyValuePair
|
|
58674
|
-
if (value instanceof
|
|
58779
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
58675
58780
|
this._content = value;
|
|
58676
58781
|
return;
|
|
58677
58782
|
}
|
|
58678
58783
|
|
|
58679
58784
|
// ObjectSlice - extract elements array
|
|
58680
|
-
if (value instanceof
|
|
58785
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
58681
58786
|
this._content = value.elements;
|
|
58682
58787
|
return;
|
|
58683
58788
|
}
|
|
@@ -58796,7 +58901,7 @@ class Element {
|
|
|
58796
58901
|
if (Array.isArray(content)) {
|
|
58797
58902
|
return content;
|
|
58798
58903
|
}
|
|
58799
|
-
if (content instanceof
|
|
58904
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
58800
58905
|
const children = [];
|
|
58801
58906
|
if (content.key) children.push(content.key);
|
|
58802
58907
|
if (content.value) children.push(content.value);
|
|
@@ -58860,7 +58965,7 @@ class Element {
|
|
|
58860
58965
|
if (_content instanceof Element) {
|
|
58861
58966
|
return _content.toValue();
|
|
58862
58967
|
}
|
|
58863
|
-
if (_content instanceof
|
|
58968
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
58864
58969
|
return _content.toValue();
|
|
58865
58970
|
}
|
|
58866
58971
|
if (Array.isArray(_content)) {
|
|
@@ -59963,14 +60068,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
59963
60068
|
/* harmony export */ testReferenceToken: () => (/* reexport safe */ _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.testReferenceToken),
|
|
59964
60069
|
/* harmony export */ unescape: () => (/* reexport safe */ _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.unescape)
|
|
59965
60070
|
/* harmony export */ });
|
|
59966
|
-
/* empty/unused harmony star reexport */
|
|
59967
60071
|
/* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61198);
|
|
59968
|
-
/* harmony import */ var
|
|
60072
|
+
/* harmony import */ var _realm_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60545);
|
|
59969
60073
|
|
|
59970
60074
|
|
|
59971
60075
|
|
|
59972
60076
|
|
|
59973
|
-
const realm = new
|
|
60077
|
+
const realm = new _realm_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
59974
60078
|
|
|
59975
60079
|
/**
|
|
59976
60080
|
* @public
|
|
@@ -90907,25 +91011,24 @@ class AllOfVisitor extends JSONSchemaAllOfVisitor {
|
|
|
90907
91011
|
|
|
90908
91012
|
"use strict";
|
|
90909
91013
|
__webpack_require__.r(__webpack_exports__);
|
|
90910
|
-
/*
|
|
90911
|
-
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
90912
|
-
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26207);
|
|
91014
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86059);
|
|
91015
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26207);
|
|
90913
91016
|
|
|
90914
91017
|
|
|
90915
91018
|
|
|
90916
91019
|
/**
|
|
90917
91020
|
* @public
|
|
90918
91021
|
*/
|
|
90919
|
-
class ItemsVisitor extends
|
|
91022
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
90920
91023
|
ObjectElement(path) {
|
|
90921
|
-
|
|
90922
|
-
if ((0,
|
|
91024
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ObjectElement.call(this, path);
|
|
91025
|
+
if ((0,_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)(this.element)) {
|
|
90923
91026
|
this.element.meta.set('referenced-element', 'schema');
|
|
90924
91027
|
}
|
|
90925
91028
|
}
|
|
90926
91029
|
ArrayElement(path) {
|
|
90927
|
-
|
|
90928
|
-
this.element.filter(
|
|
91030
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ArrayElement.call(this, path);
|
|
91031
|
+
this.element.filter(_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)
|
|
90929
91032
|
// @ts-ignore
|
|
90930
91033
|
.forEach(referenceElement => {
|
|
90931
91034
|
referenceElement.meta.set('referenced-element', 'schema');
|
|
@@ -99189,9 +99292,8 @@ class AnyOfVisitor extends JSONSchemaAnyOfVisitor {
|
|
|
99189
99292
|
|
|
99190
99293
|
"use strict";
|
|
99191
99294
|
__webpack_require__.r(__webpack_exports__);
|
|
99192
|
-
/*
|
|
99193
|
-
/* harmony import */ var
|
|
99194
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32131);
|
|
99295
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26207);
|
|
99296
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32131);
|
|
99195
99297
|
|
|
99196
99298
|
|
|
99197
99299
|
|
|
@@ -99199,10 +99301,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
99199
99301
|
/**
|
|
99200
99302
|
* @public
|
|
99201
99303
|
*/
|
|
99202
|
-
class ItemsVisitor extends
|
|
99304
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
99203
99305
|
ObjectElement(path) {
|
|
99204
|
-
|
|
99205
|
-
if ((0,
|
|
99306
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement.call(this, path);
|
|
99307
|
+
if ((0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_1__.isReferenceElement)(this.element)) {
|
|
99206
99308
|
this.element.meta.set('referenced-element', 'schema');
|
|
99207
99309
|
}
|
|
99208
99310
|
}
|
|
@@ -105906,15 +106008,13 @@ const yamlMediaTypes = new _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODU
|
|
|
105906
106008
|
"use strict";
|
|
105907
106009
|
__webpack_require__.r(__webpack_exports__);
|
|
105908
106010
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
105909
|
-
/* harmony export */ mediaTypes: () => (/* reexport safe */
|
|
106011
|
+
/* harmony export */ mediaTypes: () => (/* reexport safe */ _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])
|
|
105910
106012
|
/* harmony export */ });
|
|
105911
|
-
/* empty/unused harmony star reexport */
|
|
105912
|
-
/* empty/unused harmony star reexport */
|
|
105913
106013
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
105914
106014
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
105915
106015
|
/* harmony import */ var _native_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38600);
|
|
105916
106016
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34885);
|
|
105917
|
-
/* harmony import */ var
|
|
106017
|
+
/* harmony import */ var _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49968);
|
|
105918
106018
|
|
|
105919
106019
|
|
|
105920
106020
|
|
|
@@ -106070,10 +106170,8 @@ const parse = async source => {
|
|
|
106070
106170
|
|
|
106071
106171
|
"use strict";
|
|
106072
106172
|
__webpack_require__.r(__webpack_exports__);
|
|
106073
|
-
/*
|
|
106074
|
-
/*
|
|
106075
|
-
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19305);
|
|
106076
|
-
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13615);
|
|
106173
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19305);
|
|
106174
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13615);
|
|
106077
106175
|
|
|
106078
106176
|
|
|
106079
106177
|
|
|
@@ -106094,7 +106192,7 @@ const detect = async source => {
|
|
|
106094
106192
|
}
|
|
106095
106193
|
let cst = null;
|
|
106096
106194
|
try {
|
|
106097
|
-
cst = await (0,
|
|
106195
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
106098
106196
|
return cst.rootNode.type !== 'ERROR';
|
|
106099
106197
|
} catch {
|
|
106100
106198
|
return false;
|
|
@@ -106114,9 +106212,9 @@ const parse = async (source, {
|
|
|
106114
106212
|
sourceMap = false,
|
|
106115
106213
|
style = false
|
|
106116
106214
|
} = {}) => {
|
|
106117
|
-
const cst = await (0,
|
|
106215
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
106118
106216
|
try {
|
|
106119
|
-
return (0,
|
|
106217
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
106120
106218
|
sourceMap,
|
|
106121
106219
|
style
|
|
106122
106220
|
});
|
|
@@ -107215,15 +107313,13 @@ const yamlMediaTypes = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODUL
|
|
|
107215
107313
|
"use strict";
|
|
107216
107314
|
__webpack_require__.r(__webpack_exports__);
|
|
107217
107315
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
107218
|
-
/* harmony export */ mediaTypes: () => (/* reexport safe */
|
|
107316
|
+
/* harmony export */ mediaTypes: () => (/* reexport safe */ _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])
|
|
107219
107317
|
/* harmony export */ });
|
|
107220
|
-
/* empty/unused harmony star reexport */
|
|
107221
|
-
/* empty/unused harmony star reexport */
|
|
107222
107318
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
107223
107319
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
107224
107320
|
/* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
|
|
107225
107321
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
|
|
107226
|
-
/* harmony import */ var
|
|
107322
|
+
/* harmony import */ var _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16688);
|
|
107227
107323
|
|
|
107228
107324
|
|
|
107229
107325
|
|
|
@@ -107326,10 +107422,8 @@ const mediaTypes = new YamlMediaTypes('text/yaml', 'application/yaml');
|
|
|
107326
107422
|
|
|
107327
107423
|
"use strict";
|
|
107328
107424
|
__webpack_require__.r(__webpack_exports__);
|
|
107329
|
-
/*
|
|
107330
|
-
/*
|
|
107331
|
-
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47657);
|
|
107332
|
-
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67919);
|
|
107425
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47657);
|
|
107426
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67919);
|
|
107333
107427
|
|
|
107334
107428
|
|
|
107335
107429
|
|
|
@@ -107340,7 +107434,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107340
107434
|
const detect = async source => {
|
|
107341
107435
|
let cst = null;
|
|
107342
107436
|
try {
|
|
107343
|
-
cst = await (0,
|
|
107437
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
107344
107438
|
return !cst.rootNode.isError;
|
|
107345
107439
|
} catch {
|
|
107346
107440
|
return false;
|
|
@@ -107360,9 +107454,9 @@ const parse = async (source, {
|
|
|
107360
107454
|
sourceMap = false,
|
|
107361
107455
|
style = false
|
|
107362
107456
|
} = {}) => {
|
|
107363
|
-
const cst = await (0,
|
|
107457
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
107364
107458
|
try {
|
|
107365
|
-
return (0,
|
|
107459
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
107366
107460
|
sourceMap,
|
|
107367
107461
|
style
|
|
107368
107462
|
});
|
|
@@ -108268,15 +108362,19 @@ const transformCstToYamlAst = (cursor, ctx) => {
|
|
|
108268
108362
|
__webpack_require__.r(__webpack_exports__);
|
|
108269
108363
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
108270
108364
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
108271
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
108272
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
108273
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
108274
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
108275
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
108276
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
108277
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
108278
|
-
/* harmony import */ var
|
|
108279
|
-
/* harmony import */ var
|
|
108365
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55297);
|
|
108366
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28121);
|
|
108367
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18252);
|
|
108368
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97601);
|
|
108369
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31770);
|
|
108370
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97071);
|
|
108371
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84660);
|
|
108372
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40094);
|
|
108373
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4823);
|
|
108374
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(25810);
|
|
108375
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49686);
|
|
108376
|
+
/* harmony import */ var _ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(90594);
|
|
108377
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21544);
|
|
108280
108378
|
|
|
108281
108379
|
|
|
108282
108380
|
// Transform context passed through transformation
|
|
@@ -108286,7 +108384,7 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
108286
108384
|
if (!ctx.sourceMap) {
|
|
108287
108385
|
return;
|
|
108288
108386
|
}
|
|
108289
|
-
|
|
108387
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(node, element);
|
|
108290
108388
|
};
|
|
108291
108389
|
|
|
108292
108390
|
// find the first descendant matching a type path through the AST
|
|
@@ -108304,7 +108402,7 @@ const findFirst = (node, path) => {
|
|
|
108304
108402
|
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
108305
108403
|
const detectIndent = node => {
|
|
108306
108404
|
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
108307
|
-
if (nested?.styleGroup ===
|
|
108405
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
108308
108406
|
return nested.startCharacter;
|
|
108309
108407
|
}
|
|
108310
108408
|
return 2;
|
|
@@ -108436,7 +108534,7 @@ const buildYamlStyle = (node, ctx, extras) => {
|
|
|
108436
108534
|
// an untagged node has the non-specific tag '?' when it's a plain scalar and '!' otherwise
|
|
108437
108535
|
// (YAML 1.2 §6.9.1); an explicit '!' on any other node means the same as no tag
|
|
108438
108536
|
const tag = node.tag?.explicitName;
|
|
108439
|
-
if (tag !== undefined && tag !== (node.style ===
|
|
108537
|
+
if (tag !== undefined && tag !== (node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain ? '?' : '!')) {
|
|
108440
108538
|
yamlStyle.tag = tag;
|
|
108441
108539
|
}
|
|
108442
108540
|
// the anchor's name, without the & indicator
|
|
@@ -108550,17 +108648,17 @@ const collectStreamComments = node => {
|
|
|
108550
108648
|
if (!root) comments.before.push(text);else if (comment.startLine === root.endLine) comments.inline.push(text);else comments.after.push(text);
|
|
108551
108649
|
};
|
|
108552
108650
|
for (const child of node.children) {
|
|
108553
|
-
if ((0,
|
|
108651
|
+
if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isDocument)(child)) {
|
|
108554
108652
|
if (root) break;
|
|
108555
108653
|
// comments after an explicit document start (---) or before an explicit document end (...)
|
|
108556
108654
|
// are the document's own children, around its root node
|
|
108557
108655
|
const children = child.children || [];
|
|
108558
|
-
const rootIndex = children.findIndex(c => !(0,
|
|
108656
|
+
const rootIndex = children.findIndex(c => !(0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(c));
|
|
108559
108657
|
if (rootIndex === -1) break;
|
|
108560
|
-
children.slice(0, rootIndex).filter(
|
|
108658
|
+
children.slice(0, rootIndex).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
108561
108659
|
root = children[rootIndex];
|
|
108562
|
-
children.slice(rootIndex + 1).filter(
|
|
108563
|
-
} else if ((0,
|
|
108660
|
+
children.slice(rootIndex + 1).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
108661
|
+
} else if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(child)) {
|
|
108564
108662
|
collect(child);
|
|
108565
108663
|
}
|
|
108566
108664
|
}
|
|
@@ -108573,7 +108671,7 @@ const transformStream = (node, ctx) => {
|
|
|
108573
108671
|
if (ctx.style) {
|
|
108574
108672
|
ctx.indent = detectIndent(node);
|
|
108575
108673
|
}
|
|
108576
|
-
const element = new
|
|
108674
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
108577
108675
|
|
|
108578
108676
|
// Transform all children
|
|
108579
108677
|
const children = transformChildren(node.children || [], ctx);
|
|
@@ -108633,7 +108731,7 @@ const transformDocument = (node, ctx) => {
|
|
|
108633
108731
|
const shouldSkipVisitingMoreDocuments = ctx.processedDocumentCount >= 1;
|
|
108634
108732
|
if (shouldWarnAboutMoreDocuments) {
|
|
108635
108733
|
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
108636
|
-
const element = new
|
|
108734
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
108637
108735
|
element.classes.push('warning');
|
|
108638
108736
|
maybeAddSourceMap(node, element, ctx);
|
|
108639
108737
|
ctx.annotations.push(element);
|
|
@@ -108652,7 +108750,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
108652
108750
|
const typedNode = node;
|
|
108653
108751
|
const children = node.children || [];
|
|
108654
108752
|
if (ctx.style) {
|
|
108655
|
-
if (ctx.flowCollectionPadding === null && node.styleGroup ===
|
|
108753
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Flow) {
|
|
108656
108754
|
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
108657
108755
|
}
|
|
108658
108756
|
const comments = collectComments(children, typedNode.startCharacter);
|
|
@@ -108663,7 +108761,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
108663
108761
|
element.style = buildYamlStyle(node, ctx, {
|
|
108664
108762
|
comment: comments.trailing,
|
|
108665
108763
|
// a single pair written directly in a flow sequence (e.g. [a: 1])
|
|
108666
|
-
singlePair: node.style ===
|
|
108764
|
+
singlePair: node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.SinglePair || undefined
|
|
108667
108765
|
});
|
|
108668
108766
|
if (comments.outOfScope.length > 0) {
|
|
108669
108767
|
ctx.promotedComments.push(...comments.outOfScope);
|
|
@@ -108676,14 +108774,14 @@ const transformCollection = (element, node, ctx) => {
|
|
|
108676
108774
|
|
|
108677
108775
|
// Mapping: Transforms to ObjectElement
|
|
108678
108776
|
const transformMapping = (node, ctx) => {
|
|
108679
|
-
const element = new
|
|
108777
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
108680
108778
|
transformCollection(element, node, ctx);
|
|
108681
108779
|
return element;
|
|
108682
108780
|
};
|
|
108683
108781
|
|
|
108684
108782
|
// KeyValuePair: Transforms to MemberElement
|
|
108685
108783
|
const transformKeyValuePair = (node, ctx) => {
|
|
108686
|
-
const element = new
|
|
108784
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
108687
108785
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108688
108786
|
const {
|
|
108689
108787
|
key,
|
|
@@ -108694,15 +108792,25 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
108694
108792
|
styleGroup,
|
|
108695
108793
|
startCharacter
|
|
108696
108794
|
} = value;
|
|
108697
|
-
if (styleGroup ===
|
|
108795
|
+
if (styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block) {
|
|
108698
108796
|
ctx.indentSeq = startCharacter > node.startCharacter;
|
|
108699
108797
|
}
|
|
108700
108798
|
}
|
|
108701
108799
|
|
|
108702
108800
|
// Transform key and value (these are dynamically defined properties)
|
|
108703
|
-
|
|
108801
|
+
let keyResult = transform(key, ctx);
|
|
108704
108802
|
const valueResult = transform(value, ctx);
|
|
108705
108803
|
|
|
108804
|
+
// an empty key is a null in YAML, but a JavaScript property name can't be null, so it's the empty
|
|
108805
|
+
// string it's named by, marked as an empty key
|
|
108806
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(keyResult) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(keyResult, ['yaml-e-node'])) {
|
|
108807
|
+
const emptyKey = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]('', keyResult.meta, keyResult.attributes);
|
|
108808
|
+
emptyKey.classes.push('yaml-e-key');
|
|
108809
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(keyResult, emptyKey);
|
|
108810
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__["default"].transfer(keyResult, emptyKey);
|
|
108811
|
+
keyResult = emptyKey;
|
|
108812
|
+
}
|
|
108813
|
+
|
|
108706
108814
|
// @ts-ignore
|
|
108707
108815
|
element.content.key = keyResult;
|
|
108708
108816
|
// @ts-ignore
|
|
@@ -108722,19 +108830,18 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
108722
108830
|
|
|
108723
108831
|
// Sequence: Transforms to ArrayElement
|
|
108724
108832
|
const transformSequence = (node, ctx) => {
|
|
108725
|
-
const element = new
|
|
108833
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"]();
|
|
108726
108834
|
transformCollection(element, node, ctx);
|
|
108727
108835
|
return element;
|
|
108728
108836
|
};
|
|
108729
108837
|
|
|
108730
108838
|
// Scalar: Converts to Element via namespace
|
|
108731
108839
|
const transformScalar = (node, ctx) => {
|
|
108732
|
-
|
|
108733
|
-
|
|
108734
|
-
// Translate style information about empty nodes; an empty node (YAML 1.2 §7.2) is a null unless
|
|
108735
|
-
// a tag other than the null tag makes it something else (e.g. !!str makes it an empty string)
|
|
108840
|
+
// an empty node (YAML 1.2 §7.2) is a null unless a tag other than the null tag makes it
|
|
108841
|
+
// something else (e.g. !!str makes it an empty string); its classes tell it from an explicit null
|
|
108736
108842
|
const tag = node.tag?.explicitName;
|
|
108737
|
-
const isEmptyNode = node.content === '' && node.style ===
|
|
108843
|
+
const isEmptyNode = node.content === '' && node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain && [undefined, '?', '!!null', '!<tag:yaml.org,2002:null>'].includes(tag);
|
|
108844
|
+
const element = isEmptyNode ? new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]() : ctx.namespace.toElement(node.content);
|
|
108738
108845
|
if (isEmptyNode) {
|
|
108739
108846
|
element.classes.push('yaml-e-node');
|
|
108740
108847
|
element.classes.push('yaml-e-scalar');
|
|
@@ -108762,7 +108869,7 @@ const transformComment = (node, ctx) => {
|
|
|
108762
108869
|
// Only interested in stream comments before the first document
|
|
108763
108870
|
if (isStreamComment) {
|
|
108764
108871
|
// @ts-ignore
|
|
108765
|
-
const element = new
|
|
108872
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__["default"](node.content);
|
|
108766
108873
|
maybeAddSourceMap(node, element, ctx);
|
|
108767
108874
|
return element;
|
|
108768
108875
|
}
|
|
@@ -108773,7 +108880,7 @@ const transformComment = (node, ctx) => {
|
|
|
108773
108880
|
const transformLiteral = (node, ctx) => {
|
|
108774
108881
|
if (node.isMissing) {
|
|
108775
108882
|
const message = `(Missing ${node.value})`;
|
|
108776
|
-
const element = new
|
|
108883
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
108777
108884
|
element.classes.push('warning');
|
|
108778
108885
|
maybeAddSourceMap(node, element, ctx);
|
|
108779
108886
|
ctx.annotations.push(element);
|
|
@@ -108784,7 +108891,7 @@ const transformLiteral = (node, ctx) => {
|
|
|
108784
108891
|
// Error as annotation (used by keyValuePair)
|
|
108785
108892
|
const transformErrorAsAnnotation = (node, ctx) => {
|
|
108786
108893
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
108787
|
-
const element = new
|
|
108894
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
108788
108895
|
element.classes.push('error');
|
|
108789
108896
|
maybeAddSourceMap(node, element, ctx);
|
|
108790
108897
|
ctx.annotations.push(element);
|
|
@@ -108793,7 +108900,7 @@ const transformErrorAsAnnotation = (node, ctx) => {
|
|
|
108793
108900
|
// Error: Creates error annotation (adds to annotations array)
|
|
108794
108901
|
const transformError = (node, ctx) => {
|
|
108795
108902
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
108796
|
-
const element = new
|
|
108903
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
108797
108904
|
element.classes.push('error');
|
|
108798
108905
|
maybeAddSourceMap(node, element, ctx);
|
|
108799
108906
|
ctx.annotations.push(element);
|
|
@@ -108803,10 +108910,10 @@ const transformError = (node, ctx) => {
|
|
|
108803
108910
|
// Error at root level: Creates ParseResultElement with error annotation
|
|
108804
108911
|
const transformRootError = (node, ctx) => {
|
|
108805
108912
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
108806
|
-
const element = new
|
|
108913
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
108807
108914
|
element.classes.push('error');
|
|
108808
108915
|
maybeAddSourceMap(node, element, ctx);
|
|
108809
|
-
const parseResultElement = new
|
|
108916
|
+
const parseResultElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
108810
108917
|
parseResultElement.push(element);
|
|
108811
108918
|
return parseResultElement;
|
|
108812
108919
|
};
|
|
@@ -108833,7 +108940,7 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
108833
108940
|
|
|
108834
108941
|
// Handle empty parse result
|
|
108835
108942
|
if (!rootNode) {
|
|
108836
|
-
return new
|
|
108943
|
+
return new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
108837
108944
|
}
|
|
108838
108945
|
|
|
108839
108946
|
// Handle root-level error (no valid stream, just an error node)
|
|
@@ -108843,12 +108950,12 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
108843
108950
|
const result = transform(rootNode, ctx);
|
|
108844
108951
|
|
|
108845
108952
|
// Result should be a ParseResultElement from transformStream
|
|
108846
|
-
if (result instanceof
|
|
108953
|
+
if (result instanceof _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]) {
|
|
108847
108954
|
return result;
|
|
108848
108955
|
}
|
|
108849
108956
|
|
|
108850
108957
|
// Fallback: wrap in ParseResultElement
|
|
108851
|
-
const parseResult = new
|
|
108958
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
108852
108959
|
if (result !== null) {
|
|
108853
108960
|
if (Array.isArray(result)) {
|
|
108854
108961
|
result.forEach(el => parseResult.push(el));
|