livekit-client 2.22.3 → 2.22.4
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/README.md +35 -0
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +2 -1
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +602 -247
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.fm.worker.js +1 -1
- package/dist/livekit-client.fm.worker.js.map +1 -1
- package/dist/livekit-client.fm.worker.mjs +2 -1
- package/dist/livekit-client.fm.worker.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +4 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/options.d.ts +14 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +78 -7
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/PCTransportManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +8 -0
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/defaults.d.ts.map +1 -1
- package/dist/src/room/errors.d.ts +18 -0
- package/dist/src/room/errors.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +3 -2
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
- package/dist/src/room/rpc/client/RpcClientManager.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +2 -0
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +13 -0
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +32 -0
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/compressionStreamStubs.d.ts +12 -0
- package/dist/src/test/compressionStreamStubs.d.ts.map +1 -0
- package/dist/ts4.2/api/SignalClient.d.ts +187 -185
- package/dist/ts4.2/api/SignalClientStateMachine.d.ts +85 -85
- package/dist/ts4.2/api/WebSocketStream.d.ts +33 -33
- package/dist/ts4.2/api/utils.d.ts +9 -9
- package/dist/ts4.2/connectionHelper/ConnectionCheck.d.ts +30 -30
- package/dist/ts4.2/connectionHelper/checks/Checker.d.ts +62 -62
- package/dist/ts4.2/connectionHelper/checks/cloudRegion.d.ts +18 -18
- package/dist/ts4.2/connectionHelper/checks/connectionProtocol.d.ts +20 -20
- package/dist/ts4.2/connectionHelper/checks/publishAudio.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/publishVideo.d.ts +7 -7
- package/dist/ts4.2/connectionHelper/checks/reconnect.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/turn.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/webrtc.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/websocket.d.ts +6 -6
- package/dist/ts4.2/e2ee/E2eeManager.d.ts +111 -111
- package/dist/ts4.2/e2ee/KeyProvider.d.ts +54 -54
- package/dist/ts4.2/e2ee/constants.d.ts +21 -21
- package/dist/ts4.2/e2ee/errors.d.ts +12 -12
- package/dist/ts4.2/e2ee/events.d.ts +39 -39
- package/dist/ts4.2/e2ee/index.d.ts +6 -6
- package/dist/ts4.2/e2ee/types.d.ts +231 -231
- package/dist/ts4.2/e2ee/utils.d.ts +32 -32
- package/dist/ts4.2/e2ee/worker/DataCryptor.d.ts +16 -16
- package/dist/ts4.2/e2ee/worker/ErrorRateLimiter.d.ts +21 -21
- package/dist/ts4.2/e2ee/worker/FrameCryptor.d.ts +209 -209
- package/dist/ts4.2/e2ee/worker/ParticipantKeyHandler.d.ts +81 -84
- package/dist/ts4.2/e2ee/worker/e2ee.worker.d.ts +2 -2
- package/dist/ts4.2/e2ee/worker/naluUtils.d.ts +28 -28
- package/dist/ts4.2/e2ee/worker/sifPayload.d.ts +23 -23
- package/dist/ts4.2/frameMetadata/FrameMetadataManager.d.ts +53 -53
- package/dist/ts4.2/frameMetadata/frameMetadata.d.ts +33 -33
- package/dist/ts4.2/frameMetadata/types.d.ts +62 -62
- package/dist/ts4.2/frameMetadata/utils.d.ts +9 -9
- package/dist/ts4.2/frameMetadata/worker/frameMetadata.worker.d.ts +2 -2
- package/dist/ts4.2/index.d.ts +76 -76
- package/dist/ts4.2/logger.d.ts +66 -66
- package/dist/ts4.2/options.d.ts +163 -149
- package/dist/ts4.2/room/BackOffStrategy.d.ts +27 -27
- package/dist/ts4.2/room/DefaultReconnectPolicy.d.ts +8 -8
- package/dist/ts4.2/room/DeviceManager.d.ts +12 -12
- package/dist/ts4.2/room/PCTransport.d.ts +246 -175
- package/dist/ts4.2/room/PCTransportManager.d.ts +77 -77
- package/dist/ts4.2/room/RTCEngine.d.ts +269 -262
- package/dist/ts4.2/room/ReconnectPolicy.d.ts +24 -24
- package/dist/ts4.2/room/RegionUrlProvider.d.ts +36 -36
- package/dist/ts4.2/room/Room.d.ts +354 -365
- package/dist/ts4.2/room/attribute-typings.d.ts +35 -35
- package/dist/ts4.2/room/data-channel/DataChannelManager.d.ts +62 -62
- package/dist/ts4.2/room/data-channel/FlowControlledDataChannel.d.ts +94 -95
- package/dist/ts4.2/room/data-channel/LossyDataChannel.d.ts +41 -41
- package/dist/ts4.2/room/data-channel/ReliableDataChannel.d.ts +57 -57
- package/dist/ts4.2/room/data-channel/types.d.ts +12 -12
- package/dist/ts4.2/room/data-stream/compression.d.ts +49 -49
- package/dist/ts4.2/room/data-stream/constants.d.ts +18 -18
- package/dist/ts4.2/room/data-stream/incoming/IncomingDataStreamManager.d.ts +29 -29
- package/dist/ts4.2/room/data-stream/incoming/StreamReader.d.ts +80 -80
- package/dist/ts4.2/room/data-stream/outgoing/OutgoingDataStreamManager.d.ts +73 -73
- package/dist/ts4.2/room/data-stream/outgoing/StreamWriter.d.ts +16 -16
- package/dist/ts4.2/room/data-stream/outgoing/header-utils.d.ts +18 -18
- package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +79 -80
- package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +50 -50
- package/dist/ts4.2/room/data-track/depacketizer.d.ts +59 -59
- package/dist/ts4.2/room/data-track/frame.d.ts +22 -22
- package/dist/ts4.2/room/data-track/handle.d.ts +27 -27
- package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +124 -124
- package/dist/ts4.2/room/data-track/incoming/errors.d.ts +24 -24
- package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +41 -41
- package/dist/ts4.2/room/data-track/incoming/types.d.ts +20 -20
- package/dist/ts4.2/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +126 -126
- package/dist/ts4.2/room/data-track/outgoing/errors.d.ts +74 -74
- package/dist/ts4.2/room/data-track/outgoing/pipeline.d.ts +23 -23
- package/dist/ts4.2/room/data-track/outgoing/types.d.ts +48 -48
- package/dist/ts4.2/room/data-track/packet/constants.d.ts +20 -20
- package/dist/ts4.2/room/data-track/packet/errors.d.ts +40 -40
- package/dist/ts4.2/room/data-track/packet/extensions.d.ts +69 -69
- package/dist/ts4.2/room/data-track/packet/index.d.ts +98 -98
- package/dist/ts4.2/room/data-track/packet/serializable.d.ts +13 -13
- package/dist/ts4.2/room/data-track/packetizer.d.ts +43 -43
- package/dist/ts4.2/room/data-track/track-interfaces.d.ts +23 -23
- package/dist/ts4.2/room/data-track/types.d.ts +22 -22
- package/dist/ts4.2/room/data-track/utils.d.ts +60 -60
- package/dist/ts4.2/room/debounce.d.ts +11 -11
- package/dist/ts4.2/room/defaults.d.ts +9 -9
- package/dist/ts4.2/room/errors.d.ts +180 -162
- package/dist/ts4.2/room/events.d.ts +638 -637
- package/dist/ts4.2/room/participant/LocalParticipant.d.ts +287 -287
- package/dist/ts4.2/room/participant/Participant.d.ts +142 -144
- package/dist/ts4.2/room/participant/ParticipantTrackPermission.d.ts +26 -26
- package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +85 -86
- package/dist/ts4.2/room/participant/publishUtils.d.ts +53 -53
- package/dist/ts4.2/room/rpc/client/RpcClientManager.d.ts +43 -43
- package/dist/ts4.2/room/rpc/client/events.d.ts +8 -8
- package/dist/ts4.2/room/rpc/index.d.ts +7 -7
- package/dist/ts4.2/room/rpc/server/RpcServerManager.d.ts +44 -44
- package/dist/ts4.2/room/rpc/server/events.d.ts +8 -8
- package/dist/ts4.2/room/rpc/utils.d.ts +131 -131
- package/dist/ts4.2/room/stats.d.ts +71 -71
- package/dist/ts4.2/room/statsSummary.d.ts +13 -13
- package/dist/ts4.2/room/timers.d.ts +12 -12
- package/dist/ts4.2/room/token-source/TokenSource.d.ts +82 -82
- package/dist/ts4.2/room/token-source/types.d.ts +70 -70
- package/dist/ts4.2/room/token-source/utils.d.ts +8 -8
- package/dist/ts4.2/room/track/FrameMetadataExtractor.d.ts +19 -19
- package/dist/ts4.2/room/track/LocalAudioTrack.d.ts +39 -42
- package/dist/ts4.2/room/track/LocalTrack.d.ts +125 -125
- package/dist/ts4.2/room/track/LocalTrackPublication.d.ts +42 -42
- package/dist/ts4.2/room/track/LocalVideoTrack.d.ts +102 -100
- package/dist/ts4.2/room/track/RemoteAudioTrack.d.ts +55 -55
- package/dist/ts4.2/room/track/RemoteTrack.d.ts +38 -38
- package/dist/ts4.2/room/track/RemoteTrackPublication.d.ts +72 -75
- package/dist/ts4.2/room/track/RemoteVideoTrack.d.ts +73 -76
- package/dist/ts4.2/room/track/Track.d.ts +156 -166
- package/dist/ts4.2/room/track/TrackPublication.d.ts +75 -81
- package/dist/ts4.2/room/track/create.d.ts +25 -25
- package/dist/ts4.2/room/track/facingMode.d.ts +41 -41
- package/dist/ts4.2/room/track/options.d.ts +403 -403
- package/dist/ts4.2/room/track/processor/types.d.ts +31 -31
- package/dist/ts4.2/room/track/record.d.ts +13 -13
- package/dist/ts4.2/room/track/types.d.ts +28 -28
- package/dist/ts4.2/room/track/utils.d.ts +60 -47
- package/dist/ts4.2/room/types.d.ts +127 -127
- package/dist/ts4.2/room/utils.d.ts +246 -214
- package/dist/ts4.2/test/MockMediaStreamTrack.d.ts +26 -26
- package/dist/ts4.2/test/compressionStreamStubs.d.ts +12 -0
- package/dist/ts4.2/test/mocks.d.ts +12 -12
- package/dist/ts4.2/test/promiseState.d.ts +12 -12
- package/dist/ts4.2/test/signalToken.d.ts +26 -26
- package/dist/ts4.2/type-polyfills/non-shared-typed-arrays.d.ts +2 -2
- package/dist/ts4.2/utils/AsyncQueue.d.ts +23 -23
- package/dist/ts4.2/utils/TypedPromise.d.ts +17 -17
- package/dist/ts4.2/utils/abort-signal-polyfill.d.ts +13 -13
- package/dist/ts4.2/utils/browserParser.d.ts +13 -13
- package/dist/ts4.2/utils/camelToSnakeCase.d.ts +8 -8
- package/dist/ts4.2/utils/cloneDeep.d.ts +2 -2
- package/dist/ts4.2/utils/dataPacketBuffer.d.ts +34 -34
- package/dist/ts4.2/utils/deferrable-map.d.ts +32 -32
- package/dist/ts4.2/utils/machineInspector.d.ts +54 -54
- package/dist/ts4.2/utils/serializer.d.ts +48 -48
- package/dist/ts4.2/utils/subscribeToEvents.d.ts +15 -15
- package/dist/ts4.2/utils/ttlmap.d.ts +20 -20
- package/dist/ts4.2/version.d.ts +15 -15
- package/package.json +5 -4
- package/src/api/SignalClient.e2e.test.ts +1 -3
- package/src/api/SignalClient.test.ts +160 -10
- package/src/api/SignalClient.ts +75 -54
- package/src/options.ts +16 -0
- package/src/room/PCTransport.test.ts +183 -7
- package/src/room/PCTransport.ts +197 -36
- package/src/room/PCTransportManager.ts +3 -1
- package/src/room/RTCEngine.test.ts +84 -0
- package/src/room/RTCEngine.ts +24 -5
- package/src/room/Room.test.ts +32 -6
- package/src/room/Room.ts +26 -6
- package/src/room/data-stream/incoming/IncomingDataStreamManager.test.ts +16 -20
- package/src/room/data-stream/incoming/IncomingDataStreamManager.ts +5 -5
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.test.ts +60 -39
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.ts +4 -4
- package/src/room/defaults.ts +1 -0
- package/src/room/errors.test.ts +36 -0
- package/src/room/errors.ts +27 -0
- package/src/room/events.ts +2 -1
- package/src/room/participant/publishUtils.ts +0 -19
- package/src/room/rpc/client/RpcClientManager.test.ts +51 -0
- package/src/room/rpc/client/RpcClientManager.ts +32 -15
- package/src/room/track/LocalTrack.ts +18 -7
- package/src/room/track/LocalVideoTrack.ts +10 -3
- package/src/room/track/RemoteAudioTrack.ts +3 -3
- package/src/room/track/RemoteVideoTrack.test.ts +210 -0
- package/src/room/track/RemoteVideoTrack.ts +29 -3
- package/src/room/track/utils.test.ts +201 -2
- package/src/room/track/utils.ts +88 -0
- package/src/room/utils.test.ts +124 -0
- package/src/room/utils.ts +70 -0
- package/src/test/compressionStreamStubs.ts +53 -0
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import type TypedEventEmitter from 'typed-emitter';
|
|
2
|
-
import type RTCEngine from '../room/RTCEngine';
|
|
3
|
-
import type Room from '../room/Room';
|
|
4
|
-
import type { NonSharedUint8Array } from '../type-polyfills/non-shared-typed-arrays';
|
|
5
|
-
import type { E2EEManagerCallbacks } from './events';
|
|
6
|
-
import type { DecryptDataResponseMessage, E2EEManagerOptions, EncryptDataResponseMessage } from './types';
|
|
7
|
-
export interface BaseE2EEManager {
|
|
8
|
-
setup(room: Room): void;
|
|
9
|
-
setupEngine(engine: RTCEngine): void;
|
|
10
|
-
isEnabled: boolean;
|
|
11
|
-
isDataChannelEncryptionEnabled: boolean;
|
|
12
|
-
setParticipantCryptorEnabled(enabled: boolean, participantIdentity: string): void;
|
|
13
|
-
setSifTrailer(trailer: NonSharedUint8Array): void;
|
|
14
|
-
encryptData(data: NonSharedUint8Array): Promise<EncryptDataResponseMessage['data']>;
|
|
15
|
-
handleEncryptedData(payload: NonSharedUint8Array, iv: NonSharedUint8Array, participantIdentity: string, keyIndex: number): Promise<DecryptDataResponseMessage['data']>;
|
|
16
|
-
on<E extends keyof E2EEManagerCallbacks>(event: E, listener: E2EEManagerCallbacks[E]): this;
|
|
17
|
-
dispose?(): void;
|
|
18
|
-
}
|
|
19
|
-
declare const E2EEManager_base: new () => TypedEventEmitter<E2EEManagerCallbacks>;
|
|
20
|
-
/**
|
|
21
|
-
* @experimental
|
|
22
|
-
*/
|
|
23
|
-
export declare class E2EEManager extends E2EEManager_base implements BaseE2EEManager {
|
|
24
|
-
protected worker: Worker;
|
|
25
|
-
protected room?: Room;
|
|
26
|
-
private encryptionEnabled;
|
|
27
|
-
private keyProvider;
|
|
28
|
-
private decryptDataRequests;
|
|
29
|
-
private encryptDataRequests;
|
|
30
|
-
private dataChannelEncryptionEnabled;
|
|
31
|
-
private unsubscribeLogLevel?;
|
|
32
|
-
private log;
|
|
33
|
-
get logContext(): {
|
|
34
|
-
room: string | undefined;
|
|
35
|
-
participant: string | undefined;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Runs a cleanup callback once this manager is garbage collected. Lets the
|
|
39
|
-
* log-level listener (held in a module-global Set on the main-thread logger)
|
|
40
|
-
* fall out of scope even when the consumer forgets to call `dispose()`.
|
|
41
|
-
*/
|
|
42
|
-
private static disposeRegistry;
|
|
43
|
-
constructor(options: E2EEManagerOptions, dcEncryptionEnabled: boolean);
|
|
44
|
-
get isEnabled(): boolean;
|
|
45
|
-
get isDataChannelEncryptionEnabled(): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
setup(room: Room): void;
|
|
50
|
-
/**
|
|
51
|
-
* Subscribe the current worker to main-thread `workerLogger` level changes,
|
|
52
|
-
* without strongly retaining `this` or `this.worker` from the module-global
|
|
53
|
-
* listener Set on the logger. See {@link disposeRegistry}.
|
|
54
|
-
*/
|
|
55
|
-
private subscribeToLogLevelChanges;
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
* Release the log-level subscription, reject any pending encrypt/decrypt
|
|
59
|
-
* futures, and detach the worker message handlers. The worker itself is
|
|
60
|
-
* caller-owned and is not terminated. Idempotent.
|
|
61
|
-
*/
|
|
62
|
-
dispose(): void;
|
|
63
|
-
/**
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
setParticipantCryptorEnabled(enabled: boolean, participantIdentity: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
setSifTrailer(trailer: NonSharedUint8Array): void;
|
|
71
|
-
private onWorkerMessage;
|
|
72
|
-
private onWorkerError;
|
|
73
|
-
private handleFrameMetadata;
|
|
74
|
-
setupEngine(engine: RTCEngine): void;
|
|
75
|
-
private setupEventListeners;
|
|
76
|
-
encryptData(data: NonSharedUint8Array): Promise<EncryptDataResponseMessage['data']>;
|
|
77
|
-
handleEncryptedData(payload: NonSharedUint8Array, iv: NonSharedUint8Array, participantIdentity: string, keyIndex: number): Promise<{
|
|
78
|
-
uuid: string;
|
|
79
|
-
payload: NonSharedUint8Array;
|
|
80
|
-
} & {
|
|
81
|
-
readonly __throws?: Error | undefined;
|
|
82
|
-
}>;
|
|
83
|
-
private postRatchetRequest;
|
|
84
|
-
private postKey;
|
|
85
|
-
private postEnable;
|
|
86
|
-
private postRTPMap;
|
|
87
|
-
private postSifTrailer;
|
|
88
|
-
/**
|
|
89
|
-
* Derive the participant's encryption state from one of its publications.
|
|
90
|
-
* Publications without trackInfo are skipped rather than thrown on: throwing
|
|
91
|
-
* inside the forEach above would leave every remaining participant without an
|
|
92
|
-
* encryption state, and a cryptor with unknown state can no longer decrypt.
|
|
93
|
-
*/
|
|
94
|
-
private setParticipantCryptorEnabledForPublication;
|
|
95
|
-
private setupE2EEReceiver;
|
|
96
|
-
private setupE2EESender;
|
|
97
|
-
/**
|
|
98
|
-
* Handles the given {@code RTCRtpReceiver} by creating a {@code TransformStream} which will inject
|
|
99
|
-
* a frame decoder.
|
|
100
|
-
*
|
|
101
|
-
*/
|
|
102
|
-
private handleReceiver;
|
|
103
|
-
/**
|
|
104
|
-
* Handles the given {@code RTCRtpSender} by creating a {@code TransformStream} which will inject
|
|
105
|
-
* a frame encoder.
|
|
106
|
-
*
|
|
107
|
-
*/
|
|
108
|
-
private handleSender;
|
|
109
|
-
}
|
|
110
|
-
export {};
|
|
111
|
-
//# sourceMappingURL=E2eeManager.d.ts.map
|
|
1
|
+
import type TypedEventEmitter from 'typed-emitter';
|
|
2
|
+
import type RTCEngine from '../room/RTCEngine';
|
|
3
|
+
import type Room from '../room/Room';
|
|
4
|
+
import type { NonSharedUint8Array } from '../type-polyfills/non-shared-typed-arrays';
|
|
5
|
+
import type { E2EEManagerCallbacks } from './events';
|
|
6
|
+
import type { DecryptDataResponseMessage, E2EEManagerOptions, EncryptDataResponseMessage } from './types';
|
|
7
|
+
export interface BaseE2EEManager {
|
|
8
|
+
setup(room: Room): void;
|
|
9
|
+
setupEngine(engine: RTCEngine): void;
|
|
10
|
+
isEnabled: boolean;
|
|
11
|
+
isDataChannelEncryptionEnabled: boolean;
|
|
12
|
+
setParticipantCryptorEnabled(enabled: boolean, participantIdentity: string): void;
|
|
13
|
+
setSifTrailer(trailer: NonSharedUint8Array): void;
|
|
14
|
+
encryptData(data: NonSharedUint8Array): Promise<EncryptDataResponseMessage['data']>;
|
|
15
|
+
handleEncryptedData(payload: NonSharedUint8Array, iv: NonSharedUint8Array, participantIdentity: string, keyIndex: number): Promise<DecryptDataResponseMessage['data']>;
|
|
16
|
+
on<E extends keyof E2EEManagerCallbacks>(event: E, listener: E2EEManagerCallbacks[E]): this;
|
|
17
|
+
dispose?(): void;
|
|
18
|
+
}
|
|
19
|
+
declare const E2EEManager_base: new () => TypedEventEmitter<E2EEManagerCallbacks>;
|
|
20
|
+
/**
|
|
21
|
+
* @experimental
|
|
22
|
+
*/
|
|
23
|
+
export declare class E2EEManager extends E2EEManager_base implements BaseE2EEManager {
|
|
24
|
+
protected worker: Worker;
|
|
25
|
+
protected room?: Room;
|
|
26
|
+
private encryptionEnabled;
|
|
27
|
+
private keyProvider;
|
|
28
|
+
private decryptDataRequests;
|
|
29
|
+
private encryptDataRequests;
|
|
30
|
+
private dataChannelEncryptionEnabled;
|
|
31
|
+
private unsubscribeLogLevel?;
|
|
32
|
+
private log;
|
|
33
|
+
get logContext(): {
|
|
34
|
+
room: string | undefined;
|
|
35
|
+
participant: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Runs a cleanup callback once this manager is garbage collected. Lets the
|
|
39
|
+
* log-level listener (held in a module-global Set on the main-thread logger)
|
|
40
|
+
* fall out of scope even when the consumer forgets to call `dispose()`.
|
|
41
|
+
*/
|
|
42
|
+
private static disposeRegistry;
|
|
43
|
+
constructor(options: E2EEManagerOptions, dcEncryptionEnabled: boolean);
|
|
44
|
+
get isEnabled(): boolean;
|
|
45
|
+
get isDataChannelEncryptionEnabled(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
setup(room: Room): void;
|
|
50
|
+
/**
|
|
51
|
+
* Subscribe the current worker to main-thread `workerLogger` level changes,
|
|
52
|
+
* without strongly retaining `this` or `this.worker` from the module-global
|
|
53
|
+
* listener Set on the logger. See {@link disposeRegistry}.
|
|
54
|
+
*/
|
|
55
|
+
private subscribeToLogLevelChanges;
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
* Release the log-level subscription, reject any pending encrypt/decrypt
|
|
59
|
+
* futures, and detach the worker message handlers. The worker itself is
|
|
60
|
+
* caller-owned and is not terminated. Idempotent.
|
|
61
|
+
*/
|
|
62
|
+
dispose(): void;
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
setParticipantCryptorEnabled(enabled: boolean, participantIdentity: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
setSifTrailer(trailer: NonSharedUint8Array): void;
|
|
71
|
+
private onWorkerMessage;
|
|
72
|
+
private onWorkerError;
|
|
73
|
+
private handleFrameMetadata;
|
|
74
|
+
setupEngine(engine: RTCEngine): void;
|
|
75
|
+
private setupEventListeners;
|
|
76
|
+
encryptData(data: NonSharedUint8Array): Promise<EncryptDataResponseMessage['data']>;
|
|
77
|
+
handleEncryptedData(payload: NonSharedUint8Array, iv: NonSharedUint8Array, participantIdentity: string, keyIndex: number): Promise<{
|
|
78
|
+
uuid: string;
|
|
79
|
+
payload: NonSharedUint8Array;
|
|
80
|
+
} & {
|
|
81
|
+
readonly __throws?: Error | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
private postRatchetRequest;
|
|
84
|
+
private postKey;
|
|
85
|
+
private postEnable;
|
|
86
|
+
private postRTPMap;
|
|
87
|
+
private postSifTrailer;
|
|
88
|
+
/**
|
|
89
|
+
* Derive the participant's encryption state from one of its publications.
|
|
90
|
+
* Publications without trackInfo are skipped rather than thrown on: throwing
|
|
91
|
+
* inside the forEach above would leave every remaining participant without an
|
|
92
|
+
* encryption state, and a cryptor with unknown state can no longer decrypt.
|
|
93
|
+
*/
|
|
94
|
+
private setParticipantCryptorEnabledForPublication;
|
|
95
|
+
private setupE2EEReceiver;
|
|
96
|
+
private setupE2EESender;
|
|
97
|
+
/**
|
|
98
|
+
* Handles the given {@code RTCRtpReceiver} by creating a {@code TransformStream} which will inject
|
|
99
|
+
* a frame decoder.
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
private handleReceiver;
|
|
103
|
+
/**
|
|
104
|
+
* Handles the given {@code RTCRtpSender} by creating a {@code TransformStream} which will inject
|
|
105
|
+
* a frame encoder.
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
private handleSender;
|
|
109
|
+
}
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=E2eeManager.d.ts.map
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import type TypedEventEmitter from 'typed-emitter';
|
|
2
|
-
import type { KeyProviderCallbacks } from './events';
|
|
3
|
-
import type { KeyInfo, KeyProviderOptions, RatchetResult } from './types';
|
|
4
|
-
declare const BaseKeyProvider_base: new () => TypedEventEmitter<KeyProviderCallbacks>;
|
|
5
|
-
/**
|
|
6
|
-
* @experimental
|
|
7
|
-
*/
|
|
8
|
-
export declare class BaseKeyProvider extends BaseKeyProvider_base {
|
|
9
|
-
private keyInfoMap;
|
|
10
|
-
private readonly options;
|
|
11
|
-
private latestManuallySetKeyIndex;
|
|
12
|
-
constructor(options?: Partial<KeyProviderOptions>);
|
|
13
|
-
/**
|
|
14
|
-
* callback to invoke once a key has been set for a participant
|
|
15
|
-
* @param key
|
|
16
|
-
* @param participantIdentity
|
|
17
|
-
* @param keyIndex
|
|
18
|
-
*/
|
|
19
|
-
protected onSetEncryptionKey(key: CryptoKey, participantIdentity?: string, keyIndex?: number): void;
|
|
20
|
-
/**
|
|
21
|
-
* Callback being invoked after a key has been ratcheted.
|
|
22
|
-
* Can happen when:
|
|
23
|
-
* - A decryption failure occurs and the key is auto-ratcheted
|
|
24
|
-
* - A ratchet request is sent (see {@link ratchetKey()})
|
|
25
|
-
* @param ratchetResult Contains the ratcheted chain key (exportable to other participants) and the derived new key material.
|
|
26
|
-
* @param participantId
|
|
27
|
-
* @param keyIndex
|
|
28
|
-
*/
|
|
29
|
-
protected onKeyRatcheted: (ratchetResult: RatchetResult, participantId?: string, keyIndex?: number) => void;
|
|
30
|
-
getKeys(): KeyInfo[];
|
|
31
|
-
getLatestManuallySetKeyIndex(): number;
|
|
32
|
-
getOptions(): KeyProviderOptions;
|
|
33
|
-
ratchetKey(participantIdentity?: string, keyIndex?: number): void;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A basic KeyProvider implementation intended for a single shared
|
|
37
|
-
* passphrase between all participants
|
|
38
|
-
* @experimental
|
|
39
|
-
*/
|
|
40
|
-
export declare class ExternalE2EEKeyProvider extends BaseKeyProvider {
|
|
41
|
-
ratchetInterval: number | undefined;
|
|
42
|
-
constructor(options?: Partial<Omit<KeyProviderOptions, 'sharedKey'>>);
|
|
43
|
-
/**
|
|
44
|
-
* Accepts a passphrase that's used to create the crypto keys.
|
|
45
|
-
* When passing in a string, PBKDF2 is used. (recommended for maximum compatibility across SDKs)
|
|
46
|
-
* When passing in an ArrayBuffer of cryptographically random numbers, HKDF is used.
|
|
47
|
-
*
|
|
48
|
-
* Note: Not all client SDKS support HKDF.
|
|
49
|
-
* @param key
|
|
50
|
-
*/
|
|
51
|
-
setKey(key: string | ArrayBuffer): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
54
|
-
//# sourceMappingURL=KeyProvider.d.ts.map
|
|
1
|
+
import type TypedEventEmitter from 'typed-emitter';
|
|
2
|
+
import type { KeyProviderCallbacks } from './events';
|
|
3
|
+
import type { KeyInfo, KeyProviderOptions, RatchetResult } from './types';
|
|
4
|
+
declare const BaseKeyProvider_base: new () => TypedEventEmitter<KeyProviderCallbacks>;
|
|
5
|
+
/**
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare class BaseKeyProvider extends BaseKeyProvider_base {
|
|
9
|
+
private keyInfoMap;
|
|
10
|
+
private readonly options;
|
|
11
|
+
private latestManuallySetKeyIndex;
|
|
12
|
+
constructor(options?: Partial<KeyProviderOptions>);
|
|
13
|
+
/**
|
|
14
|
+
* callback to invoke once a key has been set for a participant
|
|
15
|
+
* @param key
|
|
16
|
+
* @param participantIdentity
|
|
17
|
+
* @param keyIndex
|
|
18
|
+
*/
|
|
19
|
+
protected onSetEncryptionKey(key: CryptoKey, participantIdentity?: string, keyIndex?: number): void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback being invoked after a key has been ratcheted.
|
|
22
|
+
* Can happen when:
|
|
23
|
+
* - A decryption failure occurs and the key is auto-ratcheted
|
|
24
|
+
* - A ratchet request is sent (see {@link ratchetKey()})
|
|
25
|
+
* @param ratchetResult Contains the ratcheted chain key (exportable to other participants) and the derived new key material.
|
|
26
|
+
* @param participantId
|
|
27
|
+
* @param keyIndex
|
|
28
|
+
*/
|
|
29
|
+
protected onKeyRatcheted: (ratchetResult: RatchetResult, participantId?: string, keyIndex?: number) => void;
|
|
30
|
+
getKeys(): KeyInfo[];
|
|
31
|
+
getLatestManuallySetKeyIndex(): number;
|
|
32
|
+
getOptions(): KeyProviderOptions;
|
|
33
|
+
ratchetKey(participantIdentity?: string, keyIndex?: number): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A basic KeyProvider implementation intended for a single shared
|
|
37
|
+
* passphrase between all participants
|
|
38
|
+
* @experimental
|
|
39
|
+
*/
|
|
40
|
+
export declare class ExternalE2EEKeyProvider extends BaseKeyProvider {
|
|
41
|
+
ratchetInterval: number | undefined;
|
|
42
|
+
constructor(options?: Partial<Omit<KeyProviderOptions, 'sharedKey'>>);
|
|
43
|
+
/**
|
|
44
|
+
* Accepts a passphrase that's used to create the crypto keys.
|
|
45
|
+
* When passing in a string, PBKDF2 is used. (recommended for maximum compatibility across SDKs)
|
|
46
|
+
* When passing in an ArrayBuffer of cryptographically random numbers, HKDF is used.
|
|
47
|
+
*
|
|
48
|
+
* Note: Not all client SDKS support HKDF.
|
|
49
|
+
* @param key
|
|
50
|
+
*/
|
|
51
|
+
setKey(key: string | ArrayBuffer): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=KeyProvider.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { KeyProviderOptions } from './types';
|
|
2
|
-
export declare const ENCRYPTION_ALGORITHM = "AES-GCM";
|
|
3
|
-
export declare const DECRYPTION_FAILURE_TOLERANCE = 10;
|
|
4
|
-
export declare const UNENCRYPTED_BYTES: {
|
|
5
|
-
readonly key: 10;
|
|
6
|
-
readonly delta: 3;
|
|
7
|
-
readonly audio: 1;
|
|
8
|
-
readonly empty: 0;
|
|
9
|
-
};
|
|
10
|
-
export declare const IV_LENGTH = 12;
|
|
11
|
-
export declare const E2EE_FLAG = "lk_e2ee";
|
|
12
|
-
/**
|
|
13
|
-
* trackId a receiver's/sender's encoded stream pipeline was last set up for.
|
|
14
|
-
* Needed to recover the right cryptor when a transceiver gets reused.
|
|
15
|
-
*/
|
|
16
|
-
export declare const E2EE_TRACK_ID = "lk_e2ee_track_id";
|
|
17
|
-
export declare const SALT = "LKFrameEncryptionKey";
|
|
18
|
-
export declare const KEY_PROVIDER_DEFAULTS: KeyProviderOptions;
|
|
19
|
-
export declare const MAX_SIF_COUNT = 100;
|
|
20
|
-
export declare const MAX_SIF_DURATION = 2000;
|
|
21
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
1
|
+
import type { KeyProviderOptions } from './types';
|
|
2
|
+
export declare const ENCRYPTION_ALGORITHM = "AES-GCM";
|
|
3
|
+
export declare const DECRYPTION_FAILURE_TOLERANCE = 10;
|
|
4
|
+
export declare const UNENCRYPTED_BYTES: {
|
|
5
|
+
readonly key: 10;
|
|
6
|
+
readonly delta: 3;
|
|
7
|
+
readonly audio: 1;
|
|
8
|
+
readonly empty: 0;
|
|
9
|
+
};
|
|
10
|
+
export declare const IV_LENGTH = 12;
|
|
11
|
+
export declare const E2EE_FLAG = "lk_e2ee";
|
|
12
|
+
/**
|
|
13
|
+
* trackId a receiver's/sender's encoded stream pipeline was last set up for.
|
|
14
|
+
* Needed to recover the right cryptor when a transceiver gets reused.
|
|
15
|
+
*/
|
|
16
|
+
export declare const E2EE_TRACK_ID = "lk_e2ee_track_id";
|
|
17
|
+
export declare const SALT = "LKFrameEncryptionKey";
|
|
18
|
+
export declare const KEY_PROVIDER_DEFAULTS: KeyProviderOptions;
|
|
19
|
+
export declare const MAX_SIF_COUNT = 100;
|
|
20
|
+
export declare const MAX_SIF_DURATION = 2000;
|
|
21
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { LivekitError } from '../room/errors';
|
|
2
|
-
export declare enum CryptorErrorReason {
|
|
3
|
-
InvalidKey = 0,
|
|
4
|
-
MissingKey = 1,
|
|
5
|
-
InternalError = 2
|
|
6
|
-
}
|
|
7
|
-
export declare class CryptorError extends LivekitError {
|
|
8
|
-
reason: CryptorErrorReason;
|
|
9
|
-
participantIdentity?: string;
|
|
10
|
-
constructor(message?: string, reason?: CryptorErrorReason, participantIdentity?: string);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
1
|
+
import { LivekitError } from '../room/errors';
|
|
2
|
+
export declare enum CryptorErrorReason {
|
|
3
|
+
InvalidKey = 0,
|
|
4
|
+
MissingKey = 1,
|
|
5
|
+
InternalError = 2
|
|
6
|
+
}
|
|
7
|
+
export declare class CryptorError extends LivekitError {
|
|
8
|
+
reason: CryptorErrorReason;
|
|
9
|
+
participantIdentity?: string;
|
|
10
|
+
constructor(message?: string, reason?: CryptorErrorReason, participantIdentity?: string);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import type Participant from '../room/participant/Participant';
|
|
2
|
-
import type { CryptorError } from './errors';
|
|
3
|
-
import type { KeyInfo, RatchetResult } from './types';
|
|
4
|
-
export declare enum KeyProviderEvent {
|
|
5
|
-
SetKey = "setKey",
|
|
6
|
-
/** Event for requesting to ratchet the key used to encrypt the stream */
|
|
7
|
-
RatchetRequest = "ratchetRequest",
|
|
8
|
-
/** Emitted when a key is ratcheted. Could be after auto-ratcheting on decryption failure or
|
|
9
|
-
* following a `RatchetRequest`, will contain the ratcheted key material */
|
|
10
|
-
KeyRatcheted = "keyRatcheted"
|
|
11
|
-
}
|
|
12
|
-
export type KeyProviderCallbacks = {
|
|
13
|
-
[KeyProviderEvent.SetKey]: (keyInfo: KeyInfo, updateCurrentKeyIndex: boolean) => void;
|
|
14
|
-
[KeyProviderEvent.RatchetRequest]: (participantIdentity?: string, keyIndex?: number) => void;
|
|
15
|
-
[KeyProviderEvent.KeyRatcheted]: (ratchetedResult: RatchetResult, participantIdentity?: string, keyIndex?: number) => void;
|
|
16
|
-
};
|
|
17
|
-
export declare enum KeyHandlerEvent {
|
|
18
|
-
/** Emitted when a key has been ratcheted. Is emitted when any key has been ratcheted
|
|
19
|
-
* i.e. when the FrameCryptor tried to ratchet when decryption is failing */
|
|
20
|
-
KeyRatcheted = "keyRatcheted"
|
|
21
|
-
}
|
|
22
|
-
export type ParticipantKeyHandlerCallbacks = {
|
|
23
|
-
[KeyHandlerEvent.KeyRatcheted]: (ratchetResult: RatchetResult, participantIdentity: string, keyIndex?: number) => void;
|
|
24
|
-
};
|
|
25
|
-
export declare enum EncryptionEvent {
|
|
26
|
-
ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged",
|
|
27
|
-
EncryptionError = "encryptionError"
|
|
28
|
-
}
|
|
29
|
-
export type E2EEManagerCallbacks = {
|
|
30
|
-
[EncryptionEvent.ParticipantEncryptionStatusChanged]: (enabled: boolean, participant: Participant) => void;
|
|
31
|
-
[EncryptionEvent.EncryptionError]: (error: Error, participantIdentity?: string) => void;
|
|
32
|
-
};
|
|
33
|
-
export type CryptorCallbacks = {
|
|
34
|
-
[CryptorEvent.Error]: (error: CryptorError) => void;
|
|
35
|
-
};
|
|
36
|
-
export declare enum CryptorEvent {
|
|
37
|
-
Error = "cryptorError"
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=events.d.ts.map
|
|
1
|
+
import type Participant from '../room/participant/Participant';
|
|
2
|
+
import type { CryptorError } from './errors';
|
|
3
|
+
import type { KeyInfo, RatchetResult } from './types';
|
|
4
|
+
export declare enum KeyProviderEvent {
|
|
5
|
+
SetKey = "setKey",
|
|
6
|
+
/** Event for requesting to ratchet the key used to encrypt the stream */
|
|
7
|
+
RatchetRequest = "ratchetRequest",
|
|
8
|
+
/** Emitted when a key is ratcheted. Could be after auto-ratcheting on decryption failure or
|
|
9
|
+
* following a `RatchetRequest`, will contain the ratcheted key material */
|
|
10
|
+
KeyRatcheted = "keyRatcheted"
|
|
11
|
+
}
|
|
12
|
+
export type KeyProviderCallbacks = {
|
|
13
|
+
[KeyProviderEvent.SetKey]: (keyInfo: KeyInfo, updateCurrentKeyIndex: boolean) => void;
|
|
14
|
+
[KeyProviderEvent.RatchetRequest]: (participantIdentity?: string, keyIndex?: number) => void;
|
|
15
|
+
[KeyProviderEvent.KeyRatcheted]: (ratchetedResult: RatchetResult, participantIdentity?: string, keyIndex?: number) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare enum KeyHandlerEvent {
|
|
18
|
+
/** Emitted when a key has been ratcheted. Is emitted when any key has been ratcheted
|
|
19
|
+
* i.e. when the FrameCryptor tried to ratchet when decryption is failing */
|
|
20
|
+
KeyRatcheted = "keyRatcheted"
|
|
21
|
+
}
|
|
22
|
+
export type ParticipantKeyHandlerCallbacks = {
|
|
23
|
+
[KeyHandlerEvent.KeyRatcheted]: (ratchetResult: RatchetResult, participantIdentity: string, keyIndex?: number) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare enum EncryptionEvent {
|
|
26
|
+
ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged",
|
|
27
|
+
EncryptionError = "encryptionError"
|
|
28
|
+
}
|
|
29
|
+
export type E2EEManagerCallbacks = {
|
|
30
|
+
[EncryptionEvent.ParticipantEncryptionStatusChanged]: (enabled: boolean, participant: Participant) => void;
|
|
31
|
+
[EncryptionEvent.EncryptionError]: (error: Error, participantIdentity?: string) => void;
|
|
32
|
+
};
|
|
33
|
+
export type CryptorCallbacks = {
|
|
34
|
+
[CryptorEvent.Error]: (error: CryptorError) => void;
|
|
35
|
+
};
|
|
36
|
+
export declare enum CryptorEvent {
|
|
37
|
+
Error = "cryptorError"
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './KeyProvider';
|
|
2
|
-
export * from './utils';
|
|
3
|
-
export * from './types';
|
|
4
|
-
export * from './events';
|
|
5
|
-
export * from './errors';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './KeyProvider';
|
|
2
|
+
export * from './utils';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './events';
|
|
5
|
+
export * from './errors';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|