@speclynx/apidom-parser-adapter-asyncapi-yaml-2 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.
|
@@ -30469,7 +30469,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30469
30469
|
* @public
|
|
30470
30470
|
*/
|
|
30471
30471
|
const emptyElement = element => {
|
|
30472
|
-
const meta = !element.isMetaEmpty ?
|
|
30472
|
+
const meta = !element.isMetaEmpty ? element.meta.cloneDeep() : undefined;
|
|
30473
30473
|
const attributes = !element.isAttributesEmpty ? (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(element.attributes) : undefined;
|
|
30474
30474
|
|
|
30475
30475
|
// @ts-ignore
|
|
@@ -30485,7 +30485,7 @@ const getMergeFunction = (keyElement, options) => {
|
|
|
30485
30485
|
};
|
|
30486
30486
|
const getMetaMergeFunction = options => {
|
|
30487
30487
|
if (typeof options.customMetaMerge !== 'function') {
|
|
30488
|
-
return targetMeta =>
|
|
30488
|
+
return targetMeta => targetMeta.cloneDeep();
|
|
30489
30489
|
}
|
|
30490
30490
|
return options.customMetaMerge;
|
|
30491
30491
|
};
|
|
@@ -30557,8 +30557,20 @@ const deepmerge = (targetElement, sourceElement, options) => {
|
|
|
30557
30557
|
const mergedElement = sourceIsArrayElement && typeof mergedOptions.arrayElementMerge === 'function' ? mergedOptions.arrayElementMerge(targetElement, sourceElement, mergedOptions) : mergedOptions.objectElementMerge(targetElement, sourceElement, mergedOptions);
|
|
30558
30558
|
|
|
30559
30559
|
// merging meta & attributes
|
|
30560
|
-
|
|
30561
|
-
|
|
30560
|
+
if (!targetElement.isMetaEmpty && !sourceElement.isMetaEmpty) {
|
|
30561
|
+
mergedElement.meta = getMetaMergeFunction(mergedOptions)(targetElement.meta, sourceElement.meta);
|
|
30562
|
+
} else if (!targetElement.isMetaEmpty) {
|
|
30563
|
+
mergedElement.meta = targetElement.meta.cloneDeep();
|
|
30564
|
+
} else if (!sourceElement.isMetaEmpty) {
|
|
30565
|
+
mergedElement.meta = sourceElement.meta.cloneDeep();
|
|
30566
|
+
}
|
|
30567
|
+
if (!targetElement.isAttributesEmpty && !sourceElement.isAttributesEmpty) {
|
|
30568
|
+
mergedElement.attributes = getAttributesMergeFunction(mergedOptions)(targetElement.attributes, sourceElement.attributes);
|
|
30569
|
+
} else if (!targetElement.isAttributesEmpty) {
|
|
30570
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(targetElement.attributes);
|
|
30571
|
+
} else if (!sourceElement.isAttributesEmpty) {
|
|
30572
|
+
mergedElement.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(sourceElement.attributes);
|
|
30573
|
+
}
|
|
30562
30574
|
return mergedElement;
|
|
30563
30575
|
};
|
|
30564
30576
|
deepmerge.all = (list, options) => {
|
|
@@ -30897,6 +30909,105 @@ class KeyValuePair {
|
|
|
30897
30909
|
|
|
30898
30910
|
/***/ },
|
|
30899
30911
|
|
|
30912
|
+
/***/ 51844
|
|
30913
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
30914
|
+
|
|
30915
|
+
"use strict";
|
|
30916
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30917
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
30918
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
30919
|
+
/* harmony export */ });
|
|
30920
|
+
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
30921
|
+
|
|
30922
|
+
/**
|
|
30923
|
+
* Lightweight meta container for Element metadata.
|
|
30924
|
+
*
|
|
30925
|
+
* Data is stored as own properties on the instance; methods live on the prototype.
|
|
30926
|
+
* `Object.keys()`, `Object.entries()`, etc. only see data properties.
|
|
30927
|
+
*
|
|
30928
|
+
* @public
|
|
30929
|
+
*/
|
|
30930
|
+
class Metadata {
|
|
30931
|
+
// Set via prototype assignment in registration.ts to avoid circular dependency
|
|
30932
|
+
|
|
30933
|
+
get(name) {
|
|
30934
|
+
return this[name];
|
|
30935
|
+
}
|
|
30936
|
+
set(name, value) {
|
|
30937
|
+
this[name] = value;
|
|
30938
|
+
}
|
|
30939
|
+
hasKey(name) {
|
|
30940
|
+
return Object.hasOwn(this, name);
|
|
30941
|
+
}
|
|
30942
|
+
keys() {
|
|
30943
|
+
return Object.keys(this);
|
|
30944
|
+
}
|
|
30945
|
+
remove(name) {
|
|
30946
|
+
delete this[name];
|
|
30947
|
+
}
|
|
30948
|
+
get isEmpty() {
|
|
30949
|
+
return Object.keys(this).length === 0;
|
|
30950
|
+
}
|
|
30951
|
+
get isFrozen() {
|
|
30952
|
+
return Object.isFrozen(this);
|
|
30953
|
+
}
|
|
30954
|
+
freeze() {
|
|
30955
|
+
for (const value of Object.values(this)) {
|
|
30956
|
+
if (value instanceof this.Element) {
|
|
30957
|
+
value.freeze();
|
|
30958
|
+
} else if (Array.isArray(value) || value !== null && typeof value === 'object') {
|
|
30959
|
+
Object.freeze(value);
|
|
30960
|
+
}
|
|
30961
|
+
}
|
|
30962
|
+
Object.freeze(this);
|
|
30963
|
+
}
|
|
30964
|
+
|
|
30965
|
+
/**
|
|
30966
|
+
* Creates a shallow clone. Same references, new container.
|
|
30967
|
+
*/
|
|
30968
|
+
cloneShallow() {
|
|
30969
|
+
const clone = new Metadata();
|
|
30970
|
+
Object.assign(clone, this);
|
|
30971
|
+
return clone;
|
|
30972
|
+
}
|
|
30973
|
+
|
|
30974
|
+
/**
|
|
30975
|
+
* Merges another Metadata into a new instance.
|
|
30976
|
+
* Arrays are concatenated, all other values are overwritten by source.
|
|
30977
|
+
*/
|
|
30978
|
+
merge(source) {
|
|
30979
|
+
const result = this.cloneShallow();
|
|
30980
|
+
for (const [key, value] of Object.entries(source)) {
|
|
30981
|
+
const existing = result.get(key);
|
|
30982
|
+
if (Array.isArray(existing) && Array.isArray(value)) {
|
|
30983
|
+
result.set(key, [...existing, ...value]);
|
|
30984
|
+
} else {
|
|
30985
|
+
result.set(key, value);
|
|
30986
|
+
}
|
|
30987
|
+
}
|
|
30988
|
+
return result;
|
|
30989
|
+
}
|
|
30990
|
+
|
|
30991
|
+
/**
|
|
30992
|
+
* Creates a deep clone. Elements are deep cloned,
|
|
30993
|
+
* all other values are deep cloned via ramda clone.
|
|
30994
|
+
*/
|
|
30995
|
+
cloneDeep() {
|
|
30996
|
+
const copy = new Metadata();
|
|
30997
|
+
for (const [key, value] of Object.entries(this)) {
|
|
30998
|
+
if (value instanceof this.Element) {
|
|
30999
|
+
copy.set(key, this.cloneDeepElement(value));
|
|
31000
|
+
} else {
|
|
31001
|
+
copy.set(key, (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(value));
|
|
31002
|
+
}
|
|
31003
|
+
}
|
|
31004
|
+
return copy;
|
|
31005
|
+
}
|
|
31006
|
+
}
|
|
31007
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Metadata);
|
|
31008
|
+
|
|
31009
|
+
/***/ },
|
|
31010
|
+
|
|
30900
31011
|
/***/ 55156
|
|
30901
31012
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
30902
31013
|
|
|
@@ -31543,7 +31654,7 @@ const cloneShallowElement = element => {
|
|
|
31543
31654
|
const copy = new Ctor();
|
|
31544
31655
|
copy.element = element.element;
|
|
31545
31656
|
if (!element.isMetaEmpty) {
|
|
31546
|
-
copy.meta =
|
|
31657
|
+
copy.meta = element.meta.cloneDeep();
|
|
31547
31658
|
}
|
|
31548
31659
|
if (!element.isAttributesEmpty) {
|
|
31549
31660
|
copy.attributes = cloneDeep(element.attributes);
|
|
@@ -31571,8 +31682,8 @@ const cloneShallowElement = element => {
|
|
|
31571
31682
|
|
|
31572
31683
|
/**
|
|
31573
31684
|
* Creates a shallow clone of an ApiDOM Element, KeyValuePair, or ObjectSlice.
|
|
31574
|
-
* The element itself is cloned, but content references are shared
|
|
31575
|
-
*
|
|
31685
|
+
* The element itself is cloned, but content references are shared.
|
|
31686
|
+
* Meta and attributes are deep cloned to preserve semantic information.
|
|
31576
31687
|
* @public
|
|
31577
31688
|
*/
|
|
31578
31689
|
const cloneShallow = value => {
|
|
@@ -32647,7 +32758,7 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
32647
32758
|
* Search the tree recursively and find the element with the matching ID.
|
|
32648
32759
|
*/
|
|
32649
32760
|
getById(id) {
|
|
32650
|
-
return this.find(item => item.id
|
|
32761
|
+
return this.find(item => item.id === id).first;
|
|
32651
32762
|
}
|
|
32652
32763
|
|
|
32653
32764
|
/**
|
|
@@ -32677,18 +32788,24 @@ class CollectionElement extends _Element_mjs__WEBPACK_IMPORTED_MODULE_0__["defau
|
|
|
32677
32788
|
"use strict";
|
|
32678
32789
|
__webpack_require__.r(__webpack_exports__);
|
|
32679
32790
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32791
|
+
/* harmony export */ Metadata: () => (/* reexport safe */ _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
32680
32792
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
32681
32793
|
/* harmony export */ });
|
|
32682
32794
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53654);
|
|
32683
|
-
/* harmony import */ var
|
|
32684
|
-
/* harmony import */ var
|
|
32795
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51844);
|
|
32796
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
32797
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38504);
|
|
32798
|
+
|
|
32685
32799
|
|
|
32686
32800
|
|
|
32801
|
+
// shared singleton for frozen elements with no meta — avoids allocation on every access
|
|
32802
|
+
const FROZEN_EMPTY_METADATA = Object.freeze(new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]());
|
|
32687
32803
|
|
|
32688
32804
|
/**
|
|
32689
32805
|
* Valid content types for an Element.
|
|
32690
32806
|
* @public
|
|
32691
32807
|
*/
|
|
32808
|
+
|
|
32692
32809
|
/**
|
|
32693
32810
|
* Base Element class that all ApiDOM elements extend.
|
|
32694
32811
|
*
|
|
@@ -32786,7 +32903,7 @@ class Element {
|
|
|
32786
32903
|
_attributes;
|
|
32787
32904
|
|
|
32788
32905
|
// ============================================================
|
|
32789
|
-
// Prototype-assigned properties (set in
|
|
32906
|
+
// Prototype-assigned properties (set in registration.ts)
|
|
32790
32907
|
// Using 'declare' allows TypeScript to know about these
|
|
32791
32908
|
// without generating runtime code.
|
|
32792
32909
|
// ============================================================
|
|
@@ -32847,13 +32964,13 @@ class Element {
|
|
|
32847
32964
|
}
|
|
32848
32965
|
|
|
32849
32966
|
// KeyValuePair
|
|
32850
|
-
if (value instanceof
|
|
32967
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
32851
32968
|
this._content = value;
|
|
32852
32969
|
return;
|
|
32853
32970
|
}
|
|
32854
32971
|
|
|
32855
32972
|
// ObjectSlice - extract elements array
|
|
32856
|
-
if (value instanceof
|
|
32973
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) {
|
|
32857
32974
|
this._content = value.elements;
|
|
32858
32975
|
return;
|
|
32859
32976
|
}
|
|
@@ -32874,24 +32991,22 @@ class Element {
|
|
|
32874
32991
|
|
|
32875
32992
|
/**
|
|
32876
32993
|
* Metadata about this element (id, classes, title, description, links).
|
|
32877
|
-
* Lazily creates
|
|
32994
|
+
* Lazily creates a Metadata instance if not set.
|
|
32878
32995
|
*/
|
|
32879
32996
|
get meta() {
|
|
32880
32997
|
if (!this._meta) {
|
|
32881
|
-
if (this.isFrozen)
|
|
32882
|
-
|
|
32883
|
-
meta.freeze();
|
|
32884
|
-
return meta;
|
|
32885
|
-
}
|
|
32886
|
-
this._meta = new this.ObjectElement();
|
|
32998
|
+
if (this.isFrozen) return FROZEN_EMPTY_METADATA;
|
|
32999
|
+
this._meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
32887
33000
|
}
|
|
32888
33001
|
return this._meta;
|
|
32889
33002
|
}
|
|
32890
33003
|
set meta(value) {
|
|
32891
|
-
if (value instanceof
|
|
33004
|
+
if (value instanceof _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
32892
33005
|
this._meta = value;
|
|
32893
|
-
} else {
|
|
32894
|
-
|
|
33006
|
+
} else if (value && typeof value === 'object') {
|
|
33007
|
+
const meta = new _Metadata_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
33008
|
+
Object.assign(meta, value);
|
|
33009
|
+
this._meta = meta;
|
|
32895
33010
|
}
|
|
32896
33011
|
}
|
|
32897
33012
|
|
|
@@ -32924,10 +33039,8 @@ class Element {
|
|
|
32924
33039
|
|
|
32925
33040
|
/** Unique identifier for this element. */
|
|
32926
33041
|
get id() {
|
|
32927
|
-
if (this.isFrozen) {
|
|
32928
|
-
return this.getMetaProperty('id', '');
|
|
32929
|
-
}
|
|
32930
33042
|
if (!this.hasMetaProperty('id')) {
|
|
33043
|
+
if (this.isFrozen) return '';
|
|
32931
33044
|
this.setMetaProperty('id', '');
|
|
32932
33045
|
}
|
|
32933
33046
|
return this.meta.get('id');
|
|
@@ -32938,10 +33051,8 @@ class Element {
|
|
|
32938
33051
|
|
|
32939
33052
|
/** CSS-like class names. */
|
|
32940
33053
|
get classes() {
|
|
32941
|
-
if (this.isFrozen) {
|
|
32942
|
-
return this.getMetaProperty('classes', []);
|
|
32943
|
-
}
|
|
32944
33054
|
if (!this.hasMetaProperty('classes')) {
|
|
33055
|
+
if (this.isFrozen) return [];
|
|
32945
33056
|
this.setMetaProperty('classes', []);
|
|
32946
33057
|
}
|
|
32947
33058
|
return this.meta.get('classes');
|
|
@@ -32952,11 +33063,13 @@ class Element {
|
|
|
32952
33063
|
|
|
32953
33064
|
/** Hyperlinks associated with this element. */
|
|
32954
33065
|
get links() {
|
|
32955
|
-
if (this.isFrozen) {
|
|
32956
|
-
return this.getMetaProperty('links', []);
|
|
32957
|
-
}
|
|
32958
33066
|
if (!this.hasMetaProperty('links')) {
|
|
32959
|
-
this.
|
|
33067
|
+
if (this.isFrozen) {
|
|
33068
|
+
const empty = new this.ArrayElement();
|
|
33069
|
+
empty.freeze();
|
|
33070
|
+
return empty;
|
|
33071
|
+
}
|
|
33072
|
+
this.setMetaProperty('links', new this.ArrayElement());
|
|
32960
33073
|
}
|
|
32961
33074
|
return this.meta.get('links');
|
|
32962
33075
|
}
|
|
@@ -32976,7 +33089,7 @@ class Element {
|
|
|
32976
33089
|
if (Array.isArray(content)) {
|
|
32977
33090
|
return content;
|
|
32978
33091
|
}
|
|
32979
|
-
if (content instanceof
|
|
33092
|
+
if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
32980
33093
|
const children = [];
|
|
32981
33094
|
if (content.key) children.push(content.key);
|
|
32982
33095
|
if (content.value) children.push(content.value);
|
|
@@ -33006,7 +33119,6 @@ class Element {
|
|
|
33006
33119
|
|
|
33007
33120
|
// Freeze meta and attributes
|
|
33008
33121
|
if (this._meta) {
|
|
33009
|
-
this._meta.parent = this;
|
|
33010
33122
|
this._meta.freeze();
|
|
33011
33123
|
}
|
|
33012
33124
|
if (this._attributes) {
|
|
@@ -33041,7 +33153,7 @@ class Element {
|
|
|
33041
33153
|
if (_content instanceof Element) {
|
|
33042
33154
|
return _content.toValue();
|
|
33043
33155
|
}
|
|
33044
|
-
if (_content instanceof
|
|
33156
|
+
if (_content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
33045
33157
|
return _content.toValue();
|
|
33046
33158
|
}
|
|
33047
33159
|
if (Array.isArray(_content)) {
|
|
@@ -33097,7 +33209,7 @@ class Element {
|
|
|
33097
33209
|
* @throws Error if this element has no ID
|
|
33098
33210
|
*/
|
|
33099
33211
|
toRef(path) {
|
|
33100
|
-
const idValue = this.id
|
|
33212
|
+
const idValue = this.id;
|
|
33101
33213
|
if (idValue === '') {
|
|
33102
33214
|
throw new Error('Cannot create reference to an element without an ID');
|
|
33103
33215
|
}
|
|
@@ -33109,26 +33221,16 @@ class Element {
|
|
|
33109
33221
|
}
|
|
33110
33222
|
|
|
33111
33223
|
/**
|
|
33112
|
-
* Gets a meta property.
|
|
33224
|
+
* Gets a meta property value.
|
|
33113
33225
|
*
|
|
33114
33226
|
* When the property doesn't exist:
|
|
33115
|
-
* - With defaultValue: returns
|
|
33227
|
+
* - With defaultValue: returns the provided default value
|
|
33116
33228
|
* - Without defaultValue: returns undefined
|
|
33117
|
-
*
|
|
33118
|
-
* Note: Each call with a default creates a new instance. Use setMetaProperty
|
|
33119
|
-
* first if you need reference equality across multiple accesses.
|
|
33120
33229
|
*/
|
|
33121
33230
|
|
|
33122
33231
|
getMetaProperty(name, defaultValue) {
|
|
33123
33232
|
if (!this.hasMetaProperty(name)) {
|
|
33124
|
-
|
|
33125
|
-
return undefined;
|
|
33126
|
-
}
|
|
33127
|
-
const element = this.refract(defaultValue);
|
|
33128
|
-
if (element && this.isFrozen) {
|
|
33129
|
-
element.freeze();
|
|
33130
|
-
}
|
|
33131
|
-
return element;
|
|
33233
|
+
return defaultValue;
|
|
33132
33234
|
}
|
|
33133
33235
|
return this.meta.get(name);
|
|
33134
33236
|
}
|
|
@@ -33141,20 +33243,17 @@ class Element {
|
|
|
33141
33243
|
}
|
|
33142
33244
|
|
|
33143
33245
|
/**
|
|
33144
|
-
*
|
|
33246
|
+
* Checks whether a meta property exists.
|
|
33145
33247
|
*/
|
|
33146
33248
|
hasMetaProperty(name) {
|
|
33147
|
-
|
|
33148
|
-
return this.meta.hasKey(name);
|
|
33149
|
-
}
|
|
33150
|
-
return false;
|
|
33249
|
+
return this._meta !== undefined && this._meta.hasKey(name);
|
|
33151
33250
|
}
|
|
33152
33251
|
|
|
33153
33252
|
/**
|
|
33154
33253
|
* Checks if meta is empty.
|
|
33155
33254
|
*/
|
|
33156
33255
|
get isMetaEmpty() {
|
|
33157
|
-
return this._meta === undefined || this.
|
|
33256
|
+
return this._meta === undefined || this._meta.isEmpty;
|
|
33158
33257
|
}
|
|
33159
33258
|
|
|
33160
33259
|
/**
|
|
@@ -33180,7 +33279,7 @@ class Element {
|
|
|
33180
33279
|
}
|
|
33181
33280
|
|
|
33182
33281
|
/**
|
|
33183
|
-
*
|
|
33282
|
+
* Checks whether an attributes property exists.
|
|
33184
33283
|
*/
|
|
33185
33284
|
hasAttributesProperty(name) {
|
|
33186
33285
|
if (!this.isAttributesEmpty) {
|
|
@@ -33199,6 +33298,7 @@ class Element {
|
|
|
33199
33298
|
|
|
33200
33299
|
// Re-export types for convenience
|
|
33201
33300
|
|
|
33301
|
+
|
|
33202
33302
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Element);
|
|
33203
33303
|
|
|
33204
33304
|
/***/ },
|
|
@@ -33637,6 +33737,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33637
33737
|
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(49686);
|
|
33638
33738
|
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(38504);
|
|
33639
33739
|
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36663);
|
|
33740
|
+
/* harmony import */ var _Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(51844);
|
|
33741
|
+
/* harmony import */ var _clone_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(12111);
|
|
33742
|
+
|
|
33743
|
+
|
|
33640
33744
|
|
|
33641
33745
|
|
|
33642
33746
|
|
|
@@ -33696,14 +33800,16 @@ function refract(value) {
|
|
|
33696
33800
|
}
|
|
33697
33801
|
|
|
33698
33802
|
// Set up prototype assignments for circular dependency resolution.
|
|
33699
|
-
// These allow Element instances to
|
|
33700
|
-
//
|
|
33803
|
+
// These allow Element and Metadata instances to reference classes they can't import
|
|
33804
|
+
// directly (which would cause circular imports).
|
|
33701
33805
|
// Using 'declare' in the class definitions enables type-safe access to these properties.
|
|
33702
33806
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ObjectElement = _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"];
|
|
33703
33807
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.ArrayElement = _primitives_ArrayElement_mjs__WEBPACK_IMPORTED_MODULE_6__["default"];
|
|
33704
33808
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.RefElement = _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"];
|
|
33705
33809
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.MemberElement = _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"];
|
|
33706
33810
|
_primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.refract = refract;
|
|
33811
|
+
_Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.Element = _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
33812
|
+
_Metadata_mjs__WEBPACK_IMPORTED_MODULE_18__["default"].prototype.cloneDeepElement = element => (0,_clone_index_mjs__WEBPACK_IMPORTED_MODULE_19__.cloneDeep)(element);
|
|
33707
33813
|
|
|
33708
33814
|
/**
|
|
33709
33815
|
* Contains all of the element classes, and related structures and methods
|
|
@@ -33768,7 +33874,13 @@ class JSONSerialiser {
|
|
|
33768
33874
|
element: element.element
|
|
33769
33875
|
};
|
|
33770
33876
|
if (!element.isMetaEmpty) {
|
|
33771
|
-
|
|
33877
|
+
const serialisedMeta = this.serialiseMeta(element);
|
|
33878
|
+
if (serialisedMeta) {
|
|
33879
|
+
payload.meta = serialisedMeta.meta;
|
|
33880
|
+
if (serialisedMeta.rawKeys.length > 0) {
|
|
33881
|
+
payload.__meta_raw__ = serialisedMeta.rawKeys;
|
|
33882
|
+
}
|
|
33883
|
+
}
|
|
33772
33884
|
}
|
|
33773
33885
|
if (!element.isAttributesEmpty) {
|
|
33774
33886
|
payload.attributes = this.serialiseObject(element.attributes);
|
|
@@ -33815,7 +33927,7 @@ class JSONSerialiser {
|
|
|
33815
33927
|
element.element = value.element;
|
|
33816
33928
|
}
|
|
33817
33929
|
|
|
33818
|
-
// Extract
|
|
33930
|
+
// Extract special meta keys without mutating input, filter remaining meta
|
|
33819
33931
|
let mappingsDoc;
|
|
33820
33932
|
let stylesDoc;
|
|
33821
33933
|
let metaToDeserialize = value.meta;
|
|
@@ -33829,8 +33941,15 @@ class JSONSerialiser {
|
|
|
33829
33941
|
stylesDoc = __styles__;
|
|
33830
33942
|
metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
|
|
33831
33943
|
}
|
|
33944
|
+
|
|
33945
|
+
// determine which meta keys were raw primitives before serialization
|
|
33946
|
+
const rawKeys = value.__meta_raw__ ? new Set(value.__meta_raw__) : undefined;
|
|
33832
33947
|
if (metaToDeserialize) {
|
|
33833
|
-
|
|
33948
|
+
for (const [key, doc] of Object.entries(metaToDeserialize)) {
|
|
33949
|
+
const deserialized = this.deserialise(doc);
|
|
33950
|
+
// unwrap keys that were raw primitives before serialization
|
|
33951
|
+
element.setMetaProperty(key, rawKeys?.has(key) ? deserialized.toValue() : deserialized);
|
|
33952
|
+
}
|
|
33834
33953
|
}
|
|
33835
33954
|
|
|
33836
33955
|
// Restore source position from __mappings__
|
|
@@ -33893,6 +34012,27 @@ class JSONSerialiser {
|
|
|
33893
34012
|
}
|
|
33894
34013
|
return content;
|
|
33895
34014
|
}
|
|
34015
|
+
serialiseMeta(element) {
|
|
34016
|
+
const meta = {};
|
|
34017
|
+
const rawKeys = [];
|
|
34018
|
+
let hasEntries = false;
|
|
34019
|
+
for (const [key, value] of Object.entries(element.meta)) {
|
|
34020
|
+
if (value instanceof this.namespace.elements.Element) {
|
|
34021
|
+
meta[key] = this.serialise(value);
|
|
34022
|
+
hasEntries = true;
|
|
34023
|
+
} else if (value !== undefined) {
|
|
34024
|
+
// refract primitives to maintain JSON Refract spec compatibility
|
|
34025
|
+
const refracted = element.refract(value);
|
|
34026
|
+
meta[key] = this.serialise(refracted);
|
|
34027
|
+
rawKeys.push(key);
|
|
34028
|
+
hasEntries = true;
|
|
34029
|
+
}
|
|
34030
|
+
}
|
|
34031
|
+
return hasEntries ? {
|
|
34032
|
+
meta,
|
|
34033
|
+
rawKeys
|
|
34034
|
+
} : undefined;
|
|
34035
|
+
}
|
|
33896
34036
|
serialiseObject(obj) {
|
|
33897
34037
|
const result = {};
|
|
33898
34038
|
obj.forEach((value, key) => {
|
|
@@ -40046,7 +40186,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40046
40186
|
const refract = (value, {
|
|
40047
40187
|
element = 'asyncApi2',
|
|
40048
40188
|
plugins = [],
|
|
40049
|
-
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]
|
|
40189
|
+
specificationObj = _specification_mjs__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
40190
|
+
consume = false
|
|
40050
40191
|
} = {}) => {
|
|
40051
40192
|
const genericElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.refract)(value);
|
|
40052
40193
|
const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__.resolveSpecification)(specificationObj);
|
|
@@ -40063,7 +40204,8 @@ const refract = (value, {
|
|
|
40063
40204
|
*/
|
|
40064
40205
|
const RootVisitorClass = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(specPath, resolvedSpec);
|
|
40065
40206
|
const rootVisitor = new RootVisitorClass({
|
|
40066
|
-
specObj: resolvedSpec
|
|
40207
|
+
specObj: resolvedSpec,
|
|
40208
|
+
consume
|
|
40067
40209
|
});
|
|
40068
40210
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.traverse)(genericElement, rootVisitor);
|
|
40069
40211
|
|
|
@@ -42877,7 +43019,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42877
43019
|
*/
|
|
42878
43020
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
42879
43021
|
enter(path) {
|
|
42880
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
43022
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
42881
43023
|
path.stop();
|
|
42882
43024
|
}
|
|
42883
43025
|
}
|
|
@@ -42944,7 +43086,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42944
43086
|
*/
|
|
42945
43087
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
42946
43088
|
specObj;
|
|
42947
|
-
passingOptionsNames = ['specObj'];
|
|
43089
|
+
passingOptionsNames = ['specObj', 'consume'];
|
|
42948
43090
|
constructor({
|
|
42949
43091
|
specObj,
|
|
42950
43092
|
...rest
|
|
@@ -42990,7 +43132,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
42990
43132
|
*/
|
|
42991
43133
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
42992
43134
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
42993
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
43135
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
42994
43136
|
}
|
|
42995
43137
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor);
|
|
42996
43138
|
return visitor.element;
|
|
@@ -43009,7 +43151,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43009
43151
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
43010
43152
|
/* harmony export */ });
|
|
43011
43153
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
43012
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
43154
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
43013
43155
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
43014
43156
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
43015
43157
|
|
|
@@ -43024,19 +43166,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43024
43166
|
*/
|
|
43025
43167
|
class Visitor {
|
|
43026
43168
|
element;
|
|
43169
|
+
consume = false;
|
|
43170
|
+
consumeSafe = false;
|
|
43027
43171
|
constructor(options) {
|
|
43028
43172
|
Object.assign(this, options);
|
|
43029
43173
|
}
|
|
43030
43174
|
copyMetaAndAttributes(from, to) {
|
|
43031
|
-
if (!from.isMetaEmpty
|
|
43032
|
-
|
|
43033
|
-
|
|
43034
|
-
to.meta = (
|
|
43175
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
43176
|
+
to.meta = to.meta.merge(from.meta);
|
|
43177
|
+
} else if (!from.isMetaEmpty) {
|
|
43178
|
+
to.meta = from.meta.cloneDeep();
|
|
43035
43179
|
}
|
|
43036
|
-
if (!from.isAttributesEmpty
|
|
43037
|
-
|
|
43038
|
-
|
|
43039
|
-
to.attributes = (0,
|
|
43180
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
43181
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
43182
|
+
} else if (!from.isAttributesEmpty) {
|
|
43183
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
43040
43184
|
}
|
|
43041
43185
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
43042
43186
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -46600,6 +46744,7 @@ class AsyncApi2Visitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_2__.BaseFixed
|
|
|
46600
46744
|
constructor(options) {
|
|
46601
46745
|
super(options);
|
|
46602
46746
|
this.element = new _elements_AsyncApi2_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
46747
|
+
this.consumeSafe = true;
|
|
46603
46748
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'AsyncApi']);
|
|
46604
46749
|
this.canSupportSpecificationExtensions = true;
|
|
46605
46750
|
}
|
|
@@ -48806,15 +48951,18 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
48806
48951
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
48807
48952
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
48808
48953
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
48809
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
48810
|
-
newMemberElement.classes.push('fixed-field');
|
|
48954
|
+
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);
|
|
48811
48955
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
48812
48956
|
this.element.content.push(newMemberElement);
|
|
48957
|
+
// consume: release processed generic subtree
|
|
48958
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
48813
48959
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
48814
48960
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
48815
48961
|
this.element.content.push(extensionElement);
|
|
48962
|
+
// consume: release processed generic subtree
|
|
48963
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
48816
48964
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
48817
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
48965
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
48818
48966
|
}
|
|
48819
48967
|
});
|
|
48820
48968
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -48918,12 +49066,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
48918
49066
|
} else if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
48919
49067
|
const specPath = this.specPath(value);
|
|
48920
49068
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
48921
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
49069
|
+
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);
|
|
48922
49070
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
48923
49071
|
newMemberElement.classes.push('patterned-field');
|
|
48924
49072
|
this.element.content.push(newMemberElement);
|
|
49073
|
+
// consume: release processed generic subtree
|
|
49074
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
48925
49075
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
48926
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
49076
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
48927
49077
|
}
|
|
48928
49078
|
});
|
|
48929
49079
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -49760,7 +49910,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49760
49910
|
*/
|
|
49761
49911
|
class FallbackVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
49762
49912
|
enter(path) {
|
|
49763
|
-
this.element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
49913
|
+
this.element = this.consume ? path.node : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(path.node);
|
|
49764
49914
|
path.stop();
|
|
49765
49915
|
}
|
|
49766
49916
|
}
|
|
@@ -49800,7 +49950,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49800
49950
|
*/
|
|
49801
49951
|
class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
|
|
49802
49952
|
specObj;
|
|
49803
|
-
passingOptionsNames = ['specObj', 'parent'];
|
|
49953
|
+
passingOptionsNames = ['specObj', 'parent', 'consume'];
|
|
49804
49954
|
constructor({
|
|
49805
49955
|
specObj,
|
|
49806
49956
|
...rest
|
|
@@ -49846,7 +49996,7 @@ class SpecificationVisitor extends _Visitor_mjs__WEBPACK_IMPORTED_MODULE_6__["de
|
|
|
49846
49996
|
*/
|
|
49847
49997
|
const visitor = this.retrieveVisitorInstance(specPath, options);
|
|
49848
49998
|
if (visitor instanceof _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"] && visitor?.constructor === _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]) {
|
|
49849
|
-
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
49999
|
+
return this.consume ? element : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(element);
|
|
49850
50000
|
}
|
|
49851
50001
|
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_5__.traverse)(element, visitor, options);
|
|
49852
50002
|
return visitor.element;
|
|
@@ -49865,7 +50015,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49865
50015
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
49866
50016
|
/* harmony export */ });
|
|
49867
50017
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
49868
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
50018
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12111);
|
|
49869
50019
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
49870
50020
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
49871
50021
|
|
|
@@ -49880,19 +50030,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49880
50030
|
*/
|
|
49881
50031
|
class Visitor {
|
|
49882
50032
|
element;
|
|
50033
|
+
consume = false;
|
|
50034
|
+
consumeSafe = false;
|
|
49883
50035
|
constructor(options) {
|
|
49884
50036
|
Object.assign(this, options);
|
|
49885
50037
|
}
|
|
49886
50038
|
copyMetaAndAttributes(from, to) {
|
|
49887
|
-
if (!from.isMetaEmpty
|
|
49888
|
-
|
|
49889
|
-
|
|
49890
|
-
to.meta = (
|
|
50039
|
+
if (!from.isMetaEmpty && !to.isMetaEmpty) {
|
|
50040
|
+
to.meta = to.meta.merge(from.meta);
|
|
50041
|
+
} else if (!from.isMetaEmpty) {
|
|
50042
|
+
to.meta = from.meta.cloneDeep();
|
|
49891
50043
|
}
|
|
49892
|
-
if (!from.isAttributesEmpty
|
|
49893
|
-
|
|
49894
|
-
|
|
49895
|
-
to.attributes = (0,
|
|
50044
|
+
if (!from.isAttributesEmpty && !to.isAttributesEmpty) {
|
|
50045
|
+
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(to.attributes, from.attributes);
|
|
50046
|
+
} else if (!from.isAttributesEmpty) {
|
|
50047
|
+
to.attributes = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(from.attributes);
|
|
49896
50048
|
}
|
|
49897
50049
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
49898
50050
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
@@ -50002,12 +50154,13 @@ class FixedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED_MOD
|
|
|
50002
50154
|
const keyValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
50003
50155
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(key) && fields.includes(keyValue) && !this.ignoredFields.includes(keyValue)) {
|
|
50004
50156
|
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', keyValue], value);
|
|
50005
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), fixedFieldElement);
|
|
50157
|
+
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);
|
|
50006
50158
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
50007
|
-
newMemberElement.classes.push('fixed-field');
|
|
50008
50159
|
this.element.content.push(newMemberElement);
|
|
50160
|
+
// consume: release processed generic subtree
|
|
50161
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
50009
50162
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
50010
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
50163
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
50011
50164
|
}
|
|
50012
50165
|
});
|
|
50013
50166
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -50096,12 +50249,14 @@ class PatternedFieldsVisitor extends _SpecificationVisitor_mjs__WEBPACK_IMPORTED
|
|
|
50096
50249
|
if (!this.ignoredFields.includes(keyValue) && this.fieldPatternPredicate(keyValue)) {
|
|
50097
50250
|
const specPath = this.specPath(value);
|
|
50098
50251
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
50099
|
-
const newMemberElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(key), patternedFieldElement);
|
|
50252
|
+
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);
|
|
50100
50253
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
50101
50254
|
newMemberElement.classes.push('patterned-field');
|
|
50102
50255
|
this.element.content.push(newMemberElement);
|
|
50256
|
+
// consume: release processed generic subtree
|
|
50257
|
+
if (this.consume && this.consumeSafe && !memberElement.isFrozen) memberElement.value = undefined;
|
|
50103
50258
|
} else if (!this.ignoredFields.includes(keyValue)) {
|
|
50104
|
-
this.element.content.push((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
50259
|
+
this.element.content.push(this.consume ? memberElement : (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(memberElement));
|
|
50105
50260
|
}
|
|
50106
50261
|
});
|
|
50107
50262
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -50659,13 +50814,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50659
50814
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33031);
|
|
50660
50815
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68894);
|
|
50661
50816
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25162);
|
|
50662
|
-
/* harmony import */ var
|
|
50663
|
-
/* harmony import */ var
|
|
50664
|
-
/* harmony import */ var
|
|
50665
|
-
/* harmony import */ var
|
|
50666
|
-
/* harmony import */ var
|
|
50667
|
-
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(94686);
|
|
50668
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(86059);
|
|
50817
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44673);
|
|
50818
|
+
/* harmony import */ var _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(55320);
|
|
50819
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89033);
|
|
50820
|
+
/* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(94686);
|
|
50821
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(86059);
|
|
50669
50822
|
|
|
50670
50823
|
|
|
50671
50824
|
|
|
@@ -50680,10 +50833,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50680
50833
|
/**
|
|
50681
50834
|
* @public
|
|
50682
50835
|
*/
|
|
50683
|
-
class JSONSchemaVisitor extends
|
|
50836
|
+
class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.JSONSchemaVisitorBase {
|
|
50684
50837
|
constructor(options) {
|
|
50685
50838
|
super(options);
|
|
50686
|
-
this.element = new
|
|
50839
|
+
this.element = new _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]();
|
|
50840
|
+
this.consumeSafe = true;
|
|
50687
50841
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'JSONSchema']);
|
|
50688
50842
|
}
|
|
50689
50843
|
get defaultDialectIdentifier() {
|
|
@@ -50696,27 +50850,27 @@ class JSONSchemaVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_9__.JSONSche
|
|
|
50696
50850
|
|
|
50697
50851
|
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
50698
50852
|
this.parent = this.element;
|
|
50699
|
-
return
|
|
50853
|
+
return _generics_FixedFieldsVisitor_mjs__WEBPACK_IMPORTED_MODULE_6__["default"].prototype.ObjectElement.call(this, path);
|
|
50700
50854
|
}
|
|
50701
50855
|
handleDialectIdentifier(objectElement) {
|
|
50702
50856
|
// handle $schema keyword in embedded resources
|
|
50703
50857
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
50704
50858
|
// no parent available and no $schema is defined, set default $schema
|
|
50705
50859
|
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
50706
|
-
} else if ((0,
|
|
50860
|
+
} else if ((0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_9__.isJSONSchemaElement)(this.parent) && !(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(objectElement.get('$schema'))) {
|
|
50707
50861
|
// parent is available and no $schema is defined, set parent $schema
|
|
50708
|
-
const inheritedDialectIdentifier = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(
|
|
50862
|
+
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));
|
|
50709
50863
|
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
50710
50864
|
}
|
|
50711
50865
|
}
|
|
50712
50866
|
handleSchemaIdentifier(objectElement, identifierKeyword = 'id') {
|
|
50713
50867
|
// handle schema identifier in embedded resources
|
|
50714
|
-
// fetch parent's ancestorsSchemaIdentifiers
|
|
50715
|
-
const ancestorsSchemaIdentifiers = this.parent !== undefined ? (
|
|
50868
|
+
// fetch parent's ancestorsSchemaIdentifiers (stored as plain string[])
|
|
50869
|
+
const ancestorsSchemaIdentifiers = this.parent !== undefined ? [...(this.parent.meta.get('ancestorsSchemaIdentifiers') ?? [])] : [];
|
|
50716
50870
|
// get current schema identifier
|
|
50717
|
-
const schemaIdentifier = (0,
|
|
50871
|
+
const schemaIdentifier = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(objectElement.get(identifierKeyword));
|
|
50718
50872
|
|
|
50719
|
-
// remember schema identifier if it's a non-empty
|
|
50873
|
+
// remember schema identifier if it's a non-empty string
|
|
50720
50874
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_3__["default"])(schemaIdentifier)) {
|
|
50721
50875
|
ancestorsSchemaIdentifiers.push(schemaIdentifier);
|
|
50722
50876
|
}
|
|
@@ -56204,7 +56358,10 @@ const parse = async (source, options = {}) => {
|
|
|
56204
56358
|
result
|
|
56205
56359
|
} = parseResultElement;
|
|
56206
56360
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(result)) {
|
|
56207
|
-
const asyncApiElement = (0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_6__.refractAsyncApi2)(result,
|
|
56361
|
+
const asyncApiElement = (0,_speclynx_apidom_ns_asyncapi_2__WEBPACK_IMPORTED_MODULE_6__.refractAsyncApi2)(result, {
|
|
56362
|
+
consume: true,
|
|
56363
|
+
...refractorOpts
|
|
56364
|
+
});
|
|
56208
56365
|
asyncApiElement.classes.push('result');
|
|
56209
56366
|
parseResultElement.replaceResult(asyncApiElement);
|
|
56210
56367
|
}
|