UNPKG

sdk-simple-auth

Version:

Universal JavaScript/TypeScript authentication SDK with multi-backend support, automatic token refresh, and React integration

68 lines 2.52 kB
import { AuthSDK } from '../core/AuthSDK'; import { AuthConfig } from '../types'; import { EnhancedAuthConfig, BACKEND_PRESETS, ResponseAnalysis } from '../types/enhanced_types'; /** * Factory para crear instancias de AuthSDK configuradas para diferentes backends */ export declare class AuthSDKFactory { /** * Crear AuthSDK para backend específico */ static create(backendType: keyof typeof BACKEND_PRESETS, customConfig?: Partial<EnhancedAuthConfig>): AuthSDK; /** * Crear AuthSDK con configuración completamente personalizada */ static createCustom(config: AuthConfig): AuthSDK; /** * Analizar respuesta de API para detectar estructura */ static analyzeResponse(response: any): ResponseAnalysis; /** * Test automático de extracción para todos los presets */ static testAllPresets(response: any): Record<string, { success: boolean; error?: string; extracted?: any; }>; /** * Generar configuración custom basada en análisis de respuesta */ static generateCustomConfig(response: any, baseUrl: string): AuthConfig; private static getAllKeys; private static generateRecommendations; } /** * Crear AuthSDK para Node.js/Express (tu sistema actual) */ export declare function createNodeExpressAuth(baseUrl?: string, customConfig?: Partial<AuthConfig>): AuthSDK; /** * Crear AuthSDK para Laravel Sanctum */ export declare function createLaravelSanctumAuth(baseUrl?: string, customConfig?: Partial<AuthConfig>): AuthSDK; /** * Crear AuthSDK para JWT estándar */ export declare function createJWTStandardAuth(baseUrl: string, customConfig?: Partial<AuthConfig>): AuthSDK; /** * Auto-detectar y crear AuthSDK basado en una respuesta de ejemplo */ export declare function createAutoDetectAuth(sampleResponse: any, baseUrl: string): AuthSDK; /** * Función helper para testear diferentes respuestas de backend */ export declare function testBackendResponse(response: any, verbose?: boolean): void; /** * Crear configuración de desarrollo con logging extendido */ export declare function createDevAuth(backendType?: keyof typeof BACKEND_PRESETS, baseUrl?: string): AuthSDK; /** * Testear con datos mock de diferentes backends */ export declare function runMockTests(): void; /** * Comparar extracción entre presets para una respuesta */ export declare function compareExtractionMethods(response: any): void; export default AuthSDKFactory; //# sourceMappingURL=AuthSDKFactory.d.ts.map