@jentic/arazzo-parser 1.0.0-alpha.22 → 1.0.0-alpha.24
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
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
# [1.0.0-alpha.24](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2026-03-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @jentic/arazzo-parser
|
|
9
|
+
|
|
10
|
+
# [1.0.0-alpha.23](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2026-03-11)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **parser:** share configuration between parsers ([#126](https://github.com/jentic/jentic-arazzo-tools/issues/126)) ([9e5c00f](https://github.com/jentic/jentic-arazzo-tools/commit/9e5c00fcb72afcf1d383ad2707969ebd63aa0774))
|
|
15
|
+
|
|
6
16
|
# [1.0.0-alpha.22](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2026-03-10)
|
|
7
17
|
|
|
8
18
|
### Performance Improvements
|
|
@@ -115,7 +115,7 @@ const defaultOptions = {
|
|
|
115
115
|
resolvers: [new _resolve_resolvers_memory_index_ts__WEBPACK_IMPORTED_MODULE_18__["default"](), new _speclynx_apidom_reference_resolve_resolvers_file__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
116
116
|
fileAllowList: ['*.json', '*.yaml', '*.yml']
|
|
117
117
|
}), new _speclynx_apidom_reference_resolve_resolvers_http_axios__WEBPACK_IMPORTED_MODULE_12__["default"]({
|
|
118
|
-
timeout:
|
|
118
|
+
timeout: 15000,
|
|
119
119
|
redirects: 5,
|
|
120
120
|
withCredentials: false
|
|
121
121
|
})],
|
|
@@ -141,6 +141,15 @@ const defaultOptions = {
|
|
|
141
141
|
* @public
|
|
142
142
|
*/
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Parses an Arazzo Document from a string, object, or URI.
|
|
146
|
+
* @param source - The Arazzo Document as a plain object, string content, or URI
|
|
147
|
+
* @param options - Reference options (uses defaultOptions when not provided)
|
|
148
|
+
* @returns A promise that resolves to the parsed Arazzo Document as ApiDOM data model
|
|
149
|
+
* @throws ParseError - When parsing fails for any reason. The original error is available via the `cause` property.
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
|
|
144
153
|
/**
|
|
145
154
|
* Parses an Arazzo Document from a string, object, or URI.
|
|
146
155
|
*
|
|
@@ -268,18 +277,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
268
277
|
/* harmony import */ var _speclynx_apidom_reference_parse_parsers_openapi_yaml_3_0__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52393);
|
|
269
278
|
/* harmony import */ var _speclynx_apidom_reference_parse_parsers_openapi_json_3_1__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(61275);
|
|
270
279
|
/* harmony import */ var _speclynx_apidom_reference_parse_parsers_openapi_yaml_3_1__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(28208);
|
|
271
|
-
/* harmony import */ var
|
|
272
|
-
/* harmony import */ var
|
|
273
|
-
/* harmony import */ var
|
|
274
|
-
/* harmony import */ var
|
|
275
|
-
/* harmony import */ var
|
|
276
|
-
/* harmony import */ var
|
|
277
|
-
/* harmony import */ var
|
|
278
|
-
/* harmony import */ var
|
|
279
|
-
/* harmony import */ var
|
|
280
|
-
/* harmony import */ var
|
|
281
|
-
/* harmony import */ var _resolve_resolvers_memory_index_ts__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(30513);
|
|
282
|
-
|
|
280
|
+
/* harmony import */ var _speclynx_apidom_parser_adapter_openapi_json_3_1__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(10343);
|
|
281
|
+
/* harmony import */ var _speclynx_apidom_parser_adapter_openapi_yaml_3_1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(43244);
|
|
282
|
+
/* harmony import */ var _speclynx_apidom_parser_adapter_openapi_json_3_0__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(50142);
|
|
283
|
+
/* harmony import */ var _speclynx_apidom_parser_adapter_openapi_yaml_3_0__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(99474);
|
|
284
|
+
/* harmony import */ var _speclynx_apidom_parser_adapter_openapi_json_2__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(64820);
|
|
285
|
+
/* harmony import */ var _speclynx_apidom_parser_adapter_openapi_yaml_2__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(71527);
|
|
286
|
+
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(34606);
|
|
287
|
+
/* harmony import */ var _errors_ParseError_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(10425);
|
|
288
|
+
/* harmony import */ var _resolve_resolvers_memory_index_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(30513);
|
|
289
|
+
/* harmony import */ var _parse_arazzo_ts__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(30089);
|
|
283
290
|
|
|
284
291
|
|
|
285
292
|
|
|
@@ -323,19 +330,11 @@ const defaultOptions = {
|
|
|
323
330
|
allowEmpty: false
|
|
324
331
|
})],
|
|
325
332
|
parserOpts: {
|
|
326
|
-
|
|
327
|
-
style: false,
|
|
328
|
-
strict: true
|
|
333
|
+
..._parse_arazzo_ts__WEBPACK_IMPORTED_MODULE_17__.defaultOptions.parse.parserOpts
|
|
329
334
|
}
|
|
330
335
|
},
|
|
331
336
|
resolve: {
|
|
332
|
-
resolvers: [new
|
|
333
|
-
fileAllowList: ['*.json', '*.yaml', '*.yml']
|
|
334
|
-
}), new _speclynx_apidom_reference_resolve_resolvers_http_axios__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
335
|
-
timeout: 5000,
|
|
336
|
-
redirects: 5,
|
|
337
|
-
withCredentials: false
|
|
338
|
-
})],
|
|
337
|
+
resolvers: [new _resolve_resolvers_memory_index_ts__WEBPACK_IMPORTED_MODULE_16__["default"](), ..._parse_arazzo_ts__WEBPACK_IMPORTED_MODULE_17__.defaultOptions.resolve.resolvers.filter(r => r.name !== 'memory')],
|
|
339
338
|
resolverOpts: {}
|
|
340
339
|
}
|
|
341
340
|
};
|
|
@@ -358,6 +357,15 @@ const defaultOptions = {
|
|
|
358
357
|
* @public
|
|
359
358
|
*/
|
|
360
359
|
|
|
360
|
+
/**
|
|
361
|
+
* Parses an OpenAPI Document from a string, object, or URI.
|
|
362
|
+
* @param source - The OpenAPI Document as a plain object, string content, or URI
|
|
363
|
+
* @param options - Reference options (uses defaultOptions when not provided)
|
|
364
|
+
* @returns A promise that resolves to the parsed OpenAPI Document as ApiDOM data model
|
|
365
|
+
* @throws ParseError - When parsing fails for any reason. The original error is available via the `cause` property.
|
|
366
|
+
* @public
|
|
367
|
+
*/
|
|
368
|
+
|
|
361
369
|
/**
|
|
362
370
|
* Parses an OpenAPI Document from a string, object, or URI.
|
|
363
371
|
*
|
|
@@ -406,7 +414,7 @@ async function parse(source, options = {}) {
|
|
|
406
414
|
let mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(defaultOptions, options);
|
|
407
415
|
const strict = mergedOptions.parse?.parserOpts?.strict ?? true;
|
|
408
416
|
let sourceProvenance;
|
|
409
|
-
if ((0,
|
|
417
|
+
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_14__["default"])(source)) {
|
|
410
418
|
const document = JSON.stringify(source, null, 2);
|
|
411
419
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
412
420
|
resolve: {
|
|
@@ -417,7 +425,7 @@ async function parse(source, options = {}) {
|
|
|
417
425
|
});
|
|
418
426
|
source = 'memory://openapi.json';
|
|
419
427
|
sourceProvenance = '[object]';
|
|
420
|
-
} else if (await (0,
|
|
428
|
+
} else if (await (0,_speclynx_apidom_parser_adapter_openapi_json_2__WEBPACK_IMPORTED_MODULE_12__.detect)(source, {
|
|
421
429
|
strict
|
|
422
430
|
})) {
|
|
423
431
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
@@ -429,7 +437,7 @@ async function parse(source, options = {}) {
|
|
|
429
437
|
});
|
|
430
438
|
source = 'memory://openapi.json';
|
|
431
439
|
sourceProvenance = '[inline JSON]';
|
|
432
|
-
} else if (await (0,
|
|
440
|
+
} else if (await (0,_speclynx_apidom_parser_adapter_openapi_yaml_2__WEBPACK_IMPORTED_MODULE_13__.detect)(source, {
|
|
433
441
|
strict
|
|
434
442
|
})) {
|
|
435
443
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
@@ -441,7 +449,7 @@ async function parse(source, options = {}) {
|
|
|
441
449
|
});
|
|
442
450
|
source = 'memory://openapi.yaml';
|
|
443
451
|
sourceProvenance = '[inline YAML]';
|
|
444
|
-
} else if (await (0,
|
|
452
|
+
} else if (await (0,_speclynx_apidom_parser_adapter_openapi_json_3_0__WEBPACK_IMPORTED_MODULE_10__.detect)(source, {
|
|
445
453
|
strict
|
|
446
454
|
})) {
|
|
447
455
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
@@ -453,7 +461,7 @@ async function parse(source, options = {}) {
|
|
|
453
461
|
});
|
|
454
462
|
source = 'memory://openapi.json';
|
|
455
463
|
sourceProvenance = '[inline JSON]';
|
|
456
|
-
} else if (await (0,
|
|
464
|
+
} else if (await (0,_speclynx_apidom_parser_adapter_openapi_yaml_3_0__WEBPACK_IMPORTED_MODULE_11__.detect)(source, {
|
|
457
465
|
strict
|
|
458
466
|
})) {
|
|
459
467
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
@@ -465,7 +473,7 @@ async function parse(source, options = {}) {
|
|
|
465
473
|
});
|
|
466
474
|
source = 'memory://openapi.yaml';
|
|
467
475
|
sourceProvenance = '[inline YAML]';
|
|
468
|
-
} else if (await (0,
|
|
476
|
+
} else if (await (0,_speclynx_apidom_parser_adapter_openapi_json_3_1__WEBPACK_IMPORTED_MODULE_8__.detect)(source, {
|
|
469
477
|
strict
|
|
470
478
|
})) {
|
|
471
479
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
@@ -477,7 +485,7 @@ async function parse(source, options = {}) {
|
|
|
477
485
|
});
|
|
478
486
|
source = 'memory://openapi.json';
|
|
479
487
|
sourceProvenance = '[inline JSON]';
|
|
480
|
-
} else if (await (0,
|
|
488
|
+
} else if (await (0,_speclynx_apidom_parser_adapter_openapi_yaml_3_1__WEBPACK_IMPORTED_MODULE_9__.detect)(source, {
|
|
481
489
|
strict
|
|
482
490
|
})) {
|
|
483
491
|
mergedOptions = (0,_speclynx_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_1__.merge)(mergedOptions, {
|
|
@@ -503,7 +511,7 @@ async function parse(source, options = {}) {
|
|
|
503
511
|
}
|
|
504
512
|
return parseResult;
|
|
505
513
|
} catch (error) {
|
|
506
|
-
throw new
|
|
514
|
+
throw new _errors_ParseError_ts__WEBPACK_IMPORTED_MODULE_15__["default"](`Failed to parse OpenAPI Document from "${sourceProvenance}"`, {
|
|
507
515
|
cause: error
|
|
508
516
|
});
|
|
509
517
|
}
|
|
@@ -38189,7 +38197,9 @@ class Path {
|
|
|
38189
38197
|
*
|
|
38190
38198
|
* @example
|
|
38191
38199
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
38200
|
+
* ```
|
|
38192
38201
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
38202
|
+
* ```
|
|
38193
38203
|
*/
|
|
38194
38204
|
getPathKeys() {
|
|
38195
38205
|
const keys = [];
|
|
@@ -38224,18 +38234,22 @@ class Path {
|
|
|
38224
38234
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
38225
38235
|
*
|
|
38226
38236
|
* @example
|
|
38237
|
+
* ```
|
|
38227
38238
|
* // JSON Pointer examples:
|
|
38228
38239
|
* path.formatPath(); // "" (root)
|
|
38229
38240
|
* path.formatPath(); // "/info"
|
|
38230
38241
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
38231
38242
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
38243
|
+
* ```
|
|
38232
38244
|
*
|
|
38233
38245
|
* @example
|
|
38246
|
+
* ```
|
|
38234
38247
|
* // JSONPath examples:
|
|
38235
38248
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
38236
38249
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
38237
38250
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
38238
38251
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
38252
|
+
* ```
|
|
38239
38253
|
*/
|
|
38240
38254
|
formatPath(pathFormat = 'jsonpointer') {
|
|
38241
38255
|
const parts = this.getPathKeys();
|
|
@@ -38445,15 +38459,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38445
38459
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66061);
|
|
38446
38460
|
|
|
38447
38461
|
/**
|
|
38448
|
-
* Finds all elements
|
|
38462
|
+
* Finds all paths whose elements match the predicate.
|
|
38449
38463
|
* @public
|
|
38450
38464
|
*/
|
|
38451
38465
|
const filter = (element, predicate) => {
|
|
38452
38466
|
const result = [];
|
|
38453
38467
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
38454
38468
|
enter(path) {
|
|
38455
|
-
if (predicate(path
|
|
38456
|
-
result.push(path
|
|
38469
|
+
if (predicate(path)) {
|
|
38470
|
+
result.push(path);
|
|
38457
38471
|
}
|
|
38458
38472
|
}
|
|
38459
38473
|
});
|
|
@@ -38479,7 +38493,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38479
38493
|
* @public
|
|
38480
38494
|
*/
|
|
38481
38495
|
/**
|
|
38482
|
-
* Finds the most inner node at the given offset.
|
|
38496
|
+
* Finds the path of the most inner node at the given offset.
|
|
38483
38497
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
38484
38498
|
* @public
|
|
38485
38499
|
*/
|
|
@@ -38504,7 +38518,7 @@ const findAtOffset = (element, options) => {
|
|
|
38504
38518
|
const endOffset = node.endOffset;
|
|
38505
38519
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
38506
38520
|
if (isWithinOffsetRange) {
|
|
38507
|
-
result.push(
|
|
38521
|
+
result.push(path);
|
|
38508
38522
|
return; // push to stack and dive in
|
|
38509
38523
|
}
|
|
38510
38524
|
path.skip(); // skip entire sub-tree
|
|
@@ -38527,15 +38541,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38527
38541
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66061);
|
|
38528
38542
|
|
|
38529
38543
|
/**
|
|
38530
|
-
*
|
|
38544
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
38531
38545
|
* @public
|
|
38532
38546
|
*/
|
|
38533
38547
|
const find = (element, predicate) => {
|
|
38534
38548
|
let result;
|
|
38535
38549
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
38536
38550
|
enter(path) {
|
|
38537
|
-
if (predicate(path
|
|
38538
|
-
result = path
|
|
38551
|
+
if (predicate(path)) {
|
|
38552
|
+
result = path;
|
|
38539
38553
|
path.stop();
|
|
38540
38554
|
}
|
|
38541
38555
|
}
|
|
@@ -38554,9 +38568,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38554
38568
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
38555
38569
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
38556
38570
|
/* harmony export */ });
|
|
38557
|
-
/* harmony import */ var
|
|
38558
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66061);
|
|
38559
|
-
|
|
38571
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66061);
|
|
38560
38572
|
|
|
38561
38573
|
/**
|
|
38562
38574
|
* @public
|
|
@@ -38565,7 +38577,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38565
38577
|
* @public
|
|
38566
38578
|
*/
|
|
38567
38579
|
/**
|
|
38568
|
-
* Executes the callback on this element and all
|
|
38580
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
38569
38581
|
* @public
|
|
38570
38582
|
*/
|
|
38571
38583
|
const forEach = (element, options) => {
|
|
@@ -38573,15 +38585,15 @@ const forEach = (element, options) => {
|
|
|
38573
38585
|
let predicate;
|
|
38574
38586
|
if (typeof options === 'function') {
|
|
38575
38587
|
callback = options;
|
|
38576
|
-
predicate =
|
|
38588
|
+
predicate = () => true;
|
|
38577
38589
|
} else {
|
|
38578
38590
|
callback = options.callback ?? (() => {});
|
|
38579
|
-
predicate = options.predicate ??
|
|
38591
|
+
predicate = options.predicate ?? (() => true);
|
|
38580
38592
|
}
|
|
38581
|
-
(0,
|
|
38593
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
38582
38594
|
enter(path) {
|
|
38583
|
-
if (predicate(path
|
|
38584
|
-
callback(path
|
|
38595
|
+
if (predicate(path)) {
|
|
38596
|
+
callback(path);
|
|
38585
38597
|
}
|
|
38586
38598
|
}
|
|
38587
38599
|
});
|
|
@@ -38630,11 +38642,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38630
38642
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5800);
|
|
38631
38643
|
|
|
38632
38644
|
/**
|
|
38633
|
-
* Complement of filter. Finds all elements NOT
|
|
38645
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
38634
38646
|
* @public
|
|
38635
38647
|
*/
|
|
38636
38648
|
const reject = (element, predicate) => {
|
|
38637
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
38649
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
38638
38650
|
};
|
|
38639
38651
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
38640
38652
|
|
|
@@ -38651,7 +38663,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38651
38663
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66919);
|
|
38652
38664
|
|
|
38653
38665
|
/**
|
|
38654
|
-
* Tests whether at least one element passes the predicate.
|
|
38666
|
+
* Tests whether at least one path's element passes the predicate.
|
|
38655
38667
|
* @public
|
|
38656
38668
|
*/
|
|
38657
38669
|
const some = (element, predicate) => {
|