@partium/js-sdk 13.0.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 (269) hide show
  1. package/LICENSE.txt +100 -0
  2. package/README.md +18 -0
  3. package/core/constants/constants.d.ts +12 -0
  4. package/core/constants/constants.js +2 -0
  5. package/core/decorators/injection-identifier.d.ts +10 -0
  6. package/core/decorators/injection-identifier.js +2 -0
  7. package/core/factories/paginated-request-service.factory.d.ts +22 -0
  8. package/core/factories/paginated-request-service.factory.js +2 -0
  9. package/core/index.d.ts +47 -0
  10. package/core/index.js +2 -0
  11. package/core/integration-defaults/http/fetch-api-http-error-helper.d.ts +16 -0
  12. package/core/integration-defaults/http/fetch-api-http-error-helper.js +2 -0
  13. package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.d.ts +35 -0
  14. package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +2 -0
  15. package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.d.ts +47 -0
  16. package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +2 -0
  17. package/core/integration-defaults/http/handle-axios-error-helper.d.ts +17 -0
  18. package/core/integration-defaults/http/handle-axios-error-helper.js +2 -0
  19. package/core/integration-defaults/http/https-client/axios-https-client.service.d.ts +83 -0
  20. package/core/integration-defaults/http/https-client/axios-https-client.service.js +2 -0
  21. package/core/integration-defaults/http/https-client/fetch-api-https-client.service.d.ts +85 -0
  22. package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +2 -0
  23. package/core/integration-defaults/http/js-oauth-keycloak-https.service.d.ts +8 -0
  24. package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +2 -0
  25. package/core/integration-defaults/js-p-file.d.ts +8 -0
  26. package/core/integration-defaults/js-p-file.js +2 -0
  27. package/core/integration-defaults/session/js-oauth-api-key-session.service.d.ts +76 -0
  28. package/core/integration-defaults/session/js-oauth-api-key-session.service.js +2 -0
  29. package/core/integration-defaults/session/js-oauth-keycloak-auth-config.d.ts +28 -0
  30. package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +2 -0
  31. package/core/integration-defaults/session/js-oauth-keycloak-session.service.d.ts +82 -0
  32. package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +2 -0
  33. package/core/integration-defaults/web-device-status.service.d.ts +24 -0
  34. package/core/integration-defaults/web-device-status.service.js +2 -0
  35. package/core/integration-defaults/web-file.service.d.ts +9 -0
  36. package/core/integration-defaults/web-file.service.js +2 -0
  37. package/core/integration-defaults/web-indexeddb.service.d.ts +19 -0
  38. package/core/integration-defaults/web-indexeddb.service.js +2 -0
  39. package/core/integration-defaults/web-local-storage.service.d.ts +157 -0
  40. package/core/integration-defaults/web-local-storage.service.js +2 -0
  41. package/core/models/api-object.d.ts +7 -0
  42. package/core/models/api-object.js +2 -0
  43. package/core/models/auth-config.d.ts +38 -0
  44. package/core/models/auth-config.js +2 -0
  45. package/core/models/device-info.d.ts +62 -0
  46. package/core/models/device-info.js +2 -0
  47. package/core/models/error.d.ts +70 -0
  48. package/core/models/error.js +2 -0
  49. package/core/models/formatted-string.d.ts +9 -0
  50. package/core/models/formatted-string.js +2 -0
  51. package/core/models/i18n-map.d.ts +34 -0
  52. package/core/models/i18n-map.js +2 -0
  53. package/core/models/i18n-string.d.ts +8 -0
  54. package/core/models/i18n-string.js +2 -0
  55. package/core/models/log.d.ts +130 -0
  56. package/core/models/log.js +2 -0
  57. package/core/models/organization.d.ts +121 -0
  58. package/core/models/organization.js +2 -0
  59. package/core/models/p-file.d.ts +17 -0
  60. package/core/models/p-file.js +2 -0
  61. package/core/models/paginated-list.d.ts +23 -0
  62. package/core/models/paginated-list.js +2 -0
  63. package/core/models/partium-config.d.ts +31 -0
  64. package/core/models/partium-config.js +2 -0
  65. package/core/models/user-token.d.ts +16 -0
  66. package/core/models/user-token.js +2 -0
  67. package/core/models/user.d.ts +48 -0
  68. package/core/models/user.js +2 -0
  69. package/core/services/backend-status.service.d.ts +46 -0
  70. package/core/services/backend-status.service.js +2 -0
  71. package/core/services/base-login-init.service.d.ts +32 -0
  72. package/core/services/base-login-init.service.js +2 -0
  73. package/core/services/base.service.d.ts +31 -0
  74. package/core/services/base.service.js +2 -0
  75. package/core/services/device-status.service.interface.d.ts +36 -0
  76. package/core/services/device-status.service.interface.js +2 -0
  77. package/core/services/file.service.interface.d.ts +24 -0
  78. package/core/services/file.service.interface.js +2 -0
  79. package/core/services/http/file-transfer/file-transfer.service.interface.d.ts +57 -0
  80. package/core/services/http/file-transfer/file-transfer.service.interface.js +2 -0
  81. package/core/services/http/https-client/https-client.service.interface.d.ts +96 -0
  82. package/core/services/http/https-client/https-client.service.interface.js +2 -0
  83. package/core/services/http/https.service.interface.d.ts +164 -0
  84. package/core/services/http/https.service.interface.js +2 -0
  85. package/core/services/http/oauth-https.service.d.ts +120 -0
  86. package/core/services/http/oauth-https.service.js +2 -0
  87. package/core/services/local-storage.service.interface.d.ts +221 -0
  88. package/core/services/local-storage.service.interface.js +2 -0
  89. package/core/services/log.service.d.ts +48 -0
  90. package/core/services/log.service.js +2 -0
  91. package/core/services/organization.service.d.ts +48 -0
  92. package/core/services/organization.service.js +2 -0
  93. package/core/services/paginated-request.service.d.ts +104 -0
  94. package/core/services/paginated-request.service.js +2 -0
  95. package/core/services/recent-parts.service.d.ts +59 -0
  96. package/core/services/recent-parts.service.js +2 -0
  97. package/core/services/service-provider.d.ts +58 -0
  98. package/core/services/service-provider.js +2 -0
  99. package/core/services/session/oauth-session.service.d.ts +76 -0
  100. package/core/services/session/oauth-session.service.js +2 -0
  101. package/core/services/session/session.service.interface.d.ts +138 -0
  102. package/core/services/session/session.service.interface.js +2 -0
  103. package/core/utils/general-helper.d.ts +35 -0
  104. package/core/utils/general-helper.js +2 -0
  105. package/data/index.d.ts +28 -0
  106. package/data/index.js +2 -0
  107. package/data/models/announcement.d.ts +30 -0
  108. package/data/models/announcement.js +2 -0
  109. package/data/models/assembly-hierarchy-node-breadcrumb.d.ts +10 -0
  110. package/data/models/assembly-hierarchy-node-breadcrumb.js +2 -0
  111. package/data/models/assembly-hierarchy-node.d.ts +16 -0
  112. package/data/models/assembly-hierarchy-node.js +2 -0
  113. package/data/models/attribute.d.ts +46 -0
  114. package/data/models/attribute.js +2 -0
  115. package/data/models/csa-request-search.d.ts +18 -0
  116. package/data/models/csa-request-search.js +2 -0
  117. package/data/models/csa-request-status.d.ts +16 -0
  118. package/data/models/csa-request-status.js +2 -0
  119. package/data/models/csa-request.d.ts +41 -0
  120. package/data/models/csa-request.js +2 -0
  121. package/data/models/document.d.ts +12 -0
  122. package/data/models/document.js +2 -0
  123. package/data/models/filter-key.d.ts +12 -0
  124. package/data/models/filter-key.js +2 -0
  125. package/data/models/filter-option-value.d.ts +18 -0
  126. package/data/models/filter-option-value.js +2 -0
  127. package/data/models/image.d.ts +36 -0
  128. package/data/models/image.js +2 -0
  129. package/data/models/inquiry.d.ts +32 -0
  130. package/data/models/inquiry.js +2 -0
  131. package/data/models/mounting-location.d.ts +32 -0
  132. package/data/models/mounting-location.js +2 -0
  133. package/data/models/multiple-expert-searches.d.ts +9 -0
  134. package/data/models/multiple-expert-searches.js +2 -0
  135. package/data/models/part-enrichment-data.d.ts +24 -0
  136. package/data/models/part-enrichment-data.js +2 -0
  137. package/data/models/part.d.ts +168 -0
  138. package/data/models/part.js +2 -0
  139. package/data/models/shopping-cart.d.ts +43 -0
  140. package/data/models/shopping-cart.js +2 -0
  141. package/data/services/announcement.service.d.ts +68 -0
  142. package/data/services/announcement.service.js +2 -0
  143. package/data/services/assembly-hierarchy-nodes.service.d.ts +113 -0
  144. package/data/services/assembly-hierarchy-nodes.service.js +2 -0
  145. package/data/services/csa-helper.service.d.ts +32 -0
  146. package/data/services/csa-helper.service.js +2 -0
  147. package/data/services/customer-service-assistance.service.d.ts +181 -0
  148. package/data/services/customer-service-assistance.service.js +2 -0
  149. package/data/services/filter.service.d.ts +97 -0
  150. package/data/services/filter.service.js +2 -0
  151. package/data/services/inquiry.service.d.ts +54 -0
  152. package/data/services/inquiry.service.js +2 -0
  153. package/data/services/part-attribute.service.d.ts +42 -0
  154. package/data/services/part-attribute.service.js +2 -0
  155. package/data/services/part-enrichment.service.d.ts +32 -0
  156. package/data/services/part-enrichment.service.js +2 -0
  157. package/data/services/part.service.d.ts +121 -0
  158. package/data/services/part.service.js +2 -0
  159. package/data/services/related-parts.service.d.ts +75 -0
  160. package/data/services/related-parts.service.js +2 -0
  161. package/data/services/shopping-cart.service.d.ts +150 -0
  162. package/data/services/shopping-cart.service.js +2 -0
  163. package/find/index.d.ts +35 -0
  164. package/find/index.js +2 -0
  165. package/find/models/assets/asset.d.ts +24 -0
  166. package/find/models/assets/asset.js +2 -0
  167. package/find/models/search-filter.d.ts +87 -0
  168. package/find/models/search-filter.js +2 -0
  169. package/find/models/search-input.d.ts +39 -0
  170. package/find/models/search-input.js +2 -0
  171. package/find/models/search-output.d.ts +10 -0
  172. package/find/models/search-output.js +2 -0
  173. package/find/models/search-result-status.d.ts +33 -0
  174. package/find/models/search-result-status.js +2 -0
  175. package/find/models/search-session-log-object.d.ts +16 -0
  176. package/find/models/search-session-log-object.js +2 -0
  177. package/find/models/search-status/cv-search-status.d.ts +20 -0
  178. package/find/models/search-status/cv-search-status.js +2 -0
  179. package/find/models/search-status/search-filter-status.d.ts +33 -0
  180. package/find/models/search-status/search-filter-status.js +2 -0
  181. package/find/models/search-status/search-status.d.ts +34 -0
  182. package/find/models/search-status/search-status.js +2 -0
  183. package/find/models/search-status/tag-search-status.d.ts +16 -0
  184. package/find/models/search-status/tag-search-status.js +2 -0
  185. package/find/models/search-status/text-search-status.d.ts +15 -0
  186. package/find/models/search-status/text-search-status.js +2 -0
  187. package/find/models/search-tag.d.ts +12 -0
  188. package/find/models/search-tag.js +2 -0
  189. package/find/models/smart-filter.d.ts +25 -0
  190. package/find/models/smart-filter.js +2 -0
  191. package/find/models/tagable/i18n-tagable.d.ts +10 -0
  192. package/find/models/tagable/i18n-tagable.js +2 -0
  193. package/find/models/tagable/tagable-base.d.ts +11 -0
  194. package/find/models/tagable/tagable-base.js +2 -0
  195. package/find/models/tagable/tagable.d.ts +10 -0
  196. package/find/models/tagable/tagable.js +2 -0
  197. package/find/models/text-search-config.d.ts +57 -0
  198. package/find/models/text-search-config.js +2 -0
  199. package/find/models/text-search-manipulator.d.ts +46 -0
  200. package/find/models/text-search-manipulator.js +2 -0
  201. package/find/models/text-search-result-item/text-search-error.d.ts +7 -0
  202. package/find/models/text-search-result-item/text-search-error.js +2 -0
  203. package/find/models/text-search-result-item/text-search-result-item-document.d.ts +10 -0
  204. package/find/models/text-search-result-item/text-search-result-item-document.js +2 -0
  205. package/find/models/text-search-result-item/text-search-result-item-part.d.ts +12 -0
  206. package/find/models/text-search-result-item/text-search-result-item-part.js +2 -0
  207. package/find/models/text-search-result-item/text-search-result-item-recent-query.d.ts +10 -0
  208. package/find/models/text-search-result-item/text-search-result-item-recent-query.js +2 -0
  209. package/find/models/text-search-result-item/text-search-result-item-unknown.d.ts +12 -0
  210. package/find/models/text-search-result-item/text-search-result-item-unknown.js +2 -0
  211. package/find/models/text-search-result-item/text-search-result-item.d.ts +16 -0
  212. package/find/models/text-search-result-item/text-search-result-item.js +2 -0
  213. package/find/services/asset.service.d.ts +160 -0
  214. package/find/services/asset.service.js +2 -0
  215. package/find/services/filter-uploaders/filter-uploader.d.ts +13 -0
  216. package/find/services/filter-uploaders/filter-uploader.js +2 -0
  217. package/find/services/filter-uploaders/update-filters-uploader.d.ts +17 -0
  218. package/find/services/filter-uploaders/update-filters-uploader.js +2 -0
  219. package/find/services/filter-uploaders/update-filters.model.d.ts +19 -0
  220. package/find/services/filter-uploaders/update-filters.model.js +2 -0
  221. package/find/services/search/cv-search.service.d.ts +103 -0
  222. package/find/services/search/cv-search.service.js +2 -0
  223. package/find/services/search/recent-text-search-queries.service.d.ts +89 -0
  224. package/find/services/search/recent-text-search-queries.service.js +2 -0
  225. package/find/services/search/search-result.service.d.ts +142 -0
  226. package/find/services/search/search-result.service.js +2 -0
  227. package/find/services/search/search.service.d.ts +291 -0
  228. package/find/services/search/search.service.js +2 -0
  229. package/find/services/search/tag-search.service.d.ts +66 -0
  230. package/find/services/search/tag-search.service.js +2 -0
  231. package/find/services/search/text-search.service.d.ts +116 -0
  232. package/find/services/search/text-search.service.js +2 -0
  233. package/find/services/search-filter.service.d.ts +223 -0
  234. package/find/services/search-filter.service.js +2 -0
  235. package/find/utils/search-helper.d.ts +14 -0
  236. package/find/utils/search-helper.js +2 -0
  237. package/gen/sdk-version.d.ts +2 -0
  238. package/gen/sdk-version.js +2 -0
  239. package/index.d.ts +121 -0
  240. package/index.js +2 -0
  241. package/management/index.d.ts +5 -0
  242. package/management/index.js +2 -0
  243. package/management/models/api-key-list-response.d.ts +10 -0
  244. package/management/models/api-key-list-response.js +2 -0
  245. package/management/models/api-key-type.d.ts +5 -0
  246. package/management/models/api-key-type.js +2 -0
  247. package/management/models/api-key.d.ts +4 -0
  248. package/management/models/api-key.js +2 -0
  249. package/management/services/api-key.service.d.ts +39 -0
  250. package/management/services/api-key.service.js +2 -0
  251. package/ocr/index.d.ts +4 -0
  252. package/ocr/index.js +2 -0
  253. package/ocr/models/detect-response.d.ts +5 -0
  254. package/ocr/models/detect-response.js +2 -0
  255. package/ocr/models/detected-text-entry.d.ts +5 -0
  256. package/ocr/models/detected-text-entry.js +2 -0
  257. package/ocr/services/ocr.service.d.ts +36 -0
  258. package/ocr/services/ocr.service.js +2 -0
  259. package/package.json +45 -0
  260. package/user-data/index.d.ts +5 -0
  261. package/user-data/index.js +2 -0
  262. package/user-data/models/part-with-nullable.d.ts +5 -0
  263. package/user-data/models/part-with-nullable.js +2 -0
  264. package/user-data/models/request-list/request-list.d.ts +16 -0
  265. package/user-data/models/request-list/request-list.js +2 -0
  266. package/user-data/services/favorite/favorite.service.d.ts +45 -0
  267. package/user-data/services/favorite/favorite.service.js +2 -0
  268. package/user-data/services/request-list/request-list.service.d.ts +97 -0
  269. package/user-data/services/request-list/request-list.service.js +2 -0
