import { logLevels } from '../constants/logging'; import ProgressBar from 'cli-progress'; export interface IPromptOptions { prompt?: string; type?: 'normal' | 'mask' | 'hide' | 'single'; timeout?: number; required?: boolean; default?: string; } export interface PrintOptions { bold?: boolean; color?: string; } export interface InquirePayload { type: string; name: string; default?: any; message: string; choices?: Array; transformer?: (value: any) => any; validate?(input: any, answers?: any): boolean | string | Promise; selectAll?: boolean; pageSize?: number; columns?: Record[]; rows?: Array; } export interface Region { name: string; cma: string; cda: string; uiHost: string; } export interface Token { token: string; apiKey: string; } export interface Organization { uid: string; name: string; } export interface selectedOrganization { orgUid: string; orgName: string; } export interface Stack { name: string; api_key: string; } export interface ContentType { uid: string; title: string; } export interface Environment { name: string; uid: string; } export interface Entry { uid: string; title: string; } export interface Locale { name: string; code: string; } export interface CliUXPromptOptions extends IPromptOptions { } export interface LoggerConfig { basePath: string; processName?: string; consoleLoggingEnabled?: boolean; consoleLogLevel?: LogType; logLevel?: LogType; } export interface PrintOptions { bold?: boolean; color?: string; } export type LogType = 'info' | 'warn' | 'error' | 'debug' | 'hidden' | 'success'; export type LogsType = LogType | PrintOptions | undefined; export type MessageType = string | Error | Record | Record[]; export type LogLevel = keyof typeof logLevels; export type ClassifiedError = { type: string; message: string; error: Record; debug?: Record; meta?: Record; context?: string; hidden?: boolean; stackTrace?: Record; }; export interface ErrorContextBase { operation?: string; component?: string; userId?: string; requestId?: string; email?: string; sessionId?: string; orgId?: string; apiKey?: string; } export type ErrorContext = ErrorContextBase & { [key: string]: unknown; }; export interface Failure { item: string; error: string | null; process?: string; } export interface ProcessProgress { name: string; total: number; current: number; status: 'pending' | 'active' | 'completed' | 'failed'; successCount: number; failureCount: number; failures: Failure[]; progressBar?: ProgressBar.SingleBar; } export interface ProgressManagerOptions { showConsoleLogs?: boolean; total?: number; moduleName?: string; enableNestedProgress?: boolean; } export interface ModuleResult { name: string; status: 'pending' | 'running' | 'completed' | 'failed'; startTime?: number; endTime?: number; totalItems: number; successCount: number; failureCount: number; failures: Array<{ item: string; error: string; }>; processes?: Array<{ processName: string; [key: string]: any; }>; } export interface SummaryOptions { operationName: string; context?: any; branchName?: string; } export interface ProgressResult { total: number; success: number; failures: number; } export type Answers = Record; export type InquirerQuestion = InquirePayload;