import { BaseCommand } from '../../modules/ace/main.ts'; import { type CommandOptions } from '../../types/ace.ts'; /** * Command to create a new VineJS validator file. * Validators define reusable validation schemas for request validation, * and can be generated as simple validators or resource-based validators * with create and update schemas. * * @example * ``` * ace make:validator UserValidator * ace make:validator PostValidator --resource * ace make:validator ContactValidator * ``` */ export default class MakeValidator extends BaseCommand { /** * The command name */ static commandName: string; /** * The command description */ static description: string; /** * Command options configuration. * Allows unknown flags to be passed through. */ static options: CommandOptions; /** * Name of the validator file to create */ name: string; /** * Generate a resource validator with create and update schemas */ resource: boolean; /** * Read the contents from this file (if the flag exists) and use * it as the raw contents */ contentsFrom: string; /** * Forcefully overwrite existing files */ force: boolean; /** * The stub template file to use for generating the validator */ protected stubPath: string; /** * Prepare the command by selecting the appropriate stub based on options. * Uses a resource stub when generating validators for CRUD operations. */ prepare(): Promise; /** * Execute the command to create a new VineJS validator file. * Generates the validator with the appropriate stub template. */ run(): Promise; }