UNPKG

@altus4/sdk

Version:

Official TypeScript SDK for Altus 4 - AI-Enhanced MySQL Full-Text Search Engine

165 lines 4.35 kB
/** * SDK package entrypoint - re-export client, services and types */ export * from './client'; export * from './services'; export * from './types'; /** * Altus 4 SDK * * A comprehensive TypeScript SDK for the Altus 4 API. * Provides a unified interface for authentication, API key management, * database connections, analytics, and system management. * * @example * ```typescript * import { Altus4SDK } from './sdk'; * * // Initialize the SDK * const altus4 = new Altus4SDK({ * baseURL: 'https://api.altus4.com/v1' * }); * * // Authenticate * const loginResult = await altus4.auth.handleLogin({ * email: 'user@example.com', * password: 'password' * }); * * if (loginResult.success) { * // Create API key * const apiKey = await altus4.apiKeys.createApiKey({ * name: 'My API Key', * environment: 'test', * permissions: ['search', 'analytics'] * }); * * // Add database connection * const database = await altus4.database.addDatabaseConnection({ * name: 'My Database', * host: 'localhost', * port: 3306, * database: 'mydb', * username: 'user', * password: 'pass' * }); * * // Get analytics * const dashboard = await altus4.analytics.getDashboardAnalytics({ * period: 'week' * }); * } * ``` */ import { AnalyticsService, ApiKeysService, AuthService, DatabaseService, ManagementService } from './services'; import type { ClientConfig } from './types'; export * from './types'; export * from './utils'; export { AnalyticsService, ApiKeysService, AuthService, DatabaseService, ManagementService, } from './services'; export { BaseClient } from './client'; /** * Main Altus 4 SDK class that provides a unified interface to all services */ export declare class Altus4SDK { /** * Authentication service for user management */ readonly auth: AuthService; /** * API Keys service for key management */ readonly apiKeys: ApiKeysService; /** * Database service for connection management */ readonly database: DatabaseService; /** * Analytics service for search insights and metrics */ readonly analytics: AnalyticsService; /** * Management service for system operations */ readonly management: ManagementService; /** * Initialize the Altus 4 SDK * * @param config - Configuration options for the SDK */ constructor(config?: ClientConfig); /** * Check if the user is currently authenticated */ isAuthenticated(): boolean; /** * Set authentication token manually */ setToken(token: string, expiresIn?: number): void; /** * Clear authentication token */ clearToken(): void; /** * Test connection to the API */ testConnection(): Promise<import("./types").ApiResponse<import("./types/management").ConnectionTestResult>>; /** * Get the base URL being used by the SDK */ getBaseURL(): string; /** * Update the base URL for all services */ setBaseURL(baseURL: string): void; /** * Quick login helper */ login(email: string, password: string): Promise<import("./types").AuthResult>; /** * Quick register helper */ register(name: string, email: string, password: string): Promise<import("./types").AuthResult>; /** * Quick logout helper */ logout(): Promise<{ success: boolean; error?: any; }>; /** * Get current user profile */ getCurrentUser(): Promise<{ success: boolean; user?: import("./types").User | undefined; error?: any; }>; /** * Check if current user is admin */ isAdmin(): Promise<boolean>; /** * Refresh authentication token if needed */ refreshTokenIfNeeded(): Promise<boolean>; } /** * Create a new Altus 4 SDK instance * * @param config - Configuration options for the SDK * @returns New SDK instance */ export declare function createAltus4SDK(config?: ClientConfig): Altus4SDK; /** * Default SDK instance for convenience * * @example * ```typescript * import { altus4 } from './sdk'; * * const user = await altus4.auth.getCurrentUser(); * ``` */ export declare const altus4: Altus4SDK; export default Altus4SDK; //# sourceMappingURL=index.d.ts.map