@aignostics/sdk 2.3.1
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/README.md +33 -0
- package/dist/aignostics-sdk-2.3.1.tgz +0 -0
- package/dist/index.cjs +1397 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1909 -0
- package/dist/index.d.ts +1909 -0
- package/dist/index.js +1375 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1397 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var globalAxios2 = require('axios');
|
|
6
|
+
var z = require('zod');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var globalAxios2__default = /*#__PURE__*/_interopDefault(globalAxios2);
|
|
11
|
+
var z__default = /*#__PURE__*/_interopDefault(z);
|
|
12
|
+
|
|
13
|
+
// package.json
|
|
14
|
+
var package_default = {
|
|
15
|
+
version: "0.0.0-development"};
|
|
16
|
+
var BASE_PATH = "https://raw.githubusercontent.com/api".replace(/\/+$/, "");
|
|
17
|
+
var BaseAPI = class {
|
|
18
|
+
constructor(configuration, basePath = BASE_PATH, axios = globalAxios2__default.default) {
|
|
19
|
+
this.basePath = basePath;
|
|
20
|
+
this.axios = axios;
|
|
21
|
+
if (configuration) {
|
|
22
|
+
this.configuration = configuration;
|
|
23
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
configuration;
|
|
27
|
+
};
|
|
28
|
+
var RequiredError = class extends Error {
|
|
29
|
+
constructor(field, msg) {
|
|
30
|
+
super(msg);
|
|
31
|
+
this.field = field;
|
|
32
|
+
this.name = "RequiredError";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var operationServerMap = {};
|
|
36
|
+
|
|
37
|
+
// src/generated/common.ts
|
|
38
|
+
var DUMMY_BASE_URL = "https://example.com";
|
|
39
|
+
var assertParamExists = function(functionName, paramName, paramValue) {
|
|
40
|
+
if (paramValue === null || paramValue === void 0) {
|
|
41
|
+
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var setOAuthToObject = async function(object, name, scopes, configuration) {
|
|
45
|
+
if (configuration && configuration.accessToken) {
|
|
46
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === "function" ? await configuration.accessToken(name, scopes) : await configuration.accessToken;
|
|
47
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
51
|
+
if (parameter == null) return;
|
|
52
|
+
if (typeof parameter === "object") {
|
|
53
|
+
if (Array.isArray(parameter)) {
|
|
54
|
+
parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
55
|
+
} else {
|
|
56
|
+
Object.keys(parameter).forEach(
|
|
57
|
+
(currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
if (urlSearchParams.has(key)) {
|
|
62
|
+
urlSearchParams.append(key, parameter);
|
|
63
|
+
} else {
|
|
64
|
+
urlSearchParams.set(key, parameter);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var setSearchParams = function(url, ...objects) {
|
|
69
|
+
const searchParams = new URLSearchParams(url.search);
|
|
70
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
71
|
+
url.search = searchParams.toString();
|
|
72
|
+
};
|
|
73
|
+
var serializeDataIfNeeded = function(value, requestOptions, configuration) {
|
|
74
|
+
const nonString = typeof value !== "string";
|
|
75
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
|
|
76
|
+
return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}) : value || "";
|
|
77
|
+
};
|
|
78
|
+
var toPathString = function(url) {
|
|
79
|
+
return url.pathname + url.search + url.hash;
|
|
80
|
+
};
|
|
81
|
+
var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
|
|
82
|
+
return (axios = globalAxios3, basePath = BASE_PATH2) => {
|
|
83
|
+
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
84
|
+
return axios.request(axiosRequestArgs);
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/generated/api.ts
|
|
89
|
+
var ApplicationRunStatus = {
|
|
90
|
+
CanceledSystem: "CANCELED_SYSTEM",
|
|
91
|
+
CanceledUser: "CANCELED_USER",
|
|
92
|
+
Completed: "COMPLETED",
|
|
93
|
+
CompletedWithError: "COMPLETED_WITH_ERROR",
|
|
94
|
+
Received: "RECEIVED",
|
|
95
|
+
Rejected: "REJECTED",
|
|
96
|
+
Running: "RUNNING",
|
|
97
|
+
Scheduled: "SCHEDULED"
|
|
98
|
+
};
|
|
99
|
+
var ItemStatus = {
|
|
100
|
+
Pending: "PENDING",
|
|
101
|
+
CanceledUser: "CANCELED_USER",
|
|
102
|
+
CanceledSystem: "CANCELED_SYSTEM",
|
|
103
|
+
ErrorUser: "ERROR_USER",
|
|
104
|
+
ErrorSystem: "ERROR_SYSTEM",
|
|
105
|
+
Succeeded: "SUCCEEDED"
|
|
106
|
+
};
|
|
107
|
+
var OutputArtifactScope = {
|
|
108
|
+
Item: "ITEM",
|
|
109
|
+
Global: "GLOBAL"
|
|
110
|
+
};
|
|
111
|
+
var PublicApiAxiosParamCreator = function(configuration) {
|
|
112
|
+
return {
|
|
113
|
+
/**
|
|
114
|
+
* The application run can be canceled by the user who created the application run. The execution can be canceled any time while the application is not in a final state. The pending items will not be processed and will not add to the cost. When the application is canceled, the already completed items stay available for download.
|
|
115
|
+
* @summary Cancel Application Run
|
|
116
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
117
|
+
* @param {*} [options] Override http request option.
|
|
118
|
+
* @throws {RequiredError}
|
|
119
|
+
*/
|
|
120
|
+
cancelApplicationRunV1RunsApplicationRunIdCancelPost: async (applicationRunId, options = {}) => {
|
|
121
|
+
assertParamExists("cancelApplicationRunV1RunsApplicationRunIdCancelPost", "applicationRunId", applicationRunId);
|
|
122
|
+
const localVarPath = `/v1/runs/{application_run_id}/cancel`.replace(`{${"application_run_id"}}`, encodeURIComponent(String(applicationRunId)));
|
|
123
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
124
|
+
let baseOptions;
|
|
125
|
+
if (configuration) {
|
|
126
|
+
baseOptions = configuration.baseOptions;
|
|
127
|
+
}
|
|
128
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
129
|
+
const localVarHeaderParameter = {};
|
|
130
|
+
const localVarQueryParameter = {};
|
|
131
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
132
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
133
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
134
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
135
|
+
return {
|
|
136
|
+
url: toPathString(localVarUrlObj),
|
|
137
|
+
options: localVarRequestOptions
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* The endpoint is used to process the input items by the chosen application version. The endpoint returns the `application_run_id`. The processing fo the items is done asynchronously. To check the status or cancel the execution, use the /v1/runs/{application_run_id} endpoint. ### Payload The payload includes `application_version_id` and `items` base fields. `application_version_id` is the id used for `/v1/versions/{application_id}` endpoint. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_version_id: \"test-app:v0.0.2\", items: [{ \"reference\": \"slide_1\", <-- Input ID to connect the input and the output artifact \"input_artifacts\": [{ \"name\": \"input_slide\", <-- Name of the artifact defined by the application (For HETA it is\"input_slide\") \"download_url\": \"https://...\", <-- signed URL to the input file in the S3 or GCS. Should be valid for more than 6 days \"metadata\": { <-- The metadata fields defined by the application. (The example fields set for a slide files are provided) \"checksum_base64_crc32c\": \"abc12==\", \"mime_type\": \"image/tiff\", \"height\": 100, \"weight\": 500, \"mpp\": 0.543 } }] }] } ``` ### Response The endpoint returns the application run UUID. After that the job is scheduled for the execution in the background. To check the status of the run call `v1/runs/{application_run_id}`. ### Rejection Apart from the authentication, authorization and malformed input error, the request can be rejected when the quota limit is exceeded. More details on quotas is described in the documentation
|
|
142
|
+
* @summary Create Application Run
|
|
143
|
+
* @param {RunCreationRequest} runCreationRequest
|
|
144
|
+
* @param {*} [options] Override http request option.
|
|
145
|
+
* @throws {RequiredError}
|
|
146
|
+
*/
|
|
147
|
+
createApplicationRunV1RunsPost: async (runCreationRequest, options = {}) => {
|
|
148
|
+
assertParamExists("createApplicationRunV1RunsPost", "runCreationRequest", runCreationRequest);
|
|
149
|
+
const localVarPath = `/v1/runs`;
|
|
150
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
151
|
+
let baseOptions;
|
|
152
|
+
if (configuration) {
|
|
153
|
+
baseOptions = configuration.baseOptions;
|
|
154
|
+
}
|
|
155
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
156
|
+
const localVarHeaderParameter = {};
|
|
157
|
+
const localVarQueryParameter = {};
|
|
158
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
159
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
160
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
161
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
162
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
163
|
+
localVarRequestOptions.data = serializeDataIfNeeded(runCreationRequest, localVarRequestOptions, configuration);
|
|
164
|
+
return {
|
|
165
|
+
url: toPathString(localVarUrlObj),
|
|
166
|
+
options: localVarRequestOptions
|
|
167
|
+
};
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* Delete the application run results. It can only be called when the application is in a final state (meaning it\'s not in `received` or `pending` states). To delete the results of the running artifacts, first call `POST /v1/runs/{application_run_id}/cancel` to cancel the application run. The output results are deleted automatically 30 days after the application run is finished.
|
|
171
|
+
* @summary Delete Application Run Results
|
|
172
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
173
|
+
* @param {*} [options] Override http request option.
|
|
174
|
+
* @throws {RequiredError}
|
|
175
|
+
*/
|
|
176
|
+
deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete: async (applicationRunId, options = {}) => {
|
|
177
|
+
assertParamExists("deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete", "applicationRunId", applicationRunId);
|
|
178
|
+
const localVarPath = `/v1/runs/{application_run_id}/results`.replace(`{${"application_run_id"}}`, encodeURIComponent(String(applicationRunId)));
|
|
179
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
180
|
+
let baseOptions;
|
|
181
|
+
if (configuration) {
|
|
182
|
+
baseOptions = configuration.baseOptions;
|
|
183
|
+
}
|
|
184
|
+
const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
|
|
185
|
+
const localVarHeaderParameter = {};
|
|
186
|
+
const localVarQueryParameter = {};
|
|
187
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
188
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
189
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
190
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
191
|
+
return {
|
|
192
|
+
url: toPathString(localVarUrlObj),
|
|
193
|
+
options: localVarRequestOptions
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
*
|
|
198
|
+
* @summary Get Me
|
|
199
|
+
* @param {*} [options] Override http request option.
|
|
200
|
+
* @throws {RequiredError}
|
|
201
|
+
*/
|
|
202
|
+
getMeV1MeGet: async (options = {}) => {
|
|
203
|
+
const localVarPath = `/v1/me`;
|
|
204
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
205
|
+
let baseOptions;
|
|
206
|
+
if (configuration) {
|
|
207
|
+
baseOptions = configuration.baseOptions;
|
|
208
|
+
}
|
|
209
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
210
|
+
const localVarHeaderParameter = {};
|
|
211
|
+
const localVarQueryParameter = {};
|
|
212
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
213
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
214
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
215
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
216
|
+
return {
|
|
217
|
+
url: toPathString(localVarUrlObj),
|
|
218
|
+
options: localVarRequestOptions
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* Returns the details of the application run. The application run is available as soon as it is created via `POST /runs/` endpoint. To download the items results, call `/runs/{application_run_id}/results`. The application is only available to the user who triggered it, regardless of the role.
|
|
223
|
+
* @summary Get Run
|
|
224
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
225
|
+
* @param {Array<any> | null} [include]
|
|
226
|
+
* @param {*} [options] Override http request option.
|
|
227
|
+
* @throws {RequiredError}
|
|
228
|
+
*/
|
|
229
|
+
getRunV1RunsApplicationRunIdGet: async (applicationRunId, include, options = {}) => {
|
|
230
|
+
assertParamExists("getRunV1RunsApplicationRunIdGet", "applicationRunId", applicationRunId);
|
|
231
|
+
const localVarPath = `/v1/runs/{application_run_id}`.replace(`{${"application_run_id"}}`, encodeURIComponent(String(applicationRunId)));
|
|
232
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
233
|
+
let baseOptions;
|
|
234
|
+
if (configuration) {
|
|
235
|
+
baseOptions = configuration.baseOptions;
|
|
236
|
+
}
|
|
237
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
238
|
+
const localVarHeaderParameter = {};
|
|
239
|
+
const localVarQueryParameter = {};
|
|
240
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
241
|
+
if (include) {
|
|
242
|
+
localVarQueryParameter["include"] = include;
|
|
243
|
+
}
|
|
244
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
245
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
246
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
247
|
+
return {
|
|
248
|
+
url: toPathString(localVarUrlObj),
|
|
249
|
+
options: localVarRequestOptions
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
/**
|
|
253
|
+
* The endpoint returns the application runs triggered by the caller. After the application run is created by POST /v1/runs, it becomes available for the current endpoint
|
|
254
|
+
* @summary List Application Runs
|
|
255
|
+
* @param {string | null} [applicationId] Optional application ID filter
|
|
256
|
+
* @param {string | null} [applicationVersion] Optional application version filter
|
|
257
|
+
* @param {Array<any> | null} [include] Request optional output values. Used internally by the platform
|
|
258
|
+
* @param {number} [page]
|
|
259
|
+
* @param {number} [pageSize]
|
|
260
|
+
* @param {Array<string> | null} [sort]
|
|
261
|
+
* @param {*} [options] Override http request option.
|
|
262
|
+
* @throws {RequiredError}
|
|
263
|
+
*/
|
|
264
|
+
listApplicationRunsV1RunsGet: async (applicationId, applicationVersion, include, page, pageSize, sort, options = {}) => {
|
|
265
|
+
const localVarPath = `/v1/runs`;
|
|
266
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
267
|
+
let baseOptions;
|
|
268
|
+
if (configuration) {
|
|
269
|
+
baseOptions = configuration.baseOptions;
|
|
270
|
+
}
|
|
271
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
272
|
+
const localVarHeaderParameter = {};
|
|
273
|
+
const localVarQueryParameter = {};
|
|
274
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
275
|
+
if (applicationId !== void 0) {
|
|
276
|
+
localVarQueryParameter["application_id"] = applicationId;
|
|
277
|
+
}
|
|
278
|
+
if (applicationVersion !== void 0) {
|
|
279
|
+
localVarQueryParameter["application_version"] = applicationVersion;
|
|
280
|
+
}
|
|
281
|
+
if (include) {
|
|
282
|
+
localVarQueryParameter["include"] = include;
|
|
283
|
+
}
|
|
284
|
+
if (page !== void 0) {
|
|
285
|
+
localVarQueryParameter["page"] = page;
|
|
286
|
+
}
|
|
287
|
+
if (pageSize !== void 0) {
|
|
288
|
+
localVarQueryParameter["page_size"] = pageSize;
|
|
289
|
+
}
|
|
290
|
+
if (sort) {
|
|
291
|
+
localVarQueryParameter["sort"] = sort;
|
|
292
|
+
}
|
|
293
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
294
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
295
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
296
|
+
return {
|
|
297
|
+
url: toPathString(localVarUrlObj),
|
|
298
|
+
options: localVarRequestOptions
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
/**
|
|
302
|
+
* Returns the list of the applications, available to the caller. The application is available if any of the version of the application is assigned to the user organization. To switch between organizations, the user should re-login and choose the needed organization.
|
|
303
|
+
* @summary List Applications
|
|
304
|
+
* @param {number} [page]
|
|
305
|
+
* @param {number} [pageSize]
|
|
306
|
+
* @param {Array<string> | null} [sort]
|
|
307
|
+
* @param {*} [options] Override http request option.
|
|
308
|
+
* @throws {RequiredError}
|
|
309
|
+
*/
|
|
310
|
+
listApplicationsV1ApplicationsGet: async (page, pageSize, sort, options = {}) => {
|
|
311
|
+
const localVarPath = `/v1/applications`;
|
|
312
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
313
|
+
let baseOptions;
|
|
314
|
+
if (configuration) {
|
|
315
|
+
baseOptions = configuration.baseOptions;
|
|
316
|
+
}
|
|
317
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
318
|
+
const localVarHeaderParameter = {};
|
|
319
|
+
const localVarQueryParameter = {};
|
|
320
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
321
|
+
if (page !== void 0) {
|
|
322
|
+
localVarQueryParameter["page"] = page;
|
|
323
|
+
}
|
|
324
|
+
if (pageSize !== void 0) {
|
|
325
|
+
localVarQueryParameter["page_size"] = pageSize;
|
|
326
|
+
}
|
|
327
|
+
if (sort) {
|
|
328
|
+
localVarQueryParameter["sort"] = sort;
|
|
329
|
+
}
|
|
330
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
331
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
332
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
333
|
+
return {
|
|
334
|
+
url: toPathString(localVarUrlObj),
|
|
335
|
+
options: localVarRequestOptions
|
|
336
|
+
};
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
* Get the list of the results for the run items
|
|
340
|
+
* @summary List Run Results
|
|
341
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
342
|
+
* @param {Array<string> | null} [itemIdIn] Filter for items ids
|
|
343
|
+
* @param {Array<string> | null} [referenceIn] Filter for items by their reference from the input payload
|
|
344
|
+
* @param {Array<ItemStatus> | null} [statusIn] Filter for items in certain statuses
|
|
345
|
+
* @param {number} [page]
|
|
346
|
+
* @param {number} [pageSize]
|
|
347
|
+
* @param {Array<string> | null} [sort]
|
|
348
|
+
* @param {*} [options] Override http request option.
|
|
349
|
+
* @throws {RequiredError}
|
|
350
|
+
*/
|
|
351
|
+
listRunResultsV1RunsApplicationRunIdResultsGet: async (applicationRunId, itemIdIn, referenceIn, statusIn, page, pageSize, sort, options = {}) => {
|
|
352
|
+
assertParamExists("listRunResultsV1RunsApplicationRunIdResultsGet", "applicationRunId", applicationRunId);
|
|
353
|
+
const localVarPath = `/v1/runs/{application_run_id}/results`.replace(`{${"application_run_id"}}`, encodeURIComponent(String(applicationRunId)));
|
|
354
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
355
|
+
let baseOptions;
|
|
356
|
+
if (configuration) {
|
|
357
|
+
baseOptions = configuration.baseOptions;
|
|
358
|
+
}
|
|
359
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
360
|
+
const localVarHeaderParameter = {};
|
|
361
|
+
const localVarQueryParameter = {};
|
|
362
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
363
|
+
if (itemIdIn) {
|
|
364
|
+
localVarQueryParameter["item_id__in"] = itemIdIn;
|
|
365
|
+
}
|
|
366
|
+
if (referenceIn) {
|
|
367
|
+
localVarQueryParameter["reference__in"] = referenceIn;
|
|
368
|
+
}
|
|
369
|
+
if (statusIn) {
|
|
370
|
+
localVarQueryParameter["status__in"] = statusIn;
|
|
371
|
+
}
|
|
372
|
+
if (page !== void 0) {
|
|
373
|
+
localVarQueryParameter["page"] = page;
|
|
374
|
+
}
|
|
375
|
+
if (pageSize !== void 0) {
|
|
376
|
+
localVarQueryParameter["page_size"] = pageSize;
|
|
377
|
+
}
|
|
378
|
+
if (sort) {
|
|
379
|
+
localVarQueryParameter["sort"] = sort;
|
|
380
|
+
}
|
|
381
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
382
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
383
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
384
|
+
return {
|
|
385
|
+
url: toPathString(localVarUrlObj),
|
|
386
|
+
options: localVarRequestOptions
|
|
387
|
+
};
|
|
388
|
+
},
|
|
389
|
+
/**
|
|
390
|
+
* Returns the list of the application versions for this application, available to the caller. The application version is available if it is assigned to the user\'s organization. The application versions are assigned to the organization by the Aignostics admin. To assign or unassign a version from your organization, please contact Aignostics support team.
|
|
391
|
+
* @summary List Versions By Application Id
|
|
392
|
+
* @param {string} applicationId
|
|
393
|
+
* @param {number} [page]
|
|
394
|
+
* @param {number} [pageSize]
|
|
395
|
+
* @param {string | null} [version]
|
|
396
|
+
* @param {Array<any> | null} [include]
|
|
397
|
+
* @param {Array<string> | null} [sort]
|
|
398
|
+
* @param {*} [options] Override http request option.
|
|
399
|
+
* @throws {RequiredError}
|
|
400
|
+
*/
|
|
401
|
+
listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet: async (applicationId, page, pageSize, version, include, sort, options = {}) => {
|
|
402
|
+
assertParamExists("listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet", "applicationId", applicationId);
|
|
403
|
+
const localVarPath = `/v1/applications/{application_id}/versions`.replace(`{${"application_id"}}`, encodeURIComponent(String(applicationId)));
|
|
404
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
405
|
+
let baseOptions;
|
|
406
|
+
if (configuration) {
|
|
407
|
+
baseOptions = configuration.baseOptions;
|
|
408
|
+
}
|
|
409
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
410
|
+
const localVarHeaderParameter = {};
|
|
411
|
+
const localVarQueryParameter = {};
|
|
412
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
413
|
+
if (page !== void 0) {
|
|
414
|
+
localVarQueryParameter["page"] = page;
|
|
415
|
+
}
|
|
416
|
+
if (pageSize !== void 0) {
|
|
417
|
+
localVarQueryParameter["page_size"] = pageSize;
|
|
418
|
+
}
|
|
419
|
+
if (version !== void 0) {
|
|
420
|
+
localVarQueryParameter["version"] = version;
|
|
421
|
+
}
|
|
422
|
+
if (include) {
|
|
423
|
+
localVarQueryParameter["include"] = include;
|
|
424
|
+
}
|
|
425
|
+
if (sort) {
|
|
426
|
+
localVarQueryParameter["sort"] = sort;
|
|
427
|
+
}
|
|
428
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
429
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
430
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
431
|
+
return {
|
|
432
|
+
url: toPathString(localVarUrlObj),
|
|
433
|
+
options: localVarRequestOptions
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
var PublicApiFp = function(configuration) {
|
|
439
|
+
const localVarAxiosParamCreator = PublicApiAxiosParamCreator(configuration);
|
|
440
|
+
return {
|
|
441
|
+
/**
|
|
442
|
+
* The application run can be canceled by the user who created the application run. The execution can be canceled any time while the application is not in a final state. The pending items will not be processed and will not add to the cost. When the application is canceled, the already completed items stay available for download.
|
|
443
|
+
* @summary Cancel Application Run
|
|
444
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
445
|
+
* @param {*} [options] Override http request option.
|
|
446
|
+
* @throws {RequiredError}
|
|
447
|
+
*/
|
|
448
|
+
async cancelApplicationRunV1RunsApplicationRunIdCancelPost(applicationRunId, options) {
|
|
449
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.cancelApplicationRunV1RunsApplicationRunIdCancelPost(applicationRunId, options);
|
|
450
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
451
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.cancelApplicationRunV1RunsApplicationRunIdCancelPost"]?.[localVarOperationServerIndex]?.url;
|
|
452
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
453
|
+
},
|
|
454
|
+
/**
|
|
455
|
+
* The endpoint is used to process the input items by the chosen application version. The endpoint returns the `application_run_id`. The processing fo the items is done asynchronously. To check the status or cancel the execution, use the /v1/runs/{application_run_id} endpoint. ### Payload The payload includes `application_version_id` and `items` base fields. `application_version_id` is the id used for `/v1/versions/{application_id}` endpoint. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_version_id: \"test-app:v0.0.2\", items: [{ \"reference\": \"slide_1\", <-- Input ID to connect the input and the output artifact \"input_artifacts\": [{ \"name\": \"input_slide\", <-- Name of the artifact defined by the application (For HETA it is\"input_slide\") \"download_url\": \"https://...\", <-- signed URL to the input file in the S3 or GCS. Should be valid for more than 6 days \"metadata\": { <-- The metadata fields defined by the application. (The example fields set for a slide files are provided) \"checksum_base64_crc32c\": \"abc12==\", \"mime_type\": \"image/tiff\", \"height\": 100, \"weight\": 500, \"mpp\": 0.543 } }] }] } ``` ### Response The endpoint returns the application run UUID. After that the job is scheduled for the execution in the background. To check the status of the run call `v1/runs/{application_run_id}`. ### Rejection Apart from the authentication, authorization and malformed input error, the request can be rejected when the quota limit is exceeded. More details on quotas is described in the documentation
|
|
456
|
+
* @summary Create Application Run
|
|
457
|
+
* @param {RunCreationRequest} runCreationRequest
|
|
458
|
+
* @param {*} [options] Override http request option.
|
|
459
|
+
* @throws {RequiredError}
|
|
460
|
+
*/
|
|
461
|
+
async createApplicationRunV1RunsPost(runCreationRequest, options) {
|
|
462
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createApplicationRunV1RunsPost(runCreationRequest, options);
|
|
463
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
464
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.createApplicationRunV1RunsPost"]?.[localVarOperationServerIndex]?.url;
|
|
465
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
466
|
+
},
|
|
467
|
+
/**
|
|
468
|
+
* Delete the application run results. It can only be called when the application is in a final state (meaning it\'s not in `received` or `pending` states). To delete the results of the running artifacts, first call `POST /v1/runs/{application_run_id}/cancel` to cancel the application run. The output results are deleted automatically 30 days after the application run is finished.
|
|
469
|
+
* @summary Delete Application Run Results
|
|
470
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
471
|
+
* @param {*} [options] Override http request option.
|
|
472
|
+
* @throws {RequiredError}
|
|
473
|
+
*/
|
|
474
|
+
async deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete(applicationRunId, options) {
|
|
475
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete(applicationRunId, options);
|
|
476
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
477
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete"]?.[localVarOperationServerIndex]?.url;
|
|
478
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
479
|
+
},
|
|
480
|
+
/**
|
|
481
|
+
*
|
|
482
|
+
* @summary Get Me
|
|
483
|
+
* @param {*} [options] Override http request option.
|
|
484
|
+
* @throws {RequiredError}
|
|
485
|
+
*/
|
|
486
|
+
async getMeV1MeGet(options) {
|
|
487
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getMeV1MeGet(options);
|
|
488
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
489
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.getMeV1MeGet"]?.[localVarOperationServerIndex]?.url;
|
|
490
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
491
|
+
},
|
|
492
|
+
/**
|
|
493
|
+
* Returns the details of the application run. The application run is available as soon as it is created via `POST /runs/` endpoint. To download the items results, call `/runs/{application_run_id}/results`. The application is only available to the user who triggered it, regardless of the role.
|
|
494
|
+
* @summary Get Run
|
|
495
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
496
|
+
* @param {Array<any> | null} [include]
|
|
497
|
+
* @param {*} [options] Override http request option.
|
|
498
|
+
* @throws {RequiredError}
|
|
499
|
+
*/
|
|
500
|
+
async getRunV1RunsApplicationRunIdGet(applicationRunId, include, options) {
|
|
501
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getRunV1RunsApplicationRunIdGet(applicationRunId, include, options);
|
|
502
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
503
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.getRunV1RunsApplicationRunIdGet"]?.[localVarOperationServerIndex]?.url;
|
|
504
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
505
|
+
},
|
|
506
|
+
/**
|
|
507
|
+
* The endpoint returns the application runs triggered by the caller. After the application run is created by POST /v1/runs, it becomes available for the current endpoint
|
|
508
|
+
* @summary List Application Runs
|
|
509
|
+
* @param {string | null} [applicationId] Optional application ID filter
|
|
510
|
+
* @param {string | null} [applicationVersion] Optional application version filter
|
|
511
|
+
* @param {Array<any> | null} [include] Request optional output values. Used internally by the platform
|
|
512
|
+
* @param {number} [page]
|
|
513
|
+
* @param {number} [pageSize]
|
|
514
|
+
* @param {Array<string> | null} [sort]
|
|
515
|
+
* @param {*} [options] Override http request option.
|
|
516
|
+
* @throws {RequiredError}
|
|
517
|
+
*/
|
|
518
|
+
async listApplicationRunsV1RunsGet(applicationId, applicationVersion, include, page, pageSize, sort, options) {
|
|
519
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listApplicationRunsV1RunsGet(applicationId, applicationVersion, include, page, pageSize, sort, options);
|
|
520
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
521
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.listApplicationRunsV1RunsGet"]?.[localVarOperationServerIndex]?.url;
|
|
522
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
523
|
+
},
|
|
524
|
+
/**
|
|
525
|
+
* Returns the list of the applications, available to the caller. The application is available if any of the version of the application is assigned to the user organization. To switch between organizations, the user should re-login and choose the needed organization.
|
|
526
|
+
* @summary List Applications
|
|
527
|
+
* @param {number} [page]
|
|
528
|
+
* @param {number} [pageSize]
|
|
529
|
+
* @param {Array<string> | null} [sort]
|
|
530
|
+
* @param {*} [options] Override http request option.
|
|
531
|
+
* @throws {RequiredError}
|
|
532
|
+
*/
|
|
533
|
+
async listApplicationsV1ApplicationsGet(page, pageSize, sort, options) {
|
|
534
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listApplicationsV1ApplicationsGet(page, pageSize, sort, options);
|
|
535
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
536
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.listApplicationsV1ApplicationsGet"]?.[localVarOperationServerIndex]?.url;
|
|
537
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
538
|
+
},
|
|
539
|
+
/**
|
|
540
|
+
* Get the list of the results for the run items
|
|
541
|
+
* @summary List Run Results
|
|
542
|
+
* @param {string} applicationRunId Application run id, returned by `POST /runs/` endpoint
|
|
543
|
+
* @param {Array<string> | null} [itemIdIn] Filter for items ids
|
|
544
|
+
* @param {Array<string> | null} [referenceIn] Filter for items by their reference from the input payload
|
|
545
|
+
* @param {Array<ItemStatus> | null} [statusIn] Filter for items in certain statuses
|
|
546
|
+
* @param {number} [page]
|
|
547
|
+
* @param {number} [pageSize]
|
|
548
|
+
* @param {Array<string> | null} [sort]
|
|
549
|
+
* @param {*} [options] Override http request option.
|
|
550
|
+
* @throws {RequiredError}
|
|
551
|
+
*/
|
|
552
|
+
async listRunResultsV1RunsApplicationRunIdResultsGet(applicationRunId, itemIdIn, referenceIn, statusIn, page, pageSize, sort, options) {
|
|
553
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listRunResultsV1RunsApplicationRunIdResultsGet(applicationRunId, itemIdIn, referenceIn, statusIn, page, pageSize, sort, options);
|
|
554
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
555
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.listRunResultsV1RunsApplicationRunIdResultsGet"]?.[localVarOperationServerIndex]?.url;
|
|
556
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
557
|
+
},
|
|
558
|
+
/**
|
|
559
|
+
* Returns the list of the application versions for this application, available to the caller. The application version is available if it is assigned to the user\'s organization. The application versions are assigned to the organization by the Aignostics admin. To assign or unassign a version from your organization, please contact Aignostics support team.
|
|
560
|
+
* @summary List Versions By Application Id
|
|
561
|
+
* @param {string} applicationId
|
|
562
|
+
* @param {number} [page]
|
|
563
|
+
* @param {number} [pageSize]
|
|
564
|
+
* @param {string | null} [version]
|
|
565
|
+
* @param {Array<any> | null} [include]
|
|
566
|
+
* @param {Array<string> | null} [sort]
|
|
567
|
+
* @param {*} [options] Override http request option.
|
|
568
|
+
* @throws {RequiredError}
|
|
569
|
+
*/
|
|
570
|
+
async listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet(applicationId, page, pageSize, version, include, sort, options) {
|
|
571
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet(applicationId, page, pageSize, version, include, sort, options);
|
|
572
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
573
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet"]?.[localVarOperationServerIndex]?.url;
|
|
574
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
var PublicApiFactory = function(configuration, basePath, axios) {
|
|
579
|
+
const localVarFp = PublicApiFp(configuration);
|
|
580
|
+
return {
|
|
581
|
+
/**
|
|
582
|
+
* The application run can be canceled by the user who created the application run. The execution can be canceled any time while the application is not in a final state. The pending items will not be processed and will not add to the cost. When the application is canceled, the already completed items stay available for download.
|
|
583
|
+
* @summary Cancel Application Run
|
|
584
|
+
* @param {PublicApiCancelApplicationRunV1RunsApplicationRunIdCancelPostRequest} requestParameters Request parameters.
|
|
585
|
+
* @param {*} [options] Override http request option.
|
|
586
|
+
* @throws {RequiredError}
|
|
587
|
+
*/
|
|
588
|
+
cancelApplicationRunV1RunsApplicationRunIdCancelPost(requestParameters, options) {
|
|
589
|
+
return localVarFp.cancelApplicationRunV1RunsApplicationRunIdCancelPost(requestParameters.applicationRunId, options).then((request) => request(axios, basePath));
|
|
590
|
+
},
|
|
591
|
+
/**
|
|
592
|
+
* The endpoint is used to process the input items by the chosen application version. The endpoint returns the `application_run_id`. The processing fo the items is done asynchronously. To check the status or cancel the execution, use the /v1/runs/{application_run_id} endpoint. ### Payload The payload includes `application_version_id` and `items` base fields. `application_version_id` is the id used for `/v1/versions/{application_id}` endpoint. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_version_id: \"test-app:v0.0.2\", items: [{ \"reference\": \"slide_1\", <-- Input ID to connect the input and the output artifact \"input_artifacts\": [{ \"name\": \"input_slide\", <-- Name of the artifact defined by the application (For HETA it is\"input_slide\") \"download_url\": \"https://...\", <-- signed URL to the input file in the S3 or GCS. Should be valid for more than 6 days \"metadata\": { <-- The metadata fields defined by the application. (The example fields set for a slide files are provided) \"checksum_base64_crc32c\": \"abc12==\", \"mime_type\": \"image/tiff\", \"height\": 100, \"weight\": 500, \"mpp\": 0.543 } }] }] } ``` ### Response The endpoint returns the application run UUID. After that the job is scheduled for the execution in the background. To check the status of the run call `v1/runs/{application_run_id}`. ### Rejection Apart from the authentication, authorization and malformed input error, the request can be rejected when the quota limit is exceeded. More details on quotas is described in the documentation
|
|
593
|
+
* @summary Create Application Run
|
|
594
|
+
* @param {PublicApiCreateApplicationRunV1RunsPostRequest} requestParameters Request parameters.
|
|
595
|
+
* @param {*} [options] Override http request option.
|
|
596
|
+
* @throws {RequiredError}
|
|
597
|
+
*/
|
|
598
|
+
createApplicationRunV1RunsPost(requestParameters, options) {
|
|
599
|
+
return localVarFp.createApplicationRunV1RunsPost(requestParameters.runCreationRequest, options).then((request) => request(axios, basePath));
|
|
600
|
+
},
|
|
601
|
+
/**
|
|
602
|
+
* Delete the application run results. It can only be called when the application is in a final state (meaning it\'s not in `received` or `pending` states). To delete the results of the running artifacts, first call `POST /v1/runs/{application_run_id}/cancel` to cancel the application run. The output results are deleted automatically 30 days after the application run is finished.
|
|
603
|
+
* @summary Delete Application Run Results
|
|
604
|
+
* @param {PublicApiDeleteApplicationRunResultsV1RunsApplicationRunIdResultsDeleteRequest} requestParameters Request parameters.
|
|
605
|
+
* @param {*} [options] Override http request option.
|
|
606
|
+
* @throws {RequiredError}
|
|
607
|
+
*/
|
|
608
|
+
deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete(requestParameters, options) {
|
|
609
|
+
return localVarFp.deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete(requestParameters.applicationRunId, options).then((request) => request(axios, basePath));
|
|
610
|
+
},
|
|
611
|
+
/**
|
|
612
|
+
*
|
|
613
|
+
* @summary Get Me
|
|
614
|
+
* @param {*} [options] Override http request option.
|
|
615
|
+
* @throws {RequiredError}
|
|
616
|
+
*/
|
|
617
|
+
getMeV1MeGet(options) {
|
|
618
|
+
return localVarFp.getMeV1MeGet(options).then((request) => request(axios, basePath));
|
|
619
|
+
},
|
|
620
|
+
/**
|
|
621
|
+
* Returns the details of the application run. The application run is available as soon as it is created via `POST /runs/` endpoint. To download the items results, call `/runs/{application_run_id}/results`. The application is only available to the user who triggered it, regardless of the role.
|
|
622
|
+
* @summary Get Run
|
|
623
|
+
* @param {PublicApiGetRunV1RunsApplicationRunIdGetRequest} requestParameters Request parameters.
|
|
624
|
+
* @param {*} [options] Override http request option.
|
|
625
|
+
* @throws {RequiredError}
|
|
626
|
+
*/
|
|
627
|
+
getRunV1RunsApplicationRunIdGet(requestParameters, options) {
|
|
628
|
+
return localVarFp.getRunV1RunsApplicationRunIdGet(requestParameters.applicationRunId, requestParameters.include, options).then((request) => request(axios, basePath));
|
|
629
|
+
},
|
|
630
|
+
/**
|
|
631
|
+
* The endpoint returns the application runs triggered by the caller. After the application run is created by POST /v1/runs, it becomes available for the current endpoint
|
|
632
|
+
* @summary List Application Runs
|
|
633
|
+
* @param {PublicApiListApplicationRunsV1RunsGetRequest} requestParameters Request parameters.
|
|
634
|
+
* @param {*} [options] Override http request option.
|
|
635
|
+
* @throws {RequiredError}
|
|
636
|
+
*/
|
|
637
|
+
listApplicationRunsV1RunsGet(requestParameters = {}, options) {
|
|
638
|
+
return localVarFp.listApplicationRunsV1RunsGet(requestParameters.applicationId, requestParameters.applicationVersion, requestParameters.include, requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(axios, basePath));
|
|
639
|
+
},
|
|
640
|
+
/**
|
|
641
|
+
* Returns the list of the applications, available to the caller. The application is available if any of the version of the application is assigned to the user organization. To switch between organizations, the user should re-login and choose the needed organization.
|
|
642
|
+
* @summary List Applications
|
|
643
|
+
* @param {PublicApiListApplicationsV1ApplicationsGetRequest} requestParameters Request parameters.
|
|
644
|
+
* @param {*} [options] Override http request option.
|
|
645
|
+
* @throws {RequiredError}
|
|
646
|
+
*/
|
|
647
|
+
listApplicationsV1ApplicationsGet(requestParameters = {}, options) {
|
|
648
|
+
return localVarFp.listApplicationsV1ApplicationsGet(requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(axios, basePath));
|
|
649
|
+
},
|
|
650
|
+
/**
|
|
651
|
+
* Get the list of the results for the run items
|
|
652
|
+
* @summary List Run Results
|
|
653
|
+
* @param {PublicApiListRunResultsV1RunsApplicationRunIdResultsGetRequest} requestParameters Request parameters.
|
|
654
|
+
* @param {*} [options] Override http request option.
|
|
655
|
+
* @throws {RequiredError}
|
|
656
|
+
*/
|
|
657
|
+
listRunResultsV1RunsApplicationRunIdResultsGet(requestParameters, options) {
|
|
658
|
+
return localVarFp.listRunResultsV1RunsApplicationRunIdResultsGet(requestParameters.applicationRunId, requestParameters.itemIdIn, requestParameters.referenceIn, requestParameters.statusIn, requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(axios, basePath));
|
|
659
|
+
},
|
|
660
|
+
/**
|
|
661
|
+
* Returns the list of the application versions for this application, available to the caller. The application version is available if it is assigned to the user\'s organization. The application versions are assigned to the organization by the Aignostics admin. To assign or unassign a version from your organization, please contact Aignostics support team.
|
|
662
|
+
* @summary List Versions By Application Id
|
|
663
|
+
* @param {PublicApiListVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGetRequest} requestParameters Request parameters.
|
|
664
|
+
* @param {*} [options] Override http request option.
|
|
665
|
+
* @throws {RequiredError}
|
|
666
|
+
*/
|
|
667
|
+
listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet(requestParameters, options) {
|
|
668
|
+
return localVarFp.listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet(requestParameters.applicationId, requestParameters.page, requestParameters.pageSize, requestParameters.version, requestParameters.include, requestParameters.sort, options).then((request) => request(axios, basePath));
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
var PublicApi = class extends BaseAPI {
|
|
673
|
+
/**
|
|
674
|
+
* The application run can be canceled by the user who created the application run. The execution can be canceled any time while the application is not in a final state. The pending items will not be processed and will not add to the cost. When the application is canceled, the already completed items stay available for download.
|
|
675
|
+
* @summary Cancel Application Run
|
|
676
|
+
* @param {PublicApiCancelApplicationRunV1RunsApplicationRunIdCancelPostRequest} requestParameters Request parameters.
|
|
677
|
+
* @param {*} [options] Override http request option.
|
|
678
|
+
* @throws {RequiredError}
|
|
679
|
+
* @memberof PublicApi
|
|
680
|
+
*/
|
|
681
|
+
cancelApplicationRunV1RunsApplicationRunIdCancelPost(requestParameters, options) {
|
|
682
|
+
return PublicApiFp(this.configuration).cancelApplicationRunV1RunsApplicationRunIdCancelPost(requestParameters.applicationRunId, options).then((request) => request(this.axios, this.basePath));
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* The endpoint is used to process the input items by the chosen application version. The endpoint returns the `application_run_id`. The processing fo the items is done asynchronously. To check the status or cancel the execution, use the /v1/runs/{application_run_id} endpoint. ### Payload The payload includes `application_version_id` and `items` base fields. `application_version_id` is the id used for `/v1/versions/{application_id}` endpoint. `items` includes the list of the items to process (slides, in case of HETA application). Every item has a set of standard fields defined by the API, plus the metadata, specific to the chosen application. Example payload structure with the comments: ``` { application_version_id: \"test-app:v0.0.2\", items: [{ \"reference\": \"slide_1\", <-- Input ID to connect the input and the output artifact \"input_artifacts\": [{ \"name\": \"input_slide\", <-- Name of the artifact defined by the application (For HETA it is\"input_slide\") \"download_url\": \"https://...\", <-- signed URL to the input file in the S3 or GCS. Should be valid for more than 6 days \"metadata\": { <-- The metadata fields defined by the application. (The example fields set for a slide files are provided) \"checksum_base64_crc32c\": \"abc12==\", \"mime_type\": \"image/tiff\", \"height\": 100, \"weight\": 500, \"mpp\": 0.543 } }] }] } ``` ### Response The endpoint returns the application run UUID. After that the job is scheduled for the execution in the background. To check the status of the run call `v1/runs/{application_run_id}`. ### Rejection Apart from the authentication, authorization and malformed input error, the request can be rejected when the quota limit is exceeded. More details on quotas is described in the documentation
|
|
686
|
+
* @summary Create Application Run
|
|
687
|
+
* @param {PublicApiCreateApplicationRunV1RunsPostRequest} requestParameters Request parameters.
|
|
688
|
+
* @param {*} [options] Override http request option.
|
|
689
|
+
* @throws {RequiredError}
|
|
690
|
+
* @memberof PublicApi
|
|
691
|
+
*/
|
|
692
|
+
createApplicationRunV1RunsPost(requestParameters, options) {
|
|
693
|
+
return PublicApiFp(this.configuration).createApplicationRunV1RunsPost(requestParameters.runCreationRequest, options).then((request) => request(this.axios, this.basePath));
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Delete the application run results. It can only be called when the application is in a final state (meaning it\'s not in `received` or `pending` states). To delete the results of the running artifacts, first call `POST /v1/runs/{application_run_id}/cancel` to cancel the application run. The output results are deleted automatically 30 days after the application run is finished.
|
|
697
|
+
* @summary Delete Application Run Results
|
|
698
|
+
* @param {PublicApiDeleteApplicationRunResultsV1RunsApplicationRunIdResultsDeleteRequest} requestParameters Request parameters.
|
|
699
|
+
* @param {*} [options] Override http request option.
|
|
700
|
+
* @throws {RequiredError}
|
|
701
|
+
* @memberof PublicApi
|
|
702
|
+
*/
|
|
703
|
+
deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete(requestParameters, options) {
|
|
704
|
+
return PublicApiFp(this.configuration).deleteApplicationRunResultsV1RunsApplicationRunIdResultsDelete(requestParameters.applicationRunId, options).then((request) => request(this.axios, this.basePath));
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
*
|
|
708
|
+
* @summary Get Me
|
|
709
|
+
* @param {*} [options] Override http request option.
|
|
710
|
+
* @throws {RequiredError}
|
|
711
|
+
* @memberof PublicApi
|
|
712
|
+
*/
|
|
713
|
+
getMeV1MeGet(options) {
|
|
714
|
+
return PublicApiFp(this.configuration).getMeV1MeGet(options).then((request) => request(this.axios, this.basePath));
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Returns the details of the application run. The application run is available as soon as it is created via `POST /runs/` endpoint. To download the items results, call `/runs/{application_run_id}/results`. The application is only available to the user who triggered it, regardless of the role.
|
|
718
|
+
* @summary Get Run
|
|
719
|
+
* @param {PublicApiGetRunV1RunsApplicationRunIdGetRequest} requestParameters Request parameters.
|
|
720
|
+
* @param {*} [options] Override http request option.
|
|
721
|
+
* @throws {RequiredError}
|
|
722
|
+
* @memberof PublicApi
|
|
723
|
+
*/
|
|
724
|
+
getRunV1RunsApplicationRunIdGet(requestParameters, options) {
|
|
725
|
+
return PublicApiFp(this.configuration).getRunV1RunsApplicationRunIdGet(requestParameters.applicationRunId, requestParameters.include, options).then((request) => request(this.axios, this.basePath));
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* The endpoint returns the application runs triggered by the caller. After the application run is created by POST /v1/runs, it becomes available for the current endpoint
|
|
729
|
+
* @summary List Application Runs
|
|
730
|
+
* @param {PublicApiListApplicationRunsV1RunsGetRequest} requestParameters Request parameters.
|
|
731
|
+
* @param {*} [options] Override http request option.
|
|
732
|
+
* @throws {RequiredError}
|
|
733
|
+
* @memberof PublicApi
|
|
734
|
+
*/
|
|
735
|
+
listApplicationRunsV1RunsGet(requestParameters = {}, options) {
|
|
736
|
+
return PublicApiFp(this.configuration).listApplicationRunsV1RunsGet(requestParameters.applicationId, requestParameters.applicationVersion, requestParameters.include, requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Returns the list of the applications, available to the caller. The application is available if any of the version of the application is assigned to the user organization. To switch between organizations, the user should re-login and choose the needed organization.
|
|
740
|
+
* @summary List Applications
|
|
741
|
+
* @param {PublicApiListApplicationsV1ApplicationsGetRequest} requestParameters Request parameters.
|
|
742
|
+
* @param {*} [options] Override http request option.
|
|
743
|
+
* @throws {RequiredError}
|
|
744
|
+
* @memberof PublicApi
|
|
745
|
+
*/
|
|
746
|
+
listApplicationsV1ApplicationsGet(requestParameters = {}, options) {
|
|
747
|
+
return PublicApiFp(this.configuration).listApplicationsV1ApplicationsGet(requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Get the list of the results for the run items
|
|
751
|
+
* @summary List Run Results
|
|
752
|
+
* @param {PublicApiListRunResultsV1RunsApplicationRunIdResultsGetRequest} requestParameters Request parameters.
|
|
753
|
+
* @param {*} [options] Override http request option.
|
|
754
|
+
* @throws {RequiredError}
|
|
755
|
+
* @memberof PublicApi
|
|
756
|
+
*/
|
|
757
|
+
listRunResultsV1RunsApplicationRunIdResultsGet(requestParameters, options) {
|
|
758
|
+
return PublicApiFp(this.configuration).listRunResultsV1RunsApplicationRunIdResultsGet(requestParameters.applicationRunId, requestParameters.itemIdIn, requestParameters.referenceIn, requestParameters.statusIn, requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Returns the list of the application versions for this application, available to the caller. The application version is available if it is assigned to the user\'s organization. The application versions are assigned to the organization by the Aignostics admin. To assign or unassign a version from your organization, please contact Aignostics support team.
|
|
762
|
+
* @summary List Versions By Application Id
|
|
763
|
+
* @param {PublicApiListVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGetRequest} requestParameters Request parameters.
|
|
764
|
+
* @param {*} [options] Override http request option.
|
|
765
|
+
* @throws {RequiredError}
|
|
766
|
+
* @memberof PublicApi
|
|
767
|
+
*/
|
|
768
|
+
listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet(requestParameters, options) {
|
|
769
|
+
return PublicApiFp(this.configuration).listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet(requestParameters.applicationId, requestParameters.page, requestParameters.pageSize, requestParameters.version, requestParameters.include, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
// src/generated/configuration.ts
|
|
774
|
+
var Configuration = class {
|
|
775
|
+
/**
|
|
776
|
+
* parameter for apiKey security
|
|
777
|
+
* @param name security name
|
|
778
|
+
* @memberof Configuration
|
|
779
|
+
*/
|
|
780
|
+
apiKey;
|
|
781
|
+
/**
|
|
782
|
+
* parameter for basic security
|
|
783
|
+
*
|
|
784
|
+
* @type {string}
|
|
785
|
+
* @memberof Configuration
|
|
786
|
+
*/
|
|
787
|
+
username;
|
|
788
|
+
/**
|
|
789
|
+
* parameter for basic security
|
|
790
|
+
*
|
|
791
|
+
* @type {string}
|
|
792
|
+
* @memberof Configuration
|
|
793
|
+
*/
|
|
794
|
+
password;
|
|
795
|
+
/**
|
|
796
|
+
* parameter for oauth2 security
|
|
797
|
+
* @param name security name
|
|
798
|
+
* @param scopes oauth2 scope
|
|
799
|
+
* @memberof Configuration
|
|
800
|
+
*/
|
|
801
|
+
accessToken;
|
|
802
|
+
/**
|
|
803
|
+
* override base path
|
|
804
|
+
*
|
|
805
|
+
* @type {string}
|
|
806
|
+
* @memberof Configuration
|
|
807
|
+
*/
|
|
808
|
+
basePath;
|
|
809
|
+
/**
|
|
810
|
+
* override server index
|
|
811
|
+
*
|
|
812
|
+
* @type {number}
|
|
813
|
+
* @memberof Configuration
|
|
814
|
+
*/
|
|
815
|
+
serverIndex;
|
|
816
|
+
/**
|
|
817
|
+
* base options for axios calls
|
|
818
|
+
*
|
|
819
|
+
* @type {any}
|
|
820
|
+
* @memberof Configuration
|
|
821
|
+
*/
|
|
822
|
+
baseOptions;
|
|
823
|
+
/**
|
|
824
|
+
* The FormData constructor that will be used to create multipart form data
|
|
825
|
+
* requests. You can inject this here so that execution environments that
|
|
826
|
+
* do not support the FormData class can still run the generated client.
|
|
827
|
+
*
|
|
828
|
+
* @type {new () => FormData}
|
|
829
|
+
*/
|
|
830
|
+
formDataCtor;
|
|
831
|
+
constructor(param = {}) {
|
|
832
|
+
this.apiKey = param.apiKey;
|
|
833
|
+
this.username = param.username;
|
|
834
|
+
this.password = param.password;
|
|
835
|
+
this.accessToken = param.accessToken;
|
|
836
|
+
this.basePath = param.basePath;
|
|
837
|
+
this.serverIndex = param.serverIndex;
|
|
838
|
+
this.baseOptions = {
|
|
839
|
+
...param.baseOptions,
|
|
840
|
+
headers: {
|
|
841
|
+
...param.baseOptions?.headers
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
this.formDataCtor = param.formDataCtor;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Check if the given MIME is a JSON MIME.
|
|
848
|
+
* JSON MIME examples:
|
|
849
|
+
* application/json
|
|
850
|
+
* application/json; charset=UTF8
|
|
851
|
+
* APPLICATION/JSON
|
|
852
|
+
* application/vnd.company+json
|
|
853
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
854
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
855
|
+
*/
|
|
856
|
+
isJsonMime(mime) {
|
|
857
|
+
const jsonMime = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i");
|
|
858
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === "application/json-patch+json");
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
// src/errors.ts
|
|
863
|
+
var BaseError = class extends Error {
|
|
864
|
+
/**
|
|
865
|
+
* Error code for programmatic error handling
|
|
866
|
+
*/
|
|
867
|
+
code;
|
|
868
|
+
/**
|
|
869
|
+
* Additional context or metadata related to the error
|
|
870
|
+
*/
|
|
871
|
+
context;
|
|
872
|
+
/**
|
|
873
|
+
* Original error that caused this error, if applicable
|
|
874
|
+
*/
|
|
875
|
+
originalError;
|
|
876
|
+
/**
|
|
877
|
+
* Creates a new BaseError instance
|
|
878
|
+
*
|
|
879
|
+
* @param message - Human-readable error message
|
|
880
|
+
* @param code - Error code for programmatic handling
|
|
881
|
+
* @param context - Additional error context or metadata
|
|
882
|
+
*/
|
|
883
|
+
constructor(message, code, { context, originalError } = {}) {
|
|
884
|
+
super(message);
|
|
885
|
+
this.name = this.constructor.name;
|
|
886
|
+
this.code = code;
|
|
887
|
+
this.context = context;
|
|
888
|
+
this.originalError = originalError;
|
|
889
|
+
if (Error.captureStackTrace) {
|
|
890
|
+
Error.captureStackTrace(this, this.constructor);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
var AuthenticationError = class extends BaseError {
|
|
895
|
+
/**
|
|
896
|
+
* Creates a new AuthenticationError instance
|
|
897
|
+
*
|
|
898
|
+
* @param message - Human-readable error message describing the authentication issue
|
|
899
|
+
* @param options - Additional options about the authentication failure
|
|
900
|
+
* @param options.context - Additional context about the authentication failure
|
|
901
|
+
* @param options.originalError - Original error that caused this authentication error
|
|
902
|
+
*/
|
|
903
|
+
constructor(message, options = {}) {
|
|
904
|
+
super(message, "AUTHENTICATION_ERROR", options);
|
|
905
|
+
}
|
|
906
|
+
};
|
|
907
|
+
var APIError = class extends BaseError {
|
|
908
|
+
/**
|
|
909
|
+
* HTTP status code from the failed API request
|
|
910
|
+
*/
|
|
911
|
+
statusCode;
|
|
912
|
+
/**
|
|
913
|
+
* Creates a new APIError instance
|
|
914
|
+
*
|
|
915
|
+
* @param message - Human-readable error message describing the API issue
|
|
916
|
+
* @param statusCode - HTTP status code from the failed request
|
|
917
|
+
* @param context - Additional context about the API failure
|
|
918
|
+
*/
|
|
919
|
+
constructor(message, options = {}) {
|
|
920
|
+
super(message, "API_ERROR", options);
|
|
921
|
+
this.statusCode = options.statusCode;
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
var ConfigurationError = class extends BaseError {
|
|
925
|
+
/**
|
|
926
|
+
* Creates a new ConfigurationError instance
|
|
927
|
+
*
|
|
928
|
+
* @param message - Human-readable error message describing the configuration issue
|
|
929
|
+
* @param context - Additional context about the configuration problem
|
|
930
|
+
*/
|
|
931
|
+
constructor(message, options = {}) {
|
|
932
|
+
super(message, "CONFIGURATION_ERROR", options);
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
var UnexpectedError = class extends BaseError {
|
|
936
|
+
/**
|
|
937
|
+
* Creates a new UnexpectedError instance
|
|
938
|
+
*
|
|
939
|
+
* @param message - Human-readable error message describing the unexpected issue
|
|
940
|
+
* @param context - Additional context about the unexpected error
|
|
941
|
+
*/
|
|
942
|
+
constructor(message, options = {}) {
|
|
943
|
+
super(message, "UNEXPECTED_ERROR", options);
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
var validationErrorSchema = z__default.default.object({
|
|
947
|
+
detail: z__default.default.array(
|
|
948
|
+
z__default.default.object({
|
|
949
|
+
loc: z__default.default.array(z__default.default.union([z__default.default.string(), z__default.default.number()])),
|
|
950
|
+
msg: z__default.default.string(),
|
|
951
|
+
type: z__default.default.string()
|
|
952
|
+
})
|
|
953
|
+
)
|
|
954
|
+
});
|
|
955
|
+
var errorResponseSchema = z__default.default.union([validationErrorSchema, z__default.default.any()]);
|
|
956
|
+
function handleRequestError(error) {
|
|
957
|
+
if (globalAxios2.isAxiosError(error)) {
|
|
958
|
+
switch (error.status) {
|
|
959
|
+
case 422: {
|
|
960
|
+
throw new APIError(`Validation error: ${error.message}`, {
|
|
961
|
+
context: {
|
|
962
|
+
responseBody: validationErrorSchema.parse(error.response?.data)
|
|
963
|
+
},
|
|
964
|
+
originalError: error,
|
|
965
|
+
statusCode: 422
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
case 404: {
|
|
969
|
+
throw new APIError(`Resource not found: ${error.message}`, {
|
|
970
|
+
context: {
|
|
971
|
+
responseBody: errorResponseSchema.parse(error.response?.data)
|
|
972
|
+
},
|
|
973
|
+
originalError: error,
|
|
974
|
+
statusCode: 404
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
default: {
|
|
978
|
+
throw new APIError(`API request failed: ${error.message}`, {
|
|
979
|
+
context: {
|
|
980
|
+
responseBody: errorResponseSchema.parse(error.response?.data)
|
|
981
|
+
},
|
|
982
|
+
originalError: error
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
throw new UnexpectedError(`Unexpected error: ${String(error)}`, { originalError: error });
|
|
988
|
+
}
|
|
989
|
+
var PlatformSDKHttp = class {
|
|
990
|
+
#config;
|
|
991
|
+
/**
|
|
992
|
+
* Creates a new instance of the Platform SDK
|
|
993
|
+
* @param config Configuration options
|
|
994
|
+
*/
|
|
995
|
+
constructor(config) {
|
|
996
|
+
this.#config = {
|
|
997
|
+
baseURL: config.baseURL || "https://api.aignostics.com",
|
|
998
|
+
timeout: config.timeout || 1e4,
|
|
999
|
+
...config
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
async #getClient() {
|
|
1003
|
+
const accessToken = await this.#config.tokenProvider();
|
|
1004
|
+
if (!accessToken) {
|
|
1005
|
+
throw new AuthenticationError(
|
|
1006
|
+
"No access token available. Please provide a tokenProvider in the SDK configuration that returns a valid token."
|
|
1007
|
+
);
|
|
1008
|
+
}
|
|
1009
|
+
return new PublicApi({
|
|
1010
|
+
basePath: this.#config.baseURL,
|
|
1011
|
+
accessToken,
|
|
1012
|
+
isJsonMime(mime) {
|
|
1013
|
+
return mime === "application/json";
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Test the connection to the Aignostics Platform API
|
|
1019
|
+
*
|
|
1020
|
+
* This method performs a simple API call to verify that the SDK can successfully
|
|
1021
|
+
* connect to the platform using the provided configuration and authentication.
|
|
1022
|
+
* It's useful for validating setup and troubleshooting connectivity issues.
|
|
1023
|
+
*
|
|
1024
|
+
* @returns A promise that resolves to `true` if the connection is successful
|
|
1025
|
+
* @throws {AuthenticationError} If no valid authentication token is available
|
|
1026
|
+
* @throws {Error} If the connection test fails due to network issues or API errors
|
|
1027
|
+
*
|
|
1028
|
+
* @example
|
|
1029
|
+
* ```typescript
|
|
1030
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1031
|
+
*
|
|
1032
|
+
* try {
|
|
1033
|
+
* const isConnected = await sdk.testConnection();
|
|
1034
|
+
* console.log('Connection successful:', isConnected);
|
|
1035
|
+
* } catch (error) {
|
|
1036
|
+
* console.error('Connection failed:', error.message);
|
|
1037
|
+
* }
|
|
1038
|
+
* ```
|
|
1039
|
+
*/
|
|
1040
|
+
async testConnection() {
|
|
1041
|
+
const client = await this.#getClient();
|
|
1042
|
+
try {
|
|
1043
|
+
const response = await client.listApplicationsV1ApplicationsGet();
|
|
1044
|
+
return response.status === 200;
|
|
1045
|
+
} catch (error) {
|
|
1046
|
+
throw new Error(`Connection test failed: ${String(error)}`);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Retrieve a list of all available applications on the platform
|
|
1051
|
+
*
|
|
1052
|
+
* This method fetches all applications that are accessible with the current
|
|
1053
|
+
* authentication credentials. Applications represent different AI models or
|
|
1054
|
+
* processing pipelines available on the Aignostics Platform.
|
|
1055
|
+
*
|
|
1056
|
+
* @returns A promise that resolves to an array of application objects
|
|
1057
|
+
* @throws {AuthenticationError} If no valid authentication token is available
|
|
1058
|
+
* @throws {Error} If the request fails due to network issues or API errors
|
|
1059
|
+
*
|
|
1060
|
+
* @example
|
|
1061
|
+
* ```typescript
|
|
1062
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1063
|
+
*
|
|
1064
|
+
* try {
|
|
1065
|
+
* const applications = await sdk.listApplications();
|
|
1066
|
+
* console.log(`Found ${applications.length} applications`);
|
|
1067
|
+
* applications.forEach(app => {
|
|
1068
|
+
* console.log(`- ${app.name} (ID: ${app.id})`);
|
|
1069
|
+
* });
|
|
1070
|
+
* } catch (error) {
|
|
1071
|
+
* console.error('Failed to list applications:', error.message);
|
|
1072
|
+
* }
|
|
1073
|
+
* ```
|
|
1074
|
+
*/
|
|
1075
|
+
async listApplications() {
|
|
1076
|
+
const client = await this.#getClient();
|
|
1077
|
+
try {
|
|
1078
|
+
const response = await client.listApplicationsV1ApplicationsGet();
|
|
1079
|
+
return response.data;
|
|
1080
|
+
} catch (error) {
|
|
1081
|
+
handleRequestError(error);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Retrieve all versions of a specific application
|
|
1086
|
+
*
|
|
1087
|
+
* This method fetches all available versions for a given application ID.
|
|
1088
|
+
* Application versions represent different iterations or configurations of
|
|
1089
|
+
* an AI model, allowing you to choose specific versions for processing.
|
|
1090
|
+
*
|
|
1091
|
+
* @param applicationId - The unique identifier of the application
|
|
1092
|
+
* @returns A promise that resolves to an array of application version objects
|
|
1093
|
+
* @throws {AuthenticationError} If no valid authentication token is available
|
|
1094
|
+
* @throws {Error} If the request fails due to network issues, invalid application ID, or API errors
|
|
1095
|
+
*
|
|
1096
|
+
* @example
|
|
1097
|
+
* ```typescript
|
|
1098
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1099
|
+
*
|
|
1100
|
+
* try {
|
|
1101
|
+
* const versions = await sdk.listApplicationVersions('app-123');
|
|
1102
|
+
* console.log(`Found ${versions.length} versions for application`);
|
|
1103
|
+
* versions.forEach(version => {
|
|
1104
|
+
* console.log(`- Version ${version.version} (ID: ${version.id})`);
|
|
1105
|
+
* });
|
|
1106
|
+
* } catch (error) {
|
|
1107
|
+
* console.error('Failed to list application versions:', error.message);
|
|
1108
|
+
* }
|
|
1109
|
+
* ```
|
|
1110
|
+
*/
|
|
1111
|
+
async listApplicationVersions(applicationId) {
|
|
1112
|
+
const client = await this.#getClient();
|
|
1113
|
+
try {
|
|
1114
|
+
const response = await client.listVersionsByApplicationIdV1ApplicationsApplicationIdVersionsGet({
|
|
1115
|
+
applicationId
|
|
1116
|
+
});
|
|
1117
|
+
return response.data;
|
|
1118
|
+
} catch (error) {
|
|
1119
|
+
handleRequestError(error);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Retrieve a list of application runs with optional filtering
|
|
1124
|
+
*
|
|
1125
|
+
* This method fetches application runs (processing jobs) that have been
|
|
1126
|
+
* submitted to the platform. You can optionally filter by application ID
|
|
1127
|
+
* and/or application version to narrow down the results.
|
|
1128
|
+
*
|
|
1129
|
+
* @param options - Optional filtering parameters
|
|
1130
|
+
* @param options.applicationId - Filter runs by specific application ID
|
|
1131
|
+
* @param options.applicationVersion - Filter runs by specific application version
|
|
1132
|
+
* @returns A promise that resolves to an array of application run objects
|
|
1133
|
+
* @throws {Error} If the request fails due to network issues, authentication problems, or API errors
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* ```typescript
|
|
1137
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1138
|
+
*
|
|
1139
|
+
* try {
|
|
1140
|
+
* // Get all runs
|
|
1141
|
+
* const allRuns = await sdk.listApplicationRuns();
|
|
1142
|
+
*
|
|
1143
|
+
* // Get runs for a specific application
|
|
1144
|
+
* const appRuns = await sdk.listApplicationRuns({
|
|
1145
|
+
* applicationId: 'app-123'
|
|
1146
|
+
* });
|
|
1147
|
+
*
|
|
1148
|
+
* // Get runs for a specific application version
|
|
1149
|
+
* const versionRuns = await sdk.listApplicationRuns({
|
|
1150
|
+
* applicationId: 'app-123',
|
|
1151
|
+
* applicationVersion: 'v1.2.0'
|
|
1152
|
+
* });
|
|
1153
|
+
*
|
|
1154
|
+
* console.log(`Found ${allRuns.length} total runs`);
|
|
1155
|
+
* } catch (error) {
|
|
1156
|
+
* console.error('Failed to list application runs:', error.message);
|
|
1157
|
+
* }
|
|
1158
|
+
* ```
|
|
1159
|
+
*/
|
|
1160
|
+
async listApplicationRuns(options) {
|
|
1161
|
+
const client = await this.#getClient();
|
|
1162
|
+
try {
|
|
1163
|
+
const response = await client.listApplicationRunsV1RunsGet({
|
|
1164
|
+
applicationId: options?.applicationId,
|
|
1165
|
+
applicationVersion: options?.applicationVersion
|
|
1166
|
+
});
|
|
1167
|
+
return response.data;
|
|
1168
|
+
} catch (error) {
|
|
1169
|
+
handleRequestError(error);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Create and submit a new application run for processing
|
|
1174
|
+
*
|
|
1175
|
+
* This method creates a new processing job by submitting data items to a
|
|
1176
|
+
* specific application version. The run will be queued and processed
|
|
1177
|
+
* asynchronously on the Aignostics Platform.
|
|
1178
|
+
*
|
|
1179
|
+
* @param request - The run creation request containing application version ID and items to process
|
|
1180
|
+
* @returns A promise that resolves to the created run response with run ID and status
|
|
1181
|
+
* @throws {Error} If the request fails due to network issues, authentication problems, invalid request data, or API errors
|
|
1182
|
+
*
|
|
1183
|
+
* @example
|
|
1184
|
+
* ```typescript
|
|
1185
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1186
|
+
*
|
|
1187
|
+
* try {
|
|
1188
|
+
* const runRequest = {
|
|
1189
|
+
* application_version_id: 'app-version-123',
|
|
1190
|
+
* items: [
|
|
1191
|
+
* {
|
|
1192
|
+
* id: 'item-1',
|
|
1193
|
+
* data: { }
|
|
1194
|
+
* },
|
|
1195
|
+
* {
|
|
1196
|
+
* id: 'item-2',
|
|
1197
|
+
* data: { }
|
|
1198
|
+
* }
|
|
1199
|
+
* ]
|
|
1200
|
+
* };
|
|
1201
|
+
*
|
|
1202
|
+
* const run = await sdk.createApplicationRun(runRequest);
|
|
1203
|
+
* console.log(`Created run with ID: ${run.id}`);
|
|
1204
|
+
* console.log(`Status: ${run.status}`);
|
|
1205
|
+
* } catch (error) {
|
|
1206
|
+
* console.error('Failed to create application run:', error.message);
|
|
1207
|
+
* }
|
|
1208
|
+
* ```
|
|
1209
|
+
*/
|
|
1210
|
+
async createApplicationRun(request) {
|
|
1211
|
+
const client = await this.#getClient();
|
|
1212
|
+
try {
|
|
1213
|
+
const response = await client.createApplicationRunV1RunsPost({
|
|
1214
|
+
runCreationRequest: request
|
|
1215
|
+
});
|
|
1216
|
+
return response.data;
|
|
1217
|
+
} catch (error) {
|
|
1218
|
+
handleRequestError(error);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Retrieve detailed information about a specific application run
|
|
1223
|
+
*
|
|
1224
|
+
* This method fetches complete details about a processing job, including
|
|
1225
|
+
* its current status, progress, metadata, and execution information.
|
|
1226
|
+
*
|
|
1227
|
+
* @param applicationRunId - The unique identifier of the application run
|
|
1228
|
+
* @returns A promise that resolves to the run details object
|
|
1229
|
+
* @throws {Error} If the request fails due to network issues, authentication problems, invalid run ID, or API errors
|
|
1230
|
+
*
|
|
1231
|
+
* @example
|
|
1232
|
+
* ```typescript
|
|
1233
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1234
|
+
*
|
|
1235
|
+
* try {
|
|
1236
|
+
* const run = await sdk.getRun('run-123');
|
|
1237
|
+
* console.log(`Run ID: ${run.id}`);
|
|
1238
|
+
* console.log(`Status: ${run.status}`);
|
|
1239
|
+
* console.log(`Progress: ${run.progress}%`);
|
|
1240
|
+
* console.log(`Created: ${run.created_at}`);
|
|
1241
|
+
* } catch (error) {
|
|
1242
|
+
* console.error('Failed to get run details:', error.message);
|
|
1243
|
+
* }
|
|
1244
|
+
* ```
|
|
1245
|
+
*/
|
|
1246
|
+
async getRun(applicationRunId) {
|
|
1247
|
+
const client = await this.#getClient();
|
|
1248
|
+
try {
|
|
1249
|
+
const response = await client.getRunV1RunsApplicationRunIdGet({
|
|
1250
|
+
applicationRunId
|
|
1251
|
+
});
|
|
1252
|
+
return response.data;
|
|
1253
|
+
} catch (error) {
|
|
1254
|
+
handleRequestError(error);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Cancel a running or queued application run
|
|
1259
|
+
*
|
|
1260
|
+
* This method attempts to cancel an application run that is currently
|
|
1261
|
+
* in progress or waiting in the queue. Once cancelled, the run cannot
|
|
1262
|
+
* be resumed and will transition to a cancelled state.
|
|
1263
|
+
*
|
|
1264
|
+
* @param applicationRunId - The unique identifier of the application run to cancel
|
|
1265
|
+
* @returns A promise that resolves when the cancellation request is successful
|
|
1266
|
+
* @throws {Error} If the request fails due to network issues, authentication problems, invalid run ID, or if the run cannot be cancelled
|
|
1267
|
+
*
|
|
1268
|
+
* @example
|
|
1269
|
+
* ```typescript
|
|
1270
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1271
|
+
*
|
|
1272
|
+
* try {
|
|
1273
|
+
* await sdk.cancelApplicationRun('run-123');
|
|
1274
|
+
* console.log('Run cancellation requested successfully');
|
|
1275
|
+
*
|
|
1276
|
+
* // Check the status to confirm cancellation
|
|
1277
|
+
* const run = await sdk.getRun('run-123');
|
|
1278
|
+
* console.log(`Updated status: ${run.status}`);
|
|
1279
|
+
* } catch (error) {
|
|
1280
|
+
* console.error('Failed to cancel run:', error.message);
|
|
1281
|
+
* }
|
|
1282
|
+
* ```
|
|
1283
|
+
*/
|
|
1284
|
+
async cancelApplicationRun(applicationRunId) {
|
|
1285
|
+
const client = await this.#getClient();
|
|
1286
|
+
try {
|
|
1287
|
+
await client.cancelApplicationRunV1RunsApplicationRunIdCancelPost({
|
|
1288
|
+
applicationRunId
|
|
1289
|
+
});
|
|
1290
|
+
} catch (error) {
|
|
1291
|
+
handleRequestError(error);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Retrieve the processing results for a completed application run
|
|
1296
|
+
*
|
|
1297
|
+
* This method fetches all result items produced by a completed application run.
|
|
1298
|
+
* Results include the processed data, analysis outcomes, and any generated
|
|
1299
|
+
* artifacts from the AI model execution.
|
|
1300
|
+
*
|
|
1301
|
+
* @param applicationRunId - The unique identifier of the application run
|
|
1302
|
+
* @returns A promise that resolves to an array of result items
|
|
1303
|
+
* @throws {Error} If the request fails due to network issues, authentication problems, invalid run ID, or API errors
|
|
1304
|
+
*
|
|
1305
|
+
* @example
|
|
1306
|
+
* ```typescript
|
|
1307
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1308
|
+
*
|
|
1309
|
+
* try {
|
|
1310
|
+
* const results = await sdk.listRunResults('run-123');
|
|
1311
|
+
* console.log(`Found ${results.length} result items`);
|
|
1312
|
+
*
|
|
1313
|
+
* results.forEach((result, index) => {
|
|
1314
|
+
* console.log(`Result ${index + 1}:`);
|
|
1315
|
+
* console.log(`- Item ID: ${result.item_id}`);
|
|
1316
|
+
* console.log(`- Status: ${result.status}`);
|
|
1317
|
+
* console.log(`- Data: ${JSON.stringify(result.data)}`);
|
|
1318
|
+
* });
|
|
1319
|
+
* } catch (error) {
|
|
1320
|
+
* console.error('Failed to list run results:', error.message);
|
|
1321
|
+
* }
|
|
1322
|
+
* ```
|
|
1323
|
+
*/
|
|
1324
|
+
async listRunResults(applicationRunId) {
|
|
1325
|
+
const client = await this.#getClient();
|
|
1326
|
+
try {
|
|
1327
|
+
const response = await client.listRunResultsV1RunsApplicationRunIdResultsGet({
|
|
1328
|
+
applicationRunId
|
|
1329
|
+
});
|
|
1330
|
+
return response.data;
|
|
1331
|
+
} catch (error) {
|
|
1332
|
+
handleRequestError(error);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
/**
|
|
1336
|
+
* Get the current version of the SDK
|
|
1337
|
+
*
|
|
1338
|
+
* This method returns the version string of the Platform SDK, which can be
|
|
1339
|
+
* useful for debugging, logging, or ensuring compatibility with API versions.
|
|
1340
|
+
*
|
|
1341
|
+
* @returns The SDK version string (e.g., "1.2.3")
|
|
1342
|
+
*
|
|
1343
|
+
* @example
|
|
1344
|
+
* ```typescript
|
|
1345
|
+
* const sdk = new PlatformSDKHttp({ tokenProvider: () => 'your-token' });
|
|
1346
|
+
* console.log(`Using SDK version: ${sdk.getVersion()}`);
|
|
1347
|
+
* ```
|
|
1348
|
+
*/
|
|
1349
|
+
getVersion() {
|
|
1350
|
+
return package_default.version;
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Get the current SDK configuration
|
|
1354
|
+
*
|
|
1355
|
+
* This method returns a copy of the current configuration used by the SDK,
|
|
1356
|
+
* including the base URL, timeout settings, and other options. The returned
|
|
1357
|
+
* object is a copy to prevent accidental modification of the internal config.
|
|
1358
|
+
*
|
|
1359
|
+
* @returns A copy of the current SDK configuration object
|
|
1360
|
+
*
|
|
1361
|
+
* @example
|
|
1362
|
+
* ```typescript
|
|
1363
|
+
* const sdk = new PlatformSDKHttp({
|
|
1364
|
+
* baseURL: 'https://api.aignostics.com',
|
|
1365
|
+
* tokenProvider: () => 'your-token',
|
|
1366
|
+
* timeout: 30000
|
|
1367
|
+
* });
|
|
1368
|
+
*
|
|
1369
|
+
* const config = sdk.getConfig();
|
|
1370
|
+
* console.log(`Base URL: ${config.baseURL}`);
|
|
1371
|
+
* console.log(`Timeout: ${config.timeout}ms`);
|
|
1372
|
+
* ```
|
|
1373
|
+
*/
|
|
1374
|
+
getConfig() {
|
|
1375
|
+
return { ...this.#config };
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
// src/index.ts
|
|
1380
|
+
var index_default = PlatformSDKHttp;
|
|
1381
|
+
|
|
1382
|
+
exports.APIError = APIError;
|
|
1383
|
+
exports.ApplicationRunStatus = ApplicationRunStatus;
|
|
1384
|
+
exports.AuthenticationError = AuthenticationError;
|
|
1385
|
+
exports.BaseError = BaseError;
|
|
1386
|
+
exports.Configuration = Configuration;
|
|
1387
|
+
exports.ConfigurationError = ConfigurationError;
|
|
1388
|
+
exports.ItemStatus = ItemStatus;
|
|
1389
|
+
exports.OutputArtifactScope = OutputArtifactScope;
|
|
1390
|
+
exports.PlatformSDKHttp = PlatformSDKHttp;
|
|
1391
|
+
exports.PublicApi = PublicApi;
|
|
1392
|
+
exports.PublicApiAxiosParamCreator = PublicApiAxiosParamCreator;
|
|
1393
|
+
exports.PublicApiFactory = PublicApiFactory;
|
|
1394
|
+
exports.PublicApiFp = PublicApiFp;
|
|
1395
|
+
exports.default = index_default;
|
|
1396
|
+
//# sourceMappingURL=index.cjs.map
|
|
1397
|
+
//# sourceMappingURL=index.cjs.map
|