-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from twilio-labs/update-oclif
Update oclif & minor refactors
- Loading branch information
Showing
13 changed files
with
1,730 additions
and
10,253 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,14 @@ | ||
const { flags } = require('@oclif/command'); | ||
const { Flags } = require('@oclif/core'); | ||
|
||
const taskrouterFlags = { | ||
'worker-sid': flags.string({ | ||
'worker-sid': Flags.string({ | ||
description: 'The Worker SID for this token', | ||
required: true, | ||
}), | ||
'workspace-sid': flags.string({ | ||
'workspace-sid': Flags.string({ | ||
description: 'The Workspace SID for this token', | ||
required: true, | ||
}) | ||
} | ||
|
||
const validateWorkerSid = function(sid) { | ||
return ( | ||
sid.startsWith('WK') && | ||
sid.length === 34 | ||
); | ||
} | ||
|
||
const validateWorkspaceSid = function(sid) { | ||
return ( | ||
sid.startsWith('WS') && | ||
sid.length === 34 | ||
); | ||
} | ||
|
||
module.exports = { taskrouterFlags, validateWorkerSid, validateWorkspaceSid }; | ||
module.exports = { taskrouterFlags }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const validateSid = function (prefix, sid) { | ||
return (sid.startsWith(prefix) && | ||
sid.length === 34 | ||
); | ||
}; | ||
|
||
module.exports = { validateSid }; |
Oops, something went wrong.