@shware/purchase 3.0.0 → 4.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/google-play/index.cjs +3 -1
- package/dist/google-play/index.d.cts +3 -2
- package/dist/google-play/index.d.mts +3 -2
- package/dist/google-play/index.mjs +3 -2
- package/dist/google-play/mapper.cjs +19 -0
- package/dist/google-play/mapper.cjs.map +1 -0
- package/dist/google-play/mapper.d.cts +7 -0
- package/dist/google-play/mapper.d.cts.map +1 -0
- package/dist/google-play/mapper.d.mts +7 -0
- package/dist/google-play/mapper.d.mts.map +1 -0
- package/dist/google-play/mapper.mjs +18 -0
- package/dist/google-play/mapper.mjs.map +1 -0
- package/dist/google-play/real-time-developer-notification.cjs +12 -43
- package/dist/google-play/real-time-developer-notification.cjs.map +1 -1
- package/dist/google-play/real-time-developer-notification.d.cts +43 -44
- package/dist/google-play/real-time-developer-notification.d.cts.map +1 -1
- package/dist/google-play/real-time-developer-notification.d.mts +43 -44
- package/dist/google-play/real-time-developer-notification.d.mts.map +1 -1
- package/dist/google-play/real-time-developer-notification.mjs +12 -43
- package/dist/google-play/real-time-developer-notification.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_google_play_config = require("./config.cjs");
|
|
3
3
|
const require_google_play_real_time_developer_notification = require("./real-time-developer-notification.cjs");
|
|
4
|
+
const require_google_play_mapper = require("./mapper.cjs");
|
|
5
|
+
exports.GOOGLE_PLAY_SUBSCRIPTION_STATES = require_google_play_real_time_developer_notification.GOOGLE_PLAY_SUBSCRIPTION_STATES;
|
|
4
6
|
exports.GooglePlayConfig = require_google_play_config.GooglePlayConfig;
|
|
5
|
-
exports.GooglePlaySubscriptionState = require_google_play_real_time_developer_notification.GooglePlaySubscriptionState;
|
|
6
7
|
exports.OneTimeProductNotificationType = require_google_play_real_time_developer_notification.OneTimeProductNotificationType;
|
|
7
8
|
exports.SubscriptionNotificationType = require_google_play_real_time_developer_notification.SubscriptionNotificationType;
|
|
8
9
|
exports.VoidedPurchaseProductType = require_google_play_real_time_developer_notification.VoidedPurchaseProductType;
|
|
9
10
|
exports.VoidedPurchaseRefundType = require_google_play_real_time_developer_notification.VoidedPurchaseRefundType;
|
|
11
|
+
exports.mapSubscriptionStatus = require_google_play_mapper.mapSubscriptionStatus;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GooglePlayConfig } from "./config.cjs";
|
|
2
|
-
import { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.cjs";
|
|
3
|
-
|
|
2
|
+
import { DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.cjs";
|
|
3
|
+
import { mapSubscriptionStatus } from "./mapper.cjs";
|
|
4
|
+
export { type DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlayConfig, type GooglePlaySubscriptionState, type OneTimeProductNotification, OneTimeProductNotificationType, type PubsubMessage, type SubscriptionNotification, SubscriptionNotificationType, type TestNotification, type VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType, mapSubscriptionStatus };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GooglePlayConfig } from "./config.mjs";
|
|
2
|
-
import { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.mjs";
|
|
3
|
-
|
|
2
|
+
import { DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.mjs";
|
|
3
|
+
import { mapSubscriptionStatus } from "./mapper.mjs";
|
|
4
|
+
export { type DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlayConfig, type GooglePlaySubscriptionState, type OneTimeProductNotification, OneTimeProductNotificationType, type PubsubMessage, type SubscriptionNotification, SubscriptionNotificationType, type TestNotification, type VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType, mapSubscriptionStatus };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GooglePlayConfig } from "./config.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { GOOGLE_PLAY_SUBSCRIPTION_STATES, OneTimeProductNotificationType, SubscriptionNotificationType, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.mjs";
|
|
3
|
+
import { mapSubscriptionStatus } from "./mapper.mjs";
|
|
4
|
+
export { GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlayConfig, OneTimeProductNotificationType, SubscriptionNotificationType, VoidedPurchaseProductType, VoidedPurchaseRefundType, mapSubscriptionStatus };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/google-play/mapper.ts
|
|
3
|
+
function mapSubscriptionStatus(state) {
|
|
4
|
+
switch (state) {
|
|
5
|
+
case "SUBSCRIPTION_STATE_PENDING": return "PENDING";
|
|
6
|
+
case "SUBSCRIPTION_STATE_ACTIVE": return "ACTIVE";
|
|
7
|
+
case "SUBSCRIPTION_STATE_PAUSED": return "PAUSED";
|
|
8
|
+
case "SUBSCRIPTION_STATE_IN_GRACE_PERIOD": return "IN_GRACE_PERIOD";
|
|
9
|
+
case "SUBSCRIPTION_STATE_ON_HOLD": return "ON_HOLD";
|
|
10
|
+
case "SUBSCRIPTION_STATE_CANCELED": return "CANCELED";
|
|
11
|
+
case "SUBSCRIPTION_STATE_EXPIRED": return "EXPIRED";
|
|
12
|
+
case "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED": return "PENDING_PURCHASE_CANCELED";
|
|
13
|
+
default: throw new Error(`Unknown Google Play subscription state: ${state}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.mapSubscriptionStatus = mapSubscriptionStatus;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=mapper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.cjs","names":[],"sources":["../../src/google-play/mapper.ts"],"sourcesContent":["import type { SubscriptionStatus } from '../subscription/index';\nimport type { GooglePlaySubscriptionState } from './real-time-developer-notification';\n\nexport function mapSubscriptionStatus(state: GooglePlaySubscriptionState): SubscriptionStatus {\n switch (state) {\n case 'SUBSCRIPTION_STATE_PENDING':\n return 'PENDING';\n case 'SUBSCRIPTION_STATE_ACTIVE':\n return 'ACTIVE';\n case 'SUBSCRIPTION_STATE_PAUSED':\n return 'PAUSED';\n case 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD':\n return 'IN_GRACE_PERIOD';\n case 'SUBSCRIPTION_STATE_ON_HOLD':\n return 'ON_HOLD';\n case 'SUBSCRIPTION_STATE_CANCELED':\n return 'CANCELED';\n case 'SUBSCRIPTION_STATE_EXPIRED':\n return 'EXPIRED';\n case 'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED':\n return 'PENDING_PURCHASE_CANCELED';\n default:\n throw new Error(`Unknown Google Play subscription state: ${state}`);\n }\n}\n"],"mappings":";;AAGA,SAAgB,sBAAsB,OAAwD;CAC5F,QAAQ,OAAR;EACE,KAAK,8BACH,OAAO;EACT,KAAK,6BACH,OAAO;EACT,KAAK,6BACH,OAAO;EACT,KAAK,sCACH,OAAO;EACT,KAAK,8BACH,OAAO;EACT,KAAK,+BACH,OAAO;EACT,KAAK,8BACH,OAAO;EACT,KAAK,gDACH,OAAO;EACT,SACE,MAAM,IAAI,MAAM,2CAA2C,OAAO;CACtE;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GooglePlaySubscriptionState } from "./real-time-developer-notification.cjs";
|
|
2
|
+
import { SubscriptionStatus } from "../subscription/index.cjs";
|
|
3
|
+
//#region src/google-play/mapper.d.ts
|
|
4
|
+
declare function mapSubscriptionStatus(state: GooglePlaySubscriptionState): SubscriptionStatus;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { mapSubscriptionStatus };
|
|
7
|
+
//# sourceMappingURL=mapper.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.cts","names":[],"sources":["../../src/google-play/mapper.ts"],"mappings":";;;iBAGgB,sBAAsB,OAAO,8BAA8B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GooglePlaySubscriptionState } from "./real-time-developer-notification.mjs";
|
|
2
|
+
import { SubscriptionStatus } from "../subscription/index.mjs";
|
|
3
|
+
//#region src/google-play/mapper.d.ts
|
|
4
|
+
declare function mapSubscriptionStatus(state: GooglePlaySubscriptionState): SubscriptionStatus;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { mapSubscriptionStatus };
|
|
7
|
+
//# sourceMappingURL=mapper.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.mts","names":[],"sources":["../../src/google-play/mapper.ts"],"mappings":";;;iBAGgB,sBAAsB,OAAO,8BAA8B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/google-play/mapper.ts
|
|
2
|
+
function mapSubscriptionStatus(state) {
|
|
3
|
+
switch (state) {
|
|
4
|
+
case "SUBSCRIPTION_STATE_PENDING": return "PENDING";
|
|
5
|
+
case "SUBSCRIPTION_STATE_ACTIVE": return "ACTIVE";
|
|
6
|
+
case "SUBSCRIPTION_STATE_PAUSED": return "PAUSED";
|
|
7
|
+
case "SUBSCRIPTION_STATE_IN_GRACE_PERIOD": return "IN_GRACE_PERIOD";
|
|
8
|
+
case "SUBSCRIPTION_STATE_ON_HOLD": return "ON_HOLD";
|
|
9
|
+
case "SUBSCRIPTION_STATE_CANCELED": return "CANCELED";
|
|
10
|
+
case "SUBSCRIPTION_STATE_EXPIRED": return "EXPIRED";
|
|
11
|
+
case "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED": return "PENDING_PURCHASE_CANCELED";
|
|
12
|
+
default: throw new Error(`Unknown Google Play subscription state: ${state}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { mapSubscriptionStatus };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=mapper.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.mjs","names":[],"sources":["../../src/google-play/mapper.ts"],"sourcesContent":["import type { SubscriptionStatus } from '../subscription/index';\nimport type { GooglePlaySubscriptionState } from './real-time-developer-notification';\n\nexport function mapSubscriptionStatus(state: GooglePlaySubscriptionState): SubscriptionStatus {\n switch (state) {\n case 'SUBSCRIPTION_STATE_PENDING':\n return 'PENDING';\n case 'SUBSCRIPTION_STATE_ACTIVE':\n return 'ACTIVE';\n case 'SUBSCRIPTION_STATE_PAUSED':\n return 'PAUSED';\n case 'SUBSCRIPTION_STATE_IN_GRACE_PERIOD':\n return 'IN_GRACE_PERIOD';\n case 'SUBSCRIPTION_STATE_ON_HOLD':\n return 'ON_HOLD';\n case 'SUBSCRIPTION_STATE_CANCELED':\n return 'CANCELED';\n case 'SUBSCRIPTION_STATE_EXPIRED':\n return 'EXPIRED';\n case 'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED':\n return 'PENDING_PURCHASE_CANCELED';\n default:\n throw new Error(`Unknown Google Play subscription state: ${state}`);\n }\n}\n"],"mappings":";AAGA,SAAgB,sBAAsB,OAAwD;CAC5F,QAAQ,OAAR;EACE,KAAK,8BACH,OAAO;EACT,KAAK,6BACH,OAAO;EACT,KAAK,6BACH,OAAO;EACT,KAAK,sCACH,OAAO;EACT,KAAK,8BACH,OAAO;EACT,KAAK,+BACH,OAAO;EACT,KAAK,8BACH,OAAO;EACT,KAAK,gDACH,OAAO;EACT,SACE,MAAM,IAAI,MAAM,2CAA2C,OAAO;CACtE;AACF"}
|
|
@@ -67,50 +67,19 @@ const VoidedPurchaseRefundType = {
|
|
|
67
67
|
REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2
|
|
68
68
|
};
|
|
69
69
|
/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* (2) If the subscription is a prepaid plan, at least one item is not expired.
|
|
82
|
-
*/
|
|
83
|
-
SUBSCRIPTION_STATE_ACTIVE: "SUBSCRIPTION_STATE_ACTIVE",
|
|
84
|
-
/**
|
|
85
|
-
* Subscription is paused. The state is only available when the subscription is an auto renewing
|
|
86
|
-
* plan. In this state, all items are in paused state.
|
|
87
|
-
*/
|
|
88
|
-
SUBSCRIPTION_STATE_PAUSED: "SUBSCRIPTION_STATE_PAUSED",
|
|
89
|
-
/**
|
|
90
|
-
* Subscription is in grace period. The state is only available when the subscription is an auto
|
|
91
|
-
* renewing plan. In this state, all items are in grace period.
|
|
92
|
-
*/
|
|
93
|
-
SUBSCRIPTION_STATE_IN_GRACE_PERIOD: "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
|
|
94
|
-
/**
|
|
95
|
-
* Subscription is on hold (suspended). The state is only available when the subscription is an
|
|
96
|
-
* auto renewing plan. In this state, all items are on hold.
|
|
97
|
-
*/
|
|
98
|
-
SUBSCRIPTION_STATE_ON_HOLD: "SUBSCRIPTION_STATE_ON_HOLD",
|
|
99
|
-
/**
|
|
100
|
-
* Subscription is canceled but not expired yet. The state is only available when the subscription
|
|
101
|
-
* is an auto renewing plan. All items have autoRenewEnabled set to false.
|
|
102
|
-
*/
|
|
103
|
-
SUBSCRIPTION_STATE_CANCELED: "SUBSCRIPTION_STATE_CANCELED",
|
|
104
|
-
/** Subscription is expired. All items have expiryTime in the past. */
|
|
105
|
-
SUBSCRIPTION_STATE_EXPIRED: "SUBSCRIPTION_STATE_EXPIRED",
|
|
106
|
-
/**
|
|
107
|
-
* Pending transaction for subscription is canceled. If this pending purchase was for an existing
|
|
108
|
-
* subscription, use linkedPurchaseToken to get the current state of that subscription.
|
|
109
|
-
*/
|
|
110
|
-
SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED: "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
|
|
111
|
-
};
|
|
70
|
+
const GOOGLE_PLAY_SUBSCRIPTION_STATES = [
|
|
71
|
+
"SUBSCRIPTION_STATE_UNSPECIFIED",
|
|
72
|
+
"SUBSCRIPTION_STATE_PENDING",
|
|
73
|
+
"SUBSCRIPTION_STATE_ACTIVE",
|
|
74
|
+
"SUBSCRIPTION_STATE_PAUSED",
|
|
75
|
+
"SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
|
|
76
|
+
"SUBSCRIPTION_STATE_ON_HOLD",
|
|
77
|
+
"SUBSCRIPTION_STATE_CANCELED",
|
|
78
|
+
"SUBSCRIPTION_STATE_EXPIRED",
|
|
79
|
+
"SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
|
|
80
|
+
];
|
|
112
81
|
//#endregion
|
|
113
|
-
exports.
|
|
82
|
+
exports.GOOGLE_PLAY_SUBSCRIPTION_STATES = GOOGLE_PLAY_SUBSCRIPTION_STATES;
|
|
114
83
|
exports.OneTimeProductNotificationType = OneTimeProductNotificationType;
|
|
115
84
|
exports.SubscriptionNotificationType = SubscriptionNotificationType;
|
|
116
85
|
exports.VoidedPurchaseProductType = VoidedPurchaseProductType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-time-developer-notification.cjs","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"sourcesContent":["// ref: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage\nexport type PubsubMessage = {\n data: string;\n attributes: Record<string, string>;\n messageId: string;\n publishTime: string;\n orderingKey: string;\n};\n\n/** https://developer.android.com/google/play/billing/rtdn-reference */\nexport interface DeveloperNotification {\n version: string;\n packageName: string;\n eventTimeMillis: number;\n subscriptionNotification: SubscriptionNotification;\n oneTimeProductNotification: OneTimeProductNotification;\n voidedPurchaseNotification: VoidedPurchaseNotification;\n testNotification: TestNotification;\n}\n\n/**\n * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)\n * */\nexport const SubscriptionNotificationType = {\n /** A subscription was recovered from account hold. */\n SUBSCRIPTION_RECOVERED: 1,\n\n /** An active subscription was renewed. */\n SUBSCRIPTION_RENEWED: 2,\n\n /**\n * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,\n * sent when the user cancels.\n */\n SUBSCRIPTION_CANCELED: 3,\n\n /** A new subscription was purchased. */\n SUBSCRIPTION_PURCHASED: 4,\n\n /** A subscription has entered account hold (if enabled). */\n SUBSCRIPTION_ON_HOLD: 5,\n\n /** A subscription has entered grace period (if enabled). */\n SUBSCRIPTION_IN_GRACE_PERIOD: 6,\n\n /**\n * User has restored their subscription from Play > Account > Subscriptions. The subscription was\n * canceled but had not expired yet when the user restores. For more information, see Restorations.\n */\n SUBSCRIPTION_RESTARTED: 7,\n\n /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */\n SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8,\n\n /** A subscription's recurrence time has been extended. */\n SUBSCRIPTION_DEFERRED: 9,\n\n /** A subscription has been paused. */\n SUBSCRIPTION_PAUSED: 10,\n\n /** A subscription pause schedule has been changed. */\n SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11,\n\n /** A subscription has been revoked from the user before the expiration time. */\n SUBSCRIPTION_REVOKED: 12,\n\n /** A subscription has expired. */\n SUBSCRIPTION_EXPIRED: 13,\n\n /** A subscription item's price change details are updated. */\n SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19,\n\n /** A pending transaction of a subscription has been canceled. */\n SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20,\n} as const;\n\nexport type SubscriptionNotificationType
|
|
1
|
+
{"version":3,"file":"real-time-developer-notification.cjs","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"sourcesContent":["// ref: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage\nexport type PubsubMessage = {\n data: string;\n attributes: Record<string, string>;\n messageId: string;\n publishTime: string;\n orderingKey: string;\n};\n\n/** https://developer.android.com/google/play/billing/rtdn-reference */\nexport interface DeveloperNotification {\n version: string;\n packageName: string;\n eventTimeMillis: number;\n subscriptionNotification: SubscriptionNotification;\n oneTimeProductNotification: OneTimeProductNotification;\n voidedPurchaseNotification: VoidedPurchaseNotification;\n testNotification: TestNotification;\n}\n\n/**\n * [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)\n * */\nexport const SubscriptionNotificationType = {\n /** A subscription was recovered from account hold. */\n SUBSCRIPTION_RECOVERED: 1,\n\n /** An active subscription was renewed. */\n SUBSCRIPTION_RENEWED: 2,\n\n /**\n * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,\n * sent when the user cancels.\n */\n SUBSCRIPTION_CANCELED: 3,\n\n /** A new subscription was purchased. */\n SUBSCRIPTION_PURCHASED: 4,\n\n /** A subscription has entered account hold (if enabled). */\n SUBSCRIPTION_ON_HOLD: 5,\n\n /** A subscription has entered grace period (if enabled). */\n SUBSCRIPTION_IN_GRACE_PERIOD: 6,\n\n /**\n * User has restored their subscription from Play > Account > Subscriptions. The subscription was\n * canceled but had not expired yet when the user restores. For more information, see Restorations.\n */\n SUBSCRIPTION_RESTARTED: 7,\n\n /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */\n SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8,\n\n /** A subscription's recurrence time has been extended. */\n SUBSCRIPTION_DEFERRED: 9,\n\n /** A subscription has been paused. */\n SUBSCRIPTION_PAUSED: 10,\n\n /** A subscription pause schedule has been changed. */\n SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11,\n\n /** A subscription has been revoked from the user before the expiration time. */\n SUBSCRIPTION_REVOKED: 12,\n\n /** A subscription has expired. */\n SUBSCRIPTION_EXPIRED: 13,\n\n /** A subscription item's price change details are updated. */\n SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19,\n\n /** A pending transaction of a subscription has been canceled. */\n SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20,\n} as const;\n\nexport type SubscriptionNotificationType =\n (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];\n\nexport interface SubscriptionNotification {\n version: string;\n purchaseToken: string;\n notificationType: SubscriptionNotificationType;\n}\n\nexport const OneTimeProductNotificationType = {\n /** A one-time product was successfully purchased by a user. */\n ONE_TIME_PRODUCT_PURCHASED: 1,\n\n /** A pending one-time product purchase has been canceled by the user. */\n ONE_TIME_PRODUCT_CANCELED: 2,\n} as const;\n\nexport type OneTimeProductNotificationType =\n (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];\n\nexport interface OneTimeProductNotification {\n version: string;\n sku: string;\n purchaseToken: string;\n notificationType: OneTimeProductNotificationType;\n}\n\nexport const VoidedPurchaseProductType = {\n /** A subscription purchase has been voided. */\n PRODUCT_TYPE_SUBSCRIPTION: 1,\n\n /** A one-time purchase has been voided. */\n PRODUCT_TYPE_ONE_TIME: 2,\n} as const;\n\nexport type VoidedPurchaseProductType =\n (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];\n\n/**\n * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType\n * will be REFUND_TYPE_FULL_REFUND.\n */\nexport const VoidedPurchaseRefundType = {\n /** The purchase has been fully voided. */\n REFUND_TYPE_FULL_REFUND: 1,\n\n /**\n * The purchase has been partially voided by a quantity-based partial refund, applicable only to\n * multi-quantity purchases. A purchase can be partially voided multiple times.\n */\n REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2,\n} as const;\n\nexport type VoidedPurchaseRefundType =\n (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];\n\nexport interface VoidedPurchaseNotification {\n purchaseToken: string;\n orderId: string;\n productType: VoidedPurchaseProductType;\n refundType: VoidedPurchaseRefundType;\n}\n\nexport interface TestNotification {\n version: string;\n}\n\n/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */\nexport const GOOGLE_PLAY_SUBSCRIPTION_STATES = [\n /** Unspecified subscription state. */\n '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',\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',\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',\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',\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',\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',\n\n /** Subscription is expired. All items have expiryTime in the past. */\n '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',\n] as const;\n\nexport type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];\n"],"mappings":";;;;;AAuBA,MAAa,+BAA+B;;CAE1C,wBAAwB;;CAGxB,sBAAsB;;;;;CAMtB,uBAAuB;;CAGvB,wBAAwB;;CAGxB,sBAAsB;;CAGtB,8BAA8B;;;;;CAM9B,wBAAwB;;CAGxB,qCAAqC;;CAGrC,uBAAuB;;CAGvB,qBAAqB;;CAGrB,qCAAqC;;CAGrC,sBAAsB;;CAGtB,sBAAsB;;CAGtB,mCAAmC;;CAGnC,wCAAwC;AAC1C;AAWA,MAAa,iCAAiC;;CAE5C,4BAA4B;;CAG5B,2BAA2B;AAC7B;AAYA,MAAa,4BAA4B;;CAEvC,2BAA2B;;CAG3B,uBAAuB;AACzB;;;;;AASA,MAAa,2BAA2B;;CAEtC,yBAAyB;;;;;CAMzB,2CAA2C;AAC7C;;AAiBA,MAAa,kCAAkC;CAE7C;CAMA;CAOA;CAMA;CAMA;CAMA;CAMA;CAGA;CAMA;AACF"}
|
|
@@ -107,49 +107,48 @@ interface TestNotification {
|
|
|
107
107
|
version: string;
|
|
108
108
|
}
|
|
109
109
|
/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
|
|
110
|
-
declare const
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
type GooglePlaySubscriptionState = (typeof GooglePlaySubscriptionState)[keyof typeof GooglePlaySubscriptionState];
|
|
110
|
+
declare const GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
111
|
+
/** Unspecified subscription state. */
|
|
112
|
+
'SUBSCRIPTION_STATE_UNSPECIFIED',
|
|
113
|
+
/**
|
|
114
|
+
* Subscription was created but awaiting payment during signup. In this state, all items are
|
|
115
|
+
* awaiting payment.
|
|
116
|
+
*/
|
|
117
|
+
'SUBSCRIPTION_STATE_PENDING',
|
|
118
|
+
/**
|
|
119
|
+
* Subscription is active.
|
|
120
|
+
* (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
|
|
121
|
+
* (2) If the subscription is a prepaid plan, at least one item is not expired.
|
|
122
|
+
*/
|
|
123
|
+
'SUBSCRIPTION_STATE_ACTIVE',
|
|
124
|
+
/**
|
|
125
|
+
* Subscription is paused. The state is only available when the subscription is an auto renewing
|
|
126
|
+
* plan. In this state, all items are in paused state.
|
|
127
|
+
*/
|
|
128
|
+
'SUBSCRIPTION_STATE_PAUSED',
|
|
129
|
+
/**
|
|
130
|
+
* Subscription is in grace period. The state is only available when the subscription is an auto
|
|
131
|
+
* renewing plan. In this state, all items are in grace period.
|
|
132
|
+
*/
|
|
133
|
+
'SUBSCRIPTION_STATE_IN_GRACE_PERIOD',
|
|
134
|
+
/**
|
|
135
|
+
* Subscription is on hold (suspended). The state is only available when the subscription is an
|
|
136
|
+
* auto renewing plan. In this state, all items are on hold.
|
|
137
|
+
*/
|
|
138
|
+
'SUBSCRIPTION_STATE_ON_HOLD',
|
|
139
|
+
/**
|
|
140
|
+
* Subscription is canceled but not expired yet. The state is only available when the subscription
|
|
141
|
+
* is an auto renewing plan. All items have autoRenewEnabled set to false.
|
|
142
|
+
*/
|
|
143
|
+
'SUBSCRIPTION_STATE_CANCELED',
|
|
144
|
+
/** Subscription is expired. All items have expiryTime in the past. */
|
|
145
|
+
'SUBSCRIPTION_STATE_EXPIRED',
|
|
146
|
+
/**
|
|
147
|
+
* Pending transaction for subscription is canceled. If this pending purchase was for an existing
|
|
148
|
+
* subscription, use linkedPurchaseToken to get the current state of that subscription.
|
|
149
|
+
*/
|
|
150
|
+
'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED'];
|
|
151
|
+
type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];
|
|
153
152
|
//#endregion
|
|
154
|
-
export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
153
|
+
export { DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
155
154
|
//# sourceMappingURL=real-time-developer-notification.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-time-developer-notification.d.cts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;cAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;KAGU,
|
|
1
|
+
{"version":3,"file":"real-time-developer-notification.d.cts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;cAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;KAGU,uCACF,2CAA2C;UAEpC;EACf;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,yCACF,6CAA6C;UAEtC;EACf;EACA;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,oCACF,wCAAwC;;;;;cAMrC;;WAEX;;;;;WAMA;;KAGU,mCACF,uCAAuC;UAEhC;EACf;EACA;EACA,aAAa;EACb,YAAY;;UAGG;EACf;;;cAIW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmDD,sCAAsC"}
|
|
@@ -107,49 +107,48 @@ interface TestNotification {
|
|
|
107
107
|
version: string;
|
|
108
108
|
}
|
|
109
109
|
/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
|
|
110
|
-
declare const
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
type GooglePlaySubscriptionState = (typeof GooglePlaySubscriptionState)[keyof typeof GooglePlaySubscriptionState];
|
|
110
|
+
declare const GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
111
|
+
/** Unspecified subscription state. */
|
|
112
|
+
'SUBSCRIPTION_STATE_UNSPECIFIED',
|
|
113
|
+
/**
|
|
114
|
+
* Subscription was created but awaiting payment during signup. In this state, all items are
|
|
115
|
+
* awaiting payment.
|
|
116
|
+
*/
|
|
117
|
+
'SUBSCRIPTION_STATE_PENDING',
|
|
118
|
+
/**
|
|
119
|
+
* Subscription is active.
|
|
120
|
+
* (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired.
|
|
121
|
+
* (2) If the subscription is a prepaid plan, at least one item is not expired.
|
|
122
|
+
*/
|
|
123
|
+
'SUBSCRIPTION_STATE_ACTIVE',
|
|
124
|
+
/**
|
|
125
|
+
* Subscription is paused. The state is only available when the subscription is an auto renewing
|
|
126
|
+
* plan. In this state, all items are in paused state.
|
|
127
|
+
*/
|
|
128
|
+
'SUBSCRIPTION_STATE_PAUSED',
|
|
129
|
+
/**
|
|
130
|
+
* Subscription is in grace period. The state is only available when the subscription is an auto
|
|
131
|
+
* renewing plan. In this state, all items are in grace period.
|
|
132
|
+
*/
|
|
133
|
+
'SUBSCRIPTION_STATE_IN_GRACE_PERIOD',
|
|
134
|
+
/**
|
|
135
|
+
* Subscription is on hold (suspended). The state is only available when the subscription is an
|
|
136
|
+
* auto renewing plan. In this state, all items are on hold.
|
|
137
|
+
*/
|
|
138
|
+
'SUBSCRIPTION_STATE_ON_HOLD',
|
|
139
|
+
/**
|
|
140
|
+
* Subscription is canceled but not expired yet. The state is only available when the subscription
|
|
141
|
+
* is an auto renewing plan. All items have autoRenewEnabled set to false.
|
|
142
|
+
*/
|
|
143
|
+
'SUBSCRIPTION_STATE_CANCELED',
|
|
144
|
+
/** Subscription is expired. All items have expiryTime in the past. */
|
|
145
|
+
'SUBSCRIPTION_STATE_EXPIRED',
|
|
146
|
+
/**
|
|
147
|
+
* Pending transaction for subscription is canceled. If this pending purchase was for an existing
|
|
148
|
+
* subscription, use linkedPurchaseToken to get the current state of that subscription.
|
|
149
|
+
*/
|
|
150
|
+
'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED'];
|
|
151
|
+
type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];
|
|
153
152
|
//#endregion
|
|
154
|
-
export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
153
|
+
export { DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
155
154
|
//# sourceMappingURL=real-time-developer-notification.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-time-developer-notification.d.mts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;cAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;KAGU,
|
|
1
|
+
{"version":3,"file":"real-time-developer-notification.d.mts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";KACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;cAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;KAGU,uCACF,2CAA2C;UAEpC;EACf;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,yCACF,6CAA6C;UAEtC;EACf;EACA;EACA;EACA,kBAAkB;;cAGP;;WAEX;;WAGA;;KAGU,oCACF,wCAAwC;;;;;cAMrC;;WAEX;;;;;WAMA;;KAGU,mCACF,uCAAuC;UAEhC;EACf;EACA;EACA,aAAa;EACb,YAAY;;UAGG;EACf;;;cAIW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmDD,sCAAsC"}
|
|
@@ -66,49 +66,18 @@ const VoidedPurchaseRefundType = {
|
|
|
66
66
|
REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2
|
|
67
67
|
};
|
|
68
68
|
/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* (2) If the subscription is a prepaid plan, at least one item is not expired.
|
|
81
|
-
*/
|
|
82
|
-
SUBSCRIPTION_STATE_ACTIVE: "SUBSCRIPTION_STATE_ACTIVE",
|
|
83
|
-
/**
|
|
84
|
-
* Subscription is paused. The state is only available when the subscription is an auto renewing
|
|
85
|
-
* plan. In this state, all items are in paused state.
|
|
86
|
-
*/
|
|
87
|
-
SUBSCRIPTION_STATE_PAUSED: "SUBSCRIPTION_STATE_PAUSED",
|
|
88
|
-
/**
|
|
89
|
-
* Subscription is in grace period. The state is only available when the subscription is an auto
|
|
90
|
-
* renewing plan. In this state, all items are in grace period.
|
|
91
|
-
*/
|
|
92
|
-
SUBSCRIPTION_STATE_IN_GRACE_PERIOD: "SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
|
|
93
|
-
/**
|
|
94
|
-
* Subscription is on hold (suspended). The state is only available when the subscription is an
|
|
95
|
-
* auto renewing plan. In this state, all items are on hold.
|
|
96
|
-
*/
|
|
97
|
-
SUBSCRIPTION_STATE_ON_HOLD: "SUBSCRIPTION_STATE_ON_HOLD",
|
|
98
|
-
/**
|
|
99
|
-
* Subscription is canceled but not expired yet. The state is only available when the subscription
|
|
100
|
-
* is an auto renewing plan. All items have autoRenewEnabled set to false.
|
|
101
|
-
*/
|
|
102
|
-
SUBSCRIPTION_STATE_CANCELED: "SUBSCRIPTION_STATE_CANCELED",
|
|
103
|
-
/** Subscription is expired. All items have expiryTime in the past. */
|
|
104
|
-
SUBSCRIPTION_STATE_EXPIRED: "SUBSCRIPTION_STATE_EXPIRED",
|
|
105
|
-
/**
|
|
106
|
-
* Pending transaction for subscription is canceled. If this pending purchase was for an existing
|
|
107
|
-
* subscription, use linkedPurchaseToken to get the current state of that subscription.
|
|
108
|
-
*/
|
|
109
|
-
SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED: "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
|
|
110
|
-
};
|
|
69
|
+
const GOOGLE_PLAY_SUBSCRIPTION_STATES = [
|
|
70
|
+
"SUBSCRIPTION_STATE_UNSPECIFIED",
|
|
71
|
+
"SUBSCRIPTION_STATE_PENDING",
|
|
72
|
+
"SUBSCRIPTION_STATE_ACTIVE",
|
|
73
|
+
"SUBSCRIPTION_STATE_PAUSED",
|
|
74
|
+
"SUBSCRIPTION_STATE_IN_GRACE_PERIOD",
|
|
75
|
+
"SUBSCRIPTION_STATE_ON_HOLD",
|
|
76
|
+
"SUBSCRIPTION_STATE_CANCELED",
|
|
77
|
+
"SUBSCRIPTION_STATE_EXPIRED",
|
|
78
|
+
"SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"
|
|
79
|
+
];
|
|
111
80
|
//#endregion
|
|
112
|
-
export {
|
|
81
|
+
export { GOOGLE_PLAY_SUBSCRIPTION_STATES, OneTimeProductNotificationType, SubscriptionNotificationType, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
113
82
|
|
|
114
83
|
//# sourceMappingURL=real-time-developer-notification.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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 const SubscriptionNotificationType = {\n /** A subscription was recovered from account hold. */\n SUBSCRIPTION_RECOVERED: 1,\n\n /** An active subscription was renewed. */\n SUBSCRIPTION_RENEWED: 2,\n\n /**\n * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,\n * sent when the user cancels.\n */\n SUBSCRIPTION_CANCELED: 3,\n\n /** A new subscription was purchased. */\n SUBSCRIPTION_PURCHASED: 4,\n\n /** A subscription has entered account hold (if enabled). */\n SUBSCRIPTION_ON_HOLD: 5,\n\n /** A subscription has entered grace period (if enabled). */\n SUBSCRIPTION_IN_GRACE_PERIOD: 6,\n\n /**\n * User has restored their subscription from Play > Account > Subscriptions. The subscription was\n * canceled but had not expired yet when the user restores. For more information, see Restorations.\n */\n SUBSCRIPTION_RESTARTED: 7,\n\n /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */\n SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8,\n\n /** A subscription's recurrence time has been extended. */\n SUBSCRIPTION_DEFERRED: 9,\n\n /** A subscription has been paused. */\n SUBSCRIPTION_PAUSED: 10,\n\n /** A subscription pause schedule has been changed. */\n SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11,\n\n /** A subscription has been revoked from the user before the expiration time. */\n SUBSCRIPTION_REVOKED: 12,\n\n /** A subscription has expired. */\n SUBSCRIPTION_EXPIRED: 13,\n\n /** A subscription item's price change details are updated. */\n SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19,\n\n /** A pending transaction of a subscription has been canceled. */\n SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20,\n} as const;\n\nexport type SubscriptionNotificationType
|
|
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 const SubscriptionNotificationType = {\n /** A subscription was recovered from account hold. */\n SUBSCRIPTION_RECOVERED: 1,\n\n /** An active subscription was renewed. */\n SUBSCRIPTION_RENEWED: 2,\n\n /**\n * A subscription was either voluntarily or involuntarily cancelled. For voluntary cancellation,\n * sent when the user cancels.\n */\n SUBSCRIPTION_CANCELED: 3,\n\n /** A new subscription was purchased. */\n SUBSCRIPTION_PURCHASED: 4,\n\n /** A subscription has entered account hold (if enabled). */\n SUBSCRIPTION_ON_HOLD: 5,\n\n /** A subscription has entered grace period (if enabled). */\n SUBSCRIPTION_IN_GRACE_PERIOD: 6,\n\n /**\n * User has restored their subscription from Play > Account > Subscriptions. The subscription was\n * canceled but had not expired yet when the user restores. For more information, see Restorations.\n */\n SUBSCRIPTION_RESTARTED: 7,\n\n /** (DEPRECATED) A subscription price change has successfully been confirmed by the user. */\n SUBSCRIPTION_PRICE_CHANGE_CONFIRMED: 8,\n\n /** A subscription's recurrence time has been extended. */\n SUBSCRIPTION_DEFERRED: 9,\n\n /** A subscription has been paused. */\n SUBSCRIPTION_PAUSED: 10,\n\n /** A subscription pause schedule has been changed. */\n SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED: 11,\n\n /** A subscription has been revoked from the user before the expiration time. */\n SUBSCRIPTION_REVOKED: 12,\n\n /** A subscription has expired. */\n SUBSCRIPTION_EXPIRED: 13,\n\n /** A subscription item's price change details are updated. */\n SUBSCRIPTION_PRICE_CHANGE_UPDATED: 19,\n\n /** A pending transaction of a subscription has been canceled. */\n SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20,\n} as const;\n\nexport type SubscriptionNotificationType =\n (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];\n\nexport interface SubscriptionNotification {\n version: string;\n purchaseToken: string;\n notificationType: SubscriptionNotificationType;\n}\n\nexport const OneTimeProductNotificationType = {\n /** A one-time product was successfully purchased by a user. */\n ONE_TIME_PRODUCT_PURCHASED: 1,\n\n /** A pending one-time product purchase has been canceled by the user. */\n ONE_TIME_PRODUCT_CANCELED: 2,\n} as const;\n\nexport type OneTimeProductNotificationType =\n (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];\n\nexport interface OneTimeProductNotification {\n version: string;\n sku: string;\n purchaseToken: string;\n notificationType: OneTimeProductNotificationType;\n}\n\nexport const VoidedPurchaseProductType = {\n /** A subscription purchase has been voided. */\n PRODUCT_TYPE_SUBSCRIPTION: 1,\n\n /** A one-time purchase has been voided. */\n PRODUCT_TYPE_ONE_TIME: 2,\n} as const;\n\nexport type VoidedPurchaseProductType =\n (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];\n\n/**\n * Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType\n * will be REFUND_TYPE_FULL_REFUND.\n */\nexport const VoidedPurchaseRefundType = {\n /** The purchase has been fully voided. */\n REFUND_TYPE_FULL_REFUND: 1,\n\n /**\n * The purchase has been partially voided by a quantity-based partial refund, applicable only to\n * multi-quantity purchases. A purchase can be partially voided multiple times.\n */\n REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2,\n} as const;\n\nexport type VoidedPurchaseRefundType =\n (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];\n\nexport interface VoidedPurchaseNotification {\n purchaseToken: string;\n orderId: string;\n productType: VoidedPurchaseProductType;\n refundType: VoidedPurchaseRefundType;\n}\n\nexport interface TestNotification {\n version: string;\n}\n\n/** ref: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionState */\nexport const GOOGLE_PLAY_SUBSCRIPTION_STATES = [\n /** Unspecified subscription state. */\n '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',\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',\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',\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',\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',\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',\n\n /** Subscription is expired. All items have expiryTime in the past. */\n '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',\n] as const;\n\nexport type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];\n"],"mappings":";;;;AAuBA,MAAa,+BAA+B;;CAE1C,wBAAwB;;CAGxB,sBAAsB;;;;;CAMtB,uBAAuB;;CAGvB,wBAAwB;;CAGxB,sBAAsB;;CAGtB,8BAA8B;;;;;CAM9B,wBAAwB;;CAGxB,qCAAqC;;CAGrC,uBAAuB;;CAGvB,qBAAqB;;CAGrB,qCAAqC;;CAGrC,sBAAsB;;CAGtB,sBAAsB;;CAGtB,mCAAmC;;CAGnC,wCAAwC;AAC1C;AAWA,MAAa,iCAAiC;;CAE5C,4BAA4B;;CAG5B,2BAA2B;AAC7B;AAYA,MAAa,4BAA4B;;CAEvC,2BAA2B;;CAG3B,uBAAuB;AACzB;;;;;AASA,MAAa,2BAA2B;;CAEtC,yBAAyB;;;;;CAMzB,2CAA2C;AAC7C;;AAiBA,MAAa,kCAAkC;CAE7C;CAMA;CAOA;CAMA;CAMA;CAMA;CAMA;CAGA;CAMA;AACF"}
|