import { Service } from '../service'; import { Client } from '../client'; import type { Models } from '../models'; import type { UploadProgress } from '../client'; export declare class Functions extends Service { constructor(client: Client); /** * List Functions * * Get a list of all the project's functions. You can use the query params to * filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ list(queries?: string[], search?: string): Promise; /** * Create Function * * Create a new function. You can pass a list of * [permissions](/docs/permissions) to allow different project users or team * with access to execute the function using the client API. * * @param {string} functionId * @param {string} name * @param {string} runtime * @param {string[]} execute * @param {string[]} events * @param {string} schedule * @param {number} timeout * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ create(functionId: string, name: string, runtime: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise; /** * List runtimes * * Get a list of all runtimes that are currently active on your instance. * * @throws {AppwriteException} * @returns {Promise} */ listRuntimes(): Promise; /** * Get Functions Usage * * * @param {string} range * @throws {AppwriteException} * @returns {Promise} */ getUsage(range?: string): Promise; /** * Get Function * * Get a function by its unique ID. * * @param {string} functionId * @throws {AppwriteException} * @returns {Promise} */ get(functionId: string): Promise; /** * Update Function * * Update function by its unique ID. * * @param {string} functionId * @param {string} name * @param {string[]} execute * @param {string[]} events * @param {string} schedule * @param {number} timeout * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ update(functionId: string, name: string, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean): Promise; /** * Delete Function * * Delete a function by its unique ID. * * @param {string} functionId * @throws {AppwriteException} * @returns {Promise} */ delete(functionId: string): Promise<{}>; /** * List Deployments * * Get a list of all the project's code deployments. You can use the query * params to filter your results. * * @param {string} functionId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listDeployments(functionId: string, queries?: string[], search?: string): Promise; /** * Create Deployment * * Create a new function code deployment. Use this endpoint to upload a new * version of your code function. To execute your newly uploaded code, you'll * need to update the function's deployment to use your new deployment UID. * * This endpoint accepts a tar.gz file compressed with your code. Make sure to * include any dependencies your code has within the compressed file. You can * learn more about code packaging in the [Appwrite Cloud Functions * tutorial](/docs/functions). * * Use the "command" param to set the entry point used to execute your code. * * @param {string} functionId * @param {string} entrypoint * @param {File} code * @param {boolean} activate * @throws {AppwriteException} * @returns {Promise} */ createDeployment(functionId: string, entrypoint: string, code: File, activate: boolean, onProgress?: (progress: UploadProgress) => void): Promise; /** * Get Deployment * * Get a code deployment by its unique ID. * * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} * @returns {Promise} */ getDeployment(functionId: string, deploymentId: string): Promise; /** * Update Function Deployment * * Update the function code deployment ID using the unique function ID. Use * this endpoint to switch the code deployment that should be executed by the * execution endpoint. * * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} * @returns {Promise} */ updateDeployment(functionId: string, deploymentId: string): Promise; /** * Delete Deployment * * Delete a code deployment by its unique ID. * * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} * @returns {Promise} */ deleteDeployment(functionId: string, deploymentId: string): Promise<{}>; /** * Create Build * * * @param {string} functionId * @param {string} deploymentId * @param {string} buildId * @throws {AppwriteException} * @returns {Promise} */ createBuild(functionId: string, deploymentId: string, buildId: string): Promise<{}>; /** * List Executions * * Get a list of all the current user function execution logs. You can use the * query params to filter your results. * * @param {string} functionId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listExecutions(functionId: string, queries?: string[], search?: string): Promise; /** * Create Execution * * Trigger a function execution. The returned object will return you the * current execution status. You can ping the `Get Execution` endpoint to get * updates on the current execution status. Once this endpoint is called, your * function execution process will start asynchronously. * * @param {string} functionId * @param {string} data * @param {boolean} async * @throws {AppwriteException} * @returns {Promise} */ createExecution(functionId: string, data?: string, async?: boolean): Promise; /** * Get Execution * * Get a function execution log by its unique ID. * * @param {string} functionId * @param {string} executionId * @throws {AppwriteException} * @returns {Promise} */ getExecution(functionId: string, executionId: string): Promise; /** * Get Function Usage * * * @param {string} functionId * @param {string} range * @throws {AppwriteException} * @returns {Promise} */ getFunctionUsage(functionId: string, range?: string): Promise; /** * List Variables * * Get a list of all variables of a specific function. * * @param {string} functionId * @throws {AppwriteException} * @returns {Promise} */ listVariables(functionId: string): Promise; /** * Create Variable * * Create a new function variable. These variables can be accessed within * function in the `env` object under the request variable. * * @param {string} functionId * @param {string} key * @param {string} value * @throws {AppwriteException} * @returns {Promise} */ createVariable(functionId: string, key: string, value: string): Promise; /** * Get Variable * * Get a variable by its unique ID. * * @param {string} functionId * @param {string} variableId * @throws {AppwriteException} * @returns {Promise} */ getVariable(functionId: string, variableId: string): Promise; /** * Update Variable * * Update variable by its unique ID. * * @param {string} functionId * @param {string} variableId * @param {string} key * @param {string} value * @throws {AppwriteException} * @returns {Promise} */ updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise; /** * Delete Variable * * Delete a variable by its unique ID. * * @param {string} functionId * @param {string} variableId * @throws {AppwriteException} * @returns {Promise} */ deleteVariable(functionId: string, variableId: string): Promise<{}>; }