Skip to content

Commit 124165f

Browse files
author
timmydoza
authored
Merge pull request #39 from twilio-labs/ahoyapps-803-improve-app-code
Ahoyapps 803 improve app code
2 parents 2f53bd0 + 692500d commit 124165f

File tree

11 files changed

+2873
-11172
lines changed

11 files changed

+2873
-11172
lines changed

.circleci/config.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: 2.1
22

3-
workspace: &workspace
4-
~/plugin-rtc
3+
workspace: &workspace ~/plugin-rtc
54

65
node-defaults: &node-defaults
76
working_directory: *workspace
@@ -27,7 +26,7 @@ jobs:
2726
- node/with-cache:
2827
steps:
2928
- run: npm install
30-
- run: npm test -- -i --verbose
29+
- run: npm test -- --verbose
3130
- persist_to_workspace:
3231
root: .
3332
paths: .
@@ -52,7 +51,7 @@ jobs:
5251
exit 1
5352
fi
5453
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > $PWD/.npmrc
55-
- run: npm publish
54+
- run: npm publish
5655
- run: echo 'export DEFAULT_BRANCH=$(git remote show origin | grep HEAD | cut -d ":" -f2- | xargs)' >> $BASH_ENV
5756
- run:
5857
name: Set git information
@@ -66,15 +65,15 @@ jobs:
6665
- run: git push origin $DEFAULT_BRANCH
6766

6867
workflows:
69-
build-and-test:
70-
jobs:
71-
- build-and-test
68+
build-and-test:
69+
jobs:
70+
- build-and-test
7271

73-
publish-release:
74-
jobs:
75-
- build-and-test:
76-
<<: *release-filter
77-
- publish-release:
78-
<<: *release-filter
79-
requires:
80-
- build-and-test
72+
publish-release:
73+
jobs:
74+
- build-and-test:
75+
<<: *release-filter
76+
- publish-release:
77+
<<: *release-filter
78+
requires:
79+
- build-and-test

CHANGELOG.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
# Changelog
22

