@wildix/xbees-connect 1.2.34 → 1.2.37

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
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": "",
@@ -145,12 +145,26 @@ class Client {
145
145
  }
146
146
  }
147
147
  }
148
+ /**
149
+ * @deprecated Use getXBeesUserAsync instead. This method doesn't wait for the user data to be fetched.
150
+ */
148
151
  getXBeesUser() {
149
152
  if (!this.user) {
150
153
  this.requestXbeesUser();
151
154
  }
152
155
  return this.user;
153
156
  }
157
+ /**
158
+ * Asynchronously retrieves the xBees user data.
159
+ * This method waits for the user data to be fetched before returning.
160
+ * @returns Promise that resolves to the XBeesUser or null if not available
161
+ */
162
+ async getXBeesUserAsync() {
163
+ if (!this.user) {
164
+ await this.requestXbeesUser();
165
+ }
166
+ return this.user;
167
+ }
154
168
  version() {
155
169
  return package_json_1.default.version;
156
170
  }
@@ -442,6 +456,13 @@ class Client {
442
456
  payload: { key },
443
457
  });
444
458
  }
459
+ /** should be removed, sendCustomEvent is enough **/
460
+ sendDropdownVisibilityEvent(dropdownVisibilityStatus) {
461
+ void this.sendAsync({
462
+ type: enums_1.ClientEventType.DROPDOWN_VISIBILITY,
463
+ payload: { dropdownVisibilityStatus },
464
+ });
465
+ }
445
466
  sendCustomEvent({ type, payload }) {
446
467
  void this.sendAsync({
447
468
  type: enums_1.ClientEventType.CUSTOM_EVENT,
@@ -48,6 +48,7 @@ var ClientEventType;
48
48
  ClientEventType["GET_FROM_STORAGE"] = "xBeesRequestFromStorage";
49
49
  ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
50
50
  ClientEventType["AVAILABLE_CONTACT_DATA"] = "xBeesAvailableContactData";
51
+ ClientEventType["DROPDOWN_VISIBILITY"] = "xBeesDropdownVisibility";
51
52
  ClientEventType["CUSTOM_EVENT"] = "xBeesCustomEvent";
52
53
  ClientEventType["CREATE_CONTACT_IS_SUPPORTED"] = "xBeesCreateContactIsSupported";
53
54
  ClientEventType["CREATE_CONTACT_HAS_NO_PERMISSION"] = "xBeesCreateContactHasNoPermission";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
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": "",
@@ -139,12 +139,26 @@ export class Client {
139
139
  }
140
140
  }
141
141
  }
142
+ /**
143
+ * @deprecated Use getXBeesUserAsync instead. This method doesn't wait for the user data to be fetched.
144
+ */
142
145
  getXBeesUser() {
143
146
  if (!this.user) {
144
147
  this.requestXbeesUser();
145
148
  }
146
149
  return this.user;
147
150
  }
151
+ /**
152
+ * Asynchronously retrieves the xBees user data.
153
+ * This method waits for the user data to be fetched before returning.
154
+ * @returns Promise that resolves to the XBeesUser or null if not available
155
+ */
156
+ async getXBeesUserAsync() {
157
+ if (!this.user) {
158
+ await this.requestXbeesUser();
159
+ }
160
+ return this.user;
161
+ }
148
162
  version() {
149
163
  return packageJson.version;
150
164
  }
@@ -436,6 +450,13 @@ export class Client {
436
450
  payload: { key },
437
451
  });
438
452
  }
