Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebhookJob

Hierarchy

  • Job
    • WebhookJob

Index

Constructors

constructor

Properties

Protected e

Protected id

id: string

Protected lifeCycle

lifeCycle: LifeEvent[]

Protected locallyAvailable

locallyAvailable: boolean

Protected name

name: string

Protected nest

nest: Nest

Protected request

request: any

Protected response

response: any

Protected tunnel

tunnel: Tunnel

Methods

Protected createLifeEvent

  • createLifeEvent(verb: string, start: string, finish: string): void

fail

  • fail(reason: string): void
  • Function to call to fail a job while in a tunnel.

    Parameters

    • reason: string

    Returns void

getDataAsString

  • getDataAsString(callback: any): void
  • Get a string from the request body. The given callback is given a string parameter.

    Example

    webhookJob.getDataAsString(function(requestBody){
        console.log(requestBody);
    });
    

    Parameters

    • callback: any

    Returns void

getFormDataFiles

  • getFormDataFiles(): Array<any>
  • Returns FileJobs made from files sent via FormData to the webhook.

    Returns Array<any>

getFormDataValue

  • getFormDataValue(key: string): any

getFormDataValues

  • getFormDataValues(): any

getId

  • getId(): string

getLifeCycle

getName

  • getName(): string

getNameProper

  • getNameProper(): string

getNest

getParameter

  • getParameter(key: string): any
  • Returns a parameter from both the query string and form-data.

    Parameters

    • key: string

    Returns any

getParameters

  • getParameters(): any

getQueryStringValue

  • getQueryStringValue(parameter: string): any
  • Return a specific URL parameter.

    Example

    // Webhook URL: /hooks/my/hook?customer_id=MyCust
    var customer_id = webhookJob.getUrlParameter("customer_id");
    // customer_id => MyCust
    

    Parameters

    • parameter: string

    Returns any

getQueryStringValues

  • getQueryStringValues(): any
  • Return all URl parameters.

    • Example

      // Webhook URL: /hooks/my/hook?customer_id=MyCust&file_name=MyFile.zip
      var query = webhookJob.getUrlParameters();
      // query => {customer_id: "MyCust", file_name: "MyFile.zip"}
      

    Returns any

getRequest

  • getRequest(): any

getResponse

  • getResponse(): any

getTunnel

isLocallyAvailable

  • isLocallyAvailable(): boolean

move

  • move(destinationNest: any, callback: any): void
  • Move function error.

    Parameters

    • destinationNest: any
    • callback: any

    Returns void

setLocallyAvailable

  • setLocallyAvailable(available: boolean): void

setName

  • setName(name: string): void

setNest

  • setNest(nest: Nest): void

setTunnel

  • setTunnel(tunnel: Tunnel): void

toString

  • toString(): string

transfer

  • transfer(tunnel: Tunnel): void

Generated using TypeDoc