@speclynx/apidom-overlay 6.1.0 → 6.1.2
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 +13 -0
- package/README.md +1 -1
- package/dist/apidom-overlay.browser.js +471 -338
- package/dist/apidom-overlay.browser.min.js +1 -1
- package/package.json +9 -9
- package/src/diff/realms/apidom.cjs +28 -7
- package/src/diff/realms/apidom.mjs +27 -7
- package/src/diff/realms/uri.cjs +2 -0
- package/src/diff/realms/uri.mjs +3 -1
- package/types/apidom-overlay.d.ts +5 -0
|
@@ -724,9 +724,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
724
724
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97071);
|
|
725
725
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44673);
|
|
726
726
|
/* harmony import */ var _speclynx_apidom_json_path__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84637);
|
|
727
|
-
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
|
728
|
-
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
|
|
729
|
-
/* harmony import */ var
|
|
727
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13786);
|
|
728
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(35937);
|
|
729
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(39505);
|
|
730
|
+
/* harmony import */ var _errors_OverlayError_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(18436);
|
|
730
731
|
|
|
731
732
|
|
|
732
733
|
|
|
@@ -745,8 +746,22 @@ const defaultDiffOptions = {
|
|
|
745
746
|
version: '0.0.0'
|
|
746
747
|
}
|
|
747
748
|
};
|
|
749
|
+
|
|
750
|
+
// generated actions update primitive values and concatenate arrays, which Overlay 1.0.0 doesn't allow
|
|
751
|
+
const supportedOverlayVersions = _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_9__["default"].filterByFormat('generic').map(mediaType => mediaType.split('version=')[1]).filter(version => version !== '1.0.0');
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* Throws {@link OverlayError} when the overlay version option is unsupported.
|
|
755
|
+
* Shared with the URI realm, which checks it before parsing any document.
|
|
756
|
+
*/
|
|
757
|
+
const assertSupportedOverlayVersion = overlay => {
|
|
758
|
+
const overlayVersion = overlay ?? defaultDiffOptions.overlay;
|
|
759
|
+
if (!supportedOverlayVersions.includes(overlayVersion)) {
|
|
760
|
+
throw new _errors_OverlayError_ts__WEBPACK_IMPORTED_MODULE_12__["default"](`Unsupported overlay version "${overlayVersion}": diff supports ${supportedOverlayVersions.join(', ')}`);
|
|
761
|
+
}
|
|
762
|
+
};
|
|
748
763
|
const createUpdateAction = (segments, value) => {
|
|
749
|
-
const action = new
|
|
764
|
+
const action = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.ActionElement();
|
|
750
765
|
action.target = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](_speclynx_apidom_json_path__WEBPACK_IMPORTED_MODULE_8__.NormalizedPath.from(segments));
|
|
751
766
|
/**
|
|
752
767
|
* Every update value is built from nodes of the right document. Cloning here
|
|
@@ -758,22 +773,27 @@ const createUpdateAction = (segments, value) => {
|
|
|
758
773
|
return action;
|
|
759
774
|
};
|
|
760
775
|
const createRemoveAction = segments => {
|
|
761
|
-
const action = new
|
|
776
|
+
const action = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.ActionElement();
|
|
762
777
|
action.target = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](_speclynx_apidom_json_path__WEBPACK_IMPORTED_MODULE_8__.NormalizedPath.from(segments));
|
|
763
778
|
action.removeField = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](true);
|
|
764
779
|
return action;
|
|
765
780
|
};
|
|
766
781
|
|
|
767
|
-
// elements are compared by their
|
|
768
|
-
// empty string; Element#equals compares the elements' own values, where both are an empty string
|
|
782
|
+
// elements are compared by their values, read with the core toValue
|
|
769
783
|
const isEqual = (left, right) => (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(left), (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(right));
|
|
784
|
+
|
|
785
|
+
// a null (as an empty YAML node is) filled in with a scalar, or a scalar emptied to a null, is
|
|
786
|
+
// updated in place like a value, keeping its position; any other change of type is structural
|
|
787
|
+
const isStructuralChange = (left, right) => {
|
|
788
|
+
const kinds = [left.primitive(), right.primitive()];
|
|
789
|
+
const isCollection = kinds.some(kind => kind === 'object' || kind === 'array');
|
|
790
|
+
return kinds[0] !== kinds[1] && (isCollection || !kinds.includes('null'));
|
|
791
|
+
};
|
|
770
792
|
const diffElements = (left, right, segments, actions) => {
|
|
771
793
|
if (isEqual(left, right)) return;
|
|
772
|
-
|
|
773
|
-
const rightKind = right.primitive();
|
|
774
|
-
if (leftKind !== rightKind) {
|
|
794
|
+
if (isStructuralChange(left, right)) {
|
|
775
795
|
if (segments.length === 0) {
|
|
776
|
-
throw new
|
|
796
|
+
throw new _errors_OverlayError_ts__WEBPACK_IMPORTED_MODULE_12__["default"]('Cannot diff documents with incompatible root types');
|
|
777
797
|
}
|
|
778
798
|
// structural type change: remove old, re-add new via parent update.
|
|
779
799
|
// only reachable from diffObjects — segments tail is always a string key
|
|
@@ -834,7 +854,7 @@ const diffArrays = (left, right, segments, actions) => {
|
|
|
834
854
|
const leftItem = left.get(i);
|
|
835
855
|
const rightItem = right.get(i);
|
|
836
856
|
if (isEqual(leftItem, rightItem)) continue;
|
|
837
|
-
if (leftItem
|
|
857
|
+
if (isStructuralChange(leftItem, rightItem)) {
|
|
838
858
|
// structural type change at index i — reconstruct tail:
|
|
839
859
|
// remove from end down to i (reverse order preserves index stability),
|
|
840
860
|
// then batch-append right[i..] as a single ArrayElement (Overlay concat semantics)
|
|
@@ -889,14 +909,15 @@ const diff = (leftElement, rightElement, options = {}) => {
|
|
|
889
909
|
const infoTitle = options.info?.title ?? defaultDiffOptions.info.title;
|
|
890
910
|
const infoVersion = options.info?.version ?? defaultDiffOptions.info.version;
|
|
891
911
|
const infoDescription = options.info?.description;
|
|
912
|
+
assertSupportedOverlayVersion(overlayVersion);
|
|
892
913
|
const actions = [];
|
|
893
914
|
diffElements(leftElement, rightElement, [], actions);
|
|
894
915
|
if (actions.length === 0 && options.onEmptyDiff === 'throw') {
|
|
895
|
-
throw new
|
|
916
|
+
throw new _errors_OverlayError_ts__WEBPACK_IMPORTED_MODULE_12__["default"]('Diff produced no actions: documents are identical');
|
|
896
917
|
}
|
|
897
|
-
const overlay = new
|
|
898
|
-
overlay.overlay = new
|
|
899
|
-
const info = new
|
|
918
|
+
const overlay = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.Overlay1Element();
|
|
919
|
+
overlay.overlay = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.OverlayElement(overlayVersion);
|
|
920
|
+
const info = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.InfoElement();
|
|
900
921
|
info.title = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](infoTitle);
|
|
901
922
|
info.version = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](infoVersion);
|
|
902
923
|
if (infoDescription !== undefined) {
|
|
@@ -906,10 +927,11 @@ const diff = (leftElement, rightElement, options = {}) => {
|
|
|
906
927
|
if (options.extends !== undefined) {
|
|
907
928
|
overlay.extends = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](options.extends);
|
|
908
929
|
}
|
|
909
|
-
overlay.actions = new
|
|
930
|
+
overlay.actions = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__["default"](actions);
|
|
910
931
|
return overlay;
|
|
911
932
|
};
|
|
912
933
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
934
|
+
/* harmony export */ "assertSupportedOverlayVersion", 0, /* binding */ assertSupportedOverlayVersion,
|
|
913
935
|
/* harmony export */ "diff", 0, /* binding */ diff
|
|
914
936
|
/* harmony export */ ]);
|
|
915
937
|
|
|
@@ -995,6 +1017,8 @@ const defaultOptions = {
|
|
|
995
1017
|
* @public
|
|
996
1018
|
*/
|
|
997
1019
|
const diff = async (leftURI, rightURI, options = defaultOptions) => {
|
|
1020
|
+
// fail on an unsupported version before fetching and parsing the documents
|
|
1021
|
+
(0,_apidom_ts__WEBPACK_IMPORTED_MODULE_1__.assertSupportedOverlayVersion)(options.overlay);
|
|
998
1022
|
const mergedRefOptions = (0,_speclynx_apidom_reference__WEBPACK_IMPORTED_MODULE_0__.mergeOptions)(defaultReferenceOptions, options.reference ?? {});
|
|
999
1023
|
const [leftParseResult, rightParseResult] = await Promise.all([(0,_speclynx_apidom_reference__WEBPACK_IMPORTED_MODULE_0__.parse)(leftURI, mergedRefOptions), (0,_speclynx_apidom_reference__WEBPACK_IMPORTED_MODULE_0__.parse)(rightURI, mergedRefOptions)]);
|
|
1000
1024
|
const leftElement = leftParseResult.api;
|
|
@@ -42827,11 +42851,8 @@ const serializer = (element, replacer, space, options) => {
|
|
|
42827
42851
|
__webpack_require__.r(__webpack_exports__);
|
|
42828
42852
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
42829
42853
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96911);
|
|
42830
|
-
/* harmony import */ var
|
|
42831
|
-
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10977);
|
|
42854
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10977);
|
|
42832
42855
|
|
|
42833
|
-
// an empty YAML node (YAML 1.2 §7.2) is a null parsed as an empty string with the yaml-e-node class
|
|
42834
|
-
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']);
|
|
42835
42856
|
|
|
42836
42857
|
/**
|
|
42837
42858
|
* Transforms the ApiDOM into JavaScript POJO.
|
|
@@ -42841,7 +42862,6 @@ const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_M
|
|
|
42841
42862
|
*/
|
|
42842
42863
|
const serializer = element => {
|
|
42843
42864
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(element)) return element;
|
|
42844
|
-
if (isEmptyNode(element)) return null;
|
|
42845
42865
|
|
|
42846
42866
|
// Shortcut optimization for primitive element types
|
|
42847
42867
|
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)) {
|
|
@@ -42859,8 +42879,8 @@ const serializer = element => {
|
|
|
42859
42879
|
node.forEach((value, key) => {
|
|
42860
42880
|
const k = serialize(key);
|
|
42861
42881
|
const v = serialize(value);
|
|
42862
|
-
const name = (0,
|
|
42863
|
-
if (name !== undefined) (0,
|
|
42882
|
+
const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__.toPropertyName)(k);
|
|
42883
|
+
if (name !== undefined) (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, name, v);
|
|
42864
42884
|
});
|
|
42865
42885
|
return obj;
|
|
42866
42886
|
}
|
|
@@ -42875,7 +42895,6 @@ const serializer = element => {
|
|
|
42875
42895
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isLinkElement)(node)) {
|
|
42876
42896
|
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(node.href) ? node.href.toValue() : '';
|
|
42877
42897
|
}
|
|
42878
|
-
if (isEmptyNode(node)) return null;
|
|
42879
42898
|
return node.toValue();
|
|
42880
42899
|
};
|
|
42881
42900
|
return serialize(element);
|
|
@@ -43243,9 +43262,10 @@ const toYAMLNode = (element, context) => {
|
|
|
43243
43262
|
// scalar element (string, number, boolean, null)
|
|
43244
43263
|
const scalarType = style.scalarStyle ? scalarStyleMap[style.scalarStyle] : undefined;
|
|
43245
43264
|
const scalar = new yaml__WEBPACK_IMPORTED_MODULE_0__.Scalar((0,_value_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])(element));
|
|
43246
|
-
// an empty node (YAML 1.2 §7.2) is serialized to null
|
|
43247
|
-
// it was written: with no content, after its anchor and tag if it
|
|
43248
|
-
|
|
43265
|
+
// an empty node (YAML 1.2 §7.2) is serialized to null, or to the empty string as a key; while it's
|
|
43266
|
+
// still empty, write it back as it was written: with no content, after its anchor and tag if it
|
|
43267
|
+
// had them
|
|
43268
|
+
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']);
|
|
43249
43269
|
if (isEmptyNode) {
|
|
43250
43270
|
const anchor = claimAnchor(style, context);
|
|
43251
43271
|
const properties = [anchor && `&${anchor}`, style.tag].filter(Boolean).join(' ');
|
|
@@ -43284,7 +43304,10 @@ const toYAMLNode = (element, context) => {
|
|
|
43284
43304
|
}
|
|
43285
43305
|
}
|
|
43286
43306
|
if ((style.scalarStyle === 'Literal' || style.scalarStyle === 'Folded') && typeof style.rawContent === 'string' && typeof scalar.value === 'string') {
|
|
43287
|
-
const
|
|
43307
|
+
const raw = style.rawContent.replace(/\r\n/g, '\n');
|
|
43308
|
+
// the empty lines after a clip or strip block aren't part of its value, but separate it from
|
|
43309
|
+
// what follows in its source, so they're dropped; a keep block's are part of its value
|
|
43310
|
+
const text = raw.replace(/^[|>][1-9]?\+/.test(raw) ? /\n$/ : /\n+$/, '');
|
|
43288
43311
|
scalar.value = new RawBlockScalar(scalar.value, text);
|
|
43289
43312
|
}
|
|
43290
43313
|
if (style.styleGroup === 'Flow' && typeof style.rawContent === 'string' && typeof scalar.value === 'string' && scalar.value !== '') {
|
|
@@ -45399,11 +45422,10 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
45399
45422
|
|
|
45400
45423
|
"use strict";
|
|
45401
45424
|
__webpack_require__.r(__webpack_exports__);
|
|
45402
|
-
/* empty/unused harmony star reexport */
|
|
45403
45425
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
45404
45426
|
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51844);
|
|
45405
|
-
/* harmony import */ var
|
|
45406
|
-
/* harmony import */ var
|
|
45427
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
45428
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38504);
|
|
45407
45429
|
|
|
45408
45430
|
|
|
45409
45431
|
|
|
@@ -45573,13 +45595,13 @@ class Element {
|
|
|
45573
45595
|
}
|
|
45574
45596
|
|
|
45575
45597
|
// KeyValuePair
|
|
45576
|
-
if (value instanceof
|
|
45598
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
45577
45599
|
this._content = value;
|
|
45578
45600
|
return;
|
|
45579
45601
|
}
|
|
45580
45602
|
|
|
45581
45603
|
// ObjectSlice - extract elements array
|
|
45582
|
-
if (value instanceof
|
|
45604
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
45583
45605
|
this._content = value.elements;
|
|
45584
45606
|
return;
|
|
45585
45607
|
}
|
|
@@ -45698,7 +45720,7 @@ class Element {
|
|
|
45698
45720
|
if (Array.isArray(content)) {
|
|
45699
45721
|
return content;
|
|
45700
45722
|
}
|
|
45701
|
-
if (content instanceof
|
|
45723
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
45702
45724
|
const children = [];
|
|
45703
45725
|
if (content.key) children.push(content.key);
|
|
45704
45726
|
if (content.value) children.push(content.value);
|
|
@@ -45762,7 +45784,7 @@ class Element {
|
|
|
45762
45784
|
if (_content instanceof Element) {
|
|
45763
45785
|
return _content.toValue();
|
|
45764
45786
|
}
|
|
45765
|
-
if (_content instanceof
|
|
45787
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
45766
45788
|
return _content.toValue();
|
|
45767
45789
|
}
|
|
45768
45790
|
if (Array.isArray(_content)) {
|
|
@@ -46858,14 +46880,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46858
46880
|
/* harmony export */ parse: () => (/* reexport safe */ _swaggerexpert_jsonpath__WEBPACK_IMPORTED_MODULE_0__.parse),
|
|
46859
46881
|
/* harmony export */ test: () => (/* reexport safe */ _swaggerexpert_jsonpath__WEBPACK_IMPORTED_MODULE_0__.test)
|
|
46860
46882
|
/* harmony export */ });
|
|
46861
|
-
/* empty/unused harmony star reexport */
|
|
46862
46883
|
/* harmony import */ var _swaggerexpert_jsonpath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84637);
|
|
46863
|
-
/* harmony import */ var
|
|
46884
|
+
/* harmony import */ var _realm_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84925);
|
|
46864
46885
|
|
|
46865
46886
|
|
|
46866
46887
|
|
|
46867
46888
|
|
|
46868
|
-
const realm = new
|
|
46889
|
+
const realm = new _realm_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
46869
46890
|
|
|
46870
46891
|
/**
|
|
46871
46892
|
* Options for ApiDOM JSONPath evaluation.
|
|
@@ -47100,14 +47121,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47100
47121
|
/* harmony export */ testReferenceToken: () => (/* reexport safe */ _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.testReferenceToken),
|
|
47101
47122
|
/* harmony export */ unescape: () => (/* reexport safe */ _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.unescape)
|
|
47102
47123
|
/* harmony export */ });
|
|
47103
|
-
/* empty/unused harmony star reexport */
|
|
47104
47124
|
/* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61198);
|
|
47105
|
-
/* harmony import */ var
|
|
47125
|
+
/* harmony import */ var _realm_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60545);
|
|
47106
47126
|
|
|
47107
47127
|
|
|
47108
47128
|
|
|
47109
47129
|
|
|
47110
|
-
const realm = new
|
|
47130
|
+
const realm = new _realm_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
47111
47131
|
|
|
47112
47132
|
/**
|
|
47113
47133
|
* @public
|
|
@@ -78044,25 +78064,24 @@ class AllOfVisitor extends JSONSchemaAllOfVisitor {
|
|
|
78044
78064
|
|
|
78045
78065
|
"use strict";
|
|
78046
78066
|
__webpack_require__.r(__webpack_exports__);
|
|
78047
|
-
/*
|
|
78048
|
-
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
78049
|
-
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26207);
|
|
78067
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86059);
|
|
78068
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26207);
|
|
78050
78069
|
|
|
78051
78070
|
|
|
78052
78071
|
|
|
78053
78072
|
/**
|
|
78054
78073
|
* @public
|
|
78055
78074
|
*/
|
|
78056
|
-
class ItemsVisitor extends
|
|
78075
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
78057
78076
|
ObjectElement(path) {
|
|
78058
|
-
|
|
78059
|
-
if ((0,
|
|
78077
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ObjectElement.call(this, path);
|
|
78078
|
+
if ((0,_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)(this.element)) {
|
|
78060
78079
|
this.element.meta.set('referenced-element', 'schema');
|
|
78061
78080
|
}
|
|
78062
78081
|
}
|
|
78063
78082
|
ArrayElement(path) {
|
|
78064
|
-
|
|
78065
|
-
this.element.filter(
|
|
78083
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ArrayElement.call(this, path);
|
|
78084
|
+
this.element.filter(_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)
|
|
78066
78085
|
// @ts-ignore
|
|
78067
78086
|
.forEach(referenceElement => {
|
|
78068
78087
|
referenceElement.meta.set('referenced-element', 'schema');
|
|
@@ -86326,9 +86345,8 @@ class AnyOfVisitor extends JSONSchemaAnyOfVisitor {
|
|
|
86326
86345
|
|
|
86327
86346
|
"use strict";
|
|
86328
86347
|
__webpack_require__.r(__webpack_exports__);
|
|
86329
|
-
/*
|
|
86330
|
-
/* harmony import */ var
|
|
86331
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32131);
|
|
86348
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26207);
|
|
86349
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32131);
|
|
86332
86350
|
|
|
86333
86351
|
|
|
86334
86352
|
|
|
@@ -86336,10 +86354,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86336
86354
|
/**
|
|
86337
86355
|
* @public
|
|
86338
86356
|
*/
|
|
86339
|
-
class ItemsVisitor extends
|
|
86357
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
86340
86358
|
ObjectElement(path) {
|
|
86341
|
-
|
|
86342
|
-
if ((0,
|
|
86359
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement.call(this, path);
|
|
86360
|
+
if ((0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_1__.isReferenceElement)(this.element)) {
|
|
86343
86361
|
this.element.meta.set('referenced-element', 'schema');
|
|
86344
86362
|
}
|
|
86345
86363
|
}
|
|
@@ -93043,15 +93061,13 @@ const yamlMediaTypes = new _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODU
|
|
|
93043
93061
|
"use strict";
|
|
93044
93062
|
__webpack_require__.r(__webpack_exports__);
|
|
93045
93063
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
93046
|
-
/* harmony export */ mediaTypes: () => (/* reexport safe */
|
|
93064
|
+
/* harmony export */ mediaTypes: () => (/* reexport safe */ _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])
|
|
93047
93065
|
/* harmony export */ });
|
|
93048
|
-
/* empty/unused harmony star reexport */
|
|
93049
|
-
/* empty/unused harmony star reexport */
|
|
93050
93066
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
93051
93067
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
93052
93068
|
/* harmony import */ var _native_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38600);
|
|
93053
93069
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34885);
|
|
93054
|
-
/* harmony import */ var
|
|
93070
|
+
/* harmony import */ var _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49968);
|
|
93055
93071
|
|
|
93056
93072
|
|
|
93057
93073
|
|
|
@@ -93207,10 +93223,8 @@ const parse = async source => {
|
|
|
93207
93223
|
|
|
93208
93224
|
"use strict";
|
|
93209
93225
|
__webpack_require__.r(__webpack_exports__);
|
|
93210
|
-
/*
|
|
93211
|
-
/*
|
|
93212
|
-
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19305);
|
|
93213
|
-
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13615);
|
|
93226
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19305);
|
|
93227
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13615);
|
|
93214
93228
|
|
|
93215
93229
|
|
|
93216
93230
|
|
|
@@ -93231,7 +93245,7 @@ const detect = async source => {
|
|
|
93231
93245
|
}
|
|
93232
93246
|
let cst = null;
|
|
93233
93247
|
try {
|
|
93234
|
-
cst = await (0,
|
|
93248
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
93235
93249
|
return cst.rootNode.type !== 'ERROR';
|
|
93236
93250
|
} catch {
|
|
93237
93251
|
return false;
|
|
@@ -93251,9 +93265,9 @@ const parse = async (source, {
|
|
|
93251
93265
|
sourceMap = false,
|
|
93252
93266
|
style = false
|
|
93253
93267
|
} = {}) => {
|
|
93254
|
-
const cst = await (0,
|
|
93268
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
93255
93269
|
try {
|
|
93256
|
-
return (0,
|
|
93270
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
93257
93271
|
sourceMap,
|
|
93258
93272
|
style
|
|
93259
93273
|
});
|
|
@@ -94352,15 +94366,13 @@ const yamlMediaTypes = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODUL
|
|
|
94352
94366
|
"use strict";
|
|
94353
94367
|
__webpack_require__.r(__webpack_exports__);
|
|
94354
94368
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
94355
|
-
/* harmony export */ mediaTypes: () => (/* reexport safe */
|
|
94369
|
+
/* harmony export */ mediaTypes: () => (/* reexport safe */ _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])
|
|
94356
94370
|
/* harmony export */ });
|
|
94357
|
-
/* empty/unused harmony star reexport */
|
|
94358
|
-
/* empty/unused harmony star reexport */
|
|
94359
94371
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
94360
94372
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
94361
94373
|
/* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
|
|
94362
94374
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
|
|
94363
|
-
/* harmony import */ var
|
|
94375
|
+
/* harmony import */ var _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16688);
|
|
94364
94376
|
|
|
94365
94377
|
|
|
94366
94378
|
|
|
@@ -94463,10 +94475,8 @@ const mediaTypes = new YamlMediaTypes('text/yaml', 'application/yaml');
|
|
|
94463
94475
|
|
|
94464
94476
|
"use strict";
|
|
94465
94477
|
__webpack_require__.r(__webpack_exports__);
|
|
94466
|
-
/*
|
|
94467
|
-
/*
|
|
94468
|
-
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47657);
|
|
94469
|
-
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67919);
|
|
94478
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47657);
|
|
94479
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67919);
|
|
94470
94480
|
|
|
94471
94481
|
|
|
94472
94482
|
|
|
@@ -94477,7 +94487,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
94477
94487
|
const detect = async source => {
|
|
94478
94488
|
let cst = null;
|
|
94479
94489
|
try {
|
|
94480
|
-
cst = await (0,
|
|
94490
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
94481
94491
|
return !cst.rootNode.isError;
|
|
94482
94492
|
} catch {
|
|
94483
94493
|
return false;
|
|
@@ -94497,9 +94507,9 @@ const parse = async (source, {
|
|
|
94497
94507
|
sourceMap = false,
|
|
94498
94508
|
style = false
|
|
94499
94509
|
} = {}) => {
|
|
94500
|
-
const cst = await (0,
|
|
94510
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
94501
94511
|
try {
|
|
94502
|
-
return (0,
|
|
94512
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
94503
94513
|
sourceMap,
|
|
94504
94514
|
style
|
|
94505
94515
|
});
|
|
@@ -95405,15 +95415,19 @@ const transformCstToYamlAst = (cursor, ctx) => {
|
|
|
95405
95415
|
__webpack_require__.r(__webpack_exports__);
|
|
95406
95416
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
95407
95417
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
95408
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
95409
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
95410
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
95411
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
95412
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
95413
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
95414
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
95415
|
-
/* harmony import */ var
|
|
95416
|
-
/* harmony import */ var
|
|
95418
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55297);
|
|
95419
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28121);
|
|
95420
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18252);
|
|
95421
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97601);
|
|
95422
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31770);
|
|
95423
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97071);
|
|
95424
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84660);
|
|
95425
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40094);
|
|
95426
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4823);
|
|
95427
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(25810);
|
|
95428
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49686);
|
|
95429
|
+
/* harmony import */ var _ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(90594);
|
|
95430
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21544);
|
|
95417
95431
|
|
|
95418
95432
|
|
|
95419
95433
|
// Transform context passed through transformation
|
|
@@ -95423,7 +95437,7 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
95423
95437
|
if (!ctx.sourceMap) {
|
|
95424
95438
|
return;
|
|
95425
95439
|
}
|
|
95426
|
-
|
|
95440
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(node, element);
|
|
95427
95441
|
};
|
|
95428
95442
|
|
|
95429
95443
|
// find the first descendant matching a type path through the AST
|
|
@@ -95441,7 +95455,7 @@ const findFirst = (node, path) => {
|
|
|
95441
95455
|
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
95442
95456
|
const detectIndent = node => {
|
|
95443
95457
|
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
95444
|
-
if (nested?.styleGroup ===
|
|
95458
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
95445
95459
|
return nested.startCharacter;
|
|
95446
95460
|
}
|
|
95447
95461
|
return 2;
|
|
@@ -95573,7 +95587,7 @@ const buildYamlStyle = (node, ctx, extras) => {
|
|
|
95573
95587
|
// an untagged node has the non-specific tag '?' when it's a plain scalar and '!' otherwise
|
|
95574
95588
|
// (YAML 1.2 §6.9.1); an explicit '!' on any other node means the same as no tag
|
|
95575
95589
|
const tag = node.tag?.explicitName;
|
|
95576
|
-
if (tag !== undefined && tag !== (node.style ===
|
|
95590
|
+
if (tag !== undefined && tag !== (node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain ? '?' : '!')) {
|
|
95577
95591
|
yamlStyle.tag = tag;
|
|
95578
95592
|
}
|
|
95579
95593
|
// the anchor's name, without the & indicator
|
|
@@ -95687,17 +95701,17 @@ const collectStreamComments = node => {
|
|
|
95687
95701
|
if (!root) comments.before.push(text);else if (comment.startLine === root.endLine) comments.inline.push(text);else comments.after.push(text);
|
|
95688
95702
|
};
|
|
95689
95703
|
for (const child of node.children) {
|
|
95690
|
-
if ((0,
|
|
95704
|
+
if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isDocument)(child)) {
|
|
95691
95705
|
if (root) break;
|
|
95692
95706
|
// comments after an explicit document start (---) or before an explicit document end (...)
|
|
95693
95707
|
// are the document's own children, around its root node
|
|
95694
95708
|
const children = child.children || [];
|
|
95695
|
-
const rootIndex = children.findIndex(c => !(0,
|
|
95709
|
+
const rootIndex = children.findIndex(c => !(0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(c));
|
|
95696
95710
|
if (rootIndex === -1) break;
|
|
95697
|
-
children.slice(0, rootIndex).filter(
|
|
95711
|
+
children.slice(0, rootIndex).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
95698
95712
|
root = children[rootIndex];
|
|
95699
|
-
children.slice(rootIndex + 1).filter(
|
|
95700
|
-
} else if ((0,
|
|
95713
|
+
children.slice(rootIndex + 1).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
95714
|
+
} else if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(child)) {
|
|
95701
95715
|
collect(child);
|
|
95702
95716
|
}
|
|
95703
95717
|
}
|
|
@@ -95710,7 +95724,7 @@ const transformStream = (node, ctx) => {
|
|
|
95710
95724
|
if (ctx.style) {
|
|
95711
95725
|
ctx.indent = detectIndent(node);
|
|
95712
95726
|
}
|
|
95713
|
-
const element = new
|
|
95727
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95714
95728
|
|
|
95715
95729
|
// Transform all children
|
|
95716
95730
|
const children = transformChildren(node.children || [], ctx);
|
|
@@ -95770,7 +95784,7 @@ const transformDocument = (node, ctx) => {
|
|
|
95770
95784
|
const shouldSkipVisitingMoreDocuments = ctx.processedDocumentCount >= 1;
|
|
95771
95785
|
if (shouldWarnAboutMoreDocuments) {
|
|
95772
95786
|
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
95773
|
-
const element = new
|
|
95787
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95774
95788
|
element.classes.push('warning');
|
|
95775
95789
|
maybeAddSourceMap(node, element, ctx);
|
|
95776
95790
|
ctx.annotations.push(element);
|
|
@@ -95789,7 +95803,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
95789
95803
|
const typedNode = node;
|
|
95790
95804
|
const children = node.children || [];
|
|
95791
95805
|
if (ctx.style) {
|
|
95792
|
-
if (ctx.flowCollectionPadding === null && node.styleGroup ===
|
|
95806
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Flow) {
|
|
95793
95807
|
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
95794
95808
|
}
|
|
95795
95809
|
const comments = collectComments(children, typedNode.startCharacter);
|
|
@@ -95800,7 +95814,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
95800
95814
|
element.style = buildYamlStyle(node, ctx, {
|
|
95801
95815
|
comment: comments.trailing,
|
|
95802
95816
|
// a single pair written directly in a flow sequence (e.g. [a: 1])
|
|
95803
|
-
singlePair: node.style ===
|
|
95817
|
+
singlePair: node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.SinglePair || undefined
|
|
95804
95818
|
});
|
|
95805
95819
|
if (comments.outOfScope.length > 0) {
|
|
95806
95820
|
ctx.promotedComments.push(...comments.outOfScope);
|
|
@@ -95813,14 +95827,14 @@ const transformCollection = (element, node, ctx) => {
|
|
|
95813
95827
|
|
|
95814
95828
|
// Mapping: Transforms to ObjectElement
|
|
95815
95829
|
const transformMapping = (node, ctx) => {
|
|
95816
|
-
const element = new
|
|
95830
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
95817
95831
|
transformCollection(element, node, ctx);
|
|
95818
95832
|
return element;
|
|
95819
95833
|
};
|
|
95820
95834
|
|
|
95821
95835
|
// KeyValuePair: Transforms to MemberElement
|
|
95822
95836
|
const transformKeyValuePair = (node, ctx) => {
|
|
95823
|
-
const element = new
|
|
95837
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
95824
95838
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95825
95839
|
const {
|
|
95826
95840
|
key,
|
|
@@ -95831,15 +95845,25 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
95831
95845
|
styleGroup,
|
|
95832
95846
|
startCharacter
|
|
95833
95847
|
} = value;
|
|
95834
|
-
if (styleGroup ===
|
|
95848
|
+
if (styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block) {
|
|
95835
95849
|
ctx.indentSeq = startCharacter > node.startCharacter;
|
|
95836
95850
|
}
|
|
95837
95851
|
}
|
|
95838
95852
|
|
|
95839
95853
|
// Transform key and value (these are dynamically defined properties)
|
|
95840
|
-
|
|
95854
|
+
let keyResult = transform(key, ctx);
|
|
95841
95855
|
const valueResult = transform(value, ctx);
|
|
95842
95856
|
|
|
95857
|
+
// an empty key is a null in YAML, but a JavaScript property name can't be null, so it's the empty
|
|
95858
|
+
// string it's named by, marked as an empty key
|
|
95859
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(keyResult) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(keyResult, ['yaml-e-node'])) {
|
|
95860
|
+
const emptyKey = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]('', keyResult.meta, keyResult.attributes);
|
|
95861
|
+
emptyKey.classes.push('yaml-e-key');
|
|
95862
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(keyResult, emptyKey);
|
|
95863
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__["default"].transfer(keyResult, emptyKey);
|
|
95864
|
+
keyResult = emptyKey;
|
|
95865
|
+
}
|
|
95866
|
+
|
|
95843
95867
|
// @ts-ignore
|
|
95844
95868
|
element.content.key = keyResult;
|
|
95845
95869
|
// @ts-ignore
|
|
@@ -95859,19 +95883,18 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
95859
95883
|
|
|
95860
95884
|
// Sequence: Transforms to ArrayElement
|
|
95861
95885
|
const transformSequence = (node, ctx) => {
|
|
95862
|
-
const element = new
|
|
95886
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"]();
|
|
95863
95887
|
transformCollection(element, node, ctx);
|
|
95864
95888
|
return element;
|
|
95865
95889
|
};
|
|
95866
95890
|
|
|
95867
95891
|
// Scalar: Converts to Element via namespace
|
|
95868
95892
|
const transformScalar = (node, ctx) => {
|
|
95869
|
-
|
|
95870
|
-
|
|
95871
|
-
// Translate style information about empty nodes; an empty node (YAML 1.2 §7.2) is a null unless
|
|
95872
|
-
// a tag other than the null tag makes it something else (e.g. !!str makes it an empty string)
|
|
95893
|
+
// an empty node (YAML 1.2 §7.2) is a null unless a tag other than the null tag makes it
|
|
95894
|
+
// something else (e.g. !!str makes it an empty string); its classes tell it from an explicit null
|
|
95873
95895
|
const tag = node.tag?.explicitName;
|
|
95874
|
-
const isEmptyNode = node.content === '' && node.style ===
|
|
95896
|
+
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);
|
|
95897
|
+
const element = isEmptyNode ? new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]() : ctx.namespace.toElement(node.content);
|
|
95875
95898
|
if (isEmptyNode) {
|
|
95876
95899
|
element.classes.push('yaml-e-node');
|
|
95877
95900
|
element.classes.push('yaml-e-scalar');
|
|
@@ -95899,7 +95922,7 @@ const transformComment = (node, ctx) => {
|
|
|
95899
95922
|
// Only interested in stream comments before the first document
|
|
95900
95923
|
if (isStreamComment) {
|
|
95901
95924
|
// @ts-ignore
|
|
95902
|
-
const element = new
|
|
95925
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__["default"](node.content);
|
|
95903
95926
|
maybeAddSourceMap(node, element, ctx);
|
|
95904
95927
|
return element;
|
|
95905
95928
|
}
|
|
@@ -95910,7 +95933,7 @@ const transformComment = (node, ctx) => {
|
|
|
95910
95933
|
const transformLiteral = (node, ctx) => {
|
|
95911
95934
|
if (node.isMissing) {
|
|
95912
95935
|
const message = `(Missing ${node.value})`;
|
|
95913
|
-
const element = new
|
|
95936
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95914
95937
|
element.classes.push('warning');
|
|
95915
95938
|
maybeAddSourceMap(node, element, ctx);
|
|
95916
95939
|
ctx.annotations.push(element);
|
|
@@ -95921,7 +95944,7 @@ const transformLiteral = (node, ctx) => {
|
|
|
95921
95944
|
// Error as annotation (used by keyValuePair)
|
|
95922
95945
|
const transformErrorAsAnnotation = (node, ctx) => {
|
|
95923
95946
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
95924
|
-
const element = new
|
|
95947
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95925
95948
|
element.classes.push('error');
|
|
95926
95949
|
maybeAddSourceMap(node, element, ctx);
|
|
95927
95950
|
ctx.annotations.push(element);
|
|
@@ -95930,7 +95953,7 @@ const transformErrorAsAnnotation = (node, ctx) => {
|
|
|
95930
95953
|
// Error: Creates error annotation (adds to annotations array)
|
|
95931
95954
|
const transformError = (node, ctx) => {
|
|
95932
95955
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
95933
|
-
const element = new
|
|
95956
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95934
95957
|
element.classes.push('error');
|
|
95935
95958
|
maybeAddSourceMap(node, element, ctx);
|
|
95936
95959
|
ctx.annotations.push(element);
|
|
@@ -95940,10 +95963,10 @@ const transformError = (node, ctx) => {
|
|
|
95940
95963
|
// Error at root level: Creates ParseResultElement with error annotation
|
|
95941
95964
|
const transformRootError = (node, ctx) => {
|
|
95942
95965
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
95943
|
-
const element = new
|
|
95966
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95944
95967
|
element.classes.push('error');
|
|
95945
95968
|
maybeAddSourceMap(node, element, ctx);
|
|
95946
|
-
const parseResultElement = new
|
|
95969
|
+
const parseResultElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95947
95970
|
parseResultElement.push(element);
|
|
95948
95971
|
return parseResultElement;
|
|
95949
95972
|
};
|
|
@@ -95970,7 +95993,7 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
95970
95993
|
|
|
95971
95994
|
// Handle empty parse result
|
|
95972
95995
|
if (!rootNode) {
|
|
95973
|
-
return new
|
|
95996
|
+
return new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95974
95997
|
}
|
|
95975
95998
|
|
|
95976
95999
|
// Handle root-level error (no valid stream, just an error node)
|
|
@@ -95980,12 +96003,12 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
95980
96003
|
const result = transform(rootNode, ctx);
|
|
95981
96004
|
|
|
95982
96005
|
// Result should be a ParseResultElement from transformStream
|
|
95983
|
-
if (result instanceof
|
|
96006
|
+
if (result instanceof _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]) {
|
|
95984
96007
|
return result;
|
|
95985
96008
|
}
|
|
95986
96009
|
|
|
95987
96010
|
// Fallback: wrap in ParseResultElement
|
|
95988
|
-
const parseResult = new
|
|
96011
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95989
96012
|
if (result !== null) {
|
|
95990
96013
|
if (Array.isArray(result)) {
|
|
95991
96014
|
result.forEach(el => parseResult.push(el));
|
|
@@ -97926,7 +97949,6 @@ class BundleStrategy {
|
|
|
97926
97949
|
|
|
97927
97950
|
"use strict";
|
|
97928
97951
|
__webpack_require__.r(__webpack_exports__);
|
|
97929
|
-
/* empty/unused harmony star reexport */
|
|
97930
97952
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
97931
97953
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
97932
97954
|
/* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53787);
|
|
@@ -98574,7 +98596,6 @@ class Arazzo1BundleVisitor {
|
|
|
98574
98596
|
|
|
98575
98597
|
"use strict";
|
|
98576
98598
|
__webpack_require__.r(__webpack_exports__);
|
|
98577
|
-
/* empty/unused harmony star reexport */
|
|
98578
98599
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
98579
98600
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
98580
98601
|
/* harmony import */ var _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46417);
|
|
@@ -99052,6 +99073,11 @@ class AsyncAPI2BundleVisitor {
|
|
|
99052
99073
|
}
|
|
99053
99074
|
async ReferenceElement(path) {
|
|
99054
99075
|
const referencingElement = path.node;
|
|
99076
|
+
|
|
99077
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
99078
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
99079
|
+
return;
|
|
99080
|
+
}
|
|
99055
99081
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
99056
99082
|
const retrievalURI = this.toBaseURI($ref);
|
|
99057
99083
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -99288,7 +99314,6 @@ class AsyncAPI2BundleVisitor {
|
|
|
99288
99314
|
|
|
99289
99315
|
"use strict";
|
|
99290
99316
|
__webpack_require__.r(__webpack_exports__);
|
|
99291
|
-
/* empty/unused harmony star reexport */
|
|
99292
99317
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
99293
99318
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
99294
99319
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3677);
|
|
@@ -99723,6 +99748,10 @@ class OpenAPI2BundleVisitor {
|
|
|
99723
99748
|
* and refraction helpers, so the shared logic is parameterized here.
|
|
99724
99749
|
*/
|
|
99725
99750
|
async bundleReference(path, referencingElement, isSemanticReference, isReferenceLike, refractReferenceFn, label) {
|
|
99751
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
99752
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
99753
|
+
return;
|
|
99754
|
+
}
|
|
99726
99755
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
99727
99756
|
const retrievalURI = this.toBaseURI($ref);
|
|
99728
99757
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -99979,7 +100008,6 @@ class OpenAPI2BundleVisitor {
|
|
|
99979
100008
|
|
|
99980
100009
|
"use strict";
|
|
99981
100010
|
__webpack_require__.r(__webpack_exports__);
|
|
99982
|
-
/* empty/unused harmony star reexport */
|
|
99983
100011
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
99984
100012
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
99985
100013
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
|
|
@@ -100432,6 +100460,11 @@ class OpenAPI3_0BundleVisitor {
|
|
|
100432
100460
|
}
|
|
100433
100461
|
async ReferenceElement(path) {
|
|
100434
100462
|
const referencingElement = path.node;
|
|
100463
|
+
|
|
100464
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
100465
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
100466
|
+
return;
|
|
100467
|
+
}
|
|
100435
100468
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
100436
100469
|
const retrievalURI = this.toBaseURI($ref);
|
|
100437
100470
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -100567,98 +100600,108 @@ class OpenAPI3_0BundleVisitor {
|
|
|
100567
100600
|
* Path Item Object is not a Components Object field in OpenAPI 3.0
|
|
100568
100601
|
* (unlike 3.1 which has `components.pathItems`). An external Path Item
|
|
100569
100602
|
* reference therefore cannot be hoisted; it is inlined in place instead,
|
|
100570
|
-
* after bundling its own external references.
|
|
100603
|
+
* after bundling its own external references. It is inlined on leave, once
|
|
100604
|
+
* the sibling fields of the referencing Path Item have been bundled, so the
|
|
100605
|
+
* traversal doesn't descend into the inlined copy and inline the `$ref` left
|
|
100606
|
+
* in it to break a cycle again.
|
|
100571
100607
|
*/
|
|
100572
|
-
|
|
100573
|
-
|
|
100574
|
-
|
|
100575
|
-
// ignore Path Item Objects without a $ref field
|
|
100576
|
-
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
|
|
100577
|
-
return;
|
|
100578
|
-
}
|
|
100579
|
-
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
|
|
100580
|
-
const retrievalURI = this.toBaseURI($ref);
|
|
100581
|
-
const isInternalReference = this.entryURI === retrievalURI;
|
|
100582
|
-
const isExternalReference = !isInternalReference;
|
|
100583
|
-
if (isInternalReference) {
|
|
100584
|
-
// normalize self-references to a bare fragment so the bundled
|
|
100585
|
-
// document stays transferable; bare fragments are left untouched
|
|
100586
|
-
pathItemElement.set('$ref', this.normalizeSelfReference($ref));
|
|
100587
|
-
return;
|
|
100588
|
-
}
|
|
100589
|
-
|
|
100590
|
-
// honor the resolve.external switch
|
|
100591
|
-
if (!this.options.resolve.external && isExternalReference) {
|
|
100592
|
-
return;
|
|
100593
|
-
}
|
|
100594
|
-
const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
|
|
100595
|
-
const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
100596
|
-
const canonicalKey = `${retrievalURI}#${jsonPointer}`;
|
|
100608
|
+
PathItemElement = {
|
|
100609
|
+
leave: async path => {
|
|
100610
|
+
const pathItemElement = path.node;
|
|
100597
100611
|
|
|
100598
|
-
|
|
100599
|
-
|
|
100600
|
-
|
|
100601
|
-
|
|
100602
|
-
|
|
100603
|
-
|
|
100604
|
-
|
|
100605
|
-
|
|
100606
|
-
|
|
100607
|
-
|
|
100608
|
-
|
|
100609
|
-
|
|
100612
|
+
// ignore Path Item Objects without a $ref field
|
|
100613
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
|
|
100614
|
+
return;
|
|
100615
|
+
}
|
|
100616
|
+
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
|
|
100617
|
+
const retrievalURI = this.toBaseURI($ref);
|
|
100618
|
+
const isInternalReference = this.entryURI === retrievalURI;
|
|
100619
|
+
const isExternalReference = !isInternalReference;
|
|
100620
|
+
if (isInternalReference) {
|
|
100621
|
+
// normalize self-references to a bare fragment so the bundled
|
|
100622
|
+
// document stays transferable; bare fragments are left untouched
|
|
100623
|
+
pathItemElement.set('$ref', this.normalizeSelfReference($ref));
|
|
100624
|
+
return;
|
|
100610
100625
|
}
|
|
100611
|
-
const reference = await this.toReference($ref);
|
|
100612
|
-
let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
|
|
100613
100626
|
|
|
100614
|
-
//
|
|
100615
|
-
if (!
|
|
100616
|
-
|
|
100617
|
-
|
|
100618
|
-
|
|
100619
|
-
|
|
100620
|
-
|
|
100621
|
-
|
|
100622
|
-
|
|
100627
|
+
// honor the resolve.external switch
|
|
100628
|
+
if (!this.options.resolve.external && isExternalReference) {
|
|
100629
|
+
return;
|
|
100630
|
+
}
|
|
100631
|
+
const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
|
|
100632
|
+
const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
100633
|
+
const canonicalKey = `${retrievalURI}#${jsonPointer}`;
|
|
100634
|
+
|
|
100635
|
+
// a circular external Path Item reference cannot be inlined without
|
|
100636
|
+
// recursing forever; leave the $ref in place to break the cycle. It ends
|
|
100637
|
+
// up in the entry document, so it has to resolve from there
|
|
100638
|
+
if (this.inlineStack.has(canonicalKey)) {
|
|
100639
|
+
const targetURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, $ref);
|
|
100640
|
+
if (_util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.entryURI, $ref) !== targetURI) {
|
|
100641
|
+
pathItemElement.set('$ref', _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.relative(this.entryURI, targetURI));
|
|
100623
100642
|
}
|
|
100643
|
+
return;
|
|
100624
100644
|
}
|
|
100625
|
-
|
|
100626
|
-
// own a copy and bundle the external references it contains
|
|
100627
|
-
const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
|
|
100628
|
-
this.inlineStack.add(canonicalKey);
|
|
100629
|
-
const visitor = new OpenAPI3_0BundleVisitor({
|
|
100630
|
-
reference,
|
|
100631
|
-
options: this.options,
|
|
100632
|
-
assignments: this.assignments,
|
|
100633
|
-
reservedNames: this.reservedNames,
|
|
100634
|
-
refractCache: this.refractCache,
|
|
100635
|
-
inlineStack: this.inlineStack
|
|
100636
|
-
});
|
|
100637
|
-
let bundledElement;
|
|
100638
100645
|
try {
|
|
100639
|
-
|
|
100640
|
-
|
|
100646
|
+
// detect maximum depth of bundling
|
|
100647
|
+
if (this.reference.depth >= this.options.bundle.maxDepth) {
|
|
100648
|
+
throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
|
|
100649
|
+
maxDepth: this.options.bundle.maxDepth,
|
|
100650
|
+
uri: this.reference.uri
|
|
100651
|
+
});
|
|
100652
|
+
}
|
|
100653
|
+
const reference = await this.toReference($ref);
|
|
100654
|
+
let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
|
|
100655
|
+
|
|
100656
|
+
// apply Path Item semantics to the referenced fragment
|
|
100657
|
+
if (!(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.isPathItemElement)(referencedElement)) {
|
|
100658
|
+
const cached = this.getRefracted(referencedElement, 'pathItem');
|
|
100659
|
+
if (cached !== undefined) {
|
|
100660
|
+
referencedElement = cached;
|
|
100661
|
+
} else {
|
|
100662
|
+
const sourceElement = referencedElement;
|
|
100663
|
+
referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__.refractPathItem)(referencedElement);
|
|
100664
|
+
this.setRefracted(sourceElement, 'pathItem', referencedElement);
|
|
100665
|
+
}
|
|
100666
|
+
}
|
|
100667
|
+
|
|
100668
|
+
// own a copy and bundle the external references it contains
|
|
100669
|
+
const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
|
|
100670
|
+
this.inlineStack.add(canonicalKey);
|
|
100671
|
+
const visitor = new OpenAPI3_0BundleVisitor({
|
|
100672
|
+
reference,
|
|
100673
|
+
options: this.options,
|
|
100674
|
+
assignments: this.assignments,
|
|
100675
|
+
reservedNames: this.reservedNames,
|
|
100676
|
+
refractCache: this.refractCache,
|
|
100677
|
+
inlineStack: this.inlineStack
|
|
100641
100678
|
});
|
|
100642
|
-
|
|
100643
|
-
|
|
100644
|
-
|
|
100679
|
+
let bundledElement;
|
|
100680
|
+
try {
|
|
100681
|
+
bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(inlinedElement, visitor, {
|
|
100682
|
+
mutable: true
|
|
100683
|
+
});
|
|
100684
|
+
} finally {
|
|
100685
|
+
this.inlineStack.delete(canonicalKey);
|
|
100686
|
+
}
|
|
100645
100687
|
|
|
100646
|
-
|
|
100647
|
-
|
|
100648
|
-
|
|
100649
|
-
|
|
100650
|
-
|
|
100651
|
-
|
|
100652
|
-
|
|
100653
|
-
|
|
100654
|
-
|
|
100655
|
-
|
|
100656
|
-
|
|
100657
|
-
|
|
100658
|
-
|
|
100659
|
-
|
|
100688
|
+
// merge sibling fields from the referencing Path Item over the referenced
|
|
100689
|
+
// one. The referencing `$ref` is being resolved away and is skipped; the
|
|
100690
|
+
// referenced element keeps its own `$ref` if one survived (i.e. it was
|
|
100691
|
+
// left in place to break a circular external Path Item chain).
|
|
100692
|
+
pathItemElement.forEach((_value, keyElement, item) => {
|
|
100693
|
+
const key = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(keyElement);
|
|
100694
|
+
if (key === '$ref') return;
|
|
100695
|
+
bundledElement.remove(key);
|
|
100696
|
+
bundledElement.content.push(item);
|
|
100697
|
+
});
|
|
100698
|
+
bundledElement.meta.set('ref-origin', reference.uri);
|
|
100699
|
+
path.replaceWith(bundledElement);
|
|
100700
|
+
} catch (error) {
|
|
100701
|
+
this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
|
|
100702
|
+
}
|
|
100660
100703
|
}
|
|
100661
|
-
}
|
|
100704
|
+
};
|
|
100662
100705
|
|
|
100663
100706
|
/**
|
|
100664
100707
|
* Example Object `externalValue` points at arbitrary external content that
|
|
@@ -100760,7 +100803,6 @@ class OpenAPI3_0BundleVisitor {
|
|
|
100760
100803
|
|
|
100761
100804
|
"use strict";
|
|
100762
100805
|
__webpack_require__.r(__webpack_exports__);
|
|
100763
|
-
/* empty/unused harmony star reexport */
|
|
100764
100806
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
100765
100807
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
100766
100808
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7822);
|
|
@@ -101319,6 +101361,11 @@ class OpenAPI3_1BundleVisitor {
|
|
|
101319
101361
|
};
|
|
101320
101362
|
async ReferenceElement(path) {
|
|
101321
101363
|
const referencingElement = path.node;
|
|
101364
|
+
|
|
101365
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
101366
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
|
|
101367
|
+
return;
|
|
101368
|
+
}
|
|
101322
101369
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(referencingElement.$ref);
|
|
101323
101370
|
const retrievalURI = this.toBaseURI($ref);
|
|
101324
101371
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -102293,7 +102340,6 @@ class DereferenceStrategy {
|
|
|
102293
102340
|
|
|
102294
102341
|
"use strict";
|
|
102295
102342
|
__webpack_require__.r(__webpack_exports__);
|
|
102296
|
-
/* empty/unused harmony star reexport */
|
|
102297
102343
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
102298
102344
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
102299
102345
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80796);
|
|
@@ -102396,7 +102442,6 @@ class ApiDOMDereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPORT
|
|
|
102396
102442
|
|
|
102397
102443
|
"use strict";
|
|
102398
102444
|
__webpack_require__.r(__webpack_exports__);
|
|
102399
|
-
/* empty/unused harmony star reexport */
|
|
102400
102445
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33031);
|
|
102401
102446
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
102402
102447
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
@@ -102742,13 +102787,6 @@ class ApiDOMDereferenceVisitor {
|
|
|
102742
102787
|
|
|
102743
102788
|
"use strict";
|
|
102744
102789
|
__webpack_require__.r(__webpack_exports__);
|
|
102745
|
-
/* empty/unused harmony star reexport */
|
|
102746
|
-
/* empty/unused harmony star reexport */
|
|
102747
|
-
/* empty/unused harmony star reexport */
|
|
102748
|
-
/* empty/unused harmony star reexport */
|
|
102749
|
-
/* empty/unused harmony star reexport */
|
|
102750
|
-
/* empty/unused harmony star reexport */
|
|
102751
|
-
/* empty/unused harmony star reexport */
|
|
102752
102790
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96911);
|
|
102753
102791
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
102754
102792
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18252);
|
|
@@ -102759,8 +102797,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
102759
102797
|
/* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(82302);
|
|
102760
102798
|
/* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(88526);
|
|
102761
102799
|
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55890);
|
|
102762
|
-
/* harmony import */ var
|
|
102763
|
-
/* harmony import */ var
|
|
102800
|
+
/* harmony import */ var _openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29587);
|
|
102801
|
+
/* harmony import */ var _source_descriptions_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(54553);
|
|
102764
102802
|
|
|
102765
102803
|
|
|
102766
102804
|
|
|
@@ -102824,7 +102862,7 @@ class Arazzo1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPOR
|
|
|
102824
102862
|
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
102825
102863
|
reference,
|
|
102826
102864
|
options,
|
|
102827
|
-
ancestorSchema$ids: (0,
|
|
102865
|
+
ancestorSchema$ids: (0,_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_10__.detachedRootSchema$ids)(refSet.rootRef.value.result)
|
|
102828
102866
|
});
|
|
102829
102867
|
const dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverseAsync)(refSet.rootRef.value, visitor, {
|
|
102830
102868
|
mutable: true,
|
|
@@ -102854,7 +102892,7 @@ class Arazzo1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPOR
|
|
|
102854
102892
|
// drop any existing parse-phase source description results before pushing
|
|
102855
102893
|
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']));
|
|
102856
102894
|
parseResult.content = cleaned.content;
|
|
102857
|
-
const sourceDescriptions = await (0,
|
|
102895
|
+
const sourceDescriptions = await (0,_source_descriptions_mjs__WEBPACK_IMPORTED_MODULE_11__.dereferenceSourceDescriptions)(parseResult, reference.uri, options, this.name);
|
|
102858
102896
|
parseResult.push(...sourceDescriptions);
|
|
102859
102897
|
}
|
|
102860
102898
|
|
|
@@ -103947,7 +103985,6 @@ class Arazzo1DereferenceVisitor {
|
|
|
103947
103985
|
|
|
103948
103986
|
"use strict";
|
|
103949
103987
|
__webpack_require__.r(__webpack_exports__);
|
|
103950
|
-
/* empty/unused harmony star reexport */
|
|
103951
103988
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
103952
103989
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
103953
103990
|
/* harmony import */ var _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46417);
|
|
@@ -104276,6 +104313,11 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
104276
104313
|
async ReferenceElement(path) {
|
|
104277
104314
|
const referencingElement = path.node;
|
|
104278
104315
|
|
|
104316
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
104317
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
104318
|
+
return;
|
|
104319
|
+
}
|
|
104320
|
+
|
|
104279
104321
|
// skip current referencing element as it's already been access
|
|
104280
104322
|
if (this.indirections.includes(referencingElement)) {
|
|
104281
104323
|
path.skip();
|
|
@@ -104605,7 +104647,6 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
104605
104647
|
|
|
104606
104648
|
"use strict";
|
|
104607
104649
|
__webpack_require__.r(__webpack_exports__);
|
|
104608
|
-
/* empty/unused harmony star reexport */
|
|
104609
104650
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
104610
104651
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3677);
|
|
104611
104652
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26365);
|
|
@@ -104938,6 +104979,11 @@ class OpenAPI2DereferenceVisitor {
|
|
|
104938
104979
|
async ReferenceElement(path) {
|
|
104939
104980
|
const referencingElement = path.node;
|
|
104940
104981
|
|
|
104982
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
104983
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
104984
|
+
return;
|
|
104985
|
+
}
|
|
104986
|
+
|
|
104941
104987
|
// skip current referencing element as it's already been access
|
|
104942
104988
|
if (this.indirections.includes(referencingElement)) {
|
|
104943
104989
|
path.skip();
|
|
@@ -105241,6 +105287,11 @@ class OpenAPI2DereferenceVisitor {
|
|
|
105241
105287
|
async JSONReferenceElement(path) {
|
|
105242
105288
|
const referencingElement = path.node;
|
|
105243
105289
|
|
|
105290
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
105291
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
105292
|
+
return;
|
|
105293
|
+
}
|
|
105294
|
+
|
|
105244
105295
|
// skip current referencing element as it's already been access
|
|
105245
105296
|
if (this.indirections.includes(referencingElement)) {
|
|
105246
105297
|
path.skip();
|
|
@@ -105403,7 +105454,6 @@ class OpenAPI2DereferenceVisitor {
|
|
|
105403
105454
|
|
|
105404
105455
|
"use strict";
|
|
105405
105456
|
__webpack_require__.r(__webpack_exports__);
|
|
105406
|
-
/* empty/unused harmony star reexport */
|
|
105407
105457
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
105408
105458
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
105409
105459
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
|
|
@@ -105735,6 +105785,11 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
105735
105785
|
async ReferenceElement(path) {
|
|
105736
105786
|
const referencingElement = path.node;
|
|
105737
105787
|
|
|
105788
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
105789
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
|
|
105790
|
+
return;
|
|
105791
|
+
}
|
|
105792
|
+
|
|
105738
105793
|
// skip current referencing element as it's already been access
|
|
105739
105794
|
if (this.indirections.includes(referencingElement)) {
|
|
105740
105795
|
path.skip();
|
|
@@ -106184,10 +106239,6 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
106184
106239
|
|
|
106185
106240
|
"use strict";
|
|
106186
106241
|
__webpack_require__.r(__webpack_exports__);
|
|
106187
|
-
/* empty/unused harmony star reexport */
|
|
106188
|
-
/* empty/unused harmony star reexport */
|
|
106189
|
-
/* empty/unused harmony star reexport */
|
|
106190
|
-
/* empty/unused harmony star reexport */
|
|
106191
106242
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
|
|
106192
106243
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
106193
106244
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80796);
|
|
@@ -106197,7 +106248,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106197
106248
|
/* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82302);
|
|
106198
106249
|
/* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88526);
|
|
106199
106250
|
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56519);
|
|
106200
|
-
/* harmony import */ var
|
|
106251
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29587);
|
|
106201
106252
|
|
|
106202
106253
|
|
|
106203
106254
|
|
|
@@ -106261,7 +106312,7 @@ class OpenAPI3_1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IM
|
|
|
106261
106312
|
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
106262
106313
|
reference: reference,
|
|
106263
106314
|
options,
|
|
106264
|
-
ancestorSchema$ids: (0,
|
|
106315
|
+
ancestorSchema$ids: (0,_util_mjs__WEBPACK_IMPORTED_MODULE_9__.detachedRootSchema$ids)(refSet.rootRef.value.result)
|
|
106265
106316
|
});
|
|
106266
106317
|
const dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__.traverseAsync)(refSet.rootRef.value, visitor, {
|
|
106267
106318
|
mutable: true,
|
|
@@ -106923,6 +106974,11 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
106923
106974
|
async ReferenceElement(path) {
|
|
106924
106975
|
const referencingElement = path.node;
|
|
106925
106976
|
|
|
106977
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
106978
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(referencingElement.$ref)) {
|
|
106979
|
+
return;
|
|
106980
|
+
}
|
|
106981
|
+
|
|
106926
106982
|
// skip current referencing element as it's already been accessed
|
|
106927
106983
|
if (this.indirections.includes(referencingElement)) {
|
|
106928
106984
|
path.skip();
|
|
@@ -107700,6 +107756,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107700
107756
|
|
|
107701
107757
|
|
|
107702
107758
|
|
|
107759
|
+
const STRATEGY_NAME = 'overlay-1';
|
|
107760
|
+
|
|
107703
107761
|
/**
|
|
107704
107762
|
* Dereferences the `extends` target document from an Overlay document's ParseResult.
|
|
107705
107763
|
*
|
|
@@ -107741,39 +107799,61 @@ async function dereferenceExtends(parseResult, parseResultRetrievalURI, options)
|
|
|
107741
107799
|
const extendsDereferenceResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
107742
107800
|
extendsDereferenceResult.classes.push('extends');
|
|
107743
107801
|
extendsDereferenceResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
107744
|
-
try {
|
|
107745
|
-
let extendsDereferenced;
|
|
107746
107802
|
|
|
107747
|
-
|
|
107748
|
-
|
|
107749
|
-
|
|
107750
|
-
|
|
107751
|
-
|
|
107752
|
-
|
|
107753
|
-
|
|
107754
|
-
},
|
|
107755
|
-
resolve: {
|
|
107756
|
-
baseURI: retrievalURI
|
|
107757
|
-
}
|
|
107758
|
-
}));
|
|
107759
|
-
} else {
|
|
107760
|
-
// no existing parse result - fetch, parse, and dereference
|
|
107761
|
-
extendsDereferenced = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_10__["default"])(retrievalURI, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
107762
|
-
parse: {
|
|
107763
|
-
mediaType: 'text/plain' // allow parser plugin detection
|
|
107803
|
+
// URIs of the Overlays currently being dereferenced, from the root down to the current one
|
|
107804
|
+
const ancestors = [...(options?.dereference?.strategyOpts?.[STRATEGY_NAME]?.extendsAncestors ?? []), file.uri];
|
|
107805
|
+
const nestedOptions = {
|
|
107806
|
+
dereference: {
|
|
107807
|
+
strategyOpts: {
|
|
107808
|
+
[STRATEGY_NAME]: {
|
|
107809
|
+
extendsAncestors: ancestors
|
|
107764
107810
|
}
|
|
107765
|
-
}
|
|
107811
|
+
}
|
|
107766
107812
|
}
|
|
107813
|
+
};
|
|
107767
107814
|
|
|
107768
|
-
|
|
107769
|
-
|
|
107770
|
-
|
|
107771
|
-
|
|
107772
|
-
} catch (error) {
|
|
107773
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
107774
|
-
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Error dereferencing extends target "${retrievalURI}": ${message}`);
|
|
107775
|
-
annotation.classes.push('error');
|
|
107815
|
+
// skip if the target is still being dereferenced higher up the chain (cycle detection)
|
|
107816
|
+
if (ancestors.includes(retrievalURI)) {
|
|
107817
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Extends target "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
107818
|
+
annotation.classes.push('warning');
|
|
107776
107819
|
extendsDereferenceResult.push(annotation);
|
|
107820
|
+
} else {
|
|
107821
|
+
try {
|
|
107822
|
+
let extendsDereferenced;
|
|
107823
|
+
|
|
107824
|
+
// check if extends was already parsed (e.g., during parse phase with extends: true)
|
|
107825
|
+
const existingParseResult = extendsElement.meta.get('parseResult');
|
|
107826
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement)(existingParseResult)) {
|
|
107827
|
+
// use existing parsed result - just dereference it (no re-fetch/re-parse)
|
|
107828
|
+
extendsDereferenced = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_10__.dereferenceApiDOM)(existingParseResult, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
107829
|
+
...nestedOptions,
|
|
107830
|
+
parse: {
|
|
107831
|
+
mediaType: 'text/plain' // allow dereference strategy detection via ApiDOM inspection
|
|
107832
|
+
},
|
|
107833
|
+
resolve: {
|
|
107834
|
+
baseURI: retrievalURI
|
|
107835
|
+
}
|
|
107836
|
+
}));
|
|
107837
|
+
} else {
|
|
107838
|
+
// no existing parse result - fetch, parse, and dereference
|
|
107839
|
+
extendsDereferenced = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_10__["default"])(retrievalURI, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
107840
|
+
...nestedOptions,
|
|
107841
|
+
parse: {
|
|
107842
|
+
mediaType: 'text/plain' // allow parser plugin detection
|
|
107843
|
+
}
|
|
107844
|
+
}));
|
|
107845
|
+
}
|
|
107846
|
+
|
|
107847
|
+
// merge dereferenced result into our wrapper
|
|
107848
|
+
for (const item of extendsDereferenced) {
|
|
107849
|
+
extendsDereferenceResult.push(item);
|
|
107850
|
+
}
|
|
107851
|
+
} catch (error) {
|
|
107852
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
107853
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Error dereferencing extends target "${retrievalURI}": ${message}`);
|
|
107854
|
+
annotation.classes.push('error');
|
|
107855
|
+
extendsDereferenceResult.push(annotation);
|
|
107856
|
+
}
|
|
107777
107857
|
}
|
|
107778
107858
|
|
|
107779
107859
|
// always attach result to extends element meta (even on failure - contains annotations)
|
|
@@ -107792,17 +107872,16 @@ async function dereferenceExtends(parseResult, parseResultRetrievalURI, options)
|
|
|
107792
107872
|
|
|
107793
107873
|
"use strict";
|
|
107794
107874
|
__webpack_require__.r(__webpack_exports__);
|
|
107795
|
-
/*
|
|
107796
|
-
/*
|
|
107797
|
-
/* harmony import */ var
|
|
107798
|
-
/* harmony import */ var
|
|
107799
|
-
/* harmony import */ var
|
|
107800
|
-
/* harmony import */ var
|
|
107801
|
-
/* harmony import */ var
|
|
107802
|
-
/* harmony import */ var
|
|
107803
|
-
/* harmony import */ var
|
|
107804
|
-
/* harmony import */ var
|
|
107805
|
-
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(64595);
|
|
107875
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96911);
|
|
107876
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
107877
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13786);
|
|
107878
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26432);
|
|
107879
|
+
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80796);
|
|
107880
|
+
/* harmony import */ var _DereferenceStrategy_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12993);
|
|
107881
|
+
/* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82302);
|
|
107882
|
+
/* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88526);
|
|
107883
|
+
/* harmony import */ var _extends_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51826);
|
|
107884
|
+
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64595);
|
|
107806
107885
|
|
|
107807
107886
|
|
|
107808
107887
|
|
|
@@ -107817,7 +107896,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107817
107896
|
/**
|
|
107818
107897
|
* @public
|
|
107819
107898
|
*/
|
|
107820
|
-
class Overlay1DereferenceStrategy extends
|
|
107899
|
+
class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPORTED_MODULE_5__["default"] {
|
|
107821
107900
|
constructor(options) {
|
|
107822
107901
|
super({
|
|
107823
107902
|
...(options ?? {}),
|
|
@@ -107827,18 +107906,18 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPO
|
|
|
107827
107906
|
canDereference(file) {
|
|
107828
107907
|
// assert by media type
|
|
107829
107908
|
if (file.mediaType !== 'text/plain') {
|
|
107830
|
-
return
|
|
107909
|
+
return _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
|
|
107831
107910
|
}
|
|
107832
107911
|
|
|
107833
107912
|
// assert by inspecting ApiDOM
|
|
107834
|
-
return (0,
|
|
107913
|
+
return (0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_3__.isOverlay1Element)(file.parseResult?.result);
|
|
107835
107914
|
}
|
|
107836
107915
|
async dereference(file, options) {
|
|
107837
|
-
const immutableRefSet = options.dereference.refSet ?? new
|
|
107838
|
-
const mutableRefSet = new
|
|
107916
|
+
const immutableRefSet = options.dereference.refSet ?? new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
107917
|
+
const mutableRefSet = new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
107839
107918
|
let reference;
|
|
107840
107919
|
if (!immutableRefSet.has(file.uri)) {
|
|
107841
|
-
reference = new
|
|
107920
|
+
reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
107842
107921
|
uri: file.uri,
|
|
107843
107922
|
value: file.parseResult
|
|
107844
107923
|
});
|
|
@@ -107853,39 +107932,51 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPO
|
|
|
107853
107932
|
* We don't want to mutate the original refSet and the references.
|
|
107854
107933
|
*/
|
|
107855
107934
|
if (options.dereference.immutable) {
|
|
107856
|
-
immutableRefSet.refs.map(ref => new
|
|
107935
|
+
immutableRefSet.refs.map(ref => new _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
107857
107936
|
...ref,
|
|
107858
|
-
value: (0,
|
|
107937
|
+
value: (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(ref.value)
|
|
107859
107938
|
})).forEach(ref => mutableRefSet.add(ref));
|
|
107860
107939
|
reference = mutableRefSet.find(ref => ref.uri === file.uri);
|
|
107861
107940
|
}
|
|
107862
|
-
const
|
|
107863
|
-
|
|
107864
|
-
/**
|
|
107865
|
-
* Reusable Action References only occur within `actions`, so the root element is never
|
|
107866
|
-
* replaced and traversing it keeps reported locations relative to the document.
|
|
107867
|
-
*/
|
|
107868
|
-
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
107941
|
+
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
107869
107942
|
reference,
|
|
107870
107943
|
options
|
|
107871
107944
|
});
|
|
107872
|
-
|
|
107873
|
-
|
|
107874
|
-
|
|
107945
|
+
/**
|
|
107946
|
+
* The reference for the dereferenced file is traversed rather than the refSet's root
|
|
107947
|
+
* reference: dereferencing the extends target shares the refSet, whose root is then
|
|
107948
|
+
* the extending Overlay. The reference may hold a lone element.
|
|
107949
|
+
*/
|
|
107950
|
+
let dereferencedElement = reference.value;
|
|
107951
|
+
|
|
107952
|
+
/**
|
|
107953
|
+
* A ParseResult may also carry the extends target parsed in the parse phase, whose
|
|
107954
|
+
* references belong to that document, so only its result is traversed. Reusable Action
|
|
107955
|
+
* References only occur within `actions`, so the result itself is never replaced.
|
|
107956
|
+
*/
|
|
107957
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(dereferencedElement)) {
|
|
107958
|
+
await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__.traverseAsync)(dereferencedElement.result, visitor, {
|
|
107959
|
+
mutable: true
|
|
107960
|
+
});
|
|
107961
|
+
} else {
|
|
107962
|
+
dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__.traverseAsync)(dereferencedElement, visitor, {
|
|
107963
|
+
mutable: true
|
|
107964
|
+
});
|
|
107965
|
+
}
|
|
107875
107966
|
|
|
107876
107967
|
/**
|
|
107877
107968
|
* Dereference extends target if option is enabled.
|
|
107878
107969
|
*/
|
|
107879
107970
|
const shouldDereferenceExtends = options?.dereference?.strategyOpts?.[this.name]?.extends ?? options?.dereference?.strategyOpts?.extends;
|
|
107880
|
-
if (shouldDereferenceExtends) {
|
|
107881
|
-
await (0,
|
|
107971
|
+
if (shouldDereferenceExtends && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(dereferencedElement)) {
|
|
107972
|
+
await (0,_extends_mjs__WEBPACK_IMPORTED_MODULE_8__.dereferenceExtends)(dereferencedElement, reference.uri, options);
|
|
107882
107973
|
}
|
|
107883
107974
|
|
|
107884
107975
|
/**
|
|
107885
107976
|
* If immutable option is set, replay refs from the refSet.
|
|
107886
107977
|
*/
|
|
107887
107978
|
if (options.dereference.immutable) {
|
|
107888
|
-
mutableRefSet.refs.filter(ref => ref.uri.startsWith('immutable://')).map(ref => new
|
|
107979
|
+
mutableRefSet.refs.filter(ref => ref.uri.startsWith('immutable://')).map(ref => new _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
107889
107980
|
...ref,
|
|
107890
107981
|
uri: ref.uri.replace(/^immutable:\/\//, '')
|
|
107891
107982
|
})).forEach(ref => immutableRefSet.add(ref));
|
|
@@ -107917,17 +108008,22 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPO
|
|
|
107917
108008
|
|
|
107918
108009
|
"use strict";
|
|
107919
108010
|
__webpack_require__.r(__webpack_exports__);
|
|
107920
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
107921
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
107922
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
107923
|
-
/* harmony import */ var
|
|
107924
|
-
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
107925
|
-
/* harmony import */ var
|
|
107926
|
-
/* harmony import */ var
|
|
107927
|
-
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
107928
|
-
/* harmony import */ var
|
|
107929
|
-
/* harmony import */ var
|
|
107930
|
-
/* harmony import */ var
|
|
108011
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
108012
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
108013
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18252);
|
|
108014
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25810);
|
|
108015
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44673);
|
|
108016
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16280);
|
|
108017
|
+
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44641);
|
|
108018
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12020);
|
|
108019
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(61198);
|
|
108020
|
+
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80796);
|
|
108021
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26432);
|
|
108022
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(35937);
|
|
108023
|
+
/* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(34968);
|
|
108024
|
+
/* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(18917);
|
|
108025
|
+
|
|
108026
|
+
|
|
107931
108027
|
|
|
107932
108028
|
|
|
107933
108029
|
|
|
@@ -107958,25 +108054,32 @@ class Overlay1DereferenceVisitor {
|
|
|
107958
108054
|
path.skip();
|
|
107959
108055
|
return;
|
|
107960
108056
|
}
|
|
107961
|
-
const $ref = (0,
|
|
107962
|
-
|
|
107963
|
-
|
|
108057
|
+
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(referencingElement.$ref);
|
|
108058
|
+
// the reference may hold a lone element; same-document references resolve against the
|
|
108059
|
+
// document registered in the refSet under the reference's URI without fragment
|
|
108060
|
+
const {
|
|
108061
|
+
refSet
|
|
108062
|
+
} = this.reference;
|
|
108063
|
+
const documentURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_13__.stripHash(this.reference.uri);
|
|
108064
|
+
const documentReference = refSet.find(ref => ref.uri === documentURI) ?? this.reference;
|
|
108065
|
+
const overlayElement = documentReference.value.result;
|
|
108066
|
+
const actionElement = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__.ActionElement();
|
|
107964
108067
|
try {
|
|
107965
108068
|
if (typeof $ref !== 'string') {
|
|
107966
|
-
throw new
|
|
108069
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"]('Reusable Action Reference "$ref" field must be a string');
|
|
107967
108070
|
}
|
|
107968
108071
|
|
|
107969
108072
|
// only `target`, `description` and extensions may accompany `$ref`
|
|
107970
108073
|
const disallowedField = ['update', 'copy', 'remove'].find(field => referencingElement.hasKey(field));
|
|
107971
108074
|
if (disallowedField !== undefined) {
|
|
107972
|
-
throw new
|
|
108075
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" must not define "${disallowedField}"`, {
|
|
107973
108076
|
$ref
|
|
107974
108077
|
});
|
|
107975
108078
|
}
|
|
107976
108079
|
|
|
107977
108080
|
// same-document reference only; external references are not supported
|
|
107978
108081
|
if (!$ref.startsWith('#')) {
|
|
107979
|
-
throw new
|
|
108082
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" must be a same-document reference`, {
|
|
107980
108083
|
$ref
|
|
107981
108084
|
});
|
|
107982
108085
|
}
|
|
@@ -107987,25 +108090,25 @@ class Overlay1DereferenceVisitor {
|
|
|
107987
108090
|
*/
|
|
107988
108091
|
let reusableAction;
|
|
107989
108092
|
try {
|
|
107990
|
-
reusableAction = (0,
|
|
108093
|
+
reusableAction = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__.evaluate)(overlayElement, _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__.URIFragmentIdentifier.from($ref));
|
|
107991
108094
|
} catch {
|
|
107992
108095
|
reusableAction = undefined;
|
|
107993
108096
|
}
|
|
107994
|
-
if (!(0,
|
|
107995
|
-
throw new
|
|
108097
|
+
if (!(0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isReusableActionElement)(reusableAction)) {
|
|
108098
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" cannot be resolved`, {
|
|
107996
108099
|
$ref
|
|
107997
108100
|
});
|
|
107998
108101
|
}
|
|
107999
108102
|
const {
|
|
108000
108103
|
fields
|
|
108001
108104
|
} = reusableAction;
|
|
108002
|
-
if (fields !== undefined && !(0,
|
|
108003
|
-
throw new
|
|
108105
|
+
if (fields !== undefined && !(0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields)) {
|
|
108106
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action "${$ref}" must define "fields" as an object`, {
|
|
108004
108107
|
$ref
|
|
108005
108108
|
});
|
|
108006
108109
|
}
|
|
108007
|
-
if ((0,
|
|
108008
|
-
throw new
|
|
108110
|
+
if ((0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields) && fields.hasKey('target')) {
|
|
108111
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action "${$ref}" must not define "target" in its "fields"`, {
|
|
108009
108112
|
$ref
|
|
108010
108113
|
});
|
|
108011
108114
|
}
|
|
@@ -108016,26 +108119,41 @@ class Overlay1DereferenceVisitor {
|
|
|
108016
108119
|
description
|
|
108017
108120
|
} = referencingElement;
|
|
108018
108121
|
if (target !== undefined) {
|
|
108019
|
-
actionElement.set('target', (0,
|
|
108122
|
+
actionElement.set('target', (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(target));
|
|
108020
108123
|
}
|
|
108021
|
-
if ((0,
|
|
108124
|
+
if ((0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields)) {
|
|
108022
108125
|
fields.forEach((value, keyElement) => {
|
|
108023
|
-
actionElement.set((0,
|
|
108126
|
+
actionElement.set((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(keyElement), (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(value));
|
|
108024
108127
|
});
|
|
108025
108128
|
}
|
|
108026
108129
|
if (description !== undefined) {
|
|
108027
|
-
actionElement.set('description', (0,
|
|
108130
|
+
actionElement.set('description', (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(description));
|
|
108028
108131
|
}
|
|
108029
108132
|
} catch (error) {
|
|
108030
108133
|
const {
|
|
108031
108134
|
continueOnError
|
|
108032
108135
|
} = this.options.dereference;
|
|
108033
|
-
|
|
108136
|
+
|
|
108137
|
+
// find element location by identity in the document tree;
|
|
108138
|
+
// falls back to the visitor path when the document doesn't contain the element
|
|
108139
|
+
let location;
|
|
108140
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(overlayElement)) {
|
|
108141
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverse)(overlayElement, {
|
|
108142
|
+
enter: p => {
|
|
108143
|
+
if (p.node === referencingElement) {
|
|
108144
|
+
location = p.formatPath();
|
|
108145
|
+
p.stop();
|
|
108146
|
+
}
|
|
108147
|
+
}
|
|
108148
|
+
});
|
|
108149
|
+
}
|
|
108150
|
+
location ??= path.formatPath();
|
|
108151
|
+
const unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_12__["default"](`Error while dereferencing Reusable Action Reference "${$ref}": ${error.message}`, {
|
|
108034
108152
|
cause: error,
|
|
108035
108153
|
type: referencingElement.element,
|
|
108036
108154
|
uri: this.reference.uri,
|
|
108037
|
-
location
|
|
108038
|
-
codeFrame: (0,
|
|
108155
|
+
location,
|
|
108156
|
+
codeFrame: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement),
|
|
108039
108157
|
refFieldName: '$ref',
|
|
108040
108158
|
refFieldValue: $ref,
|
|
108041
108159
|
trace: []
|
|
@@ -108047,14 +108165,14 @@ class Overlay1DereferenceVisitor {
|
|
|
108047
108165
|
}
|
|
108048
108166
|
|
|
108049
108167
|
// the action takes the place of the reference in `actions`, so it inherits its source position
|
|
108050
|
-
if ((0,
|
|
108051
|
-
|
|
108168
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap)(referencingElement)) {
|
|
108169
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(referencingElement, actionElement);
|
|
108052
108170
|
}
|
|
108053
108171
|
|
|
108054
108172
|
// annotate with info about original referencing element
|
|
108055
108173
|
actionElement.meta.set('ref-fields', {
|
|
108056
108174
|
$ref,
|
|
108057
|
-
description: (0,
|
|
108175
|
+
description: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(referencingElement.description)
|
|
108058
108176
|
});
|
|
108059
108177
|
// annotate with info about origin
|
|
108060
108178
|
actionElement.meta.set('ref-origin', this.reference.uri);
|
|
@@ -109300,7 +109418,6 @@ class ApiDOMJSONParser extends _Parser_mjs__WEBPACK_IMPORTED_MODULE_4__["default
|
|
|
109300
109418
|
|
|
109301
109419
|
"use strict";
|
|
109302
109420
|
__webpack_require__.r(__webpack_exports__);
|
|
109303
|
-
/* empty/unused harmony star reexport */
|
|
109304
109421
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
109305
109422
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6017);
|
|
109306
109423
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29028);
|
|
@@ -109611,7 +109728,6 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
109611
109728
|
|
|
109612
109729
|
"use strict";
|
|
109613
109730
|
__webpack_require__.r(__webpack_exports__);
|
|
109614
|
-
/* empty/unused harmony star reexport */
|
|
109615
109731
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
109616
109732
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16206);
|
|
109617
109733
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43195);
|
|
@@ -110374,6 +110490,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
110374
110490
|
|
|
110375
110491
|
|
|
110376
110492
|
|
|
110493
|
+
// shared key for recursion state (works across JSON/YAML parsers)
|
|
110494
|
+
const OVERLAY_RECURSION_KEY = 'overlay-1';
|
|
110377
110495
|
|
|
110378
110496
|
/**
|
|
110379
110497
|
* Parses the `extends` target document from an Overlay document's ParseResult.
|
|
@@ -110411,21 +110529,38 @@ async function parseExtends(parseResult, parseResultRetrievalURI, options) {
|
|
|
110411
110529
|
const extendsParseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
110412
110530
|
extendsParseResult.classes.push('extends');
|
|
110413
110531
|
extendsParseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
110414
|
-
|
|
110415
|
-
|
|
110416
|
-
|
|
110417
|
-
|
|
110532
|
+
|
|
110533
|
+
// URIs of the Overlays currently being parsed, from the root down to the current one
|
|
110534
|
+
const ancestors = [...(options?.parse?.parserOpts?.[OVERLAY_RECURSION_KEY]?.extendsAncestors ?? []), file.uri];
|
|
110535
|
+
|
|
110536
|
+
// skip if the target is still being parsed higher up the chain (cycle detection)
|
|
110537
|
+
if (ancestors.includes(retrievalURI)) {
|
|
110538
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Extends target "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
110539
|
+
annotation.classes.push('warning');
|
|
110540
|
+
extendsParseResult.push(annotation);
|
|
110541
|
+
} else {
|
|
110542
|
+
try {
|
|
110543
|
+
const targetParseResult = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_8__["default"])(retrievalURI, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_7__.merge)(options, {
|
|
110544
|
+
parse: {
|
|
110545
|
+
mediaType: 'text/plain',
|
|
110546
|
+
// force auto-detection
|
|
110547
|
+
parserOpts: {
|
|
110548
|
+
[OVERLAY_RECURSION_KEY]: {
|
|
110549
|
+
extendsAncestors: ancestors
|
|
110550
|
+
}
|
|
110551
|
+
}
|
|
110552
|
+
}
|
|
110553
|
+
}));
|
|
110554
|
+
// merge parsed result into our wrapper
|
|
110555
|
+
for (const item of targetParseResult) {
|
|
110556
|
+
extendsParseResult.push(item);
|
|
110418
110557
|
}
|
|
110419
|
-
})
|
|
110420
|
-
|
|
110421
|
-
|
|
110422
|
-
|
|
110558
|
+
} catch (error) {
|
|
110559
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
110560
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Error parsing extends target "${retrievalURI}": ${message}`);
|
|
110561
|
+
annotation.classes.push('error');
|
|
110562
|
+
extendsParseResult.push(annotation);
|
|
110423
110563
|
}
|
|
110424
|
-
} catch (error) {
|
|
110425
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
110426
|
-
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Error parsing extends target "${retrievalURI}": ${message}`);
|
|
110427
|
-
annotation.classes.push('error');
|
|
110428
|
-
extendsParseResult.push(annotation);
|
|
110429
110564
|
}
|
|
110430
110565
|
|
|
110431
110566
|
// always attach result to extends element meta (even on failure - contains annotations)
|
|
@@ -110440,7 +110575,6 @@ async function parseExtends(parseResult, parseResultRetrievalURI, options) {
|
|
|
110440
110575
|
|
|
110441
110576
|
"use strict";
|
|
110442
110577
|
__webpack_require__.r(__webpack_exports__);
|
|
110443
|
-
/* empty/unused harmony star reexport */
|
|
110444
110578
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
110445
110579
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_json_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85086);
|
|
110446
110580
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_json_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54827);
|
|
@@ -110522,7 +110656,6 @@ class OverlayJSON1Parser extends _Parser_mjs__WEBPACK_IMPORTED_MODULE_4__["defau
|
|
|
110522
110656
|
|
|
110523
110657
|
"use strict";
|
|
110524
110658
|
__webpack_require__.r(__webpack_exports__);
|
|
110525
|
-
/* empty/unused harmony star reexport */
|
|
110526
110659
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
110527
110660
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_yaml_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98585);
|
|
110528
110661
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_yaml_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83004);
|