@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.
Files changed (58) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +3 -1
  3. package/dist/arazzo-runner.browser.js +400 -229
  4. package/dist/arazzo-runner.browser.min.js +1 -1
  5. package/package.json +4 -4
  6. package/src/action/ActionResolver.cjs +4 -4
  7. package/src/action/ActionResolver.mjs +4 -4
  8. package/src/criterion/CriterionEvaluator.cjs +8 -9
  9. package/src/criterion/CriterionEvaluator.mjs +8 -9
  10. package/src/criterion/JSONPathCriterionEvaluator.cjs +1 -2
  11. package/src/criterion/JSONPathCriterionEvaluator.mjs +1 -2
  12. package/src/criterion/RegexCriterionEvaluator.cjs +1 -2
  13. package/src/criterion/RegexCriterionEvaluator.mjs +1 -2
  14. package/src/criterion/SimpleCriterionEvaluator.cjs +1 -2
  15. package/src/criterion/SimpleCriterionEvaluator.mjs +1 -2
  16. package/src/criterion/XPathCriterionEvaluator.cjs +4 -5
  17. package/src/criterion/XPathCriterionEvaluator.mjs +4 -5
  18. package/src/document/ArazzoDocument.cjs +33 -1
  19. package/src/document/ArazzoDocument.mjs +32 -1
  20. package/src/errors/CriterionError.cjs +52 -2
  21. package/src/errors/CriterionError.mjs +53 -2
  22. package/src/errors/ExecutionError.cjs +73 -2
  23. package/src/errors/ExecutionError.mjs +74 -2
  24. package/src/errors/ResolverError.cjs +53 -2
  25. package/src/errors/ResolverError.mjs +54 -2
  26. package/src/errors/RuntimeExpressionError.cjs +32 -2
  27. package/src/errors/RuntimeExpressionError.mjs +33 -2
  28. package/src/executor/ArazzoWorkflowLocatorNormalizer.cjs +4 -4
  29. package/src/executor/ArazzoWorkflowLocatorNormalizer.mjs +4 -4
  30. package/src/executor/OpenAPIOperationLocatorNormalizer.cjs +11 -11
  31. package/src/executor/OpenAPIOperationLocatorNormalizer.mjs +11 -11
  32. package/src/executor/StepExecutor.cjs +7 -7
  33. package/src/executor/StepExecutor.mjs +7 -7
  34. package/src/executor/StepRetryRunner.cjs +1 -1
  35. package/src/executor/StepRetryRunner.mjs +1 -1
  36. package/src/executor/StepTransitionInterpreter.cjs +3 -3
  37. package/src/executor/StepTransitionInterpreter.mjs +3 -3
  38. package/src/executor/WorkflowCallStack.cjs +2 -2
  39. package/src/executor/WorkflowCallStack.mjs +2 -2
  40. package/src/executor/WorkflowExecutor.cjs +13 -13
  41. package/src/executor/WorkflowExecutor.mjs +13 -13
  42. package/src/executor/abort.cjs +3 -3
  43. package/src/executor/abort.mjs +3 -3
  44. package/src/expression/RuntimeExpressionEvaluator.cjs +5 -5
  45. package/src/expression/RuntimeExpressionEvaluator.mjs +5 -5
  46. package/src/index.cjs +0 -7
  47. package/src/index.mjs +0 -1
  48. package/src/resolver/OpenAPIOperationParameterResolver.cjs +6 -6
  49. package/src/resolver/OpenAPIOperationParameterResolver.mjs +6 -6
  50. package/src/resolver/OutputResolver.cjs +3 -3
  51. package/src/resolver/OutputResolver.mjs +3 -3
  52. package/src/resolver/RequestBodyResolver.cjs +6 -6
  53. package/src/resolver/RequestBodyResolver.mjs +6 -6
  54. package/src/resolver/WorkflowParameterResolver.cjs +1 -1
  55. package/src/resolver/WorkflowParameterResolver.mjs +1 -1
  56. package/types/runner.d.ts +228 -46
  57. package/src/criterion/CriterionErrorReason.cjs +0 -51
  58. package/src/criterion/CriterionErrorReason.mjs +0 -46
