@shware/purchase 1.8.9 → 2.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.
Files changed (128) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/app-store/config.cjs +105 -128
  3. package/dist/app-store/config.cjs.map +1 -1
  4. package/dist/app-store/config.d.cts +36 -33
  5. package/dist/app-store/config.d.cts.map +1 -0
  6. package/dist/app-store/config.d.mts +42 -0
  7. package/dist/app-store/config.d.mts.map +1 -0
  8. package/dist/app-store/config.mjs +100 -91
  9. package/dist/app-store/config.mjs.map +1 -1
  10. package/dist/app-store/index.cjs +3 -31
  11. package/dist/app-store/index.d.cts +2 -3
  12. package/dist/app-store/index.d.mts +2 -0
  13. package/dist/app-store/index.mjs +1 -5
  14. package/dist/google-play/config.cjs +108 -123
  15. package/dist/google-play/config.cjs.map +1 -1
  16. package/dist/google-play/config.d.cts +35 -33
  17. package/dist/google-play/config.d.cts.map +1 -0
  18. package/dist/google-play/config.d.mts +41 -0
  19. package/dist/google-play/config.d.mts.map +1 -0
  20. package/dist/google-play/config.mjs +103 -86
  21. package/dist/google-play/config.mjs.map +1 -1
  22. package/dist/google-play/index.cjs +9 -42
  23. package/dist/google-play/index.d.cts +3 -4
  24. package/dist/google-play/index.d.mts +3 -0
  25. package/dist/google-play/index.mjs +2 -17
  26. package/dist/google-play/real-time-developer-notification.cjs +122 -81
  27. package/dist/google-play/real-time-developer-notification.cjs.map +1 -1
  28. package/dist/google-play/real-time-developer-notification.d.cts +119 -117
  29. package/dist/google-play/real-time-developer-notification.d.cts.map +1 -0
  30. package/dist/google-play/real-time-developer-notification.d.mts +150 -0
  31. package/dist/google-play/real-time-developer-notification.d.mts.map +1 -0
  32. package/dist/google-play/real-time-developer-notification.mjs +118 -53
  33. package/dist/google-play/real-time-developer-notification.mjs.map +1 -1
  34. package/dist/index.cjs +13 -48
  35. package/dist/index.d.cts +5 -6
  36. package/dist/index.d.mts +5 -0
  37. package/dist/index.mjs +2 -19
  38. package/dist/stripe/config.cjs +114 -133
  39. package/dist/stripe/config.cjs.map +1 -1
  40. package/dist/stripe/config.d.cts +46 -37
  41. package/dist/stripe/config.d.cts.map +1 -0
  42. package/dist/stripe/config.d.mts +52 -0
  43. package/dist/stripe/config.d.mts.map +1 -0
  44. package/dist/stripe/config.mjs +109 -96
  45. package/dist/stripe/config.mjs.map +1 -1
  46. package/dist/stripe/handler.cjs +25 -53
  47. package/dist/stripe/handler.cjs.map +1 -1
  48. package/dist/stripe/handler.d.cts +10 -9
  49. package/dist/stripe/handler.d.cts.map +1 -0
  50. package/dist/stripe/handler.d.mts +16 -0
  51. package/dist/stripe/handler.d.mts.map +1 -0
  52. package/dist/stripe/handler.mjs +25 -29
  53. package/dist/stripe/handler.mjs.map +1 -1
  54. package/dist/stripe/index.cjs +27 -74
  55. package/dist/stripe/index.d.cts +8 -12
  56. package/dist/stripe/index.d.mts +8 -0
  57. package/dist/stripe/index.mjs +5 -44
  58. package/dist/stripe/mapper.cjs +168 -219
  59. package/dist/stripe/mapper.cjs.map +1 -1
  60. package/dist/stripe/mapper.d.cts +115 -114
  61. package/dist/stripe/mapper.d.cts.map +1 -0
  62. package/dist/stripe/mapper.d.mts +158 -0
  63. package/dist/stripe/mapper.d.mts.map +1 -0
  64. package/dist/stripe/mapper.mjs +155 -182
  65. package/dist/stripe/mapper.mjs.map +1 -1
  66. package/dist/stripe/metadata.cjs +11 -35
  67. package/dist/stripe/metadata.cjs.map +1 -1
  68. package/dist/stripe/metadata.d.cts +9 -7
  69. package/dist/stripe/metadata.d.cts.map +1 -0
  70. package/dist/stripe/metadata.d.mts +12 -0
  71. package/dist/stripe/metadata.d.mts.map +1 -0
  72. package/dist/stripe/metadata.mjs +11 -11
  73. package/dist/stripe/metadata.mjs.map +1 -1
  74. package/dist/stripe/pending-checkout.cjs +55 -61
  75. package/dist/stripe/pending-checkout.cjs.map +1 -1
  76. package/dist/stripe/pending-checkout.d.cts +3 -1
  77. package/dist/stripe/pending-checkout.d.cts.map +1 -0
  78. package/dist/stripe/{pending-checkout.d.ts → pending-checkout.d.mts} +3 -1
  79. package/dist/stripe/pending-checkout.d.mts.map +1 -0
  80. package/dist/stripe/pending-checkout.mjs +52 -34
  81. package/dist/stripe/pending-checkout.mjs.map +1 -1
  82. package/dist/stripe/schema.cjs +30 -55
  83. package/dist/stripe/schema.cjs.map +1 -1
  84. package/dist/stripe/schema.d.cts +36 -37
  85. package/dist/stripe/schema.d.cts.map +1 -0
  86. package/dist/stripe/schema.d.mts +40 -0
  87. package/dist/stripe/schema.d.mts.map +1 -0
  88. package/dist/stripe/schema.mjs +28 -40
  89. package/dist/stripe/schema.mjs.map +1 -1
  90. package/dist/subscription/index.cjs +178 -80
  91. package/dist/subscription/index.cjs.map +1 -1
  92. package/dist/subscription/index.d.cts +136 -134
  93. package/dist/subscription/index.d.cts.map +1 -0
  94. package/dist/subscription/index.d.mts +150 -0
  95. package/dist/subscription/index.d.mts.map +1 -0
  96. package/dist/subscription/index.mjs +173 -51
  97. package/dist/subscription/index.mjs.map +1 -1
  98. package/dist/types.cjs +0 -19
  99. package/dist/types.d.cts +7 -6
  100. package/dist/types.d.cts.map +1 -0
  101. package/dist/types.d.mts +10 -0
  102. package/dist/types.d.mts.map +1 -0
  103. package/dist/types.mjs +1 -1
  104. package/package.json +40 -25
  105. package/dist/app-store/config.d.ts +0 -39
  106. package/dist/app-store/index.cjs.map +0 -1
  107. package/dist/app-store/index.d.ts +0 -3
  108. package/dist/app-store/index.mjs.map +0 -1
  109. package/dist/google-play/config.d.ts +0 -39
  110. package/dist/google-play/index.cjs.map +0 -1
  111. package/dist/google-play/index.d.ts +0 -4
  112. package/dist/google-play/index.mjs.map +0 -1
  113. package/dist/google-play/real-time-developer-notification.d.ts +0 -148
  114. package/dist/index.cjs.map +0 -1
  115. package/dist/index.d.ts +0 -6
  116. package/dist/index.mjs.map +0 -1
  117. package/dist/stripe/config.d.ts +0 -43
  118. package/dist/stripe/handler.d.ts +0 -15
  119. package/dist/stripe/index.cjs.map +0 -1
  120. package/dist/stripe/index.d.ts +0 -12
  121. package/dist/stripe/index.mjs.map +0 -1
  122. package/dist/stripe/mapper.d.ts +0 -157
  123. package/dist/stripe/metadata.d.ts +0 -10
  124. package/dist/stripe/schema.d.ts +0 -41
  125. package/dist/subscription/index.d.ts +0 -148
  126. package/dist/types.cjs.map +0 -1
  127. package/dist/types.d.ts +0 -9
  128. package/dist/types.mjs.map +0 -1
