@revenuecat/purchases-typescript-internal-esm 6.1.2
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/dist/callbackTypes.d.ts +27 -0
- package/dist/callbackTypes.js +1 -0
- package/dist/customerInfo.d.ts +192 -0
- package/dist/customerInfo.js +1 -0
- package/dist/enums.d.ts +61 -0
- package/dist/enums.js +65 -0
- package/dist/errors.d.ts +60 -0
- package/dist/errors.js +85 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/offerings.d.ts +533 -0
- package/dist/offerings.js +151 -0
- package/dist/purchasesConfiguration.d.ts +41 -0
- package/dist/purchasesConfiguration.js +1 -0
- package/package.json +38 -0
- package/tsconfig.json +37 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CustomerInfo } from './customerInfo';
|
|
2
|
+
import { LOG_LEVEL } from './enums';
|
|
3
|
+
/**
|
|
4
|
+
* Listener used on updated customer info
|
|
5
|
+
* @callback CustomerInfoUpdateListener
|
|
6
|
+
* @param {Object} customerInfo Object containing info for the customer
|
|
7
|
+
*/
|
|
8
|
+
export type CustomerInfoUpdateListener = (customerInfo: CustomerInfo) => void;
|
|
9
|
+
export type ShouldPurchasePromoProductListener = (deferredPurchase: () => Promise<MakePurchaseResult>) => void;
|
|
10
|
+
export type MakePurchaseResult = {
|
|
11
|
+
productIdentifier: string;
|
|
12
|
+
customerInfo: CustomerInfo;
|
|
13
|
+
};
|
|
14
|
+
export type LogHandler = (logLevel: LOG_LEVEL, message: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Holds the logIn result
|
|
17
|
+
*/
|
|
18
|
+
export interface LogInResult {
|
|
19
|
+
/**
|
|
20
|
+
* The Customer Info for the user.
|
|
21
|
+
*/
|
|
22
|
+
readonly customerInfo: CustomerInfo;
|
|
23
|
+
/**
|
|
24
|
+
* True if the call resulted in a new user getting created in the RevenueCat backend.
|
|
25
|
+
*/
|
|
26
|
+
readonly created: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The EntitlementInfo object gives you access to all of the information about the status of a user entitlement.
|
|
3
|
+
*/
|
|
4
|
+
export interface PurchasesEntitlementInfo {
|
|
5
|
+
/**
|
|
6
|
+
* The entitlement identifier configured in the RevenueCat dashboard
|
|
7
|
+
*/
|
|
8
|
+
readonly identifier: string;
|
|
9
|
+
/**
|
|
10
|
+
* True if the user has access to this entitlement
|
|
11
|
+
*/
|
|
12
|
+
readonly isActive: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* True if the underlying subscription is set to renew at the end of the billing period (expirationDate).
|
|
15
|
+
*/
|
|
16
|
+
readonly willRenew: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The last period type this entitlement was in. Either: NORMAL, INTRO, TRIAL.
|
|
19
|
+
*/
|
|
20
|
+
readonly periodType: string;
|
|
21
|
+
/**
|
|
22
|
+
* The latest purchase or renewal date for the entitlement in ISO8601 format.
|
|
23
|
+
*/
|
|
24
|
+
readonly latestPurchaseDate: string;
|
|
25
|
+
/**
|
|
26
|
+
* The latest purchase or renewal date for the entitlement in milliseconds.
|
|
27
|
+
*/
|
|
28
|
+
readonly latestPurchaseDateMillis: number;
|
|
29
|
+
/**
|
|
30
|
+
* The first date this entitlement was purchased in ISO8601 format.
|
|
31
|
+
*/
|
|
32
|
+
readonly originalPurchaseDate: string;
|
|
33
|
+
/**
|
|
34
|
+
* The first date this entitlement was purchased in milliseconds.
|
|
35
|
+
*/
|
|
36
|
+
readonly originalPurchaseDateMillis: number;
|
|
37
|
+
/**
|
|
38
|
+
* The expiration date for the entitlement in ISO8601, can be `null` for lifetime access.
|
|
39
|
+
* If the `periodType` is `trial`, this is the trial expiration date.
|
|
40
|
+
*/
|
|
41
|
+
readonly expirationDate: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* The expiration date for the entitlement in milliseconds, can be `null` for lifetime access.
|
|
44
|
+
* If the `periodType` is `trial`, this is the trial expiration date.
|
|
45
|
+
*/
|
|
46
|
+
readonly expirationDateMillis: number | null;
|
|
47
|
+
/**
|
|
48
|
+
* The store where this entitlement was unlocked from.
|
|
49
|
+
*/
|
|
50
|
+
readonly store: "PLAY_STORE" | "APP_STORE" | "STRIPE" | "MAC_APP_STORE" | "PROMOTIONAL" | "AMAZON" | "UNKNOWN_STORE";
|
|
51
|
+
/**
|
|
52
|
+
* The product identifier that unlocked this entitlement
|
|
53
|
+
*/
|
|
54
|
+
readonly productIdentifier: string;
|
|
55
|
+
/**
|
|
56
|
+
* False if this entitlement is unlocked via a production purchase
|
|
57
|
+
*/
|
|
58
|
+
readonly isSandbox: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The date an unsubscribe was detected in ISO8601 format. Can be `null`.
|
|
61
|
+
*
|
|
62
|
+
* @note: Entitlement may still be active even if user has unsubscribed. Check the `isActive` property.
|
|
63
|
+
*/
|
|
64
|
+
readonly unsubscribeDetectedAt: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* The date an unsubscribe was detected in milliseconds. Can be `null`.
|
|
67
|
+
*
|
|
68
|
+
* @note: Entitlement may still be active even if user has unsubscribed. Check the `isActive` property.
|
|
69
|
+
*/
|
|
70
|
+
readonly unsubscribeDetectedAtMillis: number | null;
|
|
71
|
+
/**
|
|
72
|
+
* The date a billing issue was detected in ISO8601 format. Can be `null` if there is no billing issue or an
|
|
73
|
+
* issue has been resolved
|
|
74
|
+
*
|
|
75
|
+
* @note: Entitlement may still be active even if there is a billing issue. Check the `isActive` property.
|
|
76
|
+
*/
|
|
77
|
+
readonly billingIssueDetectedAt: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* The date a billing issue was detected in milliseconds. Can be `null` if there is no billing issue or an
|
|
80
|
+
* issue has been resolved
|
|
81
|
+
*
|
|
82
|
+
* @note: Entitlement may still be active even if there is a billing issue. Check the `isActive` property.
|
|
83
|
+
*/
|
|
84
|
+
readonly billingIssueDetectedAtMillis: number | null;
|
|
85
|
+
/**
|
|
86
|
+
* Supported ownership types for an entitlement.
|
|
87
|
+
* PURCHASED if the purchase was made directly by this user.
|
|
88
|
+
* FAMILY_SHARED if the purchase has been shared to this user by a family member.
|
|
89
|
+
* UNKNOWN if the purchase has no or an unknown ownership type.
|
|
90
|
+
*/
|
|
91
|
+
readonly ownershipType: "FAMILY_SHARED" | "PURCHASED" | "UNKNOWN";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Contains all the entitlements associated to the user.
|
|
95
|
+
*/
|
|
96
|
+
export interface PurchasesEntitlementInfos {
|
|
97
|
+
/**
|
|
98
|
+
* Map of all EntitlementInfo (`PurchasesEntitlementInfo`) objects (active and inactive) keyed by entitlement identifier.
|
|
99
|
+
*/
|
|
100
|
+
readonly all: {
|
|
101
|
+
[key: string]: PurchasesEntitlementInfo;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Map of active EntitlementInfo (`PurchasesEntitlementInfo`) objects keyed by entitlement identifier.
|
|
105
|
+
*/
|
|
106
|
+
readonly active: {
|
|
107
|
+
[key: string]: PurchasesEntitlementInfo;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export interface CustomerInfo {
|
|
111
|
+
/**
|
|
112
|
+
* Entitlements attached to this customer info
|
|
113
|
+
*/
|
|
114
|
+
readonly entitlements: PurchasesEntitlementInfos;
|
|
115
|
+
/**
|
|
116
|
+
* Set of active subscription skus
|
|
117
|
+
*/
|
|
118
|
+
readonly activeSubscriptions: string[];
|
|
119
|
+
/**
|
|
120
|
+
* Set of purchased skus, active and inactive
|
|
121
|
+
*/
|
|
122
|
+
readonly allPurchasedProductIdentifiers: string[];
|
|
123
|
+
/**
|
|
124
|
+
* The latest expiration date of all purchased skus
|
|
125
|
+
*/
|
|
126
|
+
readonly latestExpirationDate: string | null;
|
|
127
|
+
/**
|
|
128
|
+
* The date this user was first seen in RevenueCat.
|
|
129
|
+
*/
|
|
130
|
+
readonly firstSeen: string;
|
|
131
|
+
/**
|
|
132
|
+
* The original App User Id recorded for this user.
|
|
133
|
+
*/
|
|
134
|
+
readonly originalAppUserId: string;
|
|
135
|
+
/**
|
|
136
|
+
* Date when this info was requested
|
|
137
|
+
*/
|
|
138
|
+
readonly requestDate: string;
|
|
139
|
+
/**
|
|
140
|
+
* Map of skus to expiration dates
|
|
141
|
+
*/
|
|
142
|
+
readonly allExpirationDates: {
|
|
143
|
+
[key: string]: string | null;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Map of skus to purchase dates
|
|
147
|
+
*/
|
|
148
|
+
readonly allPurchaseDates: {
|
|
149
|
+
[key: string]: string | null;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Returns the version number for the version of the application when the
|
|
153
|
+
* user bought the app. Use this for grandfathering users when migrating
|
|
154
|
+
* to subscriptions.
|
|
155
|
+
*
|
|
156
|
+
* This corresponds to the value of CFBundleVersion (in iOS) in the
|
|
157
|
+
* Info.plist file when the purchase was originally made. This is always null
|
|
158
|
+
* in Android
|
|
159
|
+
*/
|
|
160
|
+
readonly originalApplicationVersion: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Returns the purchase date for the version of the application when the user bought the app.
|
|
163
|
+
* Use this for grandfathering users when migrating to subscriptions.
|
|
164
|
+
*/
|
|
165
|
+
readonly originalPurchaseDate: string | null;
|
|
166
|
+
/**
|
|
167
|
+
* URL to manage the active subscription of the user. If this user has an active iOS
|
|
168
|
+
* subscription, this will point to the App Store, if the user has an active Play Store subscription
|
|
169
|
+
* it will point there. If there are no active subscriptions it will be null.
|
|
170
|
+
* If there are multiple for different platforms, it will point to the device store.
|
|
171
|
+
*/
|
|
172
|
+
readonly managementURL: string | null;
|
|
173
|
+
readonly nonSubscriptionTransactions: PurchasesStoreTransaction[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* List of all non subscription transactions. Use this to fetch the history of
|
|
177
|
+
* non-subscription purchases
|
|
178
|
+
*/
|
|
179
|
+
export interface PurchasesStoreTransaction {
|
|
180
|
+
/**
|
|
181
|
+
* Id of the transaction.
|
|
182
|
+
*/
|
|
183
|
+
transactionIdentifier: string;
|
|
184
|
+
/**
|
|
185
|
+
* Product Id associated with the transaction.
|
|
186
|
+
*/
|
|
187
|
+
productIdentifier: string;
|
|
188
|
+
/**
|
|
189
|
+
* Purchase date of the transaction in ISO 8601 format.
|
|
190
|
+
*/
|
|
191
|
+
purchaseDate: string;
|
|
192
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/enums.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated, use PRODUCT_CATEGORY
|
|
3
|
+
*/
|
|
4
|
+
export declare enum PURCHASE_TYPE {
|
|
5
|
+
/**
|
|
6
|
+
* A type of SKU for in-app products.
|
|
7
|
+
*/
|
|
8
|
+
INAPP = "inapp",
|
|
9
|
+
/**
|
|
10
|
+
* A type of SKU for subscriptions.
|
|
11
|
+
*/
|
|
12
|
+
SUBS = "subs"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Enum for billing features.
|
|
16
|
+
* Currently, these are only relevant for Google Play Android users:
|
|
17
|
+
* https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
|
|
18
|
+
*/
|
|
19
|
+
export declare enum BILLING_FEATURE {
|
|
20
|
+
/**
|
|
21
|
+
* Purchase/query for subscriptions.
|
|
22
|
+
*/
|
|
23
|
+
SUBSCRIPTIONS = 0,
|
|
24
|
+
/**
|
|
25
|
+
* Subscriptions update/replace.
|
|
26
|
+
*/
|
|
27
|
+
SUBSCRIPTIONS_UPDATE = 1,
|
|
28
|
+
/**
|
|
29
|
+
* Purchase/query for in-app items on VR.
|
|
30
|
+
*/
|
|
31
|
+
IN_APP_ITEMS_ON_VR = 2,
|
|
32
|
+
/**
|
|
33
|
+
* Purchase/query for subscriptions on VR.
|
|
34
|
+
*/
|
|
35
|
+
SUBSCRIPTIONS_ON_VR = 3,
|
|
36
|
+
/**
|
|
37
|
+
* Launch a price change confirmation flow.
|
|
38
|
+
*/
|
|
39
|
+
PRICE_CHANGE_CONFIRMATION = 4
|
|
40
|
+
}
|
|
41
|
+
export declare enum REFUND_REQUEST_STATUS {
|
|
42
|
+
/**
|
|
43
|
+
* Apple has received the refund request.
|
|
44
|
+
*/
|
|
45
|
+
SUCCESS = 0,
|
|
46
|
+
/**
|
|
47
|
+
* User canceled submission of the refund request.
|
|
48
|
+
*/
|
|
49
|
+
USER_CANCELLED = 1,
|
|
50
|
+
/**
|
|
51
|
+
* There was an error with the request. See message for more details.
|
|
52
|
+
*/
|
|
53
|
+
ERROR = 2
|
|
54
|
+
}
|
|
55
|
+
export declare enum LOG_LEVEL {
|
|
56
|
+
VERBOSE = "VERBOSE",
|
|
57
|
+
DEBUG = "DEBUG",
|
|
58
|
+
INFO = "INFO",
|
|
59
|
+
WARN = "WARN",
|
|
60
|
+
ERROR = "ERROR"
|
|
61
|
+
}
|
package/dist/enums.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated, use PRODUCT_CATEGORY
|
|
3
|
+
*/
|
|
4
|
+
export var PURCHASE_TYPE;
|
|
5
|
+
(function (PURCHASE_TYPE) {
|
|
6
|
+
/**
|
|
7
|
+
* A type of SKU for in-app products.
|
|
8
|
+
*/
|
|
9
|
+
PURCHASE_TYPE["INAPP"] = "inapp";
|
|
10
|
+
/**
|
|
11
|
+
* A type of SKU for subscriptions.
|
|
12
|
+
*/
|
|
13
|
+
PURCHASE_TYPE["SUBS"] = "subs";
|
|
14
|
+
})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Enum for billing features.
|
|
17
|
+
* Currently, these are only relevant for Google Play Android users:
|
|
18
|
+
* https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
|
|
19
|
+
*/
|
|
20
|
+
export var BILLING_FEATURE;
|
|
21
|
+
(function (BILLING_FEATURE) {
|
|
22
|
+
/**
|
|
23
|
+
* Purchase/query for subscriptions.
|
|
24
|
+
*/
|
|
25
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS"] = 0] = "SUBSCRIPTIONS";
|
|
26
|
+
/**
|
|
27
|
+
* Subscriptions update/replace.
|
|
28
|
+
*/
|
|
29
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_UPDATE"] = 1] = "SUBSCRIPTIONS_UPDATE";
|
|
30
|
+
/**
|
|
31
|
+
* Purchase/query for in-app items on VR.
|
|
32
|
+
*/
|
|
33
|
+
BILLING_FEATURE[BILLING_FEATURE["IN_APP_ITEMS_ON_VR"] = 2] = "IN_APP_ITEMS_ON_VR";
|
|
34
|
+
/**
|
|
35
|
+
* Purchase/query for subscriptions on VR.
|
|
36
|
+
*/
|
|
37
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_ON_VR"] = 3] = "SUBSCRIPTIONS_ON_VR";
|
|
38
|
+
/**
|
|
39
|
+
* Launch a price change confirmation flow.
|
|
40
|
+
*/
|
|
41
|
+
BILLING_FEATURE[BILLING_FEATURE["PRICE_CHANGE_CONFIRMATION"] = 4] = "PRICE_CHANGE_CONFIRMATION";
|
|
42
|
+
})(BILLING_FEATURE || (BILLING_FEATURE = {}));
|
|
43
|
+
export var REFUND_REQUEST_STATUS;
|
|
44
|
+
(function (REFUND_REQUEST_STATUS) {
|
|
45
|
+
/**
|
|
46
|
+
* Apple has received the refund request.
|
|
47
|
+
*/
|
|
48
|
+
REFUND_REQUEST_STATUS[REFUND_REQUEST_STATUS["SUCCESS"] = 0] = "SUCCESS";
|
|
49
|
+
/**
|
|
50
|
+
* User canceled submission of the refund request.
|
|
51
|
+
*/
|
|
52
|
+
REFUND_REQUEST_STATUS[REFUND_REQUEST_STATUS["USER_CANCELLED"] = 1] = "USER_CANCELLED";
|
|
53
|
+
/**
|
|
54
|
+
* There was an error with the request. See message for more details.
|
|
55
|
+
*/
|
|
56
|
+
REFUND_REQUEST_STATUS[REFUND_REQUEST_STATUS["ERROR"] = 2] = "ERROR";
|
|
57
|
+
})(REFUND_REQUEST_STATUS || (REFUND_REQUEST_STATUS = {}));
|
|
58
|
+
export var LOG_LEVEL;
|
|
59
|
+
(function (LOG_LEVEL) {
|
|
60
|
+
LOG_LEVEL["VERBOSE"] = "VERBOSE";
|
|
61
|
+
LOG_LEVEL["DEBUG"] = "DEBUG";
|
|
62
|
+
LOG_LEVEL["INFO"] = "INFO";
|
|
63
|
+
LOG_LEVEL["WARN"] = "WARN";
|
|
64
|
+
LOG_LEVEL["ERROR"] = "ERROR";
|
|
65
|
+
})(LOG_LEVEL || (LOG_LEVEL = {}));
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare enum PURCHASES_ERROR_CODE {
|
|
2
|
+
UNKNOWN_ERROR = "0",
|
|
3
|
+
PURCHASE_CANCELLED_ERROR = "1",
|
|
4
|
+
STORE_PROBLEM_ERROR = "2",
|
|
5
|
+
PURCHASE_NOT_ALLOWED_ERROR = "3",
|
|
6
|
+
PURCHASE_INVALID_ERROR = "4",
|
|
7
|
+
PRODUCT_NOT_AVAILABLE_FOR_PURCHASE_ERROR = "5",
|
|
8
|
+
PRODUCT_ALREADY_PURCHASED_ERROR = "6",
|
|
9
|
+
RECEIPT_ALREADY_IN_USE_ERROR = "7",
|
|
10
|
+
INVALID_RECEIPT_ERROR = "8",
|
|
11
|
+
MISSING_RECEIPT_FILE_ERROR = "9",
|
|
12
|
+
NETWORK_ERROR = "10",
|
|
13
|
+
INVALID_CREDENTIALS_ERROR = "11",
|
|
14
|
+
UNEXPECTED_BACKEND_RESPONSE_ERROR = "12",
|
|
15
|
+
RECEIPT_IN_USE_BY_OTHER_SUBSCRIBER_ERROR = "13",
|
|
16
|
+
INVALID_APP_USER_ID_ERROR = "14",
|
|
17
|
+
OPERATION_ALREADY_IN_PROGRESS_ERROR = "15",
|
|
18
|
+
UNKNOWN_BACKEND_ERROR = "16",
|
|
19
|
+
INVALID_APPLE_SUBSCRIPTION_KEY_ERROR = "17",
|
|
20
|
+
INELIGIBLE_ERROR = "18",
|
|
21
|
+
INSUFFICIENT_PERMISSIONS_ERROR = "19",
|
|
22
|
+
PAYMENT_PENDING_ERROR = "20",
|
|
23
|
+
INVALID_SUBSCRIBER_ATTRIBUTES_ERROR = "21",
|
|
24
|
+
LOG_OUT_ANONYMOUS_USER_ERROR = "22",
|
|
25
|
+
CONFIGURATION_ERROR = "23",
|
|
26
|
+
UNSUPPORTED_ERROR = "24",
|
|
27
|
+
EMPTY_SUBSCRIBER_ATTRIBUTES_ERROR = "25",
|
|
28
|
+
PRODUCT_DISCOUNT_MISSING_IDENTIFIER_ERROR = "26",
|
|
29
|
+
PRODUCT_DISCOUNT_MISSING_SUBSCRIPTION_GROUP_IDENTIFIER_ERROR = "28",
|
|
30
|
+
CUSTOMER_INFO_ERROR = "29",
|
|
31
|
+
SYSTEM_INFO_ERROR = "30",
|
|
32
|
+
BEGIN_REFUND_REQUEST_ERROR = "31",
|
|
33
|
+
PRODUCT_REQUEST_TIMED_OUT_ERROR = "32",
|
|
34
|
+
API_ENDPOINT_BLOCKED = "33",
|
|
35
|
+
INVALID_PROMOTIONAL_OFFER_ERROR = "34",
|
|
36
|
+
OFFLINE_CONNECTION_ERROR = "35"
|
|
37
|
+
}
|
|
38
|
+
export interface PurchasesError {
|
|
39
|
+
code: PURCHASES_ERROR_CODE;
|
|
40
|
+
message: string;
|
|
41
|
+
readableErrorCode: string;
|
|
42
|
+
userInfo: ErrorInfo;
|
|
43
|
+
underlyingErrorMessage: string;
|
|
44
|
+
userCancelled: boolean | null;
|
|
45
|
+
}
|
|
46
|
+
export interface ErrorInfo {
|
|
47
|
+
readableErrorCode: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare class UninitializedPurchasesError extends Error {
|
|
53
|
+
constructor();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export declare class UnsupportedPlatformError extends Error {
|
|
59
|
+
constructor();
|
|
60
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
/* tslint:disable:max-classes-per-file */
|
|
17
|
+
// Error codes indicating the reason for an error.
|
|
18
|
+
export var PURCHASES_ERROR_CODE;
|
|
19
|
+
(function (PURCHASES_ERROR_CODE) {
|
|
20
|
+
PURCHASES_ERROR_CODE["UNKNOWN_ERROR"] = "0";
|
|
21
|
+
PURCHASES_ERROR_CODE["PURCHASE_CANCELLED_ERROR"] = "1";
|
|
22
|
+
PURCHASES_ERROR_CODE["STORE_PROBLEM_ERROR"] = "2";
|
|
23
|
+
PURCHASES_ERROR_CODE["PURCHASE_NOT_ALLOWED_ERROR"] = "3";
|
|
24
|
+
PURCHASES_ERROR_CODE["PURCHASE_INVALID_ERROR"] = "4";
|
|
25
|
+
PURCHASES_ERROR_CODE["PRODUCT_NOT_AVAILABLE_FOR_PURCHASE_ERROR"] = "5";
|
|
26
|
+
PURCHASES_ERROR_CODE["PRODUCT_ALREADY_PURCHASED_ERROR"] = "6";
|
|
27
|
+
PURCHASES_ERROR_CODE["RECEIPT_ALREADY_IN_USE_ERROR"] = "7";
|
|
28
|
+
PURCHASES_ERROR_CODE["INVALID_RECEIPT_ERROR"] = "8";
|
|
29
|
+
PURCHASES_ERROR_CODE["MISSING_RECEIPT_FILE_ERROR"] = "9";
|
|
30
|
+
PURCHASES_ERROR_CODE["NETWORK_ERROR"] = "10";
|
|
31
|
+
PURCHASES_ERROR_CODE["INVALID_CREDENTIALS_ERROR"] = "11";
|
|
32
|
+
PURCHASES_ERROR_CODE["UNEXPECTED_BACKEND_RESPONSE_ERROR"] = "12";
|
|
33
|
+
PURCHASES_ERROR_CODE["RECEIPT_IN_USE_BY_OTHER_SUBSCRIBER_ERROR"] = "13";
|
|
34
|
+
PURCHASES_ERROR_CODE["INVALID_APP_USER_ID_ERROR"] = "14";
|
|
35
|
+
PURCHASES_ERROR_CODE["OPERATION_ALREADY_IN_PROGRESS_ERROR"] = "15";
|
|
36
|
+
PURCHASES_ERROR_CODE["UNKNOWN_BACKEND_ERROR"] = "16";
|
|
37
|
+
PURCHASES_ERROR_CODE["INVALID_APPLE_SUBSCRIPTION_KEY_ERROR"] = "17";
|
|
38
|
+
PURCHASES_ERROR_CODE["INELIGIBLE_ERROR"] = "18";
|
|
39
|
+
PURCHASES_ERROR_CODE["INSUFFICIENT_PERMISSIONS_ERROR"] = "19";
|
|
40
|
+
PURCHASES_ERROR_CODE["PAYMENT_PENDING_ERROR"] = "20";
|
|
41
|
+
PURCHASES_ERROR_CODE["INVALID_SUBSCRIBER_ATTRIBUTES_ERROR"] = "21";
|
|
42
|
+
PURCHASES_ERROR_CODE["LOG_OUT_ANONYMOUS_USER_ERROR"] = "22";
|
|
43
|
+
PURCHASES_ERROR_CODE["CONFIGURATION_ERROR"] = "23";
|
|
44
|
+
PURCHASES_ERROR_CODE["UNSUPPORTED_ERROR"] = "24";
|
|
45
|
+
PURCHASES_ERROR_CODE["EMPTY_SUBSCRIBER_ATTRIBUTES_ERROR"] = "25";
|
|
46
|
+
PURCHASES_ERROR_CODE["PRODUCT_DISCOUNT_MISSING_IDENTIFIER_ERROR"] = "26";
|
|
47
|
+
PURCHASES_ERROR_CODE["PRODUCT_DISCOUNT_MISSING_SUBSCRIPTION_GROUP_IDENTIFIER_ERROR"] = "28";
|
|
48
|
+
PURCHASES_ERROR_CODE["CUSTOMER_INFO_ERROR"] = "29";
|
|
49
|
+
PURCHASES_ERROR_CODE["SYSTEM_INFO_ERROR"] = "30";
|
|
50
|
+
PURCHASES_ERROR_CODE["BEGIN_REFUND_REQUEST_ERROR"] = "31";
|
|
51
|
+
PURCHASES_ERROR_CODE["PRODUCT_REQUEST_TIMED_OUT_ERROR"] = "32";
|
|
52
|
+
PURCHASES_ERROR_CODE["API_ENDPOINT_BLOCKED"] = "33";
|
|
53
|
+
PURCHASES_ERROR_CODE["INVALID_PROMOTIONAL_OFFER_ERROR"] = "34";
|
|
54
|
+
PURCHASES_ERROR_CODE["OFFLINE_CONNECTION_ERROR"] = "35";
|
|
55
|
+
})(PURCHASES_ERROR_CODE || (PURCHASES_ERROR_CODE = {}));
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
var UninitializedPurchasesError = /** @class */ (function (_super) {
|
|
60
|
+
__extends(UninitializedPurchasesError, _super);
|
|
61
|
+
function UninitializedPurchasesError() {
|
|
62
|
+
var _this = _super.call(this, "There is no singleton instance. " +
|
|
63
|
+
"Make sure you configure Purchases before trying to get the default instance. " +
|
|
64
|
+
"More info here: https://errors.rev.cat/configuring-sdk") || this;
|
|
65
|
+
// Set the prototype explicitly.
|
|
66
|
+
Object.setPrototypeOf(_this, UninitializedPurchasesError.prototype);
|
|
67
|
+
return _this;
|
|
68
|
+
}
|
|
69
|
+
return UninitializedPurchasesError;
|
|
70
|
+
}(Error));
|
|
71
|
+
export { UninitializedPurchasesError };
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
var UnsupportedPlatformError = /** @class */ (function (_super) {
|
|
76
|
+
__extends(UnsupportedPlatformError, _super);
|
|
77
|
+
function UnsupportedPlatformError() {
|
|
78
|
+
var _this = _super.call(this, "This method is not available in the current platform.") || this;
|
|
79
|
+
// Set the prototype explicitly.
|
|
80
|
+
Object.setPrototypeOf(_this, UnsupportedPlatformError.prototype);
|
|
81
|
+
return _this;
|
|
82
|
+
}
|
|
83
|
+
return UnsupportedPlatformError;
|
|
84
|
+
}(Error));
|
|
85
|
+
export { UnsupportedPlatformError };
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
export declare enum PACKAGE_TYPE {
|
|
2
|
+
/**
|
|
3
|
+
* A package that was defined with a custom identifier.
|
|
4
|
+
*/
|
|
5
|
+
UNKNOWN = "UNKNOWN",
|
|
6
|
+
/**
|
|
7
|
+
* A package that was defined with a custom identifier.
|
|
8
|
+
*/
|
|
9
|
+
CUSTOM = "CUSTOM",
|
|
10
|
+
/**
|
|
11
|
+
* A package configured with the predefined lifetime identifier.
|
|
12
|
+
*/
|
|
13
|
+
LIFETIME = "LIFETIME",
|
|
14
|
+
/**
|
|
15
|
+
* A package configured with the predefined annual identifier.
|
|
16
|
+
*/
|
|
17
|
+
ANNUAL = "ANNUAL",
|
|
18
|
+
/**
|
|
19
|
+
* A package configured with the predefined six month identifier.
|
|
20
|
+
*/
|
|
21
|
+
SIX_MONTH = "SIX_MONTH",
|
|
22
|
+
/**
|
|
23
|
+
* A package configured with the predefined three month identifier.
|
|
24
|
+
*/
|
|
25
|
+
THREE_MONTH = "THREE_MONTH",
|
|
26
|
+
/**
|
|
27
|
+
* A package configured with the predefined two month identifier.
|
|
28
|
+
*/
|
|
29
|
+
TWO_MONTH = "TWO_MONTH",
|
|
30
|
+
/**
|
|
31
|
+
* A package configured with the predefined monthly identifier.
|
|
32
|
+
*/
|
|
33
|
+
MONTHLY = "MONTHLY",
|
|
34
|
+
/**
|
|
35
|
+
* A package configured with the predefined weekly identifier.
|
|
36
|
+
*/
|
|
37
|
+
WEEKLY = "WEEKLY"
|
|
38
|
+
}
|
|
39
|
+
export declare enum INTRO_ELIGIBILITY_STATUS {
|
|
40
|
+
/**
|
|
41
|
+
* RevenueCat doesn't have enough information to determine eligibility.
|
|
42
|
+
*/
|
|
43
|
+
INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,
|
|
44
|
+
/**
|
|
45
|
+
* The user is not eligible for a free trial or intro pricing for this product.
|
|
46
|
+
*/
|
|
47
|
+
INTRO_ELIGIBILITY_STATUS_INELIGIBLE = 1,
|
|
48
|
+
/**
|
|
49
|
+
* The user is eligible for a free trial or intro pricing for this product.
|
|
50
|
+
*/
|
|
51
|
+
INTRO_ELIGIBILITY_STATUS_ELIGIBLE = 2,
|
|
52
|
+
/**
|
|
53
|
+
* There is no free trial or intro pricing for this product.
|
|
54
|
+
*/
|
|
55
|
+
INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS = 3
|
|
56
|
+
}
|
|
57
|
+
export interface PurchasesStoreProduct {
|
|
58
|
+
/**
|
|
59
|
+
* Product Id.
|
|
60
|
+
*/
|
|
61
|
+
readonly identifier: string;
|
|
62
|
+
/**
|
|
63
|
+
* Description of the product.
|
|
64
|
+
*/
|
|
65
|
+
readonly description: string;
|
|
66
|
+
/**
|
|
67
|
+
* Title of the product.
|
|
68
|
+
*/
|
|
69
|
+
readonly title: string;
|
|
70
|
+
/**
|
|
71
|
+
* Price of the product in the local currency.
|
|
72
|
+
* Contains the price value of defaultOption for Google Play.
|
|
73
|
+
*/
|
|
74
|
+
readonly price: number;
|
|
75
|
+
/**
|
|
76
|
+
* Formatted price of the item, including its currency sign.
|
|
77
|
+
* Contains the formatted price value of defaultOption for Google Play.
|
|
78
|
+
*/
|
|
79
|
+
readonly priceString: string;
|
|
80
|
+
/**
|
|
81
|
+
* Currency code for price and original price.
|
|
82
|
+
* Contains the currency code value of defaultOption for Google Play.
|
|
83
|
+
*/
|
|
84
|
+
readonly currencyCode: string;
|
|
85
|
+
/**
|
|
86
|
+
* Introductory price.
|
|
87
|
+
*/
|
|
88
|
+
readonly introPrice: PurchasesIntroPrice | null;
|
|
89
|
+
/**
|
|
90
|
+
* Collection of discount offers for a product. Null for Android.
|
|
91
|
+
*/
|
|
92
|
+
readonly discounts: PurchasesStoreProductDiscount[] | null;
|
|
93
|
+
/**
|
|
94
|
+
* Product category.
|
|
95
|
+
*/
|
|
96
|
+
readonly productCategory: PRODUCT_CATEGORY | null;
|
|
97
|
+
/**
|
|
98
|
+
* Subscription period, specified in ISO 8601 format. For example,
|
|
99
|
+
* P1W equates to one week, P1M equates to one month,
|
|
100
|
+
* P3M equates to three months, P6M equates to six months,
|
|
101
|
+
* and P1Y equates to one year.
|
|
102
|
+
* Note: Not available for Amazon.
|
|
103
|
+
*/
|
|
104
|
+
readonly subscriptionPeriod: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Default subscription option for a product. Google Play only.
|
|
107
|
+
*/
|
|
108
|
+
readonly defaultOption: SubscriptionOption | null;
|
|
109
|
+
/**
|
|
110
|
+
* Collection of subscription options for a product. Google Play only.
|
|
111
|
+
*/
|
|
112
|
+
readonly subscriptionOptions: SubscriptionOption[] | null;
|
|
113
|
+
/**
|
|
114
|
+
* Offering identifier the store product was presented from.
|
|
115
|
+
* Null if not using offerings or if fetched directly from store via getProducts.
|
|
116
|
+
*/
|
|
117
|
+
readonly presentedOfferingIdentifier: string | null;
|
|
118
|
+
}
|
|
119
|
+
export declare enum PRODUCT_CATEGORY {
|
|
120
|
+
/**
|
|
121
|
+
* A type of product for non-subscription.
|
|
122
|
+
*/
|
|
123
|
+
NON_SUBSCRIPTION = "NON_SUBSCRIPTION",
|
|
124
|
+
/**
|
|
125
|
+
* A type of product for subscriptions.
|
|
126
|
+
*/
|
|
127
|
+
SUBSCRIPTION = "SUBSCRIPTION",
|
|
128
|
+
/**
|
|
129
|
+
* A type of product for unknowns.
|
|
130
|
+
*/
|
|
131
|
+
UNKNOWN = "UNKNOWN"
|
|
132
|
+
}
|
|
133
|
+
export interface PurchasesStoreProductDiscount {
|
|
134
|
+
/**
|
|
135
|
+
* Identifier of the discount.
|
|
136
|
+
*/
|
|
137
|
+
readonly identifier: string;
|
|
138
|
+
/**
|
|
139
|
+
* Price in the local currency.
|
|
140
|
+
*/
|
|
141
|
+
readonly price: number;
|
|
142
|
+
/**
|
|
143
|
+
* Formatted price, including its currency sign, such as €3.99.
|
|
144
|
+
*/
|
|
145
|
+
readonly priceString: string;
|
|
146
|
+
/**
|
|
147
|
+
* Number of subscription billing periods for which the user will be given the discount, such as 3.
|
|
148
|
+
*/
|
|
149
|
+
readonly cycles: number;
|
|
150
|
+
/**
|
|
151
|
+
* Billing period of the discount, specified in ISO 8601 format.
|
|
152
|
+
*/
|
|
153
|
+
readonly period: string;
|
|
154
|
+
/**
|
|
155
|
+
* Unit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR.
|
|
156
|
+
*/
|
|
157
|
+
readonly periodUnit: string;
|
|
158
|
+
/**
|
|
159
|
+
* Number of units for the billing period of the discount.
|
|
160
|
+
*/
|
|
161
|
+
readonly periodNumberOfUnits: number;
|
|
162
|
+
}
|
|
163
|
+
export interface PurchasesIntroPrice {
|
|
164
|
+
/**
|
|
165
|
+
* Price in the local currency.
|
|
166
|
+
*/
|
|
167
|
+
readonly price: number;
|
|
168
|
+
/**
|
|
169
|
+
* Formatted price, including its currency sign, such as €3.99.
|
|
170
|
+
*/
|
|
171
|
+
readonly priceString: string;
|
|
172
|
+
/**
|
|
173
|
+
* Number of subscription billing periods for which the user will be given the discount, such as 3.
|
|
174
|
+
*/
|
|
175
|
+
readonly cycles: number;
|
|
176
|
+
/**
|
|
177
|
+
* Billing period of the discount, specified in ISO 8601 format.
|
|
178
|
+
*/
|
|
179
|
+
readonly period: string;
|
|
180
|
+
/**
|
|
181
|
+
* Unit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR.
|
|
182
|
+
*/
|
|
183
|
+
readonly periodUnit: string;
|
|
184
|
+
/**
|
|
185
|
+
* Number of units for the billing period of the discount.
|
|
186
|
+
*/
|
|
187
|
+
readonly periodNumberOfUnits: number;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Contains information about the product available for the user to purchase.
|
|
191
|
+
* For more info see https://docs.revenuecat.com/docs/entitlements
|
|
192
|
+
*/
|
|
193
|
+
export interface PurchasesPackage {
|
|
194
|
+
/**
|
|
195
|
+
* Unique identifier for this package. Can be one a predefined package type or a custom one.
|
|
196
|
+
*/
|
|
197
|
+
readonly identifier: string;
|
|
198
|
+
/**
|
|
199
|
+
* Package type for the product. Will be one of [PACKAGE_TYPE].
|
|
200
|
+
*/
|
|
201
|
+
readonly packageType: PACKAGE_TYPE;
|
|
202
|
+
/**
|
|
203
|
+
* Product assigned to this package.
|
|
204
|
+
*/
|
|
205
|
+
readonly product: PurchasesStoreProduct;
|
|
206
|
+
/**
|
|
207
|
+
* Offering this package belongs to.
|
|
208
|
+
*/
|
|
209
|
+
readonly offeringIdentifier: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* An offering is a collection of Packages (`PurchasesPackage`) available for the user to purchase.
|
|
213
|
+
* For more info see https://docs.revenuecat.com/docs/entitlements
|
|
214
|
+
*/
|
|
215
|
+
export interface PurchasesOffering {
|
|
216
|
+
/**
|
|
217
|
+
* Unique identifier defined in RevenueCat dashboard.
|
|
218
|
+
*/
|
|
219
|
+
readonly identifier: string;
|
|
220
|
+
/**
|
|
221
|
+
* Offering description defined in RevenueCat dashboard.
|
|
222
|
+
*/
|
|
223
|
+
readonly serverDescription: string;
|
|
224
|
+
/**
|
|
225
|
+
* Offering metadata defined in RevenueCat dashboard. To access values, you need
|
|
226
|
+
* to check the type beforehand. For example:
|
|
227
|
+
* const my_unknown_value: unknown = offering.metadata['my_key'];
|
|
228
|
+
* const my_string_value: string | undefined = typeof(my_unknown_value) === 'string' ? my_unknown_value : undefined;
|
|
229
|
+
*/
|
|
230
|
+
readonly metadata: {
|
|
231
|
+
[key: string]: unknown;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Array of `Package` objects available for purchase.
|
|
235
|
+
*/
|
|
236
|
+
readonly availablePackages: PurchasesPackage[];
|
|
237
|
+
/**
|
|
238
|
+
* Lifetime package type configured in the RevenueCat dashboard, if available.
|
|
239
|
+
*/
|
|
240
|
+
readonly lifetime: PurchasesPackage | null;
|
|
241
|
+
/**
|
|
242
|
+
* Annual package type configured in the RevenueCat dashboard, if available.
|
|
243
|
+
*/
|
|
244
|
+
readonly annual: PurchasesPackage | null;
|
|
245
|
+
/**
|
|
246
|
+
* Six month package type configured in the RevenueCat dashboard, if available.
|
|
247
|
+
*/
|
|
248
|
+
readonly sixMonth: PurchasesPackage | null;
|
|
249
|
+
/**
|
|
250
|
+
* Three month package type configured in the RevenueCat dashboard, if available.
|
|
251
|
+
*/
|
|
252
|
+
readonly threeMonth: PurchasesPackage | null;
|
|
253
|
+
/**
|
|
254
|
+
* Two month package type configured in the RevenueCat dashboard, if available.
|
|
255
|
+
*/
|
|
256
|
+
readonly twoMonth: PurchasesPackage | null;
|
|
257
|
+
/**
|
|
258
|
+
* Monthly package type configured in the RevenueCat dashboard, if available.
|
|
259
|
+
*/
|
|
260
|
+
readonly monthly: PurchasesPackage | null;
|
|
261
|
+
/**
|
|
262
|
+
* Weekly package type configured in the RevenueCat dashboard, if available.
|
|
263
|
+
*/
|
|
264
|
+
readonly weekly: PurchasesPackage | null;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Contains all the offerings configured in RevenueCat dashboard.
|
|
268
|
+
* For more info see https://docs.revenuecat.com/docs/entitlements
|
|
269
|
+
*/
|
|
270
|
+
export interface PurchasesOfferings {
|
|
271
|
+
/**
|
|
272
|
+
* Map of all Offerings [PurchasesOffering] objects keyed by their identifier.
|
|
273
|
+
*/
|
|
274
|
+
readonly all: {
|
|
275
|
+
[key: string]: PurchasesOffering;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Current offering configured in the RevenueCat dashboard.
|
|
279
|
+
*/
|
|
280
|
+
readonly current: PurchasesOffering | null;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Holds the information used when upgrading from another sku. For Android use only.
|
|
284
|
+
* @deprecated, use GoogleProductChangeInfo
|
|
285
|
+
*/
|
|
286
|
+
export interface UpgradeInfo {
|
|
287
|
+
/**
|
|
288
|
+
* The oldSKU to upgrade from.
|
|
289
|
+
*/
|
|
290
|
+
readonly oldSKU: string;
|
|
291
|
+
/**
|
|
292
|
+
* The [PRORATION_MODE] to use when upgrading the given oldSKU.
|
|
293
|
+
*/
|
|
294
|
+
readonly prorationMode?: PRORATION_MODE;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Holds the information used when upgrading from another sku. For Android use only.
|
|
298
|
+
*/
|
|
299
|
+
export interface GoogleProductChangeInfo {
|
|
300
|
+
/**
|
|
301
|
+
* The old product identifier to upgrade from.
|
|
302
|
+
*/
|
|
303
|
+
readonly oldProductIdentifier: string;
|
|
304
|
+
/**
|
|
305
|
+
* The [PRORATION_MODE] to use when upgrading the given oldSKU.
|
|
306
|
+
*/
|
|
307
|
+
readonly prorationMode?: PRORATION_MODE;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Holds the introductory price status
|
|
311
|
+
*/
|
|
312
|
+
export interface IntroEligibility {
|
|
313
|
+
/**
|
|
314
|
+
* The introductory price eligibility status
|
|
315
|
+
*/
|
|
316
|
+
readonly status: INTRO_ELIGIBILITY_STATUS;
|
|
317
|
+
/**
|
|
318
|
+
* Description of the status
|
|
319
|
+
*/
|
|
320
|
+
readonly description: string;
|
|
321
|
+
}
|
|
322
|
+
export interface PurchasesPromotionalOffer {
|
|
323
|
+
readonly identifier: string;
|
|
324
|
+
readonly keyIdentifier: string;
|
|
325
|
+
readonly nonce: string;
|
|
326
|
+
readonly signature: string;
|
|
327
|
+
readonly timestamp: number;
|
|
328
|
+
}
|
|
329
|
+
export declare enum PRORATION_MODE {
|
|
330
|
+
UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,
|
|
331
|
+
/**
|
|
332
|
+
* Replacement takes effect immediately, and the remaining time will be
|
|
333
|
+
* prorated and credited to the user. This is the current default behavior.
|
|
334
|
+
*/
|
|
335
|
+
IMMEDIATE_WITH_TIME_PRORATION = 1,
|
|
336
|
+
/**
|
|
337
|
+
* Replacement takes effect immediately, and the billing cycle remains the
|
|
338
|
+
* same. The price for the remaining period will be charged. This option is
|
|
339
|
+
* only available for subscription upgrade.
|
|
340
|
+
*/
|
|
341
|
+
IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,
|
|
342
|
+
/**
|
|
343
|
+
* Replacement takes effect immediately, and the new price will be charged on
|
|
344
|
+
* next recurrence time. The billing cycle stays the same.
|
|
345
|
+
*/
|
|
346
|
+
IMMEDIATE_WITHOUT_PRORATION = 3,
|
|
347
|
+
/**
|
|
348
|
+
* Replacement takes effect when the old plan expires, and the new price will
|
|
349
|
+
* be charged at the same time.
|
|
350
|
+
*/
|
|
351
|
+
DEFERRED = 4,
|
|
352
|
+
/**
|
|
353
|
+
* Replacement takes effect immediately, and the user is charged full price
|
|
354
|
+
* of new plan and is given a full billing cycle of subscription,
|
|
355
|
+
* plus remaining prorated time from the old plan.
|
|
356
|
+
*/
|
|
357
|
+
IMMEDIATE_AND_CHARGE_FULL_PRICE = 5
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Contains all details associated with a SubscriptionOption
|
|
361
|
+
* Used only for Google
|
|
362
|
+
*/
|
|
363
|
+
export interface SubscriptionOption {
|
|
364
|
+
/**
|
|
365
|
+
* Identifier of the subscription option
|
|
366
|
+
* If this SubscriptionOption represents a base plan, this will be the basePlanId.
|
|
367
|
+
* If it represents an offer, it will be {basePlanId}:{offerId}
|
|
368
|
+
*/
|
|
369
|
+
readonly id: string;
|
|
370
|
+
/**
|
|
371
|
+
* Identifier of the StoreProduct associated with this SubscriptionOption
|
|
372
|
+
* This will be {subId}:{basePlanId}
|
|
373
|
+
*/
|
|
374
|
+
readonly storeProductId: string;
|
|
375
|
+
/**
|
|
376
|
+
* Identifer of the subscription associated with this SubscriptionOption
|
|
377
|
+
* This will be {subId}
|
|
378
|
+
*/
|
|
379
|
+
readonly productId: string;
|
|
380
|
+
/**
|
|
381
|
+
* Pricing phases defining a user's payment plan for the product over time.
|
|
382
|
+
*/
|
|
383
|
+
readonly pricingPhases: PricingPhase[];
|
|
384
|
+
/**
|
|
385
|
+
* Tags defined on the base plan or offer. Empty for Amazon.
|
|
386
|
+
*/
|
|
387
|
+
readonly tags: string[];
|
|
388
|
+
/**
|
|
389
|
+
* True if this SubscriptionOption represents a subscription base plan (rather than an offer).
|
|
390
|
+
*/
|
|
391
|
+
readonly isBasePlan: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* The subscription period of fullPricePhase (after free and intro trials).
|
|
394
|
+
*/
|
|
395
|
+
readonly billingPeriod: Period | null;
|
|
396
|
+
/**
|
|
397
|
+
* True if the subscription is pre-paid.
|
|
398
|
+
*/
|
|
399
|
+
readonly isPrepaid: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* The full price PricingPhase of the subscription.
|
|
402
|
+
* Looks for the last price phase of the SubscriptionOption.
|
|
403
|
+
*/
|
|
404
|
+
readonly fullPricePhase: PricingPhase | null;
|
|
405
|
+
/**
|
|
406
|
+
* The free trial PricingPhase of the subscription.
|
|
407
|
+
* Looks for the first pricing phase of the SubscriptionOption where amountMicros is 0.
|
|
408
|
+
* There can be a freeTrialPhase and an introductoryPhase in the same SubscriptionOption.
|
|
409
|
+
*/
|
|
410
|
+
readonly freePhase: PricingPhase | null;
|
|
411
|
+
/**
|
|
412
|
+
* The intro trial PricingPhase of the subscription.
|
|
413
|
+
* Looks for the first pricing phase of the SubscriptionOption where amountMicros is greater than 0.
|
|
414
|
+
* There can be a freeTrialPhase and an introductoryPhase in the same SubscriptionOption.
|
|
415
|
+
*/
|
|
416
|
+
readonly introPhase: PricingPhase | null;
|
|
417
|
+
/**
|
|
418
|
+
* Offering identifier the subscription option was presented from
|
|
419
|
+
*/
|
|
420
|
+
readonly presentedOfferingIdentifier: string | null;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Contains all the details associated with a PricingPhase
|
|
424
|
+
*/
|
|
425
|
+
export interface PricingPhase {
|
|
426
|
+
/**
|
|
427
|
+
* Billing period for which the PricingPhase applies
|
|
428
|
+
*/
|
|
429
|
+
readonly billingPeriod: Period;
|
|
430
|
+
/**
|
|
431
|
+
* Recurrence mode of the PricingPhase
|
|
432
|
+
*/
|
|
433
|
+
readonly recurrenceMode: RECURRENCE_MODE | null;
|
|
434
|
+
/**
|
|
435
|
+
* Number of cycles for which the pricing phase applies.
|
|
436
|
+
* Null for infiniteRecurring or finiteRecurring recurrence modes.
|
|
437
|
+
*/
|
|
438
|
+
readonly billingCycleCount: number | null;
|
|
439
|
+
/**
|
|
440
|
+
* Price of the PricingPhase
|
|
441
|
+
*/
|
|
442
|
+
readonly price: Price;
|
|
443
|
+
/**
|
|
444
|
+
* Indicates how the pricing phase is charged for finiteRecurring pricing phases
|
|
445
|
+
*/
|
|
446
|
+
readonly offerPaymentMode: OFFER_PAYMENT_MODE | null;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Recurrence mode for a pricing phase
|
|
450
|
+
*/
|
|
451
|
+
export declare enum RECURRENCE_MODE {
|
|
452
|
+
/**
|
|
453
|
+
* Pricing phase repeats infinitely until cancellation
|
|
454
|
+
*/
|
|
455
|
+
INFINITE_RECURRING = 1,
|
|
456
|
+
/**
|
|
457
|
+
* Pricing phase repeats for a fixed number of billing periods
|
|
458
|
+
*/
|
|
459
|
+
FINITE_RECURRING = 2,
|
|
460
|
+
/**
|
|
461
|
+
* Pricing phase does not repeat
|
|
462
|
+
*/
|
|
463
|
+
NON_RECURRING = 3
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Payment mode for offer pricing phases. Google Play only.
|
|
467
|
+
*/
|
|
468
|
+
export declare enum OFFER_PAYMENT_MODE {
|
|
469
|
+
/**
|
|
470
|
+
* Subscribers don't pay until the specified period ends
|
|
471
|
+
*/
|
|
472
|
+
FREE_TRIAL = "FREE_TRIAL",
|
|
473
|
+
/**
|
|
474
|
+
* Subscribers pay up front for a specified period
|
|
475
|
+
*/
|
|
476
|
+
SINGLE_PAYMENT = "SINGLE_PAYMENT",
|
|
477
|
+
/**
|
|
478
|
+
* Subscribers pay a discounted amount for a specified number of periods
|
|
479
|
+
*/
|
|
480
|
+
DISCOUNTED_RECURRING_PAYMENT = "DISCOUNTED_RECURRING_PAYMENT"
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Contains all the details associated with a Price
|
|
484
|
+
*/
|
|
485
|
+
export interface Price {
|
|
486
|
+
/**
|
|
487
|
+
* Formatted price of the item, including its currency sign. For example $3.00
|
|
488
|
+
*/
|
|
489
|
+
readonly formatted: string;
|
|
490
|
+
/**
|
|
491
|
+
* Price in micro-units, where 1,000,000 micro-units equal one unit of the currency.
|
|
492
|
+
*
|
|
493
|
+
* For example, if price is "€7.99", price_amount_micros is 7,990,000. This value represents
|
|
494
|
+
* the localized, rounded price for a particular currency.
|
|
495
|
+
*/
|
|
496
|
+
readonly amountMicros: number;
|
|
497
|
+
/**
|
|
498
|
+
* Returns ISO 4217 currency code for price and original price.
|
|
499
|
+
*
|
|
500
|
+
* For example, if price is specified in British pounds sterling, price_currency_code is "GBP".
|
|
501
|
+
* If currency code cannot be determined, currency symbol is returned.
|
|
502
|
+
*/
|
|
503
|
+
readonly currencyCode: string;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Contains all the details associated with a Period
|
|
507
|
+
*/
|
|
508
|
+
export interface Period {
|
|
509
|
+
/**
|
|
510
|
+
* The number of period units: day, week, month, year, unknown
|
|
511
|
+
*/
|
|
512
|
+
readonly unit: PERIOD_UNIT;
|
|
513
|
+
/**
|
|
514
|
+
* The increment of time that a subscription period is specified in
|
|
515
|
+
*/
|
|
516
|
+
readonly value: number;
|
|
517
|
+
/**
|
|
518
|
+
* Specified in ISO 8601 format. For example, P1W equates to one week,
|
|
519
|
+
* P1M equates to one month, P3M equates to three months, P6M equates to six months,
|
|
520
|
+
* and P1Y equates to one year
|
|
521
|
+
*/
|
|
522
|
+
readonly iso8601: string;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Time duration unit for Period.
|
|
526
|
+
*/
|
|
527
|
+
export declare enum PERIOD_UNIT {
|
|
528
|
+
DAY = "DAY",
|
|
529
|
+
WEEK = "WEEK",
|
|
530
|
+
MONTH = "MONTH",
|
|
531
|
+
YEAR = "YEAR",
|
|
532
|
+
UNKNOWN = "UNKNOWN"
|
|
533
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export var PACKAGE_TYPE;
|
|
2
|
+
(function (PACKAGE_TYPE) {
|
|
3
|
+
/**
|
|
4
|
+
* A package that was defined with a custom identifier.
|
|
5
|
+
*/
|
|
6
|
+
PACKAGE_TYPE["UNKNOWN"] = "UNKNOWN";
|
|
7
|
+
/**
|
|
8
|
+
* A package that was defined with a custom identifier.
|
|
9
|
+
*/
|
|
10
|
+
PACKAGE_TYPE["CUSTOM"] = "CUSTOM";
|
|
11
|
+
/**
|
|
12
|
+
* A package configured with the predefined lifetime identifier.
|
|
13
|
+
*/
|
|
14
|
+
PACKAGE_TYPE["LIFETIME"] = "LIFETIME";
|
|
15
|
+
/**
|
|
16
|
+
* A package configured with the predefined annual identifier.
|
|
17
|
+
*/
|
|
18
|
+
PACKAGE_TYPE["ANNUAL"] = "ANNUAL";
|
|
19
|
+
/**
|
|
20
|
+
* A package configured with the predefined six month identifier.
|
|
21
|
+
*/
|
|
22
|
+
PACKAGE_TYPE["SIX_MONTH"] = "SIX_MONTH";
|
|
23
|
+
/**
|
|
24
|
+
* A package configured with the predefined three month identifier.
|
|
25
|
+
*/
|
|
26
|
+
PACKAGE_TYPE["THREE_MONTH"] = "THREE_MONTH";
|
|
27
|
+
/**
|
|
28
|
+
* A package configured with the predefined two month identifier.
|
|
29
|
+
*/
|
|
30
|
+
PACKAGE_TYPE["TWO_MONTH"] = "TWO_MONTH";
|
|
31
|
+
/**
|
|
32
|
+
* A package configured with the predefined monthly identifier.
|
|
33
|
+
*/
|
|
34
|
+
PACKAGE_TYPE["MONTHLY"] = "MONTHLY";
|
|
35
|
+
/**
|
|
36
|
+
* A package configured with the predefined weekly identifier.
|
|
37
|
+
*/
|
|
38
|
+
PACKAGE_TYPE["WEEKLY"] = "WEEKLY";
|
|
39
|
+
})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));
|
|
40
|
+
export var INTRO_ELIGIBILITY_STATUS;
|
|
41
|
+
(function (INTRO_ELIGIBILITY_STATUS) {
|
|
42
|
+
/**
|
|
43
|
+
* RevenueCat doesn't have enough information to determine eligibility.
|
|
44
|
+
*/
|
|
45
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_UNKNOWN"] = 0] = "INTRO_ELIGIBILITY_STATUS_UNKNOWN";
|
|
46
|
+
/**
|
|
47
|
+
* The user is not eligible for a free trial or intro pricing for this product.
|
|
48
|
+
*/
|
|
49
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_INELIGIBLE"] = 1] = "INTRO_ELIGIBILITY_STATUS_INELIGIBLE";
|
|
50
|
+
/**
|
|
51
|
+
* The user is eligible for a free trial or intro pricing for this product.
|
|
52
|
+
*/
|
|
53
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_ELIGIBLE"] = 2] = "INTRO_ELIGIBILITY_STATUS_ELIGIBLE";
|
|
54
|
+
/**
|
|
55
|
+
* There is no free trial or intro pricing for this product.
|
|
56
|
+
*/
|
|
57
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS"] = 3] = "INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS";
|
|
58
|
+
})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));
|
|
59
|
+
export var PRODUCT_CATEGORY;
|
|
60
|
+
(function (PRODUCT_CATEGORY) {
|
|
61
|
+
/**
|
|
62
|
+
* A type of product for non-subscription.
|
|
63
|
+
*/
|
|
64
|
+
PRODUCT_CATEGORY["NON_SUBSCRIPTION"] = "NON_SUBSCRIPTION";
|
|
65
|
+
/**
|
|
66
|
+
* A type of product for subscriptions.
|
|
67
|
+
*/
|
|
68
|
+
PRODUCT_CATEGORY["SUBSCRIPTION"] = "SUBSCRIPTION";
|
|
69
|
+
/**
|
|
70
|
+
* A type of product for unknowns.
|
|
71
|
+
*/
|
|
72
|
+
PRODUCT_CATEGORY["UNKNOWN"] = "UNKNOWN";
|
|
73
|
+
})(PRODUCT_CATEGORY || (PRODUCT_CATEGORY = {}));
|
|
74
|
+
export var PRORATION_MODE;
|
|
75
|
+
(function (PRORATION_MODE) {
|
|
76
|
+
PRORATION_MODE[PRORATION_MODE["UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY"] = 0] = "UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY";
|
|
77
|
+
/**
|
|
78
|
+
* Replacement takes effect immediately, and the remaining time will be
|
|
79
|
+
* prorated and credited to the user. This is the current default behavior.
|
|
80
|
+
*/
|
|
81
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITH_TIME_PRORATION"] = 1] = "IMMEDIATE_WITH_TIME_PRORATION";
|
|
82
|
+
/**
|
|
83
|
+
* Replacement takes effect immediately, and the billing cycle remains the
|
|
84
|
+
* same. The price for the remaining period will be charged. This option is
|
|
85
|
+
* only available for subscription upgrade.
|
|
86
|
+
*/
|
|
87
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_PRORATED_PRICE"] = 2] = "IMMEDIATE_AND_CHARGE_PRORATED_PRICE";
|
|
88
|
+
/**
|
|
89
|
+
* Replacement takes effect immediately, and the new price will be charged on
|
|
90
|
+
* next recurrence time. The billing cycle stays the same.
|
|
91
|
+
*/
|
|
92
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITHOUT_PRORATION"] = 3] = "IMMEDIATE_WITHOUT_PRORATION";
|
|
93
|
+
/**
|
|
94
|
+
* Replacement takes effect when the old plan expires, and the new price will
|
|
95
|
+
* be charged at the same time.
|
|
96
|
+
*/
|
|
97
|
+
PRORATION_MODE[PRORATION_MODE["DEFERRED"] = 4] = "DEFERRED";
|
|
98
|
+
/**
|
|
99
|
+
* Replacement takes effect immediately, and the user is charged full price
|
|
100
|
+
* of new plan and is given a full billing cycle of subscription,
|
|
101
|
+
* plus remaining prorated time from the old plan.
|
|
102
|
+
*/
|
|
103
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_FULL_PRICE"] = 5] = "IMMEDIATE_AND_CHARGE_FULL_PRICE";
|
|
104
|
+
})(PRORATION_MODE || (PRORATION_MODE = {}));
|
|
105
|
+
/**
|
|
106
|
+
* Recurrence mode for a pricing phase
|
|
107
|
+
*/
|
|
108
|
+
export var RECURRENCE_MODE;
|
|
109
|
+
(function (RECURRENCE_MODE) {
|
|
110
|
+
/**
|
|
111
|
+
* Pricing phase repeats infinitely until cancellation
|
|
112
|
+
*/
|
|
113
|
+
RECURRENCE_MODE[RECURRENCE_MODE["INFINITE_RECURRING"] = 1] = "INFINITE_RECURRING";
|
|
114
|
+
/**
|
|
115
|
+
* Pricing phase repeats for a fixed number of billing periods
|
|
116
|
+
*/
|
|
117
|
+
RECURRENCE_MODE[RECURRENCE_MODE["FINITE_RECURRING"] = 2] = "FINITE_RECURRING";
|
|
118
|
+
/**
|
|
119
|
+
* Pricing phase does not repeat
|
|
120
|
+
*/
|
|
121
|
+
RECURRENCE_MODE[RECURRENCE_MODE["NON_RECURRING"] = 3] = "NON_RECURRING";
|
|
122
|
+
})(RECURRENCE_MODE || (RECURRENCE_MODE = {}));
|
|
123
|
+
/**
|
|
124
|
+
* Payment mode for offer pricing phases. Google Play only.
|
|
125
|
+
*/
|
|
126
|
+
export var OFFER_PAYMENT_MODE;
|
|
127
|
+
(function (OFFER_PAYMENT_MODE) {
|
|
128
|
+
/**
|
|
129
|
+
* Subscribers don't pay until the specified period ends
|
|
130
|
+
*/
|
|
131
|
+
OFFER_PAYMENT_MODE["FREE_TRIAL"] = "FREE_TRIAL";
|
|
132
|
+
/**
|
|
133
|
+
* Subscribers pay up front for a specified period
|
|
134
|
+
*/
|
|
135
|
+
OFFER_PAYMENT_MODE["SINGLE_PAYMENT"] = "SINGLE_PAYMENT";
|
|
136
|
+
/**
|
|
137
|
+
* Subscribers pay a discounted amount for a specified number of periods
|
|
138
|
+
*/
|
|
139
|
+
OFFER_PAYMENT_MODE["DISCOUNTED_RECURRING_PAYMENT"] = "DISCOUNTED_RECURRING_PAYMENT";
|
|
140
|
+
})(OFFER_PAYMENT_MODE || (OFFER_PAYMENT_MODE = {}));
|
|
141
|
+
/**
|
|
142
|
+
* Time duration unit for Period.
|
|
143
|
+
*/
|
|
144
|
+
export var PERIOD_UNIT;
|
|
145
|
+
(function (PERIOD_UNIT) {
|
|
146
|
+
PERIOD_UNIT["DAY"] = "DAY";
|
|
147
|
+
PERIOD_UNIT["WEEK"] = "WEEK";
|
|
148
|
+
PERIOD_UNIT["MONTH"] = "MONTH";
|
|
149
|
+
PERIOD_UNIT["YEAR"] = "YEAR";
|
|
150
|
+
PERIOD_UNIT["UNKNOWN"] = "UNKNOWN";
|
|
151
|
+
})(PERIOD_UNIT || (PERIOD_UNIT = {}));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds parameters to initialize the SDK.
|
|
3
|
+
*/
|
|
4
|
+
export interface PurchasesConfiguration {
|
|
5
|
+
/**
|
|
6
|
+
* RevenueCat API Key. Needs to be a string
|
|
7
|
+
*/
|
|
8
|
+
apiKey: string;
|
|
9
|
+
/**
|
|
10
|
+
* A unique id for identifying the user
|
|
11
|
+
*/
|
|
12
|
+
appUserID?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* An optional boolean. Set this to TRUE if you have your own IAP implementation and
|
|
15
|
+
* want to use only RevenueCat's backend. Default is FALSE. If you are on Android and setting this to ON, you will have
|
|
16
|
+
* to acknowledge the purchases yourself.
|
|
17
|
+
*/
|
|
18
|
+
observerMode?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* An optional string. iOS-only, will be ignored for Android.
|
|
21
|
+
* Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults
|
|
22
|
+
* suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.
|
|
23
|
+
*/
|
|
24
|
+
userDefaultsSuiteName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* iOS-only, will be ignored for Android.
|
|
27
|
+
* Set this to TRUE to enable StoreKit2.
|
|
28
|
+
* Default is FALSE.
|
|
29
|
+
*
|
|
30
|
+
* @deprecated RevenueCat currently uses StoreKit 1 for purchases, as its stability in production scenarios has
|
|
31
|
+
* proven to be more performant than StoreKit 2.
|
|
32
|
+
* We're collecting more data on the best approach, but StoreKit 1 vs StoreKit 2 is an implementation detail
|
|
33
|
+
* that you shouldn't need to care about.
|
|
34
|
+
* We recommend not using this parameter, letting RevenueCat decide for you which StoreKit implementation to use.
|
|
35
|
+
*/
|
|
36
|
+
usesStoreKit2IfAvailable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* An optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore.
|
|
39
|
+
*/
|
|
40
|
+
useAmazon?: boolean;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@revenuecat/purchases-typescript-internal-esm",
|
|
3
|
+
"title": "Purchases typescript internal shared code",
|
|
4
|
+
"version": "6.1.2",
|
|
5
|
+
"description": "Typescript code to be used by RevenueCat's hybrid SDKs. Not meant for external usage.",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"source": "src/index",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"tsconfig.json"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"apitests": "tsc --p apitesters/",
|
|
15
|
+
"lint": "eslint",
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"build-watch": "tsc --watch"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/RevenueCat/purchases-hybrid-common.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"RevenueCat"
|
|
25
|
+
],
|
|
26
|
+
"author": "RevenueCat, Inc.",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/RevenueCat/purchases-hybrid-common/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/RevenueCat/purchases-hybrid-common#readme",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.61.0",
|
|
35
|
+
"eslint": "^8.44.0",
|
|
36
|
+
"typescript": "^5.1.6"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"paths": {
|
|
5
|
+
"purchases-typescript-internal": ["./src/index"]
|
|
6
|
+
},
|
|
7
|
+
"allowUnreachableCode": false,
|
|
8
|
+
"allowUnusedLabels": false,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"noFallthroughCasesInSwitch": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noImplicitUseStrict": false,
|
|
14
|
+
"noStrictGenericChecks": false,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"target": "es5",
|
|
19
|
+
"module": "esnext",
|
|
20
|
+
"lib": ["es6", "dom", "es2016", "esnext.asynciterable"],
|
|
21
|
+
"declaration": true,
|
|
22
|
+
"outDir": "./dist",
|
|
23
|
+
"strict": true,
|
|
24
|
+
"esModuleInterop": true,
|
|
25
|
+
"resolveJsonModule": true
|
|
26
|
+
},
|
|
27
|
+
"files": ["src/index.ts"],
|
|
28
|
+
"exclude": ["node_modules", "dist"],
|
|
29
|
+
"typedocOptions": {
|
|
30
|
+
"entryPoints": ["src/index.ts"],
|
|
31
|
+
"out": "docs",
|
|
32
|
+
"excludeInternal": true,
|
|
33
|
+
"excludePrivate": true,
|
|
34
|
+
"excludeProtected": true,
|
|
35
|
+
"includeVersion": true
|
|
36
|
+
}
|
|
37
|
+
}
|