@partium/js-sdk 16.1.0 → 16.2.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.
Files changed (95) hide show
  1. package/core/constants/constants.d.ts +1 -1
  2. package/core/constants/constants.js +1 -1
  3. package/core/index.d.ts +1 -0
  4. package/core/index.js +1 -1
  5. package/core/integration-defaults/http/handle-axios-error-helper.d.ts +39 -3
  6. package/core/integration-defaults/http/handle-axios-error-helper.js +1 -1
  7. package/core/integration-defaults/http/https-client/axios-https-client.service.d.ts +1 -0
  8. package/core/integration-defaults/http/https-client/axios-https-client.service.js +1 -1
  9. package/core/integration-defaults/http/https-client/fetch-api-https-client.service.d.ts +1 -0
  10. package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +1 -1
  11. package/core/models/blob-download-response.d.ts +5 -0
  12. package/core/models/log.d.ts +2 -2
  13. package/core/models/log.js +1 -1
  14. package/core/services/http/https-client/https-client.service.interface.d.ts +2 -1
  15. package/core/services/http/https.service.interface.d.ts +4 -3
  16. package/core/services/http/https.service.interface.js +1 -1
  17. package/core/services/http/oauth-https.service.d.ts +2 -1
  18. package/core/services/http/oauth-https.service.js +1 -1
  19. package/core/utils/multipart-upload.helper.d.ts +6 -4
  20. package/core/utils/multipart-upload.helper.js +1 -1
  21. package/core/utils/parse-content-disposition-filename.d.ts +5 -0
  22. package/core/utils/parse-content-disposition-filename.js +2 -0
  23. package/enrichment/index.d.ts +2 -0
  24. package/enrichment/index.js +1 -1
  25. package/enrichment/models/download-enrichment-job-results-request.d.ts +18 -0
  26. package/enrichment/models/download-enrichment-job-results-response.d.ts +3 -0
  27. package/enrichment/services/data-enrichment.service.d.ts +10 -0
  28. package/enrichment/services/data-enrichment.service.js +1 -1
  29. package/find/models/search-input.d.ts +4 -0
  30. package/find/services/asset.service.js +1 -1
  31. package/find/services/search/search.service.d.ts +1 -0
  32. package/find/services/search/search.service.js +1 -1
  33. package/gen/sdk-version.d.ts +1 -1
  34. package/gen/sdk-version.js +1 -1
  35. package/index.d.ts +2 -2
  36. package/index.js +1 -1
  37. package/ocr/services/ocr.service.js +1 -1
  38. package/package.json +1 -1
  39. package/part-list/index.d.ts +17 -0
  40. package/part-list/index.js +2 -0
  41. package/part-list/models/add-all-search-session-parts-to-part-list-request.d.ts +7 -0
  42. package/part-list/models/add-all-search-session-parts-to-part-list-response.d.ts +11 -0
  43. package/part-list/models/add-parts-to-part-list-request.d.ts +7 -0
  44. package/part-list/models/add-parts-to-part-list-response.d.ts +15 -0
  45. package/{selection/models/add-parts-to-selection-request.d.ts → part-list/models/check-which-parts-in-part-list-request.d.ts} +1 -1
  46. package/{selection/models/check-which-parts-in-selection-request.d.ts → part-list/models/check-which-parts-in-part-list-response.d.ts} +1 -1
  47. package/part-list/models/create-collection-from-file-request.d.ts +10 -0
  48. package/part-list/models/create-collection-from-file-response.d.ts +28 -0
  49. package/part-list/models/create-selection-request.d.ts +14 -0
  50. package/part-list/models/create-selection-response.d.ts +22 -0
  51. package/part-list/models/empty-part-list-request.d.ts +7 -0
  52. package/part-list/models/empty-part-list.response.d.ts +7 -0
  53. package/part-list/models/empty-part-list.response.js +2 -0
  54. package/{selection/models/selection-search-summary-response.d.ts → part-list/models/part-list-search-summary-response.d.ts} +1 -1
  55. package/part-list/models/part-list-search-summary-response.js +2 -0
  56. package/{selection/models/add-all-search-session-parts-to-selection-request.d.ts → part-list/models/remove-all-search-session-parts-from-part-list-request.d.ts} +1 -1
  57. package/part-list/models/remove-all-search-session-parts-from-part-list-request.js +2 -0
  58. package/part-list/models/remove-all-search-session-parts-from-part-list-response.d.ts +5 -0
  59. package/part-list/models/remove-all-search-session-parts-from-part-list-response.js +2 -0
  60. package/part-list/models/remove-parts-from-part-list-request.d.ts +7 -0
  61. package/part-list/models/remove-parts-from-part-list-request.js +2 -0
  62. package/part-list/models/remove-parts-from-part-list-response.d.ts +15 -0
  63. package/part-list/models/remove-parts-from-part-list-response.js +2 -0
  64. package/part-list/services/part-list.service.d.ts +107 -0
  65. package/part-list/services/part-list.service.js +2 -0
  66. package/selection/index.d.ts +0 -17
  67. package/selection/index.js +0 -2
  68. package/selection/models/add-all-search-session-parts-to-selection-response.d.ts +0 -5
  69. package/selection/models/add-parts-from-file-to-selection-request.d.ts +0 -10
  70. package/selection/models/add-parts-from-file-to-selection-response.d.ts +0 -33
  71. package/selection/models/add-parts-from-file-to-selection-response.js +0 -2
  72. package/selection/models/add-parts-to-selection-response.d.ts +0 -5
  73. package/selection/models/check-which-parts-in-selection-response.d.ts +0 -4
  74. package/selection/models/create-selection-request.d.ts +0 -6
  75. package/selection/models/create-selection-response.d.ts +0 -10
  76. package/selection/models/remove-all-search-session-parts-from-selection-request.d.ts +0 -4
  77. package/selection/models/remove-all-search-session-parts-from-selection-response.d.ts +0 -5
  78. package/selection/models/remove-parts-from-selection-request.d.ts +0 -4
  79. package/selection/models/remove-parts-from-selection-response.d.ts +0 -5
  80. package/selection/services/selection.service.d.ts +0 -95
  81. package/selection/services/selection.service.js +0 -2
  82. /package/{selection/models/add-all-search-session-parts-to-selection-request.js → core/models/blob-download-response.js} +0 -0
  83. /package/{selection/models/add-all-search-session-parts-to-selection-response.js → enrichment/models/download-enrichment-job-results-request.js} +0 -0
  84. /package/{selection/models/add-parts-from-file-to-selection-request.js → enrichment/models/download-enrichment-job-results-response.js} +0 -0
  85. /package/{selection/models/add-parts-to-selection-request.js → part-list/models/add-all-search-session-parts-to-part-list-request.js} +0 -0
  86. /package/{selection/models/add-parts-to-selection-response.js → part-list/models/add-all-search-session-parts-to-part-list-response.js} +0 -0
  87. /package/{selection/models/check-which-parts-in-selection-request.js → part-list/models/add-parts-to-part-list-request.js} +0 -0
  88. /package/{selection/models/check-which-parts-in-selection-response.js → part-list/models/add-parts-to-part-list-response.js} +0 -0
  89. /package/{selection/models/create-selection-request.js → part-list/models/check-which-parts-in-part-list-request.js} +0 -0
  90. /package/{selection/models/create-selection-response.js → part-list/models/check-which-parts-in-part-list-response.js} +0 -0
  91. /package/{selection/models/remove-all-search-session-parts-from-selection-request.js → part-list/models/create-collection-from-file-request.js} +0 -0
  92. /package/{selection/models/remove-all-search-session-parts-from-selection-response.js → part-list/models/create-collection-from-file-response.js} +0 -0
  93. /package/{selection/models/remove-parts-from-selection-request.js → part-list/models/create-selection-request.js} +0 -0
  94. /package/{selection/models/remove-parts-from-selection-response.js → part-list/models/create-selection-response.js} +0 -0
  95. /package/{selection/models/selection-search-summary-response.js → part-list/models/empty-part-list-request.js} +0 -0
@@ -12,5 +12,5 @@ export declare const REL_DATACURATION_API_URL = "datacuration";
12
12
  export declare const REL_DATA_V2_API_URL = "data";
13
13
  export declare const REL_DATA_ENRICHMENT_API_URL = "enrichment";
14
14
  export declare const REL_BACKOFFICE_API_URL = "backoffice";
15
- export declare const REL_SELECTION_API_URL = "selection";
15
+ export declare const REL_PART_LIST_API_URL = "part-list";
16
16
  export declare const BACKEND_STATUS_FALLBACK_URL = "https://example.com";
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BACKEND_STATUS_FALLBACK_URL=exports.REL_SELECTION_API_URL=exports.REL_BACKOFFICE_API_URL=exports.REL_DATA_ENRICHMENT_API_URL=exports.REL_DATA_V2_API_URL=exports.REL_DATACURATION_API_URL=exports.REL_CATALOG_API_URL=exports.REL_MANAGEMENT_API_URL=exports.REL_STATUS_API_URL=exports.REL_AUTH_API_URL=exports.REL_USER_DATA_API_URL=exports.REL_LOGS_API_URL=exports.REL_CSA_API_URL=exports.REL_DATA_API_URL=exports.PARTIUM_API_VERSION=void 0,exports.PARTIUM_API_VERSION=1,exports.REL_DATA_API_URL="_data",exports.REL_CSA_API_URL="_csa",exports.REL_LOGS_API_URL="_logs",exports.REL_USER_DATA_API_URL="_ud",exports.REL_AUTH_API_URL="_auth",exports.REL_STATUS_API_URL="_status",exports.REL_MANAGEMENT_API_URL="management",exports.REL_CATALOG_API_URL="catalog",exports.REL_DATACURATION_API_URL="datacuration",exports.REL_DATA_V2_API_URL="data",exports.REL_DATA_ENRICHMENT_API_URL="enrichment",exports.REL_BACKOFFICE_API_URL="backoffice",exports.REL_SELECTION_API_URL="selection",exports.BACKEND_STATUS_FALLBACK_URL="https://example.com";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BACKEND_STATUS_FALLBACK_URL=exports.REL_PART_LIST_API_URL=exports.REL_BACKOFFICE_API_URL=exports.REL_DATA_ENRICHMENT_API_URL=exports.REL_DATA_V2_API_URL=exports.REL_DATACURATION_API_URL=exports.REL_CATALOG_API_URL=exports.REL_MANAGEMENT_API_URL=exports.REL_STATUS_API_URL=exports.REL_AUTH_API_URL=exports.REL_USER_DATA_API_URL=exports.REL_LOGS_API_URL=exports.REL_CSA_API_URL=exports.REL_DATA_API_URL=exports.PARTIUM_API_VERSION=void 0,exports.PARTIUM_API_VERSION=1,exports.REL_DATA_API_URL="_data",exports.REL_CSA_API_URL="_csa",exports.REL_LOGS_API_URL="_logs",exports.REL_USER_DATA_API_URL="_ud",exports.REL_AUTH_API_URL="_auth",exports.REL_STATUS_API_URL="_status",exports.REL_MANAGEMENT_API_URL="management",exports.REL_CATALOG_API_URL="catalog",exports.REL_DATACURATION_API_URL="datacuration",exports.REL_DATA_V2_API_URL="data",exports.REL_DATA_ENRICHMENT_API_URL="enrichment",exports.REL_BACKOFFICE_API_URL="backoffice",exports.REL_PART_LIST_API_URL="part-list",exports.BACKEND_STATUS_FALLBACK_URL="https://example.com";
package/core/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from './models/formatted-string';
22
22
  export * from './models/i18n-map';
