Giter Club home page Giter Club logo

plugin-serverless's Introduction

@twilio-labs/plugin-serverless

Plugin for the Twilio CLI to locally develop, debug and deploy to Twilio Serverless. Part of the Serverless Toolkit

npm (scoped) npm GitHub All Contributors Code of Conduct PRs Welcome


This plugin adds functionality to the Twilio CLI to locally develop, debug and deploy to Twilio Serverless. It's a part of the Serverless Toolkit and wraps twilio-run and create-twilio-function.

Requirements

Install the Twilio CLI

Via npm or yarn:

$ npm install -g twilio-cli
$ yarn global add twilio-cli

Via homebrew:

$ brew tap twilio/brew && brew install twilio

Usage

$ twilio plugins:install @twilio-labs/plugin-serverless
$ twilio --help serverless
USAGE
  $ twilio serverless
...

Concurrency

When deploying lots of Functions and Assets it is possible to run up against the enforced concurrency limits of the Twilio API. You can limit the concurrency and set how many times the library retries API requests using environment variables.

The default concurrency is 50 and the default number of retries is 10. You can change this by setting environment variables. The following would set concurrency to 1, only 1 live request at a time, and retries to 0, so if it fails it won't retry.

export TWILIO_SERVERLESS_API_CONCURRENCY=1
export TWILIO_SERVERLESS_API_RETRY_LIMIT=0

Commands

twilio serverless:deploy

Deploys existing functions and assets to Twilio

USAGE
  $ twilio serverless:deploy

OPTIONS
  -c, --config=config                  [default: .twilio-functions] Location of the config file. Absolute path or
                                       relative to current working directory (cwd)

  -l, --logLevel=logLevel              [default: info] Level of logging messages.

  -n, --service-name=service-name      Overrides the name of the Serverless project. Default: the name field in your
                                       package.json

  -p, --profile=profile                Shorthand identifier for your profile.

  -u, --account-sid=account-sid        A specific account SID to be used for deployment. Uses fields in .env otherwise

  --[no-]assets                        Upload assets. Can be turned off with --no-assets

  --assets-folder=assets-folder        Specific folder name to be used for static assets

  --auth-token=auth-token              Use a specific auth token for deployment. Uses fields from .env otherwise

  --cwd=cwd                            Sets the directory from which to deploy

  --env=env                            Path to .env file. If none, the local .env in the current working directory is
                                       used.

  --environment=environment            [default: dev] The environment name (domain suffix) you want to use for your
                                       deployment

  --force                              Will run deployment in force mode. Can be dangerous.

  --[no-]functions                     Upload functions. Can be turned off with --no-functions

  --functions-folder=functions-folder  Specific folder name to be used for static functions

  --load-system-env                    Uses system environment variables as fallback for variables specified in your
                                       .env file. Needs to be used with --env explicitly specified.

  --override-existing-project          Deploys Serverless project to existing service if a naming conflict has been
                                       found.

  --production                         Please prefer the "activate" command! Deploys to the production environment (no
                                       domain suffix). Overrides the value passed via the environment flag.

See code: src/commands/serverless/deploy.js

twilio serverless:init NAME

Creates a new Twilio Function project

USAGE
  $ twilio serverless:init NAME

ARGUMENTS
  NAME  Name of Serverless project and directory that will be created

OPTIONS
  -a, --account-sid=account-sid  The Account SID for your Twilio account
  -p, --profile=profile          Shorthand identifier for your profile.
  -t, --auth-token=auth-token    Your Twilio account Auth Token
  --empty                        Initialize your new project with empty functions and assets directories

  --import-credentials           Import credentials from the environment variables TWILIO_ACCOUNT_SID and
                                 TWILIO_AUTH_TOKEN

  --skip-credentials             Don't ask for Twilio account credentials or import them from the environment

  --template=template            Initialize your new project with a template from
                                 github.com/twilio-labs/function-templates

  --typescript                   Initialize your Serverless project with TypeScript

See code: src/commands/serverless/init.js

twilio serverless:list [TYPES]

List existing services, environments, variables, deployments for your Twilio Serverless Account

USAGE
  $ twilio serverless:list [TYPES]

ARGUMENTS
  TYPES  [default: services] Comma separated list of things to list (services,environments,functions,assets,variables)

