@wildix/xbees-connect 1.2.16-alpha.1 → 1.2.18
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
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
|
@@ -43,7 +43,6 @@ class Client {
|
|
|
43
43
|
visible = false;
|
|
44
44
|
user = null;
|
|
45
45
|
userExtension = null;
|
|
46
|
-
templateId = null;
|
|
47
46
|
userEmail;
|
|
48
47
|
referrer;
|
|
49
48
|
needAuthorize;
|
|
@@ -122,12 +121,7 @@ class Client {
|
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
ready(props = types_1.SupportedPlatformVariant.ALL) {
|
|
125
|
-
const payload = typeof props === 'string'
|
|
126
|
-
? { version: this.version(), platform: props }
|
|
127
|
-
: { version: this.version(), platform: props.platform };
|
|
128
|
-
if (typeof props !== 'string' && props.templateId) {
|
|
129
|
-
this.templateId = props.templateId;
|
|
130
|
-
}
|
|
124
|
+
const payload = typeof props === 'string' ? { version: this.version(), platform: props } : { version: this.version(), ...props };
|
|
131
125
|
this.getXBeesUser();
|
|
132
126
|
return this.sendAsync({
|
|
133
127
|
type: enums_1.ClientEventType.READY,
|
|
@@ -247,9 +241,6 @@ class Client {
|
|
|
247
241
|
this.sendDailyIntegrationUsageAnalytics();
|
|
248
242
|
return this.sendAsync({
|
|
249
243
|
type: enums_1.ClientEventType.AUTHORIZED,
|
|
250
|
-
payload: {
|
|
251
|
-
templateId: this.templateId,
|
|
252
|
-
},
|
|
253
244
|
});
|
|
254
245
|
}
|
|
255
246
|
addEventListener(eventName, callback) {
|
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.18",
|
|
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
|
@@ -37,7 +37,6 @@ export class Client {
|
|
|
37
37
|
visible = false;
|
|
38
38
|
user = null;
|
|
39
39
|
userExtension = null;
|
|
40
|
-
templateId = null;
|
|
41
40
|
userEmail;
|
|
42
41
|
referrer;
|
|
43
42
|
needAuthorize;
|
|
@@ -116,12 +115,7 @@ export class Client {
|
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
117
|
ready(props = SupportedPlatformVariant.ALL) {
|
|
119
|
-
const payload = typeof props === 'string'
|
|
120
|
-
? { version: this.version(), platform: props }
|
|
121
|
-
: { version: this.version(), platform: props.platform };
|
|
122
|
-
if (typeof props !== 'string' && props.templateId) {
|
|
123
|
-
this.templateId = props.templateId;
|
|
124
|
-
}
|
|
118
|
+
const payload = typeof props === 'string' ? { version: this.version(), platform: props } : { version: this.version(), ...props };
|
|
125
119
|
this.getXBeesUser();
|
|
126
120
|
return this.sendAsync({
|
|
127
121
|
type: ClientEventType.READY,
|
|
@@ -241,9 +235,6 @@ export class Client {
|
|
|
241
235
|
this.sendDailyIntegrationUsageAnalytics();
|
|
242
236
|
return this.sendAsync({
|
|
243
237
|
type: ClientEventType.AUTHORIZED,
|
|
244
|
-
payload: {
|
|
245
|
-
templateId: this.templateId,
|
|
246
|
-
},
|
|
247
238
|
});
|
|
248
239
|
}
|
|
249
240
|
addEventListener(eventName, callback) {
|
|
@@ -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 {
|
|
4
|
+
import { IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadSendAnalytics, 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 :
|
|
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;
|
|
8
8
|
export type EventPayloadMap = {
|
|
9
9
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
|
|
10
10
|
[EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
|
|
@@ -11,6 +11,7 @@ export interface IPayloadViewPort {
|
|
|
11
11
|
export interface IPayloadVersion {
|
|
12
12
|
version: string;
|
|
13
13
|
platform?: SupportedPlatformVariant;
|
|
14
|
+
templateId?: string;
|
|
14
15
|
}
|
|
15
16
|
export interface IPayloadToast {
|
|
16
17
|
severity: ToastSeverity;
|
|
@@ -58,6 +59,3 @@ export interface IPayloadTechSupport {
|
|
|
58
59
|
message: string;
|
|
59
60
|
data?: JSONObject | JSONArray;
|
|
60
61
|
}
|
|
61
|
-
export interface IPayloadAuthorizated {
|
|
62
|
-
templateId: string | null;
|
|
63
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
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": "a4bf708627d66756ea6f32286aa290765a7e2ac2"
|
|
47
47
|
}
|