@revenuecat/purchases-js 0.0.10 → 0.0.11

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.
@@ -1,3 +1,30 @@
1
+ export declare type CustomerInfo = CustomerInfo_2;
2
+
3
+ declare interface CustomerInfo_2 {
4
+ entitlements: EntitlementInfos;
5
+ managementURL: string | null;
6
+ requestDate: Date;
7
+ firstSeenDate: Date;
8
+ originalPurchaseDate: Date | null;
9
+ }
10
+
11
+ export declare interface EntitlementInfo {
12
+ identifier: string;
13
+ isActive: boolean;
14
+ originalPurchaseDate: Date;
15
+ expirationDate: Date;
16
+ productIdentifier: string;
17
+ }
18
+
19
+ export declare interface EntitlementInfos {
20
+ all: {
21
+ [entitlementId: string]: EntitlementInfo;
22
+ };
23
+ active: {
24
+ [entitlementId: string]: EntitlementInfo;
25
+ };
26
+ }
27
+
1
28
  export declare type Offering = Offering_2;
2
29
 
3
30
  declare interface Offering_2 {
@@ -49,27 +76,18 @@ declare interface Product {
49
76
  }
50
77
 
51
78
  export declare class Purchases {
52
- private static readonly _RC_ENDPOINT;
53
- private static readonly _BASE_PATH;
54
79
  constructor(apiKey: string, paymentProviderSettings: PaymentProviderSettings);
55
80
  private toOfferings;
56
81
  getOfferings(appUserId: string): Promise<Offerings>;
57
82
  isEntitledTo(appUserId: string, entitlementIdentifier: string): Promise<boolean>;
58
- waitForEntitlement(appUserId: string, entitlementIdentifier: string, maxAttempts?: number): Promise<boolean>;
59
- subscribe(appUserId: string, productId: string, email: string, environment?: "sandbox" | "production"): Promise<SubscribeResponse>;
60
- purchasePackage(appUserId: string, rcPackage: Package, { environment, customerEmail, htmlTarget, }?: {
61
- environment?: "sandbox" | "production";
83
+ purchasePackage(appUserId: string, rcPackage: Package, entitlementId: string, // TODO: Remove this parameter once we don't have to poll for entitlements
84
+ { customerEmail, htmlTarget, }?: {
62
85
  customerEmail?: string;
63
86
  htmlTarget?: HTMLElement;
64
- }): Promise<void>;
87
+ }): Promise<boolean>;
88
+ getCustomerInfo(appUserId: string): Promise<CustomerInfo>;
65
89
  private logMissingProductIds;
66
- }
67
-
68
- declare interface SubscribeResponse {
69
- nextAction: string;
70
- data: {
71
- clientSecret?: string;
72
- };
90
+ isSandbox(): boolean;
73
91
  }
74
92
 
75
93
  export { }