@wildix/xbees-connect 1.0.6 → 1.1.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/dist-es/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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": "",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"eslint": "^8.
|
|
33
|
+
"eslint": "^8.55.0",
|
|
34
34
|
"rimraf": "^5.0.5",
|
|
35
|
-
"typescript": "^5.
|
|
35
|
+
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
37
|
"parserOptions": {
|
|
38
38
|
"project": [
|
package/dist-es/src/Client.js
CHANGED
|
@@ -121,6 +121,9 @@ export class Client {
|
|
|
121
121
|
getCurrentContact() {
|
|
122
122
|
return this.sendAsync({ type: ClientEventType.CURRENT_CONTACT });
|
|
123
123
|
}
|
|
124
|
+
contactUpdated(query, contact) {
|
|
125
|
+
return this.sendAsync({ type: ClientEventType.CONTACT_CREATE_OR_UPDATE, payload: { query, contact } });
|
|
126
|
+
}
|
|
124
127
|
getThemeMode() {
|
|
125
128
|
return this.sendAsync({ type: ClientEventType.THEME_MODE });
|
|
126
129
|
}
|
|
@@ -22,6 +22,7 @@ export var ClientEventType;
|
|
|
22
22
|
ClientEventType["AUTHORIZED"] = "xBeesAuthorized";
|
|
23
23
|
ClientEventType["CONTACTS_AUTO_SUGGEST"] = "xBeesContactsAutoSuggest";
|
|
24
24
|
ClientEventType["CONTACT_LOOKUP_AND_MATCH"] = "xBeesContactLookupAndMatch";
|
|
25
|
+
ClientEventType["CONTACT_CREATE_OR_UPDATE"] = "xBeesContactCreateOrUpdate";
|
|
25
26
|
})(ClientEventType || (ClientEventType = {}));
|
|
26
27
|
export var DeprecatedUrlParams;
|
|
27
28
|
(function (DeprecatedUrlParams) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Callback, ConnectClient, ContactQuery, IPayloadAutoSuggestResult, IPayloadContactMatchResult, IPayloadViewPort, LookupAndMatchContactsResolver, Message, Reject, RemoveEventListener, ResponseMessage, SuggestContactsResolver } from '../types';
|
|
1
|
+
import { Callback, ConnectClient, Contact, ContactQuery, IPayloadAutoSuggestResult, IPayloadContactMatchResult, IPayloadViewPort, LookupAndMatchContactsResolver, Message, Reject, RemoveEventListener, ResponseMessage, SuggestContactsResolver } 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
|
|
@@ -30,6 +30,7 @@ export declare class Client implements ConnectClient {
|
|
|
30
30
|
isActivationOnly(): boolean;
|
|
31
31
|
getContext(): Promise<Message<ClientEventType.CONTEXT>>;
|
|
32
32
|
getCurrentContact(): Promise<Message<ClientEventType.CURRENT_CONTACT>>;
|
|
33
|
+
contactUpdated(query: ContactQuery, contact: Contact): Promise<Message<ClientEventType.CONTACT_CREATE_OR_UPDATE>>;
|
|
33
34
|
getThemeMode(): Promise<Message<ClientEventType.THEME_MODE>>;
|
|
34
35
|
getTheme(): Promise<Message<ClientEventType.THEME>>;
|
|
35
36
|
startCall(phoneNumber: string): Promise<Message<ClientEventType.START_CALL>>;
|
|
@@ -19,7 +19,8 @@ export declare enum ClientEventType {
|
|
|
19
19
|
NOT_AUTHORIZED = "xBeesNotAuthorized",
|
|
20
20
|
AUTHORIZED = "xBeesAuthorized",
|
|
21
21
|
CONTACTS_AUTO_SUGGEST = "xBeesContactsAutoSuggest",
|
|
22
|
-
CONTACT_LOOKUP_AND_MATCH = "xBeesContactLookupAndMatch"
|
|
22
|
+
CONTACT_LOOKUP_AND_MATCH = "xBeesContactLookupAndMatch",
|
|
23
|
+
CONTACT_CREATE_OR_UPDATE = "xBeesContactCreateOrUpdate"
|
|
23
24
|
}
|
|
24
25
|
export declare enum DeprecatedUrlParams {
|
|
25
26
|
TOKEN = "token",
|
|
@@ -57,7 +57,7 @@ export interface IPayloadContactResult {
|
|
|
57
57
|
}
|
|
58
58
|
export interface IPayloadContextResult extends IPayloadContactResult {
|
|
59
59
|
}
|
|
60
|
-
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 ? IPayloadContactMatchResult : T extends ClientEventType.CONTEXT ? IPayloadContextResult : 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 EventType.PBX_TOKEN ? string : T extends ClientEventType.TO_CLIPBOARD ? string : never;
|
|
60
|
+
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 ? IPayloadContactMatchResult : T extends ClientEventType.CONTACT_CREATE_OR_UPDATE ? IPayloadContactMatchResult : T extends ClientEventType.CONTEXT ? IPayloadContextResult : 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 EventType.PBX_TOKEN ? string : T extends ClientEventType.TO_CLIPBOARD ? string : never;
|
|
61
61
|
export type Message<T extends MessageType = MessageType> = {
|
|
62
62
|
type: T;
|
|
63
63
|
payload?: EventPayload<T>;
|
|
@@ -130,6 +130,9 @@ export interface ConnectClient {
|
|
|
130
130
|
/**
|
|
131
131
|
* Retrieves current opened in x-bees contact data */
|
|
132
132
|
getCurrentContact: () => Promise<Message<ClientEventType.CURRENT_CONTACT>>;
|
|
133
|
+
/**
|
|
134
|
+
* Sends notification to x-bees about contact data updated */
|
|
135
|
+
contactUpdated(query: ContactQuery, contact: Contact): Promise<Message<ClientEventType.CONTACT_CREATE_OR_UPDATE>>;
|
|
133
136
|
/**
|
|
134
137
|
* Retrieves current theme mode (light or dark) */
|
|
135
138
|
getThemeMode: () => Promise<Message<ClientEventType.THEME_MODE>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-connect",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.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": "",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"eslint": "^8.
|
|
33
|
+
"eslint": "^8.55.0",
|
|
34
34
|
"rimraf": "^5.0.5",
|
|
35
|
-
"typescript": "^5.
|
|
35
|
+
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
37
|
"parserOptions": {
|
|
38
38
|
"project": [
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=16"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "233a9c252d03c11b84142544cba1f2de6cd1401c"
|
|
46
46
|
}
|