UNPKG

@squareboat/nest-eyewitness

Version:

A simple easy-to-use package to receive error reports directly to your inbox whenever any exception is witnessed 👀 in your NestJS application.

29 lines (28 loc) • 967 B
import { ModuleMetadata, Type } from "@nestjs/common/interfaces"; import { MailmanOptions } from "@squareboat/nest-mailman"; export declare enum WebhookSupportMethod { GET = "GET", POST = "POST" } export interface WebhookOptions { url: string; method: keyof typeof WebhookSupportMethod; header?: Record<string, any>; requestBuilder?: (payload: any) => Record<string, any>; } export interface EyewitnessOptions { emails: string[]; subject?: string; mailman: MailmanOptions; webhooks?: WebhookOptions[]; } export interface EyewitnessOptionsFactory { createEyewitnessOptions(): Promise<EyewitnessOptions> | EyewitnessOptions; } export interface EyewitnessAsyncOptions extends Pick<ModuleMetadata, "imports"> { name?: string; useExisting?: Type<EyewitnessOptions>; useClass?: Type<EyewitnessOptionsFactory>; useFactory?: (...args: any[]) => Promise<EyewitnessOptions> | EyewitnessOptions; inject?: any[]; }