@partium/js-sdk 15.8.0 → 15.9.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.
- package/data/models/part-data.d.ts +8 -0
- package/enrichment/index.d.ts +2 -0
- package/enrichment/index.js +1 -1
- package/enrichment/models/create-enrichment-job-request.d.ts +4 -0
- package/enrichment/models/enrichment-job-part.d.ts +12 -6
- package/enrichment/models/enrichment-job-part.js +1 -1
- package/enrichment/models/enrichment-job.d.ts +14 -3
- package/enrichment/models/enrichment-job.js +1 -1
- package/enrichment/models/get-enrichment-job-parts-request.d.ts +12 -0
- package/enrichment/models/get-enrichment-job-request.d.ts +4 -0
- package/enrichment/models/get-enrichment-jobs-request.d.ts +15 -0
- package/enrichment/models/get-enrichment-jobs-request.js +2 -0
- package/enrichment/models/submit-enrichment-job-request.d.ts +4 -0
- package/enrichment/services/data-enrichment.service.d.ts +12 -7
- package/enrichment/services/data-enrichment.service.js +1 -1
- package/gen/sdk-version.d.ts +1 -1
- package/gen/sdk-version.js +1 -1
- package/package.json +1 -1
|
@@ -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.
|
package/enrichment/index.d.ts
CHANGED
|
@@ -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';
|
package/enrichment/index.js
CHANGED
|
@@ -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 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-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);
|
|
@@ -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
|
|
7
|
-
|
|
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
|
-
|
|
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
|
|
17
|
+
jobType: EnrichmentJobType;
|
|
18
18
|
description?: string;
|
|
19
|
-
thumbnails?:
|
|
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:
|
|
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){
|
|
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
|
*/
|
|
@@ -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
|
+
}
|
|
@@ -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 {
|
|
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';
|
|
@@ -22,7 +22,7 @@ export interface DataEnrichmentService {
|
|
|
22
22
|
* @param request - The request containing the parameters for the data enrichment jobs to get.
|
|
23
23
|
* @returns An Observable that emits the data first page of enrichment jobs with pagination context.
|
|
24
24
|
*/
|
|
25
|
-
loadEnrichmentJobs(request:
|
|
25
|
+
loadEnrichmentJobs(request: GetEnrichmentJobsRequest): Observable<{
|
|
26
26
|
jobs: EnrichmentJob[];
|
|
27
27
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
28
28
|
}>;
|
|
@@ -49,9 +49,10 @@ export interface DataEnrichmentService {
|
|
|
49
49
|
* @param request - The request containing id of the enrichment job to fetch.
|
|
50
50
|
* @returns An Observable that emits the detail info of the enrichment job.
|
|
51
51
|
*/
|
|
52
|
-
getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<
|
|
52
|
+
getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<EnrichmentJobDetail>;
|
|
53
53
|
loadEnrichmentJobParts(request: GetEnrichmentJobPartsRequest): Observable<{
|
|
54
54
|
parts: EnrichmentJobPart[];
|
|
55
|
+
partsSummary: EnrichmentJobPartsSummary;
|
|
55
56
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
56
57
|
}>;
|
|
57
58
|
/**
|
|
@@ -62,6 +63,7 @@ export interface DataEnrichmentService {
|
|
|
62
63
|
*/
|
|
63
64
|
loadMoreEnrichmentJobParts(paginationContext: DefaultGetPaginatedRequestPaginationContext): Observable<{
|
|
64
65
|
parts: EnrichmentJobPart[];
|
|
66
|
+
partsSummary: EnrichmentJobPartsSummary;
|
|
65
67
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
66
68
|
}>;
|
|
67
69
|
hasMoreEnrichmentJobPartsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
|
|
@@ -91,7 +93,7 @@ export interface DataEnrichmentService {
|
|
|
91
93
|
export declare class DataEnrichmentServiceImpl extends BaseService implements DataEnrichmentService {
|
|
92
94
|
private httpsService;
|
|
93
95
|
onCreate(): void;
|
|
94
|
-
loadEnrichmentJobs(request:
|
|
96
|
+
loadEnrichmentJobs(request: GetEnrichmentJobsRequest): Observable<{
|
|
95
97
|
jobs: EnrichmentJob[];
|
|
96
98
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
97
99
|
}>;
|
|
@@ -100,13 +102,15 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
|
|
|
100
102
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
101
103
|
}>;
|
|
102
104
|
hasMoreEnrichmentJobsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
|
|
103
|
-
getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<
|
|
105
|
+
getEnrichmentJob(request: GetEnrichmentJobRequest): Observable<EnrichmentJobDetail>;
|
|
104
106
|
loadEnrichmentJobParts(request: GetEnrichmentJobPartsRequest): Observable<{
|
|
105
107
|
parts: EnrichmentJobPart[];
|
|
108
|
+
partsSummary: EnrichmentJobPartsSummary;
|
|
106
109
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
107
110
|
}>;
|
|
108
111
|
loadMoreEnrichmentJobParts(paginationContext: DefaultGetPaginatedRequestPaginationContext): Observable<{
|
|
109
112
|
parts: EnrichmentJobPart[];
|
|
113
|
+
partsSummary: EnrichmentJobPartsSummary;
|
|
110
114
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
111
115
|
}>;
|
|
112
116
|
hasMoreEnrichmentJobPartsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
|
|
@@ -115,5 +119,6 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
|
|
|
115
119
|
triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
|
|
116
120
|
private fetchEnrichmentJobsPage;
|
|
117
121
|
private fetchEnrichmentJobPartsPage;
|
|
122
|
+
private toQueryParams;
|
|
118
123
|
private extractNextCursor;
|
|
119
124
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var
|
|
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,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,t,e,n);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(i<3?o(s):i>3?o(t,e,s):o(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s},__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.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;
|
package/gen/sdk-version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
export declare const SDK_VERSION_NUMBER = "15.
|
|
2
|
+
export declare const SDK_VERSION_NUMBER = "15.9.0";
|
package/gen/sdk-version.js
CHANGED
|
@@ -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.
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="15.9.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/js-sdk",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.9.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.",
|