@@ -1,83 +1,124 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/google-play/real-time-developer-notification.ts
3
+ /**
4
+ * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
5
+ * */
6
+ let SubscriptionNotificationType = /* @__PURE__ */ function(SubscriptionNotificationType) {
7
+ /** A subscription was recovered from account hold. */
8
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RECOVERED"] = 1] = "SUBSCRIPTION_RECOVERED";
9
+ /** An active subscription was renewed. */
10
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RENEWED"] = 2] = "SUBSCRIPTION_RENEWED";
11
+ /**
12
+ * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
13
+ * sent when the user cancels.
14
+ */
15
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_CANCELED"] = 3] = "SUBSCRIPTION_CANCELED";
16
+ /** A new subscription was purchased. */
17
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PURCHASED"] = 4] = "SUBSCRIPTION_PURCHASED";
18
+ /** A subscription has entered account hold (if enabled). */
19
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_ON_HOLD"] = 5] = "SUBSCRIPTION_ON_HOLD";
20
+ /** A subscription has entered grace period (if enabled). */
21
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_IN_GRACE_PERIOD"] = 6] = "SUBSCRIPTION_IN_GRACE_PERIOD";
22
+ /**
23
+ * User has restored their subscription from Play > Account > Subscriptions. The subscription was
24
+ * canceled but had not expired yet when the user restores. For more information, see Restorations.
25
+ */
26
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RESTARTED"] = 7] = "SUBSCRIPTION_RESTARTED";
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";
29
+ /** A subscription's recurrence time has been extended. */
30
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_DEFERRED"] = 9] = "SUBSCRIPTION_DEFERRED";
31
+ /** A subscription has been paused. */
32
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PAUSED"] = 10] = "SUBSCRIPTION_PAUSED";
33
+ /** A subscription pause schedule has been changed. */
34
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED"] = 11] = "SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED";
35
+ /** A subscription has been revoked from the user before the expiration time. */
36
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_REVOKED"] = 12] = "SUBSCRIPTION_REVOKED";
37
+ /** A subscription has expired. */
38
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_EXPIRED"] = 13] = "SUBSCRIPTION_EXPIRED";
39
+ /** A subscription item's price change details are updated. */
40
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PRICE_CHANGE_UPDATED"] = 19] = "SUBSCRIPTION_PRICE_CHANGE_UPDATED";
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) {
46
+ /** A one-time product was successfully purchased by a user. */
47
+ OneTimeProductNotificationType[OneTimeProductNotificationType["ONE_TIME_PRODUCT_PURCHASED"] = 1] = "ONE_TIME_PRODUCT_PURCHASED";
48
+ /** 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) {
53
+ /** A subscription purchase has been voided. */
54
+ VoidedPurchaseProductType[VoidedPurchaseProductType["PRODUCT_TYPE_SUBSCRIPTION"] = 1] = "PRODUCT_TYPE_SUBSCRIPTION";
55
+ /** A one-time purchase has been voided. */
56
+ VoidedPurchaseProductType[VoidedPurchaseProductType["PRODUCT_TYPE_ONE_TIME"] = 2] = "PRODUCT_TYPE_ONE_TIME";
57
+ return VoidedPurchaseProductType;
58
+ }({});
59
+ /**
60
+ * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
61
+ * will be REFUND_TYPE_FULL_REFUND.
62
+ */
63
+ let VoidedPurchaseRefundType = /* @__PURE__ */ function(VoidedPurchaseRefundType) {
64
+ /** The purchase has been fully voided. */
65
+ VoidedPurchaseRefundType[VoidedPurchaseRefundType["REFUND_TYPE_FULL_REFUND"] = 1] = "REFUND_TYPE_FULL_REFUND";
66
+ /**
67
+ * The purchase has been partially voided by a quantity-based partial refund, applicable only to
68
+ * multi-quantity purchases. A purchase can be partially voided multiple times.
69
+ */
70
+ VoidedPurchaseRefundType[VoidedPurchaseRefundType["REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND"] = 2] = "REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND";
71
+ return VoidedPurchaseRefundType;
72
+ }({});
73
+ /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
74
+ let GooglePlaySubscriptionState = /* @__PURE__ */ function(GooglePlaySubscriptionState) {
75
+ /** Unspecified subscription state. */
76
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_UNSPECIFIED"] = "SUBSCRIPTION_STATE_UNSPECIFIED";
77
+ /**
78
+ * Subscription was created but awaiting payment during signup. In this state, all items are
79
+ * awaiting payment.
80
+ */
81
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PENDING"] = "SUBSCRIPTION_STATE_PENDING";
82
+ /**
83
+ * Subscription is active.
84
+ * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
85
+ * (2) If the subscription is a prepaid plan, at least one item is not expired.
86
+ */
87
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_ACTIVE"] = "SUBSCRIPTION_STATE_ACTIVE";
88
+ /**
89
+ * Subscription is paused. The state is only available when the subscription is an auto renewing
90
+ * plan. In this state, all items are in paused state.
91
+ */
92
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PAUSED"] = "SUBSCRIPTION_STATE_PAUSED";
93
+ /**
94
+ * Subscription is in grace period. The state is only available when the subscription is an auto
95
+ * renewing plan. In this state, all items are in grace period.
96
+ */
97
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_IN_GRACE_PERIOD"] = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD";
98
+ /**
99
+ * Subscription is on hold (suspended). The state is only available when the subscription is an
100
+ * auto renewing plan. In this state, all items are on hold.
101
+ */
102
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_ON_HOLD"] = "SUBSCRIPTION_STATE_ON_HOLD";
103
+ /**
104
+ * Subscription is canceled but not expired yet. The state is only available when the subscription
105
+ * is an auto renewing plan. All items have autoRenewEnabled set to false.
106
+ */
107
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_CANCELED"] = "SUBSCRIPTION_STATE_CANCELED";
108
+ /** Subscription is expired. All items have expiryTime in the past. */
109
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_EXPIRED"] = "SUBSCRIPTION_STATE_EXPIRED";
110
+ /**
111
+ * Pending transaction for subscription is canceled. If this pending purchase was for an existing
112
+ * subscription, use linkedPurchaseToken to get the current state of that subscription.
113
+ */
114
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"] = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED";
115
+ return GooglePlaySubscriptionState;
116
+ }({});
117
+ //#endregion
118
+ exports.GooglePlaySubscriptionState = GooglePlaySubscriptionState;
119
+ exports.OneTimeProductNotificationType = OneTimeProductNotificationType;
120
+ exports.SubscriptionNotificationType = SubscriptionNotificationType;
121
+ exports.VoidedPurchaseProductType = VoidedPurchaseProductType;
122
+ exports.VoidedPurchaseRefundType = VoidedPurchaseRefundType;
19
123
 
