@revenuecat/purchases-js 1.65.0 → 1.67.0
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/README.md +11 -1
- package/dist/Purchases.es.d.ts +85 -1
- package/dist/Purchases.es.js +7550 -7424
- package/dist/Purchases.umd.js +105 -105
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -47,6 +47,16 @@ pnpm install
|
|
|
47
47
|
pnpm run build:dev
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
For automatic rebuilds of the web entry point during development, run:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm run build:dev-watch
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`build:dev-watch` is web-only. It preserves the Vega artifacts produced by
|
|
57
|
+
`build:dev`, but does not rebuild them; rerun `pnpm run build:dev` after
|
|
58
|
+
changing code used by the Vega entry point.
|
|
59
|
+
|
|
50
60
|
To avoid publishing the package you can use pnpm's link feature:
|
|
51
61
|
|
|
52
62
|
1. In the purchases-js directory, register the package:
|
|
@@ -155,7 +165,7 @@ Please check the Demo app readme [here](./examples/webbilling-demo/README.md#e2e
|
|
|
155
165
|
pnpm run extract-api
|
|
156
166
|
```
|
|
157
167
|
|
|
158
|
-
This will update the files in `api-report` with the latest public API.
|
|
168
|
+
This will update the files in `api-report` and `vega/api-report` with the latest public API for both packages.
|
|
159
169
|
If it has uncommitted changes, CI tests will fail. Run this command and commit the changes if
|
|
160
170
|
they are expected.
|
|
161
171
|
|
package/dist/Purchases.es.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ declare enum BackendErrorCode {
|
|
|
51
51
|
BackendGatewaySetupErrorInvalidTaxOriginAddressDuringCheckout = 8174
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/* Excluded from this release type: BillingWrapper */
|
|
55
|
+
|
|
54
56
|
/**
|
|
55
57
|
* @public
|
|
56
58
|
* `BrandingAppearance` defines the appearance settings
|
|
@@ -179,6 +181,15 @@ export { CustomVariableValue }
|
|
|
179
181
|
|
|
180
182
|
/* Excluded from this release type: DiscountPhase */
|
|
181
183
|
|
|
184
|
+
declare interface DiscountResponse extends PriceResponse {
|
|
185
|
+
name: string | null;
|
|
186
|
+
duration_mode: "one_time" | "time_window" | "forever";
|
|
187
|
+
time_window: string | null;
|
|
188
|
+
discount_type: "percentage" | "fixed_amount";
|
|
189
|
+
percentage?: number | null;
|
|
190
|
+
fixed_amount_micros?: number | null;
|
|
191
|
+
}
|
|
192
|
+
|
|
182
193
|
declare type EmptyString = "";
|
|
183
194
|
|
|
184
195
|
/**
|
|
@@ -640,6 +651,10 @@ export declare interface NonSubscriptionOption extends PurchaseOption {
|
|
|
640
651
|
/* Excluded from this release type: discount */
|
|
641
652
|
}
|
|
642
653
|
|
|
654
|
+
declare interface NonSubscriptionOptionResponse extends PurchaseOptionResponse {
|
|
655
|
+
base_price: PriceResponse;
|
|
656
|
+
}
|
|
657
|
+
|
|
643
658
|
/**
|
|
644
659
|
* Information that represents a non-subscription purchase made by a user.
|
|
645
660
|
* @public
|
|
@@ -787,13 +802,18 @@ export declare interface Package {
|
|
|
787
802
|
readonly identifier: string;
|
|
788
803
|
/**
|
|
789
804
|
* The {@link Product} assigned to this package.
|
|
790
|
-
* @deprecated - Use {@link Package.
|
|
805
|
+
* @deprecated - Use {@link Package.product} instead.
|
|
791
806
|
*/
|
|
792
807
|
readonly rcBillingProduct: Product;
|
|
793
808
|
/**
|
|
794
809
|
* The {@link Product} assigned to this package.
|
|
810
|
+
* @deprecated - Use {@link Package.product} instead.
|
|
795
811
|
*/
|
|
796
812
|
readonly webBillingProduct: Product;
|
|
813
|
+
/**
|
|
814
|
+
* The {@link Product} assigned to this package.
|
|
815
|
+
*/
|
|
816
|
+
readonly product: Product;
|
|
797
817
|
/**
|
|
798
818
|
* The web checkout URL for this package, if available.
|
|
799
819
|
*/
|
|
@@ -1246,6 +1266,11 @@ export declare interface Price {
|
|
|
1246
1266
|
readonly formattedPrice: string;
|
|
1247
1267
|
}
|
|
1248
1268
|
|
|
1269
|
+
declare interface PriceResponse {
|
|
1270
|
+
amount_micros: number;
|
|
1271
|
+
currency: string;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1249
1274
|
/**
|
|
1250
1275
|
* Represents the price and duration information for a phase of the purchase option.
|
|
1251
1276
|
* @public
|
|
@@ -1286,6 +1311,12 @@ export declare interface PricingPhase {
|
|
|
1286
1311
|
readonly pricePerYear: Price | null;
|
|
1287
1312
|
}
|
|
1288
1313
|
|
|
1314
|
+
declare interface PricingPhaseResponse {
|
|
1315
|
+
period_duration: string | null;
|
|
1316
|
+
price: PriceResponse | null;
|
|
1317
|
+
cycle_count: number;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1289
1320
|
/**
|
|
1290
1321
|
* Represents product's listing details.
|
|
1291
1322
|
* @public
|
|
@@ -1386,6 +1417,21 @@ export declare interface Product {
|
|
|
1386
1417
|
|
|
1387
1418
|
/* Excluded from this release type: ProductChangeResult */
|
|
1388
1419
|
|
|
1420
|
+
declare interface ProductResponse {
|
|
1421
|
+
identifier: string;
|
|
1422
|
+
product_type: string;
|
|
1423
|
+
title: string;
|
|
1424
|
+
description: string | null;
|
|
1425
|
+
default_purchase_option_id: string | null;
|
|
1426
|
+
purchase_options: {
|
|
1427
|
+
[key: string]: NonSubscriptionOptionResponse | SubscriptionOptionResponse;
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
declare interface ProductsResponse {
|
|
1432
|
+
product_details: ProductResponse[];
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1389
1435
|
/**
|
|
1390
1436
|
* Possible product types
|
|
1391
1437
|
* @public
|
|
@@ -1473,6 +1519,12 @@ export declare interface PurchaseOption {
|
|
|
1473
1519
|
readonly priceId: string;
|
|
1474
1520
|
}
|
|
1475
1521
|
|
|
1522
|
+
declare interface PurchaseOptionResponse {
|
|
1523
|
+
id: string;
|
|
1524
|
+
price_id: string;
|
|
1525
|
+
discount: DiscountResponse | null;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1476
1528
|
/**
|
|
1477
1529
|
* Parameters used to customise the purchase flow when invoking the `.purchase` method.
|
|
1478
1530
|
* @public
|
|
@@ -1581,6 +1633,8 @@ export declare interface PurchaseResult {
|
|
|
1581
1633
|
readonly redemptionInfo: RedemptionInfo | null;
|
|
1582
1634
|
/**
|
|
1583
1635
|
* The operation session id of the purchase.
|
|
1636
|
+
*
|
|
1637
|
+
* For Amazon Store purchases, this will contain the Amazon Store's receipt ID from the purchase.
|
|
1584
1638
|
*/
|
|
1585
1639
|
readonly operationSessionId: string;
|
|
1586
1640
|
/**
|
|
@@ -1616,6 +1670,7 @@ export declare class Purchases {
|
|
|
1616
1670
|
/* Excluded from this release type: eventsTracker */
|
|
1617
1671
|
/* Excluded from this release type: _platformInfo */
|
|
1618
1672
|
/* Excluded from this release type: inMemoryCache */
|
|
1673
|
+
/* Excluded from this release type: billingWrapper */
|
|
1619
1674
|
/* Excluded from this release type: offeringsRequests */
|
|
1620
1675
|
/* Excluded from this release type: cachedCurrentOffering */
|
|
1621
1676
|
/* Excluded from this release type: customWebCheckoutEnabled */
|
|
@@ -1688,6 +1743,9 @@ export declare class Purchases {
|
|
|
1688
1743
|
/* Excluded from this release type: __constructor */
|
|
1689
1744
|
/**
|
|
1690
1745
|
* Renders an RC Paywall and allows the user to purchase from it using Web Billing.
|
|
1746
|
+
*
|
|
1747
|
+
* Unsupported for Amazon apps.
|
|
1748
|
+
*
|
|
1691
1749
|
* @param paywallParams - The parameters object to customise the paywall render. Check {@link PresentPaywallParams}
|
|
1692
1750
|
* @returns Promise<PurchaseResult>
|
|
1693
1751
|
*/
|
|
@@ -1762,6 +1820,9 @@ export declare class Purchases {
|
|
|
1762
1820
|
* Renders an Express Purchase button for the supported wallets (Apple Pay/Google Pay).
|
|
1763
1821
|
* When clicked it uses the wallet UI to execute the purchase instead of
|
|
1764
1822
|
* the checkout flow that would be shown with `.purchase`.
|
|
1823
|
+
*
|
|
1824
|
+
* Unsupported for Amazon apps.
|
|
1825
|
+
*
|
|
1765
1826
|
* @param params - The parameters object to customise the purchase flow. Check {@link PresentExpressPurchaseButtonParams}
|
|
1766
1827
|
* @returns Promise<PurchaseResult>
|
|
1767
1828
|
*/
|
|
@@ -1903,6 +1964,7 @@ export declare class Purchases {
|
|
|
1903
1964
|
static generateRevenueCatAnonymousAppUserId(): string;
|
|
1904
1965
|
/* Excluded from this release type: _trackEvent */
|
|
1905
1966
|
/* Excluded from this release type: _flushAllEvents */
|
|
1967
|
+
/* Excluded from this release type: unwrappedBillingWrapper */
|
|
1906
1968
|
}
|
|
1907
1969
|
|
|
1908
1970
|
/**
|
|
@@ -2243,6 +2305,14 @@ export declare class Purchases {
|
|
|
2243
2305
|
SingularDeviceId = "$singularDeviceId"
|
|
2244
2306
|
}
|
|
2245
2307
|
|
|
2308
|
+
/**
|
|
2309
|
+
* The result of restoring purchases.
|
|
2310
|
+
* @public
|
|
2311
|
+
*/
|
|
2312
|
+
declare interface RestorePurchasesResult {
|
|
2313
|
+
customerInfo: CustomerInfo;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2246
2316
|
declare type SDKEventContextSource = "sdk" | "wpl" | string;
|
|
2247
2317
|
|
|
2248
2318
|
/**
|
|
@@ -2402,6 +2472,20 @@ export declare class Purchases {
|
|
|
2402
2472
|
/* Excluded from this release type: discount */
|
|
2403
2473
|
}
|
|
2404
2474
|
|
|
2475
|
+
declare interface SubscriptionOptionResponse extends PurchaseOptionResponse {
|
|
2476
|
+
base: PricingPhaseResponse | null;
|
|
2477
|
+
trial: PricingPhaseResponse | null;
|
|
2478
|
+
intro_price: PricingPhaseResponse | null;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
/**
|
|
2482
|
+
* The result of syncing purchases.
|
|
2483
|
+
* @public
|
|
2484
|
+
*/
|
|
2485
|
+
declare interface SyncPurchasesResult {
|
|
2486
|
+
customerInfo: CustomerInfo;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2405
2489
|
/**
|
|
2406
2490
|
* Contains information about the targeting context used to obtain an object.
|
|
2407
2491
|
* @public
|