@@ -6,6 +6,77 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _ArazzoRunnerError = _interopRequireDefault(require("./ArazzoRunnerError.cjs"));
9
- /** @public */
10
- class ExecutionError extends _ArazzoRunnerError.default {}
9
+ /**
10
+ * Carries a `reason`, one of the class's static reason fields.
11
+ *
12
+ * Every static on this class is a reason: {@link ExecutionErrorReason} is
13
+ * derived from the class's own statics, so a non-reason static would join the
14
+ * union.
15
+ * @public
16
+ */
17
+ class ExecutionError extends _ArazzoRunnerError.default {
18
+ /** The run was cancelled through its `AbortSignal`; the signal's reason is the `cause`. */
19
+ static Aborted = 'aborted';
20
+ /** A step or a `goto`/`retry` action declares more than one mutually exclusive target. */
21
+ static AmbiguousTarget = 'ambiguous-target';
22
+ /** The `dependsOn` edges alone form a cycle between workflows. */
23
+ static DependsOnCycle = 'dependsOn-cycle';
24
+ /** A `goto` action declares neither a `stepId` nor a `workflowId`. */
25
+ static GotoTargetMissing = 'goto-target-missing';
26
+ /** A `goto` action's `stepId` names no step in the workflow. */
27
+ static GotoTargetNotFound = 'goto-target-not-found';
28
+ /** An `operationId` or `operationPath` is not a valid operation reference. */
29
+ static InvalidOperationReference = 'invalid-operation-reference';
30
+ /** A `workflowId` is not a valid `$sourceDescriptions.{name}.{workflowId}` expression. */
31
+ static InvalidWorkflowReference = 'invalid-workflow-reference';
32
+ /** A workflow's `dependsOn` is not a list or holds a non-string entry. */
33
+ static MalformedDependsOn = 'malformed-dependsOn';
34
+ /** A workflow's `steps` is not a list or holds an entry that is not a Step Object. */
35
+ static MalformedSteps = 'malformed-steps';
36
+ /** A step run as an operation declares neither an `operationId` nor an `operationPath`. */
37
+ static MissingOperation = 'missing-operation';
38
+ /** An operation reference locates no operation in its OpenAPI source description. */
39
+ static OperationNotFound = 'operation-not-found';
40
+ /** A `retry` action references a step or workflow, but no run reference was given to run it. */
41
+ static RetryReferenceUnsupported = 'retry-reference-unsupported';
42
+ /** A `retry` action's `stepId` names no step in the workflow. */
43
+ static RetryTargetNotFound = 'retry-target-not-found';
44
+ /** A workflow reference names a source description that is not an Arazzo document. */
45
+ static SourceDescriptionNotArazzo = 'source-description-not-arazzo';
46
+ /** A reference names a source description the Arazzo document does not define. */
47
+ static SourceDescriptionNotFound = 'source-description-not-found';
48
+ /** An operation reference names a source description that is not an OpenAPI document. */
49
+ static SourceDescriptionNotOpenAPI = 'source-description-not-openapi';
50
+ /** A workflow exceeded its budget of step attempts. */
51
+ static StepBudget = 'step-budget';
52
+ /** An action declares a `type` other than `end`, `goto` or `retry`. */
53
+ static UnknownActionType = 'unknown-action-type';
54
+ /** `execute` received an option it does not know. */
55
+ static UnknownExecuteOption = 'unknown-execute-option';
56
+ /** A step produced a transition the workflow executor does not recognize. */
57
+ static UnknownTransitionKind = 'unknown-transition-kind';
58
+ /** A sub-workflow call (alone or together with `dependsOn`) forms a cycle between workflows. */
59
+ static WorkflowCycle = 'workflow-cycle';
60
+ /** Workflows nest deeper than the configured limit. */
61
+ static WorkflowDepth = 'workflow-depth';
62
+ /** A workflow reference names a workflow the Arazzo document does not define. */
63
+ static WorkflowNotFound = 'workflow-not-found';
64
+ /** A step that targets a workflow was handed to the step executor, which runs operations only. */
65
+ static WorkflowStep = 'workflow-step';
66
+
67
+ /**
68
+ * The chain of workflowIds the error concerns — the loop A → B → A for a
69
+ * cycle, or the call chain in progress when a budget ran out.
70
+ */
71
+
72
+ constructor(message, options) {
73
+ super(message, options);
74
+ }
75
+ }
76
+
77
+ /**
78
+ * One of the reasons an {@link ExecutionError} carries: an `ExecutionError`
79
+ * static such as `ExecutionError.OperationNotFound`.
80
+ * @public
81
+ */
11
82
  var _default = exports.default = ExecutionError;
@@ -1,4 +1,76 @@
1
1
  import ArazzoRunnerError from "./ArazzoRunnerError.mjs";