OPTIONS
  -c, --config=config              [default: .twilio-functions] Location of the config file. Absolute path or relative
                                   to current working directory (cwd)

  -l, --logLevel=logLevel          [default: info] Level of logging messages.

  -n, --service-name=service-name  Overrides the name of the Serverless project. Default: the name field in your
                                   package.json

  -p, --profile=profile            Shorthand identifier for your profile.

  -u, --account-sid=account-sid    A specific account SID to be used for deployment. Uses fields in .env otherwise

  --auth-token=auth-token          Use a specific auth token for deployment. Uses fields from .env otherwise

  --env=env                        Path to .env file for environment variables that should be installed

  --environment=environment        [default: dev] The environment to list variables for

  --extended-output                Show an extended set of properties on the output

  --load-system-env                Uses system environment variables as fallback for variables specified in your .env
                                   file. Needs to be used with --env explicitly specified.

  --service-sid=service-sid        Specific Serverless Service SID to run list for

See code: src/commands/serverless/list.js

twilio serverless:list-templates

Lists the available Twilio Function templates

USAGE
  $ twilio serverless:list-templates

OPTIONS
  -l, --logLevel=logLevel  [default: info] Level of logging messages.

See code: src/commands/serverless/list-templates.js

twilio serverless:logs

Print logs from your Twilio Serverless project

USAGE
  $ twilio serverless:logs

OPTIONS
  -c, --config=config                [default: .twilio-functions] Location of the config file. Absolute path or relative
                                     to current working directory (cwd)

  -l, --logLevel=logLevel            [default: info] Level of logging messages.

  -o, --output-format=output-format  Output the log in a different format

  -p, --profile=profile              Shorthand identifier for your profile.

  -u, --account-sid=account-sid      A specific account SID to be used for deployment. Uses fields in .env otherwise

  --auth-token=auth-token            Use a specific auth token for deployment. Uses fields from .env otherwise

  --cwd=cwd                          Sets the directory of your existing Serverless project. Defaults to current
                                     directory

  --env=env                          Path to .env file for environment variables that should be installed

  --environment=environment          [default: dev] The environment to retrieve the logs for

  --function-sid=function-sid        Specific Function SID to retrieve logs for

  --load-system-env                  Uses system environment variables as fallback for variables specified in your .env
                                     file. Needs to be used with --env explicitly specified.

  --service-sid=service-sid          Specific Serverless Service SID to retrieve logs for

  --tail                             Continuously stream the logs

See code: src/commands/serverless/logs.js

twilio serverless:new [NAMESPACE]

Creates a new Twilio Function based on an existing template

USAGE
  $ twilio serverless:new [NAMESPACE]

ARGUMENTS
  NAMESPACE  The namespace your assets/functions should be grouped under

OPTIONS
  -l, --logLevel=logLevel  [default: info] Level of logging messages.
  --template=template

See code: src/commands/serverless/new.js

twilio serverless:promote

Promotes an existing deployment to a new environment

USAGE
  $ twilio serverless:promote

OPTIONS
  -c, --config=config                          [default: .twilio-functions] Location of the config file. Absolute path
                                               or relative to current working directory (cwd)

  -f, --source-environment=source-environment  SID or suffix of an existing environment you want to deploy from.

  -f, --build-sid=build-sid                    An existing Build SID to deploy to the new environment

  -l, --logLevel=logLevel                      [default: info] Level of logging messages.

  -p, --profile=profile                        Shorthand identifier for your profile.

  -t, --environment=environment                The environment suffix or SID to deploy to.

  -u, --account-sid=account-sid                A specific account SID to be used for deployment. Uses fields in .env
                                               otherwise

  --auth-token=auth-token                      Use a specific auth token for deployment. Uses fields from .env otherwise

  --create-environment                         Creates environment if it couldn't find it.

  --cwd=cwd                                    Sets the directory of your existing Serverless project. Defaults to
                                               current directory

  --env=env                                    Path to .env file for environment variables that should be installed

  --force                                      Will run deployment in force mode. Can be dangerous.

  --load-system-env                            Uses system environment variables as fallback for variables specified in
                                               your .env file. Needs to be used with --env explicitly specified.

  --production                                 Promote build to the production environment (no domain suffix). Overrides
                                               environment flag

  --service-sid=service-sid                    SID of the Twilio Serverless Service to deploy to

