@wildix/xbees-connect 1.3.5 → 1.3.6
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-cjs/index.js +2 -1
- package/dist-cjs/package.json +1 -1
- package/dist-cjs/src/Client.js +5 -0
- package/dist-cjs/src/enums/index.js +8 -1
- package/dist-cjs/src/helpers/ClientParams.js +2 -0
- package/dist-es/index.js +1 -1
- package/dist-es/package.json +1 -1
- package/dist-es/src/Client.js +5 -0
- package/dist-es/src/enums/index.js +7 -0
- package/dist-es/src/helpers/ClientParams.js +2 -0
- package/dist-types/index.d.ts +1 -1
- package/dist-types/src/Client.d.ts +3 -1
- package/dist-types/src/enums/index.d.ts +7 -1
- package/dist-types/src/helpers/ClientParams.d.ts +2 -1
- package/dist-types/types/Client.d.ts +4 -1
- package/package.json +1 -1
package/dist-cjs/index.js
CHANGED
|
@@ -14,13 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.UrlParams = exports.StartPage = exports.ClientEventType = exports.EventType = void 0;
|
|
17
|
+
exports.UrlParams = exports.StartPage = exports.Product = exports.ClientEventType = exports.EventType = void 0;
|
|
18
18
|
const Client_1 = require("./src/Client");
|
|
19
19
|
var enums_1 = require("./src/enums");
|
|
20
20
|
Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return enums_1.EventType; } });
|
|
21
21
|
var enums_2 = require("./src/enums");
|
|
22
22
|
Object.defineProperty(exports, "ClientEventType", { enumerable: true, get: function () { return enums_2.ClientEventType; } });
|
|
23
23
|
var enums_3 = require("./src/enums");
|
|
24
|
+
Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return enums_3.Product; } });
|
|
24
25
|
Object.defineProperty(exports, "StartPage", { enumerable: true, get: function () { return enums_3.StartPage; } });
|
|
25
26
|
Object.defineProperty(exports, "UrlParams", { enumerable: true, get: function () { return enums_3.UrlParams; } });
|
|
26
27
|
__exportStar(require("./types"), exports);
|
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.6",
|
|
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
|
@@ -50,6 +50,7 @@ class Client {
|
|
|
50
50
|
iframeId;
|
|
51
51
|
variant = null;
|
|
52
52
|
startPage = null;
|
|
53
|
+
product = null;
|
|
53
54
|
localStorageManager = LocalStorageManager_1.default.getInstance();
|
|
54
55
|
constructor() {
|
|
55
56
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
@@ -59,6 +60,7 @@ class Client {
|
|
|
59
60
|
this.referrer = params.get(enums_1.UrlParams.REFERRER);
|
|
60
61
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
61
62
|
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
63
|
+
this.product = params.get(enums_1.UrlParams.PRODUCT);
|
|
62
64
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
63
65
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
64
66
|
this.worker = this.isParentReactNativeWebView ? new PostMessageControllerNative_1.default() : new PostMessageControllerWeb_1.default();
|
|
@@ -199,6 +201,9 @@ class Client {
|
|
|
199
201
|
getStartPage() {
|
|
200
202
|
return this.startPage;
|
|
201
203
|
}
|
|
204
|
+
getProduct() {
|
|
205
|
+
return this.product;
|
|
206
|
+
}
|
|
202
207
|
isVisible() {
|
|
203
208
|
return this.visible;
|
|
204
209
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StartPage = exports.UrlParams = exports.ClientEventType = exports.EventType = void 0;
|
|
3
|
+
exports.Product = exports.StartPage = exports.UrlParams = exports.ClientEventType = exports.EventType = void 0;
|
|
4
4
|
var EventType;
|
|
5
5
|
(function (EventType) {
|
|
6
6
|
EventType["GET_CONTACTS_AUTO_SUGGEST"] = "xBeesGetContactsAutoSuggest";
|
|
@@ -67,8 +67,15 @@ var UrlParams;
|
|
|
67
67
|
UrlParams["REFERRER"] = "r";
|
|
68
68
|
UrlParams["AUTHORIZE"] = "a";
|
|
69
69
|
UrlParams["START_PAGE"] = "sp";
|
|
70
|
+
UrlParams["PRODUCT"] = "p";
|
|
70
71
|
})(UrlParams || (exports.UrlParams = UrlParams = {}));
|
|
71
72
|
var StartPage;
|
|
72
73
|
(function (StartPage) {
|
|
73
74
|
StartPage["CREATE_CONTACT"] = "createContact";
|
|
74
75
|
})(StartPage || (exports.StartPage = StartPage = {}));
|
|
76
|
+
var Product;
|
|
77
|
+
(function (Product) {
|
|
78
|
+
Product["XBEES"] = "xbees";
|
|
79
|
+
Product["XHOPPERS"] = "xhoppers";
|
|
80
|
+
Product["COLLABORATION"] = "collaboration";
|
|
81
|
+
})(Product || (exports.Product = Product = {}));
|
|
@@ -18,6 +18,7 @@ class ClientParams {
|
|
|
18
18
|
variant = null;
|
|
19
19
|
userExtension = null;
|
|
20
20
|
startPage = null;
|
|
21
|
+
product = null;
|
|
21
22
|
constructor() {
|
|
22
23
|
const params = (0, getUrlSearchParamsMap_1.getUrlSearchParamsMap)();
|
|
23
24
|
this.iframeId = params.get(enums_1.UrlParams.ID);
|
|
@@ -28,6 +29,7 @@ class ClientParams {
|
|
|
28
29
|
this.referrer = params.get(enums_1.UrlParams.REFERRER);
|
|
29
30
|
this.needAuthorize = params.has(enums_1.UrlParams.AUTHORIZE);
|
|
30
31
|
this.startPage = params.get(enums_1.UrlParams.START_PAGE);
|
|
32
|
+
this.product = params.get(enums_1.UrlParams.PRODUCT);
|
|
31
33
|
}
|
|
32
34
|
toString() {
|
|
33
35
|
const { userToken, ...props } = this;
|
package/dist-es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from './src/Client';
|
|
2
2
|
export { EventType } from './src/enums';
|
|
3
3
|
export { ClientEventType } from './src/enums';
|
|
4
|
-
export { StartPage, UrlParams } from './src/enums';
|
|
4
|
+
export { Product, StartPage, UrlParams } from './src/enums';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export default Client;
|
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.6",
|
|
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
|
@@ -44,6 +44,7 @@ export class Client {
|
|
|
44
44
|
iframeId;
|
|
45
45
|
variant = null;
|
|
46
46
|
startPage = null;
|
|
47
|
+
product = null;
|
|
47
48
|
localStorageManager = LocalStorageManager.getInstance();
|
|
48
49
|
constructor() {
|
|
49
50
|
const params = getUrlSearchParamsMap();
|
|
@@ -53,6 +54,7 @@ export class Client {
|
|
|
53
54
|
this.referrer = params.get(UrlParams.REFERRER);
|
|
54
55
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
55
56
|
this.startPage = params.get(UrlParams.START_PAGE);
|
|
57
|
+
this.product = params.get(UrlParams.PRODUCT);
|
|
56
58
|
// @ts-expect-error window.ReactNativeWebView will be provided by ReactNative WebView
|
|
57
59
|
this.isParentReactNativeWebView = !!window.ReactNativeWebView;
|
|
58
60
|
this.worker = this.isParentReactNativeWebView ? new PostMessageControllerNative() : new PostMessageControllerWeb();
|
|
@@ -193,6 +195,9 @@ export class Client {
|
|
|
193
195
|
getStartPage() {
|
|
194
196
|
return this.startPage;
|
|
195
197
|
}
|
|
198
|
+
getProduct() {
|
|
199
|
+
return this.product;
|
|
200
|
+
}
|
|
196
201
|
isVisible() {
|
|
197
202
|
return this.visible;
|
|
198
203
|
}
|
|
@@ -64,8 +64,15 @@ export var UrlParams;
|
|
|
64
64
|
UrlParams["REFERRER"] = "r";
|
|
65
65
|
UrlParams["AUTHORIZE"] = "a";
|
|
66
66
|
UrlParams["START_PAGE"] = "sp";
|
|
67
|
+
UrlParams["PRODUCT"] = "p";
|
|
67
68
|
})(UrlParams || (UrlParams = {}));
|
|
68
69
|
export var StartPage;
|
|
69
70
|
(function (StartPage) {
|
|
70
71
|
StartPage["CREATE_CONTACT"] = "createContact";
|
|
71
72
|
})(StartPage || (StartPage = {}));
|
|
73
|
+
export var Product;
|
|
74
|
+
(function (Product) {
|
|
75
|
+
Product["XBEES"] = "xbees";
|
|
76
|
+
Product["XHOPPERS"] = "xhoppers";
|
|
77
|
+
Product["COLLABORATION"] = "collaboration";
|
|
78
|
+
})(Product || (Product = {}));
|
|
@@ -16,6 +16,7 @@ export default class ClientParams {
|
|
|
16
16
|
variant = null;
|
|
17
17
|
userExtension = null;
|
|
18
18
|
startPage = null;
|
|
19
|
+
product = null;
|
|
19
20
|
constructor() {
|
|
20
21
|
const params = getUrlSearchParamsMap();
|
|
21
22
|
this.iframeId = params.get(UrlParams.ID);
|
|
@@ -26,6 +27,7 @@ export default class ClientParams {
|
|
|
26
27
|
this.referrer = params.get(UrlParams.REFERRER);
|
|
27
28
|
this.needAuthorize = params.has(UrlParams.AUTHORIZE);
|
|
28
29
|
this.startPage = params.get(UrlParams.START_PAGE);
|
|
30
|
+
this.product = params.get(UrlParams.PRODUCT);
|
|
29
31
|
}
|
|
30
32
|
toString() {
|
|
31
33
|
const { userToken, ...props } = this;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from './src/Client';
|
|
2
2
|
export { EventType } from './src/enums';
|
|
3
3
|
export { ClientEventType } from './src/enums';
|
|
4
|
-
export { StartPage, UrlParams } from './src/enums';
|
|
4
|
+
export { Product, StartPage, UrlParams } from './src/enums';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export default Client;
|
|
@@ -2,7 +2,7 @@ import { Callback, ConnectClient, Contact, ContactQuery, IPayloadViewPort, Looku
|
|
|
2
2
|
import { ReadyExtendedProps } from '../types/Event';
|
|
3
3
|
import { JSONValue } from '../types/Json';
|
|
4
4
|
import { LookupAndMatchBatchContactsResolver } from '../types/Resolver';
|
|
5
|
-
import { ClientEventType, EventType, StartPage } from './enums';
|
|
5
|
+
import { ClientEventType, EventType, Product, StartPage } from './enums';
|
|
6
6
|
import TechnicalSupport from './helpers/TechnicalSupport';
|
|
7
7
|
/**
|
|
8
8
|
* Client provides functionality of communication between xBees and integrated web applications via iFrame or ReactNative WebView
|
|
@@ -27,6 +27,7 @@ export declare class Client implements ConnectClient {
|
|
|
27
27
|
private readonly iframeId;
|
|
28
28
|
private readonly variant;
|
|
29
29
|
private readonly startPage;
|
|
30
|
+
private readonly product;
|
|
30
31
|
private readonly localStorageManager;
|
|
31
32
|
constructor();
|
|
32
33
|
private sendAsync;
|
|
@@ -56,6 +57,7 @@ export declare class Client implements ConnectClient {
|
|
|
56
57
|
getUserExtension(): string | null;
|
|
57
58
|
getReferrer(): string;
|
|
58
59
|
getStartPage(): StartPage | null;
|
|
60
|
+
getProduct(): Product | null;
|
|
59
61
|
isVisible(): boolean;
|
|
60
62
|
getBackToAppUrl(): string;
|
|
61
63
|
isDataOnly(): boolean;
|
|
@@ -60,8 +60,14 @@ export declare enum UrlParams {
|
|
|
60
60
|
EXTENSION = "e",
|
|
61
61
|
REFERRER = "r",
|
|
62
62
|
AUTHORIZE = "a",
|
|
63
|
-
START_PAGE = "sp"
|
|
63
|
+
START_PAGE = "sp",
|
|
64
|
+
PRODUCT = "p"
|
|
64
65
|
}
|
|
65
66
|
export declare enum StartPage {
|
|
66
67
|
CREATE_CONTACT = "createContact"
|
|
67
68
|
}
|
|
69
|
+
export declare enum Product {
|
|
70
|
+
XBEES = "xbees",
|
|
71
|
+
XHOPPERS = "xhoppers",
|
|
72
|
+
COLLABORATION = "collaboration"
|
|
73
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkVariants } from '../../types';
|
|
2
|
-
import { StartPage } from '../enums';
|
|
2
|
+
import { Product, StartPage } from '../enums';
|
|
3
3
|
export default class ClientParams {
|
|
4
4
|
private static instance;
|
|
5
5
|
static getInstance(): ClientParams;
|
|
@@ -11,6 +11,7 @@ export default class ClientParams {
|
|
|
11
11
|
readonly variant: WorkVariants | null;
|
|
12
12
|
readonly userExtension: string | null;
|
|
13
13
|
readonly startPage: StartPage | null;
|
|
14
|
+
readonly product: Product | null;
|
|
14
15
|
constructor();
|
|
15
16
|
toString(): string;
|
|
16
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientEventType, EventType, StartPage } from '../src/enums';
|
|
1
|
+
import { ClientEventType, EventType, Product, StartPage } from '../src/enums';
|
|
2
2
|
import TechnicalSupport from '../src/helpers/TechnicalSupport';
|
|
3
3
|
import { Callback } from './Callback';
|
|
4
4
|
import { Contact, ContactQuery } from './Contact';
|
|
@@ -40,6 +40,9 @@ export interface ConnectClient {
|
|
|
40
40
|
/**
|
|
41
41
|
* Retrieves start page from url */
|
|
42
42
|
getStartPage: () => StartPage | null;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the product type from which the integration is opened */
|
|
45
|
+
getProduct: () => Product | null;
|
|
43
46
|
/**
|
|
44
47
|
* Retrieves the version of xBeesConnect */
|
|
45
48
|
version: () => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
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": "",
|