@app-swiss-knife/react-native-sdk 0.2.7 → 0.3.1

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.
Files changed (66) hide show
  1. package/README.md +100 -47
  2. package/SwissKnifePurchases.podspec +8 -5
  3. package/android/vendor/java/com/appswissknife/context/DeviceContext.kt +1 -1
  4. package/android/vendor/java/com/appswissknife/net/IngestClient.kt +1 -1
  5. package/ios/SwissKnifeCrashReporting.swift +59 -18
  6. package/ios/vendor/SwissKnifeiOS/Context/DeviceContext.swift +1 -1
  7. package/ios/vendor/SwissKnifeiOS/Context/Reachability.swift +1 -1
  8. package/ios/vendor/SwissKnifeiOS/CrashReporting/SKCrashReporting.swift +51 -1
  9. package/ios/vendor/SwissKnifeiOS/DeviceID.swift +22 -1
  10. package/ios/vendor/SwissKnifeiOS/Identity/Identity.swift +105 -7
  11. package/ios/vendor/SwissKnifeiOS/Net/IngestClient.swift +14 -0
  12. package/lib/commonjs/attributes.js +103 -0
  13. package/lib/commonjs/attributes.js.map +1 -0
  14. package/lib/commonjs/index.js +31 -2
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/internal/config.js +237 -0
  17. package/lib/commonjs/internal/config.js.map +1 -0
  18. package/lib/commonjs/purchases.js +152 -209
  19. package/lib/commonjs/purchases.js.map +1 -1
  20. package/lib/commonjs/swiss-knife.js +115 -0
  21. package/lib/commonjs/swiss-knife.js.map +1 -0
  22. package/lib/commonjs/types.js +11 -0
  23. package/lib/commonjs/types.js.map +1 -1
  24. package/lib/module/attributes.js +100 -0
  25. package/lib/module/attributes.js.map +1 -0
  26. package/lib/module/index.js +19 -2
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/internal/config.js +225 -0
  29. package/lib/module/internal/config.js.map +1 -0
  30. package/lib/module/purchases.js +132 -198
  31. package/lib/module/purchases.js.map +1 -1
  32. package/lib/module/swiss-knife.js +112 -0
  33. package/lib/module/swiss-knife.js.map +1 -0
  34. package/lib/module/types.js +11 -0
  35. package/lib/module/types.js.map +1 -1
  36. package/lib/typescript/commonjs/attributes.d.ts +41 -0
  37. package/lib/typescript/commonjs/attributes.d.ts.map +1 -0
  38. package/lib/typescript/commonjs/index.d.ts +2 -0
  39. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/internal/config.d.ts +121 -0
  41. package/lib/typescript/commonjs/internal/config.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/purchases.d.ts +47 -91
  43. package/lib/typescript/commonjs/purchases.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/swiss-knife.d.ts +56 -0
  45. package/lib/typescript/commonjs/swiss-knife.d.ts.map +1 -0
  46. package/lib/typescript/commonjs/types.d.ts +13 -0
  47. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  48. package/lib/typescript/module/attributes.d.ts +41 -0
  49. package/lib/typescript/module/attributes.d.ts.map +1 -0
  50. package/lib/typescript/module/index.d.ts +2 -0
  51. package/lib/typescript/module/index.d.ts.map +1 -1
  52. package/lib/typescript/module/internal/config.d.ts +121 -0
  53. package/lib/typescript/module/internal/config.d.ts.map +1 -0
  54. package/lib/typescript/module/purchases.d.ts +47 -91
  55. package/lib/typescript/module/purchases.d.ts.map +1 -1
  56. package/lib/typescript/module/swiss-knife.d.ts +56 -0
  57. package/lib/typescript/module/swiss-knife.d.ts.map +1 -0
  58. package/lib/typescript/module/types.d.ts +13 -0
  59. package/lib/typescript/module/types.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/attributes.ts +97 -0
  62. package/src/index.ts +19 -2
  63. package/src/internal/config.ts +233 -0
  64. package/src/purchases.ts +142 -213
  65. package/src/swiss-knife.ts +134 -0
  66. package/src/types.ts +14 -0
@@ -4,94 +4,74 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Purchases = void 0;
7
- exports.__throwIfCoreNotConfigured = throwIfCoreNotConfigured;
8
- exports.__throwIfNotConfigured = throwIfNotConfigured;
7
+ Object.defineProperty(exports, "__throwIfCoreNotConfigured", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _config.throwIfCoreNotConfigured;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "__throwIfNotConfigured", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _config.throwIfNotConfigured;
17
+ }
18
+ });
9
19
  exports.default = void 0;
