@wildix/xbees-connect 1.3.18 → 1.3.19-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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.3.18",
3
+ "version": "1.3.19-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": "",
@@ -78,6 +78,11 @@ class Client {
78
78
  console.warn('[xbees-connect] Application is not running inside xbees. URL:', window.location.href);
79
79
  return new Promise(() => { });
80
80
  }
81
+ // [WMS-26987 DEBUG] TEMPORARY: every outbound iframe->host message. This is the only
82
+ // place the producer's payload is observable before it leaves the SDK, so it proves
83
+ // whether additionalPhones/additionalEmails/matchedValue survive toContact().
84
+ // eslint-disable-next-line no-console
85
+ console.log('[WMS-26987][sdk-ui][OUT]', data.type, { payload: data.payload });
81
86
  return this.worker.sendAsync({
82
87
  ...data,
83
88
  iframeId: this.iframeId,
@@ -110,6 +115,11 @@ class Client {
110
115
  return;
111
116
  }
112
117
  const { type, payload } = data;
118
+ // [WMS-26987 DEBUG] TEMPORARY: every inbound host->iframe message. NOTE: the similar log in
119
+ // MessageListener.onMessage can never fire - MessageListener.getInstance() has zero callers,
120
+ // so that class is dead code and Client.onMessage is the only live inbound path.
121
+ // eslint-disable-next-line no-console
122
+ console.log('[WMS-26987][sdk-ui][IN]', type, { payload });
113
123
  this.listeners.forEach(({ eventName, callback }) => {
114
124
  if (eventName === type) {
115
125
  if (type === enums_1.EventType.ADD_CALL) {
@@ -46,7 +46,10 @@ class MessageListener {
46
46
  return;
47
47
  }
48
48
  const { type, payload } = data;
49
- console.debug(`onMessage call - ${type} - ${payload}`);
49
+ // [WMS-26987 DEBUG] TEMPORARY: was `${payload}` which renders '[object Object]'.
50
+ // Pass the object so the inbound payload is actually inspectable in devtools.
51
+ // eslint-disable-next-line no-console
52
+ console.debug('[WMS-26987][sdk-ui][IN]', type, { payload });
50
53
  this.listeners.forEach(({ eventName, callback }) => {
51
54
  if (eventName === type) {
52
55
  if (type === enums_1.EventType.ADD_CALL) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.3.18",
3
+ "version": "1.3.19-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": "",
@@ -72,6 +72,11 @@ export class Client {
72
72
  console.warn('[xbees-connect] Application is not running inside xbees. URL:', window.location.href);
73
73
  return new Promise(() => { });
74
74
  }
75
+ // [WMS-26987 DEBUG] TEMPORARY: every outbound iframe->host message. This is the only
76
+ // place the producer's payload is observable before it leaves the SDK, so it proves
77
+ // whether additionalPhones/additionalEmails/matchedValue survive toContact().
78
+ // eslint-disable-next-line no-console
79
+ console.log('[WMS-26987][sdk-ui][OUT]', data.type, { payload: data.payload });
75
80
  return this.worker.sendAsync({
76
81
  ...data,
77
82
  iframeId: this.iframeId,
@@ -104,6 +109,11 @@ export class Client {
104
109
  return;
105
110
  }
106
111
  const { type, payload } = data;
112
+ // [WMS-26987 DEBUG] TEMPORARY: every inbound host->iframe message. NOTE: the similar log in
113
+ // MessageListener.onMessage can never fire - MessageListener.getInstance() has zero callers,
114
+ // so that class is dead code and Client.onMessage is the only live inbound path.
115
+ // eslint-disable-next-line no-console
116
+ console.log('[WMS-26987][sdk-ui][IN]', type, { payload });
107
117
  this.listeners.forEach(({ eventName, callback }) => {
108
118
  if (eventName === type) {
109
119
  if (type === EventType.ADD_CALL) {
@@ -43,7 +43,10 @@ export class MessageListener {
43
43
  return;
44
44
  }
45
45
  const { type, payload } = data;
46
- console.debug(`onMessage call - ${type} - ${payload}`);
46
+ // [WMS-26987 DEBUG] TEMPORARY: was `${payload}` which renders '[object Object]'.
47
+ // Pass the object so the inbound payload is actually inspectable in devtools.
48
+ // eslint-disable-next-line no-console
49
+ console.debug('[WMS-26987][sdk-ui][IN]', type, { payload });
47
50
  this.listeners.forEach(({ eventName, callback }) => {
48
51
  if (eventName === type) {
49
52
  if (type === EventType.ADD_CALL) {
@@ -1,3 +1,8 @@
1
+ export interface ContactChannel {
2
+ value: string;
3
+ label?: string;
4
+ field?: string;
5
+ }
1
6
  export interface ContactShape {
2
7
  id: string;
3
8
  name: string;
@@ -11,6 +16,9 @@ export interface ContactShape {
11
16
  homeMobileNumber?: string;
12
17
  extension?: string;
13
18
  organization?: string;
19
+ additionalEmails?: ContactChannel[];
20
+ additionalPhones?: ContactChannel[];
21
+ matchedValue?: string;
14
22
  }
15
23
  export type Contact = (ContactShape & {
16
24
  email: string;
@@ -1,7 +1,7 @@
1
1
  export type { AvailableContactData } from './AvailableContactData';
2
2
  export type { Callback } from './Callback';
3
3
  export type { ConnectClient } from './Client';
4
- export type { Contact, ContactQuery } from './Contact';
4
+ export type { Contact, ContactChannel, ContactQuery } from './Contact';
5
5
  export type { EventPayloadMap, RawMessageEvent } from './Event';
6
6
  export type { JSONArray, JSONObject } from './Json';
7
7
  export type { Listener, RemoveEventListener } from './Listener';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.3.18",
3
+ "version": "1.3.19-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": "",