20
- // src/google-play/real-time-developer-notification.ts
21
- var real_time_developer_notification_exports = {};
22
- __export(real_time_developer_notification_exports, {
23
- GooglePlaySubscriptionState: () => GooglePlaySubscriptionState,
24
- OneTimeProductNotificationType: () => OneTimeProductNotificationType,
25
- SubscriptionNotificationType: () => SubscriptionNotificationType,
26
- VoidedPurchaseProductType: () => VoidedPurchaseProductType,
27
- VoidedPurchaseRefundType: () => VoidedPurchaseRefundType
28
- });
29
- module.exports = __toCommonJS(real_time_developer_notification_exports);
30
- var SubscriptionNotificationType = /* @__PURE__ */ ((SubscriptionNotificationType2) => {
31
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_RECOVERED"] = 1] = "SUBSCRIPTION_RECOVERED";
32
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_RENEWED"] = 2] = "SUBSCRIPTION_RENEWED";
33
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_CANCELED"] = 3] = "SUBSCRIPTION_CANCELED";
34
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PURCHASED"] = 4] = "SUBSCRIPTION_PURCHASED";
35
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_ON_HOLD"] = 5] = "SUBSCRIPTION_ON_HOLD";
36
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_IN_GRACE_PERIOD"] = 6] = "SUBSCRIPTION_IN_GRACE_PERIOD";
37
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_RESTARTED"] = 7] = "SUBSCRIPTION_RESTARTED";
38
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PRICE_CHANGE_CONFIRMED"] = 8] = "SUBSCRIPTION_PRICE_CHANGE_CONFIRMED";
39
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_DEFERRED"] = 9] = "SUBSCRIPTION_DEFERRED";
40
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PAUSED"] = 10] = "SUBSCRIPTION_PAUSED";
41
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED"] = 11] = "SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED";
42
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_REVOKED"] = 12] = "SUBSCRIPTION_REVOKED";
43
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_EXPIRED"] = 13] = "SUBSCRIPTION_EXPIRED";
44
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PRICE_CHANGE_UPDATED"] = 19] = "SUBSCRIPTION_PRICE_CHANGE_UPDATED";
45
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PENDING_PURCHASE_CANCELED"] = 20] = "SUBSCRIPTION_PENDING_PURCHASE_CANCELED";
46
- return SubscriptionNotificationType2;
47
- })(SubscriptionNotificationType || {});
48
- var OneTimeProductNotificationType = /* @__PURE__ */ ((OneTimeProductNotificationType2) => {
49
- OneTimeProductNotificationType2[OneTimeProductNotificationType2["ONE_TIME_PRODUCT_PURCHASED"] = 1] = "ONE_TIME_PRODUCT_PURCHASED";
50
- OneTimeProductNotificationType2[OneTimeProductNotificationType2["ONE_TIME_PRODUCT_CANCELED"] = 2] = "ONE_TIME_PRODUCT_CANCELED";
51
- return OneTimeProductNotificationType2;
52
- })(OneTimeProductNotificationType || {});
53
- var VoidedPurchaseProductType = /* @__PURE__ */ ((VoidedPurchaseProductType2) => {
54
- VoidedPurchaseProductType2[VoidedPurchaseProductType2["PRODUCT_TYPE_SUBSCRIPTION"] = 1] = "PRODUCT_TYPE_SUBSCRIPTION";
55
- VoidedPurchaseProductType2[VoidedPurchaseProductType2["PRODUCT_TYPE_ONE_TIME"] = 2] = "PRODUCT_TYPE_ONE_TIME";
56
- return VoidedPurchaseProductType2;
57
- })(VoidedPurchaseProductType || {});
58
- var VoidedPurchaseRefundType = /* @__PURE__ */ ((VoidedPurchaseRefundType2) => {
59
- VoidedPurchaseRefundType2[VoidedPurchaseRefundType2["REFUND_TYPE_FULL_REFUND"] = 1] = "REFUND_TYPE_FULL_REFUND";
60
- VoidedPurchaseRefundType2[VoidedPurchaseRefundType2["REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND"] = 2] = "REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND";
61
- return VoidedPurchaseRefundType2;
62
- })(VoidedPurchaseRefundType || {});
63
- var GooglePlaySubscriptionState = /* @__PURE__ */ ((GooglePlaySubscriptionState2) => {
64
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_UNSPECIFIED"] = "SUBSCRIPTION_STATE_UNSPECIFIED";
65
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_PENDING"] = "SUBSCRIPTION_STATE_PENDING";
66
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_ACTIVE"] = "SUBSCRIPTION_STATE_ACTIVE";
67
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_PAUSED"] = "SUBSCRIPTION_STATE_PAUSED";
68
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_IN_GRACE_PERIOD"] = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD";
69
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_ON_HOLD"] = "SUBSCRIPTION_STATE_ON_HOLD";
70
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_CANCELED"] = "SUBSCRIPTION_STATE_CANCELED";
71
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_EXPIRED"] = "SUBSCRIPTION_STATE_EXPIRED";
72
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"] = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED";
73
- return GooglePlaySubscriptionState2;
74
- })(GooglePlaySubscriptionState || {});
75
- // Annotate the CommonJS export names for ESM import in node:
76
- 0 && (module.exports = {
77
- GooglePlaySubscriptionState,
78
- OneTimeProductNotificationType,
79
- SubscriptionNotificationType,
80
- VoidedPurchaseProductType,
81
- VoidedPurchaseRefundType
82
- });
83
124
  //# sourceMappingURL=real-time-developer-notification.cjs.map
