@partium/cordova-sdk 14.0.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/LICENSE.txt +100 -0
- package/README.md +9 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +2 -0
- package/core/services/cordova-device-status.service.d.ts +40 -0
- package/core/services/cordova-device-status.service.js +2 -0
- package/index.d.ts +10 -0
- package/index.js +2 -0
- package/package.json +35 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
|
|
3
|
+
Partium Source Code License, by Partium, Inc. DBA Partium ("Licensor")
|
|
4
|
+
|
|
5
|
+
License. Licensor hereby grants the person ("You" or "Licensee") accessing or
|
|
6
|
+
using the Partium software and associated documentation files to which this
|
|
7
|
+
license is attached (the "Software", being the Partium App or SDK), a limited,
|
|
8
|
+
royalty-free, non-transferable and non-sublicensable right (a) to install and
|
|
9
|
+
use the Software in order to develop, test and prototype Your applications as
|
|
10
|
+
a Partium Integration Project ("Partium Project"), including non-transferable
|
|
11
|
+
rights to use, copy and modify the Software as necessary to integrate the
|
|
12
|
+
Software into the Your own applications and (b) to distribute and sublicense
|
|
13
|
+
the use of the Software, with or without modifications, to Your clients only
|
|
14
|
+
as part of Your applications for a Partium Project. Distribution and/or public
|
|
15
|
+
communication of the Software to Your clients are permitted only if the
|
|
16
|
+
Software is embedded in the Licensee's own applications as part of a Partium
|
|
17
|
+
Project. As an exception to the above license, you may not extract, reproduce
|
|
18
|
+
modify or use except as part of this Software the UAPARSER.JS which is part of
|
|
19
|
+
and/or downloaded and installed as the Software.
|
|
20
|
+
|
|
21
|
+
Licensee undertakings. Licensee agrees that (a) it will not remove any
|
|
22
|
+
proprietary notices on the Software; (b) it will maintain the confidentiality
|
|
23
|
+
of the Software, (c) it will only use the Software as part of a Partium
|
|
24
|
+
Project and shall not distribute the Software in any form or under any
|
|
25
|
+
agreement that allows it to be reused by any application other than Licensee's
|
|
26
|
+
applications in a Partium Project; and (d) it will not use the Software to
|
|
27
|
+
build or form part of any product that competes with the Partium product or
|
|
28
|
+
technologies as described in the associated documentation or at
|
|
29
|
+
https://partium.io.
|
|
30
|
+
|
|
31
|
+
Reservation of rights. Except as expressly licensed hereunder, Licensor and
|
|
32
|
+
its own licensors retain all ownership and intellectual property rights to the
|
|
33
|
+
Software.
|
|
34
|
+
|
|
35
|
+
Disclaimer. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, (A) THE
|
|
36
|
+
SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
37
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF SATISFACTORY QUALITY,
|
|
38
|
+
OR FITNESS FOR A PARTICULAR PURPOSE; AND (B) IN NO EVENT SHALL THE LICENSOR BE
|
|
39
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
40
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
41
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
42
|
+
|
|
43
|
+
Data collection: The Software contains certain features that trigger tracking
|
|
44
|
+
events in the Partium cloud-service. These events are used for understanding
|
|
45
|
+
usage, improve technology, but also to provide to customer statistics (as
|
|
46
|
+
requested by them in product configuration). As delivered by Licensor, the
|
|
47
|
+
Software does not collect any personal data.
|
|
48
|
+
|
|
49
|
+
Export Controls. Export laws and regulations of the United States and any
|
|
50
|
+
other relevant local export laws and regulations apply to the Software. You
|
|
51
|
+
agree that such export control laws govern Your use of the Software (including
|
|
52
|
+
technical data) and any services deliverables provided under this agreement,
|
|
53
|
+
and You agree to comply with all such export laws and regulations (including
|
|
54
|
+
"deemed export" and "deemed re-export" regulations). You agree that no data,
|
|
55
|
+
information, program and/or materials resulting from Software or services (or
|
|
56
|
+
direct products thereof) will be exported, directly or indirectly, in
|
|
57
|
+
violation of these laws, or will be used for any purpose prohibited by these
|
|
58
|
+
laws including, without limitation, nuclear, chemical, or biological weapons
|
|
59
|
+
proliferation, or development of missile technology. Accordingly, You confirm:
|
|
60
|
+
- You will not download, provide, make available or otherwise export or
|
|
61
|
+
re-export the Software, directly or indirectly, to countries prohibited by
|
|
62
|
+
applicable laws and regulations nor to citizens, nationals, or residents of
|
|
63
|
+
those countries.
|
|
64
|
+
- You are not listed on the United States Department of Treasury lists of
|
|
65
|
+
Specially Designated Nationals and Blocked Persons, Specially Designated
|
|
66
|
+
Terrorists, and Specially Designated Narcotic Traffickers, nor are You listed
|
|
67
|
+
on the United States Department of Commerce Table of Denial Orders.
|
|
68
|
+
- You will not download or otherwise export or re-export the Software,
|
|
69
|
+
directly or indirectly, to persons on the above mentioned lists.
|
|
70
|
+
|
|
71
|
+
No support. The Licensor does not provide any support under this license.
|
|
72
|
+
Support may be provided under a separate service agreement with Licensor.
|
|
73
|
+
Updates may be provided at Licensor's discretion.
|
|
74
|
+
|
|
75
|
+
Term and Termination. This license is for the term of Your service agreement
|
|
76
|
+
with Licensor and shall automatically terminate without notice if You fail to
|
|
77
|
+
comply with any of the terms of this license or the service agreement with
|
|
78
|
+
Licensor, in which case You shall promptly stop using and destroy all copies
|
|
79
|
+
of the Software.
|
|
80
|
+
|
|
81
|
+
Third-Party components (including open source). The Software requires the use
|
|
82
|
+
of third-party software (open source or other) that is not provided with the
|
|
83
|
+
Software (as indicated in the Software documentation or listed dependencies).
|
|
84
|
+
Licensor may provide certain notices to Licensee in the Software documentation,
|
|
85
|
+
readmes or notice files in connection with such third-party software.
|
|
86
|
+
Third-party software is licensed to Licensee under the terms of the corresponding
|
|
87
|
+
software license indicated in the documentation or the repository of the listed
|
|
88
|
+
dependencies (provided to Licensee and downloaded with the dependency software
|
|
89
|
+
code). Licensee's rights to use such software are not restricted in any way by
|
|
90
|
+
this license.
|
|
91
|
+
|
|
92
|
+
Applicable Law and Jurisdiction. This Agreement is governed by the substantive
|
|
93
|
+
and procedural laws of Delaware (US), and Licensee and Licensor, agree to
|
|
94
|
+
submit to the exclusive jurisdiction of, and venue in, the courts of Delaware
|
|
95
|
+
in any dispute arising out of or relating to this Agreement.
|
|
96
|
+
|
|
97
|
+
Notices. For any questions concerning this license, or to contact the Licensor
|
|
98
|
+
for any reason, please write to support@partium.io
|
|
99
|
+
|
|
100
|
+
Version 4: 15 July 2024
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Partium Find SDK for Cordova
|
|
2
|
+
|
|
3
|
+
The *Partium Find SDK* enables seamless integration of Partium’s parts and materials search capabilities into Cordova-based applications. It supports multiple search modalities, including text, image, and multi-modal search, and offers advanced features like hierarchy navigation (Bill of Materials) and attribute-based filtering.
|
|
4
|
+
|
|
5
|
+
The Find SDK enables efficient spare part search, retrieval of relevant results, and seamless integration of those results into applications through an intuitive interface. Additional information about material and part search with Partium, along with user interface examples and usage guidelines, is available in the [Partium Help Center](https://www.partium.io/help-center/material-and-part-search).
|
|
6
|
+
|
|
7
|
+
# Installation & Usage
|
|
8
|
+
|
|
9
|
+
For complete installation instructions and code samples, please visit the Partium [Developer Center](https://developer.partium.io/). Access requires credentials; please contact your Partium representative for access. If you don’t yet have a contact, reach out to us via [Partium.io](https://www.partium.io/contact).
|
package/core/index.d.ts
ADDED
package/core/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,i,t){void 0===t&&(t=i);var c=Object.getOwnPropertyDescriptor(r,i);c&&!("get"in c?!r.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(e,t,c)}:function(e,r,i,t){void 0===t&&(t=i),e[t]=r[i]}),__exportStar=this&&this.__exportStar||function(e,r){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||__createBinding(r,e,i)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("@partium/js-sdk/core"),exports);const js_sdk_1=require("@partium/js-sdk"),core_1=require("@partium/js-sdk/core"),cordova_device_status_service_1=require("./services/cordova-device-status.service"),origInit=js_sdk_1.Partium.init;js_sdk_1.Partium.init=function(e){return console.log("Initializing Partium..."),origInit(Object.assign(e,{authenticationConfig:e.authenticationConfig,httpsClientService:e.httpsClientService||core_1.FetchAPIHttpsClientService,fileTransferService:e.fileTransferService||core_1.FetchAPIFileTransferService,localStorageService:e.localStorageService||core_1.WebLocalStorageService,deviceStatusService:e.deviceStatusService||cordova_device_status_service_1.CordovaDeviceStatusService,fileService:e.fileService||core_1.WebFileService}))};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
import { DeviceStatusService, DeviceInfo } from '@partium/js-sdk/core';
|
|
3
|
+
/**
|
|
4
|
+
* Implementation of the DeviceStatusService for Cordova applications.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CordovaDeviceStatusService extends DeviceStatusService {
|
|
7
|
+
/**
|
|
8
|
+
* Returns Promise that resolves with true if connection to a network is available.
|
|
9
|
+
* (Usually the internet, but for intranet-only systems it can also be only intranet)
|
|
10
|
+
*
|
|
11
|
+
* @returns promise that resolves with true or false, depending on network-connection is available or not
|
|
12
|
+
*/
|
|
13
|
+
isConnectionAvailable(): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns Promise that resolves with a DeviceInfo object, containing
|
|
16
|
+
* information about the device and the installation.
|
|
17
|
+
* Used for logging.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise that resolves with DeviceInfo
|
|
20
|
+
*/
|
|
21
|
+
getDeviceInfo(): Promise<DeviceInfo>;
|
|
22
|
+
/**
|
|
23
|
+
* Promisify a function that takes two callbacks for success and error.
|
|
24
|
+
*
|
|
25
|
+
* @returns Resolves with the result as string, if success or '' in error case.
|
|
26
|
+
*/
|
|
27
|
+
private promisify;
|
|
28
|
+
private getConnectivityType;
|
|
29
|
+
/**
|
|
30
|
+
* Returns whether the application is connected to the internet or not.
|
|
31
|
+
*/
|
|
32
|
+
private isConnectionAvailableCordova;
|
|
33
|
+
/**
|
|
34
|
+
* Returns true when the application is currently running on Cordova and
|
|
35
|
+
* not directly in the browser.
|
|
36
|
+
*
|
|
37
|
+
* This works, because when running in Cordova, the url would start with 'file://'.
|
|
38
|
+
*/
|
|
39
|
+
private isCordova;
|
|
40
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
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;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright © 2022-2025 Partium, Inc. DBA Partium
|
|
2
|
+
export * from './core';
|
|
3
|
+
export * from '@partium/js-sdk/core';
|
|
4
|
+
export * from '@partium/js-sdk/find';
|
|
5
|
+
export * from '@partium/js-sdk/data';
|
|
6
|
+
export * from '@partium/js-sdk/user-data';
|
|
7
|
+
export * from '@partium/js-sdk/ocr';
|
|
8
|
+
export * from '@partium/js-sdk/management';
|
|
9
|
+
export * from '@partium/js-sdk/catalog';
|
|
10
|
+
export { Partium, INITIALIZATION_STATUS } from '@partium/js-sdk';
|
package/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
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}});
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@partium/cordova-sdk",
|
|
3
|
+
"version": "14.0.0",
|
|
4
|
+
"description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into Cordova-based applications.",
|
|
5
|
+
"author": "Partium Inc.",
|
|
6
|
+
"license": "See LICENSE.txt",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"partium find sdk",
|
|
9
|
+
"part search",
|
|
10
|
+
"material search",
|
|
11
|
+
"visual search",
|
|
12
|
+
"image search",
|
|
13
|
+
"text search",
|
|
14
|
+
"semantic search",
|
|
15
|
+
"bill of materials search"
|
|
16
|
+
],
|
|
17
|
+
"typings": "index.d.ts",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"clean": "npx rimraf -- node_modules package-lock.json && npm i"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@partium/js-sdk": "14.0.0",
|
|
23
|
+
"rxjs": "~7.8.1"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "~5.5.4"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"cordova": "~12",
|
|
30
|
+
"cordova-plugin-app-version": "~0.1.14",
|
|
31
|
+
"cordova-plugin-device": "~3.0.0",
|
|
32
|
+
"cordova-plugin-network-information": "~3.0.0",
|
|
33
|
+
"rxjs": "~7.8.1"
|
|
34
|
+
}
|
|
35
|
+
}
|