@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.
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/app-store/config.cjs +105 -128
- package/dist/app-store/config.cjs.map +1 -1
- package/dist/app-store/config.d.cts +36 -33
- package/dist/app-store/config.d.cts.map +1 -0
- package/dist/app-store/config.d.mts +42 -0
- package/dist/app-store/config.d.mts.map +1 -0
- package/dist/app-store/config.mjs +100 -91
- package/dist/app-store/config.mjs.map +1 -1
- package/dist/app-store/index.cjs +3 -31
- package/dist/app-store/index.d.cts +2 -3
- package/dist/app-store/index.d.mts +2 -0
- package/dist/app-store/index.mjs +1 -5
- package/dist/google-play/config.cjs +108 -123
- package/dist/google-play/config.cjs.map +1 -1
- package/dist/google-play/config.d.cts +35 -33
- package/dist/google-play/config.d.cts.map +1 -0
- package/dist/google-play/config.d.mts +41 -0
- package/dist/google-play/config.d.mts.map +1 -0
- package/dist/google-play/config.mjs +103 -86
- package/dist/google-play/config.mjs.map +1 -1
- package/dist/google-play/index.cjs +9 -42
- package/dist/google-play/index.d.cts +3 -4
- package/dist/google-play/index.d.mts +3 -0
- package/dist/google-play/index.mjs +2 -17
- package/dist/google-play/real-time-developer-notification.cjs +122 -81
- package/dist/google-play/real-time-developer-notification.cjs.map +1 -1
- package/dist/google-play/real-time-developer-notification.d.cts +119 -117
- package/dist/google-play/real-time-developer-notification.d.cts.map +1 -0
- package/dist/google-play/real-time-developer-notification.d.mts +150 -0
- package/dist/google-play/real-time-developer-notification.d.mts.map +1 -0
- package/dist/google-play/real-time-developer-notification.mjs +118 -53
- package/dist/google-play/real-time-developer-notification.mjs.map +1 -1
- package/dist/index.cjs +13 -48
- package/dist/index.d.cts +5 -6
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +2 -19
- package/dist/stripe/config.cjs +114 -133
- package/dist/stripe/config.cjs.map +1 -1
- package/dist/stripe/config.d.cts +46 -37
- package/dist/stripe/config.d.cts.map +1 -0
- package/dist/stripe/config.d.mts +52 -0
- package/dist/stripe/config.d.mts.map +1 -0
- package/dist/stripe/config.mjs +109 -96
- package/dist/stripe/config.mjs.map +1 -1
- package/dist/stripe/handler.cjs +25 -53
- package/dist/stripe/handler.cjs.map +1 -1
- package/dist/stripe/handler.d.cts +10 -9
- package/dist/stripe/handler.d.cts.map +1 -0
- package/dist/stripe/handler.d.mts +16 -0
- package/dist/stripe/handler.d.mts.map +1 -0
- package/dist/stripe/handler.mjs +25 -29
- package/dist/stripe/handler.mjs.map +1 -1
- package/dist/stripe/index.cjs +27 -74
- package/dist/stripe/index.d.cts +8 -12
- package/dist/stripe/index.d.mts +8 -0
- package/dist/stripe/index.mjs +5 -44
- package/dist/stripe/mapper.cjs +168 -219
- package/dist/stripe/mapper.cjs.map +1 -1
- package/dist/stripe/mapper.d.cts +115 -114
- package/dist/stripe/mapper.d.cts.map +1 -0
- package/dist/stripe/mapper.d.mts +158 -0
- package/dist/stripe/mapper.d.mts.map +1 -0
- package/dist/stripe/mapper.mjs +155 -182
- package/dist/stripe/mapper.mjs.map +1 -1
- package/dist/stripe/metadata.cjs +11 -35
- package/dist/stripe/metadata.cjs.map +1 -1
- package/dist/stripe/metadata.d.cts +9 -7
- package/dist/stripe/metadata.d.cts.map +1 -0
- package/dist/stripe/metadata.d.mts +12 -0
- package/dist/stripe/metadata.d.mts.map +1 -0
- package/dist/stripe/metadata.mjs +11 -11
- package/dist/stripe/metadata.mjs.map +1 -1
- package/dist/stripe/pending-checkout.cjs +55 -61
- package/dist/stripe/pending-checkout.cjs.map +1 -1
- package/dist/stripe/pending-checkout.d.cts +3 -1
- package/dist/stripe/pending-checkout.d.cts.map +1 -0
- package/dist/stripe/{pending-checkout.d.ts → pending-checkout.d.mts} +3 -1
- package/dist/stripe/pending-checkout.d.mts.map +1 -0
- package/dist/stripe/pending-checkout.mjs +52 -34
- package/dist/stripe/pending-checkout.mjs.map +1 -1
- package/dist/stripe/schema.cjs +30 -55
- package/dist/stripe/schema.cjs.map +1 -1
- package/dist/stripe/schema.d.cts +36 -37
- package/dist/stripe/schema.d.cts.map +1 -0
- package/dist/stripe/schema.d.mts +40 -0
- package/dist/stripe/schema.d.mts.map +1 -0
- package/dist/stripe/schema.mjs +28 -40
- package/dist/stripe/schema.mjs.map +1 -1
- package/dist/subscription/index.cjs +178 -80
- package/dist/subscription/index.cjs.map +1 -1
- package/dist/subscription/index.d.cts +136 -134
- package/dist/subscription/index.d.cts.map +1 -0
- package/dist/subscription/index.d.mts +150 -0
- package/dist/subscription/index.d.mts.map +1 -0
- package/dist/subscription/index.mjs +173 -51
- package/dist/subscription/index.mjs.map +1 -1
- package/dist/types.cjs +0 -19
- package/dist/types.d.cts +7 -6
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +10 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +1 -1
- package/package.json +40 -25
- package/dist/app-store/config.d.ts +0 -39
- package/dist/app-store/index.cjs.map +0 -1
- package/dist/app-store/index.d.ts +0 -3
- package/dist/app-store/index.mjs.map +0 -1
- package/dist/google-play/config.d.ts +0 -39
- package/dist/google-play/index.cjs.map +0 -1
- package/dist/google-play/index.d.ts +0 -4
- package/dist/google-play/index.mjs.map +0 -1
- package/dist/google-play/real-time-developer-notification.d.ts +0 -148
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.mjs.map +0 -1
- package/dist/stripe/config.d.ts +0 -43
- package/dist/stripe/handler.d.ts +0 -15
- package/dist/stripe/index.cjs.map +0 -1
- package/dist/stripe/index.d.ts +0 -12
- package/dist/stripe/index.mjs.map +0 -1
- package/dist/stripe/mapper.d.ts +0 -157
- package/dist/stripe/metadata.d.ts +0 -10
- package/dist/stripe/schema.d.ts +0 -41
- package/dist/subscription/index.d.ts +0 -148
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.ts +0 -9
- package/dist/types.mjs.map +0 -1
|
@@ -1,83 +1,124 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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":"
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
version: string;
|
|
62
|
+
purchaseToken: string;
|
|
63
|
+
notificationType: SubscriptionNotificationType;
|
|
63
64
|
}
|
|
64
65
|
declare enum OneTimeProductNotificationType {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
version: string;
|
|
73
|
+
sku: string;
|
|
74
|
+
purchaseToken: string;
|
|
75
|
+
notificationType: OneTimeProductNotificationType;
|
|
75
76
|
}
|
|
76
77
|
declare enum VoidedPurchaseProductType {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
purchaseToken: string;
|
|
98
|
+
orderId: string;
|
|
99
|
+
productType: VoidedPurchaseProductType;
|
|
100
|
+
refundType: VoidedPurchaseRefundType;
|
|
100
101
|
}
|
|
101
102
|
interface TestNotification {
|
|
102
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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 {
|
|
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"}
|