@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
70 lines (69 loc) • 2.37 kB
TypeScript
/**
* AuthProviderFactory - Static factory for authentication providers
*
* Matches the ProviderFactory pattern: all-static class, no BaseFactory
* extension, no singleton instance. Providers are registered by
* AuthProviderRegistry using dynamic imports to avoid circular dependencies.
*/
import type { AuthProviderConfig, AuthProviderConstructor, AuthProviderMetadata, AuthProvider } from "../types/index.js";
/**
* AuthProviderFactory - Creates authentication provider instances
*
* Pure static factory with no hardcoded imports. All providers are
* registered dynamically by AuthProviderRegistry to avoid circular
* dependencies and enable lazy loading.
*
* @example
* ```typescript
* // Create a provider (after AuthProviderRegistry.registerAllProviders())
* const provider = await AuthProviderFactory.createProvider("auth0", {
* type: "auth0",
* domain: "your-tenant.auth0.com",
* clientId: "your-client-id",
* });
* ```
*/
export declare class AuthProviderFactory {
private static readonly providers;
private static readonly aliasMap;
/**
* Register a provider with the factory
*/
static registerProvider(type: string, factory: AuthProviderConstructor, aliases?: string[], metadata?: AuthProviderMetadata): void;
/**
* Create a provider instance
*/
static createProvider(typeOrAlias: string, config: AuthProviderConfig): Promise<AuthProvider>;
/**
* Check if a provider is registered
*/
static hasProvider(typeOrAlias: string): boolean;
/**
* Get list of available provider types (excludes aliases)
*/
static getAvailableProviders(): string[];
/**
* Get provider metadata
*/
static getProviderMetadata(typeOrAlias: string): AuthProviderMetadata | undefined;
/**
* Get all registered providers with their metadata
*/
static getAllProviderInfo(): Array<{
type: string;
aliases: string[];
metadata?: AuthProviderMetadata;
}>;
/**
* Clear all registrations (for testing)
*/
static clearRegistrations(): void;
/**
* Resolve an alias to its canonical provider type
*/
private static resolveType;
}
/**
* Create an auth provider using the factory
*/
export declare function createAuthProvider(type: string, config: AuthProviderConfig): Promise<AuthProvider>;