credl-parser-evaluator
Version:
TypeScript-based CREDL Parser and Evaluator that processes CREDL files and outputs complete Intermediate Representations
378 lines • 9.98 kB
TypeScript
export interface BaseCommandOptions {
quiet?: boolean;
verbose?: boolean;
output?: string;
format?: string;
}
export interface RunCommandOptions extends BaseCommandOptions {
format?: 'json' | 'pretty' | 'summary';
'fail-fast'?: boolean;
'include-metadata'?: boolean;
'resolve-presets'?: boolean;
'resolve-templates'?: boolean;
'validate-references'?: boolean;
}
export interface ValidateCommandOptions extends BaseCommandOptions {
format?: 'table' | 'json' | 'summary';
'fail-fast'?: boolean;
strict?: boolean;
'check-references'?: boolean;
'exit-code'?: boolean;
}
export interface ConvertCommandOptions extends BaseCommandOptions {
format?: 'json' | 'pretty';
'skip-validation'?: boolean;
'include-metadata'?: boolean;
'resolve-presets'?: boolean;
'resolve-templates'?: boolean;
'validate-references'?: boolean;
'generate-ids'?: boolean;
}
export interface InitCommandOptions extends BaseCommandOptions {
type?: string;
name?: string;
location?: string;
description?: string;
author?: string;
force?: boolean;
template?: string;
}
export interface TestCommandOptions extends BaseCommandOptions {
single?: string;
watch?: boolean;
coverage?: boolean;
ci?: boolean;
performance?: boolean;
examples?: boolean;
pattern?: string;
'max-workers'?: number;
timeout?: number;
}
export interface BenchmarkCommandOptions extends BaseCommandOptions {
file?: string;
format?: 'table' | 'json' | 'csv';
iterations?: number;
warmup?: number;
compare?: string;
history?: boolean;
suite?: 'quick' | 'standard' | 'comprehensive';
threshold?: number;
memory?: boolean;
concurrent?: number;
profile?: boolean;
}
export interface CLIConfig {
defaultFormat: string;
outputDirectory: string;
templateDirectory: string;
benchmarkDirectory: string;
verbose: boolean;
quiet: boolean;
colorOutput: boolean;
author?: string;
organization?: string;
}
export interface GlobalOptions {
quiet?: boolean;
verbose?: boolean;
noColor?: boolean;
config?: string;
help?: boolean;
version?: boolean;
}
export interface CommandResult {
success: boolean;
message?: string;
data?: any;
errors?: string[];
warnings?: string[];
executionTime: number;
outputPath?: string;
}
export interface FileProcessingResult {
filePath: string;
status: 'success' | 'error' | 'warning';
processingTime: number;
errors: string[];
warnings: string[];
metadata?: {
spaces: number;
assumptions: number;
models: number;
fileSize: number;
};
}
export interface ValidationResult {
isValid: boolean;
errors: ValidationError[];
warnings: ValidationWarning[];
file: string;
processingTime: number;
summary: {
totalChecks: number;
passedChecks: number;
failedChecks: number;
warningChecks: number;
};
}
export interface ValidationError {
field: string;
message: string;
line?: number;
column?: number;
severity: 'error' | 'warning';
code?: string;
}
export interface ValidationWarning {
field: string;
message: string;
line?: number;
column?: number;
suggestion?: string;
}
export interface TemplateInfo {
id: string;
name: string;
description: string;
icon: string;
category: string;
variables: TemplateVariable[];
examples?: string[];
}
export interface TemplateVariable {
name: string;
type: 'string' | 'number' | 'boolean' | 'select' | 'date';
description: string;
required: boolean;
defaultValue?: any;
options?: string[];
validation?: {
min?: number;
max?: number;
pattern?: string;
message?: string;
};
}
export interface ProjectInitData {
projectName: string;
propertyType: string;
location?: string;
description?: string;
author?: string;
outputPath: string;
templateVariables: Record<string, any>;
}
export interface BenchmarkResult {
name: string;
file?: string;
configuration: BenchmarkConfiguration;
results: BenchmarkMetrics;
metadata: BenchmarkMetadata;
}
export interface BenchmarkConfiguration {
iterations: number;
warmupIterations: number;
suite: string;
concurrency: number;
memoryTracking: boolean;
}
export interface BenchmarkMetrics {
min: number;
max: number;
mean: number;
median: number;
stddev: number;
p95: number;
p99: number;
throughput?: number;
memory?: MemoryMetrics;
}
export interface MemoryMetrics {
heapUsed: number;
heapTotal: number;
rss: number;
external: number;
peak?: number;
}
export interface BenchmarkMetadata {
timestamp: string;
version: string;
nodeVersion: string;
platform: string;
cpuModel?: string;
memoryTotal?: number;
}
export interface ProgressInfo {
current: number;
total: number;
percentage: number;
message?: string;
stage?: string;
eta?: number;
}
export interface ProcessingStatus {
stage: ProcessingStage;
progress: ProgressInfo;
startTime: number;
estimatedEndTime?: number;
}
export type ProcessingStage = 'initializing' | 'parsing' | 'validating' | 'processing' | 'generating' | 'formatting' | 'writing' | 'complete' | 'error';
export interface CLIError {
code: string;
message: string;
details?: string;
suggestions?: string[];
exitCode: number;
stack?: string;
}
export interface ErrorContext {
command: string;
options: Record<string, any>;
filePath?: string;
stage?: ProcessingStage;
timestamp: number;
}
export interface FileOperation {
type: 'read' | 'write' | 'validate' | 'process' | 'copy' | 'move' | 'delete';
source?: string;
destination?: string;
options?: Record<string, any>;
status: 'pending' | 'running' | 'completed' | 'failed';
startTime?: number;
endTime?: number;
error?: string;
}
export interface BatchOperation {
id: string;
description: string;
operations: FileOperation[];
status: 'pending' | 'running' | 'completed' | 'failed';
progress: ProgressInfo;
startTime: number;
endTime?: number;
summary?: {
successful: number;
failed: number;
skipped: number;
};
}
export interface OutputFormat {
type: 'table' | 'json' | 'csv' | 'yaml' | 'summary';
options?: {
indent?: number;
sortKeys?: boolean;
includeHeaders?: boolean;
delimiter?: string;
colorize?: boolean;
compact?: boolean;
};
}
export interface TableConfig {
columns: TableColumn[];
maxWidth?: number;
showHeaders?: boolean;
sortBy?: string;
sortOrder?: 'asc' | 'desc';
filter?: (row: any) => boolean;
}
export interface TableColumn {
key: string;
header: string;
width?: number;
align?: 'left' | 'right' | 'center';
formatter?: (value: any) => string;
sortable?: boolean;
}
export interface CLIPlugin {
name: string;
version: string;
description: string;
commands?: PluginCommand[];
hooks?: PluginHook[];
dependencies?: string[];
}
export interface PluginCommand {
name: string;
description: string;
handler: (options: any) => Promise<CommandResult>;
options?: CommandOption[];
}
export interface PluginHook {
event: HookEvent;
priority: number;
handler: (context: any) => Promise<void>;
}
export type HookEvent = 'before-parse' | 'after-parse' | 'before-validate' | 'after-validate' | 'before-process' | 'after-process' | 'before-output' | 'after-output';
export interface CommandOption {
name: string;
description: string;
type: 'string' | 'number' | 'boolean';
required?: boolean;
defaultValue?: any;
choices?: string[];
}
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
};
export type RequiredKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;
export type OptionalKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
export interface CommandContext {
command: string;
options: Record<string, any>;
args: string[];
cwd: string;
startTime: number;
config: CLIConfig;
logger: Logger;
}
export interface Logger {
debug(message: string, data?: any): void;
info(message: string, data?: any): void;
warn(message: string, data?: any): void;
error(message: string, error?: Error): void;
verbose(message: string, data?: any): void;
}
export declare enum ExitCode {
SUCCESS = 0,
GENERAL_ERROR = 1,
INVALID_ARGUMENT = 2,
FILE_NOT_FOUND = 3,
PERMISSION_DENIED = 4,
VALIDATION_ERROR = 5,
PROCESSING_ERROR = 6,
OUTPUT_ERROR = 7,
TIMEOUT_ERROR = 8,
INTERRUPTED = 9,
CONFIG_ERROR = 10
}
export declare enum LogLevel {
SILENT = 0,
ERROR = 1,
WARN = 2,
INFO = 3,
VERBOSE = 4,
DEBUG = 5
}
export declare function isValidationError(error: any): error is ValidationError;
export declare function isCLIError(error: any): error is CLIError;
export declare function isCommandResult(result: any): result is CommandResult;
export declare const DEFAULT_CLI_CONFIG: CLIConfig;
export declare const DEFAULT_TABLE_CONFIG: TableConfig;
export declare const DEFAULT_OUTPUT_FORMAT: OutputFormat;
export interface CommandMetadata {
name: string;
description: string;
usage: string;
examples: string[];
options: CommandOption[];
aliases?: string[];
category: 'core' | 'developer' | 'utility';
version: string;
stability: 'stable' | 'beta' | 'experimental';
}
export declare const COMMAND_CATEGORIES: {
readonly core: "Core Commands";
readonly developer: "Developer Commands";
readonly utility: "Utility Commands";
};
//# sourceMappingURL=cli-types.d.ts.map