2
- /** @public */
3
- class ExecutionError extends ArazzoRunnerError {}
2
+ /**
3
+ * Carries a `reason`, one of the class's static reason fields.
4
+ *
5
+ * Every static on this class is a reason: {@link ExecutionErrorReason} is
6
+ * derived from the class's own statics, so a non-reason static would join the
7
+ * union.
8
+ * @public
9
+ */
10
+ class ExecutionError extends ArazzoRunnerError {
11
+ /** The run was cancelled through its `AbortSignal`; the signal's reason is the `cause`. */
12
+ static Aborted = 'aborted';
13
+ /** A step or a `goto`/`retry` action declares more than one mutually exclusive target. */
14
+ static AmbiguousTarget = 'ambiguous-target';
15
+ /** The `dependsOn` edges alone form a cycle between workflows. */
16
+ static DependsOnCycle = 'dependsOn-cycle';
17
+ /** A `goto` action declares neither a `stepId` nor a `workflowId`. */
18
+ static GotoTargetMissing = 'goto-target-missing';
19
+ /** A `goto` action's `stepId` names no step in the workflow. */
20
+ static GotoTargetNotFound = 'goto-target-not-found';
21
+ /** An `operationId` or `operationPath` is not a valid operation reference. */
22
+ static InvalidOperationReference = 'invalid-operation-reference';
23
+ /** A `workflowId` is not a valid `$sourceDescriptions.{name}.{workflowId}` expression. */
24
+ static InvalidWorkflowReference = 'invalid-workflow-reference';
25
+ /** A workflow's `dependsOn` is not a list or holds a non-string entry. */
26
+ static MalformedDependsOn = 'malformed-dependsOn';
27
+ /** A workflow's `steps` is not a list or holds an entry that is not a Step Object. */
28
+ static MalformedSteps = 'malformed-steps';
29
+ /** A step run as an operation declares neither an `operationId` nor an `operationPath`. */
30
+ static MissingOperation = 'missing-operation';
31
+ /** An operation reference locates no operation in its OpenAPI source description. */
32
+ static OperationNotFound = 'operation-not-found';
33
+ /** A `retry` action references a step or workflow, but no run reference was given to run it. */
34
+ static RetryReferenceUnsupported = 'retry-reference-unsupported';
35
+ /** A `retry` action's `stepId` names no step in the workflow. */
36
+ static RetryTargetNotFound = 'retry-target-not-found';
37
+ /** A workflow reference names a source description that is not an Arazzo document. */
38
+ static SourceDescriptionNotArazzo = 'source-description-not-arazzo';
39
+ /** A reference names a source description the Arazzo document does not define. */
40
+ static SourceDescriptionNotFound = 'source-description-not-found';
41
+ /** An operation reference names a source description that is not an OpenAPI document. */
42
+ static SourceDescriptionNotOpenAPI = 'source-description-not-openapi';
43
+ /** A workflow exceeded its budget of step attempts. */
44
+ static StepBudget = 'step-budget';
45
+ /** An action declares a `type` other than `end`, `goto` or `retry`. */
46
+ static UnknownActionType = 'unknown-action-type';
47
+ /** `execute` received an option it does not know. */
48
+ static UnknownExecuteOption = 'unknown-execute-option';
49
+ /** A step produced a transition the workflow executor does not recognize. */
50
+ static UnknownTransitionKind = 'unknown-transition-kind';
51
+ /** A sub-workflow call (alone or together with `dependsOn`) forms a cycle between workflows. */
52
+ static WorkflowCycle = 'workflow-cycle';
53
+ /** Workflows nest deeper than the configured limit. */
54
+ static WorkflowDepth = 'workflow-depth';
55
+ /** A workflow reference names a workflow the Arazzo document does not define. */
56
+ static WorkflowNotFound = 'workflow-not-found';
57
+ /** A step that targets a workflow was handed to the step executor, which runs operations only. */
58
+ static WorkflowStep = 'workflow-step';
59
+
60
+ /**
61
+ * The chain of workflowIds the error concerns — the loop A → B → A for a
62
+ * cycle, or the call chain in progress when a budget ran out.
63
+ */
64
+
65
+ constructor(message, options) {
66
+ super(message, options);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * One of the reasons an {@link ExecutionError} carries: an `ExecutionError`
72
+ * static such as `ExecutionError.OperationNotFound`.
73
+ * @public
74
+ */
75
+
4
76
  export default ExecutionError;
@@ -6,6 +6,57 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _ArazzoRunnerError = _interopRequireDefault(require("./ArazzoRunnerError.cjs"));
9
- /** @public */
10
- class ResolverError extends _ArazzoRunnerError.default {}
9
+ /**
10
+ * Carries a `reason`, one of the class's static reason fields.
11
+ *
12
+ * Every static on this class is a reason: {@link ResolverErrorReason} is
13
+ * derived from the class's own statics, so a non-reason static would join the
14
+ * union.
15
+ * @public
16
+ */
17
+ class ResolverError extends _ArazzoRunnerError.default {
18
+ /** A parameter cannot be delivered unambiguously at its location. */
19
+ static AmbiguousDelivery = 'ambiguous-delivery';
20
+ /** An output or a request body payload holds a value that is not a valid runtime expression. */
21
+ static InvalidExpression = 'invalid-expression';
22
+ /** A parameter's location (`in`) is not one of the known locations. */
23
+ static InvalidLocation = 'invalid-location';
24
+ /** An `onSuccess`/`onFailure` list holds an entry that is not a Success/Failure Action Object. */
25
+ static MalformedActionEntry = 'malformed-action-entry';
26
+ /** A step's `onSuccess` or `onFailure` is present but is not a list. */
27
+ static MalformedActions = 'malformed-actions';
28
+ /** A step's `successCriteria` or an action's `criteria` is present but is not a list. */
29
+ static MalformedCriteria = 'malformed-criteria';
30
+ /** A criteria list holds an entry that is not a Criterion Object. */
31
+ static MalformedCriterion = 'malformed-criterion';
32
+ /** A parameter's location (`in`) is not a string. */
33
+ static MalformedLocation = 'malformed-location';
34
+ /** A step's or workflow's `outputs` is present but is not a map. */
35
+ static MalformedOutputs = 'malformed-outputs';
36
+ /** `parameters` is present but is not a list. */
37
+ static MalformedParameters = 'malformed-parameters';
38
+ /** `requestBody.replacements` is present but is not a list. */
39
+ static MalformedReplacements = 'malformed-replacements';
40
+ /** `requestBody` is present but is not a map. */
41
+ static MalformedRequestBody = 'malformed-request-body';
42
+ /** A parameter of a step that targets an operation declares no location (`in`). */
43
+ static MissingLocation = 'missing-location';
44
+ /** A parameter has a missing or non-string `name`. */
45
+ static MissingName = 'missing-name';
46
+ /** A runtime expression in the request body did not resolve. */
47
+ static UnresolvedExpression = 'unresolved-expression';
48
+ /** A `requestBody` replacement target does not resolve in the payload. */
49
+ static UnresolvedTarget = 'unresolved-target';
50
+ /** A `requestBody` replacement target is not a JSON Pointer. */
51
+ static UnsupportedTarget = 'unsupported-target';
52
+ constructor(message, options) {
53
+ super(message, options);
54
+ }
55
+ }
56
+
57
+ /**
58
+ * One of the reasons a {@link ResolverError} carries: a `ResolverError`
59
+ * static such as `ResolverError.MalformedParameters`.
60
+ * @public
61
+ */
11
62
  var _default = exports.default = ResolverError;
@@ -1,4 +1,56 @@
1
1
  import ArazzoRunnerError from "./ArazzoRunnerError.mjs";
2
- /** @public */
3
- class ResolverError extends ArazzoRunnerError {}
2
+ /**
3
+ * Carries a `reason`, one of the class's static reason fields.
4
+ *
5
+ * Every static on this class is a reason: {@link ResolverErrorReason} is
6
+ * derived from the class's own statics, so a non-reason static would join the
7
+ * union.
8
+ * @public
9
+ */
10
+ class ResolverError extends ArazzoRunnerError {
11
+ /** A parameter cannot be delivered unambiguously at its location. */
12
+ static AmbiguousDelivery = 'ambiguous-delivery';
13
+ /** An output or a request body payload holds a value that is not a valid runtime expression. */
14
+ static InvalidExpression = 'invalid-expression';
15
+ /** A parameter's location (`in`) is not one of the known locations. */
16
+ static InvalidLocation = 'invalid-location';
17
+ /** An `onSuccess`/`onFailure` list holds an entry that is not a Success/Failure Action Object. */
18
+ static MalformedActionEntry = 'malformed-action-entry';
19
+ /** A step's `onSuccess` or `onFailure` is present but is not a list. */
20
+ static MalformedActions = 'malformed-actions';
21
+ /** A step's `successCriteria` or an action's `criteria` is present but is not a list. */
22
+ static MalformedCriteria = 'malformed-criteria';
23
+ /** A criteria list holds an entry that is not a Criterion Object. */
24
+ static MalformedCriterion = 'malformed-criterion';
25
+ /** A parameter's location (`in`) is not a string. */
26
+ static MalformedLocation = 'malformed-location';
27
+ /** A step's or workflow's `outputs` is present but is not a map. */
28
+ static MalformedOutputs = 'malformed-outputs';
29
+ /** `parameters` is present but is not a list. */
30
+ static MalformedParameters = 'malformed-parameters';
31
+ /** `requestBody.replacements` is present but is not a list. */
32
+ static MalformedReplacements = 'malformed-replacements';
33
+ /** `requestBody` is present but is not a map. */
34
+ static MalformedRequestBody = 'malformed-request-body';
35
+ /** A parameter of a step that targets an operation declares no location (`in`). */
36
+ static MissingLocation = 'missing-location';
37
+ /** A parameter has a missing or non-string `name`. */
38
+ static MissingName = 'missing-name';
39
+ /** A runtime expression in the request body did not resolve. */
40
+ static UnresolvedExpression = 'unresolved-expression';
41
+ /** A `requestBody` replacement target does not resolve in the payload. */
42
+ static UnresolvedTarget = 'unresolved-target';
43
+ /** A `requestBody` replacement target is not a JSON Pointer. */
44
+ static UnsupportedTarget = 'unsupported-target';
45
+ constructor(message, options) {
46
+ super(message, options);
47
+ }
48
+ }
49
+
50
+ /**
51
+ * One of the reasons a {@link ResolverError} carries: a `ResolverError`
52
+ * static such as `ResolverError.MalformedParameters`.
53
+ * @public
54
+ */
55
+
4
56
  export default ResolverError;
@@ -6,6 +6,36 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _ArazzoRunnerError = _interopRequireDefault(require("./ArazzoRunnerError.cjs"));
9
- /** @public */
10
- class RuntimeExpressionError extends _ArazzoRunnerError.default {}
9
+ /**
10
+ * Carries a `reason`, one of the class's static reason fields.
11
+ *
12
+ * Every static on this class is a reason: {@link RuntimeExpressionErrorReason}
13
+ * is derived from the class's own statics, so a non-reason static would join
14
+ * the union.
15
+ * @public
16
+ */
17
+ class RuntimeExpressionError extends _ArazzoRunnerError.default {
18
+ /** The expression is not a valid runtime expression. */
19
+ static InvalidExpression = 'invalid-expression';
20
+ /** The runtime expression parser failed on the expression. */
21
+ static ParseError = 'parse-error';
22
+ /**
23
+ * The expression reads HTTP data (`$statusCode`, `$url`, `$method`, `$request`,
24
+ * `$response`) in a step that calls a workflow and so made no HTTP call.
25
+ */
26
+ static UnavailableExpression = 'unavailable-expression';
27
+ /** The expression could not be resolved against the evaluation context. */
28
+ static UnresolvedReference = 'unresolved-reference';
29
+ /** The parsed expression contains a node the evaluator does not support. */
30
+ static UnsupportedNode = 'unsupported-node';
31
+ constructor(message, options) {
32
+ super(message, options);
33
+ }
34
+ }
35
+
36
+ /**
37
+ * One of the reasons a {@link RuntimeExpressionError} carries: a
38
+ * `RuntimeExpressionError` static such as `RuntimeExpressionError.ParseError`.
39
+ * @public
40
+ */
11
41
  var _default = exports.default = RuntimeExpressionError;
@@ -1,4 +1,35 @@
1
1
  import ArazzoRunnerError from "./ArazzoRunnerError.mjs";
2
- /** @public */
3
- class RuntimeExpressionError extends ArazzoRunnerError {}
2
+ /**
3
+ * Carries a `reason`, one of the class's static reason fields.
4
+ *
5
+ * Every static on this class is a reason: {@link RuntimeExpressionErrorReason}
6
+ * is derived from the class's own statics, so a non-reason static would join
7
+ * the union.
8
+ * @public
9
+ */
10
+ class RuntimeExpressionError extends ArazzoRunnerError {
11
+ /** The expression is not a valid runtime expression. */
12
+ static InvalidExpression = 'invalid-expression';
13
+ /** The runtime expression parser failed on the expression. */
14
+ static ParseError = 'parse-error';
15
+ /**
16
+ * The expression reads HTTP data (`$statusCode`, `$url`, `$method`, `$request`,
17
+ * `$response`) in a step that calls a workflow and so made no HTTP call.
18
+ */
19
+ static UnavailableExpression = 'unavailable-expression';
20
+ /** The expression could not be resolved against the evaluation context. */
21
+ static UnresolvedReference = 'unresolved-reference';
22
+ /** The parsed expression contains a node the evaluator does not support. */
23
+ static UnsupportedNode = 'unsupported-node';
24
+ constructor(message, options) {
25
+ super(message, options);
26
+ }
27
+ }
28
+
29
+ /**
30
+ * One of the reasons a {@link RuntimeExpressionError} carries: a
31
+ * `RuntimeExpressionError` static such as `RuntimeExpressionError.ParseError`.
32
+ * @public
33
+ */
34
+
4
35
  export default RuntimeExpressionError;
@@ -75,7 +75,7 @@ class ArazzoWorkflowLocatorNormalizer extends _SourceDescriptionsLocatorNormaliz
75
75
  throw new _ExecutionError.default(`workflow reference "${reference}" in workflow "${context.workflowId}" names workflow "${locator.workflowId}", which the Arazzo document at "${locator.document.uri}" does not define`, {
76
76
  workflowId: context.workflowId,
77
77
  stepId: context.stepId,
78
- reason: 'workflow-not-found'
78
+ reason: _ExecutionError.default.WorkflowNotFound
79
79
  });
80
80
  }
81
81
  return locator;
@@ -104,7 +104,7 @@ class ArazzoWorkflowLocatorNormalizer extends _SourceDescriptionsLocatorNormaliz
104
104
  throw new _ExecutionError.default(`workflow reference "${reference}" in workflow "${workflowId}" is not a $sourceDescriptions.{name}.{workflowId} expression`, {
105
105
  workflowId,
106
106
  stepId,
107
- reason: 'invalid-workflow-reference'
107
+ reason: _ExecutionError.default.InvalidWorkflowReference
108
108
  });
109
109
  }
