File

src/webhooks/dto/create-webhook.dto.ts

Index

Properties

Properties

events
Type : string[]
Decorators :
@ApiProperty({example: undefined, description: 'Events to subscribe to'})
@IsArray()
@ArrayNotEmpty()
@IsString({each: true})
Optional secret
Type : string
Decorators :
@ApiPropertyOptional({description: 'HMAC signing secret. Auto-generated if not provided.'})
@IsOptional()
@IsString()
url
Type : string
Decorators :
@ApiProperty({example: 'https://erp.client.com/api/webhook', description: 'URL to receive webhook POST requests'})
@IsUrl({require_tld: false})
import { IsString, IsArray, IsOptional, IsUrl, ArrayNotEmpty } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreateWebhookDto {
  @ApiProperty({
    example: 'https://erp.client.com/api/webhook',
    description: 'URL to receive webhook POST requests',
  })
  @IsUrl({ require_tld: false })
  url: string;

  @ApiProperty({
    example: ['order.created', 'order.delivered', 'trip.completed'],
    description: 'Events to subscribe to',
  })
  @IsArray()
  @ArrayNotEmpty()
  @IsString({ each: true })
  events: string[];

  @ApiPropertyOptional({
    description: 'HMAC signing secret. Auto-generated if not provided.',
  })
  @IsOptional()
  @IsString()
  secret?: string;
}

results matching ""

    No results matching ""