20
+ var _attributes = require("./attributes.js");
10
21
  var _identity = require("./identity.js");
22
+ var _config = require("./internal/config.js");
11
23
  var _module = require("./native/module.js");
12
24
  var _spec = require("./native/spec.js");
13
25
  var _types = require("./types.js");
14
26
  // src/purchases.ts
15
-
16
- let configured = false;
17
- let configuredApiKey = null;
18
- let coreConfigured = false;
19
-
20
- /**
21
- * Read a boolean off the native module without ever letting a missing native
22
- * module escape as an exception.
23
- *
24
- * `getNativeModule()` THROWS when the module is not linked (Expo Go, a bare RN
25
- * app that skipped `pod install` / a Gradle sync, web) — precisely the state a
26
- * developer is in while wiring the SDK up, and precisely when they are most
27
- * likely to be calling one of these accessors to find out what is wrong. A
28
- * boolean accessor rejecting with "native module is not linked" is a worse
29
- * answer than `false`: an unlinked module cannot have configured anything, so
30
- * `false` is not merely safe, it is correct.
31
- *
32
- * The `.catch` covers the adjacent case where the module IS linked but predates
33
- * the method (JS upgraded without rebuilding the app) — same reasoning, same
34
- * answer. Mirrors the tolerance `Analytics.init` already applies to
35
- * `configureObservability`.
36
- */
37
- function nativeBoolean(read) {
38
- try {
39
- return Promise.resolve(read((0, _module.getNativeModule)())).catch(() => false);
40
- } catch {
41
- return Promise.resolve(false);
42
- }
43
- }
27
+ //
28
+ // The RevenueCat-compatible surface. Everything a `react-native-purchases`
29
+ // migration can call, spelled the way RevenueCat spells it.
30
+ //
31
+ // ## What this file is, after the namespace split
32
+ //
33
+ // `Purchases` used to be the whole SDK: the store, both bootstraps, subscriber
34
+ // attributes and the identity aliases, twenty-one statics across four unrelated
35
+ // concerns — while `Identity`, `Attribution`, `Analytics`, `CrashReporting` and
36
+ // `Performance` sat beside it as peer namespaces. Two organising principles at
37
+ // once, and the seams showed: `Purchases.configureCore()` is a call whose entire
38
+ // meaning is "I do not want the store", and an app with no purchases in it set
39
+ // its user data through `Purchases.setAttributes`.
40
+ //
41
+ // The store methods below are the ones that genuinely belong here. The rest are
42
+ // **RC-compatibility aliases**, and they are not going anywhere:
43
+ //
44
+ // - bootstrap → `SwissKnife.configure` / `configureCore` / `isConfigured` /
45
+ // `isCoreConfigured` / `setLogLevel` (src/swiss-knife.ts)
46
+ // - attributes → `Attributes.set` / `setEmail` / `setDisplayName` /
47
+ // `setPhoneNumber` / `setPushToken` (src/attributes.ts)
48
+ // - identity → `Identity.logIn` / `logOut` / `current` (src/identity.ts)
49
+ //
50
+ // ## Why the aliases are not deprecated
51
+ //
52
+ // This class exists so that someone migrating off `react-native-purchases` can
53
+ // keep their call sites. Emitting deprecation warnings at exactly those call
54
+ // sites would punish the users the compatibility surface was built for — the
55
+ // migration would arrive pre-broken, with a console full of warnings for code
56
+ // that is doing the right thing. They are documented as aliases and left alone.
57
+ //
58
+ // The four identity aliases are the exception and keep their `@deprecated` tags,
59
+ // because they are a different case: `Identity` is genuinely the canonical home,
60
+ // and the RC names carry return types (`logOut` resolving a `CustomerInfo`) that
61
+ // misdescribe what the call does in a store-less app.
62
+ //
63
+ // ## Why they cannot drift
64
+ //
65
+ // The aliases are not re-implementations and not one-line wrappers: they are the
66
+ // *same function objects* as the canonical methods, assigned as static fields
67
+ // from the modules that own them. `Purchases.configure === SwissKnife.configure`
68
+ // and `Purchases.setAttributes === Attributes.set` are literally true. There is
69
+ // no second copy of the bootstrap state either — see `src/internal/config.ts`.
70
+ // Pinned by `src/namespaces.test.ts`.
44
71
 