110
110
  return {
@@ -138,7 +138,7 @@ class ArazzoWorkflowLocatorNormalizer extends _SourceDescriptionsLocatorNormaliz
138
138
  throw new _ExecutionError.default(`workflow reference "${parsed.reference}" in workflow "${workflowId}" names source description "${parsed.sourceName}", which the Arazzo document at "${document.uri}" does not define`, {
139
139
  workflowId,
140
140
  stepId,
141
- reason: 'source-description-not-found'
141
+ reason: _ExecutionError.default.SourceDescriptionNotFound
142
142
  });
143
143
  }
144
144
  const source = await this.registry.acquire(uri);
@@ -146,7 +146,7 @@ class ArazzoWorkflowLocatorNormalizer extends _SourceDescriptionsLocatorNormaliz
146
146
  throw new _ExecutionError.default(`workflow reference "${parsed.reference}" in workflow "${workflowId}" names source description "${parsed.sourceName}" at "${uri}", which is not an Arazzo document`, {
147
147
  workflowId,
148
148
  stepId,
149
- reason: 'source-description-not-arazzo'
149
+ reason: _ExecutionError.default.SourceDescriptionNotArazzo
150
150
  });
151
151
  }
152
152
  return {
@@ -65,7 +65,7 @@ class ArazzoWorkflowLocatorNormalizer extends SourceDescriptionsLocatorNormalize
65
65
  throw new ExecutionError(`workflow reference "${reference}" in workflow "${context.workflowId}" names workflow "${locator.workflowId}", which the Arazzo document at "${locator.document.uri}" does not define`, {
66
66
  workflowId: context.workflowId,
67
67
  stepId: context.stepId,
68
- reason: 'workflow-not-found'
68
+ reason: ExecutionError.WorkflowNotFound
69
69
  });
70
70
  }
