@revenuecat/purchases-typescript-internal-esm 13.21.0 → 13.23.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.
@@ -1,4 +1,19 @@
1
1
  import { VERIFICATION_RESULT } from "./enums";
2
+ /**
3
+ * The supported stores for purchases.
4
+ * @public
5
+ */
6
+ export type Store = "PLAY_STORE" | "APP_STORE" | "STRIPE" | "MAC_APP_STORE" | "PROMOTIONAL" | "AMAZON" | "RC_BILLING" | "EXTERNAL" | "UNKNOWN_STORE";
7
+ /**
8
+ * The supported ownership types for an entitlement.
9
+ * @public
10
+ */
11
+ export type OwnershipType = "PURCHASED" | "FAMILY_SHARED" | "UNKNOWN";
12
+ /**
13
+ * The supported period types for an entitlement.
14
+ * @public
15
+ */
16
+ export type PeriodType = "NORMAL" | "INTRO" | "TRIAL" | "PREPAID";
2
17
  /**
3
18
  * The EntitlementInfo object gives you access to all of the information about the status of a user entitlement.
4
19
  * @public
@@ -49,7 +64,7 @@ export interface PurchasesEntitlementInfo {
49
64
  /**
50
65
  * The store where this entitlement was unlocked from.
51
66
  */
52
- readonly store: "PLAY_STORE" | "APP_STORE" | "STRIPE" | "MAC_APP_STORE" | "PROMOTIONAL" | "AMAZON" | "RC_BILLING" | "EXTERNAL" | "UNKNOWN_STORE";
67
+ readonly store: Store;
53
68
  /**
54
69
  * The product identifier that unlocked this entitlement
55
70
  */
@@ -94,7 +109,7 @@ export interface PurchasesEntitlementInfo {
94
109
  * FAMILY_SHARED if the purchase has been shared to this user by a family member.
95
110
  * UNKNOWN if the purchase has no or an unknown ownership type.
96
111
  */
97
- readonly ownershipType: "FAMILY_SHARED" | "PURCHASED" | "UNKNOWN";
112
+ readonly ownershipType: OwnershipType;
98
113
  /**
99
114
  * If entitlement verification was enabled, the result of that verification. If not, VerificationResult.NOT_REQUESTED
100
115
  */
@@ -194,6 +209,12 @@ export interface CustomerInfo {
194
209
  * non-subscription purchases
195
210
  */
196
211
  readonly nonSubscriptionTransactions: PurchasesStoreTransaction[];
212
+ /**
213
+ * Information about the customer's subscriptions for each product identifier.
214
+ */
215
+ readonly subscriptionsByProductIdentifier: {
216
+ [key: string]: PurchasesSubscriptionInfo;
217
+ };
197
218
  }
198
219
  /**
199
220
  * Represents a non-subscription transaction in the Store.
@@ -213,3 +234,80 @@ export interface PurchasesStoreTransaction {
213
234
  */
214
235
  purchaseDate: string;
215
236
  }
237
+ /**
238
+ * Subscription purchases of the Customer.
239
+ * @public
240
+ */
241
+ export interface PurchasesSubscriptionInfo {
242
+ /**
243
+ * The product identifier.
244
+ */
245
+ readonly productIdentifier: string;
246
+ /**
247
+ * Date when the last subscription period started.
248
+ */
249
+ readonly purchaseDate: string;
250
+ /**
251
+ * Date when this subscription first started. This property does not update with renewals.
252
+ * This property also does not update for product changes within a subscription group or
253
+ * re-subscriptions by lapsed subscribers.
254
+ */
255
+ readonly originalPurchaseDate: string | null;
256
+ /**
257
+ * Date when the subscription expires/expired
258
+ */
259
+ readonly expiresDate: string | null;
260
+ /**
261
+ * Store where the subscription was purchased.
262
+ */
263
+ readonly store: Store;
264
+ /**
265
+ * Date when RevenueCat detected that auto-renewal was turned off for this subscription.
266
+ * Note the subscription may still be active, check the `expiresDate` attribute.
267
+ */
268
+ readonly unsubscribeDetectedAt: string | null;
269
+ /**
270
+ * Whether or not the purchase was made in sandbox mode.
271
+ */
272
+ readonly isSandbox: boolean;
273
+ /**
274
+ * Date when RevenueCat detected any billing issues with this subscription.
275
+ * If and when the billing issue gets resolved, this field is set to nil.
276
+ */
277
+ readonly billingIssuesDetectedAt: string | null;
278
+ /**
279
+ * Date when any grace period for this subscription expires/expired.
280
+ * nil if the customer has never been in a grace period.
281
+ */
282
+ readonly gracePeriodExpiresDate: string | null;
283
+ /**
284
+ * How the Customer received access to this subscription:
285
+ * - [OwnershipType.PURCHASED]: The customer bought the subscription.
286
+ * - [OwnershipType.FAMILY_SHARED]: The Customer has access to the product via their family.
287
+ */
288
+ readonly ownershipType: OwnershipType;
289
+ /**
290
+ * Type of the current subscription period:
291
+ * - [PeriodType.NORMAL]: The product is in a normal period (default)
292
+ * - [PeriodType.TRIAL]: The product is in a free trial period
293
+ * - [PeriodType.INTRO]: The product is in an introductory pricing period
294
+ * - [PeriodType.PREPAID]: The product is in a prepaid pricing period
295
+ */
296
+ readonly periodType: PeriodType;
297
+ /**
298
+ * Date when RevenueCat detected a refund of this subscription.
299
+ */
300
+ readonly refundedAt: string | null;
301
+ /**
302
+ * The transaction id in the store of the subscription.
303
+ */
304
+ readonly storeTransactionId: string | null;
305
+ /**
306
+ * Whether the subscription is currently active.
307
+ */
308
+ readonly isActive: boolean;
309
+ /**
310
+ * Whether the subscription will renew at the next billing period.
311
+ */
312
+ readonly willRenew: boolean;
313
+ }
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": "13.21.0",
4
+ "version": "13.23.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",