@speclynx/apidom-overlay 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/apidom-overlay.browser.js +467 -337
- 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(' ');
|
|
@@ -45399,11 +45419,10 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
45399
45419
|
|
|
45400
45420
|
"use strict";
|
|
45401
45421
|
__webpack_require__.r(__webpack_exports__);
|
|
45402
|
-
/* empty/unused harmony star reexport */
|
|
45403
45422
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
45404
45423
|
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51844);
|
|
45405
|
-
/* harmony import */ var
|
|
45406
|
-
/* harmony import */ var
|
|
45424
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
45425
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38504);
|
|
45407
45426
|
|
|
45408
45427
|
|
|
45409
45428
|
|
|
@@ -45573,13 +45592,13 @@ class Element {
|
|
|
45573
45592
|
}
|
|
45574
45593
|
|
|
45575
45594
|
// KeyValuePair
|
|
45576
|
-
if (value instanceof
|
|
45595
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
45577
45596
|
this._content = value;
|
|
45578
45597
|
return;
|
|
45579
45598
|
}
|
|
45580
45599
|
|
|
45581
45600
|
// ObjectSlice - extract elements array
|
|
45582
|
-
if (value instanceof
|
|
45601
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
45583
45602
|
this._content = value.elements;
|
|
45584
45603
|
return;
|
|
45585
45604
|
}
|
|
@@ -45698,7 +45717,7 @@ class Element {
|
|
|
45698
45717
|
if (Array.isArray(content)) {
|
|
45699
45718
|
return content;
|
|
45700
45719
|
}
|
|
45701
|
-
if (content instanceof
|
|
45720
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
45702
45721
|
const children = [];
|
|
45703
45722
|
if (content.key) children.push(content.key);
|
|
45704
45723
|
if (content.value) children.push(content.value);
|
|
@@ -45762,7 +45781,7 @@ class Element {
|
|
|
45762
45781
|
if (_content instanceof Element) {
|
|
45763
45782
|
return _content.toValue();
|
|
45764
45783
|
}
|
|
45765
|
-
if (_content instanceof
|
|
45784
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
45766
45785
|
return _content.toValue();
|
|
45767
45786
|
}
|
|
45768
45787
|
if (Array.isArray(_content)) {
|
|
@@ -46858,14 +46877,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46858
46877
|
/* harmony export */ parse: () => (/* reexport safe */ _swaggerexpert_jsonpath__WEBPACK_IMPORTED_MODULE_0__.parse),
|
|
46859
46878
|
/* harmony export */ test: () => (/* reexport safe */ _swaggerexpert_jsonpath__WEBPACK_IMPORTED_MODULE_0__.test)
|
|
46860
46879
|
/* harmony export */ });
|
|
46861
|
-
/* empty/unused harmony star reexport */
|
|
46862
46880
|
/* harmony import */ var _swaggerexpert_jsonpath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84637);
|
|
46863
|
-
/* harmony import */ var
|
|
46881
|
+
/* harmony import */ var _realm_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84925);
|
|
46864
46882
|
|
|
46865
46883
|
|
|
46866
46884
|
|
|
46867
46885
|
|
|
46868
|
-
const realm = new
|
|
46886
|
+
const realm = new _realm_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
46869
46887
|
|
|
46870
46888
|
/**
|
|
46871
46889
|
* Options for ApiDOM JSONPath evaluation.
|
|
@@ -47100,14 +47118,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47100
47118
|
/* harmony export */ testReferenceToken: () => (/* reexport safe */ _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.testReferenceToken),
|
|
47101
47119
|
/* harmony export */ unescape: () => (/* reexport safe */ _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.unescape)
|
|
47102
47120
|
/* harmony export */ });
|
|
47103
|
-
/* empty/unused harmony star reexport */
|
|
47104
47121
|
/* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61198);
|
|
47105
|
-
/* harmony import */ var
|
|
47122
|
+
/* harmony import */ var _realm_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60545);
|
|
47106
47123
|
|
|
47107
47124
|
|
|
47108
47125
|
|
|
47109
47126
|
|
|
47110
|
-
const realm = new
|
|
47127
|
+
const realm = new _realm_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
47111
47128
|
|
|
47112
47129
|
/**
|
|
47113
47130
|
* @public
|
|
@@ -78044,25 +78061,24 @@ class AllOfVisitor extends JSONSchemaAllOfVisitor {
|
|
|
78044
78061
|
|
|
78045
78062
|
"use strict";
|
|
78046
78063
|
__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);
|
|
78064
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86059);
|
|
78065
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26207);
|
|
78050
78066
|
|
|
78051
78067
|
|
|
78052
78068
|
|
|
78053
78069
|
/**
|
|
78054
78070
|
* @public
|
|
78055
78071
|
*/
|
|
78056
|
-
class ItemsVisitor extends
|
|
78072
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
78057
78073
|
ObjectElement(path) {
|
|
78058
|
-
|
|
78059
|
-
if ((0,
|
|
78074
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ObjectElement.call(this, path);
|
|
78075
|
+
if ((0,_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)(this.element)) {
|
|
78060
78076
|
this.element.meta.set('referenced-element', 'schema');
|
|
78061
78077
|
}
|
|
78062
78078
|
}
|
|
78063
78079
|
ArrayElement(path) {
|
|
78064
|
-
|
|
78065
|
-
this.element.filter(
|
|
78080
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_1__["default"].prototype.ArrayElement.call(this, path);
|
|
78081
|
+
this.element.filter(_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__.isJSONReferenceElement)
|
|
78066
78082
|
// @ts-ignore
|
|
78067
78083
|
.forEach(referenceElement => {
|
|
78068
78084
|
referenceElement.meta.set('referenced-element', 'schema');
|
|
@@ -86326,9 +86342,8 @@ class AnyOfVisitor extends JSONSchemaAnyOfVisitor {
|
|
|
86326
86342
|
|
|
86327
86343
|
"use strict";
|
|
86328
86344
|
__webpack_require__.r(__webpack_exports__);
|
|
86329
|
-
/*
|
|
86330
|
-
/* harmony import */ var
|
|
86331
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32131);
|
|
86345
|
+
/* harmony import */ var _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26207);
|
|
86346
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32131);
|
|
86332
86347
|
|
|
86333
86348
|
|
|
86334
86349
|
|
|
@@ -86336,10 +86351,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86336
86351
|
/**
|
|
86337
86352
|
* @public
|
|
86338
86353
|
*/
|
|
86339
|
-
class ItemsVisitor extends
|
|
86354
|
+
class ItemsVisitor extends _speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
86340
86355
|
ObjectElement(path) {
|
|
86341
|
-
|
|
86342
|
-
if ((0,
|
|
86356
|
+
_speclynx_apidom_ns_json_schema_draft_4__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement.call(this, path);
|
|
86357
|
+
if ((0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_1__.isReferenceElement)(this.element)) {
|
|
86343
86358
|
this.element.meta.set('referenced-element', 'schema');
|
|
86344
86359
|
}
|
|
86345
86360
|
}
|
|
@@ -93043,15 +93058,13 @@ const yamlMediaTypes = new _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODU
|
|
|
93043
93058
|
"use strict";
|
|
93044
93059
|
__webpack_require__.r(__webpack_exports__);
|
|
93045
93060
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
93046
|
-
/* harmony export */ mediaTypes: () => (/* reexport safe */
|
|
93061
|
+
/* harmony export */ mediaTypes: () => (/* reexport safe */ _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])
|
|
93047
93062
|
/* harmony export */ });
|
|
93048
|
-
/* empty/unused harmony star reexport */
|
|
93049
|
-
/* empty/unused harmony star reexport */
|
|
93050
93063
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
93051
93064
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
93052
93065
|
/* harmony import */ var _native_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38600);
|
|
93053
93066
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34885);
|
|
93054
|
-
/* harmony import */ var
|
|
93067
|
+
/* harmony import */ var _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49968);
|
|
93055
93068
|
|
|
93056
93069
|
|
|
93057
93070
|
|
|
@@ -93207,10 +93220,8 @@ const parse = async source => {
|
|
|
93207
93220
|
|
|
93208
93221
|
"use strict";
|
|
93209
93222
|
__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);
|
|
93223
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19305);
|
|
93224
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13615);
|
|
93214
93225
|
|
|
93215
93226
|
|
|
93216
93227
|
|
|
@@ -93231,7 +93242,7 @@ const detect = async source => {
|
|
|
93231
93242
|
}
|
|
93232
93243
|
let cst = null;
|
|
93233
93244
|
try {
|
|
93234
|
-
cst = await (0,
|
|
93245
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
93235
93246
|
return cst.rootNode.type !== 'ERROR';
|
|
93236
93247
|
} catch {
|
|
93237
93248
|
return false;
|
|
@@ -93251,9 +93262,9 @@ const parse = async (source, {
|
|
|
93251
93262
|
sourceMap = false,
|
|
93252
93263
|
style = false
|
|
93253
93264
|
} = {}) => {
|
|
93254
|
-
const cst = await (0,
|
|
93265
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
93255
93266
|
try {
|
|
93256
|
-
return (0,
|
|
93267
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
93257
93268
|
sourceMap,
|
|
93258
93269
|
style
|
|
93259
93270
|
});
|
|
@@ -94352,15 +94363,13 @@ const yamlMediaTypes = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODUL
|
|
|
94352
94363
|
"use strict";
|
|
94353
94364
|
__webpack_require__.r(__webpack_exports__);
|
|
94354
94365
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
94355
|
-
/* harmony export */ mediaTypes: () => (/* reexport safe */
|
|
94366
|
+
/* harmony export */ mediaTypes: () => (/* reexport safe */ _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])
|
|
94356
94367
|
/* harmony export */ });
|
|
94357
|
-
/* empty/unused harmony star reexport */
|
|
94358
|
-
/* empty/unused harmony star reexport */
|
|
94359
94368
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
94360
94369
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
94361
94370
|
/* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
|
|
94362
94371
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
|
|
94363
|
-
/* harmony import */ var
|
|
94372
|
+
/* harmony import */ var _media_types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16688);
|
|
94364
94373
|
|
|
94365
94374
|
|
|
94366
94375
|
|
|
@@ -94463,10 +94472,8 @@ const mediaTypes = new YamlMediaTypes('text/yaml', 'application/yaml');
|
|
|
94463
94472
|
|
|
94464
94473
|
"use strict";
|
|
94465
94474
|
__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);
|
|
94475
|
+
/* harmony import */ var _lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47657);
|
|
94476
|
+
/* harmony import */ var _syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67919);
|
|
94470
94477
|
|
|
94471
94478
|
|
|
94472
94479
|
|
|
@@ -94477,7 +94484,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
94477
94484
|
const detect = async source => {
|
|
94478
94485
|
let cst = null;
|
|
94479
94486
|
try {
|
|
94480
|
-
cst = await (0,
|
|
94487
|
+
cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
94481
94488
|
return !cst.rootNode.isError;
|
|
94482
94489
|
} catch {
|
|
94483
94490
|
return false;
|
|
@@ -94497,9 +94504,9 @@ const parse = async (source, {
|
|
|
94497
94504
|
sourceMap = false,
|
|
94498
94505
|
style = false
|
|
94499
94506
|
} = {}) => {
|
|
94500
|
-
const cst = await (0,
|
|
94507
|
+
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
94501
94508
|
try {
|
|
94502
|
-
return (0,
|
|
94509
|
+
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
94503
94510
|
sourceMap,
|
|
94504
94511
|
style
|
|
94505
94512
|
});
|
|
@@ -95405,15 +95412,19 @@ const transformCstToYamlAst = (cursor, ctx) => {
|
|
|
95405
95412
|
__webpack_require__.r(__webpack_exports__);
|
|
95406
95413
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
95407
95414
|
/* 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
|
|
95415
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55297);
|
|
95416
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28121);
|
|
95417
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18252);
|
|
95418
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97601);
|
|
95419
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31770);
|
|
95420
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97071);
|
|
95421
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84660);
|
|
95422
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40094);
|
|
95423
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4823);
|
|
95424
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(25810);
|
|
95425
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(49686);
|
|
95426
|
+
/* harmony import */ var _ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(90594);
|
|
95427
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21544);
|
|
95417
95428
|
|
|
95418
95429
|
|
|
95419
95430
|
// Transform context passed through transformation
|
|
@@ -95423,7 +95434,7 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
95423
95434
|
if (!ctx.sourceMap) {
|
|
95424
95435
|
return;
|
|
95425
95436
|
}
|
|
95426
|
-
|
|
95437
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(node, element);
|
|
95427
95438
|
};
|
|
95428
95439
|
|
|
95429
95440
|
// find the first descendant matching a type path through the AST
|
|
@@ -95441,7 +95452,7 @@ const findFirst = (node, path) => {
|
|
|
95441
95452
|
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
95442
95453
|
const detectIndent = node => {
|
|
95443
95454
|
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
95444
|
-
if (nested?.styleGroup ===
|
|
95455
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
95445
95456
|
return nested.startCharacter;
|
|
95446
95457
|
}
|
|
95447
95458
|
return 2;
|
|
@@ -95573,7 +95584,7 @@ const buildYamlStyle = (node, ctx, extras) => {
|
|
|
95573
95584
|
// an untagged node has the non-specific tag '?' when it's a plain scalar and '!' otherwise
|
|
95574
95585
|
// (YAML 1.2 §6.9.1); an explicit '!' on any other node means the same as no tag
|
|
95575
95586
|
const tag = node.tag?.explicitName;
|
|
95576
|
-
if (tag !== undefined && tag !== (node.style ===
|
|
95587
|
+
if (tag !== undefined && tag !== (node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain ? '?' : '!')) {
|
|
95577
95588
|
yamlStyle.tag = tag;
|
|
95578
95589
|
}
|
|
95579
95590
|
// the anchor's name, without the & indicator
|
|
@@ -95687,17 +95698,17 @@ const collectStreamComments = node => {
|
|
|
95687
95698
|
if (!root) comments.before.push(text);else if (comment.startLine === root.endLine) comments.inline.push(text);else comments.after.push(text);
|
|
95688
95699
|
};
|
|
95689
95700
|
for (const child of node.children) {
|
|
95690
|
-
if ((0,
|
|
95701
|
+
if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isDocument)(child)) {
|
|
95691
95702
|
if (root) break;
|
|
95692
95703
|
// comments after an explicit document start (---) or before an explicit document end (...)
|
|
95693
95704
|
// are the document's own children, around its root node
|
|
95694
95705
|
const children = child.children || [];
|
|
95695
|
-
const rootIndex = children.findIndex(c => !(0,
|
|
95706
|
+
const rootIndex = children.findIndex(c => !(0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(c));
|
|
95696
95707
|
if (rootIndex === -1) break;
|
|
95697
|
-
children.slice(0, rootIndex).filter(
|
|
95708
|
+
children.slice(0, rootIndex).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
95698
95709
|
root = children[rootIndex];
|
|
95699
|
-
children.slice(rootIndex + 1).filter(
|
|
95700
|
-
} else if ((0,
|
|
95710
|
+
children.slice(rootIndex + 1).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
95711
|
+
} else if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(child)) {
|
|
95701
95712
|
collect(child);
|
|
95702
95713
|
}
|
|
95703
95714
|
}
|
|
@@ -95710,7 +95721,7 @@ const transformStream = (node, ctx) => {
|
|
|
95710
95721
|
if (ctx.style) {
|
|
95711
95722
|
ctx.indent = detectIndent(node);
|
|
95712
95723
|
}
|
|
95713
|
-
const element = new
|
|
95724
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95714
95725
|
|
|
95715
95726
|
// Transform all children
|
|
95716
95727
|
const children = transformChildren(node.children || [], ctx);
|
|
@@ -95770,7 +95781,7 @@ const transformDocument = (node, ctx) => {
|
|
|
95770
95781
|
const shouldSkipVisitingMoreDocuments = ctx.processedDocumentCount >= 1;
|
|
95771
95782
|
if (shouldWarnAboutMoreDocuments) {
|
|
95772
95783
|
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
95773
|
-
const element = new
|
|
95784
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95774
95785
|
element.classes.push('warning');
|
|
95775
95786
|
maybeAddSourceMap(node, element, ctx);
|
|
95776
95787
|
ctx.annotations.push(element);
|
|
@@ -95789,7 +95800,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
95789
95800
|
const typedNode = node;
|
|
95790
95801
|
const children = node.children || [];
|
|
95791
95802
|
if (ctx.style) {
|
|
95792
|
-
if (ctx.flowCollectionPadding === null && node.styleGroup ===
|
|
95803
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Flow) {
|
|
95793
95804
|
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
95794
95805
|
}
|
|
95795
95806
|
const comments = collectComments(children, typedNode.startCharacter);
|
|
@@ -95800,7 +95811,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
95800
95811
|
element.style = buildYamlStyle(node, ctx, {
|
|
95801
95812
|
comment: comments.trailing,
|
|
95802
95813
|
// a single pair written directly in a flow sequence (e.g. [a: 1])
|
|
95803
|
-
singlePair: node.style ===
|
|
95814
|
+
singlePair: node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.SinglePair || undefined
|
|
95804
95815
|
});
|
|
95805
95816
|
if (comments.outOfScope.length > 0) {
|
|
95806
95817
|
ctx.promotedComments.push(...comments.outOfScope);
|
|
@@ -95813,14 +95824,14 @@ const transformCollection = (element, node, ctx) => {
|
|
|
95813
95824
|
|
|
95814
95825
|
// Mapping: Transforms to ObjectElement
|
|
95815
95826
|
const transformMapping = (node, ctx) => {
|
|
95816
|
-
const element = new
|
|
95827
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
95817
95828
|
transformCollection(element, node, ctx);
|
|
95818
95829
|
return element;
|
|
95819
95830
|
};
|
|
95820
95831
|
|
|
95821
95832
|
// KeyValuePair: Transforms to MemberElement
|
|
95822
95833
|
const transformKeyValuePair = (node, ctx) => {
|
|
95823
|
-
const element = new
|
|
95834
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
95824
95835
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95825
95836
|
const {
|
|
95826
95837
|
key,
|
|
@@ -95831,15 +95842,25 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
95831
95842
|
styleGroup,
|
|
95832
95843
|
startCharacter
|
|
95833
95844
|
} = value;
|
|
95834
|
-
if (styleGroup ===
|
|
95845
|
+
if (styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block) {
|
|
95835
95846
|
ctx.indentSeq = startCharacter > node.startCharacter;
|
|
95836
95847
|
}
|
|
95837
95848
|
}
|
|
95838
95849
|
|
|
95839
95850
|
// Transform key and value (these are dynamically defined properties)
|
|
95840
|
-
|
|
95851
|
+
let keyResult = transform(key, ctx);
|
|
95841
95852
|
const valueResult = transform(value, ctx);
|
|
95842
95853
|
|
|
95854
|
+
// an empty key is a null in YAML, but a JavaScript property name can't be null, so it's the empty
|
|
95855
|
+
// string it's named by, marked as an empty key
|
|
95856
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(keyResult) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(keyResult, ['yaml-e-node'])) {
|
|
95857
|
+
const emptyKey = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]('', keyResult.meta, keyResult.attributes);
|
|
95858
|
+
emptyKey.classes.push('yaml-e-key');
|
|
95859
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(keyResult, emptyKey);
|
|
95860
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__["default"].transfer(keyResult, emptyKey);
|
|
95861
|
+
keyResult = emptyKey;
|
|
95862
|
+
}
|
|
95863
|
+
|
|
95843
95864
|
// @ts-ignore
|
|
95844
95865
|
element.content.key = keyResult;
|
|
95845
95866
|
// @ts-ignore
|
|
@@ -95859,19 +95880,18 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
95859
95880
|
|
|
95860
95881
|
// Sequence: Transforms to ArrayElement
|
|
95861
95882
|
const transformSequence = (node, ctx) => {
|
|
95862
|
-
const element = new
|
|
95883
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"]();
|
|
95863
95884
|
transformCollection(element, node, ctx);
|
|
95864
95885
|
return element;
|
|
95865
95886
|
};
|
|
95866
95887
|
|
|
95867
95888
|
// Scalar: Converts to Element via namespace
|
|
95868
95889
|
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)
|
|
95890
|
+
// an empty node (YAML 1.2 §7.2) is a null unless a tag other than the null tag makes it
|
|
95891
|
+
// something else (e.g. !!str makes it an empty string); its classes tell it from an explicit null
|
|
95873
95892
|
const tag = node.tag?.explicitName;
|
|
95874
|
-
const isEmptyNode = node.content === '' && node.style ===
|
|
95893
|
+
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);
|
|
95894
|
+
const element = isEmptyNode ? new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]() : ctx.namespace.toElement(node.content);
|
|
95875
95895
|
if (isEmptyNode) {
|
|
95876
95896
|
element.classes.push('yaml-e-node');
|
|
95877
95897
|
element.classes.push('yaml-e-scalar');
|
|
@@ -95899,7 +95919,7 @@ const transformComment = (node, ctx) => {
|
|
|
95899
95919
|
// Only interested in stream comments before the first document
|
|
95900
95920
|
if (isStreamComment) {
|
|
95901
95921
|
// @ts-ignore
|
|
95902
|
-
const element = new
|
|
95922
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__["default"](node.content);
|
|
95903
95923
|
maybeAddSourceMap(node, element, ctx);
|
|
95904
95924
|
return element;
|
|
95905
95925
|
}
|
|
@@ -95910,7 +95930,7 @@ const transformComment = (node, ctx) => {
|
|
|
95910
95930
|
const transformLiteral = (node, ctx) => {
|
|
95911
95931
|
if (node.isMissing) {
|
|
95912
95932
|
const message = `(Missing ${node.value})`;
|
|
95913
|
-
const element = new
|
|
95933
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95914
95934
|
element.classes.push('warning');
|
|
95915
95935
|
maybeAddSourceMap(node, element, ctx);
|
|
95916
95936
|
ctx.annotations.push(element);
|
|
@@ -95921,7 +95941,7 @@ const transformLiteral = (node, ctx) => {
|
|
|
95921
95941
|
// Error as annotation (used by keyValuePair)
|
|
95922
95942
|
const transformErrorAsAnnotation = (node, ctx) => {
|
|
95923
95943
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
95924
|
-
const element = new
|
|
95944
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95925
95945
|
element.classes.push('error');
|
|
95926
95946
|
maybeAddSourceMap(node, element, ctx);
|
|
95927
95947
|
ctx.annotations.push(element);
|
|
@@ -95930,7 +95950,7 @@ const transformErrorAsAnnotation = (node, ctx) => {
|
|
|
95930
95950
|
// Error: Creates error annotation (adds to annotations array)
|
|
95931
95951
|
const transformError = (node, ctx) => {
|
|
95932
95952
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
95933
|
-
const element = new
|
|
95953
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95934
95954
|
element.classes.push('error');
|
|
95935
95955
|
maybeAddSourceMap(node, element, ctx);
|
|
95936
95956
|
ctx.annotations.push(element);
|
|
@@ -95940,10 +95960,10 @@ const transformError = (node, ctx) => {
|
|
|
95940
95960
|
// Error at root level: Creates ParseResultElement with error annotation
|
|
95941
95961
|
const transformRootError = (node, ctx) => {
|
|
95942
95962
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
95943
|
-
const element = new
|
|
95963
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
95944
95964
|
element.classes.push('error');
|
|
95945
95965
|
maybeAddSourceMap(node, element, ctx);
|
|
95946
|
-
const parseResultElement = new
|
|
95966
|
+
const parseResultElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95947
95967
|
parseResultElement.push(element);
|
|
95948
95968
|
return parseResultElement;
|
|
95949
95969
|
};
|
|
@@ -95970,7 +95990,7 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
95970
95990
|
|
|
95971
95991
|
// Handle empty parse result
|
|
95972
95992
|
if (!rootNode) {
|
|
95973
|
-
return new
|
|
95993
|
+
return new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95974
95994
|
}
|
|
95975
95995
|
|
|
95976
95996
|
// Handle root-level error (no valid stream, just an error node)
|
|
@@ -95980,12 +96000,12 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
95980
96000
|
const result = transform(rootNode, ctx);
|
|
95981
96001
|
|
|
95982
96002
|
// Result should be a ParseResultElement from transformStream
|
|
95983
|
-
if (result instanceof
|
|
96003
|
+
if (result instanceof _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]) {
|
|
95984
96004
|
return result;
|
|
95985
96005
|
}
|
|
95986
96006
|
|
|
95987
96007
|
// Fallback: wrap in ParseResultElement
|
|
95988
|
-
const parseResult = new
|
|
96008
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
95989
96009
|
if (result !== null) {
|
|
95990
96010
|
if (Array.isArray(result)) {
|
|
95991
96011
|
result.forEach(el => parseResult.push(el));
|
|
@@ -97926,7 +97946,6 @@ class BundleStrategy {
|
|
|
97926
97946
|
|
|
97927
97947
|
"use strict";
|
|
97928
97948
|
__webpack_require__.r(__webpack_exports__);
|
|
97929
|
-
/* empty/unused harmony star reexport */
|
|
97930
97949
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
97931
97950
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
97932
97951
|
/* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53787);
|
|
@@ -98574,7 +98593,6 @@ class Arazzo1BundleVisitor {
|
|
|
98574
98593
|
|
|
98575
98594
|
"use strict";
|
|
98576
98595
|
__webpack_require__.r(__webpack_exports__);
|
|
98577
|
-
/* empty/unused harmony star reexport */
|
|
98578
98596
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
98579
98597
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
98580
98598
|
/* harmony import */ var _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46417);
|
|
@@ -99052,6 +99070,11 @@ class AsyncAPI2BundleVisitor {
|
|
|
99052
99070
|
}
|
|
99053
99071
|
async ReferenceElement(path) {
|
|
99054
99072
|
const referencingElement = path.node;
|
|
99073
|
+
|
|
99074
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
99075
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
99076
|
+
return;
|
|
99077
|
+
}
|
|
99055
99078
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
99056
99079
|
const retrievalURI = this.toBaseURI($ref);
|
|
99057
99080
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -99288,7 +99311,6 @@ class AsyncAPI2BundleVisitor {
|
|
|
99288
99311
|
|
|
99289
99312
|
"use strict";
|
|
99290
99313
|
__webpack_require__.r(__webpack_exports__);
|
|
99291
|
-
/* empty/unused harmony star reexport */
|
|
99292
99314
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
99293
99315
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
99294
99316
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3677);
|
|
@@ -99723,6 +99745,10 @@ class OpenAPI2BundleVisitor {
|
|
|
99723
99745
|
* and refraction helpers, so the shared logic is parameterized here.
|
|
99724
99746
|
*/
|
|
99725
99747
|
async bundleReference(path, referencingElement, isSemanticReference, isReferenceLike, refractReferenceFn, label) {
|
|
99748
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
99749
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
99750
|
+
return;
|
|
99751
|
+
}
|
|
99726
99752
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
99727
99753
|
const retrievalURI = this.toBaseURI($ref);
|
|
99728
99754
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -99979,7 +100005,6 @@ class OpenAPI2BundleVisitor {
|
|
|
99979
100005
|
|
|
99980
100006
|
"use strict";
|
|
99981
100007
|
__webpack_require__.r(__webpack_exports__);
|
|
99982
|
-
/* empty/unused harmony star reexport */
|
|
99983
100008
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
99984
100009
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
99985
100010
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
|
|
@@ -100432,6 +100457,11 @@ class OpenAPI3_0BundleVisitor {
|
|
|
100432
100457
|
}
|
|
100433
100458
|
async ReferenceElement(path) {
|
|
100434
100459
|
const referencingElement = path.node;
|
|
100460
|
+
|
|
100461
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
100462
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
100463
|
+
return;
|
|
100464
|
+
}
|
|
100435
100465
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
|
|
100436
100466
|
const retrievalURI = this.toBaseURI($ref);
|
|
100437
100467
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -100567,98 +100597,108 @@ class OpenAPI3_0BundleVisitor {
|
|
|
100567
100597
|
* Path Item Object is not a Components Object field in OpenAPI 3.0
|
|
100568
100598
|
* (unlike 3.1 which has `components.pathItems`). An external Path Item
|
|
100569
100599
|
* reference therefore cannot be hoisted; it is inlined in place instead,
|
|
100570
|
-
* after bundling its own external references.
|
|
100600
|
+
* after bundling its own external references. It is inlined on leave, once
|
|
100601
|
+
* the sibling fields of the referencing Path Item have been bundled, so the
|
|
100602
|
+
* traversal doesn't descend into the inlined copy and inline the `$ref` left
|
|
100603
|
+
* in it to break a cycle again.
|
|
100571
100604
|
*/
|
|
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}`;
|
|
100605
|
+
PathItemElement = {
|
|
100606
|
+
leave: async path => {
|
|
100607
|
+
const pathItemElement = path.node;
|
|
100597
100608
|
|
|
100598
|
-
|
|
100599
|
-
|
|
100600
|
-
|
|
100601
|
-
|
|
100602
|
-
|
|
100603
|
-
|
|
100604
|
-
|
|
100605
|
-
|
|
100606
|
-
|
|
100607
|
-
|
|
100608
|
-
|
|
100609
|
-
|
|
100609
|
+
// ignore Path Item Objects without a $ref field
|
|
100610
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
|
|
100611
|
+
return;
|
|
100612
|
+
}
|
|
100613
|
+
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
|
|
100614
|
+
const retrievalURI = this.toBaseURI($ref);
|
|
100615
|
+
const isInternalReference = this.entryURI === retrievalURI;
|
|
100616
|
+
const isExternalReference = !isInternalReference;
|
|
100617
|
+
if (isInternalReference) {
|
|
100618
|
+
// normalize self-references to a bare fragment so the bundled
|
|
100619
|
+
// document stays transferable; bare fragments are left untouched
|
|
100620
|
+
pathItemElement.set('$ref', this.normalizeSelfReference($ref));
|
|
100621
|
+
return;
|
|
100610
100622
|
}
|
|
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
100623
|
|
|
100614
|
-
//
|
|
100615
|
-
if (!
|
|
100616
|
-
|
|
100617
|
-
|
|
100618
|
-
|
|
100619
|
-
|
|
100620
|
-
|
|
100621
|
-
|
|
100622
|
-
|
|
100624
|
+
// honor the resolve.external switch
|
|
100625
|
+
if (!this.options.resolve.external && isExternalReference) {
|
|
100626
|
+
return;
|
|
100627
|
+
}
|
|
100628
|
+
const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
|
|
100629
|
+
const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
|
|
100630
|
+
const canonicalKey = `${retrievalURI}#${jsonPointer}`;
|
|
100631
|
+
|
|
100632
|
+
// a circular external Path Item reference cannot be inlined without
|
|
100633
|
+
// recursing forever; leave the $ref in place to break the cycle. It ends
|
|
100634
|
+
// up in the entry document, so it has to resolve from there
|
|
100635
|
+
if (this.inlineStack.has(canonicalKey)) {
|
|
100636
|
+
const targetURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, $ref);
|
|
100637
|
+
if (_util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.entryURI, $ref) !== targetURI) {
|
|
100638
|
+
pathItemElement.set('$ref', _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.relative(this.entryURI, targetURI));
|
|
100623
100639
|
}
|
|
100640
|
+
return;
|
|
100624
100641
|
}
|
|
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
100642
|
try {
|
|
100639
|
-
|
|
100640
|
-
|
|
100643
|
+
// detect maximum depth of bundling
|
|
100644
|
+
if (this.reference.depth >= this.options.bundle.maxDepth) {
|
|
100645
|
+
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}"`, {
|
|
100646
|
+
maxDepth: this.options.bundle.maxDepth,
|
|
100647
|
+
uri: this.reference.uri
|
|
100648
|
+
});
|
|
100649
|
+
}
|
|
100650
|
+
const reference = await this.toReference($ref);
|
|
100651
|
+
let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
|
|
100652
|
+
|
|
100653
|
+
// apply Path Item semantics to the referenced fragment
|
|
100654
|
+
if (!(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.isPathItemElement)(referencedElement)) {
|
|
100655
|
+
const cached = this.getRefracted(referencedElement, 'pathItem');
|
|
100656
|
+
if (cached !== undefined) {
|
|
100657
|
+
referencedElement = cached;
|
|
100658
|
+
} else {
|
|
100659
|
+
const sourceElement = referencedElement;
|
|
100660
|
+
referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__.refractPathItem)(referencedElement);
|
|
100661
|
+
this.setRefracted(sourceElement, 'pathItem', referencedElement);
|
|
100662
|
+
}
|
|
100663
|
+
}
|
|
100664
|
+
|
|
100665
|
+
// own a copy and bundle the external references it contains
|
|
100666
|
+
const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
|
|
100667
|
+
this.inlineStack.add(canonicalKey);
|
|
100668
|
+
const visitor = new OpenAPI3_0BundleVisitor({
|
|
100669
|
+
reference,
|
|
100670
|
+
options: this.options,
|
|
100671
|
+
assignments: this.assignments,
|
|
100672
|
+
reservedNames: this.reservedNames,
|
|
100673
|
+
refractCache: this.refractCache,
|
|
100674
|
+
inlineStack: this.inlineStack
|
|
100641
100675
|
});
|
|
100642
|
-
|
|
100643
|
-
|
|
100644
|
-
|
|
100676
|
+
let bundledElement;
|
|
100677
|
+
try {
|
|
100678
|
+
bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(inlinedElement, visitor, {
|
|
100679
|
+
mutable: true
|
|
100680
|
+
});
|
|
100681
|
+
} finally {
|
|
100682
|
+
this.inlineStack.delete(canonicalKey);
|
|
100683
|
+
}
|
|
100645
100684
|
|
|
100646
|
-
|
|
100647
|
-
|
|
100648
|
-
|
|
100649
|
-
|
|
100650
|
-
|
|
100651
|
-
|
|
100652
|
-
|
|
100653
|
-
|
|
100654
|
-
|
|
100655
|
-
|
|
100656
|
-
|
|
100657
|
-
|
|
100658
|
-
|
|
100659
|
-
|
|
100685
|
+
// merge sibling fields from the referencing Path Item over the referenced
|
|
100686
|
+
// one. The referencing `$ref` is being resolved away and is skipped; the
|
|
100687
|
+
// referenced element keeps its own `$ref` if one survived (i.e. it was
|
|
100688
|
+
// left in place to break a circular external Path Item chain).
|
|
100689
|
+
pathItemElement.forEach((_value, keyElement, item) => {
|
|
100690
|
+
const key = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(keyElement);
|
|
100691
|
+
if (key === '$ref') return;
|
|
100692
|
+
bundledElement.remove(key);
|
|
100693
|
+
bundledElement.content.push(item);
|
|
100694
|
+
});
|
|
100695
|
+
bundledElement.meta.set('ref-origin', reference.uri);
|
|
100696
|
+
path.replaceWith(bundledElement);
|
|
100697
|
+
} catch (error) {
|
|
100698
|
+
this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
|
|
100699
|
+
}
|
|
100660
100700
|
}
|
|
100661
|
-
}
|
|
100701
|
+
};
|
|
100662
100702
|
|
|
100663
100703
|
/**
|
|
100664
100704
|
* Example Object `externalValue` points at arbitrary external content that
|
|
@@ -100760,7 +100800,6 @@ class OpenAPI3_0BundleVisitor {
|
|
|
100760
100800
|
|
|
100761
100801
|
"use strict";
|
|
100762
100802
|
__webpack_require__.r(__webpack_exports__);
|
|
100763
|
-
/* empty/unused harmony star reexport */
|
|
100764
100803
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
100765
100804
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
100766
100805
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7822);
|
|
@@ -101319,6 +101358,11 @@ class OpenAPI3_1BundleVisitor {
|
|
|
101319
101358
|
};
|
|
101320
101359
|
async ReferenceElement(path) {
|
|
101321
101360
|
const referencingElement = path.node;
|
|
101361
|
+
|
|
101362
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
101363
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
|
|
101364
|
+
return;
|
|
101365
|
+
}
|
|
101322
101366
|
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(referencingElement.$ref);
|
|
101323
101367
|
const retrievalURI = this.toBaseURI($ref);
|
|
101324
101368
|
const isInternalReference = this.entryURI === retrievalURI;
|
|
@@ -102293,7 +102337,6 @@ class DereferenceStrategy {
|
|
|
102293
102337
|
|
|
102294
102338
|
"use strict";
|
|
102295
102339
|
__webpack_require__.r(__webpack_exports__);
|
|
102296
|
-
/* empty/unused harmony star reexport */
|
|
102297
102340
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
102298
102341
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
102299
102342
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80796);
|
|
@@ -102396,7 +102439,6 @@ class ApiDOMDereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPORT
|
|
|
102396
102439
|
|
|
102397
102440
|
"use strict";
|
|
102398
102441
|
__webpack_require__.r(__webpack_exports__);
|
|
102399
|
-
/* empty/unused harmony star reexport */
|
|
102400
102442
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33031);
|
|
102401
102443
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
102402
102444
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
@@ -102742,13 +102784,6 @@ class ApiDOMDereferenceVisitor {
|
|
|
102742
102784
|
|
|
102743
102785
|
"use strict";
|
|
102744
102786
|
__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
102787
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96911);
|
|
102753
102788
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
102754
102789
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18252);
|
|
@@ -102759,8 +102794,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
102759
102794
|
/* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(82302);
|
|
102760
102795
|
/* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(88526);
|
|
102761
102796
|
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55890);
|
|
102762
|
-
/* harmony import */ var
|
|
102763
|
-
/* harmony import */ var
|
|
102797
|
+
/* harmony import */ var _openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29587);
|
|
102798
|
+
/* harmony import */ var _source_descriptions_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(54553);
|
|
102764
102799
|
|
|
102765
102800
|
|
|
102766
102801
|
|
|
@@ -102824,7 +102859,7 @@ class Arazzo1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPOR
|
|
|
102824
102859
|
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
102825
102860
|
reference,
|
|
102826
102861
|
options,
|
|
102827
|
-
ancestorSchema$ids: (0,
|
|
102862
|
+
ancestorSchema$ids: (0,_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_10__.detachedRootSchema$ids)(refSet.rootRef.value.result)
|
|
102828
102863
|
});
|
|
102829
102864
|
const dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverseAsync)(refSet.rootRef.value, visitor, {
|
|
102830
102865
|
mutable: true,
|
|
@@ -102854,7 +102889,7 @@ class Arazzo1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPOR
|
|
|
102854
102889
|
// drop any existing parse-phase source description results before pushing
|
|
102855
102890
|
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
102891
|
parseResult.content = cleaned.content;
|
|
102857
|
-
const sourceDescriptions = await (0,
|
|
102892
|
+
const sourceDescriptions = await (0,_source_descriptions_mjs__WEBPACK_IMPORTED_MODULE_11__.dereferenceSourceDescriptions)(parseResult, reference.uri, options, this.name);
|
|
102858
102893
|
parseResult.push(...sourceDescriptions);
|
|
102859
102894
|
}
|
|
102860
102895
|
|
|
@@ -103947,7 +103982,6 @@ class Arazzo1DereferenceVisitor {
|
|
|
103947
103982
|
|
|
103948
103983
|
"use strict";
|
|
103949
103984
|
__webpack_require__.r(__webpack_exports__);
|
|
103950
|
-
/* empty/unused harmony star reexport */
|
|
103951
103985
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
103952
103986
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
103953
103987
|
/* harmony import */ var _speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46417);
|
|
@@ -104276,6 +104310,11 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
104276
104310
|
async ReferenceElement(path) {
|
|
104277
104311
|
const referencingElement = path.node;
|
|
104278
104312
|
|
|
104313
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
104314
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
104315
|
+
return;
|
|
104316
|
+
}
|
|
104317
|
+
|
|
104279
104318
|
// skip current referencing element as it's already been access
|
|
104280
104319
|
if (this.indirections.includes(referencingElement)) {
|
|
104281
104320
|
path.skip();
|
|
@@ -104605,7 +104644,6 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
104605
104644
|
|
|
104606
104645
|
"use strict";
|
|
104607
104646
|
__webpack_require__.r(__webpack_exports__);
|
|
104608
|
-
/* empty/unused harmony star reexport */
|
|
104609
104647
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
104610
104648
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3677);
|
|
104611
104649
|
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26365);
|
|
@@ -104938,6 +104976,11 @@ class OpenAPI2DereferenceVisitor {
|
|
|
104938
104976
|
async ReferenceElement(path) {
|
|
104939
104977
|
const referencingElement = path.node;
|
|
104940
104978
|
|
|
104979
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
104980
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
104981
|
+
return;
|
|
104982
|
+
}
|
|
104983
|
+
|
|
104941
104984
|
// skip current referencing element as it's already been access
|
|
104942
104985
|
if (this.indirections.includes(referencingElement)) {
|
|
104943
104986
|
path.skip();
|
|
@@ -105241,6 +105284,11 @@ class OpenAPI2DereferenceVisitor {
|
|
|
105241
105284
|
async JSONReferenceElement(path) {
|
|
105242
105285
|
const referencingElement = path.node;
|
|
105243
105286
|
|
|
105287
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
105288
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
|
|
105289
|
+
return;
|
|
105290
|
+
}
|
|
105291
|
+
|
|
105244
105292
|
// skip current referencing element as it's already been access
|
|
105245
105293
|
if (this.indirections.includes(referencingElement)) {
|
|
105246
105294
|
path.skip();
|
|
@@ -105403,7 +105451,6 @@ class OpenAPI2DereferenceVisitor {
|
|
|
105403
105451
|
|
|
105404
105452
|
"use strict";
|
|
105405
105453
|
__webpack_require__.r(__webpack_exports__);
|
|
105406
|
-
/* empty/unused harmony star reexport */
|
|
105407
105454
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
|
|
105408
105455
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
|
|
105409
105456
|
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
|
|
@@ -105735,6 +105782,11 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
105735
105782
|
async ReferenceElement(path) {
|
|
105736
105783
|
const referencingElement = path.node;
|
|
105737
105784
|
|
|
105785
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
105786
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
|
|
105787
|
+
return;
|
|
105788
|
+
}
|
|
105789
|
+
|
|
105738
105790
|
// skip current referencing element as it's already been access
|
|
105739
105791
|
if (this.indirections.includes(referencingElement)) {
|
|
105740
105792
|
path.skip();
|
|
@@ -106184,10 +106236,6 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
106184
106236
|
|
|
106185
106237
|
"use strict";
|
|
106186
106238
|
__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
106239
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
|
|
106192
106240
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
106193
106241
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80796);
|
|
@@ -106197,7 +106245,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106197
106245
|
/* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82302);
|
|
106198
106246
|
/* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88526);
|
|
106199
106247
|
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56519);
|
|
106200
|
-
/* harmony import */ var
|
|
106248
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29587);
|
|
106201
106249
|
|
|
106202
106250
|
|
|
106203
106251
|
|
|
@@ -106261,7 +106309,7 @@ class OpenAPI3_1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IM
|
|
|
106261
106309
|
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
106262
106310
|
reference: reference,
|
|
106263
106311
|
options,
|
|
106264
|
-
ancestorSchema$ids: (0,
|
|
106312
|
+
ancestorSchema$ids: (0,_util_mjs__WEBPACK_IMPORTED_MODULE_9__.detachedRootSchema$ids)(refSet.rootRef.value.result)
|
|
106265
106313
|
});
|
|
106266
106314
|
const dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__.traverseAsync)(refSet.rootRef.value, visitor, {
|
|
106267
106315
|
mutable: true,
|
|
@@ -106923,6 +106971,11 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
106923
106971
|
async ReferenceElement(path) {
|
|
106924
106972
|
const referencingElement = path.node;
|
|
106925
106973
|
|
|
106974
|
+
// ignore Reference Object without a string $ref, e.g. an empty YAML value
|
|
106975
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(referencingElement.$ref)) {
|
|
106976
|
+
return;
|
|
106977
|
+
}
|
|
106978
|
+
|
|
106926
106979
|
// skip current referencing element as it's already been accessed
|
|
106927
106980
|
if (this.indirections.includes(referencingElement)) {
|
|
106928
106981
|
path.skip();
|
|
@@ -107700,6 +107753,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107700
107753
|
|
|
107701
107754
|
|
|
107702
107755
|
|
|
107756
|
+
const STRATEGY_NAME = 'overlay-1';
|
|
107757
|
+
|
|
107703
107758
|
/**
|
|
107704
107759
|
* Dereferences the `extends` target document from an Overlay document's ParseResult.
|
|
107705
107760
|
*
|
|
@@ -107741,39 +107796,61 @@ async function dereferenceExtends(parseResult, parseResultRetrievalURI, options)
|
|
|
107741
107796
|
const extendsDereferenceResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
107742
107797
|
extendsDereferenceResult.classes.push('extends');
|
|
107743
107798
|
extendsDereferenceResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
107744
|
-
try {
|
|
107745
|
-
let extendsDereferenced;
|
|
107746
107799
|
|
|
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
|
|
107800
|
+
// URIs of the Overlays currently being dereferenced, from the root down to the current one
|
|
107801
|
+
const ancestors = [...(options?.dereference?.strategyOpts?.[STRATEGY_NAME]?.extendsAncestors ?? []), file.uri];
|
|
107802
|
+
const nestedOptions = {
|
|
107803
|
+
dereference: {
|
|
107804
|
+
strategyOpts: {
|
|
107805
|
+
[STRATEGY_NAME]: {
|
|
107806
|
+
extendsAncestors: ancestors
|
|
107764
107807
|
}
|
|
107765
|
-
}
|
|
107808
|
+
}
|
|
107766
107809
|
}
|
|
107810
|
+
};
|
|
107767
107811
|
|
|
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');
|
|
107812
|
+
// skip if the target is still being dereferenced higher up the chain (cycle detection)
|
|
107813
|
+
if (ancestors.includes(retrievalURI)) {
|
|
107814
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Extends target "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
107815
|
+
annotation.classes.push('warning');
|
|
107776
107816
|
extendsDereferenceResult.push(annotation);
|
|
107817
|
+
} else {
|
|
107818
|
+
try {
|
|
107819
|
+
let extendsDereferenced;
|
|
107820
|
+
|
|
107821
|
+
// check if extends was already parsed (e.g., during parse phase with extends: true)
|
|
107822
|
+
const existingParseResult = extendsElement.meta.get('parseResult');
|
|
107823
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement)(existingParseResult)) {
|
|
107824
|
+
// use existing parsed result - just dereference it (no re-fetch/re-parse)
|
|
107825
|
+
extendsDereferenced = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_10__.dereferenceApiDOM)(existingParseResult, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
107826
|
+
...nestedOptions,
|
|
107827
|
+
parse: {
|
|
107828
|
+
mediaType: 'text/plain' // allow dereference strategy detection via ApiDOM inspection
|
|
107829
|
+
},
|
|
107830
|
+
resolve: {
|
|
107831
|
+
baseURI: retrievalURI
|
|
107832
|
+
}
|
|
107833
|
+
}));
|
|
107834
|
+
} else {
|
|
107835
|
+
// no existing parse result - fetch, parse, and dereference
|
|
107836
|
+
extendsDereferenced = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_10__["default"])(retrievalURI, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_9__.merge)(options, {
|
|
107837
|
+
...nestedOptions,
|
|
107838
|
+
parse: {
|
|
107839
|
+
mediaType: 'text/plain' // allow parser plugin detection
|
|
107840
|
+
}
|
|
107841
|
+
}));
|
|
107842
|
+
}
|
|
107843
|
+
|
|
107844
|
+
// merge dereferenced result into our wrapper
|
|
107845
|
+
for (const item of extendsDereferenced) {
|
|
107846
|
+
extendsDereferenceResult.push(item);
|
|
107847
|
+
}
|
|
107848
|
+
} catch (error) {
|
|
107849
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
107850
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](`Error dereferencing extends target "${retrievalURI}": ${message}`);
|
|
107851
|
+
annotation.classes.push('error');
|
|
107852
|
+
extendsDereferenceResult.push(annotation);
|
|
107853
|
+
}
|
|
107777
107854
|
}
|
|
107778
107855
|
|
|
107779
107856
|
// always attach result to extends element meta (even on failure - contains annotations)
|
|
@@ -107792,17 +107869,16 @@ async function dereferenceExtends(parseResult, parseResultRetrievalURI, options)
|
|
|
107792
107869
|
|
|
107793
107870
|
"use strict";
|
|
107794
107871
|
__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);
|
|
107872
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96911);
|
|
107873
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
107874
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13786);
|
|
107875
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26432);
|
|
107876
|
+
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80796);
|
|
107877
|
+
/* harmony import */ var _DereferenceStrategy_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12993);
|
|
107878
|
+
/* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82302);
|
|
107879
|
+
/* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88526);
|
|
107880
|
+
/* harmony import */ var _extends_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51826);
|
|
107881
|
+
/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64595);
|
|
107806
107882
|
|
|
107807
107883
|
|
|
107808
107884
|
|
|
@@ -107817,7 +107893,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107817
107893
|
/**
|
|
107818
107894
|
* @public
|
|
107819
107895
|
*/
|
|
107820
|
-
class Overlay1DereferenceStrategy extends
|
|
107896
|
+
class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPORTED_MODULE_5__["default"] {
|
|
107821
107897
|
constructor(options) {
|
|
107822
107898
|
super({
|
|
107823
107899
|
...(options ?? {}),
|
|
@@ -107827,18 +107903,18 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPO
|
|
|
107827
107903
|
canDereference(file) {
|
|
107828
107904
|
// assert by media type
|
|
107829
107905
|
if (file.mediaType !== 'text/plain') {
|
|
107830
|
-
return
|
|
107906
|
+
return _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
|
|
107831
107907
|
}
|
|
107832
107908
|
|
|
107833
107909
|
// assert by inspecting ApiDOM
|
|
107834
|
-
return (0,
|
|
107910
|
+
return (0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_3__.isOverlay1Element)(file.parseResult?.result);
|
|
107835
107911
|
}
|
|
107836
107912
|
async dereference(file, options) {
|
|
107837
|
-
const immutableRefSet = options.dereference.refSet ?? new
|
|
107838
|
-
const mutableRefSet = new
|
|
107913
|
+
const immutableRefSet = options.dereference.refSet ?? new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
107914
|
+
const mutableRefSet = new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
107839
107915
|
let reference;
|
|
107840
107916
|
if (!immutableRefSet.has(file.uri)) {
|
|
107841
|
-
reference = new
|
|
107917
|
+
reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
107842
107918
|
uri: file.uri,
|
|
107843
107919
|
value: file.parseResult
|
|
107844
107920
|
});
|
|
@@ -107853,39 +107929,51 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPO
|
|
|
107853
107929
|
* We don't want to mutate the original refSet and the references.
|
|
107854
107930
|
*/
|
|
107855
107931
|
if (options.dereference.immutable) {
|
|
107856
|
-
immutableRefSet.refs.map(ref => new
|
|
107932
|
+
immutableRefSet.refs.map(ref => new _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
107857
107933
|
...ref,
|
|
107858
|
-
value: (0,
|
|
107934
|
+
value: (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(ref.value)
|
|
107859
107935
|
})).forEach(ref => mutableRefSet.add(ref));
|
|
107860
107936
|
reference = mutableRefSet.find(ref => ref.uri === file.uri);
|
|
107861
107937
|
}
|
|
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"]({
|
|
107938
|
+
const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
107869
107939
|
reference,
|
|
107870
107940
|
options
|
|
107871
107941
|
});
|
|
107872
|
-
|
|
107873
|
-
|
|
107874
|
-
|
|
107942
|
+
/**
|
|
107943
|
+
* The reference for the dereferenced file is traversed rather than the refSet's root
|
|
107944
|
+
* reference: dereferencing the extends target shares the refSet, whose root is then
|
|
107945
|
+
* the extending Overlay. The reference may hold a lone element.
|
|
107946
|
+
*/
|
|
107947
|
+
let dereferencedElement = reference.value;
|
|
107948
|
+
|
|
107949
|
+
/**
|
|
107950
|
+
* A ParseResult may also carry the extends target parsed in the parse phase, whose
|
|
107951
|
+
* references belong to that document, so only its result is traversed. Reusable Action
|
|
107952
|
+
* References only occur within `actions`, so the result itself is never replaced.
|
|
107953
|
+
*/
|
|
107954
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(dereferencedElement)) {
|
|
107955
|
+
await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__.traverseAsync)(dereferencedElement.result, visitor, {
|
|
107956
|
+
mutable: true
|
|
107957
|
+
});
|
|
107958
|
+
} else {
|
|
107959
|
+
dereferencedElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_4__.traverseAsync)(dereferencedElement, visitor, {
|
|
107960
|
+
mutable: true
|
|
107961
|
+
});
|
|
107962
|
+
}
|
|
107875
107963
|
|
|
107876
107964
|
/**
|
|
107877
107965
|
* Dereference extends target if option is enabled.
|
|
107878
107966
|
*/
|
|
107879
107967
|
const shouldDereferenceExtends = options?.dereference?.strategyOpts?.[this.name]?.extends ?? options?.dereference?.strategyOpts?.extends;
|
|
107880
|
-
if (shouldDereferenceExtends) {
|
|
107881
|
-
await (0,
|
|
107968
|
+
if (shouldDereferenceExtends && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isParseResultElement)(dereferencedElement)) {
|
|
107969
|
+
await (0,_extends_mjs__WEBPACK_IMPORTED_MODULE_8__.dereferenceExtends)(dereferencedElement, reference.uri, options);
|
|
107882
107970
|
}
|
|
107883
107971
|
|
|
107884
107972
|
/**
|
|
107885
107973
|
* If immutable option is set, replay refs from the refSet.
|
|
107886
107974
|
*/
|
|
107887
107975
|
if (options.dereference.immutable) {
|
|
107888
|
-
mutableRefSet.refs.filter(ref => ref.uri.startsWith('immutable://')).map(ref => new
|
|
107976
|
+
mutableRefSet.refs.filter(ref => ref.uri.startsWith('immutable://')).map(ref => new _Reference_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
107889
107977
|
...ref,
|
|
107890
107978
|
uri: ref.uri.replace(/^immutable:\/\//, '')
|
|
107891
107979
|
})).forEach(ref => immutableRefSet.add(ref));
|
|
@@ -107917,17 +108005,22 @@ class Overlay1DereferenceStrategy extends _DereferenceStrategy_mjs__WEBPACK_IMPO
|
|
|
107917
108005
|
|
|
107918
108006
|
"use strict";
|
|
107919
108007
|
__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
|
|
108008
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
108009
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
108010
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18252);
|
|
108011
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25810);
|
|
108012
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44673);
|
|
108013
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16280);
|
|
108014
|
+
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44641);
|
|
108015
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12020);
|
|
108016
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(61198);
|
|
108017
|
+
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80796);
|
|
108018
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26432);
|
|
108019
|
+
/* harmony import */ var _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(35937);
|
|
108020
|
+
/* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(34968);
|
|
108021
|
+
/* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(18917);
|
|
108022
|
+
|
|
108023
|
+
|
|
107931
108024
|
|
|
107932
108025
|
|
|
107933
108026
|
|
|
@@ -107958,25 +108051,32 @@ class Overlay1DereferenceVisitor {
|
|
|
107958
108051
|
path.skip();
|
|
107959
108052
|
return;
|
|
107960
108053
|
}
|
|
107961
|
-
const $ref = (0,
|
|
107962
|
-
|
|
107963
|
-
|
|
108054
|
+
const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(referencingElement.$ref);
|
|
108055
|
+
// the reference may hold a lone element; same-document references resolve against the
|
|
108056
|
+
// document registered in the refSet under the reference's URI without fragment
|
|
108057
|
+
const {
|
|
108058
|
+
refSet
|
|
108059
|
+
} = this.reference;
|
|
108060
|
+
const documentURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_13__.stripHash(this.reference.uri);
|
|
108061
|
+
const documentReference = refSet.find(ref => ref.uri === documentURI) ?? this.reference;
|
|
108062
|
+
const overlayElement = documentReference.value.result;
|
|
108063
|
+
const actionElement = new _speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_11__.ActionElement();
|
|
107964
108064
|
try {
|
|
107965
108065
|
if (typeof $ref !== 'string') {
|
|
107966
|
-
throw new
|
|
108066
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"]('Reusable Action Reference "$ref" field must be a string');
|
|
107967
108067
|
}
|
|
107968
108068
|
|
|
107969
108069
|
// only `target`, `description` and extensions may accompany `$ref`
|
|
107970
108070
|
const disallowedField = ['update', 'copy', 'remove'].find(field => referencingElement.hasKey(field));
|
|
107971
108071
|
if (disallowedField !== undefined) {
|
|
107972
|
-
throw new
|
|
108072
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" must not define "${disallowedField}"`, {
|
|
107973
108073
|
$ref
|
|
107974
108074
|
});
|
|
107975
108075
|
}
|
|
107976
108076
|
|
|
107977
108077
|
// same-document reference only; external references are not supported
|
|
107978
108078
|
if (!$ref.startsWith('#')) {
|
|
107979
|
-
throw new
|
|
108079
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" must be a same-document reference`, {
|
|
107980
108080
|
$ref
|
|
107981
108081
|
});
|
|
107982
108082
|
}
|
|
@@ -107987,25 +108087,25 @@ class Overlay1DereferenceVisitor {
|
|
|
107987
108087
|
*/
|
|
107988
108088
|
let reusableAction;
|
|
107989
108089
|
try {
|
|
107990
|
-
reusableAction = (0,
|
|
108090
|
+
reusableAction = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__.evaluate)(overlayElement, _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__.URIFragmentIdentifier.from($ref));
|
|
107991
108091
|
} catch {
|
|
107992
108092
|
reusableAction = undefined;
|
|
107993
108093
|
}
|
|
107994
|
-
if (!(0,
|
|
107995
|
-
throw new
|
|
108094
|
+
if (!(0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isReusableActionElement)(reusableAction)) {
|
|
108095
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action Reference "${$ref}" cannot be resolved`, {
|
|
107996
108096
|
$ref
|
|
107997
108097
|
});
|
|
107998
108098
|
}
|
|
107999
108099
|
const {
|
|
108000
108100
|
fields
|
|
108001
108101
|
} = reusableAction;
|
|
108002
|
-
if (fields !== undefined && !(0,
|
|
108003
|
-
throw new
|
|
108102
|
+
if (fields !== undefined && !(0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields)) {
|
|
108103
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action "${$ref}" must define "fields" as an object`, {
|
|
108004
108104
|
$ref
|
|
108005
108105
|
});
|
|
108006
108106
|
}
|
|
108007
|
-
if ((0,
|
|
108008
|
-
throw new
|
|
108107
|
+
if ((0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields) && fields.hasKey('target')) {
|
|
108108
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_6__["default"](`Reusable Action "${$ref}" must not define "target" in its "fields"`, {
|
|
108009
108109
|
$ref
|
|
108010
108110
|
});
|
|
108011
108111
|
}
|
|
@@ -108016,26 +108116,41 @@ class Overlay1DereferenceVisitor {
|
|
|
108016
108116
|
description
|
|
108017
108117
|
} = referencingElement;
|
|
108018
108118
|
if (target !== undefined) {
|
|
108019
|
-
actionElement.set('target', (0,
|
|
108119
|
+
actionElement.set('target', (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(target));
|
|
108020
108120
|
}
|
|
108021
|
-
if ((0,
|
|
108121
|
+
if ((0,_speclynx_apidom_ns_overlay_1__WEBPACK_IMPORTED_MODULE_10__.isActionElement)(fields)) {
|
|
108022
108122
|
fields.forEach((value, keyElement) => {
|
|
108023
|
-
actionElement.set((0,
|
|
108123
|
+
actionElement.set((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(keyElement), (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(value));
|
|
108024
108124
|
});
|
|
108025
108125
|
}
|
|
108026
108126
|
if (description !== undefined) {
|
|
108027
|
-
actionElement.set('description', (0,
|
|
108127
|
+
actionElement.set('description', (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(description));
|
|
108028
108128
|
}
|
|
108029
108129
|
} catch (error) {
|
|
108030
108130
|
const {
|
|
108031
108131
|
continueOnError
|
|
108032
108132
|
} = this.options.dereference;
|
|
108033
|
-
|
|
108133
|
+
|
|
108134
|
+
// find element location by identity in the document tree;
|
|
108135
|
+
// falls back to the visitor path when the document doesn't contain the element
|
|
108136
|
+
let location;
|
|
108137
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(overlayElement)) {
|
|
108138
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverse)(overlayElement, {
|
|
108139
|
+
enter: p => {
|
|
108140
|
+
if (p.node === referencingElement) {
|
|
108141
|
+
location = p.formatPath();
|
|
108142
|
+
p.stop();
|
|
108143
|
+
}
|
|
108144
|
+
}
|
|
108145
|
+
});
|
|
108146
|
+
}
|
|
108147
|
+
location ??= path.formatPath();
|
|
108148
|
+
const unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_12__["default"](`Error while dereferencing Reusable Action Reference "${$ref}": ${error.message}`, {
|
|
108034
108149
|
cause: error,
|
|
108035
108150
|
type: referencingElement.element,
|
|
108036
108151
|
uri: this.reference.uri,
|
|
108037
|
-
location
|
|
108038
|
-
codeFrame: (0,
|
|
108152
|
+
location,
|
|
108153
|
+
codeFrame: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement),
|
|
108039
108154
|
refFieldName: '$ref',
|
|
108040
108155
|
refFieldValue: $ref,
|
|
108041
108156
|
trace: []
|
|
@@ -108047,14 +108162,14 @@ class Overlay1DereferenceVisitor {
|
|
|
108047
108162
|
}
|
|
108048
108163
|
|
|
108049
108164
|
// the action takes the place of the reference in `actions`, so it inherits its source position
|
|
108050
|
-
if ((0,
|
|
108051
|
-
|
|
108165
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap)(referencingElement)) {
|
|
108166
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(referencingElement, actionElement);
|
|
108052
108167
|
}
|
|
108053
108168
|
|
|
108054
108169
|
// annotate with info about original referencing element
|
|
108055
108170
|
actionElement.meta.set('ref-fields', {
|
|
108056
108171
|
$ref,
|
|
108057
|
-
description: (0,
|
|
108172
|
+
description: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__["default"])(referencingElement.description)
|
|
108058
108173
|
});
|
|
108059
108174
|
// annotate with info about origin
|
|
108060
108175
|
actionElement.meta.set('ref-origin', this.reference.uri);
|
|
@@ -109300,7 +109415,6 @@ class ApiDOMJSONParser extends _Parser_mjs__WEBPACK_IMPORTED_MODULE_4__["default
|
|
|
109300
109415
|
|
|
109301
109416
|
"use strict";
|
|
109302
109417
|
__webpack_require__.r(__webpack_exports__);
|
|
109303
|
-
/* empty/unused harmony star reexport */
|
|
109304
109418
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
109305
109419
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6017);
|
|
109306
109420
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29028);
|
|
@@ -109611,7 +109725,6 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
109611
109725
|
|
|
109612
109726
|
"use strict";
|
|
109613
109727
|
__webpack_require__.r(__webpack_exports__);
|
|
109614
|
-
/* empty/unused harmony star reexport */
|
|
109615
109728
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
109616
109729
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16206);
|
|
109617
109730
|
/* harmony import */ var _speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43195);
|
|
@@ -110374,6 +110487,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
110374
110487
|
|
|
110375
110488
|
|
|
110376
110489
|
|
|
110490
|
+
// shared key for recursion state (works across JSON/YAML parsers)
|
|
110491
|
+
const OVERLAY_RECURSION_KEY = 'overlay-1';
|
|
110377
110492
|
|
|
110378
110493
|
/**
|
|
110379
110494
|
* Parses the `extends` target document from an Overlay document's ParseResult.
|
|
@@ -110411,21 +110526,38 @@ async function parseExtends(parseResult, parseResultRetrievalURI, options) {
|
|
|
110411
110526
|
const extendsParseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
110412
110527
|
extendsParseResult.classes.push('extends');
|
|
110413
110528
|
extendsParseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
110414
|
-
|
|
110415
|
-
|
|
110416
|
-
|
|
110417
|
-
|
|
110529
|
+
|
|
110530
|
+
// URIs of the Overlays currently being parsed, from the root down to the current one
|
|
110531
|
+
const ancestors = [...(options?.parse?.parserOpts?.[OVERLAY_RECURSION_KEY]?.extendsAncestors ?? []), file.uri];
|
|
110532
|
+
|
|
110533
|
+
// skip if the target is still being parsed higher up the chain (cycle detection)
|
|
110534
|
+
if (ancestors.includes(retrievalURI)) {
|
|
110535
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Extends target "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
110536
|
+
annotation.classes.push('warning');
|
|
110537
|
+
extendsParseResult.push(annotation);
|
|
110538
|
+
} else {
|
|
110539
|
+
try {
|
|
110540
|
+
const targetParseResult = await (0,_index_mjs__WEBPACK_IMPORTED_MODULE_8__["default"])(retrievalURI, (0,_options_util_mjs__WEBPACK_IMPORTED_MODULE_7__.merge)(options, {
|
|
110541
|
+
parse: {
|
|
110542
|
+
mediaType: 'text/plain',
|
|
110543
|
+
// force auto-detection
|
|
110544
|
+
parserOpts: {
|
|
110545
|
+
[OVERLAY_RECURSION_KEY]: {
|
|
110546
|
+
extendsAncestors: ancestors
|
|
110547
|
+
}
|
|
110548
|
+
}
|
|
110549
|
+
}
|
|
110550
|
+
}));
|
|
110551
|
+
// merge parsed result into our wrapper
|
|
110552
|
+
for (const item of targetParseResult) {
|
|
110553
|
+
extendsParseResult.push(item);
|
|
110418
110554
|
}
|
|
110419
|
-
})
|
|
110420
|
-
|
|
110421
|
-
|
|
110422
|
-
|
|
110555
|
+
} catch (error) {
|
|
110556
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
110557
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Error parsing extends target "${retrievalURI}": ${message}`);
|
|
110558
|
+
annotation.classes.push('error');
|
|
110559
|
+
extendsParseResult.push(annotation);
|
|
110423
110560
|
}
|
|
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
110561
|
}
|
|
110430
110562
|
|
|
110431
110563
|
// always attach result to extends element meta (even on failure - contains annotations)
|
|
@@ -110440,7 +110572,6 @@ async function parseExtends(parseResult, parseResultRetrievalURI, options) {
|
|
|
110440
110572
|
|
|
110441
110573
|
"use strict";
|
|
110442
110574
|
__webpack_require__.r(__webpack_exports__);
|
|
110443
|
-
/* empty/unused harmony star reexport */
|
|
110444
110575
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
110445
110576
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_json_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85086);
|
|
110446
110577
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_json_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54827);
|
|
@@ -110522,7 +110653,6 @@ class OverlayJSON1Parser extends _Parser_mjs__WEBPACK_IMPORTED_MODULE_4__["defau
|
|
|
110522
110653
|
|
|
110523
110654
|
"use strict";
|
|
110524
110655
|
__webpack_require__.r(__webpack_exports__);
|
|
110525
|
-
/* empty/unused harmony star reexport */
|
|
110526
110656
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14494);
|
|
110527
110657
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_yaml_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98585);
|
|
110528
110658
|
/* harmony import */ var _speclynx_apidom_parser_adapter_overlay_yaml_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83004);
|