71
71
  return locator;
@@ -94,7 +94,7 @@ class ArazzoWorkflowLocatorNormalizer extends SourceDescriptionsLocatorNormalize
94
94
  throw new ExecutionError(`workflow reference "${reference}" in workflow "${workflowId}" is not a $sourceDescriptions.{name}.{workflowId} expression`, {
95
95
  workflowId,
96
96
  stepId,
97
- reason: 'invalid-workflow-reference'
97
+ reason: ExecutionError.InvalidWorkflowReference
98
98
  });
99
99
  }
100
100
  return {
@@ -128,7 +128,7 @@ class ArazzoWorkflowLocatorNormalizer extends SourceDescriptionsLocatorNormalize
128
128
  throw new ExecutionError(`workflow reference "${parsed.reference}" in workflow "${workflowId}" names source description "${parsed.sourceName}", which the Arazzo document at "${document.uri}" does not define`, {
129
129
  workflowId,
130
130
  stepId,
131
- reason: 'source-description-not-found'
131
+ reason: ExecutionError.SourceDescriptionNotFound
132
132
  });
133
133
  }
134
134
  const source = await this.registry.acquire(uri);
@@ -136,7 +136,7 @@ class ArazzoWorkflowLocatorNormalizer extends SourceDescriptionsLocatorNormalize
136
136
  throw new ExecutionError(`workflow reference "${parsed.reference}" in workflow "${workflowId}" names source description "${parsed.sourceName}" at "${uri}", which is not an Arazzo document`, {
137
137
  workflowId,
138
138
  stepId,
139
- reason: 'source-description-not-arazzo'
139
+ reason: ExecutionError.SourceDescriptionNotArazzo
140
140
  });
