tdpw
Version:
CLI tool for uploading Playwright test reports to TestDino platform with TestDino storage support
67 lines • 1.88 kB
TypeScript
/**
* Validation utilities for configuration and input
*/
import { z } from 'zod';
/**
* Validation result type
*/
export interface ValidationResult<T> {
success: boolean;
data?: T;
errors?: string[];
}
/**
* Configuration validation utilities
*/
export declare class ValidationUtils {
/**
* Validate data against a Zod schema with user-friendly error messages
*/
static validateSchema<T>(schema: z.ZodSchema<T>, data: unknown, context: string): ValidationResult<T>;
/**
* Validate and throw appropriate error with context
*/
static validateOrThrow<T>(schema: z.ZodSchema<T>, data: unknown, context: string): T;
/**
* Validate API token format with detailed feedback
*/
static validateApiToken(token: string): void;
/**
* Validate URL format with helpful feedback
*/
static validateUrl(url: string, context: string): void;
/**
* Validate file path exists and is accessible
*/
static validateFilePath(path: string, context: string): void;
/**
* Validate Node.js version requirement
*/
static validateNodeVersion(requiredVersion?: string): void;
/**
* Parse semantic version string
*/
private static parseVersion;
/**
* Compare two semantic versions
* Returns: -1 if a < b, 0 if a === b, 1 if a > b
*/
private static compareVersions;
/**
* Validate environment variable name
*/
static validateEnvVarName(name: string): void;
/**
* Sanitize and validate file size
*/
static validateFileSize(size: number, maxSize: number, filename: string): void;
/**
* Validate timeout value
*/
static validateTimeout(timeout: number): void;
/**
* Validate retry count
*/
static validateRetryCount(retries: number): void;
}
//# sourceMappingURL=validation.d.ts.map