@shware/purchase 2.0.1 → 3.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.
@@ -3,117 +3,112 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  /**
4
4
  * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
5
5
  * */
6
- let SubscriptionNotificationType = /* @__PURE__ */ function(SubscriptionNotificationType) {
6
+ const SubscriptionNotificationType = {
7
7
  /** A subscription was recovered from account hold. */
8
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RECOVERED"] = 1] = "SUBSCRIPTION_RECOVERED";
8
+ SUBSCRIPTION_RECOVERED: 1,
9
9
  /** An active subscription was renewed. */
10
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RENEWED"] = 2] = "SUBSCRIPTION_RENEWED";
10
+ SUBSCRIPTION_RENEWED: 2,
11
11
  /**
12
12
  * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
13
13
  * sent when the user cancels.
14
14
  */
15
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_CANCELED"] = 3] = "SUBSCRIPTION_CANCELED";
15
+ SUBSCRIPTION_CANCELED: 3,
16
16
  /** A new subscription was purchased. */
17
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PURCHASED"] = 4] = "SUBSCRIPTION_PURCHASED";
17
+ SUBSCRIPTION_PURCHASED: 4,
18
18
  /** A subscription has entered account hold (if enabled). */
19
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_ON_HOLD"] = 5] = "SUBSCRIPTION_ON_HOLD";
19
+ SUBSCRIPTION_ON_HOLD: 5,
20
20
  /** A subscription has entered grace period (if enabled). */
21
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_IN_GRACE_PERIOD"] = 6] = "SUBSCRIPTION_IN_GRACE_PERIOD";
21
+ SUBSCRIPTION_IN_GRACE_PERIOD: 6,
22
22
  /**
23
23
  * User has restored their subscription from Play > Account > Subscriptions. The subscription was
24
24
  * canceled but had not expired yet when the user restores. For more information, see Restorations.
25
25
  */
26
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RESTARTED"] = 7] = "SUBSCRIPTION_RESTARTED";
26
+ SUBSCRIPTION_RESTARTED: 7,
27
27
  /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */
28
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PRICE_CHANGE_CONFIRMED"] = 8] = "SUBSCRIPTION_PRICE_CHANGE_CONFIRMED";
28
+ SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8,
29
29
  /** A subscription's recurrence time has been extended. */
30
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_DEFERRED"] = 9] = "SUBSCRIPTION_DEFERRED";
30
+ SUBSCRIPTION_DEFERRED: 9,
31
31
  /** A subscription has been paused. */
32
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PAUSED"] = 10] = "SUBSCRIPTION_PAUSED";
32
+ SUBSCRIPTION_PAUSED: 10,
33
33
  /** A subscription pause schedule has been changed. */
34
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED"] = 11] = "SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED";
34
+ SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11,
35
35
  /** A subscription has been revoked from the user before the expiration time. */
36
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_REVOKED"] = 12] = "SUBSCRIPTION_REVOKED";
36
+ SUBSCRIPTION_REVOKED: 12,
37
37
  /** A subscription has expired. */
38
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_EXPIRED"] = 13] = "SUBSCRIPTION_EXPIRED";
38
+ SUBSCRIPTION_EXPIRED: 13,
39
39
  /** A subscription item's price change details are updated. */
40
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PRICE_CHANGE_UPDATED"] = 19] = "SUBSCRIPTION_PRICE_CHANGE_UPDATED";
40
+ SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19,
41
41
  /** A pending transaction of a subscription has been canceled. */
42
- SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PENDING_PURCHASE_CANCELED"] = 20] = "SUBSCRIPTION_PENDING_PURCHASE_CANCELED";
43
- return SubscriptionNotificationType;
44
- }({});
45
- let OneTimeProductNotificationType = /* @__PURE__ */ function(OneTimeProductNotificationType) {
42
+ SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20
43
+ };
44
+ const OneTimeProductNotificationType = {
46
45
  /** A one-time product was successfully purchased by a user. */
47
- OneTimeProductNotificationType[OneTimeProductNotificationType["ONE_TIME_PRODUCT_PURCHASED"] = 1] = "ONE_TIME_PRODUCT_PURCHASED";
46
+ ONE_TIME_PRODUCT_PURCHASED: 1,
48
47
  /** A pending one-time product purchase has been canceled by the user. */
49
- OneTimeProductNotificationType[OneTimeProductNotificationType["ONE_TIME_PRODUCT_CANCELED"] = 2] = "ONE_TIME_PRODUCT_CANCELED";
50
- return OneTimeProductNotificationType;
51
- }({});
52
- let VoidedPurchaseProductType = /* @__PURE__ */ function(VoidedPurchaseProductType) {
48
+ ONE_TIME_PRODUCT_CANCELED: 2
49
+ };
50
+ const VoidedPurchaseProductType = {
53
51
  /** A subscription purchase has been voided. */
54
- VoidedPurchaseProductType[VoidedPurchaseProductType["PRODUCT_TYPE_SUBSCRIPTION"] = 1] = "PRODUCT_TYPE_SUBSCRIPTION";
52
+ PRODUCT_TYPE_SUBSCRIPTION: 1,
55
53
  /** A one-time purchase has been voided. */
56
- VoidedPurchaseProductType[VoidedPurchaseProductType["PRODUCT_TYPE_ONE_TIME"] = 2] = "PRODUCT_TYPE_ONE_TIME";
57
- return VoidedPurchaseProductType;
58
- }({});
54
+ PRODUCT_TYPE_ONE_TIME: 2
55
+ };
59
56
  /**
60
57
  * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
61
58
  * will be REFUND_TYPE_FULL_REFUND.
62
59
  */
63
- let VoidedPurchaseRefundType = /* @__PURE__ */ function(VoidedPurchaseRefundType) {
60
+ const VoidedPurchaseRefundType = {
64
61
  /** The purchase has been fully voided. */
65
- VoidedPurchaseRefundType[VoidedPurchaseRefundType["REFUND_TYPE_FULL_REFUND"] = 1] = "REFUND_TYPE_FULL_REFUND";
62
+ REFUND_TYPE_FULL_REFUND: 1,
66
63
  /**
67
64
  * The purchase has been partially voided by a quantity-based partial refund, applicable only to
68
65
  * multi-quantity purchases. A purchase can be partially voided multiple times.
69
66
  */
70
- VoidedPurchaseRefundType[VoidedPurchaseRefundType["REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND"] = 2] = "REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND";
71
- return VoidedPurchaseRefundType;
72
- }({});
67
+ REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2
68
+ };
73
69
  /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
