@wildix/xbees-connect 1.2.19-alpha.0 → 1.2.19-alpha.4
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/package.json +1 -1
- package/dist-cjs/src/Client.js +15 -0
- package/dist-cjs/src/enums/index.js +2 -0
- package/dist-es/package.json +1 -1
- package/dist-es/src/Client.js +15 -0
- package/dist-es/src/enums/index.js +2 -0
- package/dist-types/src/Client.d.ts +2 -0
- package/dist-types/src/enums/index.d.ts +3 -1
- package/dist-types/types/Client.d.ts +6 -0
- package/dist-types/types/Event.d.ts +2 -2
- package/dist-types/types/Payload.d.ts +7 -0
- package/package.json +2 -2
- package/dist-types/tsdoc-metadata.json +0 -11
package/dist-cjs/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19-alpha.3",
|
|
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
|
@@ -374,5 +374,20 @@ class Client {
|
|
|
374
374
|
onVisibilityChange(callback) {
|
|
375
375
|
return this.addEventListener(enums_1.EventType.VISIBILITY, callback);
|
|
376
376
|
}
|
|
377
|
+
sendToXbeesStorage(key, value) {
|
|
378
|
+
void this.sendAsync({
|
|
379
|
+
type: enums_1.ClientEventType.SAVE_TO_STORAGE,
|
|
380
|
+
payload: {
|
|
381
|
+
key,
|
|
382
|
+
value,
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
requestFromXbeesStorage(key) {
|
|
387
|
+
return this.sendAsync({
|
|
388
|
+
type: enums_1.ClientEventType.REQUEST_FROM_STORAGE,
|
|
389
|
+
payload: { key },
|
|
390
|
+
});
|
|
391
|
+
}
|
|
377
392
|
}
|
|
378
393
|
exports.Client = Client;
|
|
@@ -40,6 +40,8 @@ var ClientEventType;
|
|
|
40
40
|
ClientEventType["SEND_ANALYTICS"] = "xBeesSendAnalytics";
|
|
41
41
|
ClientEventType["SEND_TECHNICAL_SUPPORT_INFORMATION"] = "xBeesSendTechInfo";
|
|
42
42
|
ClientEventType["USER"] = "xBeesUser";
|
|
43
|
+
ClientEventType["SAVE_TO_STORAGE"] = "xBeesSaveToStorage";
|
|
44
|
+
ClientEventType["REQUEST_FROM_STORAGE"] = "xBeesRequestFromStorage";
|
|
43
45
|
})(ClientEventType || (exports.ClientEventType = ClientEventType = {}));
|
|
44
46
|
var UrlParams;
|
|
45
47
|
(function (UrlParams) {
|
package/dist-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19-alpha.3",
|
|
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
|
@@ -368,4 +368,19 @@ export class Client {
|
|
|
368
368
|
onVisibilityChange(callback) {
|
|
369
369
|
return this.addEventListener(EventType.VISIBILITY, callback);
|
|
370
370
|
}
|
|
371
|
+
sendToXbeesStorage(key, value) {
|
|
372
|
+
void this.sendAsync({
|
|
373
|
+
type: ClientEventType.SAVE_TO_STORAGE,
|
|
374
|
+
payload: {
|
|
375
|
+
key,
|
|
376
|
+
value,
|
|
377
|
+
},
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
requestFromXbeesStorage(key) {
|
|
381
|
+
return this.sendAsync({
|
|
382
|
+
type: ClientEventType.REQUEST_FROM_STORAGE,
|
|
383
|
+
payload: { key },
|
|
384
|
+
});
|
|
385
|
+
}
|
|
371
386
|
}
|
|
@@ -37,6 +37,8 @@ export var ClientEventType;
|
|
|
37
37
|
ClientEventType["SEND_ANALYTICS"] = "xBeesSendAnalytics";
|
|
38
38
|
ClientEventType["SEND_TECHNICAL_SUPPORT_INFORMATION"] = "xBeesSendTechInfo";
|
|
39
39
|
ClientEventType["USER"] = "xBeesUser";
|
|
40
|
+
ClientEventType["SAVE_TO_STORAGE"] = "xBeesSaveToStorage";
|
|
41
|
+
ClientEventType["REQUEST_FROM_STORAGE"] = "xBeesRequestFromStorage";
|
|
40
42
|
})(ClientEventType || (ClientEventType = {}));
|
|
41
43
|
export var UrlParams;
|
|
42
44
|
(function (UrlParams) {
|
|
@@ -83,4 +83,6 @@ export declare class Client implements ConnectClient {
|
|
|
83
83
|
setIntegrationStorageKey(integrationKey: string): void;
|
|
84
84
|
getTechnicalSupport(): TechnicalSupport;
|
|
85
85
|
onVisibilityChange(callback: Callback<EventType.VISIBILITY>): RemoveEventListener;
|
|
86
|
+
sendToXbeesStorage(key: string, value: string): void;
|
|
87
|
+
requestFromXbeesStorage<Type>(key: string): Promise<ResponseMessage<ClientEventType.REQUEST_FROM_STORAGE>>;
|
|
86
88
|
}
|
|
@@ -34,7 +34,9 @@ export declare enum ClientEventType {
|
|
|
34
34
|
LOGOUT_IS_SUPPORTED = "xBeesLogoutIsSupported",
|
|
35
35
|
SEND_ANALYTICS = "xBeesSendAnalytics",
|
|
36
36
|
SEND_TECHNICAL_SUPPORT_INFORMATION = "xBeesSendTechInfo",
|
|
37
|
-
USER = "xBeesUser"
|
|
37
|
+
USER = "xBeesUser",
|
|
38
|
+
SAVE_TO_STORAGE = "xBeesSaveToStorage",
|
|
39
|
+
REQUEST_FROM_STORAGE = "xBeesRequestFromStorage"
|
|
38
40
|
}
|
|
39
41
|
export declare enum UrlParams {
|
|
40
42
|
TOKEN = "t",
|
|
@@ -168,4 +168,10 @@ export interface ConnectClient {
|
|
|
168
168
|
/**
|
|
169
169
|
* Starts listen for the events of changing iframe activity and handle with the provided callback */
|
|
170
170
|
onVisibilityChange: (callback: Callback<EventType.VISIBILITY>) => RemoveEventListener;
|
|
171
|
+
/**
|
|
172
|
+
* Send data to save in x-bees storage */
|
|
173
|
+
sendToXbeesStorage: (key: string, value: string) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Request stored data from x-bees storage */
|
|
176
|
+
requestFromXbeesStorage: (key: string) => Promise<ResponseMessage<ClientEventType.REQUEST_FROM_STORAGE>>;
|
|
171
177
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ClientEventType, EventType } from '../src/enums';
|
|
2
2
|
import { ContactQuery } from './Contact';
|
|
3
3
|
import { Message, MessageType } from './Message';
|
|
4
|
-
import { IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadSendAnalytics, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
|
|
4
|
+
import { IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadRequestFromStorage, IPayloadSendAnalytics, IPayloadSentToStorage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
|
|
5
5
|
import { SupportedPlatformVariant } from './Platform';
|
|
6
6
|
import { XBeesUser } from './XBeesUser';
|
|
7
|
-
export type EventPayload<T extends MessageType> = T extends EventType.GET_CONTACTS_AUTO_SUGGEST ? string : T extends ClientEventType.CONTACTS_AUTO_SUGGEST ? IPayloadAutoSuggestResult : T extends ClientEventType.CONTACT_LOOKUP_AND_MATCH | ClientEventType.CONTACT_CREATE_OR_UPDATE | ClientEventType.CONTACT_MATCH_UPDATE ? IPayloadContactMatchResult : T extends ClientEventType.CONTACT_LOOKUP_AND_MATCH_NOT_FOUND ? IPayloadContactMatchResultNotFound : T extends ClientEventType.CONTEXT ? IPayloadContextResult : T extends ClientEventType.CURRENT_CONTACT ? IPayloadContactResult : T extends ClientEventType.CURRENT_CONVERSATION ? IPayloadConversationResult : T extends EventType.ADD_CALL ? IPayloadCallStartedInfo : T extends ClientEventType.START_CALL ? IPayloadCallStart : T extends ClientEventType.READY ? IPayloadVersion : T extends ClientEventType.VIEW_PORT ? IPayloadViewPort : T extends ClientEventType.THEME ? IPayloadThemeChange : T extends EventType.USE_THEME ? IPayloadThemeChange : T extends ClientEventType.TOAST ? IPayloadToast : T extends ClientEventType.SEND_ANALYTICS ? IPayloadSendAnalytics : T extends ClientEventType.SEND_TECHNICAL_SUPPORT_INFORMATION ? IPayloadTechSupport : T extends EventType.PBX_TOKEN ? string : T extends ClientEventType.TOKEN ? string : T extends ClientEventType.TO_CLIPBOARD ? string : T extends EventType.GET_LOOK_UP_AND_MATCH ? ContactQuery : T extends EventType.VISIBILITY ? boolean : T extends ClientEventType.USER ? XBeesUser : never;
|
|
7
|
+
export type EventPayload<T extends MessageType> = T extends EventType.GET_CONTACTS_AUTO_SUGGEST ? string : T extends ClientEventType.CONTACTS_AUTO_SUGGEST ? IPayloadAutoSuggestResult : T extends ClientEventType.CONTACT_LOOKUP_AND_MATCH | ClientEventType.CONTACT_CREATE_OR_UPDATE | ClientEventType.CONTACT_MATCH_UPDATE ? IPayloadContactMatchResult : T extends ClientEventType.CONTACT_LOOKUP_AND_MATCH_NOT_FOUND ? IPayloadContactMatchResultNotFound : T extends ClientEventType.CONTEXT ? IPayloadContextResult : T extends ClientEventType.CURRENT_CONTACT ? IPayloadContactResult : T extends ClientEventType.CURRENT_CONVERSATION ? IPayloadConversationResult : T extends EventType.ADD_CALL ? IPayloadCallStartedInfo : T extends ClientEventType.START_CALL ? IPayloadCallStart : T extends ClientEventType.READY ? IPayloadVersion : T extends ClientEventType.VIEW_PORT ? IPayloadViewPort : T extends ClientEventType.THEME ? IPayloadThemeChange : T extends EventType.USE_THEME ? IPayloadThemeChange : T extends ClientEventType.TOAST ? IPayloadToast : T extends ClientEventType.SEND_ANALYTICS ? IPayloadSendAnalytics : T extends ClientEventType.SEND_TECHNICAL_SUPPORT_INFORMATION ? IPayloadTechSupport : T extends EventType.PBX_TOKEN ? string : T extends ClientEventType.TOKEN ? string : T extends ClientEventType.TO_CLIPBOARD ? string : T extends EventType.GET_LOOK_UP_AND_MATCH ? ContactQuery : T extends EventType.VISIBILITY ? boolean : T extends ClientEventType.USER ? XBeesUser : T extends ClientEventType.SAVE_TO_STORAGE ? IPayloadSentToStorage : T extends ClientEventType.REQUEST_FROM_STORAGE ? IPayloadRequestFromStorage : never;
|
|
8
8
|
export type EventPayloadMap = {
|
|
9
9
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
10
10
|
[EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
|
|
@@ -54,6 +54,13 @@ export interface IPayloadSendAnalytics {
|
|
|
54
54
|
eventName: string;
|
|
55
55
|
params?: Record<string, string>;
|
|
56
56
|
}
|
|
57
|
+
export interface IPayloadSentToStorage {
|
|
58
|
+
key: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}
|
|
61
|
+
export interface IPayloadRequestFromStorage {
|
|
62
|
+
key: string;
|
|
63
|
+
}
|
|
57
64
|
export interface IPayloadTechSupport {
|
|
58
65
|
'x-iframe-params': ClientParams;
|
|
59
66
|
message: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.19-alpha.
|
|
3
|
+
"version": "1.2.19-alpha.4",
|
|
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": "",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=16"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "8cf6b4f65f8275bf0649cf1842df6c1f7fec695a"
|
|
47
47
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.47.3"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|