141
141
  }
142
142
  return {
@@ -94,7 +94,7 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
94
94
  if (parsed !== undefined && document.resolveSourceDescriptionURI(parsed.sourceName) === undefined) {
95
95
  throw new _ExecutionError.default(`operationPath "${operationPath}" names source description "${parsed.sourceName}", which the Arazzo document at "${document.uri}" does not define`, {
96
96
  ...scope,
97
- reason: 'source-description-not-found'
97
+ reason: _ExecutionError.default.SourceDescriptionNotFound
98
98
  });
99
99
  }
100
100
  }
@@ -108,21 +108,21 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
108
108
  if (documentURI === '') {
109
109
  throw new _ExecutionError.default(`operationPath "${operationPath}" does not resolve to a source description URL`, {
110
110
  ...scope,
111
- reason: 'invalid-operation-reference'
111
+ reason: _ExecutionError.default.InvalidOperationReference
112
112
  });
113
113
  }
114
114
  const jsonPointer = _jsonPointer.URIFragmentIdentifier.fromURIReference(uriReference);
115
115
  if (!(0, _jsonPointer.testJSONPointer)(jsonPointer)) {
116
116
  throw new _ExecutionError.default(`operationPath "${operationPath}" has an invalid JSON Pointer`, {
117
117
  ...scope,
118
- reason: 'invalid-operation-reference'
118
+ reason: _ExecutionError.default.InvalidOperationReference
119
119
  });
120
120
  }
