@partium/js-sdk 14.4.1 → 14.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/index.js +1 -21
- package/catalog/models/catalog-image-info.js +1 -22
- package/catalog/models/catalog-image.js +1 -40
- package/catalog/models/upsert-catalog-images-dto.js +1 -3
- package/catalog/models/upsert-images-result.js +1 -3
- package/catalog/services/images.service.js +1 -62
- package/core/constants/constants.d.ts +1 -0
- package/core/constants/constants.js +1 -16
- package/core/decorators/injection-identifier.js +1 -19
- package/core/factories/paginated-request-service.factory.js +1 -33
- package/core/index.js +1 -63
- package/core/integration-defaults/http/fetch-api-http-error-helper.js +1 -129
- package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +1 -138
- package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +1 -210
- package/core/integration-defaults/http/handle-axios-error-helper.js +1 -79
- package/core/integration-defaults/http/https-client/axios-https-client.service.js +1 -182
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +1 -198
- package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +1 -32
- package/core/integration-defaults/js-p-file.js +1 -36
- package/core/integration-defaults/session/js-oauth-api-key-session.service.js +1 -206
- package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +1 -64
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +1 -257
- package/core/integration-defaults/web-device-status.service.js +1 -125
- package/core/integration-defaults/web-file.service.js +1 -135
- package/core/integration-defaults/web-indexeddb.service.js +1 -142
- package/core/integration-defaults/web-local-storage.service.js +1 -310
- package/core/models/api-object.js +1 -16
- package/core/models/auth-config.js +1 -72
- package/core/models/device-info.js +1 -34
- package/core/models/error.js +1 -107
- package/core/models/formatted-string.js +1 -14
- package/core/models/i18n-map.js +1 -61
- package/core/models/i18n-string.js +1 -35
- package/core/models/log.js +1 -137
- package/core/models/organization.js +1 -159
- package/core/models/p-file.js +1 -23
- package/core/models/paginated-list.js +1 -41
- package/core/models/partium-config.js +1 -43
- package/core/models/user-token.js +1 -11
- package/core/models/user.js +1 -89
- package/core/services/backend-status.service.js +1 -147
- package/core/services/base-login-init.service.js +1 -57
- package/core/services/base.service.js +1 -37
- package/core/services/device-status.service.interface.js +1 -117
- package/core/services/file.service.interface.js +1 -61
- package/core/services/http/file-transfer/file-transfer.service.interface.js +1 -125
- package/core/services/http/https-client/https-client.service.interface.js +1 -152
- package/core/services/http/https.service.interface.d.ts +3 -1
- package/core/services/http/https.service.interface.js +1 -294
- package/core/services/http/oauth-https.service.js +1 -218
- package/core/services/local-storage.service.interface.js +1 -378
- package/core/services/log.service.js +1 -139
- package/core/services/organization.service.js +1 -202
- package/core/services/paginated-request.service.js +1 -154
- package/core/services/recent-parts.service.js +1 -194
- package/core/services/service-provider.js +1 -114
- package/core/services/session/oauth-session.service.js +1 -104
- package/core/services/session/session.service.interface.js +1 -367
- package/core/utils/general-helper.js +1 -110
- package/data/index.js +1 -44
- package/data/models/announcement.js +1 -70
- package/data/models/assembly-hierarchy-node-breadcrumb.js +1 -51
- package/data/models/assembly-hierarchy-node.js +1 -46
- package/data/models/attribute.js +1 -106
- package/data/models/csa-request-search.js +1 -46
- package/data/models/csa-request-status.js +1 -51
- package/data/models/csa-request.js +1 -112
- package/data/models/document.js +1 -17
- package/data/models/filter-key.js +1 -36
- package/data/models/filter-option-value.js +1 -41
- package/data/models/image.js +1 -77
- package/data/models/inquiry.js +1 -71
- package/data/models/mounting-location.js +1 -58
- package/data/models/multiple-expert-searches.js +1 -40
- package/data/models/part-enrichment-data.js +1 -50
- package/data/models/part.d.ts +1 -1
- package/data/models/part.js +1 -168
- package/data/models/shopping-cart.js +1 -60
- package/data/services/announcement.service.js +1 -89
- package/data/services/assembly-hierarchy-nodes.service.js +1 -193
- package/data/services/csa-helper.service.js +1 -158
- package/data/services/customer-service-assistance.service.js +1 -276
- package/data/services/filter.service.js +1 -97
- package/data/services/inquiry.service.js +1 -68
- package/data/services/part-attribute.service.js +1 -118
- package/data/services/part-enrichment.service.js +1 -56
- package/data/services/part.service.js +1 -182
- package/data/services/related-parts.service.js +1 -83
- package/data/services/shopping-cart.service.js +1 -152
- package/datacuration/index.d.ts +4 -0
- package/datacuration/index.js +2 -0
- package/datacuration/models/image-submission-request.d.ts +55 -0
- package/datacuration/models/image-submission-request.js +2 -0
- package/datacuration/models/submitted-image-response.d.ts +27 -0
- package/datacuration/models/submitted-image-response.js +2 -0
- package/datacuration/services/image-submission.service.d.ts +26 -0
- package/datacuration/services/image-submission.service.js +2 -0
- package/find/index.js +1 -51
- package/find/models/assets/asset.js +1 -32
- package/find/models/search-filter.js +1 -205
- package/find/models/search-input.js +1 -3
- package/find/models/search-output.js +1 -3
- package/find/models/search-result-status.js +1 -40
- package/find/models/search-session-log-object.js +1 -22
- package/find/models/search-status/cv-search-status.js +1 -22
- package/find/models/search-status/search-filter-status.js +1 -36
- package/find/models/search-status/search-status.js +1 -56
- package/find/models/search-status/tag-search-status.js +1 -23
- package/find/models/search-status/text-search-status.js +1 -18
- package/find/models/search-tag.js +1 -16
- package/find/models/smart-filter.js +1 -49
- package/find/models/tagable/i18n-tagable.js +1 -37
- package/find/models/tagable/tagable-base.js +1 -22
- package/find/models/tagable/tagable.js +1 -37
- package/find/models/text-search-config.js +1 -70
- package/find/models/text-search-manipulator.js +1 -90
- package/find/models/text-search-result-item/text-search-error.js +1 -12
- package/find/models/text-search-result-item/text-search-result-item-document.js +1 -34
- package/find/models/text-search-result-item/text-search-result-item-part.js +1 -36
- package/find/models/text-search-result-item/text-search-result-item-recent-query.js +1 -35
- package/find/models/text-search-result-item/text-search-result-item-unknown.js +1 -38
- package/find/models/text-search-result-item/text-search-result-item.js +1 -22
- package/find/services/asset.service.js +1 -348
- package/find/services/filter-uploaders/filter-uploader.js +1 -3
- package/find/services/filter-uploaders/update-filters-uploader.js +1 -77
- package/find/services/filter-uploaders/update-filters.model.js +1 -7
- package/find/services/search/cv-search.service.js +1 -214
- package/find/services/search/recent-text-search-queries.service.js +1 -260
- package/find/services/search/search-result.service.js +1 -539
- package/find/services/search/search.service.js +1 -514
- package/find/services/search/tag-search.service.js +1 -124
- package/find/services/search/text-search.service.js +1 -316
- package/find/services/search-filter.service.js +1 -292
- package/find/utils/search-helper.js +1 -75
- package/gen/sdk-version.d.ts +1 -1
- package/gen/sdk-version.js +1 -5
- package/index.d.ts +2 -0
- package/index.js +1 -392
- package/management/index.js +1 -21
- package/management/models/api-key-list-response.js +1 -3
- package/management/models/api-key-type.js +1 -9
- package/management/models/api-key.js +1 -3
- package/management/services/api-key.service.js +1 -53
- package/ocr/index.js +1 -20
- package/ocr/models/detect-response.js +1 -3
- package/ocr/models/detected-text-entry.js +1 -3
- package/ocr/services/ocr.service.js +1 -59
- package/package.json +1 -1
- package/user-data/index.js +1 -21
- package/user-data/models/part-with-nullable.js +1 -3
- package/user-data/models/request-list/request-list.js +1 -63
- package/user-data/services/favorite/favorite.service.js +1 -108
- package/user-data/services/request-list/request-list.service.js +1 -133
package/data/models/inquiry.js
CHANGED
|
@@ -1,72 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Inquiry = exports.InquiryStatusResponse = exports.INQUIRY_STATUS = void 0;
|
|
20
|
-
var core_1 = require("../../core");
|
|
21
|
-
var INQUIRY_STATUS;
|
|
22
|
-
(function (INQUIRY_STATUS) {
|
|
23
|
-
INQUIRY_STATUS["NEW"] = "new";
|
|
24
|
-
INQUIRY_STATUS["IN_PROGRESS"] = "in_progress";
|
|
25
|
-
INQUIRY_STATUS["PENDING_RESPONSE"] = "pending_response";
|
|
26
|
-
INQUIRY_STATUS["SENT_TO_SALES"] = "sent_to_sales";
|
|
27
|
-
INQUIRY_STATUS["CANCELED"] = "canceled";
|
|
28
|
-
})(INQUIRY_STATUS || (exports.INQUIRY_STATUS = INQUIRY_STATUS = {}));
|
|
29
|
-
var InquiryStatusResponse = /** @class */ (function (_super) {
|
|
30
|
-
__extends(InquiryStatusResponse, _super);
|
|
31
|
-
function InquiryStatusResponse(init) {
|
|
32
|
-
var _this = _super.call(this) || this;
|
|
33
|
-
Object.assign(_this, init);
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
InquiryStatusResponse.fromAPIResponse = function (requestData) {
|
|
37
|
-
return new InquiryStatusResponse({
|
|
38
|
-
status: requestData['status'],
|
|
39
|
-
timestamp: requestData['timestamp'],
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
return InquiryStatusResponse;
|
|
43
|
-
}(core_1.APIObject));
|
|
44
|
-
exports.InquiryStatusResponse = InquiryStatusResponse;
|
|
45
|
-
var Inquiry = /** @class */ (function (_super) {
|
|
46
|
-
__extends(Inquiry, _super);
|
|
47
|
-
function Inquiry(init) {
|
|
48
|
-
var _this = _super.call(this) || this;
|
|
49
|
-
Object.assign(_this, init);
|
|
50
|
-
return _this;
|
|
51
|
-
}
|
|
52
|
-
Inquiry.fromAPIResponse = function (requestData) {
|
|
53
|
-
return new Inquiry({
|
|
54
|
-
inquiryId: requestData['inquiry_id'],
|
|
55
|
-
contact: requestData['contact'],
|
|
56
|
-
organizationName: requestData['organization_name'],
|
|
57
|
-
created: requestData['created'],
|
|
58
|
-
updated: requestData['updated'],
|
|
59
|
-
cart: requestData['cart'],
|
|
60
|
-
offerRequested: requestData['offer_requested'],
|
|
61
|
-
offerRequestDate: requestData['offer_request_date'],
|
|
62
|
-
status: requestData['status'],
|
|
63
|
-
languageUi: requestData['language_ui'],
|
|
64
|
-
ecrsCompleted: requestData['ecrs_completed'],
|
|
65
|
-
ecrsTotal: requestData['ecrs_total'],
|
|
66
|
-
statusTimestamp: requestData['status_timestamp'],
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
return Inquiry;
|
|
70
|
-
}(core_1.APIObject));
|
|
71
|
-
exports.Inquiry = Inquiry;
|
|
72
|
-
//# sourceMappingURL=inquiry.js.map
|
|
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;
|
|
@@ -1,59 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PartMountingLocation = exports.PartMountingLocationInfo = void 0;
|
|
20
|
-
var core_1 = require("../../core");
|
|
21
|
-
var PartMountingLocationInfo = /** @class */ (function (_super) {
|
|
22
|
-
__extends(PartMountingLocationInfo, _super);
|
|
23
|
-
function PartMountingLocationInfo(init) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
Object.assign(_this, init);
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
PartMountingLocationInfo.fromAPIResponse = function (data) {
|
|
29
|
-
var _a;
|
|
30
|
-
return new PartMountingLocationInfo({
|
|
31
|
-
totalCount: data.total_count,
|
|
32
|
-
mountingLocations: ((_a = data.mounting_locations) === null || _a === void 0 ? void 0 : _a.map(function (item) { return PartMountingLocation.fromAPIResponse(item); })) || [],
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
return PartMountingLocationInfo;
|
|
36
|
-
}(core_1.APIObject));
|
|
37
|
-
exports.PartMountingLocationInfo = PartMountingLocationInfo;
|
|
38
|
-
var PartMountingLocation = /** @class */ (function (_super) {
|
|
39
|
-
__extends(PartMountingLocation, _super);
|
|
40
|
-
function PartMountingLocation(init) {
|
|
41
|
-
var _this = _super.call(this) || this;
|
|
42
|
-
Object.assign(_this, init);
|
|
43
|
-
return _this;
|
|
44
|
-
}
|
|
45
|
-
PartMountingLocation.fromAPIResponse = function (data) {
|
|
46
|
-
var _a;
|
|
47
|
-
return new PartMountingLocation({
|
|
48
|
-
uuid: data.uuid,
|
|
49
|
-
partiumId: data.uuid,
|
|
50
|
-
externalId: data.external_id,
|
|
51
|
-
name: new core_1.i18nString(data.name),
|
|
52
|
-
quantity: data.quantity,
|
|
53
|
-
children: ((_a = data.children) === null || _a === void 0 ? void 0 : _a.map(function (item) { return PartMountingLocation.fromAPIResponse(item); })) || [],
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
return PartMountingLocation;
|
|
57
|
-
}(core_1.APIObject));
|
|
58
|
-
exports.PartMountingLocation = PartMountingLocation;
|
|
59
|
-
//# sourceMappingURL=mounting-location.js.map
|
|
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;
|
|
@@ -1,41 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.MultipleExpertSearches = void 0;
|
|
20
|
-
var api_object_1 = require("../../core/models/api-object");
|
|
21
|
-
var csa_request_search_1 = require("./csa-request-search");
|
|
22
|
-
var MultipleExpertSearches = /** @class */ (function (_super) {
|
|
23
|
-
__extends(MultipleExpertSearches, _super);
|
|
24
|
-
function MultipleExpertSearches(init) {
|
|
25
|
-
var _this = _super.call(this) || this;
|
|
26
|
-
Object.assign(_this, init);
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
MultipleExpertSearches.fromAPIResponse = function (requestData) {
|
|
30
|
-
var camelCaseSearches = requestData['searches'].map(function (search) {
|
|
31
|
-
return csa_request_search_1.CSARequestSearch.fromAPIResponse(search);
|
|
32
|
-
});
|
|
33
|
-
return new MultipleExpertSearches({
|
|
34
|
-
searchLimitReached: requestData['search_limit_reached'],
|
|
35
|
-
searches: camelCaseSearches,
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
return MultipleExpertSearches;
|
|
39
|
-
}(api_object_1.APIObject));
|
|
40
|
-
exports.MultipleExpertSearches = MultipleExpertSearches;
|
|
41
|
-
//# sourceMappingURL=multiple-expert-searches.js.map
|
|
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;
|
|
@@ -1,51 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PartEnrichmentData = exports.PART_ENRICHMENT_STATUS = void 0;
|
|
20
|
-
var core_1 = require("../../core");
|
|
21
|
-
var PART_ENRICHMENT_STATUS;
|
|
22
|
-
(function (PART_ENRICHMENT_STATUS) {
|
|
23
|
-
PART_ENRICHMENT_STATUS["ENRICHMENT_NOT_REQUESTED"] = "ENRICHMENT_NOT_REQUESTED";
|
|
24
|
-
PART_ENRICHMENT_STATUS["ENRICHMENT_IN_PROGRESS"] = "ENRICHMENT_IN_PROGRESS";
|
|
25
|
-
PART_ENRICHMENT_STATUS["ENRICHMENT_FINISHED"] = "ENRICHMENT_FINISHED";
|
|
26
|
-
PART_ENRICHMENT_STATUS["ENRICHMENT_ERROR"] = "ENRICHMENT_ERROR";
|
|
27
|
-
PART_ENRICHMENT_STATUS["ENRICHMENT_IMPORTED"] = "ENRICHMENT_IMPORTED";
|
|
28
|
-
})(PART_ENRICHMENT_STATUS || (exports.PART_ENRICHMENT_STATUS = PART_ENRICHMENT_STATUS = {}));
|
|
29
|
-
var PartEnrichmentData = /** @class */ (function (_super) {
|
|
30
|
-
__extends(PartEnrichmentData, _super);
|
|
31
|
-
function PartEnrichmentData(init) {
|
|
32
|
-
var _this = _super.call(this) || this;
|
|
33
|
-
Object.assign(_this, init);
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
PartEnrichmentData.fromAPIResponse = function (data) {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
return new PartEnrichmentData({
|
|
39
|
-
status: data.status,
|
|
40
|
-
summary: (_b = (_a = data.summary) === null || _a === void 0 ? void 0 : _a.map(function (item) { return ({
|
|
41
|
-
key: new core_1.i18nString(item.key),
|
|
42
|
-
values: item.values.map(function (value) { return new core_1.i18nString(value); }),
|
|
43
|
-
}); })) !== null && _b !== void 0 ? _b : [],
|
|
44
|
-
upis: data.UPIs,
|
|
45
|
-
lastErrorTimestamp: new Date(data.last_error_timestamp),
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
return PartEnrichmentData;
|
|
49
|
-
}(core_1.APIObject));
|
|
50
|
-
exports.PartEnrichmentData = PartEnrichmentData;
|
|
51
|
-
//# sourceMappingURL=part-enrichment-data.js.map
|
|
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;
|
package/data/models/part.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Image, ImageFromDataAPI, ImageFromFindAPI } from './image';
|
|
|
5
5
|
import { PartMountingLocation, PartMountingLocationFromDataAPI } from './mounting-location';
|
|
6
6
|
import { PART_ENRICHMENT_STATUS, PartEnrichmentData } from './part-enrichment-data';
|
|
7
7
|
/** @deprecated directly use export from mounting-location instead */
|
|
8
|
-
export { PartMountingLocationFromDataAPI } from './mounting-location';
|
|
8
|
+
export type { PartMountingLocationFromDataAPI } from './mounting-location';
|
|
9
9
|
/** @deprecated directly use export from mounting-location instead */
|
|
10
10
|
export { PartMountingLocation } from './mounting-location';
|
|
11
11
|
export declare enum RELATION_TYPE {
|
package/data/models/part.js
CHANGED
|
@@ -1,169 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
var __assign = (this && this.__assign) || function () {
|
|
19
|
-
__assign = Object.assign || function(t) {
|
|
20
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
-
s = arguments[i];
|
|
22
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
23
|
-
t[p] = s[p];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
return __assign.apply(this, arguments);
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.Part = exports.DATA_ORIGIN = exports.DUPLICATE_DATA_AREA = exports.SUBSTITUTE_ROLE = exports.RELATION_TYPE = exports.PartMountingLocation = void 0;
|
|
31
|
-
var core_1 = require("../../core");
|
|
32
|
-
var attribute_1 = require("./attribute");
|
|
33
|
-
var image_1 = require("./image");
|
|
34
|
-
var mounting_location_1 = require("./mounting-location");
|
|
35
|
-
var part_enrichment_data_1 = require("./part-enrichment-data");
|
|
36
|
-
/** @deprecated directly use export from mounting-location instead */
|
|
37
|
-
var mounting_location_2 = require("./mounting-location");
|
|
38
|
-
Object.defineProperty(exports, "PartMountingLocation", { enumerable: true, get: function () { return mounting_location_2.PartMountingLocation; } });
|
|
39
|
-
var RELATION_TYPE;
|
|
40
|
-
(function (RELATION_TYPE) {
|
|
41
|
-
RELATION_TYPE["DUPLICATE"] = "duplicate";
|
|
42
|
-
RELATION_TYPE["SUBSTITUTE"] = "substitute";
|
|
43
|
-
RELATION_TYPE["EQUIVALENT"] = "equivalent";
|
|
44
|
-
RELATION_TYPE["NOT_RELATED"] = "not_related";
|
|
45
|
-
})(RELATION_TYPE || (exports.RELATION_TYPE = RELATION_TYPE = {}));
|
|
46
|
-
var SUBSTITUTE_ROLE;
|
|
47
|
-
(function (SUBSTITUTE_ROLE) {
|
|
48
|
-
SUBSTITUTE_ROLE["SUCCESSOR"] = "successor";
|
|
49
|
-
SUBSTITUTE_ROLE["PREDECESSOR"] = "predecessor";
|
|
50
|
-
})(SUBSTITUTE_ROLE || (exports.SUBSTITUTE_ROLE = SUBSTITUTE_ROLE = {}));
|
|
51
|
-
var DUPLICATE_DATA_AREA;
|
|
52
|
-
(function (DUPLICATE_DATA_AREA) {
|
|
53
|
-
DUPLICATE_DATA_AREA["IMAGE"] = "IMAGE";
|
|
54
|
-
DUPLICATE_DATA_AREA["NAME"] = "NAME";
|
|
55
|
-
DUPLICATE_DATA_AREA["DATA"] = "DATA";
|
|
56
|
-
})(DUPLICATE_DATA_AREA || (exports.DUPLICATE_DATA_AREA = DUPLICATE_DATA_AREA = {}));
|
|
57
|
-
var DATA_ORIGIN;
|
|
58
|
-
(function (DATA_ORIGIN) {
|
|
59
|
-
/**
|
|
60
|
-
* @deprecated use PARTIAL instead
|
|
61
|
-
*/
|
|
62
|
-
DATA_ORIGIN[DATA_ORIGIN["SEARCH_RESULT"] = 0] = "SEARCH_RESULT";
|
|
63
|
-
/**
|
|
64
|
-
* @deprecated not relevant anymore with new FIND-API
|
|
65
|
-
*/
|
|
66
|
-
DATA_ORIGIN[DATA_ORIGIN["PARTIAL"] = 0] = "PARTIAL";
|
|
67
|
-
// so the part-dataset will be incomplete. (Same as the previously used
|
|
68
|
-
// DATA_ORIGIN.SEARCH_RESULT, but not limited to search-results)
|
|
69
|
-
/**
|
|
70
|
-
* @deprecated use DATA_API instead
|
|
71
|
-
*/
|
|
72
|
-
DATA_ORIGIN[DATA_ORIGIN["SERVER"] = 2] = "SERVER";
|
|
73
|
-
DATA_ORIGIN[DATA_ORIGIN["DATA_API"] = 2] = "DATA_API";
|
|
74
|
-
DATA_ORIGIN[DATA_ORIGIN["FIND_API"] = 3] = "FIND_API";
|
|
75
|
-
})(DATA_ORIGIN || (exports.DATA_ORIGIN = DATA_ORIGIN = {}));
|
|
76
|
-
var Part = /** @class */ (function (_super) {
|
|
77
|
-
__extends(Part, _super);
|
|
78
|
-
function Part(init) {
|
|
79
|
-
var _this = _super.call(this) || this;
|
|
80
|
-
Object.assign(_this, init);
|
|
81
|
-
return _this;
|
|
82
|
-
}
|
|
83
|
-
Part.prototype.updatePart = function (update) {
|
|
84
|
-
Object.assign(this, update);
|
|
85
|
-
};
|
|
86
|
-
/** @deprecated directly update name property instead */
|
|
87
|
-
Part.prototype.updateName = function (name) {
|
|
88
|
-
this.name = name;
|
|
89
|
-
};
|
|
90
|
-
/** @deprecated description is deprecated */
|
|
91
|
-
Part.prototype.updateDescription = function (descriptionValue) {
|
|
92
|
-
this.description = descriptionValue;
|
|
93
|
-
};
|
|
94
|
-
Part.fromAPIResponse = function (partData, dataOrigin, language) {
|
|
95
|
-
var _a;
|
|
96
|
-
if (dataOrigin === void 0) { dataOrigin = DATA_ORIGIN.DATA_API; }
|
|
97
|
-
if (dataOrigin === DATA_ORIGIN.FIND_API) {
|
|
98
|
-
var data = partData;
|
|
99
|
-
var mountingLocationsCount = data.mountingLocationsCount;
|
|
100
|
-
var partLanguage = data.nameLanguage || language;
|
|
101
|
-
var attributes = data.attributes;
|
|
102
|
-
return new Part(__assign(__assign(__assign(__assign({ partiumId: data.partiumId, externalId: data.id, name: new core_1.i18nString((_a = {}, _a[partLanguage] = data.name, _a)), images: data.images
|
|
103
|
-
? data.images.map(function (imgData) { return image_1.Image.fromFindAPIResponse(imgData, core_1.BACKEND_SERVICE.DATA); }) // part-images are always fetched from DATA-service
|
|
104
|
-
: [], dataOrigin: DATA_ORIGIN.FIND_API }, (attributes && {
|
|
105
|
-
attributes: data.attributes.map(function (attribute) { return attribute_1.Attribute.fromAPIResponse(attribute, dataOrigin); }),
|
|
106
|
-
})), { mountingLocationsCount: mountingLocationsCount ? mountingLocationsCount : null, mountingLocations: null }), (data.duplicateType && { duplicateType: this.getDuplicateType(data.duplicateType) })), { highlights: data.highlights ? data.highlights : null, relatedPartsSummary: data.relatedPartsSummary ? data.relatedPartsSummary : null }));
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
var data = partData;
|
|
110
|
-
var organization = data.organization;
|
|
111
|
-
var attributes = data.attributes;
|
|
112
|
-
var mountingLocations = data.mounting_locations;
|
|
113
|
-
return new Part(__assign(__assign(__assign({ partiumId: data.uuid, externalId: data.external_id, externalPayload: data.metadata, name: new core_1.i18nString(data.name), images: data.images
|
|
114
|
-
? // ? partData["images"].map( // previous code
|
|
115
|
-
// TODO This is related to https://partium.atlassian.net/browse/PPD-1624 We may want to revert this
|
|
116
|
-
// when the filtering is done in the server side.
|
|
117
|
-
data.images
|
|
118
|
-
.filter(function (img) { return img.type === 'display'; })
|
|
119
|
-
// remove until here
|
|
120
|
-
.map(function (imgData) { return image_1.Image.fromDataAPIResponse(imgData, core_1.BACKEND_SERVICE.DATA); })
|
|
121
|
-
: [], dataOrigin: DATA_ORIGIN.DATA_API }, (organization && {
|
|
122
|
-
organization: new core_1.Organization({
|
|
123
|
-
partiumId: organization.uuid,
|
|
124
|
-
name: organization.name,
|
|
125
|
-
displayName: organization.name,
|
|
126
|
-
}),
|
|
127
|
-
})), (attributes && {
|
|
128
|
-
attributes: data.attributes.map(function (attribute) { return attribute_1.Attribute.fromAPIResponse(attribute, dataOrigin); }),
|
|
129
|
-
})), { mountingLocationsCount: data.total_mounting_locations_count || 0, mountingLocations: (mountingLocations === null || mountingLocations === void 0 ? void 0 : mountingLocations.map(function (item) {
|
|
130
|
-
return mounting_location_1.PartMountingLocation.fromAPIResponse(item);
|
|
131
|
-
})) || [], summary: data.summary
|
|
132
|
-
? {
|
|
133
|
-
summaryId: data.summary.summary_id,
|
|
134
|
-
summary: data.summary.summary.map(function (item) { return ({
|
|
135
|
-
key: new core_1.i18nString(item.key),
|
|
136
|
-
values: item.values.map(function (value) { return new core_1.i18nString(value); }),
|
|
137
|
-
}); }),
|
|
138
|
-
}
|
|
139
|
-
: null, enrichment: data.enrichment ? part_enrichment_data_1.PartEnrichmentData.fromAPIResponse(data.enrichment) : null, highlights: null }));
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
Part.fromRelatedPartsAPIResponse = function (data) {
|
|
143
|
-
var part = Part.fromAPIResponse(data === null || data === void 0 ? void 0 : data.part, DATA_ORIGIN.DATA_API);
|
|
144
|
-
part.relationType = data.type;
|
|
145
|
-
if (data.created) {
|
|
146
|
-
part.relationCreatedAt = new Date(data.created);
|
|
147
|
-
}
|
|
148
|
-
if (data.part_role === 'anchor_part') {
|
|
149
|
-
part.partRole = SUBSTITUTE_ROLE.PREDECESSOR;
|
|
150
|
-
}
|
|
151
|
-
else if (data.part_role === 'related_part') {
|
|
152
|
-
part.partRole = SUBSTITUTE_ROLE.SUCCESSOR;
|
|
153
|
-
}
|
|
154
|
-
return part;
|
|
155
|
-
};
|
|
156
|
-
Part.getDuplicateType = function (duplicateDataFromApi) {
|
|
157
|
-
switch (duplicateDataFromApi) {
|
|
158
|
-
case 'IMAGE_NAME_AND_DATA':
|
|
159
|
-
return [DUPLICATE_DATA_AREA.IMAGE, DUPLICATE_DATA_AREA.NAME, DUPLICATE_DATA_AREA.DATA];
|
|
160
|
-
case 'NAME_AND_DATA':
|
|
161
|
-
return [DUPLICATE_DATA_AREA.NAME, DUPLICATE_DATA_AREA.DATA];
|
|
162
|
-
case 'IMAGE':
|
|
163
|
-
return [DUPLICATE_DATA_AREA.IMAGE];
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
return Part;
|
|
167
|
-
}(core_1.APIObject));
|
|
168
|
-
exports.Part = Part;
|
|
169
|
-
//# sourceMappingURL=part.js.map
|
|
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.fromFindAPIResponse(t,core_1.BACKEND_SERVICE.DATA)})):[],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.fromDataAPIResponse(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;
|
|
@@ -1,61 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ShoppingCart = exports.SHOPPING_CART_STATUS = void 0;
|
|
20
|
-
var api_object_1 = require("../../core/models/api-object");
|
|
21
|
-
var SHOPPING_CART_STATUS;
|
|
22
|
-
(function (SHOPPING_CART_STATUS) {
|
|
23
|
-
SHOPPING_CART_STATUS["OFFER_REQUESTED"] = "offer_requested";
|
|
24
|
-
SHOPPING_CART_STATUS["OPEN"] = "open";
|
|
25
|
-
})(SHOPPING_CART_STATUS || (exports.SHOPPING_CART_STATUS = SHOPPING_CART_STATUS = {}));
|
|
26
|
-
var ShoppingCart = /** @class */ (function (_super) {
|
|
27
|
-
__extends(ShoppingCart, _super);
|
|
28
|
-
function ShoppingCart(init) {
|
|
29
|
-
var _this = _super.call(this) || this;
|
|
30
|
-
Object.assign(_this, init);
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
ShoppingCart.fromAPIResponse = function (cart) {
|
|
34
|
-
var statusTimestamp = cart['status_timestamp'];
|
|
35
|
-
var organizationId = cart['organization_id'];
|
|
36
|
-
var organizationName = cart['organization_name'];
|
|
37
|
-
var userId = cart['user_id'];
|
|
38
|
-
var partiumId = cart['uuid'];
|
|
39
|
-
return new ShoppingCart({
|
|
40
|
-
created: cart.created,
|
|
41
|
-
statusTimestamp: statusTimestamp,
|
|
42
|
-
organizationId: organizationId,
|
|
43
|
-
organizationName: organizationName,
|
|
44
|
-
owner: cart.owner,
|
|
45
|
-
status: cart.status,
|
|
46
|
-
userId: userId,
|
|
47
|
-
partiumId: partiumId,
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
ShoppingCart.fromPartAPIResponse = function (part) {
|
|
51
|
-
return {
|
|
52
|
-
partiumId: part['item_id'],
|
|
53
|
-
quantity: part['quantity'],
|
|
54
|
-
created: part['created'],
|
|
55
|
-
bomContext: part['bom_context'],
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
return ShoppingCart;
|
|
59
|
-
}(api_object_1.APIObject));
|
|
60
|
-
exports.ShoppingCart = ShoppingCart;
|
|
61
|
-
//# sourceMappingURL=shopping-cart.js.map
|
|
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;
|
|
@@ -1,90 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
3
|
-
var __extends = (this && this.__extends) || (function () {
|
|
4
|
-
var extendStatics = function (d, b) {
|
|
5
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
-
return extendStatics(d, b);
|
|
9
|
-
};
|
|
10
|
-
return function (d, b) {
|
|
11
|
-
if (typeof b !== "function" && b !== null)
|
|
12
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
-
extendStatics(d, b);
|
|
14
|
-
function __() { this.constructor = d; }
|
|
15
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.AnnouncementServiceImpl = void 0;
|
|
26
|
-
var rxjs_1 = require("rxjs");
|
|
27
|
-
var core_1 = require("../../core");
|
|
28
|
-
var announcement_1 = require("../models/announcement");
|
|
29
|
-
var AnnouncementServiceImpl = /** @class */ (function (_super) {
|
|
30
|
-
__extends(AnnouncementServiceImpl, _super);
|
|
31
|
-
function AnnouncementServiceImpl(serviceProvider) {
|
|
32
|
-
var _this = _super.call(this, serviceProvider) || this;
|
|
33
|
-
_this.PAGINATION_PAGE_SIZE = 500;
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
AnnouncementServiceImpl.prototype.onCreate = function () {
|
|
37
|
-
this.httpsService = this.serviceProvider.getService(core_1.HttpsService);
|
|
38
|
-
};
|
|
39
|
-
AnnouncementServiceImpl.prototype.publish = function () {
|
|
40
|
-
return this.httpsService
|
|
41
|
-
.post('announcements/publish', {}, [], core_1.BACKEND_SERVICE.DATA)
|
|
42
|
-
.pipe((0, rxjs_1.map)(function (announcementData) { return announcement_1.Announcement.fromAPIResponse(announcementData); }));
|
|
43
|
-
};
|
|
44
|
-
AnnouncementServiceImpl.prototype.unpublish = function () {
|
|
45
|
-
return this.httpsService
|
|
46
|
-
.post('announcements/unpublish', {}, [], core_1.BACKEND_SERVICE.DATA)
|
|
47
|
-
.pipe((0, rxjs_1.map)(function (announcementData) { return announcement_1.Announcement.fromAPIResponse(announcementData); }));
|
|
48
|
-
};
|
|
49
|
-
AnnouncementServiceImpl.prototype.getRecipients = function (pageSize) {
|
|
50
|
-
var _this = this;
|
|
51
|
-
var url = 'announcements/recipients';
|
|
52
|
-
return this.httpsService.get(url, [{ page_size: pageSize }], core_1.BACKEND_SERVICE.DATA).pipe((0, rxjs_1.expand)(function (response) {
|
|
53
|
-
var nextPage = !!(response['pagination'] && response['pagination']['next']);
|
|
54
|
-
var page = response['pagination']['next'] && response['pagination']['next'].split('?');
|
|
55
|
-
var cursor = page && new URLSearchParams(page[1]).get('cursor');
|
|
56
|
-
return nextPage && cursor
|
|
57
|
-
? _this.httpsService.get(url, [{ paginator: 'cursor', page_size: pageSize || _this.PAGINATION_PAGE_SIZE, cursor: cursor }], core_1.BACKEND_SERVICE.DATA)
|
|
58
|
-
: rxjs_1.EMPTY;
|
|
59
|
-
}), (0, rxjs_1.reduce)(function (acc, current) { return acc.concat(current.results); }, []), (0, rxjs_1.takeWhile)(function (response) {
|
|
60
|
-
return response !== null;
|
|
61
|
-
}, true), (0, rxjs_1.map)(function (response) {
|
|
62
|
-
var recipients = response || [];
|
|
63
|
-
return recipients.map(function (recipient) { return announcement_1.AnnouncementRecipient.fromAPIResponse(recipient); });
|
|
64
|
-
}));
|
|
65
|
-
};
|
|
66
|
-
AnnouncementServiceImpl.prototype.getDraft = function () {
|
|
67
|
-
return this.httpsService.get('announcements/draft', [], core_1.BACKEND_SERVICE.DATA).pipe((0, rxjs_1.map)(function (announcementData) { return announcement_1.Announcement.fromAPIResponse(announcementData); }));
|
|
68
|
-
};
|
|
69
|
-
AnnouncementServiceImpl.prototype.updateDraft = function (title, contents, terminatesAt, recipients, includeSubOrgs, sendEmails) {
|
|
70
|
-
if (recipients === void 0) { recipients = []; }
|
|
71
|
-
if (includeSubOrgs === void 0) { includeSubOrgs = false; }
|
|
72
|
-
if (sendEmails === void 0) { sendEmails = false; }
|
|
73
|
-
return this.httpsService
|
|
74
|
-
.put('announcements/draft', { title: title, contents: contents, terminatesAt: terminatesAt, recipients: recipients, includeSubOrgs: includeSubOrgs, sendEmails: sendEmails }, [], core_1.BACKEND_SERVICE.DATA)
|
|
75
|
-
.pipe((0, rxjs_1.map)(function (announcementData) { return announcement_1.Announcement.fromAPIResponse(announcementData); }));
|
|
76
|
-
};
|
|
77
|
-
AnnouncementServiceImpl.prototype.getAnnouncement = function () {
|
|
78
|
-
return this.httpsService
|
|
79
|
-
.get('announcements/inbox', [], core_1.BACKEND_SERVICE.DATA)
|
|
80
|
-
.pipe((0, rxjs_1.map)(function (announcementsData) {
|
|
81
|
-
return announcementsData.map(function (announcement) { return announcement_1.Announcement.fromAPIResponse(announcement); });
|
|
82
|
-
}));
|
|
83
|
-
};
|
|
84
|
-
AnnouncementServiceImpl = __decorate([
|
|
85
|
-
(0, core_1.InjectionIdentifier)('AnnouncementService')
|
|
86
|
-
], AnnouncementServiceImpl);
|
|
87
|
-
return AnnouncementServiceImpl;
|
|
88
|
-
}(core_1.BaseService));
|
|
89
|
-
exports.AnnouncementServiceImpl = AnnouncementServiceImpl;
|
|
90
|
-
//# sourceMappingURL=announcement.service.js.map
|
|
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;
|