@usearazzo/runner 1.0.1-alpha.24 → 1.0.1-alpha.26
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 +12 -0
- package/README.md +2 -0
- package/dist/arazzo-runner.browser.js +44 -4
- package/dist/arazzo-runner.browser.min.js +1 -1
- package/package.json +4 -4
- package/src/document/ArazzoDocument.cjs +34 -1
- package/src/document/ArazzoDocument.mjs +33 -1
- package/src/registry/providers/ArazzoDocumentRegistryProvider.cjs +3 -1
- package/src/registry/providers/ArazzoDocumentRegistryProvider.mjs +3 -1
- package/src/registry/providers/OpenAPIDocumentRegistryProvider.cjs +2 -0
- package/src/registry/providers/OpenAPIDocumentRegistryProvider.mjs +2 -0
- package/types/runner.d.ts +34 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.1-alpha.26](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.25...v1.0.1-alpha.26) (2026-11-05)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **runner:** resolve duplicate workflow and operation ids first-wins ([#324](https://github.com/usearazzo/arazzo-toolkit/issues/324)) ([0f5072c](https://github.com/usearazzo/arazzo-toolkit/commit/0f5072c8c60f4d9b030c58f409675f0c2e677762)), closes [#322](https://github.com/usearazzo/arazzo-toolkit/issues/322)
|
|
11
|
+
|
|
12
|
+
## [1.0.1-alpha.25](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.24...v1.0.1-alpha.25) (2026-11-04)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **runner:** list the workflows of an Arazzo document ([#321](https://github.com/usearazzo/arazzo-toolkit/issues/321)) ([93a2fc9](https://github.com/usearazzo/arazzo-toolkit/commit/93a2fc9738d095fab25bb5ba7afffe791ed4eb20)), closes [#83](https://github.com/usearazzo/arazzo-toolkit/issues/83)
|
|
17
|
+
|
|
6
18
|
## [1.0.1-alpha.24](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.23...v1.0.1-alpha.24) (2026-11-04)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/README.md
CHANGED
|
@@ -112,6 +112,8 @@ const result = await runner.execute('authenticateAndOrderPet', {
|
|
|
112
112
|
|
|
113
113
|
`runner.document` and `runner.registry` are the loaded entry document and the registry holding its source descriptions; unless you pass one, every runner `load` returns has a registry of its own. `load` takes the seams of the building blocks it wires: `registry` (one registry backs one entry document, so loading a different document into it throws `InvalidEntryDocumentError`), `httpClient` and `requestInterceptor`, and the workflow executor's `maxSteps`, `maxWorkflowDepth`, `sleep` and `now`. To bind a runner to a document you already acquired, use `new ArazzoRunner({ document, registry })`; it throws `InvalidEntryDocumentError` unless `document` is the entry document of `registry`.
|
|
114
114
|
|
|
115
|
+
To see what a document offers before running it, `runner.document.listWorkflows()` returns a `WorkflowDescriptor` for each workflow `execute` accepts, in document order: its `workflowId`, its `jsonPointer` in the document and, when the document gives them as strings, its `summary` and `description`. It reads the entry document only; source descriptions are not loaded.
|
|
116
|
+
|
|
115
117
|
To add credentials, pass a `requestInterceptor`:
|
|
116
118
|
|
|
117
119
|
```js
|
|
@@ -10573,16 +10573,27 @@ class APIDocument {
|
|
|
10573
10573
|
"use strict";
|
|
10574
10574
|
__webpack_require__.r(__webpack_exports__);
|
|
10575
10575
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7456);
|
|
10576
|
-
/* harmony import */ var
|
|
10576
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62823);
|
|
10577
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94851);
|
|
10578
|
+
/* harmony import */ var _APIDocument_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44919);
|
|
10579
|
+
|
|
10580
|
+
|
|
10581
|
+
|
|
10582
|
+
|
|
10577
10583
|
|
|
10584
|
+
/**
|
|
10585
|
+
* A workflow of an Arazzo document, as listed by
|
|
10586
|
+
* {@link ArazzoDocument.listWorkflows}.
|
|
10587
|
+
* @public
|
|
10588
|
+
*/
|
|
10578
10589
|
|
|
10579
10590
|
/**
|
|
10580
10591
|
* An Arazzo document held by the document registry: the parse result together
|
|
10581
10592
|
* with the indexes the provider built over it — a container, not a logic
|
|
10582
|
-
* bearer. The methods below are thin reads of
|
|
10593
|
+
* bearer. The methods below are thin reads of those indexes.
|
|
10583
10594
|
* @public
|
|
10584
10595
|
*/
|
|
10585
|
-
class ArazzoDocument extends
|
|
10596
|
+
class ArazzoDocument extends _APIDocument_ts__WEBPACK_IMPORTED_MODULE_3__["default"] {
|
|
10586
10597
|
type = 'arazzo';
|
|
10587
10598
|
isEntry;
|
|
10588
10599
|
/**
|
|
@@ -10615,6 +10626,31 @@ class ArazzoDocument extends _APIDocument_ts__WEBPACK_IMPORTED_MODULE_1__["defau
|
|
|
10615
10626
|
return doc.type === 'arazzo';
|
|
10616
10627
|
}
|
|
10617
10628
|
|
|
10629
|
+
/**
|
|
10630
|
+
* The workflows of this document that can be addressed by `workflowId`, in
|
|
10631
|
+
* document order. A duplicated `workflowId` is listed once, for its first
|
|
10632
|
+
* workflow. Reads this document only: source descriptions are neither loaded
|
|
10633
|
+
* nor listed.
|
|
10634
|
+
*/
|
|
10635
|
+
listWorkflows() {
|
|
10636
|
+
return [...this.workflowIndex].map(([workflowId, jsonPointer]) => {
|
|
10637
|
+
const {
|
|
10638
|
+
summary,
|
|
10639
|
+
description
|
|
10640
|
+
} = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__.evaluate)(this.parseResult.api, jsonPointer);
|
|
10641
|
+
return {
|
|
10642
|
+
workflowId,
|
|
10643
|
+
jsonPointer,
|
|
10644
|
+
...((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(summary) && {
|
|
10645
|
+
summary: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(summary)
|
|
10646
|
+
}),
|
|
10647
|
+
...((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(description) && {
|
|
10648
|
+
description: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(description)
|
|
10649
|
+
})
|
|
10650
|
+
};
|
|
10651
|
+
});
|
|
10652
|
+
}
|
|
10653
|
+
|
|
10618
10654
|
/**
|
|
10619
10655
|
* Resolves a source description name to its canonical URI — precomputed by
|
|
10620
10656
|
* the provider, resolved against this document's base URI.
|
|
@@ -16310,7 +16346,8 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBPA
|
|
|
16310
16346
|
* A source description's canonical URI is resolved here too — against the
|
|
16311
16347
|
* document's base URI, into the exact form the document registry keys on —
|
|
16312
16348
|
* so every consumer works with a ready-to-use, non-relative URI. The first
|
|
16313
|
-
* element of a duplicated source description name wins
|
|
16349
|
+
* element of a duplicated source description name wins, and so does the
|
|
16350
|
+
* first workflow of a duplicated workflowId.
|
|
16314
16351
|
*/
|
|
16315
16352
|
#buildIndexes(uri, parseResult) {
|
|
16316
16353
|
const workflowIndex = new _document_ArazzoWorkflowIndex_ts__WEBPACK_IMPORTED_MODULE_13__["default"]();
|
|
@@ -16322,6 +16359,7 @@ class ArazzoDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBPA
|
|
|
16322
16359
|
const workflowId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(workflow.workflowId);
|
|
16323
16360
|
if (typeof workflowId !== 'string') return path.skip();
|
|
16324
16361
|
if (workflowId === '') return path.skip();
|
|
16362
|
+
if (workflowIndex.has(workflowId)) return path.skip();
|
|
16325
16363
|
const workflowPointer = path.formatPath('jsonpointer');
|
|
16326
16364
|
workflowIndex.set(workflowId, workflowPointer);
|
|
16327
16365
|
|
|
@@ -16468,6 +16506,7 @@ const providerOptionsOverride = {
|
|
|
16468
16506
|
* Provides OpenAPIDocument instances for the DocumentRegistry.
|
|
16469
16507
|
*
|
|
16470
16508
|
* Parses, dereferences, and builds an OperationIndex for OpenAPI documents.
|
|
16509
|
+
* The first operation of a duplicated operationId wins.
|
|
16471
16510
|
* @public
|
|
16472
16511
|
*/
|
|
16473
16512
|
class OpenAPIDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBPACK_IMPORTED_MODULE_11__["default"] {
|
|
@@ -16519,6 +16558,7 @@ class OpenAPIDocumentRegistryProvider extends _DocumentRegistryProvider_ts__WEBP
|
|
|
16519
16558
|
const operationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(operation.operationId);
|
|
16520
16559
|
if (typeof operationId !== 'string') return path.skip();
|
|
16521
16560
|
if (operationId === '') return path.skip();
|
|
16561
|
+
if (index.has(operationId)) return path.skip();
|
|
16522
16562
|
index.set(operationId, path.formatPath('jsonpointer'));
|
|
16523
16563
|
path.skip();
|
|
16524
16564
|
}
|