3+
## 0.2.0
4+
5+
### Breaking Change
6+
7+
- This version adds extra random digits to the URL used by the Twilio Video Apps. The format of the URL has changed from `https://video-app-xxxx-dev.twil.io` to `https://video-app-xxxx-yyyy-dev.twil.io`. The [iOS Video App](https://github.com/twilio/twilio-video-app-ios) and [Android Video App](https://github.com/twilio/twilio-video-app-android) must be upgraded in order to work with this new format. The [React Video App](https://github.com/twilio/twilio-video-app-react) does not need to be upgraded. This change is being made to increase the number of available domains (from ten thousand to ten million) which will greatly reduce the number of 409 (conflict) errors experienced by users.
8+
39
## 0.1.6
410

511
### Maintenance
612

7-
* Move @oclif/plugin-help from devDependencies to dependencies to resolve NPM warning.
13+
- Move @oclif/plugin-help from devDependencies to dependencies to resolve NPM warning.
814

915
## 0.1.5
1016

1117
### Maintenance
1218

13-
* Updated `twilio rtc:apps:video:deploy` command so that it checks for the existence of a necessary Twilio API Key before deploying the video token server.
19+
- Updated `twilio rtc:apps:video:deploy` command so that it checks for the existence of a necessary Twilio API Key before deploying the video token server.
1420

1521
## 0.1.4
1622

1723
### Maintenance
1824

19-
* Updated `twilio rtc:apps:video:delete` command so that it doesn't check for serverless environments before deleting the app. This allows the command to delete the app even when no environments exist.
25+
- Updated `twilio rtc:apps:video:delete` command so that it doesn't check for serverless environments before deleting the app. This allows the command to delete the app even when no environments exist.
2026

2127
## 0.1.3
2228

2329
### Features
2430

25-
* Updated the `twilio rtc:apps:video:deploy --override` flag behavior to update an existing Twilio Serverless instance rather than deleting and redeploying an instance. This behavior allows users to update an existing deployment's passcode without changing their application's URL. This betterment was proposed in #14.
31+
- Updated the `twilio rtc:apps:video:deploy --override` flag behavior to update an existing Twilio Serverless instance rather than deleting and redeploying an instance. This behavior allows users to update an existing deployment's passcode without changing their application's URL. This betterment was proposed in #14.
2632

2733
### Maintenance
2834

29-
* Use the Twilio Account SID from a Twilio Function context rather than copying from a Twilio Client instance.
35+
- Use the Twilio Account SID from a Twilio Function context rather than copying from a Twilio Client instance.
3036

3137
## 0.1.2
3238

3339
### Maintenance
3440

35-
* Addressed security alerts
41+
- Addressed security alerts
3642

3743
## 0.1.1
3844

3945
### Maintenance
4046

41-
* Updated the token server to return the following error response with status code `400` when the request body is missing the `user_identity` field.
47+
- Updated the token server to return the following error response with status code `400` when the request body is missing the `user_identity` field.
4248

4349
```json
4450
{
45-
"error": {
46-
"message": "missing user_identity",
47-
"explanation": "The user_identity parameter is missing."
48-
}
51+
"error": {
52+
"message": "missing user_identity",
53+
"explanation": "The user_identity parameter is missing."
54+
}
4955
}
5056
```
5157

README.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
This plugin adds functionality to the [Twilio CLI](https://github.com/twilio/twilio-cli) which supports developing and deploying real-time communication apps.
77

8-
* [Getting Started](#getting-started)
9-
* [Supported Apps](#supported-apps)
10-
* [Commands](#commands)
8+
- [Getting Started](#getting-started)
9+
- [Supported Apps](#supported-apps)
10+
- [Commands](#commands)
1111

1212
## Getting Started
1313

@@ -52,17 +52,17 @@ This plugin currently supports the following applications:
5252

5353
A mobile and web collaboration application built with Twilio Programmable Video. Visit the projects below for instructions on how to use this plugin to build and deploy the Twilio Video app.
5454

55-
* [React App](https://github.com/twilio/twilio-video-app-react)
56-
* [iOS App](https://github.com/twilio/twilio-video-app-ios)
57-
* [Android App](https://github.com/twilio/twilio-video-app-android)
55+
- [React App](https://github.com/twilio/twilio-video-app-react)
56+
- [iOS App](https://github.com/twilio/twilio-video-app-ios)
57+
- [Android App](https://github.com/twilio/twilio-video-app-android)
5858

5959
#### Token Server API Documentation
6060

6161
The following section documents the application [token server](/src/video-token-server.js) used to provide [Programable Video access tokens](https://www.twilio.com/docs/video/tutorials/user-identity-access-tokens) to supported Twilio Video applications. The token server is deployed as a [Twilio Function](https://www.twilio.com/docs/runtime/functions).
6262

63-
| Method | URL |
64-
| --- | --- |
65-
| POST | [`/token`](#token) |
63+
| Method | URL |
64+
| ------ | ------------------ |
65+
| POST | [`/token`](#token) |
6666

6767
##### Authentication
6868

@@ -74,7 +74,7 @@ Each request is verified using a passcode generated at deploy time. Passcodes re
7474

7575
```
7676
{
77-
"passcode": "1234564321",
77+
"passcode": "12345612341234",
7878
"user_identity": "User",
7979
"room_name": "Demo",
8080
}
@@ -90,11 +90,11 @@ POST /token
9090

9191
###### Parameters
9292

93-
| Name | Type | Description |
94-
| --- | --- | --- |
95-
| `passcode` | `string` | **Required**. The application passcode. |
96-
| `user_identity` | `string` | **Required**. The user's identity. |
97-
| `room_name` | `string` | A room name that will be used to create a token scoped to connecting to only one room. |
93+
| Name | Type | Description |
94+
| --------------- | -------- | -------------------------------------------------------------------------------------- |
95+
| `passcode` | `string` | **Required**. The application passcode. |
96+
| `user_identity` | `string` | **Required**. The user's identity. |
97+
| `room_name` | `string` | A room name that will be used to create a token scoped to connecting to only one room. |
9898

9999
###### Success Responses
100100

@@ -108,7 +108,7 @@ POST /token
108108

109109
```json
110110
{
111-
"token": "0000000000000000.0000000000000000000000.00000000000000000"
111+
"token": "0000000000000000.0000000000000000000000.00000000000000000"
112112
}
113113
```
114114

@@ -130,10 +130,10 @@ POST /token
130130

131131
```json
132132
{
133-
"error": {
134-
"message": "missing user_identity",
135-
"explanation": "The user_identity parameter is missing."
136-
}
133+
"error": {
134+
"message": "missing user_identity",
135+
"explanation": "The user_identity parameter is missing."
136+
}
137137
}
138138
```
139139

@@ -146,10 +146,10 @@ POST /token
146146

147147
```json
148148
{
149-
"error": {
150-
"message": "passcode expired",
151-
"explanation": "The passcode used to validate application users has expired. Re-deploy the application to refresh the passcode."
152-
}
149+
"error": {
150+
"message": "passcode expired",
151+
"explanation": "The passcode used to validate application users has expired. Re-deploy the application to refresh the passcode."
152+
}
153153
}
154154
```
155155

@@ -162,10 +162,10 @@ POST /token
162162

163163
```json
164164
{
165-
"error": {
166-
"message": "passcode incorrect",
167-
"explanation": "The passcode used to validate application users is incorrect."
168-
}
165+
"error": {
166+
"message": "passcode incorrect",
167+
"explanation": "The passcode used to validate application users is incorrect."
168+
}
169169
}
170170
```
171171

@@ -175,10 +175,12 @@ POST /token
175175
</table>
176176

177177
## Commands
178+
178179
<!-- commands -->
179-
* [`twilio rtc:apps:video:delete`](#twilio-rtcappsvideodelete)
180-
* [`twilio rtc:apps:video:deploy --authentication <auth>`](#twilio-rtcappsvideodeploy---authentication-auth)
181-
* [`twilio rtc:apps:video:view`](#twilio-rtcappsvideoview)
180+
181+
- [`twilio rtc:apps:video:delete`](#twilio-rtcappsvideodelete)
182+
- [`twilio rtc:apps:video:deploy --authentication <auth>`](#twilio-rtcappsvideodeploy---authentication-auth)
183+
- [`twilio rtc:apps:video:view`](#twilio-rtcappsvideoview)
182184

183185
## `twilio rtc:apps:video:delete`
184186

@@ -190,25 +192,23 @@ USAGE
190192
191193
OPTIONS
192194
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
193-
-o=(columns|json|tsv) [default: columns] Format of command output.
194195
-p, --profile=profile Shorthand identifier for your profile.
195196
196197
EXAMPLE
197198
$ twilio rtc:apps:video:delete
198-
Removed app with Passcode: 1111111111
199+
Successfully deleted app.
199200
```
200201

201202
## `twilio rtc:apps:video:deploy --authentication <auth>`
202203

203-
Deploy a Programmable Video app
204+
Deploy a Programmable Video app
204205

205206
```
206207
USAGE
207208
$ twilio rtc:apps:video:deploy --authentication <auth>
208209
209210
OPTIONS
210211
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
211-
-o=(columns|json|tsv) [default: columns] Format of command output.
212212
-p, --profile=profile Shorthand identifier for your profile.
213213
--app-directory=app-directory Name of app directory to use
214214
--authentication=(passcode) (required) Type of authentication to use
@@ -232,21 +232,21 @@ EXAMPLES
232232
# Deploy an application token server with passcode authentication
233233
$ twilio rtc:apps:video:deploy --authentication passcode
234234
deploying app... done
235-
Passcode: 1111111111
235+
Passcode: xxx xxx xxxx xxxx
236236
237237
# Deploy an application token server with the React app
238238
$ twilio rtc:apps:video:deploy --authentication passcode --app-directory /path/to/app
239239
deploying app... done
240-
Web App URL: https://video-app-1111-dev.twil.io?passcode=1111111111
241-
Passcode: 1111111111
240+
Web App URL: https://video-app-xxxx-xxxx-dev.twil.io?passcode=xxxxxxxxxxxxxx
241+
Passcode: xxx xxx xxxx xxxx
242242
243243
# Override an existing app with a fresh deployment
244244
# Please note that this will remove a previously deployed web application if no
245245
# app directory is provided
246-
$ twilio rtc:apps:video:deploy --authentication passcode --override
247-
Removed app with Passcode: 1111111111
246+
$ twilio rtc:apps:video:deploy --authentication passcode --override
247+
Removed app with Passcode: xxx xxx xxxx xxxx
248248
deploying app... done
249-
Passcode: 2222222222
249+
Passcode: xxx xxx xxxx xxxx
250250
Expires: Mon Mar 09 2020 16:36:23 GMT-0600
251251
```
252252

@@ -260,12 +260,12 @@ USAGE
260260
261261
OPTIONS
262262
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
263-
-o=(columns|json|tsv) [default: columns] Format of command output.
264263
-p, --profile=profile Shorthand identifier for your profile.
265264
266265
EXAMPLE
267266
$ twilio rtc:apps:video:view
268-
Web App URL: https://video-app-1111-dev.twil.io?passcode=1111111111
269-
Passcode: 1111111111
267+
Web App URL: https://video-app-1111-dev.twil.io?passcode=xxxxxxxxxxxxxx
268+
Passcode: xxx xxx xxxx xxxx
270269
```
270+
271271
<!-- commandsstop -->

0 commit comments

Comments
 (0)