livekit-server-sdk 2.0.2 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # livekit-server-sdk
2
2
 
3
+ ## 2.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Add agent field to VideoGrant - [#141](https://github.com/livekit/server-sdk-js/pull/141) ([@lukasIO](https://github.com/lukasIO))
8
+
9
+ ## 2.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Export types needed for Egress - [#137](https://github.com/livekit/server-sdk-js/pull/137) ([@davidzhao](https://github.com/davidzhao))
14
+
3
15
  ## 2.0.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -17,6 +17,8 @@
17
17
 
18
18
  ## Migrate from v1.x to v2.x
19
19
 
20
+ ### Token generation
21
+
20
22
  Because the `jsonwebtoken` lib got replaced with `jose`, there are a couple of APIs that are now async, that weren't before:
21
23
 
22
24
  ```typescript
@@ -46,6 +48,47 @@ app.post('/webhook-endpoint', async (req, res) => {
46
48
  });
47
49
  ```
48
50
 
51
+ ### Egress API
52
+
53
+ Egress request types have been updated from interfaces to classes in the latest version. Additionally, `oneof` fields now require an explicit `case` field to specify the value type.
54
+
55
+ For example, to create a RoomComposite Egress:
56
+
57
+ ```typescript
58
+ // v1
59
+ // const fileOutput = {
60
+ // fileType: EncodedFileType.MP4,
61
+ // filepath: 'livekit-demo/room-composite-test.mp4',
62
+ // s3: {
63
+ // accessKey: 'aws-access-key',
64
+ // secret: 'aws-access-secret',
65
+ // region: 'aws-region',
66
+ // bucket: 'my-bucket',
67
+ // },
68
+ // };
69
+
70
+ // const info = await egressClient.startRoomCompositeEgress('my-room', {
71
+ // file: fileOutput,
72
+ // });
73
+
74
+ // v2 - current
75
+ const fileOutput = new EncodedFileOutput({
76
+ filepath: 'dz/davids-room-test.mp4',
77
+ output: {
78
+ case: 's3',
79
+ value: new S3Upload({
80
+ accessKey: 'aws-access-key',
81
+ secret: 'aws-access-secret',
82
+ bucket: 'my-bucket',
83
+ }),
84
+ },
85
+ });
86
+
87
+ const info = await egressClient.startRoomCompositeEgress('my-room', {
88
+ file: fileOutput,
89
+ });
90
+ ```
91
+
49
92
  ## Installation
50
93
 
51
94
  ### Pnpm
package/dist/grants.d.ts CHANGED
@@ -44,6 +44,8 @@ export interface VideoGrant {
44
44
  hidden?: boolean;
45
45
  /** participant is recording the room, when set, allows room to indicate it's being recorded */
46
46
  recorder?: boolean;
47
+ /** participant acts as a server side participant/bot/agent */
48
+ agent?: boolean;
47
49
  }
48
50
  /** @internal */
49
51
  export interface ClaimGrants extends JWTPayload {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,6 @@ export * from './IngressClient.js';
4
4
  export * from './RoomServiceClient.js';
5
5
  export * from './WebhookReceiver.js';
6
6
  export * from './grants.js';
7
- export { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, } from './proto/livekit_egress_pb.js';
7
+ export { AliOSSUpload, AzureBlobUpload, DirectFileOutput, EgressInfo, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ParticipantEgressRequest, RoomCompositeEgressRequest, S3Upload, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, TrackCompositeEgressRequest, TrackEgressRequest, WebEgressRequest, } from './proto/livekit_egress_pb.js';
8
8
  export { IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, } from './proto/livekit_ingress_pb.js';
9
9
  export { DataPacket_Kind, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, TrackInfo, TrackType, } from './proto/livekit_models_pb.js';
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ export * from './IngressClient.js';
4
4
  export * from './RoomServiceClient.js';
5
5
  export * from './WebhookReceiver.js';
6
6
  export * from './grants.js';
7
- export { DirectFileOutput, EgressInfo, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, } from './proto/livekit_egress_pb.js';
7
+ export { AliOSSUpload, AzureBlobUpload, DirectFileOutput, EgressInfo, EncodedFileOutput, EncodedFileType, EncodingOptions, EncodingOptionsPreset, GCPUpload, ParticipantEgressRequest, RoomCompositeEgressRequest, S3Upload, SegmentedFileOutput, SegmentedFileProtocol, StreamOutput, StreamProtocol, TrackCompositeEgressRequest, TrackEgressRequest, WebEgressRequest, } from './proto/livekit_egress_pb.js';
8
8
  export { IngressAudioEncodingOptions, IngressAudioEncodingPreset, IngressAudioOptions, IngressInfo, IngressInput, IngressState, IngressVideoEncodingOptions, IngressVideoEncodingPreset, IngressVideoOptions, } from './proto/livekit_ingress_pb.js';
9
9
  export { DataPacket_Kind, ParticipantInfo, ParticipantInfo_State, ParticipantPermission, Room, TrackInfo, TrackType, } from './proto/livekit_models_pb.js';
10
10
  //# 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":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,IAAI,EACJ,SAAS,EACT,SAAS,GACV,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,wBAAwB,EACxB,0BAA0B,EAC1B,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,IAAI,EACJ,SAAS,EACT,SAAS,GACV,MAAM,8BAA8B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "livekit-server-sdk",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Server-side SDK for LiveKit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",