@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 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, and
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. What to do about a
9823
- * collision is the caller's policy — the map only reports it.
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
- * Inherits the workflow's `successActions` / `failureActions` into each step
14963
- * that declares no `onSuccess` / `onFailure` of its own.
14984
+ * Merges the workflow's `successActions` / `failureActions` into each step's
14985
+ * `onSuccess` / `onFailure`.
14964
14986
  *
14965
- * Per Arazzo 1.0.1 both lists are "applicable for all steps described under
14966
- * this workflow", and a step's own list **overrides** the corresponding
14967
- * workflow one — wholesale, with no per-action merge, which is where this
14968
- * differs from the parameters above. Success and failure fall back
14969
- * independently: a step may override only its `onFailure` and still inherit
14970
- * the workflow's `successActions`.
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
- * Presence is tested with `hasKey`, not truthiness: a step declaring an empty
14973
- * list (`onSuccess: []`) has *overridden* the default with an empty set of
14974
- * actions, not asked for one — it is skipped, as is a step whose `onSuccess`
14975
- * is present but not a list, for the same reason the parameters pass leaves a
14976
- * malformed list alone. Testing the key is also what makes the pass
14977
- * idempotent: after the first run the step has it, so a workflow reached again
14978
- * through the registry cache is skipped.
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
- if (inheritFailure && !step.hasKey('onFailure')) {
15009
- step.onFailure = new _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__["default"]([...failureActions]);
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 — whether they collide on one key (the
16166
- * scheme is not injective: a `querystring` parameter named `header.token` and
16167
- * a header parameter named `token` both produce `header.token`) or across a
16168
- * bare/qualified pair sharing a name (a `querystring` `token` next to a
16169
- * header `token`), where the client would consult the bare name first and
16170
- * silently capture the qualified value.
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 === 'collision') {
16238
- throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_4__["default"](`Parameter "${name}" (in: ${location}) collides with another parameter on the ` + `delivery key "${key}" and cannot be delivered unambiguously`, {
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'