@partium/js-sdk 16.2.1 → 16.4.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.
@@ -23,3 +23,4 @@ export * from './models/post-remove-all-search-session-parts-from-enrichment-job
23
23
  export * from './models/get-search-summary-response';
24
24
  export * from './models/download-enrichment-job-results-request';
25
25
  export * from './models/download-enrichment-job-results-response';
26
+ export * from './models/trigger-investigation-for-partlist-request';
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var s=Object.getOwnPropertyDescriptor(r,t);s&&!("get"in s?!r.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,s)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=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/enrichment-job"),exports),__exportStar(require("./models/get-enrichment-jobs-request"),exports),__exportStar(require("./models/get-enrichment-job-request"),exports),__exportStar(require("./models/get-enrichment-job-parts-request"),exports),__exportStar(require("./models/enrichment-job-part"),exports),__exportStar(require("./services/data-enrichment.service"),exports),__exportStar(require("./models/create-enrichment-job-request"),exports),__exportStar(require("./models/create-enrichment-job-response"),exports),__exportStar(require("./models/submit-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-response"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-request"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-response"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-request"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-response"),exports),__exportStar(require("./models/post-add-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-request"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-request"),exports),__exportStar(require("./models/get-search-summary-response"),exports),__exportStar(require("./models/download-enrichment-job-results-request"),exports),__exportStar(require("./models/download-enrichment-job-results-response"),exports);
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var s=Object.getOwnPropertyDescriptor(r,t);s&&!("get"in s?!r.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,s)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=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/enrichment-job"),exports),__exportStar(require("./models/get-enrichment-jobs-request"),exports),__exportStar(require("./models/get-enrichment-job-request"),exports),__exportStar(require("./models/get-enrichment-job-parts-request"),exports),__exportStar(require("./models/enrichment-job-part"),exports),__exportStar(require("./services/data-enrichment.service"),exports),__exportStar(require("./models/create-enrichment-job-request"),exports),__exportStar(require("./models/create-enrichment-job-response"),exports),__exportStar(require("./models/submit-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-request"),exports),__exportStar(require("./models/trigger-enrichment-job-response"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-request"),exports),__exportStar(require("./models/create-enrichment-job-with-search-session-response"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-request"),exports),__exportStar(require("./models/post-check-which-parts-in-enrichment-job-response"),exports),__exportStar(require("./models/post-add-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-response"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-response"),exports),__exportStar(require("./models/post-add-all-search-session-parts-to-enrichment-job-request"),exports),__exportStar(require("./models/post-remove-all-search-session-parts-from-enrichment-job-request"),exports),__exportStar(require("./models/get-search-summary-response"),exports),__exportStar(require("./models/download-enrichment-job-results-request"),exports),__exportStar(require("./models/download-enrichment-job-results-response"),exports),__exportStar(require("./models/trigger-investigation-for-partlist-request"),exports);
@@ -12,6 +12,10 @@ export declare enum EnrichmentJobType {
12
12
  SUPPLIER_DISCOVERY = "supplier_discovery",
13
13
  CUSTOM_ENRICHMENT = "custom_enrichment"
14
14
  }
