@webex/plugin-meetings 3.13.0-next.16 → 3.13.0-next.17

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 (89) hide show
  1. package/dist/aiEnableRequest/index.js +1 -1
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +1 -1
  4. package/dist/common/events/typed-events-scope.js +135 -0
  5. package/dist/common/events/typed-events-scope.js.map +1 -0
  6. package/dist/common/types.js +7 -0
  7. package/dist/common/types.js.map +1 -0
  8. package/dist/config.js +1 -1
  9. package/dist/constants.js +5 -0
  10. package/dist/constants.js.map +1 -1
  11. package/dist/e2ee/E2eeController.js +581 -0
  12. package/dist/e2ee/E2eeController.js.map +1 -0
  13. package/dist/e2ee/E2eeManager.js +50 -31
  14. package/dist/e2ee/E2eeManager.js.map +1 -1
  15. package/dist/e2ee/E2eeSignaling.js +18 -21
  16. package/dist/e2ee/E2eeSignaling.js.map +1 -1
  17. package/dist/e2ee/MediaEncryptionService.js +2 -5
  18. package/dist/e2ee/MediaEncryptionService.js.map +1 -1
  19. package/dist/e2ee/constants.js +28 -0
  20. package/dist/e2ee/constants.js.map +1 -0
  21. package/dist/e2ee/mls.js +85 -67
  22. package/dist/e2ee/mls.js.map +1 -1
  23. package/dist/e2ee/types.js +52 -13
  24. package/dist/e2ee/types.js.map +1 -1
  25. package/dist/e2ee/wasm.d.js.map +1 -1
  26. package/dist/hashTree/hashTreeParser.js.map +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/interpretation/index.js +1 -1
  29. package/dist/interpretation/siLanguage.js +1 -1
  30. package/dist/meeting/index.js +394 -249
  31. package/dist/meeting/index.js.map +1 -1
  32. package/dist/meeting/request.js +69 -58
  33. package/dist/meeting/request.js.map +1 -1
  34. package/dist/meeting/util.js +4 -2
  35. package/dist/meeting/util.js.map +1 -1
  36. package/dist/meetings/index.js +87 -61
  37. package/dist/meetings/index.js.map +1 -1
  38. package/dist/meetings/util.js +10 -0
  39. package/dist/meetings/util.js.map +1 -1
  40. package/dist/metrics/constants.js +2 -1
  41. package/dist/metrics/constants.js.map +1 -1
  42. package/dist/types/common/events/typed-events-scope.d.ts +73 -0
  43. package/dist/types/common/types.d.ts +9 -0
  44. package/dist/types/constants.d.ts +5 -0
  45. package/dist/types/e2ee/E2eeController.d.ts +130 -0
  46. package/dist/types/e2ee/E2eeManager.d.ts +26 -6
  47. package/dist/types/e2ee/E2eeSignaling.d.ts +1 -7
  48. package/dist/types/e2ee/MediaEncryptionService.d.ts +1 -3
  49. package/dist/types/e2ee/constants.d.ts +12 -0
  50. package/dist/types/e2ee/mls.d.ts +16 -10
  51. package/dist/types/e2ee/types.d.ts +92 -35
  52. package/dist/types/hashTree/hashTreeParser.d.ts +1 -1
  53. package/dist/types/index.d.ts +1 -0
  54. package/dist/types/meeting/index.d.ts +34 -0
  55. package/dist/types/meeting/util.d.ts +1 -1
  56. package/dist/types/metrics/constants.d.ts +1 -0
  57. package/dist/webinar/index.js +1 -1
  58. package/package.json +21 -21
  59. package/src/common/events/typed-events-scope.ts +110 -0
  60. package/src/common/types.ts +10 -0
  61. package/src/constants.ts +6 -0
  62. package/src/e2ee/DESIGN.md +363 -0
  63. package/src/e2ee/E2eeController.ts +487 -0
  64. package/src/e2ee/E2eeManager.ts +48 -27
  65. package/src/e2ee/E2eeSignaling.ts +13 -28
  66. package/src/e2ee/MediaEncryptionService.ts +2 -4
  67. package/src/e2ee/constants.ts +34 -0
  68. package/src/e2ee/mls.ts +62 -32
  69. package/src/e2ee/types.ts +99 -34
  70. package/src/e2ee/wasm.d.ts +18 -14
  71. package/src/hashTree/hashTreeParser.ts +1 -1
  72. package/src/index.ts +1 -0
  73. package/src/meeting/index.ts +155 -0
  74. package/src/meeting/request.ts +16 -0
  75. package/src/meeting/util.ts +2 -1
  76. package/src/meetings/index.ts +30 -5
  77. package/src/meetings/util.ts +8 -0
  78. package/src/metrics/constants.ts +1 -0
  79. package/test/unit/spec/common/events/typed-events-scope.ts +88 -0
  80. package/test/unit/spec/e2ee/E2eeController.ts +662 -0
  81. package/test/unit/spec/e2ee/E2eeManager.ts +53 -29
  82. package/test/unit/spec/e2ee/E2eeSignaling.ts +19 -10
  83. package/test/unit/spec/e2ee/mls.ts +84 -32
  84. package/test/unit/spec/meeting/index.js +662 -0
  85. package/test/unit/spec/meeting/request.js +35 -0
  86. package/test/unit/spec/meeting/utils.js +4 -0
  87. package/test/unit/spec/meetings/index.js +36 -1
  88. package/test/unit/spec/meetings/utils.js +15 -0
  89. package/test/utils/webex-config.js +1 -0
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ /** LLM/Mercury events carrying MLS protocol messages, forwarded to the MLS engine. */
6
+ export const MEDIA_ENCRYPTION_MERCURY_EVENTS = [
7
+ 'event:media_encryption.leader_nominated',
8
+ 'event:media_encryption.welcome',
9
+ 'event:media_encryption.annotated_welcome',
10
+ 'event:media_encryption.multi_welcome',
11
+ 'event:media_encryption.group_update',
12
+ 'event:media_encryption.annotated_commit',
13
+ 'event:media_encryption.large_group_update',
14
+ 'event:media_encryption.use_key',
15
+ 'event:media_encryption.join_request',
16
+ 'event:media_encryption.leave_request',
17
+ 'event:media_encryption.join_failure',
18
+ 'event:media_encryption.leader_changed',
19
+ 'event:media_encryption.message_segment',
20
+ ];
21
+
22
+ /** Webex service names resolved from the service catalog. */
23
+ export const MEDIA_ENCRYPTION_SERVICE = 'media-encryption';
24
+
25
+ /** MLS roster device type identifying a backend media service. */
26
+ export const MEDIA_SERVICE_DEVICE_TYPE = 'MEDIA_SERVICE';
27
+
28
+ /* The WASM module that contains the libe2ee + mlspp libraries with a WebE2EE wrapper around them, required for joining MLS group for E2EE meetings.
29
+ * The version is in the filename as it is important that JS-SDK implementation of MLS class matches the WASM module version.
30
+ */
31
+ export const E2EE_WASM_ASSET = 'e2ee-0.0.1.wasm';
32
+
33
+ /** Locus join-request device capability advertising support for large (1K) E2EE meetings. */
34
+ export const E2EE_1K_SUPPORTED = 'E2EE_1K_SUPPORTED';
package/src/e2ee/mls.ts CHANGED
@@ -23,10 +23,6 @@ import type {
23
23
  WebE2EEInstance,
24
24
  } from './wasm';
