@webex/internal-plugin-metrics 3.12.0-next.4 → 3.12.0-next.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/automated-user.js +19 -0
  2. package/dist/automated-user.js.map +1 -0
  3. package/dist/batcher.js +3 -0
  4. package/dist/batcher.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +638 -65
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  7. package/dist/call-diagnostic/call-diagnostic-metrics.js +167 -76
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +5 -0
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  11. package/dist/call-diagnostic/config.js +16 -3
  12. package/dist/call-diagnostic/config.js.map +1 -1
  13. package/dist/config.js +1 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/index.js +15 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/metrics.js +1 -1
  18. package/dist/metrics.types.js +4 -0
  19. package/dist/metrics.types.js.map +1 -1
  20. package/dist/new-metrics.js +60 -17
  21. package/dist/new-metrics.js.map +1 -1
  22. package/dist/privacy-and-security-permission-enricher/constants.js +18 -0
  23. package/dist/privacy-and-security-permission-enricher/constants.js.map +1 -0
  24. package/dist/privacy-and-security-permission-enricher/index.js +143 -0
  25. package/dist/privacy-and-security-permission-enricher/index.js.map +1 -0
  26. package/dist/privacy-and-security-permission-enricher/types.js +7 -0
  27. package/dist/privacy-and-security-permission-enricher/types.js.map +1 -0
  28. package/dist/privacy-and-security-permission-enricher/utils.js +71 -0
  29. package/dist/privacy-and-security-permission-enricher/utils.js.map +1 -0
  30. package/dist/types/automated-user.d.ts +2 -0
  31. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +208 -5
  32. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +67 -14
  33. package/dist/types/call-diagnostic/config.d.ts +4 -0
  34. package/dist/types/config.d.ts +1 -0
  35. package/dist/types/index.d.ts +5 -3
  36. package/dist/types/metrics.types.d.ts +7 -2
  37. package/dist/types/new-metrics.d.ts +17 -1
  38. package/dist/types/privacy-and-security-permission-enricher/constants.d.ts +6 -0
  39. package/dist/types/privacy-and-security-permission-enricher/index.d.ts +40 -0
  40. package/dist/types/privacy-and-security-permission-enricher/types.d.ts +14 -0
  41. package/dist/types/privacy-and-security-permission-enricher/utils.d.ts +5 -0
  42. package/package.json +12 -11
  43. package/src/automated-user.ts +16 -0
  44. package/src/batcher.js +4 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +800 -73
  46. package/src/call-diagnostic/call-diagnostic-metrics.ts +101 -15
  47. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +5 -0
  48. package/src/call-diagnostic/config.ts +14 -0
  49. package/src/config.js +1 -0
  50. package/src/index.ts +7 -0
  51. package/src/metrics.types.ts +25 -3
  52. package/src/new-metrics.ts +53 -6
  53. package/src/privacy-and-security-permission-enricher/constants.ts +33 -0
  54. package/src/privacy-and-security-permission-enricher/index.ts +142 -0
  55. package/src/privacy-and-security-permission-enricher/types.ts +21 -0
  56. package/src/privacy-and-security-permission-enricher/utils.ts +82 -0
  57. package/test/unit/spec/automated-user.ts +43 -0
  58. package/test/unit/spec/batcher.js +43 -0
  59. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +14 -2
  60. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1434 -303
  61. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +852 -159
  62. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +27 -0
  63. package/test/unit/spec/new-metrics.ts +183 -50
  64. package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
  65. package/test/unit/spec/privacy-and-security-permission-enricher.ts +318 -0
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
4
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
5
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
6
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
7
+ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
8
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
9
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
10
+ _Object$defineProperty(exports, "__esModule", {
11
+ value: true
12
+ });
13
+ exports.resolveMediaResources = exports.resolveContentShareResources = exports.projectPrivacyAndSecurityPermission = exports.getChangedPermission = void 0;
14
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
16
+ var _lodash = require("lodash");
17
+ function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ var resolveMediaResources = exports.resolveMediaResources = function resolveMediaResources(payload) {
20
+ switch (payload === null || payload === void 0 ? void 0 : payload.mediaType) {
21
+ case 'audio':
22
+ return ['microphone'];
23
+ case 'video':
24
+ return ['camera'];
25
+ case 'share':
26
+ return ['contentShare'];
27
+ default:
28
+ return [];
29
+ }
30
+ };
31
+ var resolveContentShareResources = exports.resolveContentShareResources = function resolveContentShareResources(payload) {
32
+ if ((payload === null || payload === void 0 ? void 0 : payload.mediaType) !== 'share') {
33
+ return [];
34
+ }
35
+ return ['contentShare'];
36
+ };
37
+ var copyPermissionState = function copyPermissionState(source, target, resource) {
38
+ switch (resource) {
39
+ case 'camera':
40
+ if (source.camera) {
41
+ target.camera = _objectSpread({}, source.camera);
42
+ }
43
+ break;
44
+ case 'microphone':
45
+ if (source.microphone) {
46
+ target.microphone = _objectSpread({}, source.microphone);
47
+ }
48
+ break;
49
+ case 'contentShare':
50
+ if (source.contentShare) {
51
+ target.contentShare = _objectSpread({}, source.contentShare);
52
+ }
53
+ break;
54
+ default:
55
+ break;
56
+ }
57
+ };
58
+ var projectPrivacyAndSecurityPermission = exports.projectPrivacyAndSecurityPermission = function projectPrivacyAndSecurityPermission(permission, resources) {
59
+ var projectedPermission = {};
60
+ resources.forEach(function (resource) {
61
+ copyPermissionState(permission, projectedPermission, resource);
62
+ });
63
+ return (0, _keys.default)(projectedPermission).length > 0 ? projectedPermission : undefined;
64
+ };
65
+ var getChangedPermission = exports.getChangedPermission = function getChangedPermission(current, previous) {
66
+ var changedResources = (0, _keys.default)(current).filter(function (resource) {
67
+ return !(0, _lodash.isEqual)(current[resource], previous[resource]);
68
+ });
69
+ return projectPrivacyAndSecurityPermission(current, changedResources);
70
+ };
71
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_lodash","require","ownKeys","e","r","t","_Object$keys2","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","resolveMediaResources","exports","payload","mediaType","resolveContentShareResources","copyPermissionState","source","target","resource","camera","microphone","contentShare","projectPrivacyAndSecurityPermission","permission","resources","projectedPermission","_keys","undefined","getChangedPermission","current","previous","changedResources","isEqual"],"sources":["utils.ts"],"sourcesContent":["import {isEqual} from 'lodash';\n\nimport type {\n ClientEventPayload,\n PrivacyAndSecurityPermission,\n PrivacyAndSecurityPermissionResource,\n} from '../metrics.types';\n\nexport const resolveMediaResources = (\n payload?: ClientEventPayload\n): PrivacyAndSecurityPermissionResource[] => {\n switch (payload?.mediaType) {\n case 'audio':\n return ['microphone'];\n case 'video':\n return ['camera'];\n case 'share':\n return ['contentShare'];\n default:\n return [];\n }\n};\n\nexport const resolveContentShareResources = (\n payload?: ClientEventPayload\n): PrivacyAndSecurityPermissionResource[] => {\n if (payload?.mediaType !== 'share') {\n return [];\n }\n\n return ['contentShare'];\n};\n\nconst copyPermissionState = (\n source: PrivacyAndSecurityPermission,\n target: PrivacyAndSecurityPermission,\n resource: PrivacyAndSecurityPermissionResource\n): void => {\n switch (resource) {\n case 'camera':\n if (source.camera) {\n target.camera = {...source.camera};\n }\n break;\n case 'microphone':\n if (source.microphone) {\n target.microphone = {...source.microphone};\n }\n break;\n case 'contentShare':\n if (source.contentShare) {\n target.contentShare = {...source.contentShare};\n }\n break;\n default:\n break;\n }\n};\n\nexport const projectPrivacyAndSecurityPermission = (\n permission: PrivacyAndSecurityPermission,\n resources: readonly PrivacyAndSecurityPermissionResource[]\n): PrivacyAndSecurityPermission | undefined => {\n const projectedPermission: PrivacyAndSecurityPermission = {};\n\n resources.forEach((resource) => {\n copyPermissionState(permission, projectedPermission, resource);\n });\n\n return Object.keys(projectedPermission).length > 0 ? projectedPermission : undefined;\n};\n\nexport const getChangedPermission = (\n current: PrivacyAndSecurityPermission,\n previous: PrivacyAndSecurityPermission\n): PrivacyAndSecurityPermission | undefined => {\n const changedResources = (Object.keys(current) as PrivacyAndSecurityPermissionResource[]).filter(\n (resource) => !isEqual(current[resource], previous[resource])\n );\n\n return projectPrivacyAndSecurityPermission(current, changedResources);\n};\n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AGuB,mBAAmB,GAAGE,SAAS;AACtF,CAAC;AAEM,IAAMC,oBAAoB,GAAAjB,OAAA,CAAAiB,oBAAA,GAAG,SAAvBA,oBAAoBA,CAC/BC,OAAqC,EACrCC,QAAsC,EACO;EAC7C,IAAMC,gBAAgB,GAAI,IAAAL,KAAA,CAAApB,OAAA,EAAYuB,OAAO,CAAC,CAA4ClC,MAAM,CAC9F,UAACuB,QAAQ;IAAA,OAAK,CAAC,IAAAc,eAAO,EAACH,OAAO,CAACX,QAAQ,CAAC,EAAEY,QAAQ,CAACZ,QAAQ,CAAC,CAAC;EAAA,CAC/D,CAAC;EAED,OAAOI,mCAAmC,CAACO,OAAO,EAAEE,gBAAgB,CAAC;AACvE,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare const isAutomatedUserAgent: (userAgent?: string | null) => boolean;
2
+ export declare const isAutomatedUser: () => boolean;
@@ -1,5 +1,35 @@
1
1
  import { WebexPlugin } from '@webex/webex-core';
