UNPKG

appwrite-utils-cli

Version:

Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.

133 lines (132 loc) 4.79 kB
import { Storage, type Models } from "node-appwrite"; import { type AppwriteConfig } from "appwrite-utils"; export declare class AppwriteToX { config: AppwriteConfig; storage: Storage; updatedConfig: AppwriteConfig; collToAttributeMap: Map<string, ({ type: "string"; key: string; size: number; format?: string | null | undefined; description?: string | Record<string, string> | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: string | null | undefined; encrypted?: boolean | undefined; } | { type: "integer"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: number | null | undefined; min?: number | undefined; max?: number | undefined; } | { type: "double"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: number | null | undefined; min?: number | undefined; max?: number | undefined; } | { type: "float"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: number | null | undefined; min?: number | undefined; max?: number | undefined; } | { type: "boolean"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: boolean | null | undefined; } | { type: "datetime"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: string | null | undefined; } | { type: "email"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: string | null | undefined; } | { type: "ip"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: string | null | undefined; } | { type: "url"; key: string; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: string | null | undefined; } | { type: "enum"; key: string; elements: string[]; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; xdefault?: string | null | undefined; } | { type: "relationship"; key: string; relatedCollection: string; relationType: "oneToMany" | "manyToOne" | "oneToOne" | "manyToMany"; twoWay: boolean; twoWayKey: string; onDelete: "setNull" | "cascade" | "restrict"; side: "parent" | "child"; description?: string | Record<string, string> | null | undefined; required?: boolean | undefined; array?: boolean | undefined; error?: string | undefined; importMapping?: { originalIdField: string; targetField?: string | undefined; } | undefined; })[]>; appwriteFolderPath: string; constructor(config: AppwriteConfig, appwriteFolderPath: string, storage: Storage); private ensureClientInitialized; parsePermissionString: (permissionString: string) => { permission: string; target: string; }; parsePermissionsArray: (permissions: string[]) => ({ permission: string; target: string; } | { permission: string; target: string; })[]; updateCollectionConfigAttributes: (collection: Models.Collection) => void; appwriteSync(config: AppwriteConfig, databases?: Models.Database[]): Promise<void>; toSchemas(databases?: Models.Database[]): Promise<void>; }