Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace specHelper

Index

Functions

buildConnection

  • buildConnection(): Promise<any>

deleteEnqueuedTasks

  • deleteEnqueuedTasks(taskName: string, params: {}): Promise<void>
  • Delete all enqueued instances of a task, both in all the normal queues and all of the delayed queues

    Parameters

    • taskName: string
    • params: {}

      Returns Promise<void>

    findEnqueuedTasks

    • findEnqueuedTasks(taskName: string): Promise<any[]>
    • Use the specHelper to find enqueued instances of a task This will return an array of instances of the task which have been enqueued either in the normal queues or delayed queues If a task is enqueued in a delayed queue, it will have a 'timestamp' property i.e. [ { class: 'regularTask', queue: 'testQueue', args: [ [Object] ] } ]

      Parameters

      • taskName: string

      Returns Promise<any[]>

    getStaticFile

    • getStaticFile(file: string): Promise<any>
    • Mock a specHelper connection requesting a file from the server.

      Parameters

      • file: string

      Returns Promise<any>

    runAction

    • runAction<A>(actionName: string, input?: {}): Promise<(A extends Action ? UnwrapPromise<A["run"]> : any) & { error?: any; messageId?: string; requesterInformation?: { fingerprint: any; id: any; messageId: any; receivedParams: {}; remoteIP: any }; serverInformation?: { apiVersion: any; currentTime: number; requestDuration: number; serverName: any } }>
    • Run an action via the specHelper server.

      Type parameters

      Parameters

      • actionName: string
      • input: {} = {}
        • [key: string]: any

      Returns Promise<(A extends Action ? UnwrapPromise<A["run"]> : any) & { error?: any; messageId?: string; requesterInformation?: { fingerprint: any; id: any; messageId: any; receivedParams: {}; remoteIP: any }; serverInformation?: { apiVersion: any; currentTime: number; requestDuration: number; serverName: any } }>

    runFullTask

    • runFullTask<T>(taskName: string, params: object | any[]): Promise<(T extends Task ? UnwrapPromise<T["run"]> : any) & { error?: string }>
    • Use the specHelper to run a task. Note: this will run a full Task worker, and will also include any middleware. This is slower than api.specHelper.runTask.

      Type parameters

      Parameters

      • taskName: string
      • params: object | any[]

      Returns Promise<(T extends Task ? UnwrapPromise<T["run"]> : any) & { error?: string }>

    runTask

    • runTask<T>(taskName: string, params: object | any[]): Promise<(T extends Task ? UnwrapPromise<T["run"]> : any) & { error?: string | Error }>
    • Use the specHelper to run a task. Note: this only runs the task's run() method, and no middleware. This is faster than api.specHelper.runFullTask.

      Type parameters

      Parameters

      • taskName: string
      • params: object | any[]

      Returns Promise<(T extends Task ? UnwrapPromise<T["run"]> : any) & { error?: string | Error }>

    Generated using TypeDoc