@speclynx/apidom-reference 3.2.0 → 4.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 +18 -0
- package/dist/apidom-reference.browser.js +162 -127
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +25 -25
- package/types/dereference/strategies/apidom/visitor.d.ts +1 -1
- package/types/dereference/strategies/arazzo-1/visitor.d.ts +1 -1
- package/types/dereference/strategies/asyncapi-2/visitor.d.ts +1 -1
- package/types/dereference/strategies/openapi-2/visitor.d.ts +1 -1
- package/types/dereference/strategies/openapi-3-0/visitor.d.ts +1 -1
- package/types/dereference/strategies/openapi-3-1/visitor.d.ts +1 -1
- package/src/File.cjs +0 -50
- package/src/File.mjs +0 -44
- package/src/Reference.cjs +0 -31
- package/src/Reference.mjs +0 -27
- package/src/ReferenceSet.cjs +0 -60
- package/src/ReferenceSet.mjs +0 -57
- package/src/bundle/index.cjs +0 -61
- package/src/bundle/index.mjs +0 -55
- package/src/bundle/strategies/BundleStrategy.cjs +0 -20
- package/src/bundle/strategies/BundleStrategy.mjs +0 -16
- package/src/bundle/strategies/openapi-3-1/index.cjs +0 -35
- package/src/bundle/strategies/openapi-3-1/index.mjs +0 -29
- package/src/configuration/empty.cjs +0 -9
- package/src/configuration/empty.mjs +0 -1
- package/src/configuration/saturated.cjs +0 -88
- package/src/configuration/saturated.mjs +0 -80
- package/src/dereference/index.cjs +0 -90
- package/src/dereference/index.mjs +0 -83
- package/src/dereference/strategies/DereferenceStrategy.cjs +0 -20
- package/src/dereference/strategies/DereferenceStrategy.mjs +0 -16
- package/src/dereference/strategies/apidom/index.cjs +0 -89
- package/src/dereference/strategies/apidom/index.mjs +0 -83
- package/src/dereference/strategies/apidom/selectors/element-id.cjs +0 -47
- package/src/dereference/strategies/apidom/selectors/element-id.mjs +0 -41
- package/src/dereference/strategies/apidom/visitor.cjs +0 -259
- package/src/dereference/strategies/apidom/visitor.mjs +0 -252
- package/src/dereference/strategies/arazzo-1/index.cjs +0 -109
- package/src/dereference/strategies/arazzo-1/index.mjs +0 -100
- package/src/dereference/strategies/arazzo-1/selectors/$anchor.cjs +0 -12
- package/src/dereference/strategies/arazzo-1/selectors/$anchor.mjs +0 -1
- package/src/dereference/strategies/arazzo-1/selectors/uri.cjs +0 -8
- package/src/dereference/strategies/arazzo-1/selectors/uri.mjs +0 -1
- package/src/dereference/strategies/arazzo-1/source-descriptions.cjs +0 -248
- package/src/dereference/strategies/arazzo-1/source-descriptions.mjs +0 -243
- package/src/dereference/strategies/arazzo-1/util.cjs +0 -37
- package/src/dereference/strategies/arazzo-1/util.mjs +0 -29
- package/src/dereference/strategies/arazzo-1/visitor.cjs +0 -501
- package/src/dereference/strategies/arazzo-1/visitor.mjs +0 -494
- package/src/dereference/strategies/asyncapi-2/index.cjs +0 -94
- package/src/dereference/strategies/asyncapi-2/index.mjs +0 -88
- package/src/dereference/strategies/asyncapi-2/visitor.cjs +0 -495
- package/src/dereference/strategies/asyncapi-2/visitor.mjs +0 -488
- package/src/dereference/strategies/openapi-2/index.cjs +0 -96
- package/src/dereference/strategies/openapi-2/index.mjs +0 -90
- package/src/dereference/strategies/openapi-2/visitor.cjs +0 -623
- package/src/dereference/strategies/openapi-2/visitor.mjs +0 -616
- package/src/dereference/strategies/openapi-3-0/index.cjs +0 -96
- package/src/dereference/strategies/openapi-3-0/index.mjs +0 -90
- package/src/dereference/strategies/openapi-3-0/visitor.cjs +0 -615
- package/src/dereference/strategies/openapi-3-0/visitor.mjs +0 -608
- package/src/dereference/strategies/openapi-3-1/index.cjs +0 -99
- package/src/dereference/strategies/openapi-3-1/index.mjs +0 -90
- package/src/dereference/strategies/openapi-3-1/selectors/$anchor.cjs +0 -67
- package/src/dereference/strategies/openapi-3-1/selectors/$anchor.mjs +0 -56
- package/src/dereference/strategies/openapi-3-1/selectors/uri.cjs +0 -50
- package/src/dereference/strategies/openapi-3-1/selectors/uri.mjs +0 -42
- package/src/dereference/strategies/openapi-3-1/util.cjs +0 -68
- package/src/dereference/strategies/openapi-3-1/util.mjs +0 -59
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +0 -867
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +0 -860
- package/src/dereference/util.cjs +0 -31
- package/src/dereference/util.mjs +0 -27
- package/src/errors/BundleError.cjs +0 -10
- package/src/errors/BundleError.mjs +0 -7
- package/src/errors/DereferenceError.cjs +0 -10
- package/src/errors/DereferenceError.mjs +0 -7
- package/src/errors/EvaluationElementIdError.cjs +0 -10
- package/src/errors/EvaluationElementIdError.mjs +0 -7
- package/src/errors/EvaluationJsonSchema$anchorError.cjs +0 -11
- package/src/errors/EvaluationJsonSchema$anchorError.mjs +0 -6
- package/src/errors/EvaluationJsonSchemaUriError.cjs +0 -11
- package/src/errors/EvaluationJsonSchemaUriError.mjs +0 -6
- package/src/errors/InvalidJsonSchema$anchorError.cjs +0 -15
- package/src/errors/InvalidJsonSchema$anchorError.mjs +0 -10
- package/src/errors/JsonSchema$anchorError.cjs +0 -10
- package/src/errors/JsonSchema$anchorError.mjs +0 -7
- package/src/errors/JsonSchemaUriError.cjs +0 -10
- package/src/errors/JsonSchemaUriError.mjs +0 -7
- package/src/errors/MaximumBundleDepthError.cjs +0 -11
- package/src/errors/MaximumBundleDepthError.mjs +0 -6
- package/src/errors/MaximumDereferenceDepthError.cjs +0 -11
- package/src/errors/MaximumDereferenceDepthError.mjs +0 -6
- package/src/errors/MaximumResolveDepthError.cjs +0 -11
- package/src/errors/MaximumResolveDepthError.mjs +0 -6
- package/src/errors/ParseError.cjs +0 -10
- package/src/errors/ParseError.mjs +0 -7
- package/src/errors/ParserError.cjs +0 -11
- package/src/errors/ParserError.mjs +0 -6
- package/src/errors/PluginError.cjs +0 -18
- package/src/errors/PluginError.mjs +0 -15
- package/src/errors/ResolveError.cjs +0 -10
- package/src/errors/ResolveError.mjs +0 -7
- package/src/errors/ResolverError.cjs +0 -11
- package/src/errors/ResolverError.mjs +0 -6
- package/src/errors/UnmatchedBundleStrategyError.cjs +0 -11
- package/src/errors/UnmatchedBundleStrategyError.mjs +0 -6
- package/src/errors/UnmatchedDereferenceStrategyError.cjs +0 -11
- package/src/errors/UnmatchedDereferenceStrategyError.mjs +0 -6
- package/src/errors/UnmatchedParserError.cjs +0 -11
- package/src/errors/UnmatchedParserError.mjs +0 -6
- package/src/errors/UnmatchedResolveStrategyError.cjs +0 -11
- package/src/errors/UnmatchedResolveStrategyError.mjs +0 -6
- package/src/errors/UnmatchedResolverError.cjs +0 -11
- package/src/errors/UnmatchedResolverError.mjs +0 -6
- package/src/errors/UnresolvableReferenceError.cjs +0 -11
- package/src/errors/UnresolvableReferenceError.mjs +0 -6
- package/src/index.cjs +0 -146
- package/src/index.mjs +0 -103
- package/src/options/index.cjs +0 -194
- package/src/options/index.mjs +0 -191
- package/src/options/util.cjs +0 -24
- package/src/options/util.mjs +0 -19
- package/src/parse/index.cjs +0 -69
- package/src/parse/index.mjs +0 -63
- package/src/parse/parsers/Parser.cjs +0 -62
- package/src/parse/parsers/Parser.mjs +0 -58
- package/src/parse/parsers/apidom-json/index.cjs +0 -70
- package/src/parse/parsers/apidom-json/index.mjs +0 -64
- package/src/parse/parsers/arazzo-json-1/index.cjs +0 -62
- package/src/parse/parsers/arazzo-json-1/index.mjs +0 -56
- package/src/parse/parsers/arazzo-json-1/source-descriptions.cjs +0 -221
- package/src/parse/parsers/arazzo-json-1/source-descriptions.mjs +0 -214
- package/src/parse/parsers/arazzo-yaml-1/index.cjs +0 -62
- package/src/parse/parsers/arazzo-yaml-1/index.mjs +0 -56
- package/src/parse/parsers/arazzo-yaml-1/source-descriptions.cjs +0 -12
- package/src/parse/parsers/arazzo-yaml-1/source-descriptions.mjs +0 -7
- package/src/parse/parsers/asyncapi-json-2/index.cjs +0 -54
- package/src/parse/parsers/asyncapi-json-2/index.mjs +0 -48
- package/src/parse/parsers/asyncapi-yaml-2/index.cjs +0 -54
- package/src/parse/parsers/asyncapi-yaml-2/index.mjs +0 -48
- package/src/parse/parsers/binary/index-browser.cjs +0 -56
- package/src/parse/parsers/binary/index-browser.mjs +0 -50
- package/src/parse/parsers/binary/index-node.cjs +0 -51
- package/src/parse/parsers/binary/index-node.mjs +0 -45
- package/src/parse/parsers/json/index.cjs +0 -53
- package/src/parse/parsers/json/index.mjs +0 -47
- package/src/parse/parsers/openapi-json-2/index.cjs +0 -54
- package/src/parse/parsers/openapi-json-2/index.mjs +0 -48
- package/src/parse/parsers/openapi-json-3-0/index.cjs +0 -54
- package/src/parse/parsers/openapi-json-3-0/index.mjs +0 -48
- package/src/parse/parsers/openapi-json-3-1/index.cjs +0 -54
- package/src/parse/parsers/openapi-json-3-1/index.mjs +0 -48
- package/src/parse/parsers/openapi-yaml-2/index.cjs +0 -54
- package/src/parse/parsers/openapi-yaml-2/index.mjs +0 -48
- package/src/parse/parsers/openapi-yaml-3-0/index.cjs +0 -54
- package/src/parse/parsers/openapi-yaml-3-0/index.mjs +0 -48
- package/src/parse/parsers/openapi-yaml-3-1/index.cjs +0 -54
- package/src/parse/parsers/openapi-yaml-3-1/index.mjs +0 -48
- package/src/parse/parsers/yaml-1-2/index.cjs +0 -56
- package/src/parse/parsers/yaml-1-2/index.mjs +0 -50
- package/src/resolve/index.cjs +0 -67
- package/src/resolve/index.mjs +0 -60
- package/src/resolve/resolvers/HTTPResolver.cjs +0 -45
- package/src/resolve/resolvers/HTTPResolver.mjs +0 -37
- package/src/resolve/resolvers/Resolver.cjs +0 -20
- package/src/resolve/resolvers/Resolver.mjs +0 -16
- package/src/resolve/resolvers/file/index-browser.cjs +0 -24
- package/src/resolve/resolvers/file/index-browser.mjs +0 -19
- package/src/resolve/resolvers/file/index-node.cjs +0 -49
- package/src/resolve/resolvers/file/index-node.mjs +0 -42
- package/src/resolve/resolvers/http-axios/cache/MemoryCache.cjs +0 -41
- package/src/resolve/resolvers/http-axios/cache/MemoryCache.mjs +0 -37
- package/src/resolve/resolvers/http-axios/index.cjs +0 -113
- package/src/resolve/resolvers/http-axios/index.mjs +0 -105
- package/src/resolve/strategies/ResolveStrategy.cjs +0 -20
- package/src/resolve/strategies/ResolveStrategy.mjs +0 -16
- package/src/resolve/strategies/apidom/index.cjs +0 -49
- package/src/resolve/strategies/apidom/index.mjs +0 -43
- package/src/resolve/strategies/asyncapi-2/index.cjs +0 -49
- package/src/resolve/strategies/asyncapi-2/index.mjs +0 -43
- package/src/resolve/strategies/openapi-2/index.cjs +0 -49
- package/src/resolve/strategies/openapi-2/index.mjs +0 -43
- package/src/resolve/strategies/openapi-3-0/index.cjs +0 -49
- package/src/resolve/strategies/openapi-3-0/index.mjs +0 -43
- package/src/resolve/strategies/openapi-3-1/index.cjs +0 -49
- package/src/resolve/strategies/openapi-3-1/index.mjs +0 -43
- package/src/resolve/util.cjs +0 -37
- package/src/resolve/util.mjs +0 -30
- package/src/util/plugins.cjs +0 -39
- package/src/util/plugins.mjs +0 -34
- package/src/util/url.cjs +0 -288
- package/src/util/url.mjs +0 -274
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.0.0](https://github.com/speclynx/apidom/compare/v3.2.1...v4.0.0) (2026-03-11)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **traverse:** all traverse operations work on Path and not Element ([#153](https://github.com/speclynx/apidom/issues/153)) ([67d244c](https://github.com/speclynx/apidom/commit/67d244cfd3e77f6a9db704cede50ba8e45d10b11))
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
- **traverse:** This is a breaking change as operation callbacks
|
|
15
|
+
now accept Path instead of Element. By accepting Path, full
|
|
16
|
+
context of traversal is exposed to consumer instead of just Element.
|
|
17
|
+
|
|
18
|
+
## [3.2.1](https://github.com/speclynx/apidom/compare/v3.2.0...v3.2.1) (2026-03-09)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- fix issues preventing integrating with Language Service ([#143](https://github.com/speclynx/apidom/issues/143)) ([26480d7](https://github.com/speclynx/apidom/commit/26480d7a495fa57da8b39120a73f64ab2d9d61bf))
|
|
23
|
+
|
|
6
24
|
# [3.2.0](https://github.com/speclynx/apidom/compare/v3.1.0...v3.2.0) (2026-03-08)
|
|
7
25
|
|
|
8
26
|
### Bug Fixes
|
|
@@ -589,9 +589,9 @@ const getElementID = element => {
|
|
|
589
589
|
// handle both raw string (new format) and StringElement (legacy Refract without __meta_raw__)
|
|
590
590
|
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(id) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(id) : id;
|
|
591
591
|
};
|
|
592
|
-
const hasElementID =
|
|
593
|
-
if (!
|
|
594
|
-
const id = getElementID(
|
|
592
|
+
const hasElementID = path => {
|
|
593
|
+
if (!path.node.hasMetaProperty('id')) return false;
|
|
594
|
+
const id = getElementID(path.node);
|
|
595
595
|
return typeof id === 'string' && id !== '';
|
|
596
596
|
};
|
|
597
597
|
|
|
@@ -605,8 +605,8 @@ const evaluate = (elementID, element) => {
|
|
|
605
605
|
} = evaluate;
|
|
606
606
|
// warm the cache
|
|
607
607
|
if (!cache.has(element)) {
|
|
608
|
-
const
|
|
609
|
-
cache.set(element,
|
|
608
|
+
const pathsWithID = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.filter)(element, hasElementID);
|
|
609
|
+
cache.set(element, pathsWithID.map(path => path.node));
|
|
610
610
|
}
|
|
611
611
|
|
|
612
612
|
// search for the matching element
|
|
@@ -750,15 +750,22 @@ class ApiDOMDereferenceVisitor {
|
|
|
750
750
|
const isEntryDocument = _util_url_ts__WEBPACK_IMPORTED_MODULE_12__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
|
|
751
751
|
const uri = this.reference.uri;
|
|
752
752
|
const type = referencingElement.element;
|
|
753
|
+
// find element location by identity in the document tree.
|
|
754
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
755
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
756
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
753
757
|
let location;
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
p.
|
|
758
|
+
const root = this.reference.value.result;
|
|
759
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(root)) {
|
|
760
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(root, {
|
|
761
|
+
enter(p) {
|
|
762
|
+
if (p.node === referencingElement) {
|
|
763
|
+
location = p.formatPath();
|
|
764
|
+
p.stop();
|
|
765
|
+
}
|
|
759
766
|
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
767
|
+
});
|
|
768
|
+
}
|
|
762
769
|
location ??= visitorPath.formatPath();
|
|
763
770
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement);
|
|
764
771
|
const hop = {
|
|
@@ -1519,16 +1526,22 @@ class Arazzo1DereferenceVisitor {
|
|
|
1519
1526
|
const type = referencingElement.element;
|
|
1520
1527
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement);
|
|
1521
1528
|
|
|
1522
|
-
// find element location
|
|
1529
|
+
// find element location by identity in the document tree.
|
|
1530
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
1531
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
1532
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
1523
1533
|
let location;
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
p.
|
|
1534
|
+
const root = this.reference.value.result;
|
|
1535
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(root)) {
|
|
1536
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(root, {
|
|
1537
|
+
enter(p) {
|
|
1538
|
+
if (p.node === referencingElement) {
|
|
1539
|
+
location = p.formatPath();
|
|
1540
|
+
p.stop();
|
|
1541
|
+
}
|
|
1529
1542
|
}
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1532
1545
|
location ??= visitorPath.formatPath();
|
|
1533
1546
|
const hop = {
|
|
1534
1547
|
uri,
|
|
@@ -2153,16 +2166,22 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
2153
2166
|
const type = referencingElement.element;
|
|
2154
2167
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement);
|
|
2155
2168
|
|
|
2156
|
-
// find element location
|
|
2169
|
+
// find element location by identity in the document tree.
|
|
2170
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
2171
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
2172
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
2157
2173
|
let location;
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
p.
|
|
2174
|
+
const root = this.reference.value.result;
|
|
2175
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(root)) {
|
|
2176
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__.traverse)(root, {
|
|
2177
|
+
enter: p => {
|
|
2178
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
2179
|
+
location = p.formatPath();
|
|
2180
|
+
p.stop();
|
|
2181
|
+
}
|
|
2163
2182
|
}
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2166
2185
|
location ??= visitorPath.formatPath();
|
|
2167
2186
|
const hop = {
|
|
2168
2187
|
uri,
|
|
@@ -2789,16 +2808,22 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2789
2808
|
const type = referencingElement.element;
|
|
2790
2809
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement);
|
|
2791
2810
|
|
|
2792
|
-
// find element location
|
|
2811
|
+
// find element location by identity in the document tree.
|
|
2812
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
2813
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
2814
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
2793
2815
|
let location;
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
p.
|
|
2816
|
+
const root = this.reference.value.result;
|
|
2817
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(root)) {
|
|
2818
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__.traverse)(root, {
|
|
2819
|
+
enter: p => {
|
|
2820
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
2821
|
+
location = p.formatPath();
|
|
2822
|
+
p.stop();
|
|
2823
|
+
}
|
|
2799
2824
|
}
|
|
2800
|
-
}
|
|
2801
|
-
}
|
|
2825
|
+
});
|
|
2826
|
+
}
|
|
2802
2827
|
location ??= visitorPath.formatPath();
|
|
2803
2828
|
const hop = {
|
|
2804
2829
|
uri,
|
|
@@ -3552,16 +3577,22 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3552
3577
|
const type = referencingElement.element;
|
|
3553
3578
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement);
|
|
3554
3579
|
|
|
3555
|
-
// find element location
|
|
3580
|
+
// find element location by identity in the document tree.
|
|
3581
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
3582
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
3583
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
3556
3584
|
let location;
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
p.
|
|
3585
|
+
const root = this.reference.value.result;
|
|
3586
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(root)) {
|
|
3587
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(root, {
|
|
3588
|
+
enter: p => {
|
|
3589
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
3590
|
+
location = p.formatPath();
|
|
3591
|
+
p.stop();
|
|
3592
|
+
}
|
|
3562
3593
|
}
|
|
3563
|
-
}
|
|
3564
|
-
}
|
|
3594
|
+
});
|
|
3595
|
+
}
|
|
3565
3596
|
location ??= visitorPath.formatPath();
|
|
3566
3597
|
const hop = {
|
|
3567
3598
|
uri,
|
|
@@ -3956,7 +3987,8 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3956
3987
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(linkElement.operationId)) {
|
|
3957
3988
|
const operationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(linkElement.operationId);
|
|
3958
3989
|
const reference = await this.toReference(_util_url_ts__WEBPACK_IMPORTED_MODULE_17__.unsanitize(this.reference.uri));
|
|
3959
|
-
|
|
3990
|
+
const operationPath = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.find)(reference.value.result, path => (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__.isOperationElement)(path.node) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(path.node.operationId) && path.node.operationId.equals(operationId));
|
|
3991
|
+
operationElement = operationPath?.node;
|
|
3960
3992
|
// OperationElement not found by its operationId
|
|
3961
3993
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(operationElement)) {
|
|
3962
3994
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_7__["default"](`OperationElement(operationId=${operationId}) not found`, {
|
|
@@ -4216,15 +4248,13 @@ const parse = anchor => {
|
|
|
4216
4248
|
*/
|
|
4217
4249
|
const evaluate = (anchor, element) => {
|
|
4218
4250
|
const token = parse(anchor);
|
|
4219
|
-
|
|
4251
|
+
const resultPath = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.find)(element,
|
|
4220
4252
|
// @ts-ignore
|
|
4221
|
-
|
|
4222
|
-
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(
|
|
4253
|
+
path => (0,_speclynx_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTED_MODULE_4__.isJSONSchemaElement)(path.node) && (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(path.node.$anchor) === token);
|
|
4254
|
+
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(resultPath)) {
|
|
4223
4255
|
throw new _errors_EvaluationJsonSchema$anchorError_ts__WEBPACK_IMPORTED_MODULE_6__["default"](`Evaluation failed on token: "${token}"`);
|
|
4224
4256
|
}
|
|
4225
|
-
|
|
4226
|
-
// @ts-ignore
|
|
4227
|
-
return result;
|
|
4257
|
+
return resultPath.node;
|
|
4228
4258
|
};
|
|
4229
4259
|
|
|
4230
4260
|
|
|
@@ -4269,12 +4299,12 @@ const evaluate = (uri, element) => {
|
|
|
4269
4299
|
cache
|
|
4270
4300
|
} = evaluate;
|
|
4271
4301
|
const uriStrippedHash = _util_url_ts__WEBPACK_IMPORTED_MODULE_5__.stripHash(uri);
|
|
4272
|
-
const isJSONSchemaElementWith$id =
|
|
4302
|
+
const isJSONSchemaElementWith$id = path => (0,_speclynx_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTED_MODULE_2__.isJSONSchemaElement)(path.node) && typeof path.node.$id !== 'undefined';
|
|
4273
4303
|
|
|
4274
4304
|
// warm the cache
|
|
4275
4305
|
if (!cache.has(element)) {
|
|
4276
|
-
const
|
|
4277
|
-
cache.set(element,
|
|
4306
|
+
const schemaObjectPaths = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__.filter)(element, isJSONSchemaElementWith$id);
|
|
4307
|
+
cache.set(element, schemaObjectPaths.map(path => path.node));
|
|
4278
4308
|
}
|
|
4279
4309
|
|
|
4280
4310
|
// search for the matching schema
|
|
@@ -4552,16 +4582,22 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4552
4582
|
const type = referencingElement.element;
|
|
4553
4583
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(referencingElement);
|
|
4554
4584
|
|
|
4555
|
-
// find element location
|
|
4585
|
+
// find element location by identity in the document tree.
|
|
4586
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
4587
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
4588
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
4556
4589
|
let location;
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
p.
|
|
4590
|
+
const root = this.reference.value.result;
|
|
4591
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isElement)(root)) {
|
|
4592
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.traverse)(root, {
|
|
4593
|
+
enter: p => {
|
|
4594
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
4595
|
+
location = p.formatPath();
|
|
4596
|
+
p.stop();
|
|
4597
|
+
}
|
|
4562
4598
|
}
|
|
4563
|
-
}
|
|
4564
|
-
}
|
|
4599
|
+
});
|
|
4600
|
+
}
|
|
4565
4601
|
location ??= visitorPath.formatPath();
|
|
4566
4602
|
const hop = {
|
|
4567
4603
|
uri,
|
|
@@ -4969,7 +5005,8 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4969
5005
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(linkElement.operationId)) {
|
|
4970
5006
|
const operationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(linkElement.operationId);
|
|
4971
5007
|
const reference = await this.toReference(_util_url_ts__WEBPACK_IMPORTED_MODULE_23__.unsanitize(this.reference.uri));
|
|
4972
|
-
|
|
5008
|
+
const operationPath = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.find)(reference.value.result, path => (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_16__.isOperationElement)(path.node) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isElement)(path.node.operationId) && path.node.operationId.equals(operationId));
|
|
5009
|
+
operationElement = operationPath?.node;
|
|
4973
5010
|
// OperationElement not found by its operationId
|
|
4974
5011
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(operationElement)) {
|
|
4975
5012
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_9__["default"](`OperationElement(operationId=${operationId}) not found`, {
|
|
@@ -79738,11 +79775,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79738
79775
|
/* harmony export */ });
|
|
79739
79776
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
79740
79777
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
79741
|
-
/* harmony import */ var
|
|
79742
|
-
/* harmony import */ var
|
|
79743
|
-
/* harmony import */ var
|
|
79744
|
-
/* harmony import */ var
|
|
79745
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(75107);
|
|
79778
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
79779
|
+
/* harmony import */ var _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(83419);
|
|
79780
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
79781
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75107);
|
|
79746
79782
|
|
|
79747
79783
|
|
|
79748
79784
|
|
|
@@ -79752,23 +79788,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79752
79788
|
/**
|
|
79753
79789
|
* @public
|
|
79754
79790
|
*/
|
|
79755
|
-
class PathItemVisitor extends
|
|
79791
|
+
class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
79756
79792
|
constructor(options) {
|
|
79757
79793
|
super(options);
|
|
79758
|
-
this.element = new
|
|
79794
|
+
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
79759
79795
|
this.consumeSafe = true;
|
|
79760
79796
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
79761
79797
|
}
|
|
79762
79798
|
ObjectElement(path) {
|
|
79763
|
-
|
|
79799
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
79764
79800
|
|
|
79765
79801
|
// decorate Operation elements with HTTP method
|
|
79766
|
-
this.element.filter(
|
|
79802
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isOperationElement)
|
|
79767
79803
|
// @ts-ignore
|
|
79768
79804
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
79769
|
-
const
|
|
79770
|
-
|
|
79771
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
79805
|
+
const httpMethod = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(httpMethodElementCI).toUpperCase();
|
|
79806
|
+
operationElement.meta.set('http-method', httpMethod);
|
|
79772
79807
|
});
|
|
79773
79808
|
|
|
79774
79809
|
// mark this PathItemElement with reference metadata
|
|
@@ -79791,7 +79826,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79791
79826
|
/* harmony export */ });
|
|
79792
79827
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53679);
|
|
79793
79828
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29498);
|
|
79794
|
-
/* harmony import */ var
|
|
79829
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
79795
79830
|
/* harmony import */ var _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38253);
|
|
79796
79831
|
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
79797
79832
|
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75107);
|
|
@@ -79822,7 +79857,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
79822
79857
|
.forEach((pathItemElement, key) => {
|
|
79823
79858
|
key.classes.push('openapi-path-template');
|
|
79824
79859
|
key.classes.push('path-template');
|
|
79825
|
-
pathItemElement.meta.set('path', (0,
|
|
79860
|
+
pathItemElement.meta.set('path', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key));
|
|
79826
79861
|
});
|
|
79827
79862
|
}
|
|
79828
79863
|
}
|
|
@@ -80007,13 +80042,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80007
80042
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
80008
80043
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
80009
80044
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32343);
|
|
80010
|
-
/* harmony import */ var
|
|
80011
|
-
/* harmony import */ var
|
|
80012
|
-
/* harmony import */ var
|
|
80013
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
80014
|
-
/* harmony import */ var
|
|
80015
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75107);
|
|
80016
|
-
|
|
80045
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44673);
|
|
80046
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31297);
|
|
80047
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72880);
|
|
80048
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26365);
|
|
80049
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75107);
|
|
80017
80050
|
|
|
80018
80051
|
|
|
80019
80052
|
|
|
@@ -80023,32 +80056,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80023
80056
|
/**
|
|
80024
80057
|
* @public
|
|
80025
80058
|
*/
|
|
80026
|
-
class ResponsesVisitor extends
|
|
80059
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.BaseMixedFieldsVisitor {
|
|
80027
80060
|
constructor(options) {
|
|
80028
80061
|
super(options);
|
|
80029
|
-
this.element = new
|
|
80062
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
80030
80063
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
80031
80064
|
this.canSupportSpecificationExtensions = true;
|
|
80032
80065
|
this.specPathPatternedFields = element => {
|
|
80033
|
-
return (0,
|
|
80066
|
+
return (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
80034
80067
|
};
|
|
80035
80068
|
// @ts-ignore
|
|
80036
80069
|
this.fieldPatternPredicate = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`));
|
|
80037
80070
|
}
|
|
80038
80071
|
ObjectElement(path) {
|
|
80039
|
-
|
|
80072
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_7__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
80040
80073
|
|
|
80041
80074
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
80042
80075
|
// @ts-ignore
|
|
80043
|
-
this.element.filter(
|
|
80076
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__.isReferenceElement).forEach(referenceElement => {
|
|
80044
80077
|
referenceElement.meta.set('referenced-element', 'response');
|
|
80045
80078
|
});
|
|
80046
80079
|
|
|
80047
80080
|
// decorate every ResponseElement with metadata about their status code
|
|
80048
80081
|
// @ts-ignore
|
|
80049
|
-
this.element.filter(
|
|
80050
|
-
const httpStatusCode = (0,
|
|
80051
|
-
if (!this.fieldPatternPredicate(
|
|
80082
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__.isResponseElement).forEach((value, key) => {
|
|
80083
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
80084
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
80052
80085
|
value.meta.set('http-status-code', httpStatusCode);
|
|
80053
80086
|
});
|
|
80054
80087
|
}
|
|
@@ -87837,13 +87870,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
87837
87870
|
/* harmony export */ });
|
|
87838
87871
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
87839
87872
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
87840
|
-
/* harmony import */ var
|
|
87841
|
-
/* harmony import */ var
|
|
87842
|
-
/* harmony import */ var
|
|
87843
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
87844
|
-
/* harmony import */ var
|
|
87845
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74367);
|
|
87846
|
-
|
|
87873
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
87874
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71767);
|
|
87875
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21314);
|
|
87876
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32131);
|
|
87877
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74367);
|
|
87847
87878
|
|
|
87848
87879
|
|
|
87849
87880
|
|
|
@@ -87856,29 +87887,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
87856
87887
|
/**
|
|
87857
87888
|
* @public
|
|
87858
87889
|
*/
|
|
87859
|
-
class ResponsesVisitor extends
|
|
87890
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor {
|
|
87860
87891
|
constructor(options) {
|
|
87861
87892
|
super(options);
|
|
87862
|
-
this.element = new
|
|
87893
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
87863
87894
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
87864
87895
|
this.canSupportSpecificationExtensions = true;
|
|
87865
|
-
this.specPathPatternedFields = element => (0,
|
|
87896
|
+
this.specPathPatternedFields = element => (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
87866
87897
|
this.fieldPatternPredicate = value => new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`).test(String(value));
|
|
87867
87898
|
}
|
|
87868
87899
|
ObjectElement(path) {
|
|
87869
|
-
|
|
87900
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
87870
87901
|
|
|
87871
87902
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
87872
87903
|
// @ts-ignore
|
|
87873
|
-
this.element.filter(
|
|
87904
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceElement).forEach(referenceElement => {
|
|
87874
87905
|
referenceElement.meta.set('referenced-element', 'response');
|
|
87875
87906
|
});
|
|
87876
87907
|
|
|
87877
87908
|
// decorate every ResponseElement with metadata about their status code
|
|
87878
87909
|
// @ts-ignore
|
|
87879
|
-
this.element.filter(
|
|
87880
|
-
const httpStatusCode = (0,
|
|
87881
|
-
if (!this.fieldPatternPredicate(
|
|
87910
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isResponseElement).forEach((value, key) => {
|
|
87911
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
87912
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
87882
87913
|
value.meta.set('http-status-code', httpStatusCode);
|
|
87883
87914
|
});
|
|
87884
87915
|
}
|
|
@@ -96746,7 +96777,9 @@ class Path {
|
|
|
96746
96777
|
*
|
|
96747
96778
|
* @example
|
|
96748
96779
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
96780
|
+
* ```
|
|
96749
96781
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
96782
|
+
* ```
|
|
96750
96783
|
*/
|
|
96751
96784
|
getPathKeys() {
|
|
96752
96785
|
const keys = [];
|
|
@@ -96781,18 +96814,22 @@ class Path {
|
|
|
96781
96814
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
96782
96815
|
*
|
|
96783
96816
|
* @example
|
|
96817
|
+
* ```
|
|
96784
96818
|
* // JSON Pointer examples:
|
|
96785
96819
|
* path.formatPath(); // "" (root)
|
|
96786
96820
|
* path.formatPath(); // "/info"
|
|
96787
96821
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
96788
96822
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
96823
|
+
* ```
|
|
96789
96824
|
*
|
|
96790
96825
|
* @example
|
|
96826
|
+
* ```
|
|
96791
96827
|
* // JSONPath examples:
|
|
96792
96828
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
96793
96829
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
96794
96830
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
96795
96831
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
96832
|
+
* ```
|
|
96796
96833
|
*/
|
|
96797
96834
|
formatPath(pathFormat = 'jsonpointer') {
|
|
96798
96835
|
const parts = this.getPathKeys();
|
|
@@ -97002,15 +97039,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97002
97039
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
97003
97040
|
|
|
97004
97041
|
/**
|
|
97005
|
-
* Finds all elements
|
|
97042
|
+
* Finds all paths whose elements match the predicate.
|
|
97006
97043
|
* @public
|
|
97007
97044
|
*/
|
|
97008
97045
|
const filter = (element, predicate) => {
|
|
97009
97046
|
const result = [];
|
|
97010
97047
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
97011
97048
|
enter(path) {
|
|
97012
|
-
if (predicate(path
|
|
97013
|
-
result.push(path
|
|
97049
|
+
if (predicate(path)) {
|
|
97050
|
+
result.push(path);
|
|
97014
97051
|
}
|
|
97015
97052
|
}
|
|
97016
97053
|
});
|
|
@@ -97036,7 +97073,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97036
97073
|
* @public
|
|
97037
97074
|
*/
|
|
97038
97075
|
/**
|
|
97039
|
-
* Finds the most inner node at the given offset.
|
|
97076
|
+
* Finds the path of the most inner node at the given offset.
|
|
97040
97077
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
97041
97078
|
* @public
|
|
97042
97079
|
*/
|
|
@@ -97061,7 +97098,7 @@ const findAtOffset = (element, options) => {
|
|
|
97061
97098
|
const endOffset = node.endOffset;
|
|
97062
97099
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
97063
97100
|
if (isWithinOffsetRange) {
|
|
97064
|
-
result.push(
|
|
97101
|
+
result.push(path);
|
|
97065
97102
|
return; // push to stack and dive in
|
|
97066
97103
|
}
|
|
97067
97104
|
path.skip(); // skip entire sub-tree
|
|
@@ -97084,15 +97121,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97084
97121
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
97085
97122
|
|
|
97086
97123
|
/**
|
|
97087
|
-
*
|
|
97124
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
97088
97125
|
* @public
|
|
97089
97126
|
*/
|
|
97090
97127
|
const find = (element, predicate) => {
|
|
97091
97128
|
let result;
|
|
97092
97129
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
97093
97130
|
enter(path) {
|
|
97094
|
-
if (predicate(path
|
|
97095
|
-
result = path
|
|
97131
|
+
if (predicate(path)) {
|
|
97132
|
+
result = path;
|
|
97096
97133
|
path.stop();
|
|
97097
97134
|
}
|
|
97098
97135
|
}
|
|
@@ -97111,9 +97148,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97111
97148
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
97112
97149
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
97113
97150
|
/* harmony export */ });
|
|
97114
|
-
/* harmony import */ var
|
|
97115
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72078);
|
|
97116
|
-
|
|
97151
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
97117
97152
|
|
|
97118
97153
|
/**
|
|
97119
97154
|
* @public
|
|
@@ -97122,7 +97157,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97122
97157
|
* @public
|
|
97123
97158
|
*/
|
|
97124
97159
|
/**
|
|
97125
|
-
* Executes the callback on this element and all
|
|
97160
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
97126
97161
|
* @public
|
|
97127
97162
|
*/
|
|
97128
97163
|
const forEach = (element, options) => {
|
|
@@ -97130,15 +97165,15 @@ const forEach = (element, options) => {
|
|
|
97130
97165
|
let predicate;
|
|
97131
97166
|
if (typeof options === 'function') {
|
|
97132
97167
|
callback = options;
|
|
97133
|
-
predicate =
|
|
97168
|
+
predicate = () => true;
|
|
97134
97169
|
} else {
|
|
97135
97170
|
callback = options.callback ?? (() => {});
|
|
97136
|
-
predicate = options.predicate ??
|
|
97171
|
+
predicate = options.predicate ?? (() => true);
|
|
97137
97172
|
}
|
|
97138
|
-
(0,
|
|
97173
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
97139
97174
|
enter(path) {
|
|
97140
|
-
if (predicate(path
|
|
97141
|
-
callback(path
|
|
97175
|
+
if (predicate(path)) {
|
|
97176
|
+
callback(path);
|
|
97142
97177
|
}
|
|
97143
97178
|
}
|
|
97144
97179
|
});
|
|
@@ -97187,11 +97222,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97187
97222
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75247);
|
|
97188
97223
|
|
|
97189
97224
|
/**
|
|
97190
|
-
* Complement of filter. Finds all elements NOT
|
|
97225
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
97191
97226
|
* @public
|
|
97192
97227
|
*/
|
|
97193
97228
|
const reject = (element, predicate) => {
|
|
97194
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
97229
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
97195
97230
|
};
|
|
97196
97231
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
97197
97232
|
|
|
@@ -97208,7 +97243,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
97208
97243
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44860);
|
|
97209
97244
|
|
|
97210
97245
|
/**
|
|
97211
|
-
* Tests whether at least one element passes the predicate.
|
|
97246
|
+
* Tests whether at least one path's element passes the predicate.
|
|
97212
97247
|
* @public
|
|
97213
97248
|
*/
|
|
97214
97249
|
const some = (element, predicate) => {
|