feat: add webhook column model

This commit is contained in:
Rohit
2025-05-27 20:08:01 +05:30
parent 2b12726d1b
commit 1777a598c1

View File

@@ -15,6 +15,19 @@ interface RobotWorkflow {
workflow: WhereWhatPair[];
}
interface WebhookConfig {
id: string;
url: string;
events: string[];
active: boolean;
createdAt: string;
updatedAt: string;
lastCalledAt?: string | null;
retryAttempts?: number;
retryDelay?: number;
timeout?: number;
}
interface RobotAttributes {
id: string;
userId?: number;
@@ -32,6 +45,7 @@ interface RobotAttributes {
airtable_refresh_token?: string | null;
schedule?: ScheduleConfig | null;
airtable_table_id?: string | null;
webhooks?: WebhookConfig[] | null;
}
interface ScheduleConfig {
@@ -66,6 +80,7 @@ class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements R
public airtable_refresh_token!: string | null;
public airtable_table_id!: string | null;
public schedule!: ScheduleConfig | null;
public webhooks!: WebhookConfig[] | null;
}
Robot.init(
@@ -135,6 +150,11 @@ Robot.init(
type: DataTypes.JSONB,
allowNull: true,
},
webhooks: {
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
},
},
{
sequelize,