import { ApiClient } from './client'; import { mergeConfig } from './config'; import type { AstraSDKConfig, ApiResponse, RequestOptions } from './types'; import { AstraSDKError } from './types'; export class AstraSDK { private client: ApiClient; constructor(config: AstraSDKConfig) { if (!config.apiKey) { throw new AstraSDKError('API key is required', 400, 'MISSING_API_KEY'); } const mergedConfig = mergeConfig(config); this.client = new ApiClient(mergedConfig); } getClient(): ApiClient { return this.client; } updateConfig(config: Partial): void { this.client.updateConfig(config); } async get( endpoint: string, options?: Omit ): Promise> { return this.client.get(endpoint, options); } async post( endpoint: string, body?: unknown, options?: Omit ): Promise> { return this.client.post(endpoint, body, options); } async put( endpoint: string, body?: unknown, options?: Omit ): Promise> { return this.client.put(endpoint, body, options); } async patch( endpoint: string, body?: unknown, options?: Omit ): Promise> { return this.client.patch(endpoint, body, options); } async delete( endpoint: string, options?: Omit ): Promise> { return this.client.delete(endpoint, options); } async request( endpoint: string, options?: RequestOptions ): Promise> { return this.client.request(endpoint, options); } } export type { AstraSDKConfig, ApiResponse, RequestOptions, ApiError } from './types'; export { AstraSDKError } from './types'; export { ApiClient } from './client'; // Export KYC components export { KycFlow } from '../components/KycFlow'; export type { KycFlowProps } from '../components/KycFlow'; // Export KYC API service export { KycApiService } from '../services/kycApiService'; export type { KycApiConfig, SessionStatusResponse, FaceScanResponse, DocumentUploadResponse } from '../services/kycApiService'; export default AstraSDK;