@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.
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 +4 -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,44 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PartiumConfig = exports.AUTHENTICATION_METHOD = void 0;
5
- var auth_config_1 = require("./auth-config");
6
- var fetch_api_https_client_service_1 = require("../integration-defaults/http/https-client/fetch-api-https-client.service");
7
- var fetch_api_file_transfer_service_1 = require("../integration-defaults/http/file-transfer/fetch-api-file-transfer.service");
8
- var web_local_storage_service_1 = require("../integration-defaults/web-local-storage.service");
9
- var web_device_status_service_1 = require("../integration-defaults/web-device-status.service");
10
- var web_file_service_1 = require("../integration-defaults/web-file.service");
11
- var AUTHENTICATION_METHOD;
12
- (function (AUTHENTICATION_METHOD) {
13
- AUTHENTICATION_METHOD[AUTHENTICATION_METHOD["OAUTH"] = 0] = "OAUTH";
14
- AUTHENTICATION_METHOD[AUTHENTICATION_METHOD["OAUTH_API_KEY"] = 1] = "OAUTH_API_KEY";
15
- })(AUTHENTICATION_METHOD || (exports.AUTHENTICATION_METHOD = AUTHENTICATION_METHOD = {}));
16
- /**
17
- * The Partium-configuration that is passed to the Partium-SDK for the initialization.
18
- * It contains information about the backend-url, the authentication-method and it's configuration,
19
- * and some references to Platform-Adapters that need to be implemented.
20
- */
21
- var PartiumConfig = /** @class */ (function () {
22
- function PartiumConfig(init) {
23
- this.partiumApiBaseUrl = 'https://api.partium.io';
24
- this.partiumLoginUrl = 'https://login.partium.io';
25
- this.authenticationMethod = AUTHENTICATION_METHOD.OAUTH_API_KEY; // authentication method
26
- this.recentPartsMaxPartHistoryLength = 30;
27
- this.favoritePartsMaxPartLength = 50;
28
- // Platform-Adapters
29
- this.httpsClientService = fetch_api_https_client_service_1.FetchAPIHttpsClientService; // https client to use throughout the app, should be set to a platform specific one, eg. for web: AxiosHttpsClientService
30
- this.fileTransferService = fetch_api_file_transfer_service_1.FetchAPIFileTransferService; // file-transfer service to use throughout the app, should be set to a platform specific one, eg. for web: AxiosFileTransferService
31
- this.localStorageService = web_local_storage_service_1.WebLocalStorageService; // local-storage service to use throughout the app, should be set to a platform specific one, eg. for web: WebLocalStorageService
32
- this.deviceStatusService = web_device_status_service_1.WebDeviceStatusService; // device-status service to use throughout the app, should be set to a platform specific one, eg. for web: WebDeviceStatusService
33
- this.fileService = web_file_service_1.WebFileService;
34
- Object.assign(this, init);
35
- if (this.authenticationMethod === AUTHENTICATION_METHOD.OAUTH) {
36
- if (!this.authenticationConfig) {
37
- this.authenticationConfig = new auth_config_1.OauthAuthenticationConfig();
38
- }
39
- }
40
- }
41
- return PartiumConfig;
42
- }());
43
- exports.PartiumConfig = PartiumConfig;
44
- //# sourceMappingURL=partium-config.js.map
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartiumConfig=exports.AUTHENTICATION_METHOD=void 0;var AUTHENTICATION_METHOD,auth_config_1=require("./auth-config"),fetch_api_https_client_service_1=require("../integration-defaults/http/https-client/fetch-api-https-client.service"),fetch_api_file_transfer_service_1=require("../integration-defaults/http/file-transfer/fetch-api-file-transfer.service"),web_local_storage_service_1=require("../integration-defaults/web-local-storage.service"),web_device_status_service_1=require("../integration-defaults/web-device-status.service"),web_file_service_1=require("../integration-defaults/web-file.service");!function(e){e[e.OAUTH=0]="OAUTH",e[e.OAUTH_API_KEY=1]="OAUTH_API_KEY"}(AUTHENTICATION_METHOD||(exports.AUTHENTICATION_METHOD=AUTHENTICATION_METHOD={}));var PartiumConfig=function(e){this.partiumApiBaseUrl="https://api.partium.io",this.partiumLoginUrl="https://login.partium.io",this.authenticationMethod=AUTHENTICATION_METHOD.OAUTH_API_KEY,this.recentPartsMaxPartHistoryLength=30,this.favoritePartsMaxPartLength=50,this.httpsClientService=fetch_api_https_client_service_1.FetchAPIHttpsClientService,this.fileTransferService=fetch_api_file_transfer_service_1.FetchAPIFileTransferService,this.localStorageService=web_local_storage_service_1.WebLocalStorageService,this.deviceStatusService=web_device_status_service_1.WebDeviceStatusService,this.fileService=web_file_service_1.WebFileService,Object.assign(this,e),this.authenticationMethod===AUTHENTICATION_METHOD.OAUTH&&(this.authenticationConfig||(this.authenticationConfig=new auth_config_1.OauthAuthenticationConfig))};exports.PartiumConfig=PartiumConfig;
@@ -1,12 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.createUserToken = createUserToken;
5
- var jwt_decode_1 = require("jwt-decode");
6
- /**
7
- * Decodes jwt token string and returns an object with type UserToken
8
- */
9
- function createUserToken(token) {
10
- return (0, jwt_decode_1.jwtDecode)(token);
11
- }
12
- //# sourceMappingURL=user-token.js.map
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createUserToken=createUserToken;var jwt_decode_1=require("jwt-decode");function createUserToken(e){return(0,jwt_decode_1.jwtDecode)(e)}
@@ -1,90 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.User = exports.Role = void 0;
5
- var Role;
6
- (function (Role) {
7
- Role["admin"] = "admin";
8
- Role["announcementsEditor"] = "announcementsEditor";
9
- /* Partium announcement editor: set via token when the Partium organization and AnnouncementsEditor role are identified within the string
10
- */
11
- Role["partiumAnnouncementsEditor"] = "partiumAnnouncementsEditor";
12
- /** @deprecated role does not exist in Partium */
13
- Role["user"] = "user";
14
- /** Partium Analytics user role */
15
- Role["analyst"] = "dataAnalyst";
16
- /** Partium Data Insights user role */
17
- Role["dataInsightAnalyst"] = "dataInsightAnalyst";
18
- Role["csa"] = "csa";
19
- Role["factoryWorker"] = "factoryWorker";
20
- Role["developer"] = "developer";
21
- Role["catalogAdmin"] = "catalogAdmin";
22
- Role["dataManipulator"] = "dataManipulator";
23
- Role["dataContributor"] = "dataContributor";
24
- Role["dataValidator"] = "dataValidator";
25
- })(Role || (exports.Role = Role = {}));
26
- /**
27
- * The user-object of the user that is logged in into the SDK.
28
- */
29
- var User = /** @class */ (function () {
30
- function User(email, role, roles, groups) {
31
- if (groups === void 0) { groups = []; }
32
- this.email = email;
33
- this.role = role;
34
- this.roles = roles ? roles : new Set([role]);
35
- this.groups = groups;
36
- }
37
- /**
38
- * Creates a User object from a UserToken object (parsed jwt token)
39
- * @param token - jwt token in UserToken format
40
- * @returns created User with values populated from token
41
- */
42
- User.createFromToken = function (token) {
43
- // the email is optional in Keycloak, this is a workaround to not break old code (e.g. caching)
44
- var email = token.email || token.preferred_username;
45
- var roles = this.createRoles(token);
46
- var groups = token.groups || [];
47
- var firstRole = roles.values().next().value;
48
- return new User(email, firstRole, roles, groups);
49
- };
50
- User.createRoles = function (token) {
51
- // if user token already contains a property `role` it takes it
52
- if (token.role) {
53
- return new Set([token.role]);
54
- }
55
- // create roles from the `groups` token claim
56
- if (token.groups) {
57
- var roles = new Set();
58
- for (var _i = 0, _a = token.groups; _i < _a.length; _i++) {
59
- var group = _a[_i];
60
- var role = this.getRoleFromGroup(group);
61
- roles.add(role);
62
- }
63
- return roles;
64
- }
65
- return new Set();
66
- };
67
- User.getRoleFromGroup = function (group) {
68
- var isPartiumOrg = this.checkPartiumRoles(group);
69
- var rolePart = group.slice(group.lastIndexOf('/') + 1);
70
- return this.getRoleByString(rolePart, isPartiumOrg);
71
- };
72
- User.checkPartiumRoles = function (group) {
73
- var groupSegments = group.split('/');
74
- // isPartium /partium/<role>
75
- var isPartiumOrg = groupSegments[groupSegments.length - 2] === 'partium';
76
- var role = groupSegments[groupSegments.length - 1];
77
- var roleArray = Object.values(Role);
78
- return isPartiumOrg && !!roleArray.find(function (userRole) { return userRole === role; });
79
- };
80
- User.getRoleByString = function (value, isPartiumOrg) {
81
- if (Object.values(Role).includes(value)) {
82
- var roleValue = value;
83
- return roleValue === Role.announcementsEditor && isPartiumOrg ? Role.partiumAnnouncementsEditor : roleValue;
84
- }
85
- return Role.factoryWorker;
86
- };
87
- return User;
88
- }());
89
- exports.User = User;
90
- //# sourceMappingURL=user.js.map
2
+ "use strict";var Role;Object.defineProperty(exports,"__esModule",{value:!0}),exports.User=exports.Role=void 0,function(e){e.admin="admin",e.announcementsEditor="announcementsEditor",e.partiumAnnouncementsEditor="partiumAnnouncementsEditor",e.user="user",e.analyst="dataAnalyst",e.dataInsightAnalyst="dataInsightAnalyst",e.csa="csa",e.factoryWorker="factoryWorker",e.developer="developer",e.catalogAdmin="catalogAdmin",e.dataManipulator="dataManipulator",e.dataContributor="dataContributor",e.dataValidator="dataValidator"}(Role||(exports.Role=Role={}));var User=function(){function e(e,t,r,n){void 0===n&&(n=[]),this.email=e,this.role=t,this.roles=r||new Set([t]),this.groups=n}return e.createFromToken=function(t){var r=t.email||t.preferred_username,n=this.createRoles(t),o=t.groups||[];return new e(r,n.values().next().value,n,o)},e.createRoles=function(e){if(e.role)return new Set([e.role]);if(e.groups){for(var t=new Set,r=0,n=e.groups;r<n.length;r++){var o=n[r],a=this.getRoleFromGroup(o);t.add(a)}return t}return new Set},e.getRoleFromGroup=function(e){var t=this.checkPartiumRoles(e),r=e.slice(e.lastIndexOf("/")+1);return this.getRoleByString(r,t)},e.checkPartiumRoles=function(e){var t=e.split("/"),r="partium"===t[t.length-2],n=t[t.length-1],o=Object.values(Role);return r&&!!o.find((function(e){return e===n}))},e.getRoleByString=function(e,t){if(Object.values(Role).includes(e)){var r=e;return r===Role.announcementsEditor&&t?Role.partiumAnnouncementsEditor:r}return Role.factoryWorker},e}();exports.User=User;
@@ -1,148 +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.BackendStatusService = void 0;
26
- var base_service_1 = require("./base.service");
27
- var rxjs_1 = require("rxjs");
28
- var error_1 = require("../models/error");
29
- var operators_1 = require("rxjs/operators");
30
- var https_client_service_interface_1 = require("./http/https-client/https-client.service.interface");
31
- var injection_identifier_1 = require("../decorators/injection-identifier");
32
- var device_status_service_interface_1 = require("./device-status.service.interface");
33
- /**
34
- * Service that provides functionality for contacting the Status-Backend to check
35
- * the current status of the Partium-Backend and if the SDKs version is compatible
36
- * with the Backend.
37
- */
38
- var BackendStatusService = /** @class */ (function (_super) {
39
- __extends(BackendStatusService, _super);
40
- function BackendStatusService(serviceProvider) {
41
- return _super.call(this, serviceProvider) || this;
42
- }
43
- BackendStatusService.prototype.onCreate = function () {
44
- this.httpsClientService = this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService);
45
- this.deviceStatusService = this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService);
46
- };
47
- /**
48
- * Initializes the status service
49
- *
50
- * @param appVersion The version of the current application
51
- * @param language The desired language of the response message
52
- * @param statusEndpoint The status service to check for planned downtimes, availability and compatibilitiy
53
- * @param connectivityCheckFallback The endpoint that should be invoked to thest if an internet connection is available. This is example.com as default
54
- * @param timeout The timeout in milliseconds, used by all http requests. It defaults to 3 seconds
55
- */
56
- BackendStatusService.prototype.init = function (appVersion, language, statusEndpoint, connectivityCheckFallback, timeout) {
57
- if (connectivityCheckFallback === void 0) { connectivityCheckFallback = 'https://example.com'; }
58
- if (timeout === void 0) { timeout = 3000; }
59
- this.appVersion = appVersion;
60
- this.language = language;
61
- this.statusEndpoint = statusEndpoint;
62
- this.connectivityCheckFallback = connectivityCheckFallback;
63
- this.timeout = timeout;
64
- };
65
- /**
66
- * Check the compatibility of the app and the backend.
67
- * Resolves if compatible, throws error if incompatible.
68
- * Displays according error to the user if incompatible.
69
- */
70
- BackendStatusService.prototype.checkCompatibility = function () {
71
- var _this = this;
72
- this.validateConfiguration();
73
- return this.httpsClientService.get("".concat(this.statusEndpoint, "/compatibility?appVersion=").concat(this.appVersion, "&appName=js-partium-sdk"))
74
- .pipe((0, operators_1.timeout)(this.timeout), (0, operators_1.mergeMap)(function (res) {
75
- if (res.requiresUpdate) {
76
- return (0, rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.SDK_OUTDATED, res.appDownloadLink));
77
- }
78
- return (0, rxjs_1.of)(true); // resolve
79
- }), (0, operators_1.catchError)(function (error) {
80
- return _this.checkAvailability()
81
- .pipe((0, operators_1.map)(function (status) {
82
- throw error;
83
- }));
84
- }));
85
- };
86
- /**
87
- * Check the availability of the backend.
88
- * Resolves if compatible, throws error if incompatible.
89
- * Displays according error to the user if incompatible.
90
- */
91
- BackendStatusService.prototype.checkAvailability = function () {
92
- var _this = this;
93
- this.validateConfiguration();
94
- return (0, rxjs_1.from)(this.deviceStatusService.isConnectionAvailable())
95
- .pipe((0, operators_1.mergeMap)(function (connectionStatus) {
96
- if (!connectionStatus) {
97
- throw new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET, null);
98
- }
99
- return _this.httpsClientService.get("".concat(_this.statusEndpoint, "/status?language=").concat(_this.language))
100
- .pipe((0, operators_1.timeout)(_this.timeout), (0, operators_1.mergeMap)(function (res) {
101
- if (res.isUp) {
102
- return (0, rxjs_1.of)(true); // resolve
103
- }
104
- throw new error_1.SdkError(error_1.SDK_ERROR_CODES.BACKEND_DOWN, res.message);
105
- }), (0, operators_1.catchError)(function (error) {
106
- if (error instanceof error_1.SdkError && error.code === error_1.SDK_ERROR_CODES.BACKEND_DOWN) { // forward error
107
- return (0, rxjs_1.throwError)(error);
108
- }
109
- // do connectivity fallback check
110
- return _this.httpsClientService.get(_this.connectivityCheckFallback)
111
- .pipe((0, operators_1.timeout)(_this.timeout), (0, operators_1.map)(function () {
112
- throw new error_1.SdkError(error_1.SDK_ERROR_CODES.STATUS_BACKEND_DOWN, {});
113
- }), (0, operators_1.catchError)(function (error) {
114
- if (error instanceof error_1.SdkError && (error.code === error_1.SDK_ERROR_CODES.BACKEND_DOWN || error.code === error_1.SDK_ERROR_CODES.STATUS_BACKEND_DOWN)) { // forward error
115
- return (0, rxjs_1.throwError)(error);
116
- }
117
- return (0, rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET, error));
118
- }));
119
- }));
120
- }));
121
- };
122
- /**
123
- * Checks the configuration
124
- */
125
- BackendStatusService.prototype.validateConfiguration = function () {
126
- if (!this.appVersion) {
127
- throw new Error("Invalid configuration: appVersion is ".concat(this.appVersion));
128
- }
129
- if (!this.language) {
130
- throw new Error("Invalid configuration: language is ".concat(this.language));
131
- }
132
- if (!this.statusEndpoint) {
133
- throw new Error("Invalid configuration: statusEndpoint is ".concat(this.statusEndpoint));
134
- }
135
- if (!this.connectivityCheckFallback) {
136
- throw new Error("Invalid configuration: statusEndpoint is ".concat(this.connectivityCheckFallback));
137
- }
138
- if (typeof this.timeout !== 'number') {
139
- throw new Error("Invalid configuration: timeout is ".concat(this.timeout, " of type ").concat(typeof this.timeout));
140
- }
141
- };
142
- BackendStatusService = __decorate([
143
- (0, injection_identifier_1.InjectionIdentifier)('BackendStatusService')
144
- ], BackendStatusService);
145
- return BackendStatusService;
146
- }(base_service_1.BaseService));
147
- exports.BackendStatusService = BackendStatusService;
148
- //# sourceMappingURL=backend-status.service.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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__decorate=this&&this.__decorate||function(t,e,r,i){var o,n=arguments.length,c=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(c=(n<3?o(c):n>3?o(e,r,c):o(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.BackendStatusService=void 0;var base_service_1=require("./base.service"),rxjs_1=require("rxjs"),error_1=require("../models/error"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./http/https-client/https-client.service.interface"),injection_identifier_1=require("../decorators/injection-identifier"),device_status_service_interface_1=require("./device-status.service.interface"),BackendStatusService=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},e.prototype.init=function(t,e,r,i,o){void 0===i&&(i="https://example.com"),void 0===o&&(o=3e3),this.appVersion=t,this.language=e,this.statusEndpoint=r,this.connectivityCheckFallback=i,this.timeout=o},e.prototype.checkCompatibility=function(){var t=this;return this.validateConfiguration(),this.httpsClientService.get("".concat(this.statusEndpoint,"/compatibility?appVersion=").concat(this.appVersion,"&appName=js-partium-sdk")).pipe((0,operators_1.timeout)(this.timeout),(0,operators_1.mergeMap)((function(t){return t.requiresUpdate?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.SDK_OUTDATED,t.appDownloadLink)):(0,rxjs_1.of)(!0)})),(0,operators_1.catchError)((function(e){return t.checkAvailability().pipe((0,operators_1.map)((function(t){throw e})))})))},e.prototype.checkAvailability=function(){var t=this;return this.validateConfiguration(),(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.mergeMap)((function(e){if(!e)throw new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,null);return t.httpsClientService.get("".concat(t.statusEndpoint,"/status?language=").concat(t.language)).pipe((0,operators_1.timeout)(t.timeout),(0,operators_1.mergeMap)((function(t){if(t.isUp)return(0,rxjs_1.of)(!0);throw new error_1.SdkError(error_1.SDK_ERROR_CODES.BACKEND_DOWN,t.message)})),(0,operators_1.catchError)((function(e){return e instanceof error_1.SdkError&&e.code===error_1.SDK_ERROR_CODES.BACKEND_DOWN?(0,rxjs_1.throwError)(e):t.httpsClientService.get(t.connectivityCheckFallback).pipe((0,operators_1.timeout)(t.timeout),(0,operators_1.map)((function(){throw new error_1.SdkError(error_1.SDK_ERROR_CODES.STATUS_BACKEND_DOWN,{})})),(0,operators_1.catchError)((function(t){return t instanceof error_1.SdkError&&(t.code===error_1.SDK_ERROR_CODES.BACKEND_DOWN||t.code===error_1.SDK_ERROR_CODES.STATUS_BACKEND_DOWN)?(0,rxjs_1.throwError)(t):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,t))})))})))})))},e.prototype.validateConfiguration=function(){if(!this.appVersion)throw new Error("Invalid configuration: appVersion is ".concat(this.appVersion));if(!this.language)throw new Error("Invalid configuration: language is ".concat(this.language));if(!this.statusEndpoint)throw new Error("Invalid configuration: statusEndpoint is ".concat(this.statusEndpoint));if(!this.connectivityCheckFallback)throw new Error("Invalid configuration: statusEndpoint is ".concat(this.connectivityCheckFallback));if("number"!=typeof this.timeout)throw new Error("Invalid configuration: timeout is ".concat(this.timeout," of type ").concat(typeof this.timeout))},e=__decorate([(0,injection_identifier_1.InjectionIdentifier)("BackendStatusService")],e)}(base_service_1.BaseService);exports.BackendStatusService=BackendStatusService;
@@ -1,58 +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.BaseLoginInitService = void 0;
20
- var rxjs_1 = require("rxjs");
21
- var base_service_1 = require("./base.service");
22
- /**
23
- * Base class for all services that need to successfully initialize during login of the user.
24
- *
25
- * The init-function of Services outside the core-module can not directly be initialized,
26
- * because this would lead to circular dependencies.
27
- * To still allow Services to have a mandatory init-phase during login, they can be
28
- * registered to be initialized during login-phase.
29
- */
30
- var BaseLoginInitService = /** @class */ (function (_super) {
31
- __extends(BaseLoginInitService, _super);
32
- function BaseLoginInitService() {
33
- return _super !== null && _super.apply(this, arguments) || this;
34
- }
35
- /**
36
- * Initialization function of the service.
37
- * When registered, this function will be called during login process, which can only
38
- * finish successfully if this init function resolves without error.
39
- *
40
- * Throw an error to cancel login process.
41
- *
42
- * Method should be overridden by child-class
43
- *
44
- * @param config the PartiumConfig is passed to allow initializations using the config
45
- * @param userEmail the current users eMail address
46
- * @param currentOrganization$ Observable that always emits when the current organization changes
47
- * @returns Observable that resolves when the initialization of the service is successful
48
- */
49
- BaseLoginInitService.prototype.init = function (config, userEmail, currentOrganization$) {
50
- this.config = config;
51
- this.userEmail = userEmail;
52
- this.currentOrganization$ = currentOrganization$;
53
- return (0, rxjs_1.of)(undefined); // resolve
54
- };
55
- return BaseLoginInitService;
56
- }(base_service_1.BaseService));
57
- exports.BaseLoginInitService = BaseLoginInitService;
58
- //# sourceMappingURL=base-login-init.service.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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseLoginInitService=void 0;var rxjs_1=require("rxjs"),base_service_1=require("./base.service"),BaseLoginInitService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(e,t,r){return this.config=e,this.userEmail=t,this.currentOrganization$=r,(0,rxjs_1.of)(void 0)},t}(base_service_1.BaseService);exports.BaseLoginInitService=BaseLoginInitService;
@@ -1,38 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BaseService = void 0;
5
- /**
6
- * Base class for all services.
7
- *
8
- * Singleton instance will be managed via ServiceProvider.
9
- * @Injectable-decorator makes sure that the serviceProvider can address
10
- * the class by it's name, even after the code is uglified.
11
- */
12
- var BaseService = /** @class */ (function () {
13
- function BaseService(serviceProvider) {
14
- this.serviceProvider = serviceProvider;
15
- }
16
- /**
17
- * Function that is called after the service has been instantiated and all serviceProvider.useService()-Calls
18
- * are finished. This function can be overridden if needed, it will be mainly used for service-injection to
19
- * get references to other base-services.
20
- */
21
- BaseService.prototype.onCreate = function () {
22
- // do nothing, can be overridden by child if needed
23
- };
24
- /**
25
- * Returns the name of the class as it should be used for Service-injection.
26
- * This function should not be overwritten by child-classes, it will be replaced
27
- * by the decorator.
28
- * This is required, because class.name can not be used after uglifying the code.
29
- *
30
- * @returns unique name used for service-injection
31
- */
32
- BaseService.getInjectionIdentifierName = function () {
33
- throw new Error("Class can not be used for Service-Injection. Add InjectionIdentifier-decorator if you want to do so.");
34
- };
35
- return BaseService;
36
- }());
37
- exports.BaseService = BaseService;
38
- //# sourceMappingURL=base.service.js.map
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseService=void 0;var BaseService=function(){function e(e){this.serviceProvider=e}return e.prototype.onCreate=function(){},e.getInjectionIdentifierName=function(){throw new Error("Class can not be used for Service-Injection. Add InjectionIdentifier-decorator if you want to do so.")},e}();exports.BaseService=BaseService;
@@ -1,118 +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
- Object.defineProperty(exports, "__esModule", { value: true });
61
- exports.DeviceStatusService = void 0;
62
- var base_service_1 = require("./base.service");
63
- var injection_identifier_1 = require("../decorators/injection-identifier");
64
- /**
65
- * Class that defines structure of a device-status-service implementation.
66
- * It contains functions that give information about the device status,
67
- * such as network-connectivity.
68
- *
69
- * An implementation of this service is required and has to be configured during
70
- * the initialization phase of Partium.
71
- *
72
- * This class file is called interface, even though it is not an interface,
73
- * but we need it to be a concrete class for the serviceProvider.
74
- */
75
- var DeviceStatusService = /** @class */ (function (_super) {
76
- __extends(DeviceStatusService, _super);
77
- function DeviceStatusService() {
78
- return _super !== null && _super.apply(this, arguments) || this;
79
- }
80
- /**
81
- * Returns Promise that resolves with true if connection to a network is available.
82
- * (Usually the internet, but for intranet-only systems it can also be only intranet)
83
- *
84
- * Method should be overridden by child-class
85
- *
86
- * @returns promise that resolves with true or false, depending on whether a
87
- * network-connection is available or not
88
- */
89
- DeviceStatusService.prototype.isConnectionAvailable = function () {
90
- return __awaiter(this, void 0, void 0, function () {
91
- return __generator(this, function (_a) {
92
- throw new Error("In order to use the DeviceStatusService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
93
- });
94
- });
95
- };
96
- /**
97
- * Returns Promise that resolves with a DeviceInfo object, containing
98
- * information about the device and the installation.
99
- * Used for logging.
100
- *
101
- * Method should be overridden by child-class
102
- *
103
- * @returns Promise that resolves with DeviceInfo
104
- */
105
- DeviceStatusService.prototype.getDeviceInfo = function () {
106
- return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- throw new Error("In order to use the DeviceStatusService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
109
- });
110
- });
111
- };
112
- DeviceStatusService = __decorate([
113
- (0, injection_identifier_1.InjectionIdentifier)('DeviceStatusService')
114
- ], DeviceStatusService);
115
- return DeviceStatusService;
116
- }(base_service_1.BaseService));
117
- exports.DeviceStatusService = DeviceStatusService;
118
- //# sourceMappingURL=device-status.service.interface.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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,c=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(t,r,c):o(t,r))||c);return i>3&&c&&Object.defineProperty(t,r,c),c},__awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function c(e){try{s(n.next(e))}catch(e){i(e)}}function a(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,a)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,n=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DeviceStatusService=void 0;var base_service_1=require("./base.service"),injection_identifier_1=require("../decorators/injection-identifier"),DeviceStatusService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.isConnectionAvailable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("In order to use the DeviceStatusService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.getDeviceInfo=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("In order to use the DeviceStatusService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("DeviceStatusService")],t)}(base_service_1.BaseService);exports.DeviceStatusService=DeviceStatusService;
@@ -1,62 +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.FileService = void 0;
26
- var base_service_1 = require("./base.service");
27
- var injection_identifier_1 = require("../decorators/injection-identifier");
28
- /**
29
- * Class that defines the structure for the FileService implementation.
30
- *
31
- * It contains functions for extract information about the assets.
32
- */
33
- var FileService = /** @class */ (function (_super) {
34
- __extends(FileService, _super);
35
- function FileService() {
36
- return _super !== null && _super.apply(this, arguments) || this;
37
- }
38
- /**
39
- * Get file type of a file.
40
- *
41
- * @param pFile The file to get the type from.
42
- * @returns Promise<PFileType> The type
43
- */
44
- FileService.prototype.getFileType = function (pFile) {
45
- throw new Error("In order to use the FileService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
46
- };
47
- /**
48
- * Get dimensions of an image file.
49
- *
50
- * @param pFile The image file.
51
- * @returns Promise<[number, number]> where first element is width and second one is height.
52
- */
53
- FileService.prototype.getImageDimensions = function (pFile) {
54
- throw new Error("In order to use the FileService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
55
- };
56
- FileService = __decorate([
57
- (0, injection_identifier_1.InjectionIdentifier)('FileService')
58
- ], FileService);
59
- return FileService;
60
- }(base_service_1.BaseService));
61
- exports.FileService = FileService;
62
- //# sourceMappingURL=file.service.interface.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 i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__decorate=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,c=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(c=(n<3?o(c):n>3?o(t,r,c):o(t,r))||c);return n>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileService=void 0;var base_service_1=require("./base.service"),injection_identifier_1=require("../decorators/injection-identifier"),FileService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getFileType=function(e){throw new Error("In order to use the FileService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.getImageDimensions=function(e){throw new Error("In order to use the FileService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("FileService")],t)}(base_service_1.BaseService);exports.FileService=FileService;