@partium/js-sdk 14.0.3 → 14.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/catalog/index.js +21 -1
  2. package/catalog/models/catalog-image-info.js +22 -1
  3. package/catalog/models/catalog-image.js +40 -1
  4. package/catalog/models/upsert-catalog-images-dto.js +3 -1
  5. package/catalog/models/upsert-images-result.js +3 -1
  6. package/catalog/services/images.service.js +62 -1
  7. package/core/constants/constants.js +16 -1
  8. package/core/decorators/injection-identifier.js +19 -1
  9. package/core/factories/paginated-request-service.factory.js +33 -1
  10. package/core/index.js +63 -1
  11. package/core/integration-defaults/http/fetch-api-http-error-helper.js +129 -1
  12. package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +138 -1
  13. package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +210 -1
  14. package/core/integration-defaults/http/handle-axios-error-helper.js +79 -1
  15. package/core/integration-defaults/http/https-client/axios-https-client.service.js +182 -1
  16. package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +198 -1
  17. package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +32 -1
  18. package/core/integration-defaults/js-p-file.js +36 -1
  19. package/core/integration-defaults/session/js-oauth-api-key-session.service.js +206 -1
  20. package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +64 -1
  21. package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +257 -1
  22. package/core/integration-defaults/web-device-status.service.js +125 -1
  23. package/core/integration-defaults/web-file.service.js +135 -1
  24. package/core/integration-defaults/web-indexeddb.service.js +142 -1
  25. package/core/integration-defaults/web-local-storage.service.js +310 -1
  26. package/core/models/api-object.js +16 -1
  27. package/core/models/auth-config.js +72 -1
  28. package/core/models/device-info.js +34 -1
  29. package/core/models/error.js +107 -1
  30. package/core/models/formatted-string.js +14 -1
  31. package/core/models/i18n-map.js +61 -1
  32. package/core/models/i18n-string.js +35 -1
  33. package/core/models/log.js +137 -1
  34. package/core/models/organization.js +159 -1
  35. package/core/models/p-file.js +23 -1
  36. package/core/models/paginated-list.js +41 -1
  37. package/core/models/partium-config.js +43 -1
  38. package/core/models/user-token.js +11 -1
  39. package/core/models/user.d.ts +2 -1
  40. package/core/models/user.js +89 -1
  41. package/core/services/backend-status.service.js +147 -1
  42. package/core/services/base-login-init.service.js +57 -1
  43. package/core/services/base.service.js +37 -1
  44. package/core/services/device-status.service.interface.js +117 -1
  45. package/core/services/file.service.interface.js +61 -1
  46. package/core/services/http/file-transfer/file-transfer.service.interface.js +125 -1
  47. package/core/services/http/https-client/https-client.service.interface.js +152 -1
  48. package/core/services/http/https.service.interface.js +294 -1
  49. package/core/services/http/oauth-https.service.js +218 -1
  50. package/core/services/local-storage.service.interface.js +378 -1
  51. package/core/services/log.service.js +139 -1
  52. package/core/services/organization.service.js +202 -1
  53. package/core/services/paginated-request.service.js +160 -1
  54. package/core/services/recent-parts.service.js +194 -1
  55. package/core/services/service-provider.js +114 -1
  56. package/core/services/session/oauth-session.service.js +104 -1
  57. package/core/services/session/session.service.interface.js +367 -1
  58. package/core/utils/general-helper.js +110 -1
  59. package/data/index.js +44 -1
  60. package/data/models/announcement.js +70 -1
  61. package/data/models/assembly-hierarchy-node-breadcrumb.js +51 -1
  62. package/data/models/assembly-hierarchy-node.js +46 -1
  63. package/data/models/attribute.js +106 -1
  64. package/data/models/csa-request-search.js +46 -1
  65. package/data/models/csa-request-status.js +51 -1
  66. package/data/models/csa-request.js +112 -1
  67. package/data/models/document.js +17 -1
  68. package/data/models/filter-key.js +36 -1
  69. package/data/models/filter-option-value.js +41 -1
  70. package/data/models/image.d.ts +3 -1
  71. package/data/models/image.js +77 -1
  72. package/data/models/inquiry.js +71 -1
  73. package/data/models/mounting-location.js +58 -1
  74. package/data/models/multiple-expert-searches.js +40 -1
  75. package/data/models/part-enrichment-data.js +50 -1
  76. package/data/models/part.js +168 -1
  77. package/data/models/shopping-cart.js +60 -1
  78. package/data/services/announcement.service.js +89 -1
  79. package/data/services/assembly-hierarchy-nodes.service.js +193 -1
  80. package/data/services/csa-helper.service.js +158 -1
  81. package/data/services/customer-service-assistance.service.js +276 -1
  82. package/data/services/filter.service.js +97 -1
  83. package/data/services/inquiry.service.js +68 -1
  84. package/data/services/part-attribute.service.js +118 -1
  85. package/data/services/part-enrichment.service.js +56 -1
  86. package/data/services/part.service.js +182 -1
  87. package/data/services/related-parts.service.js +83 -1
  88. package/data/services/shopping-cart.service.js +152 -1
  89. package/find/index.js +51 -1
  90. package/find/models/assets/asset.js +32 -1
  91. package/find/models/search-filter.js +205 -1
  92. package/find/models/search-input.js +3 -1
  93. package/find/models/search-output.js +3 -1
  94. package/find/models/search-result-status.js +40 -1
  95. package/find/models/search-session-log-object.js +22 -1
  96. package/find/models/search-status/cv-search-status.js +22 -1
  97. package/find/models/search-status/search-filter-status.js +36 -1
  98. package/find/models/search-status/search-status.js +56 -1
  99. package/find/models/search-status/tag-search-status.js +23 -1
  100. package/find/models/search-status/text-search-status.js +18 -1
  101. package/find/models/search-tag.js +16 -1
  102. package/find/models/smart-filter.js +49 -1
  103. package/find/models/tagable/i18n-tagable.js +37 -1
  104. package/find/models/tagable/tagable-base.js +22 -1
  105. package/find/models/tagable/tagable.js +37 -1
  106. package/find/models/text-search-config.js +70 -1
  107. package/find/models/text-search-manipulator.js +90 -1
  108. package/find/models/text-search-result-item/text-search-error.js +12 -1
  109. package/find/models/text-search-result-item/text-search-result-item-document.js +34 -1
  110. package/find/models/text-search-result-item/text-search-result-item-part.js +36 -1
  111. package/find/models/text-search-result-item/text-search-result-item-recent-query.js +35 -1
  112. package/find/models/text-search-result-item/text-search-result-item-unknown.js +38 -1
  113. package/find/models/text-search-result-item/text-search-result-item.js +22 -1
  114. package/find/services/asset.service.js +348 -1
  115. package/find/services/filter-uploaders/filter-uploader.js +3 -1
  116. package/find/services/filter-uploaders/update-filters-uploader.js +77 -1
  117. package/find/services/filter-uploaders/update-filters.model.js +7 -1
  118. package/find/services/search/cv-search.service.js +214 -1
  119. package/find/services/search/recent-text-search-queries.service.js +260 -1
  120. package/find/services/search/search-result.service.js +539 -1
  121. package/find/services/search/search.service.js +514 -1
  122. package/find/services/search/tag-search.service.js +124 -1
  123. package/find/services/search/text-search.service.js +316 -1
  124. package/find/services/search-filter.service.js +292 -1
  125. package/find/utils/search-helper.js +75 -1
  126. package/gen/sdk-version.d.ts +1 -1
  127. package/gen/sdk-version.js +5 -1
  128. package/index.js +392 -1
  129. package/management/index.js +21 -1
  130. package/management/models/api-key-list-response.js +3 -1
  131. package/management/models/api-key-type.js +9 -1
  132. package/management/models/api-key.js +3 -1
  133. package/management/services/api-key.service.js +53 -1
  134. package/ocr/index.js +20 -1
  135. package/ocr/models/detect-response.js +3 -1
  136. package/ocr/models/detected-text-entry.js +3 -1
  137. package/ocr/services/ocr.service.js +59 -1
  138. package/package.json +1 -1
  139. package/user-data/index.js +21 -1
  140. package/user-data/models/part-with-nullable.js +3 -1
  141. package/user-data/models/request-list/request-list.js +63 -1
  142. package/user-data/services/favorite/favorite.service.js +108 -1
  143. package/user-data/services/request-list/request-list.service.js +133 -1
