@revenuecat/purchases-typescript-internal-esm 20.6.1 → 20.8.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.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * A configured virtual currency reward, before an ad is watched or verified.
3
+ * @public
4
+ */
5
+ export interface VirtualCurrencyRewardConfiguration {
6
+ /** Identifies a virtual currency reward. */
7
+ readonly type: 'virtual_currency';
8
+ /** The virtual currency code defined in the RevenueCat dashboard. */
9
+ readonly code: string;
10
+ /** The positive integer amount configured to be granted. */
11
+ readonly amount: number;
12
+ }
13
+ /**
14
+ * A configured entitlement reward. This describes a duration, not a grant expiration.
15
+ * @public
16
+ */
17
+ export interface EntitlementRewardConfiguration {
18
+ /** Identifies an entitlement reward. */
19
+ readonly type: 'entitlement';
20
+ /** The entitlement identifier defined in the RevenueCat dashboard. */
21
+ readonly identifier: string;
22
+ /** The configured entitlement duration in seconds. */
23
+ readonly durationSeconds: number;
24
+ }
25
+ /**
26
+ * A reward shape the native SDK does not currently model.
27
+ * @public
28
+ */
29
+ export interface UnsupportedAdRewardConfiguration {
30
+ /** Identifies a reward the native SDK cannot represent. */
31
+ readonly type: 'unsupported_reward';
32
+ }
33
+ /**
34
+ * A configured reward, separate from the authoritative reward granted after verification.
35
+ * Unknown native reward types are preserved as unsupported_reward.
36
+ * @public
37
+ */
38
+ export type AdRewardConfiguration = VirtualCurrencyRewardConfiguration | EntitlementRewardConfiguration | UnsupportedAdRewardConfiguration;
39
+ /**
40
+ * Successfully resolved rewards for an exact, case-sensitive ad unit ID.
41
+ * A null accessor result means configuration is unavailable or malformed, or the ad unit ID is empty.
42
+ * A null primary reward with an empty moreRewards array means no reward is configured.
43
+ * Additional rewards retain their configured order.
44
+ * @public
45
+ */
46
+ export type ConfiguredAdRewards = {
47
+ /** The primary configured reward. */
48
+ readonly reward: AdRewardConfiguration;
49
+ /** Additional rewards configured alongside the primary reward, in their configured order. */
50
+ readonly moreRewards: readonly AdRewardConfiguration[];
51
+ } | {
52
+ /** No primary reward is configured for the ad unit. */
53
+ readonly reward: null;
54
+ /** Empty when no reward is configured. */
55
+ readonly moreRewards: readonly [];
56
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,67 @@
1
+ import { PurchasesError } from "./errors";
2
+ /**
3
+ * The identity providers accepted by IAM login.
4
+ *
5
+ * @experimental This API is experimental and may be changed or removed in a future release.
6
+ * @public
7
+ */
8
+ export declare enum IDENTITY_SOURCE {
9
+ /**
10
+ * Sign in with Apple.
11
+ */
12
+ SIGN_IN_WITH_APPLE = "apple",
13
+ /**
14
+ * A generic OpenID Connect provider.
15
+ */
16
+ OIDC = "oidc",
17
+ /**
18
+ * Google Sign-In.
19
+ */
20
+ GOOGLE = "google",
21
+ /**
22
+ * Firebase Authentication.
23
+ */
24
+ FIREBASE = "firebase",
25
+ /**
26
+ * Facebook Login. Android-only for now: iOS returns an `UNSUPPORTED_ERROR`.
27
+ */
28
+ FACEBOOK = "facebook"
29
+ }
30
+ /**
31
+ * An identity from an external provider, to log in with through IAM. Requires configuring the SDK
32
+ * with `iamEnabled`.
33
+ *
34
+ * @experimental This API is experimental and may be changed or removed in a future release.
35
+ * @public
36
+ */
37
+ export interface IdentityCredential {
38
+ /**
39
+ * The provider the user signed in with.
40
+ */
41
+ source: IDENTITY_SOURCE;
42
+ /**
43
+ * The raw ID token the provider returned.
44
+ */
45
+ token: string;
46
+ /**
47
+ * The user's email, for {@link IDENTITY_SOURCE.FACEBOOK} only, if the app was granted the `email`
48
+ * permission.
49
+ */
50
+ email?: string;
51
+ }
52
+ /**
53
+ * Hears about IAM authentication errors that no explicit call reports, such as a failed token
54
+ * refresh. After one, treat every access token received so far as invalid.
55
+ *
56
+ * @experimental This API is experimental and may be changed or removed in a future release.
57
+ * @public
58
+ */
59
+ export type AuthenticationErrorListener = (error: PurchasesError) => void;
60
+ /**
61
+ * Hears about changes to the current user's IAM access token: a new one after login or refresh, or
62
+ * `null` once cleared.
63
+ *
64
+ * @experimental This API is experimental and may be changed or removed in a future release.
65
+ * @public
66
+ */
67
+ export type AccessTokenUpdatedListener = (accessToken: string | null) => void;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The identity providers accepted by IAM login.
3
+ *
4
+ * @experimental This API is experimental and may be changed or removed in a future release.
5
+ * @public
6
+ */
7
+ export var IDENTITY_SOURCE;
8
+ (function (IDENTITY_SOURCE) {
9
+ /**
10
+ * Sign in with Apple.
11
+ */
12
+ IDENTITY_SOURCE["SIGN_IN_WITH_APPLE"] = "apple";
13
+ /**
14
+ * A generic OpenID Connect provider.
15
+ */
16
+ IDENTITY_SOURCE["OIDC"] = "oidc";
17
+ /**
18
+ * Google Sign-In.
19
+ */
20
+ IDENTITY_SOURCE["GOOGLE"] = "google";
21
+ /**
22
+ * Firebase Authentication.
23
+ */
24
+ IDENTITY_SOURCE["FIREBASE"] = "firebase";
25
+ /**
26
+ * Facebook Login. Android-only for now: iOS returns an `UNSUPPORTED_ERROR`.
27
+ */
28
+ IDENTITY_SOURCE["FACEBOOK"] = "facebook";
29
+ })(IDENTITY_SOURCE || (IDENTITY_SOURCE = {}));
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A subscriber attribute of the current user.
3
+ *
4
+ * @experimental This API is experimental and may be changed or removed in a future release.
5
+ * @public
6
+ */
7
+ export interface CustomerAttribute {
8
+ /**
9
+ * The attribute's key. Keys that begin with `$` are reserved by RevenueCat.
10
+ */
11
+ readonly key: string;
12
+ /**
13
+ * The attribute's value.
14
+ */
15
+ readonly value: string;
16
+ /**
17
+ * When the value was last modified, as an ISO 8601 date string.
18
+ */
19
+ readonly lastUpdatedDate: string;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -10,3 +10,6 @@ export * from './webRedemption';
10
10
  export * from './storefront';
11
11
  export * from './virtualCurrency';
12
12
  export * from './paywallInteractionEvent';
13
+ export * from './adRewards';
14
+ export * from './authentication';
15
+ export * from './customerAttribute';
package/dist/index.js CHANGED
@@ -10,3 +10,6 @@ export * from './webRedemption';
10
10
  export * from './storefront';
11
11
  export * from './virtualCurrency';
12
12
  export * from './paywallInteractionEvent';
13
+ export * from './adRewards';
14
+ export * from './authentication';
15
+ export * from './customerAttribute';
@@ -113,4 +113,22 @@ export interface PurchasesConfiguration {
113
113
  * @experimental This API is experimental and may be changed or removed in a future release.
114
114
  */
115
115
  enableExternalPurchasesInSimulator?: boolean;
116
+ /**
117
+ * Whether the SDK prefers token-based (IAM) user sessions. Required for logging in with an
118
+ * {@link IdentityCredential}.
119
+ *
120
+ * Disabled by default.
121
+ *
122
+ * @experimental This API is experimental and may be changed or removed in a future release.
123
+ */
124
+ iamEnabled?: boolean;
125
+ /**
126
+ * iOS-only, will be ignored for Android.
127
+ *
128
+ * The keychain access group IAM tokens are stored in, to share them with app extensions. Ignored
129
+ * unless `iamEnabled` is `true`.
130
+ *
131
+ * @experimental This API is experimental and may be changed or removed in a future release.
132
+ */
133
+ keychainAccessGroup?: string;
116
134
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revenuecat/purchases-typescript-internal-esm",
3
3
  "title": "Purchases typescript internal shared code",
4
- "version": "20.6.1",
4
+ "version": "20.8.0",
5
5
  "description": "Typescript code to be used by RevenueCat's hybrid SDKs. Not meant for external usage.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",