@wildix/xbees-connect 1.0.4-alpha.0 → 1.0.4-alpha.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.
- package/LICENSE +21 -0
- package/README.md +34 -4
- package/dist-types/src/Client.d.ts +2 -2
- package/dist-types/src/types.d.ts +2 -3
- package/package.json +5 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Wildix Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,11 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# xbees connect client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package is the Community plan edition of the client for UI integration applications.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the package in your project directory with:
|
|
8
|
+
|
|
9
|
+
yarn
|
|
10
|
+
```bash
|
|
11
|
+
yarn add @wildix/xbees-connect
|
|
12
|
+
```
|
|
13
|
+
npm
|
|
14
|
+
```bash
|
|
15
|
+
npm install @wildix/xbees-connect
|
|
16
|
+
```
|
|
5
17
|
## Usage
|
|
18
|
+
```
|
|
19
|
+
import Client from "@wildix/xbees-connect";
|
|
20
|
+
|
|
21
|
+
const xBeesClient = Client.getInstance();
|
|
22
|
+
console.log(xBeesClient.version());
|
|
6
23
|
|
|
7
24
|
```
|
|
8
|
-
const xbeesConnect = require('xbees-connect');
|
|
9
25
|
|
|
10
|
-
|
|
26
|
+
This component has the following peer dependencies that you will need to install as well.
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@mui/material": "^5.4.1",
|
|
32
|
+
"@mui/system": "^5.4.1",
|
|
33
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
34
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
11
37
|
```
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
Visit [https://mui.com/x/react-data-grid/](https://mui.com/x/react-data-grid/) to view the full documentation.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AutoSuggestResult, Callback,
|
|
1
|
+
import { AutoSuggestResult, Callback, ConnectClient, EventType, Reject, RemoveEventListener, Resolve, Response } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Client provides functionality of communication between xBees and integrated web applications via iFrame or ReactNative WebView
|
|
4
4
|
* integration creates na instance with new Client()
|
|
5
5
|
* */
|
|
6
|
-
export declare class Client implements
|
|
6
|
+
export declare class Client implements ConnectClient {
|
|
7
7
|
private static instance;
|
|
8
8
|
static getInstance(): Client;
|
|
9
9
|
private worker;
|
|
@@ -55,7 +55,6 @@ export type ThemeChangePayload = {
|
|
|
55
55
|
palette?: unknown;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
|
-
export type ThemeChangeListenerCallback = (payload: ThemeChangePayload | unknown) => void;
|
|
59
58
|
export type ListenerCallback = (payload: unknown) => void;
|
|
60
59
|
export type DefaultCallback = (...args: unknown[]) => void;
|
|
61
60
|
type CallStartInfo = {
|
|
@@ -66,7 +65,7 @@ type EventPayload<T extends EventType> = T extends EventType.GET_CONTACTS_AUTO_S
|
|
|
66
65
|
export type EventPayloadMap = {
|
|
67
66
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
68
67
|
[EventType.ADD_CALL]: CallStartInfo;
|
|
69
|
-
[EventType.USE_THEME]: string;
|
|
68
|
+
[EventType.USE_THEME]: string | ThemeChangePayload;
|
|
70
69
|
[EventType.PBX_TOKEN]: string;
|
|
71
70
|
};
|
|
72
71
|
export type EventCallbackMap = {
|
|
@@ -105,7 +104,7 @@ export type Resolve = (contacts: Contact[]) => void;
|
|
|
105
104
|
export type Reject = (reason: string) => void;
|
|
106
105
|
export type Callback<T extends EventType = EventType> = T extends keyof EventCallbackMap ? EventCallbackMap[T] : DefaultCallback;
|
|
107
106
|
export type RemoveEventListener = () => void;
|
|
108
|
-
export interface
|
|
107
|
+
export interface ConnectClient {
|
|
109
108
|
/**
|
|
110
109
|
* Sends to x-bees signal that iFrame is ready to be shown. iFrame should send it when the application starts and ready */
|
|
111
110
|
ready: () => Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.0.4-alpha.
|
|
3
|
+
"version": "1.0.4-alpha.1",
|
|
4
4
|
"description": "This library provides easy communication between x-bees and integrated web applications",
|
|
5
5
|
"author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
|
|
6
6
|
"homepage": "",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"main": "./dist-cjs/index.js",
|
|
9
10
|
"types": "./dist-types/index.d.ts",
|
|
@@ -25,14 +26,9 @@
|
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
27
28
|
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"typescript": "^5.2.2"
|
|
33
|
-
},
|
|
34
29
|
"devDependencies": {
|
|
35
|
-
"rimraf": "^5.0.5"
|
|
30
|
+
"rimraf": "^5.0.5",
|
|
31
|
+
"typescript": "^5.2.2"
|
|
36
32
|
},
|
|
37
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "b64d0bff60d65c22da252f2656c35d96507f4c16"
|
|
38
34
|
}
|