@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,126 +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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
25
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26
- if (ar || !(i in from)) {
27
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
28
- ar[i] = from[i];
29
- }
30
- }
31
- return to.concat(ar || Array.prototype.slice.call(from));
32
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.FileTransferService = exports.TRANSFER_STATUS = void 0;
35
- var base_service_1 = require("../../base.service");
36
- var injection_identifier_1 = require("../../../decorators/injection-identifier");
37
- var TRANSFER_STATUS;
38
- (function (TRANSFER_STATUS) {
39
- TRANSFER_STATUS[TRANSFER_STATUS["TRANSFERRING"] = 0] = "TRANSFERRING";
40
- TRANSFER_STATUS[TRANSFER_STATUS["TRANSFER_FINISHED"] = 1] = "TRANSFER_FINISHED";
41
- })(TRANSFER_STATUS || (exports.TRANSFER_STATUS = TRANSFER_STATUS = {}));
42
- /**
43
- * Service interface for providing primitive file upload and download functionality.
44
- * Based on the platform that is used, this service
45
- * needs to be implemented accordingly.
46
- *
47
- * An implementation of this service is required and has to be configured during
48
- * the initialization phase of Partium.
49
- *
50
- * This class file is called interface, even though it is not an interface,
51
- * but we need it to be a concrete class for the serviceProvider.
52
- */
53
- var FileTransferService = /** @class */ (function (_super) {
54
- __extends(FileTransferService, _super);
55
- function FileTransferService(serviceProvider, knownBaseUrls) {
56
- var _this = _super.call(this, serviceProvider) || this;
57
- _this.allowedDomains = __spreadArray(__spreadArray([
58
- 'cloudfront.net', // Amazon Cloudfront cache
59
- 'amazonaws.com', // Amazon AWS services
60
- 'windows.net'
61
- ], knownBaseUrls.map(function (u) {
62
- try {
63
- return (new URL(u)).host;
64
- }
65
- catch (_a) {
66
- return u;
67
- }
68
- }), true), [
69
- 'FILE_URL',
70
- 'ASSET_URL',
71
- ], false).map(function (u) { return u.toLowerCase().split('.'); });
72
- return _this;
73
- }
74
- FileTransferService.prototype.validateIsKnownUrlOrCry = function (url) {
75
- var host = url.toLowerCase();
76
- try {
77
- host = new URL(url).host;
78
- }
79
- catch (_a) {
80
- }
81
- for (var _i = 0, _b = this.allowedDomains; _i < _b.length; _i++) {
82
- var domain = _b[_i];
83
- var subDomainToEvaluate = __spreadArray([], domain, true);
84
- do {
85
- if (host.endsWith(subDomainToEvaluate.join('.'))) {
86
- return;
87
- }
88
- subDomainToEvaluate.shift();
89
- } while (subDomainToEvaluate.length > 2);
90
- }
91
- throw new Error("Trying to transfer files to/from unknown endpoint ".concat(url));
92
- };
93
- /**
94
- * Upload the given file to the given url and emit the upload status and progress during the
95
- * upload-process.
96
- *
97
- * Method should be overridden by child-class
98
- *
99
- * @param fileToUpload can be any PFile type that should be uploaded (depending on platform),
100
- * only the implementation of this interface needs to know how to deal with
101
- * the upload
102
- * @param uploadUrl the target upload url (must be publicly available without authentication)
103
- * @returns Observable that emits the UploadStatus
104
- */
105
- FileTransferService.prototype.uploadFile = function (fileToUpload, uploadUrl) {
106
- throw new Error("In order to use the FileTransferService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
107
- };
108
- /**
109
- * Download a file from the given url
110
- *
111
- * Method should be overridden by child-class
112
- *
113
- * @param url the download url (must be publicly available without authentication)
114
- * @returns Observable that emits the DownloadStatus and resolves with a PFile that wraps the
115
- * downloaded file in a platform-specific way
116
- */
117
- FileTransferService.prototype.downloadFile = function (url) {
118
- throw new Error("In order to use the FileTransferService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
119
- };
120
- FileTransferService = __decorate([
121
- (0, injection_identifier_1.InjectionIdentifier)('FileTransferService')
122
- ], FileTransferService);
123
- return FileTransferService;
124
- }(base_service_1.BaseService));
125
- exports.FileTransferService = FileTransferService;
126
- //# sourceMappingURL=file-transfer.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 n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,i=arguments.length,s=i<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,r,t,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(r,t,s):o(r,t))||s);return i>3&&s&&Object.defineProperty(r,t,s),s},__spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileTransferService=exports.TRANSFER_STATUS=void 0;var TRANSFER_STATUS,base_service_1=require("../../base.service"),injection_identifier_1=require("../../../decorators/injection-identifier");!function(e){e[e.TRANSFERRING=0]="TRANSFERRING",e[e.TRANSFER_FINISHED=1]="TRANSFER_FINISHED"}(TRANSFER_STATUS||(exports.TRANSFER_STATUS=TRANSFER_STATUS={}));var FileTransferService=function(e){function r(r,t){var n=e.call(this,r)||this;return n.allowedDomains=__spreadArray(__spreadArray(["cloudfront.net","amazonaws.com","windows.net"],t.map((function(e){try{return new URL(e).host}catch(r){return e}})),!0),["FILE_URL","ASSET_URL"],!1).map((function(e){return e.toLowerCase().split(".")})),n}return __extends(r,e),r.prototype.validateIsKnownUrlOrCry=function(e){var r=e.toLowerCase();try{r=new URL(e).host}catch(e){}for(var t=0,n=this.allowedDomains;t<n.length;t++){var o=n[t],i=__spreadArray([],o,!0);do{if(r.endsWith(i.join(".")))return;i.shift()}while(i.length>2)}throw new Error("Trying to transfer files to/from unknown endpoint ".concat(e))},r.prototype.uploadFile=function(e,r){throw new Error("In order to use the FileTransferService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.downloadFile=function(e){throw new Error("In order to use the FileTransferService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("FileTransferService")],r)}(base_service_1.BaseService);exports.FileTransferService=FileTransferService;
@@ -1,153 +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.HttpsClientService = void 0;
26
- var injection_identifier_1 = require("../../../decorators/injection-identifier");
27
- var general_helper_1 = require("../../../utils/general-helper");
28
- var base_service_1 = require("../../base.service");
29
- /**
30
- * Https-Client-Service is an interface that should be implemented by the platform/framework
31
- * that uses the JS-SDK. It should provide functions to do basic https-calls (like GET, POST, ...)
32
- * to any web-service.
33
- * Currently only GET, PATCH, POST are supported, but it could be extended
34
- * easily.
35
- *
36
- * If you implement this service, make sure to throw the correct errors, if the request
37
- * fails. (eg: SDK_ERROR_CODES.NO_INTERNET)
38
- *
39
- * An implementation of this service is required and has to be configured during
40
- * the initialization phase of Partium.
41
- *
42
- * Note; We didn't implement this class as a real javascript interface to allow it to have
43
- * some functionality already implemented. We could also not use an abstract class, because
44
- * of the Service-Provider implementation that we use.
45
- */
46
- var HttpsClientService = /** @class */ (function (_super) {
47
- __extends(HttpsClientService, _super);
48
- function HttpsClientService(serviceProvider, knownBaseUrls) {
49
- var _this = _super.call(this, serviceProvider) || this;
50
- _this.knownBaseUrls = knownBaseUrls.map(function (v) { return v.toLowerCase(); });
51
- return _this;
52
- }
53
- HttpsClientService.prototype.validateIsKnownUrlOrCry = function (url) {
54
- var normalizedUrl = url.toLowerCase();
55
- for (var _i = 0, _a = this.knownBaseUrls; _i < _a.length; _i++) {
56
- var service = _a[_i];
57
- if (normalizedUrl.startsWith(service)) {
58
- return;
59
- }
60
- }
61
- throw new Error("The given URL is not a known service \"".concat(url, "\"."));
62
- };
63
- /**
64
- * Send GET request to a server.
65
- *
66
- * @param url the full server url
67
- * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
68
- * @param headers object with the request headers
69
- * @returns Observable that resolves with the request result
70
- */
71
- HttpsClientService.prototype.get = function (url, urlParams, headers) {
72
- throw new Error("In order to use the get HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
73
- };
74
- /**
75
- * Send POST request to the server with the given url and content.
76
- *
77
- * @param url the full server url
78
- * @param data the data to be sent with the post request
79
- * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
80
- * @param headers object with the request headers
81
- * @returns Observable that resolves with the request result
82
- */
83
- HttpsClientService.prototype.post = function (url, data, urlParams, headers) {
84
- throw new Error("In order to use the post HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
85
- };
86
- /**
87
- * Send PUT request to the server with the given url and content.
88
- *
89
- * @param url the full server url
90
- * @param data the data to be sent with the post request
91
- * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
92
- * @param headers object with the request headers
93
- * @returns Observable that resolves with the request result
94
- */
95
- HttpsClientService.prototype.put = function (url, data, urlParams, headers) {
96
- throw new Error("In order to use the put HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
97
- };
98
- /**
99
- * Send PATCH request to the server with the given url and content.
100
- *
101
- * @param url the full server url
102
- * @param data the data to be sent with the patch request
103
- * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
104
- * @param headers object with the request headers
105
- * @returns Observable that resolves with the request result
106
- */
107
- HttpsClientService.prototype.patch = function (url, data, urlParams, headers) {
108
- throw new Error("In order to use the patch HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
109
- };
110
- /**
111
- * Send DELETE request to the server with the given url and content.
112
- *
113
- * @param url the full server url
114
- * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
115
- * @param headers object with the request headers
116
- * @returns Observable that resolves with the request result
117
- */
118
- HttpsClientService.prototype.delete = function (url, data, urlParams, headers) {
119
- throw new Error("In order to use the delete HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
120
- };
121
- /**
122
- * Add url parameters to the given url and return it as string.
123
- * If one of the parameter already exists, it will be replaced with
124
- * the new value.
125
- * If an object of the array contains multiple params, all are added.
126
- *
127
- * @param url the url to add the parameters to
128
- * @param paramObjects array of objects with parameters that should be appended, eg: [{ pageNumber: 4 }]
129
- * @returns the given url with the appended parameters
130
- */
131
- HttpsClientService.prototype.addUrlParameters = function (url, paramObjects) {
132
- return (0, general_helper_1.addUrlParameters)(url, paramObjects);
133
- };
134
- /**
135
- * Add an url parameter to the given url and return it as string.
136
- * If the same parameter already exists, it will be replaced with
137
- * the new value.
138
- * If an object of the array contains multiple params, all are added.
139
- *
140
- * @param url the url to add the parameter to
141
- * @param paramObject the object with one or more params to append, eg: { pageNumber: 4 }
142
- * @returns the given url with the appended parameter
143
- */
144
- HttpsClientService.prototype.addUrlParameter = function (url, paramObject) {
145
- return (0, general_helper_1.addUrlParameter)(url, paramObject);
146
- };
147
- HttpsClientService = __decorate([
148
- (0, injection_identifier_1.InjectionIdentifier)('HttpsClientService')
149
- ], HttpsClientService);
150
- return HttpsClientService;
151
- }(base_service_1.BaseService));
152
- exports.HttpsClientService = HttpsClientService;
153
- //# sourceMappingURL=https-client.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,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsClientService=void 0;var injection_identifier_1=require("../../../decorators/injection-identifier"),general_helper_1=require("../../../utils/general-helper"),base_service_1=require("../../base.service"),HttpsClientService=function(e){function t(t,r){var n=e.call(this,t)||this;return n.knownBaseUrls=r.map((function(e){return e.toLowerCase()})),n}return __extends(t,e),t.prototype.validateIsKnownUrlOrCry=function(e){for(var t=e.toLowerCase(),r=0,n=this.knownBaseUrls;r<n.length;r++){var o=n[r];if(t.startsWith(o))return}throw new Error('The given URL is not a known service "'.concat(e,'".'))},t.prototype.get=function(e,t,r){throw new Error("In order to use the get HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.post=function(e,t,r,n){throw new Error("In order to use the post HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.put=function(e,t,r,n){throw new Error("In order to use the put HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.patch=function(e,t,r,n){throw new Error("In order to use the patch HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.delete=function(e,t,r,n){throw new Error("In order to use the delete HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.addUrlParameters=function(e,t){return(0,general_helper_1.addUrlParameters)(e,t)},t.prototype.addUrlParameter=function(e,t){return(0,general_helper_1.addUrlParameter)(e,t)},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsClientService")],t)}(base_service_1.BaseService);exports.HttpsClientService=HttpsClientService;
@@ -13,7 +13,8 @@ export declare enum BACKEND_SERVICE {
13
13
  USER_DATA = 5,
14
14
  OCR = 6,
15
15
  MANAGEMENT = 7,
16
- CATALOG = 8
16
+ CATALOG = 8,
17
+ DATACURATION = 9
17
18
  }
18
19
  export interface BaseUrls {
19
20
  partiumApiBaseUrl: string;
@@ -25,6 +26,7 @@ export interface BaseUrls {
25
26
  ocrBeBaseUrl: string;
26
27
  managementBeBaseUrl: string;
27
28
  catalogBeBaseUrl: string;
29
+ datacurationBeBaseUrl: string;
28
30
  }
29
31
  /**
30
32
  * Defines the structure of a https-service implementation, which
@@ -1,295 +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.HttpsService = exports.BACKEND_SERVICE = void 0;
26
- var base_service_1 = require("../base.service");
27
- var rxjs_1 = require("rxjs");
28
- var operators_1 = require("rxjs/operators");
29
- var https_client_service_interface_1 = require("./https-client/https-client.service.interface");
30
- var injection_identifier_1 = require("../../decorators/injection-identifier");
31
- // TODO SSL pinning -> https://github.com/axios/axios/issues/1759
32
- // and -> https://github.com/MaxToyberman/react-native-ssl-pinning/issues/54
33
- var BACKEND_SERVICE;
34
- (function (BACKEND_SERVICE) {
35
- BACKEND_SERVICE[BACKEND_SERVICE["PARTIUM"] = 0] = "PARTIUM";
36
- BACKEND_SERVICE[BACKEND_SERVICE["FIND"] = 1] = "FIND";
37
- BACKEND_SERVICE[BACKEND_SERVICE["DATA"] = 2] = "DATA";
38
- BACKEND_SERVICE[BACKEND_SERVICE["CSA"] = 3] = "CSA";
39
- BACKEND_SERVICE[BACKEND_SERVICE["LOG"] = 4] = "LOG";
40
- BACKEND_SERVICE[BACKEND_SERVICE["USER_DATA"] = 5] = "USER_DATA";
41
- BACKEND_SERVICE[BACKEND_SERVICE["OCR"] = 6] = "OCR";
42
- BACKEND_SERVICE[BACKEND_SERVICE["MANAGEMENT"] = 7] = "MANAGEMENT";
43
- BACKEND_SERVICE[BACKEND_SERVICE["CATALOG"] = 8] = "CATALOG";
44
- })(BACKEND_SERVICE || (exports.BACKEND_SERVICE = BACKEND_SERVICE = {}));
45
- /**
46
- * Defines the structure of a https-service implementation, which
47
- * is used for Partium-backend communication.
48
- * This sdk provides different https-services, based on the authentication-
49
- * method the user wants to use.
50
- * By inheriting from this class and using serviceProvider.useService, a
51
- * concrete implementation of a https-service can be chosen at runtime.
52
- * This could be useful if for example a custom http-client should be used.
53
- *
54
- * An implementation of this service is required and has to be configured during
55
- * the initialization phase of Partium.
56
- *
57
- * This class file is called interface, even though it is not an interface,
58
- * but we need it to be a concrete class for the serviceProvider.
59
- */
60
- var HttpsService = /** @class */ (function (_super) {
61
- __extends(HttpsService, _super);
62
- function HttpsService(serviceProvider) {
63
- return _super.call(this, serviceProvider) || this;
64
- }
65
- HttpsService.prototype.onCreate = function () {
66
- this.httpsClientService = this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService);
67
- };
68
- /**
69
- * Initialize the https-service with configuration parameters.
70
- *
71
- * @param baseUrls: the base-urls for the different backends
72
- * @param config the https service configuration
73
- */
74
- HttpsService.prototype.init = function (baseUrls, config) {
75
- this.baseUrls = baseUrls;
76
- this.config = config;
77
- return (0, rxjs_1.of)(void 0); // resolve observable that returns void
78
- };
79
- /**
80
- * Send GET request to the Partium-backend with the given relative url.
81
- *
82
- * @param url the relative url
83
- * @param urlParams array of url parameters (as objects) which will be appended to the url, eg: [{ p1: x }, { p2: y }] will become <url>?p1=x&p2=y
84
- * @param beService to which backend-service should the request be sent (default FIND)
85
- * @returns Observable that resolves with the request result
86
- */
87
- HttpsService.prototype.get = function (url, urlParams, beService) {
88
- var _this = this;
89
- // we use "defer" here, because this allows us to retry the Observable with a newly created header in error-case. This is important to use the updated access-token if the session ran out and we use retryWhen. If we would not use it it would retry the already used one, which would immediately result in the same error as the previous one.
90
- return (0, rxjs_1.defer)(function () {
91
- return _this.configureHeaders({}, beService);
92
- }).pipe((0, operators_1.mergeMap)(function (headers) {
93
- return _this.httpsClientService.get(_this.createUrl(url, beService), urlParams, headers);
94
- }), (0, operators_1.retryWhen)(function (errors) { return _this.retryWhen(errors); }), (0, operators_1.catchError)(function (error) { return _this.processError(error); }));
95
- };
96
- /**
97
- * Send POST request to the Partium-backend with the given relative url and content.
98
- *
99
- * @param url the relative url
100
- * @param data the data to be sent with the post request
101
- * @param urlParams array of url parameters (as objects) which will be appended to the url, eg: [{ p1: x }, { p2: y }] will become <url>?p1=x&p2=y
102
- * @param beService to which backend-service should the request be sent (default FIND)
103
- * @param headers object with custom headers to send with the request
104
- * @returns Observable that resolves with the request result
105
- */
106
- HttpsService.prototype.post = function (url, data, urlParams, beService, headers) {
107
- var _this = this;
108
- // we use "defer" here, because this allows us to retry the Observable with a newly created header in error-case. This is important to use the updated access-token if the session ran out and we use retryWhen. If we would not use it it would retry the already used one, which would immediately result in the same error as the previous one.
109
- return (0, rxjs_1.defer)(function () {
110
- return _this.configureHeaders(headers, beService);
111
- }).pipe((0, operators_1.mergeMap)(function (headers) {
112
- return _this.httpsClientService.post(_this.createUrl(url, beService), data, urlParams, headers);
113
- }), (0, operators_1.retryWhen)(function (errors) { return _this.retryWhen(errors); }), (0, operators_1.catchError)(function (error) { return _this.processError(error); }));
114
- };
115
- /**
116
- * Send PUT request to the Partium-backend with the given relative url and content.
117
- *
118
- * @param url the relative url
119
- * @param data the data to be sent with the post request
120
- * @param urlParams array of url parameters (as objects) which will be appended to the url, eg: [{ p1: x }, { p2: y }] will become <url>?p1=x&p2=y
121
- * @param beService to which backend-service should the request be sent (default FIND)
122
- * @param headers object with custom headers to send with the request
123
- * @returns Observable that resolves with the request result
124
- */
125
- HttpsService.prototype.put = function (url, data, urlParams, beService, headers) {
126
- var _this = this;
127
- // we use "defer" here, because this allows us to retry the Observable with a newly created header in error-case. This is important to use the updated access-token if the session ran out and we use retryWhen. If we would not use it it would retry the already used one, which would immediately result in the same error as the previous one.
128
- return (0, rxjs_1.defer)(function () {
129
- return _this.configureHeaders(headers, beService);
130
- }).pipe((0, operators_1.mergeMap)(function (headers) {
131
- return _this.httpsClientService.put(_this.createUrl(url, beService), data, urlParams, headers);
132
- }), (0, operators_1.retryWhen)(function (errors) { return _this.retryWhen(errors); }), (0, operators_1.catchError)(function (error) { return _this.processError(error); }));
133
- };
134
- /**
135
- * Send PATCH request to the Partium-backend with the given relative url and content.
136
- *
137
- * @param url the relative url
138
- * @param data the data to be sent with the patch request
139
- * @param urlParams array of url parameters (as objects) which will be appended to the url, eg: [{ p1: x }, { p2: y }] will become <url>?p1=x&p2=y
140
- * @param beService to which backend-service should the request be sent (default FIND)
141
- * @param headers object with custom headers to send with the request
142
- * @returns Observable that resolves with the request result
143
- */
144
- HttpsService.prototype.patch = function (url, data, urlParams, beService, headers) {
145
- var _this = this;
146
- // we use "defer" here, because this allows us to retry the Observable with a newly created header in error-case. This is important to use the updated access-token if the session ran out and we use retryWhen. If we would not use it it would retry the already used one, which would immediately result in the same error as the previous one.
147
- return (0, rxjs_1.defer)(function () {
148
- return _this.configureHeaders(headers, beService);
149
- }).pipe((0, operators_1.mergeMap)(function (headers) {
150
- return _this.httpsClientService.patch(_this.createUrl(url, beService), data, urlParams, headers);
151
- }), (0, operators_1.retryWhen)(function (errors) { return _this.retryWhen(errors); }), (0, operators_1.catchError)(function (error) { return _this.processError(error); }));
152
- };
153
- /**
154
- * Send DELETE request to the Partium-backend with the given relative url and content.
155
- *
156
- * @param url the relative url
157
- * @param data the data to be sent with the delete request
158
- * @param urlParams array of url parameters (as objects) which will be appended to the url, eg: [{ p1: x }, { p2: y }] will become <url>?p1=x&p2=y
159
- * @param beService to which backend-service should the request be sent (default FIND)
160
- * @returns Observable that resolves with the request result
161
- */
162
- HttpsService.prototype.delete = function (url, data, urlParams, beService) {
163
- var _this = this;
164
- // we use "defer" here, because this allows us to retry the Observable with a newly created header in error-case. This is important to use the updated access-token if the session ran out and we use retryWhen. If we would not use it it would retry the already used one, which would immediately result in the same error as the previous one.
165
- return (0, rxjs_1.defer)(function () {
166
- return _this.configureHeaders({}, beService);
167
- }).pipe((0, operators_1.mergeMap)(function (headers) {
168
- return _this.httpsClientService.delete(_this.createUrl(url, beService), data, urlParams, headers);
169
- }), (0, operators_1.retryWhen)(function (errors) { return _this.retryWhen(errors); }), (0, operators_1.catchError)(function (error) { return _this.processError(error); }));
170
- };
171
- /**
172
- * Set an observable that always holds the currently selected organization.
173
- * This is needed, for adding the X-Partium-Data-Organization header to all requests.
174
- *
175
- * @param currentOrganization$ Observable that holds the current organization
176
- */
177
- HttpsService.prototype.setCurrentOrganization = function (currentOrganization$) {
178
- this.currentOrganization$ = currentOrganization$;
179
- };
180
- /**
181
- * Return whether a failed request should be retried or not.
182
- * The default implementation here does not retry any requests.
183
- * Any child class of this service can override this function to provide
184
- * extended behavior.
185
- */
186
- HttpsService.prototype.retryWhen = function (errors) {
187
- return errors.pipe((0, operators_1.mergeMap)(function (error) {
188
- return (0, rxjs_1.throwError)(error);
189
- })); // don't retry
190
- };
191
- /**
192
- * Process an error received from the an http-request, by the HttpsClientService
193
- * The default implementation here does nothing with the error, it only forwards
194
- * it.
195
- * Any child classes of this service can override this function to provide
196
- * extended behavior.
197
- */
198
- HttpsService.prototype.processError = function (error) {
199
- return (0, rxjs_1.throwError)(error); // do nothing but forwarding the error
200
- };
201
- /**
202
- * Creates the headers object needed for the https-requests.
203
- * Since this parameters are different per authentication-method,
204
- * they need to be set in a child-class of this interface.
205
- *
206
- * Method should be overridden by child-class
207
- *
208
- * @param options object with given header-parameters that will be extended with more parameters
209
- * @returns the created headers object
210
- */
211
- HttpsService.prototype.createHeaders = function (options) {
212
- throw new Error("In order to use the HttpsService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().");
213
- };
214
- /**
215
- * Combine the given relative url with the Backends Base-url.
216
- *
217
- * @param relUrl the relative url
218
- * @param beService to which backend-service should the request be sent (default FIND)
219
- */
220
- HttpsService.prototype.createUrl = function (relUrl, beService) {
221
- if (beService === void 0) { beService = BACKEND_SERVICE.FIND; }
222
- while (relUrl.startsWith('/')) {
223
- // remove leading slashes
224
- relUrl = relUrl.substring(1);
225
- }
226
- // prepare base-url
227
- var baseUrl;
228
- switch (beService) {
229
- case BACKEND_SERVICE.PARTIUM:
230
- baseUrl = this.baseUrls.partiumApiBaseUrl;
231
- break;
232
- case BACKEND_SERVICE.DATA:
233
- baseUrl = this.baseUrls.dataBeBaseUrl;
234
- break;
235
- case BACKEND_SERVICE.CSA:
236
- baseUrl = this.baseUrls.csaBeBaseUrl;
237
- break;
238
- case BACKEND_SERVICE.LOG:
239
- baseUrl = this.baseUrls.logBeBaseUrl;
240
- break;
241
- case BACKEND_SERVICE.USER_DATA:
242
- baseUrl = this.baseUrls.userDataBeBaseUrl;
243
- break;
244
- case BACKEND_SERVICE.OCR:
245
- baseUrl = this.baseUrls.ocrBeBaseUrl;
246
- break;
247
- case BACKEND_SERVICE.MANAGEMENT:
248
- baseUrl = this.baseUrls.managementBeBaseUrl;
249
- break;
250
- case BACKEND_SERVICE.CATALOG:
251
- baseUrl = this.baseUrls.catalogBeBaseUrl;
252
- break;
253
- case BACKEND_SERVICE.FIND:
254
- default:
255
- baseUrl = this.baseUrls.findBeBaseUrl;
256
- break;
257
- }
258
- return [baseUrl, relUrl].join('/');
259
- };
260
- /**
261
- * This method calls the createHeaders method to generate the initial headers
262
- * and then adds additional headers based on specific conditions.
263
- *
264
- * If externalUserId is configured and the backend service is not the log service,
265
- * the X-Partium-ExternalUserId header is added to the headers object.
266
- *
267
- * @param options object with given header-parameters that will be extended with more parameters
268
- * @param beService to which backend-service should the request be sent
269
- * @returns the extended headers object
270
- */
271
- HttpsService.prototype.configureHeaders = function (options, beService) {
272
- var headers = this.createHeaders(options);
273
- // the log service is the only service that will never use the X-Partium-ExternalUserId header
274
- if (this.config.externalUserId && beService !== BACKEND_SERVICE.LOG) {
275
- headers['X-Partium-ExternalUserId'] = this.config.externalUserId;
276
- }
277
- if (this.currentOrganization$) { // https-service is also used by GET organizations call, which is before current organization is set
278
- return this.currentOrganization$.pipe((0, operators_1.first)(), (0, operators_1.map)(function (organization) {
279
- if (organization === null || organization === void 0 ? void 0 : organization.name) {
280
- headers['X-Partium-Data-Organization'] = organization.name;
281
- }
282
- return headers;
283
- }));
284
- }
285
- else {
286
- return (0, rxjs_1.of)(headers);
287
- }
288
- };
289
- HttpsService = __decorate([
290
- (0, injection_identifier_1.InjectionIdentifier)('HttpsService')
291
- ], HttpsService);
292
- return HttpsService;
293
- }(base_service_1.BaseService));
294
- exports.HttpsService = HttpsService;
295
- //# sourceMappingURL=https.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 n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,s=arguments.length,i=s<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(r,t,i):o(r,t))||i);return s>3&&i&&Object.defineProperty(r,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsService=exports.BACKEND_SERVICE=void 0;var BACKEND_SERVICE,base_service_1=require("../base.service"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./https-client/https-client.service.interface"),injection_identifier_1=require("../../decorators/injection-identifier");!function(e){e[e.PARTIUM=0]="PARTIUM",e[e.FIND=1]="FIND",e[e.DATA=2]="DATA",e[e.CSA=3]="CSA",e[e.LOG=4]="LOG",e[e.USER_DATA=5]="USER_DATA",e[e.OCR=6]="OCR",e[e.MANAGEMENT=7]="MANAGEMENT",e[e.CATALOG=8]="CATALOG",e[e.DATACURATION=9]="DATACURATION"}(BACKEND_SERVICE||(exports.BACKEND_SERVICE=BACKEND_SERVICE={}));var HttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService)},r.prototype.init=function(e,r){return this.baseUrls=e,this.config=r,(0,rxjs_1.of)(void 0)},r.prototype.get=function(e,r,t){var n=this;return(0,rxjs_1.defer)((function(){return n.configureHeaders({},t)})).pipe((0,operators_1.mergeMap)((function(o){return n.httpsClientService.get(n.createUrl(e,t),r,o)})),(0,operators_1.retryWhen)((function(e){return n.retryWhen(e)})),(0,operators_1.catchError)((function(e){return n.processError(e)})))},r.prototype.post=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.post(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.put=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.put(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.patch=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.patch(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.delete=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},n)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.delete(o.createUrl(e,n),r,t,s)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.setCurrentOrganization=function(e){this.currentOrganization$=e},r.prototype.retryWhen=function(e){return e.pipe((0,operators_1.mergeMap)((function(e){return(0,rxjs_1.throwError)(e)})))},r.prototype.processError=function(e){return(0,rxjs_1.throwError)(e)},r.prototype.createHeaders=function(e){throw new Error("In order to use the HttpsService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.createUrl=function(e,r){for(void 0===r&&(r=BACKEND_SERVICE.FIND);e.startsWith("/");)e=e.substring(1);var t;switch(r){case BACKEND_SERVICE.PARTIUM:t=this.baseUrls.partiumApiBaseUrl;break;case BACKEND_SERVICE.DATA:t=this.baseUrls.dataBeBaseUrl;break;case BACKEND_SERVICE.CSA:t=this.baseUrls.csaBeBaseUrl;break;case BACKEND_SERVICE.LOG:t=this.baseUrls.logBeBaseUrl;break;case BACKEND_SERVICE.USER_DATA:t=this.baseUrls.userDataBeBaseUrl;break;case BACKEND_SERVICE.OCR:t=this.baseUrls.ocrBeBaseUrl;break;case BACKEND_SERVICE.MANAGEMENT:t=this.baseUrls.managementBeBaseUrl;break;case BACKEND_SERVICE.CATALOG:t=this.baseUrls.catalogBeBaseUrl;break;case BACKEND_SERVICE.DATACURATION:t=this.baseUrls.datacurationBeBaseUrl;break;case BACKEND_SERVICE.FIND:default:t=this.baseUrls.findBeBaseUrl}return[t,e].join("/")},r.prototype.configureHeaders=function(e,r){var t=this.createHeaders(e);return this.config.externalUserId&&r!==BACKEND_SERVICE.LOG&&(t["X-Partium-ExternalUserId"]=this.config.externalUserId),this.currentOrganization$?this.currentOrganization$.pipe((0,operators_1.first)(),(0,operators_1.map)((function(e){return(null==e?void 0:e.name)&&(t["X-Partium-Data-Organization"]=e.name),t}))):(0,rxjs_1.of)(t)},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsService")],r)}(base_service_1.BaseService);exports.HttpsService=HttpsService;