ALIASES
  $ twilio serverless:activate

See code: src/commands/serverless/promote.js

twilio serverless:start [DIR]

Starts local Twilio Functions development server

USAGE
  $ twilio serverless:start [DIR]

ARGUMENTS
  DIR  Root directory to serve local Functions/Assets from

OPTIONS
  -c, --config=config                  [default: .twilio-functions] Location of the config file. Absolute path or
                                       relative to current working directory (cwd)

  -e, --env=env                        Loads .env file, overrides local env variables

  -f, --load-local-env                 Includes the local environment variables

  -l, --logLevel=logLevel              [default: info] Level of logging messages.

  -p, --port=port                      (required) [default: 3000] Override default port of 3000

  --assets-folder=assets-folder        Specific folder name to be used for static assets

  --cwd=cwd                            Alternative way to define the directory to start the server in. Overrides the
                                       [dir] argument passed.

  --detailed-logs                      Toggles detailed request logging by showing request body and query params

  --experimental-fork-process          Enable forking function processes to emulate production environment

  --functions-folder=functions-folder  Specific folder name to be used for static functions

  --inspect=inspect                    Enables Node.js debugging protocol

  --inspect-brk=inspect-brk            Enables Node.js debugging protocol, stops executioin until debugger is attached

  --legacy-mode                        Enables legacy mode, it will prefix your asset paths with /assets

  --[no-]live                          Always serve from the current functions (no caching)

  --[no-]logs                          Toggles request logging

  --ngrok=ngrok                        Uses ngrok to create and outfacing url

ALIASES
  $ twilio serverless:dev
  $ twilio serverless:run

See code: src/commands/serverless/start.js

Contributing

This project welcomes contributions from the community. Please see the CONTRIBUTING.md file for more details.

Code of Conduct

Please be aware that this project has a Code of Conduct. The tldr; is to just be excellent to each other โค๏ธ

Contributors

Thanks goes to these wonderful people (emoji key):

Dominik Kundel
Dominik Kundel

๐Ÿ’ป ๐Ÿ“– ๐Ÿค”
childish-sambino
childish-sambino

๐Ÿ’ป ๐Ÿ›
Elmer Thomas
Elmer Thomas

๐Ÿ› ๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

plugin-serverless's People

Contributors

dkundel avatar parammittal16 avatar parikshit-hooda avatar philnash avatar thinkingserious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugin-serverless's Issues

Allow ngrok configuration to be passed in

Hi,

It would be good to be able to add additional options to allow ngrok configuration to be passed in. The following use cases for --ngrok action

pass in subdomain into ngrok so it generate a consistent URI for ngrok
pass in user specified configuration file instead of using ~/.ngrok2/ngrok.yml for configration. This will allow project specific ngrok configuration to be set.

Issue with environment

I can not seem to deploy anymore, i keep getting the below error trying to install this plugin. Can somebody advise here i have tried uninstalling, reinstalling nothing is working.