453
+ /** should be removed, sendCustomEvent is enough **/
454
+ sendDropdownVisibilityEvent(dropdownVisibilityStatus) {
455
+ void this.sendAsync({
456
+ type: ClientEventType.DROPDOWN_VISIBILITY,
457
+ payload: { dropdownVisibilityStatus },
458
+ });
459
+ }
439
460
  sendCustomEvent({ type, payload }) {
440
461
  void this.sendAsync({
441
462
  type: ClientEventType.CUSTOM_EVENT,
@@ -45,6 +45,7 @@ export var ClientEventType;
45
45
  ClientEventType["GET_FROM_STORAGE"] = "xBeesRequestFromStorage";
46
46
  ClientEventType["REMOVE_FROM_STORAGE"] = "xBeesRemoveFromStorage";
47
47
  ClientEventType["AVAILABLE_CONTACT_DATA"] = "xBeesAvailableContactData";
48
+ ClientEventType["DROPDOWN_VISIBILITY"] = "xBeesDropdownVisibility";
48
49
  ClientEventType["CUSTOM_EVENT"] = "xBeesCustomEvent";
49
50
  ClientEventType["CREATE_CONTACT_IS_SUPPORTED"] = "xBeesCreateContactIsSupported";
50
51
  ClientEventType["CREATE_CONTACT_HAS_NO_PERMISSION"] = "xBeesCreateContactHasNoPermission";
@@ -36,7 +36,16 @@ export declare class Client implements ConnectClient {
36
36
  private sendDailyIntegrationUsageAnalytics;
37
37
  ready(props?: SupportedPlatformVariant | ReadyExtendedProps | undefined): Promise<ResponseMessage>;
38
38
  private requestXbeesUser;
39
+ /**
40
+ * @deprecated Use getXBeesUserAsync instead. This method doesn't wait for the user data to be fetched.
41
+ */
39
42
  getXBeesUser(): XBeesUser | null;
43
+ /**
44
+ * Asynchronously retrieves the xBees user data.
45
+ * This method waits for the user data to be fetched before returning.
46
+ * @returns Promise that resolves to the XBeesUser or null if not available
47
+ */
48
+ getXBeesUserAsync(): Promise<XBeesUser | null>;
40
49
  version(): string;
41
50
  isPlatformNative(): boolean;
42
51
  isPlatformWeb(): boolean;
@@ -94,6 +103,8 @@ export declare class Client implements ConnectClient {
94
103
  saveInXbeesStorage<SavingType>(key: string, value: SavingType): void;
95
104
  getFromXbeesStorage(key: string): Promise<ResponseMessage<ClientEventType.GET_FROM_STORAGE>>;
96
105
  removeFromXbeesStorage(key: string): void;
106
+ /** should be removed, sendCustomEvent is enough **/
107
+ sendDropdownVisibilityEvent(dropdownVisibilityStatus: boolean): void;
97
108
  sendCustomEvent({ type, payload }: {
98
109
  type: string;
99
110
  payload?: JSONValue;
@@ -43,6 +43,7 @@ export declare enum ClientEventType {
43
43
  GET_FROM_STORAGE = "xBeesRequestFromStorage",
44
44
  REMOVE_FROM_STORAGE = "xBeesRemoveFromStorage",
45
45
  AVAILABLE_CONTACT_DATA = "xBeesAvailableContactData",
46
+ DROPDOWN_VISIBILITY = "xBeesDropdownVisibility",
46
47
  CUSTOM_EVENT = "xBeesCustomEvent",
47
48
  CREATE_CONTACT_IS_SUPPORTED = "xBeesCreateContactIsSupported",
48
49
  CREATE_CONTACT_HAS_NO_PERMISSION = "xBeesCreateContactHasNoPermission"
@@ -193,6 +193,10 @@ export interface ConnectClient {
193
193
  /**
194
194
  * Remove data from x-bees storage */
195
195
  removeFromXbeesStorage: (key: string) => void;
196
+ /**
197
+ * Send to xbees dropdown status when it is actioned for change Webview nestedScrollEnabled (Android)
198
+ */
199
+ sendDropdownVisibilityEvent: (dropdownVisibilityStatus: boolean) => void;
196
200
  /**
197
201
  * Send to xbees custom event with eventType and payload
198
202
  */
@@ -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 { IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, IPayloadTechSupport, IPayloadThemeChange, IPayloadToast, IPayloadVersion, IPayloadViewPort } from './Payload';
5
+ import { IPayloadAutoSuggestResult, IPayloadBatchContactsMatchResult, IPayloadBatchContactsMatchResultError, IPayloadCallStart, IPayloadCallStartedInfo, IPayloadContactMatchResult, IPayloadContactMatchResultNotFound, IPayloadContactResult, IPayloadContextResult, IPayloadConversationResult, IPayloadCustomEvent, IPayloadDropdownVisibility, IPayloadGetFromStorage, IPayloadSaveToStorage, IPayloadSendAnalytics, 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.CUSTOM_EVENT ? IPayloadCustomEvent : 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 : never;
9
9
  export type EventPayloadMap = {
10
10
  [EventType.GET_CONTACTS_AUTO_SUGGEST]: string;
11
11
  [EventType.GET_LOOK_UP_AND_MATCH]: ContactQuery;
@@ -77,6 +77,9 @@ export interface IPayloadTechSupport {
77
77
  message: string;
78
78
  data?: JSONObject | JSONArray;
79
79
  }
80
+ export interface IPayloadDropdownVisibility {
81
+ dropdownVisibilityStatus: boolean;
82
+ }
80
83
  export interface IPayloadCustomEvent {
81
84
  type: string;
82
85
  payload?: JSONValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.2.34",
3
+ "version": "1.2.37",
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": "",
@@ -45,5 +45,5 @@
45
45
  "engines": {
46
46
  "node": ">=16"
47
47
  },
48
- "gitHead": "a377b8006cc371164b6295fff1e61c046086a5ef"
48
+ "gitHead": "45d941b6446ca4c1ed7ffb866ab1477a951d3e40"
49
49
  }