@partium/js-sdk 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +100 -0
- package/README.md +18 -0
- package/core/constants/constants.d.ts +12 -0
- package/core/constants/constants.js +2 -0
- package/core/decorators/injection-identifier.d.ts +10 -0
- package/core/decorators/injection-identifier.js +2 -0
- package/core/factories/paginated-request-service.factory.d.ts +22 -0
- package/core/factories/paginated-request-service.factory.js +2 -0
- package/core/index.d.ts +47 -0
- package/core/index.js +2 -0
- package/core/integration-defaults/http/fetch-api-http-error-helper.d.ts +16 -0
- package/core/integration-defaults/http/fetch-api-http-error-helper.js +2 -0
- package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.d.ts +35 -0
- package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +2 -0
- package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.d.ts +47 -0
- package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +2 -0
- package/core/integration-defaults/http/handle-axios-error-helper.d.ts +17 -0
- package/core/integration-defaults/http/handle-axios-error-helper.js +2 -0
- package/core/integration-defaults/http/https-client/axios-https-client.service.d.ts +83 -0
- package/core/integration-defaults/http/https-client/axios-https-client.service.js +2 -0
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.d.ts +85 -0
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +2 -0
- package/core/integration-defaults/http/js-oauth-keycloak-https.service.d.ts +8 -0
- package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +2 -0
- package/core/integration-defaults/js-p-file.d.ts +8 -0
- package/core/integration-defaults/js-p-file.js +2 -0
- package/core/integration-defaults/session/js-oauth-api-key-session.service.d.ts +76 -0
- package/core/integration-defaults/session/js-oauth-api-key-session.service.js +2 -0
- package/core/integration-defaults/session/js-oauth-keycloak-auth-config.d.ts +28 -0
- package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +2 -0
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.d.ts +82 -0
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +2 -0
- package/core/integration-defaults/web-device-status.service.d.ts +24 -0
- package/core/integration-defaults/web-device-status.service.js +2 -0
- package/core/integration-defaults/web-file.service.d.ts +9 -0
- package/core/integration-defaults/web-file.service.js +2 -0
- package/core/integration-defaults/web-indexeddb.service.d.ts +19 -0
- package/core/integration-defaults/web-indexeddb.service.js +2 -0
- package/core/integration-defaults/web-local-storage.service.d.ts +157 -0
- package/core/integration-defaults/web-local-storage.service.js +2 -0
- package/core/models/api-object.d.ts +7 -0
- package/core/models/api-object.js +2 -0
- package/core/models/auth-config.d.ts +38 -0
- package/core/models/auth-config.js +2 -0
- package/core/models/device-info.d.ts +62 -0
- package/core/models/device-info.js +2 -0
- package/core/models/error.d.ts +70 -0
- package/core/models/error.js +2 -0
- package/core/models/formatted-string.d.ts +9 -0
- package/core/models/formatted-string.js +2 -0
- package/core/models/i18n-map.d.ts +34 -0
- package/core/models/i18n-map.js +2 -0
- package/core/models/i18n-string.d.ts +8 -0
- package/core/models/i18n-string.js +2 -0
- package/core/models/log.d.ts +130 -0
- package/core/models/log.js +2 -0
- package/core/models/organization.d.ts +121 -0
- package/core/models/organization.js +2 -0
- package/core/models/p-file.d.ts +17 -0
- package/core/models/p-file.js +2 -0
- package/core/models/paginated-list.d.ts +23 -0
- package/core/models/paginated-list.js +2 -0
- package/core/models/partium-config.d.ts +31 -0
- package/core/models/partium-config.js +2 -0
- package/core/models/user-token.d.ts +16 -0
- package/core/models/user-token.js +2 -0
- package/core/models/user.d.ts +48 -0
- package/core/models/user.js +2 -0
- package/core/services/backend-status.service.d.ts +46 -0
- package/core/services/backend-status.service.js +2 -0
- package/core/services/base-login-init.service.d.ts +32 -0
- package/core/services/base-login-init.service.js +2 -0
- package/core/services/base.service.d.ts +31 -0
- package/core/services/base.service.js +2 -0
- package/core/services/device-status.service.interface.d.ts +36 -0
- package/core/services/device-status.service.interface.js +2 -0
- package/core/services/file.service.interface.d.ts +24 -0
- package/core/services/file.service.interface.js +2 -0
- package/core/services/http/file-transfer/file-transfer.service.interface.d.ts +57 -0
- package/core/services/http/file-transfer/file-transfer.service.interface.js +2 -0
- package/core/services/http/https-client/https-client.service.interface.d.ts +96 -0
- package/core/services/http/https-client/https-client.service.interface.js +2 -0
- package/core/services/http/https.service.interface.d.ts +164 -0
- package/core/services/http/https.service.interface.js +2 -0
- package/core/services/http/oauth-https.service.d.ts +120 -0
- package/core/services/http/oauth-https.service.js +2 -0
- package/core/services/local-storage.service.interface.d.ts +221 -0
- package/core/services/local-storage.service.interface.js +2 -0
- package/core/services/log.service.d.ts +48 -0
- package/core/services/log.service.js +2 -0
- package/core/services/organization.service.d.ts +48 -0
- package/core/services/organization.service.js +2 -0
- package/core/services/paginated-request.service.d.ts +104 -0
- package/core/services/paginated-request.service.js +2 -0
- package/core/services/recent-parts.service.d.ts +59 -0
- package/core/services/recent-parts.service.js +2 -0
- package/core/services/service-provider.d.ts +58 -0
- package/core/services/service-provider.js +2 -0
- package/core/services/session/oauth-session.service.d.ts +76 -0
- package/core/services/session/oauth-session.service.js +2 -0
- package/core/services/session/session.service.interface.d.ts +138 -0
- package/core/services/session/session.service.interface.js +2 -0
- package/core/utils/general-helper.d.ts +35 -0
- package/core/utils/general-helper.js +2 -0
- package/data/index.d.ts +28 -0
- package/data/index.js +2 -0
- package/data/models/announcement.d.ts +30 -0
- package/data/models/announcement.js +2 -0
- package/data/models/assembly-hierarchy-node-breadcrumb.d.ts +10 -0
- package/data/models/assembly-hierarchy-node-breadcrumb.js +2 -0
- package/data/models/assembly-hierarchy-node.d.ts +16 -0
- package/data/models/assembly-hierarchy-node.js +2 -0
- package/data/models/attribute.d.ts +46 -0
- package/data/models/attribute.js +2 -0
- package/data/models/csa-request-search.d.ts +18 -0
- package/data/models/csa-request-search.js +2 -0
- package/data/models/csa-request-status.d.ts +16 -0
- package/data/models/csa-request-status.js +2 -0
- package/data/models/csa-request.d.ts +41 -0
- package/data/models/csa-request.js +2 -0
- package/data/models/document.d.ts +12 -0
- package/data/models/document.js +2 -0
- package/data/models/filter-key.d.ts +12 -0
- package/data/models/filter-key.js +2 -0
- package/data/models/filter-option-value.d.ts +18 -0
- package/data/models/filter-option-value.js +2 -0
- package/data/models/image.d.ts +36 -0
- package/data/models/image.js +2 -0
- package/data/models/inquiry.d.ts +32 -0
- package/data/models/inquiry.js +2 -0
- package/data/models/mounting-location.d.ts +32 -0
- package/data/models/mounting-location.js +2 -0
- package/data/models/multiple-expert-searches.d.ts +9 -0
- package/data/models/multiple-expert-searches.js +2 -0
- package/data/models/part-enrichment-data.d.ts +24 -0
- package/data/models/part-enrichment-data.js +2 -0
- package/data/models/part.d.ts +168 -0
- package/data/models/part.js +2 -0
- package/data/models/shopping-cart.d.ts +43 -0
- package/data/models/shopping-cart.js +2 -0
- package/data/services/announcement.service.d.ts +68 -0
- package/data/services/announcement.service.js +2 -0
- package/data/services/assembly-hierarchy-nodes.service.d.ts +113 -0
- package/data/services/assembly-hierarchy-nodes.service.js +2 -0
- package/data/services/csa-helper.service.d.ts +32 -0
- package/data/services/csa-helper.service.js +2 -0
- package/data/services/customer-service-assistance.service.d.ts +181 -0
- package/data/services/customer-service-assistance.service.js +2 -0
- package/data/services/filter.service.d.ts +97 -0
- package/data/services/filter.service.js +2 -0
- package/data/services/inquiry.service.d.ts +54 -0
- package/data/services/inquiry.service.js +2 -0
- package/data/services/part-attribute.service.d.ts +42 -0
- package/data/services/part-attribute.service.js +2 -0
- package/data/services/part-enrichment.service.d.ts +32 -0
- package/data/services/part-enrichment.service.js +2 -0
- package/data/services/part.service.d.ts +121 -0
- package/data/services/part.service.js +2 -0
- package/data/services/related-parts.service.d.ts +75 -0
- package/data/services/related-parts.service.js +2 -0
- package/data/services/shopping-cart.service.d.ts +150 -0
- package/data/services/shopping-cart.service.js +2 -0
- package/find/index.d.ts +35 -0
- package/find/index.js +2 -0
- package/find/models/assets/asset.d.ts +24 -0
- package/find/models/assets/asset.js +2 -0
- package/find/models/search-filter.d.ts +87 -0
- package/find/models/search-filter.js +2 -0
- package/find/models/search-input.d.ts +39 -0
- package/find/models/search-input.js +2 -0
- package/find/models/search-output.d.ts +10 -0
- package/find/models/search-output.js +2 -0
- package/find/models/search-result-status.d.ts +33 -0
- package/find/models/search-result-status.js +2 -0
- package/find/models/search-session-log-object.d.ts +16 -0
- package/find/models/search-session-log-object.js +2 -0
- package/find/models/search-status/cv-search-status.d.ts +20 -0
- package/find/models/search-status/cv-search-status.js +2 -0
- package/find/models/search-status/search-filter-status.d.ts +33 -0
- package/find/models/search-status/search-filter-status.js +2 -0
- package/find/models/search-status/search-status.d.ts +34 -0
- package/find/models/search-status/search-status.js +2 -0
- package/find/models/search-status/tag-search-status.d.ts +16 -0
- package/find/models/search-status/tag-search-status.js +2 -0
- package/find/models/search-status/text-search-status.d.ts +15 -0
- package/find/models/search-status/text-search-status.js +2 -0
- package/find/models/search-tag.d.ts +12 -0
- package/find/models/search-tag.js +2 -0
- package/find/models/smart-filter.d.ts +25 -0
- package/find/models/smart-filter.js +2 -0
- package/find/models/tagable/i18n-tagable.d.ts +10 -0
- package/find/models/tagable/i18n-tagable.js +2 -0
- package/find/models/tagable/tagable-base.d.ts +11 -0
- package/find/models/tagable/tagable-base.js +2 -0
- package/find/models/tagable/tagable.d.ts +10 -0
- package/find/models/tagable/tagable.js +2 -0
- package/find/models/text-search-config.d.ts +57 -0
- package/find/models/text-search-config.js +2 -0
- package/find/models/text-search-manipulator.d.ts +46 -0
- package/find/models/text-search-manipulator.js +2 -0
- package/find/models/text-search-result-item/text-search-error.d.ts +7 -0
- package/find/models/text-search-result-item/text-search-error.js +2 -0
- package/find/models/text-search-result-item/text-search-result-item-document.d.ts +10 -0
- package/find/models/text-search-result-item/text-search-result-item-document.js +2 -0
- package/find/models/text-search-result-item/text-search-result-item-part.d.ts +12 -0
- package/find/models/text-search-result-item/text-search-result-item-part.js +2 -0
- package/find/models/text-search-result-item/text-search-result-item-recent-query.d.ts +10 -0
- package/find/models/text-search-result-item/text-search-result-item-recent-query.js +2 -0
- package/find/models/text-search-result-item/text-search-result-item-unknown.d.ts +12 -0
- package/find/models/text-search-result-item/text-search-result-item-unknown.js +2 -0
- package/find/models/text-search-result-item/text-search-result-item.d.ts +16 -0
- package/find/models/text-search-result-item/text-search-result-item.js +2 -0
- package/find/services/asset.service.d.ts +160 -0
- package/find/services/asset.service.js +2 -0
- package/find/services/filter-uploaders/filter-uploader.d.ts +13 -0
- package/find/services/filter-uploaders/filter-uploader.js +2 -0
- package/find/services/filter-uploaders/update-filters-uploader.d.ts +17 -0
- package/find/services/filter-uploaders/update-filters-uploader.js +2 -0
- package/find/services/filter-uploaders/update-filters.model.d.ts +19 -0
- package/find/services/filter-uploaders/update-filters.model.js +2 -0
- package/find/services/search/cv-search.service.d.ts +103 -0
- package/find/services/search/cv-search.service.js +2 -0
- package/find/services/search/recent-text-search-queries.service.d.ts +89 -0
- package/find/services/search/recent-text-search-queries.service.js +2 -0
- package/find/services/search/search-result.service.d.ts +142 -0
- package/find/services/search/search-result.service.js +2 -0
- package/find/services/search/search.service.d.ts +291 -0
- package/find/services/search/search.service.js +2 -0
- package/find/services/search/tag-search.service.d.ts +66 -0
- package/find/services/search/tag-search.service.js +2 -0
- package/find/services/search/text-search.service.d.ts +116 -0
- package/find/services/search/text-search.service.js +2 -0
- package/find/services/search-filter.service.d.ts +223 -0
- package/find/services/search-filter.service.js +2 -0
- package/find/utils/search-helper.d.ts +14 -0
- package/find/utils/search-helper.js +2 -0
- package/gen/sdk-version.d.ts +2 -0
- package/gen/sdk-version.js +2 -0
- package/index.d.ts +121 -0
- package/index.js +2 -0
- package/management/index.d.ts +5 -0
- package/management/index.js +2 -0
- package/management/models/api-key-list-response.d.ts +10 -0
- package/management/models/api-key-list-response.js +2 -0
- package/management/models/api-key-type.d.ts +5 -0
- package/management/models/api-key-type.js +2 -0
- package/management/models/api-key.d.ts +4 -0
- package/management/models/api-key.js +2 -0
- package/management/services/api-key.service.d.ts +39 -0
- package/management/services/api-key.service.js +2 -0
- package/ocr/index.d.ts +4 -0
- package/ocr/index.js +2 -0
- package/ocr/models/detect-response.d.ts +5 -0
- package/ocr/models/detect-response.js +2 -0
- package/ocr/models/detected-text-entry.d.ts +5 -0
- package/ocr/models/detected-text-entry.js +2 -0
- package/ocr/services/ocr.service.d.ts +36 -0
- package/ocr/services/ocr.service.js +2 -0
- package/package.json +45 -0
- package/user-data/index.d.ts +5 -0
- package/user-data/index.js +2 -0
- package/user-data/models/part-with-nullable.d.ts +5 -0
- package/user-data/models/part-with-nullable.js +2 -0
- package/user-data/models/request-list/request-list.d.ts +16 -0
- package/user-data/models/request-list/request-list.js +2 -0
- package/user-data/services/favorite/favorite.service.d.ts +45 -0
- package/user-data/services/favorite/favorite.service.js +2 -0
- package/user-data/services/request-list/request-list.service.d.ts +97 -0
- package/user-data/services/request-list/request-list.service.js +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core';
|
|
3
|
+
export declare enum CSA_REQUEST_STATUS {
|
|
4
|
+
NEW = "new",
|
|
5
|
+
OPENED = "opened",
|
|
6
|
+
RESOLVED = "resolved",
|
|
7
|
+
NOT_RESOLVED = "not_resolved"
|
|
8
|
+
}
|
|
9
|
+
export declare class CSARequestStatus extends APIObject {
|
|
10
|
+
timestamp: string;
|
|
11
|
+
confirmedPart: string | null;
|
|
12
|
+
status: CSA_REQUEST_STATUS;
|
|
13
|
+
constructor(init?: Partial<CSARequestStatus>);
|
|
14
|
+
static serialize(request: CSARequestStatus): string;
|
|
15
|
+
static fromAPIResponse(requestData: Object): CSARequestStatus;
|
|
16
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.CSARequestStatus=exports.CSA_REQUEST_STATUS=void 0;var CSA_REQUEST_STATUS,core_1=require("../../core");!function(t){t.NEW="new",t.OPENED="opened",t.RESOLVED="resolved",t.NOT_RESOLVED="not_resolved"}(CSA_REQUEST_STATUS||(exports.CSA_REQUEST_STATUS=CSA_REQUEST_STATUS={}));var CSARequestStatus=function(t){function e(e){var r=t.call(this)||this;return Object.assign(r,e),r}return __extends(e,t),e.serialize=function(t){var e={};return e.timestamp=t.timestamp,e.confirmedPart=t.confirmedPart,e.status=t.status,JSON.stringify(e)},e.fromAPIResponse=function(t){return new e({timestamp:t.timestamp,status:t.status,confirmedPart:t.confirmed_part?t.confirmed_part:null})},e}(core_1.APIObject);exports.CSARequestStatus=CSARequestStatus;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core/models/api-object';
|
|
3
|
+
import { KvpHardFilter } from '../../find/models/search-filter';
|
|
4
|
+
import { TextSearchQueries } from '../../find/services/search/text-search.service';
|
|
5
|
+
import { AssemblyHierarchyNode } from './assembly-hierarchy-node';
|
|
6
|
+
import { CSA_REQUEST_STATUS } from './csa-request-status';
|
|
7
|
+
import { Part } from './part';
|
|
8
|
+
export declare enum RequestType {
|
|
9
|
+
CONFIRMATION = "confirmation",
|
|
10
|
+
HELP = "help"
|
|
11
|
+
}
|
|
12
|
+
export declare class CSARequest extends APIObject {
|
|
13
|
+
partiumId: string;
|
|
14
|
+
cartId: string;
|
|
15
|
+
inquiryId: string;
|
|
16
|
+
requestType: string;
|
|
17
|
+
organizationId: string;
|
|
18
|
+
contactEmail: string;
|
|
19
|
+
language: string;
|
|
20
|
+
part: Part;
|
|
21
|
+
quantity: number;
|
|
22
|
+
message: string;
|
|
23
|
+
additionalAssetIds: string[];
|
|
24
|
+
status: CSA_REQUEST_STATUS;
|
|
25
|
+
statusTimestamp: string;
|
|
26
|
+
created: string;
|
|
27
|
+
confirmedPart: string | null;
|
|
28
|
+
confirmedFullPart: Part | null;
|
|
29
|
+
searchSessionId: string;
|
|
30
|
+
/** text query from the hybrid search. This has been de-deprecated, it was previously used for the standard-search */
|
|
31
|
+
textQuery: string;
|
|
32
|
+
/** @deprecated only used for older searches, it will be replaced by textQuery */
|
|
33
|
+
textQueries: TextSearchQueries;
|
|
34
|
+
queryImageAssetId: string;
|
|
35
|
+
resultParts: Part[];
|
|
36
|
+
assemblies: AssemblyHierarchyNode[];
|
|
37
|
+
kvpHardFilters: KvpHardFilter[];
|
|
38
|
+
confirmedBomContext: string[];
|
|
39
|
+
constructor(init?: Partial<CSARequest>);
|
|
40
|
+
static fromAPIResponse(requestData: Object): CSARequest;
|
|
41
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 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 a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;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.CSARequest=exports.RequestType=void 0;var RequestType,api_object_1=require("../../core/models/api-object"),i18n_string_1=require("../../core/models/i18n-string"),search_filter_1=require("../../find/models/search-filter"),text_search_service_1=require("../../find/services/search/text-search.service"),assembly_hierarchy_node_1=require("./assembly-hierarchy-node"),assembly_hierarchy_node_breadcrumb_1=require("./assembly-hierarchy-node-breadcrumb"),part_1=require("./part");!function(e){e.CONFIRMATION="confirmation",e.HELP="help"}(RequestType||(exports.RequestType=RequestType={}));var CSARequest=function(e){function t(t){var r=e.call(this)||this;return Object.assign(r,t),r}return __extends(t,e),t.fromAPIResponse=function(e){var r,a,s,n,i=e.request_data&&e.request_data.text_query;return!i&&(null===(s=e.request_data)||void 0===s?void 0:s.text_search)&&(i="".concat(e.request_data.text_search.semantic_text||""," ").concat(e.request_data.text_search.exact_text||"").trim()),new t(__assign(__assign({partiumId:e.request_id,cartId:e.cart_uuid,inquiryId:e.inquiry_id,requestType:e.request_data.part?RequestType.CONFIRMATION:RequestType.HELP,organizationId:e.organization_id,created:e.created,contactEmail:e.contact_email,language:e.language,status:e.status,statusTimestamp:e.status_timestamp,confirmedPart:e.confirmed_part,part:e.request_data&&e.request_data.part&&e.request_data.part.part_id?new part_1.Part({partiumId:e.request_data.part.part_id,externalId:e.request_data.part.part_external_id,name:new i18n_string_1.i18nString((r={},r[e.language]=e.request_data.part.part_name,r)),dataOrigin:part_1.DATA_ORIGIN.PARTIAL}):null,message:e.request_data&&e.request_data.user_input,quantity:e.quantity,additionalAssetIds:e.request_data&&e.request_data.media_assets,searchSessionId:e.session_id,textQuery:i},(null===(n=e.request_data)||void 0===n?void 0:n.text_search)?{textQueries:(a={},a[text_search_service_1.TEXT_SEARCH_TYPE.SEMANTIC]=e.request_data.text_search.semantic_text||"",a[text_search_service_1.TEXT_SEARCH_TYPE.EXACT]=e.request_data.text_search.exact_text||"",a)}:{}),{queryImageAssetId:e.request_data&&e.request_data.query_image_asset,resultParts:e.request_data&&e.request_data.result_list?e.request_data.result_list.map((function(t){var r;return new part_1.Part({partiumId:t.part_id,externalId:t.part_external_id,name:new i18n_string_1.i18nString((r={},r[e.language]=t.part_name,r)),dataOrigin:part_1.DATA_ORIGIN.PARTIAL})})):null,assemblies:e.request_data&&e.request_data.assemblies?e.request_data.assemblies.map((function(t){var r;return new assembly_hierarchy_node_1.AssemblyHierarchyNode({partiumId:t.assembly_id,externalId:t.assembly_external_id,name:new i18n_string_1.i18nString((r={},r[e.language]=t.assembly_name,r)),breadcrumbs:t.breadcrumbs.map((function(t){var r;return new assembly_hierarchy_node_breadcrumb_1.AssemblyHierarchyNodeBreadcrumb({partiumId:null,name:new i18n_string_1.i18nString((r={},r[e.language]=t,r))})}))})})):null,confirmedBomContext:!0==!!e.confirmed_part&&e.request_data&&e.request_data.assemblies?e.request_data.assemblies.map((function(e){return e.assembly_id})):[],kvpHardFilters:e.request_data&&e.request_data.hard_filters?e.request_data.hard_filters.map((function(e){return new search_filter_1.KvpHardFilter(e.label,e.label,e.values)})):null}))},t}(api_object_1.APIObject);exports.CSARequest=CSARequest;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
export declare class Document {
|
|
3
|
+
partiumId: string;
|
|
4
|
+
externalId: string;
|
|
5
|
+
externalPayload: Object;
|
|
6
|
+
name: string;
|
|
7
|
+
assetId: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
constructor(init?: Partial<Document>);
|
|
10
|
+
updateDocument(update?: Partial<Document>): void;
|
|
11
|
+
updateName(name: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Document=void 0;var Document=function(){function t(t){Object.assign(this,t)}return t.prototype.updateDocument=function(t){Object.assign(this,t)},t.prototype.updateName=function(t){this.name=t},t}();exports.Document=Document;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core';
|
|
3
|
+
export interface FilterKeyFromAPI {
|
|
4
|
+
uuid: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class FilterKey extends APIObject {
|
|
8
|
+
partiumId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
constructor(init?: Partial<FilterKey>);
|
|
11
|
+
static fromAPIResponse(apiResponse: FilterKeyFromAPI): FilterKey;
|
|
12
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.FilterKey=void 0;var core_1=require("../../core"),FilterKey=function(t){function e(e){var r=t.call(this)||this;return Object.assign(r,e),r}return __extends(e,t),e.fromAPIResponse=function(t){return new e({partiumId:t.uuid,name:t.name})},e}(core_1.APIObject);exports.FilterKey=FilterKey;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core';
|
|
3
|
+
export interface FilterOptionValueFromAPI {
|
|
4
|
+
uuid: string;
|
|
5
|
+
value: string;
|
|
6
|
+
part_count: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* FilterOption of type `Value`.
|
|
10
|
+
* This filter option contains an i18nString value.
|
|
11
|
+
*/
|
|
12
|
+
export declare class FilterOptionValue extends APIObject {
|
|
13
|
+
partiumId: string;
|
|
14
|
+
value: string;
|
|
15
|
+
partCount: number;
|
|
16
|
+
constructor(init?: Partial<FilterOptionValue>);
|
|
17
|
+
static fromAPIResponse(apiResponse: FilterOptionValueFromAPI): FilterOptionValue;
|
|
18
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,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=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.FilterOptionValue=void 0;var core_1=require("../../core"),FilterOptionValue=function(t){function e(e){var r=t.call(this)||this;return Object.assign(r,e),r}return __extends(e,t),e.fromAPIResponse=function(t){return new e({partiumId:t.uuid,value:t.value,partCount:t.part_count})},e}(core_1.APIObject);exports.FilterOptionValue=FilterOptionValue;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject, BACKEND_SERVICE } from '../../core';
|
|
3
|
+
export interface ImageFromFindAPI {
|
|
4
|
+
partiumId: string;
|
|
5
|
+
description: string;
|
|
6
|
+
expireAt: string;
|
|
7
|
+
urls: {
|
|
8
|
+
[size: string]: string;
|
|
9
|
+
};
|
|
10
|
+
type?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageFromDataAPI {
|
|
13
|
+
uuid: string;
|
|
14
|
+
description: string;
|
|
15
|
+
expireAt: string;
|
|
16
|
+
urls: {
|
|
17
|
+
[size: string]: string;
|
|
18
|
+
};
|
|
19
|
+
type?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class Image extends APIObject {
|
|
22
|
+
assetId: string;
|
|
23
|
+
origin: BACKEND_SERVICE;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated this informations are now included on downloadUrls object
|
|
26
|
+
* the names of the sizes this image is available in eg: "original", "thumbnail", "medium"
|
|
27
|
+
* the available sizes and size-names can be defined by data and can different by customer
|
|
28
|
+
*/
|
|
29
|
+
availableSizes: string[];
|
|
30
|
+
downloadUrls: {
|
|
31
|
+
[key: string]: string;
|
|
32
|
+
};
|
|
33
|
+
expireAt: string;
|
|
34
|
+
constructor(init?: Partial<Image>);
|
|
35
|
+
static fromAPIResponse(imageData: ImageFromFindAPI | ImageFromDataAPI, origin?: BACKEND_SERVICE): Image;
|
|
36
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 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 o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.Image=void 0;var core_1=require("../../core"),Image=function(e){function t(t){var r=e.call(this)||this;return Object.assign(r,t),r}return __extends(t,e),t.fromAPIResponse=function(e,r){var o;return void 0===r&&(r=core_1.BACKEND_SERVICE.DATA),r===core_1.BACKEND_SERVICE.FIND?new t({assetId:(o=e).partiumId,origin:r,availableSizes:Object.keys(o.urls),downloadUrls:o.urls,expireAt:o.expireAt||o.expire_at}):new t({assetId:(o=e).uuid,origin:r,availableSizes:Object.keys(o.urls),downloadUrls:o.urls,expireAt:o.expireAt||o.expire_at})},t}(core_1.APIObject);exports.Image=Image;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core';
|
|
3
|
+
export declare enum INQUIRY_STATUS {
|
|
4
|
+
NEW = "new",
|
|
5
|
+
IN_PROGRESS = "in_progress",
|
|
6
|
+
PENDING_RESPONSE = "pending_response",
|
|
7
|
+
SENT_TO_SALES = "sent_to_sales",
|
|
8
|
+
CANCELED = "canceled"
|
|
9
|
+
}
|
|
10
|
+
export declare class InquiryStatusResponse extends APIObject {
|
|
11
|
+
status: INQUIRY_STATUS;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
constructor(init?: Partial<InquiryStatusResponse>);
|
|
14
|
+
static fromAPIResponse(requestData: Object): InquiryStatusResponse;
|
|
15
|
+
}
|
|
16
|
+
export declare class Inquiry extends APIObject {
|
|
17
|
+
inquiryId: string;
|
|
18
|
+
contact: string;
|
|
19
|
+
organizationName: string;
|
|
20
|
+
created: string;
|
|
21
|
+
updated: string;
|
|
22
|
+
cart: string;
|
|
23
|
+
offerRequested: boolean;
|
|
24
|
+
offerRequestDate: string;
|
|
25
|
+
status: INQUIRY_STATUS;
|
|
26
|
+
languageUi: string;
|
|
27
|
+
ecrsCompleted: number;
|
|
28
|
+
ecrsTotal: number;
|
|
29
|
+
statusTimestamp: string;
|
|
30
|
+
constructor(init?: Partial<Inquiry>);
|
|
31
|
+
static fromAPIResponse(requestData: Object): Inquiry;
|
|
32
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.Inquiry=exports.InquiryStatusResponse=exports.INQUIRY_STATUS=void 0;var INQUIRY_STATUS,core_1=require("../../core");!function(t){t.NEW="new",t.IN_PROGRESS="in_progress",t.PENDING_RESPONSE="pending_response",t.SENT_TO_SALES="sent_to_sales",t.CANCELED="canceled"}(INQUIRY_STATUS||(exports.INQUIRY_STATUS=INQUIRY_STATUS={}));var InquiryStatusResponse=function(t){function e(e){var r=t.call(this)||this;return Object.assign(r,e),r}return __extends(e,t),e.fromAPIResponse=function(t){return new e({status:t.status,timestamp:t.timestamp})},e}(core_1.APIObject);exports.InquiryStatusResponse=InquiryStatusResponse;var Inquiry=function(t){function e(e){var r=t.call(this)||this;return Object.assign(r,e),r}return __extends(e,t),e.fromAPIResponse=function(t){return new e({inquiryId:t.inquiry_id,contact:t.contact,organizationName:t.organization_name,created:t.created,updated:t.updated,cart:t.cart,offerRequested:t.offer_requested,offerRequestDate:t.offer_request_date,status:t.status,languageUi:t.language_ui,ecrsCompleted:t.ecrs_completed,ecrsTotal:t.ecrs_total,statusTimestamp:t.status_timestamp})},e}(core_1.APIObject);exports.Inquiry=Inquiry;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { i18nString, APIObject } from '../../core';
|
|
3
|
+
export interface PartMountingLocationInfoFromDataAPI {
|
|
4
|
+
total_count: number;
|
|
5
|
+
mounting_locations: PartMountingLocationFromDataAPI[];
|
|
6
|
+
}
|
|
7
|
+
export interface PartMountingLocationFromDataAPI {
|
|
8
|
+
uuid: string;
|
|
9
|
+
external_id: string;
|
|
10
|
+
name: {
|
|
11
|
+
[language: string]: string;
|
|
12
|
+
};
|
|
13
|
+
quantity: number;
|
|
14
|
+
children: PartMountingLocationFromDataAPI[];
|
|
15
|
+
}
|
|
16
|
+
export declare class PartMountingLocationInfo extends APIObject {
|
|
17
|
+
totalCount: number;
|
|
18
|
+
mountingLocations: PartMountingLocation[];
|
|
19
|
+
constructor(init?: Partial<PartMountingLocationInfo>);
|
|
20
|
+
static fromAPIResponse(data: PartMountingLocationInfoFromDataAPI): PartMountingLocationInfo;
|
|
21
|
+
}
|
|
22
|
+
export declare class PartMountingLocation extends APIObject {
|
|
23
|
+
partiumId: string;
|
|
24
|
+
/** @deprecated use partiumId instead */
|
|
25
|
+
uuid: string;
|
|
26
|
+
externalId: string;
|
|
27
|
+
name: i18nString;
|
|
28
|
+
quantity: number;
|
|
29
|
+
children: PartMountingLocation[];
|
|
30
|
+
constructor(init?: Partial<PartMountingLocation>);
|
|
31
|
+
static fromAPIResponse(data: PartMountingLocationFromDataAPI): PartMountingLocation;
|
|
32
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartMountingLocation=exports.PartMountingLocationInfo=void 0;var core_1=require("../../core"),PartMountingLocationInfo=function(t){function n(n){var o=t.call(this)||this;return Object.assign(o,n),o}return __extends(n,t),n.fromAPIResponse=function(t){var o;return new n({totalCount:t.total_count,mountingLocations:(null===(o=t.mounting_locations)||void 0===o?void 0:o.map((function(t){return PartMountingLocation.fromAPIResponse(t)})))||[]})},n}(core_1.APIObject);exports.PartMountingLocationInfo=PartMountingLocationInfo;var PartMountingLocation=function(t){function n(n){var o=t.call(this)||this;return Object.assign(o,n),o}return __extends(n,t),n.fromAPIResponse=function(t){var o;return new n({uuid:t.uuid,partiumId:t.uuid,externalId:t.external_id,name:new core_1.i18nString(t.name),quantity:t.quantity,children:(null===(o=t.children)||void 0===o?void 0:o.map((function(t){return n.fromAPIResponse(t)})))||[]})},n}(core_1.APIObject);exports.PartMountingLocation=PartMountingLocation;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core/models/api-object';
|
|
3
|
+
import { CSARequestSearch } from './csa-request-search';
|
|
4
|
+
export declare class MultipleExpertSearches extends APIObject {
|
|
5
|
+
searchLimitReached: boolean;
|
|
6
|
+
searches: Array<CSARequestSearch>;
|
|
7
|
+
constructor(init?: Partial<MultipleExpertSearches>);
|
|
8
|
+
static fromAPIResponse(requestData: Object): MultipleExpertSearches;
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 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 o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.MultipleExpertSearches=void 0;var api_object_1=require("../../core/models/api-object"),csa_request_search_1=require("./csa-request-search"),MultipleExpertSearches=function(e){function t(t){var r=e.call(this)||this;return Object.assign(r,t),r}return __extends(t,e),t.fromAPIResponse=function(e){var r=e.searches.map((function(e){return csa_request_search_1.CSARequestSearch.fromAPIResponse(e)}));return new t({searchLimitReached:e.search_limit_reached,searches:r})},t}(api_object_1.APIObject);exports.MultipleExpertSearches=MultipleExpertSearches;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core';
|
|
3
|
+
import { PartEnrichmentSummary, PartEnrichmentSummaryFromDataAPI } from './part';
|
|
4
|
+
export declare enum PART_ENRICHMENT_STATUS {
|
|
5
|
+
ENRICHMENT_NOT_REQUESTED = "ENRICHMENT_NOT_REQUESTED",// No association between the part and the Partium Parts Catalog exists
|
|
6
|
+
ENRICHMENT_IN_PROGRESS = "ENRICHMENT_IN_PROGRESS",// The enrichment is in progress
|
|
7
|
+
ENRICHMENT_FINISHED = "ENRICHMENT_FINISHED",// The enrichment process has completed
|
|
8
|
+
ENRICHMENT_ERROR = "ENRICHMENT_ERROR",// An error occurred during the enrichment process
|
|
9
|
+
ENRICHMENT_IMPORTED = "ENRICHMENT_IMPORTED"
|
|
10
|
+
}
|
|
11
|
+
export interface PartEnrichmentDataFromAPI {
|
|
12
|
+
status: PART_ENRICHMENT_STATUS;
|
|
13
|
+
summary: PartEnrichmentSummaryFromDataAPI[];
|
|
14
|
+
UPIs: string[];
|
|
15
|
+
last_error_timestamp: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PartEnrichmentData extends APIObject {
|
|
18
|
+
status: PART_ENRICHMENT_STATUS;
|
|
19
|
+
summary: PartEnrichmentSummary[];
|
|
20
|
+
upis: string[];
|
|
21
|
+
lastErrorTimestamp: Date;
|
|
22
|
+
constructor(init?: Partial<PartEnrichmentData>);
|
|
23
|
+
static fromAPIResponse(data: PartEnrichmentDataFromAPI): PartEnrichmentData;
|
|
24
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(r,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])},t(r,e)};return function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartEnrichmentData=exports.PART_ENRICHMENT_STATUS=void 0;var PART_ENRICHMENT_STATUS,core_1=require("../../core");!function(t){t.ENRICHMENT_NOT_REQUESTED="ENRICHMENT_NOT_REQUESTED",t.ENRICHMENT_IN_PROGRESS="ENRICHMENT_IN_PROGRESS",t.ENRICHMENT_FINISHED="ENRICHMENT_FINISHED",t.ENRICHMENT_ERROR="ENRICHMENT_ERROR",t.ENRICHMENT_IMPORTED="ENRICHMENT_IMPORTED"}(PART_ENRICHMENT_STATUS||(exports.PART_ENRICHMENT_STATUS=PART_ENRICHMENT_STATUS={}));var PartEnrichmentData=function(t){function r(r){var e=t.call(this)||this;return Object.assign(e,r),e}return __extends(r,t),r.fromAPIResponse=function(t){var e,n;return new r({status:t.status,summary:null!==(n=null===(e=t.summary)||void 0===e?void 0:e.map((function(t){return{key:new core_1.i18nString(t.key),values:t.values.map((function(t){return new core_1.i18nString(t)}))}})))&&void 0!==n?n:[],upis:t.UPIs,lastErrorTimestamp:new Date(t.last_error_timestamp)})},r}(core_1.APIObject);exports.PartEnrichmentData=PartEnrichmentData;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { i18nString, Organization, APIObject } from '../../core';
|
|
3
|
+
import { Attribute, AttributeFromDataAPI, AttributeFromFindAPI } from './attribute';
|
|
4
|
+
import { Image, ImageFromDataAPI, ImageFromFindAPI } from './image';
|
|
5
|
+
import { PartMountingLocation, PartMountingLocationFromDataAPI } from './mounting-location';
|
|
6
|
+
import { PART_ENRICHMENT_STATUS, PartEnrichmentData } from './part-enrichment-data';
|
|
7
|
+
/** @deprecated directly use export from mounting-location instead */
|
|
8
|
+
export { PartMountingLocationFromDataAPI } from './mounting-location';
|
|
9
|
+
/** @deprecated directly use export from mounting-location instead */
|
|
10
|
+
export { PartMountingLocation } from './mounting-location';
|
|
11
|
+
export declare enum RELATION_TYPE {
|
|
12
|
+
DUPLICATE = "duplicate",
|
|
13
|
+
SUBSTITUTE = "substitute",
|
|
14
|
+
EQUIVALENT = "equivalent",
|
|
15
|
+
NOT_RELATED = "not_related"
|
|
16
|
+
}
|
|
17
|
+
export declare enum SUBSTITUTE_ROLE {
|
|
18
|
+
SUCCESSOR = "successor",
|
|
19
|
+
PREDECESSOR = "predecessor"
|
|
20
|
+
}
|
|
21
|
+
export declare enum DUPLICATE_DATA_AREA {
|
|
22
|
+
IMAGE = "IMAGE",
|
|
23
|
+
NAME = "NAME",
|
|
24
|
+
DATA = "DATA"
|
|
25
|
+
}
|
|
26
|
+
type DuplicateTypeFromDataApi = 'IMAGE_NAME_AND_DATA' | 'NAME_AND_DATA' | 'IMAGE';
|
|
27
|
+
export interface PartEnrichmentSummaryFromDataAPI {
|
|
28
|
+
key: {
|
|
29
|
+
[language: string]: string;
|
|
30
|
+
};
|
|
31
|
+
values: {
|
|
32
|
+
[language: string]: string;
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
export interface PartFromFindAPI {
|
|
36
|
+
partiumId: string;
|
|
37
|
+
id: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
nameLanguage?: string;
|
|
40
|
+
images: ImageFromFindAPI[];
|
|
41
|
+
attributes?: AttributeFromFindAPI[];
|
|
42
|
+
mountingLocationsCount: number;
|
|
43
|
+
duplicateType: DuplicateTypeFromDataApi;
|
|
44
|
+
highlights: {
|
|
45
|
+
snippet: string | null;
|
|
46
|
+
indices: {
|
|
47
|
+
id: {
|
|
48
|
+
from: number;
|
|
49
|
+
to: number;
|
|
50
|
+
}[];
|
|
51
|
+
name: {
|
|
52
|
+
from: number;
|
|
53
|
+
to: number;
|
|
54
|
+
}[];
|
|
55
|
+
snippet: {
|
|
56
|
+
from: number;
|
|
57
|
+
to: number;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
relatedPartsSummary?: {
|
|
62
|
+
duplicatePartsCount: number;
|
|
63
|
+
similarPartsCount: number;
|
|
64
|
+
alternativePartsCount: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface PartFromDataAPI {
|
|
68
|
+
uuid: string;
|
|
69
|
+
external_id: string;
|
|
70
|
+
name: {
|
|
71
|
+
[language: string]: string;
|
|
72
|
+
};
|
|
73
|
+
metadata?: Object;
|
|
74
|
+
images: ImageFromDataAPI[];
|
|
75
|
+
organization: {
|
|
76
|
+
uuid: string;
|
|
77
|
+
name: string;
|
|
78
|
+
};
|
|
79
|
+
attributes: AttributeFromDataAPI[];
|
|
80
|
+
mounting_locations: PartMountingLocationFromDataAPI[];
|
|
81
|
+
total_mounting_locations_count: number;
|
|
82
|
+
summary: {
|
|
83
|
+
summary_id: number;
|
|
84
|
+
summary: PartEnrichmentSummaryFromDataAPI[];
|
|
85
|
+
};
|
|
86
|
+
enrichment: {
|
|
87
|
+
status: PART_ENRICHMENT_STATUS;
|
|
88
|
+
summary: PartEnrichmentSummaryFromDataAPI[];
|
|
89
|
+
UPIs: string[];
|
|
90
|
+
last_error_timestamp: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface RelatedPartFromDataAPI {
|
|
94
|
+
part: PartFromDataAPI;
|
|
95
|
+
type: RELATION_TYPE | null;
|
|
96
|
+
part_role: 'anchor_part' | 'related_part' | null;
|
|
97
|
+
created: string;
|
|
98
|
+
}
|
|
99
|
+
export declare enum DATA_ORIGIN {
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated use PARTIAL instead
|
|
102
|
+
*/
|
|
103
|
+
SEARCH_RESULT = 0,// part-data only directly from search-result (=find)
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated not relevant anymore with new FIND-API
|
|
106
|
+
*/
|
|
107
|
+
PARTIAL = 0,// part-data comes from a service, that only provides a subset (=Partial) of a parts data,
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated use DATA_API instead
|
|
110
|
+
*/
|
|
111
|
+
SERVER = 2,// part-data freshly loaded from server (=data)
|
|
112
|
+
DATA_API = 2,// part-data comes from the data-service and can be considered complete
|
|
113
|
+
FIND_API = 3
|
|
114
|
+
}
|
|
115
|
+
export interface PartEnrichmentSummary {
|
|
116
|
+
key: i18nString;
|
|
117
|
+
values: i18nString[];
|
|
118
|
+
}
|
|
119
|
+
export type PartHighlightRange = Array<{
|
|
120
|
+
from: number;
|
|
121
|
+
to: number;
|
|
122
|
+
}>;
|
|
123
|
+
export interface PartHighlights {
|
|
124
|
+
snippet: string | null;
|
|
125
|
+
indices: {
|
|
126
|
+
id: PartHighlightRange;
|
|
127
|
+
name: PartHighlightRange;
|
|
128
|
+
snippet: PartHighlightRange;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export declare class Part extends APIObject {
|
|
132
|
+
partiumId: string;
|
|
133
|
+
externalId: string;
|
|
134
|
+
externalPayload: Object;
|
|
135
|
+
name: i18nString;
|
|
136
|
+
images: Array<Image>;
|
|
137
|
+
/** @deprecated */
|
|
138
|
+
description: i18nString;
|
|
139
|
+
dataOrigin: DATA_ORIGIN;
|
|
140
|
+
organization?: Organization;
|
|
141
|
+
attributes?: Attribute[];
|
|
142
|
+
mountingLocationsCount: number | null;
|
|
143
|
+
mountingLocations: PartMountingLocation[] | null;
|
|
144
|
+
summary: {
|
|
145
|
+
summaryId: number;
|
|
146
|
+
summary: PartEnrichmentSummary[];
|
|
147
|
+
} | null;
|
|
148
|
+
enrichment: PartEnrichmentData | null;
|
|
149
|
+
relationType?: RELATION_TYPE;
|
|
150
|
+
partRole?: SUBSTITUTE_ROLE;
|
|
151
|
+
relationCreatedAt?: Date;
|
|
152
|
+
relatedPartsSummary?: {
|
|
153
|
+
duplicatePartsCount: number;
|
|
154
|
+
similarPartsCount: number;
|
|
155
|
+
alternativePartsCount: number;
|
|
156
|
+
};
|
|
157
|
+
duplicateType: DUPLICATE_DATA_AREA[];
|
|
158
|
+
highlights: PartHighlights | null;
|
|
159
|
+
constructor(init?: Partial<Part>);
|
|
160
|
+
updatePart(update?: Partial<Part>): void;
|
|
161
|
+
/** @deprecated directly update name property instead */
|
|
162
|
+
updateName(name: i18nString): void;
|
|
163
|
+
/** @deprecated description is deprecated */
|
|
164
|
+
updateDescription(descriptionValue: i18nString): void;
|
|
165
|
+
static fromAPIResponse(partData: PartFromFindAPI | PartFromDataAPI, dataOrigin?: DATA_ORIGIN, language?: string): Part;
|
|
166
|
+
static fromRelatedPartsAPIResponse(data: RelatedPartFromDataAPI): Part;
|
|
167
|
+
private static getDuplicateType;
|
|
168
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Part=exports.DATA_ORIGIN=exports.DUPLICATE_DATA_AREA=exports.SUBSTITUTE_ROLE=exports.RELATION_TYPE=exports.PartMountingLocation=void 0;var RELATION_TYPE,SUBSTITUTE_ROLE,DUPLICATE_DATA_AREA,DATA_ORIGIN,core_1=require("../../core"),attribute_1=require("./attribute"),image_1=require("./image"),mounting_location_1=require("./mounting-location"),part_enrichment_data_1=require("./part-enrichment-data"),mounting_location_2=require("./mounting-location");Object.defineProperty(exports,"PartMountingLocation",{enumerable:!0,get:function(){return mounting_location_2.PartMountingLocation}}),function(t){t.DUPLICATE="duplicate",t.SUBSTITUTE="substitute",t.EQUIVALENT="equivalent",t.NOT_RELATED="not_related"}(RELATION_TYPE||(exports.RELATION_TYPE=RELATION_TYPE={})),function(t){t.SUCCESSOR="successor",t.PREDECESSOR="predecessor"}(SUBSTITUTE_ROLE||(exports.SUBSTITUTE_ROLE=SUBSTITUTE_ROLE={})),function(t){t.IMAGE="IMAGE",t.NAME="NAME",t.DATA="DATA"}(DUPLICATE_DATA_AREA||(exports.DUPLICATE_DATA_AREA=DUPLICATE_DATA_AREA={})),function(t){t[t.SEARCH_RESULT=0]="SEARCH_RESULT",t[t.PARTIAL=0]="PARTIAL",t[t.SERVER=2]="SERVER",t[t.DATA_API=2]="DATA_API",t[t.FIND_API=3]="FIND_API"}(DATA_ORIGIN||(exports.DATA_ORIGIN=DATA_ORIGIN={}));var Part=function(t){function e(e){var n=t.call(this)||this;return Object.assign(n,e),n}return __extends(e,t),e.prototype.updatePart=function(t){Object.assign(this,t)},e.prototype.updateName=function(t){this.name=t},e.prototype.updateDescription=function(t){this.description=t},e.fromAPIResponse=function(t,n,r){var a;if(void 0===n&&(n=DATA_ORIGIN.DATA_API),n===DATA_ORIGIN.FIND_API){var i=(u=t).mountingLocationsCount,o=u.nameLanguage||r,A=u.attributes;return new e(__assign(__assign(__assign(__assign({partiumId:u.partiumId,externalId:u.id,name:new core_1.i18nString((a={},a[o]=u.name,a)),images:u.images?u.images.map((function(t){return image_1.Image.fromAPIResponse(t,core_1.BACKEND_SERVICE.FIND)})):[],dataOrigin:DATA_ORIGIN.FIND_API},A&&{attributes:u.attributes.map((function(t){return attribute_1.Attribute.fromAPIResponse(t,n)}))}),{mountingLocationsCount:i||null,mountingLocations:null}),u.duplicateType&&{duplicateType:this.getDuplicateType(u.duplicateType)}),{highlights:u.highlights?u.highlights:null,relatedPartsSummary:u.relatedPartsSummary?u.relatedPartsSummary:null}))}var u,_=(u=t).organization,s=(A=u.attributes,u.mounting_locations);return new e(__assign(__assign(__assign({partiumId:u.uuid,externalId:u.external_id,externalPayload:u.metadata,name:new core_1.i18nString(u.name),images:u.images?u.images.filter((function(t){return"display"===t.type})).map((function(t){return image_1.Image.fromAPIResponse(t,core_1.BACKEND_SERVICE.DATA)})):[],dataOrigin:DATA_ORIGIN.DATA_API},_&&{organization:new core_1.Organization({partiumId:_.uuid,name:_.name,displayName:_.name})}),A&&{attributes:u.attributes.map((function(t){return attribute_1.Attribute.fromAPIResponse(t,n)}))}),{mountingLocationsCount:u.total_mounting_locations_count||0,mountingLocations:(null==s?void 0:s.map((function(t){return mounting_location_1.PartMountingLocation.fromAPIResponse(t)})))||[],summary:u.summary?{summaryId:u.summary.summary_id,summary:u.summary.summary.map((function(t){return{key:new core_1.i18nString(t.key),values:t.values.map((function(t){return new core_1.i18nString(t)}))}}))}:null,enrichment:u.enrichment?part_enrichment_data_1.PartEnrichmentData.fromAPIResponse(u.enrichment):null,highlights:null}))},e.fromRelatedPartsAPIResponse=function(t){var n=e.fromAPIResponse(null==t?void 0:t.part,DATA_ORIGIN.DATA_API);return n.relationType=t.type,t.created&&(n.relationCreatedAt=new Date(t.created)),"anchor_part"===t.part_role?n.partRole=SUBSTITUTE_ROLE.PREDECESSOR:"related_part"===t.part_role&&(n.partRole=SUBSTITUTE_ROLE.SUCCESSOR),n},e.getDuplicateType=function(t){switch(t){case"IMAGE_NAME_AND_DATA":return[DUPLICATE_DATA_AREA.IMAGE,DUPLICATE_DATA_AREA.NAME,DUPLICATE_DATA_AREA.DATA];case"NAME_AND_DATA":return[DUPLICATE_DATA_AREA.NAME,DUPLICATE_DATA_AREA.DATA];case"IMAGE":return[DUPLICATE_DATA_AREA.IMAGE]}},e}(core_1.APIObject);exports.Part=Part;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { APIObject } from '../../core/models/api-object';
|
|
3
|
+
import { PartWithNullable } from '../../user-data/models/part-with-nullable';
|
|
4
|
+
export declare enum SHOPPING_CART_STATUS {
|
|
5
|
+
OFFER_REQUESTED = "offer_requested",
|
|
6
|
+
OPEN = "open"
|
|
7
|
+
}
|
|
8
|
+
export interface IShoppingCartDto {
|
|
9
|
+
organization_id: string;
|
|
10
|
+
parts: Array<IShoppingPartDto>;
|
|
11
|
+
}
|
|
12
|
+
export interface IShoppingItemDto {
|
|
13
|
+
item_id: string;
|
|
14
|
+
quantity: number;
|
|
15
|
+
bom_context?: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface IShoppingPartDto extends IShoppingItemDto {
|
|
18
|
+
}
|
|
19
|
+
export interface IShoppingCartEcrDto extends IShoppingItemDto {
|
|
20
|
+
isECR?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface IShoppingPart extends PartWithNullable {
|
|
23
|
+
created?: Date;
|
|
24
|
+
quantity?: number;
|
|
25
|
+
bomContext?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface IShoppingOffer {
|
|
28
|
+
timestamp: Date | string;
|
|
29
|
+
status: SHOPPING_CART_STATUS;
|
|
30
|
+
}
|
|
31
|
+
export declare class ShoppingCart extends APIObject {
|
|
32
|
+
created: Date | string;
|
|
33
|
+
statusTimestamp: Date | string;
|
|
34
|
+
organizationId: string;
|
|
35
|
+
organizationName: string;
|
|
36
|
+
owner: string;
|
|
37
|
+
status: SHOPPING_CART_STATUS;
|
|
38
|
+
userId: string;
|
|
39
|
+
partiumId: string;
|
|
40
|
+
constructor(init?: Partial<ShoppingCart>);
|
|
41
|
+
static fromAPIResponse(cart: ShoppingCart): ShoppingCart;
|
|
42
|
+
static fromPartAPIResponse(part: IShoppingPart): IShoppingPart;
|
|
43
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,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=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShoppingCart=exports.SHOPPING_CART_STATUS=void 0;var SHOPPING_CART_STATUS,api_object_1=require("../../core/models/api-object");!function(t){t.OFFER_REQUESTED="offer_requested",t.OPEN="open"}(SHOPPING_CART_STATUS||(exports.SHOPPING_CART_STATUS=SHOPPING_CART_STATUS={}));var ShoppingCart=function(t){function e(e){var r=t.call(this)||this;return Object.assign(r,e),r}return __extends(e,t),e.fromAPIResponse=function(t){var r=t.status_timestamp,o=t.organization_id,n=t.organization_name,i=t.user_id,a=t.uuid;return new e({created:t.created,statusTimestamp:r,organizationId:o,organizationName:n,owner:t.owner,status:t.status,userId:i,partiumId:a})},e.fromPartAPIResponse=function(t){return{partiumId:t.item_id,quantity:t.quantity,created:t.created,bomContext:t.bom_context}},e}(api_object_1.APIObject);exports.ShoppingCart=ShoppingCart;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { BaseService, ServiceProvider } from '../../core';
|
|
4
|
+
import { Announcement, AnnouncementRecipient } from '../models/announcement';
|
|
5
|
+
export interface AnnouncementService {
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the current announcements.
|
|
8
|
+
* @returns An Observable that emits an array of Announcement objects.
|
|
9
|
+
*/
|
|
10
|
+
getAnnouncement(): Observable<Announcement[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Publishes a new announcement.
|
|
13
|
+
* @returns An Observable that emits the published Announcement.
|
|
14
|
+
*/
|
|
15
|
+
publish(): Observable<Announcement>;
|
|
16
|
+
/**
|
|
17
|
+
* Updates the current draft announcement with the provided details.
|
|
18
|
+
*
|
|
19
|
+
* @param title - The new title of the announcement.
|
|
20
|
+
* @param contents - The new contents of the announcement.
|
|
21
|
+
* @param terminatesAt - An optional parameter representing the termination date of the announcement.
|
|
22
|
+
* @param recipients - An optional array of recipients for the announcement.
|
|
23
|
+
* @param includeSubOrgs - An optional boolean indicating whether to include sub-organizations.
|
|
24
|
+
* @param sendEmails - An optional boolean indicating whether to send emails to recipients.
|
|
25
|
+
*
|
|
26
|
+
* @returns An Observable that emits the updated Announcement.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* This function sends a PUT request to the backend service to update the draft announcement.
|
|
30
|
+
* If the `terminatesAt`, `recipients`, `includeSubOrgs`, or `sendEmails` parameters are not provided,
|
|
31
|
+
* the corresponding fields in the announcement will not be updated.
|
|
32
|
+
*/
|
|
33
|
+
updateDraft(title: string, contents: string, terminatesAt?: string, recipients?: string[], includeSubOrgs?: boolean, sendEmails?: boolean): Observable<Announcement>;
|
|
34
|
+
/**
|
|
35
|
+
* Unpublishes the current announcement.
|
|
36
|
+
* @returns An Observable that emits the unpublished Announcement.
|
|
37
|
+
*/
|
|
38
|
+
unpublish(): Observable<Announcement>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the current draft announcement.
|
|
41
|
+
* @returns An Observable that emits the draft Announcement.
|
|
42
|
+
*/
|
|
43
|
+
getDraft(): Observable<Announcement>;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves all recipients of announcements.
|
|
46
|
+
*
|
|
47
|
+
* @param pageSize - The number of recipients to retrieve per page. Defaults to 3 if not specified.
|
|
48
|
+
* @returns An Observable that emits an array of AnnouncementRecipient objects.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* This method uses cursor-based pagination to retrieve all recipients. It sends a GET request to the backend service
|
|
52
|
+
* and handles pagination by making subsequent requests with the cursor until all recipients are retrieved.
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
getRecipients(pageSize?: number): Observable<AnnouncementRecipient[]>;
|
|
56
|
+
}
|
|
57
|
+
export declare class AnnouncementServiceImpl extends BaseService implements AnnouncementService {
|
|
58
|
+
private httpsService;
|
|
59
|
+
private PAGINATION_PAGE_SIZE;
|
|
60
|
+
constructor(serviceProvider: ServiceProvider);
|
|
61
|
+
onCreate(): void;
|
|
62
|
+
publish(): Observable<Announcement>;
|
|
63
|
+
unpublish(): Observable<Announcement>;
|
|
64
|
+
getRecipients(pageSize: number): Observable<AnnouncementRecipient[]>;
|
|
65
|
+
getDraft(): Observable<Announcement>;
|
|
66
|
+
updateDraft(title: string, contents: string, terminatesAt?: string, recipients?: string[], includeSubOrgs?: boolean, sendEmails?: boolean): Observable<Announcement>;
|
|
67
|
+
getAnnouncement(): Observable<Announcement[]>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},e(n,t)};return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}(),__decorate=this&&this.__decorate||function(e,n,t,r){var o,c=arguments.length,i=c<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,n,t,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(i=(c<3?o(i):c>3?o(n,t,i):o(n,t))||i);return c>3&&i&&Object.defineProperty(n,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnnouncementServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),announcement_1=require("../models/announcement"),AnnouncementServiceImpl=function(e){function n(n){var t=e.call(this,n)||this;return t.PAGINATION_PAGE_SIZE=500,t}return __extends(n,e),n.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},n.prototype.publish=function(){return this.httpsService.post("announcements/publish",{},[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(e){return announcement_1.Announcement.fromAPIResponse(e)})))},n.prototype.unpublish=function(){return this.httpsService.post("announcements/unpublish",{},[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(e){return announcement_1.Announcement.fromAPIResponse(e)})))},n.prototype.getRecipients=function(e){var n=this,t="announcements/recipients";return this.httpsService.get(t,[{page_size:e}],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.expand)((function(r){var o=!(!r.pagination||!r.pagination.next),c=r.pagination.next&&r.pagination.next.split("?"),i=c&&new URLSearchParams(c[1]).get("cursor");return o&&i?n.httpsService.get(t,[{paginator:"cursor",page_size:e||n.PAGINATION_PAGE_SIZE,cursor:i}],core_1.BACKEND_SERVICE.DATA):rxjs_1.EMPTY})),(0,rxjs_1.reduce)((function(e,n){return e.concat(n.results)}),[]),(0,rxjs_1.takeWhile)((function(e){return null!==e}),!0),(0,rxjs_1.map)((function(e){return(e||[]).map((function(e){return announcement_1.AnnouncementRecipient.fromAPIResponse(e)}))})))},n.prototype.getDraft=function(){return this.httpsService.get("announcements/draft",[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(e){return announcement_1.Announcement.fromAPIResponse(e)})))},n.prototype.updateDraft=function(e,n,t,r,o,c){return void 0===r&&(r=[]),void 0===o&&(o=!1),void 0===c&&(c=!1),this.httpsService.put("announcements/draft",{title:e,contents:n,terminatesAt:t,recipients:r,includeSubOrgs:o,sendEmails:c},[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(e){return announcement_1.Announcement.fromAPIResponse(e)})))},n.prototype.getAnnouncement=function(){return this.httpsService.get("announcements/inbox",[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(e){return e.map((function(e){return announcement_1.Announcement.fromAPIResponse(e)}))})))},n=__decorate([(0,core_1.InjectionIdentifier)("AnnouncementService")],n)}(core_1.BaseService);exports.AnnouncementServiceImpl=AnnouncementServiceImpl;
|