@usearazzo/runner 1.0.1-alpha.36 → 1.0.1-alpha.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usearazzo/runner",
3
- "version": "1.0.1-alpha.36",
3
+ "version": "1.0.1-alpha.37",
4
4
  "description": "Runner for Arazzo Workflows.",
5
5
  "keywords": [
6
6
  "arazzo",
@@ -112,8 +112,8 @@
112
112
  "@swaggerexpert/json-pointer": "^3.0.3",
113
113
  "@swaggerexpert/jsonpath": "^4.1.0",
114
114
  "@swaggerexpert/media-types": "^1.0.3",
115
- "@usearazzo/parser": "1.0.1-alpha.36",
116
- "@usearazzo/resolver": "1.0.1-alpha.36",
115
+ "@usearazzo/parser": "1.0.1-alpha.37",
116
+ "@usearazzo/resolver": "1.0.1-alpha.37",
117
117
  "@xmldom/xmldom": "^0.9.12",
118
118
  "fontoxpath": "^3.34.0",
119
119
  "ramda": "^0.32.0",
@@ -143,10 +143,10 @@
143
143
  }
144
144
  },
145
145
  "devDependencies": {
146
- "@opentelemetry/api": "~1.9.0",
146
+ "@opentelemetry/api": "~1.10.0",
147
147
  "@opentelemetry/context-async-hooks": "^3.1.1",
148
148
  "@opentelemetry/sdk-trace-base": "^2.12.0",
149
149
  "swagger-client": "^3.39.0"
150
150
  },
151
- "gitHead": "039f55923d0f86676181764b02744affcf5f6da2"
151
+ "gitHead": "b725c4fbaa4066e4823e13efadbb0fd399f86e34"
152
152
  }
@@ -152,7 +152,8 @@ const IGNORED_HEADERS = new Set(['accept', 'authorization', 'content-type']);
152
152
  * sends it through the pluggable {@link HTTPClient}, and normalizes the raw
153
153
  * `Response` into the runner's response model. A non-2xx status is a valid
