@partium/js-sdk 14.4.1 → 14.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/catalog/index.js +1 -21
  2. package/catalog/models/catalog-image-info.js +1 -22
  3. package/catalog/models/catalog-image.js +1 -40
  4. package/catalog/models/upsert-catalog-images-dto.js +1 -3
  5. package/catalog/models/upsert-images-result.js +1 -3
  6. package/catalog/services/images.service.js +1 -62
  7. package/core/constants/constants.d.ts +1 -0
  8. package/core/constants/constants.js +1 -16
  9. package/core/decorators/injection-identifier.js +1 -19
  10. package/core/factories/paginated-request-service.factory.js +1 -33
  11. package/core/index.js +1 -63
  12. package/core/integration-defaults/http/fetch-api-http-error-helper.js +1 -129
  13. package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +1 -138
  14. package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +1 -210
  15. package/core/integration-defaults/http/handle-axios-error-helper.js +1 -79
  16. package/core/integration-defaults/http/https-client/axios-https-client.service.js +1 -182
  17. package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +1 -198
  18. package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +1 -32
  19. package/core/integration-defaults/js-p-file.js +1 -36
  20. package/core/integration-defaults/session/js-oauth-api-key-session.service.js +1 -206
  21. package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +1 -64
  22. package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +1 -257
  23. package/core/integration-defaults/web-device-status.service.js +1 -125
  24. package/core/integration-defaults/web-file.service.js +1 -135
  25. package/core/integration-defaults/web-indexeddb.service.js +1 -142
  26. package/core/integration-defaults/web-local-storage.service.js +1 -310
  27. package/core/models/api-object.js +1 -16
  28. package/core/models/auth-config.js +1 -72
  29. package/core/models/device-info.js +1 -34
  30. package/core/models/error.js +1 -107
  31. package/core/models/formatted-string.js +1 -14
  32. package/core/models/i18n-map.js +1 -61
  33. package/core/models/i18n-string.js +1 -35
  34. package/core/models/log.js +1 -137
  35. package/core/models/organization.js +1 -159
  36. package/core/models/p-file.js +1 -23
  37. package/core/models/paginated-list.js +1 -41
  38. package/core/models/partium-config.js +1 -43
  39. package/core/models/user-token.js +1 -11
  40. package/core/models/user.js +1 -89
  41. package/core/services/backend-status.service.js +1 -147
  42. package/core/services/base-login-init.service.js +1 -57
  43. package/core/services/base.service.js +1 -37
  44. package/core/services/device-status.service.interface.js +1 -117
  45. package/core/services/file.service.interface.js +1 -61
  46. package/core/services/http/file-transfer/file-transfer.service.interface.js +1 -125
  47. package/core/services/http/https-client/https-client.service.interface.js +1 -152
  48. package/core/services/http/https.service.interface.d.ts +3 -1
  49. package/core/services/http/https.service.interface.js +1 -294
  50. package/core/services/http/oauth-https.service.js +1 -218
  51. package/core/services/local-storage.service.interface.js +1 -378
  52. package/core/services/log.service.js +1 -139
  53. package/core/services/organization.service.js +1 -202
  54. package/core/services/paginated-request.service.js +1 -154
  55. package/core/services/recent-parts.service.js +1 -194
  56. package/core/services/service-provider.js +1 -114
  57. package/core/services/session/oauth-session.service.js +1 -104
  58. package/core/services/session/session.service.interface.js +1 -367
  59. package/core/utils/general-helper.js +1 -110
  60. package/data/index.js +1 -44
  61. package/data/models/announcement.js +1 -70
  62. package/data/models/assembly-hierarchy-node-breadcrumb.js +1 -51
  63. package/data/models/assembly-hierarchy-node.js +1 -46
  64. package/data/models/attribute.js +1 -106
  65. package/data/models/csa-request-search.js +1 -46
  66. package/data/models/csa-request-status.js +1 -51
  67. package/data/models/csa-request.js +1 -112
  68. package/data/models/document.js +1 -17
  69. package/data/models/filter-key.js +1 -36
  70. package/data/models/filter-option-value.js +1 -41
  71. package/data/models/image.js +1 -77
  72. package/data/models/inquiry.js +1 -71
  73. package/data/models/mounting-location.js +1 -58
  74. package/data/models/multiple-expert-searches.js +1 -40
  75. package/data/models/part-enrichment-data.js +1 -50
  76. package/data/models/part.d.ts +1 -1
  77. package/data/models/part.js +1 -168
  78. package/data/models/shopping-cart.js +1 -60
  79. package/data/services/announcement.service.js +1 -89
  80. package/data/services/assembly-hierarchy-nodes.service.js +1 -193
  81. package/data/services/csa-helper.service.js +1 -158
  82. package/data/services/customer-service-assistance.service.js +1 -276
  83. package/data/services/filter.service.js +1 -97
  84. package/data/services/inquiry.service.js +1 -68
  85. package/data/services/part-attribute.service.js +1 -118
  86. package/data/services/part-enrichment.service.js +1 -56
  87. package/data/services/part.service.js +1 -182
  88. package/data/services/related-parts.service.js +1 -83
  89. package/data/services/shopping-cart.service.js +1 -152
  90. package/datacuration/index.d.ts +2 -0
  91. package/datacuration/index.js +2 -0
  92. package/datacuration/models/image-submission-request.d.ts +55 -0
  93. package/datacuration/models/image-submission-request.js +2 -0
  94. package/datacuration/models/submitted-image-response.d.ts +27 -0
  95. package/datacuration/models/submitted-image-response.js +2 -0
  96. package/datacuration/services/image-submission.service.d.ts +26 -0
  97. package/datacuration/services/image-submission.service.js +2 -0
  98. package/find/index.js +1 -51
  99. package/find/models/assets/asset.js +1 -32
  100. package/find/models/search-filter.js +1 -205
  101. package/find/models/search-input.js +1 -3
  102. package/find/models/search-output.js +1 -3
  103. package/find/models/search-result-status.js +1 -40
  104. package/find/models/search-session-log-object.js +1 -22
  105. package/find/models/search-status/cv-search-status.js +1 -22
  106. package/find/models/search-status/search-filter-status.js +1 -36
  107. package/find/models/search-status/search-status.js +1 -56
  108. package/find/models/search-status/tag-search-status.js +1 -23
  109. package/find/models/search-status/text-search-status.js +1 -18
  110. package/find/models/search-tag.js +1 -16
  111. package/find/models/smart-filter.js +1 -49
  112. package/find/models/tagable/i18n-tagable.js +1 -37
  113. package/find/models/tagable/tagable-base.js +1 -22
  114. package/find/models/tagable/tagable.js +1 -37
  115. package/find/models/text-search-config.js +1 -70
  116. package/find/models/text-search-manipulator.js +1 -90
  117. package/find/models/text-search-result-item/text-search-error.js +1 -12
  118. package/find/models/text-search-result-item/text-search-result-item-document.js +1 -34
  119. package/find/models/text-search-result-item/text-search-result-item-part.js +1 -36
  120. package/find/models/text-search-result-item/text-search-result-item-recent-query.js +1 -35
  121. package/find/models/text-search-result-item/text-search-result-item-unknown.js +1 -38
  122. package/find/models/text-search-result-item/text-search-result-item.js +1 -22
  123. package/find/services/asset.service.js +1 -348
  124. package/find/services/filter-uploaders/filter-uploader.js +1 -3
  125. package/find/services/filter-uploaders/update-filters-uploader.js +1 -77
  126. package/find/services/filter-uploaders/update-filters.model.js +1 -7
  127. package/find/services/search/cv-search.service.js +1 -214
  128. package/find/services/search/recent-text-search-queries.service.js +1 -260
  129. package/find/services/search/search-result.service.js +1 -539
  130. package/find/services/search/search.service.js +1 -514
  131. package/find/services/search/tag-search.service.js +1 -124
  132. package/find/services/search/text-search.service.js +1 -316
  133. package/find/services/search-filter.service.js +1 -292
  134. package/find/utils/search-helper.js +1 -75
  135. package/gen/sdk-version.d.ts +1 -1
  136. package/gen/sdk-version.js +1 -5
  137. package/index.d.ts +2 -0
  138. package/index.js +1 -392
  139. package/management/index.js +1 -21
  140. package/management/models/api-key-list-response.js +1 -3
  141. package/management/models/api-key-type.js +1 -9
  142. package/management/models/api-key.js +1 -3
  143. package/management/services/api-key.service.js +1 -53
  144. package/ocr/index.js +1 -20
  145. package/ocr/models/detect-response.js +1 -3
  146. package/ocr/models/detected-text-entry.js +1 -3
  147. package/ocr/services/ocr.service.js +1 -59
  148. package/package.json +1 -1
  149. package/user-data/index.js +1 -21
  150. package/user-data/models/part-with-nullable.js +1 -3
  151. package/user-data/models/request-list/request-list.js +1 -63
  152. package/user-data/services/favorite/favorite.service.js +1 -108
  153. package/user-data/services/request-list/request-list.service.js +1 -133
