adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
184 lines • 5.49 kB
TypeScript
/**
* Inquirer Validators
*
* Custom validators for inquirer prompts that integrate with the existing
* InputValidationService for consistent validation across the CLI.
*
* @version 1.0.0
* @author ADPA Team
*/
/**
* Validator factory for inquirer prompts
*/
export declare class InquirerValidators {
/**
* Create a validator for project names
*/
static projectName(): (input: string) => boolean | string;
/**
* Create a validator for file paths
*/
static filePath(): (input: string) => boolean | string;
/**
* Create a validator for URLs
*/
static url(): (input: string) => boolean | string;
/**
* Create a validator for email addresses
*/
static email(): (input: string) => boolean | string;
/**
* Create a validator for API keys
*/
static apiKey(provider?: string): (input: string) => boolean | string;
/**
* Create a validator for numbers
*/
static number(min?: number, max?: number): (input: string) => boolean | string;
/**
* Create a validator for required text
*/
static required(fieldName?: string): (input: string) => boolean | string;
/**
* Create a validator for text with minimum length
*/
static minLength(minLength: number, fieldName?: string): (input: string) => boolean | string;
/**
* Create a validator for text with maximum length
*/
static maxLength(maxLength: number, fieldName?: string): (input: string) => boolean | string;
/**
* Create a validator that combines multiple validators
*/
static combine(...validators: Array<(input: string) => boolean | string>): (input: string) => boolean | string;
/**
* Create a validator for allowed values
*/
static allowedValues(allowedValues: string[], caseSensitive?: boolean): (input: string) => boolean | string;
/**
* Create a validator for regex patterns
*/
static pattern(pattern: RegExp, errorMessage: string): (input: string) => boolean | string;
/**
* Create a conditional validator
*/
static conditional(condition: (input: string) => boolean, validator: (input: string) => boolean | string): (input: string) => boolean | string;
}
/**
* Filter factory for inquirer prompts
*/
export declare class InquirerFilters {
/**
* Trim whitespace
*/
static trim(): (input: string) => string;
/**
* Convert to lowercase
*/
static toLowerCase(): (input: string) => string;
/**
* Convert to uppercase
*/
static toUpperCase(): (input: string) => string;
/**
* Sanitize input using InputValidationService
*/
static sanitize(): (input: string) => string;
/**
* Parse number
*/
static parseNumber(): (input: string) => number;
/**
* Parse integer
*/
static parseInt(): (input: string) => number;
/**
* Combine multiple filters
*/
static combine(...filters: Array<(input: any) => any>): (input: any) => any;
}
/**
* Common prompt configurations
*/
export declare class InquirerPrompts {
/**
* Create a project name prompt
*/
static projectName(message?: string, defaultValue?: string): {
type: "input";
name: string;
message: string;
default: string | undefined;
validate: (input: string) => boolean | string;
filter: (input: string) => string;
};
/**
* Create an API key prompt
*/
static apiKey(provider: string, message?: string): {
type: "password";
name: string;
message: string;
validate: (input: string) => boolean | string;
filter: (input: string) => string;
};
/**
* Create a confirmation prompt
*/
static confirm(message: string, defaultValue?: boolean): {
type: "confirm";
name: string;
message: string;
default: boolean;
};
/**
* Create a list selection prompt
*/
static list(name: string, message: string, choices: any[], defaultValue?: any): {
type: "list";
name: string;
message: string;
choices: any[];
default: any;
pageSize: number;
};
/**
* Create a checkbox selection prompt
*/
static checkbox(name: string, message: string, choices: any[]): {
type: "checkbox";
name: string;
message: string;
choices: any[];
pageSize: number;
validate: (answer: any[]) => true | "You must choose at least one option";
};
/**
* Create a text input prompt
*/
static input(name: string, message: string, required?: boolean, defaultValue?: string): {
type: "input";
name: string;
message: string;
default: string | undefined;
validate: (input: string) => boolean | string;
filter: (input: string) => string;
};
/**
* Create a password input prompt
*/
static password(name: string, message: string, minLength?: number): {
type: "password";
name: string;
message: string;
validate: (input: string) => boolean | string;
filter: (input: string) => string;
};
}
declare const _default: {
InquirerValidators: typeof InquirerValidators;
InquirerFilters: typeof InquirerFilters;
InquirerPrompts: typeof InquirerPrompts;
};
export default _default;
//# sourceMappingURL=InquirerValidators.d.ts.map