livekit-server-sdk 1.0.1 → 1.0.3
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/.eslintrc.js +1 -1
- package/README.md +2 -0
- package/dist/EgressClient.d.ts +50 -12
- package/dist/EgressClient.js +39 -22
- package/dist/EgressClient.js.map +1 -1
- package/dist/RoomServiceClient.d.ts +8 -2
- package/dist/RoomServiceClient.js +3 -1
- package/dist/RoomServiceClient.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/proto/livekit_egress.d.ts +250 -7
- package/dist/proto/livekit_egress.js +251 -18
- package/dist/proto/livekit_egress.js.map +1 -1
- package/dist/proto/livekit_ingress.d.ts +1803 -0
- package/dist/proto/livekit_ingress.js +1095 -0
- package/dist/proto/livekit_ingress.js.map +1 -0
- package/dist/proto/livekit_models.d.ts +84 -0
- package/dist/proto/livekit_models.js +340 -37
- package/dist/proto/livekit_models.js.map +1 -1
- package/dist/proto/livekit_room.d.ts +818 -0
- package/dist/proto/livekit_room.js +94 -4
- package/dist/proto/livekit_room.js.map +1 -1
- package/dist/proto/livekit_webhook.d.ts +548 -58
- package/dist/proto/livekit_webhook.js +15 -19
- package/dist/proto/livekit_webhook.js.map +1 -1
- package/package.json +2 -2
- package/dist/RecordingServiceClient.d.ts +0 -25
- package/dist/RecordingServiceClient.js +0 -91
- package/dist/RecordingServiceClient.js.map +0 -1
- package/dist/proto/livekit_recording.d.ts +0 -361
- package/dist/proto/livekit_recording.js +0 -843
- package/dist/proto/livekit_recording.js.map +0 -1
package/.eslintrc.js
CHANGED
package/README.md
CHANGED
|
@@ -114,6 +114,8 @@ svc.deleteRoom('myroom').then(() => {
|
|
|
114
114
|
|
|
115
115
|
The JS SDK also provides helper functions to decode and verify webhook callbacks. While verification is optional, it ensures the authenticity of the message. See [webhooks guide](https://docs.livekit.io/guides/webhooks) for details.
|
|
116
116
|
|
|
117
|
+
Check out [example projects](examples) for full examples of webhooks integration.
|
|
118
|
+
|
|
117
119
|
```typescript
|
|
118
120
|
import { WebhookReceiver } from 'livekit-server-sdk';
|
|
119
121
|
|
package/dist/EgressClient.d.ts
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
import { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodingOptions, EncodingOptionsPreset, StreamOutput } from './proto/livekit_egress';
|
|
1
|
+
import { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodingOptions, EncodingOptionsPreset, SegmentedFileOutput, StreamOutput } from './proto/livekit_egress';
|
|
2
|
+
export interface RoomCompositeOptions {
|
|
3
|
+
/**
|
|
4
|
+
* egress layout. optional
|
|
5
|
+
*/
|
|
6
|
+
layout?: string;
|
|
7
|
+
/**
|
|
8
|
+
* encoding options or preset. optional
|
|
9
|
+
*/
|
|
10
|
+
encodingOptions?: EncodingOptionsPreset | EncodingOptions;
|
|
11
|
+
/**
|
|
12
|
+
* record audio only. optional
|
|
13
|
+
*/
|
|
14
|
+
audioOnly?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* record video only. optional
|
|
17
|
+
*/
|
|
18
|
+
videoOnly?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* custom template url. optional
|
|
21
|
+
*/
|
|
22
|
+
customBaseUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TrackCompositeOptions {
|
|
25
|
+
/**
|
|
26
|
+
* audio track ID
|
|
27
|
+
*/
|
|
28
|
+
audioTrackId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* video track ID
|
|
31
|
+
*/
|
|
32
|
+
videoTrackId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* encoding options or preset. optional
|
|
35
|
+
*/
|
|
36
|
+
encodingOptions?: EncodingOptionsPreset | EncodingOptions;
|
|
37
|
+
}
|
|
2
38
|
/**
|
|
3
39
|
* Client to access Egress APIs
|
|
4
40
|
*/
|
|
5
|
-
export
|
|
41
|
+
export declare class EgressClient {
|
|
6
42
|
private readonly rpc;
|
|
7
43
|
private readonly apiKey?;
|
|
8
44
|
private readonly secret?;
|
|
@@ -15,21 +51,23 @@ export default class EgressClient {
|
|
|
15
51
|
/**
|
|
16
52
|
* @param roomName room name
|
|
17
53
|
* @param output file or stream output
|
|
18
|
-
* @param
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* @
|
|
54
|
+
* @param opts RoomCompositeOptions
|
|
55
|
+
*/
|
|
56
|
+
startRoomCompositeEgress(roomName: string, output: EncodedFileOutput | SegmentedFileOutput | StreamOutput, opts?: RoomCompositeOptions): Promise<EgressInfo>;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated use RoomCompositeOptions instead
|
|
23
59
|
*/
|
|
24
|
-
startRoomCompositeEgress(roomName: string, output: EncodedFileOutput | StreamOutput, layout?: string, options?: EncodingOptionsPreset | EncodingOptions, audioOnly?: boolean, videoOnly?: boolean, customBaseUrl?: string): Promise<EgressInfo>;
|
|
60
|
+
startRoomCompositeEgress(roomName: string, output: EncodedFileOutput | SegmentedFileOutput | StreamOutput, layout?: string, options?: EncodingOptionsPreset | EncodingOptions, audioOnly?: boolean, videoOnly?: boolean, customBaseUrl?: string): Promise<EgressInfo>;
|
|
25
61
|
/**
|
|
26
62
|
* @param roomName room name
|
|
27
63
|
* @param output file or stream output
|
|
28
|
-
* @param
|
|
29
|
-
|
|
30
|
-
|
|
64
|
+
* @param opts TrackCompositeOptions
|
|
65
|
+
*/
|
|
66
|
+
startTrackCompositeEgress(roomName: string, output: EncodedFileOutput | SegmentedFileOutput | StreamOutput, opts?: TrackCompositeOptions): Promise<EgressInfo>;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated use TrackCompositeOptions instead
|
|
31
69
|
*/
|
|
32
|
-
startTrackCompositeEgress(roomName: string, output: EncodedFileOutput | StreamOutput, audioTrackId?: string, videoTrackId?: string, options?: EncodingOptionsPreset | EncodingOptions): Promise<EgressInfo>;
|
|
70
|
+
startTrackCompositeEgress(roomName: string, output: EncodedFileOutput | SegmentedFileOutput | StreamOutput, audioTrackId?: string, videoTrackId?: string, options?: EncodingOptionsPreset | EncodingOptions): Promise<EgressInfo>;
|
|
33
71
|
private getOutputParams;
|
|
34
72
|
/**
|
|
35
73
|
* @param roomName room name
|
package/dist/EgressClient.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EgressClient = void 0;
|
|
12
13
|
const AccessToken_1 = require("./AccessToken");
|
|
13
14
|
const livekit_egress_1 = require("./proto/livekit_egress");
|
|
14
15
|
const TwirpRPC_1 = require("./TwirpRPC");
|
|
@@ -27,22 +28,27 @@ class EgressClient {
|
|
|
27
28
|
this.apiKey = apiKey;
|
|
28
29
|
this.secret = secret;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
* @param roomName room name
|
|
32
|
-
* @param output file or stream output
|
|
33
|
-
* @param layout egress layout
|
|
34
|
-
* @param options encoding options or preset
|
|
35
|
-
* @param audioOnly record audio only
|
|
36
|
-
* @param videoOnly record video only
|
|
37
|
-
* @param customBaseUrl custom template url
|
|
38
|
-
*/
|
|
39
|
-
startRoomCompositeEgress(roomName, output, layout, options, audioOnly, videoOnly, customBaseUrl) {
|
|
31
|
+
startRoomCompositeEgress(roomName, output, optsOrLayout, options, audioOnly, videoOnly, customBaseUrl) {
|
|
40
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
let layout;
|
|
34
|
+
if (optsOrLayout !== undefined) {
|
|
35
|
+
if (typeof optsOrLayout === 'string') {
|
|
36
|
+
layout = optsOrLayout;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const opts = optsOrLayout;
|
|
40
|
+
layout = opts.layout;
|
|
41
|
+
options = opts.encodingOptions;
|
|
42
|
+
audioOnly = opts.audioOnly;
|
|
43
|
+
videoOnly = opts.videoOnly;
|
|
44
|
+
customBaseUrl = opts.customBaseUrl;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
41
47
|
layout !== null && layout !== void 0 ? layout : (layout = '');
|
|
42
48
|
audioOnly !== null && audioOnly !== void 0 ? audioOnly : (audioOnly = false);
|
|
43
49
|
videoOnly !== null && videoOnly !== void 0 ? videoOnly : (videoOnly = false);
|
|
44
50
|
customBaseUrl !== null && customBaseUrl !== void 0 ? customBaseUrl : (customBaseUrl = '');
|
|
45
|
-
const { file, stream, preset, advanced } = this.getOutputParams(output, options);
|
|
51
|
+
const { file, segments, stream, preset, advanced } = this.getOutputParams(output, options);
|
|
46
52
|
const req = livekit_egress_1.RoomCompositeEgressRequest.toJSON({
|
|
47
53
|
roomName,
|
|
48
54
|
layout,
|
|
@@ -51,6 +57,7 @@ class EgressClient {
|
|
|
51
57
|
customBaseUrl,
|
|
52
58
|
file,
|
|
53
59
|
stream,
|
|
60
|
+
segments,
|
|
54
61
|
preset,
|
|
55
62
|
advanced,
|
|
56
63
|
});
|
|
@@ -58,24 +65,30 @@ class EgressClient {
|
|
|
58
65
|
return livekit_egress_1.EgressInfo.fromJSON(data);
|
|
59
66
|
});
|
|
60
67
|
}
|
|
61
|
-
|
|
62
|
-
* @param roomName room name
|
|
63
|
-
* @param output file or stream output
|
|
64
|
-
* @param audioTrackId audio track Id
|
|
65
|
-
* @param videoTrackId video track Id
|
|
66
|
-
* @param options encoding options or preset
|
|
67
|
-
*/
|
|
68
|
-
startTrackCompositeEgress(roomName, output, audioTrackId, videoTrackId, options) {
|
|
68
|
+
startTrackCompositeEgress(roomName, output, optsOrAudioTrackId, videoTrackId, options) {
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
let audioTrackId;
|
|
71
|
+
if (optsOrAudioTrackId !== undefined) {
|
|
72
|
+
if (typeof optsOrAudioTrackId === 'string') {
|
|
73
|
+
audioTrackId = optsOrAudioTrackId;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const opts = optsOrAudioTrackId;
|
|
77
|
+
audioTrackId = opts.audioTrackId;
|
|
78
|
+
videoTrackId = opts.videoTrackId;
|
|
79
|
+
options = opts.encodingOptions;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
70
82
|
audioTrackId !== null && audioTrackId !== void 0 ? audioTrackId : (audioTrackId = '');
|
|
71
83
|
videoTrackId !== null && videoTrackId !== void 0 ? videoTrackId : (videoTrackId = '');
|
|
72
|
-
const { file, stream, preset, advanced } = this.getOutputParams(output, options);
|
|
84
|
+
const { file, segments, stream, preset, advanced } = this.getOutputParams(output, options);
|
|
73
85
|
const req = livekit_egress_1.TrackCompositeEgressRequest.toJSON({
|
|
74
86
|
roomName,
|
|
75
87
|
audioTrackId,
|
|
76
88
|
videoTrackId,
|
|
77
89
|
file,
|
|
78
90
|
stream,
|
|
91
|
+
segments,
|
|
79
92
|
preset,
|
|
80
93
|
advanced,
|
|
81
94
|
});
|
|
@@ -86,11 +99,15 @@ class EgressClient {
|
|
|
86
99
|
getOutputParams(output, options) {
|
|
87
100
|
let file;
|
|
88
101
|
let stream;
|
|
102
|
+
let segments;
|
|
89
103
|
let preset;
|
|
90
104
|
let advanced;
|
|
91
105
|
if (output.filepath !== undefined) {
|
|
92
106
|
file = output;
|
|
93
107
|
}
|
|
108
|
+
else if (output.filenamePrefix !== undefined) {
|
|
109
|
+
segments = output;
|
|
110
|
+
}
|
|
94
111
|
else {
|
|
95
112
|
stream = output;
|
|
96
113
|
}
|
|
@@ -102,7 +119,7 @@ class EgressClient {
|
|
|
102
119
|
advanced = options;
|
|
103
120
|
}
|
|
104
121
|
}
|
|
105
|
-
return { file, stream, preset, advanced };
|
|
122
|
+
return { file, segments, stream, preset, advanced };
|
|
106
123
|
}
|
|
107
124
|
/**
|
|
108
125
|
* @param roomName room name
|
|
@@ -179,5 +196,5 @@ class EgressClient {
|
|
|
179
196
|
};
|
|
180
197
|
}
|
|
181
198
|
}
|
|
182
|
-
exports.
|
|
199
|
+
exports.EgressClient = EgressClient;
|
|
183
200
|
//# sourceMappingURL=EgressClient.js.map
|
package/dist/EgressClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EgressClient.js","sourceRoot":"","sources":["../src/EgressClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EgressClient.js","sourceRoot":"","sources":["../src/EgressClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAE5C,2DAgBgC;AAChC,yCAA2D;AAE3D,MAAM,GAAG,GAAG,QAAQ,CAAC;AAwCrB;;GAEG;AACH,MAAa,YAAY;IAOvB;;;;OAIG;IACH,YAAY,IAAY,EAAE,MAAe,EAAE,MAAe;QACxD,IAAI,CAAC,GAAG,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,yBAAc,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAwBK,wBAAwB,CAC5B,QAAgB,EAChB,MAA8D,EAC9D,YAA4C,EAC5C,OAAiD,EACjD,SAAmB,EACnB,SAAmB,EACnB,aAAsB;;YAEtB,IAAI,MAA0B,CAAC;YAC/B,IAAI,YAAY,KAAK,SAAS,EAAE;gBAC9B,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;oBACpC,MAAM,GAAG,YAAY,CAAC;iBACvB;qBAAM;oBACL,MAAM,IAAI,GAAyB,YAAY,CAAC;oBAChD,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;oBACrB,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC;oBAC/B,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;oBAC3B,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;oBAC3B,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;iBACpC;aACF;YAED,MAAM,aAAN,MAAM,cAAN,MAAM,IAAN,MAAM,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C,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QACrE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO;YACL,aAAa,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAjSD,oCAiSC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DataPacket_Kind, ParticipantInfo, ParticipantPermission, Room, TrackInfo } from './proto/livekit_models';
|
|
2
|
+
import { RoomEgress } from './proto/livekit_room';
|
|
2
3
|
/**
|
|
3
4
|
* Options for when creating a room
|
|
4
5
|
*/
|
|
@@ -8,7 +9,7 @@ export interface CreateOptions {
|
|
|
8
9
|
*/
|
|
9
10
|
name: string;
|
|
10
11
|
/**
|
|
11
|
-
* number of seconds the room should
|
|
12
|
+
* number of seconds the room should clean up after being empty
|
|
12
13
|
*/
|
|
13
14
|
emptyTimeout?: number;
|
|
14
15
|
/**
|
|
@@ -19,6 +20,10 @@ export interface CreateOptions {
|
|
|
19
20
|
* override the node room is allocated to, for debugging
|
|
20
21
|
*/
|
|
21
22
|
nodeId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* add egress options
|
|
25
|
+
*/
|
|
26
|
+
egress?: RoomEgress;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
29
|
* Client to access Room APIs
|
|
@@ -89,8 +94,9 @@ export declare class RoomServiceClient {
|
|
|
89
94
|
* @param identity
|
|
90
95
|
* @param metadata optional, metadata to update
|
|
91
96
|
* @param permission optional, new permissions to assign to participant
|
|
97
|
+
* @param name optional, new name for participant
|
|
92
98
|
*/
|
|
93
|
-
updateParticipant(room: string, identity: string, metadata?: string, permission?: ParticipantPermission): Promise<ParticipantInfo>;
|
|
99
|
+
updateParticipant(room: string, identity: string, metadata?: string, permission?: ParticipantPermission, name?: string): Promise<ParticipantInfo>;
|
|
94
100
|
/**
|
|
95
101
|
* Updates a participant's subscription to tracks
|
|
96
102
|
* @param room
|
|
@@ -132,14 +132,16 @@ class RoomServiceClient {
|
|
|
132
132
|
* @param identity
|
|
133
133
|
* @param metadata optional, metadata to update
|
|
134
134
|
* @param permission optional, new permissions to assign to participant
|
|
135
|
+
* @param name optional, new name for participant
|
|
135
136
|
*/
|
|
136
|
-
updateParticipant(room, identity, metadata, permission) {
|
|
137
|
+
updateParticipant(room, identity, metadata, permission, name) {
|
|
137
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
139
|
const req = {
|
|
139
140
|
room,
|
|
140
141
|
identity,
|
|
141
142
|
metadata: metadata || '',
|
|
142
143
|
permission,
|
|
144
|
+
name: name || '',
|
|
143
145
|
};
|
|
144
146
|
const data = yield this.rpc.request(svc, 'UpdateParticipant', livekit_room_1.UpdateParticipantRequest.toJSON(req), this.authHeader({ roomAdmin: true, room }));
|
|
145
147
|
return livekit_models_1.ParticipantInfo.fromJSON(data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAE5C,2DAMgC;AAChC,
|
|
1
|
+
{"version":3,"file":"RoomServiceClient.js","sourceRoot":"","sources":["../src/RoomServiceClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAE5C,2DAMgC;AAChC,uDAe8B;AAC9B,yCAA2D;AAgC3D,MAAM,GAAG,GAAG,aAAa,CAAC;AAE1B;;GAEG;AACH,MAAa,iBAAiB;IAO5B;;;;;OAKG;IACH,YAAY,IAAY,EAAE,MAAe,EAAE,MAAe;QACxD,IAAI,CAAC,GAAG,GAAG,IAAI,mBAAQ,CAAC,IAAI,EAAE,yBAAc,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACG,UAAU,CAAC,OA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AiB,EAAE,EAAE;aACtB,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CACpB,GAAG,EACH,qBAAqB,EACrB,GAAG,EACH,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAC3C,CAAC;QACJ,CAAC;KAAA;IAED;;;;;;OAMG;IACG,QAAQ,CACZ,IAAY,EACZ,IAAgB,EAChB,IAAqB,EACrB,kBAA4B,EAAE;;YAE9B,MAAM,GAAG,GAAG,8BAAe,CAAC,MAAM,CAAC;gBACjC,IAAI;gBACJ,IAAI;gBACJ,IAAI;gBACJ,eAAe;aAChB,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3F,CAAC;KAAA;IAEO,UAAU,CAAC,KAAiB;QAClC,MAAM,EAAE,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QACrE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO;YACL,aAAa,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAjPD,8CAiPC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './AccessToken';
|
|
2
|
-
export
|
|
2
|
+
export * from './EgressClient';
|
|
3
3
|
export * from './grants';
|
|
4
|
-
export { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodingOptions, EncodingOptionsPreset, StreamOutput, } from './proto/livekit_egress';
|
|
4
|
+
export { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, } from './proto/livekit_egress';
|
|
5
5
|
export { DataPacket_Kind, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, TrackInfo, TrackType, } from './proto/livekit_models';
|
|
6
|
-
export { default as RecordingServiceClient } from './RecordingServiceClient';
|
|
7
6
|
export * from './RoomServiceClient';
|
|
8
7
|
export * from './WebhookReceiver';
|
package/dist/index.js
CHANGED
|
@@ -9,22 +9,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
-
};
|
|
15
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
13
|
+
exports.TrackType = exports.TrackInfo = exports.Room = exports.ParticipantPermission = exports.ParticipantInfo_State = exports.ParticipantInfo = exports.DataPacket_Kind = exports.StreamProtocol = exports.StreamOutput = exports.SegmentedFileProtocol = exports.SegmentedFileOutput = exports.EncodingOptionsPreset = exports.EncodingOptions = exports.EncodedFileType = exports.EncodedFileOutput = exports.EgressInfo = exports.DirectFileOutput = void 0;
|
|
17
14
|
__exportStar(require("./AccessToken"), exports);
|
|
18
|
-
|
|
19
|
-
Object.defineProperty(exports, "EgressClient", { enumerable: true, get: function () { return __importDefault(EgressClient_1).default; } });
|
|
15
|
+
__exportStar(require("./EgressClient"), exports);
|
|
20
16
|
__exportStar(require("./grants"), exports);
|
|
21
17
|
var livekit_egress_1 = require("./proto/livekit_egress");
|
|
22
18
|
Object.defineProperty(exports, "DirectFileOutput", { enumerable: true, get: function () { return livekit_egress_1.DirectFileOutput; } });
|
|
23
19
|
Object.defineProperty(exports, "EgressInfo", { enumerable: true, get: function () { return livekit_egress_1.EgressInfo; } });
|
|
24
20
|
Object.defineProperty(exports, "EncodedFileOutput", { enumerable: true, get: function () { return livekit_egress_1.EncodedFileOutput; } });
|
|
21
|
+
Object.defineProperty(exports, "EncodedFileType", { enumerable: true, get: function () { return livekit_egress_1.EncodedFileType; } });
|
|
25
22
|
Object.defineProperty(exports, "EncodingOptions", { enumerable: true, get: function () { return livekit_egress_1.EncodingOptions; } });
|
|
26
23
|
Object.defineProperty(exports, "EncodingOptionsPreset", { enumerable: true, get: function () { return livekit_egress_1.EncodingOptionsPreset; } });
|
|
24
|
+
Object.defineProperty(exports, "SegmentedFileOutput", { enumerable: true, get: function () { return livekit_egress_1.SegmentedFileOutput; } });
|
|
25
|
+
Object.defineProperty(exports, "SegmentedFileProtocol", { enumerable: true, get: function () { return livekit_egress_1.SegmentedFileProtocol; } });
|
|
27
26
|
Object.defineProperty(exports, "StreamOutput", { enumerable: true, get: function () { return livekit_egress_1.StreamOutput; } });
|
|
27
|
+
Object.defineProperty(exports, "StreamProtocol", { enumerable: true, get: function () { return livekit_egress_1.StreamProtocol; } });
|
|
28
28
|
var livekit_models_1 = require("./proto/livekit_models");
|
|
29
29
|
Object.defineProperty(exports, "DataPacket_Kind", { enumerable: true, get: function () { return livekit_models_1.DataPacket_Kind; } });
|
|
30
30
|
Object.defineProperty(exports, "ParticipantInfo", { enumerable: true, get: function () { return livekit_models_1.ParticipantInfo; } });
|
|
@@ -33,8 +33,6 @@ Object.defineProperty(exports, "ParticipantPermission", { enumerable: true, get:
|
|
|
33
33
|
Object.defineProperty(exports, "Room", { enumerable: true, get: function () { return livekit_models_1.Room; } });
|
|
34
34
|
Object.defineProperty(exports, "TrackInfo", { enumerable: true, get: function () { return livekit_models_1.TrackInfo; } });
|
|
35
35
|
Object.defineProperty(exports, "TrackType", { enumerable: true, get: function () { return livekit_models_1.TrackType; } });
|
|
36
|
-
var RecordingServiceClient_1 = require("./RecordingServiceClient");
|
|
37
|
-
Object.defineProperty(exports, "RecordingServiceClient", { enumerable: true, get: function () { return __importDefault(RecordingServiceClient_1).default; } });
|
|
38
36
|
__exportStar(require("./RoomServiceClient"), exports);
|
|
39
37
|
__exportStar(require("./WebhookReceiver"), exports);
|
|
40
38
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,2CAAyB;AACzB,yDAWgC;AAV9B,kHAAA,gBAAgB,OAAA;AAChB,4GAAA,UAAU,OAAA;AACV,mHAAA,iBAAiB,OAAA;AACjB,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,qHAAA,mBAAmB,OAAA;AACnB,uHAAA,qBAAqB,OAAA;AACrB,8GAAA,YAAY,OAAA;AACZ,gHAAA,cAAc,OAAA;AAEhB,yDAQgC;AAP9B,iHAAA,eAAe,OAAA;AACf,iHAAA,eAAe,OAAA;AACf,uHAAA,qBAAqB,OAAA;AACrB,uHAAA,qBAAqB,OAAA;AACrB,sGAAA,IAAI,OAAA;AACJ,2GAAA,SAAS,OAAA;AACT,2GAAA,SAAS,OAAA;AAEX,sDAAoC;AACpC,oDAAkC"}
|