global-input-message
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -1,3 +0,3 @@ | ||
declare module 'global-input-message' { | ||
export function createMessageConnector(): GlobalInputMessageConnector; | ||
@@ -13,3 +13,3 @@ interface ConnectResult { | ||
class GlobalInputMessageConnector { | ||
declare class GlobalInputMessageConnector { | ||
client: string; | ||
@@ -32,3 +32,3 @@ session: string; | ||
switch(Type): | ||
case 'C': use the static shared encryption key to decrypt. | ||
case 'C': use the static shared encryption key to decrypt. | ||
case 'A': use the dynamic encryption key to decrypt. | ||
@@ -80,2 +80,3 @@ case 'N': the content is not encrypted | ||
dataType?: string; | ||
key?:string; | ||
form: { | ||
@@ -135,3 +136,2 @@ id?: string; | ||
data?: object; | ||
client?: string; | ||
time?: number; | ||
@@ -155,3 +155,1 @@ securityGroup?: string; | ||
export function decrypt(content: string, password: string): string; | ||
} |
{ | ||
"name": "global-input-message", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "global input core js library", | ||
@@ -5,0 +5,0 @@ "main": "./distribution/index.js", |
@@ -1,11 +0,17 @@ | ||
### Global Input Message | ||
This JavaScript module allows you to introduce a mobile interoperability into JavaScript/TypeScript applications on smart devices like smart TVs, set-top boxes, game consoles, and devices in IoT, so that users can use their mobiles to operate on them. It allows you to define mobile interfaces and receive mobile events from within your device applications, while keeping the mobile app as a general and universal mobile app that works across all types of device applications with different business logic: meaning that there is no need to switch to different mobile app for operating on different devices and no need to develop different mobile apps for different business or device applications. It also allows you to enrich your device applications with a set of mobile functionalities like [mobile encryption](https://globalinput.co.uk/global-input-app/mobile-content-encryption), [mobile authentication](https://globalinput.co.uk/global-input-app/mobile-authentication), [mobile input & control](https://globalinput.co.uk/global-input-app/mobile-input-control), [second screen experience](https://globalinput.co.uk/global-input-app/second-screen-experience), [mobile secure storage](https://globalinput.co.uk/global-input-app/mobile-personal-storage), [mobile encryption & signing](https://globalinput.co.uk/global-input-app/mobile-content-encryption), and [mobile content transfer](https://globalinput.co.uk/global-input-app/mobile-content-transfer). The communication between a mobile app and a device application is often established through scanning an Encrypted QR Code that contains a set of communication parameters that includes one-time-use encryption key for starting an end-to-end encryption process. | ||
# Global Input Message | ||
<p align="right"> | ||
<a href="https://github.com/global-input/global-input-message/blob/master/LICENSE"> | ||
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Global Input Message is released under the MIT license." /> | ||
</a> | ||
</p> | ||
This module is particularly useful in the current new normal established by the COVID-19 pandemic, where businesses require visiting customers to communicate accurately with customer representatives while enforcing the rules of wearing masks and social distancing. Thanks to this library, you will be able to establish an instant and secure communication right within the business software you are using, allowing your customers to collaborate effectively, securely and safely. For example, you may provide one-click subscriptions through user mobiles by leveraging the [mobile secure storage](https://globalinput.co.uk/global-input-app/mobile-authentication). Alternative, you do not even have to collect users' personal data thanks to the ability to request data on-demand from the mobile app at the point of service, freeing yourself from the pains of privacy regulations. You may also choose to allow your customers to encrypt their own data using their mobiles, giving users full control over the security and privacy of their personal data. | ||
This JavaScript module allows you to introduce a mobile interoperability into JavaScript/TypeScript applications on smart devices like smart TVs, set-top boxes, game consoles, and devices in IoT, so that users can use their mobiles to operate on them. It allows you to define mobile interfaces and receive mobile events from within your device applications, while keeping the mobile app as a general and universal mobile app that works across all types of device applications with different business logic: meaning that there is no need to switch to different mobile app for operating on different devices and no need to develop different mobile apps for different business or device applications. It also allows you to enrich your device applications with a set of mobile functionalities like one-click login, one-click sign-up, mobile encryption, mobile secure storage to name a few. The communication between a mobile app and a device application is secured using end-to-end encryption process that is often initiated through scanning an encrypted QR Code. | ||
## React Applications | ||
We recommend using [global-input-react](https://github.com/global-input/global-input-react) for React applications. | ||
This module is particularly useful in the current new normal established by the COVID-19 pandemic, where businesses require visiting customers to communicate accurately with customer representatives while enforcing the rules of wearing masks and social distancing. Thanks to this library, you will be able to establish an instant and secure communication right within the business software you are using, allowing your customers to collaborate effectively, securely and safely. For example, you may provide one-click subscriptions through user mobiles by leveraging the mobile secure storage provided by the mobile app. Alternative, you do not even have to collect users' personal data thanks to the ability to request data on-demand from the mobile app at the point of service, freeing yourself from the pains of privacy regulations. You may also choose to allow your customers to encrypt their own data using their mobiles, giving users full control over the security and privacy of their personal data. | ||
## Setup | ||
## ⚛️ React Applications | ||
We recommend using [global-input-react][r] for React applications. | ||
## 🔌 Setup | ||
```shell | ||
@@ -17,4 +23,4 @@ npm install global-input-message | ||
## Usage | ||
## 📚 Usage | ||
```JavaScript | ||
@@ -60,4 +66,4 @@ import { createMessageConnector } from "global-input-message"; | ||
The ```connectionCode``` data returned by ```await connector.connect()``` holds an encrypted string value. When decrypted, it provides information on how to connect to your application, including a one-time-use encryption key for initiating an end-to-end encryption process between your application and a mobile app. The next step is to make the value of ```connectionCode``` available to mobile apps through a QR Code or any other close-range communication technologies like NFC. | ||
The ```connectionCode``` data returned by ```await connector.connect()``` holds an encrypted string value. When decrypted, it provides information on how to connect to your application, including a one-time-use encryption key for initiating an end-to-end encryption process between your application and a mobile app. The next step is to make the value of ```connectionCode``` available to mobile apps through a QR Code or any other close-range communication technologies like NFC. | ||
When connected to your application, the mobile app displays a ```form``` specified in ```initData```. Also, when the user interacts with elements in the ```form```, your application can receive mobile events through respective ```onInput()``` functions, being called with the value that the user has entered. In the above example code, you can implement ```setUsername()``` , ```setPassword()``` and ```login()``` functions to store user entries and calling a authentication mechanism. When your application needs to send send values to the connected mobile app, you can call ```deviceConnector.sendValue()``` function with the first parameter providing the id of the target element and the second parameter providing the value itself: | ||
@@ -72,3 +78,3 @@ ```JavaScript | ||
``` | ||
You can now tie the above two function to the respective input elements being displayed locally on the device: | ||
@@ -79,3 +85,3 @@ | ||
<input type="text" value="" onchange = "sendUsername(this.value)"/> | ||
Password: | ||
@@ -92,6 +98,6 @@ <input type="password" value="" onchange = "sendPassword(this.value)"/> | ||
id:"info", | ||
type: "info", | ||
type: "info", | ||
value: "Test Completed" | ||
}; | ||
const login=(username,password) => { | ||
@@ -117,3 +123,3 @@ deviceConnector.sendInitData( { | ||
The default value of the ```type``` attribute is "text". In this case, it display either a text input or a ```textarea```, depending on the value of ```nLines```, which represents how many number of lines is visible: | ||
The default value of the ```type``` attribute is "text". In this case, it display either a text input or a ```textarea```, depending on the value of ```nLines```, which represents how many number of lines is visible: | ||
@@ -130,4 +136,4 @@ ```JavaScript | ||
If the ```value``` attribute is set, it will be sent along with the form to pre-populate the the field when being displayed on the mobile screen. | ||
## Mobile Encryption | ||
## 🔐 Mobile Encryption | ||
If you set the value of ```type``` of element in a ```form``` to ```"encrypt"```, the connected mobile app encrypts the ```value``` of the element and send back the result to your application: | ||
@@ -156,3 +162,3 @@ | ||
## Customizing Form Elements & Styled Values. | ||
## 🛠 Customizing Form Elements & Styled Values. | ||
@@ -163,3 +169,3 @@ The value attribute in an element can also be an object containing some styling information: | ||
const infoField = { | ||
id: "title", | ||
id: "title", | ||
type: "info", | ||
@@ -207,3 +213,3 @@ value: { | ||
}] | ||
} | ||
} | ||
} | ||
@@ -213,6 +219,6 @@ | ||
Finally, the examples in the [website](https://globalinput.co.uk/), and tests in the [test project](https://github.com/global-input/test-global-input-app-libs) contain more information about various use cases that you can implement in your Typescript/JavaScript applications. | ||
Finally, the examples in the [website](https://globalinput.co.uk/), and tests in the [test project](https://github.com/global-input/test-global-input-app-libs) contain more information about various use cases that you can implement in your Typescript/JavaScript applications. | ||
## On Mobile App Side | ||
## 📲 On Mobile App Side | ||
Although you can use [Global Input App](https://globalinput.co.uk/) to operate on your applications, You can certainly use this module to enable your own mobile app to have the ability to operate on various device applications that are powered with this module, assuming your mobile app is implemented using one of the JavaScript-based frameworks like [React Native](https://reactnative.dev/). | ||
@@ -237,4 +243,50 @@ | ||
mobileConnector.sendValue(initData.form.fields[0].id, username); | ||
} | ||
} | ||
``` | ||
There are two input parameters required for calling ```mobileConnector.sendValue()``` function: the first one identifies the target element that the value is being sent to, while the second parameter holds the value needs to be sent across. | ||
## 👏 How to Contribute | ||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. | ||
Please make sure to update tests as appropriate. | ||
## 🖼 Examples | ||
- [Browser Extension][b] is the source code of the browser extension application ([chrome][chrome], [Firefox Add-on][f]). | ||
- [Content Transfer Example][content-source] is a hello-world application. Its [online demo][content-demo] is available. | ||
- [Game Example][content-source] is a simple mobile control application. Its [online demo][content-demo] is available. | ||
- [Video Player Example][video-demo] shows how to achieve second-screen experience in media player applications. Its [online demo][video-demo] is available. | ||
- [Mobile Encryption Example][encryption-source] shows how to use mobile to encrypt and decrypt data. Its [online demo][encryption-demo] is available. | ||
- [Form Data Transfer Example][form-source] shows shows how to transfer form data between applications and a mobile app. It can be used in sign-in and sign-up operations to achieve one-click sign-up or one-click logins. Its online [online demo][form-demo] is available. | ||
- [Send Message Example][message-source] show you can leverage the mobile secure storage to request data on-demand from the connected mobile app. Its online [online demo][message-demo] is available. | ||
## 📄 License | ||
Global Input Message is MIT licensed, as found in the [LICENSE][l] file. | ||
[l]: https://github.com/global-input/global-input-message/blob/master/LICENSE | ||
[g]: https://github.com/global-input | ||
[b]: https://github.com/global-input/browser-extension | ||
[f]: https://addons.mozilla.org/en-GB/firefox/addon/global-input-app/ | ||
[r]: https://github.com/global-input/global-input-react | ||
[w]: https://globalinput.co.uk/ | ||
[chrome]: https://chrome.google.com/webstore/detail/global-input-app/hcklienddlealndjnakkagefaelhnjkp | ||
[content-source]: https://github.com/global-input/content-transfer-example | ||
[content-demo]: https://globalinput.co.uk/global-input-app/content-transfer | ||
[game-demo]: https://globalinput.co.uk/global-input-app/game-example | ||
[game-source]: https://github.com/global-input/game-control-example. | ||
[video-demo]: https://globalinput.co.uk/global-input-app/video-player | ||
[video-source]: https://github.com/global-input/media-player-control-example | ||
[encryption-demo]: https://globalinput.co.uk/global-input-app/mobile-encryption | ||
[encryption-source]: https://github.com/global-input/mobile-encryption | ||
[form-demo]: https://globalinput.co.uk/global-input-app/form-data-transfer | ||
[form-source]: https://github.com/global-input/transfer-form-data-example | ||
[message-demo]: https://globalinput.co.uk/global-input-app/send-message | ||
[message-source]: https://github.com/global-input/send-message-example |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
281
1583792
1
33028