phenoml 12.5.0 → 13.1.0
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/dist/cjs/BaseClient.d.ts +3 -0
- package/dist/cjs/BaseClient.js +17 -2
- package/dist/cjs/api/resources/agent/client/Client.js +17 -9
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +7 -7
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +1 -1
- package/dist/cjs/api/resources/cohort/client/Client.js +1 -1
- package/dist/cjs/api/resources/construe/client/Client.js +39 -11
- package/dist/cjs/api/resources/fhir/client/Client.js +10 -6
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +7 -7
- package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +11 -3
- package/dist/cjs/api/resources/lang2Fhir/client/Client.js +16 -8
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -0
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +3 -1
- package/dist/cjs/api/resources/lang2Fhir/types/DocumentConfig.d.ts +7 -0
- package/dist/cjs/api/resources/lang2Fhir/types/DocumentConfig.js +3 -0
- package/dist/cjs/api/resources/lang2Fhir/types/DocumentMultiResponse.d.ts +5 -0
- package/dist/cjs/api/resources/lang2Fhir/types/DocumentMultiResponse.js +3 -0
- package/dist/cjs/api/resources/lang2Fhir/types/PageClassification.d.ts +11 -0
- package/dist/cjs/api/resources/lang2Fhir/types/PageClassification.js +3 -0
- package/dist/cjs/api/resources/lang2Fhir/types/PageFilter.d.ts +7 -0
- package/dist/cjs/api/resources/lang2Fhir/types/PageFilter.js +3 -0
- package/dist/cjs/api/resources/lang2Fhir/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/lang2Fhir/types/index.js +4 -0
- package/dist/cjs/api/resources/summary/client/Client.js +6 -6
- package/dist/cjs/api/resources/tools/client/Client.js +4 -4
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +0 -2
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +4 -4
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +4 -4
- package/dist/cjs/api/resources/workflows/client/Client.js +22 -6
- package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
- package/dist/cjs/core/auth/AuthProvider.js +7 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/auth/index.d.ts +1 -1
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +8 -0
- package/dist/cjs/core/fetcher/Fetcher.js +13 -8
- package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/qs.d.ts +2 -1
- package/dist/cjs/core/url/qs.js +24 -12
- package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
- package/dist/cjs/errors/phenomlError.d.ts +3 -1
- package/dist/cjs/errors/phenomlError.js +4 -1
- package/dist/cjs/errors/phenomlTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/phenomlTimeoutError.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +3 -0
- package/dist/esm/BaseClient.mjs +17 -2
- package/dist/esm/api/resources/agent/client/Client.mjs +17 -9
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +7 -7
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +1 -1
- package/dist/esm/api/resources/cohort/client/Client.mjs +1 -1
- package/dist/esm/api/resources/construe/client/Client.mjs +39 -11
- package/dist/esm/api/resources/fhir/client/Client.mjs +10 -6
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +7 -7
- package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +11 -3
- package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +16 -8
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -0
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +2 -0
- package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +3 -1
- package/dist/esm/api/resources/lang2Fhir/types/DocumentConfig.d.mts +7 -0
- package/dist/esm/api/resources/lang2Fhir/types/DocumentConfig.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/types/DocumentMultiResponse.d.mts +5 -0
- package/dist/esm/api/resources/lang2Fhir/types/DocumentMultiResponse.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/types/PageClassification.d.mts +11 -0
- package/dist/esm/api/resources/lang2Fhir/types/PageClassification.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/types/PageFilter.d.mts +7 -0
- package/dist/esm/api/resources/lang2Fhir/types/PageFilter.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/types/index.d.mts +4 -0
- package/dist/esm/api/resources/lang2Fhir/types/index.mjs +4 -0
- package/dist/esm/api/resources/summary/client/Client.mjs +6 -6
- package/dist/esm/api/resources/tools/client/Client.mjs +4 -4
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +0 -2
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +4 -4
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +4 -4
- package/dist/esm/api/resources/workflows/client/Client.mjs +22 -6
- package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
- package/dist/esm/core/auth/AuthProvider.mjs +6 -1
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/auth/index.d.mts +1 -1
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +8 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +13 -8
- package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/qs.d.mts +2 -1
- package/dist/esm/core/url/qs.mjs +24 -12
- package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
- package/dist/esm/errors/phenomlError.d.mts +3 -1
- package/dist/esm/errors/phenomlError.mjs +4 -1
- package/dist/esm/errors/phenomlTimeoutError.d.mts +4 -1
- package/dist/esm/errors/phenomlTimeoutError.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +11 -3
|
@@ -72,7 +72,7 @@ export class ToolsClient {
|
|
|
72
72
|
method: "POST",
|
|
73
73
|
headers: _headers,
|
|
74
74
|
contentType: "application/json",
|
|
75
|
-
|
|
75
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
76
76
|
requestType: "json",
|
|
77
77
|
body: _body,
|
|
78
78
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -151,7 +151,7 @@ export class ToolsClient {
|
|
|
151
151
|
method: "POST",
|
|
152
152
|
headers: _headers,
|
|
153
153
|
contentType: "application/json",
|
|
154
|
-
|
|
154
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
155
155
|
requestType: "json",
|
|
156
156
|
body: _body,
|
|
157
157
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -225,7 +225,7 @@ export class ToolsClient {
|
|
|
225
225
|
method: "POST",
|
|
226
226
|
headers: _headers,
|
|
227
227
|
contentType: "application/json",
|
|
228
|
-
|
|
228
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
229
229
|
requestType: "json",
|
|
230
230
|
body: _body,
|
|
231
231
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -299,7 +299,7 @@ export class ToolsClient {
|
|
|
299
299
|
method: "POST",
|
|
300
300
|
headers: _headers,
|
|
301
301
|
contentType: "application/json",
|
|
302
|
-
|
|
302
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
303
303
|
requestType: "json",
|
|
304
304
|
body: _body,
|
|
305
305
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -21,8 +21,6 @@ export interface Lang2FhirAndSearchRequest {
|
|
|
21
21
|
text: string;
|
|
22
22
|
/** Patient ID to filter results */
|
|
23
23
|
patient_id?: string;
|
|
24
|
-
/** Practitioner ID to filter results */
|
|
25
|
-
practitioner_id?: string;
|
|
26
24
|
/** Maximum number of results to return */
|
|
27
25
|
count?: number;
|
|
28
26
|
/** FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum) */
|
|
@@ -54,7 +54,7 @@ export class McpServerClient {
|
|
|
54
54
|
method: "POST",
|
|
55
55
|
headers: _headers,
|
|
56
56
|
contentType: "application/json",
|
|
57
|
-
|
|
57
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
58
58
|
requestType: "json",
|
|
59
59
|
body: request,
|
|
60
60
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -111,7 +111,7 @@ export class McpServerClient {
|
|
|
111
111
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "tools/mcp-server/list"),
|
|
112
112
|
method: "GET",
|
|
113
113
|
headers: _headers,
|
|
114
|
-
|
|
114
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
115
115
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
116
116
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
117
117
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -165,7 +165,7 @@ export class McpServerClient {
|
|
|
165
165
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/${core.url.encodePathParam(mcp_server_id)}`),
|
|
166
166
|
method: "GET",
|
|
167
167
|
headers: _headers,
|
|
168
|
-
|
|
168
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
169
169
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
170
170
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
171
171
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -219,7 +219,7 @@ export class McpServerClient {
|
|
|
219
219
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/${core.url.encodePathParam(mcp_server_id)}`),
|
|
220
220
|
method: "DELETE",
|
|
221
221
|
headers: _headers,
|
|
222
|
-
|
|
222
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
223
223
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
224
224
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
225
225
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -44,7 +44,7 @@ export class ToolsClient {
|
|
|
44
44
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/${core.url.encodePathParam(mcp_server_id)}/list`),
|
|
45
45
|
method: "GET",
|
|
46
46
|
headers: _headers,
|
|
47
|
-
|
|
47
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
48
48
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
49
49
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
50
50
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -98,7 +98,7 @@ export class ToolsClient {
|
|
|
98
98
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(mcp_server_tool_id)}`),
|
|
99
99
|
method: "GET",
|
|
100
100
|
headers: _headers,
|
|
101
|
-
|
|
101
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
102
102
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
103
103
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
104
104
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -152,7 +152,7 @@ export class ToolsClient {
|
|
|
152
152
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `tools/mcp-server/tool/${core.url.encodePathParam(mcp_server_tool_id)}`),
|
|
153
153
|
method: "DELETE",
|
|
154
154
|
headers: _headers,
|
|
155
|
-
|
|
155
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
156
156
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
157
157
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
158
158
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -213,7 +213,7 @@ export class ToolsClient {
|
|
|
213
213
|
method: "POST",
|
|
214
214
|
headers: _headers,
|
|
215
215
|
contentType: "application/json",
|
|
216
|
-
|
|
216
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
217
217
|
requestType: "json",
|
|
218
218
|
body: request,
|
|
219
219
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -61,7 +61,11 @@ export class WorkflowsClient {
|
|
|
61
61
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "workflows"),
|
|
62
62
|
method: "GET",
|
|
63
63
|
headers: _headers,
|
|
64
|
-
|
|
64
|
+
queryString: core.url
|
|
65
|
+
.queryBuilder()
|
|
66
|
+
.addMany(_queryParams)
|
|
67
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
68
|
+
.build(),
|
|
65
69
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
66
70
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
67
71
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -134,7 +138,11 @@ export class WorkflowsClient {
|
|
|
134
138
|
method: "POST",
|
|
135
139
|
headers: _headers,
|
|
136
140
|
contentType: "application/json",
|
|
137
|
-
|
|
141
|
+
queryString: core.url
|
|
142
|
+
.queryBuilder()
|
|
143
|
+
.addMany(_queryParams)
|
|
144
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
145
|
+
.build(),
|
|
138
146
|
requestType: "json",
|
|
139
147
|
body: _body,
|
|
140
148
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -203,7 +211,11 @@ export class WorkflowsClient {
|
|
|
203
211
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `workflows/${core.url.encodePathParam(id)}`),
|
|
204
212
|
method: "GET",
|
|
205
213
|
headers: _headers,
|
|
206
|
-
|
|
214
|
+
queryString: core.url
|
|
215
|
+
.queryBuilder()
|
|
216
|
+
.addMany(_queryParams)
|
|
217
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
218
|
+
.build(),
|
|
207
219
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
208
220
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
209
221
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -280,7 +292,11 @@ export class WorkflowsClient {
|
|
|
280
292
|
method: "PUT",
|
|
281
293
|
headers: _headers,
|
|
282
294
|
contentType: "application/json",
|
|
283
|
-
|
|
295
|
+
queryString: core.url
|
|
296
|
+
.queryBuilder()
|
|
297
|
+
.addMany(_queryParams)
|
|
298
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
299
|
+
.build(),
|
|
284
300
|
requestType: "json",
|
|
285
301
|
body: _body,
|
|
286
302
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -344,7 +360,7 @@ export class WorkflowsClient {
|
|
|
344
360
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `workflows/${core.url.encodePathParam(id)}`),
|
|
345
361
|
method: "DELETE",
|
|
346
362
|
headers: _headers,
|
|
347
|
-
|
|
363
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
348
364
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
349
365
|
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
350
366
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -414,7 +430,7 @@ export class WorkflowsClient {
|
|
|
414
430
|
method: "POST",
|
|
415
431
|
headers: _headers,
|
|
416
432
|
contentType: "application/json",
|
|
417
|
-
|
|
433
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
418
434
|
requestType: "json",
|
|
419
435
|
body: request,
|
|
420
436
|
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
@@ -2,10 +2,16 @@ import { base64Decode, base64Encode } from "../base64.mjs";
|
|
|
2
2
|
const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
|
|
3
3
|
export const BasicAuth = {
|
|
4
4
|
toAuthorizationHeader: (basicAuth) => {
|
|
5
|
+
var _a, _b;
|
|
5
6
|
if (basicAuth == null) {
|
|
6
7
|
return undefined;
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
+
const username = (_a = basicAuth.username) !== null && _a !== void 0 ? _a : "";
|
|
10
|
+
const password = (_b = basicAuth.password) !== null && _b !== void 0 ? _b : "";
|
|
11
|
+
if (username === "" && password === "") {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const token = base64Encode(`${username}:${password}`);
|
|
9
15
|
return `Basic ${token}`;
|
|
10
16
|
},
|
|
11
17
|
fromAuthorizationHeader: (header) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export { type AuthProvider, isAuthProvider } from "./AuthProvider.mjs";
|
|
2
2
|
export type { AuthRequest } from "./AuthRequest.mjs";
|
|
3
3
|
export { BasicAuth } from "./BasicAuth.mjs";
|
|
4
4
|
export { BearerToken } from "./BearerToken.mjs";
|
|
@@ -8,7 +8,13 @@ export declare namespace Fetcher {
|
|
|
8
8
|
method: string;
|
|
9
9
|
contentType?: string;
|
|
10
10
|
headers?: Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).
|
|
13
|
+
* Retained for backwards compatibility with custom fetchers and callers that
|
|
14
|
+
* still construct request args with a query-parameter object.
|
|
15
|
+
*/
|
|
11
16
|
queryParameters?: Record<string, unknown>;
|
|
17
|
+
queryString?: string;
|
|
12
18
|
body?: unknown;
|
|
13
19
|
timeoutMs?: number;
|
|
14
20
|
maxRetries?: number;
|
|
@@ -38,10 +44,12 @@ export declare namespace Fetcher {
|
|
|
38
44
|
}
|
|
39
45
|
interface TimeoutError {
|
|
40
46
|
reason: "timeout";
|
|
47
|
+
cause?: unknown;
|
|
41
48
|
}
|
|
42
49
|
interface UnknownError {
|
|
43
50
|
reason: "unknown";
|
|
44
51
|
errorMessage: string;
|
|
52
|
+
cause?: unknown;
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
55
|
export declare function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>>;
|
|
@@ -71,16 +71,11 @@ const SENSITIVE_QUERY_PARAMS = new Set([
|
|
|
71
71
|
]);
|
|
72
72
|
function redactQueryParameters(queryParameters) {
|
|
73
73
|
if (queryParameters == null) {
|
|
74
|
-
return
|
|
74
|
+
return undefined;
|
|
75
75
|
}
|
|
76
76
|
const redacted = {};
|
|
77
77
|
for (const [key, value] of Object.entries(queryParameters)) {
|
|
78
|
-
|
|
79
|
-
redacted[key] = "[REDACTED]";
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
redacted[key] = value;
|
|
83
|
-
}
|
|
78
|
+
redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
|
|
84
79
|
}
|
|
85
80
|
return redacted;
|
|
86
81
|
}
|
|
@@ -182,7 +177,13 @@ function getHeaders(args) {
|
|
|
182
177
|
export function fetcherImpl(args) {
|
|
183
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
179
|
var _a, _b, _c;
|
|
185
|
-
|
|
180
|
+
let url = args.url;
|
|
181
|
+
if (args.queryString != null && args.queryString.length > 0) {
|
|
182
|
+
url = `${url}?${args.queryString}`;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
url = createRequestUrl(args.url, args.queryParameters);
|
|
186
|
+
}
|
|
186
187
|
const requestBody = yield getRequestBody({
|
|
187
188
|
body: args.body,
|
|
188
189
|
type: (_a = args.requestType) !== null && _a !== void 0 ? _a : "other",
|
|
@@ -257,6 +258,7 @@ export function fetcherImpl(args) {
|
|
|
257
258
|
error: {
|
|
258
259
|
reason: "unknown",
|
|
259
260
|
errorMessage: "The user aborted a request",
|
|
261
|
+
cause: error,
|
|
260
262
|
},
|
|
261
263
|
rawResponse: abortRawResponse,
|
|
262
264
|
};
|
|
@@ -274,6 +276,7 @@ export function fetcherImpl(args) {
|
|
|
274
276
|
ok: false,
|
|
275
277
|
error: {
|
|
276
278
|
reason: "timeout",
|
|
279
|
+
cause: error,
|
|
277
280
|
},
|
|
278
281
|
rawResponse: abortRawResponse,
|
|
279
282
|
};
|
|
@@ -292,6 +295,7 @@ export function fetcherImpl(args) {
|
|
|
292
295
|
error: {
|
|
293
296
|
reason: "unknown",
|
|
294
297
|
errorMessage: error.message,
|
|
298
|
+
cause: error,
|
|
295
299
|
},
|
|
296
300
|
rawResponse: unknownRawResponse,
|
|
297
301
|
};
|
|
@@ -309,6 +313,7 @@ export function fetcherImpl(args) {
|
|
|
309
313
|
error: {
|
|
310
314
|
reason: "unknown",
|
|
311
315
|
errorMessage: toJson(error),
|
|
316
|
+
cause: error,
|
|
312
317
|
},
|
|
313
318
|
rawResponse: unknownRawResponse,
|
|
314
319
|
};
|
|
@@ -11,6 +11,9 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
|
|
|
11
11
|
const MAX_RETRY_DELAY = 60000; // in milliseconds
|
|
12
12
|
const DEFAULT_MAX_RETRIES = 2;
|
|
13
13
|
const JITTER_FACTOR = 0.2; // 20% random jitter
|
|
14
|
+
function isRetryableStatusCode(statusCode) {
|
|
15
|
+
return [408, 429].includes(statusCode) || statusCode >= 500;
|
|
16
|
+
}
|
|
14
17
|
function addPositiveJitter(delay) {
|
|
15
18
|
const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
|
|
16
19
|
return delay * jitterMultiplier;
|
|
@@ -50,7 +53,7 @@ export function requestWithRetries(requestFn_1) {
|
|
|
50
53
|
return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
|
|
51
54
|
let response = yield requestFn();
|
|
52
55
|
for (let i = 0; i < maxRetries; ++i) {
|
|
53
|
-
if (
|
|
56
|
+
if (isRetryableStatusCode(response.status)) {
|
|
54
57
|
const delay = getRetryDelayFromHeaders(response, i);
|
|
55
58
|
yield new Promise((resolve) => setTimeout(resolve, delay));
|
|
56
59
|
response = yield requestFn();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a fluent builder for constructing URL query strings.
|
|
3
|
+
*
|
|
4
|
+
* Each `.add()` call serializes its value immediately (like C#'s builder),
|
|
5
|
+
* so no format tracking is needed — the style is applied at add-time.
|
|
6
|
+
*
|
|
7
|
+
* Usage (generated code):
|
|
8
|
+
*
|
|
9
|
+
* const qs = core.url.queryBuilder()
|
|
10
|
+
* .add("limit", limit)
|
|
11
|
+
* .add("tags", tags, { style: "comma" }) // explode: false
|
|
12
|
+
* .mergeAdditional(requestOptions?.queryParams)
|
|
13
|
+
* .build();
|
|
14
|
+
*/
|
|
15
|
+
export declare function queryBuilder(): QueryStringBuilder;
|
|
16
|
+
declare class QueryStringBuilder {
|
|
17
|
+
private parts;
|
|
18
|
+
/**
|
|
19
|
+
* Adds a query parameter, serializing it immediately.
|
|
20
|
+
*
|
|
21
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
22
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
23
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
24
|
+
*
|
|
25
|
+
* Null / undefined values are silently skipped.
|
|
26
|
+
*/
|
|
27
|
+
add(key: string, value: unknown, options?: {
|
|
28
|
+
style?: "comma";
|
|
29
|
+
}): this;
|
|
30
|
+
/**
|
|
31
|
+
* Adds multiple query parameters at once from a record.
|
|
32
|
+
* All parameters use the default "repeat" array format.
|
|
33
|
+
* Null / undefined values are silently skipped.
|
|
34
|
+
*/
|
|
35
|
+
addMany(params: Record<string, unknown>): this;
|
|
36
|
+
/**
|
|
37
|
+
* Merges additional query parameters supplied at call-time via
|
|
38
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
39
|
+
*/
|
|
40
|
+
mergeAdditional(additionalParams?: Record<string, unknown>): this;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the assembled query string (without the leading `?`).
|
|
43
|
+
* Returns an empty string when no parameters were added.
|
|
44
|
+
*/
|
|
45
|
+
build(): string;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { toQueryString } from "./qs.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a fluent builder for constructing URL query strings.
|
|
4
|
+
*
|
|
5
|
+
* Each `.add()` call serializes its value immediately (like C#'s builder),
|
|
6
|
+
* so no format tracking is needed — the style is applied at add-time.
|
|
7
|
+
*
|
|
8
|
+
* Usage (generated code):
|
|
9
|
+
*
|
|
10
|
+
* const qs = core.url.queryBuilder()
|
|
11
|
+
* .add("limit", limit)
|
|
12
|
+
* .add("tags", tags, { style: "comma" }) // explode: false
|
|
13
|
+
* .mergeAdditional(requestOptions?.queryParams)
|
|
14
|
+
* .build();
|
|
15
|
+
*/
|
|
16
|
+
export function queryBuilder() {
|
|
17
|
+
return new QueryStringBuilder();
|
|
18
|
+
}
|
|
19
|
+
class QueryStringBuilder {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.parts = new Map();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Adds a query parameter, serializing it immediately.
|
|
25
|
+
*
|
|
26
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
27
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
28
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
29
|
+
*
|
|
30
|
+
* Null / undefined values are silently skipped.
|
|
31
|
+
*/
|
|
32
|
+
add(key, value, options) {
|
|
33
|
+
if (value === undefined || value === null) {
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
const serialized = toQueryString({ [key]: value }, { arrayFormat: (options === null || options === void 0 ? void 0 : options.style) === "comma" ? "comma" : "repeat" });
|
|
37
|
+
if (serialized.length > 0) {
|
|
38
|
+
this.parts.set(key, serialized);
|
|
39
|
+
}
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Adds multiple query parameters at once from a record.
|
|
44
|
+
* All parameters use the default "repeat" array format.
|
|
45
|
+
* Null / undefined values are silently skipped.
|
|
46
|
+
*/
|
|
47
|
+
addMany(params) {
|
|
48
|
+
if (params != null) {
|
|
49
|
+
for (const [key, value] of Object.entries(params)) {
|
|
50
|
+
this.add(key, value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Merges additional query parameters supplied at call-time via
|
|
57
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
58
|
+
*/
|
|
59
|
+
mergeAdditional(additionalParams) {
|
|
60
|
+
if (additionalParams != null) {
|
|
61
|
+
for (const [key, value] of Object.entries(additionalParams)) {
|
|
62
|
+
if (value === undefined || value === null) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" });
|
|
66
|
+
if (serialized.length > 0) {
|
|
67
|
+
this.parts.set(key, serialized);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the assembled query string (without the leading `?`).
|
|
75
|
+
* Returns an empty string when no parameters were added.
|
|
76
|
+
*/
|
|
77
|
+
build() {
|
|
78
|
+
return [...this.parts.values()].join("&");
|
|
79
|
+
}
|
|
80
|
+
}
|
package/dist/esm/core/url/qs.mjs
CHANGED
|
@@ -23,19 +23,31 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
23
23
|
if (value.length === 0) {
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const effectiveFormat = options.arrayFormat;
|
|
27
|
+
if (effectiveFormat === "comma") {
|
|
28
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
29
|
+
const encodedValues = value
|
|
30
|
+
.filter((item) => item !== undefined && item !== null)
|
|
31
|
+
.map((item) => encodeValue(item, options.encode));
|
|
32
|
+
if (encodedValues.length > 0) {
|
|
33
|
+
parts.push(`${encodedKey}=${encodedValues.join(",")}`);
|
|
30
34
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (let i = 0; i < value.length; i++) {
|
|
38
|
+
const item = value[i];
|
|
39
|
+
if (item === undefined) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
43
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
44
|
+
parts.push(...stringifyObject(item, arrayKey, options));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
48
|
+
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
49
|
+
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
50
|
+
}
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
53
|
}
|
|
@@ -14,11 +14,14 @@ export function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
|
14
14
|
rawResponse: rawResponse,
|
|
15
15
|
});
|
|
16
16
|
case "timeout":
|
|
17
|
-
throw new errors.phenomlTimeoutError(`Timeout exceeded when calling ${method} ${path}
|
|
17
|
+
throw new errors.phenomlTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
18
|
+
cause: error.cause,
|
|
19
|
+
});
|
|
18
20
|
case "unknown":
|
|
19
21
|
throw new errors.phenomlError({
|
|
20
22
|
message: error.errorMessage,
|
|
21
23
|
rawResponse: rawResponse,
|
|
24
|
+
cause: error.cause,
|
|
22
25
|
});
|
|
23
26
|
default:
|
|
24
27
|
throw new errors.phenomlError({
|
|
@@ -3,10 +3,12 @@ export declare class phenomlError extends Error {
|
|
|
3
3
|
readonly statusCode?: number;
|
|
4
4
|
readonly body?: unknown;
|
|
5
5
|
readonly rawResponse?: core.RawResponse;
|
|
6
|
-
|
|
6
|
+
readonly cause?: unknown;
|
|
7
|
+
constructor({ message, statusCode, body, rawResponse, cause, }: {
|
|
7
8
|
message?: string;
|
|
8
9
|
statusCode?: number;
|
|
9
10
|
body?: unknown;
|
|
10
11
|
rawResponse?: core.RawResponse;
|
|
12
|
+
cause?: unknown;
|
|
11
13
|
});
|
|
12
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import { toJson } from "../core/json.mjs";
|
|
3
3
|
export class phenomlError extends Error {
|
|
4
|
-
constructor({ message, statusCode, body, rawResponse, }) {
|
|
4
|
+
constructor({ message, statusCode, body, rawResponse, cause, }) {
|
|
5
5
|
super(buildMessage({ message, statusCode, body }));
|
|
6
6
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
7
7
|
if (Error.captureStackTrace) {
|
|
@@ -11,6 +11,9 @@ export class phenomlError extends Error {
|
|
|
11
11
|
this.statusCode = statusCode;
|
|
12
12
|
this.body = body;
|
|
13
13
|
this.rawResponse = rawResponse;
|
|
14
|
+
if (cause != null) {
|
|
15
|
+
this.cause = cause;
|
|
16
|
+
}
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
function buildMessage({ message, statusCode, body, }) {
|