23
23
  export * from './models/error';
24
24
  export * from './models/api-object';
25
+ export * from './models/blob-download-response';
25
26
  export * from './models/paginated-list';
26
27
  export * from './models/log';
27
28
  export * from './models/device-info';
package/core/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,i)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./decorators/injection-identifier"),exports),__exportStar(require("./integration-defaults/js-p-file"),exports),__exportStar(require("./integration-defaults/web-local-storage.service"),exports),__exportStar(require("./integration-defaults/web-device-status.service"),exports),__exportStar(require("./integration-defaults/web-indexeddb.service"),exports),__exportStar(require("./integration-defaults/web-file.service"),exports),__exportStar(require("./integration-defaults/http/js-oauth-keycloak-https.service"),exports),__exportStar(require("./integration-defaults/http/https-client/axios-https-client.service"),exports),__exportStar(require("./integration-defaults/http/https-client/fetch-api-https-client.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/axios-file-transfer.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/fetch-api-file-transfer.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-auth-config"),exports),__exportStar(require("./integration-defaults/session/js-oauth-api-key-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-web-cookie-session.service"),exports),__exportStar(require("./models/i18n-string"),exports),__exportStar(require("./models/partium-config"),exports),__exportStar(require("./models/auth-config"),exports),__exportStar(require("./models/p-file"),exports),__exportStar(require("./models/formatted-string"),exports),__exportStar(require("./models/i18n-map"),exports),__exportStar(require("./models/error"),exports),__exportStar(require("./models/api-object"),exports),__exportStar(require("./models/paginated-list"),exports),__exportStar(require("./models/log"),exports),__exportStar(require("./models/device-info"),exports),__exportStar(require("./models/user-token"),exports),__exportStar(require("./models/user"),exports),__exportStar(require("./models/base-response"),exports),__exportStar(require("./services/service-provider"),exports),__exportStar(require("./services/local-storage.service.interface"),exports),__exportStar(require("./services/backend-status.service"),exports),__exportStar(require("./services/http/https.service.interface"),exports),__exportStar(require("./services/http/https-client/https-client.service.interface"),exports),__exportStar(require("./services/http/file-transfer/file-transfer.service.interface"),exports),__exportStar(require("./services/http/oauth-https.service"),exports),__exportStar(require("./services/base.service"),exports),__exportStar(require("./services/base-login-init.service"),exports),__exportStar(require("./services/device-status.service.interface"),exports),__exportStar(require("./services/session/session.service.interface"),exports),__exportStar(require("./services/session/oauth-session.service"),exports),__exportStar(require("./services/paginated-request.service"),exports),__exportStar(require("./services/log.service"),exports),__exportStar(require("./factories/paginated-request-service.factory"),exports),__exportStar(require("./services/file.service.interface"),exports),__exportStar(require("./services/recent-parts.service"),exports),__exportStar(require("./models/base-paginated-request"),exports),__exportStar(require("./models/base-paginated-response"),exports),__exportStar(require("./models/default-get-paginated-request-pagination-context"),exports),__exportStar(require("./utils/general-helper"),exports),__exportStar(require("./utils/multipart-upload.helper"),exports),__exportStar(require("./services/organization"),exports);
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,i)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./decorators/injection-identifier"),exports),__exportStar(require("./integration-defaults/js-p-file"),exports),__exportStar(require("./integration-defaults/web-local-storage.service"),exports),__exportStar(require("./integration-defaults/web-device-status.service"),exports),__exportStar(require("./integration-defaults/web-indexeddb.service"),exports),__exportStar(require("./integration-defaults/web-file.service"),exports),__exportStar(require("./integration-defaults/http/js-oauth-keycloak-https.service"),exports),__exportStar(require("./integration-defaults/http/https-client/axios-https-client.service"),exports),__exportStar(require("./integration-defaults/http/https-client/fetch-api-https-client.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/axios-file-transfer.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/fetch-api-file-transfer.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-auth-config"),exports),__exportStar(require("./integration-defaults/session/js-oauth-api-key-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-web-cookie-session.service"),exports),__exportStar(require("./models/i18n-string"),exports),__exportStar(require("./models/partium-config"),exports),__exportStar(require("./models/auth-config"),exports),__exportStar(require("./models/p-file"),exports),__exportStar(require("./models/formatted-string"),exports),__exportStar(require("./models/i18n-map"),exports),__exportStar(require("./models/error"),exports),__exportStar(require("./models/api-object"),exports),__exportStar(require("./models/blob-download-response"),exports),__exportStar(require("./models/paginated-list"),exports),__exportStar(require("./models/log"),exports),__exportStar(require("./models/device-info"),exports),__exportStar(require("./models/user-token"),exports),__exportStar(require("./models/user"),exports),__exportStar(require("./models/base-response"),exports),__exportStar(require("./services/service-provider"),exports),__exportStar(require("./services/local-storage.service.interface"),exports),__exportStar(require("./services/backend-status.service"),exports),__exportStar(require("./services/http/https.service.interface"),exports),__exportStar(require("./services/http/https-client/https-client.service.interface"),exports),__exportStar(require("./services/http/file-transfer/file-transfer.service.interface"),exports),__exportStar(require("./services/http/oauth-https.service"),exports),__exportStar(require("./services/base.service"),exports),__exportStar(require("./services/base-login-init.service"),exports),__exportStar(require("./services/device-status.service.interface"),exports),__exportStar(require("./services/session/session.service.interface"),exports),__exportStar(require("./services/session/oauth-session.service"),exports),__exportStar(require("./services/paginated-request.service"),exports),__exportStar(require("./services/log.service"),exports),__exportStar(require("./factories/paginated-request-service.factory"),exports),__exportStar(require("./services/file.service.interface"),exports),__exportStar(require("./services/recent-parts.service"),exports),__exportStar(require("./models/base-paginated-request"),exports),__exportStar(require("./models/base-paginated-response"),exports),__exportStar(require("./models/default-get-paginated-request-pagination-context"),exports),__exportStar(require("./utils/general-helper"),exports),__exportStar(require("./utils/multipart-upload.helper"),exports),__exportStar(require("./services/organization"),exports);
@@ -1,11 +1,19 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- import { AxiosError } from "axios";
3
- import { Observable } from "rxjs";
4
- import { SDK_ERROR_CODES } from "../../models/error";
2
+ import { AxiosError } from 'axios';
3
+ import { Observable } from 'rxjs';
4
+ import { SDK_ERROR_CODES } from '../../models/error';
5
5
  /**
6
6
  * Helper function that provides error-handling and -parsing functionality for Axios-Errors.
7
7
  */