package/index.js CHANGED
@@ -1,2 +1,393 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Partium=exports.INITIALIZATION_STATUS=void 0;var INITIALIZATION_STATUS,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),core_1=require("./core"),auth_config_1=require("./core/models/auth-config"),partium_config_1=require("./core/models/partium-config"),backend_status_service_1=require("./core/services/backend-status.service"),device_status_service_interface_1=require("./core/services/device-status.service.interface"),file_service_interface_1=require("./core/services/file.service.interface"),file_transfer_service_interface_1=require("./core/services/http/file-transfer/file-transfer.service.interface"),https_client_service_interface_1=require("./core/services/http/https-client/https-client.service.interface"),https_service_interface_1=require("./core/services/http/https.service.interface"),local_storage_service_interface_1=require("./core/services/local-storage.service.interface"),log_service_1=require("./core/services/log.service"),service_provider_1=require("./core/services/service-provider"),session_service_interface_1=require("./core/services/session/session.service.interface"),data_1=require("./data"),filter_service_1=require("./data/services/filter.service"),part_attribute_service_1=require("./data/services/part-attribute.service"),part_service_1=require("./data/services/part.service"),request_list_service_1=require("./user-data/services/request-list/request-list.service"),favorite_service_1=require("./user-data/services/favorite/favorite.service"),asset_service_1=require("./find/services/asset.service"),search_service_1=require("./find/services/search/search.service"),sdk_version_1=require("./gen/sdk-version"),recent_text_search_queries_service_1=require("./find/services/search/recent-text-search-queries.service"),ocr_1=require("./ocr"),shopping_cart_service_1=require("./data/services/shopping-cart.service"),inquiry_service_1=require("./data/services/inquiry.service"),announcement_service_1=require("./data/services/announcement.service"),related_parts_service_1=require("./data/services/related-parts.service"),constants_1=require("./core/constants/constants"),management_1=require("./management"),part_enrichment_service_1=require("./data/services/part-enrichment.service"),images_service_1=require("./catalog/services/images.service");!function(e){e[e.NOT_INITIALIZED=0]="NOT_INITIALIZED",e[e.INITIALIZING=1]="INITIALIZING",e[e.INITIALIZED=2]="INITIALIZED",e[e.INITIALIZATION_ERROR=3]="INITIALIZATION_ERROR"}(INITIALIZATION_STATUS||(exports.INITIALIZATION_STATUS=INITIALIZATION_STATUS={}));var Partium=function(){function e(){}return Object.defineProperty(e,"search",{get:function(){return e.getService(search_service_1.SearchServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"asset",{get:function(){return e.getService(asset_service_1.AssetServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"https",{get:function(){return e.getService(https_service_interface_1.HttpsService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fileTransfer",{get:function(){return e.getService(file_transfer_service_interface_1.FileTransferService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"session",{get:function(){return e.getService(session_service_interface_1.SessionService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"assemblyHierarchyNode",{get:function(){return e.getService(data_1.AssemblyHierarchyNodesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"part",{get:function(){return e.getService(part_service_1.PartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partEnrichment",{get:function(){return e.getService(part_enrichment_service_1.PartEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"relatedParts",{get:function(){return e.getService(related_parts_service_1.RelatedPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"requestList",{get:function(){return e.getService(request_list_service_1.RequestListServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shoppingCart",{get:function(){return e.getService(shopping_cart_service_1.ShoppingCartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partAttribute",{get:function(){return e.getService(part_attribute_service_1.PartAttributeServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"inquiry",{get:function(){return e.getService(inquiry_service_1.InquiryServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"announcement",{get:function(){return e.getService(announcement_service_1.AnnouncementServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"customerServiceAssistance",{get:function(){return e.getService(data_1.CustomerServiceAssistanceServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"log",{get:function(){return e.getService(log_service_1.LogServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"file",{get:function(){return e.getService(file_service_interface_1.FileService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"recentParts",{get:function(){return e.getService(core_1.RecentPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"favorites",{get:function(){return e.getService(favorite_service_1.FavoriteServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"filters",{get:function(){return e.getService(filter_service_1.FilterServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"organization",{get:function(){return e.getService(core_1.OrganizationService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ocr",{get:function(){return e.getService(ocr_1.OcrServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"apiKey",{get:function(){return e.getService(management_1.ApiKeyServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"localStorage",{get:function(){return e.getService(local_storage_service_interface_1.LocalStorageService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"images",{get:function(){return e.getService(images_service_1.ImagesServiceImpl)},enumerable:!1,configurable:!0}),e.init=function(r){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZING),e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider);var i=[r.partiumApiBaseUrl,r.partiumLoginUrl];switch(e._serviceProvider.useService(r.httpsClientService,https_client_service_interface_1.HttpsClientService,i),e._serviceProvider.useService(r.fileTransferService,file_transfer_service_interface_1.FileTransferService,i),e._serviceProvider.useService(r.localStorageService,local_storage_service_interface_1.LocalStorageService),e._serviceProvider.useService(r.deviceStatusService,device_status_service_interface_1.DeviceStatusService),e._serviceProvider.useService(r.fileService,file_service_interface_1.FileService),r.authenticationMethod){case partium_config_1.AUTHENTICATION_METHOD.OAUTH_API_KEY:case partium_config_1.AUTHENTICATION_METHOD.OAUTH:e._serviceProvider.useService(r.authenticationConfig.oauthHttpsService,https_service_interface_1.HttpsService),e._serviceProvider.useService(r.authenticationConfig.oauthSessionService,session_service_interface_1.SessionService)}e._serviceProvider.serviceSelectionFinished();var t=e.getService(session_service_interface_1.SessionService),c=e.getService(local_storage_service_interface_1.LocalStorageService);t.registerLoginInitService(c,1);var n=e.getService(asset_service_1.AssetServiceImpl);t.registerLoginInitService(n,2);var s=e.getService(core_1.RecentPartsServiceImpl);t.registerLoginInitService(s,2);var a=e.getService(recent_text_search_queries_service_1.RecentTextSearchQueriesServiceImpl);t.registerLoginInitService(a,2);var _=e.getService(favorite_service_1.FavoriteServiceImpl);t.registerLoginInitService(_,2);var o=e.getService(data_1.CustomerServiceAssistanceServiceImpl);t.registerLoginInitService(o,2);var v=e.getService(search_service_1.SearchServiceImpl);t.registerLoginInitService(v,2);var u=e.getService(log_service_1.LogServiceImpl);t.registerLoginInitService(u,2);var l=e.getService(https_service_interface_1.HttpsService),I=e.getService(backend_status_service_1.BackendStatusService);return I.init(sdk_version_1.SDK_VERSION_NUMBER,"en",e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_STATUS_API_URL]),constants_1.BACKEND_STATUS_FALLBACK_URL),I.checkCompatibility().pipe((0,operators_1.mergeMap)((function(){return I.checkAvailability()})),(0,operators_1.mergeMap)((function(){return t.init(r)})),(0,operators_1.mergeMap)((function(){return l.init({partiumApiBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION)]),findBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_FIND_API_URL]),dataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_API_URL]),csaBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CSA_API_URL]),logBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_LOGS_API_URL]),userDataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_USER_DATA_API_URL]),ocrBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_OCR_API_URL]),managementBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_MANAGEMENT_API_URL]),catalogBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CATALOG_API_URL])},r.authenticationConfig)})),(0,operators_1.tap)((function(){l.setCurrentOrganization(t.getCurrentOrganization$())})),(0,operators_1.tap)((function(){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZED)})),(0,operators_1.catchError)((function(r){return e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZATION_ERROR),e.reset(),(0,rxjs_1.throwError)(r)})))},e.initApiKey=function(r){return e.init(new partium_config_1.PartiumConfig({authenticationConfig:new auth_config_1.OauthApiKeyAuthenticationConfig({apiKey:r})}))},e.reset=function(){e._serviceProvider=null,e._initializationStatus$.next(INITIALIZATION_STATUS.NOT_INITIALIZED)},e.getInitializationStatus=function(){return e._initializationStatus$.asObservable()},e.getOrganizations=function(){return e.ensureInitialized(),e.getService(core_1.OrganizationService).getOrganizations()},e.useOrganization=function(r){return e.ensureInitialized(),e.session.useOrganization(r)},e.getService=function(r){return e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider),e._serviceProvider.getService(r)},e.isInitialized=function(){return e._initializationStatus$.value===INITIALIZATION_STATUS.INITIALIZED},e.ensureInitialized=function(){if(!e.isInitialized())throw"Partium-JS-SDK not initialized. Make sure to initialize the Partium-JS-SDK before you try to use it's features!"},e.buildUrl=function(e){for(var r=[],i=0,t=e;i<t.length;i++){var c=t[i];r.push(c.replace(/^\/+/,"").replace(/\/+$/,""))}return r.join("/")},e._initializationStatus$=new rxjs_1.BehaviorSubject(INITIALIZATION_STATUS.NOT_INITIALIZED),e}();exports.Partium=Partium;
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Partium = exports.INITIALIZATION_STATUS = void 0;
5
+ var rxjs_1 = require("rxjs");
6
+ var operators_1 = require("rxjs/operators");
7
+ var core_1 = require("./core");
8
+ var auth_config_1 = require("./core/models/auth-config");
9
+ var partium_config_1 = require("./core/models/partium-config");
10
+ var backend_status_service_1 = require("./core/services/backend-status.service");
11
+ var device_status_service_interface_1 = require("./core/services/device-status.service.interface");
12
+ var file_service_interface_1 = require("./core/services/file.service.interface");
13
+ var file_transfer_service_interface_1 = require("./core/services/http/file-transfer/file-transfer.service.interface");
14
+ var https_client_service_interface_1 = require("./core/services/http/https-client/https-client.service.interface");
15
+ var https_service_interface_1 = require("./core/services/http/https.service.interface");
16
+ var local_storage_service_interface_1 = require("./core/services/local-storage.service.interface");
17
+ var log_service_1 = require("./core/services/log.service");
18
+ var service_provider_1 = require("./core/services/service-provider");
19
+ var session_service_interface_1 = require("./core/services/session/session.service.interface");
20
+ var data_1 = require("./data");
21
+ var filter_service_1 = require("./data/services/filter.service");
22
+ var part_attribute_service_1 = require("./data/services/part-attribute.service");
23
+ var part_service_1 = require("./data/services/part.service");
24
+ var request_list_service_1 = require("./user-data/services/request-list/request-list.service");
25
+ var favorite_service_1 = require("./user-data/services/favorite/favorite.service");
26
+ var asset_service_1 = require("./find/services/asset.service");
27
+ var search_service_1 = require("./find/services/search/search.service");
28
+ var sdk_version_1 = require("./gen/sdk-version");
29
+ var recent_text_search_queries_service_1 = require("./find/services/search/recent-text-search-queries.service");
30
+ var ocr_1 = require("./ocr");
31
+ var shopping_cart_service_1 = require("./data/services/shopping-cart.service");
32
+ var inquiry_service_1 = require("./data/services/inquiry.service");
33
+ var announcement_service_1 = require("./data/services/announcement.service");
34
+ var related_parts_service_1 = require("./data/services/related-parts.service");
35
+ var constants_1 = require("./core/constants/constants");
36
+ var management_1 = require("./management");
37
+ var part_enrichment_service_1 = require("./data/services/part-enrichment.service");
38
+ var images_service_1 = require("./catalog/services/images.service");
39
+ var INITIALIZATION_STATUS;
40
+ (function (INITIALIZATION_STATUS) {
41
+ INITIALIZATION_STATUS[INITIALIZATION_STATUS["NOT_INITIALIZED"] = 0] = "NOT_INITIALIZED";
42
+ INITIALIZATION_STATUS[INITIALIZATION_STATUS["INITIALIZING"] = 1] = "INITIALIZING";
43
+ INITIALIZATION_STATUS[INITIALIZATION_STATUS["INITIALIZED"] = 2] = "INITIALIZED";
44
+ INITIALIZATION_STATUS[INITIALIZATION_STATUS["INITIALIZATION_ERROR"] = 3] = "INITIALIZATION_ERROR";
45
+ })(INITIALIZATION_STATUS || (exports.INITIALIZATION_STATUS = INITIALIZATION_STATUS = {}));
46
+ /**
47
+ * The main Partium object, that can be imported by other applications and serves as
48
+ * interaction-interface to the whole Partium-JS-SDK.
49
+ * All features that are not exposed via this class can/should not be used from the outside.
50
+ *
51
+ * In order to use the Partium-SDK it has to be configured and initialized via the init-method,
52
+ * that takes a configuration object.
53
+ */
54
+ var Partium = /** @class */ (function () {
55
+ function Partium() {
56
+ }
57
+ Object.defineProperty(Partium, "search", {
58
+ get: function () {
59
+ return Partium.getService(search_service_1.SearchServiceImpl);
60
+ },
61
+ enumerable: false,
62
+ configurable: true
63
+ });
64
+ Object.defineProperty(Partium, "asset", {
65
+ get: function () {
66
+ return Partium.getService(asset_service_1.AssetServiceImpl);
67
+ },
68
+ enumerable: false,
69
+ configurable: true
70
+ });
71
+ Object.defineProperty(Partium, "https", {
72
+ get: function () {
73
+ return Partium.getService(https_service_interface_1.HttpsService);
74
+ },
75
+ enumerable: false,
76
+ configurable: true
77
+ });
78
+ Object.defineProperty(Partium, "fileTransfer", {
79
+ get: function () {
80
+ return Partium.getService(file_transfer_service_interface_1.FileTransferService);
81
+ },
82
+ enumerable: false,
83
+ configurable: true
84
+ });
85
+ Object.defineProperty(Partium, "session", {
86
+ get: function () {
87
+ return Partium.getService(session_service_interface_1.SessionService);
88
+ },
89
+ enumerable: false,
90
+ configurable: true
91
+ });
92
+ Object.defineProperty(Partium, "assemblyHierarchyNode", {
93
+ get: function () {
94
+ return Partium.getService(data_1.AssemblyHierarchyNodesServiceImpl);
95
+ },
96
+ enumerable: false,
97
+ configurable: true
98
+ });
99
+ Object.defineProperty(Partium, "part", {
100
+ get: function () {
101
+ return Partium.getService(part_service_1.PartServiceImpl);
102
+ },
103
+ enumerable: false,
104
+ configurable: true
105
+ });
106
+ Object.defineProperty(Partium, "partEnrichment", {
107
+ get: function () {
108
+ return Partium.getService(part_enrichment_service_1.PartEnrichmentServiceImpl);
109
+ },
110
+ enumerable: false,
111
+ configurable: true
112
+ });
113
+ Object.defineProperty(Partium, "relatedParts", {
114
+ get: function () {
115
+ return Partium.getService(related_parts_service_1.RelatedPartsServiceImpl);
116
+ },
117
+ enumerable: false,
118
+ configurable: true
119
+ });
120
+ Object.defineProperty(Partium, "requestList", {
121
+ get: function () {
122
+ return Partium.getService(request_list_service_1.RequestListServiceImpl);
123
+ },
124
+ enumerable: false,
125
+ configurable: true
126
+ });
127
+ Object.defineProperty(Partium, "shoppingCart", {
128
+ get: function () {
129
+ return Partium.getService(shopping_cart_service_1.ShoppingCartServiceImpl);
130
+ },
131
+ enumerable: false,
132
+ configurable: true
133
+ });
134
+ Object.defineProperty(Partium, "partAttribute", {
135
+ get: function () {
136
+ return Partium.getService(part_attribute_service_1.PartAttributeServiceImpl);
137
+ },
138
+ enumerable: false,
139
+ configurable: true
140
+ });
141
+ Object.defineProperty(Partium, "inquiry", {
142
+ get: function () {
143
+ return Partium.getService(inquiry_service_1.InquiryServiceImpl);
144
+ },
145
+ enumerable: false,
146
+ configurable: true
147
+ });
148
+ Object.defineProperty(Partium, "announcement", {
149
+ get: function () {
150
+ return Partium.getService(announcement_service_1.AnnouncementServiceImpl);
151
+ },
152
+ enumerable: false,
153
+ configurable: true
154
+ });
155
+ Object.defineProperty(Partium, "customerServiceAssistance", {
156
+ get: function () {
157
+ return Partium.getService(data_1.CustomerServiceAssistanceServiceImpl);
158
+ },
159
+ enumerable: false,
160
+ configurable: true
161
+ });
162
+ Object.defineProperty(Partium, "log", {
163
+ get: function () {
164
+ return Partium.getService(log_service_1.LogServiceImpl);
165
+ },
166
+ enumerable: false,
167
+ configurable: true
168
+ });
169
+ Object.defineProperty(Partium, "file", {
170
+ get: function () {
171
+ return Partium.getService(file_service_interface_1.FileService);
172
+ },
173
+ enumerable: false,
174
+ configurable: true
175
+ });
176
+ Object.defineProperty(Partium, "recentParts", {
177
+ get: function () {
178
+ return Partium.getService(core_1.RecentPartsServiceImpl);
179
+ },
180
+ enumerable: false,
181
+ configurable: true
182
+ });
183
+ Object.defineProperty(Partium, "favorites", {
184
+ get: function () {
185
+ return Partium.getService(favorite_service_1.FavoriteServiceImpl);
186
+ },
187
+ enumerable: false,
188
+ configurable: true
189
+ });
190
+ Object.defineProperty(Partium, "filters", {
191
+ get: function () {
192
+ return Partium.getService(filter_service_1.FilterServiceImpl);
193
+ },
194
+ enumerable: false,
195
+ configurable: true
196
+ });
197
+ Object.defineProperty(Partium, "organization", {
198
+ get: function () {
199
+ return Partium.getService(core_1.OrganizationService);
200
+ },
201
+ enumerable: false,
202
+ configurable: true
203
+ });
204
+ Object.defineProperty(Partium, "ocr", {
205
+ get: function () {
206
+ return Partium.getService(ocr_1.OcrServiceImpl);
207
+ },
208
+ enumerable: false,
209
+ configurable: true
210
+ });
211
+ Object.defineProperty(Partium, "apiKey", {
212
+ get: function () {
213
+ return Partium.getService(management_1.ApiKeyServiceImpl);
214
+ },
215
+ enumerable: false,
216
+ configurable: true
217
+ });
218
+ Object.defineProperty(Partium, "localStorage", {
219
+ get: function () {
220
+ return Partium.getService(local_storage_service_interface_1.LocalStorageService);
221
+ },
222
+ enumerable: false,
223
+ configurable: true
224
+ });
225
+ Object.defineProperty(Partium, "images", {
226
+ get: function () {
227
+ return Partium.getService(images_service_1.ImagesServiceImpl);
228
+ },
229
+ enumerable: false,
230
+ configurable: true
231
+ });
232
+ /**
233
+ * Initialize the Partium SDK with a given configuration.
234
+ * The configuration defines what Authentication method is used and which
235
+ * platform-specific implementations of some Services should be used.
236
+ *
237
+ * During the init function also the Partium-Status-Backend is called,
238
+ * to check it's status and the SDK-Version.
239
+ *
240
+ * @param config the partium configuration
241
+ */
242
+ Partium.init = function (config) {
243
+ // TODO replace any
244
+ Partium._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZING);
245
+ if (!Partium._serviceProvider) {
246
+ Partium._serviceProvider = new service_provider_1.ServiceProvider();
247
+ }
248
+ var knownBaseUrls = [config.partiumApiBaseUrl, config.partiumLoginUrl];
249
+ // which http-client to use in the sdk?
250
+ Partium._serviceProvider.useService(config.httpsClientService, https_client_service_interface_1.HttpsClientService, knownBaseUrls);
251
+ // which file-uploader should be used
252
+ Partium._serviceProvider.useService(config.fileTransferService, file_transfer_service_interface_1.FileTransferService, knownBaseUrls);
253
+ // which localstorage to use in the sdk?
254
+ Partium._serviceProvider.useService(config.localStorageService, local_storage_service_interface_1.LocalStorageService);
255
+ // which device-status should be used
256
+ Partium._serviceProvider.useService(config.deviceStatusService, device_status_service_interface_1.DeviceStatusService);
257
+ // which file service should be used
258
+ Partium._serviceProvider.useService(config.fileService, file_service_interface_1.FileService);
259
+ switch (config.authenticationMethod) {
260
+ case partium_config_1.AUTHENTICATION_METHOD.OAUTH_API_KEY:
261
+ case partium_config_1.AUTHENTICATION_METHOD.OAUTH:
262
+ Partium._serviceProvider.useService(config.authenticationConfig.oauthHttpsService, https_service_interface_1.HttpsService);
263
+ Partium._serviceProvider.useService(config.authenticationConfig.oauthSessionService, session_service_interface_1.SessionService);
264
+ break;
265
+ }
266
+ // useService doesn't need to be called anymore
267
+ Partium._serviceProvider.serviceSelectionFinished();
268
+ var sessionService = Partium.getService(session_service_interface_1.SessionService);
269
+ // cause setup of services that need to be initialized during login-process
270
+ // local-storage-service should be first in line, as it is used by other services during init
271
+ var localStorageService = Partium.getService(local_storage_service_interface_1.LocalStorageService);
272
+ sessionService.registerLoginInitService(localStorageService, 1);
273
+ var assetService = Partium.getService(asset_service_1.AssetServiceImpl);
274
+ sessionService.registerLoginInitService(assetService, 2);
275
+ var recentPartsService = Partium.getService(core_1.RecentPartsServiceImpl);
276
+ sessionService.registerLoginInitService(recentPartsService, 2);
277
+ var recentTextSearchQueriesService = Partium.getService(recent_text_search_queries_service_1.RecentTextSearchQueriesServiceImpl);
278
+ sessionService.registerLoginInitService(recentTextSearchQueriesService, 2);
279
+ var favoriteService = Partium.getService(favorite_service_1.FavoriteServiceImpl);
280
+ sessionService.registerLoginInitService(favoriteService, 2);
281
+ var customerServiceAssistanceService = Partium.getService(data_1.CustomerServiceAssistanceServiceImpl);
282
+ sessionService.registerLoginInitService(customerServiceAssistanceService, 2);
283
+ var searchService = Partium.getService(search_service_1.SearchServiceImpl);
284
+ sessionService.registerLoginInitService(searchService, 2);
285
+ var logService = Partium.getService(log_service_1.LogServiceImpl);
286
+ sessionService.registerLoginInitService(logService, 2);
287
+ var httpsService = Partium.getService(https_service_interface_1.HttpsService);
288
+ var backendStatusService = Partium.getService(backend_status_service_1.BackendStatusService);
289
+ // initialize status backend
290
+ backendStatusService.init(sdk_version_1.SDK_VERSION_NUMBER, 'en', // TODO should this be configurable??
291
+ Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_STATUS_API_URL]), // TODO enable once status-endpoint is available in new API
292
+ constants_1.BACKEND_STATUS_FALLBACK_URL);
293
+ // initialize other partium related services
294
+ return backendStatusService.checkCompatibility().pipe((0, operators_1.mergeMap)(function () { return backendStatusService.checkAvailability(); }), (0, operators_1.mergeMap)(function () { return sessionService.init(config); }), (0, operators_1.mergeMap)(function () {
295
+ return httpsService.init({
296
+ partiumApiBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION)]),
297
+ findBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_FIND_API_URL]),
298
+ dataBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_DATA_API_URL]),
299
+ csaBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_CSA_API_URL]),
300
+ logBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_LOGS_API_URL]),
301
+ userDataBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_USER_DATA_API_URL]),
302
+ ocrBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_OCR_API_URL]),
303
+ managementBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_MANAGEMENT_API_URL]),
304
+ catalogBeBaseUrl: Partium.buildUrl([config.partiumApiBaseUrl, "".concat(constants_1.PARTIUM_API_VERSION), constants_1.REL_CATALOG_API_URL]),
305
+ }, config.authenticationConfig);
306
+ }), (0, operators_1.tap)(function () {
307
+ httpsService.setCurrentOrganization(sessionService.getCurrentOrganization$());
308
+ }), (0, operators_1.tap)(function () {
309
+ Partium._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZED);
310
+ }), (0, operators_1.catchError)(function (error) {
311
+ Partium._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZATION_ERROR);
312
+ Partium.reset(); // reset the SDK so the init can be called again
313
+ return (0, rxjs_1.throwError)(error);
314
+ }));
315
+ };
316
+ /**
317
+ * Convenience function to init partium with an API-key and default configuration.
318
+ *
319
+ * During the init function also the Partium-Status-Backend is called,
320
+ * to check it's status and the SDK-Version.
321
+ *
322
+ * @param apiKey the api-key the partium configuration
323
+ */
324
+ Partium.initApiKey = function (apiKey) {
325
+ return Partium.init(new partium_config_1.PartiumConfig({ authenticationConfig: new auth_config_1.OauthApiKeyAuthenticationConfig({ apiKey: apiKey }) }));
326
+ };
327
+ /**
328
+ * Reset the Partium SDK to uninitialized state
329
+ */
330
+ Partium.reset = function () {
331
+ Partium._serviceProvider = null;
332
+ Partium._initializationStatus$.next(INITIALIZATION_STATUS.NOT_INITIALIZED);
333
+ };
334
+ /**
335
+ * Returns whether the Partium Service is already initialized or not
336
+ *
337
+ * @returns true if the Partium has already been initialized, false otherwise
338
+ */
339
+ Partium.getInitializationStatus = function () {
340
+ return Partium._initializationStatus$.asObservable();
341
+ };
342
+ /**
343
+ * Returns all Organizations of the currently logged in user.
344
+ *
345
+ * @returns a promise that resolves with an array with all available organizations for a customer. Returns null if not initialized/logged in
346
+ */
347
+ Partium.getOrganizations = function () {
348
+ Partium.ensureInitialized();
349
+ return Partium.getService(core_1.OrganizationService).getOrganizations();
350
+ };
351
+ /**
352
+ * Set organization with the given identifier as the current organization to be used in the session.
353
+ *
354
+ * @param organizationIdentifier can be organization-id or organization-name
355
+ * @returns void if organization is found, otherwise throws an error
356
+ */
357
+ Partium.useOrganization = function (organizationIdentifier) {
358
+ Partium.ensureInitialized();
359
+ return Partium.session.useOrganization(organizationIdentifier);
360
+ };
361
+ /**
362
+ * Get a service from the service-singleton provider
363
+ *
364
+ * @param service the Service-class to get an instance of
365
+ * @returns singleton instance of the requested service
366
+ */
367
+ Partium.getService = function (service) {
368
+ if (!Partium._serviceProvider) {
369
+ Partium._serviceProvider = new service_provider_1.ServiceProvider();
370
+ }
371
+ return Partium._serviceProvider.getService(service);
372
+ };
373
+ Partium.isInitialized = function () {
374
+ return Partium._initializationStatus$.value === INITIALIZATION_STATUS.INITIALIZED;
375
+ };
376
+ Partium.ensureInitialized = function () {
377
+ if (!Partium.isInitialized()) {
378
+ throw "Partium-JS-SDK not initialized. Make sure to initialize the Partium-JS-SDK before you try to use it's features!";
379
+ }
380
+ };
381
+ Partium.buildUrl = function (segments) {
382
+ var urlSegments = [];
383
+ for (var _i = 0, segments_1 = segments; _i < segments_1.length; _i++) {
384
+ var segment = segments_1[_i];
385
+ urlSegments.push(segment.replace(/^\/+/, '').replace(/\/+$/, ''));
386
+ }
387
+ return urlSegments.join('/');
388
+ };
389
+ Partium._initializationStatus$ = new rxjs_1.BehaviorSubject(INITIALIZATION_STATUS.NOT_INITIALIZED);
390
+ return Partium;
391
+ }());
392
+ exports.Partium = Partium;
393
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,22 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/api-key"),exports),__exportStar(require("./models/api-key-type"),exports),__exportStar(require("./models/api-key-list-response"),exports),__exportStar(require("./services/api-key.service"),exports);
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./models/api-key"), exports);
19
+ __exportStar(require("./models/api-key-type"), exports);
20
+ __exportStar(require("./models/api-key-list-response"), exports);
21
+ __exportStar(require("./services/api-key.service"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,4 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=api-key-list-response.js.map
@@ -1,2 +1,10 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var API_KEY_TYPE;Object.defineProperty(exports,"__esModule",{value:!0}),exports.API_KEY_TYPE=void 0,function(_){_.FIND_API="find_api",_.CATALOG_API="catalog_api"}(API_KEY_TYPE||(exports.API_KEY_TYPE=API_KEY_TYPE={}));
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.API_KEY_TYPE = void 0;
5
+ var API_KEY_TYPE;
6
+ (function (API_KEY_TYPE) {
7
+ API_KEY_TYPE["FIND_API"] = "find_api";
8
+ API_KEY_TYPE["CATALOG_API"] = "catalog_api";
9
+ })(API_KEY_TYPE || (exports.API_KEY_TYPE = API_KEY_TYPE = {}));
10
+ //# sourceMappingURL=api-key-type.js.map
@@ -1,2 +1,4 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=api-key.js.map
@@ -1,2 +1,54 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__decorate=this&&this.__decorate||function(e,t,r,o){var i,n=arguments.length,c=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,o);else for(var p=e.length-1;p>=0;p--)(i=e[p])&&(c=(n<3?i(c):n>3?i(t,r,c):i(t,r))||c);return n>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiKeyServiceImpl=void 0;var api_key_type_1=require("../models/api-key-type"),core_1=require("../../core"),ApiKeyServiceImpl=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.getAll=function(e){return void 0===e&&(e=api_key_type_1.API_KEY_TYPE.FIND_API),this.httpsService.get("keys",[{keyType:e}],core_1.BACKEND_SERVICE.MANAGEMENT)},t.prototype.create=function(e,t){return void 0===t&&(t=api_key_type_1.API_KEY_TYPE.FIND_API),this.httpsService.post("keys",{organization:e,keyType:t},[],core_1.BACKEND_SERVICE.MANAGEMENT)},t.prototype.delete=function(e,t,r){return void 0===r&&(r=api_key_type_1.API_KEY_TYPE.FIND_API),this.httpsService.delete("keys",{organization:e,value:t,keyType:r},[],core_1.BACKEND_SERVICE.MANAGEMENT)},t=__decorate([(0,core_1.InjectionIdentifier)("ApiKeyService")],t)}(core_1.BaseService);exports.ApiKeyServiceImpl=ApiKeyServiceImpl;
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.ApiKeyServiceImpl = void 0;
26
+ var api_key_type_1 = require("../models/api-key-type");
27
+ var core_1 = require("../../core");
28
+ var ApiKeyServiceImpl = /** @class */ (function (_super) {
29
+ __extends(ApiKeyServiceImpl, _super);
30
+ function ApiKeyServiceImpl(serviceProvider) {
31
+ return _super.call(this, serviceProvider) || this;
32
+ }
33
+ ApiKeyServiceImpl.prototype.onCreate = function () {
34
+ this.httpsService = this.serviceProvider.getService(core_1.HttpsService);
35
+ };
36
+ ApiKeyServiceImpl.prototype.getAll = function (keyType) {
37
+ if (keyType === void 0) { keyType = api_key_type_1.API_KEY_TYPE.FIND_API; }
38
+ return this.httpsService.get('keys', [{ keyType: keyType }], core_1.BACKEND_SERVICE.MANAGEMENT);
39
+ };
40
+ ApiKeyServiceImpl.prototype.create = function (organization, keyType) {
41
+ if (keyType === void 0) { keyType = api_key_type_1.API_KEY_TYPE.FIND_API; }
42
+ return this.httpsService.post('keys', { organization: organization, keyType: keyType }, [], core_1.BACKEND_SERVICE.MANAGEMENT);
43
+ };
44
+ ApiKeyServiceImpl.prototype.delete = function (organization, value, keyType) {
45
+ if (keyType === void 0) { keyType = api_key_type_1.API_KEY_TYPE.FIND_API; }
46
+ return this.httpsService.delete('keys', { organization: organization, value: value, keyType: keyType }, [], core_1.BACKEND_SERVICE.MANAGEMENT);
47
+ };
48
+ ApiKeyServiceImpl = __decorate([
49
+ (0, core_1.InjectionIdentifier)('ApiKeyService')
50
+ ], ApiKeyServiceImpl);
51
+ return ApiKeyServiceImpl;
52
+ }(core_1.BaseService));
53
+ exports.ApiKeyServiceImpl = ApiKeyServiceImpl;
54
+ //# sourceMappingURL=api-key.service.js.map
package/ocr/index.js CHANGED
@@ -1,2 +1,21 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),__exportStar=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||__createBinding(t,e,r)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/detect-response"),exports),__exportStar(require("./models/detected-text-entry"),exports),__exportStar(require("./services/ocr.service"),exports);
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./models/detect-response"), exports);
19
+ __exportStar(require("./models/detected-text-entry"), exports);
20
+ __exportStar(require("./services/ocr.service"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,4 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=detect-response.js.map
@@ -1,2 +1,4 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=detected-text-entry.js.map
@@ -1,2 +1,60 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
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.OcrServiceImpl=void 0;var operators_1=require("rxjs/operators"),injection_identifier_1=require("../../core/decorators/injection-identifier"),base_service_1=require("../../core/services/base.service"),https_service_interface_1=require("../../core/services/http/https.service.interface"),find_1=require("../../find"),OcrServiceImpl=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(https_service_interface_1.HttpsService),this.assetService=this.serviceProvider.getService(find_1.AssetServiceImpl)},t.prototype.detect=function(e){return this.httpsService.post("detect",{assetUrl:e},[],https_service_interface_1.BACKEND_SERVICE.OCR).pipe((0,operators_1.map)((function(e){return e.detectedTexts.map((function(e){return e.text}))})))},t.prototype.detectFromFile=function(e,t,r){var i=this;return this.assetService.generateAsset(e,t,{searchSessionId:null==r?void 0:r.searchSessionId}).pipe((0,operators_1.filter)((function(e){return e.asset.getStatus()===find_1.ASSET_STATUS.VERIFIED})),(0,operators_1.first)(),(0,operators_1.mergeMap)((function(e){return i.assetService.getImageUrlFromFind(e.asset.referenceId)})),(0,operators_1.mergeMap)((function(e){return i.detect(e.url)})))},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("OcrService")],t)}(base_service_1.BaseService);exports.OcrServiceImpl=OcrServiceImpl;
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.OcrServiceImpl = void 0;
26
+ var operators_1 = require("rxjs/operators");
27
+ var injection_identifier_1 = require("../../core/decorators/injection-identifier");
28
+ var base_service_1 = require("../../core/services/base.service");
29
+ var https_service_interface_1 = require("../../core/services/http/https.service.interface");
30
+ var find_1 = require("../../find");
31
+ var OcrServiceImpl = /** @class */ (function (_super) {
32
+ __extends(OcrServiceImpl, _super);
33
+ function OcrServiceImpl(serviceProvider) {
34
+ return _super.call(this, serviceProvider) || this;
35
+ }
36
+ OcrServiceImpl.prototype.onCreate = function () {
37
+ this.httpsService = this.serviceProvider.getService(https_service_interface_1.HttpsService);
38
+ this.assetService = this.serviceProvider.getService(find_1.AssetServiceImpl);
39
+ };
40
+ OcrServiceImpl.prototype.detect = function (assetUrl) {
41
+ return this.httpsService
42
+ .post('detect', { assetUrl: assetUrl }, [], https_service_interface_1.BACKEND_SERVICE.OCR)
43
+ .pipe((0, operators_1.map)(function (response) { return response.detectedTexts.map(function (_a) {
44
+ var text = _a.text;
45
+ return text;
46
+ }); }));
47
+ };
48
+ OcrServiceImpl.prototype.detectFromFile = function (organizationId, file, eventContext) {
49
+ var _this = this;
50
+ return this.assetService.generateAsset(organizationId, file, {
51
+ searchSessionId: eventContext === null || eventContext === void 0 ? void 0 : eventContext.searchSessionId,
52
+ }).pipe((0, operators_1.filter)(function (upload) { return upload.asset.getStatus() === find_1.ASSET_STATUS.VERIFIED; }), (0, operators_1.first)(), (0, operators_1.mergeMap)(function (upload) { return _this.assetService.getImageUrlFromFind(upload.asset.referenceId); }), (0, operators_1.mergeMap)(function (imageUrl) { return _this.detect(imageUrl.url); }));
53
+ };
54
+ OcrServiceImpl = __decorate([
55
+ (0, injection_identifier_1.InjectionIdentifier)('OcrService')
56
+ ], OcrServiceImpl);
57
+ return OcrServiceImpl;
58
+ }(base_service_1.BaseService));
59
+ exports.OcrServiceImpl = OcrServiceImpl;
60
+ //# sourceMappingURL=ocr.service.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "14.0.3",
3
+ "version": "14.2.0",
4
4
  "author": "Partium Inc.",
5
5
  "license": "See LICENSE.txt",
6
6
  "description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into JavaScript-based applications.",