2
2
  import { MetricEventNames, PreComputedLatencies } from '../metrics.types';
3
+ type SaveTimestampOptions = {
4
+ meetingId?: string;
5
+ dataSetName?: string;
6
+ trackingId?: string;
7
+ };
8
+ type SaveLatencyOptions = {
9
+ accumulate?: boolean;
10
+ meetingId?: string;
11
+ dataSetName?: string;
12
+ };
13
+ type LocusSyncLatencyRecord = {
14
+ meetingId: string;
15
+ dataSetName: string;
16
+ randomBackoffTime: number;
17
+ trackingId?: string;
18
+ syncStart?: number;
19
+ hashTreeRequest?: number;
20
+ hashTreeResponse?: number;
21
+ syncRequest?: number;
22
+ syncResponse?: number;
23
+ messageReceived?: number;
24
+ };
25
+ /**
26
+ * Container for the latencies tracked for a single meeting. Locus sync is currently the only
27
+ * meeting-specific latency we track, but this wrapper lets us add other latency records in the
28
+ * future without changing the shape of `meetingLatencies`.
29
+ */
30
+ type MeetingLatencyRecord = {
31
+ locusSync: LocusSyncLatencyRecord;
32
+ };
3
33
  /**
4
34
  * @description Helper class to store latencies timestamp and to calculate various latencies for CA.
5
35
  * @exports
@@ -8,8 +38,12 @@ import { MetricEventNames, PreComputedLatencies } from '../metrics.types';
8
38
  export default class CallDiagnosticLatencies extends WebexPlugin {
9
39
  latencyTimestamps: Map<MetricEventNames, number>;
10
40
  precomputedLatencies: Map<PreComputedLatencies, number>;
41
+ meetingLatencies: Map<string, MeetingLatencyRecord[]>;
11
42
  private meetingId?;
12
43
  private MAX_INTEGER;
44
+ private LOCUS_SYNC_SKEW_THRESHOLD_MS;
45
+ private LOCUS_SYNC_PENDING_RECORD_TTL_MS;
46
+ private LOCUS_SYNC_MAX_RECORDS_PER_DATASET;
13
47
  /**
14
48
  * @constructor
15
49
  */
