react-native-purchases 6.6.2 → 6.6.4
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/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +1 -1
- package/dist/customerInfo.d.ts +1 -158
- package/dist/customerInfo.js +16 -0
- package/dist/errors.d.ts +1 -60
- package/dist/errors.js +16 -86
- package/dist/offerings.d.ts +1 -533
- package/dist/offerings.js +16 -152
- package/dist/purchases.d.ts +2 -130
- package/dist/purchases.js +36 -96
- package/ios/RNPurchases.m +3 -2
- package/package.json +4 -1
- package/scripts/docs/index.html +1 -1
package/dist/offerings.d.ts
CHANGED
|
@@ -1,533 +1 @@
|
|
|
1
|
-
export
|
|
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
|
-
}
|
|
1
|
+
export * from '@revenuecat/purchases-typescript-internal/dist/offerings';
|
package/dist/offerings.js
CHANGED
|
@@ -1,154 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function (PACKAGE_TYPE) {
|
|
6
|
-
/**
|
|
7
|
-
* A package that was defined with a custom identifier.
|
|
8
|
-
*/
|
|
9
|
-
PACKAGE_TYPE["UNKNOWN"] = "UNKNOWN";
|
|
10
|
-
/**
|
|
11
|
-
* A package that was defined with a custom identifier.
|
|
12
|
-
*/
|
|
13
|
-
PACKAGE_TYPE["CUSTOM"] = "CUSTOM";
|
|
14
|
-
/**
|
|
15
|
-
* A package configured with the predefined lifetime identifier.
|
|
16
|
-
*/
|
|
17
|
-
PACKAGE_TYPE["LIFETIME"] = "LIFETIME";
|
|
18
|
-
/**
|
|
19
|
-
* A package configured with the predefined annual identifier.
|
|
20
|
-
*/
|
|
21
|
-
PACKAGE_TYPE["ANNUAL"] = "ANNUAL";
|
|
22
|
-
/**
|
|
23
|
-
* A package configured with the predefined six month identifier.
|
|
24
|
-
*/
|
|
25
|
-
PACKAGE_TYPE["SIX_MONTH"] = "SIX_MONTH";
|
|
26
|
-
/**
|
|
27
|
-
* A package configured with the predefined three month identifier.
|
|
28
|
-
*/
|
|
29
|
-
PACKAGE_TYPE["THREE_MONTH"] = "THREE_MONTH";
|
|
30
|
-
/**
|
|
31
|
-
* A package configured with the predefined two month identifier.
|
|
32
|
-
*/
|
|
33
|
-
PACKAGE_TYPE["TWO_MONTH"] = "TWO_MONTH";
|
|
34
|
-
/**
|
|
35
|
-
* A package configured with the predefined monthly identifier.
|
|
36
|
-
*/
|
|
37
|
-
PACKAGE_TYPE["MONTHLY"] = "MONTHLY";
|
|
38
|
-
/**
|
|
39
|
-
* A package configured with the predefined weekly identifier.
|
|
40
|
-
*/
|
|
41
|
-
PACKAGE_TYPE["WEEKLY"] = "WEEKLY";
|
|
42
|
-
})(PACKAGE_TYPE = exports.PACKAGE_TYPE || (exports.PACKAGE_TYPE = {}));
|
|
43
|
-
var INTRO_ELIGIBILITY_STATUS;
|
|
44
|
-
(function (INTRO_ELIGIBILITY_STATUS) {
|
|
45
|
-
/**
|
|
46
|
-
* RevenueCat doesn't have enough information to determine eligibility.
|
|
47
|
-
*/
|
|
48
|
-
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_UNKNOWN"] = 0] = "INTRO_ELIGIBILITY_STATUS_UNKNOWN";
|
|
49
|
-
/**
|
|
50
|
-
* The user is not eligible for a free trial or intro pricing for this product.
|
|
51
|
-
*/
|
|
52
|
-
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_INELIGIBLE"] = 1] = "INTRO_ELIGIBILITY_STATUS_INELIGIBLE";
|
|
53
|
-
/**
|
|
54
|
-
* The user is eligible for a free trial or intro pricing for this product.
|
|
55
|
-
*/
|
|
56
|
-
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_ELIGIBLE"] = 2] = "INTRO_ELIGIBILITY_STATUS_ELIGIBLE";
|
|
57
|
-
/**
|
|
58
|
-
* There is no free trial or intro pricing for this product.
|
|
59
|
-
*/
|
|
60
|
-
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS"] = 3] = "INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS";
|
|
61
|
-
})(INTRO_ELIGIBILITY_STATUS = exports.INTRO_ELIGIBILITY_STATUS || (exports.INTRO_ELIGIBILITY_STATUS = {}));
|
|
62
|
-
var PRODUCT_CATEGORY;
|
|
63
|
-
(function (PRODUCT_CATEGORY) {
|
|
64
|
-
/**
|
|
65
|
-
* A type of product for non-subscription.
|
|
66
|
-
*/
|
|
67
|
-
PRODUCT_CATEGORY["NON_SUBSCRIPTION"] = "NON_SUBSCRIPTION";
|
|
68
|
-
/**
|
|
69
|
-
* A type of product for subscriptions.
|
|
70
|
-
*/
|
|
71
|
-
PRODUCT_CATEGORY["SUBSCRIPTION"] = "SUBSCRIPTION";
|
|
72
|
-
/**
|
|
73
|
-
* A type of product for unknowns.
|
|
74
|
-
*/
|
|
75
|
-
PRODUCT_CATEGORY["UNKNOWN"] = "UNKNOWN";
|
|
76
|
-
})(PRODUCT_CATEGORY = exports.PRODUCT_CATEGORY || (exports.PRODUCT_CATEGORY = {}));
|
|
77
|
-
var PRORATION_MODE;
|
|
78
|
-
(function (PRORATION_MODE) {
|
|
79
|
-
PRORATION_MODE[PRORATION_MODE["UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY"] = 0] = "UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY";
|
|
80
|
-
/**
|
|
81
|
-
* Replacement takes effect immediately, and the remaining time will be
|
|
82
|
-
* prorated and credited to the user. This is the current default behavior.
|
|
83
|
-
*/
|
|
84
|
-
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITH_TIME_PRORATION"] = 1] = "IMMEDIATE_WITH_TIME_PRORATION";
|
|
85
|
-
/**
|
|
86
|
-
* Replacement takes effect immediately, and the billing cycle remains the
|
|
87
|
-
* same. The price for the remaining period will be charged. This option is
|
|
88
|
-
* only available for subscription upgrade.
|
|
89
|
-
*/
|
|
90
|
-
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_PRORATED_PRICE"] = 2] = "IMMEDIATE_AND_CHARGE_PRORATED_PRICE";
|
|
91
|
-
/**
|
|
92
|
-
* Replacement takes effect immediately, and the new price will be charged on
|
|
93
|
-
* next recurrence time. The billing cycle stays the same.
|
|
94
|
-
*/
|
|
95
|
-
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITHOUT_PRORATION"] = 3] = "IMMEDIATE_WITHOUT_PRORATION";
|
|
96
|
-
/**
|
|
97
|
-
* Replacement takes effect when the old plan expires, and the new price will
|
|
98
|
-
* be charged at the same time.
|
|
99
|
-
*/
|
|
100
|
-
PRORATION_MODE[PRORATION_MODE["DEFERRED"] = 4] = "DEFERRED";
|
|
101
|
-
/**
|
|
102
|
-
* Replacement takes effect immediately, and the user is charged full price
|
|
103
|
-
* of new plan and is given a full billing cycle of subscription,
|
|
104
|
-
* plus remaining prorated time from the old plan.
|
|
105
|
-
*/
|
|
106
|
-
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_FULL_PRICE"] = 5] = "IMMEDIATE_AND_CHARGE_FULL_PRICE";
|
|
107
|
-
})(PRORATION_MODE = exports.PRORATION_MODE || (exports.PRORATION_MODE = {}));
|
|
108
|
-
/**
|
|
109
|
-
* Recurrence mode for a pricing phase
|
|
110
|
-
*/
|
|
111
|
-
var RECURRENCE_MODE;
|
|
112
|
-
(function (RECURRENCE_MODE) {
|
|
113
|
-
/**
|
|
114
|
-
* Pricing phase repeats infinitely until cancellation
|
|
115
|
-
*/
|
|
116
|
-
RECURRENCE_MODE[RECURRENCE_MODE["INFINITE_RECURRING"] = 1] = "INFINITE_RECURRING";
|
|
117
|
-
/**
|
|
118
|
-
* Pricing phase repeats for a fixed number of billing periods
|
|
119
|
-
*/
|
|
120
|
-
RECURRENCE_MODE[RECURRENCE_MODE["FINITE_RECURRING"] = 2] = "FINITE_RECURRING";
|
|
121
|
-
/**
|
|
122
|
-
* Pricing phase does not repeat
|
|
123
|
-
*/
|
|
124
|
-
RECURRENCE_MODE[RECURRENCE_MODE["NON_RECURRING"] = 3] = "NON_RECURRING";
|
|
125
|
-
})(RECURRENCE_MODE = exports.RECURRENCE_MODE || (exports.RECURRENCE_MODE = {}));
|
|
126
|
-
/**
|
|
127
|
-
* Payment mode for offer pricing phases. Google Play only.
|
|
128
|
-
*/
|
|
129
|
-
var OFFER_PAYMENT_MODE;
|
|
130
|
-
(function (OFFER_PAYMENT_MODE) {
|
|
131
|
-
/**
|
|
132
|
-
* Subscribers don't pay until the specified period ends
|
|
133
|
-
*/
|
|
134
|
-
OFFER_PAYMENT_MODE["FREE_TRIAL"] = "FREE_TRIAL";
|
|
135
|
-
/**
|
|
136
|
-
* Subscribers pay up front for a specified period
|
|
137
|
-
*/
|
|
138
|
-
OFFER_PAYMENT_MODE["SINGLE_PAYMENT"] = "SINGLE_PAYMENT";
|
|
139
|
-
/**
|
|
140
|
-
* Subscribers pay a discounted amount for a specified number of periods
|
|
141
|
-
*/
|
|
142
|
-
OFFER_PAYMENT_MODE["DISCOUNTED_RECURRING_PAYMENT"] = "DISCOUNTED_RECURRING_PAYMENT";
|
|
143
|
-
})(OFFER_PAYMENT_MODE = exports.OFFER_PAYMENT_MODE || (exports.OFFER_PAYMENT_MODE = {}));
|
|
144
|
-
/**
|
|
145
|
-
* Time duration unit for Period.
|
|
146
|
-
*/
|
|
147
|
-
var PERIOD_UNIT;
|
|
148
|
-
(function (PERIOD_UNIT) {
|
|
149
|
-
PERIOD_UNIT["DAY"] = "DAY";
|
|
150
|
-
PERIOD_UNIT["WEEK"] = "WEEK";
|
|
151
|
-
PERIOD_UNIT["MONTH"] = "MONTH";
|
|
152
|
-
PERIOD_UNIT["YEAR"] = "YEAR";
|
|
153
|
-
PERIOD_UNIT["UNKNOWN"] = "UNKNOWN";
|
|
154
|
-
})(PERIOD_UNIT = exports.PERIOD_UNIT || (exports.PERIOD_UNIT = {}));
|
|
17
|
+
// This file is kept to keep backwards compatibility to any possible users using this file directly
|
|
18
|
+
__exportStar(require("@revenuecat/purchases-typescript-internal/dist/offerings"), exports);
|