Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebhookInterface

A webhook interface instance, tied to a particular session. Within interface steps, you can use these methods directly to alter the schema being returned to the user interface.

Example

var manager = webhook.getInterfaceManager();
manager.addStep("Check job number", function(webhookJob, webhookInterface, step){
     if(webhookJob.getQueryStringValue("job_number")){
         webhookInterface.addField({
             id: "something_else",
             _name: "Some other field",
             type: "text",
             description: "Thanks for adding a job number!"
         });
         step.complete = true; // Mark step as complete
     }
});

Hierarchy

  • WebhookInterface

Index

Constructors

constructor

Properties

Protected _checkpointNest

_checkpointNest: FolderNest

Protected _fields

_fields: FieldOptions[]

Protected _metadata

Protected _nest

Protected _sessionId

_sessionId: string

Protected _steps

_steps: Step[]

Protected e

Accessors

checkpointNest

description

  • set description(description: string): void

fields

interfaceProperties

metadata

nest

sessionId

  • get sessionId(): string

steps

  • get steps(): any
  • set steps(steps: any): void

tooltip

  • set tooltip(tooltip: string): void

Methods

addField

addInterfaceProperty

addStep

  • addStep(stepName: string, callback: any): void

completeStep

  • completeStep(step: Step): boolean

getField

  • getField(fieldId: string): any
  • Get an existing field from the interface to modify its properties.

    Parameters

    • fieldId: string

    Returns any

    Example

    im.addStep("Check job number", function(webhookJob, webhookInterface, step, done) {
         if(webhookJob.getParameter("job_number").length == 6) {
             // Make job number read only
             var jobNumberField = webhookInterface.getField("job_number");
             jobNumberField.readonly = true;
             // Complete step
             webhookInterface.completeStep(step);
         } else {
             step.failure = "Job number was not 6 characters.";
         }
         done();
    });
    

getJobs

getStepsTransport

  • getStepsTransport(): Array<any>

getTransportInterface

  • getTransportInterface(): object

Protected initMetadata

  • initMetadata(): void

removeStep

  • removeStep(step: Step): void

Generated using TypeDoc