@partium/js-sdk 14.0.3 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/index.js +21 -1
- package/catalog/models/catalog-image-info.js +22 -1
- package/catalog/models/catalog-image.js +40 -1
- package/catalog/models/upsert-catalog-images-dto.js +3 -1
- package/catalog/models/upsert-images-result.js +3 -1
- package/catalog/services/images.service.js +62 -1
- package/core/constants/constants.js +16 -1
- package/core/decorators/injection-identifier.js +19 -1
- package/core/factories/paginated-request-service.factory.js +33 -1
- package/core/index.js +63 -1
- package/core/integration-defaults/http/fetch-api-http-error-helper.js +129 -1
- package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +138 -1
- package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +210 -1
- package/core/integration-defaults/http/handle-axios-error-helper.js +79 -1
- package/core/integration-defaults/http/https-client/axios-https-client.service.js +182 -1
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +198 -1
- package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +32 -1
- package/core/integration-defaults/js-p-file.js +36 -1
- package/core/integration-defaults/session/js-oauth-api-key-session.service.js +206 -1
- package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +64 -1
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +257 -1
- package/core/integration-defaults/web-device-status.service.js +125 -1
- package/core/integration-defaults/web-file.service.js +135 -1
- package/core/integration-defaults/web-indexeddb.service.js +142 -1
- package/core/integration-defaults/web-local-storage.service.js +310 -1
- package/core/models/api-object.js +16 -1
- package/core/models/auth-config.js +72 -1
- package/core/models/device-info.js +34 -1
- package/core/models/error.js +107 -1
- package/core/models/formatted-string.js +14 -1
- package/core/models/i18n-map.js +61 -1
- package/core/models/i18n-string.js +35 -1
- package/core/models/log.js +137 -1
- package/core/models/organization.js +159 -1
- package/core/models/p-file.js +23 -1
- package/core/models/paginated-list.js +41 -1
- package/core/models/partium-config.js +43 -1
- package/core/models/user-token.js +11 -1
- package/core/models/user.d.ts +2 -1
- package/core/models/user.js +89 -1
- package/core/services/backend-status.service.js +147 -1
- package/core/services/base-login-init.service.js +57 -1
- package/core/services/base.service.js +37 -1
- package/core/services/device-status.service.interface.js +117 -1
- package/core/services/file.service.interface.js +61 -1
- package/core/services/http/file-transfer/file-transfer.service.interface.js +125 -1
- package/core/services/http/https-client/https-client.service.interface.js +152 -1
- package/core/services/http/https.service.interface.js +294 -1
- package/core/services/http/oauth-https.service.js +218 -1
- package/core/services/local-storage.service.interface.js +378 -1
- package/core/services/log.service.js +139 -1
- package/core/services/organization.service.js +202 -1
- package/core/services/paginated-request.service.js +160 -1
- package/core/services/recent-parts.service.js +194 -1
- package/core/services/service-provider.js +114 -1
- package/core/services/session/oauth-session.service.js +104 -1
- package/core/services/session/session.service.interface.js +367 -1
- package/core/utils/general-helper.js +110 -1
- package/data/index.js +44 -1
- package/data/models/announcement.js +70 -1
- package/data/models/assembly-hierarchy-node-breadcrumb.js +51 -1
- package/data/models/assembly-hierarchy-node.js +46 -1
- package/data/models/attribute.js +106 -1
- package/data/models/csa-request-search.js +46 -1
- package/data/models/csa-request-status.js +51 -1
- package/data/models/csa-request.js +112 -1
- package/data/models/document.js +17 -1
- package/data/models/filter-key.js +36 -1
- package/data/models/filter-option-value.js +41 -1
- package/data/models/image.d.ts +3 -1
- package/data/models/image.js +77 -1
- package/data/models/inquiry.js +71 -1
- package/data/models/mounting-location.js +58 -1
- package/data/models/multiple-expert-searches.js +40 -1
- package/data/models/part-enrichment-data.js +50 -1
- package/data/models/part.js +168 -1
- package/data/models/shopping-cart.js +60 -1
- package/data/services/announcement.service.js +89 -1
- package/data/services/assembly-hierarchy-nodes.service.js +193 -1
- package/data/services/csa-helper.service.js +158 -1
- package/data/services/customer-service-assistance.service.js +276 -1
- package/data/services/filter.service.js +97 -1
- package/data/services/inquiry.service.js +68 -1
- package/data/services/part-attribute.service.js +118 -1
- package/data/services/part-enrichment.service.js +56 -1
- package/data/services/part.service.js +182 -1
- package/data/services/related-parts.service.js +83 -1
- package/data/services/shopping-cart.service.js +152 -1
- package/find/index.js +51 -1
- package/find/models/assets/asset.js +32 -1
- package/find/models/search-filter.js +205 -1
- package/find/models/search-input.js +3 -1
- package/find/models/search-output.js +3 -1
- package/find/models/search-result-status.js +40 -1
- package/find/models/search-session-log-object.js +22 -1
- package/find/models/search-status/cv-search-status.js +22 -1
- package/find/models/search-status/search-filter-status.js +36 -1
- package/find/models/search-status/search-status.js +56 -1
- package/find/models/search-status/tag-search-status.js +23 -1
- package/find/models/search-status/text-search-status.js +18 -1
- package/find/models/search-tag.js +16 -1
- package/find/models/smart-filter.js +49 -1
- package/find/models/tagable/i18n-tagable.js +37 -1
- package/find/models/tagable/tagable-base.js +22 -1
- package/find/models/tagable/tagable.js +37 -1
- package/find/models/text-search-config.js +70 -1
- package/find/models/text-search-manipulator.js +90 -1
- package/find/models/text-search-result-item/text-search-error.js +12 -1
- package/find/models/text-search-result-item/text-search-result-item-document.js +34 -1
- package/find/models/text-search-result-item/text-search-result-item-part.js +36 -1
- package/find/models/text-search-result-item/text-search-result-item-recent-query.js +35 -1
- package/find/models/text-search-result-item/text-search-result-item-unknown.js +38 -1
- package/find/models/text-search-result-item/text-search-result-item.js +22 -1
- package/find/services/asset.service.js +348 -1
- package/find/services/filter-uploaders/filter-uploader.js +3 -1
- package/find/services/filter-uploaders/update-filters-uploader.js +77 -1
- package/find/services/filter-uploaders/update-filters.model.js +7 -1
- package/find/services/search/cv-search.service.js +214 -1
- package/find/services/search/recent-text-search-queries.service.js +260 -1
- package/find/services/search/search-result.service.js +539 -1
- package/find/services/search/search.service.js +514 -1
- package/find/services/search/tag-search.service.js +124 -1
- package/find/services/search/text-search.service.js +316 -1
- package/find/services/search-filter.service.js +292 -1
- package/find/utils/search-helper.js +75 -1
- package/gen/sdk-version.d.ts +1 -1
- package/gen/sdk-version.js +5 -1
- package/index.js +392 -1
- package/management/index.js +21 -1
- package/management/models/api-key-list-response.js +3 -1
- package/management/models/api-key-type.js +9 -1
- package/management/models/api-key.js +3 -1
- package/management/services/api-key.service.js +53 -1
- package/ocr/index.js +20 -1
- package/ocr/models/detect-response.js +3 -1
- package/ocr/models/detected-text-entry.js +3 -1
- package/ocr/services/ocr.service.js +59 -1
- package/package.json +1 -1
- package/user-data/index.js +21 -1
- package/user-data/models/part-with-nullable.js +3 -1
- package/user-data/models/request-list/request-list.js +63 -1
- package/user-data/services/favorite/favorite.service.js +108 -1
- package/user-data/services/request-list/request-list.service.js +133 -1
package/data/models/image.js
CHANGED
|
@@ -1,2 +1,78 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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.Image = void 0;
|
|
20
|
+
var core_1 = require("../../core");
|
|
21
|
+
var Image = /** @class */ (function (_super) {
|
|
22
|
+
__extends(Image, _super);
|
|
23
|
+
function Image(init) {
|
|
24
|
+
var _this = _super.call(this) || this;
|
|
25
|
+
Object.assign(_this, init);
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
Image.fromDataAPIResponse = function (imageData, origin) {
|
|
29
|
+
if (origin === void 0) { origin = core_1.BACKEND_SERVICE.DATA; }
|
|
30
|
+
var data = imageData;
|
|
31
|
+
return new Image({
|
|
32
|
+
assetId: data.uuid,
|
|
33
|
+
origin: origin,
|
|
34
|
+
availableSizes: Object.keys(data.urls),
|
|
35
|
+
downloadUrls: data.urls,
|
|
36
|
+
expireAt: data.expireAt || data['expire_at'],
|
|
37
|
+
name: data.name,
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
Image.fromFindAPIResponse = function (imageData, origin) {
|
|
41
|
+
if (origin === void 0) { origin = core_1.BACKEND_SERVICE.FIND; }
|
|
42
|
+
var data = imageData;
|
|
43
|
+
return new Image({
|
|
44
|
+
assetId: data.partiumId,
|
|
45
|
+
origin: origin,
|
|
46
|
+
availableSizes: Object.keys(data.urls),
|
|
47
|
+
downloadUrls: data.urls,
|
|
48
|
+
expireAt: data.expireAt || data['expire_at'],
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
/** @deprecated use fromDataAPIResponse or fromFindAPIResponse instead, because the origin of the data does not need to correlate with where the image can be downloaded from via assetId */
|
|
52
|
+
Image.fromAPIResponse = function (imageData, origin) {
|
|
53
|
+
if (origin === void 0) { origin = core_1.BACKEND_SERVICE.DATA; }
|
|
54
|
+
if (origin === core_1.BACKEND_SERVICE.FIND) {
|
|
55
|
+
var data = imageData;
|
|
56
|
+
return new Image({
|
|
57
|
+
assetId: data.partiumId,
|
|
58
|
+
origin: origin,
|
|
59
|
+
availableSizes: Object.keys(data.urls),
|
|
60
|
+
downloadUrls: data.urls,
|
|
61
|
+
expireAt: data.expireAt || data['expire_at'],
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
var data = imageData;
|
|
66
|
+
return new Image({
|
|
67
|
+
assetId: data.uuid,
|
|
68
|
+
origin: origin,
|
|
69
|
+
availableSizes: Object.keys(data.urls),
|
|
70
|
+
downloadUrls: data.urls,
|
|
71
|
+
expireAt: data.expireAt || data['expire_at'],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return Image;
|
|
76
|
+
}(core_1.APIObject));
|
|
77
|
+
exports.Image = Image;
|
|
78
|
+
//# sourceMappingURL=image.js.map
|
package/data/models/inquiry.js
CHANGED
|
@@ -1,2 +1,72 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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
|
|
@@ -1,2 +1,59 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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
|
|
@@ -1,2 +1,41 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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
|
|
@@ -1,2 +1,51 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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
|
package/data/models/part.js
CHANGED
|
@@ -1,2 +1,169 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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
|
|
@@ -1,2 +1,61 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";
|
|
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
|