45
72
  // Maps a caller's listener fn to its native subscription so we can remove it.
46
73
  const customerInfoSubscriptions = new Map();
47
74
 
48
- /**
49
- * Guard for surfaces that genuinely need the PURCHASE engine — `getOfferings`,
50
- * `purchasePackage`, `restorePurchases` and friends. Checks the JS "configure
51
- * was called" flag.
52
- *
53
- * The RC-parity identity aliases used to sit here too, on the grounds that the
54
- * legacy native bridge methods they called meant different things on iOS and
55
- * Android. They now delegate to `Identity` and sit on
56
- * {@link throwIfCoreNotConfigured} — see the block above `logIn`.
57
- */
58
- function throwIfNotConfigured() {
59
- if (!configured) {
60
- throw new _types.UninitializedPurchasesError();
61
- }
62
- }
63
-
64
- /**
65
- * Guard for surfaces that only need CORE — the subscriber-attribute setters.
66
- *
67
- * Attributes describe the *person*, not the purchase: natively they land in
68
- * `AttributesClient` → `POST /api/sdk/users/attributes` → `app_users.properties`,
69
- * which is what the dashboard person card reads. Neither platform's attributes
70
- * path touches StoreKit or Play Billing — iOS gates on `SwissKnife.isCoreConfigured`
71
- * (`SwissKnife.currentAnonymousIdForAttributes`), and Android's `configureCore`
72
- * wires `AttributesClient` with an `Identity`-snapshot id fallback precisely so a
73
- * store-less app still resolves ids. Gating these on the purchase flag left an app
74
- * that uses `configureCore` (because another library owns the store) with **no way
75
- * at all** to populate the person card.
76
- *
77
- * Two-step check, and the second step is load-bearing:
78
- *
79
- * 1. The JS flag, set by `configure` / `configureCore`. Free, no bridge hop.
80
- * 2. Native truth. `Analytics.init(...)` wires core natively via
81
- * `configureObservability` and touches no JS flag, so an analytics-only app
82
- * has core configured while every JS flag reads `false` — exactly the case
83
- * {@link isCoreConfigured} documents. Skipping this step would keep the most
84
- * common core-only integration broken.
85
- *
86
- * Never consults the purchase flag. Strictly more permissive than
87
- * {@link throwIfNotConfigured}, so no existing caller can break.
88
- */
89
- async function throwIfCoreNotConfigured() {
90
- if (coreConfigured) return;
91
- if (await nativeBoolean(native => native.isCoreConfigured())) return;
92
- throw new _types.UninitializedPurchasesError("Purchases core is not configured. Call Purchases.configure(), " + "Purchases.configureCore(), or Analytics.init() first.");
93
- }
94
-
95
75
  /**
96
76
  * The `CustomerInfo` RC's `logOut()` resolves with, for a device that just
97
77
  * became anonymous.
@@ -112,7 +92,7 @@ async function throwIfCoreNotConfigured() {
112
92
  * operation and must not fail because the store is unreachable.
113
93
  */
