@partium/js-sdk 15.13.0 → 15.14.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.
@@ -16,6 +16,10 @@ export interface TriggerEnrichmentJobRequest {
16
16
  * Whether the job should be visible in the enrichment dashboard.
17
17
  */
18
18
  visible?: boolean;
19
+ /**
20
+ * Optional list of attribute identifiers used for attribute enrichment jobs.
21
+ */
22
+ attributeIds?: string[];
19
23
  /**
20
24
  * Organization identifier when explicitly selecting an organization.
21
25
  */
@@ -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 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),(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,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=(0,core_1.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=(0,core_1.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.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;
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),(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,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(__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.fetchEnrichmentJobsPage=function(r){var t=this,e=(0,core_1.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=(0,core_1.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.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.13.0";
2
+ export declare const SDK_VERSION_NUMBER = "15.14.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.13.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="15.14.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "15.13.0",
3
+ "version": "15.14.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.",