15
+ export declare enum InvestigationType {
16
+ GENERAL_PART_ATTRIBUTES = "general_part_attributes",
17
+ SUPPLIER_DISCOVERY = "supplier_discovery"
18
+ }
15
19
  export interface EnrichmentJobFromAPI {
16
20
  jobId: string;
17
21
  title: string;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.enrichmentJobDetailFromAPIResponse=exports.enrichmentJobFromAPIResponse=exports.EnrichmentJobType=exports.EnrichmentJobStatus=void 0;var EnrichmentJobStatus,EnrichmentJobType,core_1=require("../../core"),image_1=require("../../data/models/image");!function(e){e.SUBMITTED="submitted",e.IN_PROGRESS="in_progress",e.COMPLETED="completed",e.ERROR="error",e.CANCELED="canceled"}(EnrichmentJobStatus||(exports.EnrichmentJobStatus=EnrichmentJobStatus={})),function(e){e.GENERAL_PART_ATTRIBUTES="general_part_attributes",e.SUPPLIER_DISCOVERY="supplier_discovery",e.CUSTOM_ENRICHMENT="custom_enrichment"}(EnrichmentJobType||(exports.EnrichmentJobType=EnrichmentJobType={}));var enrichmentJobFromAPIResponse=function(e){return{id:e.jobId,title:e.title,jobType:e.jobType,description:e.description,partImages:e.thumbnails?e.thumbnails.map((function(e){return e?(0,image_1.fromDataAPIResponse)(e,core_1.BACKEND_SERVICE.DATA):null})):[],status:e.status,requestDate:e.requestDate,partCount:e.partCount}};exports.enrichmentJobFromAPIResponse=enrichmentJobFromAPIResponse;var enrichmentJobDetailFromAPIResponse=function(e){return __assign(__assign({},(0,exports.enrichmentJobFromAPIResponse)(e)),{description:e.description,requestDate:e.requestDate,partCount:e.partCount})};exports.enrichmentJobDetailFromAPIResponse=enrichmentJobDetailFromAPIResponse;
2
+ "use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.enrichmentJobDetailFromAPIResponse=exports.enrichmentJobFromAPIResponse=exports.InvestigationType=exports.EnrichmentJobType=exports.EnrichmentJobStatus=void 0;var EnrichmentJobStatus,EnrichmentJobType,InvestigationType,core_1=require("../../core"),image_1=require("../../data/models/image");!function(e){e.SUBMITTED="submitted",e.IN_PROGRESS="in_progress",e.COMPLETED="completed",e.ERROR="error",e.CANCELED="canceled"}(EnrichmentJobStatus||(exports.EnrichmentJobStatus=EnrichmentJobStatus={})),function(e){e.GENERAL_PART_ATTRIBUTES="general_part_attributes",e.SUPPLIER_DISCOVERY="supplier_discovery",e.CUSTOM_ENRICHMENT="custom_enrichment"}(EnrichmentJobType||(exports.EnrichmentJobType=EnrichmentJobType={})),function(e){e.GENERAL_PART_ATTRIBUTES="general_part_attributes",e.SUPPLIER_DISCOVERY="supplier_discovery"}(InvestigationType||(exports.InvestigationType=InvestigationType={}));var enrichmentJobFromAPIResponse=function(e){return{id:e.jobId,title:e.title,jobType:e.jobType,description:e.description,partImages:e.thumbnails?e.thumbnails.map((function(e){return e?(0,image_1.fromDataAPIResponse)(e,core_1.BACKEND_SERVICE.DATA):null})):[],status:e.status,requestDate:e.requestDate,partCount:e.partCount}};exports.enrichmentJobFromAPIResponse=enrichmentJobFromAPIResponse;var enrichmentJobDetailFromAPIResponse=function(e){return __assign(__assign({},(0,exports.enrichmentJobFromAPIResponse)(e)),{description:e.description,requestDate:e.requestDate,partCount:e.partCount})};exports.enrichmentJobDetailFromAPIResponse=enrichmentJobDetailFromAPIResponse;
@@ -0,0 +1,23 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ import { InvestigationType } from './enrichment-job';
3
+ /**
4
+ * Request to trigger a investigation for a part list.
5
+ */
6
+ export interface TriggerInvestigationForPartListRequest {
7
+ /**
8
+ * Types of the investigations to trigger.
9
+ */
10
+ types: InvestigationType[];
11
+ /**
12
+ * Id of the part list to investigate.
13
+ */
14
+ partListId: string;
15
+ /**
16
+ * Optional list of attribute identifiers used for attribute investigations.
17
+ */
18
+ attributeIds?: string[];
19
+ /**
20
+ * Organization identifier when explicitly selecting an organization.
21
+ */
22
+ organization?: string;
23
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -27,6 +27,7 @@ import { PostRemoveAllSearchSessionPartsFromEnrichmentJobRequest } from '../mode
27
27
  import { GetSearchSummaryResponse } from '../models/get-search-summary-response';
28
28
  import { DownloadEnrichmentJobResultsRequest } from '../models/download-enrichment-job-results-request';
29
29
  import { DownloadEnrichmentJobResultsResponse } from '../models/download-enrichment-job-results-response';
30
+ import { TriggerInvestigationForPartListRequest } from '../models/trigger-investigation-for-partlist-request';
30
31
  /**
31
32
  * Service for managing data enrichment jobs.
32
33
  */
@@ -158,6 +159,13 @@ export interface DataEnrichmentService {
158
159
  * @returns An Observable that emits the created job id.
159
160
  */
160
161
  triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
162
+ /**
163
+ * Trigger a investigation of one or more types for all parts in a part list.
164
+ *
165
+ * @param request - The request containing all data for the request.
166
+ * @returns An Observable that emits when the request is completed.
167
+ */
168
+ triggerInvestigationForPartList(request: TriggerInvestigationForPartListRequest): Observable<void>;
161
169
  /**
162
170
  * Download the Excel export for a completed enrichment job.
163
171
  *
@@ -200,6 +208,7 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
200
208
  createEnrichmentJobWithSearchSession(request: CreateEnrichmentJobWithSearchSessionRequest): Observable<CreateEnrichmentJobWithSearchSessionResponse>;
201
209
  submitEnrichmentJob(request: SubmitEnrichmentJobRequest): Observable<void>;
202
210
  triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
211
+ triggerInvestigationForPartList(request: TriggerInvestigationForPartListRequest): Observable<void>;
203
212
  downloadEnrichmentJobResults(request: DownloadEnrichmentJobResultsRequest): Observable<DownloadEnrichmentJobResultsResponse>;
204
213
  private fetchEnrichmentJobsPage;
205
214
  private fetchEnrichmentJobPartsPage;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 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,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,t,e,o);else for(var a=r.length-1;a>=0;a--)(n=r[a])&&(s=(i<3?n(s):i>3?n(t,e,s):n(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s},__rest=this&&this.__rest||function(r,t){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(e[o[n]]=r[o[n]])}return e},__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.DataEnrichmentServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),enrichment_job_1=require("../models/enrichment-job"),enrichment_job_part_1=require("../models/enrichment-job-part"),DataEnrichmentServiceImpl=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return __extends(t,r),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.loadEnrichmentJobs=function(r){return this.fetchEnrichmentJobsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,o=t.nextCursor;return{jobs:e,paginationContext:{initialRequest:r,nextCursor:o}}})))},t.prototype.loadMoreEnrichmentJobs=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,o=t.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},r),{nextCursor:o})}})))},t.prototype.hasMoreEnrichmentJobsAvailable=function(r){return!!r.nextCursor},t.prototype.getEnrichmentJob=function(r){var t=r.jobId,e=__rest(r,["jobId"]);return this.httpsService.get("jobs/".concat(t),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){return(0,enrichment_job_1.enrichmentJobDetailFromAPIResponse)(r)})))},t.prototype.loadEnrichmentJobParts=function(r){return this.fetchEnrichmentJobPartsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.parts,o=t.partsSummary,n=t.nextCursor;return{parts:e,partsSummary:o,paginationContext:{initialRequest:r,nextCursor:n}}})))},t.prototype.loadMoreEnrichmentJobParts=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobPartsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.parts,o=t.partsSummary,n=t.nextCursor;return{parts:e,partsSummary:o,paginationContext:__assign(__assign({},r),{nextCursor:n})}})))},t.prototype.addPartsToEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/add"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.removePartsFromEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/remove"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.addAllSearchSessionPartsToEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/search/add"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.removeAllSearchSessionPartsFromEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/search/remove"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.checkWhichPartsInEnrichmentJob=function(r,t){return this.httpsService.post("jobs/".concat(r,"/parts/check"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.getSearchSummary=function(r){return this.httpsService.get("jobs/".concat(r,"/search/summary"),[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.hasMoreEnrichmentJobPartsAvailable=function(r){return!!r.nextCursor},t.prototype.createEnrichmentJob=function(r){var t=new FormData;t.append("file",r.csvFile);var e=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs/upload",t,e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{"Content-Type":"multipart/form-data"})},t.prototype.createEnrichmentJobWithSearchSession=function(r){var t=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs",r,t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.submitEnrichmentJob=function(r){return this.httpsService.post("jobs/".concat(r.jobId,"/submit"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.triggerEnrichmentJob=function(r){var t,e=__assign(__assign({type:r.type,partIds:r.partIds,visible:null!==(t=r.visible)&&void 0!==t&&t},void 0!==r.attributeIds?{attributeIds:r.attributeIds}:{}),void 0!==r.organization?{organization:r.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.downloadEnrichmentJobResults=function(r){var t=r.jobId,e=__rest(r,["jobId"]);return this.httpsService.get("jobs/".concat(t,"/export"),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{responseType:"blob"})},t.prototype.fetchEnrichmentJobsPage=function(r){var t=(0,core_1.toQueryParams)(r);return this.httpsService.get("jobs",t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var t,e;return{jobs:null!==(e=null===(t=r.results)||void 0===t?void 0:t.map((function(r){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(r)})))&&void 0!==e?e:[],nextCursor:(0,core_1.extractNextCursor)(r)}})))},t.prototype.fetchEnrichmentJobPartsPage=function(r){var t=r.jobId,e=__rest(r,["jobId"]),o=(0,core_1.toQueryParams)(e);return this.httpsService.get("jobs/".concat(t,"/parts"),o,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var t,e;return{parts:null!==(e=null===(t=r.results)||void 0===t?void 0:t.map((function(r){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(r)})))&&void 0!==e?e:[],partsSummary:r.partsSummary,nextCursor:(0,core_1.extractNextCursor)(r)}})))},t=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],t)}(core_1.BaseService);exports.DataEnrichmentServiceImpl=DataEnrichmentServiceImpl;
2
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(r,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])},t(r,e)};return function(r,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=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(t,r,e,o){var n,i=arguments.length,s=i<3?r:null===o?o=Object.getOwnPropertyDescriptor(r,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,r,e,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(r,e,s):n(r,e))||s);return i>3&&s&&Object.defineProperty(r,e,s),s},__rest=this&&this.__rest||function(t,r){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(e[o[n]]=t[o[n]])}return e},__spreadArray=this&&this.__spreadArray||function(t,r,e){if(e||2===arguments.length)for(var o,n=0,i=r.length;n<i;n++)!o&&n in r||(o||(o=Array.prototype.slice.call(r,0,n)),o[n]=r[n]);return t.concat(o||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataEnrichmentServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),enrichment_job_1=require("../models/enrichment-job"),enrichment_job_part_1=require("../models/enrichment-job-part"),DataEnrichmentServiceImpl=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return __extends(r,t),r.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},r.prototype.loadEnrichmentJobs=function(t){return this.fetchEnrichmentJobsPage(t).pipe((0,rxjs_1.map)((function(r){var e=r.jobs,o=r.nextCursor;return{jobs:e,paginationContext:{initialRequest:t,nextCursor:o}}})))},r.prototype.loadMoreEnrichmentJobs=function(t){if(!t.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var r=__assign(__assign({},t.initialRequest),{cursor:t.nextCursor});return this.fetchEnrichmentJobsPage(r).pipe((0,rxjs_1.map)((function(r){var e=r.jobs,o=r.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},t),{nextCursor:o})}})))},r.prototype.hasMoreEnrichmentJobsAvailable=function(t){return!!t.nextCursor},r.prototype.getEnrichmentJob=function(t){var r=t.jobId,e=__rest(t,["jobId"]);return this.httpsService.get("jobs/".concat(r),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(t){return(0,enrichment_job_1.enrichmentJobDetailFromAPIResponse)(t)})))},r.prototype.loadEnrichmentJobParts=function(t){return this.fetchEnrichmentJobPartsPage(t).pipe((0,rxjs_1.map)((function(r){var e=r.parts,o=r.partsSummary,n=r.nextCursor;return{parts:e,partsSummary:o,paginationContext:{initialRequest:t,nextCursor:n}}})))},r.prototype.loadMoreEnrichmentJobParts=function(t){if(!t.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var r=__assign(__assign({},t.initialRequest),{cursor:t.nextCursor});return this.fetchEnrichmentJobPartsPage(r).pipe((0,rxjs_1.map)((function(r){var e=r.parts,o=r.partsSummary,n=r.nextCursor;return{parts:e,partsSummary:o,paginationContext:__assign(__assign({},t),{nextCursor:n})}})))},r.prototype.addPartsToEnrichmentJob=function(t,r){return this.httpsService.post("jobs/".concat(t,"/parts/add"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.removePartsFromEnrichmentJob=function(t,r){return this.httpsService.post("jobs/".concat(t,"/parts/remove"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.addAllSearchSessionPartsToEnrichmentJob=function(t,r){return this.httpsService.post("jobs/".concat(t,"/search/add"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.removeAllSearchSessionPartsFromEnrichmentJob=function(t,r){return this.httpsService.post("jobs/".concat(t,"/search/remove"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.checkWhichPartsInEnrichmentJob=function(t,r){return this.httpsService.post("jobs/".concat(t,"/parts/check"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.getSearchSummary=function(t){return this.httpsService.get("jobs/".concat(t,"/search/summary"),[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.hasMoreEnrichmentJobPartsAvailable=function(t){return!!t.nextCursor},r.prototype.createEnrichmentJob=function(t){var r=new FormData;r.append("file",t.csvFile);var e=__spreadArray(__spreadArray([],t.jobType?[{jobType:t.jobType}]:[],!0),void 0!==t.organization?[{organization:t.organization}]:[],!0);return this.httpsService.post("jobs/upload",r,e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{"Content-Type":"multipart/form-data"})},r.prototype.createEnrichmentJobWithSearchSession=function(t){var r=__spreadArray(__spreadArray([],t.jobType?[{jobType:t.jobType}]:[],!0),void 0!==t.organization?[{organization:t.organization}]:[],!0);return this.httpsService.post("jobs",t,r,core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.submitEnrichmentJob=function(t){return this.httpsService.post("jobs/".concat(t.jobId,"/submit"),t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.triggerEnrichmentJob=function(t){var r,e=__assign(__assign({type:t.type,partIds:t.partIds,visible:null!==(r=t.visible)&&void 0!==r&&r},void 0!==t.attributeIds?{attributeIds:t.attributeIds}:{}),void 0!==t.organization?{organization:t.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.triggerInvestigationForPartList=function(t){return this.httpsService.post("jobs/from-part-list",t,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.downloadEnrichmentJobResults=function(t){var r=t.jobId,e=__rest(t,["jobId"]);return this.httpsService.get("jobs/".concat(r,"/export"),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{responseType:"blob"})},r.prototype.fetchEnrichmentJobsPage=function(t){var r=(0,core_1.toQueryParams)(t);return this.httpsService.get("jobs",r,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(t){var r,e;return{jobs:null!==(e=null===(r=t.results)||void 0===r?void 0:r.map((function(t){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(t)})))&&void 0!==e?e:[],nextCursor:(0,core_1.extractNextCursor)(t)}})))},r.prototype.fetchEnrichmentJobPartsPage=function(t){var r=t.jobId,e=__rest(t,["jobId"]),o=(0,core_1.toQueryParams)(e);return this.httpsService.get("jobs/".concat(r,"/parts"),o,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(t){var r,e;return{parts:null!==(e=null===(r=t.results)||void 0===r?void 0:r.map((function(t){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(t)})))&&void 0!==e?e:[],partsSummary:t.partsSummary,nextCursor:(0,core_1.extractNextCursor)(t)}})))},r=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],r)}(core_1.BaseService);exports.DataEnrichmentServiceImpl=DataEnrichmentServiceImpl;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- export declare const SDK_VERSION_NUMBER = "16.2.1";
2
+ export declare const SDK_VERSION_NUMBER = "16.4.0";
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="16.2.1";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="16.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "16.2.1",
3
+ "version": "16.4.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.",
@@ -5,7 +5,11 @@ export interface AddAllSearchSessionPartsToPartListResponse {
5
5
  */
6
6
  partsAdded: number;
7
7
  /**
8
- * The total number of parts in the part-list.
8
+ * The total number of unique parts in the part-list after the operation.
9
9
  */
10
- totalInPartList: number;
10
+ totalInList: number;
11
+ /**
12
+ * The part identifiers that were invalid and not added to the part-list.
13
+ */
14
+ invalidPartIds: string[];
11
15
  }
@@ -5,9 +5,9 @@ export interface AddPartsToPartListResponse {
5
5
  */
6
6
  partsAdded: number;
7
7
  /**
8
- * The total number of parts in the part-list.
8
+ * The total number of unique parts in the part-list after the operation.
9
9
  */
10
- totalInPartList: number;
10
+ totalInList: number;
11
11
  /**
12
12
  * The part identifiers that were invalid and not added to the part-list.
13
13
  */
@@ -17,6 +17,10 @@ export interface CreateCollectionFromFileResponse {
17
17
  * The amount of part-ids that were added to the collection
18
18
  */
19
19
  partsAdded: number;
20
+ /**
21
+ * The total number of unique parts in the collection after the upload.
22
+ */
23
+ totalInList: number;
20
24
  /**
21
25
  * The part identifiers that were invalid and not added to the part-list.
22
26
  */
@@ -4,4 +4,8 @@ export interface EmptyPartListResponse {
4
4
  * The number of parts removed from the part-list.
5
5
  */
6
6
  partsRemoved: number;
7
+ /**
8
+ * The total number of unique parts in the part-list after the operation.
9
+ */
10
+ totalInList: number;
7
11
  }
@@ -1,5 +1,11 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
2
  export interface RemoveAllSearchSessionPartsFromPartListResponse {
3
+ /**
4
+ * The number of parts removed from the part-list.
5
+ */
3
6
  partsRemoved: number;
4
- totalInPartList: number;
7
+ /**
8
+ * The total number of unique parts in the part-list after the operation.
9
+ */
10
+ totalInList: number;
5
11
  }
@@ -5,11 +5,7 @@ export interface RemovePartsFromPartListResponse {
5
5
  */
6
6
  partsRemoved: number;
7
7
  /**
8
- * The total number of parts in the part-list.
8
+ * The total number of unique parts in the part-list after the operation.
9
9
  */
10
- totalInPartList: number;
11
- /**
12
- * The part identifiers that were invalid and not removed from the part-list.
13
- */
14
- invalidPartIds: string[];
10
+ totalInList: number;
15
11
  }
@@ -78,12 +78,13 @@ export interface PartListService {
78
78
  */
79
79
  emptyPartList(partListId: string, request: EmptyPartListRequest): Observable<EmptyPartListResponse>;
80
80
  /**
81
- * Get the add and remove parts count for the given part-list.
81
+ * Get the add and remove parts count for the given part-list, relative to a search session.
82
82
  *
83
83
  * @param partListId - The part-list id.
84
+ * @param searchSessionId - The search session to compare the part-list against.
84
85
  * @returns An Observable that emits the add and remove parts count.
85
86
  */
86
- getSearchSummary(partListId: string): Observable<PartListSearchSummaryResponse>;
87
+ getSearchSummary(partListId: string, searchSessionId: string): Observable<PartListSearchSummaryResponse>;
87
88
  /**
88
89
  * Given part ids (e.g. from search), returns which of them are already in the part-list.
89
90
  *
@@ -102,6 +103,6 @@ export declare class PartListServiceImpl extends BaseService implements PartList
102
103
  addAllSearchSessionPartsToPartList(partListId: string, request: AddAllSearchSessionPartsToPartListRequest): Observable<AddAllSearchSessionPartsToPartListResponse>;
103
104
  removeAllSearchSessionPartsFromPartList(partListId: string, request: RemoveAllSearchSessionPartsFromPartListRequest): Observable<RemoveAllSearchSessionPartsFromPartListResponse>;
104
105
  emptyPartList(partListId: string, request: EmptyPartListRequest): Observable<EmptyPartListResponse>;
105
- getSearchSummary(partListId: string): Observable<PartListSearchSummaryResponse>;
106
+ getSearchSummary(partListId: string, searchSessionId: string): Observable<PartListSearchSummaryResponse>;
106
107
  checkWhichPartsInPartList(partListId: string, request: CheckWhichPartsInPartListRequest): Observable<CheckWhichPartsInPartListResponse>;
107
108
  }
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 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 c,i=arguments.length,n=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(c=t[s])&&(n=(i<3?c(n):i>3?c(e,r,n):c(e,r))||n);return i>3&&n&&Object.defineProperty(e,r,n),n};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartListServiceImpl=void 0;var core_1=require("../../core"),PartListServiceImpl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.createSelection=function(t){return this.httpsService.post("selections",t,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.createCollectionFromFile=function(t){var e=this;return(0,core_1.guardMultipartUpload)(t.file,(function(){return(0,core_1.postPFileMultipartRequest)(e.httpsService,{url:"collections",file:t.file,fieldName:"file",backend:core_1.BACKEND_SERVICE.PART_LIST})}))},e.prototype.addPartsToPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/add"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.removePartsFromPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/remove"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.addAllSearchSessionPartsToPartList=function(t,e){return this.httpsService.post("".concat(t,"/search/add"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.removeAllSearchSessionPartsFromPartList=function(t,e){return this.httpsService.post("".concat(t,"/search/remove"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.emptyPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/empty"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.getSearchSummary=function(t){return this.httpsService.get("".concat(t,"/search/summary"),[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.checkWhichPartsInPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/check"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e=__decorate([(0,core_1.InjectionIdentifier)("PartListService")],e)}(core_1.BaseService);exports.PartListServiceImpl=PartListServiceImpl;
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 c,i=arguments.length,n=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(c=t[s])&&(n=(i<3?c(n):i>3?c(e,r,n):c(e,r))||n);return i>3&&n&&Object.defineProperty(e,r,n),n};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartListServiceImpl=void 0;var core_1=require("../../core"),PartListServiceImpl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.createSelection=function(t){return this.httpsService.post("selections",t,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.createCollectionFromFile=function(t){var e=this;return(0,core_1.guardMultipartUpload)(t.file,(function(){return(0,core_1.postPFileMultipartRequest)(e.httpsService,{url:"collections/upload",file:t.file,fieldName:"file",backend:core_1.BACKEND_SERVICE.PART_LIST})}))},e.prototype.addPartsToPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/add"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.removePartsFromPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/remove"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.addAllSearchSessionPartsToPartList=function(t,e){return this.httpsService.post("".concat(t,"/search/add"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.removeAllSearchSessionPartsFromPartList=function(t,e){return this.httpsService.post("".concat(t,"/search/remove"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.emptyPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/empty"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.getSearchSummary=function(t,e){return this.httpsService.get("".concat(t,"/search/summary"),[{searchSessionId:e}],core_1.BACKEND_SERVICE.PART_LIST)},e.prototype.checkWhichPartsInPartList=function(t,e){return this.httpsService.post("".concat(t,"/parts/check"),e,[],core_1.BACKEND_SERVICE.PART_LIST)},e=__decorate([(0,core_1.InjectionIdentifier)("PartListService")],e)}(core_1.BaseService);exports.PartListServiceImpl=PartListServiceImpl;