feat: add webhook versioning (#23861)
* add webhook version schema * version the code * update version from numeric to date val * migration * update schema and build factory * update string * move version picker * tooltip instead of infobadge * -- * fix type * -- * fix type * fix type * -- * fix messed up merge * improvements to payloadfactory * extract version off of DB and instead keep it in IWebhookRepository * fix webhookform * fix type safety and routing ambiguity * scalable with easier factory extensions and base definition * fix types * -- * -- * clean up prisma/client type imports * fix * type fix * type fix * cleanup * add tests and registry changes * unintended file inclusion * type-fix * select in repo * -- * explicit return type * -- * fix type * fixes * feedback 1 * feedback 2 * use enum instead of string * fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger";
|
||||
import { IsArray, IsBoolean, IsEnum, IsOptional, IsString } from "class-validator";
|
||||
|
||||
import { WebhookTriggerEvents } from "@calcom/platform-libraries";
|
||||
import { WebhookTriggerEvents, WebhookVersion } from "@calcom/platform-libraries";
|
||||
|
||||
export class CreateWebhookInputDto {
|
||||
@IsString()
|
||||
@@ -48,6 +48,15 @@ export class CreateWebhookInputDto {
|
||||
@IsOptional()
|
||||
@ApiPropertyOptional()
|
||||
secret?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsEnum(WebhookVersion)
|
||||
@ApiPropertyOptional({
|
||||
description: "The version of the webhook",
|
||||
example: WebhookVersion.V_2021_10_20,
|
||||
enum: WebhookVersion,
|
||||
})
|
||||
version?: WebhookVersion;
|
||||
}
|
||||
|
||||
export class UpdateWebhookInputDto extends PartialType(CreateWebhookInputDto) {}
|
||||
|
||||
Reference in New Issue
Block a user