feat(gateway): include production Telegram user gateway
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.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user