@@ -1,368 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
25
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
- return new (P || (P = Promise))(function (resolve, reject) {
27
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
- step((generator = generator.apply(thisArg, _arguments || [])).next());
31
- });
32
- };
33
- var __generator = (this && this.__generator) || function (thisArg, body) {
34
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
35
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
- function verb(n) { return function (v) { return step([n, v]); }; }
37
- function step(op) {
38
- if (f) throw new TypeError("Generator is already executing.");
39
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
40
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
41
- if (y = 0, t) op = [op[0] & 2, t.value];
42
- switch (op[0]) {
43
- case 0: case 1: t = op; break;
44
- case 4: _.label++; return { value: op[1], done: false };
45
- case 5: _.label++; y = op[1]; op = [0]; continue;
46
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
47
- default:
48
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
49
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
50
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
51
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
52
- if (t[2]) _.ops.pop();
53
- _.trys.pop(); continue;
54
- }
55
- op = body.call(thisArg, _);
56
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
57
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
58
- }
59
- };
60
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
61
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
62
- if (ar || !(i in from)) {
63
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
64
- ar[i] = from[i];
65
- }
66
- }
67
- return to.concat(ar || Array.prototype.slice.call(from));
68
- };
69
- Object.defineProperty(exports, "__esModule", { value: true });
70
- exports.SessionService = exports.LoginConfig = exports.SESSION_STATUS_EVENT = void 0;
71
- var rxjs_1 = require("rxjs");
72
- var operators_1 = require("rxjs/operators");
73
- var injection_identifier_1 = require("../../decorators/injection-identifier");
74
- var base_service_1 = require("../base.service");
75
- var organization_service_1 = require("../organization.service");
76
- var log_1 = require("../../models/log");
77
- var log_service_1 = require("../log.service");
78
- var device_status_service_interface_1 = require("../device-status.service.interface");
79
- var sdk_version_1 = require("../../../gen/sdk-version");
80
- var error_1 = require("../../models/error");
81
- var local_storage_service_interface_1 = require("../local-storage.service.interface");
82
- var SESSION_STATUS_EVENT;
83
- (function (SESSION_STATUS_EVENT) {
84
- SESSION_STATUS_EVENT[SESSION_STATUS_EVENT["SESSION_STARTED"] = 0] = "SESSION_STARTED";
85
- SESSION_STATUS_EVENT[SESSION_STATUS_EVENT["SESSION_ENDED"] = 1] = "SESSION_ENDED";
86
- })(SESSION_STATUS_EVENT || (exports.SESSION_STATUS_EVENT = SESSION_STATUS_EVENT = {}));
87
- /**
88
- * Login-Configuration, such as username and password, or api-key
89
- */
90
- var LoginConfig = /** @class */ (function () {
91
- function LoginConfig() {
92
- }
93
- return LoginConfig;
94
- }());
95
- exports.LoginConfig = LoginConfig;
96
- /**
97
- * Defines the structure of a session-service implementation.
98
- * It contains functions that are required for handling user sessions and
99
- * authentication-mechanisms.
100
- * The implementations of this interface will be based on the chosen
101
- * authentication method and platform that is used in the application,
102
- *
103
- * An implementation of this service is required and has to be configured during
104
- * the initialization phase of Partium.
105
- *
106
- * This class file is called interface, even though it is not an interface,
107
- * but we need it to be a concrete class for the serviceProvider.
108
- */
109
- var SessionService = /** @class */ (function (_super) {
110
- __extends(SessionService, _super);
111
- function SessionService(serviceProvider) {
112
- var _this = _super.call(this, serviceProvider) || this;
113
- _this.currentOrganization$ = new rxjs_1.BehaviorSubject(undefined);
114
- // registered services, where init-method must run successfully through, during login
115
- _this.servicesToInitDuringLogin = [];
116
- _this.sessionStatus$ = new rxjs_1.BehaviorSubject(null);
117
- return _this;
118
- }
119
- /**
120
- * Called by HttpsService to pass config info
121
- *
122
- * @param config the Partium configuration
123
- */
124
- SessionService.prototype.init = function (config) {
125
- var _this = this;
126
- return new rxjs_1.Observable(function (subscriber) {
127
- _this.authenticationConfig = config.authenticationConfig;
128
- _this.partiumConfig = config;
129
- subscriber.next();
130
- subscriber.complete();
131
- });
132
- };
133
- /**
134
- * Login user based on the given configuration.
135
- *
136
- * Method should be overridden by child-class
137
- *
138
- * @param config the login configuration, which differs per authentication-method
139
- */
140
- SessionService.prototype.login = function (config) {
141
- throw new Error("In order to use the SessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
142
- };
143
- /**
144
- * Logout currently logged in user
145
- *
146
- * Method should be overridden by child-class
147
- */
148
- SessionService.prototype.logout = function () {
149
- throw new Error("In order to use the SessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
150
- };
151
- /**
152
- * Returns an Observable that always emits an event when a session has just
153
- * started or ended.
154
- */
155
- SessionService.prototype.getSessionStatusEvents = function () {
156
- return this.sessionStatus$.asObservable();
157
- };
158
- /**
159
- * Get the currently configured authentication configuration
160
- *
161
- * @returns the authentication configuration
162
- */
163
- SessionService.prototype.getAuthConfig = function () {
164
- return this.authenticationConfig;
165
- };
166
- /**
167
- * Set the user-object of the currently logged in user.
168
- * This class should be called by any of the deriving classes.
169
- *
170
- * @param user the currently logged in user
171
- */
172
- SessionService.prototype.setUser = function (user) {
173
- this.user = user;
174
- };
175
- /**
176
- * Retrieve the currently logged in user
177
- *
178
- * @returns the currently logged in user
179
- */
180
- SessionService.prototype.getUser = function () {
181
- return this.user;
182
- };
183
- /**
184
- * Set organization with the given identifier as the current organization to be used in the session.
185
- *
186
- * @param organizationIdentifier can be organization-id or organization-name
187
- * @returns void if organization is found, otherwise throws an error
188
- */
189
- SessionService.prototype.useOrganization = function (organizationIdentifier) {
190
- return __awaiter(this, void 0, void 0, function () {
191
- var organizations, flattenedOrganizations, _i, flattenedOrganizations_1, org;
192
- return __generator(this, function (_a) {
193
- switch (_a.label) {
194
- case 0: return [4 /*yield*/, this.organizationService.getOrganizations()];
195
- case 1:
196
- organizations = _a.sent();
197
- flattenedOrganizations = this.getFlattenedOrganizations(organizations);
198
- for (_i = 0, flattenedOrganizations_1 = flattenedOrganizations; _i < flattenedOrganizations_1.length; _i++) {
199
- org = flattenedOrganizations_1[_i];
200
- if (org.partiumId === organizationIdentifier || org.name === organizationIdentifier) {
201
- this.currentOrganization$.next(org);
202
- this.localStorageService.setItem('lastUsedOrganizationId', org.partiumId, { organizationName: false, userEmail: false });
203
- return [2 /*return*/];
204
- }
205
- }
206
- throw new error_1.SdkError(error_1.SDK_ERROR_CODES.ORGANIZATION_NOT_FOUND, { organizationIdentifier: organizationIdentifier }, "Could not find organization with id/name ".concat(organizationIdentifier));
207
- }
208
- });
209
- });
210
- };
211
- /**
212
- * Get an observable that always emits when the currently selected organization changed.
213
- *
214
- * @returns Observable, emitting the currently used organization.
215
- */
216
- SessionService.prototype.getCurrentOrganization$ = function () {
217
- return this.currentOrganization$.asObservable();
218
- };
219
- /**
220
- * Register a service to be initialized during login-process.
221
- * The passed service must extend the BaseLoginInitService and implement an init-function,
222
- * that returns an Observable, that resolves, when the initialization was finished successfully
223
- *
224
- * @param service the service to init during login
225
- * @param priority services with lower prio will be initialized first. Services with the same prio will be initialized in parallel. Can be used if there are dependencies between the services.
226
- */
227
- SessionService.prototype.registerLoginInitService = function (service, priority) {
228
- if (priority === void 0) { priority = 100; }
229
- this.servicesToInitDuringLogin.push({ service: service, priority: priority });
230
- };
231
- /**
232
- * Needs to be called during the login-process, after the user is authenticated,
233
- * to download and prepare all the data needed in the session.
234
- *
235
- * @param eventContext (optional) additional event context for event logs emitted during session setup
236
- */
237
- SessionService.prototype.sessionSetup = function (eventContext) {
238
- var _this = this;
239
- this.organizationService = this.serviceProvider.getService(organization_service_1.OrganizationService);
240
- this.localStorageService = this.serviceProvider.getService(local_storage_service_interface_1.LocalStorageService);
241
- var logService = this.serviceProvider.getService(log_service_1.LogServiceImpl);
242
- var deviceStatusService = this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService);
243
- return (0, rxjs_1.from)(Promise.all([
244
- this.localStorageService.getItem('lastUsedOrganizationId', { organizationName: false, userEmail: false }),
245
- this.organizationService.init().then(function () { return _this.organizationService.getOrganizations(); }),
246
- ])).pipe((0, operators_1.mergeMap)(function (_a) {
247
- var lastUsedOrganizationId = _a[0], organizations = _a[1];
248
- if (lastUsedOrganizationId) {
249
- var organization = _this.getFlattenedOrganizations(organizations).find(function (org) { return org.partiumId === lastUsedOrganizationId; });
250
- if (organization && !organization.requiresAdditionalAuthentication) { // only use recent organization, if it does not require additional authentication
251
- return (0, rxjs_1.of)(organization);
252
- ;
253
- }
254
- }
255
- return (0, rxjs_1.from)(_this.organizationService.getFirstOrganization());
256
- }), (0, operators_1.map)(function (organization) {
257
- _this.currentOrganization$.next(organization);
258
- return organization;
259
- }), (0, operators_1.mergeMap)(function (organization) {
260
- return _this.initializeRegisteredServices().pipe((0, operators_1.mergeMap)(function () {
261
- return (0, rxjs_1.from)(deviceStatusService.getDeviceInfo()).pipe((0, operators_1.tap)(function (deviceInfo) {
262
- _this.logUserSessionInfoEvent(deviceInfo, logService, organization, eventContext);
263
- }));
264
- }));
265
- }), (0, operators_1.map)(function () {
266
- _this.sessionStatus$.next(SESSION_STATUS_EVENT.SESSION_STARTED);
267
- }), (0, operators_1.catchError)(function (error) {
268
- _this.logout().subscribe();
269
- return (0, rxjs_1.throwError)(error);
270
- }));
271
- };
272
- SessionService.prototype.logUserSessionInfoEvent = function (deviceInfo, logService, organization, eventContext) {
273
- var languageUi = this.getValidLanguageUiForEvent(organization, eventContext === null || eventContext === void 0 ? void 0 : eventContext.languageUi);
274
- var eventLogData = {
275
- deviceId: deviceInfo.deviceId,
276
- manufacturer: deviceInfo.manufacturer,
277
- model: deviceInfo.model,
278
- os: deviceInfo.os,
279
- osVersion: deviceInfo.osVersion,
280
- deviceType: deviceInfo.deviceType,
281
- deviceLanguage: deviceInfo.deviceLanguage,
282
- appVersionCode: deviceInfo.appVersionCode,
283
- appVersionName: deviceInfo.appVersionName,
284
- partiumSdkVersion: sdk_version_1.SDK_VERSION_NUMBER,
285
- languageUi: languageUi,
286
- browserName: deviceInfo.browserName,
287
- browserVersion: deviceInfo.browserVersion,
288
- cpuArchitecture: deviceInfo.cpuArchitecture,
289
- engineName: deviceInfo.engineName,
290
- engineVersion: deviceInfo.engineVersion,
291
- };
292
- logService
293
- .logEvent(new log_1.EventLog({
294
- organizationId: organization.partiumId,
295
- version: log_1.EVENTLOG_VERSIONS.V_2_0_0,
296
- interface: (eventContext === null || eventContext === void 0 ? void 0 : eventContext.eventInterface) || log_1.INTERFACE.API_ACCESS,
297
- event: log_1.EVENT.USER_SESSION_INFO,
298
- data: eventLogData,
299
- }))
300
- .subscribe({
301
- next: function () {
302
- // do nothing (console.log will be called in log-service)
303
- },
304
- error: function (error) {
305
- console.error("Error while sending log event ".concat(log_1.EVENT.USER_SESSION_INFO, ": "), error);
306
- },
307
- });
308
- };
309
- /**
310
- * Returns the passed languageUiCandidate if it is valid for the organization config.
311
- * Returns null if invalid.
312
- */
313
- SessionService.prototype.getValidLanguageUiForEvent = function (organization, languageUiCandidate) {
314
- var _a;
315
- if (languageUiCandidate) {
316
- var languages = ((_a = organization.config) === null || _a === void 0 ? void 0 : _a.availableUiLanguages) || ['en'];
317
- if (languages.includes(languageUiCandidate)) {
318
- return languageUiCandidate;
319
- }
320
- }
321
- return null;
322
- };
323
- /**
324
- * Needs to be called when a session ended,
325
- * to notify other services that need to tear down.
326
- */
327
- SessionService.prototype.sessionEnded = function () {
328
- this.sessionStatus$.next(SESSION_STATUS_EVENT.SESSION_ENDED);
329
- };
330
- /**
331
- * Initializes all services, which are registered for initialization during login.
332
- * First all services with priority 1 will be registered in parallel, then all services with priority 2, and so on.
333
- *
334
- * @returns Observable that resolves once all services have been initialized.
335
- */
336
- SessionService.prototype.initializeRegisteredServices = function () {
337
- var _this = this;
338
- var sortedServices = this.servicesToInitDuringLogin.sort(function (a, b) {
339
- return a.priority - b.priority;
340
- });
341
- var groupedServices = [];
342
- var curPrio = -1;
343
- for (var i = 0; i < sortedServices.length; i++) {
344
- var service = sortedServices[i];
345
- if (service.priority === curPrio) {
346
- groupedServices[groupedServices.length - 1].push(service.service);
347
- }
348
- else {
349
- curPrio = service.priority;
350
- groupedServices.push([service.service]);
351
- }
352
- }
353
- return rxjs_1.concat.apply(void 0, groupedServices.map(function (services) {
354
- return (0, rxjs_1.forkJoin)(services.map(function (service) {
355
- return service.init(_this.partiumConfig, _this.user.email, _this.getCurrentOrganization$());
356
- }));
357
- })).pipe((0, operators_1.last)());
358
- };
359
- SessionService.prototype.getFlattenedOrganizations = function (organizations) {
360
- return organizations.reduce(function (acc, curr) { return __spreadArray(__spreadArray(__spreadArray([], acc, true), [curr], false), curr.subOrgs || [], true); }, []);
361
- };
362
- SessionService = __decorate([
363
- (0, injection_identifier_1.InjectionIdentifier)('SessionService')
364
- ], SessionService);
365
- return SessionService;
366
- }(base_service_1.BaseService));
367
- exports.SessionService = SessionService;
368
- //# sourceMappingURL=session.service.interface.js.map
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),__decorate=this&&this.__decorate||function(e,r,t,i){var n,o=arguments.length,s=o<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,r,t,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(r,t,s):n(r,t))||s);return o>3&&s&&Object.defineProperty(r,t,s),s},__awaiter=this&&this.__awaiter||function(e,r,t,i){return new(t||(t=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,a)}c((i=i.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(t=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=r.call(e,s)}catch(e){a=[6,e],i=0}finally{t=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},__spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||2===arguments.length)for(var i,n=0,o=r.length;n<o;n++)!i&&n in r||(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return e.concat(i||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SessionService=exports.LoginConfig=exports.SESSION_STATUS_EVENT=void 0;var SESSION_STATUS_EVENT,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),injection_identifier_1=require("../../decorators/injection-identifier"),base_service_1=require("../base.service"),organization_service_1=require("../organization.service"),log_1=require("../../models/log"),log_service_1=require("../log.service"),device_status_service_interface_1=require("../device-status.service.interface"),sdk_version_1=require("../../../gen/sdk-version"),error_1=require("../../models/error"),local_storage_service_interface_1=require("../local-storage.service.interface");!function(e){e[e.SESSION_STARTED=0]="SESSION_STARTED",e[e.SESSION_ENDED=1]="SESSION_ENDED"}(SESSION_STATUS_EVENT||(exports.SESSION_STATUS_EVENT=SESSION_STATUS_EVENT={}));var LoginConfig=function(){};exports.LoginConfig=LoginConfig;var SessionService=function(e){function r(r){var t=e.call(this,r)||this;return t.currentOrganization$=new rxjs_1.BehaviorSubject(void 0),t.servicesToInitDuringLogin=[],t.sessionStatus$=new rxjs_1.BehaviorSubject(null),t}return __extends(r,e),r.prototype.init=function(e){var r=this;return new rxjs_1.Observable((function(t){r.authenticationConfig=e.authenticationConfig,r.partiumConfig=e,t.next(),t.complete()}))},r.prototype.login=function(e){throw new Error("In order to use the SessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.logout=function(){throw new Error("In order to use the SessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.getSessionStatusEvents=function(){return this.sessionStatus$.asObservable()},r.prototype.getAuthConfig=function(){return this.authenticationConfig},r.prototype.setUser=function(e){this.user=e},r.prototype.getUser=function(){return this.user},r.prototype.useOrganization=function(e){return __awaiter(this,void 0,void 0,(function(){var r,t,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.organizationService.getOrganizations()];case 1:for(r=s.sent(),t=this.getFlattenedOrganizations(r),i=0,n=t;i<n.length;i++)if((o=n[i]).partiumId===e||o.name===e)return this.currentOrganization$.next(o),this.localStorageService.setItem("lastUsedOrganizationId",o.partiumId,{organizationName:!1,userEmail:!1}),[2];throw new error_1.SdkError(error_1.SDK_ERROR_CODES.ORGANIZATION_NOT_FOUND,{organizationIdentifier:e},"Could not find organization with id/name ".concat(e))}}))}))},r.prototype.getCurrentOrganization$=function(){return this.currentOrganization$.asObservable()},r.prototype.registerLoginInitService=function(e,r){void 0===r&&(r=100),this.servicesToInitDuringLogin.push({service:e,priority:r})},r.prototype.sessionSetup=function(e){var r=this;this.organizationService=this.serviceProvider.getService(organization_service_1.OrganizationService),this.localStorageService=this.serviceProvider.getService(local_storage_service_interface_1.LocalStorageService);var t=this.serviceProvider.getService(log_service_1.LogServiceImpl),i=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService);return(0,rxjs_1.from)(Promise.all([this.localStorageService.getItem("lastUsedOrganizationId",{organizationName:!1,userEmail:!1}),this.organizationService.init().then((function(){return r.organizationService.getOrganizations()}))])).pipe((0,operators_1.mergeMap)((function(e){var t=e[0],i=e[1];if(t){var n=r.getFlattenedOrganizations(i).find((function(e){return e.partiumId===t}));if(n&&!n.requiresAdditionalAuthentication)return(0,rxjs_1.of)(n)}return(0,rxjs_1.from)(r.organizationService.getFirstOrganization())})),(0,operators_1.map)((function(e){return r.currentOrganization$.next(e),e})),(0,operators_1.mergeMap)((function(n){return r.initializeRegisteredServices().pipe((0,operators_1.mergeMap)((function(){return(0,rxjs_1.from)(i.getDeviceInfo()).pipe((0,operators_1.tap)((function(i){r.logUserSessionInfoEvent(i,t,n,e)})))})))})),(0,operators_1.map)((function(){r.sessionStatus$.next(SESSION_STATUS_EVENT.SESSION_STARTED)})),(0,operators_1.catchError)((function(e){return r.logout().subscribe(),(0,rxjs_1.throwError)(e)})))},r.prototype.logUserSessionInfoEvent=function(e,r,t,i){var n=this.getValidLanguageUiForEvent(t,null==i?void 0:i.languageUi),o={deviceId:e.deviceId,manufacturer:e.manufacturer,model:e.model,os:e.os,osVersion:e.osVersion,deviceType:e.deviceType,deviceLanguage:e.deviceLanguage,appVersionCode:e.appVersionCode,appVersionName:e.appVersionName,partiumSdkVersion:sdk_version_1.SDK_VERSION_NUMBER,languageUi:n,browserName:e.browserName,browserVersion:e.browserVersion,cpuArchitecture:e.cpuArchitecture,engineName:e.engineName,engineVersion:e.engineVersion};r.logEvent(new log_1.EventLog({organizationId:t.partiumId,version:log_1.EVENTLOG_VERSIONS.V_2_0_0,interface:(null==i?void 0:i.eventInterface)||log_1.INTERFACE.API_ACCESS,event:log_1.EVENT.USER_SESSION_INFO,data:o})).subscribe({next:function(){},error:function(e){console.error("Error while sending log event ".concat(log_1.EVENT.USER_SESSION_INFO,": "),e)}})},r.prototype.getValidLanguageUiForEvent=function(e,r){var t;if(r&&((null===(t=e.config)||void 0===t?void 0:t.availableUiLanguages)||["en"]).includes(r))return r;return null},r.prototype.sessionEnded=function(){this.sessionStatus$.next(SESSION_STATUS_EVENT.SESSION_ENDED)},r.prototype.initializeRegisteredServices=function(){for(var e=this,r=this.servicesToInitDuringLogin.sort((function(e,r){return e.priority-r.priority})),t=[],i=-1,n=0;n<r.length;n++){var o=r[n];o.priority===i?t[t.length-1].push(o.service):(i=o.priority,t.push([o.service]))}return rxjs_1.concat.apply(void 0,t.map((function(r){return(0,rxjs_1.forkJoin)(r.map((function(r){return r.init(e.partiumConfig,e.user.email,e.getCurrentOrganization$())})))}))).pipe((0,operators_1.last)())},r.prototype.getFlattenedOrganizations=function(e){return e.reduce((function(e,r){return __spreadArray(__spreadArray(__spreadArray([],e,!0),[r],!1),r.subOrgs||[],!0)}),[])},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("SessionService")],r)}(base_service_1.BaseService);exports.SessionService=SessionService;
@@ -1,111 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";
3
- /**
4
- * Converts camel case to snake case
5
- *
6
- * @param data object with properties in camel case format
7
- * @returns object in snake case format
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.addUrlParameter = exports.addUrlParameters = exports.snakeToCamelCase = exports.camelToSnake = void 0;
11
- var camelToSnake = function (data) {
12
- var snakeCaseData = {};
13
- Object.keys(data).forEach(function (key) {
14
- var snakeCaseKey = key.replace(/[A-Z]/g, function (letter) { return "_".concat(letter.toLowerCase()); });
15
- snakeCaseData[snakeCaseKey] = data[key];
16
- if (Array.isArray(data[snakeCaseKey])) {
17
- var list = data[snakeCaseKey];
18
- list = list.map(function (item) {
19
- var isObject = item && typeof item === 'object' && item.constructor === Object;
20
- return isObject ? (0, exports.camelToSnake)(item) : item;
21
- });
22
- snakeCaseData[snakeCaseKey] = list;
23
- }
24
- });
25
- return snakeCaseData;
26
- };
27
- exports.camelToSnake = camelToSnake;
28
- /**
29
- * Converts snake case to camel case
30
- *
31
- * @param data object with properties in snake case format
32
- * @returns object in camel case format
33
- */
34
- var snakeToCamelCase = function (data) {
35
- var camelCaseData = {};
36
- Object.keys(data).forEach(function (key) {
37
- var camelKey = key
38
- .toLowerCase()
39
- .replace(/([-_][a-z])/g, function (group) { return group.toUpperCase().replace('-', '').replace('_', ''); });
40
- camelCaseData[camelKey] = data[key];
41
- if (Array.isArray(data[camelKey])) {
42
- var list = data[camelKey];
43
- list = list.map(function (item) {
44
- var isObject = item && typeof item === 'object' && item.constructor === Object;
45
- return isObject ? (0, exports.snakeToCamelCase)(item) : item;
46
- });
47
- camelCaseData[camelKey] = list;
48
- }
49
- });
50
- return camelCaseData;
51
- };
52
- exports.snakeToCamelCase = snakeToCamelCase;
53
- /**
54
- * Add url parameters to the given url and return it as string.
55
- * If one of the parameter already exists, it will be added another time.
56
- * If an object of the array contains multiple params, all are added.
57
- *
58
- * @param url the url to add the parameters to
59
- * @param paramObjects array of objects with parameters that should be appended, eg: [{ pageNumber: 4 }]
60
- * @returns the given url with the appended parameters
61
- */
62
- var addUrlParameters = function (url, paramObjects) {
63
- if (!paramObjects || paramObjects.length < 1) {
64
- return url;
65
- }
66
- for (var _i = 0, paramObjects_1 = paramObjects; _i < paramObjects_1.length; _i++) {
67
- var paramObject = paramObjects_1[_i];
68
- url = (0, exports.addUrlParameter)(url, paramObject);
69
- }
70
- return url;
71
- };
72
- exports.addUrlParameters = addUrlParameters;
73
- /**
74
- * Add an url parameter to the given url and return it as string.
75
- * If the same parameter already exists, it will be added another time.
76
- * If an object of the array contains multiple params, all are added.
77
- *
78
- * @param url the url to add the parameter to
79
- * @param paramObject the object with one or more params to append, eg: { pageNumber: 4 }
80
- * @returns the given url with the appended parameter
81
- */
82
- var addUrlParameter = function (url, paramObject) {
83
- if (!paramObject) {
84
- return url;
85
- }
86
- var splittedUrl = url.split('?');
87
- var baseUrl = splittedUrl[0];
88
- var curUrlParams = [];
89
- if (splittedUrl.length > 1) {
90
- curUrlParams = splittedUrl[1].split('&').map(function (param) { return param.split('='); });
91
- }
92
- for (var _i = 0, _a = Object.keys(paramObject); _i < _a.length; _i++) {
93
- var newUrlParam = _a[_i];
94
- var value = paramObject[newUrlParam];
95
- if (value == null) {
96
- continue;
97
- }
98
- newUrlParam = encodeURIComponent(newUrlParam);
99
- value = encodeURIComponent(value);
100
- curUrlParams.push([newUrlParam, value]);
101
- }
102
- var joinedPairs = curUrlParams.map(function (pair) { return pair.join('='); });
103
- if (joinedPairs.length > 0) {
104
- return "".concat(baseUrl, "?").concat(joinedPairs.join('&'));
105
- }
106
- else {
107
- return baseUrl;
108
- }
109
- };
110
- exports.addUrlParameter = addUrlParameter;
111
- //# sourceMappingURL=general-helper.js.map
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addUrlParameter=exports.addUrlParameters=exports.snakeToCamelCase=exports.camelToSnake=void 0;var camelToSnake=function(e){var r={};return Object.keys(e).forEach((function(a){var t=a.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}));if(r[t]=e[a],Array.isArray(e[t])){var n=e[t];n=n.map((function(e){return e&&"object"==typeof e&&e.constructor===Object?(0,exports.camelToSnake)(e):e})),r[t]=n}})),r};exports.camelToSnake=camelToSnake;var snakeToCamelCase=function(e){var r={};return Object.keys(e).forEach((function(a){var t=a.toLowerCase().replace(/([-_][a-z])/g,(function(e){return e.toUpperCase().replace("-","").replace("_","")}));if(r[t]=e[a],Array.isArray(e[t])){var n=e[t];n=n.map((function(e){return e&&"object"==typeof e&&e.constructor===Object?(0,exports.snakeToCamelCase)(e):e})),r[t]=n}})),r};exports.snakeToCamelCase=snakeToCamelCase;var addUrlParameters=function(e,r){if(!r||r.length<1)return e;for(var a=0,t=r;a<t.length;a++){var n=t[a];e=(0,exports.addUrlParameter)(e,n)}return e};exports.addUrlParameters=addUrlParameters;var addUrlParameter=function(e,r){if(!r)return e;var a=e.split("?"),t=a[0],n=[];a.length>1&&(n=a[1].split("&").map((function(e){return e.split("=")})));for(var o=0,c=Object.keys(r);o<c.length;o++){var s=c[o],l=r[s];null!=l&&(s=encodeURIComponent(s),l=encodeURIComponent(l),n.push([s,l]))}var p=n.map((function(e){return e.join("=")}));return p.length>0?"".concat(t,"?").concat(p.join("&")):t};exports.addUrlParameter=addUrlParameter;
package/data/index.js CHANGED
@@ -1,45 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- __exportStar(require("./models/part"), exports);
19
- __exportStar(require("./models/document"), exports);
20
- __exportStar(require("./models/assembly-hierarchy-node"), exports);
21
- __exportStar(require("./models/assembly-hierarchy-node-breadcrumb"), exports);
22
- __exportStar(require("./models/image"), exports);
23
- __exportStar(require("./models/attribute"), exports);
24
- __exportStar(require("./models/csa-request"), exports);
25
- __exportStar(require("./models/csa-request-status"), exports);
26
- __exportStar(require("./models/filter-key"), exports);
27
- __exportStar(require("./models/filter-option-value"), exports);
28
- __exportStar(require("./models/shopping-cart"), exports);
29
- __exportStar(require("./models/multiple-expert-searches"), exports);
30
- __exportStar(require("./models/csa-request-search"), exports);
31
- __exportStar(require("./models/announcement"), exports);
32
- __exportStar(require("./models/inquiry"), exports);
33
- __exportStar(require("./models/mounting-location"), exports);
34
- __exportStar(require("./models/part-enrichment-data"), exports);
35
- __exportStar(require("./services/part.service"), exports);
36
- __exportStar(require("./services/part-enrichment.service"), exports);
37
- __exportStar(require("./services/related-parts.service"), exports);
38
- __exportStar(require("./services/assembly-hierarchy-nodes.service"), exports);
39
- __exportStar(require("./services/part-attribute.service"), exports);
40
- __exportStar(require("./services/customer-service-assistance.service"), exports);
41
- __exportStar(require("./services/filter.service"), exports);
42
- __exportStar(require("./services/shopping-cart.service"), exports);
43
- __exportStar(require("./services/inquiry.service"), exports);
44
- __exportStar(require("./services/announcement.service"), exports);
45
- //# sourceMappingURL=index.js.map
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,o)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/part"),exports),__exportStar(require("./models/document"),exports),__exportStar(require("./models/assembly-hierarchy-node"),exports),__exportStar(require("./models/assembly-hierarchy-node-breadcrumb"),exports),__exportStar(require("./models/image"),exports),__exportStar(require("./models/attribute"),exports),__exportStar(require("./models/csa-request"),exports),__exportStar(require("./models/csa-request-status"),exports),__exportStar(require("./models/filter-key"),exports),__exportStar(require("./models/filter-option-value"),exports),__exportStar(require("./models/shopping-cart"),exports),__exportStar(require("./models/multiple-expert-searches"),exports),__exportStar(require("./models/csa-request-search"),exports),__exportStar(require("./models/announcement"),exports),__exportStar(require("./models/inquiry"),exports),__exportStar(require("./models/mounting-location"),exports),__exportStar(require("./models/part-enrichment-data"),exports),__exportStar(require("./services/part.service"),exports),__exportStar(require("./services/part-enrichment.service"),exports),__exportStar(require("./services/related-parts.service"),exports),__exportStar(require("./services/assembly-hierarchy-nodes.service"),exports),__exportStar(require("./services/part-attribute.service"),exports),__exportStar(require("./services/customer-service-assistance.service"),exports),__exportStar(require("./services/filter.service"),exports),__exportStar(require("./services/shopping-cart.service"),exports),__exportStar(require("./services/inquiry.service"),exports),__exportStar(require("./services/announcement.service"),exports);
@@ -1,71 +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.Announcement = exports.AnnouncementRecipient = exports.ANNOUNCEMENT_TYPE = exports.ANNOUNCEMENTS_STATUS = void 0;
20
- var core_1 = require("../../core");
21
- var ANNOUNCEMENTS_STATUS;
22
- (function (ANNOUNCEMENTS_STATUS) {
23
- ANNOUNCEMENTS_STATUS["PUBLISHED"] = "PUBLISHED";
24
- ANNOUNCEMENTS_STATUS["UNPUBLISHED"] = "UNPUBLISHED";
25
- ANNOUNCEMENTS_STATUS["UNPUBLISHED_CHANGES"] = "UNPUBLISHED CHANGES";
26
- })(ANNOUNCEMENTS_STATUS || (exports.ANNOUNCEMENTS_STATUS = ANNOUNCEMENTS_STATUS = {}));
27
- var ANNOUNCEMENT_TYPE;
28
- (function (ANNOUNCEMENT_TYPE) {
29
- ANNOUNCEMENT_TYPE["APP"] = "app";
30
- ANNOUNCEMENT_TYPE["COMPANY"] = "company";
31
- })(ANNOUNCEMENT_TYPE || (exports.ANNOUNCEMENT_TYPE = ANNOUNCEMENT_TYPE = {}));
32
- var AnnouncementRecipient = /** @class */ (function (_super) {
33
- __extends(AnnouncementRecipient, _super);
34
- function AnnouncementRecipient(init) {
35
- var _this = _super.call(this) || this;
36
- Object.assign(_this, init);
37
- return _this;
38
- }
39
- AnnouncementRecipient.fromAPIResponse = function (requestData) {
40
- return new AnnouncementRecipient({
41
- partiumId: requestData['uuid'],
42
- name: requestData['name'],
43
- });
44
- };
45
- return AnnouncementRecipient;
46
- }(core_1.APIObject));
47
- exports.AnnouncementRecipient = AnnouncementRecipient;
48
- var Announcement = /** @class */ (function (_super) {
49
- __extends(Announcement, _super);
50
- function Announcement(init) {
51
- var _this = _super.call(this) || this;
52
- Object.assign(_this, init);
53
- return _this;
54
- }
55
- Announcement.fromAPIResponse = function (requestData) {
56
- return new Announcement({
57
- status: requestData['status'],
58
- title: requestData['title'],
59
- contents: requestData['contents'],
60
- timestamp: requestData['timestamp'],
61
- terminatesAt: requestData['terminatesAt'],
62
- announcementType: requestData['type'],
63
- recipients: requestData['recipients'],
64
- includeSubOrgs: requestData['includeSubOrgs'],
65
- sendEmails: requestData['sendEmails'],
66
- });
67
- };
68
- return Announcement;
69
- }(core_1.APIObject));
70
- exports.Announcement = Announcement;
71
- //# sourceMappingURL=announcement.js.map
2
+ "use strict";var __extends=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.Announcement=exports.AnnouncementRecipient=exports.ANNOUNCEMENT_TYPE=exports.ANNOUNCEMENTS_STATUS=void 0;var ANNOUNCEMENTS_STATUS,ANNOUNCEMENT_TYPE,core_1=require("../../core");!function(n){n.PUBLISHED="PUBLISHED",n.UNPUBLISHED="UNPUBLISHED",n.UNPUBLISHED_CHANGES="UNPUBLISHED CHANGES"}(ANNOUNCEMENTS_STATUS||(exports.ANNOUNCEMENTS_STATUS=ANNOUNCEMENTS_STATUS={})),function(n){n.APP="app",n.COMPANY="company"}(ANNOUNCEMENT_TYPE||(exports.ANNOUNCEMENT_TYPE=ANNOUNCEMENT_TYPE={}));var AnnouncementRecipient=function(n){function t(t){var e=n.call(this)||this;return Object.assign(e,t),e}return __extends(t,n),t.fromAPIResponse=function(n){return new t({partiumId:n.uuid,name:n.name})},t}(core_1.APIObject);exports.AnnouncementRecipient=AnnouncementRecipient;var Announcement=function(n){function t(t){var e=n.call(this)||this;return Object.assign(e,t),e}return __extends(t,n),t.fromAPIResponse=function(n){return new t({status:n.status,title:n.title,contents:n.contents,timestamp:n.timestamp,terminatesAt:n.terminatesAt,announcementType:n.type,recipients:n.recipients,includeSubOrgs:n.includeSubOrgs,sendEmails:n.sendEmails})},t}(core_1.APIObject);exports.Announcement=Announcement;