74
- let GooglePlaySubscriptionState = /* @__PURE__ */ function(GooglePlaySubscriptionState) {
70
+ const GooglePlaySubscriptionState = {
75
71
  /** Unspecified subscription state. */
76
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_UNSPECIFIED"] = "SUBSCRIPTION_STATE_UNSPECIFIED";
72
+ SUBSCRIPTION_STATE_UNSPECIFIED: "SUBSCRIPTION_STATE_UNSPECIFIED",
77
73
  /**
78
74
  * Subscription was created but awaiting payment during signup. In this state, all items are
79
75
  * awaiting payment.
80
76
  */
81
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PENDING"] = "SUBSCRIPTION_STATE_PENDING";
77
+ SUBSCRIPTION_STATE_PENDING: "SUBSCRIPTION_STATE_PENDING",
82
78
  /**
83
79
  * Subscription is active.
84
80
  * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
85
81
  * (2) If the subscription is a prepaid plan, at least one item is not expired.
86
82
  */
87
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_ACTIVE"] = "SUBSCRIPTION_STATE_ACTIVE";
83
+ SUBSCRIPTION_STATE_ACTIVE: "SUBSCRIPTION_STATE_ACTIVE",
88
84
  /**
89
85
  * Subscription is paused. The state is only available when the subscription is an auto renewing
90
86
  * plan. In this state, all items are in paused state.
91
87
  */
92
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PAUSED"] = "SUBSCRIPTION_STATE_PAUSED";
88
+ SUBSCRIPTION_STATE_PAUSED: "SUBSCRIPTION_STATE_PAUSED",
93
89
  /**
94
90
  * Subscription is in grace period. The state is only available when the subscription is an auto
95
91
  * renewing plan. In this state, all items are in grace period.
96
92
  */
97
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_IN_GRACE_PERIOD"] = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD";
93
+ SUBSCRIPTION_STATE_IN_GRACE_PERIOD: "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
98
94
  /**
99
95
  * Subscription is on hold (suspended). The state is only available when the subscription is an
100
96
  * auto renewing plan. In this state, all items are on hold.
101
97
  */
102
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_ON_HOLD"] = "SUBSCRIPTION_STATE_ON_HOLD";
98
+ SUBSCRIPTION_STATE_ON_HOLD: "SUBSCRIPTION_STATE_ON_HOLD",
103
99
  /**
104
100
  * Subscription is canceled but not expired yet. The state is only available when the subscription
105
101
  * is an auto renewing plan. All items have autoRenewEnabled set to false.
106
102
  */
107
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_CANCELED"] = "SUBSCRIPTION_STATE_CANCELED";
103
+ SUBSCRIPTION_STATE_CANCELED: "SUBSCRIPTION_STATE_CANCELED",
108
104
  /** Subscription is expired. All items have expiryTime in the past. */
109
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_EXPIRED"] = "SUBSCRIPTION_STATE_EXPIRED";
105
+ SUBSCRIPTION_STATE_EXPIRED: "SUBSCRIPTION_STATE_EXPIRED",
110
106
  /**
111
107
  * Pending transaction for subscription is canceled. If this pending purchase was for an existing
112
108
  * subscription, use linkedPurchaseToken to get the current state of that subscription.
113
109
  */
114
- GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"] = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED";
115
- return GooglePlaySubscriptionState;
116
- }({});
110
+ SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED: "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
111
+ };
117
112
  //#endregion
118
113
  exports.GooglePlaySubscriptionState = GooglePlaySubscriptionState;
119
114
  exports.OneTimeProductNotificationType = OneTimeProductNotificationType;
