@usearazzo/runner 1.0.1-alpha.16 → 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 +6 -0
- package/dist/arazzo-runner.browser.js +40 -14
- 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/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,12 @@
|
|
|
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
|
+
|
|
6
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)
|
|
7
13
|
|
|
8
14
|
### 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,
|
|
@@ -16192,12 +16214,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16192
16214
|
* against an OpenAPI 2.0 operation, bypassing the step's `requestBody`, while
|
|
16193
16215
|
* an unknown location reaches nothing at all. And two *different* parameters the
|
|
16194
16216
|
* map reports as colliding cannot both be delivered, so a collision throws
|
|
16195
|
-
* rather than silently dropping one —
|
|
16196
|
-
*
|
|
16197
|
-
*
|
|
16198
|
-
*
|
|
16199
|
-
*
|
|
16200
|
-
*
|
|
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.
|
|
16201
16226
|
* @public
|
|
16202
16227
|
*/
|
|
16203
16228
|
class OpenAPIOperationParameterResolver extends _StepParameterResolver_ts__WEBPACK_IMPORTED_MODULE_5__["default"] {
|
|
@@ -16264,8 +16289,9 @@ class OpenAPIOperationParameterResolver extends _StepParameterResolver_ts__WEBPA
|
|
|
16264
16289
|
} = delivery.claim(location, name);
|
|
16265
16290
|
// the same parameter declared again: the earlier, more specific one won
|
|
16266
16291
|
if (outcome === 'duplicate') continue;
|
|
16267
|
-
if (outcome
|
|
16268
|
-
|
|
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`, {
|
|
16269
16295
|
...scope,
|
|
16270
16296
|
target: name,
|
|
16271
16297
|
reason: 'ambiguous-delivery'
|