Skip to content

Commit 12eb578

Browse files
author
timmydoza
authored
Merge pull request #48 from twilio-labs/support-go-rooms
Implement Go Room Type Support
2 parents 8037937 + 5c36244 commit 12eb578

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

CHANGELOG.md

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

3+
## 0.5.0
4+
5+
### Enhancements
6+
7+
- Updated the `--room-type` flag to add new 'go' room type.
8+
39
## 0.4.0
410

511
### Maintenence

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ OPTIONS
228228
--app-directory=app-directory Name of app directory to use
229229
--authentication=(passcode) (required) Type of authentication to use
230230
--override Override an existing App deployment
231-
--room-type=(group|group-small|peer-to-peer) [default: group] Set room type
231+
--room-type=(group|group-small|peer-to-peer|go) [default: group] Set room type
232232
233233
DESCRIPTION
234234
This command publishes two components as a Twilio Function: an application token

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.4.1",
3+
"version": "0.5.0",
44
"description": "A Twilio-CLI plugin for real-time communication apps",
55
"main": "index.js",
66
"publishConfig": {

src/commands/rtc/apps/video/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ DeployCommand.flags = Object.assign(
4343
description: 'Override an existing App deployment',
4444
}),
4545
'room-type': flags.enum({
46-
options: ['group', 'group-small', 'peer-to-peer'],
46+
options: ['group', 'group-small', 'peer-to-peer', 'go'],
4747
description: 'Type of room to use',
4848
required: false,
4949
default: 'group',

test/e2e/e2e.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ describe('the RTC Twilio-CLI Plugin', () => {
223223
});
224224
});
225225

226-
describe('after deploying a token server (with peer-to-peer rooms)', () => {
226+
describe('after deploying a token server (with go rooms)', () => {
227227
let URL;
228228
let passcode;
229229
let webAppURL;
230230

231231
beforeAll(async done => {
232232
stdout.start();
233-
await DeployCommand.run(['--authentication', 'passcode', '--room-type', 'peer-to-peer']);
233+
await DeployCommand.run(['--authentication', 'passcode', '--room-type', 'go']);
234234
stdout.stop();
235235
passcode = getPasscode(stdout.output);
236236
URL = getURL(stdout.output);
@@ -248,22 +248,22 @@ describe('the RTC Twilio-CLI Plugin', () => {
248248
stdout.start();
249249
await ViewCommand.run([]);
250250
stdout.stop();
251-
expect(stdout.output).toMatch(/Passcode: \d{3} \d{3} \d{4} \d{4}\nExpires: .+\nRoom Type: peer-to-peer/);
251+
expect(stdout.output).toMatch(/Passcode: \d{3} \d{3} \d{4} \d{4}\nExpires: .+\nRoom Type: go/);
252252
expect(stdout.output).not.toMatch(/Web App URL:/);
253253
});
254254
});
255255

256256
describe('the serverless deployment', () => {
257-
it('should create a peer-to-peer room and return a video token when the correct passcode is provided', async () => {
257+
it('should create a go room and return a video token when the correct passcode is provided', async () => {
258258
const ROOM_NAME = nanoid();
259259
const { body } = await superagent
260260
.post(`${URL}/token`)
261261
.send({ passcode, room_name: ROOM_NAME, user_identity: 'test user' });
262262
expect(jwt.decode(body.token).grants).toEqual({ identity: 'test user', video: { room: ROOM_NAME } });
263-
expect(body.room_type).toEqual('peer-to-peer');
263+
expect(body.room_type).toEqual('go');
264264

265265
const room = await twilioClient.video.rooms(ROOM_NAME).fetch();
266-
expect(room.type).toEqual('peer-to-peer');
266+
expect(room.type).toEqual('go');
267267
});
268268

269269
it('should return a 401 error when an incorrect passcode is provided', () => {

0 commit comments

Comments
 (0)