Description
A Webhook Endpoint is a reusable notification target that receives
fire-and-forget event callbacks (e.g. credential_accepted / credential_failed).
Webhook Endpoints are configured once per tenant and can be
referenced by credential configurations via webhookEndpointId or
per-offer via webhookEndpointId on the offer request.
|
Optional
description
|
Type : string | null
|
Decorators :
@ApiPropertyOptional({description: 'Webhook endpoint description'}) @Column('varchar', {nullable: true})
|
|
|
|
id
|
Type : string
|
Decorators :
@ApiProperty({description: 'Unique identifier for the webhook endpoint'}) @PrimaryColumn('varchar')
|
|
|
|
name
|
Type : string
|
Decorators :
@ApiProperty({description: 'Webhook endpoint name'}) @Column('varchar')
|
|
|
|
tenant
|
Type : TenantEntity
|
Decorators :
@ManyToOne(undefined, {cascade: true, onDelete: 'CASCADE'})
|
|
|
|
tenantId
|
Type : string
|
Decorators :
@ApiProperty({description: 'Tenant identifier'}) @Column('varchar', {primary: true})
|
|
|
|
url
|
Type : string
|
Decorators :
@ApiProperty({description: 'Webhook endpoint URL'}) @Column('varchar')
|
|
|
import {
ApiProperty,
ApiPropertyOptional,
getSchemaPath,
} from "@nestjs/swagger";
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { TenantEntity } from "../../../../auth/tenant/entities/tenant.entity";
import {
WebHookAuthConfigHeader,
WebHookAuthConfigNone,
} from "../../../../webhook/webhook.dto";
/**
* A Webhook Endpoint is a reusable notification target that receives
* fire-and-forget event callbacks (e.g. credential_accepted / credential_failed).
*
* Webhook Endpoints are configured once per tenant and can be
* referenced by credential configurations via `webhookEndpointId` or
* per-offer via `webhookEndpointId` on the offer request.
*/
@Entity()
export class WebhookEndpointEntity {
@ApiProperty({
description: "Unique identifier for the webhook endpoint",
})
@PrimaryColumn("varchar")
id!: string;
@ApiProperty({ description: "Tenant identifier" })
@Column("varchar", { primary: true })
tenantId!: string;
@ManyToOne(() => TenantEntity, { cascade: true, onDelete: "CASCADE" })
tenant!: TenantEntity;
@ApiProperty({ description: "Webhook endpoint name" })
@Column("varchar")
name!: string;
@ApiPropertyOptional({ description: "Webhook endpoint description" })
@Column("varchar", { nullable: true })
description?: string | null;
@ApiProperty({ description: "Webhook endpoint URL" })
@Column("varchar")
url!: string;
@ApiProperty({
oneOf: [
{ $ref: getSchemaPath(WebHookAuthConfigNone) },
{ $ref: getSchemaPath(WebHookAuthConfigHeader) },
],
})
@Column("json")
auth!: WebHookAuthConfigNone | WebHookAuthConfigHeader;
}