06112602ec
Version the NestJS TDLib gateway with Docker deployment, migrations, automated tests and platform integration documentation while excluding all account sessions, credentials, runtime databases and backups.
57 lines
1023 B
TypeScript
57 lines
1023 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
Index,
|
|
} from 'typeorm';
|
|
|
|
export enum DeliveryStatus {
|
|
PENDING = 'pending',
|
|
SUCCESS = 'success',
|
|
FAILED = 'failed',
|
|
RETRYING = 'retrying',
|
|
DEAD_LETTER = 'dead_letter',
|
|
}
|
|
|
|
@Entity('tg_webhook_deliveries')
|
|
export class TgWebhookDelivery {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Index()
|
|
@Column()
|
|
subscriptionId: string;
|
|
|
|
@Column({ length: 1000 })
|
|
url: string;
|
|
|
|
@Column({ type: 'simple-json' })
|
|
payload: Record<string, unknown>;
|
|
|
|
@Column({
|
|
type: 'varchar', length: 50,
|
|
default: DeliveryStatus.PENDING,
|
|
})
|
|
status: DeliveryStatus;
|
|
|
|
@Column({ type: 'int', nullable: true })
|
|
responseCode: number;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
responseBody: string;
|
|
|
|
@Column({ type: 'int', default: 0 })
|
|
attempt: number;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
errorMessage: string;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
}
|