@dtelecom/livekit-client 1.12.4 → 1.12.6
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 +3 -39
- 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 +301 -389
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +15291 -13060
- package/dist/livekit-client.esm.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 +2 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/ConnectionCheck.d.ts +2 -3
- package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/Checker.d.ts +2 -3
- package/dist/src/connectionHelper/checks/Checker.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/webrtc.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts +2 -4
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/KeyProvider.d.ts +2 -4
- package/dist/src/e2ee/KeyProvider.d.ts.map +1 -1
- package/dist/src/e2ee/constants.d.ts +0 -1
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +0 -1
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +2 -4
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts +3 -14
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/proto/google/protobuf/timestamp.d.ts +146 -0
- package/dist/src/proto/google/protobuf/timestamp.d.ts.map +1 -0
- package/dist/src/proto/livekit_models.d.ts +2399 -0
- package/dist/src/proto/livekit_models.d.ts.map +1 -0
- package/dist/src/proto/livekit_rtc.d.ts +14352 -0
- package/dist/src/proto/livekit_rtc.d.ts.map +1 -0
- package/dist/src/room/PCTransport.d.ts +1 -2
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +5 -9
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/RegionUrlProvider.d.ts +1 -4
- package/dist/src/room/RegionUrlProvider.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +11 -15
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +2 -2
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +3 -5
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +3 -2
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/timers.d.ts +4 -5
- package/dist/src/room/timers.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrackPublication.d.ts +1 -1
- package/dist/src/room/track/LocalTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +2 -2
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +4 -6
- package/dist/src/room/track/Track.d.ts.map +1 -1
- package/dist/src/room/track/TrackPublication.d.ts +5 -7
- package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/create.d.ts.map +1 -1
- package/dist/src/room/track/options.d.ts +0 -7
- package/dist/src/room/track/options.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +1 -5
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +1 -3
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/mocks.d.ts +4 -4
- package/dist/src/test/mocks.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -2
- package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +2 -3
- package/dist/ts4.2/src/connectionHelper/checks/Checker.d.ts +2 -3
- package/dist/ts4.2/src/e2ee/E2eeManager.d.ts +2 -4
- package/dist/ts4.2/src/e2ee/KeyProvider.d.ts +2 -4
- package/dist/ts4.2/src/e2ee/constants.d.ts +0 -1
- package/dist/ts4.2/src/e2ee/types.d.ts +0 -1
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +2 -4
- package/dist/ts4.2/src/e2ee/worker/ParticipantKeyHandler.d.ts +3 -14
- package/dist/ts4.2/src/index.d.ts +1 -1
- package/dist/ts4.2/src/proto/google/protobuf/timestamp.d.ts +150 -0
- package/dist/ts4.2/src/proto/livekit_models.d.ts +2659 -0
- package/dist/ts4.2/src/proto/livekit_rtc.d.ts +15764 -0
- package/dist/ts4.2/src/room/PCTransport.d.ts +1 -2
- package/dist/ts4.2/src/room/RTCEngine.d.ts +5 -9
- package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +1 -4
- package/dist/ts4.2/src/room/Room.d.ts +11 -15
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +2 -2
- package/dist/ts4.2/src/room/participant/Participant.d.ts +3 -5
- package/dist/ts4.2/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +3 -2
- package/dist/ts4.2/src/room/timers.d.ts +4 -5
- package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +1 -1
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +2 -2
- package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
- package/dist/ts4.2/src/room/track/Track.d.ts +4 -6
- package/dist/ts4.2/src/room/track/TrackPublication.d.ts +5 -7
- package/dist/ts4.2/src/room/track/options.d.ts +0 -7
- package/dist/ts4.2/src/room/track/utils.d.ts +1 -5
- package/dist/ts4.2/src/room/utils.d.ts +1 -3
- package/dist/ts4.2/src/test/mocks.d.ts +4 -4
- package/package.json +11 -11
- package/src/api/SignalClient.ts +101 -104
- package/src/connectionHelper/ConnectionCheck.ts +2 -3
- package/src/connectionHelper/checks/Checker.ts +3 -3
- package/src/connectionHelper/checks/webrtc.ts +2 -66
- package/src/connectionHelper/checks/websocket.ts +0 -4
- package/src/e2ee/E2eeManager.ts +3 -4
- package/src/e2ee/KeyProvider.ts +2 -3
- package/src/e2ee/constants.ts +0 -4
- package/src/e2ee/types.ts +0 -1
- package/src/e2ee/worker/FrameCryptor.test.ts +3 -1
- package/src/e2ee/worker/FrameCryptor.ts +5 -5
- package/src/e2ee/worker/ParticipantKeyHandler.ts +6 -37
- package/src/e2ee/worker/e2ee.worker.ts +1 -1
- package/src/index.ts +1 -1
- package/src/proto/google/protobuf/timestamp.ts +230 -0
- package/src/proto/livekit_models.ts +4006 -0
- package/src/proto/livekit_rtc.ts +4672 -0
- package/src/room/PCTransport.ts +1 -1
- package/src/room/RTCEngine.ts +18 -24
- package/src/room/RegionUrlProvider.ts +2 -11
- package/src/room/Room.test.ts +0 -1
- package/src/room/Room.ts +79 -158
- package/src/room/participant/LocalParticipant.ts +59 -43
- package/src/room/participant/Participant.ts +4 -6
- package/src/room/participant/ParticipantTrackPermission.ts +3 -3
- package/src/room/participant/RemoteParticipant.ts +6 -5
- package/src/room/participant/publishUtils.test.ts +0 -1
- package/src/room/track/LocalTrackPublication.ts +1 -1
- package/src/room/track/LocalVideoTrack.test.ts +1 -2
- package/src/room/track/LocalVideoTrack.ts +22 -22
- package/src/room/track/RemoteTrackPublication.ts +7 -12
- package/src/room/track/RemoteVideoTrack.test.ts +4 -5
- package/src/room/track/Track.ts +6 -9
- package/src/room/track/TrackPublication.ts +5 -7
- package/src/room/track/create.ts +17 -9
- package/src/room/track/facingMode.test.ts +0 -1
- package/src/room/track/options.ts +0 -6
- package/src/room/track/utils.test.ts +0 -1
- package/src/room/track/utils.ts +2 -44
- package/src/room/utils.ts +4 -20
- package/src/test/mocks.ts +5 -7
- package/src/utils/AsyncQueue.test.ts +0 -1
- package/src/utils/browserParser.test.ts +3 -33
- package/src/utils/browserParser.ts +1 -1
- package/dist/src/proto/livekit_models_pb.d.ts +0 -1264
- package/dist/src/proto/livekit_models_pb.d.ts.map +0 -1
- package/dist/src/proto/livekit_rtc_pb.d.ts +0 -1373
- package/dist/src/proto/livekit_rtc_pb.d.ts.map +0 -1
- package/dist/ts4.2/src/proto/livekit_models_pb.d.ts +0 -1264
- package/dist/ts4.2/src/proto/livekit_rtc_pb.d.ts +0 -1373
- package/src/proto/livekit_models_pb.ts +0 -2096
- package/src/proto/livekit_rtc_pb.ts +0 -2332
- package/src/room/utils.test.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/room/track/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,gBAAgB,CAAC;QAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,GAAG,KAAK,CAAC;IAE3E;;OAEG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC;IAEpC;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IAC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KAAK,EAAE,WAEnB,CAAC;IACK,MAAM,WAAW,EAAE,WAEzB,CAAC;IACK,MAAM,gBAAgB,EAAE,WAE9B,CAAC;IACK,MAAM,sBAAsB,EAAE,WAEpC,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;CAUjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Track } from './Track';
|
|
2
|
-
import type { AudioCaptureOptions, CreateLocalTracksOptions,
|
|
2
|
+
import type { AudioCaptureOptions, CreateLocalTracksOptions, VideoCaptureOptions } from './options';
|
|
3
3
|
import type { AudioTrack } from './types';
|
|
4
4
|
export declare function mergeDefaultOptions(options?: CreateLocalTracksOptions, audioDefaults?: AudioCaptureOptions, videoDefaults?: VideoCaptureOptions): CreateLocalTracksOptions;
|
|
5
5
|
export declare function constraintsForOptions(options: CreateLocalTracksOptions): MediaStreamConstraints;
|
|
@@ -20,8 +20,4 @@ export declare function kindToSource(kind: MediaDeviceKind): Track.Source.Camera
|
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
22
|
export declare function sourceToKind(source: Track.Source): MediaDeviceKind | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export declare function screenCaptureToDisplayMediaStreamOptions(options: ScreenShareCaptureOptions): DisplayMediaStreamOptions;
|
|
27
23
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/room/track/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/room/track/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACpG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,wBAAwB,EAClC,aAAa,CAAC,EAAE,mBAAmB,EACnC,aAAa,CAAC,EAAE,mBAAmB,GAClC,wBAAwB,CAqB1B;AAYD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,wBAAwB,GAAG,sBAAsB,CAqC/F;AACD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,SAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBzF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,GAAG,IAAI,CAOxD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,wEAQjD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,eAAe,GAAG,SAAS,CAQ9E"}
|
package/dist/src/room/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientInfo } from '../proto/
|
|
1
|
+
import { ClientInfo } from '../proto/livekit_models';
|
|
2
2
|
import type LocalAudioTrack from './track/LocalAudioTrack';
|
|
3
3
|
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
|
4
4
|
import { VideoCodec } from './track/options';
|
|
@@ -87,6 +87,4 @@ export declare class Mutex {
|
|
|
87
87
|
}
|
|
88
88
|
export declare function isVideoCodec(maybeCodec: string): maybeCodec is VideoCodec;
|
|
89
89
|
export declare function unwrapConstraint(constraint: ConstrainDOMString): string;
|
|
90
|
-
export declare function toWebsocketUrl(url: string): string;
|
|
91
|
-
export declare function toHttpUrl(url: string): string;
|
|
92
90
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/room/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/room/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,yBAAyB,CAAC;AAIrE,OAAO,KAAK,eAAe,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAK1D,eAAO,MAAM,cAAc,4FACgE,CAAC;AAE5F,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAMvD;AAED,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,YAElC;AAED,gBAAgB;AAChB,wBAAgB,gBAAgB,YAE/B;AAED,wBAAgB,sBAAsB,YAErC;AAED,wBAAgB,gBAAgB,YAE/B;AAED,wBAAgB,WAAW,IAAI,OAAO,CAerC;AAED,wBAAgB,WAAW,IAAI,OAAO,CAiBrC;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAQjE;AAQD,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAiBnF;AAED,wBAAgB,kBAAkB,YAEjC;AAED,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB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,SAAS,CAAC,EAAE,MAAM,IAAI;CAWzB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,GAAG,gBAAgB,EACzC,OAAO,CAAC,EAAE,oBAAoB;;;;EA+C/B;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAgB;IAEhC,OAAO,CAAC,MAAM,CAAS;;IAOvB,QAAQ;IAIR,IAAI,kBAGoB,IAAI;CAgB7B;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,IAAI,UAAU,CAEzE;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAqBvE"}
|
package/dist/src/test/mocks.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="jest" />
|
|
2
2
|
import { SignalClient } from '../api/SignalClient';
|
|
3
3
|
import RTCEngine from '../room/RTCEngine';
|
|
4
4
|
declare const mocks: {
|
|
5
|
-
SignalClient: MockedClass<typeof SignalClient>;
|
|
6
|
-
RTCEngine: MockedClass<typeof RTCEngine>;
|
|
5
|
+
SignalClient: jest.MockedClass<typeof SignalClient>;
|
|
6
|
+
RTCEngine: jest.MockedClass<typeof RTCEngine>;
|
|
7
7
|
MockLocalVideoTrack: {
|
|
8
|
-
stop:
|
|
8
|
+
stop: jest.Mock<any, any, any>;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export default mocks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../../src/test/mocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../../src/test/mocks.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAO1C,QAAA,MAAM,KAAK;;;;;;CAMV,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ParticipantInfo, ReconnectReason, Room, SpeakerInfo, VideoLayer } from '../proto/
|
|
2
|
-
import { AddTrackRequest, ConnectionQualityUpdate, JoinResponse, LeaveRequest, ReconnectResponse, SessionDescription, SignalRequest, SignalTarget, SimulateScenario, StreamStateUpdate, SubscribedQualityUpdate, SubscriptionPermissionUpdate, SubscriptionResponse, SyncState, TrackPermission, TrackPublishedResponse, TrackUnpublishedResponse, UpdateSubscription, UpdateTrackSettings } from '../proto/
|
|
1
|
+
import { ParticipantInfo, ReconnectReason, Room, SpeakerInfo, VideoLayer } from '../proto/livekit_models';
|
|
2
|
+
import { AddTrackRequest, ConnectionQualityUpdate, JoinResponse, LeaveRequest, ReconnectResponse, SessionDescription, SignalRequest, SignalTarget, SimulateScenario, StreamStateUpdate, SubscribedQualityUpdate, SubscriptionPermissionUpdate, SubscriptionResponse, SyncState, TrackPermission, TrackPublishedResponse, TrackUnpublishedResponse, UpdateSubscription, UpdateTrackSettings } from '../proto/livekit_rtc';
|
|
3
3
|
import { AsyncQueue } from '../utils/AsyncQueue';
|
|
4
4
|
interface ConnectOpts {
|
|
5
5
|
autoSubscribe: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import { CheckStatus, Checker } from './checks/Checker';
|
|
3
3
|
import type { CheckInfo, InstantiableCheck } from './checks/Checker';
|
|
4
4
|
export type { CheckInfo, CheckStatus };
|
|
5
|
-
declare
|
|
6
|
-
export declare class ConnectionCheck extends ConnectionCheck_base {
|
|
5
|
+
export declare class ConnectionCheck extends EventEmitter<ConnectionCheckCallbacks> {
|
|
7
6
|
token: string;
|
|
8
7
|
url: string;
|
|
9
8
|
private checkResults;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import type { RoomConnectOptions, RoomOptions } from '../../options';
|
|
3
3
|
import type RTCEngine from '../../room/RTCEngine';
|
|
4
4
|
import Room from '../../room/Room';
|
|
@@ -24,8 +24,7 @@ export interface CheckerOptions {
|
|
|
24
24
|
roomOptions?: RoomOptions;
|
|
25
25
|
connectOptions?: RoomConnectOptions;
|
|
26
26
|
}
|
|
27
|
-
declare
|
|
28
|
-
export declare abstract class Checker extends Checker_base {
|
|
27
|
+
export declare abstract class Checker extends EventEmitter<CheckerCallbacks> {
|
|
29
28
|
protected url: string;
|
|
30
29
|
protected token: string;
|
|
31
30
|
room: Room;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import type RTCEngine from '../room/RTCEngine';
|
|
3
3
|
import type Room from '../room/Room';
|
|
4
4
|
import type { E2EEManagerCallbacks, E2EEOptions } from './types';
|
|
5
|
-
declare const E2EEManager_base: new () => TypedEventEmitter<E2EEManagerCallbacks>;
|
|
6
5
|
/**
|
|
7
6
|
* @experimental
|
|
8
7
|
*/
|
|
9
|
-
export declare class E2EEManager extends
|
|
8
|
+
export declare class E2EEManager extends EventEmitter<E2EEManagerCallbacks> {
|
|
10
9
|
protected worker: Worker;
|
|
11
10
|
protected room?: Room;
|
|
12
11
|
private encryptionEnabled;
|
|
@@ -43,5 +42,4 @@ export declare class E2EEManager extends E2EEManager_base {
|
|
|
43
42
|
*/
|
|
44
43
|
private handleSender;
|
|
45
44
|
}
|
|
46
|
-
export {};
|
|
47
45
|
//# sourceMappingURL=E2eeManager.d.ts.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import type { KeyInfo, KeyProviderCallbacks, KeyProviderOptions } from './types';
|
|
3
|
-
declare const BaseKeyProvider_base: new () => TypedEventEmitter<KeyProviderCallbacks>;
|
|
4
3
|
/**
|
|
5
4
|
* @experimental
|
|
6
5
|
*/
|
|
7
|
-
export declare class BaseKeyProvider extends
|
|
6
|
+
export declare class BaseKeyProvider extends EventEmitter<KeyProviderCallbacks> {
|
|
8
7
|
private keyInfoMap;
|
|
9
8
|
private options;
|
|
10
9
|
constructor(options?: Partial<KeyProviderOptions>);
|
|
@@ -40,5 +39,4 @@ export declare class ExternalE2EEKeyProvider extends BaseKeyProvider {
|
|
|
40
39
|
*/
|
|
41
40
|
setKey(key: string): Promise<void>;
|
|
42
41
|
}
|
|
43
|
-
export {};
|
|
44
42
|
//# sourceMappingURL=KeyProvider.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { KeyProviderOptions } from './types';
|
|
2
2
|
export declare const ENCRYPTION_ALGORITHM = "AES-GCM";
|
|
3
3
|
export declare const KEYRING_SIZE = 16;
|
|
4
|
-
export declare const DECRYPTION_FAILURE_TOLERANCE = 10;
|
|
5
4
|
export declare const UNENCRYPTED_BYTES: {
|
|
6
5
|
readonly key: 10;
|
|
7
6
|
readonly delta: 3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import type { VideoCodec } from '../../room/track/options';
|
|
3
3
|
import { CryptorCallbacks, DecodeRatchetOptions, KeyProviderOptions, KeySet } from '../types';
|
|
4
4
|
import type { ParticipantKeyHandler } from './ParticipantKeyHandler';
|
|
@@ -11,8 +11,7 @@ export interface TransformerInfo {
|
|
|
11
11
|
transformer: TransformStream;
|
|
12
12
|
abortController: AbortController;
|
|
13
13
|
}
|
|
14
|
-
declare
|
|
15
|
-
export declare class BaseFrameCryptor extends BaseFrameCryptor_base {
|
|
14
|
+
export declare class BaseFrameCryptor extends EventEmitter<CryptorCallbacks> {
|
|
16
15
|
encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
|
17
16
|
decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
|
18
17
|
}
|
|
@@ -172,5 +171,4 @@ export declare enum NALUType {
|
|
|
172
171
|
* @internal
|
|
173
172
|
*/
|
|
174
173
|
export declare function isFrameServerInjected(frameData: ArrayBuffer, trailerBytes: Uint8Array): boolean;
|
|
175
|
-
export {};
|
|
176
174
|
//# sourceMappingURL=FrameCryptor.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import type { KeyProviderOptions, KeySet, ParticipantKeyHandlerCallbacks } from '../types';
|
|
3
|
-
declare const ParticipantKeyHandler_base: new () => TypedEventEmitter<ParticipantKeyHandlerCallbacks>;
|
|
4
3
|
/**
|
|
5
4
|
* ParticipantKeyHandler is responsible for providing a cryptor instance with the
|
|
6
5
|
* en-/decryption key of a participant. It assumes that all tracks of a specific participant
|
|
@@ -9,25 +8,16 @@ declare const ParticipantKeyHandler_base: new () => TypedEventEmitter<Participan
|
|
|
9
8
|
* if decryption fails or can be triggered manually on both sender and receiver side.
|
|
10
9
|
*
|
|
11
10
|
*/
|
|
12
|
-
export declare class ParticipantKeyHandler extends
|
|
11
|
+
export declare class ParticipantKeyHandler extends EventEmitter<ParticipantKeyHandlerCallbacks> {
|
|
13
12
|
private currentKeyIndex;
|
|
14
13
|
private cryptoKeyRing;
|
|
15
14
|
private enabled;
|
|
16
15
|
private keyProviderOptions;
|
|
17
16
|
private ratchetPromiseMap;
|
|
18
17
|
private participantId;
|
|
19
|
-
|
|
20
|
-
private _hasValidKey;
|
|
21
|
-
get hasValidKey(): boolean;
|
|
18
|
+
hasValidKey: boolean;
|
|
22
19
|
constructor(participantId: string | undefined, isEnabled: boolean, keyProviderOptions: KeyProviderOptions);
|
|
23
20
|
setEnabled(enabled: boolean): void;
|
|
24
|
-
decryptionFailure(): void;
|
|
25
|
-
decryptionSuccess(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Call this after user initiated ratchet or a new key has been set in order to make sure to mark potentially
|
|
28
|
-
* invalid keys as valid again
|
|
29
|
-
*/
|
|
30
|
-
resetKeyStatus(): void;
|
|
31
21
|
/**
|
|
32
22
|
* Ratchets the current key (or the one at keyIndex if provided) and
|
|
33
23
|
* returns the ratcheted material
|
|
@@ -61,5 +51,4 @@ export declare class ParticipantKeyHandler extends ParticipantKeyHandler_base {
|
|
|
61
51
|
*/
|
|
62
52
|
getKeySet(keyIndex?: number): KeySet;
|
|
63
53
|
}
|
|
64
|
-
export {};
|
|
65
54
|
//# sourceMappingURL=ParticipantKeyHandler.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel, setLogExtension, setLogLevel } from './logger';
|
|
2
|
-
import { DataPacket_Kind, DisconnectReason, VideoQuality } from './proto/
|
|
2
|
+
import { DataPacket_Kind, DisconnectReason, VideoQuality } from './proto/livekit_models';
|
|
3
3
|
import DefaultReconnectPolicy from './room/DefaultReconnectPolicy';
|
|
4
4
|
import Room, { ConnectionState, RoomState } from './room/Room';
|
|
5
5
|
import LocalParticipant from './room/participant/LocalParticipant';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
5
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
6
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
7
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
8
|
+
* Gregorian calendar backwards to year one.
|
|
9
|
+
*
|
|
10
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
11
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
12
|
+
* smear](https://developers.google.com/time/smear).
|
|
13
|
+
*
|
|
14
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
15
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
16
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
17
|
+
*
|
|
18
|
+
* # Examples
|
|
19
|
+
*
|
|
20
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
21
|
+
*
|
|
22
|
+
* Timestamp timestamp;
|
|
23
|
+
* timestamp.set_seconds(time(NULL));
|
|
24
|
+
* timestamp.set_nanos(0);
|
|
25
|
+
*
|
|
26
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
27
|
+
*
|
|
28
|
+
* struct timeval tv;
|
|
29
|
+
* gettimeofday(&tv, NULL);
|
|
30
|
+
*
|
|
31
|
+
* Timestamp timestamp;
|
|
32
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
33
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
34
|
+
*
|
|
35
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
36
|
+
*
|
|
37
|
+
* FILETIME ft;
|
|
38
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
39
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
40
|
+
*
|
|
41
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
42
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
43
|
+
* Timestamp timestamp;
|
|
44
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
45
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
46
|
+
*
|
|
47
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
48
|
+
*
|
|
49
|
+
* long millis = System.currentTimeMillis();
|
|
50
|
+
*
|
|
51
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
52
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
53
|
+
*
|
|
54
|
+
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
55
|
+
*
|
|
56
|
+
* Instant now = Instant.now();
|
|
57
|
+
*
|
|
58
|
+
* Timestamp timestamp =
|
|
59
|
+
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
60
|
+
* .setNanos(now.getNano()).build();
|
|
61
|
+
*
|
|
62
|
+
* Example 6: Compute Timestamp from current time in Python.
|
|
63
|
+
*
|
|
64
|
+
* timestamp = Timestamp()
|
|
65
|
+
* timestamp.GetCurrentTime()
|
|
66
|
+
*
|
|
67
|
+
* # JSON Mapping
|
|
68
|
+
*
|
|
69
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
70
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
71
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
72
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
73
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
74
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
75
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
76
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
77
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
78
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
79
|
+
*
|
|
80
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
81
|
+
* 01:30 UTC on January 15, 2017.
|
|
82
|
+
*
|
|
83
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
84
|
+
* standard
|
|
85
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
86
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
87
|
+
* to this format using
|
|
88
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
89
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
90
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
91
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
92
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
93
|
+
*/
|
|
94
|
+
export interface Timestamp {
|
|
95
|
+
/**
|
|
96
|
+
* Represents seconds of UTC time since Unix epoch
|
|
97
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
98
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
99
|
+
*/
|
|
100
|
+
seconds: number;
|
|
101
|
+
/**
|
|
102
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
103
|
+
* second values with fractions must still have non-negative nanos values
|
|
104
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
105
|
+
* inclusive.
|
|
106
|
+
*/
|
|
107
|
+
nanos: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const Timestamp: {
|
|
110
|
+
encode(message: Timestamp, writer?: _m0.Writer): _m0.Writer;
|
|
111
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp;
|
|
112
|
+
fromJSON(object: any): Timestamp;
|
|
113
|
+
toJSON(message: Timestamp): unknown;
|
|
114
|
+
create<I extends {
|
|
115
|
+
seconds?: number | undefined;
|
|
116
|
+
nanos?: number | undefined;
|
|
117
|
+
} & {
|
|
118
|
+
seconds?: number | undefined;
|
|
119
|
+
nanos?: number | undefined;
|
|
120
|
+
} & {
|
|
121
|
+
[K in Exclude<keyof I, keyof Timestamp>]: never;
|
|
122
|
+
}>(base?: I | undefined): Timestamp;
|
|
123
|
+
fromPartial<I_1 extends {
|
|
124
|
+
seconds?: number | undefined;
|
|
125
|
+
nanos?: number | undefined;
|
|
126
|
+
} & {
|
|
127
|
+
seconds?: number | undefined;
|
|
128
|
+
nanos?: number | undefined;
|
|
129
|
+
} & {
|
|
130
|
+
[K_1 in Exclude<keyof I_1, keyof Timestamp>]: never;
|
|
131
|
+
}>(object: I_1): Timestamp;
|
|
132
|
+
};
|
|
133
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
134
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
135
|
+
$case: string;
|
|
136
|
+
} ? {
|
|
137
|
+
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
138
|
+
} & {
|
|
139
|
+
$case: T["$case"];
|
|
140
|
+
} : T extends {} ? {
|
|
141
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
142
|
+
} : Partial<T>;
|
|
143
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
144
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
145
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
146
|
+
} & {
|
|
147
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
148
|
+
};
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=timestamp.d.ts.map
|