@revenuecat/purchases-typescript-internal 6.2.0 → 7.0.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.
@@ -52,6 +52,10 @@ export interface PurchasesEntitlementInfo {
52
52
  * The product identifier that unlocked this entitlement
53
53
  */
54
54
  readonly productIdentifier: string;
55
+ /**
56
+ * The product plan identifier that unlocked this entitlement. Android subscriptions only, null on consumables and iOS.
57
+ */
58
+ readonly productPlanIdentifier: string | null;
55
59
  /**
56
60
  * False if this entitlement is unlocked via a production purchase
57
61
  */
package/dist/enums.d.ts CHANGED
@@ -59,3 +59,24 @@ export declare enum LOG_LEVEL {
59
59
  WARN = "WARN",
60
60
  ERROR = "ERROR"
61
61
  }
62
+ /**
63
+ * Enum for in-app message types.
64
+ * This can be used if you disable automatic in-app message from showing automatically.
65
+ * Then, you can pass what type of messages you want to show in the `showInAppMessages`
66
+ * method in Purchases.
67
+ */
68
+ export declare enum IN_APP_MESSAGE_TYPE {
69
+ /**
70
+ * In-app messages to indicate there has been a billing issue charging the user.
71
+ */
72
+ BILLING_ISSUE = 0,
73
+ /**
74
+ * iOS-only. This message will show if you increase the price of a subscription and
75
+ * the user needs to opt-in to the increase.
76
+ */
77
+ PRICE_INCREASE_CONSENT = 1,
78
+ /**
79
+ * iOS-only. StoreKit generic messages.
80
+ */
81
+ GENERIC = 2
82
+ }
package/dist/enums.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOG_LEVEL = exports.REFUND_REQUEST_STATUS = exports.BILLING_FEATURE = exports.PURCHASE_TYPE = void 0;
3
+ exports.IN_APP_MESSAGE_TYPE = exports.LOG_LEVEL = exports.REFUND_REQUEST_STATUS = exports.BILLING_FEATURE = exports.PURCHASE_TYPE = void 0;
4
4
  /**
5
5
  * @deprecated, use PRODUCT_CATEGORY
6
6
  */
@@ -66,3 +66,26 @@ var LOG_LEVEL;
66
66
  LOG_LEVEL["WARN"] = "WARN";
67
67
  LOG_LEVEL["ERROR"] = "ERROR";
68
68
  })(LOG_LEVEL || (exports.LOG_LEVEL = LOG_LEVEL = {}));
69
+ /**
70
+ * Enum for in-app message types.
71
+ * This can be used if you disable automatic in-app message from showing automatically.
72
+ * Then, you can pass what type of messages you want to show in the `showInAppMessages`
73
+ * method in Purchases.
74
+ */
75
+ var IN_APP_MESSAGE_TYPE;
76
+ (function (IN_APP_MESSAGE_TYPE) {
77
+ // Make sure the enum values are in sync with those defined in iOS/Android
78
+ /**
79
+ * In-app messages to indicate there has been a billing issue charging the user.
80
+ */
81
+ IN_APP_MESSAGE_TYPE[IN_APP_MESSAGE_TYPE["BILLING_ISSUE"] = 0] = "BILLING_ISSUE";
82
+ /**
83
+ * iOS-only. This message will show if you increase the price of a subscription and
84
+ * the user needs to opt-in to the increase.
85
+ */
86
+ IN_APP_MESSAGE_TYPE[IN_APP_MESSAGE_TYPE["PRICE_INCREASE_CONSENT"] = 1] = "PRICE_INCREASE_CONSENT";
87
+ /**
88
+ * iOS-only. StoreKit generic messages.
89
+ */
90
+ IN_APP_MESSAGE_TYPE[IN_APP_MESSAGE_TYPE["GENERIC"] = 2] = "GENERIC";
91
+ })(IN_APP_MESSAGE_TYPE || (exports.IN_APP_MESSAGE_TYPE = IN_APP_MESSAGE_TYPE = {}));
@@ -94,6 +94,11 @@ export interface PurchasesStoreProduct {
94
94
  * Product category.
95
95
  */
96
96
  readonly productCategory: PRODUCT_CATEGORY | null;
97
+ /**
98
+ * The specific type of subscription or one time purchase this product represents.
99
+ * Important: In iOS, if using StoreKit 1, we cannot determine the type.
100
+ */
101
+ readonly productType: PRODUCT_TYPE;
97
102
  /**
98
103
  * Subscription period, specified in ISO 8601 format. For example,
99
104
  * P1W equates to one week, P1M equates to one month,
@@ -130,6 +135,32 @@ export declare enum PRODUCT_CATEGORY {
130
135
  */
131
136
  UNKNOWN = "UNKNOWN"
132
137
  }
