@chipmobilesdk/rn-payment 0.5.0 → 0.7.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/CHANGELOG.md +172 -0
- package/README.md +47 -16
- package/lib/commonjs/adapter/createStoreProvider.js +110 -0
- package/lib/commonjs/adapter/createStoreProvider.js.map +1 -0
- package/lib/commonjs/adapter/iap-adapter.js +393 -0
- package/lib/commonjs/adapter/iap-adapter.js.map +1 -0
- package/lib/commonjs/adapter/iapShapes.js +169 -0
- package/lib/commonjs/adapter/iapShapes.js.map +1 -0
- package/lib/commonjs/adapter/port.js +6 -0
- package/lib/commonjs/adapter/port.js.map +1 -0
- package/lib/commonjs/config/types.js +2 -0
- package/lib/commonjs/config/types.js.map +1 -0
- package/lib/commonjs/config/validate.js +181 -0
- package/lib/commonjs/config/validate.js.map +1 -0
- package/lib/commonjs/core/mutex.js +31 -0
- package/lib/commonjs/core/mutex.js.map +1 -0
- package/lib/commonjs/core/retry.js +37 -0
- package/lib/commonjs/core/retry.js.map +1 -0
- package/lib/commonjs/core/timers.js +207 -0
- package/lib/commonjs/core/timers.js.map +1 -0
- package/lib/commonjs/diagnostics/errors.js +83 -0
- package/lib/commonjs/diagnostics/errors.js.map +1 -0
- package/lib/commonjs/diagnostics/events.js +126 -0
- package/lib/commonjs/diagnostics/events.js.map +1 -0
- package/lib/commonjs/diagnostics/messageKeys.js +70 -0
- package/lib/commonjs/diagnostics/messageKeys.js.map +1 -0
- package/lib/commonjs/engine/connection.js +189 -0
- package/lib/commonjs/engine/connection.js.map +1 -0
- package/lib/commonjs/engine/engine.js +279 -0
- package/lib/commonjs/engine/engine.js.map +1 -0
- package/lib/commonjs/engine/finalize.js +325 -0
- package/lib/commonjs/engine/finalize.js.map +1 -0
- package/lib/commonjs/engine/foreground.js +26 -0
- package/lib/commonjs/engine/foreground.js.map +1 -0
- package/lib/commonjs/engine/internals.js +31 -0
- package/lib/commonjs/engine/internals.js.map +1 -0
- package/lib/commonjs/engine/pending.js +102 -0
- package/lib/commonjs/engine/pending.js.map +1 -0
- package/lib/commonjs/engine/products.js +198 -0
- package/lib/commonjs/engine/products.js.map +1 -0
- package/lib/commonjs/engine/purchase.js +395 -0
- package/lib/commonjs/engine/purchase.js.map +1 -0
- package/lib/commonjs/engine/purchaseFailure.js +77 -0
- package/lib/commonjs/engine/purchaseFailure.js.map +1 -0
- package/lib/commonjs/engine/receiptValidation.js +90 -0
- package/lib/commonjs/engine/receiptValidation.js.map +1 -0
- package/lib/commonjs/engine/state.js +201 -0
- package/lib/commonjs/engine/state.js.map +1 -0
- package/lib/commonjs/engine/subscriptions.js +122 -0
- package/lib/commonjs/engine/subscriptions.js.map +1 -0
- package/lib/commonjs/engine/sync.js +163 -0
- package/lib/commonjs/engine/sync.js.map +1 -0
- package/lib/commonjs/entitlements/aggregate.js +212 -0
- package/lib/commonjs/entitlements/aggregate.js.map +1 -0
- package/lib/commonjs/entitlements/mapping.js +41 -0
- package/lib/commonjs/entitlements/mapping.js.map +1 -0
- package/lib/commonjs/entitlements/policy.js +110 -0
- package/lib/commonjs/entitlements/policy.js.map +1 -0
- package/lib/commonjs/index.js +266 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/persistence/mmkv-store.js +149 -0
- package/lib/commonjs/persistence/mmkv-store.js.map +1 -0
- package/lib/commonjs/persistence/snapshot.js +229 -0
- package/lib/commonjs/persistence/snapshot.js.map +1 -0
- package/lib/commonjs/react/PaymentProvider.js +96 -0
- package/lib/commonjs/react/PaymentProvider.js.map +1 -0
- package/lib/commonjs/react/hooks.js +202 -0
- package/lib/commonjs/react/hooks.js.map +1 -0
- package/lib/commonjs/testing/conformance.js +136 -0
- package/lib/commonjs/testing/conformance.js.map +1 -0
- package/lib/commonjs/testing/fakeStore.js +281 -0
- package/lib/commonjs/testing/fakeStore.js.map +1 -0
- package/lib/commonjs/testing/index.js +45 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/module/adapter/createStoreProvider.js +106 -0
- package/lib/module/adapter/createStoreProvider.js.map +1 -0
- package/lib/module/adapter/iap-adapter.js +383 -0
- package/lib/module/adapter/iap-adapter.js.map +1 -0
- package/lib/module/adapter/iapShapes.js +160 -0
- package/lib/module/adapter/iapShapes.js.map +1 -0
- package/lib/module/adapter/port.js +4 -0
- package/lib/module/adapter/port.js.map +1 -0
- package/lib/module/config/types.js +2 -0
- package/lib/module/config/types.js.map +1 -0
- package/lib/module/config/validate.js +175 -0
- package/lib/module/config/validate.js.map +1 -0
- package/lib/module/core/mutex.js +22 -0
- package/lib/module/core/mutex.js.map +1 -0
- package/lib/module/core/retry.js +33 -0
- package/lib/module/core/retry.js.map +1 -0
- package/lib/module/core/timers.js +198 -0
- package/lib/module/core/timers.js.map +1 -0
- package/lib/module/diagnostics/errors.js +76 -0
- package/lib/module/diagnostics/errors.js.map +1 -0
- package/lib/module/diagnostics/events.js +117 -0
- package/lib/module/diagnostics/events.js.map +1 -0
- package/lib/module/diagnostics/messageKeys.js +64 -0
- package/lib/module/diagnostics/messageKeys.js.map +1 -0
- package/lib/module/engine/connection.js +185 -0
- package/lib/module/engine/connection.js.map +1 -0
- package/lib/module/engine/engine.js +274 -0
- package/lib/module/engine/engine.js.map +1 -0
- package/lib/module/engine/finalize.js +322 -0
- package/lib/module/engine/finalize.js.map +1 -0
- package/lib/module/engine/foreground.js +21 -0
- package/lib/module/engine/foreground.js.map +1 -0
- package/lib/module/engine/internals.js +26 -0
- package/lib/module/engine/internals.js.map +1 -0
- package/lib/module/engine/pending.js +95 -0
- package/lib/module/engine/pending.js.map +1 -0
- package/lib/module/engine/products.js +195 -0
- package/lib/module/engine/products.js.map +1 -0
- package/lib/module/engine/purchase.js +390 -0
- package/lib/module/engine/purchase.js.map +1 -0
- package/lib/module/engine/purchaseFailure.js +72 -0
- package/lib/module/engine/purchaseFailure.js.map +1 -0
- package/lib/module/engine/receiptValidation.js +87 -0
- package/lib/module/engine/receiptValidation.js.map +1 -0
- package/lib/module/engine/state.js +196 -0
- package/lib/module/engine/state.js.map +1 -0
- package/lib/module/engine/subscriptions.js +119 -0
- package/lib/module/engine/subscriptions.js.map +1 -0
- package/lib/module/engine/sync.js +158 -0
- package/lib/module/engine/sync.js.map +1 -0
- package/lib/module/entitlements/aggregate.js +204 -0
- package/lib/module/entitlements/aggregate.js.map +1 -0
- package/lib/module/entitlements/mapping.js +35 -0
- package/lib/module/entitlements/mapping.js.map +1 -0
- package/lib/module/entitlements/policy.js +104 -0
- package/lib/module/entitlements/policy.js.map +1 -0
- package/lib/module/index.js +59 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/persistence/mmkv-store.js +144 -0
- package/lib/module/persistence/mmkv-store.js.map +1 -0
- package/lib/module/persistence/snapshot.js +221 -0
- package/lib/module/persistence/snapshot.js.map +1 -0
- package/lib/module/react/PaymentProvider.js +90 -0
- package/lib/module/react/PaymentProvider.js.map +1 -0
- package/lib/module/react/hooks.js +192 -0
- package/lib/module/react/hooks.js.map +1 -0
- package/lib/module/testing/conformance.js +130 -0
- package/lib/module/testing/conformance.js.map +1 -0
- package/lib/module/testing/fakeStore.js +276 -0
- package/lib/module/testing/fakeStore.js.map +1 -0
- package/lib/module/testing/index.js +13 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/typescript/commonjs/adapter/createStoreProvider.d.ts +45 -0
- package/lib/typescript/commonjs/adapter/createStoreProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/iap-adapter.d.ts +80 -0
- package/lib/typescript/commonjs/adapter/iap-adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/iapShapes.d.ts +94 -0
- package/lib/typescript/commonjs/adapter/iapShapes.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/port.d.ts +184 -0
- package/lib/typescript/commonjs/adapter/port.d.ts.map +1 -0
- package/lib/typescript/commonjs/config/types.d.ts +326 -0
- package/lib/typescript/commonjs/config/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/config/validate.d.ts +63 -0
- package/lib/typescript/commonjs/config/validate.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/mutex.d.ts +17 -0
- package/lib/typescript/commonjs/core/mutex.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/retry.d.ts +19 -0
- package/lib/typescript/commonjs/core/retry.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/timers.d.ts +142 -0
- package/lib/typescript/commonjs/core/timers.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts +55 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts +158 -0
- package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/messageKeys.d.ts +54 -0
- package/lib/typescript/commonjs/diagnostics/messageKeys.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/connection.d.ts +30 -0
- package/lib/typescript/commonjs/engine/connection.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/engine.d.ts +93 -0
- package/lib/typescript/commonjs/engine/engine.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/finalize.d.ts +53 -0
- package/lib/typescript/commonjs/engine/finalize.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/foreground.d.ts +15 -0
- package/lib/typescript/commonjs/engine/foreground.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/internals.d.ts +28 -0
- package/lib/typescript/commonjs/engine/internals.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/pending.d.ts +51 -0
- package/lib/typescript/commonjs/engine/pending.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/products.d.ts +82 -0
- package/lib/typescript/commonjs/engine/products.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/purchase.d.ts +61 -0
- package/lib/typescript/commonjs/engine/purchase.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/purchaseFailure.d.ts +15 -0
- package/lib/typescript/commonjs/engine/purchaseFailure.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/receiptValidation.d.ts +42 -0
- package/lib/typescript/commonjs/engine/receiptValidation.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/state.d.ts +46 -0
- package/lib/typescript/commonjs/engine/state.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/subscriptions.d.ts +61 -0
- package/lib/typescript/commonjs/engine/subscriptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/engine/sync.d.ts +36 -0
- package/lib/typescript/commonjs/engine/sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/entitlements/aggregate.d.ts +97 -0
- package/lib/typescript/commonjs/entitlements/aggregate.d.ts.map +1 -0
- package/lib/typescript/commonjs/entitlements/mapping.d.ts +27 -0
- package/lib/typescript/commonjs/entitlements/mapping.d.ts.map +1 -0
- package/lib/typescript/commonjs/entitlements/policy.d.ts +75 -0
- package/lib/typescript/commonjs/entitlements/policy.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +44 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/persistence/mmkv-store.d.ts +45 -0
- package/lib/typescript/commonjs/persistence/mmkv-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/persistence/snapshot.d.ts +106 -0
- package/lib/typescript/commonjs/persistence/snapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/PaymentProvider.d.ts +57 -0
- package/lib/typescript/commonjs/react/PaymentProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/hooks.d.ts +80 -0
- package/lib/typescript/commonjs/react/hooks.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance.d.ts +41 -0
- package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/fakeStore.d.ts +69 -0
- package/lib/typescript/commonjs/testing/fakeStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +12 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/adapter/createStoreProvider.d.ts +45 -0
- package/lib/typescript/module/adapter/createStoreProvider.d.ts.map +1 -0
- package/lib/typescript/module/adapter/iap-adapter.d.ts +80 -0
- package/lib/typescript/module/adapter/iap-adapter.d.ts.map +1 -0
- package/lib/typescript/module/adapter/iapShapes.d.ts +94 -0
- package/lib/typescript/module/adapter/iapShapes.d.ts.map +1 -0
- package/lib/typescript/module/adapter/port.d.ts +184 -0
- package/lib/typescript/module/adapter/port.d.ts.map +1 -0
- package/lib/typescript/module/config/types.d.ts +326 -0
- package/lib/typescript/module/config/types.d.ts.map +1 -0
- package/lib/typescript/module/config/validate.d.ts +63 -0
- package/lib/typescript/module/config/validate.d.ts.map +1 -0
- package/lib/typescript/module/core/mutex.d.ts +17 -0
- package/lib/typescript/module/core/mutex.d.ts.map +1 -0
- package/lib/typescript/module/core/retry.d.ts +19 -0
- package/lib/typescript/module/core/retry.d.ts.map +1 -0
- package/lib/typescript/module/core/timers.d.ts +142 -0
- package/lib/typescript/module/core/timers.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/errors.d.ts +55 -0
- package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/events.d.ts +158 -0
- package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/messageKeys.d.ts +54 -0
- package/lib/typescript/module/diagnostics/messageKeys.d.ts.map +1 -0
- package/lib/typescript/module/engine/connection.d.ts +30 -0
- package/lib/typescript/module/engine/connection.d.ts.map +1 -0
- package/lib/typescript/module/engine/engine.d.ts +93 -0
- package/lib/typescript/module/engine/engine.d.ts.map +1 -0
- package/lib/typescript/module/engine/finalize.d.ts +53 -0
- package/lib/typescript/module/engine/finalize.d.ts.map +1 -0
- package/lib/typescript/module/engine/foreground.d.ts +15 -0
- package/lib/typescript/module/engine/foreground.d.ts.map +1 -0
- package/lib/typescript/module/engine/internals.d.ts +28 -0
- package/lib/typescript/module/engine/internals.d.ts.map +1 -0
- package/lib/typescript/module/engine/pending.d.ts +51 -0
- package/lib/typescript/module/engine/pending.d.ts.map +1 -0
- package/lib/typescript/module/engine/products.d.ts +82 -0
- package/lib/typescript/module/engine/products.d.ts.map +1 -0
- package/lib/typescript/module/engine/purchase.d.ts +61 -0
- package/lib/typescript/module/engine/purchase.d.ts.map +1 -0
- package/lib/typescript/module/engine/purchaseFailure.d.ts +15 -0
- package/lib/typescript/module/engine/purchaseFailure.d.ts.map +1 -0
- package/lib/typescript/module/engine/receiptValidation.d.ts +42 -0
- package/lib/typescript/module/engine/receiptValidation.d.ts.map +1 -0
- package/lib/typescript/module/engine/state.d.ts +46 -0
- package/lib/typescript/module/engine/state.d.ts.map +1 -0
- package/lib/typescript/module/engine/subscriptions.d.ts +61 -0
- package/lib/typescript/module/engine/subscriptions.d.ts.map +1 -0
- package/lib/typescript/module/engine/sync.d.ts +36 -0
- package/lib/typescript/module/engine/sync.d.ts.map +1 -0
- package/lib/typescript/module/entitlements/aggregate.d.ts +97 -0
- package/lib/typescript/module/entitlements/aggregate.d.ts.map +1 -0
- package/lib/typescript/module/entitlements/mapping.d.ts +27 -0
- package/lib/typescript/module/entitlements/mapping.d.ts.map +1 -0
- package/lib/typescript/module/entitlements/policy.d.ts +75 -0
- package/lib/typescript/module/entitlements/policy.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +44 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/persistence/mmkv-store.d.ts +45 -0
- package/lib/typescript/module/persistence/mmkv-store.d.ts.map +1 -0
- package/lib/typescript/module/persistence/snapshot.d.ts +106 -0
- package/lib/typescript/module/persistence/snapshot.d.ts.map +1 -0
- package/lib/typescript/module/react/PaymentProvider.d.ts +57 -0
- package/lib/typescript/module/react/PaymentProvider.d.ts.map +1 -0
- package/lib/typescript/module/react/hooks.d.ts +80 -0
- package/lib/typescript/module/react/hooks.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance.d.ts +41 -0
- package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
- package/lib/typescript/module/testing/fakeStore.d.ts +69 -0
- package/lib/typescript/module/testing/fakeStore.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +12 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/package.json +49 -13
- package/skills/sdk-rn-payment/SKILL.md +4 -4
- package/src/adapter/iap-adapter.ts +12 -216
- package/src/adapter/iapShapes.ts +232 -0
- package/src/config/types.ts +8 -0
- package/src/config/validate.ts +19 -4
- package/src/core/retry.ts +1 -58
- package/src/diagnostics/events.ts +1 -1
- package/src/engine/connection.ts +194 -0
- package/src/engine/engine.ts +140 -700
- package/src/engine/internals.ts +40 -0
- package/src/engine/products.ts +39 -17
- package/src/engine/purchase.ts +22 -130
- package/src/engine/purchaseFailure.ts +48 -0
- package/src/engine/receiptValidation.ts +101 -0
- package/src/engine/state.ts +253 -0
- package/src/engine/sync.ts +161 -0
- package/src/entitlements/aggregate.ts +3 -5
- package/src/entitlements/mapping.ts +0 -22
- package/src/persistence/mmkv-store.ts +10 -3
- package/src/persistence/snapshot.ts +102 -27
- package/src/react/PaymentProvider.tsx +73 -24
- package/src/react/hooks.ts +13 -3
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.aggregate = aggregate;
|
|
7
|
+
exports.diffEntitlements = diffEntitlements;
|
|
8
|
+
exports.initialEntitlements = initialEntitlements;
|
|
9
|
+
exports.shareUnchanged = shareUnchanged;
|
|
10
|
+
exports.snapshotCertainty = snapshotCertainty;
|
|
11
|
+
var _rnCore = require("@chipmobilesdk/rn-core");
|
|
12
|
+
var _mapping = require("./mapping.js");
|
|
13
|
+
var _policy = require("./policy.js");
|
|
14
|
+
/**
|
|
15
|
+
* Entitlement aggregation — the package's primary output.
|
|
16
|
+
*
|
|
17
|
+
* Everything else exists to make this one answer correct. The most damaging
|
|
18
|
+
* defect class in a payment SDK lives here: collapsing "not yet synced" into "not
|
|
19
|
+
* entitled" makes a paying user watch ads flash on cold start or see a purchased
|
|
20
|
+
* feature sit locked.
|
|
21
|
+
*
|
|
22
|
+
* Two rules do most of the work:
|
|
23
|
+
*
|
|
24
|
+
* - **A pending purchase is never a source** (FR-037). Enforced here, in
|
|
25
|
+
* aggregation, rather than at each call site, so no future code path can grant
|
|
26
|
+
* on money that has not arrived.
|
|
27
|
+
* - **Uncertainty resolves to `unknown`, never `not_entitled`** (FR-047,
|
|
28
|
+
* FR-055a). Never synced, stale, or scope-changed all mean "we do not know",
|
|
29
|
+
* and the package says so rather than asserting the user did not pay.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/** A purchase that currently confers its entitlements. */
|
|
33
|
+
function isValidSource(purchase, input) {
|
|
34
|
+
// Only a purchase the store confirmed grants. Pending money is not money, and a
|
|
35
|
+
// state this version does not know is no basis for a grant either (PAY-13).
|
|
36
|
+
if (purchase.state !== 'purchased') {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
// A backend that said no is final (FR-071). A queued re-validation still
|
|
40
|
+
// grants, which is the documented `grant_and_queue` fallback (FR-072).
|
|
41
|
+
if (purchase.validationState === 'rejected') {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (purchase.productType === 'subscription') {
|
|
45
|
+
if ((0, _policy.hasExpired)(purchase.expiresAt, input.now)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const renewalState = (0, _policy.deriveRenewalState)({
|
|
49
|
+
expiresAt: purchase.expiresAt,
|
|
50
|
+
willAutoRenew: purchase.willAutoRenew,
|
|
51
|
+
reportsGraceAndHoldDistinctly: input.reportsGraceAndHoldDistinctly
|
|
52
|
+
});
|
|
53
|
+
return (0, _policy.grantsUnderPolicy)(renewalState, {
|
|
54
|
+
gracePolicy: input.config.gracePolicy,
|
|
55
|
+
holdPolicy: input.config.holdPolicy
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// A consumable that has not been consumed yet is owned, but it must never
|
|
60
|
+
// become a permanent entitlement — consumption flips it to `consumed` above.
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
function subscriptionDetailFor(purchases, input) {
|
|
64
|
+
const subs = purchases.filter(p => p.productType === 'subscription');
|
|
65
|
+
if (subs.length === 0) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Where several subscriptions grant one entitlement, the one running longest
|
|
70
|
+
// is what the user experiences, so report that one.
|
|
71
|
+
const furthest = subs.reduce((best, candidate) => {
|
|
72
|
+
const bestAt = best.expiresAt ?? Number.MAX_SAFE_INTEGER;
|
|
73
|
+
const candidateAt = candidate.expiresAt ?? Number.MAX_SAFE_INTEGER;
|
|
74
|
+
return candidateAt > bestAt ? candidate : best;
|
|
75
|
+
});
|
|
76
|
+
const renewalState = (0, _policy.deriveRenewalState)({
|
|
77
|
+
expiresAt: furthest.expiresAt,
|
|
78
|
+
willAutoRenew: furthest.willAutoRenew,
|
|
79
|
+
reportsGraceAndHoldDistinctly: input.reportsGraceAndHoldDistinctly
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
expiresAt: furthest.expiresAt,
|
|
83
|
+
willAutoRenew: furthest.willAutoRenew === true,
|
|
84
|
+
isCancelledButValid: renewalState === 'cancelled_valid',
|
|
85
|
+
renewalState
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Computes the full entitlement map.
|
|
91
|
+
*
|
|
92
|
+
* Pure and synchronous by design: it runs on render paths, so it must never
|
|
93
|
+
* touch I/O (PERF-001). The engine calls it after any state change and caches the
|
|
94
|
+
* result.
|
|
95
|
+
*/
|
|
96
|
+
/**
|
|
97
|
+
* How far the snapshot can be trusted right now.
|
|
98
|
+
*
|
|
99
|
+
* Shared by entitlements and the pending set (FR-103) so the two can never
|
|
100
|
+
* disagree about whether the package knows anything — a paywall that showed
|
|
101
|
+
* "not entitled" next to "nothing pending" from one stale snapshot would offer
|
|
102
|
+
* Buy to a user whose payment is in flight.
|
|
103
|
+
*/
|
|
104
|
+
function snapshotCertainty(input) {
|
|
105
|
+
const {
|
|
106
|
+
config,
|
|
107
|
+
snapshot,
|
|
108
|
+
hasSynced,
|
|
109
|
+
now
|
|
110
|
+
} = input;
|
|
111
|
+
const isStale = snapshot.lastSyncedAt !== undefined && now - snapshot.lastSyncedAt > config.staleAfterMs;
|
|
112
|
+
|
|
113
|
+
// Both roads lead to `unknown`, never to a confident "no". Never having synced
|
|
114
|
+
// and having synced too long ago are the same epistemic state: we cannot
|
|
115
|
+
// currently support a claim either way.
|
|
116
|
+
return {
|
|
117
|
+
isStale,
|
|
118
|
+
undetermined: !hasSynced || isStale
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function aggregate(input) {
|
|
122
|
+
const {
|
|
123
|
+
config,
|
|
124
|
+
snapshot
|
|
125
|
+
} = input;
|
|
126
|
+
const {
|
|
127
|
+
isStale,
|
|
128
|
+
undetermined
|
|
129
|
+
} = snapshotCertainty(input);
|
|
130
|
+
const valid = snapshot.purchases.filter(p => isValidSource(p, input));
|
|
131
|
+
const result = {};
|
|
132
|
+
for (const key of config.entitlementKeys) {
|
|
133
|
+
const granting = valid.filter(p => (0, _mapping.entitlementsFor)(config, p.productKey).includes(key));
|
|
134
|
+
const sources = [...new Set(granting.map(p => p.productKey))];
|
|
135
|
+
result[key] = {
|
|
136
|
+
key,
|
|
137
|
+
// An entitlement stays valid while at least one source remains (FR-052).
|
|
138
|
+
status: undetermined ? 'unknown' : sources.length > 0 ? 'entitled' : 'not_entitled',
|
|
139
|
+
sources,
|
|
140
|
+
subscription: subscriptionDetailFor(granting, input),
|
|
141
|
+
lastSyncedAt: snapshot.lastSyncedAt,
|
|
142
|
+
isStale
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** The initial map, before anything is known. Every key starts at `unknown` (FR-047). */
|
|
149
|
+
function initialEntitlements(config) {
|
|
150
|
+
const result = {};
|
|
151
|
+
for (const key of config.entitlementKeys) {
|
|
152
|
+
result[key] = {
|
|
153
|
+
key,
|
|
154
|
+
status: 'unknown',
|
|
155
|
+
sources: [],
|
|
156
|
+
lastSyncedAt: undefined,
|
|
157
|
+
isStale: false
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Diffs two maps to produce change signals.
|
|
164
|
+
*
|
|
165
|
+
* Emitting from a diff rather than from grant call sites is what makes the
|
|
166
|
+
* exactly-once guarantees structural (FR-079): a successful subscription renewal
|
|
167
|
+
* changes no status, so it produces no event and cannot double-signal (FR-068);
|
|
168
|
+
* and an entitlement with three sources fires once on transition, not once per
|
|
169
|
+
* source.
|
|
170
|
+
*/
|
|
171
|
+
function diffEntitlements(previous, next) {
|
|
172
|
+
const changes = [];
|
|
173
|
+
for (const key of Object.keys(next)) {
|
|
174
|
+
const before = previous[key]?.status ?? 'unknown';
|
|
175
|
+
const after = next[key].status;
|
|
176
|
+
if (before !== after) {
|
|
177
|
+
changes.push({
|
|
178
|
+
key,
|
|
179
|
+
previous: before,
|
|
180
|
+
next: after,
|
|
181
|
+
sources: next[key].sources
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return changes;
|
|
186
|
+
}
|
|
187
|
+
function sameEntitlement(a, b) {
|
|
188
|
+
return a.status === b.status && a.isStale === b.isStale && a.lastSyncedAt === b.lastSyncedAt && a.sources.length === b.sources.length && a.sources.every((source, index) => source === b.sources[index]) && (0, _rnCore.shallowEqual)(a.subscription, b.subscription);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* `next`, with every entitlement that did not change replaced by the object it
|
|
193
|
+
* replaces, and `previous` itself when nothing changed (PERF-03, PAY-08). A hook
|
|
194
|
+
* selecting one entitlement then sees the same object and does not re-render.
|
|
195
|
+
*/
|
|
196
|
+
function shareUnchanged(previous, next) {
|
|
197
|
+
const keys = Object.keys(next);
|
|
198
|
+
let changed = keys.length !== Object.keys(previous).length;
|
|
199
|
+
const shared = {};
|
|
200
|
+
for (const key of keys) {
|
|
201
|
+
const before = previous[key];
|
|
202
|
+
const after = next[key];
|
|
203
|
+
if (before && sameEntitlement(before, after)) {
|
|
204
|
+
shared[key] = before;
|
|
205
|
+
} else {
|
|
206
|
+
shared[key] = after;
|
|
207
|
+
changed = true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return changed ? shared : previous;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_rnCore","require","_mapping","_policy","isValidSource","purchase","input","state","validationState","productType","hasExpired","expiresAt","now","renewalState","deriveRenewalState","willAutoRenew","reportsGraceAndHoldDistinctly","grantsUnderPolicy","gracePolicy","config","holdPolicy","subscriptionDetailFor","purchases","subs","filter","p","length","undefined","furthest","reduce","best","candidate","bestAt","Number","MAX_SAFE_INTEGER","candidateAt","isCancelledButValid","snapshotCertainty","snapshot","hasSynced","isStale","lastSyncedAt","staleAfterMs","undetermined","aggregate","valid","result","key","entitlementKeys","granting","entitlementsFor","productKey","includes","sources","Set","map","status","subscription","initialEntitlements","diffEntitlements","previous","next","changes","Object","keys","before","after","push","sameEntitlement","a","b","every","source","index","shallowEqual","shareUnchanged","changed","shared"],"sourceRoot":"../../../src","sources":["entitlements/aggregate.ts"],"mappings":";;;;;;;;;;AAkBA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF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QAAQ,CAAC,CAAClC,MAAM;EAC1D,MAAMmD,MAAsB,GAAG,CAAC,CAAC;EACjC,KAAK,MAAM9B,GAAG,IAAIiB,IAAI,EAAE;IACvB,MAAMC,MAAM,GAAGL,QAAQ,CAACb,GAAG,CAAC;IAC5B,MAAMmB,KAAK,GAAGL,IAAI,CAACd,GAAG,CAAE;IACxB,IAAIkB,MAAM,IAAIG,eAAe,CAACH,MAAM,EAAEC,KAAK,CAAC,EAAE;MAC7CW,MAAM,CAAC9B,GAAG,CAAC,GAAGkB,MAAM;IACrB,CAAC,MAAM;MACNY,MAAM,CAAC9B,GAAG,CAAC,GAAGmB,KAAK;MACnBU,OAAO,GAAG,IAAI;IACf;EACD;EACA,OAAOA,OAAO,GAAGC,MAAM,GAAGjB,QAAQ;AACnC","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.entitlementsFor = entitlementsFor;
|
|
7
|
+
exports.productKeyForStoreId = productKeyForStoreId;
|
|
8
|
+
exports.storeIdForProductKey = storeIdForProductKey;
|
|
9
|
+
/**
|
|
10
|
+
* Product ↔ entitlement indexing.
|
|
11
|
+
*
|
|
12
|
+
* The relation is many-to-many (FR-010): monthly, yearly, and lifetime products
|
|
13
|
+
* may all grant `no_ads`, and one bundle product may grant several entitlements.
|
|
14
|
+
*
|
|
15
|
+
* Both directions are indexed once at configure time. The reverse direction is
|
|
16
|
+
* what makes two requirements cheap on hot paths: naming which product currently
|
|
17
|
+
* grants an entitlement (FR-051), and keeping an entitlement valid while *any*
|
|
18
|
+
* source remains (FR-052).
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** Entitlements a product confers. Empty for an unknown key rather than throwing. */
|
|
22
|
+
function entitlementsFor(config, productKey) {
|
|
23
|
+
return config.grants.get(productKey) ?? [];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Translates a store product id back to the app's own product key.
|
|
28
|
+
*
|
|
29
|
+
* Needed because store callbacks and `queryOwned` speak in store ids, while
|
|
30
|
+
* everything above the adapter speaks in product keys (FR-003). Returns
|
|
31
|
+
* `undefined` for an id absent from the catalog — which happens legitimately when
|
|
32
|
+
* a user owns something from a build whose catalog has since changed, so it must
|
|
33
|
+
* be handled rather than treated as impossible.
|
|
34
|
+
*/
|
|
35
|
+
function productKeyForStoreId(config, storeProductId) {
|
|
36
|
+
return config.byStoreId.get(storeProductId);
|
|
37
|
+
}
|
|
38
|
+
function storeIdForProductKey(config, productKey) {
|
|
39
|
+
return config.entries.get(productKey)?.storeProductIds[config.platform];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=mapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["entitlementsFor","config","productKey","grants","get","productKeyForStoreId","storeProductId","byStoreId","storeIdForProductKey","entries","storeProductIds","platform"],"sourceRoot":"../../../src","sources":["entitlements/mapping.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACO,SAASA,eAAeA,CAC9BC,MAAsB,EACtBC,UAAsB,EACM;EAC5B,OAAOD,MAAM,CAACE,MAAM,CAACC,GAAG,CAACF,UAAU,CAAC,IAAI,EAAE;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,oBAAoBA,CACnCJ,MAAsB,EACtBK,cAAsB,EACG;EACzB,OAAOL,MAAM,CAACM,SAAS,CAACH,GAAG,CAACE,cAAc,CAAC;AAC5C;AAEO,SAASE,oBAAoBA,CACnCP,MAAsB,EACtBC,UAAsB,EACD;EACrB,OAAOD,MAAM,CAACQ,OAAO,CAACL,GAAG,CAACF,UAAU,CAAC,EAAEQ,eAAe,CAACT,MAAM,CAACU,QAAQ,CAAC;AACxE","ignoreList":[]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deriveRenewalState = deriveRenewalState;
|
|
7
|
+
exports.grantsUnderPolicy = grantsUnderPolicy;
|
|
8
|
+
exports.hasExpired = hasExpired;
|
|
9
|
+
/**
|
|
10
|
+
* Grace and hold entitlement policy.
|
|
11
|
+
*
|
|
12
|
+
* This is a **business decision, not a technical constant** (FR-049), so it is
|
|
13
|
+
* configurable with documented defaults.
|
|
14
|
+
*
|
|
15
|
+
* ## The defaults, and why
|
|
16
|
+
*
|
|
17
|
+
* `gracePolicy: 'grant'` — a grace period means the store is still retrying a
|
|
18
|
+
* payment method that failed for reasons usually outside the user's control: an
|
|
19
|
+
* expired card, a bank decline, a temporary hold. Revoking immediately punishes a
|
|
20
|
+
* paying customer for a billing hiccup they may not know about yet.
|
|
21
|
+
*
|
|
22
|
+
* `holdPolicy: 'withhold'` — account hold means the store has given up retrying.
|
|
23
|
+
* The subscription is effectively unpaid, and continuing to serve paid features
|
|
24
|
+
* indefinitely is giving away the product.
|
|
25
|
+
*
|
|
26
|
+
* ## What Android can actually tell us
|
|
27
|
+
*
|
|
28
|
+
* Client-side Play Billing **cannot** separate grace from hold: a grace-period
|
|
29
|
+
* subscription is still returned as active, and one in account hold stops being
|
|
30
|
+
* returned at all — indistinguishable from expired, cancelled, or refunded.
|
|
31
|
+
*
|
|
32
|
+
* Fortunately the platform's own behavior matches the defaults above. Play keeps
|
|
33
|
+
* returning a grace-period purchase, so the entitlement holds. Play stops
|
|
34
|
+
* returning a held one, so it lapses at the next sync. **The default policy is
|
|
35
|
+
* therefore correct with no backend at all.**
|
|
36
|
+
*
|
|
37
|
+
* What is *not* achievable client-side is a non-default policy — withholding
|
|
38
|
+
* during grace, or granting during hold — because that needs the state the client
|
|
39
|
+
* cannot see. Such an app supplies it through the validation hook (FR-069). This
|
|
40
|
+
* limitation is documented rather than papered over (FR-058).
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A subscription's renewal state as far as the package can honestly tell.
|
|
45
|
+
*
|
|
46
|
+
* `indeterminate` is not a failure — it is the truthful answer when the platform
|
|
47
|
+
* reports a subscription as active but cannot say whether that is a healthy
|
|
48
|
+
* renewal, a cancelled-but-still-paid period, or a grace period.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Derives the renewal state without inventing information.
|
|
53
|
+
*
|
|
54
|
+
* The temptation is to read `willAutoRenew === false` as "grace period", but that
|
|
55
|
+
* same value is what a deliberate cancellation looks like. Guessing would mean
|
|
56
|
+
* showing "there's a problem with your payment method" to someone who simply
|
|
57
|
+
* chose not to renew — so when the provider cannot distinguish, neither do we.
|
|
58
|
+
*/
|
|
59
|
+
function deriveRenewalState(facts) {
|
|
60
|
+
if (facts.reportsGraceAndHoldDistinctly && facts.providerRenewalState) {
|
|
61
|
+
switch (facts.providerRenewalState) {
|
|
62
|
+
case 'grace':
|
|
63
|
+
return 'grace';
|
|
64
|
+
case 'hold':
|
|
65
|
+
return 'hold';
|
|
66
|
+
case 'active':
|
|
67
|
+
return facts.willAutoRenew === false ? 'cancelled_valid' : 'active';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (facts.willAutoRenew === false) {
|
|
71
|
+
// Still inside a paid period with auto-renew off. Genuinely ambiguous
|
|
72
|
+
// between "cancelled" and "in grace", so report the one that is certainly
|
|
73
|
+
// true — the period is paid for — and let the app decide how to present it.
|
|
74
|
+
return 'cancelled_valid';
|
|
75
|
+
}
|
|
76
|
+
if (facts.willAutoRenew === true) {
|
|
77
|
+
return 'active';
|
|
78
|
+
}
|
|
79
|
+
return 'indeterminate';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Whether a subscription in this state should confer its entitlement.
|
|
84
|
+
*
|
|
85
|
+
* `hold` reaching this function at all requires a provider that reports it,
|
|
86
|
+
* which Android does not. On Android a held subscription simply stops being
|
|
87
|
+
* returned, so it never becomes a source and the entitlement lapses — the same
|
|
88
|
+
* result the `withhold` default expresses.
|
|
89
|
+
*/
|
|
90
|
+
function grantsUnderPolicy(state, policy) {
|
|
91
|
+
switch (state) {
|
|
92
|
+
case 'active':
|
|
93
|
+
case 'cancelled_valid':
|
|
94
|
+
return true;
|
|
95
|
+
case 'grace':
|
|
96
|
+
return policy.gracePolicy === 'grant';
|
|
97
|
+
case 'hold':
|
|
98
|
+
return policy.holdPolicy === 'grant';
|
|
99
|
+
case 'indeterminate':
|
|
100
|
+
// The store is still reporting the purchase as owned. Withholding here
|
|
101
|
+
// would revoke from a paying user because of our own uncertainty.
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** True once a subscription's paid period has genuinely elapsed (FR-048). */
|
|
107
|
+
function hasExpired(expiresAt, now) {
|
|
108
|
+
return expiresAt !== undefined && expiresAt <= now;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["deriveRenewalState","facts","reportsGraceAndHoldDistinctly","providerRenewalState","willAutoRenew","grantsUnderPolicy","state","policy","gracePolicy","holdPolicy","hasExpired","expiresAt","now","undefined"],"sourceRoot":"../../../src","sources":["entitlements/policy.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAACC,KAAwB,EAAgB;EAC1E,IAAIA,KAAK,CAACC,6BAA6B,IAAID,KAAK,CAACE,oBAAoB,EAAE;IACtE,QAAQF,KAAK,CAACE,oBAAoB;MACjC,KAAK,OAAO;QACX,OAAO,OAAO;MACf,KAAK,MAAM;QACV,OAAO,MAAM;MACd,KAAK,QAAQ;QACZ,OAAOF,KAAK,CAACG,aAAa,KAAK,KAAK,GAAG,iBAAiB,GAAG,QAAQ;IACrE;EACD;EAEA,IAAIH,KAAK,CAACG,aAAa,KAAK,KAAK,EAAE;IAClC;IACA;IACA;IACA,OAAO,iBAAiB;EACzB;EAEA,IAAIH,KAAK,CAACG,aAAa,KAAK,IAAI,EAAE;IACjC,OAAO,QAAQ;EAChB;EAEA,OAAO,eAAe;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAACC,KAAmB,EAAEC,MAAyB,EAAW;EAC1F,QAAQD,KAAK;IACZ,KAAK,QAAQ;IACb,KAAK,iBAAiB;MACrB,OAAO,IAAI;IACZ,KAAK,OAAO;MACX,OAAOC,MAAM,CAACC,WAAW,KAAK,OAAO;IACtC,KAAK,MAAM;MACV,OAAOD,MAAM,CAACE,UAAU,KAAK,OAAO;IACrC,KAAK,eAAe;MACnB;MACA;MACA,OAAO,IAAI;EACb;AACD;;AAEA;AACO,SAASC,UAAUA,CAACC,SAA6B,EAAEC,GAAW,EAAW;EAC/E,OAAOD,SAAS,KAAKE,SAAS,IAAIF,SAAS,IAAIC,GAAG;AACnD","ignoreList":[]}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BACKOFF_ATTEMPT_BOUNDS", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _timers.BACKOFF_ATTEMPT_BOUNDS;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "BACKOFF_MAX_DELAY_BOUNDS", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _timers.BACKOFF_MAX_DELAY_BOUNDS;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "CONNECT_TIMEOUT_BOUNDS", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _timers.CONNECT_TIMEOUT_BOUNDS;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "DEFAULT_CONNECT_TIMEOUT_MS", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _timers.DEFAULT_CONNECT_TIMEOUT_MS;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "DEFAULT_DEVELOPER_MESSAGES", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _messageKeys.DEFAULT_DEVELOPER_MESSAGES;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "DEFAULT_FINALIZE_ATTEMPT_TIMEOUT_MS", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _timers.DEFAULT_FINALIZE_ATTEMPT_TIMEOUT_MS;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "DEFAULT_FINALIZE_BACKOFF", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _timers.DEFAULT_FINALIZE_BACKOFF;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "DEFAULT_FOREGROUND_SYNC_MIN_INTERVAL_MS", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _timers.DEFAULT_FOREGROUND_SYNC_MIN_INTERVAL_MS;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "DEFAULT_MESSAGES", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _messageKeys.DEFAULT_MESSAGES;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "DEFAULT_PRODUCT_CACHE_TTL_MS", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _timers.DEFAULT_PRODUCT_CACHE_TTL_MS;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "DEFAULT_PRODUCT_QUERY_TIMEOUT_MS", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _timers.DEFAULT_PRODUCT_QUERY_TIMEOUT_MS;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "DEFAULT_PURCHASE_LAUNCH_TIMEOUT_MS", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _timers.DEFAULT_PURCHASE_LAUNCH_TIMEOUT_MS;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "DEFAULT_RECONNECT_BACKOFF", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _timers.DEFAULT_RECONNECT_BACKOFF;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "DEFAULT_STALE_AFTER_MS", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _timers.DEFAULT_STALE_AFTER_MS;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "DEFAULT_SYNC_TIMEOUT_MS", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _timers.DEFAULT_SYNC_TIMEOUT_MS;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "DEFAULT_USER_MESSAGES", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _messageKeys.DEFAULT_USER_MESSAGES;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "DEVELOPER_MESSAGE_KEYS", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _messageKeys.DEVELOPER_MESSAGE_KEYS;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "FINALIZE_ATTEMPT_TIMEOUT_BOUNDS", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _timers.FINALIZE_ATTEMPT_TIMEOUT_BOUNDS;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "FOREGROUND_SYNC_MIN_INTERVAL_BOUNDS", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _timers.FOREGROUND_SYNC_MIN_INTERVAL_BOUNDS;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "PAYMENT_ERROR_CODES", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _errors.PAYMENT_ERROR_CODES;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "PRODUCT_CACHE_TTL_BOUNDS", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _timers.PRODUCT_CACHE_TTL_BOUNDS;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "PRODUCT_QUERY_TIMEOUT_BOUNDS", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _timers.PRODUCT_QUERY_TIMEOUT_BOUNDS;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "PURCHASE_LAUNCH_TIMEOUT_BOUNDS", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _timers.PURCHASE_LAUNCH_TIMEOUT_BOUNDS;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "PaymentConfigError", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _errors.PaymentConfigError;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "PaymentError", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _errors.PaymentError;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "PaymentProvider", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _PaymentProvider.PaymentProvider;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "STALE_AFTER_BOUNDS", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _timers.STALE_AFTER_BOUNDS;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "SYNC_TIMEOUT_BOUNDS", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _timers.SYNC_TIMEOUT_BOUNDS;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "USER_MESSAGE_KEYS", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _messageKeys.USER_MESSAGE_KEYS;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "createEngine", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _engine.createEngine;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "createStoreProvider", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _createStoreProvider.createStoreProvider;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "isUserMessageKey", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _messageKeys.isUserMessageKey;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "paymentMessages", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _messageKeys.paymentMessages;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "syncOnForeground", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _foreground.syncOnForeground;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "useEntitlement", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _hooks.useEntitlement;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "useEntitlements", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _hooks.useEntitlements;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "usePaymentEngine", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _PaymentProvider.usePaymentEngine;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "usePaymentStatus", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _hooks.usePaymentStatus;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "usePendingPurchases", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return _hooks.usePendingPurchases;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "useProducts", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _hooks.useProducts;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, "usePurchase", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return _hooks.usePurchase;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(exports, "useSync", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function () {
|
|
255
|
+
return _hooks.useSync;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
var _timers = require("./core/timers.js");
|
|
259
|
+
var _createStoreProvider = require("./adapter/createStoreProvider.js");
|
|
260
|
+
var _engine = require("./engine/engine.js");
|
|
261
|
+
var _foreground = require("./engine/foreground.js");
|
|
262
|
+
var _PaymentProvider = require("./react/PaymentProvider.js");
|
|
263
|
+
var _hooks = require("./react/hooks.js");
|
|
264
|
+
var _errors = require("./diagnostics/errors.js");
|
|
265
|
+
var _messageKeys = require("./diagnostics/messageKeys.js");
|
|
266
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_timers","require","_createStoreProvider","_engine","_foreground","_PaymentProvider","_hooks","_errors","_messageKeys"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,IAAAA,OAAA,GAAAC,OAAA;AAiDA,IAAAC,oBAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AAGA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAYA,IAAAM,OAAA,GAAAN,OAAA;AAYA,IAAAO,YAAA,GAAAP,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|