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 _holdResponse

_holdResponse: boolean

Protected e

Protected handleRequest

handleRequest: any

Protected httpMethod

httpMethod: string

Protected id

id: string

Protected im

Protected name

name: string

Protected path

path: string

Protected tunnel

tunnel: Tunnel

Protected ui

Accessors

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

Methods

arrive

getCustomHandleRequest

  • getCustomHandleRequest(): any

getHttpMethod

  • getHttpMethod(): string

getId

  • getId(): string

getInterfaceManager

getName

  • getName(): string

getPath

  • getPath(): string

getTunnel

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

Protected setCustomHandleRequest

  • setCustomHandleRequest(handleRequest: any): void

Protected setHttpMethod

  • setHttpMethod(httpMethod: any): void

setPath

  • setPath(path: any): void
  • 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

toString

  • toString(): string

watch

  • watch(): void

Generated using TypeDoc