8
8
  export declare class HandleAxiosErrorHelper {
9
+ /**
10
+ * Process blob-download errors, including binary JSON error bodies.
11
+ */
12
+ static processBlobError(error: unknown): Observable<never>;
13
+ /**
14
+ * Process JSON request errors.
15
+ */
16
+ static processResponseError(error: unknown): Observable<never>;
9
17
  /**
10
18
  * Process and interpret errors that appear during the request and
11
19
  * wrap them into SdkError objects
@@ -13,5 +21,33 @@ export declare class HandleAxiosErrorHelper {
13
21
  * @param error the error that occurred
14
22
  */
15
23
  static processError(error: AxiosError): Observable<never>;
24
+ /**
25
+ * Map a prepared axios error and backend errorCode to the matching SdkError.
26
+ */
27
+ private static mapAxiosErrorToSdkError;
16
28
  static getErrorCodeFromError(error: AxiosError): SDK_ERROR_CODES;
29
+ /**
30
+ * Normalize blob-download failures into an AxiosError with a JSON-parseable response body.
31
+ * Handles both axios rejections and AxiosResponse objects thrown from processBlobResponse.
32
+ */
33
+ private static prepareBlobAxiosError;
34
+ /**
35
+ * Normalize JSON request failures into an AxiosError.
36
+ * Wraps plain AxiosResponse throws from processResponse so processError can handle them.
37
+ */
38
+ private static prepareJsonAxiosError;
39
+ /**
40
+ * Decode binary axios error bodies into plain objects when the backend returns JSON.
41
+ * Non-JSON binary payloads are returned unchanged.
42
+ */
43
+ private static parseErrorResponseData;
44
+ /**
45
+ * Read blob response text across browser and test environments.
46
+ * Falls back to FileReader when Blob.text() is unavailable (e.g. jsdom).
47
+ */
48
+ private static readBlobAsText;
49
+ /**
50
+ * Decode an ArrayBuffer response body as UTF-8 text.
51
+ */
52
+ private static decodeBinaryBody;
17
53
  }
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.HandleAxiosErrorHelper=void 0;var rxjs_1=require("rxjs"),error_1=require("../../models/error"),HandleAxiosErrorHelper=function(){function r(){}return r.processError=function(e){if(e instanceof error_1.SdkError)return(0,rxjs_1.throwError)(e);var o=r.getErrorCodeFromError(e);if(e.isAxiosError)if(e.response)switch(e.response.status){case 400:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.BAD_REQUEST,e));case 401:return-1!==[error_1.SDK_ERROR_CODES.INVALID_TOKEN,error_1.SDK_ERROR_CODES.TOKEN_EXPIRED].indexOf(o)?(0,rxjs_1.throwError)(new error_1.SdkError(o,e)):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.USER_UNAUTHORIZED,e));case 403:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.FORBIDDEN,e));case 404:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NOT_FOUND,e));case 409:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.CONFLICT,e));case 413:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.CONTENT_TOO_LARGE,e));case 415:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.UNSUPPORTED_MEDIA_TYPE,e));case 422:return-1!==[error_1.SDK_ERROR_CODES.INVALID_MULTIPLE_IMAGE_SEARCHES,error_1.SDK_ERROR_CODES.INVALID_SEARCH_LANGUAGE,error_1.SDK_ERROR_CODES.INVALID_SEARCH_MODALITY_CONFIG].indexOf(o)?(0,rxjs_1.throwError)(new error_1.SdkError(o,e)):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.UNPROCESSABLE_ENTITY,e));case 500:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.INTERNAL_SERVER_ERROR,e));case 501:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NOT_IMPLEMENTED,e));case 502:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.BAD_GATEWAY,e));case 503:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.SERVICE_UNAVAILABLE,e));case 504:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.GATEWAY_TIMEOUT,e))}else if(e.request)return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.COULD_NOT_REACH_SERVER,e));return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.UNKNOWN_ERROR,e))},r.getErrorCodeFromError=function(r){return r.response&&r.response.data?r.response.data.errorCode:error_1.SDK_ERROR_CODES.UNKNOWN_ERROR},r}();exports.HandleAxiosErrorHelper=HandleAxiosErrorHelper;
2
+ "use strict";var __awaiter=this&&this.__awaiter||function(r,e,o,n){return new(o||(o=Promise))((function(t,s){function a(r){try{E(n.next(r))}catch(r){s(r)}}function _(r){try{E(n.throw(r))}catch(r){s(r)}}function E(r){var e;r.done?t(r.value):(e=r.value,e instanceof o?e:new o((function(r){r(e)}))).then(a,_)}E((n=n.apply(r,e||[])).next())}))},__generator=this&&this.__generator||function(r,e){var o,n,t,s,a={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return s={next:_(0),throw:_(1),return:_(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function _(_){return function(E){return function(_){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,_[0]&&(a=0)),a;)try{if(o=1,n&&(t=2&_[0]?n.return:_[0]?n.throw||((t=n.return)&&t.call(n),0):n.next)&&!(t=t.call(n,_[1])).done)return t;switch(n=0,t&&(_=[2&_[0],t.value]),_[0]){case 0:case 1:t=_;break;case 4:return a.label++,{value:_[1],done:!1};case 5:a.label++,n=_[1],_=[0];continue;case 7:_=a.ops.pop(),a.trys.pop();continue;default:if(!(t=a.trys,(t=t.length>0&&t[t.length-1])||6!==_[0]&&2!==_[0])){a=0;continue}if(3===_[0]&&(!t||_[1]>t[0]&&_[1]<t[3])){a.label=_[1];break}if(6===_[0]&&a.label<t[1]){a.label=t[1],t=_;break}if(t&&a.label<t[2]){a.label=t[2],a.ops.push(_);break}t[2]&&a.ops.pop(),a.trys.pop();continue}_=e.call(r,a)}catch(r){_=[6,r],n=0}finally{o=t=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([_,E])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HandleAxiosErrorHelper=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),error_1=require("../../models/error"),HandleAxiosErrorHelper=function(){function r(){}return r.processBlobError=function(e){return(0,rxjs_1.from)(r.prepareBlobAxiosError(e)).pipe((0,operators_1.mergeMap)((function(e){return r.processError(e)})))},r.processResponseError=function(e){return r.processError(r.prepareJsonAxiosError(e))},r.processError=function(e){if(e instanceof error_1.SdkError)return(0,rxjs_1.throwError)((function(){return e}));var o=r.getErrorCodeFromError(e);return r.mapAxiosErrorToSdkError(e,o)},r.mapAxiosErrorToSdkError=function(r,e){if(r.isAxiosError)if(r.response)switch(r.response.status){case 400:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.BAD_REQUEST,r));case 401:return-1!==[error_1.SDK_ERROR_CODES.INVALID_TOKEN,error_1.SDK_ERROR_CODES.TOKEN_EXPIRED].indexOf(e)?(0,rxjs_1.throwError)(new error_1.SdkError(e,r)):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.USER_UNAUTHORIZED,r));case 403:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.FORBIDDEN,r));case 404:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NOT_FOUND,r));case 409:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.CONFLICT,r));case 413:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.CONTENT_TOO_LARGE,r));case 415:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.UNSUPPORTED_MEDIA_TYPE,r));case 422:return-1!==[error_1.SDK_ERROR_CODES.INVALID_MULTIPLE_IMAGE_SEARCHES,error_1.SDK_ERROR_CODES.INVALID_SEARCH_LANGUAGE,error_1.SDK_ERROR_CODES.INVALID_SEARCH_MODALITY_CONFIG].indexOf(e)?(0,rxjs_1.throwError)(new error_1.SdkError(e,r)):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.UNPROCESSABLE_ENTITY,r));case 500:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.INTERNAL_SERVER_ERROR,r));case 501:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NOT_IMPLEMENTED,r));case 502:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.BAD_GATEWAY,r));case 503:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.SERVICE_UNAVAILABLE,r));case 504:return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.GATEWAY_TIMEOUT,r))}else if(r.request)return(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.COULD_NOT_REACH_SERVER,r));return(0,rxjs_1.throwError)((function(){return new error_1.SdkError(error_1.SDK_ERROR_CODES.UNKNOWN_ERROR,r)}))},r.getErrorCodeFromError=function(r){var e;return(null===(e=r.response)||void 0===e?void 0:e.data)&&"object"==typeof r.response.data&&null!==r.response.data&&"errorCode"in r.response.data?r.response.data.errorCode:error_1.SDK_ERROR_CODES.UNKNOWN_ERROR},r.prepareBlobAxiosError=function(e){return __awaiter(this,void 0,void 0,(function(){var o,n,t,s,a,_,E;return __generator(this,(function(i){switch(i.label){case 0:return e instanceof error_1.SdkError?[2,e]:(null==(o=e)?void 0:o.isAxiosError)&&null!=(null===(E=o.response)||void 0===E?void 0:E.data)?(n=o.response,[4,r.parseErrorResponseData(o.response.data)]):[3,2];case 1:return n.data=i.sent(),[2,o];case 2:return(null==(t=e)?void 0:t.status)?(a={isAxiosError:!0},_={status:t.status},null==t.data?[3,4]:[4,r.parseErrorResponseData(t.data)]):[3,6];case 3:return s=i.sent(),[3,5];case 4:s=t.data,i.label=5;case 5:return[2,(a.response=(_.data=s,_.headers=t.headers,_),a)];case 6:return[2,e]}}))}))},r.prepareJsonAxiosError=function(r){if(r instanceof error_1.SdkError)return r;var e=r;if(null==e?void 0:e.isAxiosError)return e;var o=r;return(null==o?void 0:o.status)?{isAxiosError:!0,response:{status:o.status,data:o.data,headers:o.headers}}:r},r.parseErrorResponseData=function(e){return __awaiter(this,void 0,void 0,(function(){var o,n;return __generator(this,(function(t){switch(t.label){case 0:if(e instanceof ArrayBuffer)try{return[2,JSON.parse(r.decodeBinaryBody(e))]}catch(r){return[2,e]}if(!("undefined"!=typeof Blob&&e instanceof Blob))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),n=(o=JSON).parse,[4,r.readBlobAsText(e)];case 2:return[2,n.apply(o,[t.sent()])];case 3:return t.sent(),[2,e];case 4:return[2,e]}}))}))},r.readBlobAsText=function(e){return __awaiter(this,void 0,void 0,(function(){var o,n;return __generator(this,(function(t){switch(t.label){case 0:return"function"==typeof e.text?[2,e.text()]:"function"!=typeof e.arrayBuffer?[3,2]:(n=(o=r).decodeBinaryBody,[4,e.arrayBuffer()]);case 1:return[2,n.apply(o,[t.sent()])];case 2:return[2,new Promise((function(r,o){var n=new FileReader;n.onload=function(){return r(n.result)},n.onerror=function(){var r;return o(null!==(r=n.error)&&void 0!==r?r:new Error("Failed to read blob response body"))},n.readAsText(e)}))]}}))}))},r.decodeBinaryBody=function(r){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var e=new Uint8Array(r),o="",n=0;n<e.length;n++)o+=String.fromCharCode(e[n]);return o},r}();exports.HandleAxiosErrorHelper=HandleAxiosErrorHelper;
@@ -85,6 +85,7 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
85
85
  * @returns the requests response-data
86
86
  */
87
87
  private processResponse;
88
+ private processBlobResponse;
88
89
  /**
89
90
  * Check if there is internet connection and throw a NO_INTERNET, if so.
90
91
  * Rethrow the original error otherwise.
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxiosHttpsClientService=void 0;var rxjs_1=require("rxjs"),axios_observable_1=require("axios-observable"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),handle_axios_error_helper_1=require("../handle-axios-error-helper"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),AxiosHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,s){var i;return this.requestAsObservable({method:"GET",url:this.addUrlParameters(e,t),headers:r,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i})},t.prototype.post=function(e,t,r,s,i){var o;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"POST",url:this.addUrlParameters(e,r),data:t,headers:s,withCredentials:null!==(o=null==i?void 0:i.withCredentials)&&void 0!==o&&o}))},t.prototype.patch=function(e,t,r,s,i){var o;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"PATCH",url:this.addUrlParameters(e,r),data:t,headers:s,withCredentials:null!==(o=null==i?void 0:i.withCredentials)&&void 0!==o&&o}))},t.prototype.delete=function(e,t,r,s,i){var o;return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,r),data:t,headers:s,withCredentials:null!==(o=null==i?void 0:i.withCredentials)&&void 0!==o&&o})},t.prototype.put=function(e,t,r,s,i){var o;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"PUT",url:this.addUrlParameters(e,r),data:t,headers:s,withCredentials:null!==(o=null==i?void 0:i.withCredentials)&&void 0!==o&&o}))},t.prototype.applyFormDataRequestOptions=function(e){if(!(e.data instanceof FormData))return e;var t=__assign({},e.headers);return delete t["Content-Type"],delete t["content-type"],__assign(__assign({},e),{headers:t,transformRequest:[function(e){return e}]})},t.prototype.requestAsObservable=function(e){var t=this;return(0,rxjs_1.defer)((function(){return t.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return t.processResponse(e)})),(0,operators_1.catchError)((function(e){return t.checkInternetConnectivity(e)})),(0,operators_1.catchError)(handle_axios_error_helper_1.HandleAxiosErrorHelper.processError))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return e.data}throw e},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxiosHttpsClientService=void 0;var rxjs_1=require("rxjs"),axios_observable_1=require("axios-observable"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),handle_axios_error_helper_1=require("../handle-axios-error-helper"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),parse_content_disposition_filename_1=require("../../../utils/parse-content-disposition-filename"),AxiosHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,o){var s,i,n=null!==(s=null==o?void 0:o.responseType)&&void 0!==s?s:"json";return this.requestAsObservable(__assign({method:"GET",url:this.addUrlParameters(e,t),headers:r,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i},"blob"===n?{responseType:"arraybuffer"}:{}),n)},t.prototype.post=function(e,t,r,o,s){var i;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"POST",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i}))},t.prototype.patch=function(e,t,r,o,s){var i;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"PATCH",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i}))},t.prototype.delete=function(e,t,r,o,s){var i;return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i})},t.prototype.put=function(e,t,r,o,s){var i;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"PUT",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i}))},t.prototype.applyFormDataRequestOptions=function(e){if(!(e.data instanceof FormData))return e;var t=__assign({},e.headers);return delete t["Content-Type"],delete t["content-type"],__assign(__assign({},e),{headers:t,transformRequest:[function(e){return e}]})},t.prototype.requestAsObservable=function(e,t){var r=this;return void 0===t&&(t="json"),(0,rxjs_1.defer)((function(){return r.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return"blob"===t?r.processBlobResponse(e):r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)((function(e){return"blob"===t?handle_axios_error_helper_1.HandleAxiosErrorHelper.processBlobError(e):handle_axios_error_helper_1.HandleAxiosErrorHelper.processResponseError(e)})))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return e.data}throw e},t.prototype.processBlobResponse=function(e){var t,r,o,s,i,n;if(!e.status)throw e;if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;if(204===e.status)return{blob:new Blob,fileName:void 0};var a=null!==(r=null===(t=e.headers)||void 0===t?void 0:t["content-disposition"])&&void 0!==r?r:null===(o=e.headers)||void 0===o?void 0:o["Content-Disposition"],l=null!==(i=null===(s=e.headers)||void 0===s?void 0:s["content-type"])&&void 0!==i?i:null===(n=e.headers)||void 0===n?void 0:n["Content-Type"];return{blob:new Blob([e.data],{type:"string"==typeof l?l:void 0}),fileName:(0,parse_content_disposition_filename_1.parseContentDispositionFileName)("string"==typeof a?a:void 0)}},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
@@ -81,6 +81,7 @@ export declare class FetchAPIHttpsClientService extends HttpsClientService {
81
81
  * @returns the requests response-data
82
82
  */
