@wildix/xbees-connect 1.3.17 → 1.3.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/README.md +38 -1
- package/dist-cjs/package.json +2 -2
- package/dist-cjs/src/Client.js +14 -0
- package/dist-cjs/src/enums/index.js +3 -0
- package/dist-es/package.json +2 -2
- package/dist-es/src/Client.js +14 -0
- package/dist-es/src/enums/index.js +3 -0
- package/dist-types/src/Client.d.ts +9 -0
- package/dist-types/src/enums/index.d.ts +6 -3
- package/dist-types/types/Client.d.ts +12 -0
- package/dist-types/types/Event.d.ts +4 -2
- package/dist-types/types/Payload.d.ts +8 -0
- package/dist-types/types/index.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ This package is the Community plan edition of the client for UI integration appl
|
|
|
7
7
|
Install the package in your project directory with:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
pnpm add @wildix/xbees-connect
|
|
11
11
|
```
|
|
12
12
|
```bash
|
|
13
13
|
npm install @wildix/xbees-connect
|
|
@@ -530,6 +530,43 @@ const { payload } = await client.getChannelsByEmailOrPhone({ value: 'user@exampl
|
|
|
530
530
|
|
|
531
531
|
---
|
|
532
532
|
|
|
533
|
+
### Route synchronization
|
|
534
|
+
|
|
535
|
+
#### `sendRouteChange(route: string, options?: { replace?: boolean }): void`
|
|
536
|
+
|
|
537
|
+
Sends a local route change to the connected parent or iframe. Pass the route as a full app-relative string, including path, search, and hash when needed, for example `/contacts/123?tab=info#notes`.
|
|
538
|
+
|
|
539
|
+
Pass `{ replace: true }` to ask the host to update the current browser history entry instead of pushing a new one. Omit `replace` (or set it to `false`) to keep the default push behavior. Use `replace` for load-time sync and intermediate/tab transitions that should not appear in back/forward history.
|
|
540
|
+
|
|
541
|
+
```ts
|
|
542
|
+
client.sendRouteChange('/contacts/123');
|
|
543
|
+
client.sendRouteChange('/contacts/123?tab=info', {replace: true});
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
#### `onExternalRouteChange(callback: Callback<EventType.EXTERNAL_ROUTE_CHANGE>): RemoveEventListener`
|
|
547
|
+
|
|
548
|
+
Starts listening for route changes from the connected parent or iframe. Returns an unsubscribe function. The callback receives `IPayloadRouteChange` (`{ route, replace? }`).
|
|
549
|
+
|
|
550
|
+
Use the same pair on both sides of the bridge:
|
|
551
|
+
|
|
552
|
+
```ts
|
|
553
|
+
// Parent route changed.
|
|
554
|
+
parentClient.sendRouteChange('/contacts/123?tab=info');
|
|
555
|
+
iframeClient.onExternalRouteChange(({route, replace}) => {
|
|
556
|
+
syncIframeRouter(route, {replace});
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
// Iframe route changed.
|
|
560
|
+
iframeClient.sendRouteChange('/contacts/456');
|
|
561
|
+
parentClient.onExternalRouteChange(({route, replace}) => {
|
|
562
|
+
syncParentRouter(route, {replace});
|
|
563
|
+
});
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
When handling a route received through `onExternalRouteChange`, avoid sending the same value back with `sendRouteChange`. Compare it with the current local route before applying it to prevent synchronization loops.
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
533
570
|
### Technical support
|
|
534
571
|
|
|
535
572
|
#### `getTechnicalSupport(): TechnicalSupport`
|
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.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": "",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "./dist-types/index.d.ts",
|
|
11
11
|
"module": "./dist-es/index.js",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "
|
|
13
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:types",
|
|
14
14
|
"build:es": "tsc -p tsconfig.es.json",
|
|
15
15
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
16
16
|
"build:types": "tsc -p tsconfig.types.json",
|
package/dist-cjs/src/Client.js
CHANGED
|
@@ -563,6 +563,20 @@ class Client {
|
|
|
563
563
|
payload,
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
|
+
/**
|
|
567
|
+
* Sends a local route change to the connected parent or iframe.
|
|
568
|
+
* @param route - Route path with optional search and hash.
|
|
569
|
+
* @param options.replace - When true, ask the host to replace the current history entry instead of pushing.
|
|
570
|
+
*/
|
|
571
|
+
sendRouteChange(route, options) {
|
|
572
|
+
void this.sendAsync({
|
|
573
|
+
type: enums_1.ClientEventType.EXTERNAL_ROUTE_CHANGE,
|
|
574
|
+
payload: { route, replace: options?.replace },
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
onExternalRouteChange(callback) {
|
|
578
|
+
return this.addEventListener(enums_1.EventType.EXTERNAL_ROUTE_CHANGE, callback);
|
|
579
|
+
}
|
|
566
580
|
onContactWeightUpdate(callback) {
|
|
567
581
|
return this.addEventListener(enums_1.EventType.CONTACT_WEIGHT_UPDATE, callback);
|
|
568
582
|
}
|
|
@@ -20,6 +20,7 @@ var EventType;
|
|
|
20
20
|
EventType["START_REDIRECT_TO_ENTITY_PAGE"] = "xBeesStartRedirectToEntityPage";
|
|
21
21
|
EventType["CANCEL_REDIRECT_TO_ENTITY_PAGE"] = "xBeesCancelRedirectToEntityPage";
|
|
22
22
|
EventType["GET_INTEGRATION_PROXY_REQUEST"] = "xBeesGetIntegrationProxyRequest";
|
|
23
|
+
EventType["EXTERNAL_ROUTE_CHANGE"] = "xBeesExternalRouteChange";
|
|
23
24
|
})(EventType || (exports.EventType = EventType = {}));
|
|
24
25
|
var ClientEventType;
|
|
25
26
|
(function (ClientEventType) {
|
|
@@ -63,6 +64,7 @@ var ClientEventType;
|
|
|
63
64
|
ClientEventType["CREATE_CONTACT_HAS_NO_PERMISSION"] = "xBeesCreateContactHasNoPermission";
|
|
64
65
|
ClientEventType["INTEGRATION_PROXY_RESPONSE"] = "xBeesIntegrationProxyResponse";
|
|
65
66
|
ClientEventType["INTEGRATION_PROXY_REQUEST_IS_SUPPORTED"] = "xBeesIntegrationProxyRequestIsSupported";
|
|
67
|
+
ClientEventType["EXTERNAL_ROUTE_CHANGE"] = "xBeesExternalRouteChange";
|
|
66
68
|
})(ClientEventType || (exports.ClientEventType = ClientEventType = {}));
|
|
67
69
|
var UrlParams;
|
|
68
70
|
(function (UrlParams) {
|
|
@@ -76,6 +78,7 @@ var UrlParams;
|
|
|
76
78
|
UrlParams["START_PAGE"] = "sp";
|
|
77
79
|
UrlParams["PRODUCT"] = "p";
|
|
78
80
|
UrlParams["CLOUD_BACKEND_ENABLED"] = "cbi";
|
|
81
|
+
UrlParams["ROUTE"] = "rt";
|
|
79
82
|
})(UrlParams || (exports.UrlParams = UrlParams = {}));
|
|
80
83
|
var StartPage;
|
|
81
84
|
(function (StartPage) {
|
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.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": "",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "./dist-types/index.d.ts",
|
|
11
11
|
"module": "./dist-es/index.js",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "
|
|
13
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:types",
|
|
14
14
|
"build:es": "tsc -p tsconfig.es.json",
|
|
15
15
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
16
16
|
"build:types": "tsc -p tsconfig.types.json",
|
package/dist-es/src/Client.js
CHANGED
|
@@ -557,6 +557,20 @@ export class Client {
|
|
|
557
557
|
payload,
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* Sends a local route change to the connected parent or iframe.
|
|
562
|
+
* @param route - Route path with optional search and hash.
|
|
563
|
+
* @param options.replace - When true, ask the host to replace the current history entry instead of pushing.
|
|
564
|
+
*/
|
|
565
|
+
sendRouteChange(route, options) {
|
|
566
|
+
void this.sendAsync({
|
|
567
|
+
type: ClientEventType.EXTERNAL_ROUTE_CHANGE,
|
|
568
|
+
payload: { route, replace: options?.replace },
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
onExternalRouteChange(callback) {
|
|
572
|
+
return this.addEventListener(EventType.EXTERNAL_ROUTE_CHANGE, callback);
|
|
573
|
+
}
|
|
560
574
|
onContactWeightUpdate(callback) {
|
|
561
575
|
return this.addEventListener(EventType.CONTACT_WEIGHT_UPDATE, callback);
|
|
562
576
|
}
|
|
@@ -17,6 +17,7 @@ export var EventType;
|
|
|
17
17
|
EventType["START_REDIRECT_TO_ENTITY_PAGE"] = "xBeesStartRedirectToEntityPage";
|
|
18
18
|
EventType["CANCEL_REDIRECT_TO_ENTITY_PAGE"] = "xBeesCancelRedirectToEntityPage";
|
|
19
19
|
EventType["GET_INTEGRATION_PROXY_REQUEST"] = "xBeesGetIntegrationProxyRequest";
|
|
20
|
+
EventType["EXTERNAL_ROUTE_CHANGE"] = "xBeesExternalRouteChange";
|
|
20
21
|
})(EventType || (EventType = {}));
|
|
21
22
|
export var ClientEventType;
|
|
22
23
|
(function (ClientEventType) {
|
|
@@ -60,6 +61,7 @@ export var ClientEventType;
|
|
|
60
61
|
ClientEventType["CREATE_CONTACT_HAS_NO_PERMISSION"] = "xBeesCreateContactHasNoPermission";
|
|
61
62
|
ClientEventType["INTEGRATION_PROXY_RESPONSE"] = "xBeesIntegrationProxyResponse";
|
|
62
63
|
ClientEventType["INTEGRATION_PROXY_REQUEST_IS_SUPPORTED"] = "xBeesIntegrationProxyRequestIsSupported";
|
|
64
|
+
ClientEventType["EXTERNAL_ROUTE_CHANGE"] = "xBeesExternalRouteChange";
|
|
63
65
|
})(ClientEventType || (ClientEventType = {}));
|
|
64
66
|
export var UrlParams;
|
|
65
67
|
(function (UrlParams) {
|
|
@@ -73,6 +75,7 @@ export var UrlParams;
|
|
|
73
75
|
UrlParams["START_PAGE"] = "sp";
|
|
74
76
|
UrlParams["PRODUCT"] = "p";
|
|
75
77
|
UrlParams["CLOUD_BACKEND_ENABLED"] = "cbi";
|
|
78
|
+
UrlParams["ROUTE"] = "rt";
|
|
76
79
|
})(UrlParams || (UrlParams = {}));
|
|
77
80
|
export var StartPage;
|
|
78
81
|
(function (StartPage) {
|
|
@@ -123,6 +123,15 @@ export declare class Client implements ConnectClient {
|
|
|
123
123
|
*/
|
|
124
124
|
setChatToOpen(chatId: string): void;
|
|
125
125
|
getChannelsByEmailOrPhone(payload: IPayloadGetChannelsByEmailOrPhone): Promise<ResponseMessage>;
|
|
126
|
+
/**
|
|
127
|
+
* Sends a local route change to the connected parent or iframe.
|
|
128
|
+
* @param route - Route path with optional search and hash.
|
|
129
|
+
* @param options.replace - When true, ask the host to replace the current history entry instead of pushing.
|
|
130
|
+
*/
|
|
131
|
+
sendRouteChange(route: string, options?: {
|
|
132
|
+
replace?: boolean;
|
|
133
|
+
}): void;
|
|
134
|
+
onExternalRouteChange(callback: Callback<EventType.EXTERNAL_ROUTE_CHANGE>): RemoveEventListener;
|
|
126
135
|
onContactWeightUpdate(callback: Callback<EventType.CONTACT_WEIGHT_UPDATE>): RemoveEventListener;
|
|
127
136
|
onContactRefresh(callback: Callback<EventType.CONTACT_REFRESH>): RemoveEventListener;
|
|
128
137
|
/**
|
|
@@ -15,7 +15,8 @@ export declare enum EventType {
|
|
|
15
15
|
CONTACT_REFRESH = "xBeesContactRefresh",
|
|
16
16
|
START_REDIRECT_TO_ENTITY_PAGE = "xBeesStartRedirectToEntityPage",
|
|
17
17
|
CANCEL_REDIRECT_TO_ENTITY_PAGE = "xBeesCancelRedirectToEntityPage",
|
|
18
|
-
GET_INTEGRATION_PROXY_REQUEST = "xBeesGetIntegrationProxyRequest"
|
|
18
|
+
GET_INTEGRATION_PROXY_REQUEST = "xBeesGetIntegrationProxyRequest",
|
|
19
|
+
EXTERNAL_ROUTE_CHANGE = "xBeesExternalRouteChange"
|
|
19
20
|
}
|
|
20
21
|
export declare enum ClientEventType {
|
|
21
22
|
READY = "xBeesReady",
|
|
@@ -57,7 +58,8 @@ export declare enum ClientEventType {
|
|
|
57
58
|
CREATE_CONTACT_IS_SUPPORTED = "xBeesCreateContactIsSupported",
|
|
58
59
|
CREATE_CONTACT_HAS_NO_PERMISSION = "xBeesCreateContactHasNoPermission",
|
|
59
60
|
INTEGRATION_PROXY_RESPONSE = "xBeesIntegrationProxyResponse",
|
|
60
|
-
INTEGRATION_PROXY_REQUEST_IS_SUPPORTED = "xBeesIntegrationProxyRequestIsSupported"
|
|
61
|
+
INTEGRATION_PROXY_REQUEST_IS_SUPPORTED = "xBeesIntegrationProxyRequestIsSupported",
|
|
62
|
+
EXTERNAL_ROUTE_CHANGE = "xBeesExternalRouteChange"
|
|
61
63
|
}
|
|
62
64
|
export declare enum UrlParams {
|
|
63
65
|
TOKEN = "t",
|
|
@@ -69,7 +71,8 @@ export declare enum UrlParams {
|
|
|
69
71
|
AUTHORIZE = "a",
|
|
70
72
|
START_PAGE = "sp",
|
|
71
73
|
PRODUCT = "p",
|
|
72
|
-
CLOUD_BACKEND_ENABLED = "cbi"
|
|
74
|
+
CLOUD_BACKEND_ENABLED = "cbi",
|
|
75
|
+
ROUTE = "rt"
|
|
73
76
|
}
|
|
74
77
|
export declare enum StartPage {
|
|
75
78
|
CREATE_CONTACT = "createContact"
|
|
@@ -242,6 +242,18 @@ export interface ConnectClient {
|
|
|
242
242
|
* @param payload - Contact identifier: `value` (email or phone value) and `type` (`'email'` or `'phone'`).
|
|
243
243
|
*/
|
|
244
244
|
getChannelsByEmailOrPhone: (payload: IPayloadGetChannelsByEmailOrPhone) => Promise<ResponseMessage>;
|
|
245
|
+
/**
|
|
246
|
+
* Sends a local route change to the connected parent or iframe.
|
|
247
|
+
* @param route - Route path with optional search and hash.
|
|
248
|
+
* @param options.replace - When true, ask the host to replace the current history entry instead of pushing.
|
|
249
|
+
*/
|
|
250
|
+
sendRouteChange: (route: string, options?: {
|
|
251
|
+
replace?: boolean;
|
|
252
|
+
}) => void;
|
|
253
|
+
/**
|
|
254
|
+
* Starts listening for route changes from the connected parent or iframe.
|
|
255
|
+
*/
|
|
256
|
+
onExternalRouteChange: (callback: Callback<EventType.EXTERNAL_ROUTE_CHANGE>) => RemoveEventListener;
|
|
245
257
|
/**
|
|
246
258
|
* Starts listen for the events of contact weight update and handle with the provided callback
|
|
247
259
|
*/
|
|
@@ -2,10 +2,10 @@ 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, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadDropdownVisibility, IPayloadGetChannelsByEmailOrPhone, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadSetChatToOpen, 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, IPayloadGetChannelsByEmailOrPhone, IPayloadGetFromStorage, IPayloadRouteChange, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadSetChatToOpen, 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 ClientEventType.SET_CHAT_TO_OPEN ? IPayloadSetChatToOpen : T extends ClientEventType.GET_CHANNELS_BY_EMAIL_OR_PHONE ? IPayloadGetChannelsByEmailOrPhone : 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;
|
|
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 ClientEventType.SET_CHAT_TO_OPEN ? IPayloadSetChatToOpen : T extends ClientEventType.GET_CHANNELS_BY_EMAIL_OR_PHONE ? IPayloadGetChannelsByEmailOrPhone : T extends ClientEventType.EXTERNAL_ROUTE_CHANGE ? IPayloadRouteChange : 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.EXTERNAL_ROUTE_CHANGE ? IPayloadRouteChange : 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;
|
|
@@ -22,6 +22,7 @@ export type EventPayloadMap = {
|
|
|
22
22
|
[EventType.START_REDIRECT_TO_ENTITY_PAGE]: IPayloadStartRedirectToEntityPage;
|
|
23
23
|
[EventType.CANCEL_REDIRECT_TO_ENTITY_PAGE]: IPayloadCancelRedirectToEntityPage;
|
|
24
24
|
[EventType.GET_INTEGRATION_PROXY_REQUEST]: IntegrationProxyRequest;
|
|
25
|
+
[EventType.EXTERNAL_ROUTE_CHANGE]: IPayloadRouteChange;
|
|
25
26
|
};
|
|
26
27
|
export type EventCallbackMap = {
|
|
27
28
|
[EventType.GET_CONTACTS_AUTO_SUGGEST]: (query: EventPayloadMap[EventType.GET_CONTACTS_AUTO_SUGGEST]) => void;
|
|
@@ -41,6 +42,7 @@ export type EventCallbackMap = {
|
|
|
41
42
|
[EventType.DAEMON_CALL_SESSION_STARTED]: (callStartedInfo: EventPayloadMap[EventType.DAEMON_CALL_SESSION_STARTED]) => void;
|
|
42
43
|
[EventType.DAEMON_CALL_SESSION_FINISHED]: (callFinishedInfo: EventPayloadMap[EventType.DAEMON_CALL_SESSION_FINISHED]) => void;
|
|
43
44
|
[EventType.GET_INTEGRATION_PROXY_REQUEST]: (request: EventPayloadMap[EventType.GET_INTEGRATION_PROXY_REQUEST]) => void;
|
|
45
|
+
[EventType.EXTERNAL_ROUTE_CHANGE]: (params: EventPayloadMap[EventType.EXTERNAL_ROUTE_CHANGE]) => void;
|
|
44
46
|
};
|
|
45
47
|
export type RawMessageEvent = MessageEvent<string | Message>;
|
|
46
48
|
export type ReadyExtendedProps = {
|
|
@@ -104,6 +104,14 @@ export interface IPayloadGetChannelsByEmailOrPhone {
|
|
|
104
104
|
value: string;
|
|
105
105
|
type: 'email' | 'phone';
|
|
106
106
|
}
|
|
107
|
+
export interface IPayloadRouteChange {
|
|
108
|
+
route: string;
|
|
109
|
+
/**
|
|
110
|
+
* When true, the host should replace the current history entry instead of pushing a new one.
|
|
111
|
+
* Omit or set to false to keep the default push behavior.
|
|
112
|
+
*/
|
|
113
|
+
replace?: boolean;
|
|
114
|
+
}
|
|
107
115
|
export interface IPayloadContactWeightUpdate {
|
|
108
116
|
id: string;
|
|
109
117
|
query: ContactQuery;
|
|
@@ -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, IPayloadDaemonCallFinished, IPayloadDaemonCallStarted, IPayloadGetChannelsByEmailOrPhone, IPayloadSendAnalytics, IPayloadSetChatToOpen, 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, IPayloadGetChannelsByEmailOrPhone, IPayloadRouteChange, IPayloadSendAnalytics, IPayloadSetChatToOpen, 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.
|
|
3
|
+
"version": "1.3.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": "",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "./dist-types/index.d.ts",
|
|
11
11
|
"module": "./dist-es/index.js",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "
|
|
13
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:types",
|
|
14
14
|
"build:es": "tsc -p tsconfig.es.json",
|
|
15
15
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
16
16
|
"build:types": "tsc -p tsconfig.types.json",
|