@@ -1 +1 @@
1
- {"version":3,"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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,IAAK,+BAAL,kBAAKA,kCAAL;AAEL,EAAAA,4DAAA,4BAAyB,KAAzB;AAGA,EAAAA,4DAAA,0BAAuB,KAAvB;AAMA,EAAAA,4DAAA,2BAAwB,KAAxB;AAGA,EAAAA,4DAAA,4BAAyB,KAAzB;AAGA,EAAAA,4DAAA,0BAAuB,KAAvB;AAGA,EAAAA,4DAAA,kCAA+B,KAA/B;AAMA,EAAAA,4DAAA,4BAAyB,KAAzB;AAGA,EAAAA,4DAAA,yCAAsC,KAAtC;AAGA,EAAAA,4DAAA,2BAAwB,KAAxB;AAGA,EAAAA,4DAAA,yBAAsB,MAAtB;AAGA,EAAAA,4DAAA,yCAAsC,MAAtC;AAGA,EAAAA,4DAAA,0BAAuB,MAAvB;AAGA,EAAAA,4DAAA,0BAAuB,MAAvB;AAGA,EAAAA,4DAAA,uCAAoC,MAApC;AAGA,EAAAA,4DAAA,4CAAyC,MAAzC;AAlDU,SAAAA;AAAA,GAAA;AA2DL,IAAK,iCAAL,kBAAKC,oCAAL;AAEL,EAAAA,gEAAA,gCAA6B,KAA7B;AAGA,EAAAA,gEAAA,+BAA4B,KAA5B;AALU,SAAAA;AAAA,GAAA;AAeL,IAAK,4BAAL,kBAAKC,+BAAL;AAEL,EAAAA,sDAAA,+BAA4B,KAA5B;AAGA,EAAAA,sDAAA,2BAAwB,KAAxB;AALU,SAAAA;AAAA,GAAA;AAYL,IAAK,2BAAL,kBAAKC,8BAAL;AAEL,EAAAA,oDAAA,6BAA0B,KAA1B;AAMA,EAAAA,oDAAA,+CAA4C,KAA5C;AARU,SAAAA;AAAA,GAAA;AAuBL,IAAK,8BAAL,kBAAKC,iCAAL;AAEL,EAAAA,6BAAA,oCAAiC;AAMjC,EAAAA,6BAAA,gCAA6B;AAO7B,EAAAA,6BAAA,+BAA4B;AAM5B,EAAAA,6BAAA,+BAA4B;AAM5B,EAAAA,6BAAA,wCAAqC;AAMrC,EAAAA,6BAAA,gCAA6B;AAM7B,EAAAA,6BAAA,iCAA8B;AAG9B,EAAAA,6BAAA,gCAA6B;AAM7B,EAAAA,6BAAA,kDAA+C;AAhDrC,SAAAA;AAAA,GAAA;","names":["SubscriptionNotificationType","OneTimeProductNotificationType","VoidedPurchaseProductType","VoidedPurchaseRefundType","GooglePlaySubscriptionState"]}
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,148 +1,150 @@
1
+ //#region src/google-play/real-time-developer-notification.d.ts
1
2
  type PubsubMessage = {
2
- data: string;
3
- attributes: Record<string, string>;
4
- messageId: string;
5
- publishTime: string;
6
- orderingKey: string;
3
+ data: string;
4
+ attributes: Record<string, string>;
5
+ messageId: string;
6
+ publishTime: string;
7
+ orderingKey: string;
7
8
  };
