phenoml 0.0.6 → 0.0.7
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/Client.js +2 -2
- package/dist/cjs/api/index.d.ts +0 -1
- package/dist/cjs/api/index.js +0 -1
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +117 -15
- package/dist/cjs/api/resources/workflows/client/Client.js +392 -45
- package/dist/cjs/api/resources/workflows/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/workflows/client/index.js +15 -0
- package/dist/cjs/api/resources/workflows/index.d.ts +0 -1
- package/dist/cjs/api/resources/workflows/index.js +0 -1
- package/dist/cjs/api/resources/workflows/{resources/workflows/types → types}/WorkflowsGetResponse.d.ts +1 -1
- package/dist/cjs/api/resources/workflows/{resources/workflows/types → types}/WorkflowsUpdateResponse.d.ts +1 -1
- package/dist/cjs/api/resources/workflows/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/workflows/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/index.d.mts +0 -1
- package/dist/esm/api/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/client/Client.d.mts +117 -15
- package/dist/esm/api/resources/workflows/client/Client.mjs +392 -45
- package/dist/esm/api/resources/workflows/client/index.d.mts +1 -0
- package/dist/esm/api/resources/workflows/client/index.mjs +1 -0
- package/dist/esm/api/resources/workflows/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/{resources/workflows/types → types}/WorkflowsGetResponse.d.mts +1 -1
- package/dist/esm/api/resources/workflows/types/WorkflowsGetResponse.mjs +2 -0
- package/dist/esm/api/resources/workflows/{resources/workflows/types → types}/WorkflowsUpdateResponse.d.mts +1 -1
- package/dist/esm/api/resources/workflows/types/WorkflowsUpdateResponse.mjs +2 -0
- package/dist/esm/api/resources/workflows/types/index.d.mts +3 -0
- package/dist/esm/api/resources/workflows/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +12 -506
- package/dist/cjs/api/resources/workflows/resources/index.d.ts +0 -4
- package/dist/cjs/api/resources/workflows/resources/index.js +0 -43
- package/dist/cjs/api/resources/workflows/resources/mcpServer/client/Client.d.ts +0 -50
- package/dist/cjs/api/resources/workflows/resources/mcpServer/client/Client.js +0 -268
- package/dist/cjs/api/resources/workflows/resources/mcpServer/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/workflows/resources/mcpServer/index.d.ts +0 -2
- package/dist/cjs/api/resources/workflows/resources/mcpServer/index.js +0 -18
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/index.d.ts +0 -1
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/index.js +0 -37
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/tools/client/Client.d.ts +0 -49
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/tools/client/Client.js +0 -265
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/tools/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/tools/client/index.js +0 -2
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/tools/index.d.ts +0 -1
- package/dist/cjs/api/resources/workflows/resources/mcpServer/resources/tools/index.js +0 -17
- package/dist/cjs/api/resources/workflows/resources/workflows/client/Client.d.ts +0 -145
- package/dist/cjs/api/resources/workflows/resources/workflows/client/Client.js +0 -569
- package/dist/cjs/api/resources/workflows/resources/workflows/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/workflows/resources/workflows/client/index.js +0 -17
- package/dist/cjs/api/resources/workflows/resources/workflows/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/workflows/resources/workflows/index.d.ts +0 -2
- package/dist/cjs/api/resources/workflows/resources/workflows/index.js +0 -18
- package/dist/cjs/api/resources/workflows/resources/workflows/types/index.d.ts +0 -3
- package/dist/cjs/api/resources/workflows/resources/workflows/types/index.js +0 -19
- package/dist/cjs/api/types/CohortResponse.d.ts +0 -1
- package/dist/cjs/api/types/CohortResponse.js +0 -3
- package/dist/cjs/api/types/Lang2FhirAndCreateResponse.d.ts +0 -1
- package/dist/cjs/api/types/Lang2FhirAndCreateResponse.js +0 -3
- package/dist/cjs/api/types/Lang2FhirAndSearchResponse.d.ts +0 -1
- package/dist/cjs/api/types/Lang2FhirAndSearchResponse.js +0 -3
- package/dist/cjs/api/types/McpServerResponse.d.ts +0 -1
- package/dist/cjs/api/types/McpServerResponse.js +0 -3
- package/dist/cjs/api/types/McpServerToolCallResponse.d.ts +0 -1
- package/dist/cjs/api/types/McpServerToolCallResponse.js +0 -3
- package/dist/cjs/api/types/McpServerToolResponse.d.ts +0 -1
- package/dist/cjs/api/types/McpServerToolResponse.js +0 -3
- package/dist/cjs/api/types/SearchConcept.d.ts +0 -1
- package/dist/cjs/api/types/SearchConcept.js +0 -3
- package/dist/cjs/api/types/index.d.ts +0 -7
- package/dist/cjs/api/types/index.js +0 -23
- package/dist/esm/api/resources/workflows/resources/index.d.mts +0 -4
- package/dist/esm/api/resources/workflows/resources/index.mjs +0 -4
- package/dist/esm/api/resources/workflows/resources/mcpServer/client/Client.d.mts +0 -50
- package/dist/esm/api/resources/workflows/resources/mcpServer/client/Client.mjs +0 -231
- package/dist/esm/api/resources/workflows/resources/mcpServer/client/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/client/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/index.d.mts +0 -2
- package/dist/esm/api/resources/workflows/resources/mcpServer/index.mjs +0 -2
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/tools/client/Client.d.mts +0 -49
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/tools/client/Client.mjs +0 -228
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/tools/client/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/tools/client/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/tools/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/resources/mcpServer/resources/tools/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/resources/workflows/client/Client.d.mts +0 -145
- package/dist/esm/api/resources/workflows/resources/workflows/client/Client.mjs +0 -532
- package/dist/esm/api/resources/workflows/resources/workflows/client/index.d.mts +0 -2
- package/dist/esm/api/resources/workflows/resources/workflows/client/index.mjs +0 -2
- package/dist/esm/api/resources/workflows/resources/workflows/index.d.mts +0 -2
- package/dist/esm/api/resources/workflows/resources/workflows/index.mjs +0 -2
- package/dist/esm/api/resources/workflows/resources/workflows/types/WorkflowsGetResponse.mjs +0 -2
- package/dist/esm/api/resources/workflows/resources/workflows/types/WorkflowsUpdateResponse.mjs +0 -2
- package/dist/esm/api/resources/workflows/resources/workflows/types/index.d.mts +0 -3
- package/dist/esm/api/resources/workflows/resources/workflows/types/index.mjs +0 -3
- package/dist/esm/api/types/CohortResponse.d.mts +0 -1
- package/dist/esm/api/types/CohortResponse.mjs +0 -2
- package/dist/esm/api/types/Lang2FhirAndCreateResponse.d.mts +0 -1
- package/dist/esm/api/types/Lang2FhirAndCreateResponse.mjs +0 -2
- package/dist/esm/api/types/Lang2FhirAndSearchResponse.d.mts +0 -1
- package/dist/esm/api/types/Lang2FhirAndSearchResponse.mjs +0 -2
- package/dist/esm/api/types/McpServerResponse.d.mts +0 -1
- package/dist/esm/api/types/McpServerResponse.mjs +0 -2
- package/dist/esm/api/types/McpServerToolCallResponse.d.mts +0 -1
- package/dist/esm/api/types/McpServerToolCallResponse.mjs +0 -2
- package/dist/esm/api/types/McpServerToolResponse.d.mts +0 -1
- package/dist/esm/api/types/McpServerToolResponse.mjs +0 -2
- package/dist/esm/api/types/SearchConcept.d.mts +0 -1
- package/dist/esm/api/types/SearchConcept.mjs +0 -2
- package/dist/esm/api/types/index.d.mts +0 -7
- package/dist/esm/api/types/index.mjs +0 -7
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/CreateWorkflowRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/CreateWorkflowRequest.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/ExecuteWorkflowRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/ExecuteWorkflowRequest.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/UpdateWorkflowRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/UpdateWorkflowRequest.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsGetRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsGetRequest.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsListRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsListRequest.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/client → client}/requests/index.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/mcpServer/client → client/requests}/index.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/types → types}/WorkflowsDeleteResponse.d.ts +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/types → types}/WorkflowsDeleteResponse.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/types → types}/WorkflowsGetResponse.js +0 -0
- /package/dist/cjs/api/resources/workflows/{resources/workflows/types → types}/WorkflowsUpdateResponse.js +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/CreateWorkflowRequest.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/CreateWorkflowRequest.mjs +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/ExecuteWorkflowRequest.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/ExecuteWorkflowRequest.mjs +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/UpdateWorkflowRequest.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/UpdateWorkflowRequest.mjs +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsGetRequest.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsGetRequest.mjs +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsListRequest.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/WorkflowsListRequest.mjs +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/index.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/client → client}/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/types → types}/WorkflowsDeleteResponse.d.mts +0 -0
- /package/dist/esm/api/resources/workflows/{resources/workflows/types → types}/WorkflowsDeleteResponse.mjs +0 -0
|
@@ -8,55 +8,251 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import * as environments from "../../../../environments.mjs";
|
|
12
23
|
import * as core from "../../../../core/index.mjs";
|
|
24
|
+
import * as phenoml from "../../../index.mjs";
|
|
13
25
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
14
26
|
import * as errors from "../../../../errors/index.mjs";
|
|
15
|
-
import { Workflows as Workflows_ } from "../resources/workflows/client/Client.mjs";
|
|
16
|
-
import { McpServer } from "../resources/mcpServer/client/Client.mjs";
|
|
17
27
|
export class Workflows {
|
|
18
28
|
constructor(_options = {}) {
|
|
19
29
|
this._options = _options;
|
|
20
30
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves all workflow definitions for the authenticated user
|
|
33
|
+
*
|
|
34
|
+
* @param {phenoml.workflows.WorkflowsListRequest} request
|
|
35
|
+
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link phenoml.workflows.UnauthorizedError}
|
|
38
|
+
* @throws {@link phenoml.workflows.ForbiddenError}
|
|
39
|
+
* @throws {@link phenoml.workflows.InternalServerError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.workflows.list({
|
|
43
|
+
* verbose: true
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
list(request = {}, requestOptions) {
|
|
47
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
24
48
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
49
|
+
__list() {
|
|
50
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
52
|
+
const { verbose } = request;
|
|
53
|
+
const _queryParams = {};
|
|
54
|
+
if (verbose != null) {
|
|
55
|
+
_queryParams["verbose"] = verbose.toString();
|
|
56
|
+
}
|
|
57
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
58
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
59
|
+
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"),
|
|
60
|
+
method: "GET",
|
|
61
|
+
headers: _headers,
|
|
62
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
63
|
+
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,
|
|
64
|
+
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,
|
|
65
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
66
|
+
});
|
|
67
|
+
if (_response.ok) {
|
|
68
|
+
return {
|
|
69
|
+
data: _response.body,
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 401:
|
|
76
|
+
throw new phenoml.workflows.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
77
|
+
case 403:
|
|
78
|
+
throw new phenoml.workflows.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 500:
|
|
80
|
+
throw new phenoml.workflows.InternalServerError(_response.error.body, _response.rawResponse);
|
|
81
|
+
default:
|
|
82
|
+
throw new errors.phenomlError({
|
|
83
|
+
statusCode: _response.error.statusCode,
|
|
84
|
+
body: _response.error.body,
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
switch (_response.error.reason) {
|
|
90
|
+
case "non-json":
|
|
91
|
+
throw new errors.phenomlError({
|
|
92
|
+
statusCode: _response.error.statusCode,
|
|
93
|
+
body: _response.error.rawBody,
|
|
94
|
+
rawResponse: _response.rawResponse,
|
|
95
|
+
});
|
|
96
|
+
case "timeout":
|
|
97
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /workflows.");
|
|
98
|
+
case "unknown":
|
|
99
|
+
throw new errors.phenomlError({
|
|
100
|
+
message: _response.error.errorMessage,
|
|
101
|
+
rawResponse: _response.rawResponse,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
28
105
|
}
|
|
29
106
|
/**
|
|
107
|
+
* Creates a new workflow definition with graph generation from workflow instructions
|
|
108
|
+
*
|
|
109
|
+
* @param {phenoml.workflows.CreateWorkflowRequest} request
|
|
30
110
|
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
111
|
*
|
|
112
|
+
* @throws {@link phenoml.workflows.BadRequestError}
|
|
113
|
+
* @throws {@link phenoml.workflows.UnauthorizedError}
|
|
114
|
+
* @throws {@link phenoml.workflows.ForbiddenError}
|
|
115
|
+
* @throws {@link phenoml.workflows.InternalServerError}
|
|
116
|
+
*
|
|
32
117
|
* @example
|
|
33
|
-
* await client.workflows.
|
|
118
|
+
* await client.workflows.create({
|
|
119
|
+
* verbose: true,
|
|
120
|
+
* name: "Patient Data Mapping Workflow",
|
|
121
|
+
* workflow_instructions: "Given diagnosis data, find the patient and create condition record",
|
|
122
|
+
* sample_data: {
|
|
123
|
+
* "patient_last_name": "Rippin",
|
|
124
|
+
* "patient_first_name": "Clay",
|
|
125
|
+
* "diagnosis_code": "I10"
|
|
126
|
+
* },
|
|
127
|
+
* fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
128
|
+
* })
|
|
34
129
|
*/
|
|
35
|
-
|
|
36
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
130
|
+
create(request, requestOptions) {
|
|
131
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
37
132
|
}
|
|
38
|
-
|
|
133
|
+
__create(request, requestOptions) {
|
|
39
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
135
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
136
|
+
const { verbose } = request, _body = __rest(request, ["verbose"]);
|
|
137
|
+
const _queryParams = {};
|
|
138
|
+
if (verbose != null) {
|
|
139
|
+
_queryParams["verbose"] = verbose.toString();
|
|
140
|
+
}
|
|
41
141
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
42
142
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
43
|
-
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, "
|
|
143
|
+
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"),
|
|
44
144
|
method: "POST",
|
|
45
145
|
headers: _headers,
|
|
46
|
-
|
|
146
|
+
contentType: "application/json",
|
|
147
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
148
|
+
requestType: "json",
|
|
149
|
+
body: _body,
|
|
47
150
|
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,
|
|
48
151
|
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,
|
|
49
152
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
50
153
|
});
|
|
51
154
|
if (_response.ok) {
|
|
52
|
-
return {
|
|
155
|
+
return {
|
|
156
|
+
data: _response.body,
|
|
157
|
+
rawResponse: _response.rawResponse,
|
|
158
|
+
};
|
|
53
159
|
}
|
|
54
160
|
if (_response.error.reason === "status-code") {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
161
|
+
switch (_response.error.statusCode) {
|
|
162
|
+
case 400:
|
|
163
|
+
throw new phenoml.workflows.BadRequestError(_response.error.body, _response.rawResponse);
|
|
164
|
+
case 401:
|
|
165
|
+
throw new phenoml.workflows.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
166
|
+
case 403:
|
|
167
|
+
throw new phenoml.workflows.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
168
|
+
case 500:
|
|
169
|
+
throw new phenoml.workflows.InternalServerError(_response.error.body, _response.rawResponse);
|
|
170
|
+
default:
|
|
171
|
+
throw new errors.phenomlError({
|
|
172
|
+
statusCode: _response.error.statusCode,
|
|
173
|
+
body: _response.error.body,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
switch (_response.error.reason) {
|
|
179
|
+
case "non-json":
|
|
180
|
+
throw new errors.phenomlError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.rawBody,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
case "timeout":
|
|
186
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /workflows.");
|
|
187
|
+
case "unknown":
|
|
188
|
+
throw new errors.phenomlError({
|
|
189
|
+
message: _response.error.errorMessage,
|
|
190
|
+
rawResponse: _response.rawResponse,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Retrieves a workflow definition by its ID
|
|
197
|
+
*
|
|
198
|
+
* @param {string} id - ID of the workflow to retrieve
|
|
199
|
+
* @param {phenoml.workflows.WorkflowsGetRequest} request
|
|
200
|
+
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
|
+
*
|
|
202
|
+
* @throws {@link phenoml.workflows.UnauthorizedError}
|
|
203
|
+
* @throws {@link phenoml.workflows.ForbiddenError}
|
|
204
|
+
* @throws {@link phenoml.workflows.NotFoundError}
|
|
205
|
+
* @throws {@link phenoml.workflows.InternalServerError}
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* await client.workflows.get("id", {
|
|
209
|
+
* verbose: true
|
|
210
|
+
* })
|
|
211
|
+
*/
|
|
212
|
+
get(id, request = {}, requestOptions) {
|
|
213
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, request, requestOptions));
|
|
214
|
+
}
|
|
215
|
+
__get(id_1) {
|
|
216
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
217
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
218
|
+
const { verbose } = request;
|
|
219
|
+
const _queryParams = {};
|
|
220
|
+
if (verbose != null) {
|
|
221
|
+
_queryParams["verbose"] = verbose.toString();
|
|
222
|
+
}
|
|
223
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
224
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
225
|
+
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/${encodeURIComponent(id)}`),
|
|
226
|
+
method: "GET",
|
|
227
|
+
headers: _headers,
|
|
228
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
229
|
+
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,
|
|
230
|
+
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,
|
|
231
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
232
|
+
});
|
|
233
|
+
if (_response.ok) {
|
|
234
|
+
return {
|
|
235
|
+
data: _response.body,
|
|
58
236
|
rawResponse: _response.rawResponse,
|
|
59
|
-
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
if (_response.error.reason === "status-code") {
|
|
240
|
+
switch (_response.error.statusCode) {
|
|
241
|
+
case 401:
|
|
242
|
+
throw new phenoml.workflows.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
243
|
+
case 403:
|
|
244
|
+
throw new phenoml.workflows.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
245
|
+
case 404:
|
|
246
|
+
throw new phenoml.workflows.NotFoundError(_response.error.body, _response.rawResponse);
|
|
247
|
+
case 500:
|
|
248
|
+
throw new phenoml.workflows.InternalServerError(_response.error.body, _response.rawResponse);
|
|
249
|
+
default:
|
|
250
|
+
throw new errors.phenomlError({
|
|
251
|
+
statusCode: _response.error.statusCode,
|
|
252
|
+
body: _response.error.body,
|
|
253
|
+
rawResponse: _response.rawResponse,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
60
256
|
}
|
|
61
257
|
switch (_response.error.reason) {
|
|
62
258
|
case "non-json":
|
|
@@ -66,7 +262,7 @@ export class Workflows {
|
|
|
66
262
|
rawResponse: _response.rawResponse,
|
|
67
263
|
});
|
|
68
264
|
case "timeout":
|
|
69
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling
|
|
265
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /workflows/{id}.");
|
|
70
266
|
case "unknown":
|
|
71
267
|
throw new errors.phenomlError({
|
|
72
268
|
message: _response.error.errorMessage,
|
|
@@ -76,36 +272,151 @@ export class Workflows {
|
|
|
76
272
|
});
|
|
77
273
|
}
|
|
78
274
|
/**
|
|
275
|
+
* Updates an existing workflow definition
|
|
276
|
+
*
|
|
277
|
+
* @param {string} id - ID of the workflow to update
|
|
278
|
+
* @param {phenoml.workflows.UpdateWorkflowRequest} request
|
|
79
279
|
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
280
|
*
|
|
281
|
+
* @throws {@link phenoml.workflows.BadRequestError}
|
|
282
|
+
* @throws {@link phenoml.workflows.UnauthorizedError}
|
|
283
|
+
* @throws {@link phenoml.workflows.ForbiddenError}
|
|
284
|
+
* @throws {@link phenoml.workflows.NotFoundError}
|
|
285
|
+
* @throws {@link phenoml.workflows.InternalServerError}
|
|
286
|
+
*
|
|
81
287
|
* @example
|
|
82
|
-
* await client.workflows.
|
|
288
|
+
* await client.workflows.update("id", {
|
|
289
|
+
* verbose: true,
|
|
290
|
+
* name: "Updated Patient Data Mapping Workflow",
|
|
291
|
+
* workflow_instructions: "Given diagnosis data, find the patient and create condition record",
|
|
292
|
+
* sample_data: {
|
|
293
|
+
* "patient_last_name": "Smith",
|
|
294
|
+
* "patient_first_name": "John",
|
|
295
|
+
* "diagnosis_code": "E11"
|
|
296
|
+
* },
|
|
297
|
+
* fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
|
|
298
|
+
* })
|
|
83
299
|
*/
|
|
84
|
-
|
|
85
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
300
|
+
update(id, request, requestOptions) {
|
|
301
|
+
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
86
302
|
}
|
|
87
|
-
|
|
303
|
+
__update(id, request, requestOptions) {
|
|
88
304
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
305
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
306
|
+
const { verbose } = request, _body = __rest(request, ["verbose"]);
|
|
307
|
+
const _queryParams = {};
|
|
308
|
+
if (verbose != null) {
|
|
309
|
+
_queryParams["verbose"] = verbose.toString();
|
|
310
|
+
}
|
|
90
311
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
91
312
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
92
|
-
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,
|
|
93
|
-
method: "
|
|
313
|
+
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/${encodeURIComponent(id)}`),
|
|
314
|
+
method: "PUT",
|
|
94
315
|
headers: _headers,
|
|
95
|
-
|
|
316
|
+
contentType: "application/json",
|
|
317
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
318
|
+
requestType: "json",
|
|
319
|
+
body: _body,
|
|
96
320
|
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,
|
|
97
321
|
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,
|
|
98
322
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
99
323
|
});
|
|
100
324
|
if (_response.ok) {
|
|
101
|
-
return {
|
|
325
|
+
return {
|
|
326
|
+
data: _response.body,
|
|
327
|
+
rawResponse: _response.rawResponse,
|
|
328
|
+
};
|
|
102
329
|
}
|
|
103
330
|
if (_response.error.reason === "status-code") {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
331
|
+
switch (_response.error.statusCode) {
|
|
332
|
+
case 400:
|
|
333
|
+
throw new phenoml.workflows.BadRequestError(_response.error.body, _response.rawResponse);
|
|
334
|
+
case 401:
|
|
335
|
+
throw new phenoml.workflows.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
336
|
+
case 403:
|
|
337
|
+
throw new phenoml.workflows.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
338
|
+
case 404:
|
|
339
|
+
throw new phenoml.workflows.NotFoundError(_response.error.body, _response.rawResponse);
|
|
340
|
+
case 500:
|
|
341
|
+
throw new phenoml.workflows.InternalServerError(_response.error.body, _response.rawResponse);
|
|
342
|
+
default:
|
|
343
|
+
throw new errors.phenomlError({
|
|
344
|
+
statusCode: _response.error.statusCode,
|
|
345
|
+
body: _response.error.body,
|
|
346
|
+
rawResponse: _response.rawResponse,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
switch (_response.error.reason) {
|
|
351
|
+
case "non-json":
|
|
352
|
+
throw new errors.phenomlError({
|
|
353
|
+
statusCode: _response.error.statusCode,
|
|
354
|
+
body: _response.error.rawBody,
|
|
355
|
+
rawResponse: _response.rawResponse,
|
|
356
|
+
});
|
|
357
|
+
case "timeout":
|
|
358
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling PUT /workflows/{id}.");
|
|
359
|
+
case "unknown":
|
|
360
|
+
throw new errors.phenomlError({
|
|
361
|
+
message: _response.error.errorMessage,
|
|
362
|
+
rawResponse: _response.rawResponse,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Deletes a workflow definition by its ID
|
|
369
|
+
*
|
|
370
|
+
* @param {string} id - ID of the workflow to delete
|
|
371
|
+
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
372
|
+
*
|
|
373
|
+
* @throws {@link phenoml.workflows.UnauthorizedError}
|
|
374
|
+
* @throws {@link phenoml.workflows.ForbiddenError}
|
|
375
|
+
* @throws {@link phenoml.workflows.NotFoundError}
|
|
376
|
+
* @throws {@link phenoml.workflows.InternalServerError}
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* await client.workflows.delete("id")
|
|
380
|
+
*/
|
|
381
|
+
delete(id, requestOptions) {
|
|
382
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
383
|
+
}
|
|
384
|
+
__delete(id, requestOptions) {
|
|
385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
387
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
388
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
389
|
+
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/${encodeURIComponent(id)}`),
|
|
390
|
+
method: "DELETE",
|
|
391
|
+
headers: _headers,
|
|
392
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
393
|
+
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,
|
|
394
|
+
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,
|
|
395
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
396
|
+
});
|
|
397
|
+
if (_response.ok) {
|
|
398
|
+
return {
|
|
399
|
+
data: _response.body,
|
|
107
400
|
rawResponse: _response.rawResponse,
|
|
108
|
-
}
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
if (_response.error.reason === "status-code") {
|
|
404
|
+
switch (_response.error.statusCode) {
|
|
405
|
+
case 401:
|
|
406
|
+
throw new phenoml.workflows.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
407
|
+
case 403:
|
|
408
|
+
throw new phenoml.workflows.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
409
|
+
case 404:
|
|
410
|
+
throw new phenoml.workflows.NotFoundError(_response.error.body, _response.rawResponse);
|
|
411
|
+
case 500:
|
|
412
|
+
throw new phenoml.workflows.InternalServerError(_response.error.body, _response.rawResponse);
|
|
413
|
+
default:
|
|
414
|
+
throw new errors.phenomlError({
|
|
415
|
+
statusCode: _response.error.statusCode,
|
|
416
|
+
body: _response.error.body,
|
|
417
|
+
rawResponse: _response.rawResponse,
|
|
418
|
+
});
|
|
419
|
+
}
|
|
109
420
|
}
|
|
110
421
|
switch (_response.error.reason) {
|
|
111
422
|
case "non-json":
|
|
@@ -115,7 +426,7 @@ export class Workflows {
|
|
|
115
426
|
rawResponse: _response.rawResponse,
|
|
116
427
|
});
|
|
117
428
|
case "timeout":
|
|
118
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling
|
|
429
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling DELETE /workflows/{id}.");
|
|
119
430
|
case "unknown":
|
|
120
431
|
throw new errors.phenomlError({
|
|
121
432
|
message: _response.error.errorMessage,
|
|
@@ -125,36 +436,72 @@ export class Workflows {
|
|
|
125
436
|
});
|
|
126
437
|
}
|
|
127
438
|
/**
|
|
439
|
+
* Executes a workflow with provided input data and returns results
|
|
440
|
+
*
|
|
441
|
+
* @param {string} id - ID of the workflow to execute
|
|
442
|
+
* @param {phenoml.workflows.ExecuteWorkflowRequest} request
|
|
128
443
|
* @param {Workflows.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
444
|
*
|
|
445
|
+
* @throws {@link phenoml.workflows.BadRequestError}
|
|
446
|
+
* @throws {@link phenoml.workflows.UnauthorizedError}
|
|
447
|
+
* @throws {@link phenoml.workflows.ForbiddenError}
|
|
448
|
+
* @throws {@link phenoml.workflows.NotFoundError}
|
|
449
|
+
* @throws {@link phenoml.workflows.InternalServerError}
|
|
450
|
+
*
|
|
130
451
|
* @example
|
|
131
|
-
* await client.workflows.
|
|
452
|
+
* await client.workflows.execute("id", {
|
|
453
|
+
* input_data: {
|
|
454
|
+
* "patient_last_name": "Johnson",
|
|
455
|
+
* "patient_first_name": "Mary",
|
|
456
|
+
* "diagnosis_code": "M79.3",
|
|
457
|
+
* "encounter_date": "2024-01-15"
|
|
458
|
+
* }
|
|
459
|
+
* })
|
|
132
460
|
*/
|
|
133
|
-
|
|
134
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
461
|
+
execute(id, request, requestOptions) {
|
|
462
|
+
return core.HttpResponsePromise.fromPromise(this.__execute(id, request, requestOptions));
|
|
135
463
|
}
|
|
136
|
-
|
|
464
|
+
__execute(id, request, requestOptions) {
|
|
137
465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
466
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
139
467
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
140
468
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
141
|
-
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,
|
|
469
|
+
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/${encodeURIComponent(id)}/execute`),
|
|
142
470
|
method: "POST",
|
|
143
471
|
headers: _headers,
|
|
472
|
+
contentType: "application/json",
|
|
144
473
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
474
|
+
requestType: "json",
|
|
475
|
+
body: request,
|
|
145
476
|
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,
|
|
146
477
|
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,
|
|
147
478
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
148
479
|
});
|
|
149
480
|
if (_response.ok) {
|
|
150
|
-
return {
|
|
481
|
+
return {
|
|
482
|
+
data: _response.body,
|
|
483
|
+
rawResponse: _response.rawResponse,
|
|
484
|
+
};
|
|
151
485
|
}
|
|
152
486
|
if (_response.error.reason === "status-code") {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
487
|
+
switch (_response.error.statusCode) {
|
|
488
|
+
case 400:
|
|
489
|
+
throw new phenoml.workflows.BadRequestError(_response.error.body, _response.rawResponse);
|
|
490
|
+
case 401:
|
|
491
|
+
throw new phenoml.workflows.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
492
|
+
case 403:
|
|
493
|
+
throw new phenoml.workflows.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
494
|
+
case 404:
|
|
495
|
+
throw new phenoml.workflows.NotFoundError(_response.error.body, _response.rawResponse);
|
|
496
|
+
case 500:
|
|
497
|
+
throw new phenoml.workflows.InternalServerError(_response.error.body, _response.rawResponse);
|
|
498
|
+
default:
|
|
499
|
+
throw new errors.phenomlError({
|
|
500
|
+
statusCode: _response.error.statusCode,
|
|
501
|
+
body: _response.error.body,
|
|
502
|
+
rawResponse: _response.rawResponse,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
158
505
|
}
|
|
159
506
|
switch (_response.error.reason) {
|
|
160
507
|
case "non-json":
|
|
@@ -164,7 +511,7 @@ export class Workflows {
|
|
|
164
511
|
rawResponse: _response.rawResponse,
|
|
165
512
|
});
|
|
166
513
|
case "timeout":
|
|
167
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /
|
|
514
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /workflows/{id}/execute.");
|
|
168
515
|
case "unknown":
|
|
169
516
|
throw new errors.phenomlError({
|
|
170
517
|
message: _response.error.errorMessage,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from "./WorkflowsGetResponse.mjs";
|
|
2
|
+
export * from "./WorkflowsUpdateResponse.mjs";
|
|
3
|
+
export * from "./WorkflowsDeleteResponse.mjs";
|
|
1
4
|
export * from "./CreateWorkflowResponse.mjs";
|
|
2
5
|
export * from "./ExecuteWorkflowResponse.mjs";
|
|
3
6
|
export * from "./ListWorkflowsResponse.mjs";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from "./WorkflowsGetResponse.mjs";
|
|
2
|
+
export * from "./WorkflowsUpdateResponse.mjs";
|
|
3
|
+
export * from "./WorkflowsDeleteResponse.mjs";
|
|
1
4
|
export * from "./CreateWorkflowResponse.mjs";
|
|
2
5
|
export * from "./ExecuteWorkflowResponse.mjs";
|
|
3
6
|
export * from "./ListWorkflowsResponse.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.7";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.7";
|