export interface ProxyConfig { protocol: 'http' | 'https'; host: string; port: number; auth?: { username: string; password: string; }; } /** * Parse NO_PROXY / no_proxy env (both uppercase and lowercase). * NO_PROXY has priority over HTTP_PROXY/HTTPS_PROXY: hosts in this list never use the proxy. * Values are hostnames only, comma-separated; leading dot matches subdomains (e.g. .contentstack.io). * The bypass list is fully dynamic: only env values are used (no hardcoded default). * @returns List of trimmed entries, or empty array when NO_PROXY/no_proxy is unset */ export declare function getNoProxyList(): string[]; /** * Check if the given host should bypass the proxy based on NO_PROXY / no_proxy. * Supports: exact host, leading-dot subdomain match (e.g. .contentstack.io), and wildcard *. * @param host - Request hostname (with or without port; will be normalized) * @returns true if proxy should not be used for this host */ export declare function shouldBypassProxy(host: string): boolean; /** * Get proxy configuration. Priority order (per spec): * 1. Global CLI config from `csdx config:set:proxy --host --port --protocol ` * 2. Environment variables (HTTPS_PROXY or HTTP_PROXY) * For per-request use, prefer getProxyConfigForHost(host) so NO_PROXY overrides both sources. * @returns ProxyConfig object or undefined if no proxy is configured */ export declare function getProxyConfig(): ProxyConfig | undefined; /** * Get proxy config only when the request host is not in NO_PROXY. * NO_PROXY has priority over both HTTP_PROXY/HTTPS_PROXY and over proxy set via * `csdx config:set:proxy` — if the host matches NO_PROXY, no proxy is used. * Use this for all outbound requests so Contentstack and localhost bypass the proxy when set. * @param host - Request hostname (e.g. api.contentstack.io or full URL like https://api.contentstack.io) * @returns ProxyConfig or undefined if proxy is disabled or host should bypass (NO_PROXY) */ export declare function getProxyConfigForHost(host: string): ProxyConfig | undefined; /** * Hostname for NO_PROXY / proxy. Prefer `region.cma` when set so callers that pass a * default SDK host (e.g. bulk-entries -> api.contentstack.io) still match rules like * `.csnonprod.com` against the real API host (e.g. dev11-api.csnonprod.com). */ export declare function resolveRequestHost(config: { host?: string; }): string; /** * Temporarily clear proxy-related env vars so SDK/axios cannot use them. * Call the returned function to restore. Use when creating a client for a host in NO_PROXY. * @returns Restore function (call to put env back) */ export declare function clearProxyEnv(): () => void; /** * Check if proxy is configured (from any source) * @returns true if proxy is configured, false otherwise */ export declare function hasProxy(): boolean; /** * Get proxy URL string for display purposes * @returns Proxy URL string or 'proxy server' if not available */ export declare function getProxyUrl(): string;