@partium/js-sdk 15.8.0 → 15.10.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.
@@ -42,6 +42,10 @@ export interface PartDataSupplierDiscoveryResponse {
42
42
  * The supplier discovery data for the part.
43
43
  */
44
44
  supplierDiscoveryData: string | null;
45
+ /**
46
+ * The timestamp of the latest supplier discovery execution.
47
+ */
48
+ lastExecutedAt: string | null;
45
49
  }
46
50
  /**
47
51
  * The identifiers status of the part data.
@@ -156,6 +160,10 @@ export interface PartDataAttributesResponse {
156
160
  * The enriched attributes for the part.
157
161
  */
158
162
  attributes: PartDataAttributeEntry[];
163
+ /**
164
+ * The timestamp of the latest enrichment execution.
165
+ */
166
+ lastExecutedAt: string | null;
159
167
  }
160
168
  /**
161
169
  * The data of a part.
@@ -1,5 +1,7 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
2
  export * from './models/enrichment-job';
3
+ export * from './models/get-enrichment-jobs-request';
4
+ export * from './models/get-enrichment-job-request';
3
5
  export * from './models/get-enrichment-job-parts-request';
4
6
  export * from './models/enrichment-job-part';
5
7
  export * from './services/data-enrichment.service';
@@ -8,3 +10,5 @@ export * from './models/create-enrichment-job-response';
8
10
  export * from './models/submit-enrichment-job-request';
9
11
  export * from './models/trigger-enrichment-job-request';
10
12
  export * from './models/trigger-enrichment-job-response';
13
+ export * from './models/create-enrichment-job-with-search-session-request';
14
+ export * from './models/create-enrichment-job-with-search-session-response';
@@ -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 i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}: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-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);
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);
@@ -12,4 +12,8 @@ export interface CreateEnrichmentJobRequest {
12
12
  * Optional type of the enrichment job.
13
13
  */
14
14
  jobType?: EnrichmentJobType;
15
+ /**
16
+ * Organization identifier when explicitly selecting an organization.
17
+ */
18
+ organization?: string;
15
19
  }
