@webex/internal-plugin-metrics 3.0.0-beta.271 → 3.0.0-beta.272
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.js +36 -8
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +2 -0
- package/dist/types/metrics.types.d.ts +4 -0
- package/package.json +8 -8
- package/src/call-diagnostic/call-diagnostic-metrics.ts +32 -5
- package/src/metrics.types.ts +4 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +85 -4
|
@@ -199,10 +199,12 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
199
199
|
}, {
|
|
200
200
|
key: "getIdentifiers",
|
|
201
201
|
value: function getIdentifiers(options) {
|
|
202
|
-
var _meeting$locusInfo;
|
|
202
|
+
var _meeting$locusInfo, _meeting$meetingInfo2, _meeting$meetingInfo4;
|
|
203
203
|
var meeting = options.meeting,
|
|
204
204
|
mediaConnections = options.mediaConnections,
|
|
205
|
-
correlationId = options.correlationId
|
|
205
|
+
correlationId = options.correlationId,
|
|
206
|
+
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
207
|
+
globalMeetingId = options.globalMeetingId;
|
|
206
208
|
var identifiers = {
|
|
207
209
|
correlationId: 'unknown'
|
|
208
210
|
};
|
|
@@ -227,11 +229,25 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
227
229
|
identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
|
|
228
230
|
identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
|
|
229
231
|
}
|
|
232
|
+
if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo2 = meeting.meetingInfo) !== null && _meeting$meetingInfo2 !== void 0 && _meeting$meetingInfo2.confID) {
|
|
233
|
+
var _meeting$meetingInfo3;
|
|
234
|
+
identifiers.webexConferenceIdStr = (_meeting$meetingInfo3 = meeting.meetingInfo) === null || _meeting$meetingInfo3 === void 0 ? void 0 : _meeting$meetingInfo3.confID;
|
|
235
|
+
}
|
|
236
|
+
if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo4 = meeting.meetingInfo) !== null && _meeting$meetingInfo4 !== void 0 && _meeting$meetingInfo4.meetingId) {
|
|
237
|
+
var _meeting$meetingInfo5;
|
|
238
|
+
identifiers.globalMeetingId = (_meeting$meetingInfo5 = meeting.meetingInfo) === null || _meeting$meetingInfo5 === void 0 ? void 0 : _meeting$meetingInfo5.meetingId;
|
|
239
|
+
}
|
|
230
240
|
if (mediaConnections) {
|
|
231
241
|
var _mediaConnections$, _mediaConnections$2;
|
|
232
242
|
identifiers.mediaAgentAlias = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$ = mediaConnections[0]) === null || _mediaConnections$ === void 0 ? void 0 : _mediaConnections$.mediaAgentAlias;
|
|
233
243
|
identifiers.mediaAgentGroupId = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$2 = mediaConnections[0]) === null || _mediaConnections$2 === void 0 ? void 0 : _mediaConnections$2.mediaAgentGroupId;
|
|
234
244
|
}
|
|
245
|
+
if (!(identifiers !== null && identifiers !== void 0 && identifiers.webexConferenceIdStr) && webexConferenceIdStr) {
|
|
246
|
+
identifiers.webexConferenceIdStr = webexConferenceIdStr;
|
|
247
|
+
}
|
|
248
|
+
if (!(identifiers !== null && identifiers !== void 0 && identifiers.globalMeetingId) && globalMeetingId) {
|
|
249
|
+
identifiers.globalMeetingId = globalMeetingId;
|
|
250
|
+
}
|
|
235
251
|
if (identifiers.correlationId === undefined) {
|
|
236
252
|
throw new Error('Identifiers initialization failed.');
|
|
237
253
|
}
|
|
@@ -299,7 +315,9 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
299
315
|
payload = _ref2.payload,
|
|
300
316
|
options = _ref2.options;
|
|
301
317
|
var meetingId = options.meetingId,
|
|
302
|
-
mediaConnections = options.mediaConnections
|
|
318
|
+
mediaConnections = options.mediaConnections,
|
|
319
|
+
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
320
|
+
globalMeetingId = options.globalMeetingId;
|
|
303
321
|
|
|
304
322
|
// events that will most likely happen in join phase
|
|
305
323
|
if (meetingId) {
|
|
@@ -320,7 +338,9 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
320
338
|
// merge identifiers
|
|
321
339
|
var identifiers = this.getIdentifiers({
|
|
322
340
|
meeting: meeting,
|
|
323
|
-
mediaConnections: meeting.mediaConnections || mediaConnections
|
|
341
|
+
mediaConnections: meeting.mediaConnections || mediaConnections,
|
|
342
|
+
webexConferenceIdStr: webexConferenceIdStr,
|
|
343
|
+
globalMeetingId: globalMeetingId
|
|
324
344
|
});
|
|
325
345
|
|
|
326
346
|
// create media quality event object
|
|
@@ -473,7 +493,9 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
473
493
|
errors = _ref4.errors;
|
|
474
494
|
this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @createClientEventObjectInMeeting. Creating in meeting event object.', "name: ".concat(name));
|
|
475
495
|
var meetingId = options.meetingId,
|
|
476
|
-
mediaConnections = options.mediaConnections
|
|
496
|
+
mediaConnections = options.mediaConnections,
|
|
497
|
+
globalMeetingId = options.globalMeetingId,
|
|
498
|
+
webexConferenceIdStr = options.webexConferenceIdStr;
|
|
477
499
|
|
|
478
500
|
// @ts-ignore
|
|
479
501
|
var meeting = this.webex.meetings.meetingCollection.get(meetingId);
|
|
@@ -492,7 +514,9 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
492
514
|
// grab identifiers
|
|
493
515
|
var identifiers = this.getIdentifiers({
|
|
494
516
|
meeting: meeting,
|
|
495
|
-
mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections
|
|
517
|
+
mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections,
|
|
518
|
+
webexConferenceIdStr: webexConferenceIdStr,
|
|
519
|
+
globalMeetingId: globalMeetingId
|
|
496
520
|
});
|
|
497
521
|
|
|
498
522
|
// create client event object
|
|
@@ -533,11 +557,15 @@ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
533
557
|
options = _ref5.options,
|
|
534
558
|
errors = _ref5.errors;
|
|
535
559
|
this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @createClientEventObjectPreMeeting. Creating pre meeting event object.', "name: ".concat(name));
|
|
536
|
-
var correlationId = options.correlationId
|
|
560
|
+
var correlationId = options.correlationId,
|
|
561
|
+
globalMeetingId = options.globalMeetingId,
|
|
562
|
+
webexConferenceIdStr = options.webexConferenceIdStr;
|
|
537
563
|
|
|
538
564
|
// grab identifiers
|
|
539
565
|
var identifiers = this.getIdentifiers({
|
|
540
|
-
correlationId: correlationId
|
|
566
|
+
correlationId: correlationId,
|
|
567
|
+
globalMeetingId: globalMeetingId,
|
|
568
|
+
webexConferenceIdStr: webexConferenceIdStr
|
|
541
569
|
});
|
|
542
570
|
|
|
543
571
|
// create client event object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BrowserDetection","getOSVersion","getBrowserName","getBrowserVersion","CallDiagnosticMetrics","args","event","preLoginId","diagnosticEvent","prepareDiagnosticMetricItem","webex","eventPayload","type","originTime","sent","Date","toISOString","logger","log","CALL_DIAGNOSTIC_LOG_IDENTIFIER","internal","newMetrics","postPreLoginMetric","callDiagnosticEventsBatcher","CallDiagnosticEventsBatcher","parent","canAuthorize","credentials","isUnverifiedGuest","meetingId","meeting","meetings","meetingCollection","get","meetingInfo","enableConvergedArchitecture","undefined","options","defaultClientType","config","metrics","clientType","defaultSubClientType","subClientType","providedClientVersion","clientVersion","defaultSDKClientVersion","CLIENT_NAME","version","versionMetadata","extractVersionMetadata","origin","name","networkType","userAgent","userAgentToString","clientName","webexVersion","clientInfo","localNetworkPrefix","anonymizeIPAddress","geoHintInfo","clientAddress","osVersion","os","getOSNameInternal","browser","browserVersion","environment","newEnvironment","clientLaunchMethod","Error","mediaConnections","correlationId","identifiers","device","userId","deviceId","url","orgId","locusUrl","services","locusInfo","fullState","locusId","split","pop","locusStartTime","lastActive","mediaAgentAlias","mediaAgentGroupId","eventData","getOrigin","eventId","uuid","v4","triggered","senderCountryCode","countryCode","clearEmptyKeysRecursively","payload","console","warn","submitClientMetrics","CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND","fields","getIdentifiers","clientEventObject","canProceed","webClientDomain","window","location","hostname","intervals","sourceMetadata","applicationSoftwareType","applicationSoftwareVersion","mediaEngineSoftwareType","mediaEngineSoftwareVersion","startTime","prepareDiagnosticEvent","submitToCallDiagnostics","clientErrorCode","serviceErrorCode","serviceErrorName","error","partialParsedError","CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD","fatal","shownToUser","category","errorCode","errorData","errorName","rawError","isBrowserMediaErrorName","getErrorPayloadForClientErrorCode","BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP","body","code","reason","reasonCode","SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP","isLocusServiceErrorCode","NEW_LOCUS_ERROR_CLIENT_CODE","isMeetingInfoServiceError","MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE","isNetworkError","NETWORK_ERROR","errorDescription","message","isUnauthorizedError","AUTHENTICATION_FAILED_CODE","UNKNOWN_ERROR","errors","userType","getCurUserType","loginType","getCurLoginType","isConvergedArchitectureEnabled","getIsConvergedArchitectureEnabled","rawErrorMessage","generateCommonErrorMetadata","generatedError","generateClientEventErrorPayload","push","createClientEventObjectInMeeting","createClientEventObjectPreMeeting","prepareClientEvent","submitToCallDiagnosticsPreLogin","finalEvent","request","clientEvent","method","service","resource","headers","authorization","prepareFetchOptions","clientErrorPayload","StatelessWebexPlugin"],"sources":["call-diagnostic-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\nimport {getOSNameInternal} from '@webex/internal-plugin-metrics';\nimport {BrowserDetection} from '@webex/common';\nimport uuid from 'uuid';\nimport {merge} from 'lodash';\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {\n anonymizeIPAddress,\n clearEmptyKeysRecursively,\n isLocusServiceErrorCode,\n prepareDiagnosticMetricItem,\n userAgentToString,\n extractVersionMetadata,\n isMeetingInfoServiceError,\n isBrowserMediaErrorName,\n isNetworkError,\n isUnauthorizedError,\n} from './call-diagnostic-metrics.util';\nimport {CLIENT_NAME} from '../config';\nimport {\n Event,\n ClientType,\n SubClientType,\n NetworkType,\n EnvironmentType,\n NewEnvironmentType,\n ClientEvent,\n SubmitClientEventOptions,\n MediaQualityEvent,\n SubmitMQEOptions,\n SubmitMQEPayload,\n ClientLaunchMethodType,\n ClientEventError,\n ClientEventPayload,\n ClientInfo,\n ClientEventPayloadError,\n} from '../metrics.types';\nimport CallDiagnosticEventsBatcher from './call-diagnostic-metrics-batcher';\nimport {\n CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD,\n CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND,\n NEW_LOCUS_ERROR_CLIENT_CODE,\n SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP,\n UNKNOWN_ERROR,\n BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP,\n MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n NETWORK_ERROR,\n AUTHENTICATION_FAILED_CODE,\n} from './config';\nimport {generateCommonErrorMetadata} from '../utils';\n\nconst {getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();\n\ntype GetOriginOptions = {\n clientType: ClientType;\n subClientType: SubClientType;\n networkType?: NetworkType;\n clientLaunchMethod?: ClientLaunchMethodType;\n environment?: EnvironmentType;\n newEnvironment?: NewEnvironmentType;\n};\n\ntype GetIdentifiersOptions = {\n meeting?: any;\n mediaConnections?: any[];\n correlationId?: string;\n};\n\n/**\n * @description Util class to handle Call Analyzer Metrics\n * @export\n * @class CallDiagnosticMetrics\n */\nexport default class CallDiagnosticMetrics extends StatelessWebexPlugin {\n // @ts-ignore\n private callDiagnosticEventsBatcher: CallDiagnosticEventsBatcher;\n private logger: any; // to avoid adding @ts-ignore everywhere\n\n /**\n * Constructor\n * @param args\n */\n constructor(...args) {\n super(...args);\n // @ts-ignore\n this.logger = this.webex.logger;\n // @ts-ignore\n this.callDiagnosticEventsBatcher = new CallDiagnosticEventsBatcher({}, {parent: this.webex});\n }\n\n /**\n * Returns the login type of the current user\n * @returns one of 'login-ci','unverified-guest', null\n */\n getCurLoginType() {\n // @ts-ignore\n if (this.webex.canAuthorize) {\n // @ts-ignore\n return this.webex.credentials.isUnverifiedGuest ? 'unverified-guest' : 'login-ci';\n }\n\n return null;\n }\n\n /**\n * Returns if the meeting has converged architecture enabled\n * @param options.meetingId\n */\n getIsConvergedArchitectureEnabled({meetingId}: {meetingId?: string}): boolean {\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n return meeting?.meetingInfo?.enableConvergedArchitecture;\n }\n\n return undefined;\n }\n\n /**\n * Get origin object for Call Diagnostic Event payload.\n * @param options\n * @param meetingId\n * @returns\n */\n getOrigin(options: GetOriginOptions, meetingId?: string) {\n const defaultClientType: ClientType =\n // @ts-ignore\n this.webex.meetings.config?.metrics?.clientType;\n const defaultSubClientType: SubClientType =\n // @ts-ignore\n this.webex.meetings.config?.metrics?.subClientType;\n // @ts-ignore\n const providedClientVersion: string = this.webex.meetings.config?.metrics?.clientVersion;\n // @ts-ignore\n const defaultSDKClientVersion = `${CLIENT_NAME}/${this.webex.version}`;\n\n let versionMetadata: Pick<ClientInfo, 'majorVersion' | 'minorVersion'> = {};\n\n // sdk version split doesn't really make sense for now...\n if (providedClientVersion) {\n versionMetadata = extractVersionMetadata(providedClientVersion);\n }\n\n if (\n (defaultClientType && defaultSubClientType) ||\n (options.clientType && options.subClientType)\n ) {\n const origin: Event['origin'] = {\n name: 'endpoint',\n networkType: options?.networkType || 'unknown',\n userAgent: userAgentToString({\n // @ts-ignore\n clientName: this.webex.meetings?.config?.metrics?.clientName,\n // @ts-ignore\n webexVersion: this.webex.version,\n }),\n clientInfo: {\n clientType: options?.clientType || defaultClientType,\n clientVersion: providedClientVersion || defaultSDKClientVersion,\n ...versionMetadata,\n localNetworkPrefix:\n // @ts-ignore\n anonymizeIPAddress(this.webex.meetings.geoHintInfo?.clientAddress) || undefined,\n osVersion: getOSVersion() || 'unknown',\n subClientType: options?.subClientType || defaultSubClientType,\n os: getOSNameInternal(),\n browser: getBrowserName(),\n browserVersion: getBrowserVersion(),\n },\n };\n\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n if (meeting?.environment) {\n origin.environment = meeting.environment;\n }\n }\n\n if (options?.environment) {\n origin.environment = options.environment;\n }\n\n if (options?.newEnvironment) {\n origin.newEnvironment = options.newEnvironment;\n }\n\n if (options?.clientLaunchMethod) {\n origin.clientInfo.clientLaunchMethod = options.clientLaunchMethod;\n }\n\n return origin;\n }\n\n throw new Error(\"ClientType and SubClientType can't be undefined\");\n }\n\n /**\n * Gather identifier details for call diagnostic payload.\n * @throws Error if initialization fails.\n * @param options\n */\n getIdentifiers(options: GetIdentifiersOptions) {\n const {meeting, mediaConnections, correlationId} = options;\n const identifiers: Event['event']['identifiers'] = {correlationId: 'unknown'};\n\n if (meeting) {\n identifiers.correlationId = meeting.correlationId;\n }\n\n if (correlationId) {\n identifiers.correlationId = correlationId;\n }\n // @ts-ignore\n if (this.webex.internal) {\n // @ts-ignore\n const {device} = this.webex.internal;\n identifiers.userId = device.userId;\n identifiers.deviceId = device.url;\n identifiers.orgId = device.orgId;\n // @ts-ignore\n identifiers.locusUrl = this.webex.internal.services.get('locus');\n }\n\n if (meeting?.locusInfo?.fullState) {\n identifiers.locusUrl = meeting.locusUrl;\n identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();\n identifiers.locusStartTime =\n meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;\n }\n\n if (mediaConnections) {\n identifiers.mediaAgentAlias = mediaConnections?.[0]?.mediaAgentAlias;\n identifiers.mediaAgentGroupId = mediaConnections?.[0]?.mediaAgentGroupId;\n }\n\n if (identifiers.correlationId === undefined) {\n throw new Error('Identifiers initialization failed.');\n }\n\n return identifiers;\n }\n\n /**\n * Create diagnostic event, which can hold client event, feature event or MQE event data.\n * This just initiates the shared properties that are required for all the 3 event categories.\n * @param eventData\n * @param options\n * @returns\n */\n prepareDiagnosticEvent(eventData: Event['event'], options: any) {\n const {meetingId} = options;\n const origin = this.getOrigin(options, meetingId);\n\n const event: Event = {\n eventId: uuid.v4(),\n version: 1,\n origin,\n originTime: {\n triggered: new Date().toISOString(),\n // is overridden in prepareRequest batcher\n sent: 'not_defined_yet',\n },\n // @ts-ignore\n senderCountryCode: this.webex.meetings.geoHintInfo?.countryCode,\n event: eventData,\n };\n\n // sanitize (remove empty properties, CA requires it)\n // but we don't want to sanitize MQE as most of the times\n // values will be 0, [] etc, and they are required.\n if (eventData.name !== 'client.mediaquality.event') {\n clearEmptyKeysRecursively(event);\n }\n\n return event;\n }\n\n /**\n * TODO: NOT IMPLEMENTED\n * Submit Feature Event\n * @returns\n */\n public submitFeatureEvent() {\n throw Error('Not implemented');\n }\n\n /**\n * Submit Media Quality Event\n * @param args - submit params\n * @param arg.name - event key\n * @param arg.payload - additional payload to be merge with the default payload\n * @param arg.options - options\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: SubmitMQEOptions;\n }) {\n const {meetingId, mediaConnections} = options;\n\n // events that will most likely happen in join phase\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n if (!meeting) {\n console.warn(\n 'Attempt to send MQE but no meeting was found...',\n `event: ${name}, meetingId: ${meetingId}`\n );\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId,\n name,\n },\n });\n\n return;\n }\n\n // merge identifiers\n const identifiers = this.getIdentifiers({\n meeting,\n mediaConnections: meeting.mediaConnections || mediaConnections,\n });\n\n // create media quality event object\n let clientEventObject: MediaQualityEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n intervals: payload.intervals,\n sourceMetadata: {\n applicationSoftwareType: CLIENT_NAME,\n // @ts-ignore\n applicationSoftwareVersion: this.webex.version,\n mediaEngineSoftwareType: getBrowserName() || 'browser',\n mediaEngineSoftwareVersion: getOSVersion() || 'unknown',\n startTime: new Date().toISOString(),\n },\n };\n\n // merge any new properties, or override existing ones\n clientEventObject = merge(clientEventObject, payload);\n\n // append media quality event data to the call diagnostic event\n const diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n this.submitToCallDiagnostics(diagnosticEvent);\n } else {\n throw new Error(\n 'Media quality events cant be sent outside the context of a meeting. Meeting id is required.'\n );\n }\n }\n\n /**\n * Return Client Event payload by client error code\n * @param arg - get error arg\n * @param arg.clientErrorCode\n * @param arg.serviceErrorCode\n * @returns\n */\n public getErrorPayloadForClientErrorCode({\n clientErrorCode,\n serviceErrorCode,\n serviceErrorName,\n }: {\n clientErrorCode: number;\n serviceErrorCode: any;\n serviceErrorName?: any;\n }): ClientEventError {\n let error: ClientEventError;\n\n if (clientErrorCode) {\n const partialParsedError = CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n\n if (partialParsedError) {\n error = merge(\n {fatal: true, shownToUser: false, name: 'other', category: 'other'}, // default values\n {errorCode: clientErrorCode},\n serviceErrorName ? {errorData: {errorName: serviceErrorName}} : {},\n {serviceErrorCode},\n partialParsedError\n );\n\n return error;\n }\n }\n\n return undefined;\n }\n\n /**\n * Generate error payload for Client Event\n * @param rawError\n */\n generateClientEventErrorPayload(rawError: any) {\n if (rawError.name) {\n if (isBrowserMediaErrorName(rawError.name)) {\n return this.getErrorPayloadForClientErrorCode({\n serviceErrorCode: undefined,\n clientErrorCode: BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name],\n serviceErrorName: rawError.name,\n });\n }\n }\n\n const serviceErrorCode =\n rawError?.error?.body?.errorCode ||\n rawError?.body?.errorCode ||\n rawError?.body?.code ||\n rawError?.body?.reason?.reasonCode;\n\n if (serviceErrorCode) {\n const clientErrorCode = SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n if (clientErrorCode) {\n return this.getErrorPayloadForClientErrorCode({clientErrorCode, serviceErrorCode});\n }\n\n // by default, if it is locus error, return new locus err\n if (isLocusServiceErrorCode(serviceErrorCode)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: NEW_LOCUS_ERROR_CLIENT_CODE,\n serviceErrorCode,\n });\n }\n }\n\n if (isMeetingInfoServiceError(rawError)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n serviceErrorCode,\n });\n }\n\n if (isNetworkError(rawError)) {\n const payload = this.getErrorPayloadForClientErrorCode({\n clientErrorCode: NETWORK_ERROR,\n serviceErrorCode,\n });\n payload.errorDescription = rawError.message;\n\n return payload;\n }\n\n if (isUnauthorizedError(rawError)) {\n const payload = this.getErrorPayloadForClientErrorCode({\n clientErrorCode: AUTHENTICATION_FAILED_CODE,\n serviceErrorCode,\n });\n payload.errorDescription = rawError.message;\n\n return payload;\n }\n\n // otherwise return unkown error\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: UNKNOWN_ERROR,\n serviceErrorCode: UNKNOWN_ERROR,\n });\n }\n\n /**\n * Create client event object for in meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - options\n * @returns object\n */\n private createClientEventObjectInMeeting({\n name,\n options,\n errors,\n }: {\n name: ClientEvent['name'];\n options?: SubmitClientEventOptions;\n errors?: ClientEventPayloadError;\n }) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @createClientEventObjectInMeeting. Creating in meeting event object.',\n `name: ${name}`\n );\n const {meetingId, mediaConnections} = options;\n\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n if (!meeting) {\n console.warn(\n 'Attempt to send client event but no meeting was found...',\n `name: ${name}, meetingId: ${meetingId}`\n );\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId,\n name,\n },\n });\n\n return undefined;\n }\n\n // grab identifiers\n const identifiers = this.getIdentifiers({\n meeting,\n mediaConnections: meeting?.mediaConnections || mediaConnections,\n });\n\n // create client event object\n const clientEventObject: ClientEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n errors,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n userType: meeting.getCurUserType(),\n loginType: this.getCurLoginType(),\n isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({\n meetingId,\n }),\n };\n\n if (options?.rawError?.message) {\n // @ts-ignore\n clientEventObject.eventData.rawErrorMessage = options?.rawError?.message;\n }\n\n return clientEventObject;\n }\n\n /**\n * Create client event object for pre meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - payload\n * @returns object\n */\n private createClientEventObjectPreMeeting({\n name,\n options,\n errors,\n }: {\n name: ClientEvent['name'];\n options?: SubmitClientEventOptions;\n errors?: ClientEventPayloadError;\n }) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @createClientEventObjectPreMeeting. Creating pre meeting event object.',\n `name: ${name}`\n );\n const {correlationId} = options;\n\n // grab identifiers\n const identifiers = this.getIdentifiers({\n correlationId,\n });\n\n // create client event object\n const clientEventObject: ClientEvent['payload'] = {\n name,\n errors,\n canProceed: true,\n identifiers,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n loginType: this.getCurLoginType(),\n };\n\n if (options?.rawError?.message) {\n // @ts-ignore\n clientEventObject.eventData.rawErrorMessage = options?.rawError?.message;\n }\n\n return clientEventObject;\n }\n\n /**\n * Prepare Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @returns {any} options to be with fetch\n * @throws\n */\n private prepareClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }) {\n const {meetingId, correlationId, rawError} = options;\n let clientEventObject: ClientEvent['payload'];\n\n // check if we need to generate errors\n const errors: ClientEventPayloadError = [];\n\n if (rawError) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @prepareClientEvent. Error detected, attempting to map and attach it to the event...',\n `name: ${name}`,\n `rawError: ${generateCommonErrorMetadata(rawError)}`\n );\n\n const generatedError = this.generateClientEventErrorPayload(rawError);\n if (generatedError) {\n errors.push(generatedError);\n }\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @prepareClientEvent. Generated errors:',\n `generatedError: ${JSON.stringify(generatedError)}`\n );\n }\n\n // events that will most likely happen in join phase\n if (meetingId) {\n clientEventObject = this.createClientEventObjectInMeeting({name, options, errors});\n } else if (correlationId) {\n // any pre join events or events that are outside the meeting.\n clientEventObject = this.createClientEventObjectPreMeeting({name, options, errors});\n } else {\n throw new Error('Not implemented');\n }\n\n // merge any new properties, or override existing ones\n clientEventObject = merge(clientEventObject, payload);\n\n // append client event data to the call diagnostic event\n const diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n\n return diagnosticEvent;\n }\n\n /**\n * Submit Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @throws\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.',\n `name: ${name}`,\n `payload: ${JSON.stringify(payload)}`,\n `options: ${JSON.stringify(options)}`\n );\n const diagnosticEvent = this.prepareClientEvent({name, payload, options});\n\n if (options?.preLoginId) {\n return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options?.preLoginId);\n }\n\n return this.submitToCallDiagnostics(diagnosticEvent);\n }\n\n /**\n * Prepare the event and send the request to metrics-a service.\n * @param event\n * @returns promise\n */\n submitToCallDiagnostics(event: Event): Promise<any> {\n // build metrics-a event type\n const finalEvent = {\n eventPayload: event,\n type: ['diagnostic-event'],\n };\n\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @submitToCallDiagnostics. Preparing to send the request',\n `finalEvent: ${JSON.stringify(finalEvent)}`\n );\n\n return this.callDiagnosticEventsBatcher.request(finalEvent);\n }\n\n /**\n * Pre login events are not batched. We make the request directly.\n * @param event\n * @param preLoginId\n * @returns\n */\n public submitToCallDiagnosticsPreLogin = (event: Event, preLoginId?: string): Promise<any> => {\n // build metrics-a event type\n // @ts-ignore\n const diagnosticEvent = prepareDiagnosticMetricItem(this.webex, {\n eventPayload: event,\n type: ['diagnostic-event'],\n });\n\n // append sent timestamp\n diagnosticEvent.eventPayload.originTime.sent = new Date().toISOString();\n\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n `CallDiagnosticMetrics: @submitToCallDiagnosticsPreLogin. Sending the request:`,\n `diagnosticEvent: ${JSON.stringify(diagnosticEvent)}`\n );\n\n // @ts-ignore\n return this.webex.internal.newMetrics.postPreLoginMetric(diagnosticEvent, preLoginId);\n };\n\n /**\n * Builds a request options object to later be passed to fetch().\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - client event options\n * @returns {Promise<any>}\n * @throws\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...',\n `name: ${name}`,\n `payload: ${JSON.stringify(payload)}`,\n `options: ${JSON.stringify(options)}`\n );\n\n const clientEvent = this.prepareClientEvent({name, payload, options});\n\n // build metrics-a event type\n // @ts-ignore\n const diagnosticEvent = prepareDiagnosticMetricItem(this.webex, {\n eventPayload: clientEvent,\n type: ['diagnostic-event'],\n });\n\n const request = {\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics',\n body: {\n metrics: [diagnosticEvent],\n },\n headers: {},\n };\n\n if (options.preLoginId) {\n request.headers = {\n authorization: false,\n 'x-prelogin-userid': options.preLoginId,\n };\n request.resource = 'clientmetrics-prelogin';\n }\n\n // @ts-ignore\n return this.webex.prepareFetchOptions(request);\n }\n\n /**\n * Returns true if the specified serviceErrorCode maps to an expected error.\n * @param {number} serviceErrorCode the service error code\n * @returns {boolean}\n */\n public isServiceErrorExpected(serviceErrorCode: number): boolean {\n const clientErrorCode = SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n const clientErrorPayload = CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n\n return clientErrorPayload?.category === 'expected';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AAEA;AAEA;AAYA;AAmBA;AACA;AAYA;AAAqD;AAAA;AAAA;AAAA;AAErD,wBAA0D,IAAAA,wBAAgB,GAAE;EAArEC,YAAY,qBAAZA,YAAY;EAAEC,cAAc,qBAAdA,cAAc;EAAEC,iBAAiB,qBAAjBA,iBAAiB;AAiBtD;AACA;AACA;AACA;AACA;AAJA,IAKqBC,qBAAqB;EAAA;EAAA;EACxC;;EAEqB;;EAErB;AACF;AACA;AACA;EACE,iCAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IACb;IAAA;IAAA;IAAA,8GAsnBuC,UAACC,KAAY,EAAEC,UAAmB,EAAmB;MAC5F;MACA;MACA,IAAMC,eAAe,GAAG,IAAAC,kDAA2B,EAAC,MAAKC,KAAK,EAAE;QAC9DC,YAAY,EAAEL,KAAK;QACnBM,IAAI,EAAE,CAAC,kBAAkB;MAC3B,CAAC,CAAC;;MAEF;MACAJ,eAAe,CAACG,YAAY,CAACE,UAAU,CAACC,IAAI,GAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,EAAE;MAEvE,MAAKC,MAAM,CAACC,GAAG,CACbC,uCAA8B,8GAEV,wBAAeX,eAAe,CAAC,EACpD;;MAED;MACA,OAAO,MAAKE,KAAK,CAACU,QAAQ,CAACC,UAAU,CAACC,kBAAkB,CAACd,eAAe,EAAED,UAAU,CAAC;IACvF,CAAC;IAxoBC,MAAKU,MAAM,GAAG,MAAKP,KAAK,CAACO,MAAM;IAC/B;IACA,MAAKM,2BAA2B,GAAG,IAAIC,qCAA2B,CAAC,CAAC,CAAC,EAAE;MAACC,MAAM,EAAE,MAAKf;IAAK,CAAC,CAAC;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,GAAG,wBAAwB;cAC7C;;cAEA;cAAA,iCACO,IAAI,CAACrK,KAAK,CAACwK,mBAAmB,CAACP,OAAO,CAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CAC/C;MAAA;QAAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;AACA;EAJE;IAAA;IAAA,OAKA,gCAA8BhD,gBAAwB,EAAW;MAC/D,IAAMD,eAAe,GAAGoB,sDAA6C,CAACnB,gBAAgB,CAAC;MACvF,IAAMwD,kBAAkB,GAAGpD,2CAAkC,CAACL,eAAe,CAAC;MAE9E,OAAO,CAAAyD,kBAAkB,aAAlBA,kBAAkB,uBAAlBA,kBAAkB,CAAEjD,QAAQ,MAAK,UAAU;IACpD;EAAC;EAAA;AAAA,EAztBgDkD,+BAAoB;AAAA"}
|
|
1
|
+
{"version":3,"names":["BrowserDetection","getOSVersion","getBrowserName","getBrowserVersion","CallDiagnosticMetrics","args","event","preLoginId","diagnosticEvent","prepareDiagnosticMetricItem","webex","eventPayload","type","originTime","sent","Date","toISOString","logger","log","CALL_DIAGNOSTIC_LOG_IDENTIFIER","internal","newMetrics","postPreLoginMetric","callDiagnosticEventsBatcher","CallDiagnosticEventsBatcher","parent","canAuthorize","credentials","isUnverifiedGuest","meetingId","meeting","meetings","meetingCollection","get","meetingInfo","enableConvergedArchitecture","undefined","options","defaultClientType","config","metrics","clientType","defaultSubClientType","subClientType","providedClientVersion","clientVersion","defaultSDKClientVersion","CLIENT_NAME","version","versionMetadata","extractVersionMetadata","origin","name","networkType","userAgent","userAgentToString","clientName","webexVersion","clientInfo","localNetworkPrefix","anonymizeIPAddress","geoHintInfo","clientAddress","osVersion","os","getOSNameInternal","browser","browserVersion","environment","newEnvironment","clientLaunchMethod","Error","mediaConnections","correlationId","webexConferenceIdStr","globalMeetingId","identifiers","device","userId","deviceId","url","orgId","locusUrl","services","locusInfo","fullState","locusId","split","pop","locusStartTime","lastActive","confID","mediaAgentAlias","mediaAgentGroupId","eventData","getOrigin","eventId","uuid","v4","triggered","senderCountryCode","countryCode","clearEmptyKeysRecursively","payload","console","warn","submitClientMetrics","CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND","fields","getIdentifiers","clientEventObject","canProceed","webClientDomain","window","location","hostname","intervals","sourceMetadata","applicationSoftwareType","applicationSoftwareVersion","mediaEngineSoftwareType","mediaEngineSoftwareVersion","startTime","prepareDiagnosticEvent","submitToCallDiagnostics","clientErrorCode","serviceErrorCode","serviceErrorName","error","partialParsedError","CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD","fatal","shownToUser","category","errorCode","errorData","errorName","rawError","isBrowserMediaErrorName","getErrorPayloadForClientErrorCode","BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP","body","code","reason","reasonCode","SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP","isLocusServiceErrorCode","NEW_LOCUS_ERROR_CLIENT_CODE","isMeetingInfoServiceError","MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE","isNetworkError","NETWORK_ERROR","errorDescription","message","isUnauthorizedError","AUTHENTICATION_FAILED_CODE","UNKNOWN_ERROR","errors","userType","getCurUserType","loginType","getCurLoginType","isConvergedArchitectureEnabled","getIsConvergedArchitectureEnabled","rawErrorMessage","generateCommonErrorMetadata","generatedError","generateClientEventErrorPayload","push","createClientEventObjectInMeeting","createClientEventObjectPreMeeting","prepareClientEvent","submitToCallDiagnosticsPreLogin","finalEvent","request","clientEvent","method","service","resource","headers","authorization","prepareFetchOptions","clientErrorPayload","StatelessWebexPlugin"],"sources":["call-diagnostic-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\nimport {getOSNameInternal} from '@webex/internal-plugin-metrics';\nimport {BrowserDetection} from '@webex/common';\nimport uuid from 'uuid';\nimport {merge} from 'lodash';\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {\n anonymizeIPAddress,\n clearEmptyKeysRecursively,\n isLocusServiceErrorCode,\n prepareDiagnosticMetricItem,\n userAgentToString,\n extractVersionMetadata,\n isMeetingInfoServiceError,\n isBrowserMediaErrorName,\n isNetworkError,\n isUnauthorizedError,\n} from './call-diagnostic-metrics.util';\nimport {CLIENT_NAME} from '../config';\nimport {\n Event,\n ClientType,\n SubClientType,\n NetworkType,\n EnvironmentType,\n NewEnvironmentType,\n ClientEvent,\n SubmitClientEventOptions,\n MediaQualityEvent,\n SubmitMQEOptions,\n SubmitMQEPayload,\n ClientLaunchMethodType,\n ClientEventError,\n ClientEventPayload,\n ClientInfo,\n ClientEventPayloadError,\n} from '../metrics.types';\nimport CallDiagnosticEventsBatcher from './call-diagnostic-metrics-batcher';\nimport {\n CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD,\n CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND,\n NEW_LOCUS_ERROR_CLIENT_CODE,\n SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP,\n UNKNOWN_ERROR,\n BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP,\n MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n NETWORK_ERROR,\n AUTHENTICATION_FAILED_CODE,\n} from './config';\nimport {generateCommonErrorMetadata} from '../utils';\n\nconst {getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();\n\ntype GetOriginOptions = {\n clientType: ClientType;\n subClientType: SubClientType;\n networkType?: NetworkType;\n clientLaunchMethod?: ClientLaunchMethodType;\n environment?: EnvironmentType;\n newEnvironment?: NewEnvironmentType;\n};\n\ntype GetIdentifiersOptions = {\n meeting?: any;\n mediaConnections?: any[];\n correlationId?: string;\n globalMeetingId?: string;\n webexConferenceIdStr?: string;\n};\n\n/**\n * @description Util class to handle Call Analyzer Metrics\n * @export\n * @class CallDiagnosticMetrics\n */\nexport default class CallDiagnosticMetrics extends StatelessWebexPlugin {\n // @ts-ignore\n private callDiagnosticEventsBatcher: CallDiagnosticEventsBatcher;\n private logger: any; // to avoid adding @ts-ignore everywhere\n\n /**\n * Constructor\n * @param args\n */\n constructor(...args) {\n super(...args);\n // @ts-ignore\n this.logger = this.webex.logger;\n // @ts-ignore\n this.callDiagnosticEventsBatcher = new CallDiagnosticEventsBatcher({}, {parent: this.webex});\n }\n\n /**\n * Returns the login type of the current user\n * @returns one of 'login-ci','unverified-guest', null\n */\n getCurLoginType() {\n // @ts-ignore\n if (this.webex.canAuthorize) {\n // @ts-ignore\n return this.webex.credentials.isUnverifiedGuest ? 'unverified-guest' : 'login-ci';\n }\n\n return null;\n }\n\n /**\n * Returns if the meeting has converged architecture enabled\n * @param options.meetingId\n */\n getIsConvergedArchitectureEnabled({meetingId}: {meetingId?: string}): boolean {\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n return meeting?.meetingInfo?.enableConvergedArchitecture;\n }\n\n return undefined;\n }\n\n /**\n * Get origin object for Call Diagnostic Event payload.\n * @param options\n * @param meetingId\n * @returns\n */\n getOrigin(options: GetOriginOptions, meetingId?: string) {\n const defaultClientType: ClientType =\n // @ts-ignore\n this.webex.meetings.config?.metrics?.clientType;\n const defaultSubClientType: SubClientType =\n // @ts-ignore\n this.webex.meetings.config?.metrics?.subClientType;\n // @ts-ignore\n const providedClientVersion: string = this.webex.meetings.config?.metrics?.clientVersion;\n // @ts-ignore\n const defaultSDKClientVersion = `${CLIENT_NAME}/${this.webex.version}`;\n\n let versionMetadata: Pick<ClientInfo, 'majorVersion' | 'minorVersion'> = {};\n\n // sdk version split doesn't really make sense for now...\n if (providedClientVersion) {\n versionMetadata = extractVersionMetadata(providedClientVersion);\n }\n\n if (\n (defaultClientType && defaultSubClientType) ||\n (options.clientType && options.subClientType)\n ) {\n const origin: Event['origin'] = {\n name: 'endpoint',\n networkType: options?.networkType || 'unknown',\n userAgent: userAgentToString({\n // @ts-ignore\n clientName: this.webex.meetings?.config?.metrics?.clientName,\n // @ts-ignore\n webexVersion: this.webex.version,\n }),\n clientInfo: {\n clientType: options?.clientType || defaultClientType,\n clientVersion: providedClientVersion || defaultSDKClientVersion,\n ...versionMetadata,\n localNetworkPrefix:\n // @ts-ignore\n anonymizeIPAddress(this.webex.meetings.geoHintInfo?.clientAddress) || undefined,\n osVersion: getOSVersion() || 'unknown',\n subClientType: options?.subClientType || defaultSubClientType,\n os: getOSNameInternal(),\n browser: getBrowserName(),\n browserVersion: getBrowserVersion(),\n },\n };\n\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n if (meeting?.environment) {\n origin.environment = meeting.environment;\n }\n }\n\n if (options?.environment) {\n origin.environment = options.environment;\n }\n\n if (options?.newEnvironment) {\n origin.newEnvironment = options.newEnvironment;\n }\n\n if (options?.clientLaunchMethod) {\n origin.clientInfo.clientLaunchMethod = options.clientLaunchMethod;\n }\n\n return origin;\n }\n\n throw new Error(\"ClientType and SubClientType can't be undefined\");\n }\n\n /**\n * Gather identifier details for call diagnostic payload.\n * @throws Error if initialization fails.\n * @param options\n */\n getIdentifiers(options: GetIdentifiersOptions) {\n const {meeting, mediaConnections, correlationId, webexConferenceIdStr, globalMeetingId} =\n options;\n const identifiers: Event['event']['identifiers'] = {\n correlationId: 'unknown',\n };\n\n if (meeting) {\n identifiers.correlationId = meeting.correlationId;\n }\n\n if (correlationId) {\n identifiers.correlationId = correlationId;\n }\n // @ts-ignore\n if (this.webex.internal) {\n // @ts-ignore\n const {device} = this.webex.internal;\n identifiers.userId = device.userId;\n identifiers.deviceId = device.url;\n identifiers.orgId = device.orgId;\n // @ts-ignore\n identifiers.locusUrl = this.webex.internal.services.get('locus');\n }\n\n if (meeting?.locusInfo?.fullState) {\n identifiers.locusUrl = meeting.locusUrl;\n identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();\n identifiers.locusStartTime =\n meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;\n }\n\n if (meeting?.meetingInfo?.confID) {\n identifiers.webexConferenceIdStr = meeting.meetingInfo?.confID;\n }\n\n if (meeting?.meetingInfo?.meetingId) {\n identifiers.globalMeetingId = meeting.meetingInfo?.meetingId;\n }\n\n if (mediaConnections) {\n identifiers.mediaAgentAlias = mediaConnections?.[0]?.mediaAgentAlias;\n identifiers.mediaAgentGroupId = mediaConnections?.[0]?.mediaAgentGroupId;\n }\n\n if (!identifiers?.webexConferenceIdStr && webexConferenceIdStr) {\n identifiers.webexConferenceIdStr = webexConferenceIdStr;\n }\n\n if (!identifiers?.globalMeetingId && globalMeetingId) {\n identifiers.globalMeetingId = globalMeetingId;\n }\n\n if (identifiers.correlationId === undefined) {\n throw new Error('Identifiers initialization failed.');\n }\n\n return identifiers;\n }\n\n /**\n * Create diagnostic event, which can hold client event, feature event or MQE event data.\n * This just initiates the shared properties that are required for all the 3 event categories.\n * @param eventData\n * @param options\n * @returns\n */\n prepareDiagnosticEvent(eventData: Event['event'], options: any) {\n const {meetingId} = options;\n const origin = this.getOrigin(options, meetingId);\n\n const event: Event = {\n eventId: uuid.v4(),\n version: 1,\n origin,\n originTime: {\n triggered: new Date().toISOString(),\n // is overridden in prepareRequest batcher\n sent: 'not_defined_yet',\n },\n // @ts-ignore\n senderCountryCode: this.webex.meetings.geoHintInfo?.countryCode,\n event: eventData,\n };\n\n // sanitize (remove empty properties, CA requires it)\n // but we don't want to sanitize MQE as most of the times\n // values will be 0, [] etc, and they are required.\n if (eventData.name !== 'client.mediaquality.event') {\n clearEmptyKeysRecursively(event);\n }\n\n return event;\n }\n\n /**\n * TODO: NOT IMPLEMENTED\n * Submit Feature Event\n * @returns\n */\n public submitFeatureEvent() {\n throw Error('Not implemented');\n }\n\n /**\n * Submit Media Quality Event\n * @param args - submit params\n * @param arg.name - event key\n * @param arg.payload - additional payload to be merge with the default payload\n * @param arg.options - options\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: SubmitMQEOptions;\n }) {\n const {meetingId, mediaConnections, webexConferenceIdStr, globalMeetingId} = options;\n\n // events that will most likely happen in join phase\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n if (!meeting) {\n console.warn(\n 'Attempt to send MQE but no meeting was found...',\n `event: ${name}, meetingId: ${meetingId}`\n );\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId,\n name,\n },\n });\n\n return;\n }\n\n // merge identifiers\n const identifiers = this.getIdentifiers({\n meeting,\n mediaConnections: meeting.mediaConnections || mediaConnections,\n webexConferenceIdStr,\n globalMeetingId,\n });\n\n // create media quality event object\n let clientEventObject: MediaQualityEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n intervals: payload.intervals,\n sourceMetadata: {\n applicationSoftwareType: CLIENT_NAME,\n // @ts-ignore\n applicationSoftwareVersion: this.webex.version,\n mediaEngineSoftwareType: getBrowserName() || 'browser',\n mediaEngineSoftwareVersion: getOSVersion() || 'unknown',\n startTime: new Date().toISOString(),\n },\n };\n\n // merge any new properties, or override existing ones\n clientEventObject = merge(clientEventObject, payload);\n\n // append media quality event data to the call diagnostic event\n const diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n this.submitToCallDiagnostics(diagnosticEvent);\n } else {\n throw new Error(\n 'Media quality events cant be sent outside the context of a meeting. Meeting id is required.'\n );\n }\n }\n\n /**\n * Return Client Event payload by client error code\n * @param arg - get error arg\n * @param arg.clientErrorCode\n * @param arg.serviceErrorCode\n * @returns\n */\n public getErrorPayloadForClientErrorCode({\n clientErrorCode,\n serviceErrorCode,\n serviceErrorName,\n }: {\n clientErrorCode: number;\n serviceErrorCode: any;\n serviceErrorName?: any;\n }): ClientEventError {\n let error: ClientEventError;\n\n if (clientErrorCode) {\n const partialParsedError = CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n\n if (partialParsedError) {\n error = merge(\n {fatal: true, shownToUser: false, name: 'other', category: 'other'}, // default values\n {errorCode: clientErrorCode},\n serviceErrorName ? {errorData: {errorName: serviceErrorName}} : {},\n {serviceErrorCode},\n partialParsedError\n );\n\n return error;\n }\n }\n\n return undefined;\n }\n\n /**\n * Generate error payload for Client Event\n * @param rawError\n */\n generateClientEventErrorPayload(rawError: any) {\n if (rawError.name) {\n if (isBrowserMediaErrorName(rawError.name)) {\n return this.getErrorPayloadForClientErrorCode({\n serviceErrorCode: undefined,\n clientErrorCode: BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name],\n serviceErrorName: rawError.name,\n });\n }\n }\n\n const serviceErrorCode =\n rawError?.error?.body?.errorCode ||\n rawError?.body?.errorCode ||\n rawError?.body?.code ||\n rawError?.body?.reason?.reasonCode;\n\n if (serviceErrorCode) {\n const clientErrorCode = SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n if (clientErrorCode) {\n return this.getErrorPayloadForClientErrorCode({clientErrorCode, serviceErrorCode});\n }\n\n // by default, if it is locus error, return new locus err\n if (isLocusServiceErrorCode(serviceErrorCode)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: NEW_LOCUS_ERROR_CLIENT_CODE,\n serviceErrorCode,\n });\n }\n }\n\n if (isMeetingInfoServiceError(rawError)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n serviceErrorCode,\n });\n }\n\n if (isNetworkError(rawError)) {\n const payload = this.getErrorPayloadForClientErrorCode({\n clientErrorCode: NETWORK_ERROR,\n serviceErrorCode,\n });\n payload.errorDescription = rawError.message;\n\n return payload;\n }\n\n if (isUnauthorizedError(rawError)) {\n const payload = this.getErrorPayloadForClientErrorCode({\n clientErrorCode: AUTHENTICATION_FAILED_CODE,\n serviceErrorCode,\n });\n payload.errorDescription = rawError.message;\n\n return payload;\n }\n\n // otherwise return unkown error\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: UNKNOWN_ERROR,\n serviceErrorCode: UNKNOWN_ERROR,\n });\n }\n\n /**\n * Create client event object for in meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - options\n * @returns object\n */\n private createClientEventObjectInMeeting({\n name,\n options,\n errors,\n }: {\n name: ClientEvent['name'];\n options?: SubmitClientEventOptions;\n errors?: ClientEventPayloadError;\n }) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @createClientEventObjectInMeeting. Creating in meeting event object.',\n `name: ${name}`\n );\n const {meetingId, mediaConnections, globalMeetingId, webexConferenceIdStr} = options;\n\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n if (!meeting) {\n console.warn(\n 'Attempt to send client event but no meeting was found...',\n `name: ${name}, meetingId: ${meetingId}`\n );\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId,\n name,\n },\n });\n\n return undefined;\n }\n\n // grab identifiers\n const identifiers = this.getIdentifiers({\n meeting,\n mediaConnections: meeting?.mediaConnections || mediaConnections,\n webexConferenceIdStr,\n globalMeetingId,\n });\n\n // create client event object\n const clientEventObject: ClientEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n errors,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n userType: meeting.getCurUserType(),\n loginType: this.getCurLoginType(),\n isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({\n meetingId,\n }),\n };\n\n if (options?.rawError?.message) {\n // @ts-ignore\n clientEventObject.eventData.rawErrorMessage = options?.rawError?.message;\n }\n\n return clientEventObject;\n }\n\n /**\n * Create client event object for pre meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - payload\n * @returns object\n */\n private createClientEventObjectPreMeeting({\n name,\n options,\n errors,\n }: {\n name: ClientEvent['name'];\n options?: SubmitClientEventOptions;\n errors?: ClientEventPayloadError;\n }) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @createClientEventObjectPreMeeting. Creating pre meeting event object.',\n `name: ${name}`\n );\n const {correlationId, globalMeetingId, webexConferenceIdStr} = options;\n\n // grab identifiers\n const identifiers = this.getIdentifiers({\n correlationId,\n globalMeetingId,\n webexConferenceIdStr,\n });\n\n // create client event object\n const clientEventObject: ClientEvent['payload'] = {\n name,\n errors,\n canProceed: true,\n identifiers,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n loginType: this.getCurLoginType(),\n };\n\n if (options?.rawError?.message) {\n // @ts-ignore\n clientEventObject.eventData.rawErrorMessage = options?.rawError?.message;\n }\n\n return clientEventObject;\n }\n\n /**\n * Prepare Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @returns {any} options to be with fetch\n * @throws\n */\n private prepareClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }) {\n const {meetingId, correlationId, rawError} = options;\n let clientEventObject: ClientEvent['payload'];\n\n // check if we need to generate errors\n const errors: ClientEventPayloadError = [];\n\n if (rawError) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @prepareClientEvent. Error detected, attempting to map and attach it to the event...',\n `name: ${name}`,\n `rawError: ${generateCommonErrorMetadata(rawError)}`\n );\n\n const generatedError = this.generateClientEventErrorPayload(rawError);\n if (generatedError) {\n errors.push(generatedError);\n }\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @prepareClientEvent. Generated errors:',\n `generatedError: ${JSON.stringify(generatedError)}`\n );\n }\n\n // events that will most likely happen in join phase\n if (meetingId) {\n clientEventObject = this.createClientEventObjectInMeeting({name, options, errors});\n } else if (correlationId) {\n // any pre join events or events that are outside the meeting.\n clientEventObject = this.createClientEventObjectPreMeeting({name, options, errors});\n } else {\n throw new Error('Not implemented');\n }\n\n // merge any new properties, or override existing ones\n clientEventObject = merge(clientEventObject, payload);\n\n // append client event data to the call diagnostic event\n const diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n\n return diagnosticEvent;\n }\n\n /**\n * Submit Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @throws\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }) {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.',\n `name: ${name}`,\n `payload: ${JSON.stringify(payload)}`,\n `options: ${JSON.stringify(options)}`\n );\n const diagnosticEvent = this.prepareClientEvent({name, payload, options});\n\n if (options?.preLoginId) {\n return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options?.preLoginId);\n }\n\n return this.submitToCallDiagnostics(diagnosticEvent);\n }\n\n /**\n * Prepare the event and send the request to metrics-a service.\n * @param event\n * @returns promise\n */\n submitToCallDiagnostics(event: Event): Promise<any> {\n // build metrics-a event type\n const finalEvent = {\n eventPayload: event,\n type: ['diagnostic-event'],\n };\n\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @submitToCallDiagnostics. Preparing to send the request',\n `finalEvent: ${JSON.stringify(finalEvent)}`\n );\n\n return this.callDiagnosticEventsBatcher.request(finalEvent);\n }\n\n /**\n * Pre login events are not batched. We make the request directly.\n * @param event\n * @param preLoginId\n * @returns\n */\n public submitToCallDiagnosticsPreLogin = (event: Event, preLoginId?: string): Promise<any> => {\n // build metrics-a event type\n // @ts-ignore\n const diagnosticEvent = prepareDiagnosticMetricItem(this.webex, {\n eventPayload: event,\n type: ['diagnostic-event'],\n });\n\n // append sent timestamp\n diagnosticEvent.eventPayload.originTime.sent = new Date().toISOString();\n\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n `CallDiagnosticMetrics: @submitToCallDiagnosticsPreLogin. Sending the request:`,\n `diagnosticEvent: ${JSON.stringify(diagnosticEvent)}`\n );\n\n // @ts-ignore\n return this.webex.internal.newMetrics.postPreLoginMetric(diagnosticEvent, preLoginId);\n };\n\n /**\n * Builds a request options object to later be passed to fetch().\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - client event options\n * @returns {Promise<any>}\n * @throws\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n this.logger.log(\n CALL_DIAGNOSTIC_LOG_IDENTIFIER,\n 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...',\n `name: ${name}`,\n `payload: ${JSON.stringify(payload)}`,\n `options: ${JSON.stringify(options)}`\n );\n\n const clientEvent = this.prepareClientEvent({name, payload, options});\n\n // build metrics-a event type\n // @ts-ignore\n const diagnosticEvent = prepareDiagnosticMetricItem(this.webex, {\n eventPayload: clientEvent,\n type: ['diagnostic-event'],\n });\n\n const request = {\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics',\n body: {\n metrics: [diagnosticEvent],\n },\n headers: {},\n };\n\n if (options.preLoginId) {\n request.headers = {\n authorization: false,\n 'x-prelogin-userid': options.preLoginId,\n };\n request.resource = 'clientmetrics-prelogin';\n }\n\n // @ts-ignore\n return this.webex.prepareFetchOptions(request);\n }\n\n /**\n * Returns true if the specified serviceErrorCode maps to an expected error.\n * @param {number} serviceErrorCode the service error code\n * @returns {boolean}\n */\n public isServiceErrorExpected(serviceErrorCode: number): boolean {\n const clientErrorCode = SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n const clientErrorPayload = CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n\n return clientErrorPayload?.category === 'expected';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AAEA;AAEA;AAYA;AAmBA;AACA;AAYA;AAAqD;AAAA;AAAA;AAAA;AAErD,wBAA0D,IAAAA,wBAAgB,GAAE;EAArEC,YAAY,qBAAZA,YAAY;EAAEC,cAAc,qBAAdA,cAAc;EAAEC,iBAAiB,qBAAjBA,iBAAiB;AAmBtD;AACA;AACA;AACA;AACA;AAJA,IAKqBC,qBAAqB;EAAA;EAAA;EACxC;;EAEqB;;EAErB;AACF;AACA;AACA;EACE,iCAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IACb;IAAA;IAAA;IAAA,8GA+oBuC,UAACC,KAAY,EAAEC,UAAmB,EAAmB;MAC5F;MACA;MACA,IAAMC,eAAe,GAAG,IAAAC,kDAA2B,EAAC,MAAKC,KAAK,EAAE;QAC9DC,YAAY,EAAEL,KAAK;QACnBM,IAAI,EAAE,CAAC,kBAAkB;MAC3B,CAAC,CAAC;;MAEF;MACAJ,eAAe,CAACG,YAAY,CAACE,UAAU,CAACC,IAAI,GAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,EAAE;MAEvE,MAAKC,MAAM,CAACC,GAAG,CACbC,uCAA8B,8GAEV,wBAAeX,eAAe,CAAC,EACpD;;MAED;MACA,OAAO,MAAKE,KAAK,CAACU,QAAQ,CAACC,UAAU,CAACC,kBAAkB,CAACd,eAAe,EAAED,UAAU,CAAC;IACvF,CAAC;IAjqBC,MAAKU,MAAM,GAAG,MAAKP,KAAK,CAACO,MAAM;IAC/B;IACA,MAAKM,2BAA2B,GAAG,IAAIC,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O,CAACI,QAAQ,GAAG,wBAAwB;cAC7C;;cAEA;cAAA,iCACO,IAAI,CAACxK,KAAK,CAAC2K,mBAAmB,CAACP,OAAO,CAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CAC/C;MAAA;QAAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;AACA;EAJE;IAAA;IAAA,OAKA,gCAA8BhD,gBAAwB,EAAW;MAC/D,IAAMD,eAAe,GAAGoB,sDAA6C,CAACnB,gBAAgB,CAAC;MACvF,IAAMwD,kBAAkB,GAAGpD,2CAAkC,CAACL,eAAe,CAAC;MAE9E,OAAO,CAAAyD,kBAAkB,aAAlBA,kBAAkB,uBAAlBA,kBAAkB,CAAEjD,QAAQ,MAAK,UAAU;IACpD;EAAC;EAAA;AAAA,EAlvBgDkD,+BAAoB;AAAA"}
|
package/dist/metrics.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["metrics.types.ts"],"sourcesContent":["import {\n ClientEvent as RawClientEvent,\n Event as RawEvent,\n MediaQualityEvent as RawMediaQualityEvent,\n} from '@webex/event-dictionary-ts';\n\nexport type Event = Omit<RawEvent, 'event'> & {event: RawClientEvent | RawMediaQualityEvent};\n\nexport type ClientEventError = NonNullable<RawClientEvent['errors']>[0];\n\nexport type EnvironmentType = NonNullable<RawEvent['origin']['environment']>;\n\nexport type NewEnvironmentType = NonNullable<RawEvent['origin']['newEnvironment']>;\n\nexport type ClientLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['clientLaunchMethod'];\n\nexport type SubmitClientEventOptions = {\n meetingId?: string;\n mediaConnections?: any[];\n rawError?: any;\n correlationId?: string;\n preLoginId?: string;\n environment?: EnvironmentType;\n newEnvironmentType?: NewEnvironmentType;\n clientLaunchMethod?: ClientLaunchMethodType;\n};\n\nexport type SubmitMQEOptions = {\n meetingId: string;\n mediaConnections?: any[];\n networkType?: Event['origin']['networkType'];\n};\n\nexport type InternalEvent = {\n name:\n | 'internal.client.meetinginfo.request'\n | 'internal.client.meetinginfo.response'\n | 'internal.reset.join.latencies'\n | 'internal.client.meeting.click.joinbutton'\n | 'internal.host.meeting.participant.admitted'\n | 'internal.client.meeting.interstitial-window.showed'\n | 'internal.client.interstitial-window.click.joinbutton'\n | 'internal.client.add-media.turn-discovery.start'\n | 'internal.client.add-media.turn-discovery.end';\n\n payload?: never;\n options?: never;\n};\n\nexport interface ClientEvent {\n name: RawClientEvent['name'];\n payload?: RawClientEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface BehavioralEvent {\n // TODO: not implemented\n name: 'host.meeting.participant.admitted' | 'sdk.media-flow.started';\n payload?: never;\n options?: never;\n}\n\nexport interface OperationalEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface FeatureEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface MediaQualityEvent {\n name: RawMediaQualityEvent['name'];\n payload?: RawMediaQualityEvent;\n options: SubmitMQEOptions;\n}\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\n\nexport type MetricEventNames =\n | InternalEvent['name']\n | ClientEvent['name']\n | BehavioralEvent['name']\n | OperationalEvent['name']\n | FeatureEvent['name']\n | MediaQualityEvent['name'];\n\nexport type ClientInfo = NonNullable<RawEvent['origin']['clientInfo']>;\nexport type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];\nexport type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];\nexport type NetworkType = NonNullable<RawEvent['origin']>['networkType'];\n\nexport type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;\nexport type ClientEventLeaveReason = ClientEvent['payload']['leaveReason'];\nexport type ClientEventPayloadError = ClientEvent['payload']['errors'];\n\nexport type MediaQualityEventAudioSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['audioSetupDelay'];\nexport type MediaQualityEventVideoSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['videoSetupDelay'];\n\nexport type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: NonNullable<MediaQualityEvent['payload']>['intervals'];\n};\n\nexport type SubmitInternalEvent = (args: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitBehavioralEvent = (args: {\n name: BehavioralEvent['name'];\n payload?: RecursivePartial<BehavioralEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitClientEvent = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type SubmitOperationalEvent = (args: {\n name: OperationalEvent['name'];\n payload?: RecursivePartial<OperationalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitMQE = (args: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: any;\n}) => void;\n\nexport type BuildClientEventFetchRequestOptions = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["metrics.types.ts"],"sourcesContent":["import {\n ClientEvent as RawClientEvent,\n Event as RawEvent,\n MediaQualityEvent as RawMediaQualityEvent,\n} from '@webex/event-dictionary-ts';\n\nexport type Event = Omit<RawEvent, 'event'> & {event: RawClientEvent | RawMediaQualityEvent};\n\nexport type ClientEventError = NonNullable<RawClientEvent['errors']>[0];\n\nexport type EnvironmentType = NonNullable<RawEvent['origin']['environment']>;\n\nexport type NewEnvironmentType = NonNullable<RawEvent['origin']['newEnvironment']>;\n\nexport type ClientLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['clientLaunchMethod'];\n\nexport type SubmitClientEventOptions = {\n meetingId?: string;\n mediaConnections?: any[];\n rawError?: any;\n correlationId?: string;\n preLoginId?: string;\n environment?: EnvironmentType;\n newEnvironmentType?: NewEnvironmentType;\n clientLaunchMethod?: ClientLaunchMethodType;\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type SubmitMQEOptions = {\n meetingId: string;\n mediaConnections?: any[];\n networkType?: Event['origin']['networkType'];\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type InternalEvent = {\n name:\n | 'internal.client.meetinginfo.request'\n | 'internal.client.meetinginfo.response'\n | 'internal.reset.join.latencies'\n | 'internal.client.meeting.click.joinbutton'\n | 'internal.host.meeting.participant.admitted'\n | 'internal.client.meeting.interstitial-window.showed'\n | 'internal.client.interstitial-window.click.joinbutton'\n | 'internal.client.add-media.turn-discovery.start'\n | 'internal.client.add-media.turn-discovery.end';\n\n payload?: never;\n options?: never;\n};\n\nexport interface ClientEvent {\n name: RawClientEvent['name'];\n payload?: RawClientEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface BehavioralEvent {\n // TODO: not implemented\n name: 'host.meeting.participant.admitted' | 'sdk.media-flow.started';\n payload?: never;\n options?: never;\n}\n\nexport interface OperationalEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface FeatureEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface MediaQualityEvent {\n name: RawMediaQualityEvent['name'];\n payload?: RawMediaQualityEvent;\n options: SubmitMQEOptions;\n}\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\n\nexport type MetricEventNames =\n | InternalEvent['name']\n | ClientEvent['name']\n | BehavioralEvent['name']\n | OperationalEvent['name']\n | FeatureEvent['name']\n | MediaQualityEvent['name'];\n\nexport type ClientInfo = NonNullable<RawEvent['origin']['clientInfo']>;\nexport type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];\nexport type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];\nexport type NetworkType = NonNullable<RawEvent['origin']>['networkType'];\n\nexport type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;\nexport type ClientEventLeaveReason = ClientEvent['payload']['leaveReason'];\nexport type ClientEventPayloadError = ClientEvent['payload']['errors'];\n\nexport type MediaQualityEventAudioSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['audioSetupDelay'];\nexport type MediaQualityEventVideoSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['videoSetupDelay'];\n\nexport type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: NonNullable<MediaQualityEvent['payload']>['intervals'];\n};\n\nexport type SubmitInternalEvent = (args: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitBehavioralEvent = (args: {\n name: BehavioralEvent['name'];\n payload?: RecursivePartial<BehavioralEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitClientEvent = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type SubmitOperationalEvent = (args: {\n name: OperationalEvent['name'];\n payload?: RecursivePartial<OperationalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitMQE = (args: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: any;\n}) => void;\n\nexport type BuildClientEventFetchRequestOptions = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n"],"mappings":""}
|
|
@@ -15,11 +15,15 @@ export type SubmitClientEventOptions = {
|
|
|
15
15
|
environment?: EnvironmentType;
|
|
16
16
|
newEnvironmentType?: NewEnvironmentType;
|
|
17
17
|
clientLaunchMethod?: ClientLaunchMethodType;
|
|
18
|
+
webexConferenceIdStr?: string;
|
|
19
|
+
globalMeetingId?: string;
|
|
18
20
|
};
|
|
19
21
|
export type SubmitMQEOptions = {
|
|
20
22
|
meetingId: string;
|
|
21
23
|
mediaConnections?: any[];
|
|
22
24
|
networkType?: Event['origin']['networkType'];
|
|
25
|
+
webexConferenceIdStr?: string;
|
|
26
|
+
globalMeetingId?: string;
|
|
23
27
|
};
|
|
24
28
|
export type InternalEvent = {
|
|
25
29
|
name: 'internal.client.meetinginfo.request' | 'internal.client.meetinginfo.response' | 'internal.reset.join.latencies' | 'internal.client.meeting.click.joinbutton' | 'internal.host.meeting.participant.admitted' | 'internal.client.meeting.interstitial-window.showed' | 'internal.client.interstitial-window.click.joinbutton' | 'internal.client.add-media.turn-discovery.start' | 'internal.client.add-media.turn-discovery.end';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-metrics",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.272",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@webex/common": "3.0.0-beta.
|
|
32
|
-
"@webex/common-timers": "3.0.0-beta.
|
|
31
|
+
"@webex/common": "3.0.0-beta.272",
|
|
32
|
+
"@webex/common-timers": "3.0.0-beta.272",
|
|
33
33
|
"@webex/event-dictionary-ts": "^1.0.1290",
|
|
34
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
35
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
38
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
34
|
+
"@webex/internal-plugin-device": "3.0.0-beta.272",
|
|
35
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.272",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.272",
|
|
37
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.272",
|
|
38
|
+
"@webex/webex-core": "3.0.0-beta.272"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -68,6 +68,8 @@ type GetIdentifiersOptions = {
|
|
|
68
68
|
meeting?: any;
|
|
69
69
|
mediaConnections?: any[];
|
|
70
70
|
correlationId?: string;
|
|
71
|
+
globalMeetingId?: string;
|
|
72
|
+
webexConferenceIdStr?: string;
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
/**
|
|
@@ -206,8 +208,11 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
206
208
|
* @param options
|
|
207
209
|
*/
|
|
208
210
|
getIdentifiers(options: GetIdentifiersOptions) {
|
|
209
|
-
const {meeting, mediaConnections, correlationId} =
|
|
210
|
-
|
|
211
|
+
const {meeting, mediaConnections, correlationId, webexConferenceIdStr, globalMeetingId} =
|
|
212
|
+
options;
|
|
213
|
+
const identifiers: Event['event']['identifiers'] = {
|
|
214
|
+
correlationId: 'unknown',
|
|
215
|
+
};
|
|
211
216
|
|
|
212
217
|
if (meeting) {
|
|
213
218
|
identifiers.correlationId = meeting.correlationId;
|
|
@@ -234,11 +239,27 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
234
239
|
meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
|
|
235
240
|
}
|
|
236
241
|
|
|
242
|
+
if (meeting?.meetingInfo?.confID) {
|
|
243
|
+
identifiers.webexConferenceIdStr = meeting.meetingInfo?.confID;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (meeting?.meetingInfo?.meetingId) {
|
|
247
|
+
identifiers.globalMeetingId = meeting.meetingInfo?.meetingId;
|
|
248
|
+
}
|
|
249
|
+
|
|
237
250
|
if (mediaConnections) {
|
|
238
251
|
identifiers.mediaAgentAlias = mediaConnections?.[0]?.mediaAgentAlias;
|
|
239
252
|
identifiers.mediaAgentGroupId = mediaConnections?.[0]?.mediaAgentGroupId;
|
|
240
253
|
}
|
|
241
254
|
|
|
255
|
+
if (!identifiers?.webexConferenceIdStr && webexConferenceIdStr) {
|
|
256
|
+
identifiers.webexConferenceIdStr = webexConferenceIdStr;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (!identifiers?.globalMeetingId && globalMeetingId) {
|
|
260
|
+
identifiers.globalMeetingId = globalMeetingId;
|
|
261
|
+
}
|
|
262
|
+
|
|
242
263
|
if (identifiers.correlationId === undefined) {
|
|
243
264
|
throw new Error('Identifiers initialization failed.');
|
|
244
265
|
}
|
|
@@ -306,7 +327,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
306
327
|
payload: SubmitMQEPayload;
|
|
307
328
|
options: SubmitMQEOptions;
|
|
308
329
|
}) {
|
|
309
|
-
const {meetingId, mediaConnections} = options;
|
|
330
|
+
const {meetingId, mediaConnections, webexConferenceIdStr, globalMeetingId} = options;
|
|
310
331
|
|
|
311
332
|
// events that will most likely happen in join phase
|
|
312
333
|
if (meetingId) {
|
|
@@ -333,6 +354,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
333
354
|
const identifiers = this.getIdentifiers({
|
|
334
355
|
meeting,
|
|
335
356
|
mediaConnections: meeting.mediaConnections || mediaConnections,
|
|
357
|
+
webexConferenceIdStr,
|
|
358
|
+
globalMeetingId,
|
|
336
359
|
});
|
|
337
360
|
|
|
338
361
|
// create media quality event object
|
|
@@ -495,7 +518,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
495
518
|
'CallDiagnosticMetrics: @createClientEventObjectInMeeting. Creating in meeting event object.',
|
|
496
519
|
`name: ${name}`
|
|
497
520
|
);
|
|
498
|
-
const {meetingId, mediaConnections} = options;
|
|
521
|
+
const {meetingId, mediaConnections, globalMeetingId, webexConferenceIdStr} = options;
|
|
499
522
|
|
|
500
523
|
// @ts-ignore
|
|
501
524
|
const meeting = this.webex.meetings.meetingCollection.get(meetingId);
|
|
@@ -520,6 +543,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
520
543
|
const identifiers = this.getIdentifiers({
|
|
521
544
|
meeting,
|
|
522
545
|
mediaConnections: meeting?.mediaConnections || mediaConnections,
|
|
546
|
+
webexConferenceIdStr,
|
|
547
|
+
globalMeetingId,
|
|
523
548
|
});
|
|
524
549
|
|
|
525
550
|
// create client event object
|
|
@@ -567,11 +592,13 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
567
592
|
'CallDiagnosticMetrics: @createClientEventObjectPreMeeting. Creating pre meeting event object.',
|
|
568
593
|
`name: ${name}`
|
|
569
594
|
);
|
|
570
|
-
const {correlationId} = options;
|
|
595
|
+
const {correlationId, globalMeetingId, webexConferenceIdStr} = options;
|
|
571
596
|
|
|
572
597
|
// grab identifiers
|
|
573
598
|
const identifiers = this.getIdentifiers({
|
|
574
599
|
correlationId,
|
|
600
|
+
globalMeetingId,
|
|
601
|
+
webexConferenceIdStr,
|
|
575
602
|
});
|
|
576
603
|
|
|
577
604
|
// create client event object
|
package/src/metrics.types.ts
CHANGED
|
@@ -25,12 +25,16 @@ export type SubmitClientEventOptions = {
|
|
|
25
25
|
environment?: EnvironmentType;
|
|
26
26
|
newEnvironmentType?: NewEnvironmentType;
|
|
27
27
|
clientLaunchMethod?: ClientLaunchMethodType;
|
|
28
|
+
webexConferenceIdStr?: string;
|
|
29
|
+
globalMeetingId?: string;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
export type SubmitMQEOptions = {
|
|
31
33
|
meetingId: string;
|
|
32
34
|
mediaConnections?: any[];
|
|
33
35
|
networkType?: Event['origin']['networkType'];
|
|
36
|
+
webexConferenceIdStr?: string;
|
|
37
|
+
globalMeetingId?: string;
|
|
34
38
|
};
|
|
35
39
|
|
|
36
40
|
export type InternalEvent = {
|
|
@@ -262,6 +262,63 @@ describe('internal-plugin-metrics', () => {
|
|
|
262
262
|
});
|
|
263
263
|
});
|
|
264
264
|
|
|
265
|
+
it('should build identifiers correctly with a meeting that has meetingInfo with a webexConferenceIdStr and globalMeetingId, and that should take precedence over the options passed to it', () => {
|
|
266
|
+
const res = cd.getIdentifiers({
|
|
267
|
+
mediaConnections: [
|
|
268
|
+
{mediaAgentAlias: 'mediaAgentAlias', mediaAgentGroupId: 'mediaAgentGroupId'},
|
|
269
|
+
],
|
|
270
|
+
webexConferenceIdStr: 'webexConferenceIdStr',
|
|
271
|
+
globalMeetingId: 'globalMeetingId',
|
|
272
|
+
meeting: {...fakeMeeting, meetingInfo: {...fakeMeeting.meetingInfo, confID: 'webexConferenceIdStr1', meetingId: 'globalMeetingId1'}},
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
assert.deepEqual(res, {
|
|
276
|
+
correlationId: 'correlationId',
|
|
277
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
278
|
+
globalMeetingId: 'globalMeetingId1',
|
|
279
|
+
deviceId: 'deviceUrl',
|
|
280
|
+
locusId: 'url',
|
|
281
|
+
locusStartTime: 'lastActive',
|
|
282
|
+
locusUrl: 'locus/url',
|
|
283
|
+
mediaAgentAlias: 'mediaAgentAlias',
|
|
284
|
+
mediaAgentGroupId: 'mediaAgentGroupId',
|
|
285
|
+
orgId: 'orgId',
|
|
286
|
+
userId: 'userId',
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('should build identifiers correctly given webexConferenceIdStr', () => {
|
|
291
|
+
const res = cd.getIdentifiers({
|
|
292
|
+
correlationId: 'correlationId',
|
|
293
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
assert.deepEqual(res, {
|
|
297
|
+
correlationId: 'correlationId',
|
|
298
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
299
|
+
deviceId: 'deviceUrl',
|
|
300
|
+
locusUrl: 'locus-url',
|
|
301
|
+
orgId: 'orgId',
|
|
302
|
+
userId: 'userId',
|
|
303
|
+
});
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
it('should build identifiers correctly given globalMeetingId', () => {
|
|
307
|
+
const res = cd.getIdentifiers({
|
|
308
|
+
correlationId: 'correlationId',
|
|
309
|
+
globalMeetingId: 'globalMeetingId1',
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
assert.deepEqual(res, {
|
|
313
|
+
correlationId: 'correlationId',
|
|
314
|
+
globalMeetingId: 'globalMeetingId1',
|
|
315
|
+
deviceId: 'deviceUrl',
|
|
316
|
+
locusUrl: 'locus-url',
|
|
317
|
+
orgId: 'orgId',
|
|
318
|
+
userId: 'userId',
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
|
|
265
322
|
it('should build identifiers correctly given correlationId', () => {
|
|
266
323
|
const res = cd.getIdentifiers({
|
|
267
324
|
correlationId: 'correlationId',
|
|
@@ -296,7 +353,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
296
353
|
const res = cd.prepareDiagnosticEvent(
|
|
297
354
|
{
|
|
298
355
|
canProceed: false,
|
|
299
|
-
identifiers: {correlationId: 'id'},
|
|
356
|
+
identifiers: {correlationId: 'id', webexConferenceIdStr: 'webexConferenceIdStr1', globalMeetingId: 'globalMeetingId1'},
|
|
300
357
|
name: 'client.alert.displayed',
|
|
301
358
|
},
|
|
302
359
|
options
|
|
@@ -309,6 +366,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
309
366
|
canProceed: false,
|
|
310
367
|
identifiers: {
|
|
311
368
|
correlationId: 'id',
|
|
369
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
370
|
+
globalMeetingId: 'globalMeetingId1',
|
|
312
371
|
},
|
|
313
372
|
name: 'client.alert.displayed',
|
|
314
373
|
},
|
|
@@ -345,6 +404,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
345
404
|
assert.calledWith(getIdentifiersSpy, {
|
|
346
405
|
meeting: fakeMeeting,
|
|
347
406
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
407
|
+
webexConferenceIdStr: undefined,
|
|
408
|
+
globalMeetingId: undefined,
|
|
348
409
|
});
|
|
349
410
|
assert.notCalled(generateClientEventErrorPayloadSpy);
|
|
350
411
|
assert.calledWith(
|
|
@@ -429,7 +490,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
429
490
|
|
|
430
491
|
});
|
|
431
492
|
|
|
432
|
-
it('should submit client event successfully with correlationId', () => {
|
|
493
|
+
it('should submit client event successfully with correlationId, webexConferenceIdStr, and gloablMeetingId', () => {
|
|
433
494
|
const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
|
|
434
495
|
const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
|
|
435
496
|
const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
|
|
@@ -438,6 +499,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
438
499
|
|
|
439
500
|
const options = {
|
|
440
501
|
correlationId: 'correlationId',
|
|
502
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
503
|
+
globalMeetingId: 'globalMeetingId1',
|
|
441
504
|
};
|
|
442
505
|
|
|
443
506
|
cd.submitClientEvent({
|
|
@@ -447,6 +510,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
447
510
|
|
|
448
511
|
assert.calledWith(getIdentifiersSpy, {
|
|
449
512
|
correlationId: 'correlationId',
|
|
513
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
514
|
+
globalMeetingId: 'globalMeetingId1',
|
|
450
515
|
});
|
|
451
516
|
|
|
452
517
|
assert.notCalled(generateClientEventErrorPayloadSpy);
|
|
@@ -459,6 +524,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
459
524
|
},
|
|
460
525
|
identifiers: {
|
|
461
526
|
correlationId: 'correlationId',
|
|
527
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
528
|
+
globalMeetingId: 'globalMeetingId1',
|
|
462
529
|
deviceId: 'deviceUrl',
|
|
463
530
|
locusUrl: 'locus-url',
|
|
464
531
|
orgId: 'orgId',
|
|
@@ -477,6 +544,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
477
544
|
},
|
|
478
545
|
identifiers: {
|
|
479
546
|
correlationId: 'correlationId',
|
|
547
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
548
|
+
globalMeetingId: 'globalMeetingId1',
|
|
480
549
|
deviceId: 'deviceUrl',
|
|
481
550
|
locusUrl: 'locus-url',
|
|
482
551
|
orgId: 'orgId',
|
|
@@ -516,7 +585,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
516
585
|
assert.deepEqual(webexLoggerLogCalls[2].args, [
|
|
517
586
|
'call-diagnostic-events -> ',
|
|
518
587
|
'CallDiagnosticMetrics: @submitToCallDiagnostics. Preparing to send the request',
|
|
519
|
-
`finalEvent: {"eventPayload":{"eventId":"my-fake-id","version":1,"origin":{"origin":"fake-origin"},"originTime":{"triggered":"${now.toISOString()}","sent":"not_defined_yet"},"senderCountryCode":"UK","event":{"name":"client.alert.displayed","canProceed":true,"identifiers":{"correlationId":"correlationId","userId":"userId","deviceId":"deviceUrl","orgId":"orgId","locusUrl":"locus-url"},"eventData":{"webClientDomain":"whatever"},"loginType":"login-ci"}},"type":["diagnostic-event"]}`,
|
|
588
|
+
`finalEvent: {"eventPayload":{"eventId":"my-fake-id","version":1,"origin":{"origin":"fake-origin"},"originTime":{"triggered":"${now.toISOString()}","sent":"not_defined_yet"},"senderCountryCode":"UK","event":{"name":"client.alert.displayed","canProceed":true,"identifiers":{"correlationId":"correlationId","userId":"userId","deviceId":"deviceUrl","orgId":"orgId","locusUrl":"locus-url","webexConferenceIdStr":"webexConferenceIdStr1","globalMeetingId":"globalMeetingId1"},"eventData":{"webClientDomain":"whatever"},"loginType":"login-ci"}},"type":["diagnostic-event"]}`,
|
|
520
589
|
]);
|
|
521
590
|
|
|
522
591
|
|
|
@@ -528,6 +597,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
528
597
|
|
|
529
598
|
const options = {
|
|
530
599
|
meetingId: fakeMeeting.id,
|
|
600
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
601
|
+
globalMeetingId: 'globalMeetingId1',
|
|
531
602
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
532
603
|
rawError: {
|
|
533
604
|
body: {
|
|
@@ -549,6 +620,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
549
620
|
},
|
|
550
621
|
identifiers: {
|
|
551
622
|
correlationId: 'correlationId',
|
|
623
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
624
|
+
globalMeetingId: 'globalMeetingId1',
|
|
552
625
|
deviceId: 'deviceUrl',
|
|
553
626
|
locusId: 'url',
|
|
554
627
|
locusStartTime: 'lastActive',
|
|
@@ -618,7 +691,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
618
691
|
assert.deepEqual(webexLoggerLogCalls[4].args, [
|
|
619
692
|
'call-diagnostic-events -> ',
|
|
620
693
|
'CallDiagnosticMetrics: @submitToCallDiagnostics. Preparing to send the request',
|
|
621
|
-
`finalEvent: {"eventPayload":{"eventId":"my-fake-id","version":1,"origin":{"origin":"fake-origin"},"originTime":{"triggered":"${now.toISOString()}","sent":"not_defined_yet"},"senderCountryCode":"UK","event":{"name":"client.alert.displayed","canProceed":true,"identifiers":{"correlationId":"correlationId","userId":"userId","deviceId":"deviceUrl","orgId":"orgId","locusUrl":"locus/url","locusId":"url","locusStartTime":"lastActive","mediaAgentAlias":"alias","mediaAgentGroupId":"1"},"errors":[{"fatal":true,"shownToUser":false,"name":"other","category":"expected","errorCode":4029,"serviceErrorCode":2409005,"errorDescription":"StartRecordingFailed"}],"eventData":{"webClientDomain":"whatever"},"userType":"host","loginType":"login-ci"}},"type":["diagnostic-event"]}`,
|
|
694
|
+
`finalEvent: {"eventPayload":{"eventId":"my-fake-id","version":1,"origin":{"origin":"fake-origin"},"originTime":{"triggered":"${now.toISOString()}","sent":"not_defined_yet"},"senderCountryCode":"UK","event":{"name":"client.alert.displayed","canProceed":true,"identifiers":{"correlationId":"correlationId","userId":"userId","deviceId":"deviceUrl","orgId":"orgId","locusUrl":"locus/url","locusId":"url","locusStartTime":"lastActive","mediaAgentAlias":"alias","mediaAgentGroupId":"1","webexConferenceIdStr":"webexConferenceIdStr1","globalMeetingId":"globalMeetingId1"},"errors":[{"fatal":true,"shownToUser":false,"name":"other","category":"expected","errorCode":4029,"serviceErrorCode":2409005,"errorDescription":"StartRecordingFailed"}],"eventData":{"webClientDomain":"whatever"},"userType":"host","loginType":"login-ci"}},"type":["diagnostic-event"]}`,
|
|
622
695
|
]);
|
|
623
696
|
});
|
|
624
697
|
|
|
@@ -1044,6 +1117,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
1044
1117
|
const options = {
|
|
1045
1118
|
networkType: 'wifi' as const,
|
|
1046
1119
|
meetingId: fakeMeeting.id,
|
|
1120
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1121
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1047
1122
|
};
|
|
1048
1123
|
|
|
1049
1124
|
cd.submitMQE({
|
|
@@ -1058,6 +1133,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
1058
1133
|
assert.calledWith(getIdentifiersSpy, {
|
|
1059
1134
|
meeting: fakeMeeting,
|
|
1060
1135
|
mediaConnections: undefined,
|
|
1136
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1137
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1061
1138
|
});
|
|
1062
1139
|
assert.notCalled(getErrorPayloadForClientErrorCodeSpy);
|
|
1063
1140
|
assert.calledWith(
|
|
@@ -1067,6 +1144,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
1067
1144
|
canProceed: true,
|
|
1068
1145
|
identifiers: {
|
|
1069
1146
|
correlationId: 'correlationId',
|
|
1147
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1148
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1070
1149
|
userId: 'userId',
|
|
1071
1150
|
deviceId: 'deviceUrl',
|
|
1072
1151
|
orgId: 'orgId',
|
|
@@ -1098,6 +1177,8 @@ describe('internal-plugin-metrics', () => {
|
|
|
1098
1177
|
canProceed: true,
|
|
1099
1178
|
identifiers: {
|
|
1100
1179
|
correlationId: 'correlationId',
|
|
1180
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1181
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1101
1182
|
userId: 'userId',
|
|
1102
1183
|
deviceId: 'deviceUrl',
|
|
1103
1184
|
orgId: 'orgId',
|