@partium/js-sdk 16.5.0 → 16.7.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/core/integration-defaults/http/https-client/axios-https-client.service.d.ts +11 -0
- package/core/integration-defaults/http/https-client/axios-https-client.service.js +1 -1
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +1 -1
- package/core/services/http/https.service.interface.d.ts +2 -1
- package/core/services/http/https.service.interface.js +1 -1
- package/core/services/http/oauth-https.service.d.ts +2 -1
- package/core/services/http/oauth-https.service.js +1 -1
- package/data/index.d.ts +2 -0
- package/data/index.js +1 -1
- package/data/models/parts-export-request.d.ts +36 -0
- package/data/models/parts-export-request.js +2 -0
- package/data/models/parts-export-response.d.ts +3 -0
- package/data/models/parts-export-response.js +2 -0
- package/data/services/data.service.d.ts +14 -0
- package/data/services/data.service.js +1 -1
- package/enrichment/models/enrichment-job-part.d.ts +2 -2
- package/enrichment/models/enrichment-job-part.js +1 -1
- package/enrichment/models/enrichment-job.d.ts +2 -2
- package/enrichment/models/enrichment-job.js +1 -1
- package/gen/sdk-version.d.ts +1 -1
- package/gen/sdk-version.js +1 -1
- package/package.json +1 -1
- package/part-list/models/create-collection-from-file-request.d.ts +4 -3
|
@@ -64,6 +64,17 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
|
|
|
64
64
|
* @returns Observable that resolves with the request result
|
|
65
65
|
*/
|
|
66
66
|
put(url: string, data: any, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
|
|
67
|
+
/**
|
|
68
|
+
* Translate the SDK responseType into the axios responseType used for the request.
|
|
69
|
+
*
|
|
70
|
+
* A blob download asks for 'arraybuffer' instead of axios' own 'blob' mode, which only exists in
|
|
71
|
+
* the browser adapter. On success processBlobResponse builds a Blob from the buffer, so a Blob
|
|
72
|
+
* implementation is needed to construct and to consume one. On 4xx/5xx HandleAxiosErrorHelper
|
|
73
|
+
* decodes the binary body back into the JSON error payload, which keeps errorCode readable for
|
|
74
|
+
* the OAuth refresh-and-retry; it recognizes ArrayBuffer and Blob bodies, but not the Buffer that
|
|
75
|
+
* axios' Node adapter returns.
|
|
76
|
+
*/
|
|
77
|
+
private axiosResponseTypeConfig;
|
|
67
78
|
/**
|
|
68
79
|
* React Native FormData uploads fail when Content-Type is set without a boundary,
|
|
69
80
|
* and axios may stringify FormData unless transformRequest passes it through unchanged.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxiosHttpsClientService=void 0;var rxjs_1=require("rxjs"),axios_observable_1=require("axios-observable"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),handle_axios_error_helper_1=require("../handle-axios-error-helper"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),parse_content_disposition_filename_1=require("../../../utils/parse-content-disposition-filename"),AxiosHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,o){var s,i,n=null!==(s=null==o?void 0:o.responseType)&&void 0!==s?s:"json";return this.requestAsObservable(__assign({method:"GET",url:this.addUrlParameters(e,t),headers:r,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i},
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxiosHttpsClientService=void 0;var rxjs_1=require("rxjs"),axios_observable_1=require("axios-observable"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),handle_axios_error_helper_1=require("../handle-axios-error-helper"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),parse_content_disposition_filename_1=require("../../../utils/parse-content-disposition-filename"),AxiosHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,o){var s,i,n=null!==(s=null==o?void 0:o.responseType)&&void 0!==s?s:"json";return this.requestAsObservable(__assign({method:"GET",url:this.addUrlParameters(e,t),headers:r,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i},this.axiosResponseTypeConfig(n)),n)},t.prototype.post=function(e,t,r,o,s){var i,n,a=null!==(i=null==s?void 0:s.responseType)&&void 0!==i?i:"json";return this.requestAsObservable(this.applyFormDataRequestOptions(__assign({method:"POST",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(n=null==s?void 0:s.withCredentials)&&void 0!==n&&n},this.axiosResponseTypeConfig(a))),a)},t.prototype.patch=function(e,t,r,o,s){var i;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"PATCH",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i}))},t.prototype.delete=function(e,t,r,o,s){var i;return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i})},t.prototype.put=function(e,t,r,o,s){var i;return this.requestAsObservable(this.applyFormDataRequestOptions({method:"PUT",url:this.addUrlParameters(e,r),data:t,headers:o,withCredentials:null!==(i=null==s?void 0:s.withCredentials)&&void 0!==i&&i}))},t.prototype.axiosResponseTypeConfig=function(e){return"blob"===e?{responseType:"arraybuffer"}:{}},t.prototype.applyFormDataRequestOptions=function(e){if(!(e.data instanceof FormData))return e;var t=__assign({},e.headers);return delete t["Content-Type"],delete t["content-type"],__assign(__assign({},e),{headers:t,transformRequest:[function(e){return e}]})},t.prototype.requestAsObservable=function(e,t){var r=this;return void 0===t&&(t="json"),(0,rxjs_1.defer)((function(){return r.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return"blob"===t?r.processBlobResponse(e):r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)((function(e){return"blob"===t?handle_axios_error_helper_1.HandleAxiosErrorHelper.processBlobError(e):handle_axios_error_helper_1.HandleAxiosErrorHelper.processResponseError(e)})))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return e.data}throw e},t.prototype.processBlobResponse=function(e){var t,r,o,s,i,n;if(!e.status)throw e;if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;if(204===e.status)return{blob:new Blob,fileName:void 0};var a=null!==(r=null===(t=e.headers)||void 0===t?void 0:t["content-disposition"])&&void 0!==r?r:null===(o=e.headers)||void 0===o?void 0:o["Content-Disposition"],l=null!==(i=null===(s=e.headers)||void 0===s?void 0:s["content-type"])&&void 0!==i?i:null===(n=e.headers)||void 0===n?void 0:n["Content-Type"];return{blob:new Blob([e.data],{type:"string"==typeof l?l:void 0}),fileName:(0,parse_content_disposition_filename_1.parseContentDispositionFileName)("string"==typeof a?a:void 0)}},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FetchAPIHttpsClientService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),fetch_api_http_error_helper_1=require("../fetch-api-http-error-helper"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),parse_content_disposition_filename_1=require("../../../utils/parse-content-disposition-filename"),FetchAPIHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,s){var o,
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FetchAPIHttpsClientService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),fetch_api_http_error_helper_1=require("../fetch-api-http-error-helper"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),parse_content_disposition_filename_1=require("../../../utils/parse-content-disposition-filename"),FetchAPIHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,s){var o,n=null!==(o=null==s?void 0:s.responseType)&&void 0!==o?o:"json";return this.requestAsObservable(this.addUrlParameters(e,t),__assign({method:"GET",credentials:(null==s?void 0:s.withCredentials)?"include":"same-origin"},r&&{headers:Object.entries(r)}),n)},t.prototype.post=function(e,t,r,s,o){var n;return t instanceof FormData&&s&&delete s["Content-Type"],this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"POST",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}),null!==(n=null==o?void 0:o.responseType)&&void 0!==n?n:"json")},t.prototype.patch=function(e,t,r,s,o){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PATCH",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.delete=function(e,t,r,s,o){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"DELETE",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.put=function(e,t,r,s,o){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PUT",credentials:(null==o?void 0:o.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.requestAsObservable=function(e,t,r){var s=this;return void 0===r&&(r="json"),new rxjs_1.Observable((function(r){s.validateIsKnownUrlOrCry(e),fetch(e,t).then((function(e){r.next(e),r.complete()})).catch((function(e){r.error(e)}))})).pipe((0,operators_1.mergeMap)((function(e){return"blob"===r?s.processBlobResponse(e):s.processResponse(e)})),(0,operators_1.catchError)((function(e){return s.checkInternetConnectivity(e)})),(0,operators_1.catchError)(fetch_api_http_error_helper_1.FetchAPIHttpErrorHelper.processError))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({}):(0,rxjs_1.from)(e.clone().json())}throw e},t.prototype.processBlobResponse=function(e){if(!e.status)throw e;if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({blob:new Blob,fileName:void 0}):(0,rxjs_1.from)(e.clone().blob()).pipe((0,operators_1.map)((function(t){return{blob:t,fileName:(0,parse_content_disposition_filename_1.parseContentDispositionFileName)(e.headers.get("content-disposition"))}})))},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t.prototype.createBody=function(e){return"string"==typeof e||e instanceof FormData?e:JSON.stringify(e)},t}(https_client_service_interface_1.HttpsClientService);exports.FetchAPIHttpsClientService=FetchAPIHttpsClientService;
|
|
@@ -79,9 +79,10 @@ export declare class HttpsService extends BaseService {
|
|
|
79
79
|
* @param urlParams array of url parameters (as objects) which will be appended to the url, eg: [{ p1: x }, { p2: y }] will become <url>?p1=x&p2=y
|
|
80
80
|
* @param beService to which backend-service should the request be sent (default PARTIUM)
|
|
81
81
|
* @param headers object with custom headers to send with the request
|
|
82
|
+
* @param requestOptions options for the request
|
|
82
83
|
* @returns Observable that resolves with the request result
|
|
83
84
|
*/
|
|
84
|
-
post(url: string, data: Object, urlParams?: Array<Object>, beService?: BACKEND_SERVICE, headers?: Object): Observable<any>;
|
|
85
|
+
post(url: string, data: Object, urlParams?: Array<Object>, beService?: BACKEND_SERVICE, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
|
|
85
86
|
/**
|
|
86
87
|
* Send PUT request to the Partium-backend with the given relative url and content.
|
|
87
88
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,s=arguments.length,i=s<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(r,t,i):o(r,t))||i);return s>3&&i&&Object.defineProperty(r,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsService=exports.BACKEND_SERVICE=void 0;var BACKEND_SERVICE,base_service_1=require("../base.service"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./https-client/https-client.service.interface"),injection_identifier_1=require("../../decorators/injection-identifier");!function(e){e[e.PARTIUM=0]="PARTIUM",e[e.DATA=1]="DATA",e[e.CSA=2]="CSA",e[e.LOG=3]="LOG",e[e.USER_DATA=4]="USER_DATA",e[e.MANAGEMENT=5]="MANAGEMENT",e[e.CATALOG=6]="CATALOG",e[e.DATACURATION=7]="DATACURATION",e[e.DATA_V2=8]="DATA_V2",e[e.DATA_ENRICHMENT=9]="DATA_ENRICHMENT",e[e.BACKOFFICE=10]="BACKOFFICE",e[e.PART_LIST=11]="PART_LIST"}(BACKEND_SERVICE||(exports.BACKEND_SERVICE=BACKEND_SERVICE={}));var HttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService)},r.prototype.init=function(e,r){return this.baseUrls=e,this.config=r,(0,rxjs_1.of)(void 0)},r.prototype.get=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},t)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.get(o.createUrl(e,t),r,s,n)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.post=function(e,r,t,n,o){var
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,s=arguments.length,i=s<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(r,t,i):o(r,t))||i);return s>3&&i&&Object.defineProperty(r,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsService=exports.BACKEND_SERVICE=void 0;var BACKEND_SERVICE,base_service_1=require("../base.service"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./https-client/https-client.service.interface"),injection_identifier_1=require("../../decorators/injection-identifier");!function(e){e[e.PARTIUM=0]="PARTIUM",e[e.DATA=1]="DATA",e[e.CSA=2]="CSA",e[e.LOG=3]="LOG",e[e.USER_DATA=4]="USER_DATA",e[e.MANAGEMENT=5]="MANAGEMENT",e[e.CATALOG=6]="CATALOG",e[e.DATACURATION=7]="DATACURATION",e[e.DATA_V2=8]="DATA_V2",e[e.DATA_ENRICHMENT=9]="DATA_ENRICHMENT",e[e.BACKOFFICE=10]="BACKOFFICE",e[e.PART_LIST=11]="PART_LIST"}(BACKEND_SERVICE||(exports.BACKEND_SERVICE=BACKEND_SERVICE={}));var HttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService)},r.prototype.init=function(e,r){return this.baseUrls=e,this.config=r,(0,rxjs_1.of)(void 0)},r.prototype.get=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},t)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.get(o.createUrl(e,t),r,s,n)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.post=function(e,r,t,n,o,s){var i=this;return(0,rxjs_1.defer)((function(){return i.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return i.httpsClientService.post(i.createUrl(e,n),r,t,o,s)})),(0,operators_1.retryWhen)((function(e){return i.retryWhen(e)})),(0,operators_1.catchError)((function(e){return i.processError(e)})))},r.prototype.put=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.put(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.patch=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.patch(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.delete=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},n)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.delete(o.createUrl(e,n),r,t,s)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.setCurrentOrganization=function(e){this.currentOrganization$=e},r.prototype.retryWhen=function(e){return e.pipe((0,operators_1.mergeMap)((function(e){return(0,rxjs_1.throwError)(e)})))},r.prototype.processError=function(e){return(0,rxjs_1.throwError)(e)},r.prototype.createHeaders=function(e){throw new Error("In order to use the HttpsService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.createUrl=function(e,r){for(void 0===r&&(r=BACKEND_SERVICE.PARTIUM);e.startsWith("/");)e=e.substring(1);var t;switch(r){case BACKEND_SERVICE.DATA:t=this.baseUrls.dataBeBaseUrl;break;case BACKEND_SERVICE.CSA:t=this.baseUrls.csaBeBaseUrl;break;case BACKEND_SERVICE.LOG:t=this.baseUrls.logBeBaseUrl;break;case BACKEND_SERVICE.USER_DATA:t=this.baseUrls.userDataBeBaseUrl;break;case BACKEND_SERVICE.MANAGEMENT:t=this.baseUrls.managementBeBaseUrl;break;case BACKEND_SERVICE.CATALOG:t=this.baseUrls.catalogBeBaseUrl;break;case BACKEND_SERVICE.DATACURATION:t=this.baseUrls.datacurationBeBaseUrl;break;case BACKEND_SERVICE.DATA_V2:t=this.baseUrls.dataV2BeBaseUrl;break;case BACKEND_SERVICE.DATA_ENRICHMENT:t=this.baseUrls.dataEnrichmentBeBaseUrl;break;case BACKEND_SERVICE.BACKOFFICE:t=this.baseUrls.backofficeBeBaseUrl;break;case BACKEND_SERVICE.PART_LIST:t=this.baseUrls.partListBeBaseUrl;break;case BACKEND_SERVICE.PARTIUM:default:t=this.baseUrls.partiumApiBaseUrl}return[t,e].join("/")},r.prototype.configureHeaders=function(e,r){var t=this.createHeaders(e);return this.config.externalUserId&&r!==BACKEND_SERVICE.LOG&&(t["X-Partium-ExternalUserId"]=this.config.externalUserId),this.currentOrganization$?this.currentOrganization$.pipe((0,operators_1.first)(),(0,operators_1.map)((function(e){return(null==e?void 0:e.name)&&(t["X-Partium-Data-Organization"]=e.name),t}))):(0,rxjs_1.of)(t)},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsService")],r)}(base_service_1.BaseService);exports.HttpsService=HttpsService;
|
|
@@ -59,9 +59,10 @@ export declare class OauthHttpsService extends HttpsService {
|
|
|
59
59
|
* @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
|
|
60
60
|
* @param beService to which backend-service should the request be sent (default PARTIUM)
|
|
61
61
|
* @param headers object with custom headers to send with the request
|
|
62
|
+
* @param requestOptions options for the request
|
|
62
63
|
* @returns Observable that resolves with the request result
|
|
63
64
|
*/
|
|
64
|
-
post(url: string, data: Object, urlParams?: Array<Object>, beService?: BACKEND_SERVICE, headers?: Object): Observable<any>;
|
|
65
|
+
post(url: string, data: Object, urlParams?: Array<Object>, beService?: BACKEND_SERVICE, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
|
|
65
66
|
/**
|
|
66
67
|
*
|
|
67
68
|
* Send PATCH request to the server with the given url and content.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.OauthHttpsService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_service_interface_1=require("./https.service.interface"),error_1=require("../../models/error"),oauth_session_service_1=require("../session/oauth-session.service"),session_service_interface_1=require("../session/session.service.interface"),OauthHttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.oauthSessionService=this.serviceProvider.getService(session_service_interface_1.SessionService)},r.prototype.init=function(r,t){return e.prototype.init.call(this,r,t),t.apiKey?this.callOauthLogin():(0,rxjs_1.of)(void 0)},r.prototype.setToken=function(e,r){this.authToken=e,this.authTokenExpiresAt=r},r.prototype.get=function(r,t,o,i){var n=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.get.call(n,r,t,o,i)})))},r.prototype.post=function(r,t,o,i,n){var
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.OauthHttpsService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_service_interface_1=require("./https.service.interface"),error_1=require("../../models/error"),oauth_session_service_1=require("../session/oauth-session.service"),session_service_interface_1=require("../session/session.service.interface"),OauthHttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.oauthSessionService=this.serviceProvider.getService(session_service_interface_1.SessionService)},r.prototype.init=function(r,t){return e.prototype.init.call(this,r,t),t.apiKey?this.callOauthLogin():(0,rxjs_1.of)(void 0)},r.prototype.setToken=function(e,r){this.authToken=e,this.authTokenExpiresAt=r},r.prototype.get=function(r,t,o,i){var n=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.get.call(n,r,t,o,i)})))},r.prototype.post=function(r,t,o,i,n,s){var p=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.post.call(p,r,t,o,i,n,s)})))},r.prototype.patch=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.patch.call(s,r,t,o,i,n)})))},r.prototype.retryWhen=function(e){var r=this;return e.pipe((0,operators_1.mergeMap)((function(e){return e.code===error_1.SDK_ERROR_CODES.TOKEN_EXPIRED?(console.log("HttpsService - Token expired, attempting refresh"),r.refreshOrLogin()):(0,rxjs_1.throwError)(e)})))},r.prototype.createHeaders=function(e){var r={"Content-Type":"application/json"};return this.authToken&&(r.Authorization="Bearer ".concat(this.authToken)),Object.assign(r,e)},r.prototype.callOauthLogin=function(){var e=this.config;return this.oauthSessionService.login(new oauth_session_service_1.OauthLoginConfig({apiKey:e.apiKey}))},r.prototype.refreshSessionIfNeeded=function(){var e=!1;this.authTokenExpiresAt?e=(Date.now()/1e3|0)>this.authTokenExpiresAt.getTime()/1e3-60:e=!0;return e?this.refreshOrLogin():(0,rxjs_1.of)(void 0)},r.prototype.refreshOrLogin=function(){var e=this;return this.oauthSessionService.refresh().pipe((0,operators_1.catchError)((function(r){return r.code===error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED||r.code===error_1.SDK_ERROR_CODES.INVALID_TOKEN||r.code===error_1.SDK_ERROR_CODES.BAD_REQUEST||r.code===error_1.SDK_ERROR_CODES.OAUTH_ERROR?e.callOauthLogin().pipe((0,operators_1.catchError)((function(e){return e.code===error_1.SDK_ERROR_CODES.INVALID_LOGIN_CONFIG?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED,r)):(0,rxjs_1.throwError)(e)}))):(0,rxjs_1.throwError)(r)})))},r}(https_service_interface_1.HttpsService);exports.OauthHttpsService=OauthHttpsService;
|
package/data/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export * from './models/get-selectable-attributes-response';
|
|
|
23
23
|
export * from './models/part-data';
|
|
24
24
|
export * from './models/selectable-attribute';
|
|
25
25
|
export * from './models/parts-summary-request';
|
|
26
|
+
export * from './models/parts-export-request';
|
|
27
|
+
export * from './models/parts-export-response';
|
|
26
28
|
export * from './models/parts-summary-response';
|
|
27
29
|
export * from './services/part.service';
|
|
28
30
|
export * from './services/part-enrichment.service';
|
package/data/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,s){void 0===s&&(s=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,o)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=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/part"),exports),__exportStar(require("./models/document"),exports),__exportStar(require("./models/assembly-hierarchy-node"),exports),__exportStar(require("./models/assembly-hierarchy-node-breadcrumb"),exports),__exportStar(require("./models/image"),exports),__exportStar(require("./models/attribute"),exports),__exportStar(require("./models/csa-request"),exports),__exportStar(require("./models/csa-request-status"),exports),__exportStar(require("./models/filter-key"),exports),__exportStar(require("./models/filter-option-value"),exports),__exportStar(require("./models/shopping-cart"),exports),__exportStar(require("./models/multiple-expert-searches"),exports),__exportStar(require("./models/csa-request-search"),exports),__exportStar(require("./models/announcement"),exports),__exportStar(require("./models/inquiry"),exports),__exportStar(require("./models/mounting-location"),exports),__exportStar(require("./models/part-enrichment-data"),exports),__exportStar(require("./models/get-part-data-request"),exports),__exportStar(require("./models/get-part-data-response"),exports),__exportStar(require("./models/get-selectable-attributes-request"),exports),__exportStar(require("./models/get-selectable-attributes-response"),exports),__exportStar(require("./models/part-data"),exports),__exportStar(require("./models/selectable-attribute"),exports),__exportStar(require("./models/parts-summary-request"),exports),__exportStar(require("./models/parts-summary-response"),exports),__exportStar(require("./services/part.service"),exports),__exportStar(require("./services/part-enrichment.service"),exports),__exportStar(require("./services/related-parts.service"),exports),__exportStar(require("./services/assembly-hierarchy-nodes.service"),exports),__exportStar(require("./services/part-attribute.service"),exports),__exportStar(require("./services/customer-service-assistance.service"),exports),__exportStar(require("./services/filter.service"),exports),__exportStar(require("./services/shopping-cart.service"),exports),__exportStar(require("./services/inquiry.service"),exports),__exportStar(require("./services/announcement.service"),exports),__exportStar(require("./services/data.service"),exports);
|
|
2
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,o)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=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/part"),exports),__exportStar(require("./models/document"),exports),__exportStar(require("./models/assembly-hierarchy-node"),exports),__exportStar(require("./models/assembly-hierarchy-node-breadcrumb"),exports),__exportStar(require("./models/image"),exports),__exportStar(require("./models/attribute"),exports),__exportStar(require("./models/csa-request"),exports),__exportStar(require("./models/csa-request-status"),exports),__exportStar(require("./models/filter-key"),exports),__exportStar(require("./models/filter-option-value"),exports),__exportStar(require("./models/shopping-cart"),exports),__exportStar(require("./models/multiple-expert-searches"),exports),__exportStar(require("./models/csa-request-search"),exports),__exportStar(require("./models/announcement"),exports),__exportStar(require("./models/inquiry"),exports),__exportStar(require("./models/mounting-location"),exports),__exportStar(require("./models/part-enrichment-data"),exports),__exportStar(require("./models/get-part-data-request"),exports),__exportStar(require("./models/get-part-data-response"),exports),__exportStar(require("./models/get-selectable-attributes-request"),exports),__exportStar(require("./models/get-selectable-attributes-response"),exports),__exportStar(require("./models/part-data"),exports),__exportStar(require("./models/selectable-attribute"),exports),__exportStar(require("./models/parts-summary-request"),exports),__exportStar(require("./models/parts-export-request"),exports),__exportStar(require("./models/parts-export-response"),exports),__exportStar(require("./models/parts-summary-response"),exports),__exportStar(require("./services/part.service"),exports),__exportStar(require("./services/part-enrichment.service"),exports),__exportStar(require("./services/related-parts.service"),exports),__exportStar(require("./services/assembly-hierarchy-nodes.service"),exports),__exportStar(require("./services/part-attribute.service"),exports),__exportStar(require("./services/customer-service-assistance.service"),exports),__exportStar(require("./services/filter.service"),exports),__exportStar(require("./services/shopping-cart.service"),exports),__exportStar(require("./services/inquiry.service"),exports),__exportStar(require("./services/announcement.service"),exports),__exportStar(require("./services/data.service"),exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
/**
|
|
3
|
+
* The projection of the parts export: it drives the columns of the exported table sheet.
|
|
4
|
+
* The endpoint also accepts the parts-summary-only `selected` and `investigation`, which are
|
|
5
|
+
* deliberately left out here because they have no effect on the export.
|
|
6
|
+
*/
|
|
7
|
+
export type PartsExportProjection = 'attributes' | 'identifiers' | 'supplierDiscovery' | 'similarParts' | 'alternativeParts';
|
|
8
|
+
/**
|
|
9
|
+
* Request for exporting the table data of a selection of parts as an Excel file.
|
|
10
|
+
*/
|
|
11
|
+
export interface PartsExportRequest {
|
|
12
|
+
/**
|
|
13
|
+
* Specify the `selection` part list whose parts are exported, in list order.
|
|
14
|
+
*/
|
|
15
|
+
partListId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Specify which data should be included via projection.
|
|
18
|
+
*/
|
|
19
|
+
projection?: PartsExportProjection[];
|
|
20
|
+
/**
|
|
21
|
+
* Specify the attribute IDs to export. (only if projection includes "attributes")
|
|
22
|
+
*/
|
|
23
|
+
attributeIds?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Specify the organization to export for.
|
|
26
|
+
*/
|
|
27
|
+
organization?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Specify the language to render part names, attribute headers and values into.
|
|
30
|
+
*/
|
|
31
|
+
language?: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Specify the fallback languages if the main language is not available.
|
|
34
|
+
*/
|
|
35
|
+
fallbackLanguages?: string[];
|
|
36
|
+
}
|
|
@@ -5,6 +5,8 @@ import { GetPartDataRequest } from '../models/get-part-data-request';
|
|
|
5
5
|
import { GetPartDataResponse } from '../models/get-part-data-response';
|
|
6
6
|
import { GetSelectableAttributesRequest } from '../models/get-selectable-attributes-request';
|
|
7
7
|
import { GetSelectableAttributesResponse } from '../models/get-selectable-attributes-response';
|
|
8
|
+
import { PartsExportRequest } from '../models/parts-export-request';
|
|
9
|
+
import { PartsExportResponse } from '../models/parts-export-response';
|
|
8
10
|
import { PartsSummaryRequest } from '../models/parts-summary-request';
|
|
9
11
|
import { PartsSummaryResponse } from '../models/parts-summary-response';
|
|
10
12
|
export interface DataService {
|
|
@@ -23,6 +25,17 @@ export interface DataService {
|
|
|
23
25
|
* @returns The summary of the parts.
|
|
24
26
|
*/
|
|
25
27
|
getPartsSummary(request: PartsSummaryRequest): Observable<PartsSummaryResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Export the table data of a `selection` part list as an Excel file.
|
|
30
|
+
* Specify which columns the export should contain via projection.
|
|
31
|
+
*
|
|
32
|
+
* Requires an `HttpsClientService` that honors `requestOptions.responseType`, which the bundled
|
|
33
|
+
* Axios and Fetch clients do; the NativeScript client does not and returns parsed content instead.
|
|
34
|
+
*
|
|
35
|
+
* @param request - The request object.
|
|
36
|
+
* @returns The exported workbook and the file name reported by the backend.
|
|
37
|
+
*/
|
|
38
|
+
exportParts(request: PartsExportRequest): Observable<PartsExportResponse>;
|
|
26
39
|
/**
|
|
27
40
|
* Loads the first page of selectable attribute definitions with pagination context.
|
|
28
41
|
*
|
|
@@ -54,6 +67,7 @@ export declare class DataServiceImpl extends BaseService implements DataService
|
|
|
54
67
|
onCreate(): void;
|
|
55
68
|
getPart(request?: GetPartDataRequest): Observable<GetPartDataResponse>;
|
|
56
69
|
getPartsSummary(request: PartsSummaryRequest): Observable<PartsSummaryResponse>;
|
|
70
|
+
exportParts(request: PartsExportRequest): Observable<PartsExportResponse>;
|
|
57
71
|
loadSelectableAttributes(request?: GetSelectableAttributesRequest): Observable<{
|
|
58
72
|
response: GetSelectableAttributesResponse;
|
|
59
73
|
paginationContext: DefaultGetPaginatedRequestPaginationContext;
|
|
@@ -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(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(t,e,r,o){var n,i=arguments.length,s=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(s=(i<3?n(s):i>3?n(e,r,s):n(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),DataServiceImpl=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.getPart=function(t){return void 0===t&&(t={projection:["partiumId"]}),this.httpsService.get("part",(0,core_1.toQueryParams)(t),core_1.BACKEND_SERVICE.DATA_V2)},e.prototype.getPartsSummary=function(t){return this.httpsService.post("parts",t,[],core_1.BACKEND_SERVICE.DATA_V2)},e.prototype.loadSelectableAttributes=function(t){return void 0===t&&(t={}),this.fetchSelectableAttributesPage(t).pipe((0,rxjs_1.map)((function(e){return{response:e,paginationContext:{initialRequest:__assign({},t),nextCursor:(0,core_1.extractNextCursor)(e)}}})))},e.prototype.loadMoreSelectableAttributes=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 e=__assign(__assign({},t.initialRequest),{cursor:t.nextCursor});return this.fetchSelectableAttributesPage(e).pipe((0,rxjs_1.map)((function(e){return{response:e,paginationContext:__assign(__assign({},t),{nextCursor:(0,core_1.extractNextCursor)(e)})}})))},e.prototype.hasMoreSelectableAttributesAvailable=function(t){return!!t.nextCursor},e.prototype.fetchSelectableAttributesPage=function(t){return this.httpsService.get("attributes",(0,core_1.toQueryParams)(t),core_1.BACKEND_SERVICE.DATA_V2)},e=__decorate([(0,core_1.InjectionIdentifier)("DataService")],e)}(core_1.BaseService);exports.DataServiceImpl=DataServiceImpl;
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(t,e,r,o){var n,i=arguments.length,s=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(s=(i<3?n(s):i>3?n(e,r,s):n(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),DataServiceImpl=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.getPart=function(t){return void 0===t&&(t={projection:["partiumId"]}),this.httpsService.get("part",(0,core_1.toQueryParams)(t),core_1.BACKEND_SERVICE.DATA_V2)},e.prototype.getPartsSummary=function(t){return this.httpsService.post("parts",t,[],core_1.BACKEND_SERVICE.DATA_V2)},e.prototype.exportParts=function(t){return this.httpsService.post("export",t,[],core_1.BACKEND_SERVICE.DATA_V2,void 0,{responseType:"blob"})},e.prototype.loadSelectableAttributes=function(t){return void 0===t&&(t={}),this.fetchSelectableAttributesPage(t).pipe((0,rxjs_1.map)((function(e){return{response:e,paginationContext:{initialRequest:__assign({},t),nextCursor:(0,core_1.extractNextCursor)(e)}}})))},e.prototype.loadMoreSelectableAttributes=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 e=__assign(__assign({},t.initialRequest),{cursor:t.nextCursor});return this.fetchSelectableAttributesPage(e).pipe((0,rxjs_1.map)((function(e){return{response:e,paginationContext:__assign(__assign({},t),{nextCursor:(0,core_1.extractNextCursor)(e)})}})))},e.prototype.hasMoreSelectableAttributesAvailable=function(t){return!!t.nextCursor},e.prototype.fetchSelectableAttributesPage=function(t){return this.httpsService.get("attributes",(0,core_1.toQueryParams)(t),core_1.BACKEND_SERVICE.DATA_V2)},e=__decorate([(0,core_1.InjectionIdentifier)("DataService")],e)}(core_1.BaseService);exports.DataServiceImpl=DataServiceImpl;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Image,
|
|
2
|
+
import { Image, ImageFromPartiumAPI } from '../../data';
|
|
3
3
|
export interface EnrichmentJobPartFromAPI {
|
|
4
4
|
partiumId: string | null;
|
|
5
5
|
id: string;
|
|
6
6
|
name: string | null;
|
|
7
7
|
nameLanguage?: string | null;
|
|
8
|
-
image:
|
|
8
|
+
image: ImageFromPartiumAPI | null;
|
|
9
9
|
status: ENRICHMENT_JOB_PART_STATUS;
|
|
10
10
|
}
|
|
11
11
|
export interface EnrichmentJobPartsSummary {
|
|
@@ -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,nameLanguage:e.nameLanguage,image:e.image?(0,data_1.
|
|
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?(0,data_1.fromPartiumAPIResponse)(e.image,core_1.BACKEND_SERVICE.DATA):null,status:e.status}};exports.enrichmentJobPartFromAPIResponse=enrichmentJobPartFromAPIResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Image,
|
|
2
|
+
import { Image, ImageFromPartiumAPI } from '../../data/models/image';
|
|
3
3
|
export declare enum EnrichmentJobStatus {
|
|
4
4
|
SUBMITTED = "submitted",
|
|
5
5
|
IN_PROGRESS = "in_progress",
|
|
@@ -21,7 +21,7 @@ export interface EnrichmentJobFromAPI {
|
|
|
21
21
|
title: string;
|
|
22
22
|
jobType: EnrichmentJobType;
|
|
23
23
|
description?: string;
|
|
24
|
-
thumbnails?: Array<
|
|
24
|
+
thumbnails?: Array<ImageFromPartiumAPI | null>;
|
|
25
25
|
status: EnrichmentJobStatus;
|
|
26
26
|
requestDate?: string;
|
|
27
27
|
partCount?: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
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.InvestigationType=exports.EnrichmentJobType=exports.EnrichmentJobStatus=void 0;var EnrichmentJobStatus,EnrichmentJobType,InvestigationType,core_1=require("../../core"),image_1=require("../../data/models/image");!function(e){e.SUBMITTED="submitted",e.IN_PROGRESS="in_progress",e.COMPLETED="completed",e.ERROR="error",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={})),function(e){e.GENERAL_PART_ATTRIBUTES="general_part_attributes",e.SUPPLIER_DISCOVERY="supplier_discovery"}(InvestigationType||(exports.InvestigationType=InvestigationType={}));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?(0,image_1.
|
|
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.InvestigationType=exports.EnrichmentJobType=exports.EnrichmentJobStatus=void 0;var EnrichmentJobStatus,EnrichmentJobType,InvestigationType,core_1=require("../../core"),image_1=require("../../data/models/image");!function(e){e.SUBMITTED="submitted",e.IN_PROGRESS="in_progress",e.COMPLETED="completed",e.ERROR="error",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={})),function(e){e.GENERAL_PART_ATTRIBUTES="general_part_attributes",e.SUPPLIER_DISCOVERY="supplier_discovery"}(InvestigationType||(exports.InvestigationType=InvestigationType={}));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?(0,image_1.fromPartiumAPIResponse)(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;
|
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 = "16.
|
|
2
|
+
export declare const SDK_VERSION_NUMBER = "16.7.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="16.
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="16.7.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/js-sdk",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.7.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.",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { PFile } from '../../core';
|
|
3
3
|
/**
|
|
4
|
-
* Request for creating a collection (a part-list) from a file
|
|
5
|
-
*
|
|
4
|
+
* Request for creating a collection (a part-list) from a file. The upload is sent as-is to the
|
|
5
|
+
* backend, which determines the accepted file formats (currently CSV and Excel `.xlsx`;
|
|
6
|
+
* `.xls` is not supported).
|
|
6
7
|
*/
|
|
7
8
|
export interface CreateCollectionFromFileRequest {
|
|
8
|
-
/** The file containing the part-ids to add (one per
|
|
9
|
+
/** The file containing the part-ids to add (one per row, no header). */
|
|
9
10
|
file: PFile;
|
|
10
11
|
}
|