@webex/calling 0.0.1-next.0 → 0.0.1-next.2

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.
Files changed (122) hide show
  1. package/README.md +51 -66
  2. package/dist/module/CallHistory/CallHistory.js +84 -84
  3. package/dist/module/CallHistory/callHistoryFixtures.js +307 -307
  4. package/dist/module/CallHistory/constants.js +9 -9
  5. package/dist/module/CallHistory/types.js +1 -1
  6. package/dist/module/CallSettings/CallSettings.js +65 -65
  7. package/dist/module/CallSettings/UcmBackendConnector.js +100 -100
  8. package/dist/module/CallSettings/WxCallBackendConnector.js +287 -287
  9. package/dist/module/CallSettings/constants.js +11 -11
  10. package/dist/module/CallSettings/testFixtures.js +62 -62
  11. package/dist/module/CallSettings/types.js +1 -1
  12. package/dist/module/CallingClient/CallingClient.js +268 -268
  13. package/dist/module/CallingClient/callRecordFixtures.js +93 -93
  14. package/dist/module/CallingClient/calling/CallerId/index.js +169 -169
  15. package/dist/module/CallingClient/calling/CallerId/types.js +1 -1
  16. package/dist/module/CallingClient/calling/call.js +1649 -1649
  17. package/dist/module/CallingClient/calling/callManager.js +274 -274
  18. package/dist/module/CallingClient/calling/index.js +2 -2
  19. package/dist/module/CallingClient/calling/types.js +53 -53
  20. package/dist/module/CallingClient/callingClientFixtures.js +38 -38
  21. package/dist/module/CallingClient/constants.js +122 -122
  22. package/dist/module/CallingClient/line/index.js +110 -110
  23. package/dist/module/CallingClient/line/types.js +14 -14
  24. package/dist/module/CallingClient/registration/index.js +1 -1
  25. package/dist/module/CallingClient/registration/register.js +507 -507
  26. package/dist/module/CallingClient/registration/registerFixtures.js +28 -28
  27. package/dist/module/CallingClient/registration/types.js +1 -1
  28. package/dist/module/CallingClient/types.js +1 -1
  29. package/dist/module/Contacts/ContactsClient.js +487 -487
  30. package/dist/module/Contacts/constants.js +20 -20
  31. package/dist/module/Contacts/contactFixtures.js +284 -284
  32. package/dist/module/Contacts/types.js +10 -10
  33. package/dist/module/Errors/catalog/CallError.js +26 -26
  34. package/dist/module/Errors/catalog/CallingDeviceError.js +18 -18
  35. package/dist/module/Errors/catalog/ExtendedError.js +10 -10
  36. package/dist/module/Errors/catalog/LineError.js +24 -24
  37. package/dist/module/Errors/index.js +2 -2
  38. package/dist/module/Errors/types.js +48 -48
  39. package/dist/module/Events/impl/index.js +19 -19
  40. package/dist/module/Events/types.js +74 -74
  41. package/dist/module/Logger/index.js +114 -114
  42. package/dist/module/Logger/types.js +25 -25
  43. package/dist/module/Metrics/index.js +232 -232
  44. package/dist/module/Metrics/types.js +37 -37
  45. package/dist/module/SDKConnector/index.js +39 -39
  46. package/dist/module/SDKConnector/types.js +1 -1
  47. package/dist/module/SDKConnector/utils.js +12 -12
  48. package/dist/module/Voicemail/BroadworksBackendConnector.js +289 -289
  49. package/dist/module/Voicemail/UcmBackendConnector.js +275 -275
  50. package/dist/module/Voicemail/Voicemail.js +110 -110
  51. package/dist/module/Voicemail/WxCallBackendConnector.js +279 -279
  52. package/dist/module/Voicemail/constants.js +29 -29
  53. package/dist/module/Voicemail/types.js +1 -1
  54. package/dist/module/Voicemail/voicemailFixture.js +449 -449
  55. package/dist/module/common/Utils.js +802 -802
  56. package/dist/module/common/constants.js +40 -40
  57. package/dist/module/common/index.js +1 -1
  58. package/dist/module/common/testUtil.js +938 -938
  59. package/dist/module/common/types.js +57 -57
  60. package/dist/module/index.js +8 -8
  61. package/dist/types/CallHistory/CallHistory.d.ts +18 -18
  62. package/dist/types/CallHistory/callHistoryFixtures.d.ts +94 -94
  63. package/dist/types/CallHistory/constants.d.ts +9 -9
  64. package/dist/types/CallHistory/types.d.ts +20 -20
  65. package/dist/types/CallSettings/CallSettings.d.ts +19 -19
  66. package/dist/types/CallSettings/UcmBackendConnector.d.ts +19 -19
  67. package/dist/types/CallSettings/WxCallBackendConnector.d.ts +21 -21
  68. package/dist/types/CallSettings/constants.d.ts +11 -11
  69. package/dist/types/CallSettings/testFixtures.d.ts +15 -15
  70. package/dist/types/CallSettings/types.d.ts +107 -107
  71. package/dist/types/CallingClient/CallingClient.d.ts +37 -37
  72. package/dist/types/CallingClient/callRecordFixtures.d.ts +3 -3
  73. package/dist/types/CallingClient/calling/CallerId/index.d.ts +17 -17
  74. package/dist/types/CallingClient/calling/CallerId/types.d.ts +41 -41
  75. package/dist/types/CallingClient/calling/call.d.ts +94 -94
  76. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  77. package/dist/types/CallingClient/calling/callManager.d.ts +21 -21
  78. package/dist/types/CallingClient/calling/index.d.ts +2 -2
  79. package/dist/types/CallingClient/calling/types.d.ts +203 -203
  80. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  81. package/dist/types/CallingClient/callingClientFixtures.d.ts +18 -18
  82. package/dist/types/CallingClient/constants.d.ts +122 -122
  83. package/dist/types/CallingClient/line/index.d.ts +38 -38
  84. package/dist/types/CallingClient/line/types.d.ts +50 -50
  85. package/dist/types/CallingClient/registration/index.d.ts +1 -1
  86. package/dist/types/CallingClient/registration/register.d.ts +64 -64
  87. package/dist/types/CallingClient/registration/registerFixtures.d.ts +28 -28
  88. package/dist/types/CallingClient/registration/types.d.ts +20 -20
  89. package/dist/types/CallingClient/types.d.ts +29 -29
  90. package/dist/types/Contacts/ContactsClient.d.ts +27 -27
  91. package/dist/types/Contacts/constants.d.ts +19 -19
  92. package/dist/types/Contacts/contactFixtures.d.ts +280 -280
  93. package/dist/types/Contacts/types.d.ts +74 -74
  94. package/dist/types/Errors/catalog/CallError.d.ts +11 -11
  95. package/dist/types/Errors/catalog/CallingDeviceError.d.ts +10 -10
  96. package/dist/types/Errors/catalog/ExtendedError.d.ts +6 -6
  97. package/dist/types/Errors/catalog/LineError.d.ts +10 -10
  98. package/dist/types/Errors/index.d.ts +2 -2
  99. package/dist/types/Errors/types.d.ts +60 -60
  100. package/dist/types/Events/impl/index.d.ts +8 -8
  101. package/dist/types/Events/types.d.ts +283 -283
  102. package/dist/types/Logger/index.d.ts +12 -12
  103. package/dist/types/Logger/types.d.ts +25 -25
  104. package/dist/types/Metrics/index.d.ts +5 -5
  105. package/dist/types/Metrics/types.d.ts +42 -42
  106. package/dist/types/SDKConnector/index.d.ts +12 -12
  107. package/dist/types/SDKConnector/types.d.ts +128 -128
  108. package/dist/types/SDKConnector/utils.d.ts +5 -5
  109. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts +27 -27
  110. package/dist/types/Voicemail/UcmBackendConnector.d.ts +34 -34
  111. package/dist/types/Voicemail/Voicemail.d.ts +27 -27
  112. package/dist/types/Voicemail/WxCallBackendConnector.d.ts +23 -23
  113. package/dist/types/Voicemail/constants.d.ts +29 -29
  114. package/dist/types/Voicemail/types.d.ts +133 -133
  115. package/dist/types/Voicemail/voicemailFixture.d.ts +349 -349
  116. package/dist/types/common/Utils.d.ts +34 -34
  117. package/dist/types/common/constants.d.ts +40 -40
  118. package/dist/types/common/index.d.ts +1 -1
  119. package/dist/types/common/testUtil.d.ts +3611 -3611
  120. package/dist/types/common/types.d.ts +191 -191
  121. package/dist/types/index.d.ts +8 -8
  122. package/package.json +6 -41
