import type { Secret } from "../secret.js"; /** * Options for Cloudflare API requests */ export interface CloudflareApiOptions { /** * Base URL for Cloudflare API * * @default https://api.cloudflare.com/client/v4 */ baseUrl?: string; /** * API Key to use (overrides CLOUDFLARE_API_KEY env var) */ apiKey?: Secret; /** * API Token to use (overrides CLOUDFLARE_API_TOKEN env var) */ apiToken?: Secret; /** * Account ID to use (overrides CLOUDFLARE_ACCOUNT_ID env var) * If not provided, will be automatically retrieved from the Cloudflare API */ accountId?: string; /** * Zone ID to use (overrides CLOUDFLARE_ZONE_ID env var) */ zoneId?: string; /** * Email to use with API Key authentication * If not provided, will attempt to discover from Cloudflare API */ email?: string; } /** * Creates a CloudflareApi instance with automatic account ID discovery if not provided * * @param options API options * @returns Promise resolving to a CloudflareApi instance */ export declare function createCloudflareApi(options?: Partial): Promise; /** * Cloudflare API client using raw fetch */ export declare class CloudflareApi { private readonly options; readonly accountId: string; readonly baseUrl: string; /** * Create a new Cloudflare API client * Use createCloudflareApi factory function instead of direct constructor * for automatic account ID discovery. * * @param options API options */ constructor(options: CloudflareApiOptions & { accountId: string; }); /** * Make a fetch request to the Cloudflare API * * @param path API path (without base URL) * @param init Fetch init options * @returns Raw Response object from fetch */ fetch(path: string, init?: RequestInit): Promise; /** * Helper for GET requests */ get(path: string, init?: RequestInit): Promise; /** * Helper for HEAD requests */ head(path: string, init?: RequestInit): Promise; /** * Helper for POST requests */ post(path: string, body: any, init?: RequestInit): Promise; /** * Helper for PUT requests */ put(path: string, body: any, init?: RequestInit): Promise; /** * Helper for PATCH requests */ patch(path: string, body: any, init?: RequestInit): Promise; /** * Helper for DELETE requests */ delete(path: string, init?: RequestInit): Promise; } //# sourceMappingURL=api.d.ts.map