/** * Thin REST wrappers around Appwrite's Proxy service. * * The `node-appwrite@23` SDK that the rest of the CLI uses does not expose * the Proxy service yet (`@appwrite.io/console@12` does, but that's a * browser SDK with the wrong auth model). The endpoints are stable and * documented; we just call them with the API key the user already gave us. * * Endpoint shapes were verified against * `node_modules/.bun/@appwrite.io+console@12.0.0/dist/esm/sdk.js`: * GET /v1/proxy/rules (queries[]=, search=, total=) * POST /v1/proxy/rules/function ({ domain, functionId, branch? }) * POST /v1/proxy/rules/site ({ domain, siteId, branch? }) * DELETE /v1/proxy/rules/{ruleId} */ import type { Client } from "node-appwrite"; export interface ProxyRule { $id: string; $createdAt: string; $updatedAt: string; domain: string; resourceType?: string; resourceId?: string; deploymentResourceType?: "function" | "site"; deploymentResourceId?: string; deploymentVcsProviderBranch?: string; status?: "created" | "verifying" | "verified" | "unverified"; type?: "api" | "deployment" | "redirect"; trigger?: "manual" | "deployment"; redirectUrl?: string; redirectStatusCode?: number; logs?: string; } export type ProxyResourceType = "function" | "site"; /** * List proxy rules attached to a function or site. Uses the same `queries[]` * filtering wire format as the rest of the Appwrite REST API. */ export declare function listRulesForResource(client: Client, resourceType: ProxyResourceType, resourceId: string): Promise; export declare function createFunctionRule(client: Client, params: { domain: string; functionId: string; branch?: string; }): Promise; export declare function createSiteRule(client: Client, params: { domain: string; siteId: string; branch?: string; }): Promise; export declare function deleteRule(client: Client, ruleId: string): Promise; /** * Reconcile a resource's desired vs existing proxy rules. Always creates * missing domains; only deletes extras when `prune` is true. Idempotent — * existing rules with matching domains are left alone. * * Returns a summary so the caller can log what changed. */ export declare function reconcileResourceDomains(client: Client, resourceType: ProxyResourceType, resourceId: string, desiredDomains: string[], options?: { prune?: boolean; branch?: string; }): Promise<{ created: string[]; deleted: string[]; kept: string[]; }>;