@@ -18,6 +52,164 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
18
52
  * Clear timestamps
19
53
  */
20
54
  clearTimestamps(): void;
55
+ /**
56
+ * Clear tracked Locus sync latency state for a dataset.
57
+ *
58
+ * When a `trackingId` is supplied only the single record matching it is dropped, mirroring the
59
+ * native client which discards the individual in-progress record on a sync error (by syncId).
60
+ * When no `trackingId` is supplied every record for the dataset is dropped (legacy behavior).
61
+ *
62
+ * @param dataSetName dataset name
63
+ * @param meetingId meeting id
64
+ * @param trackingId optional sync tracking id to drop a single record instead of the whole dataset
65
+ */
66
+ clearLocusSyncLatency(dataSetName: string, meetingId: string, trackingId?: string): void;
67
+ /**
68
+ * Calculates Locus sync latency values from stored milestone timestamps.
69
+ * @param meetingId meeting id
70
+ * @param trackingId sync tracking id used to match the record
71
+ * @returns sync latency metrics
72
+ */
73
+ getLocusSyncLatency(meetingId: string, trackingId: string): {
74
+ totalTime: number;
75
+ syncMessageReceiveTime?: number;
76
+ syncResponseTime?: number;
77
+ randomBackoffTime: number;
78
+ hashtreePrepTime: number;
79
+ hashtreeResponseTime: number;
80
+ syncPrepTime: number;
81
+ };
82
+ /**
83
+ * Records the time the LLM state-update message for a Locus sync arrived. This is the milestone
84
+ * that gates the client.locus.sync.complete metric: the metric is emitted only for flows where
85
+ * the update came over LLM (aligned with the agreed requirement that body/http-only syncs do not
86
+ * emit). The record is matched by meeting id + tracking id, regardless of which other milestones
87
+ * are present yet, so the real arrival time is captured even if the /sync response has not landed.
88
+ * @param meetingId meeting id
89
+ * @param trackingId sync tracking id used to match the pending record
90
+ * @returns void
91
+ */
92
+ recordLocusSyncMessageReceived(meetingId: string, trackingId: string): void;
93
+ /**
94
+ * Complete and remove the Locus sync latency record for a meeting + tracking id.
95
+ *
96
+ * Both milestones are required, in any arrival order: the metric is emitted only once BOTH the
97
+ * matching LLM broadcast (messageReceived) AND the /sync response have arrived. The LLM broadcast
98
+ * confirms the client that issued the /sync received the resulting state update for its tracking
99
+ * id (so sync cancel, or a sync storm where the final broadcast echoed another client's tracking
100
+ * id, never emit); the /sync response is always waited for too, since the LLM message can arrive
101
+ * before the HTTP response. If either milestone is missing the record is kept so the other can
102
+ * still arrive; it is only consumed when the metric is actually emitted.
103
+ * @param meetingId meeting id
104
+ * @param trackingId sync tracking id used to match the pending record
105
+ * @returns completed sync latency metric payload, or undefined when not completed
106
+ */
107
+ completeLocusSyncLatency(meetingId: string, trackingId: string): {
108
+ dataSet: string;
109
+ syncLatency: {
110
+ totalTime: number;
111
+ syncMessageReceiveTime?: number;
112
+ syncResponseTime?: number;
113
+ randomBackoffTime: number;
114
+ hashtreePrepTime: number;
115
+ hashtreeResponseTime: number;
116
+ syncPrepTime: number;
117
+ };
118
+ };
119
+ /**
120
+ * Helper to calculate end - start for Locus sync milestones.
121
+ * @param record tracked milestone timestamps
122
+ * @param a start milestone
123
+ * @param b end milestone
124
+ * @returns latency
125
+ */
126
+ private getDiffBetweenLocusSyncTimestamps;
127
+ /**
128
+ * Get the timestamp that starts the sync prep segment.
129
+ * @param record tracked milestone timestamps
130
+ * @returns sync prep start milestone
131
+ */
132
+ private getLocusSyncPrepStart;
133
+ /**
134
+ * Round and clamp Locus sync latency values.
135
+ * @param latency latency value
136
+ * @returns rounded latency
137
+ */
138
+ private getClampedLocusSyncLatency;
139
+ /**
140
+ * Finds a Locus sync latency record for a meeting using a predicate run against each stored
141
+ * locusSync record.
142
+ * @param meetingId meeting id
143
+ * @param predicate matcher run against each locusSync record
144
+ * @param options.searchFromLatest when true, iterate from the most recently added record first
145
+ * @returns matching Locus sync latency record
146
+ */
147
+ private findLocusSyncRecord;
148
+ /**
149
+ * Get the Locus sync latency record for a meeting and tracking id.
150
+ * @param meetingId meeting id
151
+ * @param trackingId /sync response tracking id
152
+ * @returns matching Locus sync latency record
153
+ */
154
+ private getLocusSyncLatencyRecord;
155
+ /**
156
+ * Remove the Locus sync latency record for a meeting and tracking id.
157
+ * @param meetingId meeting id
158
+ * @param trackingId sync tracking id used to match the record
159
+ * @returns void
160
+ */
161
+ private removeLocusSyncLatencyRecord;
162
+ /**
163
+ * Prune stale never-completed Locus sync latency records for the same dataset as the record that
164
+ * just changed. Records are dropped when they have been pending longer than the TTL, or to keep
165
+ * the number of records per dataset under the safety cap (oldest pending candidates first).
166
+ * @param records current records for the meeting
167
+ * @param changedRecord the record that was just updated, used as the reference point
168
+ * @returns the records to keep
169
+ */
170
+ private pruneStaleLocusSyncLatencyRecords;
171
+ /**
172
+ * Get the most recent milestone timestamp stored on a Locus sync latency record, checking
173
+ * milestones from latest to earliest so the newest available one is returned.
174
+ * @param record tracked milestone timestamps
175
+ * @returns latest milestone timestamp, or undefined when none are set
176
+ */
177
+ private getLatestLocusSyncTimestamp;
178
+ /**
179
+ * Persist the Locus sync latency records for a meeting, deleting the meeting entry when no
180
+ * records remain. When pruneOptions is provided, stale records are pruned before saving.
181
+ * @param meetingId meeting id
182
+ * @param records records to save
183
+ * @param pruneOptions when provided, triggers stale record pruning relative to changedRecord
184
+ * @returns void
185
+ */
186
+ private setMeetingLatencyRecords;
187
+ /**
188
+ * Get the latest Locus sync latency record waiting for sync.start.
189
+ * @param meetingId meeting id
190
+ * @param dataSetName dataset name
191
+ * @returns latest pending Locus sync latency record
192
+ */
193
+ private getLatestPendingLocusSyncLatencyRecord;
194
+ /**
195
+ * Store random backoff latency for the current or next Locus sync latency record.
196
+ * @param meetingId meeting id
197
+ * @param dataSetName dataset name
198
+ * @param randomBackoffTime random backoff latency value
199
+ * @returns void
200
+ */
201
+ private saveLocusSyncBackoffLatency;
202
+ /**
203
+ * Checks if metric event name is a Locus sync latency milestone.
204
+ * @param key event name
205
+ * @returns whether event is Locus sync latency milestone
206
+ */
207
+ private isLocusSyncLatencyEvent;
208
+ /**
209
+ * Stores a Locus sync latency milestone timestamp.
210
+ * @param options options
211
+ */
212
+ private saveLocusSyncLatencyTimestamp;
21
213
  /**
22
214
  * Associate current latencies with a meeting id
23
215
  * @param meetingId
@@ -39,19 +231,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
39
231
  saveTimestamp({ key, value, options, }: {
40
232
  key: MetricEventNames;
41
233
  value?: number;
42
- options?: {
43
- meetingId?: string;
44
- };
234
+ options?: SaveTimestampOptions;
45
235
  }): void;
46
236
  /**
47
237
  * Store precomputed latency value
48
238
  * @param key - key
49
239
  * @param value - value
50
- * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement
240
+ * @param options - store options (a legacy boolean `accumulate` flag is also accepted)
241
+ * @param options.accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement
242
+ * @param options.meetingId - meeting id, only used for Locus sync latency records
243
+ * @param options.dataSetName - dataset name, only used for Locus sync latency records
51
244
  * @throws
52
245
  * @returns
53
246
  */
