@wildix/xbees-connect 1.0.6-alpha.10 → 1.0.6-alpha.12
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/dist-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.0.6-alpha.
|
|
3
|
+
"version": "1.0.6-alpha.11",
|
|
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": "",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"module": "./dist-es/index.js",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
|
+
"build": "yarn clean && yarn build:es && yarn build:types",
|
|
14
15
|
"build:es": "tsc -p tsconfig.es.json",
|
|
15
16
|
"build:types": "tsc -p tsconfig.types.json",
|
|
16
17
|
"build:docs": "typedoc",
|
package/dist-es/src/Client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import packageJson from '../package.json';
|
|
2
|
-
import { ClientEventType, EventType, UrlParams } from './enums';
|
|
2
|
+
import { ClientEventType, DeprecatedUrlParams, EventType, UrlParams } from './enums';
|
|
3
3
|
import PostMessageControllerNative from './helpers/PostMessageControllerNative';
|
|
4
4
|
import PostMessageControllerWeb from './helpers/PostMessageControllerWeb';
|
|
5
5
|
/**
|
|
@@ -38,12 +38,12 @@ export class Client {
|
|
|
38
38
|
variant = null;
|
|
39
39
|
constructor() {
|
|
40
40
|
const params = new URLSearchParams(window.location.search);
|
|
41
|
-
this.iframeId = params.get(UrlParams.ID);
|
|
42
|
-
this.variant = params.get(UrlParams.VARIANT);
|
|
43
|
-
this.userEmail = params.get(UrlParams.USER);
|
|
44
|
-
this.userToken = params.get(UrlParams.TOKEN);
|
|
45
|
-
this.referrer = params.get(UrlParams.REFERRER);
|
|
46
|
-
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
41
|
+
this.iframeId = (params.get(UrlParams.ID) ?? params.get(DeprecatedUrlParams.ID));
|
|
42
|
+
this.variant = (params.get(UrlParams.VARIANT) ?? params.get(DeprecatedUrlParams.VARIANT));
|
|
43
|
+
this.userEmail = (params.get(UrlParams.USER) ?? params.get(DeprecatedUrlParams.USER));
|
|
44
|
+
this.userToken = (params.get(UrlParams.TOKEN) ?? params.get(DeprecatedUrlParams.TOKEN));
|
|
45
|
+
this.referrer = (params.get(UrlParams.REFERRER) ?? params.get(DeprecatedUrlParams.REFERRER));
|
|
46
|
+
this.needAuthorize = (params.has(UrlParams.AUTHORIZE) ?? params.has(DeprecatedUrlParams.AUTHORIZE));
|
|
47
47
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
48
48
|
this.worker = window.ReactNativeWebView
|
|
49
49
|
? new PostMessageControllerNative()
|
|
@@ -107,7 +107,7 @@ export class Client {
|
|
|
107
107
|
return this.userEmail;
|
|
108
108
|
}
|
|
109
109
|
isDataOnly() {
|
|
110
|
-
return this.variant === '
|
|
110
|
+
return this.variant === 'no-ui' || this.variant === 'daemon';
|
|
111
111
|
}
|
|
112
112
|
showsUi() {
|
|
113
113
|
return !this.isDataOnly();
|
|
@@ -23,6 +23,15 @@ export var ClientEventType;
|
|
|
23
23
|
ClientEventType["CONTACTS_AUTO_SUGGEST"] = "xBeesContactsAutoSuggest";
|
|
24
24
|
ClientEventType["CONTACT_LOOKUP_AND_MATCH"] = "xBeesContactLookupAndMatch";
|
|
25
25
|
})(ClientEventType || (ClientEventType = {}));
|
|
26
|
+
export var DeprecatedUrlParams;
|
|
27
|
+
(function (DeprecatedUrlParams) {
|
|
28
|
+
DeprecatedUrlParams["TOKEN"] = "token";
|
|
29
|
+
DeprecatedUrlParams["ID"] = "iframeId";
|
|
30
|
+
DeprecatedUrlParams["VARIANT"] = "variant";
|
|
31
|
+
DeprecatedUrlParams["USER"] = "u";
|
|
32
|
+
DeprecatedUrlParams["REFERRER"] = "referrer";
|
|
33
|
+
DeprecatedUrlParams["AUTHORIZE"] = "authorize";
|
|
34
|
+
})(DeprecatedUrlParams || (DeprecatedUrlParams = {}));
|
|
26
35
|
export var UrlParams;
|
|
27
36
|
(function (UrlParams) {
|
|
28
37
|
UrlParams["TOKEN"] = "t";
|
|
@@ -21,6 +21,14 @@ export declare enum ClientEventType {
|
|
|
21
21
|
CONTACTS_AUTO_SUGGEST = "xBeesContactsAutoSuggest",
|
|
22
22
|
CONTACT_LOOKUP_AND_MATCH = "xBeesContactLookupAndMatch"
|
|
23
23
|
}
|
|
24
|
+
export declare enum DeprecatedUrlParams {
|
|
25
|
+
TOKEN = "token",
|
|
26
|
+
ID = "iframeId",
|
|
27
|
+
VARIANT = "variant",
|
|
28
|
+
USER = "u",
|
|
29
|
+
REFERRER = "referrer",
|
|
30
|
+
AUTHORIZE = "authorize"
|
|
31
|
+
}
|
|
24
32
|
export declare enum UrlParams {
|
|
25
33
|
TOKEN = "t",
|
|
26
34
|
ID = "i",
|
|
@@ -90,7 +90,8 @@ export interface Listener<T extends EventType = EventType> {
|
|
|
90
90
|
eventName: T;
|
|
91
91
|
callback: Callback<T>;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
type DeprecatedWorkVariants = 'info-frame' | 'daemon' | 'dialog';
|
|
94
|
+
export type WorkVariants = 'ui' | 'no-ui' | 'd' | DeprecatedWorkVariants;
|
|
94
95
|
export interface PostMessageController {
|
|
95
96
|
sendAsync<T extends MessageType>(data: MessageIFrameResponse<T>): Promise<ResponseMessage<T>>;
|
|
96
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.0.6-alpha.
|
|
3
|
+
"version": "1.0.6-alpha.12",
|
|
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": "",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"module": "./dist-es/index.js",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
|
+
"build": "yarn clean && yarn build:es && yarn build:types",
|
|
14
15
|
"build:es": "tsc -p tsconfig.es.json",
|
|
15
16
|
"build:types": "tsc -p tsconfig.types.json",
|
|
16
17
|
"build:docs": "typedoc",
|
|
@@ -41,5 +42,5 @@
|
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=16"
|
|
43
44
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "a160b6f90ab042e5deb4b77dd845a1d3bf0cfcd2"
|
|
45
46
|
}
|