138
+ export declare enum PRODUCT_TYPE {
139
+ /**
140
+ * A consumable in-app purchase.
141
+ */
142
+ CONSUMABLE = "CONSUMABLE",
143
+ /**
144
+ * A non-consumable in-app purchase. Only applies to Apple Store products.
145
+ */
146
+ NON_CONSUMABLE = "NON_CONSUMABLE",
147
+ /**
148
+ * A non-renewing subscription. Only applies to Apple Store products.
149
+ */
150
+ NON_RENEWABLE_SUBSCRIPTION = "NON_RENEWABLE_SUBSCRIPTION",
151
+ /**
152
+ * An auto-renewable subscription.
153
+ */
154
+ AUTO_RENEWABLE_SUBSCRIPTION = "AUTO_RENEWABLE_SUBSCRIPTION",
155
+ /**
156
+ * A subscription that is pre-paid. Only applies to Google Play products.
157
+ */
158
+ PREPAID_SUBSCRIPTION = "PREPAID_SUBSCRIPTION",
159
+ /**
160
+ * Unable to determine product type.
161
+ */
162
+ UNKNOWN = "UNKNOWN"
163
+ }
133
164
  export interface PurchasesStoreProductDiscount {
134
165
  /**
135
166
  * Identifier of the discount.
@@ -344,11 +375,6 @@ export declare enum PRORATION_MODE {
344
375
  * next recurrence time. The billing cycle stays the same.
345
376
  */
346
377
  IMMEDIATE_WITHOUT_PRORATION = 3,
347
- /**
348
- * Replacement takes effect when the old plan expires, and the new price will
349
- * be charged at the same time.
350
- */
351
- DEFERRED = 4,
352
378
  /**
353
379
  * Replacement takes effect immediately, and the user is charged full price
354
380
  * of new plan and is given a full billing cycle of subscription,
package/dist/offerings.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PERIOD_UNIT = exports.OFFER_PAYMENT_MODE = exports.RECURRENCE_MODE = exports.PRORATION_MODE = exports.PRODUCT_CATEGORY = exports.INTRO_ELIGIBILITY_STATUS = exports.PACKAGE_TYPE = void 0;
3
+ exports.PERIOD_UNIT = exports.OFFER_PAYMENT_MODE = exports.RECURRENCE_MODE = exports.PRORATION_MODE = exports.PRODUCT_TYPE = exports.PRODUCT_CATEGORY = exports.INTRO_ELIGIBILITY_STATUS = exports.PACKAGE_TYPE = void 0;
4
4
  var PACKAGE_TYPE;
5
5
  (function (PACKAGE_TYPE) {
6
6
  /**
@@ -74,6 +74,33 @@ var PRODUCT_CATEGORY;
74
74
  */
75
75
  PRODUCT_CATEGORY["UNKNOWN"] = "UNKNOWN";
76
76
  })(PRODUCT_CATEGORY || (exports.PRODUCT_CATEGORY = PRODUCT_CATEGORY = {}));
77
+ var PRODUCT_TYPE;
78
+ (function (PRODUCT_TYPE) {
79
+ /**
80
+ * A consumable in-app purchase.
81
+ */
82
+ PRODUCT_TYPE["CONSUMABLE"] = "CONSUMABLE";
83
+ /**
84
+ * A non-consumable in-app purchase. Only applies to Apple Store products.
85
+ */
86
+ PRODUCT_TYPE["NON_CONSUMABLE"] = "NON_CONSUMABLE";
87
+ /**
88
+ * A non-renewing subscription. Only applies to Apple Store products.
89
+ */
90
+ PRODUCT_TYPE["NON_RENEWABLE_SUBSCRIPTION"] = "NON_RENEWABLE_SUBSCRIPTION";
91
+ /**
92
+ * An auto-renewable subscription.
93
+ */
94
+ PRODUCT_TYPE["AUTO_RENEWABLE_SUBSCRIPTION"] = "AUTO_RENEWABLE_SUBSCRIPTION";
95
+ /**
96
+ * A subscription that is pre-paid. Only applies to Google Play products.
97
+ */
98
+ PRODUCT_TYPE["PREPAID_SUBSCRIPTION"] = "PREPAID_SUBSCRIPTION";
99
+ /**
100
+ * Unable to determine product type.
101
+ */
102
+ PRODUCT_TYPE["UNKNOWN"] = "UNKNOWN";
103
+ })(PRODUCT_TYPE || (exports.PRODUCT_TYPE = PRODUCT_TYPE = {}));
77
104
  var PRORATION_MODE;
78
105
  (function (PRORATION_MODE) {
79
106
  PRORATION_MODE[PRORATION_MODE["UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY"] = 0] = "UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY";
@@ -93,11 +120,6 @@ var PRORATION_MODE;
93
120
  * next recurrence time. The billing cycle stays the same.
94
121
  */
95
122
  PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITHOUT_PRORATION"] = 3] = "IMMEDIATE_WITHOUT_PRORATION";
96
- /**
97
- * Replacement takes effect when the old plan expires, and the new price will
98
- * be charged at the same time.
99
- */
100
- PRORATION_MODE[PRORATION_MODE["DEFERRED"] = 4] = "DEFERRED";
101
123
  /**
102
124
  * Replacement takes effect immediately, and the user is charged full price
103
125
  * of new plan and is given a full billing cycle of subscription,
@@ -38,4 +38,11 @@ export interface PurchasesConfiguration {
38
38
  * An optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore.
39
39
  */
40
40
  useAmazon?: boolean;
41
+ /**
42
+ * Whether we should show store in-app messages automatically. Both Google Play and the App Store provide in-app
43
+ * messages for some situations like billing issues. By default, those messages will be shown automatically.
44
+ * This allows to disable that behavior, so you can display those messages at your convenience. For more information,
45
+ * check: https://rev.cat/storekit-message and https://rev.cat/googleplayinappmessaging
46
+ */
47
+ shouldShowInAppMessagesAutomatically?: boolean;
41
48
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revenuecat/purchases-typescript-internal",
3
3
  "title": "Purchases typescript internal shared code",
4
- "version": "6.2.0",
4
+ "version": "7.0.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",