8
9
  /** https://developer.android.com/google/play/billing/rtdn-reference */
9
10
  interface DeveloperNotification {
10
- version: string;
11
- packageName: string;
12
- eventTimeMillis: number;
13
- subscriptionNotification: SubscriptionNotification;
14
- oneTimeProductNotification: OneTimeProductNotification;
15
- voidedPurchaseNotification: VoidedPurchaseNotification;
16
- testNotification: TestNotification;
11
+ version: string;
12
+ packageName: string;
13
+ eventTimeMillis: number;
14
+ subscriptionNotification: SubscriptionNotification;
15
+ oneTimeProductNotification: OneTimeProductNotification;
16
+ voidedPurchaseNotification: VoidedPurchaseNotification;
17
+ testNotification: TestNotification;
17
18
  }
18
19
  /**
19
20
  * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
20
21
  * */
21
22
  declare enum SubscriptionNotificationType {
22
- /** A subscription was recovered from account hold. */
23
- SUBSCRIPTION_RECOVERED = 1,
24
- /** An active subscription was renewed. */
25
- SUBSCRIPTION_RENEWED = 2,
26
- /**
27
- * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
28
- * sent when the user cancels.
29
- */
30
- SUBSCRIPTION_CANCELED = 3,
31
- /** A new subscription was purchased. */
32
- SUBSCRIPTION_PURCHASED = 4,
33
- /** A subscription has entered account hold (if enabled). */
34
- SUBSCRIPTION_ON_HOLD = 5,
35
- /** A subscription has entered grace period (if enabled). */
36
- SUBSCRIPTION_IN_GRACE_PERIOD = 6,
37
- /**
38
- * User has restored their subscription from Play > Account > Subscriptions. The subscription was
39
- * canceled but had not expired yet when the user restores. For more information, see Restorations.
40
- */
41
- SUBSCRIPTION_RESTARTED = 7,
42
- /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */
43
- SUBSCRIPTION_PRICE_CHANGE_CONFIRMED = 8,
44
- /** A subscription's recurrence time has been extended. */
45
- SUBSCRIPTION_DEFERRED = 9,
46
- /** A subscription has been paused. */
47
- SUBSCRIPTION_PAUSED = 10,
48
- /** A subscription pause schedule has been changed. */
49
- SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED = 11,
50
- /** A subscription has been revoked from the user before the expiration time. */
51
- SUBSCRIPTION_REVOKED = 12,
52
- /** A subscription has expired. */
53
- SUBSCRIPTION_EXPIRED = 13,
54
- /** A subscription item's price change details are updated. */
55
- SUBSCRIPTION_PRICE_CHANGE_UPDATED = 19,
56
- /** A pending transaction of a subscription has been canceled. */
57
- SUBSCRIPTION_PENDING_PURCHASE_CANCELED = 20
23
+ /** A subscription was recovered from account hold. */
24
+ SUBSCRIPTION_RECOVERED = 1,
25
+ /** An active subscription was renewed. */
26
+ SUBSCRIPTION_RENEWED = 2,
27
+ /**
28
+ * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
29
+ * sent when the user cancels.
30
+ */
31
+ SUBSCRIPTION_CANCELED = 3,
32
+ /** A new subscription was purchased. */
33
+ SUBSCRIPTION_PURCHASED = 4,
34
+ /** A subscription has entered account hold (if enabled). */
35
+ SUBSCRIPTION_ON_HOLD = 5,
36
+ /** A subscription has entered grace period (if enabled). */
37
+ SUBSCRIPTION_IN_GRACE_PERIOD = 6,
38
+ /**
39
+ * User has restored their subscription from Play > Account > Subscriptions. The subscription was
40
+ * canceled but had not expired yet when the user restores. For more information, see Restorations.
41
+ */
42
+ SUBSCRIPTION_RESTARTED = 7,
43
+ /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */
44
+ SUBSCRIPTION_PRICE_CHANGE_CONFIRMED = 8,
45
+ /** A subscription's recurrence time has been extended. */
46
+ SUBSCRIPTION_DEFERRED = 9,
47
+ /** A subscription has been paused. */
48
+ SUBSCRIPTION_PAUSED = 10,
49
+ /** A subscription pause schedule has been changed. */
50
+ SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED = 11,
51
+ /** A subscription has been revoked from the user before the expiration time. */
52
+ SUBSCRIPTION_REVOKED = 12,
53
+ /** A subscription has expired. */
54
+ SUBSCRIPTION_EXPIRED = 13,
55
+ /** A subscription item's price change details are updated. */
56
+ SUBSCRIPTION_PRICE_CHANGE_UPDATED = 19,
57
+ /** A pending transaction of a subscription has been canceled. */
58
+ SUBSCRIPTION_PENDING_PURCHASE_CANCELED = 20
58
59
  }
