@wildix/xbees-connect 1.1.15 → 1.1.17
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-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
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
|
@@ -183,18 +183,6 @@ export class Client {
|
|
|
183
183
|
isAuthorized() {
|
|
184
184
|
return this.sendAsync({ type: ClientEventType.AUTHORIZED });
|
|
185
185
|
}
|
|
186
|
-
sendContactsAutoSuggest(payload) {
|
|
187
|
-
return this.sendAsync({
|
|
188
|
-
type: ClientEventType.CONTACTS_AUTO_SUGGEST,
|
|
189
|
-
payload,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
sendContactMatch(payload) {
|
|
193
|
-
return this.sendAsync({
|
|
194
|
-
type: ClientEventType.CONTACT_LOOKUP_AND_MATCH,
|
|
195
|
-
payload,
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
186
|
addEventListener(eventName, callback) {
|
|
199
187
|
if (!this.useSubscription) {
|
|
200
188
|
this.useSubscription = true;
|
|
@@ -236,6 +224,15 @@ export class Client {
|
|
|
236
224
|
return this.sendAsync({ type: ClientEventType.TOKEN });
|
|
237
225
|
}
|
|
238
226
|
onSuggestContacts(callback) {
|
|
227
|
+
// send event to x-bees
|
|
228
|
+
try {
|
|
229
|
+
void this.sendAsync({
|
|
230
|
+
type: ClientEventType.CONTACTS_AUTO_SUGGEST_IS_SUPPORTED,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
console.debug('send error - type:', error);
|
|
235
|
+
}
|
|
239
236
|
return this.addEventListener(EventType.GET_CONTACTS_AUTO_SUGGEST, (query) => {
|
|
240
237
|
const resolve = (contacts) => this.sendAsync({
|
|
241
238
|
type: ClientEventType.CONTACTS_AUTO_SUGGEST,
|
|
@@ -256,6 +253,15 @@ export class Client {
|
|
|
256
253
|
});
|
|
257
254
|
}
|
|
258
255
|
onLookupAndMatchContact(callback) {
|
|
256
|
+
// send event to x-bees
|
|
257
|
+
try {
|
|
258
|
+
void this.sendAsync({
|
|
259
|
+
type: ClientEventType.CONTACT_LOOK_UP_AND_MATCH_IS_SUPPORTED,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
console.debug('send error - type:', error);
|
|
264
|
+
}
|
|
259
265
|
return this.addEventListener(EventType.GET_LOOK_UP_AND_MATCH, (query) => {
|
|
260
266
|
const resolve = (contact) => this.sendAsync({
|
|
261
267
|
type: ClientEventType.CONTACT_LOOKUP_AND_MATCH,
|
|
@@ -29,6 +29,8 @@ export var ClientEventType;
|
|
|
29
29
|
ClientEventType["CONTACT_LOOKUP_AND_MATCH"] = "xBeesContactLookupAndMatch";
|
|
30
30
|
ClientEventType["CONTACT_LOOKUP_AND_MATCH_NOT_FOUND"] = "xBeesContactLookupAndMatchNotFound";
|
|
31
31
|
ClientEventType["CONTACT_CREATE_OR_UPDATE"] = "xBeesContactCreateOrUpdate";
|
|
32
|
+
ClientEventType["CONTACTS_AUTO_SUGGEST_IS_SUPPORTED"] = "xBeesContactsAutoSuggestIsSupported";
|
|
33
|
+
ClientEventType["CONTACT_LOOK_UP_AND_MATCH_IS_SUPPORTED"] = "xBeesContactLookupAndMatchIsSupported";
|
|
32
34
|
ClientEventType["LOGOUT_IS_SUPPORTED"] = "xBeesLogoutIsSupported";
|
|
33
35
|
ClientEventType["SEND_ANALYTICS"] = "xBeesSendAnalytics";
|
|
34
36
|
})(ClientEventType || (ClientEventType = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Callback, ConnectClient, Contact, ContactQuery,
|
|
1
|
+
import { Callback, ConnectClient, Contact, ContactQuery, IPayloadViewPort, LookupAndMatchContactsResolver, Message, Reject, RemoveEventListener, ResponseMessage, StorageEventCallback, SuggestContactsResolver, SupportedPlatformVariant, ToastSeverity } from '../types';
|
|
2
2
|
import { ClientEventType, EventType } from './enums';
|
|
3
3
|
/**
|
|
4
4
|
* Client provides functionality of communication between xBees and integrated web applications via iFrame or ReactNative WebView
|
|
@@ -49,8 +49,6 @@ export declare class Client implements ConnectClient {
|
|
|
49
49
|
showToast(message: string, severity?: ToastSeverity | undefined): Promise<ResponseMessage>;
|
|
50
50
|
isNotAuthorized(): Promise<ResponseMessage>;
|
|
51
51
|
isAuthorized(): Promise<ResponseMessage>;
|
|
52
|
-
sendContactsAutoSuggest(payload: IPayloadAutoSuggestResult): Promise<Message<ClientEventType.CONTACTS_AUTO_SUGGEST>>;
|
|
53
|
-
sendContactMatch(payload: IPayloadContactMatchResult): Promise<Message<ClientEventType.CONTACT_LOOKUP_AND_MATCH>>;
|
|
54
52
|
addEventListener<T extends EventType = EventType>(eventName: T, callback: Callback<T>): RemoveEventListener;
|
|
55
53
|
removeEventListener<T extends EventType = EventType>(eventName: T | null, callback: Callback<T>): void;
|
|
56
54
|
off(callback: Callback | StorageEventCallback): void;
|
|
@@ -27,6 +27,8 @@ export declare enum ClientEventType {
|
|
|
27
27
|
CONTACT_LOOKUP_AND_MATCH = "xBeesContactLookupAndMatch",
|
|
28
28
|
CONTACT_LOOKUP_AND_MATCH_NOT_FOUND = "xBeesContactLookupAndMatchNotFound",
|
|
29
29
|
CONTACT_CREATE_OR_UPDATE = "xBeesContactCreateOrUpdate",
|
|
30
|
+
CONTACTS_AUTO_SUGGEST_IS_SUPPORTED = "xBeesContactsAutoSuggestIsSupported",
|
|
31
|
+
CONTACT_LOOK_UP_AND_MATCH_IS_SUPPORTED = "xBeesContactLookupAndMatchIsSupported",
|
|
30
32
|
LOGOUT_IS_SUPPORTED = "xBeesLogoutIsSupported",
|
|
31
33
|
SEND_ANALYTICS = "xBeesSendAnalytics"
|
|
32
34
|
}
|
|
@@ -199,12 +199,6 @@ export interface ConnectClient {
|
|
|
199
199
|
/**
|
|
200
200
|
* Sends message to x-bees to be shown as a toast with specified severity level */
|
|
201
201
|
showToast: (message: string, severity?: ToastSeverity) => Promise<ResponseMessage>;
|
|
202
|
-
/**
|
|
203
|
-
* Sends a response to x-bees for contacts autoSuggest */
|
|
204
|
-
sendContactsAutoSuggest: (payload: IPayloadAutoSuggestResult) => Promise<Message<ClientEventType.CONTACTS_AUTO_SUGGEST>>;
|
|
205
|
-
/**
|
|
206
|
-
* Sends a response to x-bees for contact match */
|
|
207
|
-
sendContactMatch: (payload: IPayloadContactMatchResult) => Promise<Message<ClientEventType.CONTACT_LOOKUP_AND_MATCH>>;
|
|
208
202
|
/**
|
|
209
203
|
* pushes to x-bees message that user is authorized and no more actions required */
|
|
210
204
|
isAuthorized: () => Promise<ResponseMessage>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
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": "",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=16"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "4e7dcc5d346412949b0b9ad31ba5aa7ecb685d92"
|
|
46
46
|
}
|