83
83
  private processResponse;
84
+ private processBlobResponse;
84
85
  /**
85
86
  * Check if there is internet connection and throw a NO_INTERNET, if so.
86
87
  * Rethrow the original error otherwise.
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FetchAPIHttpsClientService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),fetch_api_http_error_helper_1=require("../fetch-api-http-error-helper"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),FetchAPIHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,t),__assign({method:"GET",credentials:(null==s?void 0:s.withCredentials)?"include":"same-origin"},r&&{headers:Object.entries(r)}))},t.prototype.post=function(e,t,r,s,i){return t instanceof FormData&&s&&delete s["Content-Type"],this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"POST",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.patch=function(e,t,r,s,i){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PATCH",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.delete=function(e,t,r,s,i){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"DELETE",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.put=function(e,t,r,s,i){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PUT",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.requestAsObservable=function(e,t){var r=this;return new rxjs_1.Observable((function(s){r.validateIsKnownUrlOrCry(e),fetch(e,t).then((function(e){s.next(e),s.complete()})).catch((function(e){s.error(e)}))})).pipe((0,operators_1.mergeMap)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(fetch_api_http_error_helper_1.FetchAPIHttpErrorHelper.processError))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({}):(0,rxjs_1.from)(e.clone().json())}throw e},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t.prototype.createBody=function(e){return"string"==typeof e||e instanceof FormData?e:JSON.stringify(e)},t}(https_client_service_interface_1.HttpsClientService);exports.FetchAPIHttpsClientService=FetchAPIHttpsClientService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FetchAPIHttpsClientService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),fetch_api_http_error_helper_1=require("../fetch-api-http-error-helper"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),parse_content_disposition_filename_1=require("../../../utils/parse-content-disposition-filename"),FetchAPIHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,s){var o,i=null!==(o=null==s?void 0:s.responseType)&&void 0!==o?o:"json";return this.requestAsObservable(this.addUrlParameters(e,t),__assign({method:"GET",credentials:(null==s?void 0:s.withCredentials)?"include":"same-origin"},r&&{headers:Object.entries(r)}),i)},t.prototype.post=function(e,t,r,s,o){return t instanceof FormData&&s&&delete s["Content-Type"],this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"POST",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.patch=function(e,t,r,s,o){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PATCH",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.delete=function(e,t,r,s,o){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"DELETE",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.put=function(e,t,r,s,o){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PUT",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.requestAsObservable=function(e,t,r){var s=this;return void 0===r&&(r="json"),new rxjs_1.Observable((function(r){s.validateIsKnownUrlOrCry(e),fetch(e,t).then((function(e){r.next(e),r.complete()})).catch((function(e){r.error(e)}))})).pipe((0,operators_1.mergeMap)((function(e){return"blob"===r?s.processBlobResponse(e):s.processResponse(e)})),(0,operators_1.catchError)((function(e){return s.checkInternetConnectivity(e)})),(0,operators_1.catchError)(fetch_api_http_error_helper_1.FetchAPIHttpErrorHelper.processError))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({}):(0,rxjs_1.from)(e.clone().json())}throw e},t.prototype.processBlobResponse=function(e){if(!e.status)throw e;if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({blob:new Blob,fileName:void 0}):(0,rxjs_1.from)(e.clone().blob()).pipe((0,operators_1.map)((function(t){return{blob:t,fileName:(0,parse_content_disposition_filename_1.parseContentDispositionFileName)(e.headers.get("content-disposition"))}})))},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t.prototype.createBody=function(e){return"string"==typeof e||e instanceof FormData?e:JSON.stringify(e)},t}(https_client_service_interface_1.HttpsClientService);exports.FetchAPIHttpsClientService=FetchAPIHttpsClientService;
@@ -0,0 +1,5 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ export interface BlobDownloadResponse {
3
+ blob: Blob;
4
+ fileName: string | undefined;
5
+ }
@@ -70,7 +70,7 @@ export declare enum INTERFACE {
70
70
  ANALYTICS_APP = "analytics_app",
71
71
  DATA_CLEANSING_APP = "data_cleansing_app",
72
72
  DATA_ENRICHMENT_APP = "data_enrichment_app",
73
- AGENT_APP = "agent_app",
73
+ PARTIUM_AGENT_APP = "partium_agent_app",
74
74
  GLOBAL_APP = "global_app"
75
75
  }
76
76
  export declare enum PARTIUM_CONTEXT {
@@ -83,7 +83,7 @@ export declare enum PARTIUM_CONTEXT {
83
83
  ANALYTICS = "analytics",
84
84
  DATA_INSIGHTS = "data_insights",
85
85
  DATA_ENRICHMENT = "data_enrichment",
86
- AGENT = "agent"
86
+ PARTIUM_AGENT = "partium_agent"
87
87
  }
88
88
  export declare enum OCR_CONTEXT {
89
89
  TEXT_SEARCH = "text_search",
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var EVENT,INTERFACE,PARTIUM_CONTEXT,OCR_CONTEXT,ECR_TYPE,EVENTLOG_VERSIONS,PART_RELEVANCY_LOG_TYPES,__assign=this&&this.__assign||function(){return __assign=Object.assign||function(_){for(var e,E=1,t=arguments.length;E<t;E++)for(var T in e=arguments[E])Object.prototype.hasOwnProperty.call(e,T)&&(_[T]=e[T]);return _},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.eventLogRequestResponseAdapter=exports.EventLog=exports.PART_RELEVANCY_LOG_TYPES=exports.EVENTLOG_VERSIONS=exports.ECR_TYPE=exports.OCR_CONTEXT=exports.PARTIUM_CONTEXT=exports.INTERFACE=exports.EVENT=void 0,function(_){_.PART_COPY_ID="part_copy_id",_.PART_CONFIRMED_SEARCH="part_confirmed_search",_.PART_RELEVANCY_TO_SEARCH="part_relevancy_to_search",_.DEVICE_INFO="device_info",_.PART_DETAIL_ENTER="part_detail_enter",_.PART_DETAIL_LEAVE="part_detail_leave",_.PART_DETAIL_SET_RELATION="parts_detail_set_relation",_.PART_THUMBSUP="part_thumbsup",_.PART_THUMBSDOWN="part_thumbsdown",_.REQUEST_LIST_ADD_PART="request_list_add_part",_.REQUEST_LIST_DEL_PART="request_list_del_part",_.REQUEST_LIST_RESET_PARTS="request_list_reset_parts",_.REQUEST_LIST_SEND="request_list_send",_.REQUEST_LIST_UPDATE="request_list_update",_.REQUEST_LIST_ADD_PART_EXISTING="request_list_add_part_existing",_.ATTEMPT_UPLOAD_IMAGE_DIMENSIONS="attempt_upload_image_dimensions",_.CSA_FORM_ENTER_FROM_RESULTS="csa_form_enter_from_results",_.CSA_FORM_ENTER_FROM_PART_DETAILS="csa_form_enter_from_part_details",_.CSA_REQUEST_SEND="csa_request_send",_.CSA_CALL_EXPERT="csa_call_expert",_.CSA_EXPERT_CONFIRMS_PART="csa_expert_confirms_part",_.CSA_EXPERT_MARK_NOT_RESOLVED="csa_expert_marks_not_resolved",_.RECENT_SEARCH_QUERY_CLICKED="recent_search_query_clicked",_.SEARCH_TAG_USED="search_tag_used",_.REQUEST_LIST_EXPORTED="request_list_exported",_.CSA_EXPERT_OPENS_REQUEST="csa_expert_opens_request",_.LANGUAGE_CHANGE="language_change",_.USER_SESSION_INFO="user_session_info",_.CONFIRMED_ID_MATCHES_PART_TO_CONFIRM="confirmed_id_matches_part_to_confirm",_.SHOPPING_CART_EXPORTED="shopping_cart_exported",_.SHOPPING_CART_UPDATE="shopping_cart_update",_.SHOPPING_CART_REMOVE_ALL_PARTS="shopping_cart_remove_all_parts",_.SHOPPING_CART_REMOVE_PART="shopping_cart_remove_part",_.SHOPPING_CART_ADD_PART="shopping_cart_add_part",_.SHOPPING_CART_REQUEST_OFFER="shopping_cart_request_offer",_.FAVORITES_REMOVE="favorites_remove_part",_.FAVORITES_ADD="favorites_add_part",_.ECR_DETAILS_ENTER="ecr_details_enter",_.ECR_LIST="ecr_list",_.ECR_CALL="ecr_call",_.ECR_FORM_SUBMIT="ecr_form_submit",_.ECR_FORM_ENTER="ecr_form_enter",_.SEARCH_INPUT_CODE_SCANNING="search_input_code_scanning",_.SEARCH_INPUT_BOM_FILTER="search_input_bom_filter",_.SEARCH_INPUT_ATTRIBUTE_FILTERS="search_input_attribute_filters",_.SEARCH_INPUT_SEMANTIC_TAGS="search_input_semantic_tags",_.SEARCH_INPUT_SMART_FILTER_APPLIED="search_input_smart_filter_applied",_.SEARCH_RESULTS_STS="search_results_sts",_.SEARCH_RESULTS_VM="search_results_vm",_.SEARCH_RESULTS_HVT="search_results_hvt",_.SEARCH_RESULTS_SMMS_FLOW="search_results_smms_flow",_.SEARCH_RESULTS_FUSION="search_results_fusion",_.SEARCH_SESSION_CREATE="search_session_create",_.SEARCH_ASSISTANCE_OCR="search_assistance_ocr",_.INQUIRY_EXPORTED="inquiry_exported",_.EXPERT_OPENS_INQUIRY="expert_opens_inquiry",_.CSA_EXPERT_STARTS_EXPERT_SEARCH="csa_expert_starts_expert_search",_.CSA_INVITES_EXPERT="csa_invites_expert"}(EVENT||(exports.EVENT=EVENT={})),function(_){_.FIND_APP="find_app",_.API_ACCESS="api_access",_.AGENT_PORTAL_APP="agent_portal_app",_.ANALYTICS_APP="analytics_app",_.DATA_CLEANSING_APP="data_cleansing_app",_.DATA_ENRICHMENT_APP="data_enrichment_app",_.AGENT_APP="agent_app",_.GLOBAL_APP="global_app"}(INTERFACE||(exports.INTERFACE=INTERFACE={})),function(_){_.SEARCH="search",_.RECENTLY_VIEWED_PARTS="recently_viewed_parts",_.FAVORITES="favorites",_.ECR="ecr",_.SHOPPING_CART="shopping_cart",_.DATA_CLEANSING="data_cleansing",_.ANALYTICS="analytics",_.DATA_INSIGHTS="data_insights",_.DATA_ENRICHMENT="data_enrichment",_.AGENT="agent"}(PARTIUM_CONTEXT||(exports.PARTIUM_CONTEXT=PARTIUM_CONTEXT={})),function(_){_.TEXT_SEARCH="text_search",_.BOM_FILTER="bom_filter"}(OCR_CONTEXT||(exports.OCR_CONTEXT=OCR_CONTEXT={})),function(_){_.ASK_FOR_HELP="ask_for_help",_.ASK_FOR_CONFIRMATION="ask_for_confirmation"}(ECR_TYPE||(exports.ECR_TYPE=ECR_TYPE={})),function(_){_.V_1_0_0="1.0.0",_.V_2_0_0="2.0.0"}(EVENTLOG_VERSIONS||(exports.EVENTLOG_VERSIONS=EVENTLOG_VERSIONS={})),function(_){_.MATCHES_SEARCH_EXACTLY="matches_search_exactly",_.BEST_MATCH="best_match",_.NOT_MATCH_BUT_RELATED="not_match_but_related",_.NEEDS_CHECK_ELSEWHERE="needs_check_elsewhere",_.NOT_RELEVANT="not_relevant",_.OTHER="other"}(PART_RELEVANCY_LOG_TYPES||(exports.PART_RELEVANCY_LOG_TYPES=PART_RELEVANCY_LOG_TYPES={}));var EventLog=function(_){Object.assign(this,_)};exports.EventLog=EventLog;var eventLogRequestResponseAdapter=function(_){return function(e){return new EventLog(__assign(__assign({},_),{id:e.event_id,timestamp:new Date(e.timestamp)}))}};exports.eventLogRequestResponseAdapter=eventLogRequestResponseAdapter;
2
+ "use strict";var EVENT,INTERFACE,PARTIUM_CONTEXT,OCR_CONTEXT,ECR_TYPE,EVENTLOG_VERSIONS,PART_RELEVANCY_LOG_TYPES,__assign=this&&this.__assign||function(){return __assign=Object.assign||function(_){for(var e,E=1,t=arguments.length;E<t;E++)for(var T in e=arguments[E])Object.prototype.hasOwnProperty.call(e,T)&&(_[T]=e[T]);return _},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.eventLogRequestResponseAdapter=exports.EventLog=exports.PART_RELEVANCY_LOG_TYPES=exports.EVENTLOG_VERSIONS=exports.ECR_TYPE=exports.OCR_CONTEXT=exports.PARTIUM_CONTEXT=exports.INTERFACE=exports.EVENT=void 0,function(_){_.PART_COPY_ID="part_copy_id",_.PART_CONFIRMED_SEARCH="part_confirmed_search",_.PART_RELEVANCY_TO_SEARCH="part_relevancy_to_search",_.DEVICE_INFO="device_info",_.PART_DETAIL_ENTER="part_detail_enter",_.PART_DETAIL_LEAVE="part_detail_leave",_.PART_DETAIL_SET_RELATION="parts_detail_set_relation",_.PART_THUMBSUP="part_thumbsup",_.PART_THUMBSDOWN="part_thumbsdown",_.REQUEST_LIST_ADD_PART="request_list_add_part",_.REQUEST_LIST_DEL_PART="request_list_del_part",_.REQUEST_LIST_RESET_PARTS="request_list_reset_parts",_.REQUEST_LIST_SEND="request_list_send",_.REQUEST_LIST_UPDATE="request_list_update",_.REQUEST_LIST_ADD_PART_EXISTING="request_list_add_part_existing",_.ATTEMPT_UPLOAD_IMAGE_DIMENSIONS="attempt_upload_image_dimensions",_.CSA_FORM_ENTER_FROM_RESULTS="csa_form_enter_from_results",_.CSA_FORM_ENTER_FROM_PART_DETAILS="csa_form_enter_from_part_details",_.CSA_REQUEST_SEND="csa_request_send",_.CSA_CALL_EXPERT="csa_call_expert",_.CSA_EXPERT_CONFIRMS_PART="csa_expert_confirms_part",_.CSA_EXPERT_MARK_NOT_RESOLVED="csa_expert_marks_not_resolved",_.RECENT_SEARCH_QUERY_CLICKED="recent_search_query_clicked",_.SEARCH_TAG_USED="search_tag_used",_.REQUEST_LIST_EXPORTED="request_list_exported",_.CSA_EXPERT_OPENS_REQUEST="csa_expert_opens_request",_.LANGUAGE_CHANGE="language_change",_.USER_SESSION_INFO="user_session_info",_.CONFIRMED_ID_MATCHES_PART_TO_CONFIRM="confirmed_id_matches_part_to_confirm",_.SHOPPING_CART_EXPORTED="shopping_cart_exported",_.SHOPPING_CART_UPDATE="shopping_cart_update",_.SHOPPING_CART_REMOVE_ALL_PARTS="shopping_cart_remove_all_parts",_.SHOPPING_CART_REMOVE_PART="shopping_cart_remove_part",_.SHOPPING_CART_ADD_PART="shopping_cart_add_part",_.SHOPPING_CART_REQUEST_OFFER="shopping_cart_request_offer",_.FAVORITES_REMOVE="favorites_remove_part",_.FAVORITES_ADD="favorites_add_part",_.ECR_DETAILS_ENTER="ecr_details_enter",_.ECR_LIST="ecr_list",_.ECR_CALL="ecr_call",_.ECR_FORM_SUBMIT="ecr_form_submit",_.ECR_FORM_ENTER="ecr_form_enter",_.SEARCH_INPUT_CODE_SCANNING="search_input_code_scanning",_.SEARCH_INPUT_BOM_FILTER="search_input_bom_filter",_.SEARCH_INPUT_ATTRIBUTE_FILTERS="search_input_attribute_filters",_.SEARCH_INPUT_SEMANTIC_TAGS="search_input_semantic_tags",_.SEARCH_INPUT_SMART_FILTER_APPLIED="search_input_smart_filter_applied",_.SEARCH_RESULTS_STS="search_results_sts",_.SEARCH_RESULTS_VM="search_results_vm",_.SEARCH_RESULTS_HVT="search_results_hvt",_.SEARCH_RESULTS_SMMS_FLOW="search_results_smms_flow",_.SEARCH_RESULTS_FUSION="search_results_fusion",_.SEARCH_SESSION_CREATE="search_session_create",_.SEARCH_ASSISTANCE_OCR="search_assistance_ocr",_.INQUIRY_EXPORTED="inquiry_exported",_.EXPERT_OPENS_INQUIRY="expert_opens_inquiry",_.CSA_EXPERT_STARTS_EXPERT_SEARCH="csa_expert_starts_expert_search",_.CSA_INVITES_EXPERT="csa_invites_expert"}(EVENT||(exports.EVENT=EVENT={})),function(_){_.FIND_APP="find_app",_.API_ACCESS="api_access",_.AGENT_PORTAL_APP="agent_portal_app",_.ANALYTICS_APP="analytics_app",_.DATA_CLEANSING_APP="data_cleansing_app",_.DATA_ENRICHMENT_APP="data_enrichment_app",_.PARTIUM_AGENT_APP="partium_agent_app",_.GLOBAL_APP="global_app"}(INTERFACE||(exports.INTERFACE=INTERFACE={})),function(_){_.SEARCH="search",_.RECENTLY_VIEWED_PARTS="recently_viewed_parts",_.FAVORITES="favorites",_.ECR="ecr",_.SHOPPING_CART="shopping_cart",_.DATA_CLEANSING="data_cleansing",_.ANALYTICS="analytics",_.DATA_INSIGHTS="data_insights",_.DATA_ENRICHMENT="data_enrichment",_.PARTIUM_AGENT="partium_agent"}(PARTIUM_CONTEXT||(exports.PARTIUM_CONTEXT=PARTIUM_CONTEXT={})),function(_){_.TEXT_SEARCH="text_search",_.BOM_FILTER="bom_filter"}(OCR_CONTEXT||(exports.OCR_CONTEXT=OCR_CONTEXT={})),function(_){_.ASK_FOR_HELP="ask_for_help",_.ASK_FOR_CONFIRMATION="ask_for_confirmation"}(ECR_TYPE||(exports.ECR_TYPE=ECR_TYPE={})),function(_){_.V_1_0_0="1.0.0",_.V_2_0_0="2.0.0"}(EVENTLOG_VERSIONS||(exports.EVENTLOG_VERSIONS=EVENTLOG_VERSIONS={})),function(_){_.MATCHES_SEARCH_EXACTLY="matches_search_exactly",_.BEST_MATCH="best_match",_.NOT_MATCH_BUT_RELATED="not_match_but_related",_.NEEDS_CHECK_ELSEWHERE="needs_check_elsewhere",_.NOT_RELEVANT="not_relevant",_.OTHER="other"}(PART_RELEVANCY_LOG_TYPES||(exports.PART_RELEVANCY_LOG_TYPES=PART_RELEVANCY_LOG_TYPES={}));var EventLog=function(_){Object.assign(this,_)};exports.EventLog=EventLog;var eventLogRequestResponseAdapter=function(_){return function(e){return new EventLog(__assign(__assign({},_),{id:e.event_id,timestamp:new Date(e.timestamp)}))}};exports.eventLogRequestResponseAdapter=eventLogRequestResponseAdapter;
@@ -6,7 +6,8 @@ import { ServiceProvider } from '../../service-provider';
6
6
  * Options for the request.
7
7
  */