@@ -1 +1 @@
1
- {"version":3,"file":"real-time-developer-notification.cjs","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"sourcesContent":["// ref: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage\nexport type PubsubMessage = {\n data: string;\n attributes: Record<string, string>;\n messageId: string;\n publishTime: string;\n orderingKey: string;\n};\n\n/** https://developer.android.com/google/play/billing/rtdn-reference */\nexport interface DeveloperNotification {\n version: string;\n packageName: string;\n eventTimeMillis: number;\n subscriptionNotification: SubscriptionNotification;\n oneTimeProductNotification: OneTimeProductNotification;\n voidedPurchaseNotification: VoidedPurchaseNotification;\n testNotification: TestNotification;\n}\n\n/**\n * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)\n * */\nexport enum SubscriptionNotificationType {\n /** A subscription was recovered from account hold. */\n SUBSCRIPTION_RECOVERED = 1,\n\n /** An active subscription was renewed. */\n SUBSCRIPTION_RENEWED = 2,\n\n /**\n * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,\n * sent when the user cancels.\n */\n SUBSCRIPTION_CANCELED = 3,\n\n /** A new subscription was purchased. */\n SUBSCRIPTION_PURCHASED = 4,\n\n /** A subscription has entered account hold (if enabled). */\n SUBSCRIPTION_ON_HOLD = 5,\n\n /** A subscription has entered grace period (if enabled). */\n SUBSCRIPTION_IN_GRACE_PERIOD = 6,\n\n /**\n * User has restored their subscription from Play > Account > Subscriptions. The subscription was\n * canceled but had not expired yet when the user restores. For more information, see Restorations.\n */\n SUBSCRIPTION_RESTARTED = 7,\n\n /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */\n SUBSCRIPTION_PRICE_CHANGE_CONFIRMED = 8,\n\n /** A subscription's recurrence time has been extended. */\n SUBSCRIPTION_DEFERRED = 9,\n\n /** A subscription has been paused. */\n SUBSCRIPTION_PAUSED = 10,\n\n /** A subscription pause schedule has been changed. */\n SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED = 11,\n\n /** A subscription has been revoked from the user before the expiration time. */\n SUBSCRIPTION_REVOKED = 12,\n\n /** A subscription has expired. */\n SUBSCRIPTION_EXPIRED = 13,\n\n /** A subscription item's price change details are updated. */\n SUBSCRIPTION_PRICE_CHANGE_UPDATED = 19,\n\n /** A pending transaction of a subscription has been canceled. */\n SUBSCRIPTION_PENDING_PURCHASE_CANCELED = 20,\n}\n\nexport interface SubscriptionNotification {\n version: string;\n purchaseToken: string;\n notificationType: SubscriptionNotificationType;\n}\n\nexport enum OneTimeProductNotificationType {\n /** A one-time product was successfully purchased by a user. */\n ONE_TIME_PRODUCT_PURCHASED = 1,\n\n /** A pending one-time product purchase has been canceled by the user. */\n ONE_TIME_PRODUCT_CANCELED = 2,\n}\n\nexport interface OneTimeProductNotification {\n version: string;\n sku: string;\n purchaseToken: string;\n notificationType: OneTimeProductNotificationType;\n}\n\nexport enum VoidedPurchaseProductType {\n /** A subscription purchase has been voided. */\n PRODUCT_TYPE_SUBSCRIPTION = 1,\n\n /** A one-time purchase has been voided. */\n PRODUCT_TYPE_ONE_TIME = 2,\n}\n\n/**\n * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType\n * will be REFUND_TYPE_FULL_REFUND.\n */\nexport enum VoidedPurchaseRefundType {\n /** The purchase has been fully voided. */\n REFUND_TYPE_FULL_REFUND = 1,\n\n /**\n * The purchase has been partially voided by a quantity-based partial refund, applicable only to\n * multi-quantity purchases. A purchase can be partially voided multiple times.\n */\n REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND = 2,\n}\n\nexport interface VoidedPurchaseNotification {\n purchaseToken: string;\n orderId: string;\n productType: VoidedPurchaseProductType;\n refundType: VoidedPurchaseRefundType;\n}\n\nexport interface TestNotification {\n version: string;\n}\n\n/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */\nexport enum GooglePlaySubscriptionState {\n /** Unspecified subscription state. */\n SUBSCRIPTION_STATE_UNSPECIFIED = 'SUBSCRIPTION_STATE_UNSPECIFIED',\n\n /**\n * Subscription was created but awaiting payment during signup. In this state, all items are\n * awaiting payment.\n */\n SUBSCRIPTION_STATE_PENDING = 'SUBSCRIPTION_STATE_PENDING',\n\n /**\n * Subscription is active.\n * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.\n * (2) If the subscription is a prepaid plan, at least one item is not expired.\n */\n SUBSCRIPTION_STATE_ACTIVE = 'SUBSCRIPTION_STATE_ACTIVE',\n\n /**\n * Subscription is paused. The state is only available when the subscription is an auto renewing\n * plan. In this state, all items are in paused state.\n */\n SUBSCRIPTION_STATE_PAUSED = 'SUBSCRIPTION_STATE_PAUSED',\n\n /**\n * Subscription is in grace period. The state is only available when the subscription is an auto\n * renewing plan. In this state, all items are in grace period.\n */\n SUBSCRIPTION_STATE_IN_GRACE_PERIOD = 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD',\n\n /**\n * Subscription is on hold (suspended). The state is only available when the subscription is an\n * auto renewing plan. In this state, all items are on hold.\n */\n SUBSCRIPTION_STATE_ON_HOLD = 'SUBSCRIPTION_STATE_ON_HOLD',\n\n /**\n * Subscription is canceled but not expired yet. The state is only available when the subscription\n * is an auto renewing plan. All items have autoRenewEnabled set to false.\n */\n SUBSCRIPTION_STATE_CANCELED = 'SUBSCRIPTION_STATE_CANCELED',\n\n /** Subscription is expired. All items have expiryTime in the past. */\n SUBSCRIPTION_STATE_EXPIRED = 'SUBSCRIPTION_STATE_EXPIRED',\n\n /**\n * Pending transaction for subscription is canceled. If this pending purchase was for an existing\n * subscription, use linkedPurchaseToken to get the current state of that subscription.\n */\n SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED = 'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED',\n}\n"],"mappings":";;;;;AAuBA,IAAY,+BAAL,yBAAA,8BAAA;;CAEL,6BAAA,6BAAA,4BAAA,KAAA;;CAGA,6BAAA,6BAAA,0BAAA,KAAA;;;;;CAMA,6BAAA,6BAAA,2BAAA,KAAA;;CAGA,6BAAA,6BAAA,4BAAA,KAAA;;CAGA,6BAAA,6BAAA,0BAAA,KAAA;;CAGA,6BAAA,6BAAA,kCAAA,KAAA;;;;;CAMA,6BAAA,6BAAA,4BAAA,KAAA;;CAGA,6BAAA,6BAAA,yCAAA,KAAA;;CAGA,6BAAA,6BAAA,2BAAA,KAAA;;CAGA,6BAAA,6BAAA,yBAAA,MAAA;;CAGA,6BAAA,6BAAA,yCAAA,MAAA;;CAGA,6BAAA,6BAAA,0BAAA,MAAA;;CAGA,6BAAA,6BAAA,0BAAA,MAAA;;CAGA,6BAAA,6BAAA,uCAAA,MAAA;;CAGA,6BAAA,6BAAA,4CAAA,MAAA;;AACF,EAAA,CAAA,CAAA;AAQA,IAAY,iCAAL,yBAAA,gCAAA;;CAEL,+BAAA,+BAAA,gCAAA,KAAA;;CAGA,+BAAA,+BAAA,+BAAA,KAAA;;AACF,EAAA,CAAA,CAAA;AASA,IAAY,4BAAL,yBAAA,2BAAA;;CAEL,0BAAA,0BAAA,+BAAA,KAAA;;CAGA,0BAAA,0BAAA,2BAAA,KAAA;;AACF,EAAA,CAAA,CAAA;;;;;AAMA,IAAY,2BAAL,yBAAA,0BAAA;;CAEL,yBAAA,yBAAA,6BAAA,KAAA;;;;;CAMA,yBAAA,yBAAA,+CAAA,KAAA;;AACF,EAAA,CAAA,CAAA;;AAcA,IAAY,8BAAL,yBAAA,6BAAA;;CAEL,4BAAA,oCAAA;;;;;CAMA,4BAAA,gCAAA;;;;;;CAOA,4BAAA,+BAAA;;;;;CAMA,4BAAA,+BAAA;;;;;CAMA,4BAAA,wCAAA;;;;;CAMA,4BAAA,gCAAA;;;;;CAMA,4BAAA,iCAAA;;CAGA,4BAAA,gCAAA;;;;;CAMA,4BAAA,kDAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"real-time-developer-notification.cjs","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"sourcesContent":["// ref: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage\nexport type PubsubMessage = {\n data: string;\n attributes: Record<string, string>;\n messageId: string;\n publishTime: string;\n orderingKey: string;\n};\n\n/** https://developer.android.com/google/play/billing/rtdn-reference */\nexport interface DeveloperNotification {\n version: string;\n packageName: string;\n eventTimeMillis: number;\n subscriptionNotification: SubscriptionNotification;\n oneTimeProductNotification: OneTimeProductNotification;\n voidedPurchaseNotification: VoidedPurchaseNotification;\n testNotification: TestNotification;\n}\n\n/**\n * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)\n * */\nexport const SubscriptionNotificationType = {\n /** A subscription was recovered from account hold. */\n SUBSCRIPTION_RECOVERED: 1,\n\n /** An active subscription was renewed. */\n SUBSCRIPTION_RENEWED: 2,\n\n /**\n * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,\n * sent when the user cancels.\n */\n SUBSCRIPTION_CANCELED: 3,\n\n /** A new subscription was purchased. */\n SUBSCRIPTION_PURCHASED: 4,\n\n /** A subscription has entered account hold (if enabled). */\n SUBSCRIPTION_ON_HOLD: 5,\n\n /** A subscription has entered grace period (if enabled). */\n SUBSCRIPTION_IN_GRACE_PERIOD: 6,\n\n /**\n * User has restored their subscription from Play > Account > Subscriptions. The subscription was\n * canceled but had not expired yet when the user restores. For more information, see Restorations.\n */\n SUBSCRIPTION_RESTARTED: 7,\n\n /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */\n SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8,\n\n /** A subscription's recurrence time has been extended. */\n SUBSCRIPTION_DEFERRED: 9,\n\n /** A subscription has been paused. */\n SUBSCRIPTION_PAUSED: 10,\n\n /** A subscription pause schedule has been changed. */\n SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11,\n\n /** A subscription has been revoked from the user before the expiration time. */\n SUBSCRIPTION_REVOKED: 12,\n\n /** A subscription has expired. */\n SUBSCRIPTION_EXPIRED: 13,\n\n /** A subscription item's price change details are updated. */\n SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19,\n\n /** A pending transaction of a subscription has been canceled. */\n SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20,\n} as const;\n\nexport type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];\n\nexport interface SubscriptionNotification {\n version: string;\n purchaseToken: string;\n notificationType: SubscriptionNotificationType;\n}\n\nexport const OneTimeProductNotificationType = {\n /** A one-time product was successfully purchased by a user. */\n ONE_TIME_PRODUCT_PURCHASED: 1,\n\n /** A pending one-time product purchase has been canceled by the user. */\n ONE_TIME_PRODUCT_CANCELED: 2,\n} as const;\n\nexport type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];\n\nexport interface OneTimeProductNotification {\n version: string;\n sku: string;\n purchaseToken: string;\n notificationType: OneTimeProductNotificationType;\n}\n\nexport const VoidedPurchaseProductType = {\n /** A subscription purchase has been voided. */\n PRODUCT_TYPE_SUBSCRIPTION: 1,\n\n /** A one-time purchase has been voided. */\n PRODUCT_TYPE_ONE_TIME: 2,\n} as const;\n\nexport type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];\n\n/**\n * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType\n * will be REFUND_TYPE_FULL_REFUND.\n */\nexport const VoidedPurchaseRefundType = {\n /** The purchase has been fully voided. */\n REFUND_TYPE_FULL_REFUND: 1,\n\n /**\n * The purchase has been partially voided by a quantity-based partial refund, applicable only to\n * multi-quantity purchases. A purchase can be partially voided multiple times.\n */\n REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2,\n} as const;\n\nexport type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];\n\nexport interface VoidedPurchaseNotification {\n purchaseToken: string;\n orderId: string;\n productType: VoidedPurchaseProductType;\n refundType: VoidedPurchaseRefundType;\n}\n\nexport interface TestNotification {\n version: string;\n}\n\n/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */\nexport const GooglePlaySubscriptionState = {\n /** Unspecified subscription state. */\n SUBSCRIPTION_STATE_UNSPECIFIED: 'SUBSCRIPTION_STATE_UNSPECIFIED',\n\n /**\n * Subscription was created but awaiting payment during signup. In this state, all items are\n * awaiting payment.\n */\n SUBSCRIPTION_STATE_PENDING: 'SUBSCRIPTION_STATE_PENDING',\n\n /**\n * Subscription is active.\n * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.\n * (2) If the subscription is a prepaid plan, at least one item is not expired.\n */\n SUBSCRIPTION_STATE_ACTIVE: 'SUBSCRIPTION_STATE_ACTIVE',\n\n /**\n * Subscription is paused. The state is only available when the subscription is an auto renewing\n * plan. In this state, all items are in paused state.\n */\n SUBSCRIPTION_STATE_PAUSED: 'SUBSCRIPTION_STATE_PAUSED',\n\n /**\n * Subscription is in grace period. The state is only available when the subscription is an auto\n * renewing plan. In this state, all items are in grace period.\n */\n SUBSCRIPTION_STATE_IN_GRACE_PERIOD: 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD',\n\n /**\n * Subscription is on hold (suspended). The state is only available when the subscription is an\n * auto renewing plan. In this state, all items are on hold.\n */\n SUBSCRIPTION_STATE_ON_HOLD: 'SUBSCRIPTION_STATE_ON_HOLD',\n\n /**\n * Subscription is canceled but not expired yet. The state is only available when the subscription\n * is an auto renewing plan. All items have autoRenewEnabled set to false.\n */\n SUBSCRIPTION_STATE_CANCELED: 'SUBSCRIPTION_STATE_CANCELED',\n\n /** Subscription is expired. All items have expiryTime in the past. */\n SUBSCRIPTION_STATE_EXPIRED: 'SUBSCRIPTION_STATE_EXPIRED',\n\n /**\n * Pending transaction for subscription is canceled. If this pending purchase was for an existing\n * subscription, use linkedPurchaseToken to get the current state of that subscription.\n */\n SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED: 'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED',\n} as const;\n\nexport type GooglePlaySubscriptionState = (typeof GooglePlaySubscriptionState)[keyof typeof GooglePlaySubscriptionState];\n"],"mappings":";;;;;AAuBA,MAAa,+BAA+B;;CAE1C,wBAAwB;;CAGxB,sBAAsB;;;;;CAMtB,uBAAuB;;CAGvB,wBAAwB;;CAGxB,sBAAsB;;CAGtB,8BAA8B;;;;;CAM9B,wBAAwB;;CAGxB,qCAAqC;;CAGrC,uBAAuB;;CAGvB,qBAAqB;;CAGrB,qCAAqC;;CAGrC,sBAAsB;;CAGtB,sBAAsB;;CAGtB,mCAAmC;;CAGnC,wCAAwC;AAC1C;AAUA,MAAa,iCAAiC;;CAE5C,4BAA4B;;CAG5B,2BAA2B;AAC7B;AAWA,MAAa,4BAA4B;;CAEvC,2BAA2B;;CAG3B,uBAAuB;AACzB;;;;;AAQA,MAAa,2BAA2B;;CAEtC,yBAAyB;;;;;CAMzB,2CAA2C;AAC7C;;AAgBA,MAAa,8BAA8B;;CAEzC,gCAAgC;;;;;CAMhC,4BAA4B;;;;;;CAO5B,2BAA2B;;;;;CAM3B,2BAA2B;;;;;CAM3B,oCAAoC;;;;;CAMpC,4BAA4B;;;;;CAM5B,6BAA6B;;CAG7B,4BAA4B;;;;;CAM5B,8CAA8C;AAChD"}
@@ -19,80 +19,84 @@ interface DeveloperNotification {
19
19
  /**
20
20
  * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
21
21
  * */
22
- declare enum SubscriptionNotificationType {
22
+ declare const SubscriptionNotificationType: {
23
23
  /** A subscription was recovered from account hold. */
24
- SUBSCRIPTION_RECOVERED = 1,
24
+ readonly SUBSCRIPTION_RECOVERED: 1;
25
25
  /** An active subscription was renewed. */
26
- SUBSCRIPTION_RENEWED = 2,
26
+ readonly SUBSCRIPTION_RENEWED: 2;
27
27
  /**
28
28
  * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
29
29
  * sent when the user cancels.
30
30
  */
31
- SUBSCRIPTION_CANCELED = 3,
31
+ readonly SUBSCRIPTION_CANCELED: 3;
32
32
  /** A new subscription was purchased. */
33
- SUBSCRIPTION_PURCHASED = 4,
33
+ readonly SUBSCRIPTION_PURCHASED: 4;
34
34
  /** A subscription has entered account hold (if enabled). */
35
- SUBSCRIPTION_ON_HOLD = 5,
35
+ readonly SUBSCRIPTION_ON_HOLD: 5;
36
36
  /** A subscription has entered grace period (if enabled). */
37
- SUBSCRIPTION_IN_GRACE_PERIOD = 6,
37
+ readonly SUBSCRIPTION_IN_GRACE_PERIOD: 6;
38
38
  /**
39
39
  * User has restored their subscription from Play > Account > Subscriptions. The subscription was
40
40
  * canceled but had not expired yet when the user restores. For more information, see Restorations.
41
41
  */
42
- SUBSCRIPTION_RESTARTED = 7,
42
+ readonly SUBSCRIPTION_RESTARTED: 7;
43
43
  /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */
44
- SUBSCRIPTION_PRICE_CHANGE_CONFIRMED = 8,
44
+ readonly SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8;
45
45
  /** A subscription's recurrence time has been extended. */
46
- SUBSCRIPTION_DEFERRED = 9,
46
+ readonly SUBSCRIPTION_DEFERRED: 9;
47
47
  /** A subscription has been paused. */
48
- SUBSCRIPTION_PAUSED = 10,
48
+ readonly SUBSCRIPTION_PAUSED: 10;
49
49
  /** A subscription pause schedule has been changed. */
50
- SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED = 11,
50
+ readonly SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11;
51
51
  /** A subscription has been revoked from the user before the expiration time. */
52
- SUBSCRIPTION_REVOKED = 12,
52
+ readonly SUBSCRIPTION_REVOKED: 12;
53
53
  /** A subscription has expired. */
54
- SUBSCRIPTION_EXPIRED = 13,
54
+ readonly SUBSCRIPTION_EXPIRED: 13;
55
55
  /** A subscription item's price change details are updated. */
56
- SUBSCRIPTION_PRICE_CHANGE_UPDATED = 19,
56
+ readonly SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19;
57
57
  /** A pending transaction of a subscription has been canceled. */
58
- SUBSCRIPTION_PENDING_PURCHASE_CANCELED = 20
59
- }
58
+ readonly SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20;
59
+ };
60
+ type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];
60
61
  interface SubscriptionNotification {
61
62
  version: string;
62
63
  purchaseToken: string;
63
64
  notificationType: SubscriptionNotificationType;
64
65
  }
65
- declare enum OneTimeProductNotificationType {
66
+ declare const OneTimeProductNotificationType: {
66
67
  /** A one-time product was successfully purchased by a user. */
67
- ONE_TIME_PRODUCT_PURCHASED = 1,
68
+ readonly ONE_TIME_PRODUCT_PURCHASED: 1;
68
69
  /** A pending one-time product purchase has been canceled by the user. */
69
- ONE_TIME_PRODUCT_CANCELED = 2
70
- }
70
+ readonly ONE_TIME_PRODUCT_CANCELED: 2;
71
+ };
72
+ type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];
71
73
  interface OneTimeProductNotification {
72
74
  version: string;
73
75
  sku: string;
74
76
  purchaseToken: string;
75
77
  notificationType: OneTimeProductNotificationType;
76
78
  }
