import {ProcedureField} from '@makeflow/types'; import {Dict} from 'tslang'; export type ValidValue = string | number | boolean; export type CommandConfigParameter = CommandConfigParameterConfig | string; export type CommandConfigOptionsConfig = | ValidValue | CommandConfigOptionsEnvConfig; export interface CommandConfigParameterConfig { name: string; displayName?: string; field?: ProcedureField.BuiltInProcedureFieldType; fieldData?: unknown; required: boolean; } export interface ICommandConfigOptionsConfig { type: string; key: string; required: boolean; } export interface CommandConfigOptionsEnvConfig extends ICommandConfigOptionsConfig { type: 'env'; } export type CommandConfigOptions = Dict; export type CommandConfigStdOutConfig = | { // 聚合输出 (默认) type: 'mash'; } | { // 实时输出 type: 'live'; }; export interface CommandConfig { displayName: string; name: string; type: string; source: string; manual: boolean; stdoutConfig?: CommandConfigStdOutConfig; parameters?: CommandConfigParameter[]; options?: CommandConfigOptions; } export type CommandParameters = Dict; export type CommandOptions = Dict; export interface CommandExecuteResult { output?: string; error?: string; } export interface Command { id: number; name: string; type: string; source: string; manual: boolean; parameters?: CommandParameters; deniedParameters?: CommandParameters; from?: string; createdAt: number; executedAt?: number; result?: CommandExecuteResult; }