@umituz/react-native-subscription 2.37.13 → 2.37.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/package.json +1 -1
  2. package/src/domains/credits/application/PurchaseMetadataGenerator.ts +1 -1
  3. package/src/domains/credits/application/credit-strategies/CreditAllocationOrchestrator.ts +1 -1
  4. package/src/domains/credits/application/creditDocumentHelpers.ts +0 -14
  5. package/src/domains/credits/presentation/deduct-credit/index.ts +0 -1
  6. package/src/domains/credits/presentation/useCredits.ts +1 -6
  7. package/src/domains/credits/utils/creditValidation.ts +3 -3
  8. package/src/domains/paywall/components/PaywallFeatures.tsx +1 -1
  9. package/src/domains/paywall/hooks/usePaywallActions.ts +1 -1
  10. package/src/domains/revenuecat/core/errors/RevenueCatError.ts +1 -14
  11. package/src/domains/revenuecat/core/errors/RevenueCatErrorHandler.ts +1 -1
  12. package/src/domains/revenuecat/core/types/RevenueCatTypes.ts +3 -3
  13. package/src/domains/revenuecat/infrastructure/services/ConfigurationStateManager.ts +1 -1
  14. package/src/domains/revenuecat/infrastructure/services/RevenueCatInitializer.ts +0 -2
  15. package/src/domains/subscription/application/initializer/index.ts +1 -1
  16. package/src/domains/subscription/core/SubscriptionStatus.ts +4 -10
  17. package/src/domains/subscription/core/SubscriptionStatusHandlers.ts +1 -1
  18. package/src/domains/subscription/infrastructure/handlers/PackageHandler.ts +0 -2
  19. package/src/domains/subscription/infrastructure/hooks/usePurchasePackage.ts +1 -1
  20. package/src/domains/subscription/infrastructure/hooks/useRevenueCatTrialEligibility.ts +1 -2
  21. package/src/domains/subscription/infrastructure/hooks/useSubscriptionQueries.ts +0 -4
  22. package/src/domains/subscription/infrastructure/services/OfferingsFetcher.ts +1 -1
  23. package/src/domains/subscription/infrastructure/services/RestoreHandler.ts +1 -1
  24. package/src/domains/subscription/infrastructure/services/RevenueCatService.ts +1 -2
  25. package/src/domains/subscription/infrastructure/services/revenueCatServiceInstance.ts +0 -4
  26. package/src/domains/subscription/infrastructure/utils/renewal/index.ts +1 -1
  27. package/src/domains/subscription/presentation/components/details/CreditRow.tsx +1 -1
  28. package/src/domains/subscription/presentation/components/details/DetailRow.tsx +1 -1
  29. package/src/domains/subscription/presentation/components/feedback/FeedbackOption.tsx +0 -2
  30. package/src/domains/subscription/presentation/components/feedback/FeedbackTextInput.tsx +1 -1
  31. package/src/domains/subscription/presentation/featureGateRefs.ts +1 -1
  32. package/src/domains/subscription/presentation/screens/components/CreditsList.tsx +2 -2
  33. package/src/domains/subscription/presentation/screens/components/SubscriptionHeader.tsx +0 -2
  34. package/src/domains/subscription/presentation/stores/index.ts +0 -5
  35. package/src/domains/subscription/presentation/stores/purchaseLoadingStore.ts +3 -7
  36. package/src/domains/subscription/presentation/useAuthAwarePurchase.ts +2 -8
  37. package/src/domains/subscription/presentation/useFeatureGate.ts +0 -2
  38. package/src/domains/subscription/presentation/usePaywallVisibility.ts +1 -1
  39. package/src/domains/subscription/utils/authGuards.ts +0 -23
  40. package/src/domains/subscription/utils/syncStatus.ts +1 -1
  41. package/src/domains/wallet/index.ts +0 -112
  42. package/src/domains/wallet/infrastructure/config/walletConfig.ts +1 -23
  43. package/src/domains/wallet/infrastructure/repositories/transaction/CollectionBuilder.ts +1 -1
  44. package/src/domains/wallet/infrastructure/repositories/transaction/index.ts +0 -9
  45. package/src/domains/wallet/presentation/components/BalanceCard.tsx +1 -1
  46. package/src/domains/wallet/presentation/components/TransactionItem.tsx +0 -2
  47. package/src/domains/wallet/presentation/components/TransactionList.tsx +3 -2
  48. package/src/domains/wallet/presentation/hooks/useTransactionHistory.ts +2 -2
  49. package/src/domains/wallet/presentation/hooks/useWallet.ts +2 -2
  50. package/src/shared/application/FeedbackService.ts +2 -2
  51. package/src/shared/infrastructure/SubscriptionEventBus.ts +1 -1
  52. package/src/shared/infrastructure/firestore/collectionUtils.ts +0 -7
  53. package/src/shared/infrastructure/firestore/resultUtils.ts +3 -39
  54. package/src/shared/presentation/layouts/ScreenLayout.tsx +1 -1
  55. package/src/shared/utils/numberUtils.core.ts +0 -27
  56. package/src/shared/utils/numberUtils.ts +1 -9
  57. package/src/shared/utils/validators.ts +0 -58
  58. package/src/domains/config/domain/entities/Plan.ts +0 -44
  59. package/src/domains/config/domain/index.ts +0 -2
  60. package/src/domains/config/domain/value-objects/Config.ts +0 -49
  61. package/src/domains/config/index.ts +0 -6
  62. package/src/domains/config/utils/planSelectors.ts +0 -56
  63. package/src/domains/paywall/components/FeatureItem.tsx +0 -50
  64. package/src/domains/paywall/components/FeatureList.tsx +0 -34
  65. package/src/domains/paywall/components/PaywallHeader.tsx +0 -112
  66. package/src/domains/paywall/hooks/usePaywallTranslations.ts +0 -78
  67. package/src/domains/paywall/hooks/useSubscriptionModal.ts +0 -45
  68. package/src/domains/paywall/index.ts +0 -13
  69. package/src/domains/revenuecat/core/constants/RevenueCatConstants.ts +0 -201
  70. package/src/domains/revenuecat/core/constants/index.ts +0 -5
  71. package/src/domains/revenuecat/core/customerInfoHelpers.ts +0 -21
  72. package/src/domains/revenuecat/core/index.ts +0 -7
  73. package/src/domains/revenuecat/index.ts +0 -7
  74. package/src/domains/revenuecat/infrastructure/index.ts +0 -5
  75. package/src/domains/revenuecat/infrastructure/services/index.ts +0 -7
  76. package/src/domains/subscription/infrastructure/hooks/customer-info/index.ts +0 -2
  77. package/src/domains/subscription/infrastructure/hooks/customer-info/types.ts +0 -9
  78. package/src/domains/subscription/infrastructure/hooks/customer-info/useCustomerInfo.ts +0 -52
  79. package/src/domains/subscription/infrastructure/hooks/useInitializeSubscription.ts +0 -30
  80. package/src/domains/subscription/infrastructure/hooks/usePaywallFlow.ts +0 -78
  81. package/src/domains/subscription/infrastructure/hooks/useRevenueCat.ts +0 -119
  82. package/src/domains/subscription/presentation/components/feedback/FeedbackConstants.ts +0 -6
  83. package/src/domains/subscription/presentation/screens/components/SubscriptionActions.tsx +0 -56
  84. package/src/domains/subscription/utils/dateFormatters.ts +0 -28
  85. package/src/domains/wallet/domain/entities/CreditCost.ts +0 -45
  86. package/src/domains/wallet/domain/entities/README.md +0 -41
  87. package/src/domains/wallet/domain/errors/README.md +0 -40
  88. package/src/domains/wallet/domain/errors/WalletError.ts +0 -17
  89. package/src/domains/wallet/domain/errors/WalletError.types.ts +0 -30
  90. package/src/domains/wallet/domain/errors/WalletErrorClasses.ts +0 -82
  91. package/src/domains/wallet/domain/errors/WalletErrorFactory.ts +0 -24
  92. package/src/domains/wallet/domain/errors/WalletErrorMessages.ts +0 -17
  93. package/src/domains/wallet/domain/types/credit-cost.types.ts +0 -86
  94. package/src/domains/wallet/domain/types/index.ts +0 -33
  95. package/src/domains/wallet/domain/types/wallet.types.ts +0 -50
  96. package/src/domains/wallet/infrastructure/services/product-metadata/CacheManager.ts +0 -30
  97. package/src/domains/wallet/infrastructure/services/product-metadata/FirebaseFetcher.ts +0 -17
  98. package/src/domains/wallet/infrastructure/services/product-metadata/ProductMetadataService.ts +0 -57
  99. package/src/domains/wallet/infrastructure/services/product-metadata/ServiceManager.ts +0 -29
  100. package/src/domains/wallet/infrastructure/services/product-metadata/index.ts +0 -7
  101. package/src/domains/wallet/presentation/hooks/index.ts +0 -8
  102. package/src/domains/wallet/presentation/hooks/useProductMetadata.ts +0 -72
  103. package/src/domains/wallet/utils/index.ts +0 -1
  104. package/src/shared/application/ActivationHandler.ts +0 -108
  105. package/src/shared/application/ports/ISubscriptionService.ts +0 -27
  106. package/src/shared/infrastructure/index.ts +0 -6
  107. package/src/shared/infrastructure/react-query/queryInvalidation.ts +0 -46
  108. package/src/shared/presentation/hooks/index.ts +0 -6
  109. package/src/shared/presentation/hooks/useAsyncState.ts +0 -72
  110. package/src/shared/presentation/hooks/useServiceCall.ts +0 -77
  111. package/src/shared/types/ReactTypes.ts +0 -80
  112. package/src/shared/utils/InsufficientCreditsError.ts +0 -32
  113. package/src/shared/utils/Logger.ts +0 -81
  114. package/src/shared/utils/SubscriptionConfig.ts +0 -15
  115. package/src/shared/utils/SubscriptionError.ts +0 -47
  116. package/src/shared/utils/appValidators.ts +0 -38
  117. package/src/shared/utils/arrayUtils.core.ts +0 -81
  118. package/src/shared/utils/arrayUtils.query.ts +0 -118
  119. package/src/shared/utils/arrayUtils.transforms.ts +0 -116
  120. package/src/shared/utils/arrayUtils.ts +0 -19
  121. package/src/shared/utils/errorUtils.ts +0 -32
  122. package/src/shared/utils/index.ts +0 -14
  123. package/src/shared/utils/numberUtils.aggregate.ts +0 -35
  124. package/src/shared/utils/numberUtils.format.ts +0 -42
  125. package/src/shared/utils/numberUtils.math.ts +0 -48
  126. package/src/shared/utils/queryKeyFactory.ts +0 -9
  127. package/src/shared/utils/stringUtils.case.ts +0 -64
  128. package/src/shared/utils/stringUtils.check.ts +0 -65
  129. package/src/shared/utils/stringUtils.format.ts +0 -84
  130. package/src/shared/utils/stringUtils.generate.ts +0 -47
  131. package/src/shared/utils/stringUtils.modify.ts +0 -67
  132. package/src/shared/utils/stringUtils.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-subscription",
