@umituz/react-native-subscription 2.45.2 → 3.0.1
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.
- package/package.json +5 -1
- package/src/domains/paywall/components/PaywallScreen.renderItem.tsx +1 -1
- package/src/domains/subscription/presentation/useSubscriptionFlow.ts +4 -1
- package/src/exports/analytics.ts +18 -0
- package/src/exports/experimental.ts +12 -0
- package/src/exports/onboarding.ts +17 -0
- package/src/exports/wallet.ts +32 -0
- package/src/index.components.ts +40 -0
- package/src/index.constants.ts +71 -0
- package/src/index.hooks.ts +41 -0
- package/src/index.infrastructure.ts +81 -0
- package/src/index.ts +18 -200
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
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,6 +8,10 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./src/index.ts",
|
|
10
10
|
"./init": "./src/init/index.ts",
|
|
11
|
+
"./exports/wallet": "./src/exports/wallet.ts",
|
|
12
|
+
"./exports/onboarding": "./src/exports/onboarding.ts",
|
|
13
|
+
"./exports/analytics": "./src/exports/analytics.ts",
|
|
14
|
+
"./exports/experimental": "./src/exports/experimental.ts",
|
|
11
15
|
"./package.json": "./package.json"
|
|
12
16
|
},
|
|
13
17
|
"scripts": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from "react";
|
|
7
|
-
import { View
|
|
7
|
+
import { View } from "react-native";
|
|
8
8
|
import type { ImageSourcePropType } from "react-native";
|
|
9
9
|
import { AtomicText, AtomicIcon } from "@umituz/react-native-design-system/atoms";
|
|
10
10
|
import { Image } from "expo-image";
|
|
@@ -50,7 +50,6 @@ export interface SubscriptionFlowState {
|
|
|
50
50
|
export interface SubscriptionFlowActions {
|
|
51
51
|
// Flow actions
|
|
52
52
|
completeOnboarding: () => void;
|
|
53
|
-
checkPremiumStatus: () => void;
|
|
54
53
|
showPaywall: () => void;
|
|
55
54
|
completePaywall: (purchased: boolean) => void;
|
|
56
55
|
showFeedbackScreen: () => void;
|
|
@@ -62,6 +61,10 @@ export interface SubscriptionFlowActions {
|
|
|
62
61
|
// Sync actions
|
|
63
62
|
setSyncStatus: (status: SyncStatus, error?: string | null) => void;
|
|
64
63
|
|
|
64
|
+
// State setters (for internal use)
|
|
65
|
+
setInitialized: (initialized: boolean) => void;
|
|
66
|
+
setStatus: (status: SubscriptionFlowStatus) => void;
|
|
67
|
+
|
|
65
68
|
// Reset
|
|
66
69
|
resetFlow: () => void;
|
|
67
70
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SUBSCRIPTION ANALYTICS (Optional)
|
|
3
|
+
*
|
|
4
|
+
* NOTE: Analytics features coming soon
|
|
5
|
+
* This is a placeholder for future subscription analytics
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Future: import { SubscriptionAnalytics } from '@umituz/react-native-subscription/exports/analytics';
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Reserved for future analytics features
|
|
12
|
+
// For now, use your own analytics solution with our hooks:
|
|
13
|
+
// - usePremiumStatus
|
|
14
|
+
// - useSubscriptionStatus
|
|
15
|
+
// - usePaywallVisibility
|
|
16
|
+
|
|
17
|
+
export { useSubscriptionStatus } from '../domains/subscription/presentation/useSubscriptionStatus';
|
|
18
|
+
export { usePremiumStatus } from '../domains/subscription/presentation/usePremiumStatus';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXPERIMENTAL Features (Beta)
|
|
3
|
+
*
|
|
4
|
+
* NOTE: Experimental features coming soon
|
|
5
|
+
* This is a placeholder for future beta features
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Future: import { AIUpsell } from '@umituz/react-native-subscription/exports/experimental';
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Reserved for future experimental features
|
|
12
|
+
// Check back later for AI-powered features, smart paywalls, etc.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONBOARDING Helpers (Optional)
|
|
3
|
+
*
|
|
4
|
+
* Advanced onboarding utilities for custom flows
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* import { useOnboardingProgress } from '@umituz/react-native-subscription/exports/onboarding';
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// NOTE: These are placeholder exports for future onboarding features
|
|
11
|
+
// Currently, onboarding is handled by ManagedSubscriptionFlow core
|
|
12
|
+
|
|
13
|
+
// Re-export core onboarding types
|
|
14
|
+
export { SubscriptionFlowStatus } from '../domains/subscription/presentation/useSubscriptionFlow';
|
|
15
|
+
|
|
16
|
+
// Onboarding is part of ManagedSubscriptionFlow core
|
|
17
|
+
// This file is reserved for future advanced onboarding utilities
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WALLET Features (Optional)
|
|
3
|
+
*
|
|
4
|
+
* Import only if your app needs wallet UI and transaction history
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* import { WalletScreen } from '@umituz/react-native-subscription/exports/wallet';
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Wallet Screen
|
|
11
|
+
export {
|
|
12
|
+
WalletScreen as WalletScreenContainer,
|
|
13
|
+
} from '../domains/wallet/presentation/screens/WalletScreen';
|
|
14
|
+
|
|
15
|
+
export type {
|
|
16
|
+
WalletScreenProps,
|
|
17
|
+
WalletScreenTranslations,
|
|
18
|
+
} from '../domains/wallet/presentation/screens/WalletScreen.types';
|
|
19
|
+
|
|
20
|
+
// Wallet Hooks
|
|
21
|
+
export { useWallet } from '../domains/wallet/presentation/hooks/useWallet';
|
|
22
|
+
export { useTransactionHistory } from '../domains/wallet/presentation/hooks/useTransactionHistory';
|
|
23
|
+
|
|
24
|
+
// Wallet Components
|
|
25
|
+
export { BalanceCard } from '../domains/wallet/presentation/components/BalanceCard';
|
|
26
|
+
export type { BalanceCardProps } from '../domains/wallet/presentation/components/BalanceCard.types';
|
|
27
|
+
|
|
28
|
+
export { TransactionList } from '../domains/wallet/presentation/components/TransactionList';
|
|
29
|
+
export type { TransactionListProps } from '../domains/wallet/presentation/components/TransactionList.types';
|
|
30
|
+
|
|
31
|
+
export { TransactionItem } from '../domains/wallet/presentation/components/TransactionItem';
|
|
32
|
+
export type { TransactionItemProps } from '../domains/wallet/presentation/components/TransactionItem.types';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CORE Exports - Components
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Subscription Components
|
|
6
|
+
export { PremiumDetailsCard } from "./domains/subscription/presentation/components/details/PremiumDetailsCard";
|
|
7
|
+
export type {
|
|
8
|
+
PremiumDetailsTranslations,
|
|
9
|
+
PremiumDetailsCardProps,
|
|
10
|
+
} from "./domains/subscription/presentation/components/details/PremiumDetailsCardTypes";
|
|
11
|
+
|
|
12
|
+
export { PremiumStatusBadge } from "./domains/subscription/presentation/components/details/PremiumStatusBadge";
|
|
13
|
+
export type { PremiumStatusBadgeProps } from "./domains/subscription/presentation/components/details/PremiumStatusBadge.types";
|
|
14
|
+
|
|
15
|
+
export { SubscriptionSection } from "./domains/subscription/presentation/components/sections/SubscriptionSection";
|
|
16
|
+
export type { SubscriptionSectionProps } from "./domains/subscription/presentation/components/sections/SubscriptionSection.types";
|
|
17
|
+
|
|
18
|
+
export { PaywallFeedbackScreen } from "./domains/subscription/presentation/components/feedback/PaywallFeedbackScreen";
|
|
19
|
+
export type { PaywallFeedbackScreenProps } from "./domains/subscription/presentation/components/feedback/PaywallFeedbackScreen.types";
|
|
20
|
+
|
|
21
|
+
// Subscription Screens
|
|
22
|
+
export type {
|
|
23
|
+
SubscriptionDetailConfig,
|
|
24
|
+
SubscriptionDetailTranslations,
|
|
25
|
+
SubscriptionDisplayFlags,
|
|
26
|
+
UpgradePromptConfig,
|
|
27
|
+
} from "./domains/subscription/presentation/screens/SubscriptionDetailScreen.types";
|
|
28
|
+
|
|
29
|
+
export { SubscriptionDetailScreen } from "./domains/subscription/presentation/screens/SubscriptionDetailScreen";
|
|
30
|
+
export type { SubscriptionDetailScreenProps } from "./domains/subscription/presentation/screens/SubscriptionDetailScreen.types";
|
|
31
|
+
|
|
32
|
+
// Paywall Components
|
|
33
|
+
export { PaywallScreen } from "./domains/paywall/components/PaywallScreen";
|
|
34
|
+
export type { PaywallScreenProps } from "./domains/paywall/components/PaywallScreen.types";
|
|
35
|
+
|
|
36
|
+
// Root Flow Components
|
|
37
|
+
export { ManagedSubscriptionFlow } from "./domains/subscription/presentation/components/ManagedSubscriptionFlow";
|
|
38
|
+
export type { ManagedSubscriptionFlowProps } from "./domains/subscription/presentation/components/ManagedSubscriptionFlow";
|
|
39
|
+
export { SubscriptionFlowStatus } from "./domains/subscription/presentation/useSubscriptionFlow";
|
|
40
|
+
export { SubscriptionFlowProvider, useSubscriptionFlowStatus } from "./domains/subscription/presentation/providers/SubscriptionFlowProvider";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CORE Exports - Constants & Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Constants & Types
|
|
6
|
+
export {
|
|
7
|
+
USER_TIER,
|
|
8
|
+
SUBSCRIPTION_STATUS,
|
|
9
|
+
PERIOD_TYPE,
|
|
10
|
+
PACKAGE_TYPE,
|
|
11
|
+
PLATFORM,
|
|
12
|
+
PURCHASE_SOURCE,
|
|
13
|
+
PURCHASE_TYPE,
|
|
14
|
+
ANONYMOUS_CACHE_KEY,
|
|
15
|
+
} from "./domains/subscription/core/SubscriptionConstants";
|
|
16
|
+
|
|
17
|
+
export type {
|
|
18
|
+
UserTierType,
|
|
19
|
+
SubscriptionStatusType,
|
|
20
|
+
PeriodType,
|
|
21
|
+
PackageType,
|
|
22
|
+
Platform,
|
|
23
|
+
PurchaseSource,
|
|
24
|
+
PurchaseType,
|
|
25
|
+
} from "./domains/subscription/core/SubscriptionConstants";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
createDefaultSubscriptionStatus,
|
|
29
|
+
isSubscriptionValid,
|
|
30
|
+
resolveSubscriptionStatus,
|
|
31
|
+
} from "./domains/subscription/core/SubscriptionStatus";
|
|
32
|
+
export type { SubscriptionStatus, StatusResolverInput } from "./domains/subscription/core/SubscriptionStatus";
|
|
33
|
+
|
|
34
|
+
// Domain Events
|
|
35
|
+
export { SUBSCRIPTION_EVENTS } from "./domains/subscription/core/events/SubscriptionEvents";
|
|
36
|
+
export type { SubscriptionEventType, SyncStatusChangedEvent } from "./domains/subscription/core/events/SubscriptionEvents";
|
|
37
|
+
export type { PurchaseCompletedEvent, RenewalDetectedEvent, PremiumStatusChangedEvent } from "./domains/subscription/core/SubscriptionEvents";
|
|
38
|
+
export { FLOW_EVENTS } from "./domains/subscription/core/events/FlowEvents";
|
|
39
|
+
export type { FlowEventType, OnboardingCompletedEvent, PaywallShownEvent, PaywallClosedEvent } from "./domains/subscription/core/events/FlowEvents";
|
|
40
|
+
|
|
41
|
+
export type { SubscriptionMetadata } from "./domains/subscription/core/types/SubscriptionMetadata";
|
|
42
|
+
export type { PremiumStatus as PremiumStatusMetadata } from "./domains/subscription/core/types/PremiumStatus";
|
|
43
|
+
export type { CreditInfo } from "./domains/subscription/core/types/CreditInfo";
|
|
44
|
+
|
|
45
|
+
// Credits Types
|
|
46
|
+
export type {
|
|
47
|
+
CreditType,
|
|
48
|
+
UserCredits,
|
|
49
|
+
CreditsConfig,
|
|
50
|
+
CreditsResult,
|
|
51
|
+
DeductCreditsResult,
|
|
52
|
+
} from "./domains/credits/core/Credits";
|
|
53
|
+
|
|
54
|
+
// Paywall Types
|
|
55
|
+
export type { PaywallTranslations, PaywallLegalUrls, SubscriptionFeature } from "./domains/paywall/entities/types";
|
|
56
|
+
|
|
57
|
+
// Application Layer - Ports
|
|
58
|
+
export type { ISubscriptionRepository } from "./shared/application/ports/ISubscriptionRepository";
|
|
59
|
+
export type { IRevenueCatService } from "./shared/application/ports/IRevenueCatService";
|
|
60
|
+
|
|
61
|
+
// Result Pattern
|
|
62
|
+
export {
|
|
63
|
+
success,
|
|
64
|
+
failure,
|
|
65
|
+
isSuccess,
|
|
66
|
+
isFailure,
|
|
67
|
+
unwrap,
|
|
68
|
+
unwrapOr,
|
|
69
|
+
tryCatch,
|
|
70
|
+
} from "./shared/utils/Result";
|
|
71
|
+
export type { Result, Success, Failure } from "./shared/utils/Result";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CORE Exports - Hooks
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Subscription Hooks
|
|
6
|
+
export { useAuthAwarePurchase } from "./domains/subscription/presentation/useAuthAwarePurchase";
|
|
7
|
+
export { useFeatureGate } from "./domains/subscription/presentation/useFeatureGate";
|
|
8
|
+
export { usePaywallVisibility, paywallControl } from "./domains/subscription/presentation/usePaywallVisibility";
|
|
9
|
+
export { usePremiumStatus } from "./domains/subscription/presentation/usePremiumStatus";
|
|
10
|
+
export { usePremiumPackages } from "./domains/subscription/presentation/usePremiumPackages";
|
|
11
|
+
export { usePremiumActions } from "./domains/subscription/presentation/usePremiumActions";
|
|
12
|
+
export { useSubscriptionFlowStore } from "./domains/subscription/presentation/useSubscriptionFlow";
|
|
13
|
+
export { useSubscriptionStatus } from "./domains/subscription/presentation/useSubscriptionStatus";
|
|
14
|
+
|
|
15
|
+
// Hook Types
|
|
16
|
+
export type { PremiumStatus } from "./domains/subscription/presentation/usePremiumStatus";
|
|
17
|
+
export type { PremiumPackages } from "./domains/subscription/presentation/usePremiumPackages";
|
|
18
|
+
export type { PremiumActions } from "./domains/subscription/presentation/usePremiumActions";
|
|
19
|
+
export type { SubscriptionFlowState, SubscriptionFlowActions, SubscriptionFlowStore } from "./domains/subscription/presentation/useSubscriptionFlow";
|
|
20
|
+
export type { SubscriptionStatusResult } from "./domains/subscription/presentation/useSubscriptionStatus.types";
|
|
21
|
+
|
|
22
|
+
// Credits Hooks
|
|
23
|
+
export { useCredits } from "./domains/credits/presentation/useCredits";
|
|
24
|
+
export { useDeductCredit } from "./domains/credits/presentation/deduct-credit/useDeductCredit";
|
|
25
|
+
|
|
26
|
+
// Feedback Hooks
|
|
27
|
+
export { usePaywallFeedback } from "./presentation/hooks/feedback/usePaywallFeedback";
|
|
28
|
+
export {
|
|
29
|
+
usePaywallFeedbackSubmit,
|
|
30
|
+
useSettingsFeedbackSubmit,
|
|
31
|
+
} from "./presentation/hooks/feedback/useFeedbackSubmit";
|
|
32
|
+
|
|
33
|
+
export type {
|
|
34
|
+
UsePaywallFeedbackSubmitOptions,
|
|
35
|
+
SettingsFeedbackData,
|
|
36
|
+
UseSettingsFeedbackSubmitOptions,
|
|
37
|
+
} from "./presentation/hooks/feedback/useFeedbackSubmit";
|
|
38
|
+
|
|
39
|
+
// Paywall Hooks
|
|
40
|
+
export { usePaywallOrchestrator } from "./domains/paywall/hooks/usePaywallOrchestrator";
|
|
41
|
+
export type { PaywallOrchestratorOptions } from "./domains/paywall/hooks/usePaywallOrchestrator";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CORE Exports - Infrastructure & Utils
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Infrastructure Layer - Core Services
|
|
6
|
+
export { initializeSubscription } from "./domains/subscription/application/initializer/SubscriptionInitializer";
|
|
7
|
+
export type { SubscriptionInitConfig, CreditPackageConfig } from "./domains/subscription/application/SubscriptionInitializerTypes";
|
|
8
|
+
|
|
9
|
+
export { CreditsRepository } from "./domains/credits/infrastructure/CreditsRepository";
|
|
10
|
+
export {
|
|
11
|
+
configureCreditsRepository,
|
|
12
|
+
getCreditsRepository,
|
|
13
|
+
getCreditsConfig,
|
|
14
|
+
isCreditsRepositoryConfigured
|
|
15
|
+
} from "./domains/credits/infrastructure/CreditsRepositoryManager";
|
|
16
|
+
|
|
17
|
+
export { CreditLimitService, calculateCreditLimit } from "./domains/credits/domain/services/CreditLimitService";
|
|
18
|
+
|
|
19
|
+
// Utils
|
|
20
|
+
export {
|
|
21
|
+
getCreditAllocation,
|
|
22
|
+
createCreditAmountsFromPackages,
|
|
23
|
+
} from "./utils/creditMapper";
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
isCreditPackage,
|
|
27
|
+
detectPackageType,
|
|
28
|
+
} from "./utils/packageTypeDetector";
|
|
29
|
+
export type { SubscriptionPackageType } from "./utils/packageTypeDetector";
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
formatPrice,
|
|
33
|
+
getBillingPeriodSuffix,
|
|
34
|
+
formatPriceWithPeriod,
|
|
35
|
+
} from "./utils/priceUtils";
|
|
36
|
+
|
|
37
|
+
export type { UserTierInfo, PremiumStatusFetcher } from "./utils/types";
|
|
38
|
+
|
|
39
|
+
export type { DateLike } from "./utils/dateUtils.core";
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
isNow,
|
|
43
|
+
isPast,
|
|
44
|
+
isFuture,
|
|
45
|
+
isValidDate,
|
|
46
|
+
toSafeDate,
|
|
47
|
+
formatISO,
|
|
48
|
+
now,
|
|
49
|
+
} from "./utils/dateUtils.core";
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
daysBetween,
|
|
53
|
+
daysUntil,
|
|
54
|
+
isSameDay,
|
|
55
|
+
isToday,
|
|
56
|
+
} from "./utils/dateUtils.compare";
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
formatRelative,
|
|
60
|
+
formatShort,
|
|
61
|
+
formatLong,
|
|
62
|
+
} from "./utils/dateUtils.format";
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
addDays,
|
|
66
|
+
addMonths,
|
|
67
|
+
addYears,
|
|
68
|
+
} from "./utils/dateUtils.math";
|
|
69
|
+
|
|
70
|
+
export { getAppVersion, validatePlatform } from "./utils/appUtils";
|
|
71
|
+
|
|
72
|
+
export { toDate, toISOString, toTimestamp, getCurrentISOString } from "./shared/utils/dateConverter";
|
|
73
|
+
|
|
74
|
+
export { createPaywallTranslations, createFeedbackTranslations } from "./domains/paywall/utils/paywallTranslationUtils";
|
|
75
|
+
|
|
76
|
+
// Init Module
|
|
77
|
+
export {
|
|
78
|
+
createSubscriptionInitModule,
|
|
79
|
+
cleanupSubscriptionModule,
|
|
80
|
+
type SubscriptionInitModuleConfig,
|
|
81
|
+
} from './init';
|
package/src/index.ts
CHANGED
|
@@ -1,200 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
PurchaseSource,
|
|
20
|
-
PurchaseType,
|
|
21
|
-
} from "./domains/subscription/core/SubscriptionConstants";
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
createDefaultSubscriptionStatus,
|
|
25
|
-
isSubscriptionValid,
|
|
26
|
-
resolveSubscriptionStatus,
|
|
27
|
-
} from "./domains/subscription/core/SubscriptionStatus";
|
|
28
|
-
export type { SubscriptionStatus, StatusResolverInput } from "./domains/subscription/core/SubscriptionStatus";
|
|
29
|
-
|
|
30
|
-
// Domain Events
|
|
31
|
-
export { SUBSCRIPTION_EVENTS } from "./domains/subscription/core/events/SubscriptionEvents";
|
|
32
|
-
export type { SubscriptionEventType, SyncStatusChangedEvent } from "./domains/subscription/core/events/SubscriptionEvents";
|
|
33
|
-
export type { PurchaseCompletedEvent, RenewalDetectedEvent, PremiumStatusChangedEvent } from "./domains/subscription/core/SubscriptionEvents";
|
|
34
|
-
export { FLOW_EVENTS } from "./domains/subscription/core/events/FlowEvents";
|
|
35
|
-
export type { FlowEventType, OnboardingCompletedEvent, PaywallShownEvent, PaywallClosedEvent } from "./domains/subscription/core/events/FlowEvents";
|
|
36
|
-
|
|
37
|
-
export type { SubscriptionMetadata } from "./domains/subscription/core/types/SubscriptionMetadata";
|
|
38
|
-
export type { PremiumStatus as PremiumStatusMetadata } from "./domains/subscription/core/types/PremiumStatus";
|
|
39
|
-
export type { CreditInfo } from "./domains/subscription/core/types/CreditInfo";
|
|
40
|
-
|
|
41
|
-
// Application Layer - Ports
|
|
42
|
-
export type { ISubscriptionRepository } from "./shared/application/ports/ISubscriptionRepository";
|
|
43
|
-
export type { IRevenueCatService } from "./shared/application/ports/IRevenueCatService";
|
|
44
|
-
|
|
45
|
-
// Result Pattern
|
|
46
|
-
export {
|
|
47
|
-
success,
|
|
48
|
-
failure,
|
|
49
|
-
isSuccess,
|
|
50
|
-
isFailure,
|
|
51
|
-
unwrap,
|
|
52
|
-
unwrapOr,
|
|
53
|
-
tryCatch,
|
|
54
|
-
} from "./shared/utils/Result";
|
|
55
|
-
export type { Result, Success, Failure } from "./shared/utils/Result";
|
|
56
|
-
|
|
57
|
-
// Infrastructure Layer
|
|
58
|
-
export { initializeSubscription } from "./domains/subscription/application/initializer/SubscriptionInitializer";
|
|
59
|
-
export type { SubscriptionInitConfig, CreditPackageConfig } from "./domains/subscription/application/SubscriptionInitializerTypes";
|
|
60
|
-
|
|
61
|
-
export { CreditsRepository } from "./domains/credits/infrastructure/CreditsRepository";
|
|
62
|
-
export {
|
|
63
|
-
configureCreditsRepository,
|
|
64
|
-
getCreditsRepository,
|
|
65
|
-
getCreditsConfig,
|
|
66
|
-
isCreditsRepositoryConfigured
|
|
67
|
-
} from "./domains/credits/infrastructure/CreditsRepositoryManager";
|
|
68
|
-
|
|
69
|
-
export { CreditLimitService, calculateCreditLimit } from "./domains/credits/domain/services/CreditLimitService";
|
|
70
|
-
|
|
71
|
-
// Presentation Layer - Hooks
|
|
72
|
-
export { useAuthAwarePurchase } from "./domains/subscription/presentation/useAuthAwarePurchase";
|
|
73
|
-
export { useCredits } from "./domains/credits/presentation/useCredits";
|
|
74
|
-
export { useDeductCredit } from "./domains/credits/presentation/deduct-credit/useDeductCredit";
|
|
75
|
-
export { useFeatureGate } from "./domains/subscription/presentation/useFeatureGate";
|
|
76
|
-
export { usePaywallVisibility, paywallControl } from "./domains/subscription/presentation/usePaywallVisibility";
|
|
77
|
-
export { usePremiumStatus } from "./domains/subscription/presentation/usePremiumStatus";
|
|
78
|
-
export { usePremiumPackages } from "./domains/subscription/presentation/usePremiumPackages";
|
|
79
|
-
export { usePremiumActions } from "./domains/subscription/presentation/usePremiumActions";
|
|
80
|
-
export type { PremiumStatus } from "./domains/subscription/presentation/usePremiumStatus";
|
|
81
|
-
export type { PremiumPackages } from "./domains/subscription/presentation/usePremiumPackages";
|
|
82
|
-
export type { PremiumActions } from "./domains/subscription/presentation/usePremiumActions";
|
|
83
|
-
export { useSubscriptionFlowStore } from "./domains/subscription/presentation/useSubscriptionFlow";
|
|
84
|
-
export type { SubscriptionFlowState, SubscriptionFlowActions, SubscriptionFlowStore } from "./domains/subscription/presentation/useSubscriptionFlow";
|
|
85
|
-
export { useSubscriptionStatus } from "./domains/subscription/presentation/useSubscriptionStatus";
|
|
86
|
-
export type { SubscriptionStatusResult } from "./domains/subscription/presentation/useSubscriptionStatus.types";
|
|
87
|
-
export { usePaywallFeedback } from "./presentation/hooks/feedback/usePaywallFeedback";
|
|
88
|
-
export {
|
|
89
|
-
usePaywallFeedbackSubmit,
|
|
90
|
-
useSettingsFeedbackSubmit,
|
|
91
|
-
} from "./presentation/hooks/feedback/useFeedbackSubmit";
|
|
92
|
-
export type {
|
|
93
|
-
UsePaywallFeedbackSubmitOptions,
|
|
94
|
-
SettingsFeedbackData,
|
|
95
|
-
UseSettingsFeedbackSubmitOptions,
|
|
96
|
-
} from "./presentation/hooks/feedback/useFeedbackSubmit";
|
|
97
|
-
|
|
98
|
-
// Presentation Layer - Components
|
|
99
|
-
export { PremiumDetailsCard } from "./domains/subscription/presentation/components/details/PremiumDetailsCard";
|
|
100
|
-
export type {
|
|
101
|
-
PremiumDetailsTranslations,
|
|
102
|
-
PremiumDetailsCardProps,
|
|
103
|
-
} from "./domains/subscription/presentation/components/details/PremiumDetailsCardTypes";
|
|
104
|
-
export { PremiumStatusBadge } from "./domains/subscription/presentation/components/details/PremiumStatusBadge";
|
|
105
|
-
export type { PremiumStatusBadgeProps } from "./domains/subscription/presentation/components/details/PremiumStatusBadge.types";
|
|
106
|
-
export { SubscriptionSection } from "./domains/subscription/presentation/components/sections/SubscriptionSection";
|
|
107
|
-
export type { SubscriptionSectionProps } from "./domains/subscription/presentation/components/sections/SubscriptionSection.types";
|
|
108
|
-
export { PaywallFeedbackScreen } from "./domains/subscription/presentation/components/feedback/PaywallFeedbackScreen";
|
|
109
|
-
export type { PaywallFeedbackScreenProps } from "./domains/subscription/presentation/components/feedback/PaywallFeedbackScreen.types";
|
|
110
|
-
export type {
|
|
111
|
-
SubscriptionDetailConfig,
|
|
112
|
-
SubscriptionDetailTranslations,
|
|
113
|
-
SubscriptionDisplayFlags,
|
|
114
|
-
UpgradePromptConfig,
|
|
115
|
-
} from "./domains/subscription/presentation/screens/SubscriptionDetailScreen.types";
|
|
116
|
-
export { SubscriptionDetailScreen } from "./domains/subscription/presentation/screens/SubscriptionDetailScreen";
|
|
117
|
-
export type { SubscriptionDetailScreenProps } from "./domains/subscription/presentation/screens/SubscriptionDetailScreen.types";
|
|
118
|
-
export { PaywallScreen } from "./domains/paywall/components/PaywallScreen";
|
|
119
|
-
export type { PaywallScreenProps } from "./domains/paywall/components/PaywallScreen.types";
|
|
120
|
-
export { usePaywallOrchestrator } from "./domains/paywall/hooks/usePaywallOrchestrator";
|
|
121
|
-
export type { PaywallOrchestratorOptions } from "./domains/paywall/hooks/usePaywallOrchestrator";
|
|
122
|
-
|
|
123
|
-
export type {
|
|
124
|
-
CreditType,
|
|
125
|
-
UserCredits,
|
|
126
|
-
CreditsConfig,
|
|
127
|
-
CreditsResult,
|
|
128
|
-
DeductCreditsResult,
|
|
129
|
-
} from "./domains/credits/core/Credits";
|
|
130
|
-
|
|
131
|
-
// Utils
|
|
132
|
-
export {
|
|
133
|
-
getCreditAllocation,
|
|
134
|
-
createCreditAmountsFromPackages,
|
|
135
|
-
} from "./utils/creditMapper";
|
|
136
|
-
export {
|
|
137
|
-
isCreditPackage,
|
|
138
|
-
detectPackageType,
|
|
139
|
-
} from "./utils/packageTypeDetector";
|
|
140
|
-
export type { SubscriptionPackageType } from "./utils/packageTypeDetector";
|
|
141
|
-
export {
|
|
142
|
-
formatPrice,
|
|
143
|
-
getBillingPeriodSuffix,
|
|
144
|
-
formatPriceWithPeriod,
|
|
145
|
-
} from "./utils/priceUtils";
|
|
146
|
-
export type { UserTierInfo, PremiumStatusFetcher } from "./utils/types";
|
|
147
|
-
export type { DateLike } from "./utils/dateUtils.core";
|
|
148
|
-
export {
|
|
149
|
-
isNow,
|
|
150
|
-
isPast,
|
|
151
|
-
isFuture,
|
|
152
|
-
isValidDate,
|
|
153
|
-
toSafeDate,
|
|
154
|
-
formatISO,
|
|
155
|
-
now,
|
|
156
|
-
} from "./utils/dateUtils.core";
|
|
157
|
-
export {
|
|
158
|
-
daysBetween,
|
|
159
|
-
daysUntil,
|
|
160
|
-
isSameDay,
|
|
161
|
-
isToday,
|
|
162
|
-
} from "./utils/dateUtils.compare";
|
|
163
|
-
export {
|
|
164
|
-
formatRelative,
|
|
165
|
-
formatShort,
|
|
166
|
-
formatLong,
|
|
167
|
-
} from "./utils/dateUtils.format";
|
|
168
|
-
export {
|
|
169
|
-
addDays,
|
|
170
|
-
addMonths,
|
|
171
|
-
addYears,
|
|
172
|
-
} from "./utils/dateUtils.math";
|
|
173
|
-
export { getAppVersion, validatePlatform } from "./utils/appUtils";
|
|
174
|
-
export { toDate, toISOString, toTimestamp, getCurrentISOString } from "./shared/utils/dateConverter";
|
|
175
|
-
|
|
176
|
-
// Paywall Types & Utils
|
|
177
|
-
export type { PaywallTranslations, PaywallLegalUrls, SubscriptionFeature } from "./domains/paywall/entities/types";
|
|
178
|
-
export { createPaywallTranslations, createFeedbackTranslations } from "./domains/paywall/utils/paywallTranslationUtils";
|
|
179
|
-
|
|
180
|
-
// Root Flow Components
|
|
181
|
-
export { ManagedSubscriptionFlow } from "./domains/subscription/presentation/components/ManagedSubscriptionFlow";
|
|
182
|
-
export type { ManagedSubscriptionFlowProps } from "./domains/subscription/presentation/components/ManagedSubscriptionFlow";
|
|
183
|
-
export { SubscriptionFlowStatus } from "./domains/subscription/presentation/useSubscriptionFlow";
|
|
184
|
-
export { SubscriptionFlowProvider, useSubscriptionFlowStatus } from "./domains/subscription/presentation/providers/SubscriptionFlowProvider";
|
|
185
|
-
|
|
186
|
-
// Init Module Factory
|
|
187
|
-
export {
|
|
188
|
-
createSubscriptionInitModule,
|
|
189
|
-
cleanupSubscriptionModule,
|
|
190
|
-
type SubscriptionInitModuleConfig,
|
|
191
|
-
} from './init';
|
|
192
|
-
|
|
193
|
-
// Wallet Domain
|
|
194
|
-
export {
|
|
195
|
-
WalletScreen as WalletScreenContainer,
|
|
196
|
-
} from './domains/wallet/presentation/screens/WalletScreen';
|
|
197
|
-
export type {
|
|
198
|
-
WalletScreenProps,
|
|
199
|
-
WalletScreenTranslations,
|
|
200
|
-
} from './domains/wallet/presentation/screens/WalletScreen.types';
|
|
1
|
+
/**
|
|
2
|
+
* @umituz/react-native-subscription
|
|
3
|
+
*
|
|
4
|
+
* Complete subscription management with RevenueCat, paywall UI, and credits system
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Core features
|
|
8
|
+
* import { usePremiumStatus, ManagedSubscriptionFlow } from '@umituz/react-native-subscription';
|
|
9
|
+
*
|
|
10
|
+
* // Optional wallet
|
|
11
|
+
* import { WalletScreen } from '@umituz/react-native-subscription/exports/wallet';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Re-export from categorized files for better organization
|
|
15
|
+
export * from './index.constants';
|
|
16
|
+
export * from './index.hooks';
|
|
17
|
+
export * from './index.components';
|
|
18
|
+
export * from './index.infrastructure';
|