@usearazzo/runner 1.0.1-alpha.23 → 1.0.1-alpha.25
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 +20 -0
- package/README.md +3 -1
- package/dist/arazzo-runner.browser.js +400 -229
- 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/document/ArazzoDocument.cjs +33 -1
- package/src/document/ArazzoDocument.mjs +32 -1
- 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 +228 -46
- package/src/criterion/CriterionErrorReason.cjs +0 -51
- package/src/criterion/CriterionErrorReason.mjs +0 -46
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';
|
|
@@ -96,7 +97,7 @@ export declare abstract class APIDocument {
|
|
|
96
97
|
/**
|
|
97
98
|
* An Arazzo document held by the document registry: the parse result together
|
|
98
99
|
* with the indexes the provider built over it — a container, not a logic
|
|
99
|
-
* bearer. The methods below are thin reads of
|
|
100
|
+
* bearer. The methods below are thin reads of those indexes.
|
|
100
101
|
* @public
|
|
101
102
|
*/
|
|
102
103
|
export declare class ArazzoDocument extends APIDocument {
|
|
@@ -122,6 +123,12 @@ export declare class ArazzoDocument extends APIDocument {
|
|
|
122
123
|
* Type guard for ArazzoDocument.
|
|
123
124
|
*/
|
|
124
125
|
static is(doc: APIDocument): doc is ArazzoDocument;
|
|
126
|
+
/**
|
|
127
|
+
* The workflows of this document that can be addressed by `workflowId`, in
|
|
128
|
+
* document order. Reads this document only: source descriptions are neither
|
|
129
|
+
* loaded nor listed.
|
|
130
|
+
*/
|
|
131
|
+
listWorkflows(): WorkflowDescriptor[];
|
|
125
132
|
/**
|
|
126
133
|
* Resolves a source description name to its canonical URI — precomputed by
|
|
127
134
|
* the provider, resolved against this document's base URI.
|
|
@@ -472,58 +479,62 @@ export declare interface ContextSource {
|
|
|
472
479
|
*/
|
|
473
480
|
export declare type CriterionContextResolver = (expression: string) => unknown;
|
|
474
481
|
|
|
475
|
-
/** @public */
|
|
476
|
-
export declare class CriterionError extends ArazzoRunnerError {
|
|
477
|
-
readonly condition?: string;
|
|
478
|
-
readonly type?: string;
|
|
479
|
-
readonly reason?: CriterionErrorReason;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
482
|
/**
|
|
483
|
-
*
|
|
483
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
484
484
|
*
|
|
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.
|
|
485
|
+
* Every static on this class is a reason: {@link CriterionErrorReason} is
|
|
486
|
+
* derived from the class's own statics, so a non-reason static would join the
|
|
487
|
+
* union.
|
|
491
488
|
* @public
|
|
492
489
|
*/
|
|
493
|
-
export declare
|
|
490
|
+
export declare class CriterionError extends ArazzoRunnerError {
|
|
494
491
|
/** The element is not a Criterion Object. */
|
|
495
|
-
readonly InvalidCriterion: "invalid-criterion";
|
|
492
|
+
static readonly InvalidCriterion: "invalid-criterion";
|
|
496
493
|
/** The `condition` is missing or empty. */
|
|
497
|
-
readonly MissingCondition: "missing-condition";
|
|
494
|
+
static readonly MissingCondition: "missing-condition";
|
|
498
495
|
/** The `type` is present but unreadable. */
|
|
499
|
-
readonly InvalidType: "invalid-type";
|
|
496
|
+
static readonly InvalidType: "invalid-type";
|
|
500
497
|
/** The `type` names no known criterion type. */
|
|
501
|
-
readonly UnknownType: "unknown-type";
|
|
498
|
+
static readonly UnknownType: "unknown-type";
|
|
502
499
|
/** The expression type `version` is present but not a string. */
|
|
503
|
-
readonly InvalidVersion: "invalid-version";
|
|
500
|
+
static readonly InvalidVersion: "invalid-version";
|
|
504
501
|
/** The expression type `version` is not the one this runner supports. */
|
|
505
|
-
readonly UnsupportedVersion: "unsupported-version";
|
|
502
|
+
static readonly UnsupportedVersion: "unsupported-version";
|
|
506
503
|
/** The `context` is not a runtime expression. */
|
|
507
|
-
readonly InvalidContext: "invalid-context";
|
|
504
|
+
static readonly InvalidContext: "invalid-context";
|
|
508
505
|
/** A `regex`, `jsonpath` or `xpath` criterion has no `context`. */
|
|
509
|
-
readonly MissingContext: "missing-context";
|
|
506
|
+
static readonly MissingContext: "missing-context";
|
|
510
507
|
/** The `simple` condition cannot be parsed. */
|
|
511
|
-
readonly InvalidSimple: "invalid-simple";
|
|
508
|
+
static readonly InvalidSimple: "invalid-simple";
|
|
512
509
|
/** The `regex` condition is not a valid regular expression. */
|
|
513
|
-
readonly InvalidRegex: "invalid-regex";
|
|
510
|
+
static readonly InvalidRegex: "invalid-regex";
|
|
514
511
|
/** The `jsonpath` condition is not a valid JSONPath query. */
|
|
515
|
-
readonly InvalidJSONPath: "invalid-jsonpath";
|
|
512
|
+
static readonly InvalidJSONPath: "invalid-jsonpath";
|
|
516
513
|
/** The `xpath` condition is invalid or fails to evaluate. */
|
|
517
|
-
readonly InvalidXPath: "invalid-xpath";
|
|
514
|
+
static readonly InvalidXPath: "invalid-xpath";
|
|
518
515
|
/** The resolved `xpath` context is not XML. */
|
|
519
|
-
readonly InvalidXPathContext: "invalid-xpath-context";
|
|
520
|
-
|
|
516
|
+
static readonly InvalidXPathContext: "invalid-xpath-context";
|
|
517
|
+
readonly condition?: string;
|
|
518
|
+
readonly type?: string;
|
|
519
|
+
readonly reason?: CriterionErrorReason;
|
|
520
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
521
|
+
readonly reason?: CriterionErrorReason;
|
|
522
|
+
});
|
|
523
|
+
}
|
|
521
524
|
|
|
522
525
|
/**
|
|
523
|
-
* One of the `
|
|
526
|
+
* One of the reasons a {@link CriterionError} carries: a `CriterionError`
|
|
527
|
+
* static such as `CriterionError.InvalidRegex`.
|
|
528
|
+
*
|
|
529
|
+
* Structural reasons mark a criterion that is malformed as written; they are
|
|
530
|
+
* thrown as a plain `CriterionError`. Evaluation reasons (`InvalidSimple`,
|
|
531
|
+
* `InvalidRegex`, `InvalidJSONPath`, `InvalidXPath`, `InvalidXPathContext`) mark
|
|
532
|
+
* a condition that cannot be evaluated; they are thrown as a
|
|
533
|
+
* {@link CriterionEvaluationError}, which `CriterionEvaluator` turns into an
|
|
534
|
+
* unmet criterion.
|
|
524
535
|
* @public
|
|
525
536
|
*/
|
|
526
|
-
export declare type CriterionErrorReason = (typeof
|
|
537
|
+
export declare type CriterionErrorReason = (typeof CriterionError)[Exclude<keyof typeof CriterionError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
527
538
|
|
|
528
539
|
/**
|
|
529
540
|
* A criterion condition that cannot be evaluated: a syntax error in the
|
|
@@ -562,10 +573,10 @@ export declare interface CriterionEvaluationRecord {
|
|
|
562
573
|
readonly diagnostic?: {
|
|
563
574
|
/**
|
|
564
575
|
* 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.
|
|
576
|
+
* `CriterionErrorReason` or `RuntimeExpressionError.UnavailableExpression`
|
|
577
|
+
* for an HTTP-exchange expression in a step that calls a workflow.
|
|
567
578
|
*/
|
|
568
|
-
readonly code?: CriterionErrorReason |
|
|
579
|
+
readonly code?: CriterionErrorReason | typeof RuntimeExpressionError.UnavailableExpression;
|
|
569
580
|
/**
|
|
570
581
|
* Human-readable: names the condition or expression and, for a syntax
|
|
571
582
|
* error, what is wrong with it; never request or response data.
|
|
@@ -763,18 +774,83 @@ export declare abstract class DocumentRegistryProvider {
|
|
|
763
774
|
*/
|
|
764
775
|
export declare type DocumentRegistryProviderOptions = PartialDeep<ApiDOMReferenceOptions>;
|
|
765
776
|
|
|
766
|
-
/**
|
|
777
|
+
/**
|
|
778
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
779
|
+
*
|
|
780
|
+
* Every static on this class is a reason: {@link ExecutionErrorReason} is
|
|
781
|
+
* derived from the class's own statics, so a non-reason static would join the
|
|
782
|
+
* union.
|
|
783
|
+
* @public
|
|
784
|
+
*/
|
|
767
785
|
export declare class ExecutionError extends ArazzoRunnerError {
|
|
786
|
+
/** The run was cancelled through its `AbortSignal`; the signal's reason is the `cause`. */
|
|
787
|
+
static readonly Aborted: "aborted";
|
|
788
|
+
/** A step or a `goto`/`retry` action declares more than one mutually exclusive target. */
|
|
789
|
+
static readonly AmbiguousTarget: "ambiguous-target";
|
|
790
|
+
/** The `dependsOn` edges alone form a cycle between workflows. */
|
|
791
|
+
static readonly DependsOnCycle: "dependsOn-cycle";
|
|
792
|
+
/** A `goto` action declares neither a `stepId` nor a `workflowId`. */
|
|
793
|
+
static readonly GotoTargetMissing: "goto-target-missing";
|
|
794
|
+
/** A `goto` action's `stepId` names no step in the workflow. */
|
|
795
|
+
static readonly GotoTargetNotFound: "goto-target-not-found";
|
|
796
|
+
/** An `operationId` or `operationPath` is not a valid operation reference. */
|
|
797
|
+
static readonly InvalidOperationReference: "invalid-operation-reference";
|
|
798
|
+
/** A `workflowId` is not a valid `$sourceDescriptions.{name}.{workflowId}` expression. */
|
|
799
|
+
static readonly InvalidWorkflowReference: "invalid-workflow-reference";
|
|
800
|
+
/** A workflow's `dependsOn` is not a list or holds a non-string entry. */
|
|
801
|
+
static readonly MalformedDependsOn: "malformed-dependsOn";
|
|
802
|
+
/** A workflow's `steps` is not a list or holds an entry that is not a Step Object. */
|
|
803
|
+
static readonly MalformedSteps: "malformed-steps";
|
|
804
|
+
/** A step run as an operation declares neither an `operationId` nor an `operationPath`. */
|
|
805
|
+
static readonly MissingOperation: "missing-operation";
|
|
806
|
+
/** An operation reference locates no operation in its OpenAPI source description. */
|
|
807
|
+
static readonly OperationNotFound: "operation-not-found";
|
|
808
|
+
/** A `retry` action references a step or workflow, but no run reference was given to run it. */
|
|
809
|
+
static readonly RetryReferenceUnsupported: "retry-reference-unsupported";
|
|
810
|
+
/** A `retry` action's `stepId` names no step in the workflow. */
|
|
811
|
+
static readonly RetryTargetNotFound: "retry-target-not-found";
|
|
812
|
+
/** A workflow reference names a source description that is not an Arazzo document. */
|
|
813
|
+
static readonly SourceDescriptionNotArazzo: "source-description-not-arazzo";
|
|
814
|
+
/** A reference names a source description the Arazzo document does not define. */
|
|
815
|
+
static readonly SourceDescriptionNotFound: "source-description-not-found";
|
|
816
|
+
/** An operation reference names a source description that is not an OpenAPI document. */
|
|
817
|
+
static readonly SourceDescriptionNotOpenAPI: "source-description-not-openapi";
|
|
818
|
+
/** A workflow exceeded its budget of step attempts. */
|
|
819
|
+
static readonly StepBudget: "step-budget";
|
|
820
|
+
/** An action declares a `type` other than `end`, `goto` or `retry`. */
|
|
821
|
+
static readonly UnknownActionType: "unknown-action-type";
|
|
822
|
+
/** `execute` received an option it does not know. */
|
|
823
|
+
static readonly UnknownExecuteOption: "unknown-execute-option";
|
|
824
|
+
/** A step produced a transition the workflow executor does not recognize. */
|
|
825
|
+
static readonly UnknownTransitionKind: "unknown-transition-kind";
|
|
826
|
+
/** A sub-workflow call (alone or together with `dependsOn`) forms a cycle between workflows. */
|
|
827
|
+
static readonly WorkflowCycle: "workflow-cycle";
|
|
828
|
+
/** Workflows nest deeper than the configured limit. */
|
|
829
|
+
static readonly WorkflowDepth: "workflow-depth";
|
|
830
|
+
/** A workflow reference names a workflow the Arazzo document does not define. */
|
|
831
|
+
static readonly WorkflowNotFound: "workflow-not-found";
|
|
832
|
+
/** A step that targets a workflow was handed to the step executor, which runs operations only. */
|
|
833
|
+
static readonly WorkflowStep: "workflow-step";
|
|
768
834
|
readonly stepId?: string;
|
|
769
835
|
readonly workflowId?: string;
|
|
770
|
-
readonly reason?:
|
|
836
|
+
readonly reason?: ExecutionErrorReason;
|
|
771
837
|
/**
|
|
772
838
|
* The chain of workflowIds the error concerns — the loop A → B → A for a
|
|
773
839
|
* cycle, or the call chain in progress when a budget ran out.
|
|
774
840
|
*/
|
|
775
841
|
readonly path?: readonly string[];
|
|
842
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
843
|
+
readonly reason?: ExecutionErrorReason;
|
|
844
|
+
});
|
|
776
845
|
}
|
|
777
846
|
|
|
847
|
+
/**
|
|
848
|
+
* One of the reasons an {@link ExecutionError} carries: an `ExecutionError`
|
|
849
|
+
* static such as `ExecutionError.OperationNotFound`.
|
|
850
|
+
* @public
|
|
851
|
+
*/
|
|
852
|
+
export declare type ExecutionErrorReason = (typeof ExecutionError)[Exclude<keyof typeof ExecutionError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
853
|
+
|
|
778
854
|
/** @public */
|
|
779
855
|
export declare class ExtractionError extends ArazzoRunnerError {
|
|
780
856
|
readonly workflowId?: string;
|
|
@@ -1533,7 +1609,7 @@ export declare class OutputResolver extends ArazzoValueResolver {
|
|
|
1533
1609
|
*
|
|
1534
1610
|
* `scope` names the step or workflow the outputs belong to, for a thrown
|
|
1535
1611
|
* {@link ResolverError}. An output value that is not a valid runtime
|
|
1536
|
-
* expression throws with
|
|
1612
|
+
* expression throws with reason `ResolverError.InvalidExpression`.
|
|
1537
1613
|
*/
|
|
1538
1614
|
resolve(outputs: StepOutputsElement | WorkflowOutputsElement | undefined, resolve: RuntimeExpressionResolver, scope: ResolverScope): Record<string, unknown>;
|
|
1539
1615
|
}
|
|
@@ -1629,14 +1705,65 @@ export declare interface ResolvedRequestBody {
|
|
|
1629
1705
|
readonly contentType?: string;
|
|
1630
1706
|
}
|
|
1631
1707
|
|
|
1632
|
-
/**
|
|
1708
|
+
/**
|
|
1709
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
1710
|
+
*
|
|
1711
|
+
* Every static on this class is a reason: {@link ResolverErrorReason} is
|
|
1712
|
+
* derived from the class's own statics, so a non-reason static would join the
|
|
1713
|
+
* union.
|
|
1714
|
+
* @public
|
|
1715
|
+
*/
|
|
1633
1716
|
export declare class ResolverError extends ArazzoRunnerError {
|
|
1717
|
+
/** A parameter cannot be delivered unambiguously at its location. */
|
|
1718
|
+
static readonly AmbiguousDelivery: "ambiguous-delivery";
|
|
1719
|
+
/** An output or a request body payload holds a value that is not a valid runtime expression. */
|
|
1720
|
+
static readonly InvalidExpression: "invalid-expression";
|
|
1721
|
+
/** A parameter's location (`in`) is not one of the known locations. */
|
|
1722
|
+
static readonly InvalidLocation: "invalid-location";
|
|
1723
|
+
/** An `onSuccess`/`onFailure` list holds an entry that is not a Success/Failure Action Object. */
|
|
1724
|
+
static readonly MalformedActionEntry: "malformed-action-entry";
|
|
1725
|
+
/** A step's `onSuccess` or `onFailure` is present but is not a list. */
|
|
1726
|
+
static readonly MalformedActions: "malformed-actions";
|
|
1727
|
+
/** A step's `successCriteria` or an action's `criteria` is present but is not a list. */
|
|
1728
|
+
static readonly MalformedCriteria: "malformed-criteria";
|
|
1729
|
+
/** A criteria list holds an entry that is not a Criterion Object. */
|
|
1730
|
+
static readonly MalformedCriterion: "malformed-criterion";
|
|
1731
|
+
/** A parameter's location (`in`) is not a string. */
|
|
1732
|
+
static readonly MalformedLocation: "malformed-location";
|
|
1733
|
+
/** A step's or workflow's `outputs` is present but is not a map. */
|
|
1734
|
+
static readonly MalformedOutputs: "malformed-outputs";
|
|
1735
|
+
/** `parameters` is present but is not a list. */
|
|
1736
|
+
static readonly MalformedParameters: "malformed-parameters";
|
|
1737
|
+
/** `requestBody.replacements` is present but is not a list. */
|
|
1738
|
+
static readonly MalformedReplacements: "malformed-replacements";
|
|
1739
|
+
/** `requestBody` is present but is not a map. */
|
|
1740
|
+
static readonly MalformedRequestBody: "malformed-request-body";
|
|
1741
|
+
/** A parameter of a step that targets an operation declares no location (`in`). */
|
|
1742
|
+
static readonly MissingLocation: "missing-location";
|
|
1743
|
+
/** A parameter has a missing or non-string `name`. */
|
|
1744
|
+
static readonly MissingName: "missing-name";
|
|
1745
|
+
/** A runtime expression in the request body did not resolve. */
|
|
1746
|
+
static readonly UnresolvedExpression: "unresolved-expression";
|
|
1747
|
+
/** A `requestBody` replacement target does not resolve in the payload. */
|
|
1748
|
+
static readonly UnresolvedTarget: "unresolved-target";
|
|
1749
|
+
/** A `requestBody` replacement target is not a JSON Pointer. */
|
|
1750
|
+
static readonly UnsupportedTarget: "unsupported-target";
|
|
1634
1751
|
readonly stepId?: string;
|
|
1635
1752
|
readonly workflowId?: string;
|
|
1636
1753
|
readonly target?: string;
|
|
1637
|
-
readonly reason?:
|
|
1754
|
+
readonly reason?: ResolverErrorReason;
|
|
1755
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
1756
|
+
readonly reason?: ResolverErrorReason;
|
|
1757
|
+
});
|
|
1638
1758
|
}
|
|
1639
1759
|
|
|
1760
|
+
/**
|
|
1761
|
+
* One of the reasons a {@link ResolverError} carries: a `ResolverError`
|
|
1762
|
+
* static such as `ResolverError.MalformedParameters`.
|
|
1763
|
+
* @public
|
|
1764
|
+
*/
|
|
1765
|
+
export declare type ResolverErrorReason = (typeof ResolverError)[Exclude<keyof typeof ResolverError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
1766
|
+
|
|
1640
1767
|
/**
|
|
1641
1768
|
* Identifies the step or workflow a resolver is resolving for. The wider
|
|
1642
1769
|
* union {@link OutputResolver} takes, since it resolves both a step's
|
|
@@ -1736,12 +1863,42 @@ export declare interface RuntimeExpressionContext {
|
|
|
1736
1863
|
readonly calledWorkflow?: RuntimeExpressionCalledWorkflowContext;
|
|
1737
1864
|
}
|
|
1738
1865
|
|
|
1739
|
-
/**
|
|
1866
|
+
/**
|
|
1867
|
+
* Carries a `reason`, one of the class's static reason fields.
|
|
1868
|
+
*
|
|
1869
|
+
* Every static on this class is a reason: {@link RuntimeExpressionErrorReason}
|
|
1870
|
+
* is derived from the class's own statics, so a non-reason static would join
|
|
1871
|
+
* the union.
|
|
1872
|
+
* @public
|
|
1873
|
+
*/
|
|
1740
1874
|
export declare class RuntimeExpressionError extends ArazzoRunnerError {
|
|
1875
|
+
/** The expression is not a valid runtime expression. */
|
|
1876
|
+
static readonly InvalidExpression: "invalid-expression";
|
|
1877
|
+
/** The runtime expression parser failed on the expression. */
|
|
1878
|
+
static readonly ParseError: "parse-error";
|
|
1879
|
+
/**
|
|
1880
|
+
* The expression reads HTTP data (`$statusCode`, `$url`, `$method`, `$request`,
|
|
1881
|
+
* `$response`) in a step that calls a workflow and so made no HTTP call.
|
|
1882
|
+
*/
|
|
1883
|
+
static readonly UnavailableExpression: "unavailable-expression";
|
|
1884
|
+
/** The expression could not be resolved against the evaluation context. */
|
|
1885
|
+
static readonly UnresolvedReference: "unresolved-reference";
|
|
1886
|
+
/** The parsed expression contains a node the evaluator does not support. */
|
|
1887
|
+
static readonly UnsupportedNode: "unsupported-node";
|
|
1741
1888
|
readonly expression?: string;
|
|
1742
|
-
readonly reason?:
|
|
1889
|
+
readonly reason?: RuntimeExpressionErrorReason;
|
|
1890
|
+
constructor(message?: string, options?: ApiDOMErrorOptions & {
|
|
1891
|
+
readonly reason?: RuntimeExpressionErrorReason;
|
|
1892
|
+
});
|
|
1743
1893
|
}
|
|
1744
1894
|
|
|
1895
|
+
/**
|
|
1896
|
+
* One of the reasons a {@link RuntimeExpressionError} carries: a
|
|
1897
|
+
* `RuntimeExpressionError` static such as `RuntimeExpressionError.ParseError`.
|
|
1898
|
+
* @public
|
|
1899
|
+
*/
|
|
1900
|
+
export declare type RuntimeExpressionErrorReason = (typeof RuntimeExpressionError)[Exclude<keyof typeof RuntimeExpressionError, keyof typeof ArazzoRunnerError | 'prototype'>];
|
|
1901
|
+
|
|
1745
1902
|
/**
|
|
1746
1903
|
* Evaluates Arazzo runtime expressions against a context.
|
|
1747
1904
|
*
|
|
@@ -2055,7 +2212,7 @@ export declare class StepExecutor {
|
|
|
2055
2212
|
* take precedence over it.
|
|
2056
2213
|
*
|
|
2057
2214
|
* A `signal` in that bag is honored here and not only at the transport: an
|
|
2058
|
-
* already-aborted signal throws
|
|
2215
|
+
* already-aborted signal throws with reason `ExecutionError.Aborted` instead of issuing a
|
|
2059
2216
|
* request nobody is waiting for, whose wire-level cancellation would surface
|
|
2060
2217
|
* as a transport {@link ClientError} — a request that failed on its own terms
|
|
2061
2218
|
* — rather than as the withdrawal it is.
|
|
@@ -2251,6 +2408,31 @@ export declare class UnmatchedProviderError extends ArazzoRunnerError {
|
|
|
2251
2408
|
readonly uri?: string;
|
|
2252
2409
|
}
|
|
2253
2410
|
|
|
2411
|
+
/**
|
|
2412
|
+
* A workflow of an Arazzo document, as listed by
|
|
2413
|
+
* {@link ArazzoDocument.listWorkflows}.
|
|
2414
|
+
* @public
|
|
2415
|
+
*/
|
|
2416
|
+
export declare interface WorkflowDescriptor {
|
|
2417
|
+
/**
|
|
2418
|
+
* The id `ArazzoRunner.execute` takes to run the workflow.
|
|
2419
|
+
*/
|
|
2420
|
+
workflowId: WorkflowId;
|
|
2421
|
+
/**
|
|
2422
|
+
* JSON Pointer to the workflow within the document.
|
|
2423
|
+
*/
|
|
2424
|
+
jsonPointer: JSONPointer;
|
|
2425
|
+
/**
|
|
2426
|
+
* Present only when the workflow has a string `summary`.
|
|
2427
|
+
*/
|
|
2428
|
+
summary?: string;
|
|
2429
|
+
/**
|
|
2430
|
+
* Present only when the workflow has a string `description`, as written
|
|
2431
|
+
* (CommonMark).
|
|
2432
|
+
*/
|
|
2433
|
+
description?: string;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2254
2436
|
/**
|
|
2255
2437
|
* Per-call options for {@link WorkflowExecutor.execute}.
|
|
2256
2438
|
* @public
|
|
@@ -2301,7 +2483,7 @@ export declare interface WorkflowExecuteOptions {
|
|
|
2301
2483
|
* `retryAfter` waits between attempts, so an aborted run stops at the next
|
|
2302
2484
|
* boundary rather than working its way to the end of the workflow.
|
|
2303
2485
|
*
|
|
2304
|
-
* An aborted run throws {@link ExecutionError} with
|
|
2486
|
+
* An aborted run throws {@link ExecutionError} with reason `ExecutionError.Aborted`,
|
|
2305
2487
|
* naming the boundary it stopped at and carrying the signal's own `reason` as
|
|
2306
2488
|
* the error's `cause`. It does not resolve as a `failed` result: cancellation
|
|
2307
2489
|
* is not something the steps did, and the steps that never ran were not
|
|
@@ -2549,9 +2731,9 @@ export declare interface WorkflowExecutorOptions {
|
|
|
2549
2731
|
readonly maxSteps?: number;
|
|
2550
2732
|
/**
|
|
2551
2733
|
* Upper bound on how deeply workflows may nest — a workflow entered while
|
|
2552
|
-
* this many are already in progress throws
|
|
2734
|
+
* this many are already in progress throws with reason `ExecutionError.WorkflowDepth`.
|
|
2553
2735
|
* Bounds *legitimate* (acyclic) nesting; a genuine cycle is caught earlier and
|
|
2554
|
-
* separately by
|
|
2736
|
+
* separately by reason `ExecutionError.WorkflowCycle`. Defaults to 32.
|
|
2555
2737
|
*
|
|
2556
2738
|
* The count includes the workflow `execute` was called with, so `1` permits
|
|
2557
2739
|
* 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;
|