@@ -0,0 +1,19 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ import { EnrichmentJobType } from './enrichment-job';
3
+ /**
4
+ * Request for creating a data enrichment job that get's linked to a search session.
5
+ */
6
+ export interface CreateEnrichmentJobWithSearchSessionRequest {
7
+ /**
8
+ * The id of the search session to relate to the enrichment job.
9
+ */
10
+ searchSessionId: string;
11
+ /**
12
+ * Optional type of the enrichment job.
13
+ */
14
+ jobType?: EnrichmentJobType;
15
+ /**
16
+ * Organization identifier when explicitly selecting an organization.
17
+ */
18
+ organization?: string;
19
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,10 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ /**
3
+ * Response for creating a data enrichment job that get's linked to a search session.
4
+ */
5
+ export interface CreateEnrichmentJobWithSearchSessionResponse {
6
+ /**
7
+ * The id of the newly created enrichment job.
8
+ */
9
+ jobId: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,21 +1,27 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
2
  import { ImageFromFindAPI, Image } from '../../data';
3
3
  export interface EnrichmentJobPartFromAPI {
4
- partiumId: string;
4
+ partiumId: string | null;
5
5
  id: string;
6
- name?: string;
7
- image: ImageFromFindAPI;
6
+ name: string | null;
7
+ nameLanguage?: string | null;
8
+ image: ImageFromFindAPI | null;
8
9
  status: ENRICHMENT_JOB_PART_STATUS;
9
10
  }
11
+ export interface EnrichmentJobPartsSummary {
12
+ totalCount: number;
13
+ validCount: number;
14
+ }
10
15
  export declare enum ENRICHMENT_JOB_PART_STATUS {
11
16
  VALID = "valid",
12
17
  INVALID = "invalid"
13
18
  }
14
19
  export interface EnrichmentJobPart {
15
- partiumId: string;
20
+ partiumId: string | null;
16
21
  externalId: string;
17
- name: string;
18
- image: Image;
22
+ name: string | null;
23
+ nameLanguage?: string | null;
24
+ image: Image | null;
19
25
  status: ENRICHMENT_JOB_PART_STATUS;
20
26
  }
21
27
  export declare const enrichmentJobPartFromAPIResponse: (data: EnrichmentJobPartFromAPI) => EnrichmentJobPart;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.enrichmentJobPartFromAPIResponse=exports.ENRICHMENT_JOB_PART_STATUS=void 0;var ENRICHMENT_JOB_PART_STATUS,core_1=require("../../core"),data_1=require("../../data");!function(e){e.VALID="valid",e.INVALID="invalid"}(ENRICHMENT_JOB_PART_STATUS||(exports.ENRICHMENT_JOB_PART_STATUS=ENRICHMENT_JOB_PART_STATUS={}));var enrichmentJobPartFromAPIResponse=function(e){return{partiumId:e.partiumId,externalId:e.id,name:e.name,image:e.image?data_1.Image.fromFindAPIResponse(e.image,core_1.BACKEND_SERVICE.DATA):null,status:e.status}};exports.enrichmentJobPartFromAPIResponse=enrichmentJobPartFromAPIResponse;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.enrichmentJobPartFromAPIResponse=exports.ENRICHMENT_JOB_PART_STATUS=void 0;var ENRICHMENT_JOB_PART_STATUS,core_1=require("../../core"),data_1=require("../../data");!function(e){e.VALID="valid",e.INVALID="invalid"}(ENRICHMENT_JOB_PART_STATUS||(exports.ENRICHMENT_JOB_PART_STATUS=ENRICHMENT_JOB_PART_STATUS={}));var enrichmentJobPartFromAPIResponse=function(e){return{partiumId:e.partiumId,externalId:e.id,name:e.name,nameLanguage:e.nameLanguage,image:e.image?data_1.Image.fromFindAPIResponse(e.image,core_1.BACKEND_SERVICE.DATA):null,status:e.status}};exports.enrichmentJobPartFromAPIResponse=enrichmentJobPartFromAPIResponse;
@@ -14,21 +14,32 @@ export declare enum EnrichmentJobType {
14
14
  export interface EnrichmentJobFromAPI {
15
15
  jobId: string;
16
16
  title: string;
17
- jobType?: EnrichmentJobType;
17
+ jobType: EnrichmentJobType;
18
18
  description?: string;
19
- thumbnails?: (ImageFromFindAPI | undefined)[];
19
+ thumbnails?: Array<ImageFromFindAPI | null>;
20
20
  status: EnrichmentJobStatus;
21
21
  requestDate?: string;
22
22
  partCount?: number;
23
23
  }
24
+ export interface EnrichmentJobDetailFromAPI extends EnrichmentJobFromAPI {
25
+ description: string;
26
+ requestDate: string;
27
+ partCount: number;
28
+ }
24
29
  export interface EnrichmentJob {
25
30
  id: string;
26
31
  title: string;
27
32
  jobType: EnrichmentJobType;
28
33
  description?: string;
29
- partImages: (Image | undefined)[];
34
+ partImages: Array<Image | null>;
30
35
  status: EnrichmentJobStatus;
31
36
  requestDate?: string;
32
37
  partCount?: number;
33
38
  }
39
+ export interface EnrichmentJobDetail extends EnrichmentJob {
40
+ description: string;
41
+ requestDate: string;
42
+ partCount: number;
43
+ }
34
44
  export declare const enrichmentJobFromAPIResponse: (data: EnrichmentJobFromAPI) => EnrichmentJob;
45
+ export declare const enrichmentJobDetailFromAPIResponse: (data: EnrichmentJobDetailFromAPI) => EnrichmentJobDetail;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),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.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){var t;return{id:e.jobId,title:e.title,jobType:null!==(t=e.jobType)&&void 0!==t?t:EnrichmentJobType.CUSTOM_ENRICHMENT,description:e.description,partImages:e.thumbnails?e.thumbnails.map((function(e){return e?image_1.Image.fromFindAPIResponse(e,core_1.BACKEND_SERVICE.DATA):null})):[],status:e.status,requestDate:e.requestDate,partCount:e.partCount}};exports.enrichmentJobFromAPIResponse=enrichmentJobFromAPIResponse;
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.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?image_1.Image.fromFindAPIResponse(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;
@@ -8,6 +8,18 @@ export interface GetEnrichmentJobPartsRequest extends BasePaginatedRequest {
8
8
  * The id of the enrichment job.
9
9
  */
10
10
  jobId: string;
11
+ /**
12
+ * Organization identifier when explicitly selecting an organization.
13
+ */
14
+ organization?: string;
15
+ /**
16
+ * Preferred language for translated part names.
17
+ */
18
+ language?: string;
19
+ /**
20
+ * Ordered fallback languages for translated part names.
21
+ */
22
+ fallbackLanguages?: string[];
11
23
  /**
12
24
  * Sort by field (default 'filePosition')
13
25
  */
@@ -7,4 +7,8 @@ export interface GetEnrichmentJobRequest {
7
7
  * The id of the requested enrichment job.
8
8
  */
9
9
  jobId: string;
10
+ /**
11
+ * Organization identifier when explicitly selecting an organization.
12
+ */
13
+ organization?: string;
10
14
  }
@@ -0,0 +1,15 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ import { BasePaginatedRequest } from '../../core/models/base-paginated-request';
3
+ /**
4
+ * Request for getting data enrichment jobs.
5
+ */
6
+ export interface GetEnrichmentJobsRequest extends BasePaginatedRequest {
7
+ /**
8
+ * Organization identifier when explicitly selecting an organization.
9
+ */
10
+ organization?: string;
11
+ /**
12
+ * Include hidden results when supported by the endpoint.
13
+ */
14
+ includeHidden?: boolean;
15
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -23,4 +23,8 @@ export interface SubmitEnrichmentJobRequest {
23
23
  * When provided, it overrides the type set during upload.
24
24
  */
25
25
  jobType?: EnrichmentJobType;
26
+ /**
27
+ * Organization identifier when explicitly selecting an organization.
28
+ */
29
+ organization?: string;
26
30
  }
@@ -1,10 +1,10 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
2
  import { Observable } from 'rxjs';
3
3
  import { BaseService } from '../../core';
4
- import { EnrichmentJob } from '../models/enrichment-job';
4
+ import { EnrichmentJob, EnrichmentJobDetail } from '../models/enrichment-job';
5
5
  import { DefaultGetPaginatedRequestPaginationContext } from '../../core/models/default-get-paginated-request-pagination-context';
6
- import { EnrichmentJobPart } from '../models/enrichment-job-part';
7
- import { BasePaginatedRequest } from '../../core/models/base-paginated-request';
6
+ import { EnrichmentJobPart, EnrichmentJobPartsSummary } from '../models/enrichment-job-part';
7
+ import { GetEnrichmentJobsRequest } from '../models/get-enrichment-jobs-request';
8
8
  import { GetEnrichmentJobPartsRequest } from '../models/get-enrichment-job-parts-request';
9
9
  import { CreateEnrichmentJobRequest } from '../models/create-enrichment-job-request';
10
10
  import { CreateEnrichmentJobResponse } from '../models/create-enrichment-job-response';
@@ -12,6 +12,8 @@ import { SubmitEnrichmentJobRequest } from '../models/submit-enrichment-job-requ
12
12
  import { GetEnrichmentJobRequest } from '../models/get-enrichment-job-request';
13
13
  import { TriggerEnrichmentJobRequest } from '../models/trigger-enrichment-job-request';
14
14
  import { TriggerEnrichmentJobResponse } from '../models/trigger-enrichment-job-response';
15
+ import { CreateEnrichmentJobWithSearchSessionRequest } from '../models/create-enrichment-job-with-search-session-request';
16
+ import { CreateEnrichmentJobWithSearchSessionResponse } from '../models/create-enrichment-job-with-search-session-response';
15
17
  /**
16
18
  * Service for managing data enrichment jobs.
17
19
  */
@@ -22,7 +24,7 @@ export interface DataEnrichmentService {
22
24
  * @param request - The request containing the parameters for the data enrichment jobs to get.
23
25
  * @returns An Observable that emits the data first page of enrichment jobs with pagination context.
24
26
  */
25
- loadEnrichmentJobs(request: BasePaginatedRequest): Observable<{
27
+ loadEnrichmentJobs(request: GetEnrichmentJobsRequest): Observable<{
26
28
  jobs: EnrichmentJob[];
27
29
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
28
30
  }>;
@@ -49,9 +51,10 @@ export interface DataEnrichmentService {
49
51
  * @param request - The request containing id of the enrichment job to fetch.
50
52
  * @returns An Observable that emits the detail info of the enrichment job.
51
53
  */
52
- getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<EnrichmentJob>;
54
+ getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<EnrichmentJobDetail>;
53
55
  loadEnrichmentJobParts(request: GetEnrichmentJobPartsRequest): Observable<{
54
56
  parts: EnrichmentJobPart[];
57
+ partsSummary: EnrichmentJobPartsSummary;
55
58
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
56
59
  }>;
57
60
  /**
@@ -62,6 +65,7 @@ export interface DataEnrichmentService {
62
65
  */
63
66
  loadMoreEnrichmentJobParts(paginationContext: DefaultGetPaginatedRequestPaginationContext): Observable<{
64
67
  parts: EnrichmentJobPart[];
68
+ partsSummary: EnrichmentJobPartsSummary;
65
69
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
66
70
  }>;
67
71
  hasMoreEnrichmentJobPartsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
@@ -72,6 +76,14 @@ export interface DataEnrichmentService {
72
76
  * @returns An Observable that emits the response
73
77
  */
74
78
  createEnrichmentJob(request: CreateEnrichmentJobRequest): Observable<CreateEnrichmentJobResponse>;
79
+ /**
80
+ * Create a new data enrichment job that get's linked to a search session.
81
+ * This job will not automatically contain all search-results, but the part-list can be built with using the search-results.
82
+ *
83
+ * @param request - The request containing the search session id to link to the job.
84
+ * @returns An Observable that emits the response
85
+ */
86
+ createEnrichmentJobWithSearchSession(request: CreateEnrichmentJobWithSearchSessionRequest): Observable<CreateEnrichmentJobWithSearchSessionResponse>;
75
87
  /**
76
88
  * Submit the "draft" enrichment job and cause it's status to change to "submitted"
77
89
  * @param request - The request containing the id and metadata of the enrichment job to submit.
@@ -91,7 +103,7 @@ export interface DataEnrichmentService {
91
103
  export declare class DataEnrichmentServiceImpl extends BaseService implements DataEnrichmentService {
92
104
  private httpsService;
93
105
  onCreate(): void;
94
- loadEnrichmentJobs(request: BasePaginatedRequest): Observable<{
106
+ loadEnrichmentJobs(request: GetEnrichmentJobsRequest): Observable<{
95
107
  jobs: EnrichmentJob[];
96
108
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
97
109
  }>;
@@ -100,20 +112,24 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
100
112
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
101
113
  }>;
102
114
  hasMoreEnrichmentJobsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
103
- getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<EnrichmentJob>;
115
+ getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<EnrichmentJobDetail>;
104
116
  loadEnrichmentJobParts(request: GetEnrichmentJobPartsRequest): Observable<{
105
117
  parts: EnrichmentJobPart[];
118
+ partsSummary: EnrichmentJobPartsSummary;
106
119
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
107
120
  }>;
108
121
  loadMoreEnrichmentJobParts(paginationContext: DefaultGetPaginatedRequestPaginationContext): Observable<{
109
122
  parts: EnrichmentJobPart[];
123
+ partsSummary: EnrichmentJobPartsSummary;
110
124
  paginationContext: DefaultGetPaginatedRequestPaginationContext;
111
125
  }>;
112
126
  hasMoreEnrichmentJobPartsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
113
127
  createEnrichmentJob(request: CreateEnrichmentJobRequest): Observable<CreateEnrichmentJobResponse>;
128
+ createEnrichmentJobWithSearchSession(request: CreateEnrichmentJobWithSearchSessionRequest): Observable<CreateEnrichmentJobWithSearchSessionResponse>;
114
129
  submitEnrichmentJob(request: SubmitEnrichmentJobRequest): Observable<void>;
115
130
  triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
116
131
  private fetchEnrichmentJobsPage;
117
132
  private fetchEnrichmentJobPartsPage;
133
+ private toQueryParams;
118
134
  private extractNextCursor;
119
135
  }
@@ -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(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 n(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(t,r,e,n){var o,i=arguments.length,s=i<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,r,e,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(i<3?o(s):i>3?o(r,e,s):o(r,e))||s);return i>3&&s&&Object.defineProperty(r,e,s),s};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,n=r.nextCursor;return{jobs:e,paginationContext:{initialRequest:t,nextCursor:n}}})))},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,n=r.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},t),{nextCursor:n})}})))},r.prototype.hasMoreEnrichmentJobsAvailable=function(t){return!!t.nextCursor},r.prototype.getEnrichmentJob=function(t){return this.httpsService.get("jobs/".concat(t.jobId),[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(t){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(t)})))},r.prototype.loadEnrichmentJobParts=function(t){return this.fetchEnrichmentJobPartsPage(t).pipe((0,rxjs_1.map)((function(r){var e=r.parts,n=r.nextCursor;return{parts:e,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,n=r.nextCursor;return{parts:e,paginationContext:__assign(__assign({},t),{nextCursor:n})}})))},r.prototype.hasMoreEnrichmentJobPartsAvailable=function(t){return!!t.nextCursor},r.prototype.createEnrichmentJob=function(t){var r=new FormData;r.append("file",t.csvFile);var e=t.jobType?[{jobType:t.jobType}]:[];return this.httpsService.post("jobs/upload",r,e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{"Content-Type":"multipart/form-data"})},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({type:t.type,partIds:t.partIds,visible:null!==(r=t.visible)&&void 0!==r&&r},void 0!==t.organization?{organization:t.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},r.prototype.fetchEnrichmentJobsPage=function(t){var r=this,e=Object.entries(t).map((function(t){var r,e=t[0],n=t[1];return(r={})[e]=n,r}));return this.httpsService.get("jobs",e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(t){var e;return{jobs:null===(e=t.results)||void 0===e?void 0:e.map((function(t){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(t)})),nextCursor:r.extractNextCursor(t)}})))},r.prototype.fetchEnrichmentJobPartsPage=function(t){var r=this,e=Object.entries(t).map((function(t){var r,e=t[0],n=t[1];return(r={})[e]=n,r}));return this.httpsService.get("jobs/".concat(t.jobId,"/parts"),e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(t){var e;return{parts:null===(e=t.results)||void 0===e?void 0:e.map((function(t){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(t)})),nextCursor:r.extractNextCursor(t)}})))},r.prototype.extractNextCursor=function(t){if(t.next)return new URL(t.next).searchParams.get("cursor")||void 0},r=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],r)}(core_1.BaseService);exports.DataEnrichmentServiceImpl=DataEnrichmentServiceImpl;
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 n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,t,e,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a},__rest=this&&this.__rest||function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},__spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return r.concat(n||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,n=t.nextCursor;return{jobs:e,paginationContext:{initialRequest:r,nextCursor:n}}})))},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,n=t.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},r),{nextCursor:n})}})))},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),this.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,n=t.partsSummary,o=t.nextCursor;return{parts:e,partsSummary:n,paginationContext:{initialRequest:r,nextCursor:o}}})))},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,n=t.partsSummary,o=t.nextCursor;return{parts:e,partsSummary:n,paginationContext:__assign(__assign({},r),{nextCursor:o})}})))},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({type:r.type,partIds:r.partIds,visible:null!==(t=r.visible)&&void 0!==t&&t},void 0!==r.organization?{organization:r.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.fetchEnrichmentJobsPage=function(r){var t=this,e=this.toQueryParams(r);return this.httpsService.get("jobs",e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var e,n;return{jobs:null!==(n=null===(e=r.results)||void 0===e?void 0:e.map((function(r){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(r)})))&&void 0!==n?n:[],nextCursor:t.extractNextCursor(r)}})))},t.prototype.fetchEnrichmentJobPartsPage=function(r){var t=this,e=r.jobId,n=__rest(r,["jobId"]),o=this.toQueryParams(n);return this.httpsService.get("jobs/".concat(e,"/parts"),o,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var e,n;return{parts:null!==(n=null===(e=r.results)||void 0===e?void 0:e.map((function(r){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(r)})))&&void 0!==n?n:[],partsSummary:r.partsSummary,nextCursor:t.extractNextCursor(r)}})))},t.prototype.toQueryParams=function(r){return Object.entries(r).reduce((function(r,t){var e,n=t[0],o=t[1];return null==o?r:Array.isArray(o)?__spreadArray(__spreadArray([],r,!0),o.map((function(r){var t;return(t={})[n]=r,t})),!0):__spreadArray(__spreadArray([],r,!0),[(e={},e[n]=o,e)],!1)}),[])},t.prototype.extractNextCursor=function(r){if(r.next)return new URL(r.next).searchParams.get("cursor")||void 0},t=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],t)}(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 = "15.8.0";
2
+ export declare const SDK_VERSION_NUMBER = "15.10.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="15.8.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="15.10.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "15.8.0",
3
+ "version": "15.10.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.",