@shware/purchase 5.1.0 → 5.2.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/README.md +341 -0
- package/dist/app-store/config.d.cts +2 -2
- package/dist/app-store/config.d.cts.map +1 -1
- package/dist/app-store/config.d.mts +2 -2
- package/dist/app-store/config.d.mts.map +1 -1
- package/dist/app-store/handler.d.cts +3 -3
- package/dist/app-store/handler.d.cts.map +1 -1
- package/dist/app-store/handler.d.mts +3 -3
- package/dist/app-store/handler.d.mts.map +1 -1
- package/dist/app-store/mapper.d.cts +2 -3
- package/dist/app-store/mapper.d.cts.map +1 -1
- package/dist/app-store/mapper.d.mts +2 -3
- package/dist/app-store/mapper.d.mts.map +1 -1
- package/dist/google-play/config.d.cts +2 -2
- package/dist/google-play/config.d.cts.map +1 -1
- package/dist/google-play/config.d.mts +2 -2
- package/dist/google-play/config.d.mts.map +1 -1
- package/dist/google-play/mapper.d.cts +4 -5
- package/dist/google-play/mapper.d.cts.map +1 -1
- package/dist/google-play/mapper.d.mts +4 -5
- package/dist/google-play/mapper.d.mts.map +1 -1
- package/dist/google-play/real-time-developer-notification.d.cts +16 -17
- package/dist/google-play/real-time-developer-notification.d.cts.map +1 -1
- package/dist/google-play/real-time-developer-notification.d.mts +16 -17
- package/dist/google-play/real-time-developer-notification.d.mts.map +1 -1
- package/dist/stripe/config.d.cts +4 -4
- package/dist/stripe/config.d.cts.map +1 -1
- package/dist/stripe/config.d.mts +4 -4
- package/dist/stripe/config.d.mts.map +1 -1
- package/dist/stripe/handler.d.cts +2 -2
- package/dist/stripe/handler.d.cts.map +1 -1
- package/dist/stripe/handler.d.mts +2 -2
- package/dist/stripe/handler.d.mts.map +1 -1
- package/dist/stripe/mapper.d.cts +22 -23
- package/dist/stripe/mapper.d.cts.map +1 -1
- package/dist/stripe/mapper.d.mts +22 -23
- package/dist/stripe/mapper.d.mts.map +1 -1
- package/dist/stripe/metadata.d.cts +1 -2
- package/dist/stripe/metadata.d.cts.map +1 -1
- package/dist/stripe/metadata.d.mts +1 -2
- package/dist/stripe/metadata.d.mts.map +1 -1
- package/dist/stripe/pending-checkout.d.cts +3 -4
- package/dist/stripe/pending-checkout.d.cts.map +1 -1
- package/dist/stripe/pending-checkout.d.mts +3 -4
- package/dist/stripe/pending-checkout.d.mts.map +1 -1
- package/dist/stripe/schema.d.cts +5 -5
- package/dist/stripe/schema.d.cts.map +1 -1
- package/dist/stripe/schema.d.mts +5 -5
- package/dist/stripe/schema.d.mts.map +1 -1
- package/dist/subscription/index.d.cts +12 -13
- package/dist/subscription/index.d.cts.map +1 -1
- package/dist/subscription/index.d.mts +12 -13
- package/dist/subscription/index.d.mts.map +1 -1
- package/dist/types.d.cts +2 -3
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +2 -3
- package/dist/types.d.mts.map +1 -1
- package/package.json +9 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/google-play/real-time-developer-notification.d.ts
|
|
2
|
-
type PubsubMessage = {
|
|
2
|
+
export type PubsubMessage = {
|
|
3
3
|
data: string;
|
|
4
4
|
attributes: Record<string, string>;
|
|
5
5
|
messageId: string;
|
|
@@ -7,7 +7,7 @@ type PubsubMessage = {
|
|
|
7
7
|
orderingKey: string;
|
|
8
8
|
};
|
|
9
9
|
/** https://developer.android.com/google/play/billing/rtdn-reference */
|
|
10
|
-
interface DeveloperNotification {
|
|
10
|
+
export interface DeveloperNotification {
|
|
11
11
|
version: string;
|
|
12
12
|
packageName: string;
|
|
13
13
|
eventTimeMillis: number;
|
|
@@ -19,7 +19,7 @@ interface DeveloperNotification {
|
|
|
19
19
|
/**
|
|
20
20
|
* [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
|
|
21
21
|
* */
|
|
22
|
-
declare const SubscriptionNotificationType: {
|
|
22
|
+
export declare const SubscriptionNotificationType: {
|
|
23
23
|
/** A subscription was recovered from account hold. */
|
|
24
24
|
readonly SUBSCRIPTION_RECOVERED: 1;
|
|
25
25
|
/** An active subscription was renewed. */
|
|
@@ -57,37 +57,37 @@ declare const SubscriptionNotificationType: {
|
|
|
57
57
|
/** A pending transaction of a subscription has been canceled. */
|
|
58
58
|
readonly SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20;
|
|
59
59
|
};
|
|
60
|
-
type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];
|
|
61
|
-
interface SubscriptionNotification {
|
|
60
|
+
export type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];
|
|
61
|
+
export interface SubscriptionNotification {
|
|
62
62
|
version: string;
|
|
63
63
|
purchaseToken: string;
|
|
64
64
|
notificationType: SubscriptionNotificationType;
|
|
65
65
|
}
|
|
66
|
-
declare const OneTimeProductNotificationType: {
|
|
66
|
+
export declare const OneTimeProductNotificationType: {
|
|
67
67
|
/** A one-time product was successfully purchased by a user. */
|
|
68
68
|
readonly ONE_TIME_PRODUCT_PURCHASED: 1;
|
|
69
69
|
/** A pending one-time product purchase has been canceled by the user. */
|
|
70
70
|
readonly ONE_TIME_PRODUCT_CANCELED: 2;
|
|
71
71
|
};
|
|
72
|
-
type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];
|
|
73
|
-
interface OneTimeProductNotification {
|
|
72
|
+
export type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];
|
|
73
|
+
export interface OneTimeProductNotification {
|
|
74
74
|
version: string;
|
|
75
75
|
sku: string;
|
|
76
76
|
purchaseToken: string;
|
|
77
77
|
notificationType: OneTimeProductNotificationType;
|
|
78
78
|
}
|
|
79
|
-
declare const VoidedPurchaseProductType: {
|
|
79
|
+
export declare const VoidedPurchaseProductType: {
|
|
80
80
|
/** A subscription purchase has been voided. */
|
|
81
81
|
readonly PRODUCT_TYPE_SUBSCRIPTION: 1;
|
|
82
82
|
/** A one-time purchase has been voided. */
|
|
83
83
|
readonly PRODUCT_TYPE_ONE_TIME: 2;
|
|
84
84
|
};
|
|
85
|
-
type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];
|
|
85
|
+
export type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];
|
|
86
86
|
/**
|
|
87
87
|
* Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
|
|
88
88
|
* will be REFUND_TYPE_FULL_REFUND.
|
|
89
89
|
*/
|
|
90
|
-
declare const VoidedPurchaseRefundType: {
|
|
90
|
+
export declare const VoidedPurchaseRefundType: {
|
|
91
91
|
/** The purchase has been fully voided. */
|
|
92
92
|
readonly REFUND_TYPE_FULL_REFUND: 1;
|
|
93
93
|
/**
|
|
@@ -96,18 +96,18 @@ declare const VoidedPurchaseRefundType: {
|
|
|
96
96
|
*/
|
|
97
97
|
readonly REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2;
|
|
98
98
|
};
|
|
99
|
-
type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];
|
|
100
|
-
interface VoidedPurchaseNotification {
|
|
99
|
+
export type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];
|
|
100
|
+
export interface VoidedPurchaseNotification {
|
|
101
101
|
purchaseToken: string;
|
|
102
102
|
orderId: string;
|
|
103
103
|
productType: VoidedPurchaseProductType;
|
|
104
104
|
refundType: VoidedPurchaseRefundType;
|
|
105
105
|
}
|
|
106
|
-
interface TestNotification {
|
|
106
|
+
export 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 GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
110
|
+
export declare const GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
111
111
|
/** Unspecified subscription state. */
|
|
112
112
|
'SUBSCRIPTION_STATE_UNSPECIFIED',
|
|
113
113
|
/**
|
|
@@ -148,7 +148,6 @@ declare const GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
|
148
148
|
* subscription, use linkedPurchaseToken to get the current state of that subscription.
|
|
149
149
|
*/
|
|
150
150
|
'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED'];
|
|
151
|
-
type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];
|
|
151
|
+
export type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];
|
|
152
152
|
//#endregion
|
|
153
|
-
export { DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
154
153
|
//# 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":";
|
|
1
|
+
{"version":3,"file":"real-time-developer-notification.d.cts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";YACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;iBAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;qBAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;YAGU,uCACF,2CAA2C;iBAEpC;EACf;EACA;EACA,kBAAkB;;qBAGP;;WAEX;;WAGA;;YAGU,yCACF,6CAA6C;iBAEtC;EACf;EACA;EACA;EACA,kBAAkB;;qBAGP;;WAEX;;WAGA;;YAGU,oCACF,wCAAwC;;;;;qBAMrC;;WAEX;;;;;WAMA;;YAGU,mCACF,uCAAuC;iBAEhC;EACf;EACA;EACA,aAAa;EACb,YAAY;;iBAGG;EACf;;;qBAIW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmDD,sCAAsC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/google-play/real-time-developer-notification.d.ts
|
|
2
|
-
type PubsubMessage = {
|
|
2
|
+
export type PubsubMessage = {
|
|
3
3
|
data: string;
|
|
4
4
|
attributes: Record<string, string>;
|
|
5
5
|
messageId: string;
|
|
@@ -7,7 +7,7 @@ type PubsubMessage = {
|
|
|
7
7
|
orderingKey: string;
|
|
8
8
|
};
|
|
9
9
|
/** https://developer.android.com/google/play/billing/rtdn-reference */
|
|
10
|
-
interface DeveloperNotification {
|
|
10
|
+
export interface DeveloperNotification {
|
|
11
11
|
version: string;
|
|
12
12
|
packageName: string;
|
|
13
13
|
eventTimeMillis: number;
|
|
@@ -19,7 +19,7 @@ interface DeveloperNotification {
|
|
|
19
19
|
/**
|
|
20
20
|
* [Real-time developer notifications reference guide](https://developer.android.com/google/play/billing/rtdn-reference)
|
|
21
21
|
* */
|
|
22
|
-
declare const SubscriptionNotificationType: {
|
|
22
|
+
export declare const SubscriptionNotificationType: {
|
|
23
23
|
/** A subscription was recovered from account hold. */
|
|
24
24
|
readonly SUBSCRIPTION_RECOVERED: 1;
|
|
25
25
|
/** An active subscription was renewed. */
|
|
@@ -57,37 +57,37 @@ declare const SubscriptionNotificationType: {
|
|
|
57
57
|
/** A pending transaction of a subscription has been canceled. */
|
|
58
58
|
readonly SUBSCRIPTION_PENDING_PURCHASE_CANCELED: 20;
|
|
59
59
|
};
|
|
60
|
-
type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];
|
|
61
|
-
interface SubscriptionNotification {
|
|
60
|
+
export type SubscriptionNotificationType = (typeof SubscriptionNotificationType)[keyof typeof SubscriptionNotificationType];
|
|
61
|
+
export interface SubscriptionNotification {
|
|
62
62
|
version: string;
|
|
63
63
|
purchaseToken: string;
|
|
64
64
|
notificationType: SubscriptionNotificationType;
|
|
65
65
|
}
|
|
66
|
-
declare const OneTimeProductNotificationType: {
|
|
66
|
+
export declare const OneTimeProductNotificationType: {
|
|
67
67
|
/** A one-time product was successfully purchased by a user. */
|
|
68
68
|
readonly ONE_TIME_PRODUCT_PURCHASED: 1;
|
|
69
69
|
/** A pending one-time product purchase has been canceled by the user. */
|
|
70
70
|
readonly ONE_TIME_PRODUCT_CANCELED: 2;
|
|
71
71
|
};
|
|
72
|
-
type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];
|
|
73
|
-
interface OneTimeProductNotification {
|
|
72
|
+
export type OneTimeProductNotificationType = (typeof OneTimeProductNotificationType)[keyof typeof OneTimeProductNotificationType];
|
|
73
|
+
export interface OneTimeProductNotification {
|
|
74
74
|
version: string;
|
|
75
75
|
sku: string;
|
|
76
76
|
purchaseToken: string;
|
|
77
77
|
notificationType: OneTimeProductNotificationType;
|
|
78
78
|
}
|
|
79
|
-
declare const VoidedPurchaseProductType: {
|
|
79
|
+
export declare const VoidedPurchaseProductType: {
|
|
80
80
|
/** A subscription purchase has been voided. */
|
|
81
81
|
readonly PRODUCT_TYPE_SUBSCRIPTION: 1;
|
|
82
82
|
/** A one-time purchase has been voided. */
|
|
83
83
|
readonly PRODUCT_TYPE_ONE_TIME: 2;
|
|
84
84
|
};
|
|
85
|
-
type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];
|
|
85
|
+
export type VoidedPurchaseProductType = (typeof VoidedPurchaseProductType)[keyof typeof VoidedPurchaseProductType];
|
|
86
86
|
/**
|
|
87
87
|
* Note when the remaining total quantity of a multi-quantity purchase is refunded, the refundType
|
|
88
88
|
* will be REFUND_TYPE_FULL_REFUND.
|
|
89
89
|
*/
|
|
90
|
-
declare const VoidedPurchaseRefundType: {
|
|
90
|
+
export declare const VoidedPurchaseRefundType: {
|
|
91
91
|
/** The purchase has been fully voided. */
|
|
92
92
|
readonly REFUND_TYPE_FULL_REFUND: 1;
|
|
93
93
|
/**
|
|
@@ -96,18 +96,18 @@ declare const VoidedPurchaseRefundType: {
|
|
|
96
96
|
*/
|
|
97
97
|
readonly REFUND_TYPE_QUANTITY_BASED_PARTIAL_REFUND: 2;
|
|
98
98
|
};
|
|
99
|
-
type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];
|
|
100
|
-
interface VoidedPurchaseNotification {
|
|
99
|
+
export type VoidedPurchaseRefundType = (typeof VoidedPurchaseRefundType)[keyof typeof VoidedPurchaseRefundType];
|
|
100
|
+
export interface VoidedPurchaseNotification {
|
|
101
101
|
purchaseToken: string;
|
|
102
102
|
orderId: string;
|
|
103
103
|
productType: VoidedPurchaseProductType;
|
|
104
104
|
refundType: VoidedPurchaseRefundType;
|
|
105
105
|
}
|
|
106
|
-
interface TestNotification {
|
|
106
|
+
export 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 GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
110
|
+
export declare const GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
111
111
|
/** Unspecified subscription state. */
|
|
112
112
|
'SUBSCRIPTION_STATE_UNSPECIFIED',
|
|
113
113
|
/**
|
|
@@ -148,7 +148,6 @@ declare const GOOGLE_PLAY_SUBSCRIPTION_STATES: readonly [
|
|
|
148
148
|
* subscription, use linkedPurchaseToken to get the current state of that subscription.
|
|
149
149
|
*/
|
|
150
150
|
'SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED'];
|
|
151
|
-
type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];
|
|
151
|
+
export type GooglePlaySubscriptionState = (typeof GOOGLE_PLAY_SUBSCRIPTION_STATES)[number];
|
|
152
152
|
//#endregion
|
|
153
|
-
export { DeveloperNotification, GOOGLE_PLAY_SUBSCRIPTION_STATES, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
|
|
154
153
|
//# 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":";
|
|
1
|
+
{"version":3,"file":"real-time-developer-notification.d.mts","names":[],"sources":["../../src/google-play/real-time-developer-notification.ts"],"mappings":";YACY;EACV;EACA,YAAY;EACZ;EACA;EACA;;;iBAIe;EACf;EACA;EACA;EACA,0BAA0B;EAC1B,4BAA4B;EAC5B,4BAA4B;EAC5B,kBAAkB;;;;;qBAMP;;WAEX;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;;;;WAMA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;WAGA;;YAGU,uCACF,2CAA2C;iBAEpC;EACf;EACA;EACA,kBAAkB;;qBAGP;;WAEX;;WAGA;;YAGU,yCACF,6CAA6C;iBAEtC;EACf;EACA;EACA;EACA,kBAAkB;;qBAGP;;WAEX;;WAGA;;YAGU,oCACF,wCAAwC;;;;;qBAMrC;;WAEX;;;;;WAMA;;YAGU,mCACF,uCAAuC;iBAEhC;EACf;EACA;EACA,aAAa;EACb,YAAY;;iBAGG;EACf;;;qBAIW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmDD,sCAAsC"}
|
package/dist/stripe/config.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Metadata } from "../types.cjs";
|
|
2
2
|
//#region src/stripe/config.d.ts
|
|
3
|
-
type PriceId = `price_${string}`;
|
|
3
|
+
export type PriceId = `price_${string}`;
|
|
4
4
|
/**
|
|
5
5
|
* Which Stripe object space the config addresses. Test and live prices are
|
|
6
6
|
* disjoint, so a config is built for exactly one of them. Derive it from the
|
|
7
7
|
* secret key (`sk_test_` vs `sk_live_`) rather than from the deployment
|
|
8
8
|
* environment: the key is what actually decides which space API calls hit.
|
|
9
9
|
*/
|
|
10
|
-
type StripeMode = 'live' | 'test';
|
|
10
|
+
export type StripeMode = 'live' | 'test';
|
|
11
11
|
declare const addMethod: unique symbol;
|
|
12
12
|
declare class Product<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never, I extends PriceId = never> {
|
|
13
13
|
readonly id: string;
|
|
@@ -43,7 +43,7 @@ type Options = {
|
|
|
43
43
|
cancellationCouponId: string;
|
|
44
44
|
allowPromotionCodes: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare class StripeConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never> {
|
|
46
|
+
export declare class StripeConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never> {
|
|
47
47
|
private readonly products;
|
|
48
48
|
readonly mode: StripeMode;
|
|
49
49
|
returnUrl: string;
|
|
@@ -73,5 +73,5 @@ declare class StripeConfig<NS extends Lowercase<string> = Lowercase<string>, PE
|
|
|
73
73
|
getCreditExpiresAt: (productId: string, priceId?: string) => string;
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
|
-
export {
|
|
76
|
+
export {};
|
|
77
77
|
//# sourceMappingURL=config.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/stripe/config.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/stripe/config.ts"],"mappings":";;YAIY;;;;;;;YAQA;cAEN;cAEA,QACJ,WAAW,oBAAoB,mBAC/B,4BACA,4BACA,2BACA,2BACA,UAAU;WAED;WACA,QAAQ,aAAa,IAAI,IAAI,IAAI,IAAI;WACrC,MAAM;WACN,eAAe;WACf,QAAQ,IAAI,SAAS;EAE9B,gBAAgB;EAEhB,YACE,QAAQ,aAAa,IAAI,IAAI,IAAI,IAAI,KACrC,YACA,OAAM,WACN,gBAAe;;;;;;EAejB,QAAS,UAAU,SAAO,SACf,UAAU,YAAY,GAAC,WACtB,aACT,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;;;;;;;;;EAcnC,UAAO,gBAAoB,GAAC;IAAW,MAAM;QAAS,aAAA,IAAA,IAAA,IAAA,IAAA;;KAgBnD;EACH,MAAM;EACN;EACA;EACA;EACA;EACA;;qBAGW,aACX,WAAW,oBAAoB,mBAC/B,4BACA,4BACA,2BACA;mBAEiB;WAED,MAAM;EACf;EACA;EACA;EACA;EACA;MAEH;GAMH,aAAU,SAAa,QAAQ,IAAI,IAAI,IAAI,IAAI;UAczC;SASA,SAAU,aAAW,mBAAmB,qBAAmB,8BAA0B,SACjF,YAAO,aAAA,MAAA,MAAA;;;;;EASlB;KACG,aAAa,MAAM,qBAClB,WAAW,UAAU,aAAa,IACjC,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI;KAC9B,aAAa,MAAM,qBAAqB,UAAU,IAAI,UAAU,IAC/D,WAAW,UAAU,aAAa,GAClC,MAAM,GACN,kBAAkB,KAAK,YAAY,aAAa,IAC/C,QAAQ,IAAI,IAAI,OAAO,KAAK,MAAM,IAAI,IAAI;;EAK/C,UAAO,sBAAwB;EAO/B,mBAAgB,sBAAwB;EAOxC,UAAO;;EAOP,aAAU,sBAAwB;EAOlC,kBAAe,mBAAqB;mBAanB;EAajB,qBAAkB,mBAAqB"}
|
package/dist/stripe/config.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Metadata } from "../types.mjs";
|
|
2
2
|
//#region src/stripe/config.d.ts
|
|
3
|
-
type PriceId = `price_${string}`;
|
|
3
|
+
export type PriceId = `price_${string}`;
|
|
4
4
|
/**
|
|
5
5
|
* Which Stripe object space the config addresses. Test and live prices are
|
|
6
6
|
* disjoint, so a config is built for exactly one of them. Derive it from the
|
|
7
7
|
* secret key (`sk_test_` vs `sk_live_`) rather than from the deployment
|
|
8
8
|
* environment: the key is what actually decides which space API calls hit.
|
|
9
9
|
*/
|
|
10
|
-
type StripeMode = 'live' | 'test';
|
|
10
|
+
export type StripeMode = 'live' | 'test';
|
|
11
11
|
declare const addMethod: unique symbol;
|
|
12
12
|
declare class Product<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never, I extends PriceId = never> {
|
|
13
13
|
readonly id: string;
|
|
@@ -43,7 +43,7 @@ type Options = {
|
|
|
43
43
|
cancellationCouponId: string;
|
|
44
44
|
allowPromotionCodes: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare class StripeConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never> {
|
|
46
|
+
export declare class StripeConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PL extends string = never, PI extends string = never> {
|
|
47
47
|
private readonly products;
|
|
48
48
|
readonly mode: StripeMode;
|
|
49
49
|
returnUrl: string;
|
|
@@ -73,5 +73,5 @@ declare class StripeConfig<NS extends Lowercase<string> = Lowercase<string>, PE
|
|
|
73
73
|
getCreditExpiresAt: (productId: string, priceId?: string) => string;
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
|
-
export {
|
|
76
|
+
export {};
|
|
77
77
|
//# sourceMappingURL=config.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/stripe/config.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/stripe/config.ts"],"mappings":";;YAIY;;;;;;;YAQA;cAEN;cAEA,QACJ,WAAW,oBAAoB,mBAC/B,4BACA,4BACA,2BACA,2BACA,UAAU;WAED;WACA,QAAQ,aAAa,IAAI,IAAI,IAAI,IAAI;WACrC,MAAM;WACN,eAAe;WACf,QAAQ,IAAI,SAAS;EAE9B,gBAAgB;EAEhB,YACE,QAAQ,aAAa,IAAI,IAAI,IAAI,IAAI,KACrC,YACA,OAAM,WACN,gBAAe;;;;;;EAejB,QAAS,UAAU,SAAO,SACf,UAAU,YAAY,GAAC,WACtB,aACT,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;;;;;;;;;EAcnC,UAAO,gBAAoB,GAAC;IAAW,MAAM;QAAS,aAAA,IAAA,IAAA,IAAA,IAAA;;KAgBnD;EACH,MAAM;EACN;EACA;EACA;EACA;EACA;;qBAGW,aACX,WAAW,oBAAoB,mBAC/B,4BACA,4BACA,2BACA;mBAEiB;WAED,MAAM;EACf;EACA;EACA;EACA;EACA;MAEH;GAMH,aAAU,SAAa,QAAQ,IAAI,IAAI,IAAI,IAAI;UAczC;SASA,SAAU,aAAW,mBAAmB,qBAAmB,8BAA0B,SACjF,YAAO,aAAA,MAAA,MAAA;;;;;EASlB;KACG,aAAa,MAAM,qBAClB,WAAW,UAAU,aAAa,IACjC,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI;KAC9B,aAAa,MAAM,qBAAqB,UAAU,IAAI,UAAU,IAC/D,WAAW,UAAU,aAAa,GAClC,MAAM,GACN,kBAAkB,KAAK,YAAY,aAAa,IAC/C,QAAQ,IAAI,IAAI,OAAO,KAAK,MAAM,IAAI,IAAI;;EAK/C,UAAO,sBAAwB;EAO/B,mBAAgB,sBAAwB;EAOxC,UAAO;;EAOP,aAAU,sBAAwB;EAOlC,kBAAe,mBAAqB;mBAanB;EAajB,qBAAkB,mBAAqB"}
|
|
@@ -4,7 +4,7 @@ type StripeEventObject<T extends Stripe.Event.Type> = Extract<Stripe.Event, {
|
|
|
4
4
|
type: T;
|
|
5
5
|
}>['data']['object'];
|
|
6
6
|
type EventHandlerFn<T extends Stripe.Event.Type = Stripe.Event.Type> = (object: StripeEventObject<T>) => Promise<void>;
|
|
7
|
-
declare class StripeEventHandler {
|
|
7
|
+
export declare class StripeEventHandler {
|
|
8
8
|
private readonly handlers;
|
|
9
9
|
private constructor();
|
|
10
10
|
static create(): StripeEventHandler;
|
|
@@ -12,5 +12,5 @@ declare class StripeEventHandler {
|
|
|
12
12
|
process: (event: Stripe.Event) => Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
15
|
+
export {};
|
|
16
16
|
//# sourceMappingURL=handler.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.cts","names":[],"sources":["../../src/stripe/handler.ts"],"mappings":";;KAEK,kBAAkB,UAAU,OAAO,MAAM,QAAQ,QACpD,OAAO;EACL,MAAM;;KAGL,eAAe,UAAU,OAAO,MAAM,OAAO,OAAO,MAAM,SAC7D,QAAQ,kBAAkB,OACvB;
|
|
1
|
+
{"version":3,"file":"handler.d.cts","names":[],"sources":["../../src/stripe/handler.ts"],"mappings":";;KAEK,kBAAkB,UAAU,OAAO,MAAM,QAAQ,QACpD,OAAO;EACL,MAAM;;KAGL,eAAe,UAAU,OAAO,MAAM,OAAO,OAAO,MAAM,SAC7D,QAAQ,kBAAkB,OACvB;qBAEQ;mBAEM;UAEV;SAIA,UAAM;EAIb,KAAM,UAAU,OAAO,MAAM,MAAI,MAAQ,GAAC,SAAW,eAAe;EASpE,UAAO,OAAiB,OAAO,UAAQ"}
|
|
@@ -4,7 +4,7 @@ type StripeEventObject<T extends Stripe.Event.Type> = Extract<Stripe.Event, {
|
|
|
4
4
|
type: T;
|
|
5
5
|
}>['data']['object'];
|
|
6
6
|
type EventHandlerFn<T extends Stripe.Event.Type = Stripe.Event.Type> = (object: StripeEventObject<T>) => Promise<void>;
|
|
7
|
-
declare class StripeEventHandler {
|
|
7
|
+
export declare class StripeEventHandler {
|
|
8
8
|
private readonly handlers;
|
|
9
9
|
private constructor();
|
|
10
10
|
static create(): StripeEventHandler;
|
|
@@ -12,5 +12,5 @@ declare class StripeEventHandler {
|
|
|
12
12
|
process: (event: Stripe.Event) => Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
15
|
+
export {};
|
|
16
16
|
//# sourceMappingURL=handler.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.mts","names":[],"sources":["../../src/stripe/handler.ts"],"mappings":";;KAEK,kBAAkB,UAAU,OAAO,MAAM,QAAQ,QACpD,OAAO;EACL,MAAM;;KAGL,eAAe,UAAU,OAAO,MAAM,OAAO,OAAO,MAAM,SAC7D,QAAQ,kBAAkB,OACvB;
|
|
1
|
+
{"version":3,"file":"handler.d.mts","names":[],"sources":["../../src/stripe/handler.ts"],"mappings":";;KAEK,kBAAkB,UAAU,OAAO,MAAM,QAAQ,QACpD,OAAO;EACL,MAAM;;KAGL,eAAe,UAAU,OAAO,MAAM,OAAO,OAAO,MAAM,SAC7D,QAAQ,kBAAkB,OACvB;qBAEQ;mBAEM;UAEV;SAIA,UAAM;EAIb,KAAM,UAAU,OAAO,MAAM,MAAI,MAAQ,GAAC,SAAW,eAAe;EASpE,UAAO,OAAiB,OAAO,UAAQ"}
|
package/dist/stripe/mapper.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CancellationDetails, SubscriptionStatus } from "../subscription/index.cjs";
|
|
2
2
|
import { Stripe } from "stripe";
|
|
3
3
|
//#region src/stripe/mapper.d.ts
|
|
4
|
-
declare function mapTime<T extends number | null>(stripeTimestampSeconds: T): T extends number ? string : null;
|
|
5
|
-
type Price = {
|
|
4
|
+
export declare function mapTime<T extends number | null>(stripeTimestampSeconds: T): T extends number ? string : null;
|
|
5
|
+
export type Price = {
|
|
6
6
|
id: string;
|
|
7
7
|
type: Stripe.Price.Type;
|
|
8
8
|
active: boolean;
|
|
@@ -12,8 +12,8 @@ type Price = {
|
|
|
12
12
|
unit_amount_decimal: string | null;
|
|
13
13
|
recurring: Stripe.Price.Recurring | null;
|
|
14
14
|
};
|
|
15
|
-
declare function mapPrice(price: Stripe.Price): Price;
|
|
16
|
-
interface LineItem {
|
|
15
|
+
export declare function mapPrice(price: Stripe.Price): Price;
|
|
16
|
+
export interface LineItem {
|
|
17
17
|
id: string;
|
|
18
18
|
currency: string;
|
|
19
19
|
quantity: number | null;
|
|
@@ -24,9 +24,9 @@ interface LineItem {
|
|
|
24
24
|
amount_discount: number;
|
|
25
25
|
price: Price | null;
|
|
26
26
|
}
|
|
27
|
-
declare function mapLineItem(item: Stripe.LineItem): LineItem;
|
|
28
|
-
type PaymentStatus = Stripe.Checkout.Session.PaymentStatus;
|
|
29
|
-
interface CheckoutSession {
|
|
27
|
+
export declare function mapLineItem(item: Stripe.LineItem): LineItem;
|
|
28
|
+
export type PaymentStatus = Stripe.Checkout.Session.PaymentStatus;
|
|
29
|
+
export interface CheckoutSession {
|
|
30
30
|
id: string;
|
|
31
31
|
url: string | null;
|
|
32
32
|
coupon: string | undefined;
|
|
@@ -37,8 +37,8 @@ interface CheckoutSession {
|
|
|
37
37
|
amount_total: number | null;
|
|
38
38
|
line_items: LineItem[] | undefined;
|
|
39
39
|
}
|
|
40
|
-
declare function mapCheckoutSession(session: Stripe.Checkout.Session): CheckoutSession;
|
|
41
|
-
declare function mapInvoice(i: Stripe.Invoice): {
|
|
40
|
+
export declare function mapCheckoutSession(session: Stripe.Checkout.Session): CheckoutSession;
|
|
41
|
+
export declare function mapInvoice(i: Stripe.Invoice): {
|
|
42
42
|
id: string;
|
|
43
43
|
number: string | null;
|
|
44
44
|
total: number;
|
|
@@ -56,7 +56,7 @@ declare function mapInvoice(i: Stripe.Invoice): {
|
|
|
56
56
|
period_start: number;
|
|
57
57
|
period_end: number;
|
|
58
58
|
};
|
|
59
|
-
declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
|
|
59
|
+
export declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
|
|
60
60
|
id: string;
|
|
61
61
|
amount: number;
|
|
62
62
|
amount_capturable: number;
|
|
@@ -67,7 +67,7 @@ declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
|
|
|
67
67
|
status: Stripe.PaymentIntent.Status;
|
|
68
68
|
created: number;
|
|
69
69
|
};
|
|
70
|
-
declare function mapCharge(charge: Stripe.Charge): {
|
|
70
|
+
export declare function mapCharge(charge: Stripe.Charge): {
|
|
71
71
|
id: string;
|
|
72
72
|
description: string | null;
|
|
73
73
|
currency: string;
|
|
@@ -91,7 +91,7 @@ declare function mapCharge(charge: Stripe.Charge): {
|
|
|
91
91
|
created: number;
|
|
92
92
|
} | undefined;
|
|
93
93
|
};
|
|
94
|
-
type ProductPrice = {
|
|
94
|
+
export type ProductPrice = {
|
|
95
95
|
id: string;
|
|
96
96
|
type: Stripe.Price.Type;
|
|
97
97
|
unit_amount: number;
|
|
@@ -103,11 +103,11 @@ type ProductPrice = {
|
|
|
103
103
|
livemode: Stripe.Product['livemode'];
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
declare function mapSubscriptionStatus(status: Stripe.Subscription.Status): SubscriptionStatus;
|
|
107
|
-
declare const ZERO_DECIMAL_CURRENCIES: string[];
|
|
108
|
-
declare function minorUnits(currency: string): 1 | 100;
|
|
109
|
-
declare function price(value: number, currency: string): number;
|
|
110
|
-
interface Item {
|
|
106
|
+
export declare function mapSubscriptionStatus(status: Stripe.Subscription.Status): SubscriptionStatus;
|
|
107
|
+
export declare const ZERO_DECIMAL_CURRENCIES: string[];
|
|
108
|
+
export declare function minorUnits(currency: string): 1 | 100;
|
|
109
|
+
export declare function price(value: number, currency: string): number;
|
|
110
|
+
export interface Item {
|
|
111
111
|
item_id: string;
|
|
112
112
|
item_name: string;
|
|
113
113
|
affiliation?: 'Google Store' | (string & {});
|
|
@@ -127,7 +127,7 @@ interface Item {
|
|
|
127
127
|
price?: number;
|
|
128
128
|
quantity?: number;
|
|
129
129
|
}
|
|
130
|
-
interface PurchaseProperties {
|
|
130
|
+
export interface PurchaseProperties {
|
|
131
131
|
currency: string;
|
|
132
132
|
value: number;
|
|
133
133
|
transaction_id: string;
|
|
@@ -136,21 +136,20 @@ interface PurchaseProperties {
|
|
|
136
136
|
tax?: number;
|
|
137
137
|
items?: Item[];
|
|
138
138
|
}
|
|
139
|
-
interface BeginCheckoutProperties {
|
|
139
|
+
export interface BeginCheckoutProperties {
|
|
140
140
|
currency: string;
|
|
141
141
|
value: number;
|
|
142
142
|
coupon?: string;
|
|
143
143
|
items: Item[];
|
|
144
144
|
}
|
|
145
|
-
declare function getPurchaseProperties(session: CheckoutSession): PurchaseProperties;
|
|
146
|
-
declare function getBeginCheckoutProperties(p: ProductPrice): BeginCheckoutProperties;
|
|
145
|
+
export declare function getPurchaseProperties(session: CheckoutSession): PurchaseProperties;
|
|
146
|
+
export declare function getBeginCheckoutProperties(p: ProductPrice): BeginCheckoutProperties;
|
|
147
147
|
/**
|
|
148
148
|
* Stripe's `cancellation_details` in the shared shape. The object is present on every
|
|
149
149
|
* subscription with all three fields null, so an active one maps to null rather than an empty
|
|
150
150
|
* record. `reason` says who acted: `cancellation_requested` is the customer (or us on their
|
|
151
151
|
* behalf), the payment reasons are Stripe ending it.
|
|
152
152
|
*/
|
|
153
|
-
declare function mapCancellationDetails(subscription: Pick<Stripe.Subscription, 'cancellation_details'>): CancellationDetails | null;
|
|
153
|
+
export declare function mapCancellationDetails(subscription: Pick<Stripe.Subscription, 'cancellation_details'>): CancellationDetails | null;
|
|
154
154
|
//#endregion
|
|
155
|
-
export { BeginCheckoutProperties, CheckoutSession, Item, LineItem, PaymentStatus, Price, ProductPrice, PurchaseProperties, ZERO_DECIMAL_CURRENCIES, getBeginCheckoutProperties, getPurchaseProperties, mapCancellationDetails, mapCharge, mapCheckoutSession, mapInvoice, mapLineItem, mapPaymentIntent, mapPrice, mapSubscriptionStatus, mapTime, minorUnits, price };
|
|
156
155
|
//# sourceMappingURL=mapper.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.cts","names":[],"sources":["../../src/stripe/mapper.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mapper.d.cts","names":[],"sources":["../../src/stripe/mapper.ts"],"mappings":";;;wBAQgB,QAAQ,yBACtB,wBAAwB,IACvB;YAKS;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,gBAAgB,OAAO,MAAM;EAC7B,UAAU,OAAO;EACjB;EACA;EACA,WAAW,OAAO,MAAM;;wBAGV,SAAS,OAAO,OAAO,QAAQ;iBAa9B;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO;;wBAGO,YAAY,MAAM,OAAO,WAAW;YAoBxC,gBAAgB,OAAO,SAAS,QAAQ;iBAMnC;EACf;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;EACA,YAAY;;wBAGE,mBAAmB,SAAS,OAAO,SAAS,UAAU;wBA0BtD,WAAW,GAAG,OAAO;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAc,OAAA,QAAA;EACd;EACA;EACA;EACA,QAAM,OAAA,QAAA;EACN;EACA;EACA;;wBAIY,iBAAiB,QAAQ,OAAO;EAE5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,cAAA;EACN;;wBAIY,UAAU,QAAQ,OAAO;EAErC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,OAAA;EACN;EACA;;;;;;;;;;;;YAOQ;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,UAAU,OAAO;EACjB;IACE,IAAI,OAAO;IACX,MAAM,OAAO;IACb,aAAa,OAAO;IACpB,UAAU,OAAO;;;wBAIL,sBAAsB,QAAQ,OAAO,aAAa,SAAS;qBAyB9D;wBAmBG,WAAW;wBAIX,MAAM,eAAe;iBAIpB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;iBAGO;EACf;EACA;EACA;EACA,OAAO;;wBAqCO,sBAAsB,SAAS,kBAAkB;wBA2BjD,2BAA2B,GAAG,eAAe;;;;;;;wBAoB7C,uBACd,cAAc,KAAK,OAAO,wCACzB"}
|
package/dist/stripe/mapper.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CancellationDetails, SubscriptionStatus } from "../subscription/index.mjs";
|
|
2
2
|
import { Stripe } from "stripe";
|
|
3
3
|
//#region src/stripe/mapper.d.ts
|
|
4
|
-
declare function mapTime<T extends number | null>(stripeTimestampSeconds: T): T extends number ? string : null;
|
|
5
|
-
type Price = {
|
|
4
|
+
export declare function mapTime<T extends number | null>(stripeTimestampSeconds: T): T extends number ? string : null;
|
|
5
|
+
export type Price = {
|
|
6
6
|
id: string;
|
|
7
7
|
type: Stripe.Price.Type;
|
|
8
8
|
active: boolean;
|
|
@@ -12,8 +12,8 @@ type Price = {
|
|
|
12
12
|
unit_amount_decimal: string | null;
|
|
13
13
|
recurring: Stripe.Price.Recurring | null;
|
|
14
14
|
};
|
|
15
|
-
declare function mapPrice(price: Stripe.Price): Price;
|
|
16
|
-
interface LineItem {
|
|
15
|
+
export declare function mapPrice(price: Stripe.Price): Price;
|
|
16
|
+
export interface LineItem {
|
|
17
17
|
id: string;
|
|
18
18
|
currency: string;
|
|
19
19
|
quantity: number | null;
|
|
@@ -24,9 +24,9 @@ interface LineItem {
|
|
|
24
24
|
amount_discount: number;
|
|
25
25
|
price: Price | null;
|
|
26
26
|
}
|
|
27
|
-
declare function mapLineItem(item: Stripe.LineItem): LineItem;
|
|
28
|
-
type PaymentStatus = Stripe.Checkout.Session.PaymentStatus;
|
|
29
|
-
interface CheckoutSession {
|
|
27
|
+
export declare function mapLineItem(item: Stripe.LineItem): LineItem;
|
|
28
|
+
export type PaymentStatus = Stripe.Checkout.Session.PaymentStatus;
|
|
29
|
+
export interface CheckoutSession {
|
|
30
30
|
id: string;
|
|
31
31
|
url: string | null;
|
|
32
32
|
coupon: string | undefined;
|
|
@@ -37,8 +37,8 @@ interface CheckoutSession {
|
|
|
37
37
|
amount_total: number | null;
|
|
38
38
|
line_items: LineItem[] | undefined;
|
|
39
39
|
}
|
|
40
|
-
declare function mapCheckoutSession(session: Stripe.Checkout.Session): CheckoutSession;
|
|
41
|
-
declare function mapInvoice(i: Stripe.Invoice): {
|
|
40
|
+
export declare function mapCheckoutSession(session: Stripe.Checkout.Session): CheckoutSession;
|
|
41
|
+
export declare function mapInvoice(i: Stripe.Invoice): {
|
|
42
42
|
id: string;
|
|
43
43
|
number: string | null;
|
|
44
44
|
total: number;
|
|
@@ -56,7 +56,7 @@ declare function mapInvoice(i: Stripe.Invoice): {
|
|
|
56
56
|
period_start: number;
|
|
57
57
|
period_end: number;
|
|
58
58
|
};
|
|
59
|
-
declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
|
|
59
|
+
export declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
|
|
60
60
|
id: string;
|
|
61
61
|
amount: number;
|
|
62
62
|
amount_capturable: number;
|
|
@@ -67,7 +67,7 @@ declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
|
|
|
67
67
|
status: Stripe.PaymentIntent.Status;
|
|
68
68
|
created: number;
|
|
69
69
|
};
|
|
70
|
-
declare function mapCharge(charge: Stripe.Charge): {
|
|
70
|
+
export declare function mapCharge(charge: Stripe.Charge): {
|
|
71
71
|
id: string;
|
|
72
72
|
description: string | null;
|
|
73
73
|
currency: string;
|
|
@@ -91,7 +91,7 @@ declare function mapCharge(charge: Stripe.Charge): {
|
|
|
91
91
|
created: number;
|
|
92
92
|
} | undefined;
|
|
93
93
|
};
|
|
94
|
-
type ProductPrice = {
|
|
94
|
+
export type ProductPrice = {
|
|
95
95
|
id: string;
|
|
96
96
|
type: Stripe.Price.Type;
|
|
97
97
|
unit_amount: number;
|
|
@@ -103,11 +103,11 @@ type ProductPrice = {
|
|
|
103
103
|
livemode: Stripe.Product['livemode'];
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
declare function mapSubscriptionStatus(status: Stripe.Subscription.Status): SubscriptionStatus;
|
|
107
|
-
declare const ZERO_DECIMAL_CURRENCIES: string[];
|
|
108
|
-
declare function minorUnits(currency: string): 1 | 100;
|
|
109
|
-
declare function price(value: number, currency: string): number;
|
|
110
|
-
interface Item {
|
|
106
|
+
export declare function mapSubscriptionStatus(status: Stripe.Subscription.Status): SubscriptionStatus;
|
|
107
|
+
export declare const ZERO_DECIMAL_CURRENCIES: string[];
|
|
108
|
+
export declare function minorUnits(currency: string): 1 | 100;
|
|
109
|
+
export declare function price(value: number, currency: string): number;
|
|
110
|
+
export interface Item {
|
|
111
111
|
item_id: string;
|
|
112
112
|
item_name: string;
|
|
113
113
|
affiliation?: 'Google Store' | (string & {});
|
|
@@ -127,7 +127,7 @@ interface Item {
|
|
|
127
127
|
price?: number;
|
|
128
128
|
quantity?: number;
|
|
129
129
|
}
|
|
130
|
-
interface PurchaseProperties {
|
|
130
|
+
export interface PurchaseProperties {
|
|
131
131
|
currency: string;
|
|
132
132
|
value: number;
|
|
133
133
|
transaction_id: string;
|
|
@@ -136,21 +136,20 @@ interface PurchaseProperties {
|
|
|
136
136
|
tax?: number;
|
|
137
137
|
items?: Item[];
|
|
138
138
|
}
|
|
139
|
-
interface BeginCheckoutProperties {
|
|
139
|
+
export interface BeginCheckoutProperties {
|
|
140
140
|
currency: string;
|
|
141
141
|
value: number;
|
|
142
142
|
coupon?: string;
|
|
143
143
|
items: Item[];
|
|
144
144
|
}
|
|
145
|
-
declare function getPurchaseProperties(session: CheckoutSession): PurchaseProperties;
|
|
146
|
-
declare function getBeginCheckoutProperties(p: ProductPrice): BeginCheckoutProperties;
|
|
145
|
+
export declare function getPurchaseProperties(session: CheckoutSession): PurchaseProperties;
|
|
146
|
+
export declare function getBeginCheckoutProperties(p: ProductPrice): BeginCheckoutProperties;
|
|
147
147
|
/**
|
|
148
148
|
* Stripe's `cancellation_details` in the shared shape. The object is present on every
|
|
149
149
|
* subscription with all three fields null, so an active one maps to null rather than an empty
|
|
150
150
|
* record. `reason` says who acted: `cancellation_requested` is the customer (or us on their
|
|
151
151
|
* behalf), the payment reasons are Stripe ending it.
|
|
152
152
|
*/
|
|
153
|
-
declare function mapCancellationDetails(subscription: Pick<Stripe.Subscription, 'cancellation_details'>): CancellationDetails | null;
|
|
153
|
+
export declare function mapCancellationDetails(subscription: Pick<Stripe.Subscription, 'cancellation_details'>): CancellationDetails | null;
|
|
154
154
|
//#endregion
|
|
155
|
-
export { BeginCheckoutProperties, CheckoutSession, Item, LineItem, PaymentStatus, Price, ProductPrice, PurchaseProperties, ZERO_DECIMAL_CURRENCIES, getBeginCheckoutProperties, getPurchaseProperties, mapCancellationDetails, mapCharge, mapCheckoutSession, mapInvoice, mapLineItem, mapPaymentIntent, mapPrice, mapSubscriptionStatus, mapTime, minorUnits, price };
|
|
156
155
|
//# sourceMappingURL=mapper.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.mts","names":[],"sources":["../../src/stripe/mapper.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mapper.d.mts","names":[],"sources":["../../src/stripe/mapper.ts"],"mappings":";;;wBAQgB,QAAQ,yBACtB,wBAAwB,IACvB;YAKS;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,gBAAgB,OAAO,MAAM;EAC7B,UAAU,OAAO;EACjB;EACA;EACA,WAAW,OAAO,MAAM;;wBAGV,SAAS,OAAO,OAAO,QAAQ;iBAa9B;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO;;wBAGO,YAAY,MAAM,OAAO,WAAW;YAoBxC,gBAAgB,OAAO,SAAS,QAAQ;iBAMnC;EACf;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;EACA,YAAY;;wBAGE,mBAAmB,SAAS,OAAO,SAAS,UAAU;wBA0BtD,WAAW,GAAG,OAAO;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAc,OAAA,QAAA;EACd;EACA;EACA;EACA,QAAM,OAAA,QAAA;EACN;EACA;EACA;;wBAIY,iBAAiB,QAAQ,OAAO;EAE5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,cAAA;EACN;;wBAIY,UAAU,QAAQ,OAAO;EAErC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,OAAA;EACN;EACA;;;;;;;;;;;;YAOQ;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,UAAU,OAAO;EACjB;IACE,IAAI,OAAO;IACX,MAAM,OAAO;IACb,aAAa,OAAO;IACpB,UAAU,OAAO;;;wBAIL,sBAAsB,QAAQ,OAAO,aAAa,SAAS;qBAyB9D;wBAmBG,WAAW;wBAIX,MAAM,eAAe;iBAIpB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;iBAGO;EACf;EACA;EACA;EACA,OAAO;;wBAqCO,sBAAsB,SAAS,kBAAkB;wBA2BjD,2BAA2B,GAAG,eAAe;;;;;;;wBAoB7C,uBACd,cAAc,KAAK,OAAO,wCACzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/stripe/metadata.d.ts
|
|
2
|
-
declare const METADATA_KEYS: {
|
|
2
|
+
export declare const METADATA_KEYS: {
|
|
3
3
|
readonly USER_ID: 'user_id';
|
|
4
4
|
readonly USER_ACCOUNT_TOKEN: 'user_account_token';
|
|
5
5
|
readonly PRODUCT_ID: 'product_id';
|
|
@@ -8,5 +8,4 @@ declare const METADATA_KEYS: {
|
|
|
8
8
|
readonly CREDIT_EXPIRES_IN: 'credit_expires_in';
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
|
-
export { METADATA_KEYS };
|
|
12
11
|
//# sourceMappingURL=metadata.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.cts","names":[],"sources":["../../src/stripe/metadata.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"metadata.d.cts","names":[],"sources":["../../src/stripe/metadata.ts"],"mappings":";qBAAa;WACX;WACA;WACA;WACA;WACA;WACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/stripe/metadata.d.ts
|
|
2
|
-
declare const METADATA_KEYS: {
|
|
2
|
+
export declare const METADATA_KEYS: {
|
|
3
3
|
readonly USER_ID: 'user_id';
|
|
4
4
|
readonly USER_ACCOUNT_TOKEN: 'user_account_token';
|
|
5
5
|
readonly PRODUCT_ID: 'product_id';
|
|
@@ -8,5 +8,4 @@ declare const METADATA_KEYS: {
|
|
|
8
8
|
readonly CREDIT_EXPIRES_IN: 'credit_expires_in';
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
|
-
export { METADATA_KEYS };
|
|
12
11
|
//# sourceMappingURL=metadata.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.mts","names":[],"sources":["../../src/stripe/metadata.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"metadata.d.mts","names":[],"sources":["../../src/stripe/metadata.ts"],"mappings":";qBAAa;WACX;WACA;WACA;WACA;WACA;WACA"}
|