feat(domaincheck): support all TLDs with suggestion alternatives
- Accept full domains (e.g. "example.xyz") not just labels - Check the entered TLD as primary result - Show .de, .com, .net, .org as alternative suggestions below - Primary result highlighted with accent border - Input without TLD still works (shows all 4 suggestions) - Updated i18n placeholders and added "suggestions" label Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import {
|
||||
ArrayMaxSize,
|
||||
IsArray,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
Matches,
|
||||
} from 'class-validator';
|
||||
@@ -16,19 +13,9 @@ import {
|
||||
export class CheckDomainDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Matches(/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/, {
|
||||
@Matches(/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z]{2,})?$/, {
|
||||
message:
|
||||
'Domain must be a valid label: alphanumeric and hyphens only, 1-63 characters, cannot start or end with a hyphen',
|
||||
'Domain must be a valid label (e.g. "example") or full domain (e.g. "example.com")',
|
||||
})
|
||||
domain!: string;
|
||||
|
||||
/**
|
||||
* Optional list of TLDs to check. If omitted, defaults are used.
|
||||
* Per T-03-06: max 10 TLDs per request to prevent DoS.
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
@ArrayMaxSize(10, { message: 'Maximum 10 TLDs per request' })
|
||||
tlds?: string[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user