/** * Smart test value generation for schema-based testing. * * This module provides intelligent value generation for test cases by: * 1. Recognizing semantic patterns in field names and descriptions * 2. Respecting JSON Schema format fields * 3. Generating syntactically and semantically valid test values * * The goal is to generate values that are more likely to be accepted by * real-world tools, rather than random strings that get rejected. */ /** * Pattern matchers for detecting date/time formats. */ export declare const DATE_TIME_PATTERNS: { /** Field name patterns that suggest date fields */ readonly FIELD_NAME: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp]; /** Description patterns that suggest date formats */ readonly DESCRIPTION: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp]; /** Default date value if format not specified */ readonly DEFAULT_DATE: "2024-01-15"; readonly DEFAULT_DATETIME: "2024-01-15T14:30:00Z"; readonly DEFAULT_TIME: "14:30:00"; }; /** * Pattern matchers for detecting email fields. */ export declare const EMAIL_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp, RegExp]; /** Default email value */ readonly DEFAULT: "test@example.com"; }; /** * Pattern matchers for detecting URL fields. */ export declare const URL_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp, RegExp, RegExp]; /** Default URL value */ readonly DEFAULT: "https://example.com"; }; /** * Pattern matchers for detecting ID fields. */ export declare const ID_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp, RegExp, RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp, RegExp]; /** Default ID value */ readonly DEFAULT: "test-id-123"; readonly DEFAULT_UUID: "550e8400-e29b-41d4-a716-446655440000"; }; /** * Pattern matchers for detecting phone fields. */ export declare const PHONE_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp, RegExp]; /** Default phone value */ readonly DEFAULT: "+1-555-123-4567"; }; /** * Pattern matchers for detecting monetary/amount fields. */ export declare const AMOUNT_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp, RegExp, RegExp, RegExp]; /** Default amount value */ readonly DEFAULT: "100.00"; }; /** * Pattern matchers for detecting month fields. */ export declare const MONTH_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp]; /** Valid month names */ readonly VALID_VALUES: readonly ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"]; /** Default month value */ readonly DEFAULT: "january"; readonly DEFAULT_NUMERIC: "01"; }; /** * Pattern matchers for detecting year fields. */ export declare const YEAR_PATTERNS: { /** Field name patterns */ readonly FIELD_NAME: readonly [RegExp, RegExp]; /** Description patterns */ readonly DESCRIPTION: readonly [RegExp, RegExp]; /** Default year value */ readonly DEFAULT: "2024"; }; /** * Property schema interface (JSON Schema subset). */ export interface PropertySchema { type?: string | string[]; enum?: unknown[]; const?: unknown; default?: unknown; examples?: unknown[]; minimum?: number; maximum?: number; minLength?: number; maxLength?: number; pattern?: string; format?: string; items?: PropertySchema; properties?: Record; required?: string[]; description?: string; oneOf?: PropertySchema[]; anyOf?: PropertySchema[]; } /** * Result of smart value generation. */ export interface SmartValueResult { /** The generated value */ value: unknown; /** The detected semantic type */ semanticType: string | null; /** Confidence level of the type detection */ confidence: 'high' | 'medium' | 'low'; } /** * Generate a smart string value based on field name, description, and schema. */ export declare function generateSmartStringValue(propName: string, prop: PropertySchema): SmartValueResult; /** * Generate a smart number value based on schema constraints and field name. * * @param prop - Schema property definition * @param propName - Optional property name for semantic detection (e.g., "latitude") */ export declare function generateSmartNumberValue(prop: PropertySchema, propName?: string): SmartValueResult; /** * Generate a complete smart value for any type. */ export declare function generateSmartValue(propName: string, prop: PropertySchema): SmartValueResult; /** * Generate multiple alternative values for a field (for varied testing). */ export declare function generateAlternativeValues(propName: string, prop: PropertySchema, count?: number): SmartValueResult[]; //# sourceMappingURL=smart-value-generator.d.ts.map