@partium/js-sdk 14.8.0 → 14.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 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 s(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}}();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"),AxiosHttpsClientService=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},r.prototype.get=function(e,r,t){return this.requestAsObservable({method:"GET",url:this.addUrlParameters(e,r),headers:t})},r.prototype.post=function(e,r,t,s){return this.requestAsObservable({method:"POST",url:this.addUrlParameters(e,t),data:r,headers:s})},r.prototype.patch=function(e,r,t,s){return this.requestAsObservable({method:"PATCH",url:this.addUrlParameters(e,t),data:r,headers:s})},r.prototype.delete=function(e,r,t,s){return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,t),data:r,headers:s})},r.prototype.put=function(e,r,t,s){return this.requestAsObservable({method:"PUT",url:this.addUrlParameters(e,t),data:r,headers:s})},r.prototype.requestAsObservable=function(e){var r=this;return(0,rxjs_1.defer)((function(){return r.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(handle_axios_error_helper_1.HandleAxiosErrorHelper.processError))},r.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},r.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(r){throw r?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},r}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
|
|
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 s(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}}();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"),AxiosHttpsClientService=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},r.prototype.get=function(e,r,t){return this.requestAsObservable({method:"GET",url:this.addUrlParameters(e,r),headers:t,withCredentials:!0})},r.prototype.post=function(e,r,t,s){return this.requestAsObservable({method:"POST",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.patch=function(e,r,t,s){return this.requestAsObservable({method:"PATCH",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.delete=function(e,r,t,s){return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.put=function(e,r,t,s){return this.requestAsObservable({method:"PUT",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.requestAsObservable=function(e){var r=this;return(0,rxjs_1.defer)((function(){return r.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(handle_axios_error_helper_1.HandleAxiosErrorHelper.processError))},r.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},r.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(r){throw r?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},r}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 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
|
|
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 n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);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"),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){return this.requestAsObservable(this.addUrlParameters(e,t),__assign({method:"GET",credentials:"include"},r&&{headers:Object.entries(r)}))},t.prototype.post=function(e,t,r,s){return t instanceof FormData&&delete s["Content-Type"],this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"POST",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.patch=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PATCH",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.delete=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"DELETE",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.put=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PUT",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.requestAsObservable=function(e,t){var r=this;return new rxjs_1.Observable((function(s){r.validateIsKnownUrlOrCry(e),fetch(e,t).then((function(e){s.next(e),s.complete()})).catch((function(e){s.error(e)}))})).pipe((0,operators_1.mergeMap)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.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.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;
|
package/gen/sdk-version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
export declare const SDK_VERSION_NUMBER = "14.
|
|
2
|
+
export declare const SDK_VERSION_NUMBER = "14.9.0";
|
package/gen/sdk-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.9.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/js-sdk",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.9.0",
|
|
4
4
|
"author": "Partium Inc.",
|
|
5
5
|
"license": "See LICENSE.txt",
|
|
6
6
|
"description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into JavaScript-based applications.",
|