@webex/internal-plugin-metrics 3.0.0-beta.26 → 3.0.0-beta.261
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/call-diagnostic/call-diagnostic-metrics-batcher.js +65 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +446 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.js +728 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +281 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
- package/dist/call-diagnostic/config.js +620 -0
- package/dist/call-diagnostic/config.js.map +1 -0
- package/dist/config.js +20 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +30 -30
- package/dist/metrics.js.map +1 -1
- package/dist/metrics.types.js +7 -0
- package/dist/metrics.types.js.map +1 -0
- package/dist/new-metrics.js +333 -0
- package/dist/new-metrics.js.map +1 -0
- package/dist/types/batcher.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +189 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +391 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +73 -0
- package/dist/types/call-diagnostic/config.d.ts +91 -0
- package/dist/types/client-metrics-batcher.d.ts +2 -0
- package/dist/types/config.d.ts +35 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/metrics.d.ts +3 -0
- package/dist/types/metrics.types.d.ts +99 -0
- package/dist/types/new-metrics.d.ts +139 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/utils.js +27 -0
- package/dist/utils.js.map +1 -0
- package/package.json +13 -8
- package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +82 -0
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +403 -0
- package/src/call-diagnostic/call-diagnostic-metrics.ts +784 -0
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +291 -0
- package/src/call-diagnostic/config.ts +618 -0
- package/src/config.js +19 -0
- package/src/index.ts +43 -0
- package/src/metrics.js +25 -27
- package/src/metrics.types.ts +152 -0
- package/src/new-metrics.ts +317 -0
- package/src/utils.ts +17 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +394 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +465 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +1550 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +479 -0
- package/test/unit/spec/metrics.js +65 -97
- package/test/unit/spec/new-metrics.ts +269 -0
- package/test/unit/spec/utils.ts +22 -0
- package/tsconfig.json +6 -0
- package/dist/call-diagnostic-events-batcher.js +0 -60
- package/dist/call-diagnostic-events-batcher.js.map +0 -1
- package/src/call-diagnostic-events-batcher.js +0 -62
- package/src/index.js +0 -17
- package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { StatelessWebexPlugin } from '@webex/webex-core';
|
|
2
|
+
import { Event, ClientType, SubClientType, NetworkType, EnvironmentType, NewEnvironmentType, ClientEvent, SubmitClientEventOptions, MediaQualityEvent, SubmitMQEOptions, SubmitMQEPayload, ClientLaunchMethodType, ClientEventError, ClientEventPayload } from '../metrics.types';
|
|
3
|
+
type GetOriginOptions = {
|
|
4
|
+
clientType: ClientType;
|
|
5
|
+
subClientType: SubClientType;
|
|
6
|
+
networkType?: NetworkType;
|
|
7
|
+
clientLaunchMethod?: ClientLaunchMethodType;
|
|
8
|
+
environment?: EnvironmentType;
|
|
9
|
+
newEnvironment?: NewEnvironmentType;
|
|
10
|
+
};
|
|
11
|
+
type GetIdentifiersOptions = {
|
|
12
|
+
meeting?: any;
|
|
13
|
+
mediaConnections?: any[];
|
|
14
|
+
correlationId?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @description Util class to handle Call Analyzer Metrics
|
|
18
|
+
* @export
|
|
19
|
+
* @class CallDiagnosticMetrics
|
|
20
|
+
*/
|
|
21
|
+
export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
22
|
+
private callDiagnosticEventsBatcher;
|
|
23
|
+
private logger;
|
|
24
|
+
/**
|
|
25
|
+
* Constructor
|
|
26
|
+
* @param args
|
|
27
|
+
*/
|
|
28
|
+
constructor(...args: any[]);
|
|
29
|
+
/**
|
|
30
|
+
* Returns the login type of the current user
|
|
31
|
+
* @returns one of 'login-ci','unverified-guest', null
|
|
32
|
+
*/
|
|
33
|
+
getCurLoginType(): "unverified-guest" | "login-ci";
|
|
34
|
+
/**
|
|
35
|
+
* Returns if the meeting has converged architecture enabled
|
|
36
|
+
* @param options.meetingId
|
|
37
|
+
*/
|
|
38
|
+
getIsConvergedArchitectureEnabled({ meetingId }: {
|
|
39
|
+
meetingId?: string;
|
|
40
|
+
}): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get origin object for Call Diagnostic Event payload.
|
|
43
|
+
* @param options
|
|
44
|
+
* @param meetingId
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
getOrigin(options: GetOriginOptions, meetingId?: string): {
|
|
48
|
+
name: "endpoint" | "antares" | "beech" | "breakout" | "cb" | "cloudproxy" | "edonus" | "givr" | "hecate" | "hedge" | "hesiod" | "homer" | "superhomer" | "l2sip" | "linus" | "locus" | "mcc" | "mcs" | "mercury" | "mes" | "mjs" | "mmp" | "mygdon" | "orpheus" | "page" | "poros" | "rhesos" | "terminus" | "tpgw" | "ucc" | "wdm" | "webexivr";
|
|
49
|
+
userAgent: string;
|
|
50
|
+
buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
|
|
51
|
+
upgradeChannel?: string;
|
|
52
|
+
instanceId?: string;
|
|
53
|
+
networkType: "wifi" | "ethernet" | "cellular" | "unknown";
|
|
54
|
+
localIP?: string;
|
|
55
|
+
usingProxy?: boolean;
|
|
56
|
+
mediaEngineSoftwareVersion?: string;
|
|
57
|
+
environment?: string;
|
|
58
|
+
newEnvironment?: string;
|
|
59
|
+
clientInfo?: {
|
|
60
|
+
os?: "windows" | "mac" | "ios" | "android" | "chrome" | "linux" | "other" | "android-x64" | "uwp-arm64";
|
|
61
|
+
osVersion?: string;
|
|
62
|
+
localIP?: string;
|
|
63
|
+
gatewayIP?: string;
|
|
64
|
+
macAddress?: string;
|
|
65
|
+
localNetworkPrefix?: string;
|
|
66
|
+
publicNetworkPrefix?: string;
|
|
67
|
+
browserLaunchMethod?: "url-handler" | "activex" | "npapi" | "extension" | "cwsapi" | "java" | "tfs" | "webacd" | "thinclient";
|
|
68
|
+
clientLaunchMethod?: "url-handler" | "universal-link" | "voice-command" | "notification" | "manual" | "teams-cross-launch" | "mc-cross-launch";
|
|
69
|
+
browser?: string;
|
|
70
|
+
browserVersion?: string;
|
|
71
|
+
clientType?: "MEETING_CENTER" | "EVENT_CENTER" | "TRAINING_CENTER" | "TEAMS_CLIENT" | "TEAMS_DEVICE" | "TEAMS_SHARE" | "SIP" | "RECORDING" | "CLOUD_AWARE_SIP" | "TEAMS_WXC_CLIENT" | "WXC_CLIENT" | "WXC_DEVICE" | "WEBEX_JS_SDK" | "VOICEA_CLIENT" | "CISCO_SIP_GW" | "WEBEX_SDK" | "CPAAS_THIRD_PARTY_SDK" | "WXC_THIRD_PARTY" | "WXCC"; /**
|
|
72
|
+
* Returns if the meeting has converged architecture enabled
|
|
73
|
+
* @param options.meetingId
|
|
74
|
+
*/
|
|
75
|
+
subClientType?: "TEAMS_DEVICE" | "DESKTOP_APP" | "DESKTOP_APP_VDI" | "DEVICE_CURRENT" | "DEVICE_LEGACY_2020" | "HOLOGRAM_HEADSET_APP" | "HVDI_APP" | "MOBILE_APP" | "MOBILE_NETWORK" | "VDI_APP" | "WEB_APP";
|
|
76
|
+
clientVersion?: string;
|
|
77
|
+
localClientVersion?: string;
|
|
78
|
+
modelNumber?: string;
|
|
79
|
+
joinFirstUpdateLater?: "ep-enabled" | "sp-enabled" | "not-enabled";
|
|
80
|
+
standbyUsed?: boolean;
|
|
81
|
+
prefetchDocShowUsed?: boolean;
|
|
82
|
+
fastJoinUsed?: boolean;
|
|
83
|
+
clientDownloadSize?: number;
|
|
84
|
+
clientDownloadFileCount?: number;
|
|
85
|
+
nodeId?: number;
|
|
86
|
+
machineInfo?: string;
|
|
87
|
+
parentAppName?: string;
|
|
88
|
+
parentAppInPermitList?: boolean;
|
|
89
|
+
meetingSiteType?: "train" | "webex-11" | "orion";
|
|
90
|
+
CDNEnabled?: boolean;
|
|
91
|
+
clientMajorVersion?: string;
|
|
92
|
+
majorVersion?: number;
|
|
93
|
+
minorVersion?: number;
|
|
94
|
+
revision?: number;
|
|
95
|
+
isValidClientVersion?: boolean;
|
|
96
|
+
cpuInfo?: {
|
|
97
|
+
description: string;
|
|
98
|
+
clockSpeedGigaHertz: number;
|
|
99
|
+
numberOfCores: number;
|
|
100
|
+
architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64";
|
|
101
|
+
staticPerformance?: string;
|
|
102
|
+
additionalProperties?: false;
|
|
103
|
+
};
|
|
104
|
+
shareType?: "cb-normal-share" | "ce-airplay-share" | "ce-direct-share" | "ce-gui-loopback-share" | "ce-input-source-share" | "ce-input-source-share-hdmi" | "ce-input-source-share-usbc" | "ce-jpg-share" | "ce-miracast-share" | "mcs-normal-share" | "mcs-normal-audio-share" | "mcs-hfps-share" | "mcs-hfps-audio-share";
|
|
105
|
+
videoDisplayMode?: "grid-view" | "active-speaker-view";
|
|
106
|
+
videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare";
|
|
107
|
+
videoRenderType?: "wme" | "client_d3d" | "client_gdi";
|
|
108
|
+
vdiInfo?: {};
|
|
109
|
+
is64BitsClient?: boolean;
|
|
110
|
+
webexAppVersion?: string;
|
|
111
|
+
launch32BitsReason?: "forcewin32" | "disablewin64" | "platform_win32" | "platform_arm" | "platform_unknown" | "version_below_41.11";
|
|
112
|
+
inMeetingUpdate?: boolean;
|
|
113
|
+
mtaVersion?: string;
|
|
114
|
+
isWarholOpening?: boolean;
|
|
115
|
+
additionalProperties?: false;
|
|
116
|
+
};
|
|
117
|
+
emmVendorId?: string;
|
|
118
|
+
isHybridMedia?: boolean;
|
|
119
|
+
originData?: {};
|
|
120
|
+
additionalProperties?: false;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Gather identifier details for call diagnostic payload.
|
|
124
|
+
* @throws Error if initialization fails.
|
|
125
|
+
* @param options
|
|
126
|
+
*/
|
|
127
|
+
getIdentifiers(options: GetIdentifiersOptions): {
|
|
128
|
+
attendeeId?: string;
|
|
129
|
+
breakoutGroupId?: string;
|
|
130
|
+
breakoutMoveId?: string;
|
|
131
|
+
breakoutSessionId?: string;
|
|
132
|
+
confluenceId?: string;
|
|
133
|
+
cpaasIdentifiers?: {
|
|
134
|
+
imiTenantId: string;
|
|
135
|
+
devClientId: string;
|
|
136
|
+
imiServiceId: string;
|
|
137
|
+
imiAppId: string;
|
|
138
|
+
sessionId: string;
|
|
139
|
+
sessionInstanceId: string;
|
|
140
|
+
additionalProperties?: false;
|
|
141
|
+
};
|
|
142
|
+
csdmDeviceUrl?: string;
|
|
143
|
+
destinationBreakoutSessionId?: string;
|
|
144
|
+
destinationLocusSessionId?: string;
|
|
145
|
+
destinationLocusUrl?: string;
|
|
146
|
+
destinationVenueId?: string;
|
|
147
|
+
deviceId?: string;
|
|
148
|
+
ivrCallId?: string;
|
|
149
|
+
ivrDialogId?: string;
|
|
150
|
+
ivrId?: string;
|
|
151
|
+
callId?: string;
|
|
152
|
+
locusId?: string;
|
|
153
|
+
locusSessionId?: string;
|
|
154
|
+
locusStartTime?: string;
|
|
155
|
+
locusUrl?: string;
|
|
156
|
+
mediaAgentAlias?: string;
|
|
157
|
+
mediaAgentGroupId?: string;
|
|
158
|
+
meetClusterName?: string;
|
|
159
|
+
meetingLookupUrl?: string;
|
|
160
|
+
meetingOrgId?: string;
|
|
161
|
+
msteamsTenantGuid?: string;
|
|
162
|
+
msteamsConferenceId?: string;
|
|
163
|
+
oauth2ClientId?: string;
|
|
164
|
+
orgId?: string;
|
|
165
|
+
provisionalCorrelationId?: string;
|
|
166
|
+
roomId?: string;
|
|
167
|
+
sipCallId?: string;
|
|
168
|
+
sipSessionId?: {
|
|
169
|
+
local?: string;
|
|
170
|
+
remote?: string;
|
|
171
|
+
additionalProperties?: false;
|
|
172
|
+
};
|
|
173
|
+
sipUri?: string;
|
|
174
|
+
subConfId?: string;
|
|
175
|
+
tenantId?: string;
|
|
176
|
+
trackingId?: string;
|
|
177
|
+
userId?: string;
|
|
178
|
+
venueId?: string;
|
|
179
|
+
venueUrl?: string;
|
|
180
|
+
whiteboardUrl?: string;
|
|
181
|
+
webexConferenceId?: number;
|
|
182
|
+
webexClusterName?: string;
|
|
183
|
+
webexConferenceIdStr?: string;
|
|
184
|
+
webexDataCenter?: string;
|
|
185
|
+
webexGuestId?: number;
|
|
186
|
+
webexMeetingId?: number;
|
|
187
|
+
webexNodeId?: number;
|
|
188
|
+
webexSiteId?: number;
|
|
189
|
+
webexSiteName?: string;
|
|
190
|
+
webexUserId?: number;
|
|
191
|
+
webexWebDomain?: string;
|
|
192
|
+
correlationId: string;
|
|
193
|
+
additionalProperties?: false;
|
|
194
|
+
} | {
|
|
195
|
+
attendeeId?: string;
|
|
196
|
+
breakoutGroupId?: string;
|
|
197
|
+
breakoutMoveId?: string;
|
|
198
|
+
breakoutSessionId?: string;
|
|
199
|
+
confluenceId?: string;
|
|
200
|
+
cpaasIdentifiers?: {
|
|
201
|
+
imiTenantId: string;
|
|
202
|
+
devClientId: string;
|
|
203
|
+
imiServiceId: string;
|
|
204
|
+
imiAppId: string;
|
|
205
|
+
sessionId: string;
|
|
206
|
+
sessionInstanceId: string;
|
|
207
|
+
additionalProperties?: false;
|
|
208
|
+
};
|
|
209
|
+
csdmDeviceUrl?: string;
|
|
210
|
+
destinationBreakoutSessionId?: string;
|
|
211
|
+
destinationLocusSessionId?: string;
|
|
212
|
+
destinationLocusUrl?: string;
|
|
213
|
+
destinationVenueId?: string;
|
|
214
|
+
deviceId?: string;
|
|
215
|
+
ivrCallId?: string;
|
|
216
|
+
ivrDialogId?: string;
|
|
217
|
+
ivrId?: string;
|
|
218
|
+
callId?: string;
|
|
219
|
+
locusId?: string;
|
|
220
|
+
locusSessionId?: string;
|
|
221
|
+
locusStartTime?: string;
|
|
222
|
+
locusUrl?: string;
|
|
223
|
+
mediaAgentAlias?: string;
|
|
224
|
+
mediaAgentGroupId?: string;
|
|
225
|
+
meetClusterName?: string;
|
|
226
|
+
meetingLookupUrl?: string;
|
|
227
|
+
meetingOrgId?: string;
|
|
228
|
+
msteamsTenantGuid?: string;
|
|
229
|
+
msteamsConferenceId?: string;
|
|
230
|
+
oauth2ClientId?: string;
|
|
231
|
+
orgId?: string;
|
|
232
|
+
provisionalCorrelationId?: string;
|
|
233
|
+
roomId?: string;
|
|
234
|
+
sipCallId?: string;
|
|
235
|
+
sipSessionId?: {
|
|
236
|
+
local?: string;
|
|
237
|
+
remote?: string;
|
|
238
|
+
additionalProperties?: false;
|
|
239
|
+
};
|
|
240
|
+
sipUri?: string;
|
|
241
|
+
subConfId?: string;
|
|
242
|
+
tenantId?: string;
|
|
243
|
+
trackingId?: string;
|
|
244
|
+
userId?: string;
|
|
245
|
+
venueId?: string;
|
|
246
|
+
venueUrl?: string;
|
|
247
|
+
whiteboardUrl?: string;
|
|
248
|
+
webexConferenceId?: number;
|
|
249
|
+
webexClusterName?: string;
|
|
250
|
+
webexConferenceIdStr?: string;
|
|
251
|
+
webexDataCenter?: string;
|
|
252
|
+
webexGuestId?: number;
|
|
253
|
+
webexMeetingId?: number;
|
|
254
|
+
webexNodeId?: number;
|
|
255
|
+
webexSiteId?: number;
|
|
256
|
+
webexSiteName?: string;
|
|
257
|
+
webexUserId?: number;
|
|
258
|
+
webexWebDomain?: string;
|
|
259
|
+
correlationId: string;
|
|
260
|
+
additionalProperties?: false;
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Create diagnostic event, which can hold client event, feature event or MQE event data.
|
|
264
|
+
* This just initiates the shared properties that are required for all the 3 event categories.
|
|
265
|
+
* @param eventData
|
|
266
|
+
* @param options
|
|
267
|
+
* @returns
|
|
268
|
+
*/
|
|
269
|
+
prepareDiagnosticEvent(eventData: Event['event'], options: any): Event;
|
|
270
|
+
/**
|
|
271
|
+
* TODO: NOT IMPLEMENTED
|
|
272
|
+
* Submit Feature Event
|
|
273
|
+
* @returns
|
|
274
|
+
*/
|
|
275
|
+
submitFeatureEvent(): void;
|
|
276
|
+
/**
|
|
277
|
+
* Submit Media Quality Event
|
|
278
|
+
* @param args - submit params
|
|
279
|
+
* @param arg.name - event key
|
|
280
|
+
* @param arg.payload - additional payload to be merge with the default payload
|
|
281
|
+
* @param arg.options - options
|
|
282
|
+
*/
|
|
283
|
+
submitMQE({ name, payload, options, }: {
|
|
284
|
+
name: MediaQualityEvent['name'];
|
|
285
|
+
payload: SubmitMQEPayload;
|
|
286
|
+
options: SubmitMQEOptions;
|
|
287
|
+
}): void;
|
|
288
|
+
/**
|
|
289
|
+
* Return Client Event payload by client error code
|
|
290
|
+
* @param arg - get error arg
|
|
291
|
+
* @param arg.clientErrorCode
|
|
292
|
+
* @param arg.serviceErrorCode
|
|
293
|
+
* @returns
|
|
294
|
+
*/
|
|
295
|
+
getErrorPayloadForClientErrorCode({ clientErrorCode, serviceErrorCode, serviceErrorName, }: {
|
|
296
|
+
clientErrorCode: number;
|
|
297
|
+
serviceErrorCode: any;
|
|
298
|
+
serviceErrorName?: any;
|
|
299
|
+
}): ClientEventError;
|
|
300
|
+
/**
|
|
301
|
+
* Generate error payload for Client Event
|
|
302
|
+
* @param rawError
|
|
303
|
+
*/
|
|
304
|
+
generateClientEventErrorPayload(rawError: any): {
|
|
305
|
+
fatal: boolean;
|
|
306
|
+
category: "other" | "signaling" | "media" | "expected";
|
|
307
|
+
errorDescription?: string;
|
|
308
|
+
errorCode?: number;
|
|
309
|
+
errorCodeStr?: string;
|
|
310
|
+
httpCode?: number;
|
|
311
|
+
errorCodeExt1?: number;
|
|
312
|
+
errorData?: {};
|
|
313
|
+
shownToUser: boolean;
|
|
314
|
+
serviceErrorCode?: number;
|
|
315
|
+
name: "other" | "locus.response" | "media-engine" | "ice.failed" | "locus.leave" | "client.leave" | "media-device" | "media-sca" | "wxc";
|
|
316
|
+
additionalProperties?: false;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Create client event object for in meeting events
|
|
320
|
+
* @param arg - create args
|
|
321
|
+
* @param arg.event - event key
|
|
322
|
+
* @param arg.options - options
|
|
323
|
+
* @returns object
|
|
324
|
+
*/
|
|
325
|
+
private createClientEventObjectInMeeting;
|
|
326
|
+
/**
|
|
327
|
+
* Create client event object for pre meeting events
|
|
328
|
+
* @param arg - create args
|
|
329
|
+
* @param arg.event - event key
|
|
330
|
+
* @param arg.options - payload
|
|
331
|
+
* @returns object
|
|
332
|
+
*/
|
|
333
|
+
private createClientEventObjectPreMeeting;
|
|
334
|
+
/**
|
|
335
|
+
* Prepare Client Event CA event.
|
|
336
|
+
* @param arg - submit params
|
|
337
|
+
* @param arg.event - event key
|
|
338
|
+
* @param arg.payload - additional payload to be merged with default payload
|
|
339
|
+
* @param arg.options - payload
|
|
340
|
+
* @returns {any} options to be with fetch
|
|
341
|
+
* @throws
|
|
342
|
+
*/
|
|
343
|
+
private prepareClientEvent;
|
|
344
|
+
/**
|
|
345
|
+
* Submit Client Event CA event.
|
|
346
|
+
* @param arg - submit params
|
|
347
|
+
* @param arg.event - event key
|
|
348
|
+
* @param arg.payload - additional payload to be merged with default payload
|
|
349
|
+
* @param arg.options - payload
|
|
350
|
+
* @throws
|
|
351
|
+
*/
|
|
352
|
+
submitClientEvent({ name, payload, options, }: {
|
|
353
|
+
name: ClientEvent['name'];
|
|
354
|
+
payload?: ClientEventPayload;
|
|
355
|
+
options?: SubmitClientEventOptions;
|
|
356
|
+
}): Promise<any>;
|
|
357
|
+
/**
|
|
358
|
+
* Prepare the event and send the request to metrics-a service.
|
|
359
|
+
* @param event
|
|
360
|
+
* @returns promise
|
|
361
|
+
*/
|
|
362
|
+
submitToCallDiagnostics(event: Event): Promise<any>;
|
|
363
|
+
/**
|
|
364
|
+
* Pre login events are not batched. We make the request directly.
|
|
365
|
+
* @param event
|
|
366
|
+
* @param preLoginId
|
|
367
|
+
* @returns
|
|
368
|
+
*/
|
|
369
|
+
submitToCallDiagnosticsPreLogin: (event: Event, preLoginId?: string) => Promise<any>;
|
|
370
|
+
/**
|
|
371
|
+
* Builds a request options object to later be passed to fetch().
|
|
372
|
+
* @param arg - submit params
|
|
373
|
+
* @param arg.event - event key
|
|
374
|
+
* @param arg.payload - additional payload to be merged with default payload
|
|
375
|
+
* @param arg.options - client event options
|
|
376
|
+
* @returns {Promise<any>}
|
|
377
|
+
* @throws
|
|
378
|
+
*/
|
|
379
|
+
buildClientEventFetchRequestOptions({ name, payload, options, }: {
|
|
380
|
+
name: ClientEvent['name'];
|
|
381
|
+
payload?: ClientEventPayload;
|
|
382
|
+
options?: SubmitClientEventOptions;
|
|
383
|
+
}): Promise<any>;
|
|
384
|
+
/**
|
|
385
|
+
* Returns true if the specified serviceErrorCode maps to an expected error.
|
|
386
|
+
* @param {number} serviceErrorCode the service error code
|
|
387
|
+
* @returns {boolean}
|
|
388
|
+
*/
|
|
389
|
+
isServiceErrorExpected(serviceErrorCode: number): boolean;
|
|
390
|
+
}
|
|
391
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Event } from '../metrics.types';
|
|
2
|
+
export declare const anonymizeIPAddress: (localIp: any) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Returns a formated string of the user agent.
|
|
5
|
+
*
|
|
6
|
+
* @returns {string} formatted user agent information
|
|
7
|
+
*/
|
|
8
|
+
export declare const userAgentToString: ({ clientName, webexVersion }: {
|
|
9
|
+
clientName: any;
|
|
10
|
+
webexVersion: any;
|
|
11
|
+
}) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Iterates object recursively and removes any
|
|
14
|
+
* property that returns isEmpty for it's associated value
|
|
15
|
+
* isEmpty = implementation from Lodash.
|
|
16
|
+
*
|
|
17
|
+
* It modifies the object in place (mutable)
|
|
18
|
+
*
|
|
19
|
+
* @param obj - input
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare const clearEmptyKeysRecursively: (obj: any) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Locus error codes start with 2. The next three digits are the
|
|
25
|
+
* HTTP status code related to the error code (like 400, 403, 502, etc.)
|
|
26
|
+
* The remaining three digits are just an increasing integer.
|
|
27
|
+
* If it is 7 digits and starts with a 2, it is locus.
|
|
28
|
+
*
|
|
29
|
+
* @param errorCode
|
|
30
|
+
* @returns {boolean}
|
|
31
|
+
*/
|
|
32
|
+
export declare const isLocusServiceErrorCode: (errorCode: string | number) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* MeetingInfo errors sometimes has body.data.meetingInfo object
|
|
35
|
+
* MeetingInfo errors come with a wbxappapi url
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} rawError
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
export declare const isMeetingInfoServiceError: (rawError: any) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* MDN Media Devices getUserMedia() method returns a name if it errs
|
|
43
|
+
* Documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
|
|
44
|
+
*
|
|
45
|
+
* @param errorCode
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
export declare const isBrowserMediaErrorName: (errorName: any) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @param webClientDomain
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
export declare const getBuildType: (webClientDomain: any, markAsTestEvent?: boolean) => Event['origin']['buildType'];
|
|
54
|
+
/**
|
|
55
|
+
* Prepare metric item for submission.
|
|
56
|
+
* @param {Object} webex sdk instance
|
|
57
|
+
* @param {Object} item
|
|
58
|
+
* @returns {Object} prepared item
|
|
59
|
+
*/
|
|
60
|
+
export declare const prepareDiagnosticMetricItem: (webex: any, item: any) => any;
|
|
61
|
+
/**
|
|
62
|
+
* Sets the originTime value(s) before the request/fetch.
|
|
63
|
+
* This function is only useful if you are about to submit a metrics
|
|
64
|
+
* request using pre-built fetch options;
|
|
65
|
+
*
|
|
66
|
+
* @param {any} options
|
|
67
|
+
* @returns {any} the updated options object
|
|
68
|
+
*/
|
|
69
|
+
export declare const setMetricTimings: (options: any) => any;
|
|
70
|
+
export declare const extractVersionMetadata: (version: string) => {
|
|
71
|
+
majorVersion: number;
|
|
72
|
+
minorVersion: number;
|
|
73
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ClientEventError } from '../metrics.types';
|
|
2
|
+
export declare const CALL_DIAGNOSTIC_LOG_IDENTIFIER = "call-diagnostic-events -> ";
|
|
3
|
+
export declare const NEW_LOCUS_ERROR_CLIENT_CODE = 4008;
|
|
4
|
+
export declare const MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = 4100;
|
|
5
|
+
export declare const UNKNOWN_ERROR = 9999;
|
|
6
|
+
export declare const ICE_FAILURE_CLIENT_CODE = 2004;
|
|
7
|
+
export declare const WBX_APP_API_URL = "wbxappapi";
|
|
8
|
+
export declare const BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP: {
|
|
9
|
+
[x: string]: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
|
|
12
|
+
58400: number;
|
|
13
|
+
99002: number;
|
|
14
|
+
99009: number;
|
|
15
|
+
58500: number;
|
|
16
|
+
400001: number;
|
|
17
|
+
403004: number;
|
|
18
|
+
403028: number;
|
|
19
|
+
403032: number;
|
|
20
|
+
403034: number;
|
|
21
|
+
403036: number;
|
|
22
|
+
403038: number;
|
|
23
|
+
403040: number;
|
|
24
|
+
403041: number;
|
|
25
|
+
403047: number;
|
|
26
|
+
403408: number;
|
|
27
|
+
403043: number;
|
|
28
|
+
403048: number;
|
|
29
|
+
403049: number;
|
|
30
|
+
403100: number;
|
|
31
|
+
403101: number;
|
|
32
|
+
403102: number;
|
|
33
|
+
403103: number;
|
|
34
|
+
403104: number;
|
|
35
|
+
404001: number;
|
|
36
|
+
404006: number;
|
|
37
|
+
423001: number;
|
|
38
|
+
423005: number;
|
|
39
|
+
423006: number;
|
|
40
|
+
423010: number;
|
|
41
|
+
423012: number;
|
|
42
|
+
423013: number;
|
|
43
|
+
429005: number;
|
|
44
|
+
2403001: number;
|
|
45
|
+
2403002: number;
|
|
46
|
+
2403003: number;
|
|
47
|
+
2403004: number;
|
|
48
|
+
2403018: number;
|
|
49
|
+
2403019: number;
|
|
50
|
+
2423003: number;
|
|
51
|
+
2423004: number;
|
|
52
|
+
2423005: number;
|
|
53
|
+
2423006: number;
|
|
54
|
+
2423016: number;
|
|
55
|
+
2423017: number;
|
|
56
|
+
2423018: number;
|
|
57
|
+
2423012: number;
|
|
58
|
+
2423021: number;
|
|
59
|
+
2423007: number;
|
|
60
|
+
2403010: number;
|
|
61
|
+
2403014: number;
|
|
62
|
+
2403015: number;
|
|
63
|
+
2423010: number;
|
|
64
|
+
2400008: number;
|
|
65
|
+
2400011: number;
|
|
66
|
+
2400012: number;
|
|
67
|
+
2403007: number;
|
|
68
|
+
2401002: number;
|
|
69
|
+
2404002: number;
|
|
70
|
+
2400009: number;
|
|
71
|
+
2400025: number;
|
|
72
|
+
2423009: number;
|
|
73
|
+
2403022: number;
|
|
74
|
+
2423008: number;
|
|
75
|
+
2400006: number;
|
|
76
|
+
2400014: number;
|
|
77
|
+
2404001: number;
|
|
78
|
+
2403025: number;
|
|
79
|
+
2405001: number;
|
|
80
|
+
2409005: number;
|
|
81
|
+
2409062: number;
|
|
82
|
+
2423025: number;
|
|
83
|
+
100002: number;
|
|
84
|
+
100007: number;
|
|
85
|
+
100001: number;
|
|
86
|
+
100006: number;
|
|
87
|
+
100005: number;
|
|
88
|
+
100004: number;
|
|
89
|
+
};
|
|
90
|
+
export declare const CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD: Record<number, Partial<ClientEventError>>;
|
|
91
|
+
export declare const CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = "js_sdk_call_diagnostic_event_failed_to_send";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const CLIENT_NAME: "webex-js-sdk";
|
|
2
|
+
declare namespace _default {
|
|
3
|
+
export namespace device {
|
|
4
|
+
namespace preDiscoveryServices {
|
|
5
|
+
const metricsServiceUrl: string;
|
|
6
|
+
const metrics: string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export namespace metrics_1 {
|
|
10
|
+
const appType: string;
|
|
11
|
+
const batcherWait: number;
|
|
12
|
+
const batcherMaxCalls: number;
|
|
13
|
+
const batcherMaxWait: number;
|
|
14
|
+
const batcherRetryPlateau: number;
|
|
15
|
+
}
|
|
16
|
+
export { metrics_1 as metrics };
|
|
17
|
+
}
|
|
18
|
+
export default _default;
|
|
19
|
+
export namespace OS_NAME {
|
|
20
|
+
const WINDOWS: string;
|
|
21
|
+
const MAC: string;
|
|
22
|
+
const IOS: string;
|
|
23
|
+
const ANDROID: string;
|
|
24
|
+
const CHROME: string;
|
|
25
|
+
const LINUX: string;
|
|
26
|
+
const OTHERS: string;
|
|
27
|
+
}
|
|
28
|
+
export const OSMap: {
|
|
29
|
+
'Chrome OS': string;
|
|
30
|
+
macOS: string;
|
|
31
|
+
Windows: string;
|
|
32
|
+
iOS: string;
|
|
33
|
+
Android: string;
|
|
34
|
+
Linux: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
import '@webex/internal-plugin-device';
|
|
5
|
+
import config from './config';
|
|
6
|
+
import NewMetrics from './new-metrics';
|
|
7
|
+
import * as Utils from './utils';
|
|
8
|
+
import { ClientEvent, ClientEventLeaveReason, SubmitBehavioralEvent, SubmitClientEvent, SubmitInternalEvent, SubmitOperationalEvent, SubmitMQE } from './metrics.types';
|
|
9
|
+
import * as CALL_DIAGNOSTIC_CONFIG from './call-diagnostic/config';
|
|
10
|
+
import * as CallDiagnosticUtils from './call-diagnostic/call-diagnostic-metrics.util';
|
|
11
|
+
export { default, getOSNameInternal } from './metrics';
|
|
12
|
+
export { config, CALL_DIAGNOSTIC_CONFIG, NewMetrics, Utils, CallDiagnosticUtils };
|
|
13
|
+
export type { ClientEvent, ClientEventLeaveReason, SubmitBehavioralEvent, SubmitClientEvent, SubmitInternalEvent, SubmitMQE, SubmitOperationalEvent, };
|