From db13b9afaa37f7d9fa5c21f4be90ab5418470e85 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 9 Oct 2024 14:34:43 +0530 Subject: [PATCH] feat: match types from maxun-core --- server/src/models/Robot.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/server/src/models/Robot.ts b/server/src/models/Robot.ts index cdc67bdc..444dcf2d 100644 --- a/server/src/models/Robot.ts +++ b/server/src/models/Robot.ts @@ -1,6 +1,7 @@ import { Model, DataTypes, Optional } from 'sequelize'; import sequelize from '../db/config'; import Run from './Run'; +import { WorkflowFile, Where, What, WhereWhatPair } from 'maxun-core'; interface RobotMeta { name: string; @@ -11,18 +12,8 @@ interface RobotMeta { params: any[]; } -interface Workflow { - where: { - url: string; - }; - what: Array<{ - action: string; - args: any[]; - }>; -} - interface Robot { - workflow: Workflow[]; + workflow: WhereWhatPair[]; } interface RobotAttributes { @@ -58,10 +49,10 @@ Robot.init( { sequelize, tableName: 'robot', - timestamps: false, // We'll manage timestamps manually in recording_meta + timestamps: false, } ); Robot.hasMany(Run, { foreignKey: 'robotId' }); -export default Robot; +export default Robot; \ No newline at end of file