154
154
  * outcome (judged by a step's `successCriteria`) and is returned, never
155
- * thrown; a transport failure is wrapped as a {@link ClientError}.
155
+ * thrown; a transport failure, a response body that cannot be read in full
156
+ * included, is wrapped as a {@link ClientError}.
156
157
  *
157
158
  * The executor is Arazzo-agnostic: it neither locates the operation (that is
158
159
  * the operation locator normalizer's concern) nor resolves parameters or
@@ -332,10 +333,26 @@ class OpenAPIOperationExecutor {
332
333
  } catch (error) {
333
334
  throw new _ClientError.default('OpenAPI operation request failed', {
334
335
  operationPath: locator.jsonPointer,
336
+ uri: locator.document.uri,
337
+ cause: error
338
+ });
339
+ }
340
+
341
+ // the transport resolves once the headers are in, so a connection lost
342
+ // while the body streams fails here, inside the normalizer that reads it,
343
+ // and is as much a transport failure as a request that never got a
344
+ // response. Anything else the normalizer throws is reported the same way:
345
+ // either way there is no response to hand to the step.
346
+ let response;
347
+ try {
348
+ response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
349
+ } catch (error) {
350
+ throw new _ClientError.default('OpenAPI operation response could not be read', {
351
+ operationPath: locator.jsonPointer,
352
+ uri: locator.document.uri,
335
353
  cause: error
336
354
  });
337
355
  }
338
- const response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
339
356
  if (this.#events.hasObservers) {
340
357
  this.#events.emit({
341
358
  type: 'openapi:operation:request:settled',
@@ -140,7 +140,8 @@ const IGNORED_HEADERS = new Set(['accept', 'authorization', 'content-type']);
140
140
  * sends it through the pluggable {@link HTTPClient}, and normalizes the raw
141
141
  * `Response` into the runner's response model. A non-2xx status is a valid
142
142
  * outcome (judged by a step's `successCriteria`) and is returned, never
143
- * thrown; a transport failure is wrapped as a {@link ClientError}.
143
+ * thrown; a transport failure, a response body that cannot be read in full
144
+ * included, is wrapped as a {@link ClientError}.
144
145
  *
145
146
  * The executor is Arazzo-agnostic: it neither locates the operation (that is
146
147
  * the operation locator normalizer's concern) nor resolves parameters or
@@ -320,10 +321,26 @@ class OpenAPIOperationExecutor {
320
321
  } catch (error) {
321
322
  throw new ClientError('OpenAPI operation request failed', {
322
323
  operationPath: locator.jsonPointer,
324
+ uri: locator.document.uri,
325
+ cause: error
326
+ });
327
+ }
328
+
329
+ // the transport resolves once the headers are in, so a connection lost
330
+ // while the body streams fails here, inside the normalizer that reads it,
331
+ // and is as much a transport failure as a request that never got a
332
+ // response. Anything else the normalizer throws is reported the same way:
333
+ // either way there is no response to hand to the step.
334
+ let response;
335
+ try {
336
+ response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
337
+ } catch (error) {
338
+ throw new ClientError('OpenAPI operation response could not be read', {
339
+ operationPath: locator.jsonPointer,
340
+ uri: locator.document.uri,
323
341
  cause: error
324
342
  });
325
343
  }
326
- const response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
327
344
  if (this.#events.hasObservers) {
328
345
  this.#events.emit({
329
346
  type: 'openapi:operation:request:settled',
package/src/version.cjs CHANGED
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  // generated by scripts/version-update.mjs from package.json; do not edit
8
- const version = '1.0.1-alpha.35';
8
+ const version = '1.0.1-alpha.36';
9
9
  var _default = exports.default = version;
package/src/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  // generated by scripts/version-update.mjs from package.json; do not edit
2
- const version = '1.0.1-alpha.35';
2
+ const version = '1.0.1-alpha.36';
3
3
  export default version;
@@ -1681,7 +1681,8 @@ export declare type OpenAPIOperationExecuteOptionsBag = OpenAPIOperationExecuteO
1681
1681
  * sends it through the pluggable {@link HTTPClient}, and normalizes the raw
1682
1682
  * `Response` into the runner's response model. A non-2xx status is a valid
1683
1683
  * outcome (judged by a step's `successCriteria`) and is returned, never
1684
- * thrown; a transport failure is wrapped as a {@link ClientError}.
1684
+ * thrown; a transport failure, a response body that cannot be read in full
1685
+ * included, is wrapped as a {@link ClientError}.
1685
1686
  *
1686
1687
  * The executor is Arazzo-agnostic: it neither locates the operation (that is
1687
1688
  * the operation locator normalizer's concern) nor resolves parameters or
@@ -2926,6 +2927,12 @@ export declare type StepExecuteOptions = Record<string, unknown> | ((locator: Op
2926
2927
  export declare interface StepExecutionResult {
2927
2928
  readonly stepId: string;
2928
2929
  readonly response: OpenAPIOperationResponse;
2930
+ /**
2931
+ * Whether every one of the step's `successCriteria` was met. A step without
2932
+ * `successCriteria` asserts nothing, so it is successful on any received
2933
+ * response, whatever its status code; its `successCriteria` records are then
2934
+ * empty.
2935
+ */
2929
2936
  readonly successful: boolean;
2930
2937
  readonly outputs: Record<string, unknown>;
2931
2938
  /**
@@ -3156,6 +3163,16 @@ export declare interface StepRunRecord {
3156
3163
  * Where the step is written.
3157
3164
  */
3158
3165
  readonly location: DocumentLocation;
3166
+ /**
3167
+ * Whether the step succeeded in its last attempt: every one of its
3168
+ * `successCriteria` was met and, for a step calling a workflow, that
3169
+ * workflow's run did not settle as failed (see
3170
+ * {@link WorkflowExecutionResult.settledStatus}). A step without
3171
+ * `successCriteria` asserts nothing, so its records are empty: one calling an
3172
+ * operation is then successful on any received response, whatever its status
3173
+ * code, and one calling a workflow unless that workflow's run settled as
3174
+ * failed.
3175
+ */
3159
3176
  readonly successful: boolean;
3160
3177
  readonly action: SelectedAction | undefined;
3161
3178
  /**
package/types/runner.d.ts CHANGED
@@ -1681,7 +1681,8 @@ export declare type OpenAPIOperationExecuteOptionsBag = OpenAPIOperationExecuteO
1681
1681
  * sends it through the pluggable {@link HTTPClient}, and normalizes the raw
1682
1682
  * `Response` into the runner's response model. A non-2xx status is a valid
1683
1683
  * outcome (judged by a step's `successCriteria`) and is returned, never
1684
- * thrown; a transport failure is wrapped as a {@link ClientError}.
1684
+ * thrown; a transport failure, a response body that cannot be read in full
1685
+ * included, is wrapped as a {@link ClientError}.
1685
1686
  *
1686
1687
  * The executor is Arazzo-agnostic: it neither locates the operation (that is
1687
1688
  * the operation locator normalizer's concern) nor resolves parameters or
@@ -2926,6 +2927,12 @@ export declare type StepExecuteOptions = Record<string, unknown> | ((locator: Op
2926
2927
  export declare interface StepExecutionResult {
2927
2928
  readonly stepId: string;
2928
2929
  readonly response: OpenAPIOperationResponse;
2930
+ /**
2931
+ * Whether every one of the step's `successCriteria` was met. A step without
2932
+ * `successCriteria` asserts nothing, so it is successful on any received
2933
+ * response, whatever its status code; its `successCriteria` records are then
2934
+ * empty.
2935
+ */
2929
2936
  readonly successful: boolean;
2930
2937
  readonly outputs: Record<string, unknown>;
2931
2938
  /**
@@ -3156,6 +3163,16 @@ export declare interface StepRunRecord {
3156
3163
  * Where the step is written.
3157
3164
  */
3158
3165
  readonly location: DocumentLocation;
3166
+ /**
3167
+ * Whether the step succeeded in its last attempt: every one of its
3168
+ * `successCriteria` was met and, for a step calling a workflow, that
3169
+ * workflow's run did not settle as failed (see
3170
+ * {@link WorkflowExecutionResult.settledStatus}). A step without
3171
+ * `successCriteria` asserts nothing, so its records are empty: one calling an
3172
+ * operation is then successful on any received response, whatever its status
3173
+ * code, and one calling a workflow unless that workflow's run settled as
3174
+ * failed.
3175
+ */
3159
3176
  readonly successful: boolean;
3160
3177
  readonly action: SelectedAction | undefined;
3161
3178
  /**