59
60
  interface SubscriptionNotification {
60
- version: string;
61
- purchaseToken: string;
62
- notificationType: SubscriptionNotificationType;
61
+ version: string;
62
+ purchaseToken: string;
63
+ notificationType: SubscriptionNotificationType;
63
64
  }
64
65
  declare enum OneTimeProductNotificationType {
65
- /** A one-time product was successfully purchased by a user. */
66
- ONE_TIME_PRODUCT_PURCHASED = 1,
67
- /** A pending one-time product purchase has been canceled by the user. */
68
- ONE_TIME_PRODUCT_CANCELED = 2
66
+ /** A one-time product was successfully purchased by a user. */
67
+ ONE_TIME_PRODUCT_PURCHASED = 1,
68
+ /** A pending one-time product purchase has been canceled by the user. */
69
+ ONE_TIME_PRODUCT_CANCELED = 2
69
70
  }
70
71
  interface OneTimeProductNotification {
71
- version: string;
72
- sku: string;
73
- purchaseToken: string;
74
- notificationType: OneTimeProductNotificationType;
72
+ version: string;
73
+ sku: string;
74
+ purchaseToken: string;
75
+ notificationType: OneTimeProductNotificationType;
75
76
  }
76
77
  declare enum VoidedPurchaseProductType {
77
- /** A subscription purchase has been voided. */
78
- PRODUCT_TYPE_SUBSCRIPTION = 1,
79
- /** A one-time purchase has been voided. */
80
- PRODUCT_TYPE_ONE_TIME = 2
78
+ /** A subscription purchase has been voided. */
79
+ PRODUCT_TYPE_SUBSCRIPTION = 1,
80
+ /** A one-time purchase has been voided. */
81
+ PRODUCT_TYPE_ONE_TIME = 2
81
82
  }