77
- declare enum VoidedPurchaseProductType {
79
+ declare const VoidedPurchaseProductType: {
78
80
  /** A subscription purchase has been voided. */
79
- PRODUCT_TYPE_SUBSCRIPTION = 1,
81
+ readonly PRODUCT_TYPE_SUBSCRIPTION: 1;
80
82
  /** A one-time purchase has been voided. */
81
- PRODUCT_TYPE_ONE_TIME = 2
82
- }
83
+ readonly PRODUCT_TYPE_ONE_TIME: 2;
84
+ };
85
+ type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];
83
86
  /**
84
87
  * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
85
88
  * will be REFUND_TYPE_FULL_REFUND.
86
89
  */
87
- declare enum VoidedPurchaseRefundType {
90
+ declare const VoidedPurchaseRefundType: {
88
91
  /** The purchase has been fully voided. */
89
- REFUND_TYPE_FULL_REFUND = 1,
92
+ readonly REFUND_TYPE_FULL_REFUND: 1;
90
93
  /**
91
94
  * The purchase has been partially voided by a quantity-based partial refund, applicable only to
92
95
  * multi-quantity purchases. A purchase can be partially voided multiple times.
93
96
  */
94
- REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND = 2
95
- }
97
+ readonly REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2;
98
+ };
99
+ type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];
96
100
  interface VoidedPurchaseNotification {
97
101
  purchaseToken: string;
98
102
  orderId: string;
@@ -103,48 +107,49 @@ interface TestNotification {
103
107
  version: string;
104
108
  }
105
109
  /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
106
- declare enum GooglePlaySubscriptionState {
110
+ declare const GooglePlaySubscriptionState: {
107
111
  /** Unspecified subscription state. */
108
- SUBSCRIPTION_STATE_UNSPECIFIED = "SUBSCRIPTION_STATE_UNSPECIFIED",
112
+ readonly SUBSCRIPTION_STATE_UNSPECIFIED: 'SUBSCRIPTION_STATE_UNSPECIFIED';
109
113
  /**
110
114
  * Subscription was created but awaiting payment during signup. In this state, all items are
111
115
  * awaiting payment.
112
116
  */
113
- SUBSCRIPTION_STATE_PENDING = "SUBSCRIPTION_STATE_PENDING",
117
+ readonly SUBSCRIPTION_STATE_PENDING: 'SUBSCRIPTION_STATE_PENDING';
114
118
  /**
115
119
  * Subscription is active.
116
120
  * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
117
121
  * (2) If the subscription is a prepaid plan, at least one item is not expired.
118
122
  */
119
- SUBSCRIPTION_STATE_ACTIVE = "SUBSCRIPTION_STATE_ACTIVE",
123
+ readonly SUBSCRIPTION_STATE_ACTIVE: 'SUBSCRIPTION_STATE_ACTIVE';
120
124
  /**
121
125
  * Subscription is paused. The state is only available when the subscription is an auto renewing
122
126
  * plan. In this state, all items are in paused state.
123
127
  */
124
- SUBSCRIPTION_STATE_PAUSED = "SUBSCRIPTION_STATE_PAUSED",
128
+ readonly SUBSCRIPTION_STATE_PAUSED: 'SUBSCRIPTION_STATE_PAUSED';
125
129
  /**
126
130
  * Subscription is in grace period. The state is only available when the subscription is an auto
127
131
  * renewing plan. In this state, all items are in grace period.
128
132
  */
129
- SUBSCRIPTION_STATE_IN_GRACE_PERIOD = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
133
+ readonly SUBSCRIPTION_STATE_IN_GRACE_PERIOD: 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD';
130
134
  /**
131
135
  * Subscription is on hold (suspended). The state is only available when the subscription is an
132
136
  * auto renewing plan. In this state, all items are on hold.
133
137
  */
134
- SUBSCRIPTION_STATE_ON_HOLD = "SUBSCRIPTION_STATE_ON_HOLD",
138
+ readonly SUBSCRIPTION_STATE_ON_HOLD: 'SUBSCRIPTION_STATE_ON_HOLD';
135
139
  /**
136
140
  * Subscription is canceled but not expired yet. The state is only available when the subscription
137
141
  * is an auto renewing plan. All items have autoRenewEnabled set to false.
138
142
  */
139
- SUBSCRIPTION_STATE_CANCELED = "SUBSCRIPTION_STATE_CANCELED",
143
+ readonly SUBSCRIPTION_STATE_CANCELED: 'SUBSCRIPTION_STATE_CANCELED';
140
144
  /** Subscription is expired. All items have expiryTime in the past. */
141
- SUBSCRIPTION_STATE_EXPIRED = "SUBSCRIPTION_STATE_EXPIRED",
145
+ readonly SUBSCRIPTION_STATE_EXPIRED: 'SUBSCRIPTION_STATE_EXPIRED';
142
146
  /**
143
147
  * Pending transaction for subscription is canceled. If this pending purchase was for an existing
144
148
  * subscription, use linkedPurchaseToken to get the current state of that subscription.
145
149
  */
146
- SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
147
- }
150
+ readonly SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED: 'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED';
151
+ };
152
+ type GooglePlaySubscriptionState = (typeof GooglePlaySubscriptionState)[keyof typeof GooglePlaySubscriptionState];
148
153
  //#endregion
149
154
  export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
150
155
  //# sourceMappingURL=real-time-developer-notification.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"real-time-developer-notification.d.cts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;aAMR;;EAEV;;EAGA;;;;;EAMA;;EAGA;;EAGA;;EAGA;;;;;EAMA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;UAGe;EACf;EACA;EACA,kBAAkB;;aAGR;;EAEV;;EAGA;;UAGe;EACf;EACA;EACA;EACA,kBAAkB;;aAGR;;EAEV;;EAGA;;;;;;aAOU;;EAEV;;;;;EAMA;;UAGe;EACf;EACA;EACA,aAAa;EACb,YAAY;;UAGG;EACf;;;aAIU;;EAEV;;;;;EAMA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;EAGA;;;;;EAMA"}
1
+ {"version":3,"file":"real-time-developer-notification.d.cts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;cAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;KAGU,uCAAuC,2CAA2C;UAE7E;EACf;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,yCAAyC,6CAA6C;UAEjF;EACf;EACA;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,oCAAoC,wCAAwC;;;;;cAM3E;;WAEX;;;;;WAMA;;KAGU,mCAAmC,uCAAuC;UAErE;EACf;EACA;EACA,aAAa;EACb,YAAY;;UAGG;EACf;;;cAIW;;WAEX;;;;;WAMA;;;;;;WAOA;;;;;WAMA;;;;;WAMA;;;;;WAMA;;;;;WAMA;;WAGA;;;;;WAMA;;KAGU,sCAAsC,0CAA0C"}
@@ -19,80 +19,84 @@ interface DeveloperNotification {
19
19
  /**
20
20
  * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
21
21
  * */
22
- declare enum SubscriptionNotificationType {
22
+ declare const SubscriptionNotificationType: {
23
23
  /** A subscription was recovered from account hold. */
24
- SUBSCRIPTION_RECOVERED = 1,
24
+ readonly SUBSCRIPTION_RECOVERED: 1;
25
25
  /** An active subscription was renewed. */
26
- SUBSCRIPTION_RENEWED = 2,
26
+ readonly SUBSCRIPTION_RENEWED: 2;
27
27
  /**
28
28
  * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
29
29
  * sent when the user cancels.
30
30
  */
31
- SUBSCRIPTION_CANCELED = 3,
31
+ readonly SUBSCRIPTION_CANCELED: 3;
32
32
  /** A new subscription was purchased. */
33
- SUBSCRIPTION_PURCHASED = 4,
33
+ readonly SUBSCRIPTION_PURCHASED: 4;
34
34
  /** A subscription has entered account hold (if enabled). */
35
- SUBSCRIPTION_ON_HOLD = 5,
35
+ readonly SUBSCRIPTION_ON_HOLD: 5;
36
36
  /** A subscription has entered grace period (if enabled). */
37
- SUBSCRIPTION_IN_GRACE_PERIOD = 6,
37
+ readonly SUBSCRIPTION_IN_GRACE_PERIOD: 6;
38
38
  /**
39
39
  * User has restored their subscription from Play > Account > Subscriptions. The subscription was
40
40
  * canceled but had not expired yet when the user restores. For more information, see Restorations.
41
41
  */
42
- SUBSCRIPTION_RESTARTED = 7,
42
+ readonly SUBSCRIPTION_RESTARTED: 7;
43
43
  /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */
44
- SUBSCRIPTION_PRICE_CHANGE_CONFIRMED = 8,
44
+ readonly SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8;
45
45
  /** A subscription's recurrence time has been extended. */
46
- SUBSCRIPTION_DEFERRED = 9,
46
+ readonly SUBSCRIPTION_DEFERRED: 9;
47
47
  /** A subscription has been paused. */
48
- SUBSCRIPTION_PAUSED = 10,
48
+ readonly SUBSCRIPTION_PAUSED: 10;
49
49
  /** A subscription pause schedule has been changed. */
50
- SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED = 11,
50
+ readonly SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11;
51
51
  /** A subscription has been revoked from the user before the expiration time. */
52
- SUBSCRIPTION_REVOKED = 12,
52
+ readonly SUBSCRIPTION_REVOKED: 12;
53
53
  /** A subscription has expired. */
54
- SUBSCRIPTION_EXPIRED = 13,
54
+ readonly SUBSCRIPTION_EXPIRED: 13;
55
55
  /** A subscription item's price change details are updated. */
56
- SUBSCRIPTION_PRICE_CHANGE_UPDATED = 19,
56
+ readonly SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19;
57
57
  /** A pending transaction of a subscription has been canceled. */
58
- SUBSCRIPTION_PENDING_PURCHASE_CANCELED = 20
59
- }
58
+ readonly SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20;
59
+ };
60
+ type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];
60
61
  interface SubscriptionNotification {
61
62
  version: string;
62
63
  purchaseToken: string;
63
64
  notificationType: SubscriptionNotificationType;
64
65
  }
65
- declare enum OneTimeProductNotificationType {
66
+ declare const OneTimeProductNotificationType: {
66
67
  /** A one-time product was successfully purchased by a user. */
67
- ONE_TIME_PRODUCT_PURCHASED = 1,
68
+ readonly ONE_TIME_PRODUCT_PURCHASED: 1;
68
69
  /** A pending one-time product purchase has been canceled by the user. */
69
- ONE_TIME_PRODUCT_CANCELED = 2
70
- }
70
+ readonly ONE_TIME_PRODUCT_CANCELED: 2;
71
+ };
72
+ type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];
71
73
  interface OneTimeProductNotification {
72
74
  version: string;
73
75
  sku: string;
74
76
  purchaseToken: string;
75
77
  notificationType: OneTimeProductNotificationType;
76
78
  }
