@speclynx/apidom-reference 2.13.0 → 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 +16 -0
- package/README.md +5 -5
- package/dist/apidom-reference.browser.js +577 -337
- 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
- package/src/resolve/resolvers/http-axios/cache/MemoryCache.cjs +0 -3
- package/src/resolve/resolvers/http-axios/cache/MemoryCache.mjs +0 -3
- package/types/apidom-reference.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/resolve/resolvers/http-axios/cache/MemoryCache.d.ts +0 -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
|
|
|
@@ -7118,9 +7125,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7118
7125
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7119
7126
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
7120
7127
|
/* harmony export */ });
|
|
7121
|
-
/**
|
|
7122
|
-
* @public
|
|
7123
|
-
*/
|
|
7124
7128
|
class MemoryCache {
|
|
7125
7129
|
maxEntries;
|
|
7126
7130
|
maxStaleAge;
|
|
@@ -47084,9 +47088,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47084
47088
|
/* harmony export */ defaultIdentityManager: () => (/* binding */ defaultIdentityManager)
|
|
47085
47089
|
/* harmony export */ });
|
|
47086
47090
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25162);
|
|
47087
|
-
/* harmony import */ var
|
|
47088
|
-
/* harmony import */ var
|
|
47089
|
-
/* 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);
|
|
47090
47093
|
|
|
47091
47094
|
|
|
47092
47095
|
|
|
@@ -47099,23 +47102,23 @@ class IdentityManager {
|
|
|
47099
47102
|
constructor({
|
|
47100
47103
|
length = 6
|
|
47101
47104
|
} = {}) {
|
|
47102
|
-
this.uuid = new
|
|
47105
|
+
this.uuid = new short_unique_id__WEBPACK_IMPORTED_MODULE_1__({
|
|
47103
47106
|
length
|
|
47104
47107
|
});
|
|
47105
47108
|
this.identityMap = new WeakMap();
|
|
47106
47109
|
}
|
|
47107
47110
|
identify(element) {
|
|
47108
47111
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(element)) {
|
|
47109
|
-
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.', {
|
|
47110
47113
|
value: element
|
|
47111
47114
|
});
|
|
47112
47115
|
}
|
|
47113
47116
|
|
|
47114
47117
|
// use already assigned identity
|
|
47115
47118
|
if (element.hasMetaProperty('id')) {
|
|
47116
|
-
const existingId = element.
|
|
47117
|
-
if (
|
|
47118
|
-
return
|
|
47119
|
+
const existingId = element.id;
|
|
47120
|
+
if (typeof existingId === 'string' && existingId !== '') {
|
|
47121
|
+
return existingId;
|
|
47119
47122
|
}
|
|
47120
47123
|
}
|
|
47121
47124
|
|
|
@@ -47125,7 +47128,7 @@ class IdentityManager {
|
|
|
47125
47128
|
}
|
|
47126
47129
|
|
|
47127
47130
|
// return element identity
|
|
47128
|
-
const id =
|
|
47131
|
+
const id = this.generateId();
|
|
47129
47132
|
this.identityMap.set(element, id);
|
|
47130
47133
|
return id;
|
|
47131
47134
|
}
|
|
@@ -47225,7 +47228,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47225
47228
|
* @public
|
|
47226
47229
|
*/
|
|
47227
47230
|
const emptyElement = element => {
|
|
47228
|
-
const meta = !element.isMetaEmpty ?
|
|
47231
|
+
const meta = !element.isMetaEmpty ? element.meta.cloneDeep() : undefined;
|
|
47229
47232
|
const attributes = !element.isAttributesEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes) : undefined;
|
|
47230
47233
|
|
|
47231
47234
|
// @ts-ignore
|
|
@@ -47241,7 +47244,7 @@ const getMergeFunction = (keyElement, options) => {
|
|
|
47241
47244
|
};
|
|
47242
47245
|
const getMetaMergeFunction = options => {
|
|
47243
47246
|
if (typeof options.customMetaMerge !== 'function') {
|
|
47244
|
-
return targetMeta =>
|
|
47247
|
+
return targetMeta => targetMeta.cloneDeep();
|
|
47245
47248
|
}
|
|
47246
47249
|
return options.customMetaMerge;
|
|
47247
47250
|
};
|
|
@@ -47313,8 +47316,20 @@ const deepmerge = (targetElement, sourceElement, options) => {
|
|
|
47313
47316
|
const mergedElement = sourceIsArrayElement && typeof mergedOptions.arrayElementMerge === 'function' ? mergedOptions.arrayElementMerge(targetElement, sourceElement, mergedOptions) : mergedOptions.objectElementMerge(targetElement, sourceElement, mergedOptions);
|
|
47314
47317
|
|
|
47315
47318
|
// merging meta & attributes
|
|
47316
|
-
|
|
47317
|
-
|
|
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
|
+
}
|
|
47318
47333
|
return mergedElement;
|
|
47319
47334
|
};
|
|
47320
47335
|
deepmerge.all = (list, options) => {
|
|
@@ -47653,6 +47668,105 @@ class KeyValuePair {
|
|
|
47653
47668
|
|
|
47654
47669
|
/***/ },
|
|
47655
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
|
+
|
|
47656
47770
|
/***/ 55156
|
|
47657
47771
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
47658
47772
|
|
|
@@ -48299,7 +48413,7 @@ const cloneShallowElement = element => {
|
|
|
48299
48413
|
const copy = new Ctor();
|
|
48300
48414
|
copy.element = element.element;
|
|
48301
48415
|
if (!element.isMetaEmpty) {
|
|
48302
|
-
copy.meta =
|
|
48416
|
+
copy.meta = element.meta.cloneDeep();
|
|
48303
48417
|
}
|
|
48304
48418
|
if (!element.isAttributesEmpty) {
|
|
48305
48419
|
copy.attributes = cloneDeep(element.attributes);
|
|
@@ -48327,8 +48441,8 @@ const cloneShallowElement = element => {
|
|
|
48327
48441
|
|
|
48328
48442
|
/**
|
|
48329
48443
|
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
|
|
48330
|
-
* The element itself is cloned, but content references are shared
|
|
48331
|
-
*
|
|
48444
|
+
* The element itself is cloned, but content references are shared.
|
|
48445
|
+
* Meta and attributes are deep cloned to preserve semantic information.
|
|
48332
48446
|
* @public
|
|
48333
48447
|
*/
|
|
48334
48448
|
const cloneShallow = value => {
|
|
@@ -49403,7 +49517,7 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
49403
49517
|
* Search the tree recursively and find the element with the matching ID.
|
|
49404
49518
|
*/
|
|
49405
49519
|
getById(id) {
|
|
49406
|
-
return this.find(item => item.id
|
|
49520
|
+
return this.find(item => item.id === id).first;
|
|
49407
49521
|
}
|
|
49408
49522
|
|
|
49409
49523
|
/**
|
|
@@ -49433,18 +49547,24 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
49433
49547
|
"use strict";
|
|
49434
49548
|
__webpack_require__.r(__webpack_exports__);
|
|
49435
49549
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
49550
|
+
/* harmony export */ Metadata: () => (/* reexport safe */ _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
49436
49551
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
49437
49552
|
/* harmony export */ });
|
|
49438
49553
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
49439
|
-
/* harmony import */ var
|
|
49440
|
-
/* 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);
|
|
49441
49557
|
|
|
49442
49558
|
|
|
49443
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"]());
|
|
49562
|
+
|
|
49444
49563
|
/**
|
|
49445
49564
|
* Valid content types for an Element.
|
|
49446
49565
|
* @public
|
|
49447
49566
|
*/
|
|
49567
|
+
|
|
49448
49568
|
/**
|
|
49449
49569
|
* Base Element class that all ApiDOM elements extend.
|
|
49450
49570
|
*
|
|
@@ -49542,7 +49662,7 @@ class Element {
|
|
|
49542
49662
|
_attributes;
|
|
49543
49663
|
|
|
49544
49664
|
// ============================================================
|
|
49545
|
-
// Prototype-assigned properties (set in
|
|
49665
|
+
// Prototype-assigned properties (set in registration.ts)
|
|
49546
49666
|
// Using 'declare' allows TypeScript to know about these
|
|
49547
49667
|
// without generating runtime code.
|
|
49548
49668
|
// ============================================================
|
|
@@ -49603,13 +49723,13 @@ class Element {
|
|
|
49603
49723
|
}
|
|
49604
49724
|
|
|
49605
49725
|
// KeyValuePair
|
|
49606
|
-
if (value instanceof
|
|
49726
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
49607
49727
|
this._content = value;
|
|
49608
49728
|
return;
|
|
49609
49729
|
}
|
|
49610
49730
|
|
|
49611
49731
|
// ObjectSlice - extract elements array
|
|
49612
|
-
if (value instanceof
|
|
49732
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
49613
49733
|
this._content = value.elements;
|
|
49614
49734
|
return;
|
|
49615
49735
|
}
|
|
@@ -49630,24 +49750,22 @@ class Element {
|
|
|
49630
49750
|
|
|
49631
49751
|
/**
|
|
49632
49752
|
* Metadata about this element (id, classes, title, description, links).
|
|
49633
|
-
* Lazily creates
|
|
49753
|
+
* Lazily creates a Metadata instance if not set.
|
|
49634
49754
|
*/
|
|
49635
49755
|
get meta() {
|
|
49636
49756
|
if (!this._meta) {
|
|
49637
|
-
if (this.isFrozen)
|
|
49638
|
-
|
|
49639
|
-
meta.freeze();
|
|
49640
|
-
return meta;
|
|
49641
|
-
}
|
|
49642
|
-
this._meta = new this.ObjectElement();
|
|
49757
|
+
if (this.isFrozen) return FROZEN_EMPTY_METADATA;
|
|
49758
|
+
this._meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
49643
49759
|
}
|
|
49644
49760
|
return this._meta;
|
|
49645
49761
|
}
|
|
49646
49762
|
set meta(value) {
|
|
49647
|
-
if (value instanceof
|
|
49763
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
49648
49764
|
this._meta = value;
|
|
49649
|
-
} else {
|
|
49650
|
-
|
|
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;
|
|
49651
49769
|
}
|
|
49652
49770
|
}
|
|
49653
49771
|
|
|
@@ -49680,10 +49798,8 @@ class Element {
|
|
|
49680
49798
|
|
|
49681
49799
|
/** Unique identifier for this element. */
|
|
49682
49800
|
get id() {
|
|
49683
|
-
if (this.isFrozen) {
|
|
49684
|
-
return this.getMetaProperty('id', '');
|
|
49685
|
-
}
|
|
49686
49801
|
if (!this.hasMetaProperty('id')) {
|
|
49802
|
+
if (this.isFrozen) return '';
|
|
49687
49803
|
this.setMetaProperty('id', '');
|
|
49688
49804
|
}
|
|
49689
49805
|
return this.meta.get('id');
|
|
@@ -49694,10 +49810,8 @@ class Element {
|
|
|
49694
49810
|
|
|
49695
49811
|
/** CSS-like class names. */
|
|
49696
49812
|
get classes() {
|
|
49697
|
-
if (this.isFrozen) {
|
|
49698
|
-
return this.getMetaProperty('classes', []);
|
|
49699
|
-
}
|
|
49700
49813
|
if (!this.hasMetaProperty('classes')) {
|
|
49814
|
+
if (this.isFrozen) return [];
|
|
49701
49815
|
this.setMetaProperty('classes', []);
|
|
49702
49816
|
}
|
|
49703
49817
|
return this.meta.get('classes');
|
|
@@ -49708,11 +49822,13 @@ class Element {
|
|
|
49708
49822
|
|
|
49709
49823
|
/** Hyperlinks associated with this element. */
|
|
49710
49824
|
get links() {
|
|
49711
|
-
if (this.isFrozen) {
|
|
49712
|
-
return this.getMetaProperty('links', []);
|
|
49713
|
-
}
|
|
49714
49825
|
if (!this.hasMetaProperty('links')) {
|
|
49715
|
-
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());
|
|
49716
49832
|
}
|
|
49717
49833
|
return this.meta.get('links');
|
|
49718
49834
|
}
|
|
@@ -49732,7 +49848,7 @@ class Element {
|
|
|
49732
49848
|
if (Array.isArray(content)) {
|
|
49733
49849
|
return content;
|
|
49734
49850
|
}
|
|
49735
|
-
if (content instanceof
|
|
49851
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
49736
49852
|
const children = [];
|
|
49737
49853
|
if (content.key) children.push(content.key);
|
|
49738
49854
|
if (content.value) children.push(content.value);
|
|
@@ -49762,7 +49878,6 @@ class Element {
|
|
|
49762
49878
|
|
|
49763
49879
|
// Freeze meta and attributes
|
|
49764
49880
|
if (this._meta) {
|
|
49765
|
-
this._meta.parent = this;
|
|
49766
49881
|
this._meta.freeze();
|
|
49767
49882
|
}
|
|
49768
49883
|
if (this._attributes) {
|
|
@@ -49797,7 +49912,7 @@ class Element {
|
|
|
49797
49912
|
if (_content instanceof Element) {
|
|
49798
49913
|
return _content.toValue();
|
|
49799
49914
|
}
|
|
49800
|
-
if (_content instanceof
|
|
49915
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
49801
49916
|
return _content.toValue();
|
|
49802
49917
|
}
|
|
49803
49918
|
if (Array.isArray(_content)) {
|
|
@@ -49853,7 +49968,7 @@ class Element {
|
|
|
49853
49968
|
* @throws Error if this element has no ID
|
|
49854
49969
|
*/
|
|
49855
49970
|
toRef(path) {
|
|
49856
|
-
const idValue = this.id
|
|
49971
|
+
const idValue = this.id;
|
|
49857
49972
|
if (idValue === '') {
|
|
49858
49973
|
throw new Error('Cannot create reference to an element without an ID');
|
|
49859
49974
|
}
|
|
@@ -49865,26 +49980,16 @@ class Element {
|
|
|
49865
49980
|
}
|
|
49866
49981
|
|
|
49867
49982
|
/**
|
|
49868
|
-
* Gets a meta property.
|
|
49983
|
+
* Gets a meta property value.
|
|
49869
49984
|
*
|
|
49870
49985
|
* When the property doesn't exist:
|
|
49871
|
-
* - With defaultValue: returns
|
|
49986
|
+
* - With defaultValue: returns the provided default value
|
|
49872
49987
|
* - Without defaultValue: returns undefined
|
|
49873
|
-
*
|
|
49874
|
-
* Note: Each call with a default creates a new instance. Use setMetaProperty
|
|
49875
|
-
* first if you need reference equality across multiple accesses.
|
|
49876
49988
|
*/
|
|
49877
49989
|
|
|
49878
49990
|
getMetaProperty(name, defaultValue) {
|
|
49879
49991
|
if (!this.hasMetaProperty(name)) {
|
|
49880
|
-
|
|
49881
|
-
return undefined;
|
|
49882
|
-
}
|
|
49883
|
-
const element = this.refract(defaultValue);
|
|
49884
|
-
if (element && this.isFrozen) {
|
|
49885
|
-
element.freeze();
|
|
49886
|
-
}
|
|
49887
|
-
return element;
|
|
49992
|
+
return defaultValue;
|
|
49888
49993
|
}
|
|
49889
49994
|
return this.meta.get(name);
|
|
49890
49995
|
}
|
|
@@ -49897,20 +50002,17 @@ class Element {
|
|
|
49897
50002
|
}
|
|
49898
50003
|
|
|
49899
50004
|
/**
|
|
49900
|
-
*
|
|
50005
|
+
* Checks whether a meta property exists.
|
|
49901
50006
|
*/
|
|
49902
50007
|
hasMetaProperty(name) {
|
|
49903
|
-
|
|
49904
|
-
return this.meta.hasKey(name);
|
|
49905
|
-
}
|
|
49906
|
-
return false;
|
|
50008
|
+
return this._meta !== undefined && this._meta.hasKey(name);
|
|
49907
50009
|
}
|
|
49908
50010
|
|
|
49909
50011
|
/**
|
|
49910
50012
|
* Checks if meta is empty.
|
|
49911
50013
|
*/
|
|
49912
50014
|
get isMetaEmpty() {
|
|
49913
|
-
return this._meta === undefined || this.
|
|
50015
|
+
return this._meta === undefined || this._meta.isEmpty;
|
|
49914
50016
|
}
|
|
49915
50017
|
|
|
49916
50018
|
/**
|
|
@@ -49936,7 +50038,7 @@ class Element {
|
|
|
49936
50038
|
}
|
|
49937
50039
|
|
|
49938
50040
|
/**
|
|
49939
|
-
*
|
|
50041
|
+
* Checks whether an attributes property exists.
|
|
49940
50042
|
*/
|
|
49941
50043
|
hasAttributesProperty(name) {
|
|
49942
50044
|
if (!this.isAttributesEmpty) {
|
|
@@ -49955,6 +50057,7 @@ class Element {
|
|
|
49955
50057
|
|
|
49956
50058
|
// Re-export types for convenience
|
|
49957
50059
|
|
|
50060
|
+
|
|
49958
50061
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Element);
|
|
49959
50062
|
|
|
49960
50063
|
/***/ },
|
|
@@ -50393,6 +50496,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50393
50496
|
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(49686);
|
|
50394
50497
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(38504);
|
|
50395
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
|
+
|
|
50396
50503
|
|
|
50397
50504
|
|
|
50398
50505
|
|
|
@@ -50452,14 +50559,16 @@ function refract(value) {
|
|
|
50452
50559
|
}
|
|
50453
50560
|
|
|
50454
50561
|
// Set up prototype assignments for circular dependency resolution.
|
|
50455
|
-
// These allow Element instances to
|
|
50456
|
-
//
|
|
50562
|
+
// These allow Element and Metadata instances to reference classes they can't import
|
|
50563
|
+
// directly (which would cause circular imports).
|
|
50457
50564
|
// Using 'declare' in the class definitions enables type-safe access to these properties.
|
|
50458
50565
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement = _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"];
|
|
50459
50566
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ArrayElement = _primitives_ArrayElement_mjs__WEBPACK_IMPORTED_MODULE_6__["default"];
|
|
50460
50567
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.RefElement = _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"];
|
|
50461
50568
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.MemberElement = _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"];
|
|
50462
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);
|
|
50463
50572
|
|
|
50464
50573
|
/**
|
|
50465
50574
|
* Contains all of the element classes, and related structures and methods
|
|
@@ -50524,7 +50633,13 @@ class JSONSerialiser {
|
|
|
50524
50633
|
element: element.element
|
|
50525
50634
|
};
|
|
50526
50635
|
if (!element.isMetaEmpty) {
|
|
50527
|
-
|
|
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
|
+
}
|
|
50528
50643
|
}
|
|
50529
50644
|
if (!element.isAttributesEmpty) {
|
|
50530
50645
|
payload.attributes = this.serialiseObject(element.attributes);
|
|
@@ -50571,7 +50686,7 @@ class JSONSerialiser {
|
|
|
50571
50686
|
element.element = value.element;
|
|
50572
50687
|
}
|
|
50573
50688
|
|
|
50574
|
-
// Extract
|
|
50689
|
+
// Extract special meta keys without mutating input, filter remaining meta
|
|
50575
50690
|
let mappingsDoc;
|
|
50576
50691
|
let stylesDoc;
|
|
50577
50692
|
let metaToDeserialize = value.meta;
|
|
@@ -50585,8 +50700,15 @@ class JSONSerialiser {
|
|
|
50585
50700
|
stylesDoc = __styles__;
|
|
50586
50701
|
metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
|
|
50587
50702
|
}
|
|
50703
|
+
|
|
50704
|
+
// determine which meta keys were raw primitives before serialization
|
|
50705
|
+
const rawKeys = value.__meta_raw__ ? new Set(value.__meta_raw__) : undefined;
|
|
50588
50706
|
if (metaToDeserialize) {
|
|
50589
|
-
|
|
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
|
+
}
|
|
50590
50712
|
}
|
|
50591
50713
|
|
|
50592
50714
|
// Restore source position from __mappings__
|
|
@@ -50649,6 +50771,27 @@ class JSONSerialiser {
|
|
|
50649
50771
|
}
|
|
50650
50772
|
return content;
|
|
50651
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
|
+
}
|
|
50652
50795
|
serialiseObject(obj) {
|
|
50653
50796
|
const result = {};
|
|
50654
50797
|
obj.forEach((value, key) => {
|
|
@@ -50862,6 +51005,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50862
51005
|
/* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61198);
|
|
50863
51006
|
|
|
50864
51007
|
|
|
51008
|
+
|
|
51009
|
+
/**
|
|
51010
|
+
* @public
|
|
51011
|
+
*/
|
|
50865
51012
|
class ApiDOMEvaluationRealm extends _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_1__.EvaluationRealm {
|
|
50866
51013
|
name = 'apidom';
|
|
50867
51014
|
isArray(node) {
|
|
@@ -52678,7 +52825,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
52678
52825
|
const refract = (value, {
|
|
52679
52826
|
element = 'arazzoSpecification1',
|
|
52680
52827
|
plugins = [],
|
|
52681
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
52828
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
52829
|
+
consume = false
|
|
52682
52830
|
} = {}) => {
|
|
52683
52831
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.refract)(value);
|
|
52684
52832
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -52695,7 +52843,8 @@ const refract = (value, {
|
|
|
52695
52843
|
*/
|
|
52696
52844
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
52697
52845
|
const rootVisitor = new RootVisitorClass({
|
|
52698
|
-
specObj: resolvedSpec
|
|
52846
|
+
specObj: resolvedSpec,
|
|
52847
|
+
consume
|
|
52699
52848
|
});
|
|
52700
52849
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_2__.traverse)(genericElement, rootVisitor);
|
|
52701
52850
|
|
|
@@ -53287,7 +53436,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53287
53436
|
*/
|
|
53288
53437
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
53289
53438
|
enter(path) {
|
|
53290
|
-
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);
|
|
53291
53440
|
path.stop();
|
|
53292
53441
|
}
|
|
53293
53442
|
}
|
|
@@ -53354,7 +53503,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53354
53503
|
*/
|
|
53355
53504
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
53356
53505
|
specObj;
|
|
53357
|
-
passingOptionsNames = ['specObj'];
|
|
53506
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
53358
53507
|
constructor({
|
|
53359
53508
|
specObj,
|
|
53360
53509
|
...rest
|
|
@@ -53400,7 +53549,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
53400
53549
|
*/
|
|
53401
53550
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
53402
53551
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
53403
|
-
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);
|
|
53404
53553
|
}
|
|
53405
53554
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
53406
53555
|
return visitor.element;
|
|
@@ -53419,7 +53568,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53419
53568
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
53420
53569
|
/* harmony export */ });
|
|
53421
53570
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
53422
|
-
/* 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);
|
|
53423
53572
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
53424
53573
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
53425
53574
|
|
|
@@ -53434,19 +53583,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53434
53583
|
*/
|
|
53435
53584
|
class Visitor {
|
|
53436
53585
|
element;
|
|
53586
|
+
consume = false;
|
|
53587
|
+
consumeSafe = false;
|
|
53437
53588
|
constructor(options = {}) {
|
|
53438
53589
|
Object.assign(this, options);
|
|
53439
53590
|
}
|
|
53440
53591
|
copyMetaAndAttributes(from, to) {
|
|
53441
|
-
if (!from.isMetaEmpty
|
|
53442
|
-
|
|
53443
|
-
|
|
53444
|
-
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();
|
|
53445
53596
|
}
|
|
53446
|
-
if (!from.isAttributesEmpty
|
|
53447
|
-
|
|
53448
|
-
|
|
53449
|
-
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);
|
|
53450
53601
|
}
|
|
53451
53602
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
53452
53603
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -53993,6 +54144,7 @@ class ArazzoSpecificationVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__
|
|
|
53993
54144
|
constructor(options) {
|
|
53994
54145
|
super(options);
|
|
53995
54146
|
this.element = new _elements_ArazzoSpecification1_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
54147
|
+
this.consumeSafe = true;
|
|
53996
54148
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'ArazzoSpecification']);
|
|
53997
54149
|
this.canSupportSpecificationExtensions = true;
|
|
53998
54150
|
}
|
|
@@ -54986,15 +55138,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
54986
55138
|
objectElement.forEach((value, key, memberElement) => {
|
|
54987
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))) {
|
|
54988
55140
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key)], value);
|
|
54989
|
-
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);
|
|
54990
55142
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
54991
|
-
newMemberElement.classes.push('fixed-field');
|
|
54992
55143
|
this.element.push(newMemberElement);
|
|
55144
|
+
// consume: release processed generic subtree
|
|
55145
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
54993
55146
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
54994
55147
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
54995
55148
|
this.element.push(extensionElement);
|
|
55149
|
+
// consume: release processed generic subtree
|
|
55150
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
54996
55151
|
} else if (!this.ignoredFields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key))) {
|
|
54997
|
-
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));
|
|
54998
55153
|
}
|
|
54999
55154
|
});
|
|
55000
55155
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -55097,12 +55252,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
55097
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))) {
|
|
55098
55253
|
const specPath = this.specPath(value);
|
|
55099
55254
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
55100
|
-
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);
|
|
55101
55256
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
55102
55257
|
newMemberElement.classes.push('patterned-field');
|
|
55103
55258
|
this.element.push(newMemberElement);
|
|
55259
|
+
// consume: release processed generic subtree
|
|
55260
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
55104
55261
|
} else if (!this.ignoredFields.includes((0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key))) {
|
|
55105
|
-
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));
|
|
55106
55263
|
}
|
|
55107
55264
|
});
|
|
55108
55265
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -61124,7 +61281,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61124
61281
|
const refract = (value, {
|
|
61125
61282
|
element = 'asyncApi2',
|
|
61126
61283
|
plugins = [],
|
|
61127
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
61284
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
61285
|
+
consume = false
|
|
61128
61286
|
} = {}) => {
|
|
61129
61287
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.refract)(value);
|
|
61130
61288
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__.resolveSpecification)(specificationObj);
|
|
@@ -61141,7 +61299,8 @@ const refract = (value, {
|
|
|
61141
61299
|
*/
|
|
61142
61300
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
61143
61301
|
const rootVisitor = new RootVisitorClass({
|
|
61144
|
-
specObj: resolvedSpec
|
|
61302
|
+
specObj: resolvedSpec,
|
|
61303
|
+
consume
|
|
61145
61304
|
});
|
|
61146
61305
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor);
|
|
61147
61306
|
|
|
@@ -63955,7 +64114,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63955
64114
|
*/
|
|
63956
64115
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
63957
64116
|
enter(path) {
|
|
63958
|
-
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);
|
|
63959
64118
|
path.stop();
|
|
63960
64119
|
}
|
|
63961
64120
|
}
|
|
@@ -64022,7 +64181,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64022
64181
|
*/
|
|
64023
64182
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
64024
64183
|
specObj;
|
|
64025
|
-
passingOptionsNames = ['specObj'];
|
|
64184
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
64026
64185
|
constructor({
|
|
64027
64186
|
specObj,
|
|
64028
64187
|
...rest
|
|
@@ -64068,7 +64227,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
64068
64227
|
*/
|
|
64069
64228
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
64070
64229
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
64071
|
-
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);
|
|
64072
64231
|
}
|
|
64073
64232
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
|
|
64074
64233
|
return visitor.element;
|
|
@@ -64087,7 +64246,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64087
64246
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
64088
64247
|
/* harmony export */ });
|
|
64089
64248
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
64090
|
-
/* 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);
|
|
64091
64250
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
64092
64251
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
64093
64252
|
|
|
@@ -64102,19 +64261,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64102
64261
|
*/
|
|
64103
64262
|
class Visitor {
|
|
64104
64263
|
element;
|
|
64264
|
+
consume = false;
|
|
64265
|
+
consumeSafe = false;
|
|
64105
64266
|
constructor(options) {
|
|
64106
64267
|
Object.assign(this, options);
|
|
64107
64268
|
}
|
|
64108
64269
|
copyMetaAndAttributes(from, to) {
|
|
64109
|
-
if (!from.isMetaEmpty
|
|
64110
|
-
|
|
64111
|
-
|
|
64112
|
-
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();
|
|
64113
64274
|
}
|
|
64114
|
-
if (!from.isAttributesEmpty
|
|
64115
|
-
|
|
64116
|
-
|
|
64117
|
-
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);
|
|
64118
64279
|
}
|
|
64119
64280
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
64120
64281
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -67678,6 +67839,7 @@ class AsyncApi2Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixed
|
|
|
67678
67839
|
constructor(options) {
|
|
67679
67840
|
super(options);
|
|
67680
67841
|
this.element = new _elements_AsyncApi2_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
67842
|
+
this.consumeSafe = true;
|
|
67681
67843
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'AsyncApi']);
|
|
67682
67844
|
this.canSupportSpecificationExtensions = true;
|
|
67683
67845
|
}
|
|
@@ -69884,15 +70046,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
69884
70046
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
69885
70047
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
69886
70048
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
69887
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
69888
|
-
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);
|
|
69889
70050
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
69890
70051
|
this.element.content.push(newMemberElement);
|
|
70052
|
+
// consume: release processed generic subtree
|
|
70053
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
69891
70054
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
69892
70055
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
69893
70056
|
this.element.content.push(extensionElement);
|
|
70057
|
+
// consume: release processed generic subtree
|
|
70058
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
69894
70059
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
69895
|
-
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));
|
|
69896
70061
|
}
|
|
69897
70062
|
});
|
|
69898
70063
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -69996,12 +70161,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
69996
70161
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
69997
70162
|
const specPath = this.specPath(value);
|
|
69998
70163
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
69999
|
-
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);
|
|
70000
70165
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
70001
70166
|
newMemberElement.classes.push('patterned-field');
|
|
70002
70167
|
this.element.content.push(newMemberElement);
|
|
70168
|
+
// consume: release processed generic subtree
|
|
70169
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
70003
70170
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
70004
|
-
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));
|
|
70005
70172
|
}
|
|
70006
70173
|
});
|
|
70007
70174
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -72020,7 +72187,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72020
72187
|
*/
|
|
72021
72188
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
72022
72189
|
enter(path) {
|
|
72023
|
-
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);
|
|
72024
72191
|
path.stop();
|
|
72025
72192
|
}
|
|
72026
72193
|
}
|
|
@@ -72060,7 +72227,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72060
72227
|
*/
|
|
72061
72228
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
72062
72229
|
specObj;
|
|
72063
|
-
passingOptionsNames = ['specObj', 'parent'];
|
|
72230
|
+
passingOptionsNames = ['specObj', 'parent', 'consume'];
|
|
72064
72231
|
constructor({
|
|
72065
72232
|
specObj,
|
|
72066
72233
|
...rest
|
|
@@ -72106,7 +72273,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
72106
72273
|
*/
|
|
72107
72274
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
72108
72275
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
72109
|
-
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);
|
|
72110
72277
|
}
|
|
72111
72278
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
72112
72279
|
return visitor.element;
|
|
@@ -72125,7 +72292,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72125
72292
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
72126
72293
|
/* harmony export */ });
|
|
72127
72294
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
72128
|
-
/* 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);
|
|
72129
72296
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
72130
72297
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
72131
72298
|
|
|
@@ -72140,19 +72307,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72140
72307
|
*/
|
|
72141
72308
|
class Visitor {
|
|
72142
72309
|
element;
|
|
72310
|
+
consume = false;
|
|
72311
|
+
consumeSafe = false;
|
|
72143
72312
|
constructor(options) {
|
|
72144
72313
|
Object.assign(this, options);
|
|
72145
72314
|
}
|
|
72146
72315
|
copyMetaAndAttributes(from, to) {
|
|
72147
|
-
if (!from.isMetaEmpty
|
|
72148
|
-
|
|
72149
|
-
|
|
72150
|
-
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();
|
|
72151
72320
|
}
|
|
72152
|
-
if (!from.isAttributesEmpty
|
|
72153
|
-
|
|
72154
|
-
|
|
72155
|
-
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);
|
|
72156
72325
|
}
|
|
72157
72326
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
72158
72327
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -72262,12 +72431,13 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
72262
72431
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
72263
72432
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
72264
72433
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
72265
|
-
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);
|
|
72266
72435
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
72267
|
-
newMemberElement.classes.push('fixed-field');
|
|
72268
72436
|
this.element.content.push(newMemberElement);
|
|
72437
|
+
// consume: release processed generic subtree
|
|
72438
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
72269
72439
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
72270
|
-
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));
|
|
72271
72441
|
}
|
|
72272
72442
|
});
|
|
72273
72443
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -72356,12 +72526,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
72356
72526
|
if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
72357
72527
|
const specPath = this.specPath(value);
|
|
72358
72528
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
72359
|
-
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);
|
|
72360
72530
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
72361
72531
|
newMemberElement.classes.push('patterned-field');
|
|
72362
72532
|
this.element.content.push(newMemberElement);
|
|
72533
|
+
// consume: release processed generic subtree
|
|
72534
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
72363
72535
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
72364
|
-
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));
|
|
72365
72537
|
}
|
|
72366
72538
|
});
|
|
72367
72539
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -72919,13 +73091,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72919
73091
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33031);
|
|
72920
73092
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68894);
|
|
72921
73093
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25162);
|
|
72922
|
-
/* harmony import */ var
|
|
72923
|
-
/* harmony import */ var
|
|
72924
|
-
/* harmony import */ var
|
|
72925
|
-
/* harmony import */ var
|
|
72926
|
-
/* harmony import */ var
|
|
72927
|
-
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(94686);
|
|
72928
|
-
/* 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);
|
|
72929
73099
|
|
|
72930
73100
|
|
|
72931
73101
|
|
|
@@ -72940,10 +73110,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
72940
73110
|
/**
|
|
72941
73111
|
* @public
|
|
72942
73112
|
*/
|
|
72943
|
-
class JSONSchemaVisitor extends
|
|
73113
|
+
class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.JSONSchemaVisitorBase {
|
|
72944
73114
|
constructor(options) {
|
|
72945
73115
|
super(options);
|
|
72946
|
-
this.element = new
|
|
73116
|
+
this.element = new _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]();
|
|
73117
|
+
this.consumeSafe = true;
|
|
72947
73118
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'JSONSchema']);
|
|
72948
73119
|
}
|
|
72949
73120
|
get defaultDialectIdentifier() {
|
|
@@ -72956,27 +73127,27 @@ class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_9__.JSONSche
|
|
|
72956
73127
|
|
|
72957
73128
|
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
72958
73129
|
this.parent = this.element;
|
|
72959
|
-
return
|
|
73130
|
+
return _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].prototype.ObjectElement.call(this, path);
|
|
72960
73131
|
}
|
|
72961
73132
|
handleDialectIdentifier(objectElement) {
|
|
72962
73133
|
// handle $schema keyword in embedded resources
|
|
72963
73134
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
72964
73135
|
// no parent available and no $schema is defined, set default $schema
|
|
72965
73136
|
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
72966
|
-
} 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'))) {
|
|
72967
73138
|
// parent is available and no $schema is defined, set parent $schema
|
|
72968
|
-
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));
|
|
72969
73140
|
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
72970
73141
|
}
|
|
72971
73142
|
}
|
|
72972
73143
|
handleSchemaIdentifier(objectElement, identifierKeyword = 'id') {
|
|
72973
73144
|
// handle schema identifier in embedded resources
|
|
72974
|
-
// fetch parent's ancestorsSchemaIdentifiers
|
|
72975
|
-
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') ?? [])] : [];
|
|
72976
73147
|
// get current schema identifier
|
|
72977
|
-
const schemaIdentifier = (0,
|
|
73148
|
+
const schemaIdentifier = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(objectElement.get(identifierKeyword));
|
|
72978
73149
|
|
|
72979
|
-
// remember schema identifier if it's a non-empty
|
|
73150
|
+
// remember schema identifier if it's a non-empty string
|
|
72980
73151
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__["default"])(schemaIdentifier)) {
|
|
72981
73152
|
ancestorsSchemaIdentifiers.push(schemaIdentifier);
|
|
72982
73153
|
}
|
|
@@ -76487,7 +76658,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
76487
76658
|
const refract = (value, {
|
|
76488
76659
|
element = 'swagger',
|
|
76489
76660
|
plugins = [],
|
|
76490
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
76661
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
76662
|
+
consume = false
|
|
76491
76663
|
} = {}) => {
|
|
76492
76664
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.refract)(value);
|
|
76493
76665
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -76504,7 +76676,8 @@ const refract = (value, {
|
|
|
76504
76676
|
*/
|
|
76505
76677
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
76506
76678
|
const rootVisitor = new RootVisitorClass({
|
|
76507
|
-
specObj: resolvedSpec
|
|
76679
|
+
specObj: resolvedSpec,
|
|
76680
|
+
consume
|
|
76508
76681
|
});
|
|
76509
76682
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor);
|
|
76510
76683
|
|
|
@@ -77425,7 +77598,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77425
77598
|
*/
|
|
77426
77599
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
77427
77600
|
enter(path) {
|
|
77428
|
-
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);
|
|
77429
77602
|
path.stop();
|
|
77430
77603
|
}
|
|
77431
77604
|
}
|
|
@@ -77491,7 +77664,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77491
77664
|
*/
|
|
77492
77665
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
77493
77666
|
specObj;
|
|
77494
|
-
passingOptionsNames = ['specObj'];
|
|
77667
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
77495
77668
|
constructor({
|
|
77496
77669
|
specObj,
|
|
77497
77670
|
...rest
|
|
@@ -77537,7 +77710,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
77537
77710
|
*/
|
|
77538
77711
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
77539
77712
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
77540
|
-
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);
|
|
77541
77714
|
}
|
|
77542
77715
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
|
|
77543
77716
|
return visitor.element;
|
|
@@ -77556,7 +77729,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77556
77729
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
77557
77730
|
/* harmony export */ });
|
|
77558
77731
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
77559
|
-
/* 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);
|
|
77560
77733
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
77561
77734
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
77562
77735
|
|
|
@@ -77571,19 +77744,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77571
77744
|
*/
|
|
77572
77745
|
class Visitor {
|
|
77573
77746
|
element;
|
|
77747
|
+
consume = false;
|
|
77748
|
+
consumeSafe = false;
|
|
77574
77749
|
constructor(options = {}) {
|
|
77575
77750
|
Object.assign(this, options);
|
|
77576
77751
|
}
|
|
77577
77752
|
copyMetaAndAttributes(from, to) {
|
|
77578
|
-
if (!from.isMetaEmpty
|
|
77579
|
-
|
|
77580
|
-
|
|
77581
|
-
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();
|
|
77582
77757
|
}
|
|
77583
|
-
if (!from.isAttributesEmpty
|
|
77584
|
-
|
|
77585
|
-
|
|
77586
|
-
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);
|
|
77587
77762
|
}
|
|
77588
77763
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
77589
77764
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -77705,15 +77880,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
77705
77880
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
77706
77881
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
77707
77882
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
77708
|
-
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);
|
|
77709
77884
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
77710
|
-
newMemberElement.classes.push('fixed-field');
|
|
77711
77885
|
this.element.content.push(newMemberElement);
|
|
77886
|
+
// consume: release processed generic subtree
|
|
77887
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
77712
77888
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
77713
77889
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
77714
77890
|
this.element.content.push(extensionElement);
|
|
77891
|
+
// consume: release processed generic subtree
|
|
77892
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
77715
77893
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
77716
|
-
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));
|
|
77717
77895
|
}
|
|
77718
77896
|
});
|
|
77719
77897
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -77895,12 +78073,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
77895
78073
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
77896
78074
|
const specPath = this.specPath(value);
|
|
77897
78075
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
77898
|
-
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);
|
|
77899
78077
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
77900
78078
|
newMemberElement.classes.push('patterned-field');
|
|
77901
78079
|
this.element.content.push(newMemberElement);
|
|
78080
|
+
// consume: release processed generic subtree
|
|
78081
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
77902
78082
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
77903
|
-
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));
|
|
77904
78084
|
}
|
|
77905
78085
|
});
|
|
77906
78086
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -78451,6 +78631,7 @@ class SwaggerVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixedFi
|
|
|
78451
78631
|
constructor(options) {
|
|
78452
78632
|
super(options);
|
|
78453
78633
|
this.element = new _elements_Swagger_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
78634
|
+
this.consumeSafe = true;
|
|
78454
78635
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Swagger']);
|
|
78455
78636
|
this.canSupportSpecificationExtensions = true;
|
|
78456
78637
|
}
|
|
@@ -78955,6 +79136,7 @@ class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseFixedF
|
|
|
78955
79136
|
constructor(options) {
|
|
78956
79137
|
super(options);
|
|
78957
79138
|
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
79139
|
+
this.consumeSafe = true;
|
|
78958
79140
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
78959
79141
|
}
|
|
78960
79142
|
ObjectElement(path) {
|
|
@@ -79006,6 +79188,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
79006
79188
|
constructor(options) {
|
|
79007
79189
|
super(options);
|
|
79008
79190
|
this.element = new _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
79191
|
+
this.consumeSafe = true;
|
|
79009
79192
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(['document', 'objects', 'PathItem']);
|
|
79010
79193
|
this.canSupportSpecificationExtensions = true;
|
|
79011
79194
|
this.fieldPatternPredicate = ramda__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
@@ -82666,7 +82849,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82666
82849
|
const refract = (value, {
|
|
82667
82850
|
element = 'openApi3_0',
|
|
82668
82851
|
plugins = [],
|
|
82669
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
82852
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
82853
|
+
consume = false
|
|
82670
82854
|
} = {}) => {
|
|
82671
82855
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.refract)(value);
|
|
82672
82856
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -82683,7 +82867,8 @@ const refract = (value, {
|
|
|
82683
82867
|
*/
|
|
82684
82868
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
82685
82869
|
const rootVisitor = new RootVisitorClass({
|
|
82686
|
-
specObj: resolvedSpec
|
|
82870
|
+
specObj: resolvedSpec,
|
|
82871
|
+
consume
|
|
82687
82872
|
});
|
|
82688
82873
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor, {
|
|
82689
82874
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.getNodePrimitiveType
|
|
@@ -83871,7 +84056,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83871
84056
|
*/
|
|
83872
84057
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
83873
84058
|
enter(path) {
|
|
83874
|
-
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);
|
|
83875
84060
|
path.stop();
|
|
83876
84061
|
}
|
|
83877
84062
|
}
|
|
@@ -83937,8 +84122,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83937
84122
|
*/
|
|
83938
84123
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
83939
84124
|
specObj;
|
|
83940
|
-
passingOptionsNames = ['specObj', 'openApiGenericElement', 'openApiSemanticElement'];
|
|
84125
|
+
passingOptionsNames = ['specObj', 'openApiGenericElement', 'sourceContext', 'openApiSemanticElement', 'consume'];
|
|
83941
84126
|
openApiGenericElement;
|
|
84127
|
+
sourceContext;
|
|
83942
84128
|
openApiSemanticElement;
|
|
83943
84129
|
constructor({
|
|
83944
84130
|
specObj,
|
|
@@ -83993,7 +84179,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
83993
84179
|
*/
|
|
83994
84180
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
83995
84181
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
83996
|
-
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);
|
|
83997
84183
|
}
|
|
83998
84184
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, {
|
|
83999
84185
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.getNodePrimitiveType
|
|
@@ -84014,7 +84200,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84014
84200
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
84015
84201
|
/* harmony export */ });
|
|
84016
84202
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
84017
|
-
/* 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);
|
|
84018
84204
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
84019
84205
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
84020
84206
|
|
|
@@ -84029,19 +84215,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84029
84215
|
*/
|
|
84030
84216
|
class Visitor {
|
|
84031
84217
|
element;
|
|
84218
|
+
consume = false;
|
|
84219
|
+
consumeSafe = false;
|
|
84032
84220
|
constructor(options = {}) {
|
|
84033
84221
|
Object.assign(this, options);
|
|
84034
84222
|
}
|
|
84035
84223
|
copyMetaAndAttributes(from, to) {
|
|
84036
|
-
if (!from.isMetaEmpty
|
|
84037
|
-
|
|
84038
|
-
|
|
84039
|
-
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();
|
|
84040
84228
|
}
|
|
84041
|
-
if (!from.isAttributesEmpty
|
|
84042
|
-
|
|
84043
|
-
|
|
84044
|
-
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);
|
|
84045
84233
|
}
|
|
84046
84234
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
84047
84235
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -84163,15 +84351,20 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
84163
84351
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
84164
84352
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
84165
84353
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
84166
|
-
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);
|
|
84167
84355
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
84168
|
-
newMemberElement.classes.push('fixed-field');
|
|
84169
84356
|
this.element.content.push(newMemberElement);
|
|
84357
|
+
// consume: release processed generic subtree
|
|
84358
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
84170
84359
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
84171
84360
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
84172
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
|
+
}
|
|
84173
84366
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
84174
|
-
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));
|
|
84175
84368
|
}
|
|
84176
84369
|
});
|
|
84177
84370
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -84353,12 +84546,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
84353
84546
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
84354
84547
|
const specPath = this.specPath(value);
|
|
84355
84548
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
84356
|
-
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);
|
|
84357
84550
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
84358
84551
|
newMemberElement.classes.push('patterned-field');
|
|
84359
84552
|
this.element.content.push(newMemberElement);
|
|
84553
|
+
// consume: release processed generic subtree
|
|
84554
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
84360
84555
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
84361
|
-
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));
|
|
84362
84557
|
}
|
|
84363
84558
|
});
|
|
84364
84559
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -85221,6 +85416,7 @@ class ComponentsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixe
|
|
|
85221
85416
|
this.element = new _elements_Components_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
85222
85417
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Components']);
|
|
85223
85418
|
this.canSupportSpecificationExtensions = true;
|
|
85419
|
+
this.consumeSafe = true;
|
|
85224
85420
|
}
|
|
85225
85421
|
}
|
|
85226
85422
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ComponentsVisitor);
|
|
@@ -85659,6 +85855,7 @@ class OpenApi3_0Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_1__.BaseFixe
|
|
|
85659
85855
|
this.element = new _elements_OpenApi3_0_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
85660
85856
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'OpenApi']);
|
|
85661
85857
|
this.canSupportSpecificationExtensions = true;
|
|
85858
|
+
this.consumeSafe = true;
|
|
85662
85859
|
}
|
|
85663
85860
|
ObjectElement(path) {
|
|
85664
85861
|
_bases_mjs__WEBPACK_IMPORTED_MODULE_1__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
@@ -86549,11 +86746,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86549
86746
|
/* harmony export */ });
|
|
86550
86747
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
86551
86748
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
86552
|
-
/* harmony import */ var
|
|
86553
|
-
/* harmony import */ var
|
|
86554
|
-
/* harmony import */ var
|
|
86555
|
-
/* harmony import */ var
|
|
86556
|
-
/* 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);
|
|
86557
86753
|
|
|
86558
86754
|
|
|
86559
86755
|
|
|
@@ -86566,22 +86762,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86566
86762
|
/**
|
|
86567
86763
|
* @public
|
|
86568
86764
|
*/
|
|
86569
|
-
class PathItemVisitor extends
|
|
86765
|
+
class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
86570
86766
|
constructor(options) {
|
|
86571
86767
|
super(options);
|
|
86572
|
-
this.element = new
|
|
86768
|
+
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
86573
86769
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
86770
|
+
this.consumeSafe = true;
|
|
86574
86771
|
}
|
|
86575
86772
|
ObjectElement(path) {
|
|
86576
|
-
|
|
86773
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
86577
86774
|
|
|
86578
86775
|
// decorate Operation elements with HTTP method
|
|
86579
|
-
this.element.filter(
|
|
86776
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isOperationElement)
|
|
86580
86777
|
// @ts-ignore
|
|
86581
86778
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
86582
|
-
|
|
86583
|
-
httpMethodElementCS.content = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(httpMethodElementCS).toUpperCase();
|
|
86584
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
86779
|
+
operationElement.meta.set('http-method', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(httpMethodElementCI).toUpperCase());
|
|
86585
86780
|
});
|
|
86586
86781
|
|
|
86587
86782
|
// mark this PathItemElement with reference metadata
|
|
@@ -86604,7 +86799,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86604
86799
|
/* harmony export */ });
|
|
86605
86800
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53679);
|
|
86606
86801
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29498);
|
|
86607
|
-
/* harmony import */ var
|
|
86802
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
86608
86803
|
/* harmony import */ var _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8535);
|
|
86609
86804
|
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32131);
|
|
86610
86805
|
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74367);
|
|
@@ -86625,6 +86820,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
86625
86820
|
this.element = new _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
86626
86821
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(['document', 'objects', 'PathItem']);
|
|
86627
86822
|
this.canSupportSpecificationExtensions = true;
|
|
86823
|
+
this.consumeSafe = true;
|
|
86628
86824
|
this.fieldPatternPredicate = ramda__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
86629
86825
|
}
|
|
86630
86826
|
ObjectElement(path) {
|
|
@@ -86636,7 +86832,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
86636
86832
|
.forEach((pathItemElement, key) => {
|
|
86637
86833
|
key.classes.push('openapi-path-template');
|
|
86638
86834
|
key.classes.push('path-template');
|
|
86639
|
-
pathItemElement.meta.set('path', (0,
|
|
86835
|
+
pathItemElement.meta.set('path', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key));
|
|
86640
86836
|
});
|
|
86641
86837
|
}
|
|
86642
86838
|
}
|
|
@@ -88936,7 +89132,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
88936
89132
|
const refract = (value, {
|
|
88937
89133
|
element = 'openApi3_1',
|
|
88938
89134
|
plugins = [],
|
|
88939
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
89135
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
89136
|
+
consume = false
|
|
88940
89137
|
} = {}) => {
|
|
88941
89138
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.refract)(value);
|
|
88942
89139
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_1__.resolveSpecification)(specificationObj);
|
|
@@ -88953,7 +89150,8 @@ const refract = (value, {
|
|
|
88953
89150
|
*/
|
|
88954
89151
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
88955
89152
|
const rootVisitor = new RootVisitorClass({
|
|
88956
|
-
specObj: resolvedSpec
|
|
89153
|
+
specObj: resolvedSpec,
|
|
89154
|
+
consume
|
|
88957
89155
|
});
|
|
88958
89156
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor, {
|
|
88959
89157
|
nodeTypeGetter: _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.getNodePrimitiveType
|
|
@@ -90475,9 +90673,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
90475
90673
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
90476
90674
|
/* harmony export */ });
|
|
90477
90675
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
90478
|
-
/* harmony import */ var
|
|
90479
|
-
/* harmony import */ var
|
|
90480
|
-
/* 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
|
+
|
|
90481
90683
|
|
|
90482
90684
|
|
|
90483
90685
|
|
|
@@ -90489,18 +90691,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
90489
90691
|
* @public
|
|
90490
90692
|
*/
|
|
90491
90693
|
|
|
90492
|
-
class OpenApi3_1Visitor extends
|
|
90694
|
+
class OpenApi3_1Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
90493
90695
|
constructor(options) {
|
|
90494
90696
|
super(options);
|
|
90495
|
-
this.element = new
|
|
90697
|
+
this.element = new _elements_OpenApi3_1_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
90496
90698
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'OpenApi']);
|
|
90497
90699
|
this.canSupportSpecificationExtensions = true;
|
|
90700
|
+
this.consumeSafe = true;
|
|
90498
90701
|
this.openApiSemanticElement = this.element;
|
|
90499
90702
|
}
|
|
90500
90703
|
ObjectElement(path) {
|
|
90501
90704
|
const objectElement = path.node;
|
|
90502
90705
|
this.openApiGenericElement = objectElement;
|
|
90503
|
-
|
|
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);
|
|
90504
90713
|
}
|
|
90505
90714
|
}
|
|
90506
90715
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenApi3_1Visitor);
|
|
@@ -91188,8 +91397,8 @@ class SchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_8__.BaseSchemaVi
|
|
|
91188
91397
|
(0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isJsonSchemaDialectElement)(this.openApiSemanticElement.jsonSchemaDialect)) {
|
|
91189
91398
|
// @ts-ignore
|
|
91190
91399
|
jsonSchemaDialect = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(this.openApiSemanticElement.jsonSchemaDialect);
|
|
91191
|
-
} else if (this.
|
|
91192
|
-
jsonSchemaDialect =
|
|
91400
|
+
} else if (this.sourceContext?.jsonSchemaDialect !== undefined) {
|
|
91401
|
+
jsonSchemaDialect = this.sourceContext.jsonSchemaDialect;
|
|
91193
91402
|
} else {
|
|
91194
91403
|
jsonSchemaDialect = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(this.jsonSchemaDefaultDialect);
|
|
91195
91404
|
}
|
|
@@ -91437,7 +91646,10 @@ const parse = async (source, options = {}) => {
|
|
|
91437
91646
|
result
|
|
91438
91647
|
} = parseResultElement;
|
|
91439
91648
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91440
|
-
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
|
+
});
|
|
91441
91653
|
arazzoSpecificationElement.classes.push('result');
|
|
91442
91654
|
parseResultElement.replaceResult(arazzoSpecificationElement);
|
|
91443
91655
|
}
|
|
@@ -91521,7 +91733,10 @@ const parse = async (source, options = {}) => {
|
|
|
91521
91733
|
result
|
|
91522
91734
|
} = parseResultElement;
|
|
91523
91735
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91524
|
-
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
|
+
});
|
|
91525
91740
|
arazzoSpecificationElement.classes.push('result');
|
|
91526
91741
|
parseResultElement.replaceResult(arazzoSpecificationElement);
|
|
91527
91742
|
}
|
|
@@ -91605,7 +91820,10 @@ const parse = async (source, options = {}) => {
|
|
|
91605
91820
|
result
|
|
91606
91821
|
} = parseResultElement;
|
|
91607
91822
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91608
|
-
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
|
+
});
|
|
91609
91827
|
asyncApiElement.classes.push('result');
|
|
91610
91828
|
parseResultElement.replaceResult(asyncApiElement);
|
|
91611
91829
|
}
|
|
@@ -91689,7 +91907,10 @@ const parse = async (source, options = {}) => {
|
|
|
91689
91907
|
result
|
|
91690
91908
|
} = parseResultElement;
|
|
91691
91909
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
91692
|
-
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
|
+
});
|
|
91693
91914
|
asyncApiElement.classes.push('result');
|
|
91694
91915
|
parseResultElement.replaceResult(asyncApiElement);
|
|
91695
91916
|
}
|
|
@@ -91872,8 +92093,9 @@ const parse = async source => {
|
|
|
91872
92093
|
if (source.trim().length === 0) {
|
|
91873
92094
|
return parseResult;
|
|
91874
92095
|
}
|
|
91875
|
-
|
|
92096
|
+
let pojo = JSON.parse(source);
|
|
91876
92097
|
const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.refract)(pojo);
|
|
92098
|
+
pojo = null; // allow GC to reclaim POJO
|
|
91877
92099
|
element.classes.push('result');
|
|
91878
92100
|
parseResult.push(element);
|
|
91879
92101
|
return parseResult;
|
|
@@ -92348,7 +92570,10 @@ const parse = async (source, options = {}) => {
|
|
|
92348
92570
|
result
|
|
92349
92571
|
} = parseResultElement;
|
|
92350
92572
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92351
|
-
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
|
+
});
|
|
92352
92577
|
swaggerElement.classes.push('result');
|
|
92353
92578
|
parseResultElement.replaceResult(swaggerElement);
|
|
92354
92579
|
}
|
|
@@ -92432,7 +92657,10 @@ const parse = async (source, options = {}) => {
|
|
|
92432
92657
|
result
|
|
92433
92658
|
} = parseResultElement;
|
|
92434
92659
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92435
|
-
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
|
+
});
|
|
92436
92664
|
openApiElement.classes.push('result');
|
|
92437
92665
|
parseResultElement.replaceResult(openApiElement);
|
|
92438
92666
|
}
|
|
@@ -92516,7 +92744,10 @@ const parse = async (source, options = {}) => {
|
|
|
92516
92744
|
result
|
|
92517
92745
|
} = parseResultElement;
|
|
92518
92746
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92519
|
-
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
|
+
});
|
|
92520
92751
|
openApiElement.classes.push('result');
|
|
92521
92752
|
parseResultElement.replaceResult(openApiElement);
|
|
92522
92753
|
}
|
|
@@ -92600,7 +92831,10 @@ const parse = async (source, options = {}) => {
|
|
|
92600
92831
|
result
|
|
92601
92832
|
} = parseResultElement;
|
|
92602
92833
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92603
|
-
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
|
+
});
|
|
92604
92838
|
swaggerElement.classes.push('result');
|
|
92605
92839
|
parseResultElement.replaceResult(swaggerElement);
|
|
92606
92840
|
}
|
|
@@ -92684,7 +92918,10 @@ const parse = async (source, options = {}) => {
|
|
|
92684
92918
|
result
|
|
92685
92919
|
} = parseResultElement;
|
|
92686
92920
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92687
|
-
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
|
+
});
|
|
92688
92925
|
openApiElement.classes.push('result');
|
|
92689
92926
|
parseResultElement.replaceResult(openApiElement);
|
|
92690
92927
|
}
|
|
@@ -92768,7 +93005,10 @@ const parse = async (source, options = {}) => {
|
|
|
92768
93005
|
result
|
|
92769
93006
|
} = parseResultElement;
|
|
92770
93007
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
92771
|
-
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
|
+
});
|
|
92772
93012
|
openApiElement.classes.push('result');
|
|
92773
93013
|
parseResultElement.replaceResult(openApiElement);
|
|
92774
93014
|
}
|