Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebhookNest

Hierarchy

Index

Constructors

constructor

  • new WebhookNest(e: Environment, path: string | string[], httpMethod: string, handleRequest?: any): WebhookNest

Properties

Protected _handleRequest

_handleRequest: any

Protected _holdResponse

_holdResponse: boolean

Protected _httpMethod

_httpMethod: string

Protected _id

_id: string

Protected _im

Protected _name

_name: string

Protected _path

_path: string

Protected _tunnel

_tunnel: Tunnel

Protected _ui

Protected e

Accessors

customHandleRequest

  • get customHandleRequest(): any
  • set customHandleRequest(handleRequest: any): void

holdResponse

  • get holdResponse(): boolean
  • set holdResponse(holdResponse: boolean): void
  • Get the holdResponse flag.

    Returns boolean

  • Set hold response flag. This allows you to run tunnel logic and send the response after completion. You must call releaseResponse later if you use this.

    Parameters

    • holdResponse: boolean

    Returns void

httpMethod

  • get httpMethod(): string
  • set httpMethod(httpMethod: string): void

id

  • get id(): string

interfaceManager

name

  • get name(): string

path

  • get path(): any
  • set path(path: any): void
  • Get the _path.

    Returns any

  • Set the _path as a string or a string array. All parts are URI encoded. Create directory structures with an array: ["one", "two"] results in "/one/two".

    Parameters

    • path: any

    Returns void

tunnel

Methods

arrive

load

  • load(): void

register

  • register(tunnel: Tunnel): void

releaseResponse

  • releaseResponse(job: WebhookJob, message?: string): void
  • Releases the webhook response when tunnel run logic is complete.

    Parameters

    • job: WebhookJob

      The webhook job that triggered the webhook nest.

    • Optional message: string

      The optional response message, if not using a custom request handler.

      Example

      var webhook = af.createWebhookNest(["jobs", "submit"], "post");
      webhook.holdResponse = true; // Keeps the response from being sent immediately
      var tunnel = af.createTunnel("Dwight's test tunnel");
      tunnel.watch(webhook);
      tunnel.run(function(job, nest){
           setTimeout(function(){
               nest.releaseResponse(job, "Worked!"); // Sends response
           }, 1500); // After 1.5 seconds
      });
      

    Returns void

take

  • take(job: Job, callback: any): void

toString

  • toString(): string

watch

  • watch(): void

Generated using TypeDoc