8
8
  export interface RequestOptions {
9
- withCredentials: boolean;
9
+ withCredentials?: boolean;
10
+ responseType?: 'json' | 'blob';
10
11
  }
11
12
  /**
12
13
  * Https-Client-Service is an interface that should be implemented by the platform/framework
@@ -2,6 +2,7 @@
2
2
  import { BaseService } from '../base.service';
3
3
  import { Observable } from 'rxjs';
4
4
  import { AuthenticationConfig } from '../../models/auth-config';
5
+ import { RequestOptions } from './https-client/https-client.service.interface';
5
6
  import { ServiceProvider } from '../service-provider';
6
7
  import { Organization } from '../organization/models/organization';
7
8
  export declare enum BACKEND_SERVICE {
@@ -16,7 +17,7 @@ export declare enum BACKEND_SERVICE {
16
17
  DATA_V2 = 8,
17
18
  DATA_ENRICHMENT = 9,
18
19
  BACKOFFICE = 10,
19
- SELECTION = 11
20
+ PART_LIST = 11
20
21
  }
21
22
  export interface BaseUrls {
22
23
  partiumApiBaseUrl: string;
@@ -30,7 +31,7 @@ export interface BaseUrls {
30
31
  dataV2BeBaseUrl: string;
31
32
  dataEnrichmentBeBaseUrl: string;
32
33
  backofficeBeBaseUrl: string;
33
- selectionBeBaseUrl: string;
34
+ partListBeBaseUrl: string;
34
35
  }
35
36
  /**
36
37
  * Defines the structure of a https-service implementation, which
@@ -69,7 +70,7 @@ export declare class HttpsService extends BaseService {
69
70
  * @param beService to which backend-service should the request be sent (default PARTIUM)
70
71
  * @returns Observable that resolves with the request result
71
72
  */
