@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
@@ -0,0 +1,150 @@
1
+ //#region src/google-play/real-time-developer-notification.d.ts
2
+ type PubsubMessage = {
3
+ data: string;
4
+ attributes: Record<string, string>;
5
+ messageId: string;
6
+ publishTime: string;
7
+ orderingKey: string;
8
+ };
9
+ /** https://developer.android.com/google/play/billing/rtdn-reference */
10
+ interface DeveloperNotification {
11
+ version: string;
12
+ packageName: string;
13
+ eventTimeMillis: number;
14
+ subscriptionNotification: SubscriptionNotification;
15
+ oneTimeProductNotification: OneTimeProductNotification;
16
+ voidedPurchaseNotification: VoidedPurchaseNotification;
17
+ testNotification: TestNotification;
18
+ }
19
+ /**
20
+ * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
21
+ * */
22
+ declare enum SubscriptionNotificationType {
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
59
+ }
60
+ interface SubscriptionNotification {
61
+ version: string;
62
+ purchaseToken: string;
63
+ notificationType: SubscriptionNotificationType;
64
+ }
65
+ declare enum OneTimeProductNotificationType {
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
70
+ }
71
+ interface OneTimeProductNotification {
72
+ version: string;
73
+ sku: string;
74
+ purchaseToken: string;
75
+ notificationType: OneTimeProductNotificationType;
76
+ }
77
+ declare enum VoidedPurchaseProductType {
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
82
+ }
83
+ /**
84
+ * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
85
+ * will be REFUND_TYPE_FULL_REFUND.
86
+ */
87
+ declare enum VoidedPurchaseRefundType {
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
95
+ }
96
+ interface VoidedPurchaseNotification {
97
+ purchaseToken: string;
98
+ orderId: string;
99
+ productType: VoidedPurchaseProductType;
100
+ refundType: VoidedPurchaseRefundType;
101
+ }
102
+ interface TestNotification {
103
+ version: string;
104
+ }
105
+ /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
106
+ declare enum GooglePlaySubscriptionState {
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"
147
+ }
148
+ //#endregion
149
+ export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
150
+ //# sourceMappingURL=real-time-developer-notification.d.mts.map
@@ -0,0 +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,54 +1,119 @@
1
- // src/google-play/real-time-developer-notification.ts
2
- var SubscriptionNotificationType = /* @__PURE__ */ ((SubscriptionNotificationType2) => {
3
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_RECOVERED"] = 1] = "SUBSCRIPTION_RECOVERED";
4
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_RENEWED"] = 2] = "SUBSCRIPTION_RENEWED";
5
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_CANCELED"] = 3] = "SUBSCRIPTION_CANCELED";
6
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PURCHASED"] = 4] = "SUBSCRIPTION_PURCHASED";
7
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_ON_HOLD"] = 5] = "SUBSCRIPTION_ON_HOLD";
8
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_IN_GRACE_PERIOD"] = 6] = "SUBSCRIPTION_IN_GRACE_PERIOD";
9
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_RESTARTED"] = 7] = "SUBSCRIPTION_RESTARTED";
10
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PRICE_CHANGE_CONFIRMED"] = 8] = "SUBSCRIPTION_PRICE_CHANGE_CONFIRMED";
11
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_DEFERRED"] = 9] = "SUBSCRIPTION_DEFERRED";
12
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PAUSED"] = 10] = "SUBSCRIPTION_PAUSED";
13
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED"] = 11] = "SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED";
14
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_REVOKED"] = 12] = "SUBSCRIPTION_REVOKED";
15
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_EXPIRED"] = 13] = "SUBSCRIPTION_EXPIRED";
16
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PRICE_CHANGE_UPDATED"] = 19] = "SUBSCRIPTION_PRICE_CHANGE_UPDATED";
17
- SubscriptionNotificationType2[SubscriptionNotificationType2["SUBSCRIPTION_PENDING_PURCHASE_CANCELED"] = 20] = "SUBSCRIPTION_PENDING_PURCHASE_CANCELED";
18
- return SubscriptionNotificationType2;
19
- })(SubscriptionNotificationType || {});
20
- var OneTimeProductNotificationType = /* @__PURE__ */ ((OneTimeProductNotificationType2) => {
21
- OneTimeProductNotificationType2[OneTimeProductNotificationType2["ONE_TIME_PRODUCT_PURCHASED"] = 1] = "ONE_TIME_PRODUCT_PURCHASED";
22
- OneTimeProductNotificationType2[OneTimeProductNotificationType2["ONE_TIME_PRODUCT_CANCELED"] = 2] = "ONE_TIME_PRODUCT_CANCELED";
23
- return OneTimeProductNotificationType2;
24
- })(OneTimeProductNotificationType || {});
25
- var VoidedPurchaseProductType = /* @__PURE__ */ ((VoidedPurchaseProductType2) => {
26
- VoidedPurchaseProductType2[VoidedPurchaseProductType2["PRODUCT_TYPE_SUBSCRIPTION"] = 1] = "PRODUCT_TYPE_SUBSCRIPTION";
27
- VoidedPurchaseProductType2[VoidedPurchaseProductType2["PRODUCT_TYPE_ONE_TIME"] = 2] = "PRODUCT_TYPE_ONE_TIME";
28
- return VoidedPurchaseProductType2;
29
- })(VoidedPurchaseProductType || {});
30
- var VoidedPurchaseRefundType = /* @__PURE__ */ ((VoidedPurchaseRefundType2) => {
31
- VoidedPurchaseRefundType2[VoidedPurchaseRefundType2["REFUND_TYPE_FULL_REFUND"] = 1] = "REFUND_TYPE_FULL_REFUND";
32
- VoidedPurchaseRefundType2[VoidedPurchaseRefundType2["REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND"] = 2] = "REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND";
33
- return VoidedPurchaseRefundType2;
34
- })(VoidedPurchaseRefundType || {});
35
- var GooglePlaySubscriptionState = /* @__PURE__ */ ((GooglePlaySubscriptionState2) => {
36
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_UNSPECIFIED"] = "SUBSCRIPTION_STATE_UNSPECIFIED";
37
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_PENDING"] = "SUBSCRIPTION_STATE_PENDING";
38
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_ACTIVE"] = "SUBSCRIPTION_STATE_ACTIVE";
39
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_PAUSED"] = "SUBSCRIPTION_STATE_PAUSED";
40
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_IN_GRACE_PERIOD"] = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD";
41
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_ON_HOLD"] = "SUBSCRIPTION_STATE_ON_HOLD";
42
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_CANCELED"] = "SUBSCRIPTION_STATE_CANCELED";
43
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_EXPIRED"] = "SUBSCRIPTION_STATE_EXPIRED";
44
- GooglePlaySubscriptionState2["SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"] = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED";
45
- return GooglePlaySubscriptionState2;
46
- })(GooglePlaySubscriptionState || {});
47
- export {
48
- GooglePlaySubscriptionState,
49
- OneTimeProductNotificationType,
50
- SubscriptionNotificationType,
51
- VoidedPurchaseProductType,
52
- VoidedPurchaseRefundType
53
- };
1
+ //#region src/google-play/real-time-developer-notification.ts
2
+ /**
3
+ * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
4
+ * */
5
+ let SubscriptionNotificationType = /* @__PURE__ */ function(SubscriptionNotificationType) {
6
+ /** A subscription was recovered from account hold. */
7
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RECOVERED"] = 1] = "SUBSCRIPTION_RECOVERED";
8
+ /** An active subscription was renewed. */
9
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RENEWED"] = 2] = "SUBSCRIPTION_RENEWED";
10
+ /**
11
+ * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,
12
+ * sent when the user cancels.
13
+ */
14
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_CANCELED"] = 3] = "SUBSCRIPTION_CANCELED";
15
+ /** A new subscription was purchased. */
16
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PURCHASED"] = 4] = "SUBSCRIPTION_PURCHASED";
17
+ /** A subscription has entered account hold (if enabled). */
18
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_ON_HOLD"] = 5] = "SUBSCRIPTION_ON_HOLD";
19
+ /** A subscription has entered grace period (if enabled). */
20
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_IN_GRACE_PERIOD"] = 6] = "SUBSCRIPTION_IN_GRACE_PERIOD";
21
+ /**
22
+ * User has restored their subscription from Play > Account > Subscriptions. The subscription was
23
+ * canceled but had not expired yet when the user restores. For more information, see Restorations.
24
+ */
25
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_RESTARTED"] = 7] = "SUBSCRIPTION_RESTARTED";
26
+ /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */
27
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PRICE_CHANGE_CONFIRMED"] = 8] = "SUBSCRIPTION_PRICE_CHANGE_CONFIRMED";
28
+ /** A subscription's recurrence time has been extended. */
29
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_DEFERRED"] = 9] = "SUBSCRIPTION_DEFERRED";
30
+ /** A subscription has been paused. */
31
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PAUSED"] = 10] = "SUBSCRIPTION_PAUSED";
32
+ /** A subscription pause schedule has been changed. */
33
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED"] = 11] = "SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED";
34
+ /** A subscription has been revoked from the user before the expiration time. */
35
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_REVOKED"] = 12] = "SUBSCRIPTION_REVOKED";
36
+ /** A subscription has expired. */
37
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_EXPIRED"] = 13] = "SUBSCRIPTION_EXPIRED";
38
+ /** A subscription item's price change details are updated. */
39
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PRICE_CHANGE_UPDATED"] = 19] = "SUBSCRIPTION_PRICE_CHANGE_UPDATED";
40
+ /** A pending transaction of a subscription has been canceled. */
41
+ SubscriptionNotificationType[SubscriptionNotificationType["SUBSCRIPTION_PENDING_PURCHASE_CANCELED"] = 20] = "SUBSCRIPTION_PENDING_PURCHASE_CANCELED";
42
+ return SubscriptionNotificationType;
43
+ }({});
44
+ let OneTimeProductNotificationType = /* @__PURE__ */ function(OneTimeProductNotificationType) {
45
+ /** A one-time product was successfully purchased by a user. */
46
+ OneTimeProductNotificationType[OneTimeProductNotificationType["ONE_TIME_PRODUCT_PURCHASED"] = 1] = "ONE_TIME_PRODUCT_PURCHASED";
47
+ /** A pending one-time product purchase has been canceled by the user. */
48
+ OneTimeProductNotificationType[OneTimeProductNotificationType["ONE_TIME_PRODUCT_CANCELED"] = 2] = "ONE_TIME_PRODUCT_CANCELED";
49
+ return OneTimeProductNotificationType;
50
+ }({});
51
+ let VoidedPurchaseProductType = /* @__PURE__ */ function(VoidedPurchaseProductType) {
52
+ /** A subscription purchase has been voided. */
53
+ VoidedPurchaseProductType[VoidedPurchaseProductType["PRODUCT_TYPE_SUBSCRIPTION"] = 1] = "PRODUCT_TYPE_SUBSCRIPTION";
54
+ /** A one-time purchase has been voided. */
55
+ VoidedPurchaseProductType[VoidedPurchaseProductType["PRODUCT_TYPE_ONE_TIME"] = 2] = "PRODUCT_TYPE_ONE_TIME";
56
+ return VoidedPurchaseProductType;
57
+ }({});
58
+ /**
59
+ * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
60
+ * will be REFUND_TYPE_FULL_REFUND.
61
+ */
62
+ let VoidedPurchaseRefundType = /* @__PURE__ */ function(VoidedPurchaseRefundType) {
63
+ /** The purchase has been fully voided. */
64
+ VoidedPurchaseRefundType[VoidedPurchaseRefundType["REFUND_TYPE_FULL_REFUND"] = 1] = "REFUND_TYPE_FULL_REFUND";
65
+ /**
66
+ * The purchase has been partially voided by a quantity-based partial refund, applicable only to
67
+ * multi-quantity purchases. A purchase can be partially voided multiple times.
68
+ */
69
+ VoidedPurchaseRefundType[VoidedPurchaseRefundType["REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND"] = 2] = "REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND";
70
+ return VoidedPurchaseRefundType;
71
+ }({});
72
+ /** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
73
+ let GooglePlaySubscriptionState = /* @__PURE__ */ function(GooglePlaySubscriptionState) {
74
+ /** Unspecified subscription state. */
75
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_UNSPECIFIED"] = "SUBSCRIPTION_STATE_UNSPECIFIED";
76
+ /**
77
+ * Subscription was created but awaiting payment during signup. In this state, all items are
78
+ * awaiting payment.
79
+ */
80
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PENDING"] = "SUBSCRIPTION_STATE_PENDING";
81
+ /**
82
+ * Subscription is active.
83
+ * (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
84
+ * (2) If the subscription is a prepaid plan, at least one item is not expired.
85
+ */
86
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_ACTIVE"] = "SUBSCRIPTION_STATE_ACTIVE";
87
+ /**
88
+ * Subscription is paused. The state is only available when the subscription is an auto renewing
89
+ * plan. In this state, all items are in paused state.
90
+ */
91
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PAUSED"] = "SUBSCRIPTION_STATE_PAUSED";
92
+ /**
93
+ * Subscription is in grace period. The state is only available when the subscription is an auto
94
+ * renewing plan. In this state, all items are in grace period.
95
+ */
96
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_IN_GRACE_PERIOD"] = "SUBSCRIPTION_STATE_IN_GRACE_PERIOD";
97
+ /**
98
+ * Subscription is on hold (suspended). The state is only available when the subscription is an
99
+ * auto renewing plan. In this state, all items are on hold.
100
+ */
101
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_ON_HOLD"] = "SUBSCRIPTION_STATE_ON_HOLD";
102
+ /**
103
+ * Subscription is canceled but not expired yet. The state is only available when the subscription
104
+ * is an auto renewing plan. All items have autoRenewEnabled set to false.
105
+ */
106
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_CANCELED"] = "SUBSCRIPTION_STATE_CANCELED";
107
+ /** Subscription is expired. All items have expiryTime in the past. */
108
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_EXPIRED"] = "SUBSCRIPTION_STATE_EXPIRED";
109
+ /**
110
+ * Pending transaction for subscription is canceled. If this pending purchase was for an existing
111
+ * subscription, use linkedPurchaseToken to get the current state of that subscription.
112
+ */
113
+ GooglePlaySubscriptionState["SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"] = "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED";
114
+ return GooglePlaySubscriptionState;
115
+ }({});
116
+ //#endregion
117
+ export { GooglePlaySubscriptionState, OneTimeProductNotificationType, SubscriptionNotificationType, VoidedPurchaseProductType, VoidedPurchaseRefundType };
118
+
54
119
  //# sourceMappingURL=real-time-developer-notification.mjs.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":";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.mjs","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"}
