@aignostics/sdk 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aignostics-sdk-3.3.0.tgz +0 -0
- package/dist/{api-Ce-0fPc3.d.cts → api-CWohsFN3.d.cts} +184 -33
- package/dist/{api-Ce-0fPc3.d.ts → api-CWohsFN3.d.ts} +184 -33
- package/dist/index.cjs +165 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -9
- package/dist/index.d.ts +119 -9
- package/dist/index.js +159 -9
- package/dist/index.js.map +1 -1
- package/dist/test-utils/http-mocks.d.cts +1 -1
- package/dist/test-utils/http-mocks.d.ts +1 -1
- package/package.json +1 -1
- package/dist/aignostics-sdk-3.2.0.tgz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -255,6 +255,35 @@ var PublicApiAxiosParamCreator = function(configuration) {
|
|
|
255
255
|
options: localVarRequestOptions
|
|
256
256
|
};
|
|
257
257
|
},
|
|
258
|
+
/**
|
|
259
|
+
* Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.
|
|
260
|
+
* @summary Get Artifact Url
|
|
261
|
+
* @param {string} runId Run id, returned by `POST /runs/` endpoint
|
|
262
|
+
* @param {string} artifactId The artifact id to download
|
|
263
|
+
* @param {*} [options] Override http request option.
|
|
264
|
+
* @throws {RequiredError}
|
|
265
|
+
*/
|
|
266
|
+
getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet: async (runId, artifactId, options = {}) => {
|
|
267
|
+
assertParamExists("getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet", "runId", runId);
|
|
268
|
+
assertParamExists("getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet", "artifactId", artifactId);
|
|
269
|
+
const localVarPath = `/v1/runs/{run_id}/artifacts/{artifact_id}/file`.replace(`{${"run_id"}}`, encodeURIComponent(String(runId))).replace(`{${"artifact_id"}}`, encodeURIComponent(String(artifactId)));
|
|
270
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
271
|
+
let baseOptions;
|
|
272
|
+
if (configuration) {
|
|
273
|
+
baseOptions = configuration.baseOptions;
|
|
274
|
+
}
|
|
275
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
276
|
+
const localVarHeaderParameter = {};
|
|
277
|
+
const localVarQueryParameter = {};
|
|
278
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration);
|
|
279
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
280
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
281
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
282
|
+
return {
|
|
283
|
+
url: toPathString(localVarUrlObj),
|
|
284
|
+
options: localVarRequestOptions
|
|
285
|
+
};
|
|
286
|
+
},
|
|
258
287
|
/**
|
|
259
288
|
* Retrieve details of a specific item (slide) by its external ID and the run ID.
|
|
260
289
|
* @summary Get Item By Run
|
|
@@ -441,11 +470,12 @@ var PublicApiAxiosParamCreator = function(configuration) {
|
|
|
441
470
|
* @param {string | null} [customMetadata] Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL\'s `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests**
|
|
442
471
|
* @param {number} [page]
|
|
443
472
|
* @param {number} [pageSize]
|
|
473
|
+
* @param {string | null} [forOrganization] Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller\'s own runs.
|
|
444
474
|
* @param {Array<string> | null} [sort] Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)
|
|
445
475
|
* @param {*} [options] Override http request option.
|
|
446
476
|
* @throws {RequiredError}
|
|
447
477
|
*/
|
|
448
|
-
listRunsV1RunsGet: async (applicationId, applicationVersion, externalId, customMetadata, page, pageSize, sort, options = {}) => {
|
|
478
|
+
listRunsV1RunsGet: async (applicationId, applicationVersion, externalId, customMetadata, page, pageSize, forOrganization, sort, options = {}) => {
|
|
449
479
|
const localVarPath = `/v1/runs`;
|
|
450
480
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
451
481
|
let baseOptions;
|
|
@@ -474,6 +504,9 @@ var PublicApiAxiosParamCreator = function(configuration) {
|
|
|
474
504
|
if (pageSize !== void 0) {
|
|
475
505
|
localVarQueryParameter["page_size"] = pageSize;
|
|
476
506
|
}
|
|
507
|
+
if (forOrganization !== void 0) {
|
|
508
|
+
localVarQueryParameter["for_organization"] = forOrganization;
|
|
509
|
+
}
|
|
477
510
|
if (sort) {
|
|
478
511
|
localVarQueryParameter["sort"] = sort;
|
|
479
512
|
}
|
|
@@ -634,6 +667,20 @@ var PublicApiFp = function(configuration) {
|
|
|
634
667
|
const localVarOperationServerBasePath = operationServerMap["PublicApi.deleteRunItemsV1RunsRunIdArtifactsDelete"]?.[localVarOperationServerIndex]?.url;
|
|
635
668
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
636
669
|
},
|
|
670
|
+
/**
|
|
671
|
+
* Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.
|
|
672
|
+
* @summary Get Artifact Url
|
|
673
|
+
* @param {string} runId Run id, returned by `POST /runs/` endpoint
|
|
674
|
+
* @param {string} artifactId The artifact id to download
|
|
675
|
+
* @param {*} [options] Override http request option.
|
|
676
|
+
* @throws {RequiredError}
|
|
677
|
+
*/
|
|
678
|
+
async getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet(runId, artifactId, options) {
|
|
679
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet(runId, artifactId, options);
|
|
680
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
681
|
+
const localVarOperationServerBasePath = operationServerMap["PublicApi.getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet"]?.[localVarOperationServerIndex]?.url;
|
|
682
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
683
|
+
},
|
|
637
684
|
/**
|
|
638
685
|
* Retrieve details of a specific item (slide) by its external ID and the run ID.
|
|
639
686
|
* @summary Get Item By Run
|
|
@@ -718,12 +765,13 @@ var PublicApiFp = function(configuration) {
|
|
|
718
765
|
* @param {string | null} [customMetadata] Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata. #### URL Encoding Required **Important**: JSONPath expressions contain special characters that must be URL-encoded when used in query parameters. Most HTTP clients handle this automatically, but when constructing URLs manually, please ensure proper encoding. #### Examples (Clear Format): - **Field existence**: `$.study` - Runs that have a study field defined - **Exact value match**: `$.study ? (@ == \"high\")` - Runs with specific study value - **Numeric comparison**: `$.confidence_score ? (@ > 0.75)` - Runs with confidence score greater than 0.75 - **Array operations**: `$.tags[*] ? (@ == \"draft\")` - Runs with tags array containing \"draft\" - **Complex conditions**: `$.resources ? (@.gpu_count > 2 && @.memory_gb >= 16)` - Runs with high resource requirements #### Examples (URL-Encoded Format): - **Field existence**: `%24.study` - **Exact value match**: `%24.study%20%3F%20(%40%20%3D%3D%20%22high%22)` - **Numeric comparison**: `%24.confidence_score%20%3F%20(%40%20%3E%200.75)` - **Array operations**: `%24.tags%5B*%5D%20%3F%20(%40%20%3D%3D%20%22draft%22)` - **Complex conditions**: `%24.resources%20%3F%20(%40.gpu_count%20%3E%202%20%26%26%20%40.memory_gb%20%3E%3D%2016)` #### Notes - JSONPath expressions are evaluated using PostgreSQL\'s `@?` operator - The `$.` prefix is automatically added to root-level field references if missing - String values in conditions must be enclosed in double quotes - Use `&&` for AND operations and `||` for OR operations - Regular expressions use `like_regex` with standard regex syntax - **Please remember to URL-encode the entire JSONPath expression when making HTTP requests**
|
|
719
766
|
* @param {number} [page]
|
|
720
767
|
* @param {number} [pageSize]
|
|
768
|
+
* @param {string | null} [forOrganization] Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller\'s own runs.
|
|
721
769
|
* @param {Array<string> | null} [sort] Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. **Available fields:** - `run_id` - `application_id` - `version_number` - `custom_metadata` - `submitted_at` - `submitted_by` - `terminated_at` - `termination_reason` **Examples:** - `?sort=submitted_at` - Sort by creation time (ascending) - `?sort=-submitted_at` - Sort by creation time (descending) - `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)
|
|
722
770
|
* @param {*} [options] Override http request option.
|
|
723
771
|
* @throws {RequiredError}
|
|
724
772
|
*/
|
|
725
|
-
async listRunsV1RunsGet(applicationId, applicationVersion, externalId, customMetadata, page, pageSize, sort, options) {
|
|
726
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.listRunsV1RunsGet(applicationId, applicationVersion, externalId, customMetadata, page, pageSize, sort, options);
|
|
773
|
+
async listRunsV1RunsGet(applicationId, applicationVersion, externalId, customMetadata, page, pageSize, forOrganization, sort, options) {
|
|
774
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listRunsV1RunsGet(applicationId, applicationVersion, externalId, customMetadata, page, pageSize, forOrganization, sort, options);
|
|
727
775
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
728
776
|
const localVarOperationServerBasePath = operationServerMap["PublicApi.listRunsV1RunsGet"]?.[localVarOperationServerIndex]?.url;
|
|
729
777
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -815,6 +863,16 @@ var PublicApiFactory = function(configuration, basePath, axios) {
|
|
|
815
863
|
deleteRunItemsV1RunsRunIdArtifactsDelete(requestParameters, options) {
|
|
816
864
|
return localVarFp.deleteRunItemsV1RunsRunIdArtifactsDelete(requestParameters.runId, options).then((request) => request(axios, basePath));
|
|
817
865
|
},
|
|
866
|
+
/**
|
|
867
|
+
* Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.
|
|
868
|
+
* @summary Get Artifact Url
|
|
869
|
+
* @param {PublicApiGetArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGetRequest} requestParameters Request parameters.
|
|
870
|
+
* @param {*} [options] Override http request option.
|
|
871
|
+
* @throws {RequiredError}
|
|
872
|
+
*/
|
|
873
|
+
getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet(requestParameters, options) {
|
|
874
|
+
return localVarFp.getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet(requestParameters.runId, requestParameters.artifactId, options).then((request) => request(axios, basePath));
|
|
875
|
+
},
|
|
818
876
|
/**
|
|
819
877
|
* Retrieve details of a specific item (slide) by its external ID and the run ID.
|
|
820
878
|
* @summary Get Item By Run
|
|
@@ -872,7 +930,7 @@ var PublicApiFactory = function(configuration, basePath, axios) {
|
|
|
872
930
|
* @throws {RequiredError}
|
|
873
931
|
*/
|
|
874
932
|
listRunsV1RunsGet(requestParameters = {}, options) {
|
|
875
|
-
return localVarFp.listRunsV1RunsGet(requestParameters.applicationId, requestParameters.applicationVersion, requestParameters.externalId, requestParameters.customMetadata, requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(axios, basePath));
|
|
933
|
+
return localVarFp.listRunsV1RunsGet(requestParameters.applicationId, requestParameters.applicationVersion, requestParameters.externalId, requestParameters.customMetadata, requestParameters.page, requestParameters.pageSize, requestParameters.forOrganization, requestParameters.sort, options).then((request) => request(axios, basePath));
|
|
876
934
|
},
|
|
877
935
|
/**
|
|
878
936
|
* Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`.
|
|
@@ -951,6 +1009,17 @@ var PublicApi = class extends BaseAPI {
|
|
|
951
1009
|
deleteRunItemsV1RunsRunIdArtifactsDelete(requestParameters, options) {
|
|
952
1010
|
return PublicApiFp(this.configuration).deleteRunItemsV1RunsRunIdArtifactsDelete(requestParameters.runId, options).then((request) => request(this.axios, this.basePath));
|
|
953
1011
|
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Download the artifact file with the specified artifact_id, belonging to the specified run. The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.
|
|
1014
|
+
* @summary Get Artifact Url
|
|
1015
|
+
* @param {PublicApiGetArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGetRequest} requestParameters Request parameters.
|
|
1016
|
+
* @param {*} [options] Override http request option.
|
|
1017
|
+
* @throws {RequiredError}
|
|
1018
|
+
* @memberof PublicApi
|
|
1019
|
+
*/
|
|
1020
|
+
getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet(requestParameters, options) {
|
|
1021
|
+
return PublicApiFp(this.configuration).getArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGet(requestParameters.runId, requestParameters.artifactId, options).then((request) => request(this.axios, this.basePath));
|
|
1022
|
+
}
|
|
954
1023
|
/**
|
|
955
1024
|
* Retrieve details of a specific item (slide) by its external ID and the run ID.
|
|
956
1025
|
* @summary Get Item By Run
|
|
@@ -1014,7 +1083,7 @@ var PublicApi = class extends BaseAPI {
|
|
|
1014
1083
|
* @memberof PublicApi
|
|
1015
1084
|
*/
|
|
1016
1085
|
listRunsV1RunsGet(requestParameters = {}, options) {
|
|
1017
|
-
return PublicApiFp(this.configuration).listRunsV1RunsGet(requestParameters.applicationId, requestParameters.applicationVersion, requestParameters.externalId, requestParameters.customMetadata, requestParameters.page, requestParameters.pageSize, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
1086
|
+
return PublicApiFp(this.configuration).listRunsV1RunsGet(requestParameters.applicationId, requestParameters.applicationVersion, requestParameters.externalId, requestParameters.customMetadata, requestParameters.page, requestParameters.pageSize, requestParameters.forOrganization, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
|
1018
1087
|
}
|
|
1019
1088
|
/**
|
|
1020
1089
|
* Update the custom metadata of the item with the specified `external_id`, belonging to the specified run. Optionally, a checksum may be provided along the custom metadata JSON. It can be used to verify if the custom metadata was updated since the last time it was accessed. If the checksum is provided, it must match the existing custom metadata in the system, ensuring that the current custom metadata value to be overwritten is acknowledged by the user. If no checksum is provided, submitted metadata directly overwrites the existing metadata, without any checks. The latest custom metadata and checksum can be retrieved for individual items via `GET /v1/runs/{run_id}/items/{external_id}`, and for all items of a run via `GET /v1/runs/{run_id}/items`.
|
|
@@ -1224,6 +1293,87 @@ var UnexpectedError = class extends BaseError {
|
|
|
1224
1293
|
super(message, "UNEXPECTED_ERROR", options);
|
|
1225
1294
|
}
|
|
1226
1295
|
};
|
|
1296
|
+
|
|
1297
|
+
// src/entities/application-run/utils.ts
|
|
1298
|
+
function getRunProgress(run) {
|
|
1299
|
+
const {
|
|
1300
|
+
item_count,
|
|
1301
|
+
item_succeeded_count,
|
|
1302
|
+
item_user_error_count,
|
|
1303
|
+
item_system_error_count,
|
|
1304
|
+
item_skipped_count
|
|
1305
|
+
} = run.statistics;
|
|
1306
|
+
if (item_count === 0) return 0;
|
|
1307
|
+
const processed = item_succeeded_count + item_user_error_count + item_system_error_count + item_skipped_count;
|
|
1308
|
+
return Math.round(processed / item_count * 100);
|
|
1309
|
+
}
|
|
1310
|
+
function getRunStatus(run) {
|
|
1311
|
+
const { state, statistics, termination_reason } = run;
|
|
1312
|
+
switch (state) {
|
|
1313
|
+
case "PENDING":
|
|
1314
|
+
return "PENDING";
|
|
1315
|
+
case "PROCESSING":
|
|
1316
|
+
return "PROCESSING";
|
|
1317
|
+
case "TERMINATED":
|
|
1318
|
+
if (termination_reason === "CANCELED_BY_USER") {
|
|
1319
|
+
return "CANCELED";
|
|
1320
|
+
}
|
|
1321
|
+
if (termination_reason === "CANCELED_BY_SYSTEM") {
|
|
1322
|
+
return "FAILED";
|
|
1323
|
+
}
|
|
1324
|
+
if (statistics.item_count !== statistics.item_succeeded_count) {
|
|
1325
|
+
return "COMPLETED_WITH_ERRORS";
|
|
1326
|
+
}
|
|
1327
|
+
return "COMPLETED";
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
var canDownloadRunItems = (run) => {
|
|
1331
|
+
const status = getRunStatus(run);
|
|
1332
|
+
return !["FAILED", "CANCELED", "PENDING", "PROCESSING"].includes(status);
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
// src/entities/application-run/process-application-run.ts
|
|
1336
|
+
var processApplicationRun = (run) => {
|
|
1337
|
+
return {
|
|
1338
|
+
...run,
|
|
1339
|
+
progress: getRunProgress(run),
|
|
1340
|
+
status: getRunStatus(run),
|
|
1341
|
+
can_download: canDownloadRunItems(run)
|
|
1342
|
+
};
|
|
1343
|
+
};
|
|
1344
|
+
|
|
1345
|
+
// src/entities/run-item/utils.ts
|
|
1346
|
+
var canDownloadItem = (item) => {
|
|
1347
|
+
return getItemStatus(item) === "COMPLETED";
|
|
1348
|
+
};
|
|
1349
|
+
function getItemStatus(item) {
|
|
1350
|
+
const { state, termination_reason } = item;
|
|
1351
|
+
switch (state) {
|
|
1352
|
+
case "PENDING":
|
|
1353
|
+
return "PENDING";
|
|
1354
|
+
case "PROCESSING":
|
|
1355
|
+
return "PROCESSING";
|
|
1356
|
+
case "TERMINATED":
|
|
1357
|
+
if (termination_reason === "SYSTEM_ERROR" || termination_reason === "USER_ERROR") {
|
|
1358
|
+
return "FAILED";
|
|
1359
|
+
}
|
|
1360
|
+
if (termination_reason === "SKIPPED") {
|
|
1361
|
+
return "SKIPPED";
|
|
1362
|
+
}
|
|
1363
|
+
return "COMPLETED";
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
// src/entities/run-item/process-run-item.ts
|
|
1368
|
+
var processRunItem = (item) => {
|
|
1369
|
+
return {
|
|
1370
|
+
...item,
|
|
1371
|
+
status: getItemStatus(item),
|
|
1372
|
+
can_download: canDownloadItem(item)
|
|
1373
|
+
};
|
|
1374
|
+
};
|
|
1375
|
+
|
|
1376
|
+
// src/platform-sdk.ts
|
|
1227
1377
|
var validationErrorSchema = z__default.default.object({
|
|
1228
1378
|
detail: z__default.default.array(
|
|
1229
1379
|
z__default.default.object({
|
|
@@ -1490,7 +1640,7 @@ var PlatformSDKHttp = class {
|
|
|
1490
1640
|
page: options?.page,
|
|
1491
1641
|
pageSize: options?.pageSize
|
|
1492
1642
|
});
|
|
1493
|
-
return response.data;
|
|
1643
|
+
return response.data.map(processApplicationRun);
|
|
1494
1644
|
} catch (error) {
|
|
1495
1645
|
handleRequestError(error);
|
|
1496
1646
|
}
|
|
@@ -1575,7 +1725,7 @@ var PlatformSDKHttp = class {
|
|
|
1575
1725
|
const response = await client.getRunV1RunsRunIdGet({
|
|
1576
1726
|
runId: applicationRunId
|
|
1577
1727
|
});
|
|
1578
|
-
return response.data;
|
|
1728
|
+
return processApplicationRun(response.data);
|
|
1579
1729
|
} catch (error) {
|
|
1580
1730
|
handleRequestError(error);
|
|
1581
1731
|
}
|
|
@@ -1666,7 +1816,7 @@ var PlatformSDKHttp = class {
|
|
|
1666
1816
|
state,
|
|
1667
1817
|
terminationReason
|
|
1668
1818
|
});
|
|
1669
|
-
return response.data;
|
|
1819
|
+
return response.data.map(processRunItem);
|
|
1670
1820
|
} catch (error) {
|
|
1671
1821
|
handleRequestError(error);
|
|
1672
1822
|
}
|
|
@@ -1739,6 +1889,13 @@ exports.PublicApiFp = PublicApiFp;
|
|
|
1739
1889
|
exports.RunOutput = RunOutput;
|
|
1740
1890
|
exports.RunState = RunState;
|
|
1741
1891
|
exports.RunTerminationReason = RunTerminationReason;
|
|
1892
|
+
exports.canDownloadItem = canDownloadItem;
|
|
1893
|
+
exports.canDownloadRunItems = canDownloadRunItems;
|
|
1742
1894
|
exports.default = index_default;
|
|
1895
|
+
exports.getItemStatus = getItemStatus;
|
|
1896
|
+
exports.getRunProgress = getRunProgress;
|
|
1897
|
+
exports.getRunStatus = getRunStatus;
|
|
1898
|
+
exports.processApplicationRun = processApplicationRun;
|
|
1899
|
+
exports.processRunItem = processRunItem;
|
|
1743
1900
|
//# sourceMappingURL=index.cjs.map
|
|
1744
1901
|
//# sourceMappingURL=index.cjs.map
|