72
- get(url: string, urlParams?: Array<Object>, beService?: BACKEND_SERVICE): Observable<any>;
73
+ get(url: string, urlParams?: Array<Object>, beService?: BACKEND_SERVICE, requestOptions?: RequestOptions): Observable<any>;
73
74
  /**
74
75
  * Send POST request to the Partium-backend with the given relative url and content.
75
76
  *
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,s=arguments.length,i=s<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(r,t,i):o(r,t))||i);return s>3&&i&&Object.defineProperty(r,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsService=exports.BACKEND_SERVICE=void 0;var BACKEND_SERVICE,base_service_1=require("../base.service"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./https-client/https-client.service.interface"),injection_identifier_1=require("../../decorators/injection-identifier");!function(e){e[e.PARTIUM=0]="PARTIUM",e[e.DATA=1]="DATA",e[e.CSA=2]="CSA",e[e.LOG=3]="LOG",e[e.USER_DATA=4]="USER_DATA",e[e.MANAGEMENT=5]="MANAGEMENT",e[e.CATALOG=6]="CATALOG",e[e.DATACURATION=7]="DATACURATION",e[e.DATA_V2=8]="DATA_V2",e[e.DATA_ENRICHMENT=9]="DATA_ENRICHMENT",e[e.BACKOFFICE=10]="BACKOFFICE",e[e.SELECTION=11]="SELECTION"}(BACKEND_SERVICE||(exports.BACKEND_SERVICE=BACKEND_SERVICE={}));var HttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService)},r.prototype.init=function(e,r){return this.baseUrls=e,this.config=r,(0,rxjs_1.of)(void 0)},r.prototype.get=function(e,r,t){var n=this;return(0,rxjs_1.defer)((function(){return n.configureHeaders({},t)})).pipe((0,operators_1.mergeMap)((function(o){return n.httpsClientService.get(n.createUrl(e,t),r,o)})),(0,operators_1.retryWhen)((function(e){return n.retryWhen(e)})),(0,operators_1.catchError)((function(e){return n.processError(e)})))},r.prototype.post=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.post(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.put=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.put(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.patch=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.patch(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.delete=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},n)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.delete(o.createUrl(e,n),r,t,s)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.setCurrentOrganization=function(e){this.currentOrganization$=e},r.prototype.retryWhen=function(e){return e.pipe((0,operators_1.mergeMap)((function(e){return(0,rxjs_1.throwError)(e)})))},r.prototype.processError=function(e){return(0,rxjs_1.throwError)(e)},r.prototype.createHeaders=function(e){throw new Error("In order to use the HttpsService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.createUrl=function(e,r){for(void 0===r&&(r=BACKEND_SERVICE.PARTIUM);e.startsWith("/");)e=e.substring(1);var t;switch(r){case BACKEND_SERVICE.DATA:t=this.baseUrls.dataBeBaseUrl;break;case BACKEND_SERVICE.CSA:t=this.baseUrls.csaBeBaseUrl;break;case BACKEND_SERVICE.LOG:t=this.baseUrls.logBeBaseUrl;break;case BACKEND_SERVICE.USER_DATA:t=this.baseUrls.userDataBeBaseUrl;break;case BACKEND_SERVICE.MANAGEMENT:t=this.baseUrls.managementBeBaseUrl;break;case BACKEND_SERVICE.CATALOG:t=this.baseUrls.catalogBeBaseUrl;break;case BACKEND_SERVICE.DATACURATION:t=this.baseUrls.datacurationBeBaseUrl;break;case BACKEND_SERVICE.DATA_V2:t=this.baseUrls.dataV2BeBaseUrl;break;case BACKEND_SERVICE.DATA_ENRICHMENT:t=this.baseUrls.dataEnrichmentBeBaseUrl;break;case BACKEND_SERVICE.BACKOFFICE:t=this.baseUrls.backofficeBeBaseUrl;break;case BACKEND_SERVICE.SELECTION:t=this.baseUrls.selectionBeBaseUrl;break;case BACKEND_SERVICE.PARTIUM:default:t=this.baseUrls.partiumApiBaseUrl}return[t,e].join("/")},r.prototype.configureHeaders=function(e,r){var t=this.createHeaders(e);return this.config.externalUserId&&r!==BACKEND_SERVICE.LOG&&(t["X-Partium-ExternalUserId"]=this.config.externalUserId),this.currentOrganization$?this.currentOrganization$.pipe((0,operators_1.first)(),(0,operators_1.map)((function(e){return(null==e?void 0:e.name)&&(t["X-Partium-Data-Organization"]=e.name),t}))):(0,rxjs_1.of)(t)},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsService")],r)}(base_service_1.BaseService);exports.HttpsService=HttpsService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,s=arguments.length,i=s<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(r,t,i):o(r,t))||i);return s>3&&i&&Object.defineProperty(r,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsService=exports.BACKEND_SERVICE=void 0;var BACKEND_SERVICE,base_service_1=require("../base.service"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./https-client/https-client.service.interface"),injection_identifier_1=require("../../decorators/injection-identifier");!function(e){e[e.PARTIUM=0]="PARTIUM",e[e.DATA=1]="DATA",e[e.CSA=2]="CSA",e[e.LOG=3]="LOG",e[e.USER_DATA=4]="USER_DATA",e[e.MANAGEMENT=5]="MANAGEMENT",e[e.CATALOG=6]="CATALOG",e[e.DATACURATION=7]="DATACURATION",e[e.DATA_V2=8]="DATA_V2",e[e.DATA_ENRICHMENT=9]="DATA_ENRICHMENT",e[e.BACKOFFICE=10]="BACKOFFICE",e[e.PART_LIST=11]="PART_LIST"}(BACKEND_SERVICE||(exports.BACKEND_SERVICE=BACKEND_SERVICE={}));var HttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService)},r.prototype.init=function(e,r){return this.baseUrls=e,this.config=r,(0,rxjs_1.of)(void 0)},r.prototype.get=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},t)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.get(o.createUrl(e,t),r,s,n)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.post=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.post(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.put=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.put(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.patch=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.patch(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.delete=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},n)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.delete(o.createUrl(e,n),r,t,s)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.setCurrentOrganization=function(e){this.currentOrganization$=e},r.prototype.retryWhen=function(e){return e.pipe((0,operators_1.mergeMap)((function(e){return(0,rxjs_1.throwError)(e)})))},r.prototype.processError=function(e){return(0,rxjs_1.throwError)(e)},r.prototype.createHeaders=function(e){throw new Error("In order to use the HttpsService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.createUrl=function(e,r){for(void 0===r&&(r=BACKEND_SERVICE.PARTIUM);e.startsWith("/");)e=e.substring(1);var t;switch(r){case BACKEND_SERVICE.DATA:t=this.baseUrls.dataBeBaseUrl;break;case BACKEND_SERVICE.CSA:t=this.baseUrls.csaBeBaseUrl;break;case BACKEND_SERVICE.LOG:t=this.baseUrls.logBeBaseUrl;break;case BACKEND_SERVICE.USER_DATA:t=this.baseUrls.userDataBeBaseUrl;break;case BACKEND_SERVICE.MANAGEMENT:t=this.baseUrls.managementBeBaseUrl;break;case BACKEND_SERVICE.CATALOG:t=this.baseUrls.catalogBeBaseUrl;break;case BACKEND_SERVICE.DATACURATION:t=this.baseUrls.datacurationBeBaseUrl;break;case BACKEND_SERVICE.DATA_V2:t=this.baseUrls.dataV2BeBaseUrl;break;case BACKEND_SERVICE.DATA_ENRICHMENT:t=this.baseUrls.dataEnrichmentBeBaseUrl;break;case BACKEND_SERVICE.BACKOFFICE:t=this.baseUrls.backofficeBeBaseUrl;break;case BACKEND_SERVICE.PART_LIST:t=this.baseUrls.partListBeBaseUrl;break;case BACKEND_SERVICE.PARTIUM:default:t=this.baseUrls.partiumApiBaseUrl}return[t,e].join("/")},r.prototype.configureHeaders=function(e,r){var t=this.createHeaders(e);return this.config.externalUserId&&r!==BACKEND_SERVICE.LOG&&(t["X-Partium-ExternalUserId"]=this.config.externalUserId),this.currentOrganization$?this.currentOrganization$.pipe((0,operators_1.first)(),(0,operators_1.map)((function(e){return(null==e?void 0:e.name)&&(t["X-Partium-Data-Organization"]=e.name),t}))):(0,rxjs_1.of)(t)},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsService")],r)}(base_service_1.BaseService);exports.HttpsService=HttpsService;
@@ -2,6 +2,7 @@
2
2
  import { Observable } from 'rxjs';
3
3
  import { OauthAuthenticationConfig } from '../../models/auth-config';
4
4
  import { BACKEND_SERVICE, BaseUrls, HttpsService } from './https.service.interface';
5
+ import { RequestOptions } from './https-client/https-client.service.interface';
5
6
  import { ServiceProvider } from '../service-provider';
6
7
  /**
7
8
  * Implementation of https service that provides authorization with oauth.
@@ -43,7 +44,7 @@ export declare class OauthHttpsService extends HttpsService {
43
44
  * @param beService to which backend-service should the request be sent (default PARTIUM)
44
45
  * @returns Observable that resolves with the request result
45
46
  */
