@partium/cordova-sdk 14.0.2 → 14.14.1

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 __awaiter=this&&this.__awaiter||function(e,n,i,o){return new(i||(i=Promise))((function(t,r){function c(e){try{v(o.next(e))}catch(e){r(e)}}function a(e){try{v(o.throw(e))}catch(e){r(e)}}function v(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(e){e(n)}))).then(c,a)}v((o=o.apply(e,n||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CordovaDeviceStatusService=void 0;const core_1=require("@partium/js-sdk/core"),Connection=require("cordova-plugin-network-information/www/Connection"),AppVersion=require("cordova-plugin-app-version/www/AppVersionPlugin");class CordovaDeviceStatusService extends core_1.DeviceStatusService{isConnectionAvailable(){return __awaiter(this,void 0,void 0,(function*(){return this.isCordova()?this.isConnectionAvailableCordova():window.navigator.onLine}))}getDeviceInfo(){return __awaiter(this,void 0,void 0,(function*(){var e;const n=yield this.promisify(AppVersion.getVersionCode),i=yield this.promisify(AppVersion.getVersionNumber),o=yield this.promisify(AppVersion.getPackageName),t=(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.language)||"unavailable";return new core_1.DeviceInfo({deviceId:null===device||void 0===device?void 0:device.uuid,manufacturer:null===device||void 0===device?void 0:device.manufacturer,model:null===device||void 0===device?void 0:device.model,os:null===device||void 0===device?void 0:device.platform,osVersion:null===device||void 0===device?void 0:device.version,deviceType:null===device||void 0===device?void 0:device.model,deviceLanguage:t,appVersionCode:n,appVersionName:i,appId:o,connectivityType:this.getConnectivityType()})}))}promisify(e){return __awaiter(this,void 0,void 0,(function*(){try{return(yield new Promise(((n,i)=>e(n,i)))).toString()}catch(e){return""}}))}getConnectivityType(){let e;switch(e=navigator&&navigator.connection&&navigator.connection.type?navigator.connection.type:null,e){case Connection.ETHERNET:return"Ethernet";case Connection.WIFI:return"WiFi";case Connection.CELL_2G:return"Cell 2G";case Connection.CELL_3G:return"Cell 3G";case Connection.CELL_4G:return"Cell 4G";case Connection.CELL:return"Cell generic connection";case Connection.NONE:return"No network connection";case Connection.UNKNOWN:default:return"Unknown connection"}}isConnectionAvailableCordova(){if(!navigator.connection||!navigator.connection.type)throw new core_1.SdkError(core_1.SDK_ERROR_CODES.INTEGRATION_ERROR,null,"Could not determine network state in CordovaLocalStorageService. "+navigator.connection);return navigator.connection.type!==Connection.NONE}isCordova(){return 0===document.URL.indexOf("file://")}}exports.CordovaDeviceStatusService=CordovaDeviceStatusService;
2
+ "use strict";var __awaiter=this&&this.__awaiter||function(e,n,i,o){return new(i||(i=Promise))(function(t,r){function c(e){try{v(o.next(e))}catch(e){r(e)}}function a(e){try{v(o.throw(e))}catch(e){r(e)}}function v(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i(function(e){e(n)})).then(c,a)}v((o=o.apply(e,n||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CordovaDeviceStatusService=void 0;const core_1=require("@partium/js-sdk/core"),Connection=require("cordova-plugin-network-information/www/Connection"),AppVersion=require("cordova-plugin-app-version/www/AppVersionPlugin");class CordovaDeviceStatusService extends core_1.DeviceStatusService{isConnectionAvailable(){return __awaiter(this,void 0,void 0,function*(){return this.isCordova()?this.isConnectionAvailableCordova():window.navigator.onLine})}getDeviceInfo(){return __awaiter(this,void 0,void 0,function*(){var e;const n=yield this.promisify(AppVersion.getVersionCode),i=yield this.promisify(AppVersion.getVersionNumber),o=yield this.promisify(AppVersion.getPackageName),t=(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.language)||"unavailable";return new core_1.DeviceInfo({deviceId:null===device||void 0===device?void 0:device.uuid,manufacturer:null===device||void 0===device?void 0:device.manufacturer,model:null===device||void 0===device?void 0:device.model,os:null===device||void 0===device?void 0:device.platform,osVersion:null===device||void 0===device?void 0:device.version,deviceType:null===device||void 0===device?void 0:device.model,deviceLanguage:t,appVersionCode:n,appVersionName:i,appId:o,connectivityType:this.getConnectivityType()})})}promisify(e){return __awaiter(this,void 0,void 0,function*(){try{return(yield new Promise((n,i)=>e(n,i))).toString()}catch(e){return""}})}getConnectivityType(){let e;switch(e=navigator&&navigator.connection&&navigator.connection.type?navigator.connection.type:null,e){case Connection.ETHERNET:return"Ethernet";case Connection.WIFI:return"WiFi";case Connection.CELL_2G:return"Cell 2G";case Connection.CELL_3G:return"Cell 3G";case Connection.CELL_4G:return"Cell 4G";case Connection.CELL:return"Cell generic connection";case Connection.NONE:return"No network connection";case Connection.UNKNOWN:default:return"Unknown connection"}}isConnectionAvailableCordova(){if(!navigator.connection||!navigator.connection.type)throw new core_1.SdkError(core_1.SDK_ERROR_CODES.INTEGRATION_ERROR,null,"Could not determine network state in CordovaLocalStorageService. "+navigator.connection);return navigator.connection.type!==Connection.NONE}isCordova(){return 0===document.URL.indexOf("file://")}}exports.CordovaDeviceStatusService=CordovaDeviceStatusService;
package/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export * from '@partium/js-sdk/user-data';
7
7
  export * from '@partium/js-sdk/ocr';
8
8
  export * from '@partium/js-sdk/management';
9
9
  export * from '@partium/js-sdk/catalog';
10
+ export * from '@partium/js-sdk/datacuration';
10
11
  export { Partium, INITIALIZATION_STATUS } from '@partium/js-sdk';
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=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,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=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}),exports.INITIALIZATION_STATUS=exports.Partium=void 0,__exportStar(require("./core"),exports),__exportStar(require("@partium/js-sdk/core"),exports),__exportStar(require("@partium/js-sdk/find"),exports),__exportStar(require("@partium/js-sdk/data"),exports),__exportStar(require("@partium/js-sdk/user-data"),exports),__exportStar(require("@partium/js-sdk/ocr"),exports),__exportStar(require("@partium/js-sdk/management"),exports),__exportStar(require("@partium/js-sdk/catalog"),exports);var js_sdk_1=require("@partium/js-sdk");Object.defineProperty(exports,"Partium",{enumerable:!0,get:function(){return js_sdk_1.Partium}}),Object.defineProperty(exports,"INITIALIZATION_STATUS",{enumerable:!0,get:function(){return js_sdk_1.INITIALIZATION_STATUS}});
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(e,t);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,o)}:function(r,e,t,i){void 0===i&&(i=t),r[i]=e[t]}),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)"default"===t||Object.prototype.hasOwnProperty.call(e,t)||__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.INITIALIZATION_STATUS=exports.Partium=void 0,__exportStar(require("./core"),exports),__exportStar(require("@partium/js-sdk/core"),exports),__exportStar(require("@partium/js-sdk/find"),exports),__exportStar(require("@partium/js-sdk/data"),exports),__exportStar(require("@partium/js-sdk/user-data"),exports),__exportStar(require("@partium/js-sdk/ocr"),exports),__exportStar(require("@partium/js-sdk/management"),exports),__exportStar(require("@partium/js-sdk/catalog"),exports),__exportStar(require("@partium/js-sdk/datacuration"),exports);var js_sdk_1=require("@partium/js-sdk");Object.defineProperty(exports,"Partium",{enumerable:!0,get:function(){return js_sdk_1.Partium}}),Object.defineProperty(exports,"INITIALIZATION_STATUS",{enumerable:!0,get:function(){return js_sdk_1.INITIALIZATION_STATUS}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/cordova-sdk",
3
- "version": "14.0.2",
3
+ "version": "14.14.1",
4
4
  "description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into Cordova-based applications.",
5
5
  "author": "Partium Inc.",
6
6
  "license": "See LICENSE.txt",
@@ -19,7 +19,7 @@
19
19
  "clean": "npx rimraf -- node_modules package-lock.json && npm i"
20
20
  },
21
21
  "dependencies": {
22
- "@partium/js-sdk": "14.0.2",
22
+ "@partium/js-sdk": "14.14.1",
23
23
  "rxjs": "~7.8.1"
24
24
  },
25
25
  "devDependencies": {