121
121
  const source = await this.registry.acquire(documentURI);
122
122
  if (!_OpenAPIDocument.default.is(source)) {
123
123
  throw new _ExecutionError.default(`operationPath "${operationPath}" references "${documentURI}", which is not an OpenAPI document`, {
124
124
  ...scope,
125
- reason: 'source-description-not-openapi'
125
+ reason: _ExecutionError.default.SourceDescriptionNotOpenAPI
126
126
  });
127
127
  }
128
128
 
@@ -134,7 +134,7 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
134
134
  throw new _ExecutionError.default(`operationPath "${operationPath}" does not locate an operation in the OpenAPI document at "${source.uri}"`, {
135
135
  cause: error,
136
136
  ...scope,
137
- reason: 'operation-not-found'
137
+ reason: _ExecutionError.default.OperationNotFound
138
138
  });
139
139
  }
140
140
  return {
@@ -147,7 +147,7 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
147
147
  if (parsed === undefined) {
148
148
  throw new _ExecutionError.default(`operationId "${expression}" is not a $sourceDescriptions.{name}.{operationId} expression`, {
149
149
  ...scope,
150
- reason: 'invalid-operation-reference'
150
+ reason: _ExecutionError.default.InvalidOperationReference
151
151
  });
152
152
  }
153
153
  const {
@@ -159,7 +159,7 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
159
159
  if (jsonPointer === undefined) {
160
160
  throw new _ExecutionError.default(`Operation "${operationId}" not found in source description "${sourceName}" at "${openapiDocument.uri}"`, {
161
161
  ...scope,
162
- reason: 'operation-not-found'
162
+ reason: _ExecutionError.default.OperationNotFound
163
163
  });
164
164
  }
165
165
  return {
@@ -188,7 +188,7 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
188
188
  if (jsonPointer === undefined) {
189
189
  throw new _ExecutionError.default(`Operation "${operationId}" not found in source description at "${source.uri}"`, {
190
190
  ...scope,
191
- reason: 'operation-not-found'
191
+ reason: _ExecutionError.default.OperationNotFound
192
192
  });
193
193
  }
194
194
  return {
@@ -201,7 +201,7 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
201
201
  // is simply no OpenAPI document for the operation to be in.
202
202
  throw new _ExecutionError.default(`Operation "${operationId}" not found: the Arazzo document at "${document.uri}" has no OpenAPI source description`, {
203
203
  ...scope,
204
- reason: 'operation-not-found'
204
+ reason: _ExecutionError.default.OperationNotFound
205
205
  });
206
206
  }
207
207
 
@@ -213,14 +213,14 @@ class OpenAPIOperationLocatorNormalizer extends _SourceDescriptionsLocatorNormal
213
213
  if (uri === undefined) {
214
214
  throw new _ExecutionError.default(`Source description "${sourceName}" not found in the Arazzo document at "${document.uri}"`, {
215
215
  ...scope,
216
- reason: 'source-description-not-found'
216
+ reason: _ExecutionError.default.SourceDescriptionNotFound
217
217
  });
218
218
  }
219
219
  const source = await this.registry.acquire(uri);
220
220
  if (!_OpenAPIDocument.default.is(source)) {
221
221
  throw new _ExecutionError.default(`Source description "${sourceName}" at "${uri}" is not an OpenAPI document`, {
222
222
  ...scope,
223
- reason: 'source-description-not-openapi'
223
+ reason: _ExecutionError.default.SourceDescriptionNotOpenAPI
224
224
  });
225
225
  }
226
226
  return source;
@@ -86,7 +86,7 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
86
86
  if (parsed !== undefined && document.resolveSourceDescriptionURI(parsed.sourceName) === undefined) {
87
87
  throw new ExecutionError(`operationPath "${operationPath}" names source description "${parsed.sourceName}", which the Arazzo document at "${document.uri}" does not define`, {
88
88
  ...scope,
89
- reason: 'source-description-not-found'
89
+ reason: ExecutionError.SourceDescriptionNotFound
90
90
  });
91
91
  }
92
92
  }
@@ -100,21 +100,21 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
100
100
  if (documentURI === '') {
101
101
  throw new ExecutionError(`operationPath "${operationPath}" does not resolve to a source description URL`, {
102
102
  ...scope,
103
- reason: 'invalid-operation-reference'
103
+ reason: ExecutionError.InvalidOperationReference
104
104
  });
105
105
  }
106
106
  const jsonPointer = URIFragmentIdentifier.fromURIReference(uriReference);
107
107
  if (!testJSONPointer(jsonPointer)) {
108
108
  throw new ExecutionError(`operationPath "${operationPath}" has an invalid JSON Pointer`, {
109
109
  ...scope,
110
- reason: 'invalid-operation-reference'
110
+ reason: ExecutionError.InvalidOperationReference
111
111
  });
112
112
  }
113
113
  const source = await this.registry.acquire(documentURI);
114
114
  if (!OpenAPIDocument.is(source)) {
115
115
  throw new ExecutionError(`operationPath "${operationPath}" references "${documentURI}", which is not an OpenAPI document`, {
116
116
  ...scope,
117
- reason: 'source-description-not-openapi'
117
+ reason: ExecutionError.SourceDescriptionNotOpenAPI
118
118
  });
119
119
  }
120
120
 
@@ -126,7 +126,7 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
126
126
  throw new ExecutionError(`operationPath "${operationPath}" does not locate an operation in the OpenAPI document at "${source.uri}"`, {
127
127
  cause: error,
128
128
  ...scope,
129
- reason: 'operation-not-found'
129
+ reason: ExecutionError.OperationNotFound
130
130
  });
131
131
  }
132
132
  return {
@@ -139,7 +139,7 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
139
139
  if (parsed === undefined) {
140
140
  throw new ExecutionError(`operationId "${expression}" is not a $sourceDescriptions.{name}.{operationId} expression`, {
141
141
  ...scope,
142
- reason: 'invalid-operation-reference'
142
+ reason: ExecutionError.InvalidOperationReference
143
143
  });
144
144
  }
145
145
  const {
@@ -151,7 +151,7 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
151
151
  if (jsonPointer === undefined) {
152
152
  throw new ExecutionError(`Operation "${operationId}" not found in source description "${sourceName}" at "${openapiDocument.uri}"`, {
153
153
  ...scope,
154
- reason: 'operation-not-found'
154
+ reason: ExecutionError.OperationNotFound
155
155
  });
156
156
  }
157
157
  return {
@@ -180,7 +180,7 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
180
180
  if (jsonPointer === undefined) {
181
181
  throw new ExecutionError(`Operation "${operationId}" not found in source description at "${source.uri}"`, {
182
182
  ...scope,
183
- reason: 'operation-not-found'
183
+ reason: ExecutionError.OperationNotFound
184
184
  });
185
185
  }
186
186
  return {
@@ -193,7 +193,7 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
193
193
  // is simply no OpenAPI document for the operation to be in.
194
194
  throw new ExecutionError(`Operation "${operationId}" not found: the Arazzo document at "${document.uri}" has no OpenAPI source description`, {
195
195
  ...scope,
196
- reason: 'operation-not-found'
196
+ reason: ExecutionError.OperationNotFound
197
197
  });
198
198
  }
199
199
 
@@ -205,14 +205,14 @@ class OpenAPIOperationLocatorNormalizer extends SourceDescriptionsLocatorNormali
205
205
  if (uri === undefined) {
206
206
  throw new ExecutionError(`Source description "${sourceName}" not found in the Arazzo document at "${document.uri}"`, {
207
207
  ...scope,
208
- reason: 'source-description-not-found'
208
+ reason: ExecutionError.SourceDescriptionNotFound
209
209
  });
210
210
  }
211
211
  const source = await this.registry.acquire(uri);
212
212
  if (!OpenAPIDocument.is(source)) {
213
213
  throw new ExecutionError(`Source description "${sourceName}" at "${uri}" is not an OpenAPI document`, {
214
214
  ...scope,
215
- reason: 'source-description-not-openapi'
215
+ reason: ExecutionError.SourceDescriptionNotOpenAPI
216
216
  });
217
217
  }
218
218
  return source;