oberts-iMac-Pro:TomoLive robertnorton$ twilio plugins:install @twilio-labs/plugin-serverless -l debug
warning @twilio-labs/plugin-serverless > @twilio/cli-core > [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
warning @twilio-labs/plugin-serverless > twilio-run > @types/is-ci > @types/[email protected]: This is a stub types definition. ci-info provides its own type definitions, so you do not need this installed.
warning @twilio-labs/plugin-serverless > twilio-run > ngrok > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning @twilio-labs/plugin-serverless > twilio-run > ngrok > [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning @twilio-labs/plugin-serverless > twilio-run > ngrok > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @twilio-labs/plugin-serverless > twilio-run > ngrok > request > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @twilio-labs/plugin-serverless > twilio-run > ngrok > request > [email protected]: this library is no longer supported
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=12.22.1". Got "12.16.3"
error Found incompatible module.
Installing plugin @twilio-labs/plugin-serverless... failed
    Error: yarn add @twilio-labs/plugin-serverless@latest --non-interactive --mutex=file:/Users/robertnorton/.twilio-cli/yarn.lock --preferred-cache-folder=/Users/robertnorton/.twilio-cli/yarn --check-files exited with code 1
[Error: EACCES: permission denied, open '/Users/robertnorton/.twilio-cli/error.log'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/Users/robertnorton/.twilio-cli/error.log'
}
Roberts-iMac-Pro:TomoLive robertnorton$ 

Unable to install plugins using Twilio CLI in Nodejs

Issue Summary
Twilio CLI throwing an error stating local certiifcate in not found. I even installed certificate , still same error occurs.

Code Snippet
twilio plugins:install @twilio-labs/plugin-serverless

paste code here

Exception/Log

error An unexpected error occurred: "https://registry.yarnpkg.com/@twilio-labs%2fplugin-serverless: unable to get local issuer certificate".
Installing plugin @twilio-labs/plugin-serverless... !
Error: yarn add @twilio-labs/plugin-serverless@latest --non-interactive
--mutex=file:C:\Users\ARPANSINGH.twilio-cli\yarn.lock
--preferred-cache-folder=C:\Users\ARPANSINGH.twilio-cli\yarn --check-files exited with code 1

Add support for `-o` flag

If you want to script complex setups the support of -o would be great. The -o=json|tsv flag is supported by most of the other CLI commands. :)

Production env adds "undefined" suffix

Hi there. It used to be that if I ran twilio serverless:deploy --production, my project would be deployed to a domain like project-1234.twil.io. Today I ran this command for a new project for the first time in a bit, and my project was deployed to a domain like project-1234-undefined.twil.io. I compared this project and an old one from https://www.twilio.com/console/functions/api, and both have environments with unique_name: production. Did something change? Do I need to run this differently? Or is this a bug? Thanks!

Clearly display which asset is unable to be uploaded

When running twilio-run deploy from a twilio serverless template and a few minor changes, I receive an error message with very little detail involved:

image

I tracked this down myself (eventually) to the fact that I had a .gitkeep file inside of my assets directory (probably a stupid thing to do, and I've since removed the file anyway.

Would it be possible to enhance the twilio-serverless cli plugin to clearly state the name of which asset is unable to be deployed? Even with debug logging enabled I wasn't able to find this information in the logs.

A big thank you to everyone who has contributed to this project, its a great platform to work on and I'm having loads of fun!

Unable to activate when only providing source-environment param

Below is a quick listing of my environment, running the initial activate command without source-environment, and finally with:

image

It looks like it is trying to check the build-sid that was not provided. It may be a case where a better error message explaining that what parameters are required would be helpful.

serverless:promote has conflicting command line options

twilio serverless:promote --help lists:

  -f, --source-environment=source-environment  SID or suffix of an existing environment you want to deploy from.

  -f, --build-sid=build-sid                    An existing Build SID to deploy to the new environment

I can't quite figure out where this comes from in the project source. I suspect it might be

https://github.com/twilio-labs/twilio-run/blob/b8ed5079c87ab407815e1cb9c32dac43be44a066/src/commands/activate.ts#L96-L106

... and that the aliases are being truncated to one-character -f flags.

A similar issue is that for twilio serverless:deploy --help, --production indicates Please prefer the "activate" command!. But then "activate" is missing from twilio serverless --help, whereas twilio-run's help lists that twilio-functions promote has an alias of "activate".

NGrok required dependency installer issue

I am having some problems installing on our server.

I have executed the following:

npm install twilio-cli -g

where I got an exception saying the dependency ngrok cannot be downloaded โ€“ this is because ngrok is blocked by our firewall for security reasons.

I then tried:

npm install twilio-cli -g --no-optional

which worked, Twilio CLI is now installed globally on the server.

Next I tried to install the dependencies of the application itself, of which @twilio-labs/plugin-serverless version 1.7.1 is one, and this had the same problem as the CLI.

The problem here is that --no-optional throws the same error, so I believe ngrok is not an optional dependency but a required one.

Can ngrok be changed to be an optional dependency, or is there another way around this?

Add support for debug flag

Right now it doesn't support the debug flag that the CLI supports. Unfortunately the CLI auto-suggests that you should use that to debug. We should add support for it even in some way.

.twilio-functions file not mentioned in .gitignore

I developed functions locally, initialised through the twilio serverless:init command, deployed it, then wanted to push it to a git repo and noticed that the deploy call created a .twilio-functions file that didn't seem to be added to .gitignore.

Think this might be something one might want to add to .gitignore as the file contains account specific content.

Node version detection is mixed up

I'm using nvm and it's set to switch node versions whenever enter a new dir and a .nvmrc is present. I created a new project with twilio serverless:init. When I now enter the created dir the node version is changed to 8.10.0 (as my bash prompt shows me).

I now run twilio serverless:start and am facing a node version warning because it detects node 10.16.0. ๐Ÿ˜ฒ What's interesting about this is, is that my default nvm node version is 12.4.0.

Running node -v inside of the dir correctly returns 8.10.

Screenshot 2019-08-08 at 16 20 16

This behavior persists across terminal sessions. :)

Twilio twilio binary is the one installed via brew.

๐Ÿฌ  โžก which twilio                                                                                                                                                                          
/usr/local/bin/twilio

Running twilio-run in the same directory works fine.

/tmp/your-project-name  โฌก v8.10.0

  โžก npx twilio-run                                                                                                                                                                           
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                    โ”‚
โ”‚   Twilio functions available:                                      โ”‚
โ”‚   โ”œโ”€โ”€ /hello-world | http://localhost:3000/hello-world             โ”‚
โ”‚   โ”œโ”€โ”€ /private-message | http://localhost:3000/private-message     โ”‚
โ”‚   โ””โ”€โ”€ [protected] /sms/reply | http://localhost:3000/sms/reply     โ”‚
โ”‚                                                                    โ”‚
โ”‚   Twilio assets available:                                         โ”‚
โ”‚   โ”œโ”€โ”€ /index.html | http://localhost:3000/index.html               โ”‚
โ”‚   โ”œโ”€โ”€ [private] /message.js | Runtime.getAssets()['/message.js']   โ”‚
โ”‚   โ””โ”€โ”€ /style.css | http://localhost:3000/style.css                 โ”‚
โ”‚                                                                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Add support for https_proxy param

It looks like https_proxy variables that is declared in shell is being ignored when Serverless Plugin is setting up connection with Proxy. We should add support so that all twilio serverless:* can access proxy connection.

Support for switching between profiles

After switching between profiles with the profiles:use command, serverless:deploy will still deploy to the profile that was active when the serverless:init command was run.

My guess is that this is because the ACCOUNT_SID and AUTH_TOKEN get set in the .env file whenserverless:init is run but don't get updated when the active profile is switched.

Seems like the ACCOUNT_SID and AUTH_TOKEN values should be updated in the .env file when the profiles:use command is used to set a new active profile.

Fix typo in Readme

There are some grammatical issues in Readme file.
I want to correct them and work on this issue as of Hackoberfest.

twilio serverless:deploy unexpected error

Moved here as advised in twilio/twilio-cli#173

Technical details:

  • twilio-cli version: twilio-cli/2.0.0 darwin-x64 node-v13.7.0
  • node version: v13.7.0
  • Command output with debug logging enabled (adding -l debug to the end of the command):
Deploying functions & assets to the Twilio Runtime

Account		AC2e28b44893fdebc06eb44c73fa07c03b
Token		82be****************************
Service Name	stripe-payment-link-sms
Environment	dev
Root Directory	/Users/thorsten/Documents/twilio/function-templates/stripe-payment-link-sms
Dependencies	stripe
Env Variables	STRIPE_SECRET_KEY

โ ‹ Deploying Function  twilio-serverless-api:client Deploy config {
  twilio-serverless-api:client   cwd: '/Users/thorsten/Documents/twilio/function-templates/stripe-payment-link-sms',
  twilio-serverless-api:client   envPath: '/Users/thorsten/Documents/twilio/function-templates/stripe-payment-link-sms/.env',
  twilio-serverless-api:client   accountSid: 'AC2e28b44893fdebc06eb44c73fa07c03b',
  twilio-serverless-api:client   authToken: '[REDACTED]',
  twilio-serverless-api:client   env: { STRIPE_SECRET_KEY: '[REDACTED]' },
  twilio-serverless-api:client   serviceSid: 'ZS5ad06539c2d5760d7b5f7218bc1f5649',
  twilio-serverless-api:client   pkgJson: { name: '[REDACTED]', dependencies: '[REDACTED]' },
  twilio-serverless-api:client   overrideExistingService: false,
  twilio-serverless-api:client   force: false,
  twilio-serverless-api:client   serviceName: 'stripe-payment-link-sms',
  twilio-serverless-api:client   functionsEnv: 'dev',
  twilio-serverless-api:client   noAssets: false,
  twilio-serverless-api:client   noFunctions: false
  twilio-serverless-api:client } +0ms
  twilio-serverless-api:fs Search for directory. Options: "functions,src" +0ms
  twilio-serverless-api:fs Found Functions Directory "/Users/thorsten/Documents/twilio/function-templates/stripe-payment-link-sms/functions" +0ms
  twilio-serverless-api:fs Search for directory. Options: "assets,static" +0ms
  twilio-serverless-api:fs Found Assets Directory "undefined" +1ms
โ ธ Configuring "dev" environment
  twilio-serverless-api:utils:pagination GotError [HTTPError]: Response code 404 (NOT FOUND)
  twilio-serverless-api:utils:pagination     at EventEmitter.<anonymous> (/Users/thorsten/.twilio-cli/node_modules/got/source/as-promise.js:74:19)
  twilio-serverless-api:utils:pagination     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  twilio-serverless-api:utils:pagination   name: 'HTTPError',
  twilio-serverless-api:utils:pagination   host: undefined,
  twilio-serverless-api:utils:pagination   hostname: 'serverless.twilio.com',
  twilio-serverless-api:utils:pagination   method: 'GET',
  twilio-serverless-api:utils:pagination   path: '/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-serverless-api:utils:pagination   socketPath: undefined,
  twilio-serverless-api:utils:pagination   protocol: 'https:',
  twilio-serverless-api:utils:pagination   url: 'https://serverless.twilio.com/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-serverless-api:utils:pagination   gotOptions: {
  twilio-serverless-api:utils:pagination     path: '/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-serverless-api:utils:pagination     protocol: 'https:',
  twilio-serverless-api:utils:pagination     hostname: 'serverless.twilio.com',
  twilio-serverless-api:utils:pagination     hash: '',
  twilio-serverless-api:utils:pagination     search: '',
  twilio-serverless-api:utils:pagination     pathname: '/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-serverless-api:utils:pagination     href: 'https://serverless.twilio.com/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-serverless-api:utils:pagination     retry: {
  twilio-serverless-api:utils:pagination       retries: [Function (anonymous)],
  twilio-serverless-api:utils:pagination       methods: [Set],
  twilio-serverless-api:utils:pagination       statusCodes: [Set],
  twilio-serverless-api:utils:pagination       errorCodes: [Set]
  twilio-serverless-api:utils:pagination     },
  twilio-serverless-api:utils:pagination     headers: {
  twilio-serverless-api:utils:pagination       'user-agent': 'twilio-serverless-api',
  twilio-serverless-api:utils:pagination       accept: 'application/json',
  twilio-serverless-api:utils:pagination       'accept-encoding': 'gzip, deflate'
  twilio-serverless-api:utils:pagination     },
  twilio-serverless-api:utils:pagination     hooks: {
  twilio-serverless-api:utils:pagination       beforeError: [],
  twilio-serverless-api:utils:pagination       init: [],
  twilio-serverless-api:utils:pagination       beforeRequest: [],
  twilio-serverless-api:utils:pagination       beforeRedirect: [],
  twilio-serverless-api:utils:pagination       beforeRetry: [],
  twilio-serverless-api:utils:pagination       afterResponse: []
  twilio-serverless-api:utils:pagination     },
  twilio-serverless-api:utils:pagination     decompress: true,
  twilio-serverless-api:utils:pagination     throwHttpErrors: true,
  twilio-serverless-api:utils:pagination     followRedirect: true,
  twilio-serverless-api:utils:pagination     stream: false,
  twilio-serverless-api:utils:pagination     form: false,
  twilio-serverless-api:utils:pagination     json: true,
  twilio-serverless-api:utils:pagination     cache: false,
  twilio-serverless-api:utils:pagination     useElectronNet: false,
  twilio-serverless-api:utils:pagination     baseUrl: [Getter/Setter],
  twilio-serverless-api:utils:pagination     auth: 'AC2e28b44893fdebc06eb44c73fa07c03b:[REDACTED]',
  twilio-serverless-api:utils:pagination     method: 'GET'
  twilio-serverless-api:utils:pagination   },
  twilio-serverless-api:utils:pagination   statusCode: 404,
  twilio-serverless-api:utils:pagination   statusMessage: 'NOT FOUND',
  twilio-serverless-api:utils:pagination   headers: {
  twilio-serverless-api:utils:pagination     date: 'Fri, 17 Apr 2020 10:26:22 GMT',
  twilio-serverless-api:utils:pagination     'content-type': 'application/json',
  twilio-serverless-api:utils:pagination     'content-length': '196',
  twilio-serverless-api:utils:pagination     connection: 'close',
  twilio-serverless-api:utils:pagination     'twilio-request-id': 'RQec0c62821ed04af6aedf21b7d40d4161',
  twilio-serverless-api:utils:pagination     'twilio-request-duration': '0.039',
  twilio-serverless-api:utils:pagination     'access-control-allow-origin': '*',
  twilio-serverless-api:utils:pagination     'access-control-allow-headers': 'Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since',
  twilio-serverless-api:utils:pagination     'access-control-allow-methods': 'GET, POST, DELETE, OPTIONS',
  twilio-serverless-api:utils:pagination     'access-control-expose-headers': 'ETag',
  twilio-serverless-api:utils:pagination     'access-control-allow-credentials': 'true',
  twilio-serverless-api:utils:pagination     'x-powered-by': 'AT-5000',
  twilio-serverless-api:utils:pagination     'x-shenanigans': 'none',
  twilio-serverless-api:utils:pagination     'x-home-region': 'us1',
  twilio-serverless-api:utils:pagination     'x-api-domain': 'serverless.twilio.com',
  twilio-serverless-api:utils:pagination     'strict-transport-security': 'max-age=31536000'
  twilio-serverless-api:utils:pagination   },
  twilio-serverless-api:utils:pagination   body: {
  twilio-serverless-api:utils:pagination     code: 20404,
  twilio-serverless-api:utils:pagination     message: 'The requested resource /Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments was not found',
  twilio-serverless-api:utils:pagination     more_info: 'https://www.twilio.com/docs/errors/20404',
  twilio-serverless-api:utils:pagination     status: 404
  twilio-serverless-api:utils:pagination   }
