@umituz/react-native-subscription 2.2.42 → 2.2.43
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.43",
|
|
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",
|
|
@@ -18,12 +18,12 @@ export interface ISubscriptionService {
|
|
|
18
18
|
userId: string,
|
|
19
19
|
productId: string,
|
|
20
20
|
expiresAt: string | null
|
|
21
|
-
): Promise<
|
|
21
|
+
): Promise<SubscriptionStatus>;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Deactivate a subscription
|
|
25
25
|
*/
|
|
26
|
-
deactivateSubscription(userId: string): Promise<
|
|
26
|
+
deactivateSubscription(userId: string): Promise<SubscriptionStatus>;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Check if user has premium access
|
|
@@ -32,3 +32,23 @@ export class SubscriptionError extends Error {
|
|
|
32
32
|
return new SubscriptionError(message, 'NETWORK_ERROR');
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
export class SubscriptionRepositoryError extends Error {
|
|
37
|
+
public readonly code: string;
|
|
38
|
+
|
|
39
|
+
constructor(message: string, code: string = 'REPOSITORY_ERROR') {
|
|
40
|
+
super(message);
|
|
41
|
+
this.name = 'SubscriptionRepositoryError';
|
|
42
|
+
this.code = code;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class SubscriptionValidationError extends Error {
|
|
47
|
+
public readonly code: string;
|
|
48
|
+
|
|
49
|
+
constructor(message: string, code: string = 'VALIDATION_ERROR') {
|
|
50
|
+
super(message);
|
|
51
|
+
this.name = 'SubscriptionValidationError';
|
|
52
|
+
this.code = code;
|
|
53
|
+
}
|
|
54
|
+
}
|