UNPKG

@nestjs-mod/webhook

Version:

Webhook module with an error filter, guard, controller, database migrations and rest-sdk for work with module from other nodejs appliaction

94 lines (93 loc) 3.74 kB
import { PrismaToolsService } from '@nestjs-mod/prisma-tools'; import { TranslatesService, TranslatesStorage } from 'nestjs-translates'; import { PrismaClient } from '../generated/prisma-client'; import { CreateWebhookDto } from '../generated/rest-dto/create-webhook.dto'; import { UpdateWebhookDto } from '../generated/rest-dto/update-webhook.dto'; import { WebhookUser } from '../generated/rest-dto/webhook-user.entity'; import { WebhookService } from '../services/webhook.service'; import { FindManyWebhookArgs } from '../types/find-many-webhook-args'; import { WebhookTestRequestResponse } from '../types/webhook-test-request-response'; export declare class WebhookController { private readonly prismaClient; private readonly prismaToolsService; private readonly webhookService; private readonly translatesService; private readonly translatesStorage; constructor(prismaClient: PrismaClient, prismaToolsService: PrismaToolsService, webhookService: WebhookService, translatesService: TranslatesService, translatesStorage: TranslatesStorage); profile(webhookUser: WebhookUser): Promise<WebhookUser>; events(): Promise<{ descriptionLocale: { en: string; }; eventName: string; description: string; example: object; }[]>; findMany(externalTenantId: string, webhookUser: WebhookUser, args: FindManyWebhookArgs): Promise<{ webhooks: { eventName: string; id: string; externalTenantId: string; createdAt: Date; updatedAt: Date; endpoint: string; enabled: boolean; headers: import("@prisma/client/runtime/client").JsonValue | null; requestTimeout: number | null; createdBy: string; updatedBy: string; workUntilDate: Date | null; }[]; meta: { totalResults: number; curPage: number; perPage: number; }; }>; testRequest(externalTenantId: string, args: CreateWebhookDto): Promise<WebhookTestRequestResponse>; createOne(externalTenantId: string, webhookUser: WebhookUser, args: CreateWebhookDto): Promise<{ eventName: string; id: string; externalTenantId: string; createdAt: Date; updatedAt: Date; endpoint: string; enabled: boolean; headers: import("@prisma/client/runtime/client").JsonValue | null; requestTimeout: number | null; createdBy: string; updatedBy: string; workUntilDate: Date | null; }>; updateOne(externalTenantId: string, webhookUser: WebhookUser, id: string, args: UpdateWebhookDto): Promise<{ eventName: string; id: string; externalTenantId: string; createdAt: Date; updatedAt: Date; endpoint: string; enabled: boolean; headers: import("@prisma/client/runtime/client").JsonValue | null; requestTimeout: number | null; createdBy: string; updatedBy: string; workUntilDate: Date | null; }>; deleteOne(externalTenantId: string, webhookUser: WebhookUser, id: string, locale: string): Promise<{ message: string; }>; findOne(externalTenantId: string, webhookUser: WebhookUser, id: string): Promise<{ eventName: string; id: string; externalTenantId: string; createdAt: Date; updatedAt: Date; endpoint: string; enabled: boolean; headers: import("@prisma/client/runtime/client").JsonValue | null; requestTimeout: number | null; createdBy: string; updatedBy: string; workUntilDate: Date | null; }>; }