UNPKG

appwrite-utils

Version:

`appwrite-utils` is a comprehensive TypeScript library designed to streamline the development process for Appwrite projects. It provides a suite of utilities and helper functions that facilitate data manipulation, schema management, and seamless integrati

110 lines (109 loc) 8.73 kB
import { z } from "zod"; /** * THIS IS SERVER-SIDE SCHEMA, DO NOT EXPECT THIS TO BE COMPATIBLE WITH CLIENT-SIDE SCHEMA * * dirPath?: string, -- The directory path to the function, if not provided, the function will be created in the appwriteConfig/functions directory * functionId: string, * name: string, * runtime?: Runtime, * execute?: string[], * events?: string[], * schedule?: string, * timeout?: number, * enabled?: boolean, * logging?: boolean, * entrypoint?: string, * predeployCommands?: string[], -- These are custom and ours, and they will be evaluated on the host machine before the function is deployed * deployDir?: string, -- The directory to deploy the function from, if not provided, the function will be deployed from the function's directory * commands?: string, * scopes?: string[], * installationId?: string, * providerRepositoryId?: string, * providerBranch?: string, * providerSilentMode?: boolean, * providerRootDirectory?: string, * specification?: string */ export declare const AppwriteFunctionSchema: z.ZodObject<{ dirPath: z.ZodOptional<z.ZodString>; $id: z.ZodString; name: z.ZodString; runtime: z.ZodEnum<["node-14.5", "node-16.0", "node-18.0", "node-19.0", "node-20.0", "node-21.0", "php-8.0", "php-8.1", "php-8.2", "php-8.3", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", "python-3.8", "python-3.9", "python-3.10", "python-3.11", "python-3.12", "python-ml-3.11", "deno-1.40", "dart-2.15", "dart-2.16", "dart-2.17", "dart-2.18", "dart-3.0", "dart-3.1", "dart-3.3", "dotnet-3.1", "dotnet-6.0", "dotnet-7.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", "swift-5.5", "swift-5.8", "swift-5.9", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", "cpp-17", "cpp-20", "bun-1.0", "go-1.23"]>; execute: z.ZodArray<z.ZodString, "many">; events: z.ZodArray<z.ZodString, "many">; schedule: z.ZodOptional<z.ZodString>; timeout: z.ZodOptional<z.ZodNumber>; enabled: z.ZodOptional<z.ZodBoolean>; logging: z.ZodOptional<z.ZodBoolean>; ignore: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; entrypoint: z.ZodOptional<z.ZodString>; predeployCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; deployDir: z.ZodOptional<z.ZodString>; commands: z.ZodOptional<z.ZodString>; scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<["users.read", "users.write", "teams.read", "teams.write", "databases.read", "databases.write", "collections.read", "collections.write", "attributes.read", "attributes.write", "indexes.read", "indexes.write", "documents.read", "documents.write", "files.read", "files.write", "buckets.read", "buckets.write", "functions.read", "functions.write", "execution.read", "execution.write", "locale.read", "avatars.read", "health.read", "rules.read", "rules.write", "migrations.read", "migrations.write", "vcs.read", "vcs.write", "assistant.read", "messages.read", "messages.write", "targets.read", "targets.write", "providers.read", "providers.write", "topics.read", "topics.write", "subscribers.read", "subscribers.write"]>, "many">>; installationId: z.ZodOptional<z.ZodString>; providerRepositoryId: z.ZodOptional<z.ZodString>; providerBranch: z.ZodOptional<z.ZodString>; providerSilentMode: z.ZodOptional<z.ZodBoolean>; providerRootDirectory: z.ZodOptional<z.ZodString>; templateRepository: z.ZodOptional<z.ZodString>; templateOwner: z.ZodOptional<z.ZodString>; templateRootDirectory: z.ZodOptional<z.ZodString>; templateVersion: z.ZodOptional<z.ZodString>; specification: z.ZodOptional<z.ZodEnum<["s-0.5vcpu-512mb", "s-1vcpu-512mb", "s-1vcpu-1gb", "s-2vcpu-2gb", "s-2vcpu-4gb", "s-4vcpu-4gb", "s-4vcpu-8gb", "s-8vcpu-4gb", "s-8vcpu-8gb"]>>; }, "strip", z.ZodTypeAny, { name: string; $id: string; runtime: "node-14.5" | "node-16.0" | "node-18.0" | "node-19.0" | "node-20.0" | "node-21.0" | "php-8.0" | "php-8.1" | "php-8.2" | "php-8.3" | "ruby-3.0" | "ruby-3.1" | "ruby-3.2" | "ruby-3.3" | "python-3.8" | "python-3.9" | "python-3.10" | "python-3.11" | "python-3.12" | "python-ml-3.11" | "deno-1.40" | "dart-2.15" | "dart-2.16" | "dart-2.17" | "dart-2.18" | "dart-3.0" | "dart-3.1" | "dart-3.3" | "dotnet-3.1" | "dotnet-6.0" | "dotnet-7.0" | "java-8.0" | "java-11.0" | "java-17.0" | "java-18.0" | "java-21.0" | "swift-5.5" | "swift-5.8" | "swift-5.9" | "kotlin-1.6" | "kotlin-1.8" | "kotlin-1.9" | "cpp-17" | "cpp-20" | "bun-1.0" | "go-1.23"; execute: string[]; events: string[]; enabled?: boolean | undefined; dirPath?: string | undefined; schedule?: string | undefined; timeout?: number | undefined; logging?: boolean | undefined; ignore?: string[] | undefined; entrypoint?: string | undefined; predeployCommands?: string[] | undefined; deployDir?: string | undefined; commands?: string | undefined; scopes?: ("users.read" | "users.write" | "teams.read" | "teams.write" | "databases.read" | "databases.write" | "collections.read" | "collections.write" | "attributes.read" | "attributes.write" | "indexes.read" | "indexes.write" | "documents.read" | "documents.write" | "files.read" | "files.write" | "buckets.read" | "buckets.write" | "functions.read" | "functions.write" | "execution.read" | "execution.write" | "locale.read" | "avatars.read" | "health.read" | "rules.read" | "rules.write" | "migrations.read" | "migrations.write" | "vcs.read" | "vcs.write" | "assistant.read" | "messages.read" | "messages.write" | "targets.read" | "targets.write" | "providers.read" | "providers.write" | "topics.read" | "topics.write" | "subscribers.read" | "subscribers.write")[] | undefined; installationId?: string | undefined; providerRepositoryId?: string | undefined; providerBranch?: string | undefined; providerSilentMode?: boolean | undefined; providerRootDirectory?: string | undefined; templateRepository?: string | undefined; templateOwner?: string | undefined; templateRootDirectory?: string | undefined; templateVersion?: string | undefined; specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined; }, { name: string; $id: string; runtime: "node-14.5" | "node-16.0" | "node-18.0" | "node-19.0" | "node-20.0" | "node-21.0" | "php-8.0" | "php-8.1" | "php-8.2" | "php-8.3" | "ruby-3.0" | "ruby-3.1" | "ruby-3.2" | "ruby-3.3" | "python-3.8" | "python-3.9" | "python-3.10" | "python-3.11" | "python-3.12" | "python-ml-3.11" | "deno-1.40" | "dart-2.15" | "dart-2.16" | "dart-2.17" | "dart-2.18" | "dart-3.0" | "dart-3.1" | "dart-3.3" | "dotnet-3.1" | "dotnet-6.0" | "dotnet-7.0" | "java-8.0" | "java-11.0" | "java-17.0" | "java-18.0" | "java-21.0" | "swift-5.5" | "swift-5.8" | "swift-5.9" | "kotlin-1.6" | "kotlin-1.8" | "kotlin-1.9" | "cpp-17" | "cpp-20" | "bun-1.0" | "go-1.23"; execute: string[]; events: string[]; enabled?: boolean | undefined; dirPath?: string | undefined; schedule?: string | undefined; timeout?: number | undefined; logging?: boolean | undefined; ignore?: string[] | undefined; entrypoint?: string | undefined; predeployCommands?: string[] | undefined; deployDir?: string | undefined; commands?: string | undefined; scopes?: ("users.read" | "users.write" | "teams.read" | "teams.write" | "databases.read" | "databases.write" | "collections.read" | "collections.write" | "attributes.read" | "attributes.write" | "indexes.read" | "indexes.write" | "documents.read" | "documents.write" | "files.read" | "files.write" | "buckets.read" | "buckets.write" | "functions.read" | "functions.write" | "execution.read" | "execution.write" | "locale.read" | "avatars.read" | "health.read" | "rules.read" | "rules.write" | "migrations.read" | "migrations.write" | "vcs.read" | "vcs.write" | "assistant.read" | "messages.read" | "messages.write" | "targets.read" | "targets.write" | "providers.read" | "providers.write" | "topics.read" | "topics.write" | "subscribers.read" | "subscribers.write")[] | undefined; installationId?: string | undefined; providerRepositoryId?: string | undefined; providerBranch?: string | undefined; providerSilentMode?: boolean | undefined; providerRootDirectory?: string | undefined; templateRepository?: string | undefined; templateOwner?: string | undefined; templateRootDirectory?: string | undefined; templateVersion?: string | undefined; specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined; }>; export type AppwriteFunction = z.infer<typeof AppwriteFunctionSchema>;