Skip to content

Commit 4f761c8

Browse files
author
timmydoza
authored
Merge pull request #44 from twilio-labs/AHOYAPPS-855-always-return-room-type
Update plugin to always return room_type parameter
2 parents c18ee08 + 45cbda8 commit 4f761c8

File tree

7 files changed

+13
-6
lines changed

7 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.4.0
4+
5+
### Maintenence
6+
7+
- Updated the logic in the video token server so that it always returns the `room_type` parameter.
8+
- Upgraded @twilio/cli-core from 5.8.1 to 5.9.0
9+
310
## 0.3.0
411

512
### Enhancements

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ POST /token
110110
```json
111111
{
112112
"token": "0000000000000000.0000000000000000000000.00000000000000000",
113-
"room_type": "group" | "group-small" | "peer-to-peer" | null
113+
"room_type": "group" | "group-small" | "peer-to-peer"
114114
}
115115
```
116116

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@twilio-labs/plugin-rtc",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "A Twilio-CLI plugin for real-time communication apps",
55
"main": "index.js",
66
"publishConfig": {

src/video-token-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ module.exports.handler = async (context, event, callback) => {
9494
const videoGrant = new VideoGrant({ room: room_name });
9595
token.addGrant(videoGrant);
9696
response.setStatusCode(200);
97-
response.setBody({ token: token.toJwt(), room_type: create_room ? ROOM_TYPE : null });
97+
response.setBody({ token: token.toJwt(), room_type: ROOM_TYPE });
9898
return callback(null, response);
9999
};

test/e2e/e2e.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('the RTC Twilio-CLI Plugin', () => {
147147
.post(`${URL}/token`)
148148
.send({ passcode, room_name: ROOM_NAME, user_identity: 'test user', create_room: false });
149149
expect(jwt.decode(body.token).grants).toEqual({ identity: 'test user', video: { room: ROOM_NAME } });
150-
expect(body.room_type).toEqual(null);
150+
expect(body.room_type).toEqual('group');
151151

152152
try {
153153
await twilioClient.video.rooms(ROOM_NAME).fetch();

test/video-token-server.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ describe('the video-token-server', () => {
185185

186186
expect(mockCreateFunction).not.toHaveBeenCalled();
187187
expect(callback).toHaveBeenCalledWith(null, {
188-
body: { token: expect.any(String), room_type: null },
188+
body: { token: expect.any(String), room_type: 'group' },
189189
headers: { 'Content-Type': 'application/json' },
190190
statusCode: 200,
191191
});

0 commit comments

Comments
 (0)