UNPKG

a0-purchases

Version:

Lightweight subscription management for AI apps with auto-detecting providers

30 lines 997 B
/** * Legacy Compatibility Layer * * This module provides backward compatibility for components that * were using the old iapService/iapServiceWrapper APIs. */ import { purchasesService } from './core/PurchasesService'; import { PURCHASES_ERROR_CODE } from './types'; // Re-export types that components need export { PURCHASES_ERROR_CODE } from './types'; /** * Create a library error (compatibility function) */ export function createLibraryError(message, code = PURCHASES_ERROR_CODE.UNKNOWN_ERROR, underlyingError, userCancelled = false) { const error = new Error(message); error.code = code; error.message = message; error.userCancelled = userCancelled; if (underlyingError) { error.underlyingError = underlyingError; } return error; } /** * Register Stripe presenter (compatibility function) */ export function registerStripePresenter(presenter) { purchasesService.registerStripePresenter(presenter); } //# sourceMappingURL=legacy-compat.js.map