Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EventEmitter
    • TwilioServerlessApiClient

Index

Constructors

constructor

Properties

Private client

client: GotClient

The got client that is used to make all the API requests

type

{GotClient}

memberof

TwilioServerlessApiClient

Private config

config: ClientConfig

Contains the client config used to do API requests

type

{ClientConfig}

memberof

TwilioServerlessApiClient

Static defaultMaxListeners

defaultMaxListeners: number

Methods

activateBuild

  • "Activates" a build by taking a specified build SID or a "source environment" and activating the same build in the specified environment.

    Can optionally create the new environment when called with activateConfig.createEnvironment

    Parameters

    • activateConfig: ActivateConfig

      Config to specify which build to activate in which environment

    Returns Promise<ActivateResult>

    Promise Object containing meta information around deployment

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

deployLocalProject

  • Deploys a local project by reading existing functions and assets from deployConfig.cwd and calling this.deployProject with it.

    Functions have to be placed in a functions or src directory to be found. Assets have to be placed into an assets or static directory.

    Nested folder structures will result in nested routes.

    Parameters

    Returns Promise<DeployResult>

    Promise Object containing meta information around deployment

deployProject

  • Deploys a set of functions, assets, variables and dependencies specified in deployConfig. Functions & assets can either be paths to the local filesystem or Buffer instances allowing you to dynamically upload even without a file system.

    Unless a deployConfig. serviceSid is specified, it will try to create one. If a service with the name deployConfig.serviceName already exists, it will throw an error. You can make it use the existing service by setting overrideExistingService to true.

    Updates to the deployment will be emitted as events to status-update. Example:

    client.on('status-update', ({ status, message }) => {
     console.log('[%s]: %s', status, message);
    })

    Parameters

    Returns Promise<DeployResult>

    Promise Object containing meta information around deployment

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getClient

  • Returns the internally used GotClient instance used to make API requests

    Returns GotClient

    A client instance with set-up credentials

getMaxListeners

  • getMaxListeners(): number
  • Returns number

list

  • Returns an object containing lists of services, environments, variables functions or assets, depending on which have beeen requested in listConfig

    Parameters

    • listConfig: ListConfig

      Specifies info around which things should be listed

    Returns Promise<ListResult>

    Promise Object containing the different lists.

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc