feat: add webhook column model
This commit is contained in:
@@ -15,6 +15,19 @@ interface RobotWorkflow {
|
|||||||
workflow: WhereWhatPair[];
|
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 {
|
interface RobotAttributes {
|
||||||
id: string;
|
id: string;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
@@ -32,6 +45,7 @@ interface RobotAttributes {
|
|||||||
airtable_refresh_token?: string | null;
|
airtable_refresh_token?: string | null;
|
||||||
schedule?: ScheduleConfig | null;
|
schedule?: ScheduleConfig | null;
|
||||||
airtable_table_id?: string | null;
|
airtable_table_id?: string | null;
|
||||||
|
webhooks?: WebhookConfig[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ScheduleConfig {
|
interface ScheduleConfig {
|
||||||
@@ -66,6 +80,7 @@ class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements R
|
|||||||
public airtable_refresh_token!: string | null;
|
public airtable_refresh_token!: string | null;
|
||||||
public airtable_table_id!: string | null;
|
public airtable_table_id!: string | null;
|
||||||
public schedule!: ScheduleConfig | null;
|
public schedule!: ScheduleConfig | null;
|
||||||
|
public webhooks!: WebhookConfig[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Robot.init(
|
Robot.init(
|
||||||
@@ -135,6 +150,11 @@ Robot.init(
|
|||||||
type: DataTypes.JSONB,
|
type: DataTypes.JSONB,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
webhooks: {
|
||||||
|
type: DataTypes.JSONB,
|
||||||
|
allowNull: true,
|
||||||
|
defaultValue: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sequelize,
|
sequelize,
|
||||||
|
|||||||
Reference in New Issue
Block a user