46
- get(url: string, urlParams?: Array<Object>, beService?: BACKEND_SERVICE): Observable<any>;
47
+ get(url: string, urlParams?: Array<Object>, beService?: BACKEND_SERVICE, requestOptions?: RequestOptions): Observable<any>;
47
48
  /**
48
49
  *
49
50
  * Send POST request to the server with the given url and content.
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.OauthHttpsService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_service_interface_1=require("./https.service.interface"),error_1=require("../../models/error"),oauth_session_service_1=require("../session/oauth-session.service"),session_service_interface_1=require("../session/session.service.interface"),OauthHttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.oauthSessionService=this.serviceProvider.getService(session_service_interface_1.SessionService)},r.prototype.init=function(r,t){return e.prototype.init.call(this,r,t),t.apiKey?this.callOauthLogin():(0,rxjs_1.of)(void 0)},r.prototype.setToken=function(e,r){this.authToken=e,this.authTokenExpiresAt=r},r.prototype.get=function(r,t,o){var i=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.get.call(i,r,t,o)})))},r.prototype.post=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.post.call(s,r,t,o,i,n)})))},r.prototype.patch=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.patch.call(s,r,t,o,i,n)})))},r.prototype.retryWhen=function(e){var r=this;return e.pipe((0,operators_1.mergeMap)((function(e){return e.code===error_1.SDK_ERROR_CODES.TOKEN_EXPIRED?(console.log("HttpsService - Token expired, attempting refresh"),r.refreshOrLogin()):(0,rxjs_1.throwError)(e)})))},r.prototype.createHeaders=function(e){var r={"Content-Type":"application/json"};return this.authToken&&(r.Authorization="Bearer ".concat(this.authToken)),Object.assign(r,e)},r.prototype.callOauthLogin=function(){var e=this.config;return this.oauthSessionService.login(new oauth_session_service_1.OauthLoginConfig({apiKey:e.apiKey}))},r.prototype.refreshSessionIfNeeded=function(){var e=!1;this.authTokenExpiresAt?e=(Date.now()/1e3|0)>this.authTokenExpiresAt.getTime()/1e3-60:e=!0;return e?this.refreshOrLogin():(0,rxjs_1.of)(void 0)},r.prototype.refreshOrLogin=function(){var e=this;return this.oauthSessionService.refresh().pipe((0,operators_1.catchError)((function(r){return r.code===error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED||r.code===error_1.SDK_ERROR_CODES.INVALID_TOKEN||r.code===error_1.SDK_ERROR_CODES.BAD_REQUEST||r.code===error_1.SDK_ERROR_CODES.OAUTH_ERROR?e.callOauthLogin().pipe((0,operators_1.catchError)((function(e){return e.code===error_1.SDK_ERROR_CODES.INVALID_LOGIN_CONFIG?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED,r)):(0,rxjs_1.throwError)(e)}))):(0,rxjs_1.throwError)(r)})))},r}(https_service_interface_1.HttpsService);exports.OauthHttpsService=OauthHttpsService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.OauthHttpsService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_service_interface_1=require("./https.service.interface"),error_1=require("../../models/error"),oauth_session_service_1=require("../session/oauth-session.service"),session_service_interface_1=require("../session/session.service.interface"),OauthHttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.oauthSessionService=this.serviceProvider.getService(session_service_interface_1.SessionService)},r.prototype.init=function(r,t){return e.prototype.init.call(this,r,t),t.apiKey?this.callOauthLogin():(0,rxjs_1.of)(void 0)},r.prototype.setToken=function(e,r){this.authToken=e,this.authTokenExpiresAt=r},r.prototype.get=function(r,t,o,i){var n=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.get.call(n,r,t,o,i)})))},r.prototype.post=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.post.call(s,r,t,o,i,n)})))},r.prototype.patch=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.patch.call(s,r,t,o,i,n)})))},r.prototype.retryWhen=function(e){var r=this;return e.pipe((0,operators_1.mergeMap)((function(e){return e.code===error_1.SDK_ERROR_CODES.TOKEN_EXPIRED?(console.log("HttpsService - Token expired, attempting refresh"),r.refreshOrLogin()):(0,rxjs_1.throwError)(e)})))},r.prototype.createHeaders=function(e){var r={"Content-Type":"application/json"};return this.authToken&&(r.Authorization="Bearer ".concat(this.authToken)),Object.assign(r,e)},r.prototype.callOauthLogin=function(){var e=this.config;return this.oauthSessionService.login(new oauth_session_service_1.OauthLoginConfig({apiKey:e.apiKey}))},r.prototype.refreshSessionIfNeeded=function(){var e=!1;this.authTokenExpiresAt?e=(Date.now()/1e3|0)>this.authTokenExpiresAt.getTime()/1e3-60:e=!0;return e?this.refreshOrLogin():(0,rxjs_1.of)(void 0)},r.prototype.refreshOrLogin=function(){var e=this;return this.oauthSessionService.refresh().pipe((0,operators_1.catchError)((function(r){return r.code===error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED||r.code===error_1.SDK_ERROR_CODES.INVALID_TOKEN||r.code===error_1.SDK_ERROR_CODES.BAD_REQUEST||r.code===error_1.SDK_ERROR_CODES.OAUTH_ERROR?e.callOauthLogin().pipe((0,operators_1.catchError)((function(e){return e.code===error_1.SDK_ERROR_CODES.INVALID_LOGIN_CONFIG?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED,r)):(0,rxjs_1.throwError)(e)}))):(0,rxjs_1.throwError)(r)})))},r}(https_service_interface_1.HttpsService);exports.OauthHttpsService=OauthHttpsService;
@@ -7,13 +7,15 @@ import { BACKEND_SERVICE, HttpsService } from '../services/http/https.service.in
7
7
  export declare function createMultipartUploadUnsupportedError(): SdkError;
8
8
  export declare function guardMultipartUpload<T>(file: PFile, proceed: () => Observable<T>): Observable<T>;
9
9
  /**
10
- * Builds the standard partium-api multipart body: JSON `input` field + binary `image` from PFile.
10
+ * Builds the standard partium-api multipart body: an optional JSON `input` field + the binary file from
11
+ * PFile, appended under `fieldName` (eg 'image', 'file').
11
12
  */
12
- export declare function createPFileImageMultipartFormData(image: PFile, input?: object): FormData;
13
+ export declare function createPFileMultipartFormData(file: PFile, fieldName: string, input?: object): FormData;
13
14
  export declare function createPartiumInterfaceMultipartHeaders(eventInterface?: INTERFACE): Record<string, string>;