โ ง Configuring "dev" environment
  twilio-run:deploy GotError [HTTPError]: Response code 404 (NOT FOUND)
  twilio-run:deploy     at EventEmitter.<anonymous> (/Users/thorsten/.twilio-cli/node_modules/got/source/as-promise.js:74:19)
  twilio-run:deploy     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  twilio-run:deploy   name: 'HTTPError',
  twilio-run:deploy   host: undefined,
  twilio-run:deploy   hostname: 'serverless.twilio.com',
  twilio-run:deploy   method: 'POST',
  twilio-run:deploy   path: '/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-run:deploy   socketPath: undefined,
  twilio-run:deploy   protocol: 'https:',
  twilio-run:deploy   url: 'https://serverless.twilio.com/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-run:deploy   gotOptions: {
  twilio-run:deploy     path: '/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-run:deploy     protocol: 'https:',
  twilio-run:deploy     hostname: 'serverless.twilio.com',
  twilio-run:deploy     hash: '',
  twilio-run:deploy     search: '',
  twilio-run:deploy     pathname: '/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-run:deploy     href: 'https://serverless.twilio.com/v1/Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments',
  twilio-run:deploy     retry: {
  twilio-run:deploy       retries: [Function (anonymous)],
  twilio-run:deploy       methods: [Set],
  twilio-run:deploy       statusCodes: [Set],
  twilio-run:deploy       errorCodes: [Set]
  twilio-run:deploy     },
  twilio-run:deploy     headers: {
  twilio-run:deploy       'user-agent': 'twilio-serverless-api',
  twilio-run:deploy       accept: 'application/json',
  twilio-run:deploy       'accept-encoding': 'gzip, deflate',
  twilio-run:deploy       'content-type': 'application/x-www-form-urlencoded',
  twilio-run:deploy       'content-length': 105
  twilio-run:deploy     },
  twilio-run:deploy     hooks: {
  twilio-run:deploy       beforeError: [],
  twilio-run:deploy       init: [],
  twilio-run:deploy       beforeRequest: [],
  twilio-run:deploy       beforeRedirect: [],
  twilio-run:deploy       beforeRetry: [],
  twilio-run:deploy       afterResponse: []
  twilio-run:deploy     },
  twilio-run:deploy     decompress: true,
  twilio-run:deploy     throwHttpErrors: true,
  twilio-run:deploy     followRedirect: true,
  twilio-run:deploy     stream: false,
  twilio-run:deploy     form: true,
  twilio-run:deploy     json: true,
  twilio-run:deploy     cache: false,
  twilio-run:deploy     useElectronNet: false,
  twilio-run:deploy     baseUrl: [Getter/Setter],
  twilio-run:deploy     auth: 'AC2e28b44893fdebc06eb44c73fa07c03b:[REDACTED]',
  twilio-run:deploy     body: 'UniqueName=dev-environment&DomainSuffix=dev&FriendlyName=dev-environment+Environment+%28Created+by+CLI%29',
  twilio-run:deploy     method: 'POST'
  twilio-run:deploy   },
  twilio-run:deploy   statusCode: 404,
  twilio-run:deploy   statusMessage: 'NOT FOUND',
  twilio-run:deploy   headers: {
  twilio-run:deploy     date: 'Fri, 17 Apr 2020 10:26:23 GMT',
  twilio-run:deploy     'content-type': 'application/json',
  twilio-run:deploy     'content-length': '196',
  twilio-run:deploy     connection: 'close',
  twilio-run:deploy     'twilio-request-id': 'RQ8fa7f421ce794c31853764026a26b961',
  twilio-run:deploy     'twilio-request-duration': '0.029',
  twilio-run:deploy     'access-control-allow-origin': '*',
  twilio-run:deploy     'access-control-allow-headers': 'Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since',
  twilio-run:deploy     'access-control-allow-methods': 'GET, POST, DELETE, OPTIONS',
  twilio-run:deploy     'access-control-expose-headers': 'ETag',
  twilio-run:deploy     'access-control-allow-credentials': 'true',
  twilio-run:deploy     'x-powered-by': 'AT-5000',
  twilio-run:deploy     'x-shenanigans': 'none',
  twilio-run:deploy     'x-home-region': 'us1',
  twilio-run:deploy     'x-api-domain': 'serverless.twilio.com',
  twilio-run:deploy     'strict-transport-security': 'max-age=31536000'
  twilio-run:deploy   },
  twilio-run:deploy   body: {
  twilio-run:deploy     code: 20404,
  twilio-run:deploy     message: 'The requested resource /Services/ZS5ad06539c2d5760d7b5f7218bc1f5649/Environments was not found',
  twilio-run:deploy     more_info: 'https://www.twilio.com/docs/errors/20404',
  twilio-run:deploy     status: 404
  twilio-run:deploy   }
