@wildix/xbees-connect 1.3.13 → 1.3.14-alpha.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 CHANGED
@@ -246,6 +246,14 @@ Starts listening for the event fired when a call starts. Returns an unsubscribe
246
246
 
247
247
  Starts listening for the event fired when a call ends. Returns an unsubscribe function.
248
248
 
249
+ #### `onDaemonCallStarted(callback: (info: IPayloadDaemonCallStarted) => void): RemoveEventListener`
250
+
251
+ Starts listening for daemon-specific call start events. This event is independent from `onCallStarted` and carries daemon payload.
252
+
253
+ #### `onDaemonCallFinished(callback: (info: IPayloadDaemonCallFinished) => void): RemoveEventListener`
254
+
255
+ Starts listening for daemon-specific call finish events. This event is independent from `onCallEnded` and carries daemon payload.
256
+
249
257
  ---
250
258
 
251
259
  ### Contacts
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.3.13",
3
+ "version": "1.3.14-alpha.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": "",
@@ -548,5 +548,11 @@ class Client {
548
548
  onCancelRedirectToEntityPage(callback) {
549
549
  return this.addEventListener(enums_1.EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE, callback);
550
550
  }
551
+ onDaemonCallStarted(callback) {
552
+ return this.addEventListener(enums_1.EventType.DAEMON_CALL_SESSION_STARTED, callback);
553
+ }
554
+ onDaemonCallFinished(callback) {
555
+ return this.addEventListener(enums_1.EventType.DAEMON_CALL_SESSION_FINISHED, callback);
556
+ }
551
557
  }
552
558
  exports.Client = Client;
@@ -8,6 +8,8 @@ var EventType;
8
8
  EventType["GET_LOOK_UP_AND_MATCH_BATCH"] = "xBeesGetLookUpAndMatchBatch";
9
9
  EventType["ADD_CALL"] = "xBeesAddCall";
10
10
  EventType["TERMINATE_CALL"] = "xBeesTerminateCall";
11
+ EventType["DAEMON_CALL_SESSION_STARTED"] = "xBeesDaemonCallSessionStarted";
12
+ EventType["DAEMON_CALL_SESSION_FINISHED"] = "xBeesDaemonCallSessionFinished";
11
13
  EventType["USE_THEME"] = "xBeesUseTheme";
12
14
  EventType["PBX_TOKEN"] = "xBeesPbxToken";
13
15
  EventType["REDIRECT_QUERY"] = "xBeesRedirectQuery";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.3.13",
3
+ "version": "1.3.14-alpha.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": "",
@@ -542,4 +542,10 @@ export class Client {
542
542
  onCancelRedirectToEntityPage(callback) {
543
543
  return this.addEventListener(EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE, callback);
544
544
  }
545
+ onDaemonCallStarted(callback) {
546
+ return this.addEventListener(EventType.DAEMON_CALL_SESSION_STARTED, callback);
547
+ }
548
+ onDaemonCallFinished(callback) {
549
+ return this.addEventListener(EventType.DAEMON_CALL_SESSION_FINISHED, callback);
550
+ }
545
551
  }
@@ -5,6 +5,8 @@ export var EventType;
5
5
  EventType["GET_LOOK_UP_AND_MATCH_BATCH"] = "xBeesGetLookUpAndMatchBatch";
6
6
  EventType["ADD_CALL"] = "xBeesAddCall";
7
7
  EventType["TERMINATE_CALL"] = "xBeesTerminateCall";
8
+ EventType["DAEMON_CALL_SESSION_STARTED"] = "xBeesDaemonCallSessionStarted";
9
+ EventType["DAEMON_CALL_SESSION_FINISHED"] = "xBeesDaemonCallSessionFinished";
8
10
  EventType["USE_THEME"] = "xBeesUseTheme";
9
11
  EventType["PBX_TOKEN"] = "xBeesPbxToken";
10
12
  EventType["REDIRECT_QUERY"] = "xBeesRedirectQuery";
@@ -119,4 +119,6 @@ export declare class Client implements ConnectClient {
119
119
  onContactRefresh(callback: Callback<EventType.CONTACT_REFRESH>): RemoveEventListener;
120
120
  onStartRedirectToEntityPage(callback: Callback<EventType.START_REDIRECT_TO_ENTITY_PAGE>): RemoveEventListener;
121
121
  onCancelRedirectToEntityPage(callback: Callback<EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE>): RemoveEventListener;
122
+ onDaemonCallStarted(callback: Callback<EventType.DAEMON_CALL_SESSION_STARTED>): RemoveEventListener;
123
+ onDaemonCallFinished(callback: Callback<EventType.DAEMON_CALL_SESSION_FINISHED>): RemoveEventListener;
122
124
  }