25
25
 
26
- const DEFAULT_JOIN_TIMEOUT = 180_000;
27
- const DEFAULT_COALESCE_WINDOW = 500;
28
- const DEFAULT_DEVICE_TYPE = 'WEB';
29
-
30
26
  // WASM log levels, indexed by the numeric level the engine emits (see LogLevel in libe2ee).
31
27
  const WASM_LOG_LEVELS = ['', 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG'];
32
28
 
@@ -34,7 +30,7 @@ const WASM_LOG_LEVELS = ['', 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG'];
34
30
  export interface MLSEventMap {
35
31
  joinSuccess: {epoch: number; securityCode: string; sframe: SframeParams; key: E2eeKey};
36
32
  joinFailure: {reason: string};
37
- mediaEncryptionRequestFailure: {errorCode: number; message: string};
33
+ mediaEncryptionServiceFailure: {errorCode: number; message: string};
38
34
  newKey: E2eeKey;
39
35
  useKey: {epoch: number};
40
36
  purgeKeys: {epoch: number};
@@ -54,7 +50,7 @@ export type MLSEvent = keyof MLSEventMap;
54
50
  * emitted as typed events. This keeps it unit-testable in isolation.
55
51
  */
56
52
  export default class MLS {
57
- private readonly loadModule: () => Promise<ModuleInstance>;
53
+ private readonly module: ModuleInstance;
58
54
 
59
55
  private readonly httpClient: IMlsHttpClient;
60
56
 
@@ -64,22 +60,18 @@ export default class MLS {
64
60
 
65
61
  private e2ee: WebE2EEInstance | null = null;
66
62
 
63
+ private readonly waitTimeouts = new Set<ReturnType<typeof setTimeout>>();
64
+
67
65
  private lastSecurityCode = '';
68
66
 
69
67
  /**
70
68
  * @param {Object} deps
69
+ * @param {ModuleInstance} deps.module - The loaded WASM module used to instantiate the engine.
71
70
  * @param {IMlsHttpClient} deps.httpClient - Transport for the engine's protocol requests.
72
- * @param {Function} deps.loadModule - Loads the WASM module instance; supplied by the integration layer.
73
71
  */
74
- constructor({
75
- httpClient,
76
- loadModule,
77
- }: {
78
- httpClient: IMlsHttpClient;
79
- loadModule: () => Promise<ModuleInstance>;
80
- }) {
72
+ constructor({httpClient, module}: {httpClient: IMlsHttpClient; module: ModuleInstance}) {
81
73
  this.httpClient = httpClient;
82
- this.loadModule = loadModule;
74
+ this.module = module;
83
75
  }
84
76
 
85
77
  /**
@@ -113,30 +105,26 @@ export default class MLS {
113
105
  }
114
106
 
115
107
  /**
116
- * Loads the WASM module, instantiates the engine, wires its callbacks, and applies credentials,
117
- * trust anchors and timeouts. Must be called before {@link join}.
108
+ * Instantiates the engine, wires its callbacks, and applies credentials, trust anchors and
109
+ * timeouts. Must be called before {@link join}.
118
110
  * @param {MLSConfig} config
119
- * @returns {Promise<void>}
111
+ * @returns {void}
120
112
  */
121
- async initialize(config: MLSConfig): Promise<void> {
122
- LoggerProxy.logger.info('e2ee: MLS --> initialize: loading WASM and instantiating engine');
123
- const module = await this.loadModule();
124
-
125
- // When loadModule uses WasmLoader.get(), repeated calls share the in-flight promise or return
126
- // the cached module, so this check can stay after loading.
113
+ initialize(config: MLSConfig): void {
114
+ LoggerProxy.logger.info('e2ee: MLS --> initialize: instantiating engine');
127
115
  if (this.e2ee) {
128
116
  LoggerProxy.logger.info('e2ee: MLS --> initialize: already initialized');
129
117
 
130
118
  return;
131
119
  }
132
120
 
133
- this.e2ee = new module.WebE2EE();
121
+ this.e2ee = new this.module.WebE2EE();
134
122
  this.setupCallbacks();
135
123
 
136
124
  this.e2ee.initialize(
137
125
  config.participantId,
138
126
  config.deviceUrl,
139
- config.deviceType || DEFAULT_DEVICE_TYPE,
127
+ config.deviceType,
140
128
  config.correlationId,
141
129
  config.displayName,
142
130
  config.serviceUrl
@@ -157,8 +145,12 @@ export default class MLS {
157
145
  );
158
146
  }
159
147
 
160
- this.e2ee.setJoinTimeout(config.joinTimeout ?? DEFAULT_JOIN_TIMEOUT);
161
- this.e2ee.setCoalesceWindow(config.coalesceWindow ?? DEFAULT_COALESCE_WINDOW);
148
+ if (config.joinTimeout !== undefined) {
149
+ this.e2ee.setJoinTimeout(config.joinTimeout);
150
+ }
151
+ if (config.coalesceWindow !== undefined) {
152
+ this.e2ee.setCoalesceWindow(config.coalesceWindow);
153
+ }
162
154
 
163
155
  LoggerProxy.logger.info('e2ee: MLS --> initialize: engine initialized');
164
156
  }
@@ -253,9 +245,12 @@ export default class MLS {
253
245
  });
254
246
 
255
247
  e2ee.setOnWait((milliseconds, handlerId) => {
256
- setTimeout(() => {
248
+ const timeout = setTimeout(() => {
249
+ this.waitTimeouts.delete(timeout);
257
250
  this.e2ee?.completeWait(handlerId);
258
251
  }, milliseconds);
252
+
253
+ this.waitTimeouts.add(timeout);
259
254
  });
260
255
 
261
256
  e2ee.setOnGotKey((epoch: EpochInfo) => {
@@ -264,7 +259,7 @@ export default class MLS {
264
259
  baseKey: new Uint8Array(epoch.base_key),
265
260
  index: epoch.index,
266
261
  indexBits: epoch.index_bits,
267
- canEncrypt: false,
262
+ canEncrypt: false, // the key can only be used for encryption after onUseKey is called
268
263
  });
269
264
  });
270
265
 
@@ -379,7 +374,7 @@ export default class MLS {
379
374
  * `e2ee_negotiation_failure` out of this call when it can't recover from the service's error code
380
375
  * or fails to process a successful response; this surfaces in JS as an opaque value with no
381
376
  * message. That is unrecoverable for the in-flight operation, so it is reported as
382
- * `mediaEncryptionRequestFailure` instead of escaping as an unhandled rejection.
377
+ * `mediaEncryptionServiceFailure` instead of escaping as an unhandled rejection.
383
378
  * @param {number} handlerId
384
379
  * @param {boolean} success
385
380
  * @param {Uint8Array} body
@@ -400,7 +395,7 @@ export default class MLS {
400
395
  LoggerProxy.logger.error(
401
396
  `e2ee: MLS --> engine threw while completing HTTP request (success=${success}, errorCode=${errorCode}): ${error}`
402
397
  );
403
- this.emitEvent('mediaEncryptionRequestFailure', {
398
+ this.emitEvent('mediaEncryptionServiceFailure', {
404
399
  errorCode,
405
400
  message: success ? 'Engine failed to process HTTP response' : message,
406
401
  });
@@ -448,6 +443,41 @@ export default class MLS {
448
443
  this.assertInitialized().leave();
449
444
  }
450
445
 
446
+ /**
447
+ * Detaches engine callbacks and releases the WASM engine and wrapper resources.
448
+ * @returns {void}
449
+ */
450
+ cleanUp(): void {
451
+ this.waitTimeouts.forEach((timeout) => clearTimeout(timeout));
452
+ this.waitTimeouts.clear();
453
+ this.transactions.clear();
454
+ this.lastSecurityCode = '';
455
+
456
+ const {e2ee} = this;
457
+
458
+ this.e2ee = null;
459
+
460
+ if (e2ee) {
461
+ e2ee.setOnNewTransaction(null);
462
+ e2ee.setOnCompleteTransaction(null);
463
+ e2ee.setOnHttpRequest(null);
464
+ e2ee.setOnWait(null);
465
+ e2ee.setOnGotKey(null);
466
+ e2ee.setOnUseKey(null);
467
+ e2ee.setOnLeader(null);
468
+ e2ee.setOnPurgeBefore(null);
469
+ e2ee.setOnEvicted(null);
470
+ e2ee.setOnAddRoster(null);
471
+ e2ee.setOnRemoveRoster(null);
472
+ e2ee.setOnE2eeVersion(null);
473
+ e2ee.setOnMissingCommit(null);
474
+ e2ee.setOnLog(null);
475
+ e2ee.delete();
476
+ }
477
+
478
+ this.emitter.removeAllListeners();
479
+ }
480
+
451
481
  /**
452
482
  * Forwards an incoming MLS protocol event (from the signaling channel) to the engine.
453
483
  * @param {Uint8Array} eventData
package/src/e2ee/types.ts CHANGED
@@ -2,12 +2,88 @@
2
2
  * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
3
3
  */
4
4
 
5
+ import type {IdentityCredentials, IdentityTrustAnchors} from '@webex/internal-plugin-identity';
6
+ import type LLMChannel from '@webex/internal-plugin-llm';
7
+
8
+ import {EVENT_TRIGGERS, type Enum} from '../constants';
9
+ import type {LocusDTO} from '../locus-info/types';
10
+ import type Members from '../members';
11
+
12
+ /** The Locus DTO fields consumed by E2EE, matching the shape exposed by `Meeting.locusInfo`. */
13
+ export type E2eeLocusInfo = Pick<LocusDTO, 'url' | 'info'>;
14
+
15
+ /** Per-meeting context supplied by Meetings without exposing its Meeting class to E2EE. */
16
+ export interface E2eeMeetingContext {
17
+ getCorrelationId(): string;
18
+ getLocusInfo(): E2eeLocusInfo | undefined;
19
+ getLlmChannel(): LLMChannel | undefined;
20
+ members: Members;
21
+ }
22
+
5
23
  /**
6
- * SDK-facing shapes used by the isolated MLS protocol engine. Integration-specific meeting,
7
- * identity-plugin and signaling types are added by the later adapter phases.
24
+ * SDK-facing E2EE types (camelCase), mapped from the raw WASM boundary shapes in wasm.d.ts.
8
25
  */
9
26
 
10
- /** Credential-validation outcome from the MLS roster. Keep ordinals in sync with libe2ee. */
27
+ /** Lifecycle state of a per-meeting MLS session. */
28
+ export const E2eeState = {
29
+ Disabled: 'disabled',
30
+ Initializing: 'initializing',
31
+ Joining: 'joining',
32
+ Joined: 'joined',
33
+ Failed: 'failed',
34
+ Evicted: 'evicted',
35
+ Left: 'left',
36
+ } as const;
37
+
38
+ export type E2eeState = Enum<typeof E2eeState>;
39
+
40
+ /** Event payloads emitted by E2eeController and forwarded through Meeting. */
41
+ export interface E2eeControllerEventMap {
42
+ [EVENT_TRIGGERS.MEETING_E2EE_SECURITY_CODE_UPDATED]: {securityCode: string | undefined};
43
+ [EVENT_TRIGGERS.MEETING_E2EE_STATE_CHANGED]: {state: E2eeState};
44
+ [EVENT_TRIGGERS.MEETING_E2EE_MEDIA_SERVICES_CHANGED]: {hasMediaServices: boolean};
45
+ [EVENT_TRIGGERS.MEETING_E2EE_FAILURE]: {
46
+ reason: string;
47
+ errorCode?: number;
48
+ errorMessage?: string;
49
+ };
50
+ }
51
+
52
+ export type E2eeControllerEvent = keyof E2eeControllerEventMap;
53
+
54
+ /** The meeting's overall E2EE trust state, surfaced to the app for its UI indicator. */
55
+ export const TrustState = {
56
+ Calculating: 'calculating',
57
+ Failed: 'failed',
58
+ Strong: 'strong',
59
+ ZeroTrust: 'zeroTrust',
60
+ AdaptiveStrong: 'adaptiveStrong',
61
+ AdaptiveZeroTrust: 'adaptiveZeroTrust',
62
+ } as const;
63
+
64
+ export type TrustState = Enum<typeof TrustState>;
65
+
66
+ /** A media-encryption (SFrame) key for a given MLS epoch. */
67
+ export interface E2eeKey {
68
+ epoch: number;
69
+ baseKey: Uint8Array;
70
+ index: number;
71
+ indexBits: number;
72
+ canEncrypt: boolean;
73
+ }
74
+
75
+ /** SFrame parameters negotiated for the group, reported on a successful join. */
76
+ export interface SframeParams {
77
+ cipherSuite: number;
78
+ epochBits: number;
79
+ }
80
+
81
+ /**
82
+ * Credential-validation outcome for an MLS roster member. Mirrors (by ordinal) the C++
83
+ * `RosterStatus::ValidationResult` enum in libe2ee (`common/include/e2ee_common/types.h`) — keep
84
+ * the two in sync. For MultiCredential, `PartialSuccess` means at least one credential passed and
85
+ * at least one failed; X.509 identity verification is derived from the individual X.509 results.
86
+ */
11
87
  export const E2eeValidationResult = {
12
88
  Success: 0,
13
89
  PartialSuccess: 1,
@@ -25,9 +101,12 @@ export const E2eeValidationResult = {
25
101
  MissingDisplayNameExtension: 13,
26
102
  } as const;
27
103
 
28
- export type E2eeValidationResult = (typeof E2eeValidationResult)[keyof typeof E2eeValidationResult];
104
+ export type E2eeValidationResult = Enum<typeof E2eeValidationResult>;
29
105
 
30
- /** Identity type attached to the leaf certificate. Keep ordinals in sync with libe2ee. */
106
+ /**
107
+ * Identity type attached to the leaf X.509 certificate. Mirrors the C++ `IdentityType` enum in
108
+ * libe2ee (`common/include/e2ee_common/types.h`) — keep the ordinals in sync.
109
+ */
31
110
  export const E2eeIdentityType = {
32
111
  WebexAnonymousIdentity: 0,
33
112
  WebexMachineIdentity: 1,
@@ -35,24 +114,9 @@ export const E2eeIdentityType = {
35
114
  ExternalVerifiedIdentity: 3,
36
115
  } as const;
37
116
 
38
- export type E2eeIdentityType = (typeof E2eeIdentityType)[keyof typeof E2eeIdentityType];
39
-
40
- /** A media-encryption (SFrame) key for an MLS epoch. */
41
- export interface E2eeKey {
42
- epoch: number;
43
- baseKey: Uint8Array;
44
- index: number;
45
- indexBits: number;
46
- canEncrypt: boolean;
47
- }
48
-
49
- /** SFrame parameters negotiated for an MLS group. */
50
- export interface SframeParams {
51
- cipherSuite: number;
52
- epochBits: number;
53
- }
117
+ export type E2eeIdentityType = Enum<typeof E2eeIdentityType>;
54
118
 
55
- /** Parsed certificate information returned with a roster member. */
119
+ /** Parsed X.509 certificate details from a member's certificate chain. */
56
120
  export interface E2eeCertificateInfo {
57
121
  primaryName: string;
58
122
  commonName: string;
@@ -68,12 +132,13 @@ export interface E2eeCertificateInfo {
68
132
  }
69
133
 
70
134
  export interface E2eeIdentityResult {
135
+ /** Result for this X.509 credential, which may differ from the overall MultiCredential result. */
71
136
  result: E2eeValidationResult;
72
137
  certificateChain: E2eeCertificateInfo[];
73
138
  failedCertIndex?: number;
74
139
  }
75
140
 
76
- /** A member of the MLS roster and its credential-validation result. */
141
+ /** A member of the MLS roster and its overall libe2ee credential validation result. */
77
142
  export interface E2eeRosterMember {
78
143
  url: string;
79
144
  displayName: string;
@@ -82,21 +147,16 @@ export interface E2eeRosterMember {
82
147
  identityResults?: E2eeIdentityResult[];
83
148
  }
84
149
 
85
- /** Credentials and trust anchors consumed by the WASM engine. */
150
+ /** Configuration for initializing an MLS group session. */
86
151
  export interface MLSConfig {
87
152
  participantId: string;
88
153
  deviceUrl: string;
89
- deviceType?: string;
154
+ deviceType: string;
90
155
  correlationId: string;
91
156
  displayName: string;
92
157
  serviceUrl: string;
93
- credentials?: {privateKey: Uint8Array; certChain: Uint8Array[]};
94
- trustAnchors?: {
95
- webexCaRoots?: string;
96
- domainNameRoots?: string;
97
- userIdentityRoots?: string;
98
- domainNameRootsP7b?: Uint8Array;
99
- };
158
+ credentials?: IdentityCredentials;
159
+ trustAnchors?: IdentityTrustAnchors;
100
160
  joinTimeout?: number;
101
161
  coalesceWindow?: number;
102
162
  }
@@ -110,5 +170,10 @@ export interface IMlsHttpClient {
110
170
  request(url: string, body: unknown): Promise<unknown>;
111
171
  }
112
172
 
113
- /** Signaling transport that delivered an MLS protocol message. */
114
- export type E2eeSignalingSource = 'llm' | 'mercury';
173
+ /** Which signaling channel an incoming MLS protocol event arrived on. */
174
+ export const E2eeSignalingSource = {
175
+ Llm: 'llm',
176
+ Mercury: 'mercury',
177
+ } as const;
178
+
179
+ export type E2eeSignalingSource = Enum<typeof E2eeSignalingSource>;
@@ -85,6 +85,8 @@ export interface RosterMember {
85
85
  }
86
86
 
87
87
  export interface WebE2EEInstance {
88
+ delete(): void;
89
+
88
90
  initialize(
89
91
  participantId: string,
90
92
  deviceUrl: string,
@@ -123,20 +125,22 @@ export interface WebE2EEInstance {
123
125
  setJoinTimeout(milliseconds: number): void;
124
126
  setPurgeKeysTimeout(milliseconds: number): void;
125
127
 
126
- setOnNewTransaction(callback: (transaction: Transaction) => void): void;
127
- setOnCompleteTransaction(callback: (id: string, result: TransactionResult) => void): void;
128
- setOnHttpRequest(callback: (request: HTTPRequest) => void): void;
129
- setOnWait(callback: (milliseconds: number, handlerId: number) => void): void;
130
- setOnGotKey(callback: (epoch: EpochInfo) => void): void;
131
- setOnUseKey(callback: (epoch: number) => void): void;
132
- setOnLeader(callback: () => void): void;
133
- setOnPurgeBefore(callback: (epoch: number) => void): void;
134
- setOnEvicted(callback: () => void): void;
135
- setOnAddRoster(callback: (added: RosterMember[]) => void): void;
136
- setOnRemoveRoster(callback: (removed: string[]) => void): void;
137
- setOnE2eeVersion(callback: (version: number) => void): void;
138
- setOnMissingCommit(callback: (mlsEpoch: number, useKeyEpoch: number) => void): void;
139
- setOnLog(callback: (level: number, message: string) => void): void;
128
+ setOnNewTransaction(callback: ((transaction: Transaction) => void) | null): void;
129
+ setOnCompleteTransaction(
130
+ callback: ((id: string, result: TransactionResult) => void) | null
131
+ ): void;
132
+ setOnHttpRequest(callback: ((request: HTTPRequest) => void) | null): void;
133
+ setOnWait(callback: ((milliseconds: number, handlerId: number) => void) | null): void;
134
+ setOnGotKey(callback: ((epoch: EpochInfo) => void) | null): void;
135
+ setOnUseKey(callback: ((epoch: number) => void) | null): void;
136
+ setOnLeader(callback: (() => void) | null): void;
137
+ setOnPurgeBefore(callback: ((epoch: number) => void) | null): void;
138
+ setOnEvicted(callback: (() => void) | null): void;
139
+ setOnAddRoster(callback: ((added: RosterMember[]) => void) | null): void;
140
+ setOnRemoveRoster(callback: ((removed: string[]) => void) | null): void;
141
+ setOnE2eeVersion(callback: ((version: number) => void) | null): void;
142
+ setOnMissingCommit(callback: ((mlsEpoch: number, useKeyEpoch: number) => void) | null): void;
143
+ setOnLog(callback: ((level: number, message: string) => void) | null): void;
140
144
 
141
145
  completeHttpRequest(
142
146
  handlerId: number,
@@ -8,6 +8,7 @@ import {Enum, HTTP_VERBS} from '../constants';
8
8
  import {DataSetNames, DATA_SET_INIT_PRIORITY, EMPTY_HASH, LLM_DATASET_NAMES} from './constants';
9
9
  import {ObjectType, HtMeta, HashTreeObject} from './types';
10
10
  import {LocusDTO, LocusErrorCodes} from '../locus-info/types';
11
+ import type {WebexRequestMethod} from '../common/types';
11
12
  import {deleteNestedObjectsWithHtMeta, isMetadata, sleep, sortByInitPriority} from './utils';
12
13
 
13
14
  export enum SyncAllBackoffType {
@@ -61,7 +62,6 @@ interface InternalDataSet extends DataSet {
61
62
  syncAbortController?: AbortController;
62
63
  }
63
64
 
64
- type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
65
65
  type GenerateTrackingId = () => string | undefined;
66
66
 
67
67
  export const LocusInfoUpdateType = {
package/src/index.ts CHANGED
@@ -72,6 +72,7 @@ export type {
72
72
  SitePreferencesResponse,
73
73
  } from './meetings/meetings.types';
74
74
  export type {Interpreter, InterpreterUsingResource} from './interpretation/interpretation.types';
75
+ export type {E2eeControllerEvent, E2eeControllerEventMap} from './e2ee/types';
75
76
 
76
77
  export {
77
78
  CaptchaError,