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.

40 lines (39 loc) 1.82 kB
import { type AppwriteConfig } from "appwrite-utils"; import { Client } from "node-appwrite"; import type { DatabaseAdapter } from "../adapters/DatabaseAdapter.js"; /** * Enhanced client creation from config with session authentication support * @deprecated Use getAdapterFromConfig for dual API support with session auth */ export declare const getClientFromConfig: (config: AppwriteConfig, sessionCookie?: string) => Client | undefined; /** * Enhanced client creation with session authentication support * Priority: explicit session > session from prefs > API key */ export declare const getClientWithAuth: (endpoint: string, project: string, key?: string, sessionCookie?: string) => Client; /** * Legacy function - returns basic Client * @deprecated Use getClientWithAuth for session support or createDatabaseAdapter for dual API support */ export declare const getClient: (endpoint: string, project: string, key: string) => Client; /** * Modern adapter-based client creation with dual API support and session authentication * Returns both adapter and legacy client for compatibility */ export declare const getAdapterFromConfig: (config: AppwriteConfig, forceRefresh?: boolean, sessionCookie?: string) => Promise<{ adapter: DatabaseAdapter; client: Client; apiMode: "legacy" | "tablesdb"; }>; /** * Create adapter from individual parameters with session authentication support */ export declare const getAdapter: (endpoint: string, project: string, key?: string, apiMode?: "auto" | "legacy" | "tablesdb", sessionCookie?: string) => Promise<{ adapter: DatabaseAdapter; client: Client; apiMode: "legacy" | "tablesdb"; }>; /** * Check if session authentication is available for a project */ export declare const checkSessionAuth: (endpoint: string, project: string) => boolean;