@@ -4,6 +4,8 @@ export declare enum EventType {
4
4
  GET_LOOK_UP_AND_MATCH_BATCH = "xBeesGetLookUpAndMatchBatch",
5
5
  ADD_CALL = "xBeesAddCall",
6
6
  TERMINATE_CALL = "xBeesTerminateCall",
7
+ DAEMON_CALL_SESSION_STARTED = "xBeesDaemonCallSessionStarted",
8
+ DAEMON_CALL_SESSION_FINISHED = "xBeesDaemonCallSessionFinished",
7
9
  USE_THEME = "xBeesUseTheme",
8
10
  PBX_TOKEN = "xBeesPbxToken",
9
11
  REDIRECT_QUERY = "xBeesRedirectQuery",
@@ -167,6 +167,12 @@ export interface ConnectClient {
167
167
  /**
168
168
  * Starts listen for the events of ending the call and handle with the provided callback */
169
169
  onCallEnded: (callback: Callback<EventType.TERMINATE_CALL>) => RemoveEventListener;
170
+ /**
171
+ * Starts listening for daemon event when a call is started with daemon-specific payload */
172
+ onDaemonCallStarted: (callback: Callback<EventType.DAEMON_CALL_SESSION_STARTED>) => RemoveEventListener;
173
+ /**
174
+ * Starts listening for daemon event when a call is finished with daemon-specific payload */
175
+ onDaemonCallFinished: (callback: Callback<EventType.DAEMON_CALL_SESSION_FINISHED>) => RemoveEventListener;
170
176
  /**
171
177
  * Starts listen for redirect query message which fires when user opens app with deeplink to integration */
172
178
  onRedirectQuery: (callback: Callback<EventType.REDIRECT_QUERY>) => RemoveEventListener;
@@ -2,15 +2,17 @@ import { ClientEventType, EventType } from '../src/enums';
2
2
  import { AvailableContactData } from './AvailableContactData';
3
3
  import { ContactQuery } from './Contact';
4
4
  import { Message, MessageType } from './Message';
5
- import { IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContactWeightUpdate, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent, IPayloadDropdownVisibility, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
5
+ import { IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContactWeightUpdate, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadDropdownVisibility, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
6
6
  import { SupportedPlatformVariant } from './Platform';
7
7
  import { XBeesUser } from './XBeesUser';
8
- 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.LOOKUP_AND_MATCH_BATCH_ERROR ? IPayloadBatchContactsMatchResultError : 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.GET_LOOK_UP_AND_MATCH_BATCH ? ContactQuery[] : T extends EventType.VISIBILITY ? boolean : T extends ClientEventType.USER ? XBeesUser : T extends ClientEventType.SAVE_TO_STORAGE ? IPayloadSaveToStorage : T extends ClientEventType.GET_FROM_STORAGE ? IPayloadGetFromStorage : T extends ClientEventType.REMOVE_FROM_STORAGE ? IPayloadGetFromStorage : T extends ClientEventType.AVAILABLE_CONTACT_DATA ? AvailableContactData | null : T extends ClientEventType.LOOK_UP_AND_MATCH_BATCH_CONTACTS ? IPayloadBatchContactsMatchResult : T extends ClientEventType.DROPDOWN_VISIBILITY ? IPayloadDropdownVisibility : T extends ClientEventType.CUSTOM_EVENT ? IPayloadCustomEvent : T extends EventType.START_REDIRECT_TO_ENTITY_PAGE ? IPayloadStartRedirectToEntityPage : T extends EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE ? IPayloadCancelRedirectToEntityPage : T extends EventType.GET_INTEGRATION_PROXY_REQUEST ? IntegrationProxyRequest : T extends ClientEventType.INTEGRATION_PROXY_RESPONSE ? IntegrationProxyResponse : T extends ClientEventType.INTEGRATION_PROXY_REQUEST_IS_SUPPORTED ? undefined : never;
8
+ 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.LOOKUP_AND_MATCH_BATCH_ERROR ? IPayloadBatchContactsMatchResultError : 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.GET_LOOK_UP_AND_MATCH_BATCH ? ContactQuery[] : T extends EventType.VISIBILITY ? boolean : T extends ClientEventType.USER ? XBeesUser : T extends ClientEventType.SAVE_TO_STORAGE ? IPayloadSaveToStorage : T extends ClientEventType.GET_FROM_STORAGE ? IPayloadGetFromStorage : T extends ClientEventType.REMOVE_FROM_STORAGE ? IPayloadGetFromStorage : T extends ClientEventType.AVAILABLE_CONTACT_DATA ? AvailableContactData | null : T extends ClientEventType.LOOK_UP_AND_MATCH_BATCH_CONTACTS ? IPayloadBatchContactsMatchResult : T extends ClientEventType.DROPDOWN_VISIBILITY ? IPayloadDropdownVisibility : T extends ClientEventType.CUSTOM_EVENT ? IPayloadCustomEvent : T extends EventType.START_REDIRECT_TO_ENTITY_PAGE ? IPayloadStartRedirectToEntityPage : T extends EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE ? IPayloadCancelRedirectToEntityPage : T extends EventType.GET_INTEGRATION_PROXY_REQUEST ? IntegrationProxyRequest : T extends ClientEventType.INTEGRATION_PROXY_RESPONSE ? IntegrationProxyResponse : T extends ClientEventType.INTEGRATION_PROXY_REQUEST_IS_SUPPORTED ? undefined : T extends EventType.DAEMON_CALL_SESSION_STARTED ? IPayloadDaemonCallStarted : T extends EventType.DAEMON_CALL_SESSION_FINISHED ? IPayloadDaemonCallFinished : never;
9
9
  export type EventPayloadMap = {
10
10
  [EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
11
11
  [EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
12
12
  [EventType.GET_LOOK_UP_AND_MATCH_BATCH]: ContactQuery[];
13
13
  [EventType.ADD_CALL]: IPayloadCallStartedInfo;
14
+ [EventType.DAEMON_CALL_SESSION_STARTED]: IPayloadDaemonCallStarted;
15
+ [EventType.DAEMON_CALL_SESSION_FINISHED]: IPayloadDaemonCallFinished;
14
16
  [EventType.USE_THEME]: IPayloadThemeChange;
15
17
  [EventType.PBX_TOKEN]: string;
16
18
  [EventType.VISIBILITY]: boolean;
@@ -26,6 +28,8 @@ export type EventCallbackMap = {
26
28
  [EventType.GET_LOOK_UP_AND_MATCH]: (query: EventPayloadMap[EventType.GET_LOOK_UP_AND_MATCH]) => void;
27
29
  [EventType.GET_LOOK_UP_AND_MATCH_BATCH]: (queries: EventPayloadMap[EventType.GET_LOOK_UP_AND_MATCH_BATCH]) => void;
28
30
  [EventType.ADD_CALL]: (callStartInfo: EventPayloadMap[EventType.ADD_CALL]) => void;
31
+ [EventType.DAEMON_CALL_SESSION_STARTED]: (callStartedInfo: EventPayloadMap[EventType.DAEMON_CALL_SESSION_STARTED]) => void;
32
+ [EventType.DAEMON_CALL_SESSION_FINISHED]: (callFinishedInfo: EventPayloadMap[EventType.DAEMON_CALL_SESSION_FINISHED]) => void;
29
33
  [EventType.USE_THEME]: (theme: EventPayloadMap[EventType.USE_THEME]) => void;
30
34
  [EventType.PBX_TOKEN]: (token: EventPayloadMap[EventType.PBX_TOKEN]) => void;
31
35
  [EventType.VISIBILITY]: (isActive: EventPayloadMap[EventType.VISIBILITY]) => void;
@@ -30,6 +30,16 @@ export interface IPayloadCallStartedInfo {
30
30
  destination: string;
31
31
  video: boolean;
32
32
  }
33
+ export interface IPayloadDaemonCallStarted {
34
+ callId?: string;
35
+ conversationId?: string;
36
+ [key: string]: unknown;
37
+ }
38
+ export interface IPayloadDaemonCallFinished {
39
+ callId?: string;
40
+ conversationId?: string;
41
+ [key: string]: unknown;
42
+ }
33
43
  export interface IPayloadCallStart {
34
44
  phoneNumber: string;
35
45
  }
@@ -7,7 +7,7 @@ export type { JSONArray, JSONObject } from './Json';
7
7
  export type { Listener, RemoveEventListener } from './Listener';
8
8
  export type { Message, MessageIFrameResponse, MessageType, ResponseMessage } from './Message';
9
9
  export type { MessageSender } from './MessageSender';
10
- export type { IntegrationProxyErrorCode, IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadSendAnalytics, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort, } from './Payload';
10
+ export type { IntegrationProxyErrorCode, IntegrationProxyRequest, IntegrationProxyResponse, IPayloadAutoSuggestResult, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadCancelRedirectToEntityPage, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadSendAnalytics, IPayloadStartRedirectToEntityPage, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort, } from './Payload';
11
11
  export { SupportedPlatformVariant } from './Platform';
12
12
  export type { IntegrationProxyRequestResolver, LookupAndMatchBatchContactsResolver, LookupAndMatchContactsResolver, Reject, SuggestContactsResolver, } from './Resolver';
13
13
  export type { StorageEventCallback } from './Storage';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.3.13",
3
+ "version": "1.3.14-alpha.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": "",