Spaces:
Runtime error
Runtime error
| import { ApiProperty } from '@nestjs/swagger'; | |
| import { | |
| AllEvents, | |
| AllEventType, | |
| WAHAEvents, | |
| } from '@waha/structures/enums.dto'; | |
| import { Type } from 'class-transformer'; | |
| import { | |
| IsArray, | |
| IsEnum, | |
| IsIn, | |
| IsNumber, | |
| IsOptional, | |
| IsString, | |
| IsUrl, | |
| ValidateNested, | |
| } from 'class-validator'; | |
| import { each } from 'lodash'; | |
| export enum RetryPolicy { | |
| LINEAR = 'linear', | |
| EXPONENTIAL = 'exponential', | |
| CONSTANT = 'constant', | |
| } | |
| export class RetriesConfiguration { | |
| ({ | |
| example: 2, | |
| }) | |
| () | |
| () | |
| delaySeconds?: number; | |
| ({ | |
| example: 15, | |
| }) | |
| () | |
| () | |
| attempts?: number; | |
| ({ | |
| example: RetryPolicy.LINEAR, | |
| }) | |
| () | |
| (RetryPolicy) | |
| policy?: RetryPolicy; | |
| } | |
| export class CustomHeader { | |
| ({ | |
| example: 'X-My-Custom-Header', | |
| }) | |
| () | |
| name: string; | |
| ({ | |
| example: 'Value', | |
| }) | |
| () | |
| value: string; | |
| } | |
| export class HmacConfiguration { | |
| ({ | |
| example: 'your-secret-key', | |
| }) | |
| () | |
| () | |
| key?: string; | |
| } | |
| export class WebhookConfig { | |
| ({ | |
| example: 'https://webhook.site/11111111-1111-1111-1111-11111111', | |
| required: true, | |
| description: | |
| 'You can use https://docs.webhook.site/ to test webhooks and see the payload', | |
| }) | |
| ({ | |
| protocols: ['http', 'https'], | |
| require_protocol: true, | |
| require_tld: false, | |
| }) | |
| url: string; | |
| ({ | |
| example: ['message', 'session.status'], | |
| required: true, | |
| }) | |
| (AllEvents, { each: true }) | |
| () | |
| events: AllEventType[]; | |
| ({ | |
| example: null, | |
| }) | |
| () | |
| (() => HmacConfiguration) | |
| () | |
| hmac?: HmacConfiguration; | |
| ({ | |
| example: null, | |
| }) | |
| () | |
| (() => RetriesConfiguration) | |
| () | |
| retries?: RetriesConfiguration; | |
| ({ | |
| example: null, | |
| }) | |
| () | |
| (() => CustomHeader) | |
| () | |
| () | |
| customHeaders?: CustomHeader[]; | |
| } | |