@@ -0,0 +1,2 @@
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 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,c=arguments.length,i=c<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(c<3?o(i):c>3?o(t,r,i):o(t,r))||i);return c>3&&i&&Object.defineProperty(t,r,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartEnrichmentServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),part_enrichment_data_1=require("../models/part-enrichment-data"),PartEnrichmentServiceImpl=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.enrichPart=function(e){return this.httpsService.post("part_types/".concat(e,"/enrich"),{},[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.catchError)((function(e){var t;if(404===(null===(t=e.detail)||void 0===t?void 0:t.status))throw new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_UPIS_FOUND,e.detail);throw e})))},t.prototype.getEnrichedData=function(e){return this.httpsService.get("part_types/".concat(e,"/enrichment-status"),[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(e){return part_enrichment_data_1.PartEnrichmentData.fromAPIResponse(e)})))},t=__decorate([(0,core_1.InjectionIdentifier)("PartEnrichmentService")],t)}(core_1.BaseService);exports.PartEnrichmentServiceImpl=PartEnrichmentServiceImpl;
@@ -0,0 +1,121 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { Observable } from 'rxjs';
3
+ import { BaseService, PaginatedRequestService, ServiceProvider } from '../../core';
4
+ import { Part } from '../models/part';
5
+ import { PartMountingLocationInfo } from '../models/mounting-location';
6
+ /**
7
+ * Options for the getPart method.
8
+ */
9
+ export interface PartDetailRequestOptions {
10
+ /**
11
+ * Whether to include the mounting locations.
12
+ * If true, the mounting locations of the part will be included in the response. (For performance reasons, the BE will
13
+ * cut after a certain amount of mounting locations).
14
+ * If false, the mounting locations of the part will not be included in the response. (default)
15
+ * If a string-array of bom-node-ids is passed, then mounting locations will be included in the response, whereas the
16
+ * ones with the ids passed will definitely be added (due to performance reasons others might be cut out).
17
+ */
18
+ includeMountingLocations?: boolean | string[];
19
+ /**
20
+ * If true, the enriched metadata and summary-id will also be included in the response.
21
+ */
22
+ includeSummary?: boolean;
23
+ /**
24
+ * If true, the enrichment status and enriched metadata will also be included in the response.
25
+ */
26
+ includeEnrichment?: boolean;
27
+ }
28
+ /**
29
+ * Service for getting and setting parts.
30
+ */
31
+ export interface PartService {
32
+ /**
33
+ * Will trigger loading the information of a part from the backend.
34
+ *
35
+ * It will also fetch the part attributes which is not fetched by getParts
36
+ * method.
37
+ *
38
+ * @param partiumPartId part-id of the part to retrieve
39
+ * @param options options for the request
40
+ * @returns observable that emits when the requested part was loaded from
41
+ * the backend
42
+ * @returns observable that emits when the requested part was loaded from the
43
+ * backend.
44
+ */
45
+ getPart(partiumPartId: string, options?: PartDetailRequestOptions): Observable<Part>;
46
+ /**
47
+ * Will trigger loading the information of all requested parts from the backend.
48
+ *
49
+ * It will not fetch the part attributes compared to getPart method.
50
+ *
51
+ * The returned array of Parts will be in the same order as the requested
52
+ * part-ids. For every part that could not be found, the array contains null
53
+ * instead.
54
+ *
55
+ * @param partiumPartIds part-ids of all parts to retrieve
56
+ * @returns observable that emits when the requested part was loaded from the
57
+ * backend
58
+ */
59
+ getParts(partiumPartIds: string[]): Observable<Part[]>;
60
+ /**
61
+ * Request the information of all parts that have the given assembly hierarchy
62
+ * node as parent.
63
+ *
64
+ * It will not fetch the part attributes compared to getPart method.
65
+ *
66
+ * @param assemblyHierarchyNodeId id of the parent assembly hierarchy node
67
+ * @returns observable that emits with a Service of type PaginatedRequestService.
68
+ * This service can be used to retrieve a paginated list of the
69
+ * requested parts.
70
+ */
71
+ getPartsByAssemblyHierarchyNodeId(assemblyHierarchyNodeId: string): PaginatedRequestService<Part>;
72
+ /**
73
+ * Requests all mounting locations for a part.
74
+ *
75
+ * @param partPartiumId partium-id of the part
76
+ * @param prioritizedLocationIds optional array of location ids to include for sure (the whole list will be cut after a certain amount of elements, but these will be included)
77
+ * @returns observable that emits all the mounting locations for the part
78
+ */
79
+ getMountingLocationsForPart(partPartiumId: string, prioritizedLocationIds?: string[]): Observable<PartMountingLocationInfo>;
80
+ }
81
+ export declare class PartServiceImpl extends BaseService implements PartService {
82
+ private DOWNLOAD_PAGE_SIZE;
83
+ private PAGINATION_PAGE_SIZE;
84
+ private httpsService;
85
+ constructor(serviceProvider: ServiceProvider);
86
+ onCreate(): void;
87
+ getPart(partiumPartId: string, options?: PartDetailRequestOptions): Observable<Part>;
88
+ getParts(partiumPartIds: string[]): Observable<Part[]>;
89
+ getPartsByAssemblyHierarchyNodeId(assemblyHierarchyNodeId: string): PaginatedRequestService<Part>;
90
+ getMountingLocationsForPart(partPartiumId: string, prioritizedLocationIds?: string[]): Observable<PartMountingLocationInfo>;
91
+ /**
92
+ * Load the requested part from the server.
93
+ *
94
+ * @param partiumPartId the partium-id of the parts to get
95
+ * @param options options for the request
96
+ */
97
+ private loadPartFromServer;
98
+ /**
99
+ * Load all requested parts from the server.
100
+ * Since the response is paginated, it is necessary to do as many request as needed until
101
+ * all nodes are loaded.
102
+ *
103
+ * @param partiumPartIds the partium-ids of the parts to get
104
+ */
105
+ private loadPartsFromServer;
106
+ /**
107
+ * Sent request for one page of nodes
108
+ *
109
+ * @param page the current page of the pagination (1-indexed)
110
+ */
111
+ private requestPaginatedParts;
112
+ /**
113
+ * Order the given parts by the part-ids given in the part-id-array.
114
+ * If any part is not found in unorderedParts, the array contains null instead.
115
+ *
116
+ * @param unorderedParts the parts to order
117
+ * @param partiumPartIds the order in which to sort
118
+ * @returns array of given parts, ordered by partiumPartIds (contains null for parts not found)
119
+ */
120
+ private orderParts;
121
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])},r(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var t,e=1,o=arguments.length;e<o;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,t,e,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,t,e,o);else for(var s=r.length-1;s>=0;s--)(n=r[s])&&(a=(i<3?n(a):i>3?n(t,e,a):n(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a},__spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return r.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartServiceImpl=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),core_1=require("../../core"),part_1=require("../models/part"),mounting_location_1=require("../models/mounting-location"),PartServiceImpl=function(r){function t(t){var e=r.call(this,t)||this;return e.DOWNLOAD_PAGE_SIZE=250,e.PAGINATION_PAGE_SIZE=25,e}return __extends(t,r),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.getPart=function(r,t){return this.loadPartFromServer(r,t).pipe((0,operators_1.catchError)((function(r){return console.log("Error while loading part-information from server.",r),(0,rxjs_1.throwError)(r)})))},t.prototype.getParts=function(r){var t=this;return this.loadPartsFromServer(r).pipe((0,operators_1.map)((function(e){return t.orderParts(e,r)})),(0,operators_1.mergeMap)((function(r){return console.log("Warning: nonexistent partium ids will be ignored"),(0,rxjs_1.of)(r.filter((function(r){return!!r})))})),(0,operators_1.catchError)((function(r){return console.log("Error while loading part-information from server.",r),(0,rxjs_1.throwError)(r)})))},t.prototype.getPartsByAssemblyHierarchyNodeId=function(r){return core_1.PaginatedRequestServiceFactory.generatePaginatedRequestService(part_1.Part.fromAPIResponse,this.httpsService,"part_types",core_1.BACKEND_SERVICE.DATA,[{assembly_uuid:r}],this.PAGINATION_PAGE_SIZE)},t.prototype.getMountingLocationsForPart=function(r,t){return this.httpsService.post("part_types/".concat(r,"/mounting-locations"),__assign({},t&&{priority_locations:t}),[],core_1.BACKEND_SERVICE.DATA).pipe((0,operators_1.map)((function(r){return mounting_location_1.PartMountingLocationInfo.fromAPIResponse(r)})))},t.prototype.loadPartFromServer=function(r,t){var e=[];return(null==t?void 0:t.includeMountingLocations)&&e.push({include_mounting_locations:t.includeMountingLocations}),(null==t?void 0:t.includeSummary)&&e.push({include_summary:t.includeSummary}),(null==t?void 0:t.includeEnrichment)&&e.push({include_enrichment:t.includeEnrichment}),this.httpsService.get("part_types/".concat(r),e,core_1.BACKEND_SERVICE.DATA).pipe((0,operators_1.map)((function(r){return part_1.Part.fromAPIResponse(r)})))},t.prototype.loadPartsFromServer=function(r){var t=this,e=1,o=new rxjs_1.Subject;return(0,rxjs_1.defer)((function(){return t.requestPaginatedParts(r,e)})).pipe((0,operators_1.map)((function(r){var t=r.pagination.page_size,n=r.pagination.items_count,i=Math.ceil(n/t);return e>=i?o.complete():e++<i&&setTimeout((function(){o.next()})),r.results})),(0,operators_1.repeatWhen)((function(){return o.asObservable()})),(0,operators_1.reduce)((function(r,t){return __spreadArray(__spreadArray([],r,!0),t,!0)})),(0,operators_1.map)((function(r){return r.map((function(r){return part_1.Part.fromAPIResponse(r,part_1.DATA_ORIGIN.DATA_API)}))})))},t.prototype.requestPaginatedParts=function(r,t){return this.httpsService.post("part_types/many",{uuids:r},[{page:t},{page_size:this.DOWNLOAD_PAGE_SIZE}],core_1.BACKEND_SERVICE.DATA)},t.prototype.orderParts=function(r,t){for(var e=[],o=function(t){e.push(r.find((function(r){return r&&r.partiumId===t})))},n=0,i=t;n<i.length;n++){o(i[n])}return e},t=__decorate([(0,core_1.InjectionIdentifier)("PartService")],t)}(core_1.BaseService);exports.PartServiceImpl=PartServiceImpl;
@@ -0,0 +1,75 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { Observable } from 'rxjs';
3
+ import { BaseService, PaginatedRequestService, ServiceProvider } from '../../core';
4
+ import { Part, RELATION_TYPE } from '../models/part';
5
+ export interface RelatedPartsSummaryResponse {
6
+ duplicates: number;
7
+ substitutes: number;
8
+ equivalents: number;
9
+ not_related: number;
10
+ }
11
+ export type RelatedPartsSummary = {
12
+ duplicatesCount: number;
13
+ substitutesCount: number;
14
+ equivalentsCount: number;
15
+ notRelatedCount: number;
16
+ };
17
+ /**
18
+ * Options for the getRelatedParts method.
19
+ */
20
+ export interface RelatedPartsRequestOptions {
21
+ /**
22
+ * If true, the enriched part-attributes will also be included in the response.
23
+ */
24
+ includeAttributes?: boolean;
25
+ }
26
+ /**
27
+ * Service for getting and setting parts.
28
+ */
29
+ export interface RelatedPartsService {
30
+ /**
31
+ * Get a summary of the related parts, how many parts of different relation types are available.
32
+ *
33
+ * @param partiumPartId partiumId of the part for which to get the relation summary
34
+ * @returns summary over the related parts for the given part
35
+ */
36
+ getSummary(partiumPartId: string): Observable<RelatedPartsSummary>;
37
+ /**
38
+ * Get a paginated list of the related parts of a given relation-type, for the given part.
39
+ *
40
+ * @param partiumPartId partiumId of the part for which to get relations
41
+ * @param relationTypes type or array of types of the relation(s) to retrieve
42
+ * @param options options for the request
43
+ * @returns observable that emits with a Service of type PaginatedRequestService.
44
+ * This service can be used to retrieve a paginated list of the
45
+ * related parts.
46
+ */
47
+ getRelatedParts(partiumPartId: string, relationTypes: RELATION_TYPE | RELATION_TYPE[], options?: RelatedPartsRequestOptions): PaginatedRequestService<Part>;
48
+ /**
49
+ * Create a new relation between two parts.
50
+ * For some relation-types it is relevant, in which direction the relation goes, so there is the relation-source (=anchor) and
51
+ * the relation target (related part):
52
+ * Anchor-Part | Related-Part | Type | Meaning
53
+ * -------------------------------------------------------------------------------------------
54
+ * A | B | DUPLICATE | A and B are duplicates; B and A are duplicates
55
+ * B | A | DUPLICATE | A and B are duplicates; B and A are duplicates
56
+ * A | B | EQUIVALENT | A and B are equivalent; B and A are equivalent
57
+ * B | A | EQUIVALENT | A and B are equivalent; B and A are equivalent
58
+ * A | B | SUBSTITUTE | A is a predecessor of B; B is a successor of A
59
+ * B | A | SUBSTITUTE | B is a predecessor of A; A is a successor of B
60
+ *
61
+ * @param anchorPartId partiumId of the anchor part
62
+ * @param relatedPartId partiumId of the related part
63
+ * @param relationType type of relation
64
+ */
65
+ createPartRelation(anchorPartId: string, relatedPartId: string, relationType: RELATION_TYPE): Observable<void>;
66
+ }
67
+ export declare class RelatedPartsServiceImpl extends BaseService implements RelatedPartsService {
68
+ private PAGINATION_PAGE_SIZE;
69
+ private httpsService;
70
+ constructor(serviceProvider: ServiceProvider);
71
+ onCreate(): void;
72
+ getSummary(partiumPartId: string): Observable<RelatedPartsSummary>;
73
+ getRelatedParts(partiumPartId: string, relationTypes: RELATION_TYPE | RELATION_TYPE[], options?: RelatedPartsRequestOptions): PaginatedRequestService<Part>;
74
+ createPartRelation(anchorPartId: string, relatedPartId: string, relationType: RELATION_TYPE): Observable<void>;
75
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,r,o){var n,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(e,r,a):n(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};Object.defineProperty(exports,"__esModule",{value:!0}),exports.RelatedPartsServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),part_1=require("../models/part"),RelatedPartsServiceImpl=function(t){function e(e){var r=t.call(this,e)||this;return r.PAGINATION_PAGE_SIZE=25,r}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.getSummary=function(t){return this.httpsService.get("part_types/".concat(t,"/relations-summary"),[],core_1.BACKEND_SERVICE.DATA).pipe((0,rxjs_1.map)((function(t){return{duplicatesCount:t.duplicates,substitutesCount:t.substitutes,equivalentsCount:t.equivalents,notRelatedCount:t.not_related}})))},e.prototype.getRelatedParts=function(t,e,r){var o,n=Array.isArray(e)?e:[e],i=((o={})[part_1.RELATION_TYPE.DUPLICATE]="duplicates",o[part_1.RELATION_TYPE.SUBSTITUTE]="substitutes",o[part_1.RELATION_TYPE.EQUIVALENT]="equivalents",o[part_1.RELATION_TYPE.NOT_RELATED]="not_related",o),a=[];return n.map((function(t){return i[t]})).map((function(t){return a.push({relation_types:t})})),(null==r?void 0:r.includeAttributes)&&a.push({include_attributes:r.includeAttributes}),core_1.PaginatedRequestServiceFactory.generatePaginatedRequestService((function(t){return part_1.Part.fromRelatedPartsAPIResponse(t)}),this.httpsService,"part_types/".concat(t,"/relations"),core_1.BACKEND_SERVICE.DATA,a,this.PAGINATION_PAGE_SIZE,!0)},e.prototype.createPartRelation=function(t,e,r){return this.httpsService.post("part_types/relations",[{anchor_part_uuid:t,related_part_uuid:e,type:r}],[],core_1.BACKEND_SERVICE.DATA)},e=__decorate([(0,core_1.InjectionIdentifier)("RelatedPartsService")],e)}(core_1.BaseService);exports.RelatedPartsServiceImpl=RelatedPartsServiceImpl;
@@ -0,0 +1,150 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { Observable } from 'rxjs';
3
+ import { EventContext } from '../../core/models/log';
4
+ import { BaseService } from '../../core/services/base.service';
5
+ import { LogService } from '../../core/services/log.service';
6
+ import { ServiceProvider } from '../../core/services/service-provider';
7
+ import { SearchService } from '../../find';
8
+ import { IShoppingCartDto, IShoppingCartEcrDto, IShoppingOffer, IShoppingPart, IShoppingPartDto, ShoppingCart } from '../models/shopping-cart';
9
+ import { PaginatedRequestService } from '../../core/services/paginated-request.service';
10
+ import { CSARequest } from '../models/csa-request';
11
+ interface ecrsData {
12
+ expert_request_id: string;
13
+ quantity: number;
14
+ }
15
+ interface ShoppingCartEventContext extends EventContext {
16
+ organizationId?: string;
17
+ ecrs?: ecrsData[];
18
+ searchSessionId?: string;
19
+ }
20
+ /**
21
+ * TODO Apv2 transition
22
+ * APv2 Service for CRUD functionality on Shopping cart
23
+ * this services will remove the current Request-list service from sdk
24
+ * @experimental This service and its API in a beta phase and not stable. It is subject to change and break until marked as stable.
25
+ */
26
+ export interface ShoppingCartService {
27
+ /**
28
+ * Returns all carts client has access to.
29
+ * CSA: depending on org-auth Technician: The single "OPEN" cart they have open or empty if no new cart exists yet
30
+ * @param urlParams the params to be passed to the request for filtered results
31
+ * @returns Observable with an array of the Shopping cart of the saved parts.
32
+ */
33
+ getShoppingCarts(urlParams: Object[]): PaginatedRequestService<ShoppingCart>;
34
+ /**
35
+ * Creates an empty shopping cart object.
36
+ *
37
+ * @returns Observable with an array of the Shopping cart of the saved parts.
38
+ */
39
+ createEmptyShoppingCart(ShoppingCartDto: IShoppingCartDto): Observable<ShoppingCart>;
40
+ /**
41
+ * Fetches the Shopping cart by Id.
42
+ * @param cartId the id of the shopping cart to be fetched
43
+ * @returns Observable with an Shopping cart object
44
+ * to the backend.
45
+ */
46
+ getShoppingCart(cartId: string): Observable<ShoppingCart>;
47
+ /**
48
+ * Creates a request offer action
49
+ * Creating an offer leads to an inquiry being created if the cart does not already have a relation to an existing inquiry
50
+ * @param cartId the id of the shopping cart to be send
51
+ * @param languageUI the interface language of the shopping cart to be send
52
+
53
+ */
54
+ requestShoppingCartOffer(cartId: string, languageUI: string): Observable<IShoppingOffer>;
55
+ /**
56
+ * Fetches the parts of the Shopping cart.
57
+ * @param cartId the id of the shopping cart to be fetched
58
+ * @param urlParams (optional) the params to be passed to the request for filtered results
59
+ * @returns Observable with an Shopping cart object
60
+ * to the backend.
61
+ */
62
+ getShoppingCartParts(cartId: string, urlParams?: Object[]): PaginatedRequestService<IShoppingPart>;
63
+ /**
64
+ * Saves a group of parts in the shopping cart.
65
+ * @param cartId the id of the shopping cart to be fetched
66
+ * @param updatedParts An array of type IShoppingPart of all the requested parts
67
+ * that are going to be added to the list.
68
+ * @param shoppingCartEventContext (optional) ShoppingCartEventContext object to add the missing data that will be logged using the log format V2
69
+ * @returns Observable with an array of the Shopping cart of the saved parts.
70
+ */
71
+ saveShoppingCartParts(cartId: string, updatedParts: IShoppingPartDto[], shoppingCartEventContext?: ShoppingCartEventContext): Observable<IShoppingPart[]>;
72
+ /**
73
+ * Saves a group of ecrs in the shopping cart.
74
+ * @param updatedEcrs An array of type IShoppingCartEcrDto with the data of the CSARquest that were updated
75
+ * @param shoppingCartEventContext (optional) ShoppingCartEventContext object to add the missing data that will be logged using the log format V2
76
+ * @returns Observable with an array of the Shopping cart of the saved parts.
77
+ */
78
+ saveShoppingCartEcrs(updatedEcr: IShoppingCartEcrDto[], shoppingCartEventContext?: ShoppingCartEventContext): Observable<Array<CSARequest>>;
79
+ /**
80
+ * Adds a new part to the Shopping cart.
81
+ * Adds cart contents for one part. If item id already exists, adds quantity to existing one.
82
+ * @param cartId the id of the shopping cart to be fetched
83
+ * @param addedPart the part that is going to be added to the list
84
+ * @param shoppingCartEventContext (optional) ShoppingCartEventContext object to add the missing data that will be logged using the log format V2
85
+ * @returns Observable with an array of the parts that resolves with the request
86
+ * to the backend.
87
+ */
88
+ addPart(cartId: string, addedPart: IShoppingPartDto, shoppingCartEventContext?: ShoppingCartEventContext): Observable<IShoppingPart>;
89
+ /**
90
+ * Updates the Shopping cart parts part when new quantities are added-
91
+ * @param cartId the id of the shopping cart to be fetched
92
+ * @param updatedPart the part that is going to be added to the list
93
+ * @param shoppingCartEventContext (optional) ShoppingCartEventContext object to add the missing data that will be logged using the log format V2
94
+ * @returns Observable with an array of the parts that resolves with the request
95
+ * to the backend.
96
+ */
97
+ updateShoppingCartPart(cartId: string, updatedPart: IShoppingPartDto, shoppingCartEventContext?: ShoppingCartEventContext): Observable<IShoppingPart>;
98
+ /**
99
+ * Deletes one part from the requestedList.
100
+ * @param cartId the id of the shopping cart to be fetched
101
+ * @param partiumId the id of the part that is going to be removed
102
+ * @param shoppingCartEventContext (optional) ShoppingCartEventContext object to add the missing data that will be logged using the log format V2
103
+ * @returns Observable with a boolean
104
+ */
105
+ deletePart(cartId: string, partiumId: string, shoppingCartEventContext?: ShoppingCartEventContext): Observable<boolean>;
106
+ /**
107
+ * Resets the shopping cart parts list to an empty array of parts.
108
+ * @param cartId the id of the shopping cart to be fetched
109
+ * @param shoppingCartEventContext (optional) ShoppingCartEventContext object to add the missing data that will be logged using the log format V2
110
+ * @returns Observable with a empty Shopping cart parts object that resolves with the
111
+ * request to the backend.
112
+ */
113
+ resetShoppingCart(cartId: string, shoppingCartEventContext?: ShoppingCartEventContext): Observable<boolean>;
114
+ /**
115
+ * Exports the shopping cart as an email.
116
+ * @param shoppingCartId id of the shopping cart to export
117
+ * @param recipients comma separated list of recipients
118
+ * @param subject subject of the email
119
+ * @param message message of the email
120
+ * @return an observable that completes when the email is sent
121
+ */
122
+ exportShoppingCartAsEmail(shoppingCartId: string, recipients: string, subject: string, message: string): Observable<void>;
123
+ }
124
+ export declare class ShoppingCartServiceImpl extends BaseService implements ShoppingCartService {
125
+ private httpsService;
126
+ protected logService: LogService;
127
+ protected searchService: SearchService;
128
+ constructor(serviceProvider: ServiceProvider);
129
+ onCreate(): void;
130
+ getShoppingCarts(urlParams?: Object[]): PaginatedRequestService<ShoppingCart>;
131
+ createEmptyShoppingCart(dto: IShoppingCartDto): Observable<ShoppingCart>;
132
+ getShoppingCart(cartId: string): Observable<ShoppingCart>;
133
+ getShoppingCartParts(cartId: string, urlParams?: Object[]): PaginatedRequestService<IShoppingPart>;
134
+ updateShoppingCartPart(cartId: string, updatedPart: IShoppingPartDto, shoppingCartEventContext?: ShoppingCartEventContext): Observable<IShoppingPart>;
135
+ requestShoppingCartOffer(cartId: string, languageUi: string): Observable<IShoppingOffer>;
136
+ saveShoppingCartEcrs(updatedItems: IShoppingCartEcrDto[], shoppingCartEventContext?: ShoppingCartEventContext): Observable<Array<CSARequest>>;
137
+ saveShoppingCartParts(cartId: string, updatedParts: IShoppingPartDto[], shoppingCartEventContext: ShoppingCartEventContext): Observable<IShoppingPart[]>;
138
+ addPart(cartId: string, addedPart: IShoppingPartDto, shoppingCartEventContext?: ShoppingCartEventContext): Observable<IShoppingPart>;
139
+ /**
140
+ * Resets the requests list to an empty array of parts.
141
+ */
142
+ resetShoppingCart(cartId: string, shoppingCartEventContext?: ShoppingCartEventContext): Observable<boolean>;
143
+ /**
144
+ * DELETE a part from request-list without send entire list to update
145
+ */
146
+ deletePart(cartId: string, partiumId: string, shoppingCartEventContext?: ShoppingCartEventContext): Observable<boolean>;
147
+ exportShoppingCartAsEmail(cartId: string, recipients: string, subject: string, message: string): Observable<void>;
148
+ private dispatchLogService;
149
+ }
150
+ export {};
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__decorate=this&&this.__decorate||function(t,e,r,i){var o,n=arguments.length,c=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(c=(n<3?o(c):n>3?o(e,r,c):o(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShoppingCartServiceImpl=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),log_1=require("../../core/models/log"),injection_identifier_1=require("../../core/decorators/injection-identifier"),https_service_interface_1=require("../../core/services/http/https.service.interface"),base_service_1=require("../../core/services/base.service"),log_service_1=require("../../core/services/log.service"),shopping_cart_1=require("../models/shopping-cart"),core_1=require("../../core"),csa_request_1=require("../models/csa-request"),ShoppingCartServiceImpl=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(https_service_interface_1.HttpsService),this.logService=this.serviceProvider.getService(log_service_1.LogServiceImpl)},e.prototype.getShoppingCarts=function(t){return void 0===t&&(t=[]),core_1.PaginatedRequestServiceFactory.generatePaginatedRequestService(shopping_cart_1.ShoppingCart.fromAPIResponse,this.httpsService,"carts",https_service_interface_1.BACKEND_SERVICE.CSA,t)},e.prototype.createEmptyShoppingCart=function(t){return this.httpsService.post("carts",t,[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.map)((function(t){return shopping_cart_1.ShoppingCart.fromAPIResponse(t)})))},e.prototype.getShoppingCart=function(t){return this.httpsService.get("carts/".concat(t),[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.map)((function(t){return shopping_cart_1.ShoppingCart.fromAPIResponse(t)})))},e.prototype.getShoppingCartParts=function(t,e){return void 0===e&&(e=[]),core_1.PaginatedRequestServiceFactory.generatePaginatedRequestService(shopping_cart_1.ShoppingCart.fromPartAPIResponse,this.httpsService,"carts/".concat(t,"/parts"),https_service_interface_1.BACKEND_SERVICE.CSA,e)},e.prototype.updateShoppingCartPart=function(t,e,r){var i=this;return this.httpsService.put("carts/".concat(t,"/parts/").concat(e.item_id),e,[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.tap)((function(){i.dispatchLogService(log_1.EVENT.SHOPPING_CART_ADD_PART,{partium_id:e.item_id,quantity:e.quantity,shopping_cart_id:t,searchSessionId:null==r?void 0:r.searchSessionId},r)})))},e.prototype.requestShoppingCartOffer=function(t,e){return this.httpsService.post("carts/".concat(t,"/actions/request-offer"),{language_ui:e},[],https_service_interface_1.BACKEND_SERVICE.CSA)},e.prototype.saveShoppingCartEcrs=function(t,e){var r=this,i=[];return t.forEach((function(t){i.push(r.httpsService.put("requests/".concat(t.item_id,"/quantity/"),{quantity:t.quantity},[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.map)((function(t){return csa_request_1.CSARequest.fromAPIResponse(t)}))))})),(0,rxjs_1.forkJoin)(i)},e.prototype.saveShoppingCartParts=function(t,e,r){var i=e.map((function(t){return{item_id:t.item_id,quantity:t.quantity,bom_context:t.bom_context}}));return this.httpsService.put("carts/".concat(t,"/parts"),i,[],https_service_interface_1.BACKEND_SERVICE.CSA)},e.prototype.addPart=function(t,e,r){var i=this,o={item_id:e.item_id,quantity:e.quantity,bom_context:null==e?void 0:e.bom_context};return this.httpsService.post("carts/".concat(t,"/parts"),o,[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.tap)((function(){return i.dispatchLogService(log_1.EVENT.SHOPPING_CART_ADD_PART,{partiumId:e.item_id,quantity:e.quantity,searchSessionId:null==r?void 0:r.searchSessionId,shopping_cart_id:t},r)})))},e.prototype.resetShoppingCart=function(t,e){var r=this;return this.httpsService.put("carts/".concat(t,"/parts"),[],[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.tap)((function(){r.dispatchLogService(log_1.EVENT.SHOPPING_CART_REMOVE_ALL_PARTS,{shopping_cart_id:t},e)})),(0,operators_1.catchError)((function(t){})))},e.prototype.deletePart=function(t,e,r){var i=this;return this.httpsService.delete("carts/".concat(t,"/parts/").concat(e),{},[],https_service_interface_1.BACKEND_SERVICE.CSA).pipe((0,operators_1.tap)((function(){return i.dispatchLogService(log_1.EVENT.SHOPPING_CART_REMOVE_PART,{partiumId:e,shopping_cart_id:t},r)})),(0,operators_1.map)((function(){return!0})))},e.prototype.exportShoppingCartAsEmail=function(t,e,r,i){return this.httpsService.post("carts/".concat(t,"/actions/email"),{recipients:e,subject:r,message:i},[],https_service_interface_1.BACKEND_SERVICE.CSA)},e.prototype.dispatchLogService=function(t,e,r){this.logService.logEvent(new log_1.EventLog({version:log_1.EVENTLOG_VERSIONS.V_2_0_0,organizationId:null==r?void 0:r.organizationId,interface:(null==r?void 0:r.eventInterface)||log_1.INTERFACE.API_ACCESS,event:t,data:e})).subscribe((function(){}),(function(t){console.log("Error while sending log event: ",t)}))},e=__decorate([(0,injection_identifier_1.InjectionIdentifier)("ShoppingCartService")],e)}(base_service_1.BaseService);exports.ShoppingCartServiceImpl=ShoppingCartServiceImpl;
@@ -0,0 +1,35 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ export * from './models/tagable/i18n-tagable';
3
+ export * from './models/tagable/tagable-base';
4
+ export * from './models/tagable/tagable';
5
+ export * from './models/text-search-result-item/text-search-result-item-unknown';
6
+ export * from './models/text-search-result-item/text-search-result-item-part';
7
+ export * from './models/text-search-result-item/text-search-result-item-document';
8
+ export * from './models/text-search-result-item/text-search-result-item-recent-query';
9
+ export * from './models/text-search-result-item/text-search-error';
10
+ export * from './models/text-search-result-item/text-search-result-item';
11
+ export * from './models/smart-filter';
12
+ export * from './models/search-status/text-search-status';
13
+ export * from './models/search-status/cv-search-status';
14
+ export * from './models/search-status/search-filter-status';
15
+ export * from './models/search-status/search-status';
16
+ export * from './models/search-status/tag-search-status';
17
+ export * from './models/search-filter';
18
+ export * from './models/text-search-manipulator';
19
+ export * from './models/assets/asset';
20
+ export * from './models/text-search-config';
21
+ export * from './models/search-session-log-object';
22
+ export * from './models/search-tag';
23
+ export * from './models/search-result-status';
24
+ export * from './models/search-input';
25
+ export * from './models/search-output';
26
+ export * from './services/search-filter.service';
27
+ export * from './services/search/search.service';
28
+ export * from './services/search/search-result.service';
29
+ export * from './services/search/text-search.service';
30
+ export * from './services/search/cv-search.service';
31
+ export * from './services/filter-uploaders/filter-uploader';
32
+ export * from './services/filter-uploaders/update-filters-uploader';
33
+ export * from './services/asset.service';
34
+ export * from './services/search/tag-search.service';
35
+ export * from './services/search/recent-text-search-queries.service';
package/find/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var a=Object.getOwnPropertyDescriptor(r,t);a&&!("get"in a?!r.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,a)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/tagable/i18n-tagable"),exports),__exportStar(require("./models/tagable/tagable-base"),exports),__exportStar(require("./models/tagable/tagable"),exports),__exportStar(require("./models/text-search-result-item/text-search-result-item-unknown"),exports),__exportStar(require("./models/text-search-result-item/text-search-result-item-part"),exports),__exportStar(require("./models/text-search-result-item/text-search-result-item-document"),exports),__exportStar(require("./models/text-search-result-item/text-search-result-item-recent-query"),exports),__exportStar(require("./models/text-search-result-item/text-search-error"),exports),__exportStar(require("./models/text-search-result-item/text-search-result-item"),exports),__exportStar(require("./models/smart-filter"),exports),__exportStar(require("./models/search-status/text-search-status"),exports),__exportStar(require("./models/search-status/cv-search-status"),exports),__exportStar(require("./models/search-status/search-filter-status"),exports),__exportStar(require("./models/search-status/search-status"),exports),__exportStar(require("./models/search-status/tag-search-status"),exports),__exportStar(require("./models/search-filter"),exports),__exportStar(require("./models/text-search-manipulator"),exports),__exportStar(require("./models/assets/asset"),exports),__exportStar(require("./models/text-search-config"),exports),__exportStar(require("./models/search-session-log-object"),exports),__exportStar(require("./models/search-tag"),exports),__exportStar(require("./models/search-result-status"),exports),__exportStar(require("./models/search-input"),exports),__exportStar(require("./models/search-output"),exports),__exportStar(require("./services/search-filter.service"),exports),__exportStar(require("./services/search/search.service"),exports),__exportStar(require("./services/search/search-result.service"),exports),__exportStar(require("./services/search/text-search.service"),exports),__exportStar(require("./services/search/cv-search.service"),exports),__exportStar(require("./services/filter-uploaders/filter-uploader"),exports),__exportStar(require("./services/filter-uploaders/update-filters-uploader"),exports),__exportStar(require("./services/asset.service"),exports),__exportStar(require("./services/search/tag-search.service"),exports),__exportStar(require("./services/search/recent-text-search-queries.service"),exports);
@@ -0,0 +1,24 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { PFile } from "../../../core";
3
+ export declare enum ASSET_STATUS {
4
+ NEW = 0,// asset is only available local or just being generated
5
+ PREPARING = 1,// prepare asset request on the server is currently running
6
+ PREPARED = 2,// asset is prepared for upload
7
+ UPLOADING = 3,// assets is currently uploading to the server
8
+ UPLOADED = 4,// asset was successfully uploaded to the server
9
+ VERIFYING = 5,// the verify request is currently active
10
+ VERIFIED = 6,// the asset upload was verified with the BE
11
+ ERROR = 7
12
+ }
13
+ /**
14
+ * Asset of any type that exists in the Partium ecosystem.
15
+ */
16
+ export declare class Asset {
17
+ referenceId: string;
18
+ uploadUrl: string;
19
+ private status;
20
+ file: PFile;
21
+ constructor(file: PFile);
22
+ setStatus(newStatus: ASSET_STATUS): void;
23
+ getStatus(): ASSET_STATUS;
24
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var ASSET_STATUS;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Asset=exports.ASSET_STATUS=void 0,function(t){t[t.NEW=0]="NEW",t[t.PREPARING=1]="PREPARING",t[t.PREPARED=2]="PREPARED",t[t.UPLOADING=3]="UPLOADING",t[t.UPLOADED=4]="UPLOADED",t[t.VERIFYING=5]="VERIFYING",t[t.VERIFIED=6]="VERIFIED",t[t.ERROR=7]="ERROR"}(ASSET_STATUS||(exports.ASSET_STATUS=ASSET_STATUS={}));var Asset=function(){function t(t){this.file=t,this.status=ASSET_STATUS.NEW}return t.prototype.setStatus=function(t){this.status=t},t.prototype.getStatus=function(){return this.status},t}();exports.Asset=Asset;
@@ -0,0 +1,87 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * @deprecated not needed for new search, use search.performSearch and SearchInput.
4
+ */
5
+ export declare enum SearchFilterType {
6
+ CategoryFilter = "category",
7
+ IncludeExcludeFilter = "includeExclude",
8
+ KvpHardFilter = "kvpHardFilter"
9
+ }
10
+ /**
11
+ * Search-filters that can be applied to a search-session, in order to narrow down the search.
12
+ *
13
+ * @deprecated not needed for new search, use search.performSearch and SearchInput.
14
+ */
15
+ export declare class SearchFilter {
16
+ key: string;
17
+ type: SearchFilterType;
18
+ header?: string;
19
+ constructor(key: string, type: SearchFilterType);
20
+ /**
21
+ * checks equality between filters. Need to be overriden by sub types to correctly determine equality.
22
+ * @param other
23
+ * @returns true if they can be considered equal, false if not
24
+ */
25
+ equals(other: SearchFilter): boolean;
26
+ /**
27
+ * checks if the filter has any value set.
28
+ * @returns true if the filter has no value set
29
+ */
30
+ isEmpty(): boolean;
31
+ }
32
+ /**
33
+ * @deprecated this filter class is deprecated. Use the KvpHardFilter instead.
34
+ */
35
+ export declare class CategoryFilter extends SearchFilter {
36
+ value: string | string[];
37
+ label?: string;
38
+ constructor(key: string, value: string | string[], label?: string);
39
+ equals(other: SearchFilter): boolean;
40
+ }
41
+ /**
42
+ * @deprecated not needed for new search, use search.performSearch and SearchInput.
43
+ */
44
+ export declare class IncludeExcludeFilter extends SearchFilter {
45
+ include: string[];
46
+ exclude: string[];
47
+ label?: string;
48
+ constructor(key: string, include: string[], exclude: string[], label?: string);
49
+ equals(other: SearchFilter): boolean;
50
+ isEmpty(): boolean;
51
+ }
52
+ /**
53
+ * @deprecated not needed for new search, use search.performSearch and SearchInput.
54
+ */
55
+ export declare class ExternalPayloadFilter extends CategoryFilter {
56
+ constructor(field: string, value: string, label?: string);
57
+ }
58
+ /**
59
+ * @deprecated this filter class is deprecated and will be removed in a future version of the SDK, use HierarchyPartiumIdFilter instead
60
+ */
61
+ export declare class HierarchyFilter extends CategoryFilter {
62
+ constructor(partiumId: string, label?: string);
63
+ }
64
+ /**
65
+ * Hierarchy search filter that allows filtering for assembly hierarchy nodes by their partiumId.
66
+ * This is an IncludeExcludeFilter, which means that nodes can be included, as well as excluded in the search.
67
+ * For example it is possible to exclude nodes and search only in the nodes that are not excluded.
68
+ * This is also combinable with the include, e.g. a parent node can be included, but some of its child nodes can be excluded from the search
69
+ *
70
+ * @deprecated not needed for new search, use search.performSearch and SearchInput.
71
+ */
72
+ export declare class HierarchyPartiumIdFilter extends IncludeExcludeFilter {
73
+ static readonly KEY = "hierarchy-partium-id";
74
+ constructor(include: string[], exclude?: string[], label?: string);
75
+ }
76
+ /**
77
+ * Key-value hard filters
78
+ *
79
+ * @deprecated not needed for new search, use search.performSearch and SearchInput.
80
+ */
81
+ export declare class KvpHardFilter extends SearchFilter {
82
+ label: string;
83
+ values: string[];
84
+ constructor(partiumId: string, label: string, values: string[]);
85
+ equals(other: SearchFilter): boolean;
86
+ isEmpty(): boolean;
87
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var SearchFilterType,__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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.KvpHardFilter=exports.HierarchyPartiumIdFilter=exports.HierarchyFilter=exports.ExternalPayloadFilter=exports.IncludeExcludeFilter=exports.CategoryFilter=exports.SearchFilter=exports.SearchFilterType=void 0,function(e){e.CategoryFilter="category",e.IncludeExcludeFilter="includeExclude",e.KvpHardFilter="kvpHardFilter"}(SearchFilterType||(exports.SearchFilterType=SearchFilterType={}));var SearchFilter=function(){function e(e,t){this.key=e,this.type=t}return e.prototype.equals=function(e){return this.key===e.key},e.prototype.isEmpty=function(){return!0},e}();exports.SearchFilter=SearchFilter;var CategoryFilter=function(e){function t(t,r,i){var n=e.call(this,t,SearchFilterType.CategoryFilter)||this;return n.value=r,n.label=i,n}return __extends(t,e),t.prototype.equals=function(e){return e instanceof t&&(this.key==e.key&&this.value==e.value)},t}(SearchFilter);exports.CategoryFilter=CategoryFilter;var IncludeExcludeFilter=function(e){function t(t,r,i,n){var l=e.call(this,t,SearchFilterType.IncludeExcludeFilter)||this;return l.include=r,l.exclude=i,l.label=n,l}return __extends(t,e),t.prototype.equals=function(e){if(!(e instanceof t))return!1;if(this.key!==e.key)return!1;if(this.include.length!==e.include.length)return!1;for(var r=0,i=this.include;r<i.length;r++){var n=i[r];if(!e.include.includes(n))return!1}if(this.exclude.length!==e.exclude.length)return!1;for(var l=0,u=this.exclude;l<u.length;l++){n=u[l];if(!e.exclude.includes(n))return!1}return!0},t.prototype.isEmpty=function(){var e;return!((null===(e=this.include)||void 0===e?void 0:e.length)>0)},t}(SearchFilter);exports.IncludeExcludeFilter=IncludeExcludeFilter;var ExternalPayloadFilter=function(e){function t(t,r,i){return e.call(this,"external_payload."+t,r,i)||this}return __extends(t,e),t}(CategoryFilter);exports.ExternalPayloadFilter=ExternalPayloadFilter;var HierarchyFilter=function(e){function t(t,r){return e.call(this,"hierarchy-partium-id",t,r)||this}return __extends(t,e),t}(CategoryFilter);exports.HierarchyFilter=HierarchyFilter;var HierarchyPartiumIdFilter=function(e){function t(r,i,n){return void 0===i&&(i=[]),e.call(this,t.KEY,r,i,n)||this}return __extends(t,e),t.KEY="hierarchy-partium-id",t}(IncludeExcludeFilter);exports.HierarchyPartiumIdFilter=HierarchyPartiumIdFilter;var KvpHardFilter=function(e){function t(t,r,i){var n=e.call(this,t,SearchFilterType.KvpHardFilter)||this;return n.values=i,n.label=r,n}return __extends(t,e),t.prototype.equals=function(e){if(!(e instanceof t))return!1;if(this.key!==e.key)return!1;if(this.label!==e.label)return!1;if(this.values.length!==e.values.length)return!1;for(var r=0,i=this.values;r<i.length;r++){var n=i[r];if(!e.values.includes(n))return!1}return!0},t.prototype.isEmpty=function(){var e;return!((null===(e=this.values)||void 0===e?void 0:e.length)>0)},t}(SearchFilter);exports.KvpHardFilter=KvpHardFilter;
@@ -0,0 +1,39 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { PFile } from '../../core';
3
+ import { TextSearchQueries } from '../services/search/text-search.service';
4
+ import { ImageCropArea } from './search-status/cv-search-status';
5
+ /**
6
+ * Search-Input for searches
7
+ */
8
+ export interface SearchInput {
9
+ /** needed for a new search-session (can not be changed for existing search-session) */
10
+ organizationName: string;
11
+ /** needed for a new search-session (can not be changed for existing search-session) */
12
+ searchLanguage: string;
13
+ /** needed to continue an existing search-session */
14
+ searchSessionId?: string;
15
+ /** @deprecated use the text attribute instead*/
16
+ searchQueries?: TextSearchQueries;
17
+ text?: string;
18
+ /** either searchImageAssetId or searchImage can be set to perform image-search */
19
+ searchImageAssetId?: string;
20
+ /** either searchImageAssetId or searchImage can be set to perform image-search */
21
+ searchImage?: PFile;
22
+ searchImageCropArea?: ImageCropArea;
23
+ /** ids of hierarchy-nodes to filter for */
24
+ hierarchyFilters?: string[];
25
+ /** filter-names and filter-values to add as filters */
26
+ attributeFilters?: Record<string, string[]>;
27
+ /** Search for parts, similar to the one with the given id (can not be combined with any other search input, such as text, image or filter) */
28
+ similarTo?: {
29
+ id?: string;
30
+ partiumId?: string;
31
+ };
32
+ /** Search for parts, that are duplicates of the one with the given id (can not be combined with any other search input, such as text, image or filter) */
33
+ duplicateOf?: {
34
+ id?: string;
35
+ partiumId?: string;
36
+ };
37
+ /** Search for parts, that have related parts or are suggestions for relations/duplicates. */
38
+ hasRelatedParts?: boolean;
39
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,10 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { Part } from "../../data";
3
+ import { SearchInput } from "./search-input";
4
+ import { SmartFilter } from "./smart-filter";
5
+ export interface SearchOutput {
6
+ searchInput: SearchInput;
7
+ searchResults: Part[];
8
+ smartFilters: SmartFilter[];
9
+ resultsTotalCount: number;
10
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});