@usearazzo/runner 1.0.1-alpha.23 → 1.0.1-alpha.24
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 +14 -0
- package/README.md +1 -1
- package/dist/arazzo-runner.browser.js +362 -226
- package/dist/arazzo-runner.browser.min.js +1 -1
- package/package.json +4 -4
- package/src/action/ActionResolver.cjs +4 -4
- package/src/action/ActionResolver.mjs +4 -4
- package/src/criterion/CriterionEvaluator.cjs +8 -9
- package/src/criterion/CriterionEvaluator.mjs +8 -9
- package/src/criterion/JSONPathCriterionEvaluator.cjs +1 -2
- package/src/criterion/JSONPathCriterionEvaluator.mjs +1 -2
- package/src/criterion/RegexCriterionEvaluator.cjs +1 -2
- package/src/criterion/RegexCriterionEvaluator.mjs +1 -2
- package/src/criterion/SimpleCriterionEvaluator.cjs +1 -2
- package/src/criterion/SimpleCriterionEvaluator.mjs +1 -2
- package/src/criterion/XPathCriterionEvaluator.cjs +4 -5
- package/src/criterion/XPathCriterionEvaluator.mjs +4 -5
- package/src/errors/CriterionError.cjs +52 -2
- package/src/errors/CriterionError.mjs +53 -2
- package/src/errors/ExecutionError.cjs +73 -2
- package/src/errors/ExecutionError.mjs +74 -2
- package/src/errors/ResolverError.cjs +53 -2
- package/src/errors/ResolverError.mjs +54 -2
- package/src/errors/RuntimeExpressionError.cjs +32 -2
- package/src/errors/RuntimeExpressionError.mjs +33 -2
- package/src/executor/ArazzoWorkflowLocatorNormalizer.cjs +4 -4
- package/src/executor/ArazzoWorkflowLocatorNormalizer.mjs +4 -4
- package/src/executor/OpenAPIOperationLocatorNormalizer.cjs +11 -11
- package/src/executor/OpenAPIOperationLocatorNormalizer.mjs +11 -11
- package/src/executor/StepExecutor.cjs +7 -7
- package/src/executor/StepExecutor.mjs +7 -7
- package/src/executor/StepRetryRunner.cjs +1 -1
- package/src/executor/StepRetryRunner.mjs +1 -1
- package/src/executor/StepTransitionInterpreter.cjs +3 -3
- package/src/executor/StepTransitionInterpreter.mjs +3 -3
- package/src/executor/WorkflowCallStack.cjs +2 -2
- package/src/executor/WorkflowCallStack.mjs +2 -2
- package/src/executor/WorkflowExecutor.cjs +13 -13
- package/src/executor/WorkflowExecutor.mjs +13 -13
- package/src/executor/abort.cjs +3 -3
- package/src/executor/abort.mjs +3 -3
- package/src/expression/RuntimeExpressionEvaluator.cjs +5 -5
- package/src/expression/RuntimeExpressionEvaluator.mjs +5 -5
- package/src/index.cjs +0 -7
- package/src/index.mjs +0 -1
- package/src/resolver/OpenAPIOperationParameterResolver.cjs +6 -6
- package/src/resolver/OpenAPIOperationParameterResolver.mjs +6 -6
- package/src/resolver/OutputResolver.cjs +3 -3
- package/src/resolver/OutputResolver.mjs +3 -3
- package/src/resolver/RequestBodyResolver.cjs +6 -6
- package/src/resolver/RequestBodyResolver.mjs +6 -6
- package/src/resolver/WorkflowParameterResolver.cjs +1 -1
- package/src/resolver/WorkflowParameterResolver.mjs +1 -1
- package/types/runner.d.ts +196 -45
- package/src/criterion/CriterionErrorReason.cjs +0 -51
- package/src/criterion/CriterionErrorReason.mjs +0 -46
|
@@ -75,7 +75,7 @@ class RequestBodyResolver extends _ArazzoValueResolver.default {
|
|
|
75
75
|
throw new _ResolverError.default('`requestBody` is present but is not a map', {
|
|
76
76
|
...scope,
|
|
77
77
|
target: 'requestBody',
|
|
78
|
-
reason:
|
|
78
|
+
reason: _ResolverError.default.MalformedRequestBody
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
const authoredPayload = (0, _apidomCore.toValue)(requestBody.payload);
|
|
@@ -87,7 +87,7 @@ class RequestBodyResolver extends _ArazzoValueResolver.default {
|
|
|
87
87
|
throw new _ResolverError.default('`requestBody.replacements` is present but is not a list', {
|
|
88
88
|
...scope,
|
|
89
89
|
target: 'requestBody.replacements',
|
|
90
|
-
reason:
|
|
90
|
+
reason: _ResolverError.default.MalformedReplacements
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
for (const replacement of requestBody.replacements) {
|
|
@@ -152,7 +152,7 @@ class RequestBodyResolver extends _ArazzoValueResolver.default {
|
|
|
152
152
|
throw new _ResolverError.default(`Invalid runtime expression "${text}" in ${this.#payloadTarget(tokens)}`, {
|
|
153
153
|
...scope,
|
|
154
154
|
target: this.#payloadTarget(tokens),
|
|
155
|
-
reason:
|
|
155
|
+
reason: _ResolverError.default.InvalidExpression
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
});
|
|
@@ -171,7 +171,7 @@ class RequestBodyResolver extends _ArazzoValueResolver.default {
|
|
|
171
171
|
return new _ResolverError.default(`Runtime expression "${expression}" in ${target} did not resolve`, {
|
|
172
172
|
...scope,
|
|
173
173
|
target,
|
|
174
|
-
reason:
|
|
174
|
+
reason: _ResolverError.default.UnresolvedExpression
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -195,7 +195,7 @@ class RequestBodyResolver extends _ArazzoValueResolver.default {
|
|
|
195
195
|
throw new _ResolverError.default(`Unsupported requestBody replacement target "${target}" (expected JSON Pointer)`, {
|
|
196
196
|
...scope,
|
|
197
197
|
target,
|
|
198
|
-
reason:
|
|
198
|
+
reason: _ResolverError.default.UnsupportedTarget
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -209,7 +209,7 @@ class RequestBodyResolver extends _ArazzoValueResolver.default {
|
|
|
209
209
|
throw new _ResolverError.default(`requestBody replacement target "${target}" does not resolve in the payload`, {
|
|
210
210
|
...scope,
|
|
211
211
|
target,
|
|
212
|
-
reason:
|
|
212
|
+
reason: _ResolverError.default.UnresolvedTarget
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
return (0, _ramda.assocPath)(tokens, value, payload);
|
|
@@ -68,7 +68,7 @@ class RequestBodyResolver extends ArazzoValueResolver {
|
|
|
68
68
|
throw new ResolverError('`requestBody` is present but is not a map', {
|
|
69
69
|
...scope,
|
|
70
70
|
target: 'requestBody',
|
|
71
|
-
reason:
|
|
71
|
+
reason: ResolverError.MalformedRequestBody
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
const authoredPayload = toValue(requestBody.payload);
|
|
@@ -80,7 +80,7 @@ class RequestBodyResolver extends ArazzoValueResolver {
|
|
|
80
80
|
throw new ResolverError('`requestBody.replacements` is present but is not a list', {
|
|
81
81
|
...scope,
|
|
82
82
|
target: 'requestBody.replacements',
|
|
83
|
-
reason:
|
|
83
|
+
reason: ResolverError.MalformedReplacements
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
for (const replacement of requestBody.replacements) {
|
|
@@ -145,7 +145,7 @@ class RequestBodyResolver extends ArazzoValueResolver {
|
|
|
145
145
|
throw new ResolverError(`Invalid runtime expression "${text}" in ${this.#payloadTarget(tokens)}`, {
|
|
146
146
|
...scope,
|
|
147
147
|
target: this.#payloadTarget(tokens),
|
|
148
|
-
reason:
|
|
148
|
+
reason: ResolverError.InvalidExpression
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
});
|
|
@@ -164,7 +164,7 @@ class RequestBodyResolver extends ArazzoValueResolver {
|
|
|
164
164
|
return new ResolverError(`Runtime expression "${expression}" in ${target} did not resolve`, {
|
|
165
165
|
...scope,
|
|
166
166
|
target,
|
|
167
|
-
reason:
|
|
167
|
+
reason: ResolverError.UnresolvedExpression
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -188,7 +188,7 @@ class RequestBodyResolver extends ArazzoValueResolver {
|
|
|
188
188
|
throw new ResolverError(`Unsupported requestBody replacement target "${target}" (expected JSON Pointer)`, {
|
|
189
189
|
...scope,
|
|
190
190
|
target,
|
|
191
|
-
reason:
|
|
191
|
+
reason: ResolverError.UnsupportedTarget
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -202,7 +202,7 @@ class RequestBodyResolver extends ArazzoValueResolver {
|
|
|
202
202
|
throw new ResolverError(`requestBody replacement target "${target}" does not resolve in the payload`, {
|
|
203
203
|
...scope,
|
|
204
204
|
target,
|
|
205
|
-
reason:
|
|
205
|
+
reason: ResolverError.UnresolvedTarget
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
return assocPath(tokens, value, payload);
|
|
@@ -44,7 +44,7 @@ class WorkflowParameterResolver extends _StepParameterResolver.default {
|
|
|
44
44
|
throw new _ResolverError.default('`parameters` is present but is not a list', {
|
|
45
45
|
...scope,
|
|
46
46
|
target: 'parameters',
|
|
47
|
-
reason:
|
|
47
|
+
reason: _ResolverError.default.MalformedParameters
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
for (const parameter of parameters) {
|
|
@@ -37,7 +37,7 @@ class WorkflowParameterResolver extends StepParameterResolver {
|
|
|
37
37
|
throw new ResolverError('`parameters` is present but is not a list', {
|
|
38
38
|
...scope,
|
|
39
39
|
target: 'parameters',
|
|
40
|
-
reason:
|
|
40
|
+
reason: ResolverError.MalformedParameters
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
for (const parameter of parameters) {
|
package/types/runner.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ApiDOMErrorOptions } from '@speclynx/apidom-error';
|
|
1
2
|
import { ApiDOMReferenceOptions } from '@speclynx/apidom-reference/configuration/empty';
|
|
2
3
|
import { ApiDOMStructuredError } from '@speclynx/apidom-error';
|
|
3
4
|
import { CriterionElement } from '@speclynx/apidom-ns-arazzo-1';
|
|
@@ -472,58 +473,62 @@ export declare interface ContextSource {
|
|
|
472
473
|
*/
|
|
473
474
|
export declare type CriterionContextResolver = (expression: string) => unknown;
|
|
474
475
|
|
|
475
|
-
/** @public */
|
|
476
|
-
export declare class CriterionError extends ArazzoRunnerError {
|
|
477
|
-
readonly condition?: string;
|
|
478
|
-
readonly type?: string;
|
|
479
|
-
readonly reason?: CriterionErrorReason;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
476
|
/**
|
|
483
|
-
*
|
|
477
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
484
478
|
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
* a condition that cannot be evaluated; they are thrown as a
|
|
489
|
-
* {@link CriterionEvaluationError}, which `CriterionEvaluator` turns into an
|
|
490
|
-
* unmet criterion.
|
|
479
|
+
* Every static on this class is a reason: {@link CriterionErrorReason} is
|
|
480
|
+
* derived from the class's own statics, so a non-reason static would join the
|
|
481
|
+
* union.
|
|
491
482
|
* @public
|
|
492
483
|
*/
|
|
493
|
-
export declare
|
|
484
|
+
export declare class CriterionError extends ArazzoRunnerError {
|
|
494
485
|
/** The element is not a Criterion Object. */
|
|
495
|
-
readonly InvalidCriterion: "invalid-criterion";
|
|
486
|
+
static readonly InvalidCriterion: "invalid-criterion";
|
|
496
487
|
/** The `condition` is missing or empty. */
|
|
497
|
-
readonly MissingCondition: "missing-condition";
|
|
488
|
+
static readonly MissingCondition: "missing-condition";
|
|
498
489
|
/** The `type` is present but unreadable. */
|
|
499
|
-
readonly InvalidType: "invalid-type";
|
|
490
|
+
static readonly InvalidType: "invalid-type";
|
|
500
491
|
/** The `type` names no known criterion type. */
|
|
501
|
-
readonly UnknownType: "unknown-type";
|
|
492
|
+
static readonly UnknownType: "unknown-type";
|
|
502
493
|
/** The expression type `version` is present but not a string. */
|
|
503
|
-
readonly InvalidVersion: "invalid-version";
|
|
494
|
+
static readonly InvalidVersion: "invalid-version";
|
|
504
495
|
/** The expression type `version` is not the one this runner supports. */
|
|
505
|
-
readonly UnsupportedVersion: "unsupported-version";
|
|
496
|
+
static readonly UnsupportedVersion: "unsupported-version";
|
|
506
497
|
/** The `context` is not a runtime expression. */
|
|
507
|
-
readonly InvalidContext: "invalid-context";
|
|
498
|
+
static readonly InvalidContext: "invalid-context";
|
|
508
499
|
/** A `regex`, `jsonpath` or `xpath` criterion has no `context`. */
|
|
509
|
-
readonly MissingContext: "missing-context";
|
|
500
|
+
static readonly MissingContext: "missing-context";
|
|
510
501
|
/** The `simple` condition cannot be parsed. */
|
|
511
|
-
readonly InvalidSimple: "invalid-simple";
|
|
502
|
+
static readonly InvalidSimple: "invalid-simple";
|
|
512
503
|
/** The `regex` condition is not a valid regular expression. */
|
|
513
|
-
readonly InvalidRegex: "invalid-regex";
|
|
504
|
+
static readonly InvalidRegex: "invalid-regex";
|
|
514
505
|
/** The `jsonpath` condition is not a valid JSONPath query. */
|
|
515
|
-
readonly InvalidJSONPath: "invalid-jsonpath";
|
|
506
|
+
static readonly InvalidJSONPath: "invalid-jsonpath";
|
|
516
507
|
/** The `xpath` condition is invalid or fails to evaluate. */
|
|
517
|
-
readonly InvalidXPath: "invalid-xpath";
|
|
508
|
+
static readonly InvalidXPath: "invalid-xpath";
|
|
518
509
|
/** The resolved `xpath` context is not XML. */
|
|
519
|
-
readonly InvalidXPathContext: "invalid-xpath-context";
|
|
520
|
-
|
|
510
|
+
static readonly InvalidXPathContext: "invalid-xpath-context";
|
|
511
|
+
readonly condition?: string;
|
|
512
|
+
readonly type?: string;
|
|
513
|
+
readonly reason?: CriterionErrorReason;
|
|
514
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
515
|
+
readonly reason?: CriterionErrorReason;
|
|
516
|
+
});
|
|
517
|
+
}
|
|
521
518
|
|
|
522
519
|
/**
|
|
523
|
-
* One of the `
|
|
520
|
+
* One of the reasons a {@link CriterionError} carries: a `CriterionError`
|
|
521
|
+
* static such as `CriterionError.InvalidRegex`.
|
|
522
|
+
*
|
|
523
|
+
* Structural reasons mark a criterion that is malformed as written; they are
|
|
524
|
+
* thrown as a plain `CriterionError`. Evaluation reasons (`InvalidSimple`,
|
|
525
|
+
* `InvalidRegex`, `InvalidJSONPath`, `InvalidXPath`, `InvalidXPathContext`) mark
|
|
526
|
+
* a condition that cannot be evaluated; they are thrown as a
|
|
527
|
+
* {@link CriterionEvaluationError}, which `CriterionEvaluator` turns into an
|
|
528
|
+
* unmet criterion.
|
|
524
529
|
* @public
|
|
525
530
|
*/
|
|
526
|
-
export declare type CriterionErrorReason = (typeof
|
|
531
|
+
export declare type CriterionErrorReason = (typeof CriterionError)[Exclude<keyof typeof CriterionError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
527
532
|
|
|
528
533
|
/**
|
|
529
534
|
* A criterion condition that cannot be evaluated: a syntax error in the
|
|
@@ -562,10 +567,10 @@ export declare interface CriterionEvaluationRecord {
|
|
|
562
567
|
readonly diagnostic?: {
|
|
563
568
|
/**
|
|
564
569
|
* Machine-readable: the `reason` of the error that failed the criterion, a
|
|
565
|
-
* `CriterionErrorReason`
|
|
566
|
-
* HTTP-exchange expression in a step that calls a workflow.
|
|
570
|
+
* `CriterionErrorReason` or `RuntimeExpressionError.UnavailableExpression`
|
|
571
|
+
* for an HTTP-exchange expression in a step that calls a workflow.
|
|
567
572
|
*/
|
|
568
|
-
readonly code?: CriterionErrorReason |
|
|
573
|
+
readonly code?: CriterionErrorReason | typeof RuntimeExpressionError.UnavailableExpression;
|
|
569
574
|
/**
|
|
570
575
|
* Human-readable: names the condition or expression and, for a syntax
|
|
571
576
|
* error, what is wrong with it; never request or response data.
|
|
@@ -763,18 +768,83 @@ export declare abstract class DocumentRegistryProvider {
|
|
|
763
768
|
*/
|
|
764
769
|
export declare type DocumentRegistryProviderOptions = PartialDeep<ApiDOMReferenceOptions>;
|
|
765
770
|
|
|
766
|
-
/**
|
|
771
|
+
/**
|
|
772
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
773
|
+
*
|
|
774
|
+
* Every static on this class is a reason: {@link ExecutionErrorReason} is
|
|
775
|
+
* derived from the class's own statics, so a non-reason static would join the
|
|
776
|
+
* union.
|
|
777
|
+
* @public
|
|
778
|
+
*/
|
|
767
779
|
export declare class ExecutionError extends ArazzoRunnerError {
|
|
780
|
+
/** The run was cancelled through its `AbortSignal`; the signal's reason is the `cause`. */
|
|
781
|
+
static readonly Aborted: "aborted";
|
|
782
|
+
/** A step or a `goto`/`retry` action declares more than one mutually exclusive target. */
|
|
783
|
+
static readonly AmbiguousTarget: "ambiguous-target";
|
|
784
|
+
/** The `dependsOn` edges alone form a cycle between workflows. */
|
|
785
|
+
static readonly DependsOnCycle: "dependsOn-cycle";
|
|
786
|
+
/** A `goto` action declares neither a `stepId` nor a `workflowId`. */
|
|
787
|
+
static readonly GotoTargetMissing: "goto-target-missing";
|
|
788
|
+
/** A `goto` action's `stepId` names no step in the workflow. */
|
|
789
|
+
static readonly GotoTargetNotFound: "goto-target-not-found";
|
|
790
|
+
/** An `operationId` or `operationPath` is not a valid operation reference. */
|
|
791
|
+
static readonly InvalidOperationReference: "invalid-operation-reference";
|
|
792
|
+
/** A `workflowId` is not a valid `$sourceDescriptions.{name}.{workflowId}` expression. */
|
|
793
|
+
static readonly InvalidWorkflowReference: "invalid-workflow-reference";
|
|
794
|
+
/** A workflow's `dependsOn` is not a list or holds a non-string entry. */
|
|
795
|
+
static readonly MalformedDependsOn: "malformed-dependsOn";
|
|
796
|
+
/** A workflow's `steps` is not a list or holds an entry that is not a Step Object. */
|
|
797
|
+
static readonly MalformedSteps: "malformed-steps";
|
|
798
|
+
/** A step run as an operation declares neither an `operationId` nor an `operationPath`. */
|
|
799
|
+
static readonly MissingOperation: "missing-operation";
|
|
800
|
+
/** An operation reference locates no operation in its OpenAPI source description. */
|
|
801
|
+
static readonly OperationNotFound: "operation-not-found";
|
|
802
|
+
/** A `retry` action references a step or workflow, but no run reference was given to run it. */
|
|
803
|
+
static readonly RetryReferenceUnsupported: "retry-reference-unsupported";
|
|
804
|
+
/** A `retry` action's `stepId` names no step in the workflow. */
|
|
805
|
+
static readonly RetryTargetNotFound: "retry-target-not-found";
|
|
806
|
+
/** A workflow reference names a source description that is not an Arazzo document. */
|
|
807
|
+
static readonly SourceDescriptionNotArazzo: "source-description-not-arazzo";
|
|
808
|
+
/** A reference names a source description the Arazzo document does not define. */
|
|
809
|
+
static readonly SourceDescriptionNotFound: "source-description-not-found";
|
|
810
|
+
/** An operation reference names a source description that is not an OpenAPI document. */
|
|
811
|
+
static readonly SourceDescriptionNotOpenAPI: "source-description-not-openapi";
|
|
812
|
+
/** A workflow exceeded its budget of step attempts. */
|
|
813
|
+
static readonly StepBudget: "step-budget";
|
|
814
|
+
/** An action declares a `type` other than `end`, `goto` or `retry`. */
|
|
815
|
+
static readonly UnknownActionType: "unknown-action-type";
|
|
816
|
+
/** `execute` received an option it does not know. */
|
|
817
|
+
static readonly UnknownExecuteOption: "unknown-execute-option";
|
|
818
|
+
/** A step produced a transition the workflow executor does not recognize. */
|
|
819
|
+
static readonly UnknownTransitionKind: "unknown-transition-kind";
|
|
820
|
+
/** A sub-workflow call (alone or together with `dependsOn`) forms a cycle between workflows. */
|
|
821
|
+
static readonly WorkflowCycle: "workflow-cycle";
|
|
822
|
+
/** Workflows nest deeper than the configured limit. */
|
|
823
|
+
static readonly WorkflowDepth: "workflow-depth";
|
|
824
|
+
/** A workflow reference names a workflow the Arazzo document does not define. */
|
|
825
|
+
static readonly WorkflowNotFound: "workflow-not-found";
|
|
826
|
+
/** A step that targets a workflow was handed to the step executor, which runs operations only. */
|
|
827
|
+
static readonly WorkflowStep: "workflow-step";
|
|
768
828
|
readonly stepId?: string;
|
|
769
829
|
readonly workflowId?: string;
|
|
770
|
-
readonly reason?:
|
|
830
|
+
readonly reason?: ExecutionErrorReason;
|
|
771
831
|
/**
|
|
772
832
|
* The chain of workflowIds the error concerns — the loop A → B → A for a
|
|
773
833
|
* cycle, or the call chain in progress when a budget ran out.
|
|
774
834
|
*/
|
|
775
835
|
readonly path?: readonly string[];
|
|
836
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
837
|
+
readonly reason?: ExecutionErrorReason;
|
|
838
|
+
});
|
|
776
839
|
}
|
|
777
840
|
|
|
841
|
+
/**
|
|
842
|
+
* One of the reasons an {@link ExecutionError} carries: an `ExecutionError`
|
|
843
|
+
* static such as `ExecutionError.OperationNotFound`.
|
|
844
|
+
* @public
|
|
845
|
+
*/
|
|
846
|
+
export declare type ExecutionErrorReason = (typeof ExecutionError)[Exclude<keyof typeof ExecutionError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
847
|
+
|
|
778
848
|
/** @public */
|
|
779
849
|
export declare class ExtractionError extends ArazzoRunnerError {
|
|
780
850
|
readonly workflowId?: string;
|
|
@@ -1533,7 +1603,7 @@ export declare class OutputResolver extends ArazzoValueResolver {
|
|
|
1533
1603
|
*
|
|
1534
1604
|
* `scope` names the step or workflow the outputs belong to, for a thrown
|
|
1535
1605
|
* {@link ResolverError}. An output value that is not a valid runtime
|
|
1536
|
-
* expression throws with
|
|
1606
|
+
* expression throws with reason `ResolverError.InvalidExpression`.
|
|
1537
1607
|
*/
|
|
1538
1608
|
resolve(outputs: StepOutputsElement | WorkflowOutputsElement | undefined, resolve: RuntimeExpressionResolver, scope: ResolverScope): Record<string, unknown>;
|
|
1539
1609
|
}
|
|
@@ -1629,14 +1699,65 @@ export declare interface ResolvedRequestBody {
|
|
|
1629
1699
|
readonly contentType?: string;
|
|
1630
1700
|
}
|
|
1631
1701
|
|
|
1632
|
-
/**
|
|
1702
|
+
/**
|
|
1703
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
1704
|
+
*
|
|
1705
|
+
* Every static on this class is a reason: {@link ResolverErrorReason} is
|
|
1706
|
+
* derived from the class's own statics, so a non-reason static would join the
|
|
1707
|
+
* union.
|
|
1708
|
+
* @public
|
|
1709
|
+
*/
|
|
1633
1710
|
export declare class ResolverError extends ArazzoRunnerError {
|
|
1711
|
+
/** A parameter cannot be delivered unambiguously at its location. */
|
|
1712
|
+
static readonly AmbiguousDelivery: "ambiguous-delivery";
|
|
1713
|
+
/** An output or a request body payload holds a value that is not a valid runtime expression. */
|
|
1714
|
+
static readonly InvalidExpression: "invalid-expression";
|
|
1715
|
+
/** A parameter's location (`in`) is not one of the known locations. */
|
|
1716
|
+
static readonly InvalidLocation: "invalid-location";
|
|
1717
|
+
/** An `onSuccess`/`onFailure` list holds an entry that is not a Success/Failure Action Object. */
|
|
1718
|
+
static readonly MalformedActionEntry: "malformed-action-entry";
|
|
1719
|
+
/** A step's `onSuccess` or `onFailure` is present but is not a list. */
|
|
1720
|
+
static readonly MalformedActions: "malformed-actions";
|
|
1721
|
+
/** A step's `successCriteria` or an action's `criteria` is present but is not a list. */
|
|
1722
|
+
static readonly MalformedCriteria: "malformed-criteria";
|
|
1723
|
+
/** A criteria list holds an entry that is not a Criterion Object. */
|
|
1724
|
+
static readonly MalformedCriterion: "malformed-criterion";
|
|
1725
|
+
/** A parameter's location (`in`) is not a string. */
|
|
1726
|
+
static readonly MalformedLocation: "malformed-location";
|
|
1727
|
+
/** A step's or workflow's `outputs` is present but is not a map. */
|
|
1728
|
+
static readonly MalformedOutputs: "malformed-outputs";
|
|
1729
|
+
/** `parameters` is present but is not a list. */
|
|
1730
|
+
static readonly MalformedParameters: "malformed-parameters";
|
|
1731
|
+
/** `requestBody.replacements` is present but is not a list. */
|
|
1732
|
+
static readonly MalformedReplacements: "malformed-replacements";
|
|
1733
|
+
/** `requestBody` is present but is not a map. */
|
|
1734
|
+
static readonly MalformedRequestBody: "malformed-request-body";
|
|
1735
|
+
/** A parameter of a step that targets an operation declares no location (`in`). */
|
|
1736
|
+
static readonly MissingLocation: "missing-location";
|
|
1737
|
+
/** A parameter has a missing or non-string `name`. */
|
|
1738
|
+
static readonly MissingName: "missing-name";
|
|
1739
|
+
/** A runtime expression in the request body did not resolve. */
|
|
1740
|
+
static readonly UnresolvedExpression: "unresolved-expression";
|
|
1741
|
+
/** A `requestBody` replacement target does not resolve in the payload. */
|
|
1742
|
+
static readonly UnresolvedTarget: "unresolved-target";
|
|
1743
|
+
/** A `requestBody` replacement target is not a JSON Pointer. */
|
|
1744
|
+
static readonly UnsupportedTarget: "unsupported-target";
|
|
1634
1745
|
readonly stepId?: string;
|
|
1635
1746
|
readonly workflowId?: string;
|
|
1636
1747
|
readonly target?: string;
|
|
1637
|
-
readonly reason?:
|
|
1748
|
+
readonly reason?: ResolverErrorReason;
|
|
1749
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
1750
|
+
readonly reason?: ResolverErrorReason;
|
|
1751
|
+
});
|
|
1638
1752
|
}
|
|
1639
1753
|
|
|
1754
|
+
/**
|
|
1755
|
+
* One of the reasons a {@link ResolverError} carries: a `ResolverError`
|
|
1756
|
+
* static such as `ResolverError.MalformedParameters`.
|
|
1757
|
+
* @public
|
|
1758
|
+
*/
|
|
1759
|
+
export declare type ResolverErrorReason = (typeof ResolverError)[Exclude<keyof typeof ResolverError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
1760
|
+
|
|
1640
1761
|
/**
|
|
1641
1762
|
* Identifies the step or workflow a resolver is resolving for. The wider
|
|
1642
1763
|
* union {@link OutputResolver} takes, since it resolves both a step's
|
|
@@ -1736,12 +1857,42 @@ export declare interface RuntimeExpressionContext {
|
|
|
1736
1857
|
readonly calledWorkflow?: RuntimeExpressionCalledWorkflowContext;
|
|
1737
1858
|
}
|
|
1738
1859
|
|
|
1739
|
-
/**
|
|
1860
|
+
/**
|
|
1861
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
1862
|
+
*
|
|
1863
|
+
* Every static on this class is a reason: {@link RuntimeExpressionErrorReason}
|
|
1864
|
+
* is derived from the class's own statics, so a non-reason static would join
|
|
1865
|
+
* the union.
|
|
1866
|
+
* @public
|
|
1867
|
+
*/
|
|
1740
1868
|
export declare class RuntimeExpressionError extends ArazzoRunnerError {
|
|
1869
|
+
/** The expression is not a valid runtime expression. */
|
|
1870
|
+
static readonly InvalidExpression: "invalid-expression";
|
|
1871
|
+
/** The runtime expression parser failed on the expression. */
|
|
1872
|
+
static readonly ParseError: "parse-error";
|
|
1873
|
+
/**
|
|
1874
|
+
* The expression reads HTTP data (`$statusCode`, `$url`, `$method`, `$request`,
|
|
1875
|
+
* `$response`) in a step that calls a workflow and so made no HTTP call.
|
|
1876
|
+
*/
|
|
1877
|
+
static readonly UnavailableExpression: "unavailable-expression";
|
|
1878
|
+
/** The expression could not be resolved against the evaluation context. */
|
|
1879
|
+
static readonly UnresolvedReference: "unresolved-reference";
|
|
1880
|
+
/** The parsed expression contains a node the evaluator does not support. */
|
|
1881
|
+
static readonly UnsupportedNode: "unsupported-node";
|
|
1741
1882
|
readonly expression?: string;
|
|
1742
|
-
readonly reason?:
|
|
1883
|
+
readonly reason?: RuntimeExpressionErrorReason;
|
|
1884
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
1885
|
+
readonly reason?: RuntimeExpressionErrorReason;
|
|
1886
|
+
});
|
|
1743
1887
|
}
|
|
1744
1888
|
|
|
1889
|
+
/**
|
|
1890
|
+
* One of the reasons a {@link RuntimeExpressionError} carries: a
|
|
1891
|
+
* `RuntimeExpressionError` static such as `RuntimeExpressionError.ParseError`.
|
|
1892
|
+
* @public
|
|
1893
|
+
*/
|
|
1894
|
+
export declare type RuntimeExpressionErrorReason = (typeof RuntimeExpressionError)[Exclude<keyof typeof RuntimeExpressionError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
1895
|
+
|
|
1745
1896
|
/**
|
|
1746
1897
|
* Evaluates Arazzo runtime expressions against a context.
|
|
1747
1898
|
*
|
|
@@ -2055,7 +2206,7 @@ export declare class StepExecutor {
|
|
|
2055
2206
|
* take precedence over it.
|
|
2056
2207
|
*
|
|
2057
2208
|
* A `signal` in that bag is honored here and not only at the transport: an
|
|
2058
|
-
* already-aborted signal throws
|
|
2209
|
+
* already-aborted signal throws with reason `ExecutionError.Aborted` instead of issuing a
|
|
2059
2210
|
* request nobody is waiting for, whose wire-level cancellation would surface
|
|
2060
2211
|
* as a transport {@link ClientError} — a request that failed on its own terms
|
|
2061
2212
|
* — rather than as the withdrawal it is.
|
|
@@ -2301,7 +2452,7 @@ export declare interface WorkflowExecuteOptions {
|
|
|
2301
2452
|
* `retryAfter` waits between attempts, so an aborted run stops at the next
|
|
2302
2453
|
* boundary rather than working its way to the end of the workflow.
|
|
2303
2454
|
*
|
|
2304
|
-
* An aborted run throws {@link ExecutionError} with
|
|
2455
|
+
* An aborted run throws {@link ExecutionError} with reason `ExecutionError.Aborted`,
|
|
2305
2456
|
* naming the boundary it stopped at and carrying the signal's own `reason` as
|
|
2306
2457
|
* the error's `cause`. It does not resolve as a `failed` result: cancellation
|
|
2307
2458
|
* is not something the steps did, and the steps that never ran were not
|
|
@@ -2549,9 +2700,9 @@ export declare interface WorkflowExecutorOptions {
|
|
|
2549
2700
|
readonly maxSteps?: number;
|
|
2550
2701
|
/**
|
|
2551
2702
|
* Upper bound on how deeply workflows may nest — a workflow entered while
|
|
2552
|
-
* this many are already in progress throws
|
|
2703
|
+
* this many are already in progress throws with reason `ExecutionError.WorkflowDepth`.
|
|
2553
2704
|
* Bounds *legitimate* (acyclic) nesting; a genuine cycle is caught earlier and
|
|
2554
|
-
* separately by
|
|
2705
|
+
* separately by reason `ExecutionError.WorkflowCycle`. Defaults to 32.
|
|
2555
2706
|
*
|
|
2556
2707
|
* The count includes the workflow `execute` was called with, so `1` permits
|
|
2557
2708
|
* that workflow and forbids all nesting; a value below 1 leaves no room for
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* The `reason` a {@link CriterionError} carries.
|
|
9
|
-
*
|
|
10
|
-
* Structural reasons mark a criterion that is malformed as written; they are
|
|
11
|
-
* thrown as a plain `CriterionError`. Evaluation reasons (`InvalidSimple`,
|
|
12
|
-
* `InvalidRegex`, `InvalidJSONPath`, `InvalidXPath`, `InvalidXPathContext`) mark
|
|
13
|
-
* a condition that cannot be evaluated; they are thrown as a
|
|
14
|
-
* {@link CriterionEvaluationError}, which `CriterionEvaluator` turns into an
|
|
15
|
-
* unmet criterion.
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
const CriterionErrorReason = {
|
|
19
|
-
/** The element is not a Criterion Object. */
|
|
20
|
-
InvalidCriterion: 'invalid-criterion',
|
|
21
|
-
/** The `condition` is missing or empty. */
|
|
22
|
-
MissingCondition: 'missing-condition',
|
|
23
|
-
/** The `type` is present but unreadable. */
|
|
24
|
-
InvalidType: 'invalid-type',
|
|
25
|
-
/** The `type` names no known criterion type. */
|
|
26
|
-
UnknownType: 'unknown-type',
|
|
27
|
-
/** The expression type `version` is present but not a string. */
|
|
28
|
-
InvalidVersion: 'invalid-version',
|
|
29
|
-
/** The expression type `version` is not the one this runner supports. */
|
|
30
|
-
UnsupportedVersion: 'unsupported-version',
|
|
31
|
-
/** The `context` is not a runtime expression. */
|
|
32
|
-
InvalidContext: 'invalid-context',
|
|
33
|
-
/** A `regex`, `jsonpath` or `xpath` criterion has no `context`. */
|
|
34
|
-
MissingContext: 'missing-context',
|
|
35
|
-
/** The `simple` condition cannot be parsed. */
|
|
36
|
-
InvalidSimple: 'invalid-simple',
|
|
37
|
-
/** The `regex` condition is not a valid regular expression. */
|
|
38
|
-
InvalidRegex: 'invalid-regex',
|
|
39
|
-
/** The `jsonpath` condition is not a valid JSONPath query. */
|
|
40
|
-
InvalidJSONPath: 'invalid-jsonpath',
|
|
41
|
-
/** The `xpath` condition is invalid or fails to evaluate. */
|
|
42
|
-
InvalidXPath: 'invalid-xpath',
|
|
43
|
-
/** The resolved `xpath` context is not XML. */
|
|
44
|
-
InvalidXPathContext: 'invalid-xpath-context'
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* One of the `CriterionErrorReason` values.
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
var _default = exports.default = CriterionErrorReason;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `reason` a {@link CriterionError} carries.
|
|
3
|
-
*
|
|
4
|
-
* Structural reasons mark a criterion that is malformed as written; they are
|
|
5
|
-
* thrown as a plain `CriterionError`. Evaluation reasons (`InvalidSimple`,
|
|
6
|
-
* `InvalidRegex`, `InvalidJSONPath`, `InvalidXPath`, `InvalidXPathContext`) mark
|
|
7
|
-
* a condition that cannot be evaluated; they are thrown as a
|
|
8
|
-
* {@link CriterionEvaluationError}, which `CriterionEvaluator` turns into an
|
|
9
|
-
* unmet criterion.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
const CriterionErrorReason = {
|
|
13
|
-
/** The element is not a Criterion Object. */
|
|
14
|
-
InvalidCriterion: 'invalid-criterion',
|
|
15
|
-
/** The `condition` is missing or empty. */
|
|
16
|
-
MissingCondition: 'missing-condition',
|
|
17
|
-
/** The `type` is present but unreadable. */
|
|
18
|
-
InvalidType: 'invalid-type',
|
|
19
|
-
/** The `type` names no known criterion type. */
|
|
20
|
-
UnknownType: 'unknown-type',
|
|
21
|
-
/** The expression type `version` is present but not a string. */
|
|
22
|
-
InvalidVersion: 'invalid-version',
|
|
23
|
-
/** The expression type `version` is not the one this runner supports. */
|
|
24
|
-
UnsupportedVersion: 'unsupported-version',
|
|
25
|
-
/** The `context` is not a runtime expression. */
|
|
26
|
-
InvalidContext: 'invalid-context',
|
|
27
|
-
/** A `regex`, `jsonpath` or `xpath` criterion has no `context`. */
|
|
28
|
-
MissingContext: 'missing-context',
|
|
29
|
-
/** The `simple` condition cannot be parsed. */
|
|
30
|
-
InvalidSimple: 'invalid-simple',
|
|
31
|
-
/** The `regex` condition is not a valid regular expression. */
|
|
32
|
-
InvalidRegex: 'invalid-regex',
|
|
33
|
-
/** The `jsonpath` condition is not a valid JSONPath query. */
|
|
34
|
-
InvalidJSONPath: 'invalid-jsonpath',
|
|
35
|
-
/** The `xpath` condition is invalid or fails to evaluate. */
|
|
36
|
-
InvalidXPath: 'invalid-xpath',
|
|
37
|
-
/** The resolved `xpath` context is not XML. */
|
|
38
|
-
InvalidXPathContext: 'invalid-xpath-context'
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* One of the `CriterionErrorReason` values.
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
export default CriterionErrorReason;
|