@wildix/xbees-connect 1.3.15 → 1.3.16-beta.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/README.md +4 -0
- package/dist-cjs/package.json +1 -1
- package/dist-cjs/src/Client.js +5 -0
- package/dist-cjs/src/enums/index.js +1 -0
- package/dist-cjs/src/helpers/ClientParams.js +2 -0
- package/dist-es/package.json +1 -1
- package/dist-es/src/Client.js +5 -0
- package/dist-es/src/enums/index.js +1 -0
- package/dist-es/src/helpers/ClientParams.js +2 -0
- package/dist-types/src/Client.d.ts +2 -0
- package/dist-types/src/enums/index.d.ts +2 -1
- package/dist-types/src/helpers/ClientParams.d.ts +1 -0
- package/dist-types/types/Client.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,6 +182,10 @@ Returns `true` when the integration is launched in fullsize mode (`f`).
|
|
|
182
182
|
|
|
183
183
|
Returns `true` when the integration is opened for activation/authorization purposes only (URL contains the `authorize` parameter).
|
|
184
184
|
|
|
185
|
+
#### `isCloudBackendEnabled(): boolean`
|
|
186
|
+
|
|
187
|
+
Returns `true` when cloud backend is enabled for this integration. Reads the `cbi` URL parameter at construction time (`cbi=1` → `true`, `cbi=0` or missing → `false`).
|
|
188
|
+
|
|
185
189
|
---
|
|
186
190
|
|
|
187
191
|
### Context
|
package/dist-cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16-beta.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": "",
|
package/dist-cjs/src/Client.js
CHANGED
|
@@ -52,6 +52,7 @@ class Client {
|
|
|
52
52
|
variant = null;
|
|
53
53
|
startPage = null;
|
|
54
54
|
product = null;
|
|
55
|
+
cloudBackendEnabled;
|
|
55
56
|
localStorageManager = LocalStorageManager_1.default.getInstance();
|
|
56
57
|
constructor() {
|
|
57
58
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
@@ -62,6 +63,7 @@ class Client {
|
|
|
62
63
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
63
64
|
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
64
65
|
this.product = params.get(enums_1.UrlParams.PRODUCT);
|
|
66
|
+
this.cloudBackendEnabled = params.get(enums_1.UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
65
67
|
this.integrationId = params.get(enums_1.UrlParams.ID)?.split('-')[0] ?? '';
|
|
66
68
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
67
69
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
@@ -239,6 +241,9 @@ class Client {
|
|
|
239
241
|
isActivationOnly() {
|
|
240
242
|
return this.needAuthorize;
|
|
241
243
|
}
|
|
244
|
+
isCloudBackendEnabled() {
|
|
245
|
+
return this.cloudBackendEnabled;
|
|
246
|
+
}
|
|
242
247
|
getContext() {
|
|
243
248
|
return this.sendAsync({ type: enums_1.ClientEventType.CONTEXT });
|
|
244
249
|
}
|
|
@@ -74,6 +74,7 @@ var UrlParams;
|
|
|
74
74
|
UrlParams["AUTHORIZE"] = "a";
|
|
75
75
|
UrlParams["START_PAGE"] = "sp";
|
|
76
76
|
UrlParams["PRODUCT"] = "p";
|
|
77
|
+
UrlParams["CLOUD_BACKEND_ENABLED"] = "cbi";
|
|
77
78
|
})(UrlParams || (exports.UrlParams = UrlParams = {}));
|
|
78
79
|
var StartPage;
|
|
79
80
|
(function (StartPage) {
|
|
@@ -19,6 +19,7 @@ class ClientParams {
|
|
|
19
19
|
userExtension = null;
|
|
20
20
|
startPage = null;
|
|
21
21
|
product = null;
|
|
22
|
+
cloudBackendEnabled;
|
|
22
23
|
constructor() {
|
|
23
24
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
24
25
|
this.iframeId = params.get(enums_1.UrlParams.ID);
|
|
@@ -30,6 +31,7 @@ class ClientParams {
|
|
|
30
31
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
31
32
|
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
32
33
|
this.product = params.get(enums_1.UrlParams.PRODUCT);
|
|
34
|
+
this.cloudBackendEnabled = params.get(enums_1.UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
33
35
|
}
|
|
34
36
|
toString() {
|
|
35
37
|
const { userToken, ...props } = this;
|
package/dist-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16-beta.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": "",
|
package/dist-es/src/Client.js
CHANGED
|
@@ -46,6 +46,7 @@ export class Client {
|
|
|
46
46
|
variant = null;
|
|
47
47
|
startPage = null;
|
|
48
48
|
product = null;
|
|
49
|
+
cloudBackendEnabled;
|
|
49
50
|
localStorageManager = LocalStorageManager.getInstance();
|
|
50
51
|
constructor() {
|
|
51
52
|
const params = getUrlSearchParamsMap();
|
|
@@ -56,6 +57,7 @@ export class Client {
|
|
|
56
57
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
57
58
|
this.startPage = params.get(UrlParams.START_PAGE);
|
|
58
59
|
this.product = params.get(UrlParams.PRODUCT);
|
|
60
|
+
this.cloudBackendEnabled = params.get(UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
59
61
|
this.integrationId = params.get(UrlParams.ID)?.split('-')[0] ?? '';
|
|
60
62
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
61
63
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
@@ -233,6 +235,9 @@ export class Client {
|
|
|
233
235
|
isActivationOnly() {
|
|
234
236
|
return this.needAuthorize;
|
|
235
237
|
}
|
|
238
|
+
isCloudBackendEnabled() {
|
|
239
|
+
return this.cloudBackendEnabled;
|
|
240
|
+
}
|
|
236
241
|
getContext() {
|
|
237
242
|
return this.sendAsync({ type: ClientEventType.CONTEXT });
|
|
238
243
|
}
|
|
@@ -17,6 +17,7 @@ export default class ClientParams {
|
|
|
17
17
|
userExtension = null;
|
|
18
18
|
startPage = null;
|
|
19
19
|
product = null;
|
|
20
|
+
cloudBackendEnabled;
|
|
20
21
|
constructor() {
|
|
21
22
|
const params = getUrlSearchParamsMap();
|
|
22
23
|
this.iframeId = params.get(UrlParams.ID);
|
|
@@ -28,6 +29,7 @@ export default class ClientParams {
|
|
|
28
29
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
29
30
|
this.startPage = params.get(UrlParams.START_PAGE);
|
|
30
31
|
this.product = params.get(UrlParams.PRODUCT);
|
|
32
|
+
this.cloudBackendEnabled = params.get(UrlParams.CLOUD_BACKEND_ENABLED) === '1';
|
|
31
33
|
}
|
|
32
34
|
toString() {
|
|
33
35
|
const { userToken, ...props } = this;
|
|
@@ -29,6 +29,7 @@ export declare class Client implements ConnectClient {
|
|
|
29
29
|
private readonly variant;
|
|
30
30
|
private readonly startPage;
|
|
31
31
|
private readonly product;
|
|
32
|
+
private readonly cloudBackendEnabled;
|
|
32
33
|
private readonly localStorageManager;
|
|
33
34
|
constructor();
|
|
34
35
|
private sendAsync;
|
|
@@ -66,6 +67,7 @@ export declare class Client implements ConnectClient {
|
|
|
66
67
|
showsUi(): boolean;
|
|
67
68
|
isFullsize(): boolean;
|
|
68
69
|
isActivationOnly(): boolean;
|
|
70
|
+
isCloudBackendEnabled(): boolean;
|
|
69
71
|
getContext(): Promise<Message<ClientEventType.CONTEXT>>;
|
|
70
72
|
getCurrentContact(): Promise<Message<ClientEventType.CURRENT_CONTACT>>;
|
|
71
73
|
getCurrentConversation(): Promise<Message<ClientEventType.CURRENT_CONVERSATION>>;
|
|
@@ -79,6 +79,9 @@ export interface ConnectClient {
|
|
|
79
79
|
* dialog which leads to integration be activated
|
|
80
80
|
* */
|
|
81
81
|
isActivationOnly: () => boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Determines whether cloud backend is enabled for this integration (URL parameter `cbi=1`). */
|
|
84
|
+
isCloudBackendEnabled: () => boolean;
|
|
82
85
|
/**
|
|
83
86
|
* Retrieves current x-bees context data */
|
|
84
87
|
getContext: () => Promise<ResponseMessage<ClientEventType.CONTEXT>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16-beta.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": "",
|