package/dist/index.cjs CHANGED
@@ -1,48 +1,13 @@
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);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- ALL_PLATFORMS: () => import_subscription.ALL_PLATFORMS,
24
- ALL_SUBSCRIPTION_STATUS: () => import_subscription.ALL_SUBSCRIPTION_STATUS,
25
- AVAILABLE_STATUS: () => import_subscription.AVAILABLE_STATUS,
26
- AppStoreConfig: () => import_config.AppStoreConfig,
27
- GooglePlayConfig: () => import_config2.GooglePlayConfig,
28
- Platform: () => import_subscription.Platform,
29
- StripeConfig: () => import_config3.StripeConfig,
30
- SubscriptionStatus: () => import_subscription.SubscriptionStatus
31
- });
32
- module.exports = __toCommonJS(index_exports);
33
- var import_subscription = require("./subscription/index.cjs");
34
- var import_config = require("./app-store/config.cjs");
35
- var import_config2 = require("./google-play/config.cjs");
36
- var import_config3 = require("./stripe/config.cjs");
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- ALL_PLATFORMS,
40
- ALL_SUBSCRIPTION_STATUS,
41
- AVAILABLE_STATUS,
42
- AppStoreConfig,
43
- GooglePlayConfig,
44
- Platform,
45
- StripeConfig,
46
- SubscriptionStatus
47
- });
48
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_subscription_index = require("./subscription/index.cjs");
3
+ const require_app_store_config = require("./app-store/config.cjs");
4
+ const require_google_play_config = require("./google-play/config.cjs");
5
+ const require_stripe_config = require("./stripe/config.cjs");
6
+ exports.ALL_PLATFORMS = require_subscription_index.ALL_PLATFORMS;
7
+ exports.ALL_SUBSCRIPTION_STATUS = require_subscription_index.ALL_SUBSCRIPTION_STATUS;
8
+ exports.AVAILABLE_STATUS = require_subscription_index.AVAILABLE_STATUS;
9
+ exports.AppStoreConfig = require_app_store_config.AppStoreConfig;
10
+ exports.GooglePlayConfig = require_google_play_config.GooglePlayConfig;
11
+ exports.Platform = require_subscription_index.Platform;
12
+ exports.StripeConfig = require_stripe_config.StripeConfig;
13
+ exports.SubscriptionStatus = require_subscription_index.SubscriptionStatus;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
- export { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, Platform, SubscriptionStatus } from './subscription/index.cjs';
2
- export { AppStoreConfig } from './app-store/config.cjs';
3
- export { GooglePlayConfig } from './google-play/config.cjs';
4
- export { StripeConfig } from './stripe/config.cjs';
5
- import './types.cjs';
6
- import 'ms';
1
+ import { AppStoreConfig } from "./app-store/config.cjs";
2
+ import { GooglePlayConfig } from "./google-play/config.cjs";
3
+ import { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, Platform, SubscriptionStatus } from "./subscription/index.cjs";
4
+ import { StripeConfig } from "./stripe/config.cjs";
5
+ export { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, AppStoreConfig, GooglePlayConfig, Platform, StripeConfig, SubscriptionStatus };
@@ -0,0 +1,5 @@
1
+ import { AppStoreConfig } from "./app-store/config.mjs";
2
+ import { GooglePlayConfig } from "./google-play/config.mjs";
3
+ import { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, Platform, SubscriptionStatus } from "./subscription/index.mjs";
4
+ import { StripeConfig } from "./stripe/config.mjs";
5
+ export { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, AppStoreConfig, GooglePlayConfig, Platform, StripeConfig, SubscriptionStatus };
package/dist/index.mjs CHANGED
@@ -1,22 +1,5 @@
1
- // src/index.ts
2
- import {
3
- Platform,
4
- SubscriptionStatus,
5
- ALL_PLATFORMS,
6
- AVAILABLE_STATUS,
7
- ALL_SUBSCRIPTION_STATUS
8
- } from "./subscription/index.mjs";
1
+ import { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, Platform, SubscriptionStatus } from "./subscription/index.mjs";
9
2
  import { AppStoreConfig } from "./app-store/config.mjs";
10
3
  import { GooglePlayConfig } from "./google-play/config.mjs";
11
4
  import { StripeConfig } from "./stripe/config.mjs";
12
- export {
13
- ALL_PLATFORMS,
14
- ALL_SUBSCRIPTION_STATUS,
15
- AVAILABLE_STATUS,
16
- AppStoreConfig,
17
- GooglePlayConfig,
18
- Platform,
19
- StripeConfig,
20
- SubscriptionStatus
21
- };
22
- //# sourceMappingURL=index.mjs.map
5
+ export { ALL_PLATFORMS, ALL_SUBSCRIPTION_STATUS, AVAILABLE_STATUS, AppStoreConfig, GooglePlayConfig, Platform, StripeConfig, SubscriptionStatus };