feat: match types from maxun-core

This commit is contained in:
karishmas6
2024-10-09 14:34:43 +05:30
parent d303afc2af
commit db13b9afaa

View File

@@ -1,6 +1,7 @@
import { Model, DataTypes, Optional } from 'sequelize'; import { Model, DataTypes, Optional } from 'sequelize';
import sequelize from '../db/config'; import sequelize from '../db/config';
import Run from './Run'; import Run from './Run';
import { WorkflowFile, Where, What, WhereWhatPair } from 'maxun-core';
interface RobotMeta { interface RobotMeta {
name: string; name: string;
@@ -11,18 +12,8 @@ interface RobotMeta {
params: any[]; params: any[];
} }
interface Workflow {
where: {
url: string;
};
what: Array<{
action: string;
args: any[];
}>;
}
interface Robot { interface Robot {
workflow: Workflow[]; workflow: WhereWhatPair[];
} }
interface RobotAttributes { interface RobotAttributes {
@@ -58,10 +49,10 @@ Robot.init(
{ {
sequelize, sequelize,
tableName: 'robot', tableName: 'robot',
timestamps: false, // We'll manage timestamps manually in recording_meta timestamps: false,
} }
); );
Robot.hasMany(Run, { foreignKey: 'robotId' }); Robot.hasMany(Run, { foreignKey: 'robotId' });
export default Robot; export default Robot;