82
83
  /**
83
84
  * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
84
85
  * will be REFUND_TYPE_FULL_REFUND.
85
86
  */
86
87
  declare enum VoidedPurchaseRefundType {
87
- /** The purchase has been fully voided. */
88
- REFUND_TYPE_FULL_REFUND = 1,
89
- /**
90
- * The purchase has been partially voided by a quantity-based partial refund, applicable only to
91
- * multi-quantity purchases. A purchase can be partially voided multiple times.
92
- */
93
- REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND = 2
88
+ /** The purchase has been fully voided. */
89
+ REFUND_TYPE_FULL_REFUND = 1,
90
+ /**
91
+ * The purchase has been partially voided by a quantity-based partial refund, applicable only to
92
+ * multi-quantity purchases. A purchase can be partially voided multiple times.
93
+ */
94
+ REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND = 2
94
95
  }
95
96
  interface VoidedPurchaseNotification {
96
- purchaseToken: string;
97
- orderId: string;
98
- productType: VoidedPurchaseProductType;
99
- refundType: VoidedPurchaseRefundType;
97
+ purchaseToken: string;
98
+ orderId: string;
99
+ productType: VoidedPurchaseProductType;
100
+ refundType: VoidedPurchaseRefundType;
100
101
  }
101
102
  interface TestNotification {
102
- version: string;
103
+ version: string;
103
104
  }
104
105
  /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