77
- declare enum VoidedPurchaseProductType {
79
+ declare const VoidedPurchaseProductType: {
78
80
  /** A subscription purchase has been voided. */
79
- PRODUCT_TYPE_SUBSCRIPTION = 1,
81
+ readonly PRODUCT_TYPE_SUBSCRIPTION: 1;
80
82
  /** A one-time purchase has been voided. */
81
- PRODUCT_TYPE_ONE_TIME = 2
82
- }
83
+ readonly PRODUCT_TYPE_ONE_TIME: 2;
84
+ };
85
+ type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];
83
86
  /**
84
87
  * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
85
88
  * will be REFUND_TYPE_FULL_REFUND.
86
89
  */
87
- declare enum VoidedPurchaseRefundType {
90
+ declare const VoidedPurchaseRefundType: {
88
91
  /** The purchase has been fully voided. */
89
- REFUND_TYPE_FULL_REFUND = 1,
92
+ readonly REFUND_TYPE_FULL_REFUND: 1;
90
93
  /**
91
94
  * The purchase has been partially voided by a quantity-based partial refund, applicable only to
92
95
  * multi-quantity purchases. A purchase can be partially voided multiple times.
93
96
  */
94
- REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND = 2
95
- }
97
+ readonly REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2;
98
+ };
99
+ type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];
96
100
  interface VoidedPurchaseNotification {
97
101
  purchaseToken: string;
98
102
  orderId: string;
@@ -103,48 +107,49 @@ interface TestNotification {
103
107
  version: string;
104
108
  }
105
109
  /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
106
- declare enum GooglePlaySubscriptionState {
110
+ declare const GooglePlaySubscriptionState: {
107
111
  /** Unspecified subscription state. */
108
- SUBSCRIPTION_STATE_UNSPECIFIED = "SUBSCRIPTION_STATE_UNSPECIFIED",
112
+ readonly SUBSCRIPTION_STATE_UNSPECIFIED: 'SUBSCRIPTION_STATE_UNSPECIFIED';
109
113
  /**
110
114
  * Subscription was created but awaiting payment during signup. In this state, all items are
111
115
  * awaiting payment.
112
116
  */
113
- SUBSCRIPTION_STATE_PENDING = "SUBSCRIPTION_STATE_PENDING",
117
+ readonly SUBSCRIPTION_STATE_PENDING: 'SUBSCRIPTION_STATE_PENDING';
114
118
  /**
115
119
  * Subscription is active.
116
120
  * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
117
121
  * (2) If the subscription is a prepaid plan, at least one item is not expired.
118
122
  */
119
- SUBSCRIPTION_STATE_ACTIVE = "SUBSCRIPTION_STATE_ACTIVE",
123
+ readonly SUBSCRIPTION_STATE_ACTIVE: 'SUBSCRIPTION_STATE_ACTIVE';
120
124
  /**
121
125
  * Subscription is paused. The state is only available when the subscription is an auto renewing
122
126
  * plan. In this state, all items are in paused state.
123
127
  */
124
- SUBSCRIPTION_STATE_PAUSED = "SUBSCRIPTION_STATE_PAUSED",
128
+ readonly SUBSCRIPTION_STATE_PAUSED: 'SUBSCRIPTION_STATE_PAUSED';
125
129
  /**
126
130
  * Subscription is in grace period. The state is only available when the subscription is an auto
127
131
  * renewing plan. In this state, all items are in grace period.
128
132
  */
129
- SUBSCRIPTION_STATE_IN_GRACE_PERIOD = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
133
+ readonly SUBSCRIPTION_STATE_IN_GRACE_PERIOD: 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD';
130
134
  /**
131
135
  * Subscription is on hold (suspended). The state is only available when the subscription is an
132
136
  * auto renewing plan. In this state, all items are on hold.
133
137
  */
134
- SUBSCRIPTION_STATE_ON_HOLD = "SUBSCRIPTION_STATE_ON_HOLD",
138
+ readonly SUBSCRIPTION_STATE_ON_HOLD: 'SUBSCRIPTION_STATE_ON_HOLD';
135
139
  /**
136
140
  * Subscription is canceled but not expired yet. The state is only available when the subscription
137
141
  * is an auto renewing plan. All items have autoRenewEnabled set to false.
138
142
  */
139
- SUBSCRIPTION_STATE_CANCELED = "SUBSCRIPTION_STATE_CANCELED",
143
+ readonly SUBSCRIPTION_STATE_CANCELED: 'SUBSCRIPTION_STATE_CANCELED';
140
144
  /** Subscription is expired. All items have expiryTime in the past. */
141
- SUBSCRIPTION_STATE_EXPIRED = "SUBSCRIPTION_STATE_EXPIRED",
145
+ readonly SUBSCRIPTION_STATE_EXPIRED: 'SUBSCRIPTION_STATE_EXPIRED';
142
146
  /**
143
147
  * Pending transaction for subscription is canceled. If this pending purchase was for an existing
144
148
  * subscription, use linkedPurchaseToken to get the current state of that subscription.
145
149
  */
146
- SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
147
- }
150
+ readonly SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED: 'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED';
151
+ };
152
+ type GooglePlaySubscriptionState = (typeof GooglePlaySubscriptionState)[keyof typeof GooglePlaySubscriptionState];
148
153
  //#endregion
149
154
  export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
150
155
  //# sourceMappingURL=real-time-developer-notification.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"real-time-developer-notification.d.mts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;aAMR;;EAEV;;EAGA;;;;;EAMA;;EAGA;;EAGA;;EAGA;;;;;EAMA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;UAGe;EACf;EACA;EACA,kBAAkB;;aAGR;;EAEV;;EAGA;;UAGe;EACf;EACA;EACA;EACA,kBAAkB;;aAGR;;EAEV;;EAGA;;;;;;aAOU;;EAEV;;;;;EAMA;;UAGe;EACf;EACA;EACA,aAAa;EACb,YAAY;;UAGG;EACf;;;aAIU;;EAEV;;;;;EAMA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;EAGA;;;;;EAMA"}
1
+ {"version":3,"file":"real-time-developer-notification.d.mts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;cAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;KAGU,uCAAuC,2CAA2C;UAE7E;EACf;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,yCAAyC,6CAA6C;UAEjF;EACf;EACA;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,oCAAoC,wCAAwC;;;;;cAM3E;;WAEX;;;;;WAMA;;KAGU,mCAAmC,uCAAuC;UAErE;EACf;EACA;EACA,aAAa;EACb,YAAY;;UAGG;EACf;;;cAIW;;WAEX;;;;;WAMA;;;;;;WAOA;;;;;WAMA;;;;;WAMA;;;;;WAMA;;;;;WAMA;;WAGA;;;;;WAMA;;KAGU,sCAAsC,0CAA0C"}