@partium/js-sdk 15.5.0 → 15.6.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.
@@ -6,3 +6,5 @@ export * from './services/data-enrichment.service';
6
6
  export * from './models/create-enrichment-job-request';
7
7
  export * from './models/create-enrichment-job-response';
8
8
  export * from './models/submit-enrichment-job-request';
9
+ export * from './models/trigger-enrichment-job-request';
10
+ export * from './models/trigger-enrichment-job-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);
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);
@@ -0,0 +1,23 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ import { EnrichmentJobType } from './enrichment-job';
3
+ /**
4
+ * Request to trigger a single-part enrichment job.
5
+ */
6
+ export interface TriggerEnrichmentJobRequest {
7
+ /**
8
+ * Type of the enrichment job.
9
+ */
10
+ type: EnrichmentJobType;
11
+ /**
12
+ * List of part ids to enrich.
13
+ */
14
+ partIds: string[];
15
+ /**
16
+ * Whether the job should be visible in the enrichment dashboard.
17
+ */
18
+ visible?: boolean;
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});
@@ -0,0 +1,10 @@
1
+ // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
+ /**
3
+ * Response for triggering a data enrichment job.
4
+ */
5
+ export interface TriggerEnrichmentJobResponse {
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});
@@ -10,6 +10,8 @@ import { CreateEnrichmentJobRequest } from '../models/create-enrichment-job-requ
10
10
  import { CreateEnrichmentJobResponse } from '../models/create-enrichment-job-response';
11
11
  import { SubmitEnrichmentJobRequest } from '../models/submit-enrichment-job-request';
12
12
  import { GetEnrichmentJobRequest } from '../models/get-enrichment-job-request';
13
+ import { TriggerEnrichmentJobRequest } from '../models/trigger-enrichment-job-request';
14
+ import { TriggerEnrichmentJobResponse } from '../models/trigger-enrichment-job-response';
13
15
  /**
14
16
  * Service for managing data enrichment jobs.
15
17
  */
@@ -78,6 +80,13 @@ export interface DataEnrichmentService {
78
80
  * @returns An Observable that emits the response
79
81
  */
80
82
  submitEnrichmentJob(request: SubmitEnrichmentJobRequest): Observable<void>;
83
+ /**
84
+ * Trigger a single-part enrichment job.
85
+ *
86
+ * @param request - The request containing enrichment type, part ids and optional visibility/organization.
87
+ * @returns An Observable that emits the created job id.
88
+ */
89
+ triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
81
90
  }
82
91
  export declare class DataEnrichmentServiceImpl extends BaseService implements DataEnrichmentService {
83
92
  private httpsService;
@@ -103,6 +112,7 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
103
112
  hasMoreEnrichmentJobPartsAvailable(paginationContext: DefaultGetPaginatedRequestPaginationContext): boolean;
104
113
  createEnrichmentJob(request: CreateEnrichmentJobRequest): Observable<CreateEnrichmentJobResponse>;
105
114
  submitEnrichmentJob(request: SubmitEnrichmentJobRequest): Observable<void>;
115
+ triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
106
116
  private fetchEnrichmentJobsPage;
107
117
  private fetchEnrichmentJobPartsPage;
108
118
  private extractNextCursor;
@@ -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.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 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;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2026 Partium, Inc. DBA Partium
2
- export declare const SDK_VERSION_NUMBER = "15.5.0";
2
+ export declare const SDK_VERSION_NUMBER = "15.6.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.5.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="15.6.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "15.5.0",
3
+ "version": "15.6.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.",