@@ -1,232 +1,232 @@
1
- import { METRIC_FILE, VERSION } from '../CallingClient/constants';
2
- import { METRIC_EVENT } from './types';
3
- import log from '../Logger';
4
- let metricManager;
5
- class MetricManager {
6
- webex;
7
- deviceInfo;
8
- serviceIndicator;
9
- constructor(webex, indicator) {
10
- log.info('Initializing metric manager...', { file: METRIC_FILE });
11
- this.webex = webex;
12
- this.serviceIndicator = indicator;
13
- }
14
- setDeviceInfo(deviceInfo) {
15
- this.deviceInfo = deviceInfo;
16
- }
17
- submitRegistrationMetric(name, metricAction, type, clientError) {
18
- let data;
19
- switch (name) {
20
- case METRIC_EVENT.REGISTRATION: {
21
- data = {
22
- tags: {
23
- action: metricAction,
24
- device_id: this.deviceInfo?.device?.deviceId,
25
- service_indicator: this.serviceIndicator,
26
- },
27
- fields: {
28
- device_url: this.deviceInfo?.device?.clientDeviceUri,
29
- mobius_url: this.deviceInfo?.device?.uri,
30
- calling_sdk_version: VERSION,
31
- },
32
- type,
33
- };
34
- break;
35
- }
36
- case METRIC_EVENT.REGISTRATION_ERROR: {
37
- if (clientError) {
38
- data = {
39
- tags: {
40
- action: metricAction,
41
- device_id: this.deviceInfo?.device?.deviceId,
42
- service_indicator: this.serviceIndicator,
43
- },
44
- fields: {
45
- device_url: this.deviceInfo?.device?.clientDeviceUri,
46
- mobius_url: this.deviceInfo?.device?.uri,
47
- calling_sdk_version: VERSION,
48
- error: clientError.getError().message,
49
- error_type: clientError.getError().type,
50
- },
51
- type,
52
- };
53
- }
54
- break;
55
- }
56
- default:
57
- log.warn('Invalid metric name received. Rejecting request to submit metric.', {
58
- file: METRIC_FILE,
59
- method: this.submitRegistrationMetric.name,
60
- });
61
- break;
62
- }
63
- if (data) {
64
- this.webex.internal.metrics.submitClientMetrics(name, data);
65
- }
66
- }
67
- submitCallMetric(name, metricAction, type, callId, correlationId, callError) {
68
- let data;
69
- switch (name) {
70
- case METRIC_EVENT.CALL: {
71
- data = {
72
- tags: {
73
- action: metricAction,
74
- device_id: this.deviceInfo?.device?.deviceId,
75
- service_indicator: this.serviceIndicator,
76
- },
77
- fields: {
78
- device_url: this.deviceInfo?.device?.clientDeviceUri,
79
- mobius_url: this.deviceInfo?.device?.uri,
80
- calling_sdk_version: VERSION,
81
- call_id: callId,
82
- correlation_id: correlationId,
83
- },
84
- type,
85
- };
86
- break;
87
- }
88
- case METRIC_EVENT.CALL_ERROR: {
89
- if (callError) {
90
- data = {
91
- tags: {
92
- action: metricAction,
93
- device_id: this.deviceInfo?.device?.deviceId,
94
- service_indicator: this.serviceIndicator,
95
- },
96
- fields: {
97
- device_url: this.deviceInfo?.device?.clientDeviceUri,
98
- mobius_url: this.deviceInfo?.device?.uri,
99
- calling_sdk_version: VERSION,
100
- call_id: callId,
101
- correlation_id: correlationId,
102
- error: callError.getCallError().message,
103
- error_type: callError.getCallError().type,
104
- },
105
- type,
106
- };
107
- }
108
- break;
109
- }
110
- default:
111
- log.warn('Invalid metric name received. Rejecting request to submit metric.', {
112
- file: METRIC_FILE,
113
- method: this.submitCallMetric.name,
114
- });
115
- break;
116
- }
117
- if (data) {
118
- this.webex.internal.metrics.submitClientMetrics(name, data);
119
- }
120
- }
121
- submitMediaMetric(name, metricAction, type, callId, correlationId, localSdp, remoteSdp, callError) {
122
- let data;
123
- switch (name) {
124
- case METRIC_EVENT.MEDIA: {
125
- data = {
126
- tags: {
127
- action: metricAction,
128
- device_id: this.deviceInfo?.device?.deviceId,
129
- service_indicator: this.serviceIndicator,
130
- },
131
- fields: {
132
- device_url: this.deviceInfo?.device?.clientDeviceUri,
133
- mobius_url: this.deviceInfo?.device?.uri,
134
- calling_sdk_version: VERSION,
135
- call_id: callId,
136
- correlation_id: correlationId,
137
- local_media_details: localSdp,
138
- remote_media_details: remoteSdp,
139
- },
140
- type,
141
- };
142
- break;
143
- }
144
- case METRIC_EVENT.MEDIA_ERROR: {
145
- if (callError) {
146
- data = {
147
- tags: {
148
- action: metricAction,
149
- device_id: this.deviceInfo?.device?.deviceId,
150
- service_indicator: this.serviceIndicator,
151
- },
152
- fields: {
153
- device_url: this.deviceInfo?.device?.clientDeviceUri,
154
- mobius_url: this.deviceInfo?.device?.uri,
155
- calling_sdk_version: VERSION,
156
- call_id: callId,
157
- correlation_id: correlationId,
158
- local_media_details: localSdp,
159
- remote_media_details: remoteSdp,
160
- error: callError.getCallError().message,
161
- error_type: callError.getCallError().type,
162
- },
163
- type,
164
- };
165
- }
166
- break;
167
- }
168
- default:
169
- log.warn('Invalid metric name received. Rejecting request to submit metric.', {
170
- file: METRIC_FILE,
171
- method: this.submitMediaMetric.name,
172
- });
173
- break;
174
- }
175
- if (data) {
176
- this.webex.internal.metrics.submitClientMetrics(name, data);
177
- }
178
- }
179
- submitVoicemailMetric(name, metricAction, type, messageId, voicemailError, statusCode) {
180
- let data;
181
- switch (name) {
182
- case METRIC_EVENT.VOICEMAIL: {
183
- data = {
184
- tags: {
185
- action: metricAction,
186
- device_id: this.deviceInfo?.device?.deviceId,
187
- message_id: messageId,
188
- },
189
- fields: {
190
- device_url: this.deviceInfo?.device?.clientDeviceUri,
191
- calling_sdk_version: VERSION,
192
- },
193
- type,
194
- };
195
- break;
196
- }
197
- case METRIC_EVENT.VOICEMAIL_ERROR: {
198
- data = {
199
- tags: {
200
- action: metricAction,
201
- device_id: this.deviceInfo?.device?.deviceId,
202
- message_id: messageId,
203
- error: voicemailError,
204
- status_code: statusCode,
205
- },
206
- fields: {
207
- device_url: this.deviceInfo?.device?.clientDeviceUri,
208
- calling_sdk_version: VERSION,
209
- },
210
- type,
211
- };
212
- break;
213
- }
214
- default:
215
- log.warn('Invalid metric name received. Rejecting request to submit metric.', {
216
- file: METRIC_FILE,
217
- method: this.submitVoicemailMetric.name,
218
- });
219
- break;
220
- }
221
- if (data) {
222
- this.webex.internal.metrics.submitClientMetrics(name, data);
223
- }
224
- }
225
- }
226
- export const getMetricManager = (webex, indicator) => {
227
- if (!metricManager) {
228
- metricManager = new MetricManager(webex, indicator);
229
- }
230
- return metricManager;
231
- };
232
- export default getMetricManager;
1
+ import { METRIC_FILE, VERSION } from '../CallingClient/constants';
2
+ import { METRIC_EVENT } from './types';
3
+ import log from '../Logger';
4
+ let metricManager;
5
+ class MetricManager {
6
+ webex;
7
+ deviceInfo;
8
+ serviceIndicator;
9
+ constructor(webex, indicator) {
10
+ log.info('Initializing metric manager...', { file: METRIC_FILE });
11
+ this.webex = webex;
12
+ this.serviceIndicator = indicator;
13
+ }
14
+ setDeviceInfo(deviceInfo) {
15
+ this.deviceInfo = deviceInfo;
16
+ }
17
+ submitRegistrationMetric(name, metricAction, type, clientError) {
18
+ let data;
19
+ switch (name) {
20
+ case METRIC_EVENT.REGISTRATION: {
21
+ data = {
22
+ tags: {
23
+ action: metricAction,
24
+ device_id: this.deviceInfo?.device?.deviceId,
25
+ service_indicator: this.serviceIndicator,
26
+ },
27
+ fields: {
28
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
29
+ mobius_url: this.deviceInfo?.device?.uri,
30
+ calling_sdk_version: VERSION,
31
+ },
32
+ type,
33
+ };
34
+ break;
35
+ }
36
+ case METRIC_EVENT.REGISTRATION_ERROR: {
37
+ if (clientError) {
38
+ data = {
39
+ tags: {
40
+ action: metricAction,
41
+ device_id: this.deviceInfo?.device?.deviceId,
42
+ service_indicator: this.serviceIndicator,
43
+ },
44
+ fields: {
45
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
46
+ mobius_url: this.deviceInfo?.device?.uri,
47
+ calling_sdk_version: VERSION,
48
+ error: clientError.getError().message,
49
+ error_type: clientError.getError().type,
50
+ },
51
+ type,
52
+ };
53
+ }
54
+ break;
55
+ }
56
+ default:
57
+ log.warn('Invalid metric name received. Rejecting request to submit metric.', {
58
+ file: METRIC_FILE,
59
+ method: this.submitRegistrationMetric.name,
60
+ });
61
+ break;
62
+ }
63
+ if (data) {
64
+ this.webex.internal.metrics.submitClientMetrics(name, data);
65
+ }
66
+ }
67
+ submitCallMetric(name, metricAction, type, callId, correlationId, callError) {
68
+ let data;
69
+ switch (name) {
70
+ case METRIC_EVENT.CALL: {
71
+ data = {
72
+ tags: {
73
+ action: metricAction,
74
+ device_id: this.deviceInfo?.device?.deviceId,
75
+ service_indicator: this.serviceIndicator,
76
+ },
77
+ fields: {
78
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
79
+ mobius_url: this.deviceInfo?.device?.uri,
80
+ calling_sdk_version: VERSION,
81
+ call_id: callId,
82
+ correlation_id: correlationId,
83
+ },
84
+ type,
85
+ };
86
+ break;
87
+ }
88
+ case METRIC_EVENT.CALL_ERROR: {
89
+ if (callError) {
90
+ data = {
91
+ tags: {
92
+ action: metricAction,
93
+ device_id: this.deviceInfo?.device?.deviceId,
94
+ service_indicator: this.serviceIndicator,
95
+ },
96
+ fields: {
97
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
98
+ mobius_url: this.deviceInfo?.device?.uri,
99
+ calling_sdk_version: VERSION,
100
+ call_id: callId,
101
+ correlation_id: correlationId,
102
+ error: callError.getCallError().message,
103
+ error_type: callError.getCallError().type,
104
+ },
105
+ type,
106
+ };
107
+ }
108
+ break;
109
+ }
110
+ default:
111
+ log.warn('Invalid metric name received. Rejecting request to submit metric.', {
112
+ file: METRIC_FILE,
113
+ method: this.submitCallMetric.name,
114
+ });
115
+ break;
116
+ }
117
+ if (data) {
118
+ this.webex.internal.metrics.submitClientMetrics(name, data);
119
+ }
120
+ }
121
+ submitMediaMetric(name, metricAction, type, callId, correlationId, localSdp, remoteSdp, callError) {
122
+ let data;
123
+ switch (name) {
124
+ case METRIC_EVENT.MEDIA: {
125
+ data = {
126
+ tags: {
127
+ action: metricAction,
128
+ device_id: this.deviceInfo?.device?.deviceId,
129
+ service_indicator: this.serviceIndicator,
130
+ },
131
+ fields: {
132
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
133
+ mobius_url: this.deviceInfo?.device?.uri,
134
+ calling_sdk_version: VERSION,
135
+ call_id: callId,
136
+ correlation_id: correlationId,
137
+ local_media_details: localSdp,
138
+ remote_media_details: remoteSdp,
139
+ },
140
+ type,
141
+ };
142
+ break;
143
+ }
144
+ case METRIC_EVENT.MEDIA_ERROR: {
145
+ if (callError) {
146
+ data = {
147
+ tags: {
148
+ action: metricAction,
149
+ device_id: this.deviceInfo?.device?.deviceId,
150
+ service_indicator: this.serviceIndicator,
151
+ },
152
+ fields: {
153
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
154
+ mobius_url: this.deviceInfo?.device?.uri,
155
+ calling_sdk_version: VERSION,
156
+ call_id: callId,
157
+ correlation_id: correlationId,
158
+ local_media_details: localSdp,
159
+ remote_media_details: remoteSdp,
160
+ error: callError.getCallError().message,
161
+ error_type: callError.getCallError().type,
162
+ },
163
+ type,
164
+ };
165
+ }
166
+ break;
167
+ }
168
+ default:
169
+ log.warn('Invalid metric name received. Rejecting request to submit metric.', {
170
+ file: METRIC_FILE,
171
+ method: this.submitMediaMetric.name,
172
+ });
173
+ break;
174
+ }
175
+ if (data) {
176
+ this.webex.internal.metrics.submitClientMetrics(name, data);
177
+ }
178
+ }
179
+ submitVoicemailMetric(name, metricAction, type, messageId, voicemailError, statusCode) {
180
+ let data;
181
+ switch (name) {
182
+ case METRIC_EVENT.VOICEMAIL: {
183
+ data = {
184
+ tags: {
185
+ action: metricAction,
186
+ device_id: this.deviceInfo?.device?.deviceId,
187
+ message_id: messageId,
188
+ },
189
+ fields: {
190
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
191
+ calling_sdk_version: VERSION,
192
+ },
193
+ type,
194
+ };
195
+ break;
196
+ }
197
+ case METRIC_EVENT.VOICEMAIL_ERROR: {
198
+ data = {
199
+ tags: {
200
+ action: metricAction,
201
+ device_id: this.deviceInfo?.device?.deviceId,
202
+ message_id: messageId,
203
+ error: voicemailError,
204
+ status_code: statusCode,
205
+ },
206
+ fields: {
207
+ device_url: this.deviceInfo?.device?.clientDeviceUri,
208
+ calling_sdk_version: VERSION,
209
+ },
210
+ type,
211
+ };
212
+ break;
213
+ }
214
+ default:
215
+ log.warn('Invalid metric name received. Rejecting request to submit metric.', {
216
+ file: METRIC_FILE,
217
+ method: this.submitVoicemailMetric.name,
218
+ });
219
+ break;
220
+ }
221
+ if (data) {
222
+ this.webex.internal.metrics.submitClientMetrics(name, data);
223
+ }
224
+ }
225
+ }
226
+ export const getMetricManager = (webex, indicator) => {
227
+ if (!metricManager) {
228
+ metricManager = new MetricManager(webex, indicator);
229
+ }
230
+ return metricManager;
231
+ };
232
+ export default getMetricManager;
@@ -1,37 +1,37 @@
1
- export var METRIC_TYPE;
2
- (function (METRIC_TYPE) {
3
- METRIC_TYPE["OPERATIONAL"] = "operational";
4
- METRIC_TYPE["BEHAVIORAL"] = "behavioral";
5
- })(METRIC_TYPE || (METRIC_TYPE = {}));
6
- export var METRIC_EVENT;
7
- (function (METRIC_EVENT) {
8
- METRIC_EVENT["CALL"] = "web-calling-sdk-callcontrol";
9
- METRIC_EVENT["CALL_ERROR"] = "web-calling-sdk-callcontrol-error";
10
- METRIC_EVENT["MEDIA"] = "web-calling-sdk-media";
11
- METRIC_EVENT["MEDIA_ERROR"] = "web-calling-sdk-media-error";
12
- METRIC_EVENT["REGISTRATION"] = "web-calling-sdk-registration";
13
- METRIC_EVENT["REGISTRATION_ERROR"] = "web-calling-sdk-registration-error";
14
- METRIC_EVENT["VOICEMAIL"] = "web-calling-sdk-voicemail";
15
- METRIC_EVENT["VOICEMAIL_ERROR"] = "web-calling-sdk-voicemail-error";
16
- })(METRIC_EVENT || (METRIC_EVENT = {}));
17
- export var REG_ACTION;
18
- (function (REG_ACTION) {
19
- REG_ACTION["REGISTER"] = "register";
20
- REG_ACTION["DEREGISTER"] = "deregister";
21
- REG_ACTION["KEEPALIVE_FAILURE"] = "keepaliveFailure";
22
- })(REG_ACTION || (REG_ACTION = {}));
23
- export var TRANSFER_ACTION;
24
- (function (TRANSFER_ACTION) {
25
- TRANSFER_ACTION["BLIND"] = "TRANSFER_BLIND";
26
- TRANSFER_ACTION["CONSULT"] = "TRANSFER_CONSULT";
27
- })(TRANSFER_ACTION || (TRANSFER_ACTION = {}));
28
- export var VOICEMAIL_ACTION;
29
- (function (VOICEMAIL_ACTION) {
30
- VOICEMAIL_ACTION["GET_VOICEMAILS"] = "get_voicemails";
31
- VOICEMAIL_ACTION["GET_VOICEMAIL_CONTENT"] = "get_voicemail_content";
32
- VOICEMAIL_ACTION["GET_VOICEMAIL_SUMMARY"] = "get_voicemail_summary";
33
- VOICEMAIL_ACTION["MARK_READ"] = "mark_read";
34
- VOICEMAIL_ACTION["MARK_UNREAD"] = "mark_unread";
35
- VOICEMAIL_ACTION["DELETE"] = "delete";
36
- VOICEMAIL_ACTION["TRANSCRIPT"] = "transcript";
37
- })(VOICEMAIL_ACTION || (VOICEMAIL_ACTION = {}));
1
+ export var METRIC_TYPE;
2
+ (function (METRIC_TYPE) {
3
+ METRIC_TYPE["OPERATIONAL"] = "operational";
4
+ METRIC_TYPE["BEHAVIORAL"] = "behavioral";
5
+ })(METRIC_TYPE || (METRIC_TYPE = {}));
6
+ export var METRIC_EVENT;
7
+ (function (METRIC_EVENT) {
8
+ METRIC_EVENT["CALL"] = "web-calling-sdk-callcontrol";
9
+ METRIC_EVENT["CALL_ERROR"] = "web-calling-sdk-callcontrol-error";
10
+ METRIC_EVENT["MEDIA"] = "web-calling-sdk-media";
11
+ METRIC_EVENT["MEDIA_ERROR"] = "web-calling-sdk-media-error";
12
+ METRIC_EVENT["REGISTRATION"] = "web-calling-sdk-registration";
13
+ METRIC_EVENT["REGISTRATION_ERROR"] = "web-calling-sdk-registration-error";
14
+ METRIC_EVENT["VOICEMAIL"] = "web-calling-sdk-voicemail";
15
+ METRIC_EVENT["VOICEMAIL_ERROR"] = "web-calling-sdk-voicemail-error";
16
+ })(METRIC_EVENT || (METRIC_EVENT = {}));
17
+ export var REG_ACTION;
18
+ (function (REG_ACTION) {
19
+ REG_ACTION["REGISTER"] = "register";
20
+ REG_ACTION["DEREGISTER"] = "deregister";
21
+ REG_ACTION["KEEPALIVE_FAILURE"] = "keepaliveFailure";
22
+ })(REG_ACTION || (REG_ACTION = {}));
23
+ export var TRANSFER_ACTION;
24
+ (function (TRANSFER_ACTION) {
25
+ TRANSFER_ACTION["BLIND"] = "TRANSFER_BLIND";
26
+ TRANSFER_ACTION["CONSULT"] = "TRANSFER_CONSULT";
27
+ })(TRANSFER_ACTION || (TRANSFER_ACTION = {}));
28
+ export var VOICEMAIL_ACTION;
29
+ (function (VOICEMAIL_ACTION) {
30
+ VOICEMAIL_ACTION["GET_VOICEMAILS"] = "get_voicemails";
31
+ VOICEMAIL_ACTION["GET_VOICEMAIL_CONTENT"] = "get_voicemail_content";
32
+ VOICEMAIL_ACTION["GET_VOICEMAIL_SUMMARY"] = "get_voicemail_summary";
33
+ VOICEMAIL_ACTION["MARK_READ"] = "mark_read";
34
+ VOICEMAIL_ACTION["MARK_UNREAD"] = "mark_unread";
35
+ VOICEMAIL_ACTION["DELETE"] = "delete";
36
+ VOICEMAIL_ACTION["TRANSCRIPT"] = "transcript";
37
+ })(VOICEMAIL_ACTION || (VOICEMAIL_ACTION = {}));
@@ -1,39 +1,39 @@
1
- import { validateWebex } from './utils';
2
- let instance;
3
- let webex;
4
- class SDKConnector {
5
- setWebex(webexInstance) {
6
- if (instance) {
7
- throw new Error('You cannot set the SDKConnector instance more than once');
8
- }
9
- const { error, success } = validateWebex(webexInstance);
10
- if (error) {
11
- throw error;
12
- }
13
- else if (success) {
14
- webex = webexInstance;
15
- }
16
- else {
17
- throw new Error('An unknown error occurred setting up the webex instance.');
18
- }
19
- instance = this;
20
- }
21
- get() {
22
- return instance;
23
- }
24
- getWebex() {
25
- return webex;
26
- }
27
- request(request) {
28
- return instance.getWebex().request(request);
29
- }
30
- registerListener(event, cb) {
31
- instance.getWebex().internal.mercury.on(event, (data) => {
32
- cb(data);
33
- });
34
- }
35
- unregisterListener(event) {
36
- instance.getWebex().internal.mercury.off(event);
37
- }
38
- }
39
- export default Object.freeze(new SDKConnector());
1
+ import { validateWebex } from './utils';
2
+ let instance;
3
+ let webex;
4
+ class SDKConnector {
5
+ setWebex(webexInstance) {
6
+ if (instance) {
7
+ throw new Error('You cannot set the SDKConnector instance more than once');
8
+ }
9
+ const { error, success } = validateWebex(webexInstance);
10
+ if (error) {
11
+ throw error;
12
+ }
13
+ else if (success) {
14
+ webex = webexInstance;
15
+ }
16
+ else {
17
+ throw new Error('An unknown error occurred setting up the webex instance.');
18
+ }
19
+ instance = this;
20
+ }
21
+ get() {
22
+ return instance;
23
+ }
24
+ getWebex() {
25
+ return webex;
26
+ }
27
+ request(request) {
28
+ return instance.getWebex().request(request);
29
+ }
30
+ registerListener(event, cb) {
31
+ instance.getWebex().internal.mercury.on(event, (data) => {
32
+ cb(data);
33
+ });
34
+ }
35
+ unregisterListener(event) {
36
+ instance.getWebex().internal.mercury.off(event);
37
+ }
38
+ }
39
+ export default Object.freeze(new SDKConnector());
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,12 +1,12 @@
1
- export const validateWebex = (webexInstance) => {
2
- if (webexInstance.canAuthorize) {
3
- if (webexInstance.ready) {
4
- if (webexInstance.internal.mercury) {
5
- return { error: undefined, success: true };
6
- }
7
- return { error: new Error('webex.internal.mercury is not available'), success: false };
8
- }
9
- return { error: new Error('webex.ready is not true'), success: false };
10
- }
11
- return { error: new Error('webex.canAuthorize is not true'), success: false };
12
- };
1
+ export const validateWebex = (webexInstance) => {
2
+ if (webexInstance.canAuthorize) {
3
+ if (webexInstance.ready) {
4
+ if (webexInstance.internal.mercury) {
5
+ return { error: undefined, success: true };
6
+ }
7
+ return { error: new Error('webex.internal.mercury is not available'), success: false };
8
+ }
9
+ return { error: new Error('webex.ready is not true'), success: false };
10
+ }
11
+ return { error: new Error('webex.canAuthorize is not true'), success: false };
12
+ };