3
- "version": "2.37.13",
3
+ "version": "2.37.14",
4
4
  "description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -8,7 +8,7 @@ import type {
8
8
  import { detectPackageType } from "../../../utils/packageTypeDetector";
9
9
  import { PACKAGE_TYPE, PURCHASE_TYPE, type Platform } from "../../subscription/core/SubscriptionConstants";
10
10
 
11
- export interface MetadataGeneratorConfig {
11
+ interface MetadataGeneratorConfig {
12
12
  productId: string;
13
13
  source: PurchaseSource;
14
14
  type: PurchaseType;
@@ -6,7 +6,7 @@ import { StandardPurchaseCreditStrategy } from "./StandardPurchaseCreditStrategy
6
6
  /**
7
7
  * Orchestrator to coordinate credit allocation logic using the Strategy Pattern.
8
8
  */
9
- export class CreditAllocationOrchestrator {
9
+ class CreditAllocationOrchestrator {
10
10
  private strategies: ICreditStrategy[] = [
11
11
  new SyncCreditStrategy(),
12
12
  new TrialCreditStrategy(),
@@ -6,8 +6,6 @@
6
6
  import type { UserCreditsDocumentRead } from "../core/UserCreditsDocument";
7
7
  import { serverTimestamp, type DocumentSnapshot } from "@umituz/react-native-firebase";
8
8
  import { SUBSCRIPTION_STATUS, type Platform } from "../../subscription/core/SubscriptionConstants";
9
- import { PROCESSED_PURCHASES_WINDOW } from "../core/CreditsConstants";
10
-
11
9
  /**
12
10
  * Get existing credit document or create default
13
11
  */
@@ -54,15 +52,3 @@ export function getCreditDocumentOrDefault(
54
52
 
55
53
  return defaultDocument;
56
54
  }
57
-
58
- /**
59
- * Add purchase ID to processed purchases list
60
- * Maintains last N purchases (default: PROCESSED_PURCHASES_WINDOW)
61
- */
62
- export function addProcessedPurchase(
63
- existing: string[],
64
- purchaseId: string,
65
- limit: number = PROCESSED_PURCHASES_WINDOW
66
- ): string[] {
67
- return [...existing, purchaseId].slice(-limit);
68
- }
@@ -1,2 +1 @@
1
1
  export { useDeductCredit } from "./useDeductCredit";
2
- export type { UseDeductCreditParams, UseDeductCreditResult } from "./types";
@@ -95,9 +95,4 @@ export const useCredits = (): UseCreditsResult => {
95
95
  refetch,
96
96
  canAfford,
97
97
  };
98
- };
99
-
100
- export const useHasCredits = (): boolean => {
101
- const { hasCredits } = useCredits();
102
- return hasCredits;
103
- };
98
+ };
@@ -1,14 +1,14 @@
1
1
  import { isValidNumber, isNonNegativeNumber } from "../../../shared/utils/validators";
2
2
 
3
- export const isValidBalance = (balance: number | null | undefined): balance is number => {
3
+ const isValidBalance = (balance: number | null | undefined): balance is number => {
4
4
  return isValidNumber(balance) && isNonNegativeNumber(balance);
5
5
  };
6
6
 
7
- export const isValidCost = (cost: number): boolean => {
7
+ const isValidCost = (cost: number): boolean => {
8
8
  return isValidNumber(cost) && isNonNegativeNumber(cost);
9
9
  };
10
10
 
11
- export const isValidMaxCredits = (max: number): boolean => {
11
+ const isValidMaxCredits = (max: number): boolean => {
12
12
  return isValidNumber(max) && max > 0;
13
13
  };
14
14
 
@@ -11,7 +11,7 @@ export const PaywallFeatures: React.FC<{ features: SubscriptionFeature[] }> = ({
11
11
  return (
12
12
  <View style={[styles.features, { backgroundColor: tokens.colors.surfaceSecondary }]}>
13
13
  {features.map((feature, idx) => (
14
- <View key={idx} style={styles.featureRow}>
14
+ <View key={`${feature.icon}-${feature.text}`} style={styles.featureRow}>
15
15
  <View style={[styles.featureIcon, { backgroundColor: tokens.colors.primaryLight }]}>
16
16
  <AtomicIcon name={feature.icon} customSize={16} customColor={tokens.colors.primary} />
17
17
  </View>
@@ -7,7 +7,7 @@ import type { PurchasesPackage } from "react-native-purchases";
7
7
  import { usePurchaseLoadingStore } from "../../subscription/presentation/stores";
8
8
  import type { PurchaseSource } from "../../subscription/core/SubscriptionConstants";
9
9
 
10
- export interface UsePaywallActionsParams {
10
+ interface UsePaywallActionsParams {
11
11
  packages?: PurchasesPackage[];
12
12
  onPurchase?: (pkg: PurchasesPackage) => Promise<void | boolean>;
13
13
  onRestore?: () => Promise<void | boolean>;
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { BaseError } from "../../../../shared/utils/BaseError";
7
7
 
8
- export class RevenueCatError extends BaseError {
8
+ class RevenueCatError extends BaseError {
9
9
  constructor(message: string, code: string = 'REVENUE_CAT_ERROR', cause?: Error) {
10
10
  super(message, code, cause);
11
11
  this.name = "RevenueCatError";
@@ -19,13 +19,6 @@ export class RevenueCatInitializationError extends RevenueCatError {
19
19
  }
20
20
  }
21
21
 
22
- export class RevenueCatConfigurationError extends RevenueCatError {
23
- constructor(message = "RevenueCat configuration is invalid", cause?: Error) {
24
- super(message, 'REVENUE_CAT_CONFIGURATION_ERROR', cause);
25
- this.name = "RevenueCatConfigurationError";
26
- }
27
- }
28
-
29
22
  export class RevenueCatPurchaseError extends RevenueCatError {
30
23
  public readonly productId: string | undefined;
31
24
 
@@ -57,9 +50,3 @@ export class RevenueCatNetworkError extends RevenueCatError {
57
50
  }
58
51
  }
59
52
 
60
- export class RevenueCatExpoGoError extends RevenueCatError {
61
- constructor(message = "RevenueCat is not available in Expo Go. Use a development build or test store.", cause?: Error) {
62
- super(message, 'REVENUE_CAT_EXPO_GO_ERROR', cause);
63
- this.name = "RevenueCatExpoGoError";
64
- }
65
- }
@@ -54,7 +54,7 @@ const ERROR_CODE_MAP = new Map<string, PurchasesErrorCode>([
54
54
  * @param errorCode - Error code string from RevenueCat error
55
55
  * @returns ErrorMessage configuration
56
56
  */
57
- export function getErrorMessageForCode(errorCode: string | null | undefined): ErrorMessage {
57
+ function getErrorMessageForCode(errorCode: string | null | undefined): ErrorMessage {
58
58
  if (!errorCode) {
59
59
  return DEFAULT_ERROR_MESSAGE;
60
60
  }
@@ -9,7 +9,7 @@ import type { CustomerInfo, PurchasesEntitlementInfo, PurchasesPackage } from "r
9
9
  * Default entitlement identifier
10
10
  * Can be overridden in RevenueCatConfig
11
11
  */
12
- export const DEFAULT_ENTITLEMENT_ID = "premium";
12
+ const DEFAULT_ENTITLEMENT_ID = "premium";
13
13
 
14
14
  /**
15
15
  * Store type - Directly from RevenueCat SDK
@@ -34,7 +34,7 @@ export type PackageType = PurchasesPackage['packageType'];
34
34
  * RevenueCat Entitlement Info
35
35
  * Represents active entitlement data from CustomerInfo
36
36
  */
37
- export interface RevenueCatEntitlement {
37
+ interface RevenueCatEntitlement {
38
38
  identifier: string;
39
39
  productIdentifier: string;
40
40
  isSandbox: boolean;
@@ -50,7 +50,7 @@ export interface RevenueCatEntitlement {
50
50
  /**
51
51
  * RevenueCat Purchase Error with userCancelled flag
52
52
  */
53
- export interface RevenueCatPurchaseErrorInfo extends Error {
53
+ interface RevenueCatPurchaseErrorInfo extends Error {
54
54
  userCancelled?: boolean;
55
55
  code?: string;
56
56
  readableErrorCode?: string;
@@ -1,6 +1,6 @@
1
1
  import type { InitializeResult } from "../../../../shared/application/ports/IRevenueCatService";
2
2
 
3
- export class ConfigurationStateManager {
3
+ class ConfigurationStateManager {
4
4
  private _isPurchasesConfigured = false;
5
5
  private _configurationPromise: Promise<InitializeResult> | null = null;
6
6
  private _resolveConfiguration: ((value: InitializeResult) => void) | null = null;
@@ -5,8 +5,6 @@ import { FAILED_INITIALIZATION_RESULT, CONFIGURATION_RETRY_DELAY_MS, MAX_INIT_RE
5
5
  import { configState } from "./ConfigurationStateManager";
6
6
  import { handleUserSwitch, handleInitialConfiguration, fetchCurrentUserData } from "./userSwitchHandler";
7
7
 
8
- export type { InitializerDeps } from "./RevenueCatInitializer.types";
9
-
10
8
  const MAX_CONFIG_START_RETRIES = 3;
11
9
 
12
10
  export async function initializeSDK(
@@ -1,2 +1,2 @@
1
1
  export { initializeSubscription } from "./SubscriptionInitializer";
2
- export type { FirebaseAuthLike, CreditPackageConfig, SubscriptionInitConfig } from "../SubscriptionInitializerTypes";
2
+ export type { CreditPackageConfig, SubscriptionInitConfig } from "../SubscriptionInitializerTypes";
@@ -11,11 +11,10 @@ import {
11
11
  ActiveStatusHandler
12
12
  } from "./SubscriptionStatusHandlers";
13
13
 
14
- export {
15
- SUBSCRIPTION_STATUS,
16
- PERIOD_TYPE,
17
- type PeriodType,
18
- type SubscriptionStatusType
14
+ export {
15
+ PERIOD_TYPE,
16
+ type PeriodType,
17
+ type SubscriptionStatusType
19
18
  };
20
19
 
21
20
  export interface SubscriptionStatus {
@@ -46,11 +45,6 @@ export const isSubscriptionValid = (status: SubscriptionStatus | null): boolean
46
45
  return timezoneService.isFuture(new Date(status.expiresAt));
47
46
  };
48
47
 
49
- export const calculateDaysRemaining = (expiresAt: string | null): number | null => {
50
- if (!expiresAt) return null;
51
- return timezoneService.getDaysUntil(new Date(expiresAt));
52
- };
53
-
54
48
  export interface StatusResolverInput {
55
49
  isPremium: boolean;
56
50
  willRenew?: boolean;
@@ -5,7 +5,7 @@ import {
5
5
  } from "./SubscriptionConstants";
6
6
  import type { StatusResolverInput } from "./SubscriptionStatus";
7
7
 
8
- export abstract class BaseStatusHandler {
8
+ abstract class BaseStatusHandler {
9
9
  protected next?: BaseStatusHandler;
10
10
 
11
11
  setNext(handler: BaseStatusHandler): BaseStatusHandler {
@@ -36,5 +36,3 @@ export class PackageHandler {
36
36
  return checkPremiumStatus(customerInfo, this.entitlementId);
37
37
  }
38
38
  }
39
-
40
- export type { PremiumStatus, RestoreResultInfo };
@@ -20,7 +20,7 @@ import { creditsQueryKeys } from "../../../credits/presentation/creditsQueryKeys
20
20
  import { getErrorMessage } from "../../../revenuecat/core/errors";
21
21
 
22
22
  /** Purchase mutation result - simplified for presentation layer */
23
- export interface PurchaseMutationResult {
23
+ interface PurchaseMutationResult {
24
24
  success: boolean;
25
25
  productId: string;
26
26
  }
@@ -14,9 +14,8 @@ import {
14
14
  type TrialEligibilityMap,
15
15
  } from "../utils/trialEligibilityUtils";
16
16
 
17
- export type { ProductTrialEligibility, TrialEligibilityMap };
18
17
 
19
- export interface UseRevenueCatTrialEligibilityResult {
18
+ interface UseRevenueCatTrialEligibilityResult {
20
19
  /** Map of product IDs to their trial eligibility */
21
20
  eligibilityMap: TrialEligibilityMap;
22
21
  /** Whether eligibility check is in progress */
@@ -4,10 +4,6 @@
4
4
  * Generic hooks for 100+ apps
5
5
  */
6
6
 
7
- export {
8
- SUBSCRIPTION_QUERY_KEYS,
9
- } from "./subscriptionQueryKeys";
10
- export { useInitializeSubscription } from "./useInitializeSubscription";
11
7
  export { useSubscriptionPackages } from "./useSubscriptionPackages";
12
8
  export { usePurchasePackage } from "./usePurchasePackage";
13
9
  export { useRestorePurchase } from "./useRestorePurchase";
@@ -1,6 +1,6 @@
1
1
  import Purchases, { type PurchasesOffering } from "react-native-purchases";
2
2
 
3
- export interface OfferingsFetcherDeps {
3
+ interface OfferingsFetcherDeps {
4
4
  isInitialized: () => boolean;
5
5
  }
6
6
 
@@ -14,7 +14,7 @@ import {
14
14
  } from "../../../revenuecat/core/types";
15
15
  import { notifyRestoreCompleted } from "../utils/PremiumStatusSyncer";
16
16
 
17
- export interface RestoreHandlerDeps {
17
+ interface RestoreHandlerDeps {
18
18
  config: RevenueCatConfig;
19
19
  isInitialized: () => boolean;
20
20
  }
@@ -1,2 +1 @@
1
- export { RevenueCatService } from "./RevenueCatService.types";
2
- export { initializeRevenueCatService, getRevenueCatService, resetRevenueCatService } from "./revenueCatServiceInstance";
1
+ export { initializeRevenueCatService, getRevenueCatService } from "./revenueCatServiceInstance";
@@ -11,7 +11,3 @@ export const initializeRevenueCatService = (config: RevenueCatConfig): RevenueCa
11
11
  };
12
12
 
13
13
  export const getRevenueCatService = (): RevenueCatService | null => revenueCatServiceInstance;
14
-
15
- export const resetRevenueCatService = (): void => {
16
- revenueCatServiceInstance = null;
17
- };
@@ -1,3 +1,3 @@
1
- export type { RenewalState, RenewalDetectionResult } from "./types";
1
+ export type { RenewalState } from "./types";
2
2
  export { detectRenewal } from "./RenewalDetector";
3
3
  export { updateRenewalState } from "./RenewalStateUpdater";
@@ -2,7 +2,7 @@ import React, { useMemo } from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
3
  import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
4
4
 
5
- export interface CreditRowProps {
5
+ interface CreditRowProps {
6
6
  label: string;
7
7
  current: number;
8
8
  total: number;
@@ -7,7 +7,7 @@ import React from "react";
7
7
  import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
8
8
  import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
9
9
 
10
- export interface DetailRowProps {
10
+ interface DetailRowProps {
11
11
  label: string;
12
12
  value: string;
13
13
  highlight?: boolean;
@@ -7,8 +7,6 @@ import { FEEDBACK_OPTION_OPACITY } from "./feedbackOptionConstants";
7
7
  import { FeedbackRadioButton } from "./FeedbackRadioButton";
8
8
  import { FeedbackTextInput } from "./FeedbackTextInput";
9
9
 
10
- export type { FeedbackOptionProps } from "./FeedbackOption.types";
11
-
12
10
  export const FeedbackOption: React.FC<FeedbackOptionProps> = React.memo(({
13
11
  isSelected,
14
12
  text,
@@ -33,7 +33,7 @@ export const FeedbackTextInput: React.FC<FeedbackTextInputProps> = ({ placeholde
33
33
  maxLength={FEEDBACK_INPUT_MAX_LENGTH}
34
34
  value={value}
35
35
  onChangeText={onChangeText}
36
- autoFocus
36
+
37
37
  />
38
38
  </View>
39
39
  );
@@ -1,6 +1,6 @@
1
1
  import { useRef, useEffect, type MutableRefObject } from "react";
2
2
 
3
- export interface FeatureGateRefs {
3
+ interface FeatureGateRefs {
4
4
  creditBalanceRef: MutableRefObject<number>;
5
5
  hasSubscriptionRef: MutableRefObject<boolean>;
6
6
  onShowPaywallRef: MutableRefObject<(requiredCredits?: number) => void>;
@@ -8,14 +8,14 @@ import { View, StyleSheet } from "react-native";
8
8
  import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
9
9
  import { CreditRow } from "../../components/details/CreditRow";
10
10
 
11
- export interface CreditItem {
11
+ interface CreditItem {
12
12
  id: string;
13
13
  label: string;
14
14
  current: number;
15
15
  total: number;
16
16
  }
17
17
 
18
- export interface CreditsListProps {
18
+ interface CreditsListProps {
19
19
  credits: readonly CreditItem[];
20
20
  title?: string;
21
21
  description?: string;
@@ -7,8 +7,6 @@ import { createSubscriptionHeaderStyles } from "./SubscriptionHeader.styles";
7
7
  import { EXPIRATION_WARNING_THRESHOLD_DAYS as EXPIRING_SOON_THRESHOLD_DAYS } from "../../../constants/thresholds";
8
8
  import { SubscriptionHeaderContent } from "./SubscriptionHeaderContent";
9
9
 
10
- export type { SubscriptionHeaderProps } from "./SubscriptionHeader.types";
11
-
12
10
  export const SubscriptionHeader: React.FC<SubscriptionHeaderProps> = ({
13
11
  statusType,
14
12
  showExpirationDate,
@@ -5,9 +5,4 @@
5
5
  export {
6
6
  usePurchaseLoadingStore,
7
7
  selectIsPurchasing,
8
- selectIsProductPurchasing,
9
- selectPurchaseSource,
10
- type PurchaseLoadingState,
11
- type PurchaseLoadingActions,
12
- type PurchaseLoadingStore,
13
8
  } from "./purchaseLoadingStore";
@@ -7,12 +7,12 @@
7
7
 
8
8
  import { create } from "zustand";
9
9
 
10
- export interface PurchaseLoadingState {
10
+ interface PurchaseLoadingState {
11
11
  /** Map of product IDs to purchase sources (supports concurrent purchases) */
12
12
  activePurchases: Map<string, "manual" | "auto-execution">;
13
13
  }
14
14
 
15
- export interface PurchaseLoadingActions {
15
+ interface PurchaseLoadingActions {
16
16
  /** Start purchase loading state for a product */
17
17
  startPurchase: (productId: string, source: "manual" | "auto-execution") => void;
18
18
  /** End purchase loading state for a product */
@@ -23,7 +23,7 @@ export interface PurchaseLoadingActions {
23
23
  reset: () => void;
24
24
  }
25
25
 
26
- export type PurchaseLoadingStore = PurchaseLoadingState & PurchaseLoadingActions;
26
+ type PurchaseLoadingStore = PurchaseLoadingState & PurchaseLoadingActions;
27
27
 
28
28
  const createInitialState = (): PurchaseLoadingState => ({
29
29
  activePurchases: new Map(),
@@ -61,7 +61,3 @@ export const usePurchaseLoadingStore = create<PurchaseLoadingStore>((set, get) =
61
61
 
62
62
  // Selectors for optimized re-renders
63
63
  export const selectIsPurchasing = (state: PurchaseLoadingStore) => state.activePurchases.size > 0;
64
- export const selectIsProductPurchasing = (productId: string) =>
65
- (state: PurchaseLoadingStore) => state.activePurchases.has(productId);
66
- export const selectPurchaseSource = (productId: string) =>
67
- (state: PurchaseLoadingStore) => state.activePurchases.get(productId) ?? null;
@@ -9,16 +9,10 @@ import { usePremium } from "./usePremium";
9
9
  import type { PurchaseSource } from "../core/SubscriptionConstants";
10
10
  import { authPurchaseStateManager } from "../infrastructure/utils/authPurchaseState";
11
11
 
12
- export type { PurchaseAuthProvider } from "../infrastructure/utils/authPurchaseState";
13
-
14
12
  export const configureAuthProvider = (provider: import("../infrastructure/utils/authPurchaseState").PurchaseAuthProvider): void => {
15
13
  authPurchaseStateManager.configure(provider);
16
14
  };
17
15
 
18
- export const cleanupAuthProvider = (): void => {
19
- authPurchaseStateManager.cleanup();
20
- };
21
-
22
16
  export const getSavedPurchase = (): { pkg: PurchasesPackage; source: PurchaseSource } | null => {
23
17
  return authPurchaseStateManager.getSavedPurchase();
24
18
  };
@@ -27,11 +21,11 @@ export const clearSavedPurchase = (): void => {
27
21
  authPurchaseStateManager.clearSavedPurchase();
28
22
  };
29
23
 
30
- export interface UseAuthAwarePurchaseParams {
24
+ interface UseAuthAwarePurchaseParams {
31
25
  source?: PurchaseSource;
32
26
  }
33
27
 
34
- export interface UseAuthAwarePurchaseResult {
28
+ interface UseAuthAwarePurchaseResult {
35
29
  handlePurchase: (pkg: PurchasesPackage, source?: PurchaseSource) => Promise<boolean>;
36
30
  handleRestore: () => Promise<boolean>;
37
31
  executeSavedPurchase: () => Promise<boolean>;
@@ -4,8 +4,6 @@ import { DEFAULT_REQUIRED_CREDITS, canExecuteAuthAction, canExecutePurchaseActio
4
4
  import { useSyncedRefs } from "./featureGateRefs";
5
5
  import { executeFeatureAction } from "./featureGateActions";
6
6
 
7
- export type { UseFeatureGateParams, UseFeatureGateResult } from "./useFeatureGate.types";
8
-
9
7
  export function useFeatureGate(params: UseFeatureGateParams): UseFeatureGateResult {
10
8
  const {
11
9
  isAuthenticated,
@@ -39,7 +39,7 @@ export const paywallControl = {
39
39
  getSource: () => paywallState.source,
40
40
  };
41
41
 
42
- export interface UsePaywallVisibilityResult {
42
+ interface UsePaywallVisibilityResult {
43
43
  showPaywall: boolean;
44
44
  currentSource?: PurchaseSource;
45
45
  setShowPaywall: (visible: boolean, source?: PurchaseSource) => void;
@@ -4,26 +4,3 @@ export function isAuthenticated(userId: string | null | undefined): userId is st
4
4
  return isDefined(userId) && userId.length > 0;
5
5
  }
6
6
 
7
- /**
8
- * Requires user to be authenticated, throws if not
9
- * Type guard that asserts userId is string
10
- *
11
- * @param userId - User ID to check
12
- * @param errorMessage - Custom error message (optional)
13
- * @throws Error if user is not authenticated
14
- *
15
- * @example
16
- * function purchaseProduct(userId: string | null) {
17
- * requireAuthentication(userId); // throws if null/undefined
18
- * // TypeScript now knows userId is string
19
- * await purchase(userId);
20
- * }
21
- */
22
- export function requireAuthentication(
23
- userId: string | null | undefined,
24
- errorMessage = "User not authenticated"
25
- ): asserts userId is string {
26
- if (!isAuthenticated(userId)) {
27
- throw new Error(errorMessage);
28
- }
29
- }
@@ -1,7 +1,7 @@
1
1
  import { isDefined } from "../../../shared/utils/validators";
2
2
  import type { UserCredits } from "../../credits/core/Credits";
3
3
 
4
- export interface SyncState {
4
+ interface SyncState {
5
5
  statusLoading: boolean;
6
6
  creditsLoading: boolean;
7
7
  subscriptionActive: boolean;