@speclynx/apidom-reference 2.13.1 → 3.0.0
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 +10 -0
- package/README.md +5 -5
- package/dist/apidom-reference.browser.js +577 -334
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +25 -25
- package/src/dereference/strategies/apidom/selectors/element-id.cjs +11 -2
- package/src/dereference/strategies/apidom/selectors/element-id.mjs +12 -3
- package/src/dereference/strategies/arazzo-1/source-descriptions.cjs +2 -2
- package/src/dereference/strategies/arazzo-1/source-descriptions.mjs +3 -3
- package/src/dereference/strategies/arazzo-1/visitor.cjs +2 -2
- package/src/dereference/strategies/arazzo-1/visitor.mjs +2 -2
- package/src/dereference/strategies/asyncapi-2/visitor.cjs +6 -6
- package/src/dereference/strategies/asyncapi-2/visitor.mjs +6 -6
- package/src/dereference/strategies/openapi-2/visitor.cjs +8 -8
- package/src/dereference/strategies/openapi-2/visitor.mjs +8 -8
- package/src/dereference/strategies/openapi-3-0/visitor.cjs +6 -6
- package/src/dereference/strategies/openapi-3-0/visitor.mjs +6 -6
- package/src/dereference/strategies/openapi-3-1/util.cjs +2 -2
- package/src/dereference/strategies/openapi-3-1/util.mjs +2 -2
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +8 -8
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +8 -8
- package/src/parse/parsers/arazzo-json-1/source-descriptions.cjs +2 -2
- package/src/parse/parsers/arazzo-json-1/source-descriptions.mjs +3 -3
|
@@ -579,7 +579,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
579
579
|
|
|
580
580
|
|
|
581
581
|
|
|
582
|
-
const
|
|
582
|
+
const getElementID = element => {
|
|
583
|
+
const id = element.meta.get('id');
|
|
584
|
+
// handle both raw string (new format) and StringElement (legacy Refract without __meta_raw__)
|
|
585
|
+
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(id) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(id) : id;
|
|
586
|
+
};
|
|
587
|
+
const hasElementID = element => {
|
|
588
|
+
if (!element.hasMetaProperty('id')) return false;
|
|
589
|
+
const id = getElementID(element);
|
|
590
|
+
return typeof id === 'string' && id !== '';
|
|
591
|
+
};
|
|
583
592
|
|
|
584
593
|
/**
|
|
585
594
|
* Evaluates element ID against ApiDOM fragment.
|
|
@@ -597,7 +606,7 @@ const evaluate = (elementID, element) => {
|
|
|
597
606
|
|
|
598
607
|
// search for the matching element
|
|
599
608
|
const result = cache.get(element).find(e => {
|
|
600
|
-
return
|
|
609
|
+
return getElementID(e) === elementID;
|
|
601
610
|
});
|
|
602
611
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(result)) {
|
|
603
612
|
throw new _errors_EvaluationElementIdError_ts__WEBPACK_IMPORTED_MODULE_4__["default"](`Evaluation failed on element ID: "${elementID}"`);
|
|
@@ -620,8 +629,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
620
629
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
|
|
621
630
|
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16126);
|
|
622
631
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25162);
|
|
623
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
624
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
632
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96911);
|
|
633
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12111);
|
|
625
634
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10404);
|
|
626
635
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44673);
|
|
627
636
|
/* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80796);
|
|
@@ -698,7 +707,7 @@ class ApiDOMDereferenceVisitor {
|
|
|
698
707
|
// register new mutable reference with a refSet
|
|
699
708
|
const mutableReference = new _Reference_ts__WEBPACK_IMPORTED_MODULE_12__["default"]({
|
|
700
709
|
uri: baseURI,
|
|
701
|
-
value: (0,
|
|
710
|
+
value: (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(parseResult),
|
|
702
711
|
depth: this.reference.depth + 1
|
|
703
712
|
});
|
|
704
713
|
refSet.add(mutableReference);
|
|
@@ -748,7 +757,7 @@ class ApiDOMDereferenceVisitor {
|
|
|
748
757
|
if (refElement === referencedElement) {
|
|
749
758
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('RefElement cannot reference itself');
|
|
750
759
|
}
|
|
751
|
-
if ((0,
|
|
760
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isRefElement)(referencedElement)) {
|
|
752
761
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('RefElement cannot reference another RefElement');
|
|
753
762
|
}
|
|
754
763
|
if (isExternalReference) {
|
|
@@ -950,18 +959,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
950
959
|
/* harmony export */ dereferenceSourceDescriptions: () => (/* binding */ dereferenceSourceDescriptions)
|
|
951
960
|
/* harmony export */ });
|
|
952
961
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
953
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
954
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
955
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
956
|
-
/* harmony import */ var
|
|
957
|
-
/* harmony import */ var
|
|
958
|
-
/* harmony import */ var
|
|
959
|
-
/* harmony import */ var
|
|
960
|
-
/* harmony import */ var
|
|
961
|
-
/* harmony import */ var
|
|
962
|
-
/* harmony import */ var
|
|
963
|
-
/* harmony import */ var
|
|
964
|
-
/* harmony import */ var _index_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(42037);
|
|
962
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96911);
|
|
963
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84660);
|
|
964
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
|
|
965
|
+
/* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28839);
|
|
966
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26365);
|
|
967
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32131);
|
|
968
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(76332);
|
|
969
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44673);
|
|
970
|
+
/* harmony import */ var _util_url_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(30658);
|
|
971
|
+
/* harmony import */ var _options_util_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(86547);
|
|
972
|
+
/* harmony import */ var _index_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(42037);
|
|
965
973
|
|
|
966
974
|
|
|
967
975
|
|
|
@@ -976,9 +984,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
976
984
|
* Returns ParseResultElement on success, or with annotation if skipped.
|
|
977
985
|
*/
|
|
978
986
|
async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
979
|
-
const parseResult = new
|
|
980
|
-
if (!(0,
|
|
981
|
-
const annotation = new
|
|
987
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
988
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isSourceDescriptionElement)(sourceDescription)) {
|
|
989
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]('Element is not a valid SourceDescriptionElement. Skipping');
|
|
982
990
|
annotation.classes.push('warning');
|
|
983
991
|
parseResult.push(annotation);
|
|
984
992
|
return parseResult;
|
|
@@ -986,23 +994,23 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
986
994
|
|
|
987
995
|
// set class and metadata from source description element
|
|
988
996
|
parseResult.classes.push('source-description');
|
|
989
|
-
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.name)) parseResult.setMetaProperty('name', (0,
|
|
990
|
-
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.type)) parseResult.setMetaProperty('type', (0,
|
|
991
|
-
const sourceDescriptionURI = (0,
|
|
997
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.name)) parseResult.setMetaProperty('name', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(sourceDescription.name));
|
|
998
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.type)) parseResult.setMetaProperty('type', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(sourceDescription.type));
|
|
999
|
+
const sourceDescriptionURI = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(sourceDescription.url);
|
|
992
1000
|
if (typeof sourceDescriptionURI !== 'string') {
|
|
993
|
-
const annotation = new
|
|
1001
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]('Source description URL is missing or not a string. Skipping');
|
|
994
1002
|
annotation.classes.push('warning');
|
|
995
1003
|
parseResult.push(annotation);
|
|
996
1004
|
return parseResult;
|
|
997
1005
|
}
|
|
998
1006
|
|
|
999
1007
|
// normalize URI for consistent cycle detection and refSet cache key matching
|
|
1000
|
-
const retrievalURI =
|
|
1008
|
+
const retrievalURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_9__.sanitize(_util_url_ts__WEBPACK_IMPORTED_MODULE_9__.stripHash(_util_url_ts__WEBPACK_IMPORTED_MODULE_9__.resolve(ctx.baseURI, sourceDescriptionURI)));
|
|
1001
1009
|
parseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
1002
1010
|
|
|
1003
1011
|
// skip if already visited (cycle detection)
|
|
1004
1012
|
if (ctx.visitedUrls.has(retrievalURI)) {
|
|
1005
|
-
const annotation = new
|
|
1013
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](`Source description "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
1006
1014
|
annotation.classes.push('warning');
|
|
1007
1015
|
parseResult.push(annotation);
|
|
1008
1016
|
return parseResult;
|
|
@@ -1013,9 +1021,9 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
1013
1021
|
const existingParseResult = sourceDescription.meta.get('parseResult');
|
|
1014
1022
|
try {
|
|
1015
1023
|
let sourceDescriptionDereferenced;
|
|
1016
|
-
if ((0,
|
|
1024
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement)(existingParseResult)) {
|
|
1017
1025
|
// use existing parsed result - just dereference it (no re-fetch/re-parse)
|
|
1018
|
-
sourceDescriptionDereferenced = await (0,
|
|
1026
|
+
sourceDescriptionDereferenced = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_11__.dereferenceApiDOM)(existingParseResult, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_10__.merge)(ctx.options, {
|
|
1019
1027
|
parse: {
|
|
1020
1028
|
mediaType: 'text/plain' // allow dereference strategy detection via ApiDOM inspection
|
|
1021
1029
|
},
|
|
@@ -1037,7 +1045,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
1037
1045
|
}));
|
|
1038
1046
|
} else {
|
|
1039
1047
|
// no existing parse result - fetch, parse, and dereference
|
|
1040
|
-
sourceDescriptionDereferenced = await (0,
|
|
1048
|
+
sourceDescriptionDereferenced = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_11__["default"])(retrievalURI, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_10__.merge)(ctx.options, {
|
|
1041
1049
|
parse: {
|
|
1042
1050
|
mediaType: 'text/plain' // allow parser plugin detection
|
|
1043
1051
|
},
|
|
@@ -1063,7 +1071,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
1063
1071
|
} catch (error) {
|
|
1064
1072
|
// create error annotation instead of failing entire dereference
|
|
1065
1073
|
const message = error instanceof Error ? error.message : String(error);
|
|
1066
|
-
const annotation = new
|
|
1074
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](`Error dereferencing source description "${retrievalURI}": ${message}`);
|
|
1067
1075
|
annotation.classes.push('error');
|
|
1068
1076
|
parseResult.push(annotation);
|
|
1069
1077
|
return parseResult;
|
|
@@ -1073,24 +1081,24 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
1073
1081
|
const {
|
|
1074
1082
|
api: sourceDescriptionAPI
|
|
1075
1083
|
} = parseResult;
|
|
1076
|
-
const isOpenApi = (0,
|
|
1077
|
-
const isArazzo = (0,
|
|
1084
|
+
const isOpenApi = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_5__.isSwaggerElement)(sourceDescriptionAPI) || (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__.isOpenApi3_0Element)(sourceDescriptionAPI) || (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_7__.isOpenApi3_1Element)(sourceDescriptionAPI);
|
|
1085
|
+
const isArazzo = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isArazzoSpecification1Element)(sourceDescriptionAPI);
|
|
1078
1086
|
if (!isOpenApi && !isArazzo) {
|
|
1079
|
-
const annotation = new
|
|
1087
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](`Source description "${retrievalURI}" is not an OpenAPI or Arazzo document`);
|
|
1080
1088
|
annotation.classes.push('warning');
|
|
1081
1089
|
parseResult.push(annotation);
|
|
1082
1090
|
return parseResult;
|
|
1083
1091
|
}
|
|
1084
1092
|
|
|
1085
1093
|
// validate declared type matches actual dereferenced type
|
|
1086
|
-
const declaredType = (0,
|
|
1094
|
+
const declaredType = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(sourceDescription.type);
|
|
1087
1095
|
if (typeof declaredType === 'string') {
|
|
1088
1096
|
if (declaredType === 'openapi' && !isOpenApi) {
|
|
1089
|
-
const annotation = new
|
|
1097
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](`Source description "${retrievalURI}" declared as "openapi" but dereferenced as Arazzo document`);
|
|
1090
1098
|
annotation.classes.push('warning');
|
|
1091
1099
|
parseResult.push(annotation);
|
|
1092
1100
|
} else if (declaredType === 'arazzo' && !isArazzo) {
|
|
1093
|
-
const annotation = new
|
|
1101
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](`Source description "${retrievalURI}" declared as "arazzo" but dereferenced as OpenAPI document`);
|
|
1094
1102
|
annotation.classes.push('warning');
|
|
1095
1103
|
parseResult.push(annotation);
|
|
1096
1104
|
}
|
|
@@ -1140,7 +1148,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
1140
1148
|
* @public
|
|
1141
1149
|
*/
|
|
1142
1150
|
async function dereferenceSourceDescriptions(parseResult, parseResultRetrievalURI, options, strategyName = 'arazzo-1') {
|
|
1143
|
-
const baseURI =
|
|
1151
|
+
const baseURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_9__.sanitize(_util_url_ts__WEBPACK_IMPORTED_MODULE_9__.stripHash(parseResultRetrievalURI));
|
|
1144
1152
|
const results = [];
|
|
1145
1153
|
|
|
1146
1154
|
// get API from dereferenced parse result
|
|
@@ -1152,15 +1160,15 @@ async function dereferenceSourceDescriptions(parseResult, parseResultRetrievalUR
|
|
|
1152
1160
|
* Validate prerequisites for dereferencing source descriptions.
|
|
1153
1161
|
* Return warning annotations if validation fails.
|
|
1154
1162
|
*/
|
|
1155
|
-
if (!(0,
|
|
1156
|
-
const annotation = new
|
|
1163
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isArazzoSpecification1Element)(api)) {
|
|
1164
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]('Cannot dereference source descriptions: API is not an Arazzo specification');
|
|
1157
1165
|
annotation.classes.push('warning');
|
|
1158
|
-
return [new
|
|
1166
|
+
return [new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]([annotation])];
|
|
1159
1167
|
}
|
|
1160
1168
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isArrayElement)(api.sourceDescriptions)) {
|
|
1161
|
-
const annotation = new
|
|
1169
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]('Cannot dereference source descriptions: sourceDescriptions field is missing or not an array');
|
|
1162
1170
|
annotation.classes.push('warning');
|
|
1163
|
-
return [new
|
|
1171
|
+
return [new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]([annotation])];
|
|
1164
1172
|
}
|
|
1165
1173
|
|
|
1166
1174
|
// user config: strategy-specific options take precedence over global strategyOpts
|
|
@@ -1174,9 +1182,9 @@ async function dereferenceSourceDescriptions(parseResult, parseResultRetrievalUR
|
|
|
1174
1182
|
// add current file to visited URLs to prevent cycles
|
|
1175
1183
|
visitedUrls.add(baseURI);
|
|
1176
1184
|
if (currentDepth >= maxDepth) {
|
|
1177
|
-
const annotation = new
|
|
1185
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](`Maximum dereference depth of ${maxDepth} has been exceeded by file "${baseURI}"`);
|
|
1178
1186
|
annotation.classes.push('error');
|
|
1179
|
-
const parseResult = new
|
|
1187
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]([annotation]);
|
|
1180
1188
|
parseResult.classes.push('source-description');
|
|
1181
1189
|
return [parseResult];
|
|
1182
1190
|
}
|
|
@@ -1191,8 +1199,8 @@ async function dereferenceSourceDescriptions(parseResult, parseResultRetrievalUR
|
|
|
1191
1199
|
// determine which source descriptions to dereference (array filters by name)
|
|
1192
1200
|
const sourceDescriptionsOption = options?.dereference?.strategyOpts?.[strategyName]?.sourceDescriptions ?? options?.dereference?.strategyOpts?.sourceDescriptions;
|
|
1193
1201
|
const sourceDescriptions = Array.isArray(sourceDescriptionsOption) ? api.sourceDescriptions.filter(sd => {
|
|
1194
|
-
if (!(0,
|
|
1195
|
-
const name = (0,
|
|
1202
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isSourceDescriptionElement)(sd)) return false;
|
|
1203
|
+
const name = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(sd.name);
|
|
1196
1204
|
return typeof name === 'string' && sourceDescriptionsOption.includes(name);
|
|
1197
1205
|
}) : api.sourceDescriptions;
|
|
1198
1206
|
|
|
@@ -1660,7 +1668,7 @@ class Arazzo1DereferenceVisitor {
|
|
|
1660
1668
|
// annotate referenced element with info about origin
|
|
1661
1669
|
booleanJsonSchemaElement.meta.set('ref-origin', reference.uri);
|
|
1662
1670
|
// annotate fragment with info about referencing element
|
|
1663
|
-
booleanJsonSchemaElement.meta.set('ref-referencing-element-id',
|
|
1671
|
+
booleanJsonSchemaElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
1664
1672
|
path.replaceWith(booleanJsonSchemaElement);
|
|
1665
1673
|
return;
|
|
1666
1674
|
}
|
|
@@ -1685,7 +1693,7 @@ class Arazzo1DereferenceVisitor {
|
|
|
1685
1693
|
// annotate fragment with info about origin
|
|
1686
1694
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
1687
1695
|
// annotate fragment with info about referencing element
|
|
1688
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
1696
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
1689
1697
|
referencedElement = mergedElement;
|
|
1690
1698
|
}
|
|
1691
1699
|
/**
|
|
@@ -1976,8 +1984,8 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
1976
1984
|
* Applying semantics to a referenced element if semantics are missing.
|
|
1977
1985
|
*/
|
|
1978
1986
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement)(referencedElement)) {
|
|
1979
|
-
const referencedElementType =
|
|
1980
|
-
const cacheKey = `${referencedElementType}-${
|
|
1987
|
+
const referencedElementType = referencingElement.meta.get('referenced-element');
|
|
1988
|
+
const cacheKey = `${referencedElementType}-${identityManager.identify(referencedElement)}`;
|
|
1981
1989
|
if (this.refractCache.has(cacheKey)) {
|
|
1982
1990
|
referencedElement = this.refractCache.get(cacheKey);
|
|
1983
1991
|
} else if ((0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_11__.isReferenceLikeElement)(referencedElement)) {
|
|
@@ -2066,7 +2074,7 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
2066
2074
|
// annotate referenced element with info about origin
|
|
2067
2075
|
booleanJsonSchemaElement.meta.set('ref-origin', reference.uri);
|
|
2068
2076
|
// annotate fragment with info about referencing element
|
|
2069
|
-
booleanJsonSchemaElement.meta.set('ref-referencing-element-id',
|
|
2077
|
+
booleanJsonSchemaElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
2070
2078
|
path.replaceWith(booleanJsonSchemaElement);
|
|
2071
2079
|
return;
|
|
2072
2080
|
}
|
|
@@ -2084,7 +2092,7 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
2084
2092
|
// annotate fragment with info about origin
|
|
2085
2093
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
2086
2094
|
// annotate fragment with info about referencing element
|
|
2087
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
2095
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
2088
2096
|
|
|
2089
2097
|
/**
|
|
2090
2098
|
* Transclude referencing element with merged referenced element.
|
|
@@ -2132,7 +2140,7 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
2132
2140
|
* Applying semantics to a referenced element if semantics are missing.
|
|
2133
2141
|
*/
|
|
2134
2142
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement)(referencedElement)) {
|
|
2135
|
-
const cacheKey = `channel-item-${
|
|
2143
|
+
const cacheKey = `channel-item-${identityManager.identify(referencedElement)}`;
|
|
2136
2144
|
if (this.refractCache.has(cacheKey)) {
|
|
2137
2145
|
referencedElement = this.refractCache.get(cacheKey);
|
|
2138
2146
|
} else {
|
|
@@ -2222,7 +2230,7 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
2222
2230
|
// annotate referenced with info about origin
|
|
2223
2231
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
2224
2232
|
// annotate fragment with info about referencing element
|
|
2225
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
2233
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
2226
2234
|
referencedElement = mergedElement;
|
|
2227
2235
|
}
|
|
2228
2236
|
|
|
@@ -2517,8 +2525,8 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2517
2525
|
* Applying semantics to a referenced element if semantics are missing.
|
|
2518
2526
|
*/
|
|
2519
2527
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement)(referencedElement)) {
|
|
2520
|
-
const referencedElementType =
|
|
2521
|
-
const cacheKey = `${referencedElementType}-${
|
|
2528
|
+
const referencedElementType = referencingElement.meta.get('referenced-element');
|
|
2529
|
+
const cacheKey = `${referencedElementType}-${identityManager.identify(referencedElement)}`;
|
|
2522
2530
|
if (this.refractCache.has(cacheKey)) {
|
|
2523
2531
|
referencedElement = this.refractCache.get(cacheKey);
|
|
2524
2532
|
} else if ((0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_14__.isReferenceLikeElement)(referencedElement)) {
|
|
@@ -2609,7 +2617,7 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2609
2617
|
// annotate fragment with info about origin
|
|
2610
2618
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
2611
2619
|
// annotate fragment with info about referencing element
|
|
2612
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
2620
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
2613
2621
|
|
|
2614
2622
|
/**
|
|
2615
2623
|
* Transclude referencing element with merged referenced element.
|
|
@@ -2658,7 +2666,7 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2658
2666
|
* Applying semantics to a referenced element if semantics are missing.
|
|
2659
2667
|
*/
|
|
2660
2668
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement)(referencedElement)) {
|
|
2661
|
-
const cacheKey = `pathItem-${
|
|
2669
|
+
const cacheKey = `pathItem-${identityManager.identify(referencedElement)}`;
|
|
2662
2670
|
if (this.refractCache.has(cacheKey)) {
|
|
2663
2671
|
referencedElement = this.refractCache.get(cacheKey);
|
|
2664
2672
|
} else {
|
|
@@ -2746,7 +2754,7 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2746
2754
|
// annotate referenced element with info about origin
|
|
2747
2755
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
2748
2756
|
// annotate fragment with info about referencing element
|
|
2749
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
2757
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
2750
2758
|
referencedElement = mergedElement;
|
|
2751
2759
|
}
|
|
2752
2760
|
|
|
@@ -2794,8 +2802,8 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2794
2802
|
* Applying semantics to a referenced element if semantics are missing.
|
|
2795
2803
|
*/
|
|
2796
2804
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement)(referencedElement)) {
|
|
2797
|
-
const referencedElementType =
|
|
2798
|
-
const cacheKey = `path-item-${
|
|
2805
|
+
const referencedElementType = referencingElement.meta.get('referenced-element');
|
|
2806
|
+
const cacheKey = `path-item-${identityManager.identify(referencedElement)}`;
|
|
2799
2807
|
if (this.refractCache.has(cacheKey)) {
|
|
2800
2808
|
referencedElement = this.refractCache.get(cacheKey);
|
|
2801
2809
|
} else if ((0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__.isJSONReferenceLikeElement)(referencedElement)) {
|
|
@@ -2886,7 +2894,7 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2886
2894
|
// annotate fragment with info about origin
|
|
2887
2895
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
2888
2896
|
// annotate fragment with info about referencing element
|
|
2889
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
2897
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
2890
2898
|
|
|
2891
2899
|
/**
|
|
2892
2900
|
* Transclude referencing element with merged referenced element.
|
|
@@ -3180,8 +3188,8 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3180
3188
|
* Applying semantics to a referenced element if semantics are missing.
|
|
3181
3189
|
*/
|
|
3182
3190
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isPrimitiveElement)(referencedElement)) {
|
|
3183
|
-
const referencedElementType =
|
|
3184
|
-
const cacheKey = `${referencedElementType}-${
|
|
3191
|
+
const referencedElementType = referencingElement.meta.get('referenced-element');
|
|
3192
|
+
const cacheKey = `${referencedElementType}-${identityManager.identify(referencedElement)}`;
|
|
3185
3193
|
if (this.refractCache.has(cacheKey)) {
|
|
3186
3194
|
referencedElement = this.refractCache.get(cacheKey);
|
|
3187
3195
|
} else if ((0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.isReferenceLikeElement)(referencedElement)) {
|
|
@@ -3271,7 +3279,7 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3271
3279
|
// annotate fragment with info about origin
|
|
3272
3280
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
3273
3281
|
// annotate fragment with info about referencing element
|
|
3274
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
3282
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
3275
3283
|
|
|
3276
3284
|
/**
|
|
3277
3285
|
* Transclude referencing element with merged referenced element.
|
|
@@ -3319,7 +3327,7 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3319
3327
|
* Applying semantics to a referenced element if semantics are missing.
|
|
3320
3328
|
*/
|
|
3321
3329
|
if (!(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__.isPathItemElement)(referencedElement)) {
|
|
3322
|
-
const cacheKey = `path-item-${
|
|
3330
|
+
const cacheKey = `path-item-${identityManager.identify(referencedElement)}`;
|
|
3323
3331
|
if (this.refractCache.has(cacheKey)) {
|
|
3324
3332
|
referencedElement = this.refractCache.get(cacheKey);
|
|
3325
3333
|
} else {
|
|
@@ -3409,7 +3417,7 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3409
3417
|
// annotate referenced element with info about origin
|
|
3410
3418
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
3411
3419
|
// annotate fragment with info about referencing element
|
|
3412
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
3420
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
3413
3421
|
referencedElement = mergedElement;
|
|
3414
3422
|
}
|
|
3415
3423
|
|
|
@@ -3452,7 +3460,7 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3452
3460
|
operationElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.evaluate)(reference.value.result, jsonPointer);
|
|
3453
3461
|
// applying semantics to a referenced element
|
|
3454
3462
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isPrimitiveElement)(operationElement)) {
|
|
3455
|
-
const cacheKey = `operation-${
|
|
3463
|
+
const cacheKey = `operation-${identityManager.identify(operationElement)}`;
|
|
3456
3464
|
if (this.refractCache.has(cacheKey)) {
|
|
3457
3465
|
operationElement = this.refractCache.get(cacheKey);
|
|
3458
3466
|
} else {
|
|
@@ -3836,7 +3844,7 @@ const resolveSchema$refField = (retrievalURI, schemaElement) => {
|
|
|
3836
3844
|
return undefined;
|
|
3837
3845
|
}
|
|
3838
3846
|
const hash = _util_url_ts__WEBPACK_IMPORTED_MODULE_4__.getHash((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(schemaElement.$ref));
|
|
3839
|
-
const ancestorsSchemaIdentifiers =
|
|
3847
|
+
const ancestorsSchemaIdentifiers = schemaElement.meta.get('ancestorsSchemaIdentifiers');
|
|
3840
3848
|
const $refBaseURI = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])((acc, uri) => {
|
|
3841
3849
|
return _util_url_ts__WEBPACK_IMPORTED_MODULE_4__.resolve(acc, _util_url_ts__WEBPACK_IMPORTED_MODULE_4__.sanitize(_util_url_ts__WEBPACK_IMPORTED_MODULE_4__.stripHash(uri)));
|
|
3842
3850
|
}, retrievalURI, [...ancestorsSchemaIdentifiers, (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(schemaElement.$ref)]);
|
|
@@ -3850,7 +3858,7 @@ const resolveSchema$idField = (retrievalURI, schemaElement) => {
|
|
|
3850
3858
|
if (typeof schemaElement.$id === 'undefined') {
|
|
3851
3859
|
return undefined;
|
|
3852
3860
|
}
|
|
3853
|
-
const ancestorsSchemaIdentifiers =
|
|
3861
|
+
const ancestorsSchemaIdentifiers = schemaElement.meta.get('ancestorsSchemaIdentifiers');
|
|
3854
3862
|
return (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])((acc, $id) => {
|
|
3855
3863
|
return _util_url_ts__WEBPACK_IMPORTED_MODULE_4__.resolve(acc, _util_url_ts__WEBPACK_IMPORTED_MODULE_4__.sanitize(_util_url_ts__WEBPACK_IMPORTED_MODULE_4__.stripHash($id)));
|
|
3856
3864
|
}, retrievalURI, ancestorsSchemaIdentifiers);
|
|
@@ -4061,8 +4069,8 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4061
4069
|
|
|
4062
4070
|
// applying semantics to a fragment
|
|
4063
4071
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isPrimitiveElement)(referencedElement)) {
|
|
4064
|
-
const referencedElementType =
|
|
4065
|
-
const cacheKey = `${referencedElementType}-${
|
|
4072
|
+
const referencedElementType = referencingElement.meta.get('referenced-element');
|
|
4073
|
+
const cacheKey = `${referencedElementType}-${identityManager.identify(referencedElement)}`;
|
|
4066
4074
|
if (this.refractCache.has(cacheKey)) {
|
|
4067
4075
|
referencedElement = this.refractCache.get(cacheKey);
|
|
4068
4076
|
} else if ((0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_14__.isReferenceLikeElement)(referencedElement)) {
|
|
@@ -4156,7 +4164,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4156
4164
|
// annotate fragment with info about origin
|
|
4157
4165
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
4158
4166
|
// annotate fragment with info about referencing element
|
|
4159
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
4167
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
4160
4168
|
|
|
4161
4169
|
// override description and summary (outer has higher priority then inner)
|
|
4162
4170
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isObjectElement)(referencedElement) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isObjectElement)(mergedElement)) {
|
|
@@ -4219,7 +4227,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4219
4227
|
* Applying semantics to a referenced element if semantics are missing.
|
|
4220
4228
|
*/
|
|
4221
4229
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isPrimitiveElement)(referencedElement)) {
|
|
4222
|
-
const cacheKey = `path-item-${
|
|
4230
|
+
const cacheKey = `path-item-${identityManager.identify(referencedElement)}`;
|
|
4223
4231
|
if (this.refractCache.has(cacheKey)) {
|
|
4224
4232
|
referencedElement = this.refractCache.get(cacheKey);
|
|
4225
4233
|
} else {
|
|
@@ -4309,7 +4317,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4309
4317
|
// annotate referenced element with info about origin
|
|
4310
4318
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
4311
4319
|
// annotate fragment with info about referencing element
|
|
4312
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
4320
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
4313
4321
|
referencedElement = mergedElement;
|
|
4314
4322
|
}
|
|
4315
4323
|
|
|
@@ -4352,7 +4360,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4352
4360
|
operationElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.evaluate)(reference.value.result, jsonPointer);
|
|
4353
4361
|
// applying semantics to a referenced element
|
|
4354
4362
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isPrimitiveElement)(operationElement)) {
|
|
4355
|
-
const cacheKey = `operation-${
|
|
4363
|
+
const cacheKey = `operation-${identityManager.identify(operationElement)}`;
|
|
4356
4364
|
if (this.refractCache.has(cacheKey)) {
|
|
4357
4365
|
operationElement = this.refractCache.get(cacheKey);
|
|
4358
4366
|
} else {
|
|
@@ -4633,7 +4641,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4633
4641
|
// annotate referenced element with info about origin
|
|
4634
4642
|
booleanJsonSchemaElement.meta.set('ref-origin', reference.uri);
|
|
4635
4643
|
// annotate fragment with info about referencing element
|
|
4636
|
-
booleanJsonSchemaElement.meta.set('ref-referencing-element-id',
|
|
4644
|
+
booleanJsonSchemaElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
4637
4645
|
path.replaceWith(booleanJsonSchemaElement);
|
|
4638
4646
|
return;
|
|
4639
4647
|
}
|
|
@@ -4658,7 +4666,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4658
4666
|
// annotate fragment with info about origin
|
|
4659
4667
|
mergedElement.meta.set('ref-origin', reference.uri);
|
|
4660
4668
|
// annotate fragment with info about referencing element
|
|
4661
|
-
mergedElement.meta.set('ref-referencing-element-id',
|
|
4669
|
+
mergedElement.meta.set('ref-referencing-element-id', identityManager.identify(referencingElement));
|
|
4662
4670
|
referencedElement = mergedElement;
|
|
4663
4671
|
}
|
|
4664
4672
|
/**
|
|
@@ -5862,18 +5870,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5862
5870
|
/* harmony export */ parseSourceDescriptions: () => (/* binding */ parseSourceDescriptions)
|
|
5863
5871
|
/* harmony export */ });
|
|
5864
5872
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
5865
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
5866
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
5867
|
-
/* harmony import */ var
|
|
5868
|
-
/* harmony import */ var
|
|
5869
|
-
/* harmony import */ var
|
|
5870
|
-
/* harmony import */ var
|
|
5871
|
-
/* harmony import */ var
|
|
5872
|
-
/* harmony import */ var
|
|
5873
|
-
/* harmony import */ var
|
|
5874
|
-
/* harmony import */ var
|
|
5875
|
-
/* harmony import */ var
|
|
5876
|
-
/* harmony import */ var _index_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(35014);
|
|
5873
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84660);
|
|
5874
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4823);
|
|
5875
|
+
/* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28839);
|
|
5876
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
5877
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32131);
|
|
5878
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(76332);
|
|
5879
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44673);
|
|
5880
|
+
/* harmony import */ var _File_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(10682);
|
|
5881
|
+
/* harmony import */ var _util_url_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(30658);
|
|
5882
|
+
/* harmony import */ var _options_util_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(86547);
|
|
5883
|
+
/* harmony import */ var _index_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(35014);
|
|
5877
5884
|
|
|
5878
5885
|
|
|
5879
5886
|
|
|
@@ -5892,9 +5899,9 @@ const ARAZZO_RECURSION_KEY = 'arazzo-1';
|
|
|
5892
5899
|
* Returns ParseResultElement on success, or undefined if skipped.
|
|
5893
5900
|
*/
|
|
5894
5901
|
async function parseSourceDescription(sourceDescription, ctx) {
|
|
5895
|
-
const parseResult = new
|
|
5896
|
-
if (!(0,
|
|
5897
|
-
const annotation = new
|
|
5902
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
5903
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__.isSourceDescriptionElement)(sourceDescription)) {
|
|
5904
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"]('Element is not a valid SourceDescriptionElement. Skipping');
|
|
5898
5905
|
annotation.classes.push('warning');
|
|
5899
5906
|
parseResult.push(annotation);
|
|
5900
5907
|
return parseResult;
|
|
@@ -5902,30 +5909,30 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
5902
5909
|
|
|
5903
5910
|
// set class and metadata from source description element
|
|
5904
5911
|
parseResult.classes.push('source-description');
|
|
5905
|
-
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.name)) parseResult.setMetaProperty('name', (0,
|
|
5906
|
-
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.type)) parseResult.setMetaProperty('type', (0,
|
|
5907
|
-
const sourceDescriptionURI = (0,
|
|
5912
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.name)) parseResult.setMetaProperty('name', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(sourceDescription.name));
|
|
5913
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(sourceDescription.type)) parseResult.setMetaProperty('type', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(sourceDescription.type));
|
|
5914
|
+
const sourceDescriptionURI = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(sourceDescription.url);
|
|
5908
5915
|
if (typeof sourceDescriptionURI !== 'string') {
|
|
5909
|
-
const annotation = new
|
|
5916
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"]('Source description URL is missing or not a string. Skipping');
|
|
5910
5917
|
annotation.classes.push('warning');
|
|
5911
5918
|
parseResult.push(annotation);
|
|
5912
5919
|
return parseResult;
|
|
5913
5920
|
}
|
|
5914
5921
|
|
|
5915
5922
|
// normalize URI for consistent cycle detection and cache key matching
|
|
5916
|
-
const retrievalURI =
|
|
5923
|
+
const retrievalURI = _util_url_ts__WEBPACK_IMPORTED_MODULE_9__.sanitize(_util_url_ts__WEBPACK_IMPORTED_MODULE_9__.stripHash(_util_url_ts__WEBPACK_IMPORTED_MODULE_9__.resolve(ctx.baseURI, sourceDescriptionURI)));
|
|
5917
5924
|
parseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
5918
5925
|
|
|
5919
5926
|
// skip if already visited (cycle detection)
|
|
5920
5927
|
if (ctx.visitedUrls.has(retrievalURI)) {
|
|
5921
|
-
const annotation = new
|
|
5928
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Source description "${retrievalURI}" has already been visited. Skipping to prevent cycle`);
|
|
5922
5929
|
annotation.classes.push('warning');
|
|
5923
5930
|
parseResult.push(annotation);
|
|
5924
5931
|
return parseResult;
|
|
5925
5932
|
}
|
|
5926
5933
|
ctx.visitedUrls.add(retrievalURI);
|
|
5927
5934
|
try {
|
|
5928
|
-
const sourceDescriptionParseResult = await (0,
|
|
5935
|
+
const sourceDescriptionParseResult = await (0,_index_ts__WEBPACK_IMPORTED_MODULE_11__["default"])(retrievalURI, (0,_options_util_ts__WEBPACK_IMPORTED_MODULE_10__.merge)(ctx.options, {
|
|
5929
5936
|
parse: {
|
|
5930
5937
|
mediaType: 'text/plain',
|
|
5931
5938
|
// allow parser plugin detection
|
|
@@ -5947,7 +5954,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
5947
5954
|
} catch (error) {
|
|
5948
5955
|
// create error annotation instead of failing entire parse
|
|
5949
5956
|
const message = error instanceof Error ? error.message : String(error);
|
|
5950
|
-
const annotation = new
|
|
5957
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Error parsing source description "${retrievalURI}": ${message}`);
|
|
5951
5958
|
annotation.classes.push('error');
|
|
5952
5959
|
parseResult.push(annotation);
|
|
5953
5960
|
return parseResult;
|
|
@@ -5957,24 +5964,24 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
5957
5964
|
const {
|
|
5958
5965
|
api: sourceDescriptionAPI
|
|
5959
5966
|
} = parseResult;
|
|
5960
|
-
const isOpenApi = (0,
|
|
5961
|
-
const isArazzo = (0,
|
|
5967
|
+
const isOpenApi = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_4__.isSwaggerElement)(sourceDescriptionAPI) || (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_5__.isOpenApi3_0Element)(sourceDescriptionAPI) || (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__.isOpenApi3_1Element)(sourceDescriptionAPI);
|
|
5968
|
+
const isArazzo = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__.isArazzoSpecification1Element)(sourceDescriptionAPI);
|
|
5962
5969
|
if (!isOpenApi && !isArazzo) {
|
|
5963
|
-
const annotation = new
|
|
5970
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Source description "${retrievalURI}" is not an OpenAPI or Arazzo document`);
|
|
5964
5971
|
annotation.classes.push('warning');
|
|
5965
5972
|
parseResult.push(annotation);
|
|
5966
5973
|
return parseResult;
|
|
5967
5974
|
}
|
|
5968
5975
|
|
|
5969
5976
|
// validate declared type matches actual parsed type
|
|
5970
|
-
const declaredType = (0,
|
|
5977
|
+
const declaredType = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(sourceDescription.type);
|
|
5971
5978
|
if (typeof declaredType === 'string') {
|
|
5972
5979
|
if (declaredType === 'openapi' && !isOpenApi) {
|
|
5973
|
-
const annotation = new
|
|
5980
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Source description "${retrievalURI}" declared as "openapi" but parsed as Arazzo document`);
|
|
5974
5981
|
annotation.classes.push('warning');
|
|
5975
5982
|
parseResult.push(annotation);
|
|
5976
5983
|
} else if (declaredType === 'arazzo' && !isArazzo) {
|
|
5977
|
-
const annotation = new
|
|
5984
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Source description "${retrievalURI}" declared as "arazzo" but parsed as OpenAPI document`);
|
|
5978
5985
|
annotation.classes.push('warning');
|
|
5979
5986
|
parseResult.push(annotation);
|
|
5980
5987
|
}
|
|
@@ -6029,8 +6036,8 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
6029
6036
|
const {
|
|
6030
6037
|
api
|
|
6031
6038
|
} = parseResult;
|
|
6032
|
-
const file = new
|
|
6033
|
-
uri:
|
|
6039
|
+
const file = new _File_ts__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
6040
|
+
uri: _util_url_ts__WEBPACK_IMPORTED_MODULE_9__.sanitize(_util_url_ts__WEBPACK_IMPORTED_MODULE_9__.stripHash(parseResultRetrievalURI))
|
|
6034
6041
|
});
|
|
6035
6042
|
const results = [];
|
|
6036
6043
|
|
|
@@ -6038,15 +6045,15 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
6038
6045
|
* Validate prerequisites for parsing source descriptions.
|
|
6039
6046
|
* Return warning annotations if validation fails.
|
|
6040
6047
|
*/
|
|
6041
|
-
if (!(0,
|
|
6042
|
-
const annotation = new
|
|
6048
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__.isArazzoSpecification1Element)(api)) {
|
|
6049
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot parse source descriptions: API is not an Arazzo specification');
|
|
6043
6050
|
annotation.classes.push('warning');
|
|
6044
|
-
return [new
|
|
6051
|
+
return [new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]([annotation])];
|
|
6045
6052
|
}
|
|
6046
6053
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isArrayElement)(api.sourceDescriptions)) {
|
|
6047
|
-
const annotation = new
|
|
6054
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot parse source descriptions: sourceDescriptions field is missing or not an array');
|
|
6048
6055
|
annotation.classes.push('warning');
|
|
6049
|
-
return [new
|
|
6056
|
+
return [new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]([annotation])];
|
|
6050
6057
|
}
|
|
6051
6058
|
|
|
6052
6059
|
// user config: parser-specific options take precedence over global parserOpts
|
|
@@ -6060,9 +6067,9 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
6060
6067
|
// add current file to visited URLs to prevent cycles
|
|
6061
6068
|
visitedUrls.add(file.uri);
|
|
6062
6069
|
if (currentDepth >= maxDepth) {
|
|
6063
|
-
const annotation = new
|
|
6070
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"](`Maximum parse depth of ${maxDepth} has been exceeded by file "${file.uri}"`);
|
|
6064
6071
|
annotation.classes.push('error');
|
|
6065
|
-
const parseResult = new
|
|
6072
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]([annotation]);
|
|
6066
6073
|
parseResult.classes.push('source-description');
|
|
6067
6074
|
return [parseResult];
|
|
6068
6075
|
}
|
|
@@ -6076,8 +6083,8 @@ async function parseSourceDescriptions(parseResult, parseResultRetrievalURI, opt
|
|
|
6076
6083
|
// determine which source descriptions to parse (array filters by name)
|
|
6077
6084
|
const sourceDescriptionsOption = options?.parse?.parserOpts?.[parserName]?.sourceDescriptions ?? options?.parse?.parserOpts?.sourceDescriptions;
|
|
6078
6085
|
const sourceDescriptions = Array.isArray(sourceDescriptionsOption) ? api.sourceDescriptions.filter(sd => {
|
|
6079
|
-
if (!(0,
|
|
6080
|
-
const name = (0,
|
|
6086
|
+
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__.isSourceDescriptionElement)(sd)) return false;
|
|
6087
|
+
const name = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(sd.name);
|
|
6081
6088
|
return typeof name === 'string' && sourceDescriptionsOption.includes(name);
|
|
6082
6089
|
}) : api.sourceDescriptions;
|
|
6083
6090
|
|
|
@@ -47081,9 +47088,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47081
47088
|
/* harmony export */ defaultIdentityManager: () => (/* binding */ defaultIdentityManager)
|
|
47082
47089
|
/* harmony export */ });
|
|
47083
47090
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
47084
|
-
/* harmony import */ var
|
|
47085
|
-
/* harmony import */ var
|
|
47086
|
-
/* harmony import */ var _errors_ElementIdentityError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53770);
|
|
47091
|
+
/* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24279);
|
|
47092
|
+
/* harmony import */ var _errors_ElementIdentityError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53770);
|
|
47087
47093
|
|
|
47088
47094
|
|
|
47089
47095
|
|
|
@@ -47096,23 +47102,23 @@ class IdentityManager {
|
|
|
47096
47102
|
constructor({
|
|
47097
47103
|
length = 6
|
|
47098
47104
|
} = {}) {
|
|
47099
|
-
this.uuid = new
|
|
47105
|
+
this.uuid = new short_unique_id__WEBPACK_IMPORTED_MODULE_1__({
|
|
47100
47106
|
length
|
|
47101
47107
|
});
|
|
47102
47108
|
this.identityMap = new WeakMap();
|
|
47103
47109
|
}
|
|
47104
47110
|
identify(element) {
|
|
47105
47111
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(element)) {
|
|
47106
|
-
throw new
|
|
47112
|
+
throw new _errors_ElementIdentityError_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]('Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.', {
|
|
47107
47113
|
value: element
|
|
47108
47114
|
});
|
|
47109
47115
|
}
|
|
47110
47116
|
|
|
47111
47117
|
// use already assigned identity
|
|
47112
47118
|
if (element.hasMetaProperty('id')) {
|
|
47113
|
-
const existingId = element.
|
|
47114
|
-
if (
|
|
47115
|
-
return
|
|
47119
|
+
const existingId = element.id;
|
|
47120
|
+
if (typeof existingId === 'string' && existingId !== '') {
|
|
47121
|
+
return existingId;
|
|
47116
47122
|
}
|
|
47117
47123
|
}
|
|
47118
47124
|
|
|
@@ -47122,7 +47128,7 @@ class IdentityManager {
|
|
|
47122
47128
|
}
|
|
47123
47129
|
|
|
47124
47130
|
// return element identity
|
|
47125
|
-
const id =
|
|
47131
|
+
const id = this.generateId();
|
|
47126
47132
|
this.identityMap.set(element, id);
|
|
47127
47133
|
return id;
|
|
47128
47134
|
}
|
|
@@ -47222,7 +47228,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47222
47228
|
* @public
|
|
47223
47229
|
*/
|
|
47224
47230
|
const emptyElement = element => {
|
|
47225
|
-
const meta = !element.isMetaEmpty ?
|
|
47231
|
+
const meta = !element.isMetaEmpty ? element.meta.cloneDeep() : undefined;
|
|
47226
47232
|
const attributes = !element.isAttributesEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes) : undefined;
|
|
47227
47233
|
|
|
47228
47234
|
// @ts-ignore
|
|
@@ -47238,7 +47244,7 @@ const getMergeFunction = (keyElement, options) => {
|
|
|
47238
47244
|
};
|
|
47239
47245
|
const getMetaMergeFunction = options => {
|
|
47240
47246
|
if (typeof options.customMetaMerge !== 'function') {
|
|
47241
|
-
return targetMeta =>
|
|
47247
|
+
return targetMeta => targetMeta.cloneDeep();
|
|
47242
47248
|
}
|
|
47243
47249
|
return options.customMetaMerge;
|
|
47244
47250
|
};
|
|
@@ -47310,8 +47316,20 @@ const deepmerge = (targetElement, sourceElement, options) => {
|
|
|
47310
47316
|
const mergedElement = sourceIsArrayElement && typeof mergedOptions.arrayElementMerge === 'function' ? mergedOptions.arrayElementMerge(targetElement, sourceElement, mergedOptions) : mergedOptions.objectElementMerge(targetElement, sourceElement, mergedOptions);
|
|
47311
47317
|
|
|
47312
47318
|
// merging meta & attributes
|
|
47313
|
-
|
|
47314
|
-
|
|
47319
|
+
if (!targetElement.isMetaEmpty && !sourceElement.isMetaEmpty) {
|
|
47320
|
+
mergedElement.meta = getMetaMergeFunction(mergedOptions)(targetElement.meta, sourceElement.meta);
|
|
47321
|
+
} else if (!targetElement.isMetaEmpty) {
|
|
47322
|
+
mergedElement.meta = targetElement.meta.cloneDeep();
|
|
47323
|
+
} else if (!sourceElement.isMetaEmpty) {
|
|
47324
|
+
mergedElement.meta = sourceElement.meta.cloneDeep();
|
|
47325
|
+
}
|
|
47326
|
+
if (!targetElement.isAttributesEmpty && !sourceElement.isAttributesEmpty) {
|
|
47327
|
+
mergedElement.attributes = getAttributesMergeFunction(mergedOptions)(targetElement.attributes, sourceElement.attributes);
|
|
47328
|
+
} else if (!targetElement.isAttributesEmpty) {
|
|
47329
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetElement.attributes);
|
|
47330
|
+
} else if (!sourceElement.isAttributesEmpty) {
|
|
47331
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(sourceElement.attributes);
|
|
47332
|
+
}
|
|
47315
47333
|
return mergedElement;
|
|
47316
47334
|
};
|
|
47317
47335
|
deepmerge.all = (list, options) => {
|
|
@@ -47650,6 +47668,105 @@ class KeyValuePair {
|
|
|
47650
47668
|
|
|
47651
47669
|
/***/ },
|
|
47652
47670
|
|
|
47671
|
+
/***/ 51844
|
|
47672
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
47673
|
+
|
|
47674
|
+
"use strict";
|
|
47675
|
+
__webpack_require__.r(__webpack_exports__);
|
|
47676
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
47677
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
47678
|
+
/* harmony export */ });
|
|
47679
|
+
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
47680
|
+
|
|
47681
|
+
/**
|
|
47682
|
+
* Lightweight meta container for Element metadata.
|
|
47683
|
+
*
|
|
47684
|
+
* Data is stored as own properties on the instance; methods live on the prototype.
|
|
47685
|
+
* `Object.keys()`, `Object.entries()`, etc. only see data properties.
|
|
47686
|
+
*
|
|
47687
|
+
* @public
|
|
47688
|
+
*/
|
|
47689
|
+
class Metadata {
|
|
47690
|
+
// Set via prototype assignment in registration.ts to avoid circular dependency
|
|
47691
|
+
|
|
47692
|
+
get(name) {
|
|
47693
|
+
return this[name];
|
|
47694
|
+
}
|
|
47695
|
+
set(name, value) {
|
|
47696
|
+
this[name] = value;
|
|
47697
|
+
}
|
|
47698
|
+
hasKey(name) {
|
|
47699
|
+
return Object.hasOwn(this, name);
|
|
47700
|
+
}
|
|
47701
|
+
keys() {
|
|
47702
|
+
return Object.keys(this);
|
|
47703
|
+
}
|
|
47704
|
+
remove(name) {
|
|
47705
|
+
delete this[name];
|
|
47706
|
+
}
|
|
47707
|
+
get isEmpty() {
|
|
47708
|
+
return Object.keys(this).length === 0;
|
|
47709
|
+
}
|
|
47710
|
+
get isFrozen() {
|
|
47711
|
+
return Object.isFrozen(this);
|
|
47712
|
+
}
|
|
47713
|
+
freeze() {
|
|
47714
|
+
for (const value of Object.values(this)) {
|
|
47715
|
+
if (value instanceof this.Element) {
|
|
47716
|
+
value.freeze();
|
|
47717
|
+
} else if (Array.isArray(value) || value !== null && typeof value === 'object') {
|
|
47718
|
+
Object.freeze(value);
|
|
47719
|
+
}
|
|
47720
|
+
}
|
|
47721
|
+
Object.freeze(this);
|
|
47722
|
+
}
|
|
47723
|
+
|
|
47724
|
+
/**
|
|
47725
|
+
* Creates a shallow clone. Same references, new container.
|
|
47726
|
+
*/
|
|
47727
|
+
cloneShallow() {
|
|
47728
|
+
const clone = new Metadata();
|
|
47729
|
+
Object.assign(clone, this);
|
|
47730
|
+
return clone;
|
|
47731
|
+
}
|
|
47732
|
+
|
|
47733
|
+
/**
|
|
47734
|
+
* Merges another Metadata into a new instance.
|
|
47735
|
+
* Arrays are concatenated, all other values are overwritten by source.
|
|
47736
|
+
*/
|
|
47737
|
+
merge(source) {
|
|
47738
|
+
const result = this.cloneShallow();
|
|
47739
|
+
for (const [key, value] of Object.entries(source)) {
|
|
47740
|
+
const existing = result.get(key);
|
|
47741
|
+
if (Array.isArray(existing) && Array.isArray(value)) {
|
|
47742
|
+
result.set(key, [...existing, ...value]);
|
|
47743
|
+
} else {
|
|
47744
|
+
result.set(key, value);
|
|
47745
|
+
}
|
|
47746
|
+
}
|
|
47747
|
+
return result;
|
|
47748
|
+
}
|
|
47749
|
+
|
|
47750
|
+
/**
|
|
47751
|
+
* Creates a deep clone. Elements are deep cloned,
|
|
47752
|
+
* all other values are deep cloned via ramda clone.
|
|
47753
|
+
*/
|
|
47754
|
+
cloneDeep() {
|
|
47755
|
+
const copy = new Metadata();
|
|
47756
|
+
for (const [key, value] of Object.entries(this)) {
|
|
47757
|
+
if (value instanceof this.Element) {
|
|
47758
|
+
copy.set(key, this.cloneDeepElement(value));
|
|
47759
|
+
} else {
|
|
47760
|
+
copy.set(key, (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(value));
|
|
47761
|
+
}
|
|
47762
|
+
}
|
|
47763
|
+
return copy;
|
|
47764
|
+
}
|
|
47765
|
+
}
|
|
47766
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Metadata);
|
|
47767
|
+
|
|
47768
|
+
/***/ },
|
|
47769
|
+
|
|
47653
47770
|
/***/ 55156
|
|
47654
47771
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
47655
47772
|
|
|
@@ -48296,7 +48413,7 @@ const cloneShallowElement = element => {
|
|
|
48296
48413
|
const copy = new Ctor();
|
|
48297
48414
|
copy.element = element.element;
|
|
48298
48415
|
if (!element.isMetaEmpty) {
|
|
48299
|
-
copy.meta =
|
|
48416
|
+
copy.meta = element.meta.cloneDeep();
|
|
48300
48417
|
}
|
|
48301
48418
|
if (!element.isAttributesEmpty) {
|
|
48302
48419
|
copy.attributes = cloneDeep(element.attributes);
|
|
@@ -48324,8 +48441,8 @@ const cloneShallowElement = element => {
|
|
|
48324
48441
|
|
|
48325
48442
|
/**
|
|
48326
48443
|
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
|
|
48327
|
-
* The element itself is cloned, but content references are shared
|
|
48328
|
-
*
|
|
48444
|
+
* The element itself is cloned, but content references are shared.
|
|
48445
|
+
* Meta and attributes are deep cloned to preserve semantic information.
|
|
48329
48446
|
* @public
|
|
48330
48447
|
*/
|
|
48331
48448
|
const cloneShallow = value => {
|
|
@@ -49400,7 +49517,7 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
49400
49517
|
* Search the tree recursively and find the element with the matching ID.
|
|
49401
49518
|
*/
|
|
49402
49519
|
getById(id) {
|
|
49403
|
-
return this.find(item => item.id
|
|
49520
|
+
return this.find(item => item.id === id).first;
|
|
49404
49521
|
}
|
|
49405
49522
|
|
|
49406
49523
|
/**
|
|
@@ -49430,18 +49547,24 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
49430
49547
|
"use strict";
|
|
49431
49548
|
__webpack_require__.r(__webpack_exports__);
|
|
49432
49549
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
49550
|
+
/* harmony export */ Metadata: () => (/* reexport safe */ _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
49433
49551
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
49434
49552
|
/* harmony export */ });
|
|
49435
49553
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
49436
|
-
/* harmony import */ var
|
|
49437
|
-
/* harmony import */ var
|
|
49554
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51844);
|
|
49555
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
49556
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38504);
|
|
49557
|
+
|
|
49438
49558
|
|
|
49439
49559
|
|
|
49560
|
+
// shared singleton for frozen elements with no meta — avoids allocation on every access
|
|
49561
|
+
const FROZEN_EMPTY_METADATA = Object.freeze(new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]());
|
|
49440
49562
|
|
|
49441
49563
|
/**
|
|
49442
49564
|
* Valid content types for an Element.
|
|
49443
49565
|
* @public
|
|
49444
49566
|
*/
|
|
49567
|
+
|
|
49445
49568
|
/**
|
|
49446
49569
|
* Base Element class that all ApiDOM elements extend.
|
|
49447
49570
|
*
|
|
@@ -49539,7 +49662,7 @@ class Element {
|
|
|
49539
49662
|
_attributes;
|
|
49540
49663
|
|
|
49541
49664
|
// ============================================================
|
|
49542
|
-
// Prototype-assigned properties (set in
|
|
49665
|
+
// Prototype-assigned properties (set in registration.ts)
|
|
49543
49666
|
// Using 'declare' allows TypeScript to know about these
|
|
49544
49667
|
// without generating runtime code.
|
|
49545
49668
|
// ============================================================
|
|
@@ -49600,13 +49723,13 @@ class Element {
|
|
|
49600
49723
|
}
|
|
49601
49724
|
|
|
49602
49725
|
// KeyValuePair
|
|
49603
|
-
if (value instanceof
|
|
49726
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
49604
49727
|
this._content = value;
|
|
49605
49728
|
return;
|
|
49606
49729
|
}
|
|
49607
49730
|
|
|
49608
49731
|
// ObjectSlice - extract elements array
|
|
49609
|
-
if (value instanceof
|
|
49732
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
49610
49733
|
this._content = value.elements;
|
|
49611
49734
|
return;
|
|
49612
49735
|
}
|
|
@@ -49627,24 +49750,22 @@ class Element {
|
|
|
49627
49750
|
|
|
49628
49751
|
/**
|
|
49629
49752
|
* Metadata about this element (id, classes, title, description, links).
|
|
49630
|
-
* Lazily creates
|
|
49753
|
+
* Lazily creates a Metadata instance if not set.
|
|
49631
49754
|
*/
|
|
49632
49755
|
get meta() {
|
|
49633
49756
|
if (!this._meta) {
|
|
49634
|
-
if (this.isFrozen)
|
|
49635
|
-
|
|
49636
|
-
meta.freeze();
|
|
49637
|
-
return meta;
|
|
49638
|
-
}
|
|
49639
|
-
this._meta = new this.ObjectElement();
|
|
49757
|
+
if (this.isFrozen) return FROZEN_EMPTY_METADATA;
|
|
49758
|
+
this._meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
49640
49759
|
}
|
|
49641
49760
|
return this._meta;
|
|
49642
49761
|
}
|
|
49643
49762
|
set meta(value) {
|
|
49644
|
-
if (value instanceof
|
|
49763
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
49645
49764
|
this._meta = value;
|
|
49646
|
-
} else {
|
|
49647
|
-
|
|
49765
|
+
} else if (value && typeof value === 'object') {
|
|
49766
|
+
const meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
49767
|
+
Object.assign(meta, value);
|
|
49768
|
+
this._meta = meta;
|
|
49648
49769
|
}
|
|
49649
49770
|
}
|
|
49650
49771
|
|
|
@@ -49677,10 +49798,8 @@ class Element {
|
|
|
49677
49798
|
|
|
49678
49799
|
/** Unique identifier for this element. */
|
|
49679
49800
|
get id() {
|
|
49680
|
-
if (this.isFrozen) {
|
|
49681
|
-
return this.getMetaProperty('id', '');
|
|
49682
|
-
}
|
|
49683
49801
|
if (!this.hasMetaProperty('id')) {
|
|
49802
|
+
if (this.isFrozen) return '';
|
|
49684
49803
|
this.setMetaProperty('id', '');
|
|
49685
49804
|
}
|
|
49686
49805
|
return this.meta.get('id');
|
|
@@ -49691,10 +49810,8 @@ class Element {
|
|
|
49691
49810
|
|
|
49692
49811
|
/** CSS-like class names. */
|
|
49693
49812
|
get classes() {
|
|
49694
|
-
if (this.isFrozen) {
|
|
49695
|
-
return this.getMetaProperty('classes', []);
|
|
49696
|
-
}
|
|
49697
49813
|
if (!this.hasMetaProperty('classes')) {
|
|
49814
|
+
if (this.isFrozen) return [];
|
|
49698
49815
|
this.setMetaProperty('classes', []);
|
|
49699
49816
|
}
|
|
49700
49817
|
return this.meta.get('classes');
|
|
@@ -49705,11 +49822,13 @@ class Element {
|
|
|
49705
49822
|
|
|
49706
49823
|
/** Hyperlinks associated with this element. */
|
|
49707
49824
|
get links() {
|
|
49708
|
-
if (this.isFrozen) {
|
|
49709
|
-
return this.getMetaProperty('links', []);
|
|
49710
|
-
}
|
|
49711
49825
|
if (!this.hasMetaProperty('links')) {
|
|
49712
|
-
this.
|
|
49826
|
+
if (this.isFrozen) {
|
|
49827
|
+
const empty = new this.ArrayElement();
|
|
49828
|
+
empty.freeze();
|
|
49829
|
+
return empty;
|
|
49830
|
+
}
|
|
49831
|
+
this.setMetaProperty('links', new this.ArrayElement());
|
|
49713
49832
|
}
|
|
49714
49833
|
return this.meta.get('links');
|
|
49715
49834
|
}
|
|
@@ -49729,7 +49848,7 @@ class Element {
|
|
|
49729
49848
|
if (Array.isArray(content)) {
|
|
49730
49849
|
return content;
|
|
49731
49850
|
}
|
|
49732
|
-
if (content instanceof
|
|
49851
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
49733
49852
|
const children = [];
|
|
49734
49853
|
if (content.key) children.push(content.key);
|
|
49735
49854
|
if (content.value) children.push(content.value);
|
|
@@ -49759,7 +49878,6 @@ class Element {
|
|
|
49759
49878
|
|
|
49760
49879
|
// Freeze meta and attributes
|
|
49761
49880
|
if (this._meta) {
|
|
49762
|
-
this._meta.parent = this;
|
|
49763
49881
|
this._meta.freeze();
|
|
49764
49882
|
}
|
|
49765
49883
|
if (this._attributes) {
|
|
@@ -49794,7 +49912,7 @@ class Element {
|
|
|
49794
49912
|
if (_content instanceof Element) {
|
|
49795
49913
|
return _content.toValue();
|
|
49796
49914
|
}
|
|
49797
|
-
if (_content instanceof
|
|
49915
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
49798
49916
|
return _content.toValue();
|
|
49799
49917
|
}
|
|
49800
49918
|
if (Array.isArray(_content)) {
|
|
@@ -49850,7 +49968,7 @@ class Element {
|
|
|
49850
49968
|
* @throws Error if this element has no ID
|
|
49851
49969
|
*/
|
|
49852
49970
|
toRef(path) {
|
|
49853
|
-
const idValue = this.id
|
|
49971
|
+
const idValue = this.id;
|
|
49854
49972
|
if (idValue === '') {
|
|
49855
49973
|
throw new Error('Cannot create reference to an element without an ID');
|
|
49856
49974
|
}
|
|
@@ -49862,26 +49980,16 @@ class Element {
|
|
|
49862
49980
|
}
|
|
49863
49981
|
|
|
49864
49982
|
/**
|
|
49865
|
-
* Gets a meta property.
|
|
49983
|
+
* Gets a meta property value.
|
|
49866
49984
|
*
|
|
49867
49985
|
* When the property doesn't exist:
|
|
49868
|
-
* - With defaultValue: returns
|
|
49986
|
+
* - With defaultValue: returns the provided default value
|
|
49869
49987
|
* - Without defaultValue: returns undefined
|
|
49870
|
-
*
|
|
49871
|
-
* Note: Each call with a default creates a new instance. Use setMetaProperty
|
|
49872
|
-
* first if you need reference equality across multiple accesses.
|
|
49873
49988
|
*/
|
|
49874
49989
|
|
|
49875
49990
|
getMetaProperty(name, defaultValue) {
|
|
49876
49991
|
if (!this.hasMetaProperty(name)) {
|
|
49877
|
-
|
|
49878
|
-
return undefined;
|
|
49879
|
-
}
|
|
49880
|
-
const element = this.refract(defaultValue);
|
|
49881
|
-
if (element && this.isFrozen) {
|
|
49882
|
-
element.freeze();
|
|
49883
|
-
}
|
|
49884
|
-
return element;
|
|
49992
|
+
return defaultValue;
|
|
49885
49993
|
}
|
|
49886
49994
|
return this.meta.get(name);
|
|
49887
49995
|
}
|
|
@@ -49894,20 +50002,17 @@ class Element {
|
|
|
49894
50002
|
}
|
|
49895
50003
|
|
|
49896
50004
|
/**
|
|
49897
|
-
*
|
|
50005
|
+
* Checks whether a meta property exists.
|
|
49898
50006
|
*/
|
|
49899
50007
|
hasMetaProperty(name) {
|
|
49900
|
-
|
|
49901
|
-
return this.meta.hasKey(name);
|
|
49902
|
-
}
|
|
49903
|
-
return false;
|
|
50008
|
+
return this._meta !== undefined && this._meta.hasKey(name);
|
|
49904
50009
|
}
|
|
49905
50010
|
|
|
49906
50011
|
/**
|
|
49907
50012
|
* Checks if meta is empty.
|
|
49908
50013
|
*/
|
|
49909
50014
|
get isMetaEmpty() {
|
|
49910
|
-
return this._meta === undefined || this.
|
|
50015
|
+
return this._meta === undefined || this._meta.isEmpty;
|
|
49911
50016
|
}
|
|
49912
50017
|
|
|
49913
50018
|
/**
|
|
@@ -49933,7 +50038,7 @@ class Element {
|
|
|
49933
50038
|
}
|
|
49934
50039
|
|
|
49935
50040
|
/**
|
|
49936
|
-
*
|
|
50041
|
+
* Checks whether an attributes property exists.
|
|
49937
50042
|
*/
|
|
49938
50043
|
hasAttributesProperty(name) {
|
|
49939
50044
|
if (!this.isAttributesEmpty) {
|
|
@@ -49952,6 +50057,7 @@ class Element {
|
|
|
49952
50057
|
|
|
49953
50058
|
// Re-export types for convenience
|
|
49954
50059
|
|
|
50060
|
+
|
|
49955
50061
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Element);
|
|
49956
50062
|
|
|
49957
50063
|
/***/ },
|
|
@@ -50390,6 +50496,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50390
50496
|
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(49686);
|
|
50391
50497
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(38504);
|
|
50392
50498
|
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36663);
|
|
50499
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(51844);
|
|
50500
|
+
/* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(12111);
|
|
50501
|
+
|
|
50502
|
+
|
|
50393
50503
|
|
|
50394
50504
|
|
|
50395
50505
|
|
|
@@ -50449,14 +50559,16 @@ function refract(value) {
|
|
|
50449
50559
|
}
|
|
50450
50560
|
|
|
50451
50561
|
// Set up prototype assignments for circular dependency resolution.
|
|
50452
|
-
// These allow Element instances to
|
|
50453
|
-
//
|
|
50562
|
+
// These allow Element and Metadata instances to reference classes they can't import
|
|
50563
|
+
// directly (which would cause circular imports).
|
|
50454
50564
|
// Using 'declare' in the class definitions enables type-safe access to these properties.
|
|
50455
50565
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement = _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"];
|
|
50456
50566
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ArrayElement = _primitives_ArrayElement_mjs__WEBPACK_IMPORTED_MODULE_6__["default"];
|
|
50457
50567
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.RefElement = _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"];
|
|
50458
50568
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.MemberElement = _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"];
|
|
50459
50569
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.refract = refract;
|
|
50570
|
+
_Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.Element = _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
50571
|
+
_Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.cloneDeepElement = element => (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_19__.cloneDeep)(element);
|
|
50460
50572
|
|
|
50461
50573
|
/**
|
|
50462
50574
|
* Contains all of the element classes, and related structures and methods
|
|
@@ -50521,7 +50633,13 @@ class JSONSerialiser {
|
|
|
50521
50633
|
element: element.element
|
|
50522
50634
|
};
|
|
50523
50635
|
if (!element.isMetaEmpty) {
|
|
50524
|
-
|
|
50636
|
+
const serialisedMeta = this.serialiseMeta(element);
|
|
50637
|
+
if (serialisedMeta) {
|
|
50638
|
+
payload.meta = serialisedMeta.meta;
|
|
50639
|
+
if (serialisedMeta.rawKeys.length > 0) {
|
|
50640
|
+
payload.__meta_raw__ = serialisedMeta.rawKeys;
|
|
50641
|
+
}
|
|
50642
|
+
}
|
|
50525
50643
|
}
|
|
50526
50644
|
if (!element.isAttributesEmpty) {
|
|
50527
50645
|
payload.attributes = this.serialiseObject(element.attributes);
|
|
@@ -50568,7 +50686,7 @@ class JSONSerialiser {
|
|
|
50568
50686
|
element.element = value.element;
|
|
50569
50687
|
}
|
|
50570
50688
|
|
|
50571
|
-
// Extract
|
|
50689
|
+
// Extract special meta keys without mutating input, filter remaining meta
|
|
50572
50690
|
let mappingsDoc;
|
|
50573
50691
|
let stylesDoc;
|
|
50574
50692
|
let metaToDeserialize = value.meta;
|
|
@@ -50582,8 +50700,15 @@ class JSONSerialiser {
|
|
|
50582
50700
|
stylesDoc = __styles__;
|
|
50583
50701
|
metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
|
|
50584
50702
|
}
|
|
50703
|
+
|
|
50704
|
+
// determine which meta keys were raw primitives before serialization
|
|
50705
|
+
const rawKeys = value.__meta_raw__ ? new Set(value.__meta_raw__) : undefined;
|
|
50585
50706
|
if (metaToDeserialize) {
|
|
50586
|
-
|
|
50707
|
+
for (const [key, doc] of Object.entries(metaToDeserialize)) {
|
|
50708
|
+
const deserialized = this.deserialise(doc);
|
|
50709
|
+
// unwrap keys that were raw primitives before serialization
|
|
50710
|
+
element.setMetaProperty(key, rawKeys?.has(key) ? deserialized.toValue() : deserialized);
|
|
50711
|
+
}
|
|
50587
50712
|
}
|
|
50588
50713
|
|
|
50589
50714
|
// Restore source position from __mappings__
|
|
@@ -50646,6 +50771,27 @@ class JSONSerialiser {
|
|
|
50646
50771
|
}
|
|
50647
50772
|
return content;
|
|
50648
50773
|
}
|
|
50774
|
+
serialiseMeta(element) {
|
|
50775
|
+
const meta = {};
|
|
50776
|
+
const rawKeys = [];
|
|
50777
|
+
let hasEntries = false;
|
|
50778
|
+
for (const [key, value] of Object.entries(element.meta)) {
|
|
50779
|
+
if (value instanceof this.namespace.elements.Element) {
|
|
50780
|
+
meta[key] = this.serialise(value);
|
|
50781
|
+
hasEntries = true;
|
|
50782
|
+
} else if (value !== undefined) {
|
|
50783
|
+
// refract primitives to maintain JSON Refract spec compatibility
|
|
50784
|
+
const refracted = element.refract(value);
|
|
50785
|
+
meta[key] = this.serialise(refracted);
|
|
50786
|
+
rawKeys.push(key);
|
|
50787
|
+
hasEntries = true;
|
|
50788
|
+
}
|
|
50789
|
+
}
|
|
50790
|
+
return hasEntries ? {
|
|
50791
|
+
meta,
|
|
50792
|
+
rawKeys
|
|
50793
|
+
} : undefined;
|
|
50794
|
+
}
|
|
50649
50795
|
serialiseObject(obj) {
|
|
50650
50796
|
const result = {};
|
|
50651
50797
|
obj.forEach((value, key) => {
|
|
@@ -50859,6 +51005,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50859
51005
|
/* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61198);
|
|
50860
51006
|
|
|
50861
51007
|
|
|
51008
|
+
|
|
51009
|
+
/**
|
|
51010
|
+
* @public
|
|
51011
|
+
*/
|
|
50862
51012
|
class ApiDOMEvaluationRealm extends _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_1__.EvaluationRealm {
|
|
50863
51013
|
name = 'apidom';
|
|
50864
51014
|
isArray(node) {
|
|
@@ -52675,7 +52825,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
52675
52825
|
const refract = (value, {
|
|
52676
52826
|
element = 'arazzoSpecification1',
|
|
52677
52827
|
plugins = [],
|
|
52678
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
52828
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
52829
|
+
consume = false
|
|
52679
52830
|
} = {}) => {
|
|
52680
52831
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.refract)(value);
|
|
52681
52832
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -52692,7 +52843,8 @@ const refract = (value, {
|
|
|
52692
52843
|
*/
|
|
52693
52844
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
52694
52845
|
const rootVisitor = new RootVisitorClass({
|
|
52695
|
-
specObj: resolvedSpec
|
|
52846
|
+
specObj: resolvedSpec,
|
|
52847
|
+
consume
|
|
52696
52848
|
});
|
|
52697
52849
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__.traverse)(genericElement, rootVisitor);
|
|
52698
52850
|
|
|
@@ -53284,7 +53436,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53284
53436
|
*/
|
|
53285
53437
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
53286
53438
|
enter(path) {
|
|
53287
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
53439
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
53288
53440
|
path.stop();
|
|
53289
53441
|
}
|
|
53290
53442
|
}
|
|
@@ -53351,7 +53503,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53351
53503
|
*/
|
|
53352
53504
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
53353
53505
|
specObj;
|
|
53354
|
-
passingOptionsNames = ['specObj'];
|
|
53506
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
53355
53507
|
constructor({
|
|
53356
53508
|
specObj,
|
|
53357
53509
|
...rest
|
|
@@ -53397,7 +53549,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
53397
53549
|
*/
|
|
53398
53550
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
53399
53551
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
53400
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
53552
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
53401
53553
|
}
|
|
53402
53554
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
53403
53555
|
return visitor.element;
|
|
@@ -53416,7 +53568,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53416
53568
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
53417
53569
|
/* harmony export */ });
|
|
53418
53570
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
53419
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
53571
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
53420
53572
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
53421
53573
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
53422
53574
|
|
|
@@ -53431,19 +53583,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53431
53583
|
*/
|
|
53432
53584
|
class Visitor {
|
|
53433
53585
|
element;
|
|
53586
|
+
consume = false;
|
|
53587
|
+
consumeSafe = false;
|
|
53434
53588
|
constructor(options = {}) {
|
|
53435
53589
|
Object.assign(this, options);
|
|
53436
53590
|
}
|
|
53437
53591
|
copyMetaAndAttributes(from, to) {
|
|
53438
|
-
if (!from.isMetaEmpty
|
|
53439
|
-
|
|
53440
|
-
|
|
53441
|
-
to.meta = (
|
|
53592
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
53593
|
+
to.meta = to.meta.merge(from.meta);
|
|
53594
|
+
} else if (!from.isMetaEmpty) {
|
|
53595
|
+
to.meta = from.meta.cloneDeep();
|
|
53442
53596
|
}
|
|
53443
|
-
if (!from.isAttributesEmpty
|
|
53444
|
-
|
|
53445
|
-
|
|
53446
|
-
to.attributes = (0,
|
|
53597
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
53598
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
53599
|
+
} else if (!from.isAttributesEmpty) {
|
|
53600
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
53447
53601
|
}
|
|
53448
53602
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
53449
53603
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -53990,6 +54144,7 @@ class ArazzoSpecificationVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__
|
|
|
53990
54144
|
constructor(options) {
|
|
53991
54145
|
super(options);
|
|
53992
54146
|
this.element = new _elements_ArazzoSpecification1_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
54147
|
+
this.consumeSafe = true;
|
|
53993
54148
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'ArazzoSpecification']);
|
|
53994
54149
|
this.canSupportSpecificationExtensions = true;
|
|
53995
54150
|
}
|
|
@@ -54983,15 +55138,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
54983
55138
|
objectElement.forEach((value, key, memberElement) => {
|
|
54984
55139
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key)) && !this.ignoredFields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key))) {
|
|
54985
55140
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key)], value);
|
|
54986
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
55141
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
54987
55142
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
54988
|
-
newMemberElement.classes.push('fixed-field');
|
|
54989
55143
|
this.element.push(newMemberElement);
|
|
55144
|
+
// consume: release processed generic subtree
|
|
55145
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
54990
55146
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
54991
55147
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
54992
55148
|
this.element.push(extensionElement);
|
|
55149
|
+
// consume: release processed generic subtree
|
|
55150
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
54993
55151
|
} else if (!this.ignoredFields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key))) {
|
|
54994
|
-
this.element.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
55152
|
+
this.element.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
54995
55153
|
}
|
|
54996
55154
|
});
|
|
54997
55155
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -55094,12 +55252,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
55094
55252
|
} else if (!this.ignoredFields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key)) && this.fieldPatternPredicate((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key))) {
|
|
55095
55253
|
const specPath = this.specPath(value);
|
|
55096
55254
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
55097
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
55255
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
55098
55256
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
55099
55257
|
newMemberElement.classes.push('patterned-field');
|
|
55100
55258
|
this.element.push(newMemberElement);
|
|
55259
|
+
// consume: release processed generic subtree
|
|
55260
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
55101
55261
|
} else if (!this.ignoredFields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key))) {
|
|
55102
|
-
this.element.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
55262
|
+
this.element.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
55103
55263
|
}
|
|
55104
55264
|
});
|
|
55105
55265
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -61121,7 +61281,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61121
61281
|
const refract = (value, {
|
|
61122
61282
|
element = 'asyncApi2',
|
|
61123
61283
|
plugins = [],
|
|
61124
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
61284
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
61285
|
+
consume = false
|
|
61125
61286
|
} = {}) => {
|
|
61126
61287
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.refract)(value);
|
|
61127
61288
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__.resolveSpecification)(specificationObj);
|
|
@@ -61138,7 +61299,8 @@ const refract = (value, {
|
|
|
61138
61299
|
*/
|
|
61139
61300
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
61140
61301
|
const rootVisitor = new RootVisitorClass({
|
|
61141
|
-
specObj: resolvedSpec
|
|
61302
|
+
specObj: resolvedSpec,
|
|
61303
|
+
consume
|
|
61142
61304
|
});
|
|
61143
61305
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor);
|
|
61144
61306
|
|
|
@@ -63952,7 +64114,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63952
64114
|
*/
|
|
63953
64115
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
63954
64116
|
enter(path) {
|
|
63955
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
64117
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
63956
64118
|
path.stop();
|
|
63957
64119
|
}
|
|
63958
64120
|
}
|
|
@@ -64019,7 +64181,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64019
64181
|
*/
|
|
64020
64182
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
64021
64183
|
specObj;
|
|
64022
|
-
passingOptionsNames = ['specObj'];
|
|
64184
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
64023
64185
|
constructor({
|
|
64024
64186
|
specObj,
|
|
64025
64187
|
...rest
|
|
@@ -64065,7 +64227,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
64065
64227
|
*/
|
|
64066
64228
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
64067
64229
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
64068
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
64230
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
64069
64231
|
}
|
|
64070
64232
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
|
|
64071
64233
|
return visitor.element;
|
|
@@ -64084,7 +64246,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64084
64246
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
64085
64247
|
/* harmony export */ });
|
|
64086
64248
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
64087
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
64249
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
64088
64250
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
64089
64251
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
64090
64252
|
|
|
@@ -64099,19 +64261,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64099
64261
|
*/
|
|
64100
64262
|
class Visitor {
|
|
64101
64263
|
element;
|
|
64264
|
+
consume = false;
|
|
64265
|
+
consumeSafe = false;
|
|
64102
64266
|
constructor(options) {
|
|
64103
64267
|
Object.assign(this, options);
|
|
64104
64268
|
}
|
|
64105
64269
|
copyMetaAndAttributes(from, to) {
|
|
64106
|
-
if (!from.isMetaEmpty
|
|
64107
|
-
|
|
64108
|
-
|
|
64109
|
-
to.meta = (
|
|
64270
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
64271
|
+
to.meta = to.meta.merge(from.meta);
|
|
64272
|
+
} else if (!from.isMetaEmpty) {
|
|
64273
|
+
to.meta = from.meta.cloneDeep();
|
|
64110
64274
|
}
|
|
64111
|
-
if (!from.isAttributesEmpty
|
|
64112
|
-
|
|
64113
|
-
|
|
64114
|
-
to.attributes = (0,
|
|
64275
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
64276
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
64277
|
+
} else if (!from.isAttributesEmpty) {
|
|
64278
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
64115
64279
|
}
|
|
64116
64280
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
64117
64281
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -67675,6 +67839,7 @@ class AsyncApi2Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixed
|
|
|
67675
67839
|
constructor(options) {
|
|
67676
67840
|
super(options);
|
|
67677
67841
|
this.element = new _elements_AsyncApi2_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
67842
|
+
this.consumeSafe = true;
|
|
67678
67843
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'AsyncApi']);
|
|
67679
67844
|
this.canSupportSpecificationExtensions = true;
|
|
67680
67845
|
}
|
|
@@ -69881,15 +70046,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
69881
70046
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
69882
70047
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
69883
70048
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
69884
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
69885
|
-
newMemberElement.classes.push('fixed-field');
|
|
70049
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
69886
70050
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
69887
70051
|
this.element.content.push(newMemberElement);
|
|
70052
|
+
// consume: release processed generic subtree
|
|
70053
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
69888
70054
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
69889
70055
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
69890
70056
|
this.element.content.push(extensionElement);
|
|
70057
|
+
// consume: release processed generic subtree
|
|
70058
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
69891
70059
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
69892
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
70060
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
69893
70061
|
}
|
|
69894
70062
|
});
|
|
69895
70063
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -69993,12 +70161,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
69993
70161
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
69994
70162
|
const specPath = this.specPath(value);
|
|
69995
70163
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
69996
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
70164
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
69997
70165
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
69998
70166
|
newMemberElement.classes.push('patterned-field');
|
|
69999
70167
|
this.element.content.push(newMemberElement);
|
|
70168
|
+
// consume: release processed generic subtree
|
|
70169
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
70000
70170
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
70001
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
70171
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
70002
70172
|
}
|
|
70003
70173
|
});
|
|
70004
70174
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -72017,7 +72187,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72017
72187
|
*/
|
|
72018
72188
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
72019
72189
|
enter(path) {
|
|
72020
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
72190
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
72021
72191
|
path.stop();
|
|
72022
72192
|
}
|
|
72023
72193
|
}
|
|
@@ -72057,7 +72227,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72057
72227
|
*/
|
|
72058
72228
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
72059
72229
|
specObj;
|
|
72060
|
-
passingOptionsNames = ['specObj', 'parent'];
|
|
72230
|
+
passingOptionsNames = ['specObj', 'parent', 'consume'];
|
|
72061
72231
|
constructor({
|
|
72062
72232
|
specObj,
|
|
72063
72233
|
...rest
|
|
@@ -72103,7 +72273,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
72103
72273
|
*/
|
|
72104
72274
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
72105
72275
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
72106
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
72276
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
72107
72277
|
}
|
|
72108
72278
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
72109
72279
|
return visitor.element;
|
|
@@ -72122,7 +72292,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72122
72292
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
72123
72293
|
/* harmony export */ });
|
|
72124
72294
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
72125
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
72295
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
72126
72296
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
72127
72297
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
72128
72298
|
|
|
@@ -72137,19 +72307,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72137
72307
|
*/
|
|
72138
72308
|
class Visitor {
|
|
72139
72309
|
element;
|
|
72310
|
+
consume = false;
|
|
72311
|
+
consumeSafe = false;
|
|
72140
72312
|
constructor(options) {
|
|
72141
72313
|
Object.assign(this, options);
|
|
72142
72314
|
}
|
|
72143
72315
|
copyMetaAndAttributes(from, to) {
|
|
72144
|
-
if (!from.isMetaEmpty
|
|
72145
|
-
|
|
72146
|
-
|
|
72147
|
-
to.meta = (
|
|
72316
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
72317
|
+
to.meta = to.meta.merge(from.meta);
|
|
72318
|
+
} else if (!from.isMetaEmpty) {
|
|
72319
|
+
to.meta = from.meta.cloneDeep();
|
|
72148
72320
|
}
|
|
72149
|
-
if (!from.isAttributesEmpty
|
|
72150
|
-
|
|
72151
|
-
|
|
72152
|
-
to.attributes = (0,
|
|
72321
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
72322
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
72323
|
+
} else if (!from.isAttributesEmpty) {
|
|
72324
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
72153
72325
|
}
|
|
72154
72326
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
72155
72327
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -72259,12 +72431,13 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
72259
72431
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
72260
72432
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
72261
72433
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
72262
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
72434
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
72263
72435
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
72264
|
-
newMemberElement.classes.push('fixed-field');
|
|
72265
72436
|
this.element.content.push(newMemberElement);
|
|
72437
|
+
// consume: release processed generic subtree
|
|
72438
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
72266
72439
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
72267
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
72440
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
72268
72441
|
}
|
|
72269
72442
|
});
|
|
72270
72443
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -72353,12 +72526,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
72353
72526
|
if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
72354
72527
|
const specPath = this.specPath(value);
|
|
72355
72528
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
72356
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
72529
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
72357
72530
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
72358
72531
|
newMemberElement.classes.push('patterned-field');
|
|
72359
72532
|
this.element.content.push(newMemberElement);
|
|
72533
|
+
// consume: release processed generic subtree
|
|
72534
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
72360
72535
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
72361
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
72536
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
72362
72537
|
}
|
|
72363
72538
|
});
|
|
72364
72539
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -72916,13 +73091,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72916
73091
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33031);
|
|
72917
73092
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68894);
|
|
72918
73093
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25162);
|
|
72919
|
-
/* harmony import */ var
|
|
72920
|
-
/* harmony import */ var
|
|
72921
|
-
/* harmony import */ var
|
|
72922
|
-
/* harmony import */ var
|
|
72923
|
-
/* harmony import */ var
|
|
72924
|
-
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(94686);
|
|
72925
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(86059);
|
|
73094
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44673);
|
|
73095
|
+
/* harmony import */ var _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(55320);
|
|
73096
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89033);
|
|
73097
|
+
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(94686);
|
|
73098
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(86059);
|
|
72926
73099
|
|
|
72927
73100
|
|
|
72928
73101
|
|
|
@@ -72937,10 +73110,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72937
73110
|
/**
|
|
72938
73111
|
* @public
|
|
72939
73112
|
*/
|
|
72940
|
-
class JSONSchemaVisitor extends
|
|
73113
|
+
class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.JSONSchemaVisitorBase {
|
|
72941
73114
|
constructor(options) {
|
|
72942
73115
|
super(options);
|
|
72943
|
-
this.element = new
|
|
73116
|
+
this.element = new _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]();
|
|
73117
|
+
this.consumeSafe = true;
|
|
72944
73118
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'JSONSchema']);
|
|
72945
73119
|
}
|
|
72946
73120
|
get defaultDialectIdentifier() {
|
|
@@ -72953,27 +73127,27 @@ class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_9__.JSONSche
|
|
|
72953
73127
|
|
|
72954
73128
|
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
72955
73129
|
this.parent = this.element;
|
|
72956
|
-
return
|
|
73130
|
+
return _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].prototype.ObjectElement.call(this, path);
|
|
72957
73131
|
}
|
|
72958
73132
|
handleDialectIdentifier(objectElement) {
|
|
72959
73133
|
// handle $schema keyword in embedded resources
|
|
72960
73134
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
72961
73135
|
// no parent available and no $schema is defined, set default $schema
|
|
72962
73136
|
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
72963
|
-
} else if ((0,
|
|
73137
|
+
} else if ((0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_9__.isJSONSchemaElement)(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
72964
73138
|
// parent is available and no $schema is defined, set parent $schema
|
|
72965
|
-
const inheritedDialectIdentifier = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(
|
|
73139
|
+
const inheritedDialectIdentifier = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(this.parent.meta.get('inheritedDialectIdentifier'), (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(this.parent.$schema));
|
|
72966
73140
|
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
72967
73141
|
}
|
|
72968
73142
|
}
|
|
72969
73143
|
handleSchemaIdentifier(objectElement, identifierKeyword = 'id') {
|
|
72970
73144
|
// handle schema identifier in embedded resources
|
|
72971
|
-
// fetch parent's ancestorsSchemaIdentifiers
|
|
72972
|
-
const ancestorsSchemaIdentifiers = this.parent !== undefined ? (
|
|
73145
|
+
// fetch parent's ancestorsSchemaIdentifiers (stored as plain string[])
|
|
73146
|
+
const ancestorsSchemaIdentifiers = this.parent !== undefined ? [...(this.parent.meta.get('ancestorsSchemaIdentifiers') ?? [])] : [];
|
|
72973
73147
|
// get current schema identifier
|
|
72974
|
-
const schemaIdentifier = (0,
|
|
73148
|
+
const schemaIdentifier = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(objectElement.get(identifierKeyword));
|
|
72975
73149
|
|
|
72976
|
-
// remember schema identifier if it's a non-empty
|
|
73150
|
+
// remember schema identifier if it's a non-empty string
|
|
72977
73151
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__["default"])(schemaIdentifier)) {
|
|
72978
73152
|
ancestorsSchemaIdentifiers.push(schemaIdentifier);
|
|
72979
73153
|
}
|
|
@@ -76484,7 +76658,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
76484
76658
|
const refract = (value, {
|
|
76485
76659
|
element = 'swagger',
|
|
76486
76660
|
plugins = [],
|
|
76487
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
76661
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
76662
|
+
consume = false
|
|
76488
76663
|
} = {}) => {
|
|
76489
76664
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.refract)(value);
|
|
76490
76665
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -76501,7 +76676,8 @@ const refract = (value, {
|
|
|
76501
76676
|
*/
|
|
76502
76677
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
76503
76678
|
const rootVisitor = new RootVisitorClass({
|
|
76504
|
-
specObj: resolvedSpec
|
|
76679
|
+
specObj: resolvedSpec,
|
|
76680
|
+
consume
|
|
76505
76681
|
});
|
|
76506
76682
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor);
|
|
76507
76683
|
|
|
@@ -77422,7 +77598,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77422
77598
|
*/
|
|
77423
77599
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
77424
77600
|
enter(path) {
|
|
77425
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
77601
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
77426
77602
|
path.stop();
|
|
77427
77603
|
}
|
|
77428
77604
|
}
|
|
@@ -77488,7 +77664,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77488
77664
|
*/
|
|
77489
77665
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
77490
77666
|
specObj;
|
|
77491
|
-
passingOptionsNames = ['specObj'];
|
|
77667
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
77492
77668
|
constructor({
|
|
77493
77669
|
specObj,
|
|
77494
77670
|
...rest
|
|
@@ -77534,7 +77710,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
77534
77710
|
*/
|
|
77535
77711
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
77536
77712
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
77537
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
77713
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
77538
77714
|
}
|
|
77539
77715
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
|
|
77540
77716
|
return visitor.element;
|
|
@@ -77553,7 +77729,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77553
77729
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
77554
77730
|
/* harmony export */ });
|
|
77555
77731
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
77556
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
77732
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
77557
77733
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
77558
77734
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
77559
77735
|
|
|
@@ -77568,19 +77744,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77568
77744
|
*/
|
|
77569
77745
|
class Visitor {
|
|
77570
77746
|
element;
|
|
77747
|
+
consume = false;
|
|
77748
|
+
consumeSafe = false;
|
|
77571
77749
|
constructor(options = {}) {
|
|
77572
77750
|
Object.assign(this, options);
|
|
77573
77751
|
}
|
|
77574
77752
|
copyMetaAndAttributes(from, to) {
|
|
77575
|
-
if (!from.isMetaEmpty
|
|
77576
|
-
|
|
77577
|
-
|
|
77578
|
-
to.meta = (
|
|
77753
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
77754
|
+
to.meta = to.meta.merge(from.meta);
|
|
77755
|
+
} else if (!from.isMetaEmpty) {
|
|
77756
|
+
to.meta = from.meta.cloneDeep();
|
|
77579
77757
|
}
|
|
77580
|
-
if (!from.isAttributesEmpty
|
|
77581
|
-
|
|
77582
|
-
|
|
77583
|
-
to.attributes = (0,
|
|
77758
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
77759
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
77760
|
+
} else if (!from.isAttributesEmpty) {
|
|
77761
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
77584
77762
|
}
|
|
77585
77763
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
77586
77764
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -77702,15 +77880,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
77702
77880
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
77703
77881
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
77704
77882
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
77705
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
77883
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
77706
77884
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
77707
|
-
newMemberElement.classes.push('fixed-field');
|
|
77708
77885
|
this.element.content.push(newMemberElement);
|
|
77886
|
+
// consume: release processed generic subtree
|
|
77887
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
77709
77888
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
77710
77889
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
77711
77890
|
this.element.content.push(extensionElement);
|
|
77891
|
+
// consume: release processed generic subtree
|
|
77892
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
77712
77893
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
77713
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
77894
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
77714
77895
|
}
|
|
77715
77896
|
});
|
|
77716
77897
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -77892,12 +78073,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
77892
78073
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
77893
78074
|
const specPath = this.specPath(value);
|
|
77894
78075
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
77895
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
78076
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
77896
78077
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
77897
78078
|
newMemberElement.classes.push('patterned-field');
|
|
77898
78079
|
this.element.content.push(newMemberElement);
|
|
78080
|
+
// consume: release processed generic subtree
|
|
78081
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
77899
78082
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
77900
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
78083
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
77901
78084
|
}
|
|
77902
78085
|
});
|
|
77903
78086
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -78448,6 +78631,7 @@ class SwaggerVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixedFi
|
|
|
78448
78631
|
constructor(options) {
|
|
78449
78632
|
super(options);
|
|
78450
78633
|
this.element = new _elements_Swagger_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
78634
|
+
this.consumeSafe = true;
|
|
78451
78635
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Swagger']);
|
|
78452
78636
|
this.canSupportSpecificationExtensions = true;
|
|
78453
78637
|
}
|
|
@@ -78952,6 +79136,7 @@ class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseFixedF
|
|
|
78952
79136
|
constructor(options) {
|
|
78953
79137
|
super(options);
|
|
78954
79138
|
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
79139
|
+
this.consumeSafe = true;
|
|
78955
79140
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
78956
79141
|
}
|
|
78957
79142
|
ObjectElement(path) {
|
|
@@ -79003,6 +79188,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
79003
79188
|
constructor(options) {
|
|
79004
79189
|
super(options);
|
|
79005
79190
|
this.element = new _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
79191
|
+
this.consumeSafe = true;
|
|
79006
79192
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(['document', 'objects', 'PathItem']);
|
|
79007
79193
|
this.canSupportSpecificationExtensions = true;
|
|
79008
79194
|
this.fieldPatternPredicate = ramda__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
@@ -82663,7 +82849,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82663
82849
|
const refract = (value, {
|
|
82664
82850
|
element = 'openApi3_0',
|
|
82665
82851
|
plugins = [],
|
|
82666
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
82852
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
82853
|
+
consume = false
|
|
82667
82854
|
} = {}) => {
|
|
82668
82855
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.refract)(value);
|
|
82669
82856
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -82680,7 +82867,8 @@ const refract = (value, {
|
|
|
82680
82867
|
*/
|
|
82681
82868
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
82682
82869
|
const rootVisitor = new RootVisitorClass({
|
|
82683
|
-
specObj: resolvedSpec
|
|
82870
|
+
specObj: resolvedSpec,
|
|
82871
|
+
consume
|
|
82684
82872
|
});
|
|
82685
82873
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor, {
|
|
82686
82874
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.getNodePrimitiveType
|
|
@@ -83868,7 +84056,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83868
84056
|
*/
|
|
83869
84057
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
83870
84058
|
enter(path) {
|
|
83871
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
84059
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
83872
84060
|
path.stop();
|
|
83873
84061
|
}
|
|
83874
84062
|
}
|
|
@@ -83934,8 +84122,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83934
84122
|
*/
|
|
83935
84123
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
83936
84124
|
specObj;
|
|
83937
|
-
passingOptionsNames = ['specObj', 'openApiGenericElement', 'openApiSemanticElement'];
|
|
84125
|
+
passingOptionsNames = ['specObj', 'openApiGenericElement', 'sourceContext', 'openApiSemanticElement', 'consume'];
|
|
83938
84126
|
openApiGenericElement;
|
|
84127
|
+
sourceContext;
|
|
83939
84128
|
openApiSemanticElement;
|
|
83940
84129
|
constructor({
|
|
83941
84130
|
specObj,
|
|
@@ -83990,7 +84179,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
83990
84179
|
*/
|
|
83991
84180
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
83992
84181
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
83993
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
84182
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
83994
84183
|
}
|
|
83995
84184
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, {
|
|
83996
84185
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.getNodePrimitiveType
|
|
@@ -84011,7 +84200,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84011
84200
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
84012
84201
|
/* harmony export */ });
|
|
84013
84202
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
84014
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
84203
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
84015
84204
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
84016
84205
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
84017
84206
|
|
|
@@ -84026,19 +84215,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84026
84215
|
*/
|
|
84027
84216
|
class Visitor {
|
|
84028
84217
|
element;
|
|
84218
|
+
consume = false;
|
|
84219
|
+
consumeSafe = false;
|
|
84029
84220
|
constructor(options = {}) {
|
|
84030
84221
|
Object.assign(this, options);
|
|
84031
84222
|
}
|
|
84032
84223
|
copyMetaAndAttributes(from, to) {
|
|
84033
|
-
if (!from.isMetaEmpty
|
|
84034
|
-
|
|
84035
|
-
|
|
84036
|
-
to.meta = (
|
|
84224
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
84225
|
+
to.meta = to.meta.merge(from.meta);
|
|
84226
|
+
} else if (!from.isMetaEmpty) {
|
|
84227
|
+
to.meta = from.meta.cloneDeep();
|
|
84037
84228
|
}
|
|
84038
|
-
if (!from.isAttributesEmpty
|
|
84039
|
-
|
|
84040
|
-
|
|
84041
|
-
to.attributes = (0,
|
|
84229
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
84230
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
84231
|
+
} else if (!from.isAttributesEmpty) {
|
|
84232
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
84042
84233
|
}
|
|
84043
84234
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
84044
84235
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -84160,15 +84351,20 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
84160
84351
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
84161
84352
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
84162
84353
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
84163
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
84354
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
84164
84355
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
84165
|
-
newMemberElement.classes.push('fixed-field');
|
|
84166
84356
|
this.element.content.push(newMemberElement);
|
|
84357
|
+
// consume: release processed generic subtree
|
|
84358
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
84167
84359
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
84168
84360
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
84169
84361
|
this.element.content.push(extensionElement);
|
|
84362
|
+
// consume: release processed generic subtree
|
|
84363
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) {
|
|
84364
|
+
memberElement.value = undefined;
|
|
84365
|
+
}
|
|
84170
84366
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
84171
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
84367
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
84172
84368
|
}
|
|
84173
84369
|
});
|
|
84174
84370
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -84350,12 +84546,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
84350
84546
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
84351
84547
|
const specPath = this.specPath(value);
|
|
84352
84548
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
84353
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
84549
|
+
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](this.consume ? key : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
84354
84550
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
84355
84551
|
newMemberElement.classes.push('patterned-field');
|
|
84356
84552
|
this.element.content.push(newMemberElement);
|
|
84553
|
+
// consume: release processed generic subtree
|
|
84554
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
84357
84555
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
84358
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
84556
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
84359
84557
|
}
|
|
84360
84558
|
});
|
|
84361
84559
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -85218,6 +85416,7 @@ class ComponentsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixe
|
|
|
85218
85416
|
this.element = new _elements_Components_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
85219
85417
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Components']);
|
|
85220
85418
|
this.canSupportSpecificationExtensions = true;
|
|
85419
|
+
this.consumeSafe = true;
|
|
85221
85420
|
}
|
|
85222
85421
|
}
|
|
85223
85422
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ComponentsVisitor);
|
|
@@ -85656,6 +85855,7 @@ class OpenApi3_0Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_1__.BaseFixe
|
|
|
85656
85855
|
this.element = new _elements_OpenApi3_0_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
85657
85856
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'OpenApi']);
|
|
85658
85857
|
this.canSupportSpecificationExtensions = true;
|
|
85858
|
+
this.consumeSafe = true;
|
|
85659
85859
|
}
|
|
85660
85860
|
ObjectElement(path) {
|
|
85661
85861
|
_bases_mjs__WEBPACK_IMPORTED_MODULE_1__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
@@ -86546,11 +86746,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86546
86746
|
/* harmony export */ });
|
|
86547
86747
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
86548
86748
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
86549
|
-
/* harmony import */ var
|
|
86550
|
-
/* harmony import */ var
|
|
86551
|
-
/* harmony import */ var
|
|
86552
|
-
/* harmony import */ var
|
|
86553
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74367);
|
|
86749
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
86750
|
+
/* harmony import */ var _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(98557);
|
|
86751
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32131);
|
|
86752
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74367);
|
|
86554
86753
|
|
|
86555
86754
|
|
|
86556
86755
|
|
|
@@ -86563,22 +86762,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86563
86762
|
/**
|
|
86564
86763
|
* @public
|
|
86565
86764
|
*/
|
|
86566
|
-
class PathItemVisitor extends
|
|
86765
|
+
class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
86567
86766
|
constructor(options) {
|
|
86568
86767
|
super(options);
|
|
86569
|
-
this.element = new
|
|
86768
|
+
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
86570
86769
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
86770
|
+
this.consumeSafe = true;
|
|
86571
86771
|
}
|
|
86572
86772
|
ObjectElement(path) {
|
|
86573
|
-
|
|
86773
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
86574
86774
|
|
|
86575
86775
|
// decorate Operation elements with HTTP method
|
|
86576
|
-
this.element.filter(
|
|
86776
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isOperationElement)
|
|
86577
86777
|
// @ts-ignore
|
|
86578
86778
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
86579
|
-
|
|
86580
|
-
httpMethodElementCS.content = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(httpMethodElementCS).toUpperCase();
|
|
86581
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
86779
|
+
operationElement.meta.set('http-method', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(httpMethodElementCI).toUpperCase());
|
|
86582
86780
|
});
|
|
86583
86781
|
|
|
86584
86782
|
// mark this PathItemElement with reference metadata
|
|
@@ -86601,7 +86799,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86601
86799
|
/* harmony export */ });
|
|
86602
86800
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53679);
|
|
86603
86801
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29498);
|
|
86604
|
-
/* harmony import */ var
|
|
86802
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
86605
86803
|
/* harmony import */ var _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8535);
|
|
86606
86804
|
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32131);
|
|
86607
86805
|
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74367);
|
|
@@ -86622,6 +86820,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
86622
86820
|
this.element = new _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
86623
86821
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(['document', 'objects', 'PathItem']);
|
|
86624
86822
|
this.canSupportSpecificationExtensions = true;
|
|
86823
|
+
this.consumeSafe = true;
|
|
86625
86824
|
this.fieldPatternPredicate = ramda__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
86626
86825
|
}
|
|
86627
86826
|
ObjectElement(path) {
|
|
@@ -86633,7 +86832,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
86633
86832
|
.forEach((pathItemElement, key) => {
|
|
86634
86833
|
key.classes.push('openapi-path-template');
|
|
86635
86834
|
key.classes.push('path-template');
|
|
86636
|
-
pathItemElement.meta.set('path', (0,
|
|
86835
|
+
pathItemElement.meta.set('path', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key));
|
|
86637
86836
|
});
|
|
86638
86837
|
}
|
|
86639
86838
|
}
|
|
@@ -88933,7 +89132,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
88933
89132
|
const refract = (value, {
|
|
88934
89133
|
element = 'openApi3_1',
|
|
88935
89134
|
plugins = [],
|
|
88936
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
89135
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
89136
|
+
consume = false
|
|
88937
89137
|
} = {}) => {
|
|
88938
89138
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.refract)(value);
|
|
88939
89139
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -88950,7 +89150,8 @@ const refract = (value, {
|
|
|
88950
89150
|
*/
|
|
88951
89151
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
88952
89152
|
const rootVisitor = new RootVisitorClass({
|
|
88953
|
-
specObj: resolvedSpec
|
|
89153
|
+
specObj: resolvedSpec,
|
|
89154
|
+
consume
|
|
88954
89155
|
});
|
|
88955
89156
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor, {
|
|
88956
89157
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.getNodePrimitiveType
|
|
@@ -90472,9 +90673,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
90472
90673
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
90473
90674
|
/* harmony export */ });
|
|
90474
90675
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
90475
|
-
/* harmony import */ var
|
|
90476
|
-
/* harmony import */ var
|
|
90477
|
-
/* harmony import */ var
|
|
90676
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
90677
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
90678
|
+
/* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(58368);
|
|
90679
|
+
/* harmony import */ var _elements_OpenApi3_1_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81793);
|
|
90680
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43027);
|
|
90681
|
+
|
|
90682
|
+
|
|
90478
90683
|
|
|
90479
90684
|
|
|
90480
90685
|
|
|
@@ -90486,18 +90691,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
90486
90691
|
* @public
|
|
90487
90692
|
*/
|
|
90488
90693
|
|
|
90489
|
-
class OpenApi3_1Visitor extends
|
|
90694
|
+
class OpenApi3_1Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
90490
90695
|
constructor(options) {
|
|
90491
90696
|
super(options);
|
|
90492
|
-
this.element = new
|
|
90697
|
+
this.element = new _elements_OpenApi3_1_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
90493
90698
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'OpenApi']);
|
|
90494
90699
|
this.canSupportSpecificationExtensions = true;
|
|
90700
|
+
this.consumeSafe = true;
|
|
90495
90701
|
this.openApiSemanticElement = this.element;
|
|
90496
90702
|
}
|
|
90497
90703
|
ObjectElement(path) {
|
|
90498
90704
|
const objectElement = path.node;
|
|
90499
90705
|
this.openApiGenericElement = objectElement;
|
|
90500
|
-
|
|
90706
|
+
// precompute values from generic root before consume may release fields
|
|
90707
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(objectElement.get('jsonSchemaDialect'))) {
|
|
90708
|
+
this.sourceContext = {
|
|
90709
|
+
jsonSchemaDialect: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(objectElement.get('jsonSchemaDialect'))
|
|
90710
|
+
};
|
|
90711
|
+
}
|
|
90712
|
+
_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__["default"].prototype.ObjectElement.call(this, path);
|
|
90501
90713
|
}
|
|
90502
90714
|
}
|
|
90503
90715
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenApi3_1Visitor);
|
|
@@ -91185,8 +91397,8 @@ class SchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_8__.BaseSchemaVi
|
|
|
91185
91397
|
(0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isJsonSchemaDialectElement)(this.openApiSemanticElement.jsonSchemaDialect)) {
|
|
91186
91398
|
// @ts-ignore
|
|
91187
91399
|
jsonSchemaDialect = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(this.openApiSemanticElement.jsonSchemaDialect);
|
|
91188
|
-
} else if (this.
|
|
91189
|
-
jsonSchemaDialect =
|
|
91400
|
+
} else if (this.sourceContext?.jsonSchemaDialect !== undefined) {
|
|
91401
|
+
jsonSchemaDialect = this.sourceContext.jsonSchemaDialect;
|
|
91190
91402
|
} else {
|
|
91191
91403
|
jsonSchemaDialect = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(this.jsonSchemaDefaultDialect);
|
|
91192
91404
|
}
|
|
@@ -91434,7 +91646,10 @@ const parse = async (source, options = {}) => {
|
|
|
91434
91646
|
result
|
|
91435
91647
|
} = parseResultElement;
|
|
91436
91648
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91437
|
-
const arazzoSpecificationElement = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_6__.refractArazzoSpecification1)(result,
|
|
91649
|
+
const arazzoSpecificationElement = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_6__.refractArazzoSpecification1)(result, {
|
|
91650
|
+
consume: true,
|
|
91651
|
+
...refractorOpts
|
|
91652
|
+
});
|
|
91438
91653
|
arazzoSpecificationElement.classes.push('result');
|
|
91439
91654
|
parseResultElement.replaceResult(arazzoSpecificationElement);
|
|
91440
91655
|
}
|
|
@@ -91518,7 +91733,10 @@ const parse = async (source, options = {}) => {
|
|
|
91518
91733
|
result
|
|
91519
91734
|
} = parseResultElement;
|
|
91520
91735
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91521
|
-
const arazzoSpecificationElement = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_6__.refractArazzoSpecification1)(result,
|
|
91736
|
+
const arazzoSpecificationElement = (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_6__.refractArazzoSpecification1)(result, {
|
|
91737
|
+
consume: true,
|
|
91738
|
+
...refractorOpts
|
|
91739
|
+
});
|
|
91522
91740
|
arazzoSpecificationElement.classes.push('result');
|
|
91523
91741
|
parseResultElement.replaceResult(arazzoSpecificationElement);
|
|
91524
91742
|
}
|
|
@@ -91602,7 +91820,10 @@ const parse = async (source, options = {}) => {
|
|
|
91602
91820
|
result
|
|
91603
91821
|
} = parseResultElement;
|
|
91604
91822
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91605
|
-
const asyncApiElement = (0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_6__.refractAsyncApi2)(result,
|
|
91823
|
+
const asyncApiElement = (0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_6__.refractAsyncApi2)(result, {
|
|
91824
|
+
consume: true,
|
|
91825
|
+
...refractorOpts
|
|
91826
|
+
});
|
|
91606
91827
|
asyncApiElement.classes.push('result');
|
|
91607
91828
|
parseResultElement.replaceResult(asyncApiElement);
|
|
91608
91829
|
}
|
|
@@ -91686,7 +91907,10 @@ const parse = async (source, options = {}) => {
|
|
|
91686
91907
|
result
|
|
91687
91908
|
} = parseResultElement;
|
|
91688
91909
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91689
|
-
const asyncApiElement = (0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_6__.refractAsyncApi2)(result,
|
|
91910
|
+
const asyncApiElement = (0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_6__.refractAsyncApi2)(result, {
|
|
91911
|
+
consume: true,
|
|
91912
|
+
...refractorOpts
|
|
91913
|
+
});
|
|
91690
91914
|
asyncApiElement.classes.push('result');
|
|
91691
91915
|
parseResultElement.replaceResult(asyncApiElement);
|
|
91692
91916
|
}
|
|
@@ -91869,8 +92093,9 @@ const parse = async source => {
|
|
|
91869
92093
|
if (source.trim().length === 0) {
|
|
91870
92094
|
return parseResult;
|
|
91871
92095
|
}
|
|
91872
|
-
|
|
92096
|
+
let pojo = JSON.parse(source);
|
|
91873
92097
|
const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.refract)(pojo);
|
|
92098
|
+
pojo = null; // allow GC to reclaim POJO
|
|
91874
92099
|
element.classes.push('result');
|
|
91875
92100
|
parseResult.push(element);
|
|
91876
92101
|
return parseResult;
|
|
@@ -92345,7 +92570,10 @@ const parse = async (source, options = {}) => {
|
|
|
92345
92570
|
result
|
|
92346
92571
|
} = parseResultElement;
|
|
92347
92572
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92348
|
-
const swaggerElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_6__.refractSwagger)(result,
|
|
92573
|
+
const swaggerElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_6__.refractSwagger)(result, {
|
|
92574
|
+
consume: true,
|
|
92575
|
+
...refractorOpts
|
|
92576
|
+
});
|
|
92349
92577
|
swaggerElement.classes.push('result');
|
|
92350
92578
|
parseResultElement.replaceResult(swaggerElement);
|
|
92351
92579
|
}
|
|
@@ -92429,7 +92657,10 @@ const parse = async (source, options = {}) => {
|
|
|
92429
92657
|
result
|
|
92430
92658
|
} = parseResultElement;
|
|
92431
92659
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92432
|
-
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_0)(result,
|
|
92660
|
+
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_0)(result, {
|
|
92661
|
+
consume: true,
|
|
92662
|
+
...refractorOpts
|
|
92663
|
+
});
|
|
92433
92664
|
openApiElement.classes.push('result');
|
|
92434
92665
|
parseResultElement.replaceResult(openApiElement);
|
|
92435
92666
|
}
|
|
@@ -92513,7 +92744,10 @@ const parse = async (source, options = {}) => {
|
|
|
92513
92744
|
result
|
|
92514
92745
|
} = parseResultElement;
|
|
92515
92746
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92516
|
-
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_1)(result,
|
|
92747
|
+
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_1)(result, {
|
|
92748
|
+
consume: true,
|
|
92749
|
+
...refractorOpts
|
|
92750
|
+
});
|
|
92517
92751
|
openApiElement.classes.push('result');
|
|
92518
92752
|
parseResultElement.replaceResult(openApiElement);
|
|
92519
92753
|
}
|
|
@@ -92597,7 +92831,10 @@ const parse = async (source, options = {}) => {
|
|
|
92597
92831
|
result
|
|
92598
92832
|
} = parseResultElement;
|
|
92599
92833
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92600
|
-
const swaggerElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_6__.refractSwagger)(result,
|
|
92834
|
+
const swaggerElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_6__.refractSwagger)(result, {
|
|
92835
|
+
consume: true,
|
|
92836
|
+
...refractorOpts
|
|
92837
|
+
});
|
|
92601
92838
|
swaggerElement.classes.push('result');
|
|
92602
92839
|
parseResultElement.replaceResult(swaggerElement);
|
|
92603
92840
|
}
|
|
@@ -92681,7 +92918,10 @@ const parse = async (source, options = {}) => {
|
|
|
92681
92918
|
result
|
|
92682
92919
|
} = parseResultElement;
|
|
92683
92920
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92684
|
-
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_0)(result,
|
|
92921
|
+
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_0)(result, {
|
|
92922
|
+
consume: true,
|
|
92923
|
+
...refractorOpts
|
|
92924
|
+
});
|
|
92685
92925
|
openApiElement.classes.push('result');
|
|
92686
92926
|
parseResultElement.replaceResult(openApiElement);
|
|
92687
92927
|
}
|
|
@@ -92765,7 +93005,10 @@ const parse = async (source, options = {}) => {
|
|
|
92765
93005
|
result
|
|
92766
93006
|
} = parseResultElement;
|
|
92767
93007
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92768
|
-
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_1)(result,
|
|
93008
|
+
const openApiElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__.refractOpenApi3_1)(result, {
|
|
93009
|
+
consume: true,
|
|
93010
|
+
...refractorOpts
|
|
93011
|
+
});
|
|
92769
93012
|
openApiElement.classes.push('result');
|
|
92770
93013
|
parseResultElement.replaceResult(openApiElement);
|
|
92771
93014
|
}
|