@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,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.attachEngineInternals = attachEngineInternals;
|
|
7
|
+
exports.engineInternals = engineInternals;
|
|
8
|
+
/**
|
|
9
|
+
* What tests and diagnostics need from an engine, off its public type (PAY-11).
|
|
10
|
+
*
|
|
11
|
+
* Until 0.6.0 these were methods of `PaymentEngine`, so any consumer could commit
|
|
12
|
+
* a snapshot of its own and grant itself an entitlement the store never sold,
|
|
13
|
+
* and a hand-written engine double had to implement all of them. They live in a
|
|
14
|
+
* WeakMap keyed by the engine now, and this module is not exported from the
|
|
15
|
+
* package entrypoint.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const registry = new WeakMap();
|
|
19
|
+
function attachEngineInternals(engine, internals) {
|
|
20
|
+
registry.set(engine, internals);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The internals of an engine `createEngine` made. Throws for any other object. */
|
|
24
|
+
function engineInternals(engine) {
|
|
25
|
+
const internals = registry.get(engine);
|
|
26
|
+
if (!internals) {
|
|
27
|
+
throw new Error('engineInternals: this engine was not created by createEngine');
|
|
28
|
+
}
|
|
29
|
+
return internals;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=internals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["registry","WeakMap","attachEngineInternals","engine","internals","set","engineInternals","get","Error"],"sourceRoot":"../../../src","sources":["engine/internals.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,MAAMA,QAAQ,GAAG,IAAIC,OAAO,CAAiC,CAAC;AAEvD,SAASC,qBAAqBA,CAACC,MAAqB,EAAEC,SAA0B,EAAQ;EAC9FJ,QAAQ,CAACK,GAAG,CAACF,MAAM,EAAEC,SAAS,CAAC;AAChC;;AAEA;AACO,SAASE,eAAeA,CAACH,MAAqB,EAAmB;EACvE,MAAMC,SAAS,GAAGJ,QAAQ,CAACO,GAAG,CAACJ,MAAM,CAAC;EACtC,IAAI,CAACC,SAAS,EAAE;IACf,MAAM,IAAII,KAAK,CAAC,8DAA8D,CAAC;EAChF;EACA,OAAOJ,SAAS;AACjB","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UNKNOWN_PENDING = void 0;
|
|
7
|
+
exports.derivePending = derivePending;
|
|
8
|
+
exports.pendingTransitions = pendingTransitions;
|
|
9
|
+
exports.samePending = samePending;
|
|
10
|
+
var _aggregate = require("../entitlements/aggregate.js");
|
|
11
|
+
/**
|
|
12
|
+
* The pending set, and how a pending purchase ends (FR-101 – FR-104), added in
|
|
13
|
+
* 0.2.0.
|
|
14
|
+
*
|
|
15
|
+
* 0.1.0 handled pending purchases correctly on the grant side — pending never
|
|
16
|
+
* grants, a settled one is granted at the next sync, an abandoned one is removed
|
|
17
|
+
* — but an app could only *see* one in the session it started in. The record
|
|
18
|
+
* was already persisted with a `pending` state; this module is the read side of
|
|
19
|
+
* it, and nothing more. It decides nothing about granting: that stays in
|
|
20
|
+
* `entitlements/aggregate.ts`, where pending is refused unconditionally.
|
|
21
|
+
*
|
|
22
|
+
* Pure: no provider, no I/O, no React. The engine calls it from `commit`.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const UNKNOWN_PENDING = exports.UNKNOWN_PENDING = {
|
|
26
|
+
status: 'unknown',
|
|
27
|
+
purchases: [],
|
|
28
|
+
isStale: false
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Derives the pending set from the snapshot.
|
|
33
|
+
*
|
|
34
|
+
* Read from the persisted record, so it survives an app kill and an offline
|
|
35
|
+
* restart, and judged by the very staleness rule entitlements use (FR-103).
|
|
36
|
+
* Products no longer in the catalog are left out: an app cannot render a row,
|
|
37
|
+
* or withhold a Buy button, for a product key it no longer has.
|
|
38
|
+
*/
|
|
39
|
+
function derivePending(input) {
|
|
40
|
+
const {
|
|
41
|
+
config,
|
|
42
|
+
snapshot
|
|
43
|
+
} = input;
|
|
44
|
+
const {
|
|
45
|
+
isStale,
|
|
46
|
+
undetermined
|
|
47
|
+
} = (0, _aggregate.snapshotCertainty)(input);
|
|
48
|
+
const earliest = new Map();
|
|
49
|
+
for (const purchase of snapshot.purchases) {
|
|
50
|
+
if (purchase.state !== 'pending' || !config.entries.has(purchase.productKey)) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const known = earliest.get(purchase.productKey);
|
|
54
|
+
if (known === undefined || purchase.purchasedAt < known) {
|
|
55
|
+
earliest.set(purchase.productKey, purchase.purchasedAt);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const purchases = [...earliest].map(([productKey, since]) => ({
|
|
59
|
+
productKey,
|
|
60
|
+
since
|
|
61
|
+
})).sort((a, b) => a.since - b.since || a.productKey.localeCompare(b.productKey));
|
|
62
|
+
return {
|
|
63
|
+
status: undetermined ? 'unknown' : 'known',
|
|
64
|
+
purchases,
|
|
65
|
+
isStale
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Every pending transaction that stopped being pending between two snapshots.
|
|
70
|
+
*
|
|
71
|
+
* Computed from the commit itself rather than at each call site that might end
|
|
72
|
+
* a pending purchase — sync, a store push, a purchase — which is what makes
|
|
73
|
+
* "exactly once" structural (FR-104, FR-079). A store push and a sync racing on
|
|
74
|
+
* one settling purchase both commit, but only the first commit sees it leave
|
|
75
|
+
* the pending set.
|
|
76
|
+
*
|
|
77
|
+
* A record that disappeared ended without payment. Why is the store's to say;
|
|
78
|
+
* when it says nothing, `cancelled` (see `PendingResolution`).
|
|
79
|
+
*/
|
|
80
|
+
function pendingTransitions(previous, next, config, endReason) {
|
|
81
|
+
const transitions = [];
|
|
82
|
+
for (const before of previous.purchases) {
|
|
83
|
+
if (before.state !== 'pending' || !config.entries.has(before.productKey)) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const after = next.purchases.find(p => p.transactionId === before.transactionId);
|
|
87
|
+
if (after?.state === 'pending') {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
transitions.push({
|
|
91
|
+
productKey: before.productKey,
|
|
92
|
+
outcome: after ? 'settled' : endReason(before.transactionId) ?? 'cancelled'
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return transitions;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Whether a listener has anything new to hear. */
|
|
99
|
+
function samePending(a, b) {
|
|
100
|
+
return a.status === b.status && a.isStale === b.isStale && a.purchases.length === b.purchases.length && a.purchases.every((purchase, index) => purchase.productKey === b.purchases[index].productKey && purchase.since === b.purchases[index].since);
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=pending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_aggregate","require","UNKNOWN_PENDING","exports","status","purchases","isStale","derivePending","input","config","snapshot","undetermined","snapshotCertainty","earliest","Map","purchase","state","entries","has","productKey","known","get","undefined","purchasedAt","set","map","since","sort","a","b","localeCompare","pendingTransitions","previous","next","endReason","transitions","before","after","find","p","transactionId","push","outcome","samePending","length","every","index"],"sourceRoot":"../../../src","sources":["engine/pending.ts"],"mappings":";;;;;;;;;AAsBA,IAAAA,UAAA,GAAAC,OAAA;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAMC,eAAsC,GAAAC,OAAA,CAAAD,eAAA,GAAG;EACrDE,MAAM,EAAE,SAAS;EACjBC,SAAS,EAAE,EAAE;EACbC,OAAO,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAACC,KAK7B,EAAyB;EACzB,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGF,KAAK;EAClC,MAAM;IAAEF,OAAO;IAAEK;EAAa,CAAC,GAAG,IAAAC,4BAAiB,EAACJ,KAAK,CAAC;EAE1D,MAAMK,QAAQ,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAC9C,KAAK,MAAMC,QAAQ,IAAIL,QAAQ,CAACL,SAAS,EAAE;IAC1C,IAAIU,QAAQ,CAACC,KAAK,KAAK,SAAS,IAAI,CAACP,MAAM,CAACQ,OAAO,CAACC,GAAG,CAACH,QAAQ,CAACI,UA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ChF,IAAIH,KAAK,EAAErB,KAAK,KAAK,SAAS,EAAE;MAC/B;IACD;IACAmB,WAAW,CAACM,IAAI,CAAC;MAChBtB,UAAU,EAAEiB,MAAM,CAACjB,UAAU;MAC7BuB,OAAO,EAAEL,KAAK,GAAG,SAAS,GAAIH,SAAS,CAACE,MAAM,CAACI,aAAa,CAAC,IAAI;IAClE,CAAC,CAAC;EACH;EACA,OAAOL,WAAW;AACnB;;AAEA;AACO,SAASQ,WAAWA,CAACf,CAAwB,EAAEC,CAAwB,EAAW;EACxF,OACCD,CAAC,CAACxB,MAAM,KAAKyB,CAAC,CAACzB,MAAM,IACrBwB,CAAC,CAACtB,OAAO,KAAKuB,CAAC,CAACvB,OAAO,IACvBsB,CAAC,CAACvB,SAAS,CAACuC,MAAM,KAAKf,CAAC,CAACxB,SAAS,CAACuC,MAAM,IACzChB,CAAC,CAACvB,SAAS,CAACwC,KAAK,CAChB,CAAC9B,QAAQ,EAAE+B,KAAK,KACf/B,QAAQ,CAACI,UAAU,KAAKU,CAAC,CAACxB,SAAS,CAACyC,KAAK,CAAC,CAAC3B,UAAU,IACrDJ,QAAQ,CAACW,KAAK,KAAKG,CAAC,CAACxB,SAAS,CAACyC,KAAK,CAAC,CAACpB,KACxC,CAAC;AAEH","ignoreList":[]}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createProducts = createProducts;
|
|
7
|
+
var _errors = require("../diagnostics/errors.js");
|
|
8
|
+
var _mutex = require("../core/mutex.js");
|
|
9
|
+
var _mapping = require("../entitlements/mapping.js");
|
|
10
|
+
/**
|
|
11
|
+
* Product query, normalization, and the in-memory price cache (US11).
|
|
12
|
+
*
|
|
13
|
+
* Two rules shape this module:
|
|
14
|
+
*
|
|
15
|
+
* - **Prices come from the store, formatted.** An app must never build a price
|
|
16
|
+
* string (FR-028): only the store knows the right currency symbol, its
|
|
17
|
+
* placement, the decimal separator, and the grouping for the user's locale. A
|
|
18
|
+
* hand-built "$9.99" is wrong in most of the world.
|
|
19
|
+
* - **Offer eligibility is reported, never computed.** The store decides who
|
|
20
|
+
* qualifies for a trial or an introductory price (FR-026). Guessing locally
|
|
21
|
+
* would promise a trial the store then refuses at checkout.
|
|
22
|
+
*
|
|
23
|
+
* The cache is in **memory only** and short-lived. Persisting prices would risk
|
|
24
|
+
* showing a stale one as current in a later session, and a paywall is exactly
|
|
25
|
+
* where that matters.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Why a requested product produced nothing, kept distinct from a network error. */
|
|
29
|
+
|
|
30
|
+
function normalize(raw, productKey, productType) {
|
|
31
|
+
return {
|
|
32
|
+
productKey,
|
|
33
|
+
productType,
|
|
34
|
+
title: raw.title,
|
|
35
|
+
description: raw.description,
|
|
36
|
+
formattedPrice: raw.formattedPrice,
|
|
37
|
+
currencyCode: raw.currencyCode,
|
|
38
|
+
priceAmountMicros: raw.priceAmountMicros,
|
|
39
|
+
offers: raw.offers.map(offer => ({
|
|
40
|
+
offerKey: offer.offerKey,
|
|
41
|
+
billingPeriod: offer.billingPeriod,
|
|
42
|
+
formattedPrice: offer.formattedPrice,
|
|
43
|
+
priceAmountMicros: offer.priceAmountMicros,
|
|
44
|
+
currencyCode: offer.currencyCode,
|
|
45
|
+
trialPeriod: offer.trialPeriod,
|
|
46
|
+
introductoryPrice: offer.introductoryPrice,
|
|
47
|
+
isEligible: offer.isEligible
|
|
48
|
+
}))
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function createProducts(deps) {
|
|
52
|
+
const {
|
|
53
|
+
resolved
|
|
54
|
+
} = deps;
|
|
55
|
+
const cache = new Map();
|
|
56
|
+
const isFresh = entry => deps.now() - entry.cachedAt < resolved.productCacheTtlMs;
|
|
57
|
+
const query = async (productKeys, useCache) => {
|
|
58
|
+
const missing = [];
|
|
59
|
+
const resolvedProducts = [];
|
|
60
|
+
const toFetch = [];
|
|
61
|
+
for (const productKey of productKeys) {
|
|
62
|
+
const entry = resolved.entries.get(productKey);
|
|
63
|
+
const storeProductId = (0, _mapping.storeIdForProductKey)(resolved, productKey);
|
|
64
|
+
if (!entry || !storeProductId) {
|
|
65
|
+
// A configuration problem, not a store one. Distinguishing them tells a
|
|
66
|
+
// developer whether to fix the catalog or check Play Console.
|
|
67
|
+
missing.push({
|
|
68
|
+
productKey,
|
|
69
|
+
reason: 'not_in_catalog'
|
|
70
|
+
});
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const cached = useCache ? cache.get(productKey) : undefined;
|
|
74
|
+
if (cached && isFresh(cached)) {
|
|
75
|
+
resolvedProducts.push(cached.product);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
toFetch.push({
|
|
79
|
+
productKey,
|
|
80
|
+
storeProductId,
|
|
81
|
+
productType: entry.productType
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (toFetch.length === 0) {
|
|
85
|
+
deps.emit({
|
|
86
|
+
type: 'products_queried',
|
|
87
|
+
productKeys,
|
|
88
|
+
found: resolvedProducts.length,
|
|
89
|
+
missing: missing.map(m => m.productKey),
|
|
90
|
+
fromCache: true
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
ok: true,
|
|
94
|
+
products: resolvedProducts,
|
|
95
|
+
missing,
|
|
96
|
+
fromCache: true
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Grouped by product type because the store queries in-app products and
|
|
101
|
+
// subscriptions through separate calls.
|
|
102
|
+
const byType = new Map();
|
|
103
|
+
for (const item of toFetch) {
|
|
104
|
+
const list = byType.get(item.productType) ?? [];
|
|
105
|
+
list.push(item);
|
|
106
|
+
byType.set(item.productType, list);
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
// In parallel: a paywall offering a subscription and a one-time purchase
|
|
110
|
+
// used to wait for one store round-trip after the other (PAY-20).
|
|
111
|
+
const groups = await Promise.all([...byType].map(async ([productType, items]) => ({
|
|
112
|
+
items,
|
|
113
|
+
raw: await (0, _mutex.withTimeout)(deps.provider.queryProducts(items.map(i => i.storeProductId), productType), resolved.timeouts.productQueryMs, () => new _errors.PaymentError({
|
|
114
|
+
code: 'PAYMENT_TIMEOUT',
|
|
115
|
+
message: 'Querying products timed out',
|
|
116
|
+
operation: 'getProducts',
|
|
117
|
+
retryable: true
|
|
118
|
+
}))
|
|
119
|
+
})));
|
|
120
|
+
for (const {
|
|
121
|
+
items,
|
|
122
|
+
raw
|
|
123
|
+
} of groups) {
|
|
124
|
+
const returned = new Map(raw.map(p => [p.storeProductId, p]));
|
|
125
|
+
for (const item of items) {
|
|
126
|
+
const found = returned.get(item.storeProductId);
|
|
127
|
+
if (!found) {
|
|
128
|
+
// The store knows the id but will not sell it here: unapproved, or
|
|
129
|
+
// not available in this country. Never conflated with a network
|
|
130
|
+
// failure (FR-027).
|
|
131
|
+
missing.push({
|
|
132
|
+
productKey: item.productKey,
|
|
133
|
+
reason: 'not_available_from_store'
|
|
134
|
+
});
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const product = normalize(found, item.productKey, item.productType);
|
|
138
|
+
cache.set(item.productKey, {
|
|
139
|
+
product,
|
|
140
|
+
cachedAt: deps.now()
|
|
141
|
+
});
|
|
142
|
+
resolvedProducts.push(product);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} catch (error) {
|
|
146
|
+
const paymentError = error instanceof _errors.PaymentError ? error : new _errors.PaymentError({
|
|
147
|
+
code: 'PAYMENT_NETWORK_ERROR',
|
|
148
|
+
message: 'Could not reach the store to query products',
|
|
149
|
+
operation: 'getProducts',
|
|
150
|
+
retryable: true
|
|
151
|
+
});
|
|
152
|
+
deps.emit({
|
|
153
|
+
type: 'internal_error',
|
|
154
|
+
code: paymentError.code,
|
|
155
|
+
operation: 'getProducts'
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
ok: false,
|
|
159
|
+
error: paymentError
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
deps.emit({
|
|
163
|
+
type: 'products_queried',
|
|
164
|
+
productKeys,
|
|
165
|
+
found: resolvedProducts.length,
|
|
166
|
+
missing: missing.map(m => m.productKey),
|
|
167
|
+
fromCache: false
|
|
168
|
+
});
|
|
169
|
+
return {
|
|
170
|
+
ok: true,
|
|
171
|
+
products: resolvedProducts,
|
|
172
|
+
missing,
|
|
173
|
+
fromCache: false
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Identical requests in flight share one store call (PAY-20): several screens
|
|
179
|
+
* mounting `useProducts` for the same paywall ask once.
|
|
180
|
+
*/
|
|
181
|
+
const flights = new Map();
|
|
182
|
+
const joined = (productKeys, useCache) => {
|
|
183
|
+
const key = `${useCache ? 'get' : 'refresh'}:${productKeys.join('|')}`;
|
|
184
|
+
const running = flights.get(key);
|
|
185
|
+
if (running) {
|
|
186
|
+
return running;
|
|
187
|
+
}
|
|
188
|
+
const promise = query(productKeys, useCache).finally(() => flights.delete(key));
|
|
189
|
+
flights.set(key, promise);
|
|
190
|
+
return promise;
|
|
191
|
+
};
|
|
192
|
+
return {
|
|
193
|
+
get: productKeys => joined(productKeys, true),
|
|
194
|
+
refresh: productKeys => joined(productKeys, false),
|
|
195
|
+
invalidate: () => cache.clear()
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","require","_mutex","_mapping","normalize","raw","productKey","productType","title","description","formattedPrice","currencyCode","priceAmountMicros","offers","map","offer","offerKey","billingPeriod","trialPeriod","introductoryPrice","isEligible","createProducts","deps","resolved","cache","Map","isFresh","entry","now","cachedAt","productCacheTtlMs","query","productKeys","useCache","missing","resolvedProducts","toFetch","entries","get","storeProductId","storeIdForProductKey","push","reason","cached","undefined","product","length","emit","type","found","m","fromCache","ok","products","byType","item","list","set","groups","Promise","all","items","withTimeout","provider","queryProducts","i","timeouts","productQueryMs","PaymentError","code","message","operation","retryable","returned","p","error","paymentError","flights","joined","key","join","running","promise","finally","delete","refresh","invalidate","clear"],"sourceRoot":"../../../src","sources":["engine/products.ts"],"mappings":";;;;;;AAqBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuCA;;AAyCA,SAASG,SAASA,CACjBC,GAAoB,EACpBC,UAAsB,EACtBC,WAAwB,EACV;EACd,OAAO;IACND,UAAU;IACVC,WAAW;IACXC,KAAK,EAAEH,GAAG,CAACG,KAAK;IAChBC,WAAW,EAAEJ,GAAG,CAACI,WAAW;IAC5BC,cAAc,EAAEL,GAAG,CAACK,cAAc;IAClCC,YAAY,EAAEN,GAAG,CAACM,YAAY;IAC9BC,iBAAiB,EAAEP,GAAG,CAACO,iBAAiB;IACxCC,MAAM,EAAER,GAAG,CAACQ,MAAM,CAACC,GAAG,CAACC,KAAK,KAAK;MAChCC,QAAQ,EAAED,KAAK,CAACC,QAAQ;MACxBC,aAAa,EAAEF,KAAK,CAACE,aAAa;MAClCP,cAAc,EAAEK,KAAK,CAACL,cAAc;MACpCE,iBAAiB,EAAEG,KAAK,CAACH,iBAAiB;MAC1CD,YAAY,EAAEI,KAAK,CAACJ,YAAY;MAChCO,WAAW,EAAEH,KAAK,CAACG,WAAW;MAC9BC,iBAAiB,EAAEJ,KAAK,CAACI,iBAAiB;MAC1CC,UAAU,EAAEL,KAAK,CAACK;IACnB,CAAC,CAAC;EACH,CAAC;AACF;AAEO,SAASC,cAAcA,CAACC,IAAkB,EAAY;EAC5D,MAAM;IAAEC;EAAS,CAAC,GAAGD,IAAI;EACzB,MAAME,KAAK,GAAG,IAAI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