54
- saveLatency(key: PreComputedLatencies, value: number, accumulate?: boolean): void;
247
+ saveLatency(key: PreComputedLatencies, value: number, options?: SaveLatencyOptions): void;
55
248
  /**
56
249
  * Measure latency for a request
57
250
  * @param callback - callback for which you would like to measure latency
@@ -149,6 +342,15 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
149
342
  * @returns - latency
150
343
  */
151
344
  getStayLobbyTime(): number;
345
+ /**
346
+ * Stay lobby time capped by a certain timestamp.
347
+ * This is to handle the case where the target end timestamp could happen before the lobby is exited,
348
+ * for example media-engine.ready or client.ice.end
349
+ * This is supposed to be called AFTER the end timestamp happens
350
+ * @param endTimestampKey name of the target end event
351
+ * @returns - latency
352
+ */
353
+ getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames): number;
152
354
  /**
153
355
  * Page JMT
154
356
  * @returns - latency
@@ -258,3 +460,4 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
258
460
  */
259
461
  getOtherAppApiReqResp(): number;
260
462
  }
463
+ export {};
@@ -27,7 +27,7 @@ type GetIdentifiersOptions = {
27
27
  export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
28
28
  private callDiagnosticEventsBatcher;
29
29
  private preLoginMetricsBatcher;
30
- private logger;
30
+ private get logger();
31
31
  private hasLoggedBrowserSerial;
32
32
  private device;
33
33
  private delayedClientEvents;
@@ -36,6 +36,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
36
36
  private isMercuryConnected;
37
37
  private eventLimitTracker;
38
38
  private eventLimitWarningsLogged;
39
+ private isTelemetryOptOutManual;
40
+ private isTelemetryOptOutAutomatic;
39
41
  validator: (options: {
40
42
  type: 'mqe' | 'ce';
41
43
  event: Event;
@@ -53,6 +55,29 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
53
55
  * @returns one of 'login-ci','unverified-guest', null
54
56
  */
55
57
  getCurLoginType(): "unverified-guest" | "login-ci";
58
+ /**
59
+ * Returns the user activation state reported from the browser's navigator.userActivation API
60
+ * @returns object with hasBeenActive and isActive booleans, or undefined if unavailable
61
+ */
62
+ getUserActivation(): {
63
+ hasBeenActive: boolean;
64
+ isActive: boolean;
65
+ } | undefined;
66
+ /**
67
+ * Returns the telemetryOptOut value of the current user
68
+ * @returns one of 'manual', 'automatic', undefined
69
+ */
70
+ getTelemetryOptOut(): "manual" | "automatic";
71
+ /**
72
+ * Sets the manual telemetry opt-out status for the current user
73
+ * @param value - boolean value indicating manual telemetry opt-out status
74
+ */
75
+ setIsTelemetryOptOutManual(value: boolean): void;
76
+ /**
77
+ * Sets the automatic telemetry opt-out status for the current user
78
+ * @param value - boolean value indicating automatic telemetry opt-out status
79
+ */
80
+ setIsTelemetryOptOutAutomatic(value: boolean): void;
56
81
  /**
57
82
  * Returns if the meeting has converged architecture enabled
58
83
  * @param options.meetingId
@@ -84,6 +109,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
84
109
  userAgent: string;
85
110
  buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
86
111
  upgradeChannel?: string;
112
+ upgradeSource?: string;
87
113
  instanceId?: string;
88
114
  networkType: "wifi" | "ethernet" | "cellular" | "unknown";
89
115
  localIP?: string;
@@ -106,6 +132,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
106
132
  urlProtocolLaunchMethod?: "manual" | "auto" | "extension-fallback";
107
133
  browser?: string;
108
134
  browserVersion?: string;
135
+ isSupportedBrowserFamily?: boolean;
136
+ isOutdatedBrowserVersion?: boolean;
109
137
  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" | "TEAMS_PHONE" | "WEBEX_RELAY";
110
138
  subClientType?: "TEAMS_DEVICE" | "SIP" | "AUTOMOTIVE_APP" | "BROWSER_EXTENSION" | "DESKTOP_APP" | "DESKTOP_APP_VDI" | "DEVICE_CURRENT" | "DEVICE_LEGACY_2020" | "HOLOGRAM_HEADSET_APP" | "HVDI_APP" | "MIXED" | "MOBILE_APP" | "MOBILE_NETWORK" | "PAGE" | "VDI_APP" | "WEB_APP" | "PHONE_NOVUM" | "PHONE_ESPRESSO" | "PHONE_BUMBLEBEE" | "SIP_PSTN";
111
139
  schedulingClientType?: "TEAMS_CLIENT" | "GOOGLE_ADDON" | "PT" | "PUBLIC_API" | "UNIFIED_PAGE" | "WEBEX_PAGE" | "GOOGLE_NOTIFICATION_CALENDAR" | "MSFT_NOTIFICATION_ADDIN" | "MSFT_NOTIFICATION_CALENDAR" | "OUTLOOK_ADDIN";
@@ -113,6 +141,10 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
113
141
  clientVersionStatus?: "CURRENT" | "LEGACY" | "UNSUPPORTED";
114
142
  localClientVersion?: string;
115
143
  launcherVersion?: string;
144
+ installerVersion?: string;
145
+ installerMajorVersion?: number;
146
+ installerMinorVersion?: number;
147
+ installerRevision?: number;
116
148
  modelNumber?: string;
117
149
  joinFirstUpdateLater?: "ep-enabled" | "sp-enabled" | "not-enabled";
118
150
  standbyUsed?: boolean;
@@ -137,11 +169,12 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
137
169
  architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64" | "armv9" | "armv8" | "armv7" | "armv6" | "x86_64" | "x86_32";
138
170
  staticPerformance?: string;
139
171
  clockSpeedGigaHertz?: number;
140
- additionalProperties?: false;
172
+ additionalProperties?: never;
141
173
  };
142
174
  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";
143
175
  videoDisplayMode?: "grid-view" | "active-speaker-view";
144
- videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery";
176
+ videoLayoutType?: "auto" | "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery" | "autoWithShare";
177
+ appliedLayout?: "auto" | "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery" | "autoWithShare";
145
178
  videoRenderType?: "wme" | "client_d3d" | "client_gdi";
146
179
  vdiInfo?: {};
147
180
  is64BitsClient?: boolean;
@@ -153,13 +186,24 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
153
186
  vendorId?: string;
154
187
  staticPerformanceLevel?: string;
155
188
  staticPerformanceScore?: number;
156
- additionalProperties?: false;
189
+ preInstalledTime?: string;
190
+ preInstalledType?: "installer" | "launcher" | "app";
191
+ preInstalledVersion?: string;
192
+ additionalProperties?: never;
193
+ };
194
+ installerInfo?: {
195
+ packageSuffix?: string;
196
+ packageArch?: string;
197
+ launchId?: string;
198
+ packageCount?: number;
199
+ totalSize?: number;
200
+ additionalProperties?: never;
157
201
  };
158
202
  emmVendorId?: string;
159
203
  isHybridMedia?: boolean;
160
204
  originData?: {};
161
205
  serviceVersion?: string;
162
- additionalProperties?: false;
206
+ additionalProperties?: never;
163
207
  };
164
208
  /**
165
209
  * Gather identifier details for call diagnostic payload.
@@ -172,6 +216,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
172
216
  participantId?: string;
173
217
  breakoutGroupId?: string;
174
218
  breakoutMoveId?: string;
219
+ breakoutTrackingId?: string;
175
220
  breakoutSessionId?: string;
176
221
  browserId?: string;
177
222
  ciExchangeTokenUrl?: string;
@@ -183,7 +228,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
183
228
  imiAppId: string;
184
229
  sessionId: string;
185
230
  sessionInstanceId: string;
186
- additionalProperties?: false;
231
+ additionalProperties?: never;
187
232
  };
188
233
  csdmDeviceUrl?: string;
189
234
  destinationBreakoutSessionId?: string;
@@ -200,6 +245,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
200
245
  callId?: string;
201
246
  pairCallId?: string;
202
247
  llmWebsocketUrl?: string;
248
+ locusCluster?: string;
203
249
  locusId?: string;
204
250
  locusJoinUrl?: string;
205
251
  locusSessionId?: string;
@@ -217,6 +263,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
217
263
  msteamsTenantGuid?: string;
218
264
  msteamsConferenceId?: string;
219
265
  msteamsMeetingId?: string;
266
+ mtid?: string;
220
267
  oauth2ClientId?: string;
221
268
  orgId?: string;
222
269
  provisionalCorrelationId?: string;
@@ -227,7 +274,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
227
274
  sipSessionId?: {
228
275
  local?: string;
229
276
  remote?: string;
230
- additionalProperties?: false;
277
+ additionalProperties?: never;
231
278
  };
232
279
  sipUri?: string;
233
280
  subConfId?: string;
@@ -255,13 +302,14 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
255
302
  idForEndpointAB?: string;
256
303
  customerOrgId?: string;
257
304
  correlationId: string;
258
- additionalProperties?: false;
305
+ additionalProperties?: never;
259
306
  } | {
260
307
  aggregatedBreakoutMoveId?: string;
261
308
  attendeeId?: string;
262
309
  participantId?: string;
263
310
  breakoutGroupId?: string;
264
311
  breakoutMoveId?: string;
312
+ breakoutTrackingId?: string;
265
313
  breakoutSessionId?: string;
266
314
  browserId?: string;
267
315
  ciExchangeTokenUrl?: string;
@@ -273,7 +321,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
273
321
  imiAppId: string;
274
322
  sessionId: string;
275
323
  sessionInstanceId: string;
276
- additionalProperties?: false;
324
+ additionalProperties?: never;
277
325
  };
278
326
  csdmDeviceUrl?: string;
279
327
  destinationBreakoutSessionId?: string;
@@ -290,6 +338,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
290
338
  callId?: string;
291
339
  pairCallId?: string;
292
340
  llmWebsocketUrl?: string;
341
+ locusCluster?: string;
293
342
  locusId?: string;
294
343
  locusJoinUrl?: string;
295
344
  locusSessionId?: string;
@@ -307,6 +356,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
307
356
  msteamsTenantGuid?: string;
308
357
  msteamsConferenceId?: string;
309
358
  msteamsMeetingId?: string;
359
+ mtid?: string;
310
360
  oauth2ClientId?: string;
311
361
  orgId?: string;
312
362
  provisionalCorrelationId?: string;
@@ -317,7 +367,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
317
367
  sipSessionId?: {
318
368
  local?: string;
319
369
  remote?: string;
320
- additionalProperties?: false;
370
+ additionalProperties?: never;
321
371
  };
322
372
  sipUri?: string;
323
373
  subConfId?: string;
@@ -345,13 +395,14 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
345
395
  idForEndpointAB?: string;
346
396
  customerOrgId?: string;
347
397
  correlationId: string;
348
- additionalProperties?: false;
398
+ additionalProperties?: never;
349
399
  } | {
350
400
  aggregatedBreakoutMoveId?: string;
351
401
  attendeeId?: string;
352
402
  participantId?: string;
353
403
  breakoutGroupId?: string;
354
404
  breakoutMoveId?: string;
405
+ breakoutTrackingId?: string;
355
406
  breakoutSessionId?: string;
356
407
  browserId?: string;
357
408
  ciExchangeTokenUrl?: string;
@@ -363,7 +414,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
363
414
  imiAppId: string;
364
415
  sessionId: string;
365
416
  sessionInstanceId: string;
366
- additionalProperties?: false;
417
+ additionalProperties?: never;
367
418
  };
368
419
  csdmDeviceUrl?: string;
369
420
  destinationBreakoutSessionId?: string;
@@ -380,6 +431,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
380
431
  callId?: string;
381
432
  pairCallId?: string;
382
433
  llmWebsocketUrl?: string;
434
+ locusCluster?: string;
383
435
  locusId?: string;
384
436
  locusJoinUrl?: string;
385
437
  locusSessionId?: string;
@@ -397,6 +449,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
397
449
  msteamsTenantGuid?: string;
398
450
  msteamsConferenceId?: string;
399
451
  msteamsMeetingId?: string;
452
+ mtid?: string;
400
453
  oauth2ClientId?: string;
401
454
  orgId?: string;
402
455
  provisionalCorrelationId?: string;
@@ -407,7 +460,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
407
460
  sipSessionId?: {
408
461
  local?: string;
409
462
  remote?: string;
410
- additionalProperties?: false;
463
+ additionalProperties?: never;
411
464
  };
412
465
  sipUri?: string;
413
466
  subConfId?: string;
@@ -435,7 +488,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
435
488
  idForEndpointAB?: string;
436
489
  customerOrgId?: string;
437
490
  correlationId: string;
438
- additionalProperties?: false;
491
+ additionalProperties?: never;
439
492
  };
440
493
  /**
441
494
  * Create diagnostic event, which can hold client event, feature event or MQE event data.
@@ -102,11 +102,13 @@ export declare const ERROR_DESCRIPTIONS: {
102
102
  WEBRTC_API_NOT_AVAILABLE: string;
103
103
  WDM_RESTRICTED_REGION: string;
104
104
  USER_NOT_ALLOWED_JOIN_WEBINAR: string;
105
+ INVALID_MEETING_INFO: string;
105
106
  };
106
107
  export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
107
108
  58400: number;
108
109
  99002: number;
109
110
  99009: number;
111
+ 99019: number;
110
112
  58500: number;
111
113
  400001: number;
112
114
  403004: number;
@@ -134,6 +136,7 @@ export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
134
136
  423001: number;
135
137
  423005: number;
136
138
  423006: number;
139
+ 423008: number;
137
140
  423010: number;
138
141
  423012: number;
139
142
  423013: number;
@@ -147,6 +150,7 @@ export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
147
150
  403037: number;
148
151
  403003: number;
149
152
  403030: number;
153
+ 403106: number;
150
154
  2403001: number;
151
155
  2403002: number;
152
156
  2403003: number;
@@ -12,6 +12,7 @@ declare namespace _default {
12
12
  const batcherMaxCalls: number;
13
13
  const batcherMaxWait: number;
14
14
  const batcherRetryPlateau: number;
15
+ const batcherRetryOnNetworkError: boolean;
15
16
  const waitForServiceTimeout: number;
16
17
  }
17
18
  export { metrics_1 as metrics };