@rocapine/react-native-onboarding 1.73.0 → 1.74.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 +136 -3
- package/dist/OnboardingStudio.d.ts +82 -0
- package/dist/OnboardingStudio.d.ts.map +1 -0
- package/dist/OnboardingStudio.js +91 -0
- package/dist/OnboardingStudio.js.map +1 -0
- package/dist/OnboardingStudioClient.d.ts +14 -5
- package/dist/OnboardingStudioClient.d.ts.map +1 -1
- package/dist/OnboardingStudioClient.js +24 -9
- package/dist/OnboardingStudioClient.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -4
- package/dist/index.js.map +1 -1
- package/dist/infra/provider/OnboardingProvider.d.ts +11 -2
- package/dist/infra/provider/OnboardingProvider.d.ts.map +1 -1
- package/dist/infra/provider/OnboardingProvider.js +26 -2
- package/dist/infra/provider/OnboardingProvider.js.map +1 -1
- package/dist/infra/queries/cacheKey.d.ts +41 -3
- package/dist/infra/queries/cacheKey.d.ts.map +1 -1
- package/dist/infra/queries/cacheKey.js +44 -8
- package/dist/infra/queries/cacheKey.js.map +1 -1
- package/dist/infra/queries/getOnboarding.query.d.ts.map +1 -1
- package/dist/infra/queries/getOnboarding.query.js +6 -1
- package/dist/infra/queries/getOnboarding.query.js.map +1 -1
- package/dist/paywalls/PaywallProvider.d.ts +52 -4
- package/dist/paywalls/PaywallProvider.d.ts.map +1 -1
- package/dist/paywalls/PaywallProvider.js +105 -7
- package/dist/paywalls/PaywallProvider.js.map +1 -1
- package/dist/paywalls/catalogSettleWaiter.d.ts +31 -0
- package/dist/paywalls/catalogSettleWaiter.d.ts.map +1 -0
- package/dist/paywalls/catalogSettleWaiter.js +58 -0
- package/dist/paywalls/catalogSettleWaiter.js.map +1 -0
- package/dist/paywalls/getPaywalls.query.d.ts.map +1 -1
- package/dist/paywalls/getPaywalls.query.js +6 -1
- package/dist/paywalls/getPaywalls.query.js.map +1 -1
- package/dist/paywalls/register.d.ts +105 -0
- package/dist/paywalls/register.d.ts.map +1 -0
- package/dist/paywalls/register.js +112 -0
- package/dist/paywalls/register.js.map +1 -0
- package/dist/paywalls/usePaywall.d.ts +29 -0
- package/dist/paywalls/usePaywall.d.ts.map +1 -1
- package/dist/paywalls/usePaywall.js +2 -1
- package/dist/paywalls/usePaywall.js.map +1 -1
- package/dist/userProperties/applyPatch.d.ts +18 -0
- package/dist/userProperties/applyPatch.d.ts.map +1 -0
- package/dist/userProperties/applyPatch.js +57 -0
- package/dist/userProperties/applyPatch.js.map +1 -0
- package/dist/userProperties/effectiveParams.d.ts +29 -0
- package/dist/userProperties/effectiveParams.d.ts.map +1 -0
- package/dist/userProperties/effectiveParams.js +56 -0
- package/dist/userProperties/effectiveParams.js.map +1 -0
- package/dist/userProperties/index.d.ts +9 -0
- package/dist/userProperties/index.d.ts.map +1 -0
- package/dist/userProperties/index.js +21 -0
- package/dist/userProperties/index.js.map +1 -0
- package/dist/userProperties/reserved.d.ts +33 -0
- package/dist/userProperties/reserved.d.ts.map +1 -0
- package/dist/userProperties/reserved.js +45 -0
- package/dist/userProperties/reserved.js.map +1 -0
- package/dist/userProperties/serialize.d.ts +38 -0
- package/dist/userProperties/serialize.d.ts.map +1 -0
- package/dist/userProperties/serialize.js +67 -0
- package/dist/userProperties/serialize.js.map +1 -0
- package/dist/userProperties/store.d.ts +63 -0
- package/dist/userProperties/store.d.ts.map +1 -0
- package/dist/userProperties/store.js +153 -0
- package/dist/userProperties/store.js.map +1 -0
- package/dist/userProperties/types.d.ts +21 -0
- package/dist/userProperties/types.d.ts.map +1 -0
- package/dist/userProperties/types.js +3 -0
- package/dist/userProperties/types.js.map +1 -0
- package/dist/userProperties/useUserProperties.d.ts +20 -0
- package/dist/userProperties/useUserProperties.d.ts.map +1 -0
- package/dist/userProperties/useUserProperties.js +30 -0
- package/dist/userProperties/useUserProperties.js.map +1 -0
- package/package.json +1 -1
- package/src/OnboardingStudio.ts +147 -0
- package/src/OnboardingStudioClient.ts +27 -11
- package/src/__tests__/OnboardingStudio.test.ts +208 -0
- package/src/__tests__/cacheKey.test.ts +71 -0
- package/src/__tests__/getOnboarding.query.test.ts +47 -8
- package/src/index.ts +43 -0
- package/src/infra/provider/OnboardingProvider.tsx +45 -4
- package/src/infra/queries/cacheKey.ts +54 -9
- package/src/infra/queries/getOnboarding.query.ts +9 -1
- package/src/paywalls/PaywallProvider.tsx +162 -6
- package/src/paywalls/__tests__/catalogSettleWaiter.test.ts +134 -0
- package/src/paywalls/__tests__/getPaywalls.test.ts +29 -11
- package/src/paywalls/__tests__/register.test.ts +266 -0
- package/src/paywalls/catalogSettleWaiter.ts +72 -0
- package/src/paywalls/getPaywalls.query.ts +9 -1
- package/src/paywalls/register.ts +169 -0
- package/src/paywalls/usePaywall.ts +40 -2
- package/src/userProperties/__tests__/effectiveParams.test.ts +51 -0
- package/src/userProperties/__tests__/primitives.test.ts +96 -0
- package/src/userProperties/__tests__/store.test.ts +181 -0
- package/src/userProperties/applyPatch.ts +68 -0
- package/src/userProperties/effectiveParams.ts +60 -0
- package/src/userProperties/index.ts +11 -0
- package/src/userProperties/reserved.ts +44 -0
- package/src/userProperties/serialize.ts +61 -0
- package/src/userProperties/store.ts +177 -0
- package/src/userProperties/types.ts +22 -0
- package/src/userProperties/useUserProperties.ts +26 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaywallProvider.js","sourceRoot":"","sources":["../../src/paywalls/PaywallProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAAqG;AACrG,uDAAmF;AAEnF,2DAAuD;AAEvD,uCAYmB;AACnB,yDAAsD;AAEtD,6EAA0E;AAI1E,+EAA+E;AAC/E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,iEAAiE;AACjE,yDAAyD;AACzD,gCAAgC;AAChC,MAAM,kBAAkB,GAAG,IAAI,yBAAW,CAAC;IACzC,cAAc,EAAE;QACd,OAAO,E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M;YAAE,OAAO;QACnB,OAAO,CAAC,IAAI,CAAC,GAAG,yCAAsB,iCAAiC,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,iDAAiD;IACjD,IAAI,CAAC,MAAM;QAAE,OAAO,2DAAG,QAAQ,GAAI,CAAC;IAEpC,OAAO,CACL,uBAAC,iCAAmB,IAAC,MAAM,EAAE,kBAAkB,YAC7C,uBAAC,oBAAoB,IACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,oBAAoB,EAC1C,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,iBAAiB,EAAE,iBAAiB,YAEnC,QAAQ,GACY,GACH,CACvB,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,eAAe,mBA2C1B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parks `register()` callers while the paywall catalog is still loading, and
|
|
3
|
+
* wakes them when it settles or when their own timeout elapses.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `PaywallProvider` — rather than written inline over a couple of
|
|
6
|
+
* refs — because it has two invariants that are easy to get wrong and impossible
|
|
7
|
+
* to assert from inside a component without a DOM (this repo's tests run in
|
|
8
|
+
* vitest's default `node` environment):
|
|
9
|
+
*
|
|
10
|
+
* 1. **A waiter resolves exactly once.** A timeout can fire after a real settle
|
|
11
|
+
* already woke the waiter. Resolving a Promise twice is harmless in itself,
|
|
12
|
+
* but the bookkeeping around it is not — a stale entry left in the set would
|
|
13
|
+
* be woken by the NEXT settle, running a continuation that belongs to nobody.
|
|
14
|
+
* 2. **Draining must not skip a re-parked waiter.** A woken caller's continuation
|
|
15
|
+
* may call `register()` again and park immediately; mutating the set while
|
|
16
|
+
* iterating it would either miss that new waiter or loop over it. So the set
|
|
17
|
+
* is swapped out before it is drained.
|
|
18
|
+
*
|
|
19
|
+
* The timer is injected so both invariants are testable without real time.
|
|
20
|
+
*/
|
|
21
|
+
/** Cancels the scheduled callback. */
|
|
22
|
+
export type ScheduleCancel = () => void;
|
|
23
|
+
export type Schedule = (fn: () => void, ms: number) => ScheduleCancel;
|
|
24
|
+
export type CatalogSettleWaiter = {
|
|
25
|
+
/** Resolves when the catalog stops loading, or after `timeoutMs`. */
|
|
26
|
+
wait: (timeoutMs: number) => Promise<void>;
|
|
27
|
+
/** Wakes every parked waiter. Called when the catalog status leaves "loading". */
|
|
28
|
+
settle: () => void;
|
|
29
|
+
};
|
|
30
|
+
export declare const createCatalogSettleWaiter: (isLoading: () => boolean, schedule?: Schedule) => CatalogSettleWaiter;
|
|
31
|
+
//# sourceMappingURL=catalogSettleWaiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogSettleWaiter.d.ts","sourceRoot":"","sources":["../../src/paywalls/catalogSettleWaiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC;AACxC,MAAM,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,cAAc,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,qEAAqE;IACrE,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,kFAAkF;IAClF,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAOF,eAAO,MAAM,yBAAyB,GACpC,WAAW,MAAM,OAAO,EACxB,WAAU,QAA0B,KACnC,mBA+BF,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Parks `register()` callers while the paywall catalog is still loading, and
|
|
4
|
+
* wakes them when it settles or when their own timeout elapses.
|
|
5
|
+
*
|
|
6
|
+
* Extracted from `PaywallProvider` — rather than written inline over a couple of
|
|
7
|
+
* refs — because it has two invariants that are easy to get wrong and impossible
|
|
8
|
+
* to assert from inside a component without a DOM (this repo's tests run in
|
|
9
|
+
* vitest's default `node` environment):
|
|
10
|
+
*
|
|
11
|
+
* 1. **A waiter resolves exactly once.** A timeout can fire after a real settle
|
|
12
|
+
* already woke the waiter. Resolving a Promise twice is harmless in itself,
|
|
13
|
+
* but the bookkeeping around it is not — a stale entry left in the set would
|
|
14
|
+
* be woken by the NEXT settle, running a continuation that belongs to nobody.
|
|
15
|
+
* 2. **Draining must not skip a re-parked waiter.** A woken caller's continuation
|
|
16
|
+
* may call `register()` again and park immediately; mutating the set while
|
|
17
|
+
* iterating it would either miss that new waiter or loop over it. So the set
|
|
18
|
+
* is swapped out before it is drained.
|
|
19
|
+
*
|
|
20
|
+
* The timer is injected so both invariants are testable without real time.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.createCatalogSettleWaiter = void 0;
|
|
24
|
+
const defaultSchedule = (fn, ms) => {
|
|
25
|
+
const timer = setTimeout(fn, ms);
|
|
26
|
+
return () => clearTimeout(timer);
|
|
27
|
+
};
|
|
28
|
+
const createCatalogSettleWaiter = (isLoading, schedule = defaultSchedule) => {
|
|
29
|
+
let waiters = new Set();
|
|
30
|
+
return {
|
|
31
|
+
wait: (timeoutMs) => new Promise((resolve) => {
|
|
32
|
+
// Nothing to wait for — do not allocate a timer or an entry.
|
|
33
|
+
if (!isLoading())
|
|
34
|
+
return resolve();
|
|
35
|
+
let settled = false;
|
|
36
|
+
let cancelTimer = () => { };
|
|
37
|
+
const finish = () => {
|
|
38
|
+
if (settled)
|
|
39
|
+
return; // invariant 1
|
|
40
|
+
settled = true;
|
|
41
|
+
waiters.delete(finish);
|
|
42
|
+
cancelTimer();
|
|
43
|
+
resolve();
|
|
44
|
+
};
|
|
45
|
+
waiters.add(finish);
|
|
46
|
+
cancelTimer = schedule(finish, timeoutMs);
|
|
47
|
+
}),
|
|
48
|
+
settle: () => {
|
|
49
|
+
// Swapped before draining — invariant 2.
|
|
50
|
+
const parked = waiters;
|
|
51
|
+
waiters = new Set();
|
|
52
|
+
for (const wake of parked)
|
|
53
|
+
wake();
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.createCatalogSettleWaiter = createCatalogSettleWaiter;
|
|
58
|
+
//# sourceMappingURL=catalogSettleWaiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogSettleWaiter.js","sourceRoot":"","sources":["../../src/paywalls/catalogSettleWaiter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAaH,MAAM,eAAe,GAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;AAEK,MAAM,yBAAyB,GAAG,CACvC,SAAwB,EACxB,WAAqB,eAAe,EACf,EAAE;IACvB,IAAI,OAAO,GAAG,IAAI,GAAG,EAAc,CAAC;IAEpC,OAAO;QACL,IAAI,EAAE,CAAC,SAAS,EAAE,EAAE,CAClB,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC5B,6DAA6D;YAC7D,IAAI,CAAC,SAAS,EAAE;gBAAE,OAAO,OAAO,EAAE,CAAC;YAEnC,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,WAAW,GAAmB,GAAG,EAAE,GAAE,CAAC,CAAC;YAE3C,MAAM,MAAM,GAAG,GAAG,EAAE;gBAClB,IAAI,OAAO;oBAAE,OAAO,CAAC,cAAc;gBACnC,OAAO,GAAG,IAAI,CAAC;gBACf,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACvB,WAAW,EAAE,CAAC;gBACd,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACpB,WAAW,GAAG,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEJ,MAAM,EAAE,GAAG,EAAE;YACX,yCAAyC;YACzC,MAAM,MAAM,GAAG,OAAO,CAAC;YACvB,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;YACpB,KAAK,MAAM,IAAI,IAAI,MAAM;gBAAE,IAAI,EAAE,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,yBAAyB,6BAkCpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPaywalls.query.d.ts","sourceRoot":"","sources":["../../src/paywalls/getPaywalls.query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"getPaywalls.query.d.ts","sourceRoot":"","sources":["../../src/paywalls/getPaywalls.query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,sBAAsB,EAC9B,QAAQ,MAAM,EACd,sBAAsB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzC,cAAc,WAAW;;mBAcJ,OAAO,CAAC,cAAc,CAAC;;CA6E7C,CAAC"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getPaywallsQuery = void 0;
|
|
7
7
|
const async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
|
|
8
8
|
const cacheKey_1 = require("../infra/queries/cacheKey");
|
|
9
|
+
const serialize_1 = require("../userProperties/serialize");
|
|
9
10
|
/**
|
|
10
11
|
* Mirrors `getOnboarding.query.ts`'s cache-first / background-revalidate /
|
|
11
12
|
* custom-key behaviour exactly (same `staleTime: Infinity`, same
|
|
@@ -53,7 +54,11 @@ const getPaywallsQuery = (client, locale, customAudienceParams, queryClient) =>
|
|
|
53
54
|
// with NO background revalidation, so a pinned version survives across
|
|
54
55
|
// launches. The default key keeps stale-while-revalidate.
|
|
55
56
|
const hasCustomKey = Boolean(client.options.cacheKey);
|
|
56
|
-
|
|
57
|
+
// Scoped by the resolved audience params — see `cacheKey.ts`. This is what
|
|
58
|
+
// makes `catalogStatus: "revalidating"` mean "a genuine freshness refresh"
|
|
59
|
+
// rather than "this catalog may have been resolved under other params",
|
|
60
|
+
// which `register()`'s decision relies on.
|
|
61
|
+
const cacheKey = (0, cacheKey_1.getPaywallsCacheKey)(client.options.cacheKey, (0, serialize_1.paramsHash)(customAudienceParams));
|
|
57
62
|
// Fetches the live catalog, caches it, and pushes it into the query
|
|
58
63
|
// cache directly — see the module doc above for why that push is
|
|
59
64
|
// needed even though `queryFn`'s own return value already becomes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPaywalls.query.js","sourceRoot":"","sources":["../../src/paywalls/getPaywalls.query.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAqE;AAIrE,wDAAgE;
|
|
1
|
+
{"version":3,"file":"getPaywalls.query.js","sourceRoot":"","sources":["../../src/paywalls/getPaywalls.query.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAqE;AAIrE,wDAAgE;AAChE,2DA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AACJ,CAAC,CAAC;AA/FW,QAAA,gBAAgB,oBA+F3B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Paywall, PaywallCatalog, PresentResult } from "./types";
|
|
2
|
+
import type { CatalogStatus } from "./present";
|
|
3
|
+
/** The feature `register` gates. May be async; `register` awaits it. */
|
|
4
|
+
export type RegisterFeature = () => void | Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* What `register(moment, feature)` should do, as a pure function of current
|
|
7
|
+
* state — extracted for the same reason `resolvePresentDecision` and
|
|
8
|
+
* `shouldAdvanceOnComplete` are: every branch on a monetisation path gets an
|
|
9
|
+
* importable test rather than inspection.
|
|
10
|
+
*/
|
|
11
|
+
export type RegisterDecision = {
|
|
12
|
+
type: "run";
|
|
13
|
+
reason: "no-paywall" | "catalog-unavailable";
|
|
14
|
+
} | {
|
|
15
|
+
type: "present";
|
|
16
|
+
paywall: Paywall;
|
|
17
|
+
} | {
|
|
18
|
+
type: "wait";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* `wait` is a DECISION rather than something the caller infers from
|
|
22
|
+
* `catalogStatus` itself, so "when may register block?" has exactly one answer in
|
|
23
|
+
* one tested place. The caller awaits the catalog settling and calls this again;
|
|
24
|
+
* the second call cannot return `wait`, because the wait resolves only on
|
|
25
|
+
* `"ready"`/`"error"` and a timeout is treated as `catalog-unavailable` without
|
|
26
|
+
* asking again.
|
|
27
|
+
*
|
|
28
|
+
* `"revalidating"` counts as usable. That is safe only because the AsyncStorage
|
|
29
|
+
* cache key is scoped by audience params: before that, a revalidating catalog
|
|
30
|
+
* might have been resolved under DIFFERENT params, so a missing moment could
|
|
31
|
+
* mean "not yet" rather than "absent". Now a served catalog always matches the
|
|
32
|
+
* current params.
|
|
33
|
+
*/
|
|
34
|
+
export declare const resolveRegisterDecision: (catalog: PaywallCatalog | null, catalogStatus: CatalogStatus, moment: string) => RegisterDecision;
|
|
35
|
+
/**
|
|
36
|
+
* Whether a completed presentation unlocks the feature. Only a purchase does.
|
|
37
|
+
*
|
|
38
|
+
* This one-liner is correct only because `resolvePresentedOutcome` already
|
|
39
|
+
* upgraded the generic `{status:"dismissed"}` that the canonical authoring shape
|
|
40
|
+
* — `{type:"purchase", onSuccess:[{type:"dismiss"}]}` — produces into
|
|
41
|
+
* `"purchased"` when the store actually charged. Without that upgrade this would
|
|
42
|
+
* refuse the feature to every user who bought.
|
|
43
|
+
*
|
|
44
|
+
* **A Stripe paywall never unlocks on the purchase alone.** `PresentResult` has
|
|
45
|
+
* no `"pending"` status — that belongs to `PurchaseResult` — so a Payment Link
|
|
46
|
+
* checkout surfaces here as whatever its action list reported, in practice
|
|
47
|
+
* `"dismissed"` via its `onPending` branch. The entitlement arrives out-of-band
|
|
48
|
+
* through RevenueCat, so grant access from that webhook rather than from
|
|
49
|
+
* `register`. `runRegister` warns when it is about to present one.
|
|
50
|
+
*/
|
|
51
|
+
export declare const shouldRunFeature: (outcome: PresentResult) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* What `register` resolves to.
|
|
54
|
+
*
|
|
55
|
+
* Returned rather than fire-and-forget so a host can measure how often it ran
|
|
56
|
+
* ungated: `reason: "catalog-unavailable"` is the rate at which failing open is
|
|
57
|
+
* giving features away, and a host that cannot see that number cannot decide
|
|
58
|
+
* whether the default is right for it.
|
|
59
|
+
*/
|
|
60
|
+
export type RegisterResult = {
|
|
61
|
+
ran: true;
|
|
62
|
+
presented: false;
|
|
63
|
+
reason: "no-paywall" | "catalog-unavailable";
|
|
64
|
+
} | {
|
|
65
|
+
ran: true;
|
|
66
|
+
presented: true;
|
|
67
|
+
reason: "purchased";
|
|
68
|
+
outcome: PresentResult;
|
|
69
|
+
} | {
|
|
70
|
+
ran: false;
|
|
71
|
+
presented: true;
|
|
72
|
+
reason: "not-purchased";
|
|
73
|
+
outcome: PresentResult;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Everything `register` reads from its environment, injected.
|
|
77
|
+
*
|
|
78
|
+
* The catalog and its status are read through GETTERS rather than passed by value
|
|
79
|
+
* because `register` may await a wait in the middle: reading them once up front
|
|
80
|
+
* would decide against a catalog that has since arrived, which is the entire
|
|
81
|
+
* point of waiting.
|
|
82
|
+
*/
|
|
83
|
+
export type RegisterDeps = {
|
|
84
|
+
getCatalog: () => PaywallCatalog | null;
|
|
85
|
+
getCatalogStatus: () => CatalogStatus;
|
|
86
|
+
/** Resolves when the catalog stops loading, or after `timeoutMs`. */
|
|
87
|
+
waitForCatalogSettled: (timeoutMs: number) => Promise<void>;
|
|
88
|
+
present: (moment: string) => Promise<PresentResult>;
|
|
89
|
+
timeoutMs: number;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* `register(moment, feature)`'s whole orchestration.
|
|
93
|
+
*
|
|
94
|
+
* Lives here rather than inside `PaywallProvider` so every branch — both
|
|
95
|
+
* fail-open paths, the wait-once rule, the Stripe warning, and the
|
|
96
|
+
* withhold-on-dismiss case — is covered by a plain async test. This repo has no
|
|
97
|
+
* vitest config, so tests run without a DOM; a provider-rendering test would mean
|
|
98
|
+
* adding jsdom to assert control flow that has nothing to do with rendering.
|
|
99
|
+
*
|
|
100
|
+
* It delegates presentation to the injected `present`, which in the provider is
|
|
101
|
+
* the real one — so the wedge recovery, the purchase-generation race guard and
|
|
102
|
+
* outcome reconciliation all apply unchanged.
|
|
103
|
+
*/
|
|
104
|
+
export declare const runRegister: (deps: RegisterDeps, moment: string, feature?: RegisterFeature) => Promise<RegisterResult>;
|
|
105
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/paywalls/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,wEAAwE;AACxE,MAAM,MAAM,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AAM,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,YAAY,EAClB,QAAQ,MAAM,EACd,UAAU,eAAe,KACxB,OAAO,CAAC,cAAc,CAoDxB,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runRegister = exports.shouldRunFeature = exports.resolveRegisterDecision = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `wait` is a DECISION rather than something the caller infers from
|
|
6
|
+
* `catalogStatus` itself, so "when may register block?" has exactly one answer in
|
|
7
|
+
* one tested place. The caller awaits the catalog settling and calls this again;
|
|
8
|
+
* the second call cannot return `wait`, because the wait resolves only on
|
|
9
|
+
* `"ready"`/`"error"` and a timeout is treated as `catalog-unavailable` without
|
|
10
|
+
* asking again.
|
|
11
|
+
*
|
|
12
|
+
* `"revalidating"` counts as usable. That is safe only because the AsyncStorage
|
|
13
|
+
* cache key is scoped by audience params: before that, a revalidating catalog
|
|
14
|
+
* might have been resolved under DIFFERENT params, so a missing moment could
|
|
15
|
+
* mean "not yet" rather than "absent". Now a served catalog always matches the
|
|
16
|
+
* current params.
|
|
17
|
+
*/
|
|
18
|
+
const resolveRegisterDecision = (catalog, catalogStatus, moment) => {
|
|
19
|
+
if (!catalog) {
|
|
20
|
+
// Nothing to decide against yet. "loading" is worth waiting for; anything
|
|
21
|
+
// else with no catalog is terminal.
|
|
22
|
+
return catalogStatus === "loading"
|
|
23
|
+
? { type: "wait" }
|
|
24
|
+
: { type: "run", reason: "catalog-unavailable" };
|
|
25
|
+
}
|
|
26
|
+
const paywall = catalog.paywalls[moment];
|
|
27
|
+
// A moment absent from a RESOLVED catalog is not a failure: it means the moment
|
|
28
|
+
// is not monetised, or is not authored yet. The feature is free.
|
|
29
|
+
if (!paywall)
|
|
30
|
+
return { type: "run", reason: "no-paywall" };
|
|
31
|
+
return { type: "present", paywall };
|
|
32
|
+
};
|
|
33
|
+
exports.resolveRegisterDecision = resolveRegisterDecision;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a completed presentation unlocks the feature. Only a purchase does.
|
|
36
|
+
*
|
|
37
|
+
* This one-liner is correct only because `resolvePresentedOutcome` already
|
|
38
|
+
* upgraded the generic `{status:"dismissed"}` that the canonical authoring shape
|
|
39
|
+
* — `{type:"purchase", onSuccess:[{type:"dismiss"}]}` — produces into
|
|
40
|
+
* `"purchased"` when the store actually charged. Without that upgrade this would
|
|
41
|
+
* refuse the feature to every user who bought.
|
|
42
|
+
*
|
|
43
|
+
* **A Stripe paywall never unlocks on the purchase alone.** `PresentResult` has
|
|
44
|
+
* no `"pending"` status — that belongs to `PurchaseResult` — so a Payment Link
|
|
45
|
+
* checkout surfaces here as whatever its action list reported, in practice
|
|
46
|
+
* `"dismissed"` via its `onPending` branch. The entitlement arrives out-of-band
|
|
47
|
+
* through RevenueCat, so grant access from that webhook rather than from
|
|
48
|
+
* `register`. `runRegister` warns when it is about to present one.
|
|
49
|
+
*/
|
|
50
|
+
const shouldRunFeature = (outcome) => outcome.status === "purchased";
|
|
51
|
+
exports.shouldRunFeature = shouldRunFeature;
|
|
52
|
+
/**
|
|
53
|
+
* `register(moment, feature)`'s whole orchestration.
|
|
54
|
+
*
|
|
55
|
+
* Lives here rather than inside `PaywallProvider` so every branch — both
|
|
56
|
+
* fail-open paths, the wait-once rule, the Stripe warning, and the
|
|
57
|
+
* withhold-on-dismiss case — is covered by a plain async test. This repo has no
|
|
58
|
+
* vitest config, so tests run without a DOM; a provider-rendering test would mean
|
|
59
|
+
* adding jsdom to assert control flow that has nothing to do with rendering.
|
|
60
|
+
*
|
|
61
|
+
* It delegates presentation to the injected `present`, which in the provider is
|
|
62
|
+
* the real one — so the wedge recovery, the purchase-generation race guard and
|
|
63
|
+
* outcome reconciliation all apply unchanged.
|
|
64
|
+
*/
|
|
65
|
+
const runRegister = async (deps, moment, feature) => {
|
|
66
|
+
let decision = (0, exports.resolveRegisterDecision)(deps.getCatalog(), deps.getCatalogStatus(), moment);
|
|
67
|
+
if (decision.type === "wait") {
|
|
68
|
+
// Called on a user tap, so it cannot simply fail because the catalog has not
|
|
69
|
+
// landed. In practice a returning user's catalog is already on disk and this
|
|
70
|
+
// resolves immediately.
|
|
71
|
+
await deps.waitForCatalogSettled(deps.timeoutMs);
|
|
72
|
+
decision = (0, exports.resolveRegisterDecision)(deps.getCatalog(), deps.getCatalogStatus(), moment);
|
|
73
|
+
// The wait timed out with the catalog still loading. Decide — never wait a
|
|
74
|
+
// second time, or a permanently-loading catalog would park the caller
|
|
75
|
+
// forever in `timeoutMs` increments.
|
|
76
|
+
if (decision.type === "wait")
|
|
77
|
+
decision = { type: "run", reason: "catalog-unavailable" };
|
|
78
|
+
}
|
|
79
|
+
if (decision.type === "run") {
|
|
80
|
+
if (decision.reason === "catalog-unavailable") {
|
|
81
|
+
// Failing OPEN. The alternative locks every gated feature behind a network
|
|
82
|
+
// call: an offline launch would make the app's features silently dead with
|
|
83
|
+
// no paywall to explain why, which is indistinguishable from a broken app.
|
|
84
|
+
// The cost is real — some sessions get a paid feature free — so it is
|
|
85
|
+
// logged, and the returned `reason` lets a host measure the rate.
|
|
86
|
+
console.warn(`[paywalls] register("${moment}") could not reach a verdict (no paywall catalog) ` +
|
|
87
|
+
"and ran the feature ungated. The catalog failed to load, or is still loading " +
|
|
88
|
+
"after the register timeout.");
|
|
89
|
+
}
|
|
90
|
+
await (feature === null || feature === void 0 ? void 0 : feature());
|
|
91
|
+
return { ran: true, presented: false, reason: decision.reason };
|
|
92
|
+
}
|
|
93
|
+
if (decision.paywall.billing === "stripe") {
|
|
94
|
+
// See `shouldRunFeature`: a Payment Link checkout never produces a
|
|
95
|
+
// "purchased" PresentResult, so the gated feature cannot unlock from it.
|
|
96
|
+
console.warn(`[paywalls] register("${moment}") will present a Stripe-billed paywall. A Payment ` +
|
|
97
|
+
'Link checkout never resolves as "purchased" — the entitlement arrives out-of-band ' +
|
|
98
|
+
"through RevenueCat — so the gated feature will NOT run on a successful checkout. " +
|
|
99
|
+
"Grant access from your RevenueCat entitlement webhook instead.");
|
|
100
|
+
}
|
|
101
|
+
const outcome = await deps.present(moment);
|
|
102
|
+
if ((0, exports.shouldRunFeature)(outcome)) {
|
|
103
|
+
await (feature === null || feature === void 0 ? void 0 : feature());
|
|
104
|
+
return { ran: true, presented: true, reason: "purchased", outcome };
|
|
105
|
+
}
|
|
106
|
+
// Covers dismissed, cancelled and every `present()` error — including
|
|
107
|
+
// "already-presenting", which needs no branch of its own: the feature does not
|
|
108
|
+
// run and the in-flight paywall is untouched.
|
|
109
|
+
return { ran: false, presented: true, reason: "not-purchased", outcome };
|
|
110
|
+
};
|
|
111
|
+
exports.runRegister = runRegister;
|
|
112
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/paywalls/register.ts"],"names":[],"mappings":";;;AAiBA;;;;;;;;;;;;;GAaG;AACI,MAAM,uBAAuB,GAAG,CACrC,OAA8B,EAC9B,aAA4B,EAC5B,MAAc,EACI,EAAE;IACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,0EAA0E;QAC1E,oCAAoC;QACpC,OAAO,aAAa,KAAK,SAAS;YAChC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;YAClB,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;IACrD,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzC,gFAAgF;IAChF,iEAAiE;IACjE,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAC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AA6B,CAChC,CAAC;QACJ,CAAC;QACD,MAAM,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,EAAI,CAAA,CAAC;QAClB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClE,CAAC;IAED,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC1C,mEAAmE;QACnE,yEAAyE;QACzE,OAAO,CAAC,IAAI,CACV,wBAAwB,MAAM,qDAAqD;YACjF,oFAAoF;YACpF,mFAAmF;YACnF,gEAAgE,CACnE,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,IAAA,wBAAgB,EAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,EAAI,CAAA,CAAC;QAClB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;IACtE,CAAC;IACD,sEAAsE;IACtE,+EAA+E;IAC/E,8CAA8C;IAC9C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;AAC3E,CAAC,CAAC;AAxDW,QAAA,WAAW,eAwDtB"}
|
|
@@ -2,6 +2,7 @@ import { PaywallCatalog, PresentResult } from "./types";
|
|
|
2
2
|
import type { CatalogStatus } from "./present";
|
|
3
3
|
import type { ProductStatus } from "../products/types";
|
|
4
4
|
import type { CustomPaywallScreens } from "./customScreens";
|
|
5
|
+
import type { RegisterFeature, RegisterResult } from "./register";
|
|
5
6
|
export type UsePaywallResult = {
|
|
6
7
|
/**
|
|
7
8
|
* Present a paywall by moment. Never fetches — the catalog and its
|
|
@@ -14,6 +15,34 @@ export type UsePaywallResult = {
|
|
|
14
15
|
* presented. See `resolvePresentDecision` in `present.ts`.
|
|
15
16
|
*/
|
|
16
17
|
present: (moment: string) => Promise<PresentResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Gate a feature on a moment — Superwall's `registerPlacement`, in this SDK's
|
|
20
|
+
* vocabulary:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* await register("unlock_stats", () => router.push("/stats"));
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* - The moment has **no paywall** (not monetised, or not authored yet) → runs
|
|
27
|
+
* the feature immediately.
|
|
28
|
+
* - The moment **has** a paywall → presents it, and runs the feature **only**
|
|
29
|
+
* on a purchase. A dismiss or a cancel withholds it.
|
|
30
|
+
* - **No catalog is reachable** → fails OPEN: runs the feature and warns. An
|
|
31
|
+
* offline launch must not silently disable the app's features. Read
|
|
32
|
+
* `reason: "catalog-unavailable"` off the result to measure how often this
|
|
33
|
+
* happens.
|
|
34
|
+
*
|
|
35
|
+
* Gates on the moment **alone** — there is no entitlement check. Exclude
|
|
36
|
+
* paying users by setting a user property
|
|
37
|
+
* (`OnboardingStudio.setUserProperty("plan", "pro")`)
|
|
38
|
+
* and authoring an audience filter on it.
|
|
39
|
+
*
|
|
40
|
+
* **A Stripe-billed paywall never runs the feature**, even on a successful
|
|
41
|
+
* checkout: a Payment Link resolves out-of-band through RevenueCat, so the
|
|
42
|
+
* presentation never reports `"purchased"`. Grant access from your RevenueCat
|
|
43
|
+
* entitlement webhook. `register` warns when it presents one.
|
|
44
|
+
*/
|
|
45
|
+
register: (moment: string, feature?: RegisterFeature) => Promise<RegisterResult>;
|
|
17
46
|
/**
|
|
18
47
|
* `true` once BOTH the catalog and its products have resolved — the one
|
|
19
48
|
* flag meaning "calling `present()` now will not show a spinner".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaywall.d.ts","sourceRoot":"","sources":["../../src/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AAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAO,gBAqB7B,CAAC"}
|
|
@@ -10,9 +10,10 @@ const PaywallProvider_1 = require("./PaywallProvider");
|
|
|
10
10
|
* `useProductRuntime()` degrades to `null` with no ancestor.
|
|
11
11
|
*/
|
|
12
12
|
const usePaywall = () => {
|
|
13
|
-
const { present, isReady, catalog, catalogStatus, productsStatus, isProviderMounted, customScreens } = (0, react_1.useContext)(PaywallProvider_1.PaywallContext);
|
|
13
|
+
const { present, register, isReady, catalog, catalogStatus, productsStatus, isProviderMounted, customScreens, } = (0, react_1.useContext)(PaywallProvider_1.PaywallContext);
|
|
14
14
|
return {
|
|
15
15
|
present,
|
|
16
|
+
register,
|
|
16
17
|
isReady,
|
|
17
18
|
catalog,
|
|
18
19
|
catalogStatus,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaywall.js","sourceRoot":"","sources":["../../src/paywalls/usePaywall.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,uDAAmD;
|
|
1
|
+
{"version":3,"file":"usePaywall.js","sourceRoot":"","sources":["../../src/paywalls/usePaywall.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,uDAAmD;AAkFnD;;;;;GAKG;AACI,MAAM,UAAU,GAAG,GAAqB,EAAE;IAC/C,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,GAAG,IAAA,kBAAU,EAAC,gCAAc,CAAC,CAAC;IAC/B,OAAO;QACL,OAAO;QACP,QAAQ;QACR,OAAO;QACP,OAAO;QACP,aAAa;QACb,cAAc;QACd,iBAAiB;QACjB,aAAa;KACd,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,UAAU,cAqBrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UserProperties, UserPropertyPatch } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* The store's entire mutation logic, as a pure function — so merge semantics,
|
|
4
|
+
* deletion, and every rejection rule are covered by an importable test rather
|
|
5
|
+
* than through AsyncStorage and React.
|
|
6
|
+
*
|
|
7
|
+
* Warnings are RETURNED rather than logged here, so the same rules can be
|
|
8
|
+
* asserted without spying on `console`. The store logs them.
|
|
9
|
+
*
|
|
10
|
+
* Returns the SAME `current` object when nothing changed, so a no-op `set` does
|
|
11
|
+
* not notify subscribers or trigger a refetch — a host calling `set({ plan })`
|
|
12
|
+
* on every render must not re-key the catalog query each time.
|
|
13
|
+
*/
|
|
14
|
+
export declare const applyUserPropertyPatch: (current: UserProperties, patch: UserPropertyPatch) => {
|
|
15
|
+
next: UserProperties;
|
|
16
|
+
warnings: string[];
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=applyPatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyPatch.d.ts","sourceRoot":"","sources":["../../src/userProperties/applyPatch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,cAAc,EACvB,OAAO,iBAAiB,KACvB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAiD5C,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyUserPropertyPatch = void 0;
|
|
4
|
+
const reserved_1 = require("./reserved");
|
|
5
|
+
/**
|
|
6
|
+
* The store's entire mutation logic, as a pure function — so merge semantics,
|
|
7
|
+
* deletion, and every rejection rule are covered by an importable test rather
|
|
8
|
+
* than through AsyncStorage and React.
|
|
9
|
+
*
|
|
10
|
+
* Warnings are RETURNED rather than logged here, so the same rules can be
|
|
11
|
+
* asserted without spying on `console`. The store logs them.
|
|
12
|
+
*
|
|
13
|
+
* Returns the SAME `current` object when nothing changed, so a no-op `set` does
|
|
14
|
+
* not notify subscribers or trigger a refetch — a host calling `set({ plan })`
|
|
15
|
+
* on every render must not re-key the catalog query each time.
|
|
16
|
+
*/
|
|
17
|
+
const applyUserPropertyPatch = (current, patch) => {
|
|
18
|
+
const warnings = [];
|
|
19
|
+
const next = Object.assign({}, current);
|
|
20
|
+
let changed = false;
|
|
21
|
+
for (const key of Object.keys(patch)) {
|
|
22
|
+
if ((0, reserved_1.isReservedUserPropertyKey)(key)) {
|
|
23
|
+
warnings.push(`[user-properties] Ignoring "${key}" — the SDK puts that name on the ` +
|
|
24
|
+
"request querystring itself, and a duplicate silently breaks the request. " +
|
|
25
|
+
"Rename the property.");
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const value = patch[key];
|
|
29
|
+
if (value === null || value === undefined) {
|
|
30
|
+
if (key in next) {
|
|
31
|
+
delete next[key];
|
|
32
|
+
changed = true;
|
|
33
|
+
}
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const type = typeof value;
|
|
37
|
+
if (type === "number") {
|
|
38
|
+
if (!Number.isFinite(value)) {
|
|
39
|
+
warnings.push(`[user-properties] Ignoring "${key}" — ${String(value)} is not a finite ` +
|
|
40
|
+
'number and would reach the server as "NaN"/"Infinity", matching nothing.');
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (type !== "string" && type !== "boolean") {
|
|
45
|
+
warnings.push(`[user-properties] Ignoring "${key}" — a user property must be a string, ` +
|
|
46
|
+
`number or boolean, not ${type}. Audience filters compare scalars.`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (next[key] !== value) {
|
|
50
|
+
next[key] = value;
|
|
51
|
+
changed = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { next: changed ? next : current, warnings };
|
|
55
|
+
};
|
|
56
|
+
exports.applyUserPropertyPatch = applyUserPropertyPatch;
|
|
57
|
+
//# sourceMappingURL=applyPatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyPatch.js","sourceRoot":"","sources":["../../src/userProperties/applyPatch.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAGvD;;;;;;;;;;;GAWG;AACI,MAAM,sBAAsB,GAAG,CACpC,OAAuB,EACvB,KAAwB,EACsB,EAAE;IAChD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,IAAI,qBAAwB,OAAO,CAAE,CAAC;IAC5C,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,IAAI,IAAA,oCAAyB,EAAC,GAAG,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,IAAI,CACX,+BAA+B,GAAG,oCAAoC;gBACpE,2EAA2E;gBAC3E,sBAAsB,CACzB,CAAC;YACF,SAAS;QACX,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAEzB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC1C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;gBACjB,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;QAC1B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,QAAQ,CAAC,IAAI,CACX,+BAA+B,GAAG,OAAO,MAAM,CAAC,KAAK,CAAC,mBAAmB;oBACvE,0EAA0E,CAC7E,CAAC;gBACF,SAAS;YACX,CAAC;QACH,CAAC;aAAM,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACnD,QAAQ,CAAC,IAAI,CACX,+BAA+B,GAAG,wCAAwC;gBACxE,0BAA0B,IAAI,qCAAqC,CACtE,CAAC;YACF,SAAS;QACX,CAAC;QAED,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAClB,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtD,CAAC,CAAC;AApDW,QAAA,sBAAsB,0BAoDjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { UserProperties } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* The audience params a provider actually sends: the `customAudienceParams` prop
|
|
4
|
+
* as a static baseline, with the user-property store merged OVER it.
|
|
5
|
+
*
|
|
6
|
+
* Precedence is the store, per key. `customAudienceParams` is where build-time
|
|
7
|
+
* facts live (an `onboardingId`, a build channel) — set once at mount — and the
|
|
8
|
+
* store is where anything that changes at runtime lives. A runtime value losing
|
|
9
|
+
* to a mount-time prop would make the store useless for the case it exists for.
|
|
10
|
+
*
|
|
11
|
+
* The prop is neither deprecated nor removed: merging means every existing host
|
|
12
|
+
* keeps working untouched.
|
|
13
|
+
*
|
|
14
|
+
* Everything is serialized to a string here, once, so the query key, the cache
|
|
15
|
+
* key hash and the querystring all see the same bytes.
|
|
16
|
+
*
|
|
17
|
+
* The prop is typed `Record<string, any>` and predates this module, so its values
|
|
18
|
+
* are treated conservatively:
|
|
19
|
+
*
|
|
20
|
+
* - a reserved name is DROPPED, because it would break the request outright (the
|
|
21
|
+
* client puts that name on the querystring itself — see `reserved.ts`);
|
|
22
|
+
* - `null`/`undefined` is OMITTED rather than sent as the string `"null"`, which
|
|
23
|
+
* would match an audience filter testing for absence;
|
|
24
|
+
* - anything else non-scalar is stringified with `String(...)` rather than
|
|
25
|
+
* dropped, so a host already passing something exotic keeps the exact wire
|
|
26
|
+
* behaviour it had before this module existed.
|
|
27
|
+
*/
|
|
28
|
+
export declare const resolveEffectiveParams: (baseline: Record<string, any>, properties: UserProperties) => Record<string, string>;
|
|
29
|
+
//# sourceMappingURL=effectiveParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effectiveParams.d.ts","sourceRoot":"","sources":["../../src/userProperties/effectiveParams.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,YAAY,cAAc,KACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CA0BvB,CAAC"}
|