interface WebhooksService {
    create(webhook: Webhook): Promise<SavedWebhook>;
    getById(id: string): Promise<SavedWebhook>;
    list(query?: FilterQuery<Webhook>): Promise<SavedWebhook[]>;
    listForDispatch(
        modelName: constants.models.ModelName,
        eventName: EventName,
    ): Promise<SavedWebhook[]>;
    paginate(
        options?: PaginateQueryOptions<SavedWebhook>,
    ): Promise<PaginationResponse>;
    recordExecution(hookId: string, modelId: string): Promise<void>;
    updateById(id: string, webhook: Partial<Webhook>): Promise<SavedWebhook>;
}

Hierarchy

  • BaseHooksService<SavedWebhook>
    • WebhooksService

Methods

  • Record the execution of a hook in the database

    Parameters

    • hookId: string

      The ID of the hook

    • modelId: string

      The ID of the model that triggered the hook

    Returns Promise<void>