import { AuthError, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, ResolveTokenInput, WikiProxyConfig, Workers } from "@theholocron/cli"; import { CloudflareClient, CloudflareClientOptions, CloudflareClientOptions as CloudflareClientOptions$1, createCloudflareClient } from "@theholocron/cloudflare-client"; //#region src/auth.d.ts declare const resolveToken: (input?: ResolveTokenInput) => string; //#endregion //#region src/capabilities/deployment.d.ts declare class CloudflareDeployment implements Deployment { private readonly client; private readonly accountId; readonly key: "deployment"; readonly providerName = "cloudflare"; constructor(client: () => CloudflareClient, accountId: string); listProjects(): Promise; ensureProject(input: { name: string; framework?: string; repo?: string; rootDirectory?: string; }): Promise; updateProjectSettings(projectId: string, settings: DeploymentProjectSettings): Promise; listEnvVars(projectId: string, target: DeploymentTarget): Promise; setEnvVar(projectId: string, target: DeploymentTarget, name: string, value: string): Promise; triggerDeployment(input: { projectId: string; branch: string; target?: DeploymentTrigger; }): Promise; getDeployment(deploymentId: string): Promise; listPreviewDeployments(projectId: string, branch: string): Promise; deletePreviewDeployments(projectId: string, deploymentIds: string[]): Promise; ensureCustomDomain(projectId: string, hostname: string): Promise; private getProjectByName; } //#endregion //#region src/capabilities/dns.d.ts declare class CloudflareDns implements Dns { private readonly client; readonly key: "dns"; readonly providerName = "cloudflare"; private readonly zoneCache; constructor(client: () => CloudflareClient); listRecords(domain: string): Promise; upsertRecord(domain: string, record: DnsRecord): Promise; deleteRecord(domain: string, id: string): Promise; /** * Walk from full domain up to apex to find the Cloudflare zone. * E.g. "api.staging.example.com" tries: * 1. "api.staging.example.com" * 2. "staging.example.com" * 3. "example.com" */ private resolveZone; } //#endregion //#region src/capabilities/workers.d.ts interface ZonesClient { list(query?: { name?: string; per_page?: number; }): Promise>; } declare class CloudflareWorkers implements Workers { private readonly zones; private readonly accountId; readonly key: "workers"; readonly providerName = "cloudflare"; private readonly zoneCache; private readonly baseUrl; private readonly fetchImpl; /** Memoized token thunk — resolved on the first authenticated request. */ private readonly token; constructor(zones: () => ZonesClient, accountId: string, opts: { token: () => string; } & Pick); upsertProxy(hostname: string, config: WikiProxyConfig): Promise; private putScript; private listRoutes; private createRoute; private updateRoute; private cfRequest; private resolveZone; } //#endregion //#region src/verify-token.d.ts interface VerifyTokenSuccess { ok: true; subject: string; } interface VerifyTokenFailure { ok: false; message: string; } type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure; interface VerifyTokenOptions { baseUrl?: string; fetch?: typeof fetch; } declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise; //#endregion //#region src/index.d.ts interface CloudflarePluginOptions extends ResolveTokenInput { /** * Cloudflare account ID. Required for Pages (deployment) operations; * optional for DNS-only use. */ accountId?: string; /** Override base URL for tests. */ baseUrl?: string; fetch?: typeof fetch; } interface PluginContext { options: CloudflarePluginOptions; /** Memoized client — the token is resolved on first use, not at plugin load. */ client: () => CloudflareClient; /** Memoized token resolver — shared by the client and the Workers capability. */ token: () => string; } declare function createContext(options?: CloudflarePluginOptions): PluginContext; declare function dns(ctx: PluginContext): Dns; declare function deployment(ctx: PluginContext): Deployment; declare function workersCapability(ctx: PluginContext): Workers; declare function createPlugin(options?: CloudflarePluginOptions): { name: string; capabilities: { deployment?: (() => Deployment) | undefined; workers?: (() => Workers) | undefined; dns: () => Dns; }; }; declare const AUTH_HINT: string; //#endregion export { AUTH_HINT, AuthError, type CloudflareClient, type CloudflareClientOptions, CloudflareDeployment, CloudflareDns, CloudflarePluginOptions, CloudflareWorkers, PluginContext, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createCloudflareClient, createContext, createPlugin, deployment, dns, resolveToken, verifyToken, workersCapability };