src/webhooks/dto/create-webhook.dto.ts
Properties |
| events |
Type : string[]
|
Decorators :
@ApiProperty({example: undefined, description: 'Events to subscribe to'})
|
|
Defined in src/webhooks/dto/create-webhook.dto.ts:19
|
| Optional secret |
Type : string
|
Decorators :
@ApiPropertyOptional({description: 'HMAC signing secret. Auto-generated if not provided.'})
|
|
Defined in src/webhooks/dto/create-webhook.dto.ts:26
|
| url |
Type : string
|
Decorators :
@ApiProperty({example: 'https://erp.client.com/api/webhook', description: 'URL to receive webhook POST requests'})
|
|
Defined in src/webhooks/dto/create-webhook.dto.ts:10
|
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;
}