@speclynx/apidom-reference 2.9.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +11 -5
- package/dist/apidom-reference.browser.js +13 -4
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +25 -25
- package/src/dereference/strategies/arazzo-1/source-descriptions.cjs +5 -1
- package/src/dereference/strategies/arazzo-1/source-descriptions.mjs +5 -1
- package/src/parse/parsers/arazzo-json-1/source-descriptions.cjs +4 -1
- package/src/parse/parsers/arazzo-json-1/source-descriptions.mjs +4 -1
- package/types/dereference/strategies/arazzo-1/source-descriptions.d.ts +4 -1
- package/types/parse/parsers/arazzo-json-1/source-descriptions.d.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-reference",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.1",
|
|
4
4
|
"description": "Advanced algorithms for semantic ApiDOM manipulations like dereferencing or resolution.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -231,29 +231,29 @@
|
|
|
231
231
|
"license": "Apache-2.0",
|
|
232
232
|
"dependencies": {
|
|
233
233
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
234
|
-
"@speclynx/apidom-core": "^2.
|
|
235
|
-
"@speclynx/apidom-datamodel": "^2.
|
|
236
|
-
"@speclynx/apidom-error": "^2.
|
|
237
|
-
"@speclynx/apidom-json-pointer": "^2.
|
|
238
|
-
"@speclynx/apidom-ns-arazzo-1": "^2.
|
|
239
|
-
"@speclynx/apidom-ns-asyncapi-2": "^2.
|
|
240
|
-
"@speclynx/apidom-ns-json-schema-2020-12": "^2.
|
|
241
|
-
"@speclynx/apidom-ns-openapi-2": "^2.
|
|
242
|
-
"@speclynx/apidom-ns-openapi-3-0": "^2.
|
|
243
|
-
"@speclynx/apidom-ns-openapi-3-1": "^2.
|
|
244
|
-
"@speclynx/apidom-parser-adapter-arazzo-json-1": "^2.
|
|
245
|
-
"@speclynx/apidom-parser-adapter-arazzo-yaml-1": "^2.
|
|
246
|
-
"@speclynx/apidom-parser-adapter-asyncapi-json-2": "^2.
|
|
247
|
-
"@speclynx/apidom-parser-adapter-asyncapi-yaml-2": "^2.
|
|
248
|
-
"@speclynx/apidom-parser-adapter-json": "^2.
|
|
249
|
-
"@speclynx/apidom-parser-adapter-openapi-json-2": "^2.
|
|
250
|
-
"@speclynx/apidom-parser-adapter-openapi-json-3-0": "^2.
|
|
251
|
-
"@speclynx/apidom-parser-adapter-openapi-json-3-1": "^2.
|
|
252
|
-
"@speclynx/apidom-parser-adapter-openapi-yaml-2": "^2.
|
|
253
|
-
"@speclynx/apidom-parser-adapter-openapi-yaml-3-0": "^2.
|
|
254
|
-
"@speclynx/apidom-parser-adapter-openapi-yaml-3-1": "^2.
|
|
255
|
-
"@speclynx/apidom-parser-adapter-yaml-1-2": "^2.
|
|
256
|
-
"@speclynx/apidom-traverse": "^2.
|
|
234
|
+
"@speclynx/apidom-core": "^2.10.1",
|
|
235
|
+
"@speclynx/apidom-datamodel": "^2.10.1",
|
|
236
|
+
"@speclynx/apidom-error": "^2.10.1",
|
|
237
|
+
"@speclynx/apidom-json-pointer": "^2.10.1",
|
|
238
|
+
"@speclynx/apidom-ns-arazzo-1": "^2.10.1",
|
|
239
|
+
"@speclynx/apidom-ns-asyncapi-2": "^2.10.1",
|
|
240
|
+
"@speclynx/apidom-ns-json-schema-2020-12": "^2.10.1",
|
|
241
|
+
"@speclynx/apidom-ns-openapi-2": "^2.10.1",
|
|
242
|
+
"@speclynx/apidom-ns-openapi-3-0": "^2.10.1",
|
|
243
|
+
"@speclynx/apidom-ns-openapi-3-1": "^2.10.1",
|
|
244
|
+
"@speclynx/apidom-parser-adapter-arazzo-json-1": "^2.10.1",
|
|
245
|
+
"@speclynx/apidom-parser-adapter-arazzo-yaml-1": "^2.10.1",
|
|
246
|
+
"@speclynx/apidom-parser-adapter-asyncapi-json-2": "^2.10.1",
|
|
247
|
+
"@speclynx/apidom-parser-adapter-asyncapi-yaml-2": "^2.10.1",
|
|
248
|
+
"@speclynx/apidom-parser-adapter-json": "^2.10.1",
|
|
249
|
+
"@speclynx/apidom-parser-adapter-openapi-json-2": "^2.10.1",
|
|
250
|
+
"@speclynx/apidom-parser-adapter-openapi-json-3-0": "^2.10.1",
|
|
251
|
+
"@speclynx/apidom-parser-adapter-openapi-json-3-1": "^2.10.1",
|
|
252
|
+
"@speclynx/apidom-parser-adapter-openapi-yaml-2": "^2.10.1",
|
|
253
|
+
"@speclynx/apidom-parser-adapter-openapi-yaml-3-0": "^2.10.1",
|
|
254
|
+
"@speclynx/apidom-parser-adapter-openapi-yaml-3-1": "^2.10.1",
|
|
255
|
+
"@speclynx/apidom-parser-adapter-yaml-1-2": "^2.10.1",
|
|
256
|
+
"@speclynx/apidom-traverse": "^2.10.1",
|
|
257
257
|
"@swaggerexpert/arazzo-runtime-expression": "^2.0.2",
|
|
258
258
|
"axios": "^1.13.0",
|
|
259
259
|
"minimatch": "^7.4.6",
|
|
@@ -274,5 +274,5 @@
|
|
|
274
274
|
"README.md",
|
|
275
275
|
"CHANGELOG.md"
|
|
276
276
|
],
|
|
277
|
-
"gitHead": "
|
|
277
|
+
"gitHead": "c17dde40295b5156a2fab55d247a5cbe0cd4ddf3"
|
|
278
278
|
}
|
|
@@ -39,6 +39,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
39
39
|
|
|
40
40
|
// normalize URI for consistent cycle detection and refSet cache key matching
|
|
41
41
|
const retrievalURI = url.sanitize(url.stripHash(url.resolve(ctx.baseURI, sourceDescriptionURI)));
|
|
42
|
+
parseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
42
43
|
|
|
43
44
|
// skip if already visited (cycle detection)
|
|
44
45
|
if (ctx.visitedUrls.has(retrievalURI)) {
|
|
@@ -152,7 +153,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
152
153
|
* in `dereference.strategyOpts` to filter which source descriptions to process.
|
|
153
154
|
* @param strategyName - Strategy name for options lookup (defaults to 'arazzo-1')
|
|
154
155
|
* @returns Array of ParseResultElements. Returns one ParseResultElement per source description
|
|
155
|
-
* (each with class 'source-description' and name
|
|
156
|
+
* (each with class 'source-description' and metadata: name, type, retrievalURI).
|
|
156
157
|
* May return early with a single-element array containing a warning annotation when:
|
|
157
158
|
* - The API is not an Arazzo specification
|
|
158
159
|
* - The sourceDescriptions field is missing or not an array
|
|
@@ -161,6 +162,8 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
161
162
|
*
|
|
162
163
|
* @example
|
|
163
164
|
* ```typescript
|
|
165
|
+
* import { toValue } from '@speclynx/apidom-core';
|
|
166
|
+
*
|
|
164
167
|
* // Dereference all source descriptions
|
|
165
168
|
* await dereferenceSourceDescriptions(parseResult, uri, options);
|
|
166
169
|
*
|
|
@@ -172,6 +175,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
172
175
|
* // Access dereferenced document from source description element
|
|
173
176
|
* const sourceDesc = parseResult.api.sourceDescriptions.get(0);
|
|
174
177
|
* const dereferencedDoc = sourceDesc.meta.get('parseResult');
|
|
178
|
+
* const retrievalURI = toValue(dereferencedDoc.meta.get('retrievalURI'));
|
|
175
179
|
* ```
|
|
176
180
|
*
|
|
177
181
|
* @public
|
|
@@ -34,6 +34,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
34
34
|
|
|
35
35
|
// normalize URI for consistent cycle detection and refSet cache key matching
|
|
36
36
|
const retrievalURI = url.sanitize(url.stripHash(url.resolve(ctx.baseURI, sourceDescriptionURI)));
|
|
37
|
+
parseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
37
38
|
|
|
38
39
|
// skip if already visited (cycle detection)
|
|
39
40
|
if (ctx.visitedUrls.has(retrievalURI)) {
|
|
@@ -147,7 +148,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
147
148
|
* in `dereference.strategyOpts` to filter which source descriptions to process.
|
|
148
149
|
* @param strategyName - Strategy name for options lookup (defaults to 'arazzo-1')
|
|
149
150
|
* @returns Array of ParseResultElements. Returns one ParseResultElement per source description
|
|
150
|
-
* (each with class 'source-description' and name
|
|
151
|
+
* (each with class 'source-description' and metadata: name, type, retrievalURI).
|
|
151
152
|
* May return early with a single-element array containing a warning annotation when:
|
|
152
153
|
* - The API is not an Arazzo specification
|
|
153
154
|
* - The sourceDescriptions field is missing or not an array
|
|
@@ -156,6 +157,8 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
156
157
|
*
|
|
157
158
|
* @example
|
|
158
159
|
* ```typescript
|
|
160
|
+
* import { toValue } from '@speclynx/apidom-core';
|
|
161
|
+
*
|
|
159
162
|
* // Dereference all source descriptions
|
|
160
163
|
* await dereferenceSourceDescriptions(parseResult, uri, options);
|
|
161
164
|
*
|
|
@@ -167,6 +170,7 @@ async function dereferenceSourceDescription(sourceDescription, ctx) {
|
|
|
167
170
|
* // Access dereferenced document from source description element
|
|
168
171
|
* const sourceDesc = parseResult.api.sourceDescriptions.get(0);
|
|
169
172
|
* const dereferencedDoc = sourceDesc.meta.get('parseResult');
|
|
173
|
+
* const retrievalURI = toValue(dereferencedDoc.meta.get('retrievalURI'));
|
|
170
174
|
* ```
|
|
171
175
|
*
|
|
172
176
|
* @public
|
|
@@ -43,6 +43,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
43
43
|
|
|
44
44
|
// normalize URI for consistent cycle detection and cache key matching
|
|
45
45
|
const retrievalURI = url.sanitize(url.stripHash(url.resolve(ctx.baseURI, sourceDescriptionURI)));
|
|
46
|
+
parseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
46
47
|
|
|
47
48
|
// skip if already visited (cycle detection)
|
|
48
49
|
if (ctx.visitedUrls.has(retrievalURI)) {
|
|
@@ -124,7 +125,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
124
125
|
* in `parse.parserOpts` to filter which source descriptions to process.
|
|
125
126
|
* @param parserName - Parser name for options lookup (defaults to 'arazzo-json-1')
|
|
126
127
|
* @returns Array of ParseResultElements. Returns one ParseResultElement per source description
|
|
127
|
-
* (each with class 'source-description' and name
|
|
128
|
+
* (each with class 'source-description' and metadata: name, type, retrievalURI).
|
|
128
129
|
* May return early with a single-element array containing a warning annotation when:
|
|
129
130
|
* - The API is not an Arazzo specification
|
|
130
131
|
* - The sourceDescriptions field is missing or not an array
|
|
@@ -133,6 +134,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
133
134
|
*
|
|
134
135
|
* @example
|
|
135
136
|
* ```typescript
|
|
137
|
+
* import { toValue } from '@speclynx/apidom-core';
|
|
136
138
|
* import { options, mergeOptions } from '@speclynx/apidom-reference';
|
|
137
139
|
* import { parseSourceDescriptions } from '@speclynx/apidom-reference/parse/parsers/arazzo-json-1';
|
|
138
140
|
*
|
|
@@ -147,6 +149,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
147
149
|
* // Access parsed document from source description element
|
|
148
150
|
* const sourceDesc = parseResult.api.sourceDescriptions.get(0);
|
|
149
151
|
* const parsedDoc = sourceDesc.meta.get('parseResult');
|
|
152
|
+
* const retrievalURI = toValue(parsedDoc.meta.get('retrievalURI'));
|
|
150
153
|
* ```
|
|
151
154
|
*
|
|
152
155
|
* @public
|
|
@@ -36,6 +36,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
36
36
|
|
|
37
37
|
// normalize URI for consistent cycle detection and cache key matching
|
|
38
38
|
const retrievalURI = url.sanitize(url.stripHash(url.resolve(ctx.baseURI, sourceDescriptionURI)));
|
|
39
|
+
parseResult.setMetaProperty('retrievalURI', retrievalURI);
|
|
39
40
|
|
|
40
41
|
// skip if already visited (cycle detection)
|
|
41
42
|
if (ctx.visitedUrls.has(retrievalURI)) {
|
|
@@ -117,7 +118,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
117
118
|
* in `parse.parserOpts` to filter which source descriptions to process.
|
|
118
119
|
* @param parserName - Parser name for options lookup (defaults to 'arazzo-json-1')
|
|
119
120
|
* @returns Array of ParseResultElements. Returns one ParseResultElement per source description
|
|
120
|
-
* (each with class 'source-description' and name
|
|
121
|
+
* (each with class 'source-description' and metadata: name, type, retrievalURI).
|
|
121
122
|
* May return early with a single-element array containing a warning annotation when:
|
|
122
123
|
* - The API is not an Arazzo specification
|
|
123
124
|
* - The sourceDescriptions field is missing or not an array
|
|
@@ -126,6 +127,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
126
127
|
*
|
|
127
128
|
* @example
|
|
128
129
|
* ```typescript
|
|
130
|
+
* import { toValue } from '@speclynx/apidom-core';
|
|
129
131
|
* import { options, mergeOptions } from '@speclynx/apidom-reference';
|
|
130
132
|
* import { parseSourceDescriptions } from '@speclynx/apidom-reference/parse/parsers/arazzo-json-1';
|
|
131
133
|
*
|
|
@@ -140,6 +142,7 @@ async function parseSourceDescription(sourceDescription, ctx) {
|
|
|
140
142
|
* // Access parsed document from source description element
|
|
141
143
|
* const sourceDesc = parseResult.api.sourceDescriptions.get(0);
|
|
142
144
|
* const parsedDoc = sourceDesc.meta.get('parseResult');
|
|
145
|
+
* const retrievalURI = toValue(parsedDoc.meta.get('retrievalURI'));
|
|
143
146
|
* ```
|
|
144
147
|
*
|
|
145
148
|
* @public
|
|
@@ -14,7 +14,7 @@ import type { ReferenceOptions } from '../../../options/index.ts';
|
|
|
14
14
|
* in `dereference.strategyOpts` to filter which source descriptions to process.
|
|
15
15
|
* @param strategyName - Strategy name for options lookup (defaults to 'arazzo-1')
|
|
16
16
|
* @returns Array of ParseResultElements. Returns one ParseResultElement per source description
|
|
17
|
-
* (each with class 'source-description' and name
|
|
17
|
+
* (each with class 'source-description' and metadata: name, type, retrievalURI).
|
|
18
18
|
* May return early with a single-element array containing a warning annotation when:
|
|
19
19
|
* - The API is not an Arazzo specification
|
|
20
20
|
* - The sourceDescriptions field is missing or not an array
|
|
@@ -23,6 +23,8 @@ import type { ReferenceOptions } from '../../../options/index.ts';
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
+
* import { toValue } from '@speclynx/apidom-core';
|
|
27
|
+
*
|
|
26
28
|
* // Dereference all source descriptions
|
|
27
29
|
* await dereferenceSourceDescriptions(parseResult, uri, options);
|
|
28
30
|
*
|
|
@@ -34,6 +36,7 @@ import type { ReferenceOptions } from '../../../options/index.ts';
|
|
|
34
36
|
* // Access dereferenced document from source description element
|
|
35
37
|
* const sourceDesc = parseResult.api.sourceDescriptions.get(0);
|
|
36
38
|
* const dereferencedDoc = sourceDesc.meta.get('parseResult');
|
|
39
|
+
* const retrievalURI = toValue(dereferencedDoc.meta.get('retrievalURI'));
|
|
37
40
|
* ```
|
|
38
41
|
*
|
|
39
42
|
* @public
|
|
@@ -14,7 +14,7 @@ import type { ReferenceOptions } from '../../../options/index.ts';
|
|
|
14
14
|
* in `parse.parserOpts` to filter which source descriptions to process.
|
|
15
15
|
* @param parserName - Parser name for options lookup (defaults to 'arazzo-json-1')
|
|
16
16
|
* @returns Array of ParseResultElements. Returns one ParseResultElement per source description
|
|
17
|
-
* (each with class 'source-description' and name
|
|
17
|
+
* (each with class 'source-description' and metadata: name, type, retrievalURI).
|
|
18
18
|
* May return early with a single-element array containing a warning annotation when:
|
|
19
19
|
* - The API is not an Arazzo specification
|
|
20
20
|
* - The sourceDescriptions field is missing or not an array
|
|
@@ -23,6 +23,7 @@ import type { ReferenceOptions } from '../../../options/index.ts';
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
+
* import { toValue } from '@speclynx/apidom-core';
|
|
26
27
|
* import { options, mergeOptions } from '@speclynx/apidom-reference';
|
|
27
28
|
* import { parseSourceDescriptions } from '@speclynx/apidom-reference/parse/parsers/arazzo-json-1';
|
|
28
29
|
*
|
|
@@ -37,6 +38,7 @@ import type { ReferenceOptions } from '../../../options/index.ts';
|
|
|
37
38
|
* // Access parsed document from source description element
|
|
38
39
|
* const sourceDesc = parseResult.api.sourceDescriptions.get(0);
|
|
39
40
|
* const parsedDoc = sourceDesc.meta.get('parseResult');
|
|
41
|
+
* const retrievalURI = toValue(parsedDoc.meta.get('retrievalURI'));
|
|
40
42
|
* ```
|
|
41
43
|
*
|
|
42
44
|
* @public
|