Files
crawlab/frontend/crawlab-ui/typings/interfaces/models/dependency.d.ts
Marvin Zhang b5f10cb6a8 feat: add TypeScript interfaces for Vuex store modules
- Introduced new interfaces for various store modules including environment, file, git, layout, node, notification alerts, channels, requests, settings, plugins, projects, roles, schedules, spiders, systems, tags, tasks, tokens, and users.
- Each module includes state, getters, mutations, and actions definitions to enhance type safety and maintainability.
- Added utility interfaces for file handling and view-specific types for database, git, login, node, project, result, schedule, spider, task, and user.
- Improved overall structure and organization of TypeScript typings for better developer experience.
2025-09-12 14:57:42 +08:00

93 lines
2.0 KiB
TypeScript

export declare global {
interface DependencyConfig extends BaseModel {
key?: string;
name?: string;
enabled?: boolean;
exec_cmd?: string;
pkg_cmd?: string;
pkg_src_url?: string;
setup?: boolean;
search_ready?: boolean;
total_dependencies?: number;
}
interface DependencyConfigSetup extends BaseModel {
dependency_config_id?: string;
node_id?: string;
version?: string;
status?: DependencyStatus;
error?: string;
node?: CNode;
}
type DependencyStatus =
| 'installing'
| 'installed'
| 'uninstalling'
| 'uninstalled'
| 'error'
| 'abnormal';
type DependencyFileType = 'requirements.txt' | 'package.json';
interface Dependency extends BaseModel {
node_id?: string;
type?: string;
name?: string;
version?: string;
latest_version?: string;
description?: string;
status?: DependencyStatus;
error?: string;
}
interface DependencyRepo {
name?: string;
node_ids?: string[];
versions?: string[];
latest_version?: string;
type?: DependencyLang;
dependencies?: Dependency[];
}
interface DependencyRequirement {
name?: string;
version?: string;
dependencies?: Dependency[];
latest_version?: string;
type?: DependencyLang;
}
type DependencyRepoTabName = 'installed' | 'search' | 'nodes';
interface DependencyLog extends BaseModel {
dependency_id?: string;
content?: string;
}
interface DependencyInstallForm {
mode?: 'all' | 'selected-nodes';
name?: string;
version?: string;
node_ids?: string[];
nodes?: CNode[];
}
interface DependencyUninstallForm {
mode?: 'all' | 'selected-nodes';
names?: string[];
node_ids?: string[];
nodes?: CNode[];
}
interface DependencySetupForm {
node_id?: string;
version?: string;
mode?: 'all' | 'selected-nodes';
node_ids?: string[];
nodes?: CNode[];
}
type DependencyLang = 'python' | 'node' | 'go' | 'java' | 'browser';
}