@usearazzo/runner 1.0.1-alpha.35 → 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.35",
3
+ "version": "1.0.1-alpha.37",
4
4
  "description": "Runner for Arazzo Workflows.",
5
5
  "keywords": [
6
6
  "arazzo",
@@ -29,40 +29,47 @@
29
29
  "main": "./src/index.cjs",
30
30
  "exports": {
31
31
  ".": {
32
- "types": "./types/runner.d.ts",
33
- "import": "./src/index.mjs",
34
- "require": "./src/index.cjs"
32
+ "import": {
33
+ "types": "./types/runner.d.ts",
34
+ "default": "./src/index.mjs"
35
+ },
36
+ "require": {
37
+ "types": "./types/runner.d.cts",
38
+ "default": "./src/index.cjs"
39
+ }
35
40
  },
36
41
  "./observability/logging": {
37
- "types": "./types/observability/logging/index.d.ts",
38
- "import": "./src/observability/logging/index.mjs",
39
- "require": "./src/observability/logging/index.cjs"
42
+ "import": {
43
+ "types": "./types/observability/logging/index.d.ts",
44
+ "default": "./src/observability/logging/index.mjs"
45
+ },
46
+ "require": {
47
+ "types": "./types/observability/logging/index.d.cts",
48
+ "default": "./src/observability/logging/index.cjs"
49
+ }
40
50
  },
41
51
  "./observability/stream": {
42
- "types": "./types/observability/stream/index.d.ts",
43
- "import": "./src/observability/stream/index.mjs",
44
- "require": "./src/observability/stream/index.cjs"
52
+ "import": {
53
+ "types": "./types/observability/stream/index.d.ts",
54
+ "default": "./src/observability/stream/index.mjs"
55
+ },
56
+ "require": {
57
+ "types": "./types/observability/stream/index.d.cts",
58
+ "default": "./src/observability/stream/index.cjs"
59
+ }
45
60
  },
46
61
  "./observability/opentelemetry": {
47
- "types": "./types/observability/opentelemetry/index.d.ts",
48
- "import": "./src/observability/opentelemetry/index.mjs",
49
- "require": "./src/observability/opentelemetry/index.cjs"
62
+ "import": {
63
+ "types": "./types/observability/opentelemetry/index.d.ts",
64
+ "default": "./src/observability/opentelemetry/index.mjs"
65
+ },
66
+ "require": {
67
+ "types": "./types/observability/opentelemetry/index.d.cts",
68
+ "default": "./src/observability/opentelemetry/index.cjs"
69
+ }
50
70
  }
51
71
  },
52
72
  "types": "./types/runner.d.ts",
53
- "typesVersions": {
54
- "*": {
55
- "observability/logging": [
56
- "./types/observability/logging/index.d.ts"
57
- ],
58
- "observability/stream": [
59
- "./types/observability/stream/index.d.ts"
60
- ],
61
- "observability/opentelemetry": [
62
- "./types/observability/opentelemetry/index.d.ts"
63
- ]
64
- }
65
- },
66
73
  "scripts": {
67
74
  "build": "npm run clean && npm run build:es && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:cjs build:umd:browser",
68
75
  "build:es": "npm run build:swagger-client && cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
@@ -74,7 +81,8 @@
74
81
  "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
75
82
  "typescript:check-types": "tsc --noEmit",
76
83
  "version": "node ../../scripts/version-update.mjs",
77
- "typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json",
84
+ "typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json && node ../../scripts/declarations-cts.mjs",
85
+ "typescript:check-published-types": "attw --pack . --profile node16 && tsc -p test/types/tsconfig.json",
78
86
  "test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
79
87
  "test:e2e": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha --config .mocharc.e2e.json",
80
88
  "prepack": "copyfiles -u 2 ../../LICENSE . && copyfiles -u 2 ../../NOTICE .",
@@ -87,37 +95,37 @@
87
95
  "author": "Vladimir Gorej <vladimir.gorej@gmail.com>",
88
96
  "license": "Apache-2.0",
89
97
  "dependencies": {
90
- "@babel/runtime-corejs3": "^8.1.2",
91
- "@speclynx/apidom-core": "^7.1.0",
92
- "@speclynx/apidom-datamodel": "^7.1.0",
93
- "@speclynx/apidom-error": "^7.1.0",
94
- "@speclynx/apidom-json-pointer": "^7.1.0",
95
- "@speclynx/apidom-ns-arazzo-1": "^7.1.0",
96
- "@speclynx/apidom-ns-openapi-2": "^7.1.0",
97
- "@speclynx/apidom-ns-openapi-3-0": "^7.1.0",
98
- "@speclynx/apidom-ns-openapi-3-1": "^7.1.0",
99
- "@speclynx/apidom-reference": "^7.1.0",
100
- "@speclynx/apidom-traverse": "^7.1.0",
98
+ "@babel/runtime-corejs3": "^8.1.3",
99
+ "@speclynx/apidom-core": "^7.1.1",
100
+ "@speclynx/apidom-datamodel": "^7.1.1",
101
+ "@speclynx/apidom-error": "^7.1.1",
102
+ "@speclynx/apidom-json-pointer": "^7.1.1",
103
+ "@speclynx/apidom-ns-arazzo-1": "^7.1.1",
104
+ "@speclynx/apidom-ns-openapi-2": "^7.1.1",
105
+ "@speclynx/apidom-ns-openapi-3-0": "^7.1.1",
106
+ "@speclynx/apidom-ns-openapi-3-1": "^7.1.1",
107
+ "@speclynx/apidom-reference": "^7.1.1",
108
+ "@speclynx/apidom-traverse": "^7.1.1",
101
109
  "@swaggerexpert/arazzo-criterion": "^1.2.0",
102
110
  "@swaggerexpert/arazzo-runtime-expression": "^3.4.0",
103
- "@swaggerexpert/cookie": "^2.1.1",
104
- "@swaggerexpert/json-pointer": "^3.0.2",
105
- "@swaggerexpert/jsonpath": "^4.0.5",
106
- "@swaggerexpert/media-types": "^1.0.2",
107
- "@usearazzo/parser": "1.0.1-alpha.35",
108
- "@usearazzo/resolver": "1.0.1-alpha.35",
111
+ "@swaggerexpert/cookie": "^2.2.0",
112
+ "@swaggerexpert/json-pointer": "^3.0.3",
113
+ "@swaggerexpert/jsonpath": "^4.1.0",
114
+ "@swaggerexpert/media-types": "^1.0.3",
115
+ "@usearazzo/parser": "1.0.1-alpha.37",
116
+ "@usearazzo/resolver": "1.0.1-alpha.37",
109
117
  "@xmldom/xmldom": "^0.9.12",
110
118
  "fontoxpath": "^3.34.0",
111
119
  "ramda": "^0.32.0",
112
120
  "ramda-adjunct": "^6.1.0",
113
- "short-unique-id": "^5.3.2",
114
- "type-fest": "^5.10.0"
121
+ "short-unique-id": "^5.3.2"
115
122
  },
116
123
  "files": [
117
124
  "src/**/*.mjs",
118
125
  "src/**/*.cjs",
119
126
  "dist/",
120
127
  "types/runner.d.ts",
128
+ "types/runner.d.cts",
121
129
  "types/observability/logging/",
122
130
  "types/observability/stream/",
123
131
  "types/observability/opentelemetry/",
@@ -135,10 +143,10 @@
135
143
  }
136
144
  },
137
145
  "devDependencies": {
138
- "@opentelemetry/api": "~1.9.0",
139
- "@opentelemetry/context-async-hooks": "^2.12.1",
146
+ "@opentelemetry/api": "~1.10.0",
147
+ "@opentelemetry/context-async-hooks": "^3.1.1",
140
148
  "@opentelemetry/sdk-trace-base": "^2.12.0",
141
149
  "swagger-client": "^3.39.0"
142
150
  },
143
- "gitHead": "8a1fa9ce51886f2788d381483d4aa0763dfd5d4c"
151
+ "gitHead": "b725c4fbaa4066e4823e13efadbb0fd399f86e34"
144
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',