114
94
  async function customerInfoAfterLogOut() {
115
- if (await nativeBoolean(native => native.isConfigured())) {
95
+ if (await (0, _config.nativeBoolean)(native => native.isConfigured())) {
116
96
  try {
117
97
  return await (0, _module.getNativeModule)().getCustomerInfo();
118
98
  } catch {
@@ -153,140 +133,99 @@ function emptyCustomerInfo(subjectId) {
153
133
  }
154
134
 
155
135
  /**
156
- * RC-compatible subscriptions SDK entry point. Process-wide singleton; call
157
- * `Purchases.configure(...)` once at app start, then use the static methods.
136
+ * RC-compatible subscriptions SDK entry point. Process-wide singleton.
137
+ *
138
+ * New code should bootstrap through {@link SwissKnife} — `SwissKnife.configure(…)`
139
+ * — and reach the store through this class. Code migrating from
140
+ * `react-native-purchases` can keep calling `Purchases.configure(…)`: it is the
141
+ * same function.
158
142
  */
159
143
  class Purchases {
144
+ // MARK: - Bootstrap (RC-compatibility aliases for `SwissKnife.*`)
145
+ //
146
+ // Assigned, not wrapped: these ARE `SwissKnife.configure` and friends. The
147
+ // configure state lives in one module (`./internal/config`), so mixing the two
148
+ // spellings in one app is not merely allowed, it is indistinguishable.
149
+
160
150
  /**
161
151
  * Configure the SDK. Must be called before any other method. Calling again
162
- * with the same API key is a no-op (matches the common "configure once" guard);
163
- * the native layer owns full reconfiguration.
152
+ * with the same API key is a no-op; the native layer owns full reconfiguration.
153
+ *
154
+ * RC-compatibility alias for `SwissKnife.configure(...)` — the same function
155
+ * under the name `react-native-purchases` uses. Neither is deprecated.
164
156
  */
165
- static configure(options) {
166
- if (configured && configuredApiKey === options.apiKey) return;
167
- const native = (0, _module.getNativeModule)();
168
- const nativeOptions = {
169
- apiKey: options.apiKey,
170
- appUserID: options.appUserID ?? null,
171
- // proxyURL points the native SDK at the Swiss Knife backend. Without it the
172
- // native layer falls back to its hardcoded default host (api.swiss-knife.dev),
173
- // which is unreachable for self-hosted tenants. Forward it so callers can
174
- // target their own backend (e.g. https://swiss.remneys.com).
175
- proxyURL: options.proxyURL ?? null,
176
- // Hardening pass (spec): diagnostics opt-in only — default OFF.
177
- diagnosticsEnabled: options.diagnosticsEnabled ?? false,
178
- storeKitVersion: options.storeKitVersion,
179
- useAmazon: options.useAmazon,
180
- // iOS ATT — default off (no tracking prompt) unless the host opts in.
181
- autoPromptATT: options.autoPromptATT,
182
- sendInstallOnFirstLaunch: options.sendInstallOnFirstLaunch,
183
- logLevel: options.logLevel
184
- };
185
- // Fire-and-forget: native configure resolves async but RC's configure is sync.
186
- void native.configure(nativeOptions);
187
- configured = true;
188
- coreConfigured = true;
189
- configuredApiKey = options.apiKey;
190
- }
157
+ static configure = _config.configure;
191
158
 
192
159
  /**
193
160
  * Configure everything EXCEPT the store: ingest, `Identity`, `Attribution`,
194
- * subscriber attributes.
195
- *
196
- * Use this when another library already owns in-app purchases. `configure`
197
- * starts a `StoreKit.Transaction.updates` observer on iOS (whose handler
198
- * calls `transaction.finish()`) and builds a `BillingClient` on Android —
199
- * both of which contend with an incumbent IAP SDK. `configureCore` creates
200
- * neither, and registers no install as a side effect.
161
+ * `Attributes`. Use it when another library already owns in-app purchases.
201
162
  *
202
- * Analytics-only apps don't even need this: `Analytics.init(...)` already
203
- * wires core natively. Reach for `configureCore` when you want to pass an
204
- * `appUserID`, an attribution configuration, or a log level up front.
163
+ * Alias for `SwissKnife.configureCore(...)`, which is the name that actually
164
+ * describes the call — nothing about this method concerns purchases, and it is
165
+ * only spelled `Purchases.configureCore` here so that no existing call site
166
+ * breaks. Prefer the `SwissKnife` spelling in new code.
205
167
  */
206
- static configureCore(options) {
207
- if (coreConfigured && configuredApiKey === options.apiKey) return;
208
- const native = (0, _module.getNativeModule)();
209
- const nativeOptions = {
210
- apiKey: options.apiKey,
211
- appUserID: options.appUserID ?? null,
212
- proxyURL: options.proxyURL ?? null,
213
- diagnosticsEnabled: options.diagnosticsEnabled ?? false,
214
- autoPromptATT: options.autoPromptATT,
215
- // Forwarded but inert on this path — core never auto-registers an
216
- // install. Kept on the payload so the same options object can be handed
217
- // to `configure` later without surprises.
218
- sendInstallOnFirstLaunch: options.sendInstallOnFirstLaunch,
219
- logLevel: options.logLevel
220
- };
221
- void native.configureCore(nativeOptions);
222
- coreConfigured = true;
223
- configuredApiKey = options.apiKey;
224
- }
168
+ static configureCore = _config.configureCore;
225
169
 
226
170
  /**
227
171
  * Whether the PURCHASE engine has been configured — i.e. whether the store
228
- * APIs (`getOfferings`, `purchasePackage`, `restorePurchases`, …) can work.
229
- *
230
- * **Native is the source of truth.** This does not consult the JS-side
231
- * "configure was called" flag: a brownfield app can configure the SDK from
232
- * native code, and `Purchases.configure` itself is fire-and-forget, so the
233
- * JS flag is a request, not a fact.
172
+ * APIs below can work. Native is the source of truth; never throws or rejects.
234
173
  *
235
- * Never throws and never rejects. Resolves `false` when the native module is
236
- * not linked — see {@link nativeBoolean}. Exactly the same failure semantics
237
- * as {@link isCoreConfigured}; the two differ only in which native flag they
238
- * report.
174
+ * RC-compatibility alias for `SwissKnife.isConfigured()`.
239
175
  */
240
- static isConfigured() {
241
- return nativeBoolean(native => native.isConfigured());
242
- }
176
+ static isConfigured = _config.isConfigured;
243
177
 
244
178
  /**
245
- * Whether the CORE (ingest / Identity / Attribution / attributes) is
179
+ * Whether the CORE (ingest / Identity / Attribution / Attributes) is
246
180
  * configured. True after `configure`, `configureCore`, or `Analytics.init`.
181
+ * Native is the source of truth; never throws or rejects.
247
182
  *
248
- * **Native is the source of truth**, and here that is load-bearing rather
249
- * than merely principled: `Analytics.init` wires core natively via
250
- * `configureObservability` and touches no JS configure flag, so an
251
- * analytics-only app has core configured while every JS flag reads false.
252
- * Short-circuiting on JS state would report `false` in the single most
253
- * common core-only integration.
183
+ * Alias for `SwissKnife.isCoreConfigured()`.
184
+ */
185
+ static isCoreConfigured = _config.isCoreConfigured;
186
+
187
+ /**
188
+ * Set the native log level. Process-wide — it governs the store engine, the
189
+ * ingest client, Identity, Attribution and the observability modules alike.
254
190
  *
255
- * Never throws and never rejects. Resolves `false` when the native module is
256
- * not linked — see {@link nativeBoolean}.
191
+ * Alias for `SwissKnife.setLogLevel(...)`, which is where a process-wide
192
+ * setting belongs (and where both native SDKs already put it).
257
193
  */
258
- static isCoreConfigured() {
259
- return nativeBoolean(native => native.isCoreConfigured());
260
- }
194
+ static setLogLevel = _config.setLogLevel;
195
+
196
+ // MARK: - The store
197
+ //
198
+ // These are the methods that genuinely belong on `Purchases`. All of them are
199
+ // gated on the PURCHASE flag.
261
200
 
262
201
  /** Latest CustomerInfo (entitlements + subscriptions), computed server-side. */
263
202
  static async getCustomerInfo() {
264
- throwIfNotConfigured();
203
+ (0, _config.throwIfNotConfigured)();
265
204
  return (0, _module.getNativeModule)().getCustomerInfo();
266
205
  }
267
206
 
268
207
  /** Current + all offerings configured for this app. */
269
208
  static async getOfferings() {
270
- throwIfNotConfigured();
209
+ (0, _config.throwIfNotConfigured)();
271
210
  return (0, _module.getNativeModule)().getOfferings();
272
211
  }
273
212
 
274
213
  /** Purchase a package from an offering. Drives the native store payment sheet. */
275
214
  static async purchasePackage(pkg) {
276
- throwIfNotConfigured();
215
+ (0, _config.throwIfNotConfigured)();
277
216
  const offeringId = pkg.presentedOfferingContext?.offeringIdentifier ?? '';
278
217
  return (0, _module.getNativeModule)().purchasePackage(pkg.identifier, offeringId);
279
218
  }
280
219
 
281
220
  /** Purchase a store product directly by its store SKU. */
282
221
  static async purchaseStoreProduct(product) {
283
- throwIfNotConfigured();
222
+ (0, _config.throwIfNotConfigured)();
284
223
  return (0, _module.getNativeModule)().purchaseStoreProduct(product.identifier);
285
224
  }
286
225
 
287
226
  /** Restore purchases tied to the underlying store account. */
288
227
  static async restorePurchases() {
289
- throwIfNotConfigured();
228
+ (0, _config.throwIfNotConfigured)();
290
229
  return (0, _module.getNativeModule)().restorePurchases();
291
230
  }
292
231
 
@@ -336,9 +275,20 @@ class Purchases {
336
275
  // the stale cache and resolved "logged in" without the device ever being
337
276
  // re-identified. Routing through `Identity` means one owner for that state.
338
277
  //
278
+ // ## Why these four ARE deprecated, when the aliases above are not
279
+ //
280
+ // The bootstrap and attribute aliases are pure renames: same arguments, same
281
+ // return type, same behaviour, and keeping them costs a migrating app nothing.
282
+ // These four are not. `logOut` returns a `CustomerInfo` that is fabricated in
283
+ // a store-less app, `getAppUserID` collapses a three-field snapshot into one
284
+ // string, and `isAnonymous` forces a second round trip to learn what
285
+ // `Identity.current()` already returned. The RC names describe the RC model,
286
+ // not ours, so `Identity.*` is genuinely the better call and not merely the
287
+ // better-organised one. They still work, and will keep working.
288
+ //
339
289
  // ## The guard
340
290
  //
341
- // These sit on {@link throwIfCoreNotConfigured}, not on the purchase guard.
291
+ // These sit on `throwIfCoreNotConfigured`, not on the purchase guard.
342
292
  // Identity is a core capability — natively both platforms gate it on
343
293
  // `isCoreConfigured` — and the single most likely caller of
344
294
  // `Purchases.logIn` is an app migrating off RevenueCat that still lets
@@ -360,7 +310,7 @@ class Purchases {
360
310
  * is NOT merged server-side and the call must be retried. Repeat calls with
361
311
  * the id already in effect are free (no bridge hop, no request).
362
312
  *
363
- * Works after `Purchases.configure`, `Purchases.configureCore`, or
313
+ * Works after `SwissKnife.configure`, `SwissKnife.configureCore`, or
364
314
  * `Analytics.init` — the store does not have to be ours.
365
315
  *
366
316
  * @deprecated Wave 1 — prefer `Identity.logIn(userId)`. This alias exists so
@@ -368,7 +318,7 @@ class Purchases {
368
318
  * is nothing to gain by keeping it and one less name to learn by dropping it.
369
319
  */
370
320
  static async logIn(appUserID) {
371
- await throwIfCoreNotConfigured();
321
+ await (0, _config.throwIfCoreNotConfigured)();
372
322
  return _identity.Identity.logIn(appUserID);
373
323
  }
374
324
 
@@ -388,7 +338,7 @@ class Purchases {
388
338
  * return store state.
389
339
  */
390
340
  static async logOut() {
391
- await throwIfCoreNotConfigured();
341
+ await (0, _config.throwIfCoreNotConfigured)();
392
342
  await _identity.Identity.logOut();
393
343
  return customerInfoAfterLogOut();
394
344
  }
@@ -407,7 +357,7 @@ class Purchases {
407
357
  * two calls that can interleave.
408
358
  */
409
359
  static async getAppUserID() {
410
- await throwIfCoreNotConfigured();
360
+ await (0, _config.throwIfCoreNotConfigured)();
411
361
  const snapshot = await _identity.Identity.current();
412
362
  return snapshot.userId ?? snapshot.anonymousId;
413
363
  }
@@ -422,48 +372,43 @@ class Purchases {
422
372
  * {@link getAppUserID}.
423
373
  */
424
374
  static async isAnonymous() {
425
- await throwIfCoreNotConfigured();
375
+ await (0, _config.throwIfCoreNotConfigured)();
426
376
  return (await _identity.Identity.current()).isAnonymous;
427
377
  }
428
378
 
429
- // Subscriber attributes. CORE, not store — see {@link throwIfCoreNotConfigured}.
430
- // These work in an app that only called `configureCore` (another library owns
431
- // the store) or only `Analytics.init`.
379
+ // MARK: - Subscriber attributes (RC-compatibility aliases for `Attributes.*`)
380
+ //
381
+ // CORE, not store: all five are gated on `throwIfCoreNotConfigured`, so they
382
+ // work in an app that only called `configureCore` (another library owns the
383
+ // store) or only `Analytics.init`. That is the tell that they never belonged
384
+ // on this class — an app with no purchases at all still needs them, because
385
+ // they are the only path to the dashboard person card.
386
+ //
387
+ // Assigned, not wrapped: `Purchases.setAttributes === Attributes.set`.
432
388
 
433
- /** Set arbitrary subscriber attributes. null clears an attribute. */
434
- static async setAttributes(attributes) {
435
- await throwIfCoreNotConfigured();
436
- return (0, _module.getNativeModule)().setAttributes(attributes);
437
- }
389
+ /**
390
+ * Set arbitrary subscriber attributes. `null` clears an attribute.
391
+ *
392
+ * RC-compatibility alias for `Attributes.set(...)`. Not deprecated.
393
+ */
394
+ static setAttributes = _attributes.Attributes.set;
438
395
 
439
- /** Reserved attribute: email. */
440
- static async setEmail(email) {
441
- await throwIfCoreNotConfigured();
442
- return (0, _module.getNativeModule)().setEmail(email);
443
- }
396
+ /** Reserved attribute: email. Alias for `Attributes.setEmail(...)`. */
397
+ static setEmail = _attributes.Attributes.setEmail;
444
398
 
445
- /** Reserved attribute: display name. */
446
- static async setDisplayName(displayName) {
447
- await throwIfCoreNotConfigured();
448
- return (0, _module.getNativeModule)().setDisplayName(displayName);
449
- }
399
+ /** Reserved attribute: display name. Alias for `Attributes.setDisplayName(...)`. */
400
+ static setDisplayName = _attributes.Attributes.setDisplayName;
450
401
 
451
- /** Reserved attribute: phone number. */
452
- static async setPhoneNumber(phoneNumber) {
453
- await throwIfCoreNotConfigured();
454
- return (0, _module.getNativeModule)().setPhoneNumber(phoneNumber);
455
- }
402
+ /** Reserved attribute: phone number. Alias for `Attributes.setPhoneNumber(...)`. */
403
+ static setPhoneNumber = _attributes.Attributes.setPhoneNumber;
456
404
 
457
- /** Reserved attribute: push token. */
458
- static async setPushToken(pushToken) {
459
- await throwIfCoreNotConfigured();
460
- return (0, _module.getNativeModule)().setPushToken(pushToken);
461
- }
405
+ /** Reserved attribute: push token. Alias for `Attributes.setPushToken(...)`. */
406
+ static setPushToken = _attributes.Attributes.setPushToken;
462
407
 
463
- /** Set the native log level. Accepts a LOG_LEVEL enum value. */
464
- static async setLogLevel(level) {
465
- return (0, _module.getNativeModule)().setLogLevel(level);
466
- }
408
+ // MARK: - CustomerInfo listeners
409
+ //
410
+ // Store surface: these fire on purchase, renewal and dashboard grant, so they
411
+ // stay here rather than moving to the root.
467
412
 
468
413
  /** Subscribe to CustomerInfo changes (purchase, renewal, dashboard grant). */
469
414
  static addCustomerInfoUpdateListener(listener) {
@@ -489,9 +434,7 @@ class Purchases {
489
434
  * short-circuit before reaching the (freshly mocked) bridge.
490
435
  */
491
436
  static __resetForTests() {
492
- configured = false;
493
- coreConfigured = false;
494
- configuredApiKey = null;
437
+ (0, _config.resetConfigForTests)();
495
438
  customerInfoSubscriptions.clear();
496
439
  _identity.Identity.__resetForTests();
497
440
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_identity","require","_module","_spec","_types","configured","configuredApiKey","coreConfigured","nativeBoolean","read","Promise","resolve","getNativeModule","catch","customerInfoSubscriptions","Map","throwIfNotConfigured","UninitializedPurchasesError","throwIfCoreNotConfigured","native","isCoreConfigured","customerInfoAfterLogOut","isConfigured","getCustomerInfo","snapshot","Identity","current","emptyCustomerInfo","userId","anonymousId","subjectId","now","Date","entitlements","all","active","verification","VERIFICATION_RESULT","NOT_REQUESTED","activeSubscriptions","allPurchasedProductIdentifiers","allPurchaseDates","subscriptionsByProductIdentifier","nonSubscriptionTransactions","firstSeen","toISOString","firstSeenMillis","getTime","originalAppUserId","requestDate","requestDateMillis","latestExpirationDate","latestExpirationDateMillis","originalPurchaseDate","originalPurchaseDateMillis","originalApplicationVersion","managementURL","Purchases","configure","options","apiKey","nativeOptions","appUserID","proxyURL","diagnosticsEnabled","storeKitVersion","useAmazon","autoPromptATT","sendInstallOnFirstLaunch","logLevel","configureCore","getOfferings","purchasePackage","pkg","offeringId","presentedOfferingContext","offeringIdentifier","identifier","purchaseStoreProduct","product","restorePurchases","logIn","logOut","getAppUserID","isAnonymous","setAttributes","attributes","setEmail","email","setDisplayName","displayName","setPhoneNumber","phoneNumber","setPushToken","pushToken","setLogLevel","level","addCustomerInfoUpdateListener","listener","sub","getEventEmitter","addListener","CUSTOMER_INFO_UPDATED_EVENT","event","set","removeCustomerInfoUpdateListener","get","remove","delete","__resetForTests","clear","exports","_default","default"],"sourceRoot":"../../src","sources":["purchases.ts"],"mappings":";;;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAJA;;AAsBA,IAAII,UAAU,GAAG,KAAK;AACtB,IAAIC,gBAA+B,GAAG,IAAI;AAC1C,IAAIC,cAAc,GAAG,KAAK;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CACpBC,IAAmE,EACjD;EAClB,IAAI;IACF,OAAOC,OAAO,CAACC,OAAO,CAACF,IAAI,CAAC,IAAAG,uBAAe,EAAC,CAAC,CAAC,CAAC,CAACC,KAAK,C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IAC5C;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOW,eAAeA,CAAA,EAAS;IAC7BxG,UAAU,GAAG,KAAK;IAClBE,cAAc,GAAG,KAAK;IACtBD,gBAAgB,GAAG,IAAI;IACvBQ,yBAAyB,CAACgG,KAAK,CAAC,CAAC;IACjCrF,kBAAQ,CAACoF,eAAe,CAAC,CAAC;EAC5B;AACF;;AAEA;AAAAE,OAAA,CAAAtD,SAAA,GAAAA,SAAA;AAAA,IAAAuD,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAMexD,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_attributes","require","_identity","_config","_module","_spec","_types","customerInfoSubscriptions","Map","customerInfoAfterLogOut","nativeBoolean","native","isConfigured","getNativeModule","getCustomerInfo","snapshot","Identity","current","emptyCustomerInfo","userId","anonymousId","subjectId","now","Date","entitlements","all","active","verification","VERIFICATION_RESULT","NOT_REQUESTED","activeSubscriptions","allPurchasedProductIdentifiers","allPurchaseDates","subscriptionsByProductIdentifier","nonSubscriptionTransactions","firstSeen","toISOString","firstSeenMillis","getTime","originalAppUserId","requestDate","requestDateMillis","latestExpirationDate","latestExpirationDateMillis","originalPurchaseDate","originalPurchaseDateMillis","originalApplicationVersion","managementURL","Purchases","configure","configureCore","isCoreConfigured","setLogLevel","throwIfNotConfigured","getOfferings","purchasePackage","pkg","offeringId","presentedOfferingContext","offeringIdentifier","identifier","purchaseStoreProduct","product","restorePurchases","logIn","appUserID","throwIfCoreNotConfigured","logOut","getAppUserID","isAnonymous","setAttributes","Attributes","set","setEmail","setDisplayName","setPhoneNumber","setPushToken","addCustomerInfoUpdateListener","listener","sub","getEventEmitter","addListener","CUSTOMER_INFO_UPDATED_EVENT","event","removeCustomerInfoUpdateListener","get","remove","delete","__resetForTests","resetConfigForTests","clear","exports","_default","default"],"sourceRoot":"../../src","sources":["purchases.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,IAAAA,WAAA,GAAAC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C,uBAAe,EAAC,CAAC,CAACyC,YAAY,CAAC,CAAC;EACzC;;EAEA;EACA,aAAaC,eAAeA,CAACC,GAAqB,EAA+B;IAC/E,IAAAH,4BAAoB,EAAC,CAAC;IACtB,MAAMI,UAAU,GAAGD,GAAG,CAACE,wBAAwB,EAAEC,kBAAkB,IAAI,EAAE;IACzE,OAAO,IAAA9C,uBAAe,EAAC,CAAC,CAAC0C,eAAe,CAACC,GAAG,CAACI,UAAU,EAAEH,UAAU,CAAC;EACtE;;EAEA;EACA,aAAaI,oBAAoBA,CAC/BC,OAA8B,EACD;IAC7B,IAAAT,4BAAoB,EAAC,CAAC;IACtB,OAAO,IAAAxC,uBAAe,EAAC,CAAC,CAACgD,oBAAoB,CAACC,OAAO,CAACF,UAAU,CAAC;EACnE;;EAEA;EACA,aAAaG,gBAAgBA,CAAA,EAA0B;IACrD,IAAAV,4BAAoB,EAAC,CAAC;IACtB,OAAO,IAAAxC,uBAAe,EAAC,CAAC,CAACkD,gBAAgB,CAAC,CAAC;EAC7C;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,KAAKA,CAACC,SAAiB,EAAwB;IAC1D,MAAM,IAAAC,gCAAwB,EAAC,CAAC;IAChC,OAAOlD,kBAAQ,CAACgD,KAAK,CAACC,SAAS,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;AAC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