UNPKG

@push.rocks/smartproxy

Version:

A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.

62 lines (61 loc) 1.99 kB
import type { IDomainOptions, IAcmeOptions } from '../models/common-types.js'; /** * Collection of validation utilities for configuration and domain options */ export declare class ValidationUtils { /** * Validates domain configuration options * * @param domainOptions The domain options to validate * @returns An object with validation result and error message if invalid */ static validateDomainOptions(domainOptions: IDomainOptions): { isValid: boolean; error?: string; }; /** * Validates ACME configuration options * * @param acmeOptions The ACME options to validate * @returns An object with validation result and error message if invalid */ static validateAcmeOptions(acmeOptions: IAcmeOptions): { isValid: boolean; error?: string; }; /** * Validates a port number * * @param port The port to validate * @returns true if the port is valid, false otherwise */ static isValidPort(port: number): boolean; /** * Validates a domain name * * @param domain The domain name to validate * @returns true if the domain name is valid, false otherwise */ static isValidDomainName(domain: string): boolean; /** * Validates an email address * * @param email The email to validate * @returns true if the email is valid, false otherwise */ static isValidEmail(email: string): boolean; /** * Validates a certificate format (PEM) * * @param cert The certificate content to validate * @returns true if the certificate appears to be in PEM format, false otherwise */ static isValidCertificate(cert: string): boolean; /** * Validates a private key format (PEM) * * @param key The private key content to validate * @returns true if the key appears to be in PEM format, false otherwise */ static isValidPrivateKey(key: string): boolean; }