@partium/js-sdk 15.1.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/enrichment/models/create-enrichment-job-request.d.ts +5 -0
- package/enrichment/models/enrichment-job.d.ts +7 -0
- package/enrichment/models/enrichment-job.js +1 -1
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
import { EnrichmentJobType } from './enrichment-job';
|
|
2
3
|
/**
|
|
3
4
|
* Request for creating a data enrichment job.
|
|
4
5
|
*/
|
|
@@ -7,4 +8,8 @@ export interface CreateEnrichmentJobRequest {
|
|
|
7
8
|
* The CSV file containing the part-ids to enrich.
|
|
8
9
|
*/
|
|
9
10
|
csvFile: File;
|
|
11
|
+
/**
|
|
12
|
+
* Optional type of the enrichment job.
|
|
13
|
+
*/
|
|
14
|
+
jobType?: EnrichmentJobType;
|
|
10
15
|
}
|
|
@@ -6,9 +6,15 @@ export declare enum EnrichmentJobStatus {
|
|
|
6
6
|
COMPLETED = "completed",
|
|
7
7
|
CANCELED = "canceled"
|
|
8
8
|
}
|
|
9
|
+
export declare enum EnrichmentJobType {
|
|
10
|
+
GENERAL_PART_ATTRIBUTES = "general_part_attributes",
|
|
11
|
+
SUPPLIER_DISCOVERY = "supplier_discovery",
|
|
12
|
+
CUSTOM_ENRICHMENT = "custom_enrichment"
|
|
13
|
+
}
|
|
9
14
|
export interface EnrichmentJobFromAPI {
|
|
10
15
|
jobId: string;
|
|
11
16
|
title: string;
|
|
17
|
+
jobType?: EnrichmentJobType;
|
|
12
18
|
description?: string;
|
|
13
19
|
thumbnails?: (ImageFromFindAPI | undefined)[];
|
|
14
20
|
status: EnrichmentJobStatus;
|
|
@@ -18,6 +24,7 @@ export interface EnrichmentJobFromAPI {
|
|
|
18
24
|
export interface EnrichmentJob {
|
|
19
25
|
id: string;
|
|
20
26
|
title: string;
|
|
27
|
+
jobType: EnrichmentJobType;
|
|
21
28
|
description?: string;
|
|
22
29
|
partImages: (Image | undefined)[];
|
|
23
30
|
status: EnrichmentJobStatus;
|
|
@@ -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.EnrichmentJobStatus=void 0;var EnrichmentJobStatus,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={}));var enrichmentJobFromAPIResponse=function(e){return{id:e.jobId,title:e.title,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";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;
|
|
@@ -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;
|
|
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.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;
|
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.2.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.2.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/js-sdk",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.2.0",
|
|
4
4
|
"author": "Partium Inc.",
|
|
5
5
|
"license": "See LICENSE.txt",
|
|
6
6
|
"description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into JavaScript-based applications.",
|