From 8c347e37a29bee3e6c24512fd654a4078263b67a Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Thu, 10 Sep 2020 16:50:24 -0600 Subject: [PATCH 1/6] Add support for new peer-to-peer-basic room type --- README.md | 2 +- src/commands/rtc/apps/video/deploy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5eddb0..2ab24ac 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ OPTIONS --app-directory=app-directory Name of app directory to use --authentication=(passcode) (required) Type of authentication to use --override Override an existing App deployment - --room-type=(group|group-small|peer-to-peer) [default: group] Set room type + --room-type=(group|group-small|peer-to-peer|peer-to-peer-basic) [default: group] Set room type DESCRIPTION This command publishes two components as a Twilio Function: an application token diff --git a/src/commands/rtc/apps/video/deploy.js b/src/commands/rtc/apps/video/deploy.js index 61b4bd6..a8b81ff 100644 --- a/src/commands/rtc/apps/video/deploy.js +++ b/src/commands/rtc/apps/video/deploy.js @@ -43,7 +43,7 @@ DeployCommand.flags = Object.assign( description: 'Override an existing App deployment', }), 'room-type': flags.enum({ - options: ['group', 'group-small', 'peer-to-peer'], + options: ['group', 'group-small', 'peer-to-peer', 'peer-to-peer-basic'], description: 'Type of room to use', required: false, default: 'group', From 350e34e5048e58b74036a3bc987f2c7f1647cec9 Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Thu, 10 Sep 2020 16:50:44 -0600 Subject: [PATCH 2/6] Adjust e2e test to use peer-to-peer-basic room type --- test/e2e/e2e.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/e2e.test.js b/test/e2e/e2e.test.js index b4683de..d6cf86b 100644 --- a/test/e2e/e2e.test.js +++ b/test/e2e/e2e.test.js @@ -223,14 +223,14 @@ describe('the RTC Twilio-CLI Plugin', () => { }); }); - describe('after deploying a token server (with peer-to-peer rooms)', () => { + describe('after deploying a token server (with peer-to-peer-basic rooms)', () => { let URL; let passcode; let webAppURL; beforeAll(async done => { stdout.start(); - await DeployCommand.run(['--authentication', 'passcode', '--room-type', 'peer-to-peer']); + await DeployCommand.run(['--authentication', 'passcode', '--room-type', 'peer-to-peer-basic']); stdout.stop(); passcode = getPasscode(stdout.output); URL = getURL(stdout.output); @@ -248,22 +248,22 @@ describe('the RTC Twilio-CLI Plugin', () => { stdout.start(); await ViewCommand.run([]); stdout.stop(); - expect(stdout.output).toMatch(/Passcode: \d{3} \d{3} \d{4} \d{4}\nExpires: .+\nRoom Type: peer-to-peer/); + expect(stdout.output).toMatch(/Passcode: \d{3} \d{3} \d{4} \d{4}\nExpires: .+\nRoom Type: peer-to-peer-basic/); expect(stdout.output).not.toMatch(/Web App URL:/); }); }); describe('the serverless deployment', () => { - it('should create a peer-to-peer room and return a video token when the correct passcode is provided', async () => { + it('should create a peer-to-peer-basic room and return a video token when the correct passcode is provided', async () => { const ROOM_NAME = nanoid(); const { body } = await superagent .post(`${URL}/token`) .send({ passcode, room_name: ROOM_NAME, user_identity: 'test user' }); expect(jwt.decode(body.token).grants).toEqual({ identity: 'test user', video: { room: ROOM_NAME } }); - expect(body.room_type).toEqual('peer-to-peer'); + expect(body.room_type).toEqual('peer-to-peer-basic'); const room = await twilioClient.video.rooms(ROOM_NAME).fetch(); - expect(room.type).toEqual('peer-to-peer'); + expect(room.type).toEqual('peer-to-peer-basic'); }); it('should return a 401 error when an incorrect passcode is provided', () => { From 8cf7e927b9f540d9cf43ba58e52d2fcb6f47dac5 Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Thu, 24 Sep 2020 14:49:53 -0600 Subject: [PATCH 3/6] Add support for go rooms --- README.md | 2 +- src/commands/rtc/apps/video/deploy.js | 4 ++-- test/e2e/e2e.test.js | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2ab24ac..673ee59 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ OPTIONS --app-directory=app-directory Name of app directory to use --authentication=(passcode) (required) Type of authentication to use --override Override an existing App deployment - --room-type=(group|group-small|peer-to-peer|peer-to-peer-basic) [default: group] Set room type + --room-type=(group|group-small|peer-to-peer|go) [default: go] Set room type DESCRIPTION This command publishes two components as a Twilio Function: an application token diff --git a/src/commands/rtc/apps/video/deploy.js b/src/commands/rtc/apps/video/deploy.js index a8b81ff..013b933 100644 --- a/src/commands/rtc/apps/video/deploy.js +++ b/src/commands/rtc/apps/video/deploy.js @@ -43,10 +43,10 @@ DeployCommand.flags = Object.assign( description: 'Override an existing App deployment', }), 'room-type': flags.enum({ - options: ['group', 'group-small', 'peer-to-peer', 'peer-to-peer-basic'], + options: ['group', 'group-small', 'peer-to-peer', 'go'], description: 'Type of room to use', required: false, - default: 'group', + default: 'go', }), }, TwilioClientCommand.flags diff --git a/test/e2e/e2e.test.js b/test/e2e/e2e.test.js index d6cf86b..c09d551 100644 --- a/test/e2e/e2e.test.js +++ b/test/e2e/e2e.test.js @@ -223,14 +223,14 @@ describe('the RTC Twilio-CLI Plugin', () => { }); }); - describe('after deploying a token server (with peer-to-peer-basic rooms)', () => { + describe('after deploying a token server (with go rooms)', () => { let URL; let passcode; let webAppURL; beforeAll(async done => { stdout.start(); - await DeployCommand.run(['--authentication', 'passcode', '--room-type', 'peer-to-peer-basic']); + await DeployCommand.run(['--authentication', 'passcode', '--room-type', 'go']); stdout.stop(); passcode = getPasscode(stdout.output); URL = getURL(stdout.output); @@ -248,22 +248,22 @@ describe('the RTC Twilio-CLI Plugin', () => { stdout.start(); await ViewCommand.run([]); stdout.stop(); - expect(stdout.output).toMatch(/Passcode: \d{3} \d{3} \d{4} \d{4}\nExpires: .+\nRoom Type: peer-to-peer-basic/); + expect(stdout.output).toMatch(/Passcode: \d{3} \d{3} \d{4} \d{4}\nExpires: .+\nRoom Type: go/); expect(stdout.output).not.toMatch(/Web App URL:/); }); }); describe('the serverless deployment', () => { - it('should create a peer-to-peer-basic room and return a video token when the correct passcode is provided', async () => { + it('should create a go room and return a video token when the correct passcode is provided', async () => { const ROOM_NAME = nanoid(); const { body } = await superagent .post(`${URL}/token`) .send({ passcode, room_name: ROOM_NAME, user_identity: 'test user' }); expect(jwt.decode(body.token).grants).toEqual({ identity: 'test user', video: { room: ROOM_NAME } }); - expect(body.room_type).toEqual('peer-to-peer-basic'); + expect(body.room_type).toEqual('go'); const room = await twilioClient.video.rooms(ROOM_NAME).fetch(); - expect(room.type).toEqual('peer-to-peer-basic'); + expect(room.type).toEqual('go'); }); it('should return a 401 error when an incorrect passcode is provided', () => { From 620b38f36984247cd62cd71af760d74dada73833 Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Mon, 28 Sep 2020 09:54:48 -0600 Subject: [PATCH 4/6] Make 'group' default room type --- README.md | 2 +- src/commands/rtc/apps/video/deploy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 673ee59..c385022 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ OPTIONS --app-directory=app-directory Name of app directory to use --authentication=(passcode) (required) Type of authentication to use --override Override an existing App deployment - --room-type=(group|group-small|peer-to-peer|go) [default: go] Set room type + --room-type=(group|group-small|peer-to-peer|go) [default: group] Set room type DESCRIPTION This command publishes two components as a Twilio Function: an application token diff --git a/src/commands/rtc/apps/video/deploy.js b/src/commands/rtc/apps/video/deploy.js index 013b933..a7bce3d 100644 --- a/src/commands/rtc/apps/video/deploy.js +++ b/src/commands/rtc/apps/video/deploy.js @@ -46,7 +46,7 @@ DeployCommand.flags = Object.assign( options: ['group', 'group-small', 'peer-to-peer', 'go'], description: 'Type of room to use', required: false, - default: 'go', + default: 'group', }), }, TwilioClientCommand.flags From f057b8a9aa4e519b8c521478b8d2719b59fe9e6a Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Mon, 28 Sep 2020 09:55:25 -0600 Subject: [PATCH 5/6] Bump version and add changelog entry --- CHANGELOG.md | 6 ++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e91963d..4e19df5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.5.0 + +### Enhancements + +- Update the `--room-type` flag to add new 'go' room type. + ## 0.4.0 ### Maintenence diff --git a/package-lock.json b/package-lock.json index d98f514..f99ed05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@twilio-labs/plugin-rtc", - "version": "0.4.0", + "version": "0.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b2d1336..5495416 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@twilio-labs/plugin-rtc", - "version": "0.4.0", + "version": "0.5.0", "description": "A Twilio-CLI plugin for real-time communication apps", "main": "index.js", "publishConfig": { From 6f17509f07ab737f1fc7bab0f3cd935214bb2913 Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Mon, 28 Sep 2020 09:55:42 -0600 Subject: [PATCH 6/6] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e19df5..72b6353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Enhancements -- Update the `--room-type` flag to add new 'go' room type. +- Updated the `--room-type` flag to add new 'go' room type. ## 0.4.0