UNPKG

supa-seed

Version:

A constraint-aware, framework-agnostic database seeding framework with deep PostgreSQL business logic discovery and MakerKit integration support

97 lines 2.83 kB
/** * Framework-Aware Adapter * Bridges the existing schema-adapter with the new framework strategy system */ import type { createClient } from '@supabase/supabase-js'; import { SchemaInfo } from '../../core/schema-adapter'; import { StrategySelection } from './strategy-registry'; import { SeedingStrategy, UserData, SeedingResult } from './strategy-interface'; type SupabaseClient = ReturnType<typeof createClient>; export interface FrameworkAdapterOptions { enableSchemaCache?: boolean; frameworkOverride?: string; enableConstraintHandling?: boolean; debug?: boolean; } export declare class FrameworkAdapter { private client; private schemaAdapter; private strategyRegistry; private currentStrategy?; private currentSelection?; private options; constructor(client: SupabaseClient, config?: any, options?: FrameworkAdapterOptions); /** * Initialize the framework adapter */ initialize(): Promise<void>; /** * Register all available strategies */ private registerStrategies; /** * Detect schema and select appropriate strategy */ private detectAndSelectStrategy; /** * Convert existing SchemaInfo to new DatabaseSchema format */ private convertSchemaInfo; /** * Create a user using the selected strategy */ createUser(userData: UserData): Promise<SeedingResult>; /** * Get the current strategy */ getCurrentStrategy(): SeedingStrategy | undefined; /** * Get strategy selection details */ getStrategySelection(): StrategySelection | undefined; /** * Get framework recommendations */ getRecommendations(): string[]; /** * Check if a specific feature is supported */ supportsFeature(feature: string): boolean; /** * Get schema information (backward compatibility) */ getSchemaInfo(): Promise<SchemaInfo>; /** * Get legacy user creation strategy (backward compatibility) */ getUserCreationStrategy(): 'simple-accounts' | 'makerkit-profiles' | 'custom-profiles'; /** * Validate the current strategy setup */ validateStrategy(): Promise<{ valid: boolean; issues: string[]; recommendations: string[]; }>; /** * Override the current strategy */ overrideStrategy(strategyName: string): Promise<void>; /** * Get all available strategies */ getAvailableStrategies(): string[]; /** * Get detection results for all strategies */ getAllDetectionResults(): Promise<Array<{ strategy: string; detection: any; }>>; /** * Get the currently active strategy */ getActiveStrategy(): SeedingStrategy | undefined; } export {}; //# sourceMappingURL=framework-adapter.d.ts.map