Skip to content
Français

TriggerSource

import type { TriggerSource } from "@elie-laloum/outpost";
  • nameRequired
    string
    Source name reported in TriggerEvent.source.
  • verifyRequired
    (request: TriggerHttpRequest, now: number) => Promise<TriggerEvent>
    Authenticate the request and return the normalized event; throwing rejects it with 401.
  • replyOptional
    ((outcome: TriggerOutcome, job?: string) => TriggerReply) | undefined
    Replace the default replies, 202 with the job id as JSON or 204 for an ignored event, for senders expecting another status, such as Slack.
export interface TriggerSource {
  readonly name: string;
  verify(request: TriggerHttpRequest, now: number): Promise<TriggerEvent>;
  /** Overrides the default 202/204 replies when the sender expects another status. */
  reply?(outcome: TriggerOutcome, job?: string): TriggerReply;
}