import { Client, type Models } from "node-appwrite"; import { type AppwriteFunction, type Specification } from "appwrite-utils"; export declare const listFunctions: (client: Client, queries?: string[], search?: string) => Promise; export declare const getFunction: (client: Client, functionId: string) => Promise; export declare const downloadLatestFunctionDeployment: (client: Client, functionId: string, basePath?: string) => Promise<{ path: string; function: Models.Function; deployment: Models.Deployment; }>; export declare const deleteFunction: (client: Client, functionId: string) => Promise<{}>; export declare const createFunction: (client: Client, functionConfig: AppwriteFunction) => Promise; export declare const updateFunctionSpecifications: (client: Client, functionId: string, buildSpecification: Specification, runtimeSpecification: Specification) => Promise; export declare const listSpecifications: (client: Client) => Promise; export declare const listFunctionDeployments: (client: Client, functionId: string, queries?: string[]) => Promise; export interface WaitForDeploymentOptions { intervalMs?: number; timeoutMs?: number; } export declare const waitForDeploymentReady: (client: Client, functionId: string, deploymentId: string, options?: WaitForDeploymentOptions) => Promise; export declare const activateDeployment: (client: Client, functionId: string, deploymentId: string) => Promise; export declare const updateFunction: (client: Client, functionConfig: AppwriteFunction) => Promise; export declare const createFunctionTemplate: (templateType: "typescript-node" | "uv" | "count-docs-in-collection" | "hono-typescript", functionName: string, basePath?: string) => Promise; export declare const listFunctionVariables: (client: Client, functionId: string) => Promise; export declare const createFunctionVariable: (client: Client, functionId: string, key: string, value: string, secret?: boolean) => Promise; export declare const updateFunctionVariable: (client: Client, functionId: string, variableId: string, key: string, value?: string, secret?: boolean) => Promise; export interface SyncVariablesOptions { /** * When true, overwrites Appwrite-side variables whose `secret` flag is true. * Default: false (secrets are preserved across deploys). */ forceOverwriteSecrets?: boolean; /** * Optional MessageFormatter prefix override. Defaults to "Variables". */ prefix?: string; } export interface SyncVariablesResult { created: string[]; updated: string[]; skipped: string[]; unchanged: string[]; } /** * Sync a function's variables to Appwrite while respecting Appwrite-side * secret variables. Behavior: * * - For each key in `desiredVars`: * - if absent on Appwrite → createVariable * - if present and `secret === true` on Appwrite and * `forceOverwriteSecrets !== true` → SKIP (preserve) * - if present and value differs → updateVariable * - if present and value matches → unchanged * - Variables present on Appwrite but absent from `desiredVars` are * LEFT ALONE. We never delete server-side vars during sync. * * This is intentionally additive/preserving so that out-of-band secrets * (e.g. OneUptime ingest tokens, payment provider keys set in the UI) * survive every redeploy. */ export declare const syncFunctionVariables: (client: Client, functionId: string, desiredVars: Record | undefined, options?: SyncVariablesOptions) => Promise;