import { Client, type Models } from "node-appwrite"; import { type AppwriteFunction } from "appwrite-utils"; import { type WaitForDeploymentOptions } from "./methods.js"; /** * Upload-only phase of a deployment: tars + uploads the function source and * creates the deployment record. Does NOT wait for the build to finish and * does NOT explicitly call activateDeployment — the returned deployment is * typically in "waiting" or "building" state. * * Pair with finalizeFunctionDeployment to wait+activate. */ export declare const uploadFunctionDeployment: (client: Client, functionId: string, codePath: string, activate?: boolean, entrypoint?: string, commands?: string, ignored?: string[]) => Promise; /** * Finalize phase of a deployment: polls until the build is ready, then * explicitly activates the deployment. Safe to run concurrently for many * deployments because the underlying calls are just polling getDeployment * and a single updateFunctionDeployment per call. */ export declare const finalizeFunctionDeployment: (client: Client, functionId: string, deploymentId: string, pollOptions?: WaitForDeploymentOptions) => Promise; /** * Thin wrapper preserving the original single-function deploy semantics: * upload then (if activate) wait+activate inline. */ export declare const deployFunction: (client: Client, functionId: string, codePath: string, activate?: boolean, entrypoint?: string, commands?: string, ignored?: string[]) => Promise; /** * Result of prepareFunctionDeployment: the resolved code directory and the * effective config, ready to be passed to uploadFunctionDeployment. */ export interface PreparedFunctionDeployment { functionId: string; functionName: string; deployPath: string; entrypoint: string; /** * Commands string sent to Appwrite's createDeployment. Empty when the * function is prebuilt — Appwrite skips the build step entirely. */ commands: string; ignored: string[]; prebuilt: boolean; } /** * Runs everything that must happen BEFORE the tarball upload: * - resolves the on-disk code directory * - creates the function on Appwrite if missing, otherwise pushes the * config (specs, scopes, schedule, etc.) * - runs predeployCommands * * Returns the info needed to call uploadFunctionDeployment. */ export declare const prepareFunctionDeployment: (client: Client, functionName: string, functionConfig: AppwriteFunction, functionPath?: string, configDirPath?: string) => Promise; /** * Thin wrapper preserving the original single-function deploy semantics: * prepare + upload + wait + activate inline. */ export declare const deployLocalFunction: (client: Client, functionName: string, functionConfig: AppwriteFunction, functionPath?: string, configDirPath?: string) => Promise;