105
106
  declare enum GooglePlaySubscriptionState {
106
- /** Unspecified subscription state. */
107
- SUBSCRIPTION_STATE_UNSPECIFIED = "SUBSCRIPTION_STATE_UNSPECIFIED",
108
- /**
109
- * Subscription was created but awaiting payment during signup. In this state, all items are
110
- * awaiting payment.
111
- */
112
- SUBSCRIPTION_STATE_PENDING = "SUBSCRIPTION_STATE_PENDING",
113
- /**
114
- * Subscription is active.
115
- * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
116
- * (2) If the subscription is a prepaid plan, at least one item is not expired.
117
- */
118
- SUBSCRIPTION_STATE_ACTIVE = "SUBSCRIPTION_STATE_ACTIVE",
119
- /**
120
- * Subscription is paused. The state is only available when the subscription is an auto renewing
121
- * plan. In this state, all items are in paused state.
122
- */
123
- SUBSCRIPTION_STATE_PAUSED = "SUBSCRIPTION_STATE_PAUSED",
124
- /**
125
- * Subscription is in grace period. The state is only available when the subscription is an auto
126
- * renewing plan. In this state, all items are in grace period.
127
- */
128
- SUBSCRIPTION_STATE_IN_GRACE_PERIOD = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
129
- /**
130
- * Subscription is on hold (suspended). The state is only available when the subscription is an
131
- * auto renewing plan. In this state, all items are on hold.
132
- */
133
- SUBSCRIPTION_STATE_ON_HOLD = "SUBSCRIPTION_STATE_ON_HOLD",
134
- /**
135
- * Subscription is canceled but not expired yet. The state is only available when the subscription
136
- * is an auto renewing plan. All items have autoRenewEnabled set to false.
137
- */
138
- SUBSCRIPTION_STATE_CANCELED = "SUBSCRIPTION_STATE_CANCELED",
139
- /** Subscription is expired. All items have expiryTime in the past. */
140
- SUBSCRIPTION_STATE_EXPIRED = "SUBSCRIPTION_STATE_EXPIRED",
141
- /**
142
- * Pending transaction for subscription is canceled. If this pending purchase was for an existing
143
- * subscription, use linkedPurchaseToken to get the current state of that subscription.
144
- */
145
- SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
107
+ /** Unspecified subscription state. */
108
+ SUBSCRIPTION_STATE_UNSPECIFIED = "SUBSCRIPTION_STATE_UNSPECIFIED",
109
+ /**
110
+ * Subscription was created but awaiting payment during signup. In this state, all items are
111
+ * awaiting payment.
112
+ */
113
+ SUBSCRIPTION_STATE_PENDING = "SUBSCRIPTION_STATE_PENDING",
114
+ /**
115
+ * Subscription is active.
116
+ * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
117
+ * (2) If the subscription is a prepaid plan, at least one item is not expired.
118
+ */
119
+ SUBSCRIPTION_STATE_ACTIVE = "SUBSCRIPTION_STATE_ACTIVE",
120
+ /**
121
+ * Subscription is paused. The state is only available when the subscription is an auto renewing
122
+ * plan. In this state, all items are in paused state.
123
+ */
124
+ SUBSCRIPTION_STATE_PAUSED = "SUBSCRIPTION_STATE_PAUSED",
125
+ /**
126
+ * Subscription is in grace period. The state is only available when the subscription is an auto
127
+ * renewing plan. In this state, all items are in grace period.
128
+ */
129
+ SUBSCRIPTION_STATE_IN_GRACE_PERIOD = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
130
+ /**
131
+ * Subscription is on hold (suspended). The state is only available when the subscription is an
132
+ * auto renewing plan. In this state, all items are on hold.
133
+ */
134
+ SUBSCRIPTION_STATE_ON_HOLD = "SUBSCRIPTION_STATE_ON_HOLD",
135
+ /**
136
+ * Subscription is canceled but not expired yet. The state is only available when the subscription
137
+ * is an auto renewing plan. All items have autoRenewEnabled set to false.
138
+ */
139
+ SUBSCRIPTION_STATE_CANCELED = "SUBSCRIPTION_STATE_CANCELED",
140
+ /** Subscription is expired. All items have expiryTime in the past. */
141
+ SUBSCRIPTION_STATE_EXPIRED = "SUBSCRIPTION_STATE_EXPIRED",
142
+ /**
143
+ * Pending transaction for subscription is canceled. If this pending purchase was for an existing
144
+ * subscription, use linkedPurchaseToken to get the current state of that subscription.
145
+ */
146
+ SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
146
147
  }
147
-
148
- export { type DeveloperNotification, GooglePlaySubscriptionState, type OneTimeProductNotification, OneTimeProductNotificationType, type PubsubMessage, type SubscriptionNotification, SubscriptionNotificationType, type TestNotification, type VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
148
+ //#endregion
149
+ export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
150
+ //# sourceMappingURL=real-time-developer-notification.d.cts.map
@@ -0,0 +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"}