14
- export declare function postPFileImageMultipartRequest<T>(httpsService: HttpsService, options: {
15
+ export declare function postPFileMultipartRequest<T>(httpsService: HttpsService, options: {
15
16
  url: string;
16
- image: PFile;
17
+ file: PFile;
18
+ fieldName: string;
17
19
  input?: object;
18
20
  eventInterface?: INTERFACE;
19
21
  backend?: BACKEND_SERVICE;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createMultipartUploadUnsupportedError=createMultipartUploadUnsupportedError,exports.guardMultipartUpload=guardMultipartUpload,exports.createPFileImageMultipartFormData=createPFileImageMultipartFormData,exports.createPartiumInterfaceMultipartHeaders=createPartiumInterfaceMultipartHeaders,exports.postPFileImageMultipartRequest=postPFileImageMultipartRequest;var rxjs_1=require("rxjs"),error_1=require("../models/error"),log_1=require("../models/log"),https_service_interface_1=require("../services/http/https.service.interface"),MULTIPART_UPLOAD_NOT_SUPPORTED_MESSAGE="Image-upload is only available on platforms that support multipart-upload.";function createMultipartUploadUnsupportedError(){return new error_1.SdkError(error_1.SDK_ERROR_CODES.MULTIPART_UPLOAD_NOT_SUPPORTED,{},MULTIPART_UPLOAD_NOT_SUPPORTED_MESSAGE)}function guardMultipartUpload(r,e){return r.supportsMultipartUpload()?e():(0,rxjs_1.throwError)((function(){return createMultipartUploadUnsupportedError()}))}function createPFileImageMultipartFormData(r,e){var t=new FormData;return void 0!==e&&t.append("input",JSON.stringify(e)),r.appendToFormData("image",t),t}function createPartiumInterfaceMultipartHeaders(r){return void 0===r&&(r=log_1.INTERFACE.API_ACCESS),{"Content-Type":"multipart/form-data","X-Partium-Interface":r}}function postPFileImageMultipartRequest(r,e){var t;return r.post(e.url,createPFileImageMultipartFormData(e.image,e.input),void 0,null!==(t=e.backend)&&void 0!==t?t:https_service_interface_1.BACKEND_SERVICE.PARTIUM,createPartiumInterfaceMultipartHeaders(e.eventInterface))}
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createMultipartUploadUnsupportedError=createMultipartUploadUnsupportedError,exports.guardMultipartUpload=guardMultipartUpload,exports.createPFileMultipartFormData=createPFileMultipartFormData,exports.createPartiumInterfaceMultipartHeaders=createPartiumInterfaceMultipartHeaders,exports.postPFileMultipartRequest=postPFileMultipartRequest;var rxjs_1=require("rxjs"),error_1=require("../models/error"),log_1=require("../models/log"),https_service_interface_1=require("../services/http/https.service.interface"),MULTIPART_UPLOAD_NOT_SUPPORTED_MESSAGE="File-upload is only available on platforms that support multipart-upload.";function createMultipartUploadUnsupportedError(){return new error_1.SdkError(error_1.SDK_ERROR_CODES.MULTIPART_UPLOAD_NOT_SUPPORTED,{},MULTIPART_UPLOAD_NOT_SUPPORTED_MESSAGE)}function guardMultipartUpload(r,t){return r.supportsMultipartUpload()?t():(0,rxjs_1.throwError)((function(){return createMultipartUploadUnsupportedError()}))}function createPFileMultipartFormData(r,t,e){var a=new FormData;return void 0!==e&&a.append("input",JSON.stringify(e)),r.appendToFormData(t,a),a}function createPartiumInterfaceMultipartHeaders(r){return void 0===r&&(r=log_1.INTERFACE.API_ACCESS),{"Content-Type":"multipart/form-data","X-Partium-Interface":r}}function postPFileMultipartRequest(r,t){var e;return r.post(t.url,createPFileMultipartFormData(t.file,t.fieldName,t.input),void 0,null!==(e=t.backend)&&void 0!==e?e:https_service_interface_1.BACKEND_SERVICE.PARTIUM,createPartiumInterfaceMultipartHeaders(t.eventInterface))}
@@ -0,0 +1,5 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ /**
3
+ * Extracts the filename from a Content-Disposition header value when present.
4
+ */
5
+ export declare const parseContentDispositionFileName: (contentDisposition: string | null | undefined) => string | undefined;
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseContentDispositionFileName=void 0;var parseContentDispositionFileName=function(e){var i;if(e){var t=e.match(/filename\*=UTF-8''([^;]+)/i);if(null==t?void 0:t[1])try{return decodeURIComponent(t[1].trim())}catch(e){return t[1].trim()}var n=e.match(/filename="([^"]+)"/i);if(null==n?void 0:n[1])return n[1].trim();var r=e.match(/filename=([^;]+)/i);return null===(i=null==r?void 0:r[1])||void 0===i?void 0:i.trim()}};exports.parseContentDispositionFileName=parseContentDispositionFileName;
@@ -21,3 +21,5 @@ export * from './models/post-remove-all-search-session-parts-from-enrichment-job
21
21
  export * from './models/post-add-all-search-session-parts-to-enrichment-job-request';
22
22
  export * from './models/post-remove-all-search-session-parts-from-enrichment-job-request';
23
23
  export * from './models/get-search-summary-response';
24
+ export * from './models/download-enrichment-job-results-request';
25
+ export * from './models/download-enrichment-job-results-response';
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var s=Object.getOwnPropertyDescriptor(r,t);s&&!("get"in s?!r.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,s)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/enrichment-job"),exports),__exportStar(require("./models/get-enrichment-jobs-request"),exports),__exportStar(require("./models/get-enrichment-job-request"),exports),__exportStar(require("./models/get-enrichment-job-parts-request"),exports),__exportStar(require("./models/enrichment-job-part"),exports),__exportStar(require("./services/data-enrichment.service"),exports),__exportStar(require("./models/create-enrichment-job-request"),exports),__exportStar(require("./models/create-enrichment-job-response"),exports),__exportStar(require("./models/submit-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-response"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-request"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-response"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-request"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-response"),exports),__exportStar(require("./models/post-add-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-request"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-request"),exports),__exportStar(require("./models/get-search-summary-response"),exports);
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var s=Object.getOwnPropertyDescriptor(r,t);s&&!("get"in s?!r.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,s)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/enrichment-job"),exports),__exportStar(require("./models/get-enrichment-jobs-request"),exports),__exportStar(require("./models/get-enrichment-job-request"),exports),__exportStar(require("./models/get-enrichment-job-parts-request"),exports),__exportStar(require("./models/enrichment-job-part"),exports),__exportStar(require("./services/data-enrichment.service"),exports),__exportStar(require("./models/create-enrichment-job-request"),exports),__exportStar(require("./models/create-enrichment-job-response"),exports),__exportStar(require("./models/submit-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-response"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-request"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-response"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-request"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-response"),exports),__exportStar(require("./models/post-add-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-request"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-request"),exports),__exportStar(require("./models/get-search-summary-response"),exports),__exportStar(require("./models/download-enrichment-job-results-request"),exports),__exportStar(require("./models/download-enrichment-job-results-response"),exports);
@@ -0,0 +1,18 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ /**
3
+ * Request for downloading the Excel export of a completed enrichment job.
4
+ */
5
+ export interface DownloadEnrichmentJobResultsRequest {
6
+ /**
7
+ * The id of the enrichment job to export.
8
+ */
9
+ jobId: string;
10
+ /**
11
+ * Organization name when explicitly selecting an organization.
12
+ */
13
+ organization?: string;
14
+ /**
15
+ * Preferred export language (e.g. `en`, `de`, `it`, `es`, `pt`, `fr`).
16
+ */
17
+ language?: string;
18
+ }
@@ -0,0 +1,3 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ import { BlobDownloadResponse } from '../../core';
3
+ export type DownloadEnrichmentJobResultsResponse = BlobDownloadResponse;
@@ -25,6 +25,8 @@ import { PostRemovePartsFromEnrichmentJobResponse } from '../models/post-remove-
25
25
  import { PostAddAllSearchSessionPartsToEnrichmentJobRequest } from '../models/post-add-all-search-session-parts-to-enrichment-job-request';
26
26
  import { PostRemoveAllSearchSessionPartsFromEnrichmentJobRequest } from '../models/post-remove-all-search-session-parts-from-enrichment-job-request';
27
27
  import { GetSearchSummaryResponse } from '../models/get-search-summary-response';
28
+ import { DownloadEnrichmentJobResultsRequest } from '../models/download-enrichment-job-results-request';
29
+ import { DownloadEnrichmentJobResultsResponse } from '../models/download-enrichment-job-results-response';
28
30
  /**
29
31
  * Service for managing data enrichment jobs.
30
32
  */
@@ -156,6 +158,13 @@ export interface DataEnrichmentService {
156
158
  * @returns An Observable that emits the created job id.
157
159
  */
158
160
  triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
161
+ /**
162
+ * Download the Excel export for a completed enrichment job.
163
+ *
164
+ * @param request - The request containing the job id and optional organization/language.
165
+ * @returns An Observable that emits the downloaded file and optional filename from Content-Disposition.
166
+ */
167
+ downloadEnrichmentJobResults(request: DownloadEnrichmentJobResultsRequest): Observable<DownloadEnrichmentJobResultsResponse>;
159
168
  }
160
169
  export declare class DataEnrichmentServiceImpl extends BaseService implements DataEnrichmentService {
161
170
  private httpsService;
@@ -191,6 +200,7 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
191
200
  createEnrichmentJobWithSearchSession(request: CreateEnrichmentJobWithSearchSessionRequest): Observable<CreateEnrichmentJobWithSearchSessionResponse>;
192
201
  submitEnrichmentJob(request: SubmitEnrichmentJobRequest): Observable<void>;
193
202
  triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
203
+ downloadEnrichmentJobResults(request: DownloadEnrichmentJobResultsRequest): Observable<DownloadEnrichmentJobResultsResponse>;
194
204
  private fetchEnrichmentJobsPage;
195
205
  private fetchEnrichmentJobPartsPage;
196
206
  }
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])},r(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var t,e=1,o=arguments.length;e<o;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,t,e,o){var n,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,t,e,o);else for(var a=r.length-1;a>=0;a--)(n=r[a])&&(s=(i<3?n(s):i>3?n(t,e,s):n(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s},__rest=this&&this.__rest||function(r,t){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(e[o[n]]=r[o[n]])}return e},__spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return r.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataEnrichmentServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),enrichment_job_1=require("../models/enrichment-job"),enrichment_job_part_1=require("../models/enrichment-job-part"),DataEnrichmentServiceImpl=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return __extends(t,r),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.loadEnrichmentJobs=function(r){return this.fetchEnrichmentJobsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,o=t.nextCursor;return{jobs:e,paginationContext:{initialRequest:r,nextCursor:o}}})))},t.prototype.loadMoreEnrichmentJobs=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,o=t.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},r),{nextCursor:o})}})))},t.prototype.hasMoreEnrichmentJobsAvailable=function(r){return!!r.nextCursor},t.prototype.getEnrichmentJob=function(r){var t=r.jobId,e=__rest(r,["jobId"]);return this.httpsService.get("jobs/".concat(t),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){return(0,enrichment_job_1.enrichmentJobDetailFromAPIResponse)(r)})))},t.prototype.loadEnrichmentJobParts=function(r){return this.fetchEnrichmentJobPartsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.parts,o=t.partsSummary,n=t.nextCursor;return{parts:e,partsSummary:o,paginationContext:{initialRequest:r,nextCursor:n}}})))},t.prototype.loadMoreEnrichmentJobParts=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobPartsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.parts,o=t.partsSummary,n=t.nextCursor;return{parts:e,partsSummary:o,paginationContext:__assign(__assign({},r),{nextCursor:n})}})))},t.prototype.addPartsToEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/add"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.removePartsFromEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/remove"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.addAllSearchSessionPartsToEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/search/add"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.removeAllSearchSessionPartsFromEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/search/remove"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.checkWhichPartsInEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/check"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.getSearchSummary=function(r){return this.httpsService.get("jobs/".concat(r,"/search/summary"),[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.hasMoreEnrichmentJobPartsAvailable=function(r){return!!r.nextCursor},t.prototype.createEnrichmentJob=function(r){var t=new FormData;t.append("file",r.csvFile);var e=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs/upload",t,e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{"Content-Type":"multipart/form-data"})},t.prototype.createEnrichmentJobWithSearchSession=function(r){var t=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs",r,t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.submitEnrichmentJob=function(r){return this.httpsService.post("jobs/".concat(r.jobId,"/submit"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.triggerEnrichmentJob=function(r){var t,e=__assign(__assign({type:r.type,partIds:r.partIds,visible:null!==(t=r.visible)&&void 0!==t&&t},void 0!==r.attributeIds?{attributeIds:r.attributeIds}:{}),void 0!==r.organization?{organization:r.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.fetchEnrichmentJobsPage=function(r){var t=(0,core_1.toQueryParams)(r);return this.httpsService.get("jobs",t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var t,e;return{jobs:null!==(e=null===(t=r.results)||void 0===t?void 0:t.map((function(r){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(r)})))&&void 0!==e?e:[],nextCursor:(0,core_1.extractNextCursor)(r)}})))},t.prototype.fetchEnrichmentJobPartsPage=function(r){var t=r.jobId,e=__rest(r,["jobId"]),o=(0,core_1.toQueryParams)(e);return this.httpsService.get("jobs/".concat(t,"/parts"),o,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var t,e;return{parts:null!==(e=null===(t=r.results)||void 0===t?void 0:t.map((function(r){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(r)})))&&void 0!==e?e:[],partsSummary:r.partsSummary,nextCursor:(0,core_1.extractNextCursor)(r)}})))},t=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],t)}(core_1.BaseService);exports.DataEnrichmentServiceImpl=DataEnrichmentServiceImpl;
2
+ "use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])},r(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var t,e=1,o=arguments.length;e<o;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,t,e,o){var n,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,t,e,o);else for(var a=r.length-1;a>=0;a--)(n=r[a])&&(s=(i<3?n(s):i>3?n(t,e,s):n(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s},__rest=this&&this.__rest||function(r,t){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(e[o[n]]=r[o[n]])}return e},__spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return r.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataEnrichmentServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),enrichment_job_1=require("../models/enrichment-job"),enrichment_job_part_1=require("../models/enrichment-job-part"),DataEnrichmentServiceImpl=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return __extends(t,r),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.loadEnrichmentJobs=function(r){return this.fetchEnrichmentJobsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,o=t.nextCursor;return{jobs:e,paginationContext:{initialRequest:r,nextCursor:o}}})))},t.prototype.loadMoreEnrichmentJobs=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,o=t.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},r),{nextCursor:o})}})))},t.prototype.hasMoreEnrichmentJobsAvailable=function(r){return!!r.nextCursor},t.prototype.getEnrichmentJob=function(r){var t=r.jobId,e=__rest(r,["jobId"]);return this.httpsService.get("jobs/".concat(t),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){return(0,enrichment_job_1.enrichmentJobDetailFromAPIResponse)(r)})))},t.prototype.loadEnrichmentJobParts=function(r){return this.fetchEnrichmentJobPartsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.parts,o=t.partsSummary,n=t.nextCursor;return{parts:e,partsSummary:o,paginationContext:{initialRequest:r,nextCursor:n}}})))},t.prototype.loadMoreEnrichmentJobParts=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobPartsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.parts,o=t.partsSummary,n=t.nextCursor;return{parts:e,partsSummary:o,paginationContext:__assign(__assign({},r),{nextCursor:n})}})))},t.prototype.addPartsToEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/add"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.removePartsFromEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/remove"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.addAllSearchSessionPartsToEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/search/add"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.removeAllSearchSessionPartsFromEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/search/remove"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.checkWhichPartsInEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/check"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.getSearchSummary=function(r){return this.httpsService.get("jobs/".concat(r,"/search/summary"),[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.hasMoreEnrichmentJobPartsAvailable=function(r){return!!r.nextCursor},t.prototype.createEnrichmentJob=function(r){var t=new FormData;t.append("file",r.csvFile);var e=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs/upload",t,e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{"Content-Type":"multipart/form-data"})},t.prototype.createEnrichmentJobWithSearchSession=function(r){var t=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs",r,t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.submitEnrichmentJob=function(r){return this.httpsService.post("jobs/".concat(r.jobId,"/submit"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.triggerEnrichmentJob=function(r){var t,e=__assign(__assign({type:r.type,partIds:r.partIds,visible:null!==(t=r.visible)&&void 0!==t&&t},void 0!==r.attributeIds?{attributeIds:r.attributeIds}:{}),void 0!==r.organization?{organization:r.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.downloadEnrichmentJobResults=function(r){var t=r.jobId,e=__rest(r,["jobId"]);return this.httpsService.get("jobs/".concat(t,"/export"),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{responseType:"blob"})},t.prototype.fetchEnrichmentJobsPage=function(r){var t=(0,core_1.toQueryParams)(r);return this.httpsService.get("jobs",t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var t,e;return{jobs:null!==(e=null===(t=r.results)||void 0===t?void 0:t.map((function(r){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(r)})))&&void 0!==e?e:[],nextCursor:(0,core_1.extractNextCursor)(r)}})))},t.prototype.fetchEnrichmentJobPartsPage=function(r){var t=r.jobId,e=__rest(r,["jobId"]),o=(0,core_1.toQueryParams)(e);return this.httpsService.get("jobs/".concat(t,"/parts"),o,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var t,e;return{parts:null!==(e=null===(t=r.results)||void 0===t?void 0:t.map((function(r){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(r)})))&&void 0!==e?e:[],partsSummary:r.partsSummary,nextCursor:(0,core_1.extractNextCursor)(r)}})))},t=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],t)}(core_1.BaseService);exports.DataEnrichmentServiceImpl=DataEnrichmentServiceImpl;
@@ -36,6 +36,10 @@ export interface SearchInput {
36
36
  hierarchyFilters?: string[];
37
37
  /** filter-names and filter-values to add as filters */
38
38
  attributeFilters?: Record<string, string[]>;
39
+ /**
40
+ * Id of a part-list (e.g. from PartListService.createCollectionFromFile) to restrict the search to only search within that part-list.
41
+ */
42
+ partListId?: string;
39
43
  /** Search for parts, similar to the one with the given id (can not be combined with any other search input, such as text, image or filter) */
40
44
  similarTo?: {
41
45
  id?: string;