@forklaunch/implementation-billing-stripe 0.2.4 → 0.2.6
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/lib/domain/enum/index.d.mts +119 -112
- package/lib/domain/enum/index.d.ts +119 -112
- package/lib/domain/enum/index.js +124 -119
- package/lib/domain/enum/index.mjs +109 -109
- package/lib/domain/schemas/index.d.mts +2908 -317
- package/lib/domain/schemas/index.d.ts +2908 -317
- package/lib/domain/schemas/index.js +257 -181
- package/lib/domain/schemas/index.mjs +131 -130
- package/lib/domain/types/index.d.mts +231 -72
- package/lib/domain/types/index.d.ts +231 -72
- package/lib/domain/types/index.js +8 -4
- package/lib/services/index.d.mts +709 -194
- package/lib/services/index.d.ts +709 -194
- package/lib/services/index.js +356 -241
- package/lib/services/index.mjs +295 -202
- package/package.json +9 -9
|
@@ -1,121 +1,280 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BillingPortalDto,
|
|
3
|
+
CreateBillingPortalDto,
|
|
4
|
+
UpdateBillingPortalDto,
|
|
5
|
+
CheckoutSessionDto,
|
|
6
|
+
CreateCheckoutSessionDto,
|
|
7
|
+
UpdateCheckoutSessionDto,
|
|
8
|
+
PaymentLinkDto,
|
|
9
|
+
CreatePaymentLinkDto,
|
|
10
|
+
UpdatePaymentLinkDto,
|
|
11
|
+
PlanDto,
|
|
12
|
+
CreatePlanDto,
|
|
13
|
+
UpdatePlanDto,
|
|
14
|
+
SubscriptionDto,
|
|
15
|
+
CreateSubscriptionDto,
|
|
16
|
+
UpdateSubscriptionDto
|
|
17
|
+
} from '@forklaunch/interfaces-billing/types';
|
|
2
18
|
import Stripe__default from 'stripe';
|
|
3
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
PaymentMethodEnum,
|
|
21
|
+
CurrencyEnum,
|
|
22
|
+
PlanCadenceEnum,
|
|
23
|
+
BillingProviderEnum
|
|
24
|
+
} from '../enum/index.mjs';
|
|
4
25
|
|
|
5
26
|
type BillingPortalOmissions = 'customer';
|
|
6
|
-
type StripeCreateBillingPortalDto = Omit<
|
|
7
|
-
|
|
27
|
+
type StripeCreateBillingPortalDto = Omit<
|
|
28
|
+
CreateBillingPortalDto,
|
|
29
|
+
'providerFields'
|
|
30
|
+
> & {
|
|
31
|
+
stripeFields: Omit<
|
|
32
|
+
Stripe__default.BillingPortal.SessionCreateParams,
|
|
33
|
+
BillingPortalOmissions
|
|
34
|
+
>;
|
|
8
35
|
};
|
|
9
|
-
type StripeUpdateBillingPortalDto = Omit<
|
|
10
|
-
|
|
36
|
+
type StripeUpdateBillingPortalDto = Omit<
|
|
37
|
+
UpdateBillingPortalDto,
|
|
38
|
+
'providerFields'
|
|
39
|
+
> & {
|
|
40
|
+
stripeFields?: Omit<
|
|
41
|
+
Stripe__default.BillingPortal.SessionCreateParams,
|
|
42
|
+
BillingPortalOmissions
|
|
43
|
+
>;
|
|
11
44
|
};
|
|
12
45
|
type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
|
|
13
|
-
|
|
46
|
+
stripeFields: Stripe__default.BillingPortal.Session;
|
|
14
47
|
};
|
|
15
48
|
type StripeBillingPortalDtos = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
49
|
+
BillingPortalMapper: StripeBillingPortalDto;
|
|
50
|
+
CreateBillingPortalMapper: StripeCreateBillingPortalDto;
|
|
51
|
+
UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
|
|
19
52
|
};
|
|
20
|
-
type CheckoutSessionOmissions =
|
|
21
|
-
|
|
22
|
-
|
|
53
|
+
type CheckoutSessionOmissions =
|
|
54
|
+
| 'payment_method_types'
|
|
55
|
+
| 'currency'
|
|
56
|
+
| 'success_url'
|
|
57
|
+
| 'cancel_url';
|
|
58
|
+
type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<
|
|
59
|
+
CreateCheckoutSessionDto<
|
|
60
|
+
typeof PaymentMethodEnum,
|
|
61
|
+
typeof CurrencyEnum,
|
|
62
|
+
StatusEnum
|
|
63
|
+
>,
|
|
64
|
+
'providerFields'
|
|
65
|
+
> & {
|
|
66
|
+
stripeFields: Omit<
|
|
67
|
+
Stripe__default.Checkout.SessionCreateParams,
|
|
68
|
+
CheckoutSessionOmissions
|
|
69
|
+
>;
|
|
23
70
|
};
|
|
24
|
-
type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<
|
|
25
|
-
|
|
71
|
+
type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<
|
|
72
|
+
UpdateCheckoutSessionDto<
|
|
73
|
+
typeof PaymentMethodEnum,
|
|
74
|
+
typeof CurrencyEnum,
|
|
75
|
+
StatusEnum
|
|
76
|
+
>,
|
|
77
|
+
'providerFields'
|
|
78
|
+
> & {
|
|
79
|
+
stripeFields?: Omit<
|
|
80
|
+
Stripe__default.Checkout.SessionCreateParams,
|
|
81
|
+
CheckoutSessionOmissions
|
|
82
|
+
>;
|
|
26
83
|
};
|
|
27
|
-
type StripeCheckoutSessionDto<StatusEnum> = Omit<
|
|
28
|
-
|
|
84
|
+
type StripeCheckoutSessionDto<StatusEnum> = Omit<
|
|
85
|
+
CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
|
|
86
|
+
'providerFields'
|
|
87
|
+
> & {
|
|
88
|
+
stripeFields: Stripe__default.Checkout.Session;
|
|
29
89
|
};
|
|
30
90
|
type StripeCheckoutSessionDtos<StatusEnum> = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
91
|
+
CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
|
|
92
|
+
CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
|
|
93
|
+
UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
|
|
34
94
|
};
|
|
35
|
-
type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
|
|
36
|
-
|
|
95
|
+
type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
|
|
96
|
+
CreatePaymentLinkDto<
|
|
97
|
+
typeof PaymentMethodEnum,
|
|
98
|
+
typeof CurrencyEnum,
|
|
99
|
+
StatusEnum
|
|
100
|
+
>,
|
|
101
|
+
'providerFields'
|
|
102
|
+
> & {
|
|
103
|
+
stripeFields: Stripe__default.PaymentLinkCreateParams;
|
|
37
104
|
};
|
|
38
|
-
type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
|
|
39
|
-
|
|
105
|
+
type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
|
|
106
|
+
UpdatePaymentLinkDto<
|
|
107
|
+
typeof PaymentMethodEnum,
|
|
108
|
+
typeof CurrencyEnum,
|
|
109
|
+
StatusEnum
|
|
110
|
+
>,
|
|
111
|
+
'providerFields'
|
|
112
|
+
> & {
|
|
113
|
+
stripeFields?: Stripe__default.PaymentLinkUpdateParams;
|
|
40
114
|
};
|
|
41
|
-
type StripePaymentLinkDto<StatusEnum> = Omit<
|
|
42
|
-
|
|
115
|
+
type StripePaymentLinkDto<StatusEnum> = Omit<
|
|
116
|
+
PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
|
|
117
|
+
'providerFields'
|
|
118
|
+
> & {
|
|
119
|
+
stripeFields: Stripe__default.PaymentLink;
|
|
43
120
|
};
|
|
44
121
|
type StripePaymentLinkDtos<StatusEnum> = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
122
|
+
PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
|
|
123
|
+
CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
|
|
124
|
+
UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
|
|
48
125
|
};
|
|
49
126
|
type PlanOmissions = 'product' | 'interval' | 'currency';
|
|
50
|
-
type StripeCreatePlanDto = Omit<
|
|
51
|
-
|
|
127
|
+
type StripeCreatePlanDto = Omit<
|
|
128
|
+
CreatePlanDto<
|
|
129
|
+
typeof PlanCadenceEnum,
|
|
130
|
+
typeof CurrencyEnum,
|
|
131
|
+
typeof BillingProviderEnum
|
|
132
|
+
>,
|
|
133
|
+
'providerFields'
|
|
134
|
+
> & {
|
|
135
|
+
stripeFields: Omit<Stripe__default.PlanCreateParams, PlanOmissions>;
|
|
52
136
|
};
|
|
53
|
-
type StripeUpdatePlanDto = Omit<
|
|
54
|
-
|
|
137
|
+
type StripeUpdatePlanDto = Omit<
|
|
138
|
+
UpdatePlanDto<
|
|
139
|
+
typeof PlanCadenceEnum,
|
|
140
|
+
typeof CurrencyEnum,
|
|
141
|
+
typeof BillingProviderEnum
|
|
142
|
+
>,
|
|
143
|
+
'providerFields'
|
|
144
|
+
> & {
|
|
145
|
+
stripeFields?: Omit<Stripe__default.PlanUpdateParams, PlanOmissions>;
|
|
55
146
|
};
|
|
56
|
-
type StripePlanDto = Omit<
|
|
57
|
-
|
|
147
|
+
type StripePlanDto = Omit<
|
|
148
|
+
PlanDto<
|
|
149
|
+
typeof PlanCadenceEnum,
|
|
150
|
+
typeof CurrencyEnum,
|
|
151
|
+
typeof BillingProviderEnum
|
|
152
|
+
>,
|
|
153
|
+
'providerFields'
|
|
154
|
+
> & {
|
|
155
|
+
stripeFields: Stripe__default.Plan;
|
|
58
156
|
};
|
|
59
157
|
type StripePlanDtos = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
158
|
+
PlanMapper: StripePlanDto;
|
|
159
|
+
CreatePlanMapper: StripeCreatePlanDto;
|
|
160
|
+
UpdatePlanMapper: StripeUpdatePlanDto;
|
|
63
161
|
};
|
|
64
162
|
type SubscriptionOmissions = 'items' | 'customer';
|
|
65
|
-
type StripeCreateSubscriptionDto<PartyType> = Omit<
|
|
66
|
-
|
|
163
|
+
type StripeCreateSubscriptionDto<PartyType> = Omit<
|
|
164
|
+
CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
|
|
165
|
+
'providerFields'
|
|
166
|
+
> & {
|
|
167
|
+
stripeFields: Omit<
|
|
168
|
+
Stripe__default.SubscriptionCreateParams,
|
|
169
|
+
SubscriptionOmissions
|
|
170
|
+
>;
|
|
67
171
|
};
|
|
68
|
-
type StripeUpdateSubscriptionDto<PartyType> = Omit<
|
|
69
|
-
|
|
172
|
+
type StripeUpdateSubscriptionDto<PartyType> = Omit<
|
|
173
|
+
UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
|
|
174
|
+
'providerFields'
|
|
175
|
+
> & {
|
|
176
|
+
stripeFields?: Omit<
|
|
177
|
+
Stripe__default.SubscriptionUpdateParams,
|
|
178
|
+
SubscriptionOmissions
|
|
179
|
+
>;
|
|
70
180
|
};
|
|
71
|
-
type StripeSubscriptionDto<PartyType> = Omit<
|
|
72
|
-
|
|
181
|
+
type StripeSubscriptionDto<PartyType> = Omit<
|
|
182
|
+
SubscriptionDto<PartyType, typeof BillingProviderEnum>,
|
|
183
|
+
'providerFields'
|
|
184
|
+
> & {
|
|
185
|
+
stripeFields: Stripe__default.Subscription;
|
|
73
186
|
};
|
|
74
187
|
type StripeSubscriptionDtos<PartyType> = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
188
|
+
SubscriptionMapper: StripeSubscriptionDto<PartyType>;
|
|
189
|
+
CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
|
|
190
|
+
UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
|
|
78
191
|
};
|
|
79
192
|
|
|
80
193
|
type StripeBillingPortalEntity = BillingPortalDto & {
|
|
81
|
-
|
|
194
|
+
providerFields: Stripe__default.BillingPortal.Session;
|
|
82
195
|
};
|
|
83
196
|
type StripeBillingPortalEntities = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
197
|
+
BillingPortalMapper: StripeBillingPortalEntity;
|
|
198
|
+
CreateBillingPortalMapper: StripeBillingPortalEntity;
|
|
199
|
+
UpdateBillingPortalMapper: StripeBillingPortalEntity;
|
|
87
200
|
};
|
|
88
|
-
type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
|
|
89
|
-
|
|
201
|
+
type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
|
|
202
|
+
typeof PaymentMethodEnum,
|
|
203
|
+
typeof CurrencyEnum,
|
|
204
|
+
StatusEnum
|
|
205
|
+
> & {
|
|
206
|
+
providerFields: Stripe__default.Checkout.Session;
|
|
90
207
|
};
|
|
91
208
|
type StripeCheckoutSessionEntities<StatusEnum> = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
209
|
+
CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
|
|
210
|
+
CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
|
|
211
|
+
UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
|
|
95
212
|
};
|
|
96
|
-
type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
|
|
97
|
-
|
|
213
|
+
type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
|
|
214
|
+
typeof PaymentMethodEnum,
|
|
215
|
+
typeof CurrencyEnum,
|
|
216
|
+
StatusEnum
|
|
217
|
+
> & {
|
|
218
|
+
providerFields: Stripe__default.PaymentLink;
|
|
98
219
|
};
|
|
99
220
|
type StripePaymentLinkEntities<StatusEnum> = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
221
|
+
PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
|
|
222
|
+
CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
|
|
223
|
+
UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
|
|
103
224
|
};
|
|
104
|
-
type StripePlanEntity = PlanDto<
|
|
105
|
-
|
|
225
|
+
type StripePlanEntity = PlanDto<
|
|
226
|
+
typeof PlanCadenceEnum,
|
|
227
|
+
typeof CurrencyEnum,
|
|
228
|
+
typeof BillingProviderEnum
|
|
229
|
+
> & {
|
|
230
|
+
providerFields: Stripe__default.Plan;
|
|
106
231
|
};
|
|
107
232
|
type StripePlanEntities = {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
233
|
+
PlanMapper: StripePlanEntity;
|
|
234
|
+
CreatePlanMapper: StripePlanEntity;
|
|
235
|
+
UpdatePlanMapper: StripePlanEntity;
|
|
111
236
|
};
|
|
112
|
-
type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
|
|
113
|
-
|
|
237
|
+
type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
|
|
238
|
+
PartyType,
|
|
239
|
+
typeof BillingProviderEnum
|
|
240
|
+
> & {
|
|
241
|
+
providerFields: Stripe__default.Subscription;
|
|
114
242
|
};
|
|
115
243
|
type StripeSubscriptionEntities<PartyType> = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
244
|
+
SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
|
|
245
|
+
CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
|
|
246
|
+
UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
|
|
119
247
|
};
|
|
120
248
|
|
|
121
|
-
export type {
|
|
249
|
+
export type {
|
|
250
|
+
StripeBillingPortalDto,
|
|
251
|
+
StripeBillingPortalDtos,
|
|
252
|
+
StripeBillingPortalEntities,
|
|
253
|
+
StripeBillingPortalEntity,
|
|
254
|
+
StripeCheckoutSessionDto,
|
|
255
|
+
StripeCheckoutSessionDtos,
|
|
256
|
+
StripeCheckoutSessionEntities,
|
|
257
|
+
StripeCheckoutSessionEntity,
|
|
258
|
+
StripeCreateBillingPortalDto,
|
|
259
|
+
StripeCreateCheckoutSessionDto,
|
|
260
|
+
StripeCreatePaymentLinkDto,
|
|
261
|
+
StripeCreatePlanDto,
|
|
262
|
+
StripeCreateSubscriptionDto,
|
|
263
|
+
StripePaymentLinkDto,
|
|
264
|
+
StripePaymentLinkDtos,
|
|
265
|
+
StripePaymentLinkEntities,
|
|
266
|
+
StripePaymentLinkEntity,
|
|
267
|
+
StripePlanDto,
|
|
268
|
+
StripePlanDtos,
|
|
269
|
+
StripePlanEntities,
|
|
270
|
+
StripePlanEntity,
|
|
271
|
+
StripeSubscriptionDto,
|
|
272
|
+
StripeSubscriptionDtos,
|
|
273
|
+
StripeSubscriptionEntities,
|
|
274
|
+
StripeSubscriptionEntity,
|
|
275
|
+
StripeUpdateBillingPortalDto,
|
|
276
|
+
StripeUpdateCheckoutSessionDto,
|
|
277
|
+
StripeUpdatePaymentLinkDto,
|
|
278
|
+
StripeUpdatePlanDto,
|
|
279
|
+
StripeUpdateSubscriptionDto
|
|
280
|
+
};
|