Files
cloudly/ts_interfaces/data/taskexecution.ts

84 lines
1.6 KiB
TypeScript
Raw Normal View History

/**
* Task execution tracking for the task management system
* Tasks themselves are hard-coded using @push.rocks/taskbuffer
* This interface tracks execution history and outcomes
*/
export interface ITaskExecution {
id: string;
data: {
/**
* Name of the task being executed
*/
taskName: string;
/**
* Optional description of what the task does
*/
taskDescription?: string;
/**
* Category for grouping tasks
*/
category?: 'maintenance' | 'deployment' | 'backup' | 'monitoring' | 'cleanup' | 'system' | 'security';
/**
* Timestamp when the task started
*/
startedAt: number;
/**
* Timestamp when the task completed
*/
completedAt?: number;
/**
* Current status of the task execution
*/
status: 'running' | 'completed' | 'failed' | 'cancelled';
/**
* Duration in milliseconds
*/
duration?: number;
/**
* How the task was triggered
*/
triggeredBy: 'schedule' | 'manual' | 'system';
/**
* User ID if manually triggered
*/
userId?: string;
/**
* Execution logs
*/
logs: Array<{
timestamp: number;
message: string;
severity: 'info' | 'warning' | 'error' | 'success';
}>;
/**
* Task-specific metrics
*/
metrics?: {
[key: string]: any;
};
/**
* Final result/output of the task
*/
result?: any;
/**
* Error details if the task failed
*/
error?: {
message: string;
stack?: string;
code?: string;
};
};
}