@usearazzo/runner 1.0.1-alpha.15 → 1.0.1-alpha.17
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/dist/arazzo-runner.browser.js +89 -33
- package/dist/arazzo-runner.browser.min.js +1 -1
- package/package.json +5 -5
- package/src/client/ParameterDelivery.cjs +28 -6
- package/src/client/ParameterDelivery.mjs +28 -6
- package/src/normalizer/ArazzoWorkflowNormalizer.cjs +49 -19
- package/src/normalizer/ArazzoWorkflowNormalizer.mjs +50 -20
- package/src/resolver/OpenAPIOperationParameterResolver.cjs +12 -8
- package/src/resolver/OpenAPIOperationParameterResolver.mjs +12 -8
- package/types/runner.d.ts +9 -6
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.17](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.16...v1.0.1-alpha.17) (2026-10-29)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **runner:** reject a querystring name shaped like a location key ([#292](https://github.com/usearazzo/arazzo-toolkit/issues/292)) ([de44f5e](https://github.com/usearazzo/arazzo-toolkit/commit/de44f5e4c65b225cb3c6caad9887d5b51fcd02b8)), closes [#280](https://github.com/usearazzo/arazzo-toolkit/issues/280)
|
|
11
|
+
|
|
12
|
+
## [1.0.1-alpha.16](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.15...v1.0.1-alpha.16) (2026-10-28)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **runner:** merge workflow default actions into steps by name ([#288](https://github.com/usearazzo/arazzo-toolkit/issues/288)) ([8ee0ba3](https://github.com/usearazzo/arazzo-toolkit/commit/8ee0ba387c475fef329c7d094e10ed3b2b0753c1)), closes [#117](https://github.com/usearazzo/arazzo-toolkit/issues/117)
|
|
17
|
+
|
|
6
18
|
## [1.0.1-alpha.15](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.14...v1.0.1-alpha.15) (2026-10-28)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
|
@@ -9776,10 +9776,19 @@ class OpenAPIOperationResponseNormalizer {
|
|
|
9776
9776
|
|
|
9777
9777
|
"use strict";
|
|
9778
9778
|
__webpack_require__.r(__webpack_exports__);
|
|
9779
|
+
/**
|
|
9780
|
+
* A key starting with an `in` value the client builds qualified keys from —
|
|
9781
|
+
* the OpenAPI locations, including OpenAPI 2.0's `formData` and `body`. The
|
|
9782
|
+
* client qualifies whatever `in` an operation declares, so a non-standard one
|
|
9783
|
+
* is not covered.
|
|
9784
|
+
*/
|
|
9785
|
+
const QUALIFIED_KEY = /^(?:path|query|header|cookie|formData|body)\./;
|
|
9786
|
+
|
|
9779
9787
|
/**
|
|
9780
9788
|
* The outcome of claiming a delivery key: `claimed` for a first claim,
|
|
9781
|
-
* `duplicate` when the same `(name, in)` parameter claims its key again,
|
|
9782
|
-
* `collision` when a *different* parameter produces an already-claimed key
|
|
9789
|
+
* `duplicate` when the same `(name, in)` parameter claims its key again,
|
|
9790
|
+
* `collision` when a *different* parameter produces an already-claimed key,
|
|
9791
|
+
* and `misaddressed` when a bare key has the shape of a qualified one.
|
|
9783
9792
|
* @internal
|
|
9784
9793
|
*/
|
|
9785
9794
|
|
|
@@ -9819,8 +9828,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9819
9828
|
* alone identifies the claimant. A bare key and a qualified key sharing one
|
|
9820
9829
|
* name are a collision too, even though the keys differ — the client consults
|
|
9821
9830
|
* the bare name first for every declared parameter bearing it, so the bare
|
|
9822
|
-
* entry would silently capture the qualified one.
|
|
9823
|
-
*
|
|
9831
|
+
* entry would silently capture the qualified one.
|
|
9832
|
+
*
|
|
9833
|
+
* A bare key that starts with a location the client qualifies keys with
|
|
9834
|
+
* (`querystring` named `header.X-Foo`) is misaddressed even when it claims
|
|
9835
|
+
* alone: the client matches it as the qualified key of every declared
|
|
9836
|
+
* parameter that location and the rest of the name identify, so the value
|
|
9837
|
+
* would reach the header `X-Foo` — and `OpenAPIOperationExecutor` reads such
|
|
9838
|
+
* a key the same way when it delivers undeclared parameters. What to do about
|
|
9839
|
+
* a collision or a misaddressed key is the caller's policy — the map only
|
|
9840
|
+
* reports it.
|
|
9824
9841
|
*
|
|
9825
9842
|
* Diff this against the vendored bundle's lookup when bumping swagger-client.
|
|
9826
9843
|
* @internal
|
|
@@ -9843,10 +9860,16 @@ class ParameterDelivery {
|
|
|
9843
9860
|
* Only a `claimed` outcome entitles the caller to {@link ParameterDelivery.set}
|
|
9844
9861
|
* the key; a `duplicate` means the same parameter already holds it, and a
|
|
9845
9862
|
* `collision` means a different parameter does — on the same key, or across
|
|
9846
|
-
* a bare/qualified pair sharing the name (see the class doc).
|
|
9863
|
+
* a bare/qualified pair sharing the name (see the class doc). A
|
|
9864
|
+
* `misaddressed` bare key is never claimed.
|
|
9847
9865
|
*/
|
|
9848
9866
|
claim(location, name) {
|
|
9849
9867
|
const key = ParameterDelivery.keyFor(location, name);
|
|
9868
|
+
const bare = key === name;
|
|
9869
|
+
if (bare && QUALIFIED_KEY.test(name)) return {
|
|
9870
|
+
key,
|
|
9871
|
+
outcome: 'misaddressed'
|
|
9872
|
+
};
|
|
9850
9873
|
const claimant = this.#claimedBy.get(key);
|
|
9851
9874
|
if (claimant !== undefined) {
|
|
9852
9875
|
return {
|
|
@@ -9854,7 +9877,6 @@ class ParameterDelivery {
|
|
|
9854
9877
|
outcome: claimant === location ? 'duplicate' : 'collision'
|
|
9855
9878
|
};
|
|
9856
9879
|
}
|
|
9857
|
-
const bare = key === name;
|
|
9858
9880
|
if (bare ? this.#qualifiedNames.has(name) : this.#bareNames.has(name)) {
|
|
9859
9881
|
return {
|
|
9860
9882
|
key,
|
|
@@ -14959,23 +14981,32 @@ class ArazzoWorkflowNormalizer {
|
|
|
14959
14981
|
}
|
|
14960
14982
|
|
|
14961
14983
|
/**
|
|
14962
|
-
*
|
|
14963
|
-
*
|
|
14984
|
+
* Merges the workflow's `successActions` / `failureActions` into each step's
|
|
14985
|
+
* `onSuccess` / `onFailure`.
|
|
14964
14986
|
*
|
|
14965
|
-
* Per Arazzo
|
|
14966
|
-
*
|
|
14967
|
-
*
|
|
14968
|
-
*
|
|
14969
|
-
*
|
|
14970
|
-
* the
|
|
14987
|
+
* Per Arazzo both lists are "applicable for all steps described under this
|
|
14988
|
+
* workflow" and "can be overridden at the step level but cannot be removed
|
|
14989
|
+
* there". The required action `name` is what makes both halves hold: a
|
|
14990
|
+
* step's action replaces the workflow action of the same `name`, and every
|
|
14991
|
+
* workflow action the step does not name still applies. The effective list is
|
|
14992
|
+
* the step's own actions in order, then the workflow actions it did not
|
|
14993
|
+
* override, in theirs — order matters, as selection is first-match-wins on
|
|
14994
|
+
* `criteria`. So a step with no list, or with `[]`, gets every workflow
|
|
14995
|
+
* action. The step's own list is kept exactly as written, even a duplicate
|
|
14996
|
+
* `name` in it, which the validator reports: inheritance only adds to it.
|
|
14997
|
+
* Within the workflow's list the first action with a given `name` wins.
|
|
14998
|
+
* Success and failure merge independently.
|
|
14971
14999
|
*
|
|
14972
|
-
*
|
|
14973
|
-
*
|
|
14974
|
-
*
|
|
14975
|
-
* is present but not a list
|
|
14976
|
-
*
|
|
14977
|
-
*
|
|
14978
|
-
*
|
|
15000
|
+
* An entry without a readable `name` (an unresolved Reusable Object, a
|
|
15001
|
+
* scalar someone put in the list) neither overrides nor is overridden: it
|
|
15002
|
+
* keeps its place, and is added only if that same element is not already in
|
|
15003
|
+
* the list. A step whose `onSuccess` is present but not a list is left
|
|
15004
|
+
* alone, for the same reason the parameters pass leaves a malformed list
|
|
15005
|
+
* alone — overwriting it would erase what makes the document invalid.
|
|
15006
|
+
*
|
|
15007
|
+
* The pass is idempotent, so a workflow reached again through the registry
|
|
15008
|
+
* cache is merged into once: on a second pass every inherited action is
|
|
15009
|
+
* already in the step's list, under its own `name` or as the same element.
|
|
14979
15010
|
*
|
|
14980
15011
|
* Unlike parameters there is no step-kind filter — an action names a
|
|
14981
15012
|
* transition within the workflow, which is as meaningful for a step targeting
|
|
@@ -15002,13 +15033,34 @@ class ArazzoWorkflowNormalizer {
|
|
|
15002
15033
|
if (!inheritSuccess && !inheritFailure) return;
|
|
15003
15034
|
for (const step of workflow.steps) {
|
|
15004
15035
|
if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_1__.isStepElement)(step)) continue;
|
|
15005
|
-
if (inheritSuccess && !step.hasKey('onSuccess')) {
|
|
15006
|
-
step.onSuccess = new _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__["default"]([...successActions]);
|
|
15036
|
+
if (inheritSuccess && (!step.hasKey('onSuccess') || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__.isArrayElement)(step.onSuccess))) {
|
|
15037
|
+
step.onSuccess = new _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__["default"](ArazzoWorkflowNormalizer.#mergeActions([...(step.onSuccess ?? [])], [...successActions]));
|
|
15038
|
+
}
|
|
15039
|
+
if (inheritFailure && (!step.hasKey('onFailure') || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__.isArrayElement)(step.onFailure))) {
|
|
15040
|
+
step.onFailure = new _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__["default"](ArazzoWorkflowNormalizer.#mergeActions([...(step.onFailure ?? [])], [...failureActions]));
|
|
15007
15041
|
}
|
|
15008
|
-
|
|
15009
|
-
|
|
15042
|
+
}
|
|
15043
|
+
}
|
|
15044
|
+
|
|
15045
|
+
/**
|
|
15046
|
+
* The step's actions as written, followed by each workflow action whose
|
|
15047
|
+
* `name` neither the step nor an earlier workflow action carries; a nameless
|
|
15048
|
+
* workflow entry is added unless that same element is already present.
|
|
15049
|
+
*/
|
|
15050
|
+
static #mergeActions(own, inherited) {
|
|
15051
|
+
const nameOf = action => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__.isObjectElement)(action) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(action.get('name')) : undefined;
|
|
15052
|
+
const names = new Set(own.map(nameOf));
|
|
15053
|
+
const merged = [...own];
|
|
15054
|
+
for (const action of inherited) {
|
|
15055
|
+
const name = nameOf(action);
|
|
15056
|
+
if (typeof name !== 'string') {
|
|
15057
|
+
if (!merged.includes(action)) merged.push(action);
|
|
15058
|
+
} else if (!names.has(name)) {
|
|
15059
|
+
names.add(name);
|
|
15060
|
+
merged.push(action);
|
|
15010
15061
|
}
|
|
15011
15062
|
}
|
|
15063
|
+
return merged;
|
|
15012
15064
|
}
|
|
15013
15065
|
}
|
|
15014
15066
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ArazzoWorkflowNormalizer);
|
|
@@ -16162,12 +16214,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16162
16214
|
* against an OpenAPI 2.0 operation, bypassing the step's `requestBody`, while
|
|
16163
16215
|
* an unknown location reaches nothing at all. And two *different* parameters the
|
|
16164
16216
|
* map reports as colliding cannot both be delivered, so a collision throws
|
|
16165
|
-
* rather than silently dropping one —
|
|
16166
|
-
*
|
|
16167
|
-
*
|
|
16168
|
-
*
|
|
16169
|
-
*
|
|
16170
|
-
*
|
|
16217
|
+
* rather than silently dropping one — a bare/qualified pair sharing a name (a
|
|
16218
|
+
* `querystring` `token` next to a header `token`), where the client would
|
|
16219
|
+
* consult the bare name first and silently capture the qualified value. A
|
|
16220
|
+
* `querystring` parameter whose name starts with a location the client
|
|
16221
|
+
* qualifies keys with (`header.X-Foo`) throws even alone: the client would
|
|
16222
|
+
* match its bare key as the qualified key of a declared header `X-Foo` and
|
|
16223
|
+
* deliver it there. The same check rejects it, in either order, next to a
|
|
16224
|
+
* header parameter `X-Foo` producing that very key — the scheme is not
|
|
16225
|
+
* injective, so the two could otherwise collide on one key.
|
|
16171
16226
|
* @public
|
|
16172
16227
|
*/
|
|
16173
16228
|
class OpenAPIOperationParameterResolver extends _StepParameterResolver_ts__WEBPACK_IMPORTED_MODULE_5__["default"] {
|
|
@@ -16234,8 +16289,9 @@ class OpenAPIOperationParameterResolver extends _StepParameterResolver_ts__WEBPA
|
|
|
16234
16289
|
} = delivery.claim(location, name);
|
|
16235
16290
|
// the same parameter declared again: the earlier, more specific one won
|
|
16236
16291
|
if (outcome === 'duplicate') continue;
|
|
16237
|
-
if (outcome
|
|
16238
|
-
|
|
16292
|
+
if (outcome !== 'claimed') {
|
|
16293
|
+
const why = outcome === 'collision' ? `collides with another parameter on the delivery key "${key}"` : 'has a name the client reads as the delivery key of another location';
|
|
16294
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_4__["default"](`Parameter "${name}" (in: ${location}) ${why} and cannot be delivered unambiguously`, {
|
|
16239
16295
|
...scope,
|
|
16240
16296
|
target: name,
|
|
16241
16297
|
reason: 'ambiguous-delivery'
|