@usearazzo/runner 1.0.1-alpha.13 → 1.0.1-alpha.15
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 +86 -16
- package/dist/arazzo-runner.browser.min.js +1 -1
- package/package.json +4 -4
- package/src/document/ParameterIdentity.cjs +16 -0
- package/src/document/ParameterIdentity.mjs +16 -0
- package/src/executor/StepExecutor.cjs +47 -9
- package/src/executor/StepExecutor.mjs +47 -9
- package/src/executor/WorkflowExecutor.cjs +4 -0
- package/src/executor/WorkflowExecutor.mjs +4 -0
- package/src/resolver/OpenAPIOperationParameterResolver.cjs +12 -1
- package/src/resolver/OpenAPIOperationParameterResolver.mjs +12 -1
- package/types/runner.d.ts +22 -2
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.15](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.14...v1.0.1-alpha.15) (2026-10-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **runner:** reject an unreadable successCriteria before any request ([#284](https://github.com/usearazzo/arazzo-toolkit/issues/284)) ([11662f5](https://github.com/usearazzo/arazzo-toolkit/commit/11662f5e603909e356e95f0daa85a7e245667920)), closes [#127](https://github.com/usearazzo/arazzo-toolkit/issues/127)
|
|
11
|
+
|
|
12
|
+
## [1.0.1-alpha.14](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.13...v1.0.1-alpha.14) (2026-10-27)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **runner:** reject a parameter location outside the defined set ([#283](https://github.com/usearazzo/arazzo-toolkit/issues/283)) ([250f6bf](https://github.com/usearazzo/arazzo-toolkit/commit/250f6bf6a23bbb8b2f305480dc3d728d419e3017)), closes [#126](https://github.com/usearazzo/arazzo-toolkit/issues/126)
|
|
17
|
+
|
|
6
18
|
## [1.0.1-alpha.13](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.12...v1.0.1-alpha.13) (2026-10-27)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
|
@@ -10805,6 +10805,14 @@ class ParameterIdentity {
|
|
|
10805
10805
|
if (location === undefined || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(location)) return undefined;
|
|
10806
10806
|
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(location) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(location) : null;
|
|
10807
10807
|
}
|
|
10808
|
+
|
|
10809
|
+
/**
|
|
10810
|
+
* The locations the Parameter Object defines: Arazzo 1.0.1's closed set plus
|
|
10811
|
+
* 1.1.0's `querystring`. 1.0.0's field description also listed `body`, which
|
|
10812
|
+
* its own summary of locations did not; 1.0.1 removed it as an erratum, so it
|
|
10813
|
+
* is not a location in any version (a payload is the step's `requestBody`).
|
|
10814
|
+
*/
|
|
10815
|
+
static LOCATIONS = ['path', 'query', 'header', 'cookie', 'querystring'];
|
|
10808
10816
|
name;
|
|
10809
10817
|
location;
|
|
10810
10818
|
constructor(name, location) {
|
|
@@ -10812,6 +10820,14 @@ class ParameterIdentity {
|
|
|
10812
10820
|
this.location = location;
|
|
10813
10821
|
}
|
|
10814
10822
|
|
|
10823
|
+
/**
|
|
10824
|
+
* Whether the location is one the Parameter Object defines. An absent or
|
|
10825
|
+
* malformed location is not.
|
|
10826
|
+
*/
|
|
10827
|
+
get hasDefinedLocation() {
|
|
10828
|
+
return ParameterIdentity.LOCATIONS.includes(this.location);
|
|
10829
|
+
}
|
|
10830
|
+
|
|
10815
10831
|
/**
|
|
10816
10832
|
* Whether this and the other identity name the same parameter. A malformed
|
|
10817
10833
|
* location equals nothing, its own duplicate included.
|
|
@@ -12081,8 +12097,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12081
12097
|
/* harmony import */ var _action_ActionResolver_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51097);
|
|
12082
12098
|
/* harmony import */ var _OpenAPIOperationLocatorNormalizer_ts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7308);
|
|
12083
12099
|
/* harmony import */ var _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17658);
|
|
12084
|
-
/* harmony import */ var
|
|
12085
|
-
/* harmony import */ var
|
|
12100
|
+
/* harmony import */ var _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8696);
|
|
12101
|
+
/* harmony import */ var _errors_RuntimeExpressionError_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(48770);
|
|
12102
|
+
/* harmony import */ var _abort_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(99628);
|
|
12103
|
+
|
|
12086
12104
|
|
|
12087
12105
|
|
|
12088
12106
|
|
|
@@ -12215,6 +12233,7 @@ class StepExecutor {
|
|
|
12215
12233
|
reason: 'workflow-step'
|
|
12216
12234
|
});
|
|
12217
12235
|
}
|
|
12236
|
+
this.assertSuccessCriteria(step);
|
|
12218
12237
|
|
|
12219
12238
|
// locate which operation the step invokes — reduced to a (document, JSON
|
|
12220
12239
|
// Pointer) locator that the operation executor extracts, normalizes,
|
|
@@ -12236,8 +12255,8 @@ class StepExecutor {
|
|
|
12236
12255
|
// still reach this line — and this is the last moment before the step has a
|
|
12237
12256
|
// live side effect. The signal stays in the bag, so a request already in
|
|
12238
12257
|
// flight is aborted by the transport as before.
|
|
12239
|
-
const signal = (0,
|
|
12240
|
-
(0,
|
|
12258
|
+
const signal = (0,_abort_ts__WEBPACK_IMPORTED_MODULE_13__.readAbortSignal)(executeOptions);
|
|
12259
|
+
(0,_abort_ts__WEBPACK_IMPORTED_MODULE_13__.throwIfAborted)(signal, {
|
|
12241
12260
|
stepId
|
|
12242
12261
|
});
|
|
12243
12262
|
|
|
@@ -12258,7 +12277,7 @@ class StepExecutor {
|
|
|
12258
12277
|
// cancelled, it did not: reporting it as the abort keeps one error shape
|
|
12259
12278
|
// whether the run was withdrawn between two steps or mid-flight, and keeps
|
|
12260
12279
|
// the whole feature from reading differently per transport.
|
|
12261
|
-
;(0,
|
|
12280
|
+
;(0,_abort_ts__WEBPACK_IMPORTED_MODULE_13__.throwIfAborted)(signal, {
|
|
12262
12281
|
stepId
|
|
12263
12282
|
});
|
|
12264
12283
|
throw error;
|
|
@@ -12310,9 +12329,48 @@ class StepExecutor {
|
|
|
12310
12329
|
});
|
|
12311
12330
|
}
|
|
12312
12331
|
|
|
12332
|
+
/**
|
|
12333
|
+
* Throws {@link ResolverError} unless the step's `successCriteria` is absent
|
|
12334
|
+
* or a list of Criterion Objects: `malformed-criteria` for one that is
|
|
12335
|
+
* present but not a list, `malformed-criterion` for an entry that is not a
|
|
12336
|
+
* Criterion Object. Skipping an unreadable entry would turn the author's
|
|
12337
|
+
* assertion into a vacuous pass, so it is an authoring error, as an action's
|
|
12338
|
+
* unreadable `criteria` is in {@link ActionResolver}.
|
|
12339
|
+
*
|
|
12340
|
+
* Called before the step's request is sent, so no live side effect precedes
|
|
12341
|
+
* the error. Public because the workflow executor checks every step of a
|
|
12342
|
+
* workflow with it before any of them runs, a step targeting a `workflowId`
|
|
12343
|
+
* included. It passes `workflowId`, which the error then carries: step ids
|
|
12344
|
+
* are only unique within a workflow.
|
|
12345
|
+
*/
|
|
12346
|
+
assertSuccessCriteria(step, workflowId) {
|
|
12347
|
+
const criteria = step.successCriteria;
|
|
12348
|
+
if (criteria === undefined) return;
|
|
12349
|
+
const scope = {
|
|
12350
|
+
...(workflowId === undefined ? {} : {
|
|
12351
|
+
workflowId
|
|
12352
|
+
}),
|
|
12353
|
+
stepId: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(step.stepId),
|
|
12354
|
+
target: 'successCriteria'
|
|
12355
|
+
};
|
|
12356
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isArrayElement)(criteria)) {
|
|
12357
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_11__["default"]("A step's `successCriteria` is present but is not a list", {
|
|
12358
|
+
...scope,
|
|
12359
|
+
reason: 'malformed-criteria'
|
|
12360
|
+
});
|
|
12361
|
+
}
|
|
12362
|
+
if (![...criteria].every(_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__.isCriterionElement)) {
|
|
12363
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_11__["default"]("A step's `successCriteria` contains an entry that is not a Criterion Object", {
|
|
12364
|
+
...scope,
|
|
12365
|
+
reason: 'malformed-criterion'
|
|
12366
|
+
});
|
|
12367
|
+
}
|
|
12368
|
+
}
|
|
12369
|
+
|
|
12313
12370
|
/**
|
|
12314
12371
|
* Evaluates the step's `successCriteria`; all criteria must pass. A step with
|
|
12315
|
-
* no criteria succeeds on a received response.
|
|
12372
|
+
* no criteria succeeds on a received response. An unreadable
|
|
12373
|
+
* `successCriteria` throws, see {@link StepExecutor.assertSuccessCriteria}.
|
|
12316
12374
|
*
|
|
12317
12375
|
* Public for the same reason as {@link StepExecutor.selectActions}: a step
|
|
12318
12376
|
* targeting a `workflowId` is run by the workflow executor and never reaches
|
|
@@ -12320,15 +12378,12 @@ class StepExecutor {
|
|
|
12320
12378
|
* assertion about the step and must be evaluated somewhere.
|
|
12321
12379
|
*/
|
|
12322
12380
|
evaluateCriteria(step, context) {
|
|
12381
|
+
this.assertSuccessCriteria(step);
|
|
12323
12382
|
const criteria = step.successCriteria;
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
const met = this.#criterionEvaluator.evaluate(criterion, expression => this.#evaluate(context, expression));
|
|
12329
|
-
if (!met) return false;
|
|
12330
|
-
}
|
|
12331
|
-
return true;
|
|
12383
|
+
if (criteria === undefined) return true;
|
|
12384
|
+
|
|
12385
|
+
// assertSuccessCriteria above guarantees every entry is a Criterion Object
|
|
12386
|
+
return [...criteria].every(criterion => this.#criterionEvaluator.evaluate(criterion, expression => this.#evaluate(context, expression)));
|
|
12332
12387
|
}
|
|
12333
12388
|
|
|
12334
12389
|
/**
|
|
@@ -12361,7 +12416,7 @@ class StepExecutor {
|
|
|
12361
12416
|
// components. A condition on an HTTP exchange cannot apply to a step
|
|
12362
12417
|
// that calls a workflow, so the action does not match; the run does not
|
|
12363
12418
|
// abort over a default written for the operation steps.
|
|
12364
|
-
if (error instanceof
|
|
12419
|
+
if (error instanceof _errors_RuntimeExpressionError_ts__WEBPACK_IMPORTED_MODULE_12__["default"] && error.reason === 'unavailable-expression') {
|
|
12365
12420
|
return false;
|
|
12366
12421
|
}
|
|
12367
12422
|
throw error;
|
|
@@ -13263,6 +13318,10 @@ class WorkflowExecutor {
|
|
|
13263
13318
|
// at `#result` where it used to be resolved, means the throw lands before
|
|
13264
13319
|
// the first request rather than after the last.
|
|
13265
13320
|
this.#validateWorkflowOutputsShape(workflow, workflowId);
|
|
13321
|
+
// and to every step's `successCriteria`, a step calling a workflow
|
|
13322
|
+
// included: an unreadable assertion found at step three must not cost the
|
|
13323
|
+
// run the requests of steps one and two.
|
|
13324
|
+
for (const step of steps) this.#stepExecutor.assertSuccessCriteria(step, workflowId);
|
|
13266
13325
|
const dependencies = await this.#runDependencies(workflow, invocation, scope);
|
|
13267
13326
|
if (dependencies.some(dependency => this.#settledFailed(dependency))) {
|
|
13268
13327
|
// a declared prerequisite did not complete, so this workflow cannot be
|
|
@@ -16097,7 +16156,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16097
16156
|
* instead would let it capture *every* declared location of that name — see
|
|
16098
16157
|
* `ParameterDelivery` for the lookup order that makes it so. A
|
|
16099
16158
|
* non-string location throws for the same reason it deduplicates with nothing
|
|
16100
|
-
* in the normalizer: it names no location.
|
|
16159
|
+
* in the normalizer: it names no location. So does a location outside
|
|
16160
|
+
* `path`, `query`, `header`, `cookie` and `querystring`: Arazzo 1.0.1 removed
|
|
16161
|
+
* `in: body`, and forwarding one would let it still deliver a request body
|
|
16162
|
+
* against an OpenAPI 2.0 operation, bypassing the step's `requestBody`, while
|
|
16163
|
+
* an unknown location reaches nothing at all. And two *different* parameters the
|
|
16101
16164
|
* map reports as colliding cannot both be delivered, so a collision throws
|
|
16102
16165
|
* rather than silently dropping one — whether they collide on one key (the
|
|
16103
16166
|
* scheme is not injective: a `querystring` parameter named `header.token` and
|
|
@@ -16158,6 +16221,13 @@ class OpenAPIOperationParameterResolver extends _StepParameterResolver_ts__WEBPA
|
|
|
16158
16221
|
reason: 'malformed-location'
|
|
16159
16222
|
});
|
|
16160
16223
|
}
|
|
16224
|
+
if (!identity.hasDefinedLocation) {
|
|
16225
|
+
throw new _errors_ResolverError_ts__WEBPACK_IMPORTED_MODULE_4__["default"](`Parameter "${name}" has location "${location}", which is not one of ` + `${_document_ParameterIdentity_ts__WEBPACK_IMPORTED_MODULE_3__["default"].LOCATIONS.join(', ')}`, {
|
|
16226
|
+
...scope,
|
|
16227
|
+
target: name,
|
|
16228
|
+
reason: 'invalid-location'
|
|
16229
|
+
});
|
|
16230
|
+
}
|
|
16161
16231
|
const {
|
|
16162
16232
|
key,
|
|
16163
16233
|
outcome
|