โœ– Failed Deployment
 ยป twilio-cli encountered an unexpected error. To report this issue, execute the command with the "-l debug" flag, then copy the output to a new issue here: https://github.com/twilio/twilio-cli/issues

Add support for `-l` flag within twilio serverless:init

The error below seems to be caused by something else in Twilio CLI, but it is confusing that the error points towards using "-l" to troubleshoot when "-l" is not implemented for init.

PS /Users/adtaylor/work/twilio-serverless/test_assets/MP3TEST>twilio serverless:init example-client-app --template="voice-client-javascript"
ยป twilio-cli encountered an unexpected error. To report this issue, execute the command with the "-l debug" flag, then copy the output to a new issue here: https://github.com/twilio/twilio-cli/issues
ยป Error: EEXIT: 1
ยป Code: EEXIT

PS /Users/adtaylor/work/twilio-serverless/test_assets/MP3TEST>twilio serverless:init example-client-app --template="voice-client-javascript" -l debug
ยป Error: Unexpected arguments: -l, debug
ยป See more help with --help

PS /Users/adtaylor/work/twilio-serverless/test_assets/MP3TEST> twilio serverless:init --help

Creates a new Twilio Function project

USAGE

$ twilio serverless:init NAME

ARGUMENTS

NAME Name of Serverless project and directory that will be created

OPTIONS

-a, --account-sid=account-sid The Account SID for your Twilio account
-p, --profile=profile Shorthand identifier for your profile.
-t, --auth-token=auth-token Your Twilio account Auth Token
--empty Initialize your new project with empty functions and assets directories
--import-credentials Import credentials from the environment variables TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN
--skip-credentials Don't ask for Twilio account credentials or import them from the environment
--template=template Initialize your new project with a template from github.com/twilio-labs/function-templates
--typescript Initialize your Serverless project with TypeScript

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.