@forklaunch/implementation-billing-stripe 0.2.7 → 0.3.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.
@@ -1,3 +1,5 @@
1
+ import { EntityManager } from '@mikro-orm/core';
2
+ import stripe__default from 'stripe';
1
3
  import {
2
4
  BillingPortalDto,
3
5
  CreateBillingPortalDto,
@@ -15,7 +17,6 @@ import {
15
17
  CreateSubscriptionDto,
16
18
  UpdateSubscriptionDto
17
19
  } from '@forklaunch/interfaces-billing/types';
18
- import Stripe__default from 'stripe';
19
20
  import {
20
21
  PaymentMethodEnum,
21
22
  CurrencyEnum,
@@ -29,7 +30,7 @@ type StripeCreateBillingPortalDto = Omit<
29
30
  'providerFields'
30
31
  > & {
31
32
  stripeFields: Omit<
32
- Stripe__default.BillingPortal.SessionCreateParams,
33
+ stripe__default.BillingPortal.SessionCreateParams,
33
34
  BillingPortalOmissions
34
35
  >;
35
36
  };
@@ -38,12 +39,12 @@ type StripeUpdateBillingPortalDto = Omit<
38
39
  'providerFields'
39
40
  > & {
40
41
  stripeFields?: Omit<
41
- Stripe__default.BillingPortal.SessionCreateParams,
42
+ stripe__default.BillingPortal.SessionCreateParams,
42
43
  BillingPortalOmissions
43
44
  >;
44
45
  };
45
46
  type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
46
- stripeFields: Stripe__default.BillingPortal.Session;
47
+ stripeFields: stripe__default.BillingPortal.Session;
47
48
  };
48
49
  type StripeBillingPortalDtos = {
49
50
  BillingPortalMapper: StripeBillingPortalDto;
@@ -64,7 +65,7 @@ type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<
64
65
  'providerFields'
65
66
  > & {
66
67
  stripeFields: Omit<
67
- Stripe__default.Checkout.SessionCreateParams,
68
+ stripe__default.Checkout.SessionCreateParams,
68
69
  CheckoutSessionOmissions
69
70
  >;
70
71
  };
@@ -77,7 +78,7 @@ type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<
77
78
  'providerFields'
78
79
  > & {
79
80
  stripeFields?: Omit<
80
- Stripe__default.Checkout.SessionCreateParams,
81
+ stripe__default.Checkout.SessionCreateParams,
81
82
  CheckoutSessionOmissions
82
83
  >;
83
84
  };
@@ -85,7 +86,7 @@ type StripeCheckoutSessionDto<StatusEnum> = Omit<
85
86
  CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
86
87
  'providerFields'
87
88
  > & {
88
- stripeFields: Stripe__default.Checkout.Session;
89
+ stripeFields: stripe__default.Checkout.Session;
89
90
  };
90
91
  type StripeCheckoutSessionDtos<StatusEnum> = {
91
92
  CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
@@ -100,7 +101,7 @@ type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
100
101
  >,
101
102
  'providerFields'
102
103
  > & {
103
- stripeFields: Stripe__default.PaymentLinkCreateParams;
104
+ stripeFields: stripe__default.PaymentLinkCreateParams;
104
105
  };
105
106
  type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
106
107
  UpdatePaymentLinkDto<
@@ -110,13 +111,13 @@ type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
110
111
  >,
111
112
  'providerFields'
112
113
  > & {
113
- stripeFields?: Stripe__default.PaymentLinkUpdateParams;
114
+ stripeFields?: stripe__default.PaymentLinkUpdateParams;
114
115
  };
115
116
  type StripePaymentLinkDto<StatusEnum> = Omit<
116
117
  PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
117
118
  'providerFields'
118
119
  > & {
119
- stripeFields: Stripe__default.PaymentLink;
120
+ stripeFields: stripe__default.PaymentLink;
120
121
  };
121
122
  type StripePaymentLinkDtos<StatusEnum> = {
122
123
  PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
@@ -132,7 +133,7 @@ type StripeCreatePlanDto = Omit<
132
133
  >,
133
134
  'providerFields'
134
135
  > & {
135
- stripeFields: Omit<Stripe__default.PlanCreateParams, PlanOmissions>;
136
+ stripeFields: Omit<stripe__default.PlanCreateParams, PlanOmissions>;
136
137
  };
137
138
  type StripeUpdatePlanDto = Omit<
138
139
  UpdatePlanDto<
@@ -142,7 +143,7 @@ type StripeUpdatePlanDto = Omit<
142
143
  >,
143
144
  'providerFields'
144
145
  > & {
145
- stripeFields?: Omit<Stripe__default.PlanUpdateParams, PlanOmissions>;
146
+ stripeFields?: Omit<stripe__default.PlanUpdateParams, PlanOmissions>;
146
147
  };
147
148
  type StripePlanDto = Omit<
148
149
  PlanDto<
@@ -152,7 +153,7 @@ type StripePlanDto = Omit<
152
153
  >,
153
154
  'providerFields'
154
155
  > & {
155
- stripeFields: Stripe__default.Plan;
156
+ stripeFields: stripe__default.Plan;
156
157
  };
157
158
  type StripePlanDtos = {
158
159
  PlanMapper: StripePlanDto;
@@ -165,7 +166,7 @@ type StripeCreateSubscriptionDto<PartyType> = Omit<
165
166
  'providerFields'
166
167
  > & {
167
168
  stripeFields: Omit<
168
- Stripe__default.SubscriptionCreateParams,
169
+ stripe__default.SubscriptionCreateParams,
169
170
  SubscriptionOmissions
170
171
  >;
171
172
  };
@@ -174,7 +175,7 @@ type StripeUpdateSubscriptionDto<PartyType> = Omit<
174
175
  'providerFields'
175
176
  > & {
176
177
  stripeFields?: Omit<
177
- Stripe__default.SubscriptionUpdateParams,
178
+ stripe__default.SubscriptionUpdateParams,
178
179
  SubscriptionOmissions
179
180
  >;
180
181
  };
@@ -182,7 +183,7 @@ type StripeSubscriptionDto<PartyType> = Omit<
182
183
  SubscriptionDto<PartyType, typeof BillingProviderEnum>,
183
184
  'providerFields'
184
185
  > & {
185
- stripeFields: Stripe__default.Subscription;
186
+ stripeFields: stripe__default.Subscription;
186
187
  };
187
188
  type StripeSubscriptionDtos<PartyType> = {
188
189
  SubscriptionMapper: StripeSubscriptionDto<PartyType>;
@@ -191,7 +192,7 @@ type StripeSubscriptionDtos<PartyType> = {
191
192
  };
192
193
 
193
194
  type StripeBillingPortalEntity = BillingPortalDto & {
194
- providerFields: Stripe__default.BillingPortal.Session;
195
+ providerFields: stripe__default.BillingPortal.Session;
195
196
  };
196
197
  type StripeBillingPortalEntities = {
197
198
  BillingPortalMapper: StripeBillingPortalEntity;
@@ -203,7 +204,7 @@ type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
203
204
  typeof CurrencyEnum,
204
205
  StatusEnum
205
206
  > & {
206
- providerFields: Stripe__default.Checkout.Session;
207
+ providerFields: stripe__default.Checkout.Session;
207
208
  };
208
209
  type StripeCheckoutSessionEntities<StatusEnum> = {
209
210
  CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
@@ -215,7 +216,7 @@ type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
215
216
  typeof CurrencyEnum,
216
217
  StatusEnum
217
218
  > & {
218
- providerFields: Stripe__default.PaymentLink;
219
+ providerFields: stripe__default.PaymentLink;
219
220
  };
220
221
  type StripePaymentLinkEntities<StatusEnum> = {
221
222
  PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
@@ -227,7 +228,7 @@ type StripePlanEntity = PlanDto<
227
228
  typeof CurrencyEnum,
228
229
  typeof BillingProviderEnum
229
230
  > & {
230
- providerFields: Stripe__default.Plan;
231
+ providerFields: stripe__default.Plan;
231
232
  };
232
233
  type StripePlanEntities = {
233
234
  PlanMapper: StripePlanEntity;
@@ -238,7 +239,7 @@ type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
238
239
  PartyType,
239
240
  typeof BillingProviderEnum
240
241
  > & {
241
- providerFields: Stripe__default.Subscription;
242
+ providerFields: stripe__default.Subscription;
242
243
  };
243
244
  type StripeSubscriptionEntities<PartyType> = {
244
245
  SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
@@ -246,15 +247,153 @@ type StripeSubscriptionEntities<PartyType> = {
246
247
  UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
247
248
  };
248
249
 
250
+ type StripeBillingPortalMappers<
251
+ Entities extends StripeBillingPortalEntities,
252
+ Dto extends StripeBillingPortalDtos
253
+ > = {
254
+ BillingPortalMapper: {
255
+ toDto: (
256
+ entity: Entities['BillingPortalMapper']
257
+ ) => Promise<Dto['BillingPortalMapper']>;
258
+ };
259
+ CreateBillingPortalMapper: {
260
+ toEntity: (
261
+ dto: Dto['CreateBillingPortalMapper'],
262
+ em: EntityManager,
263
+ stripeSession: stripe__default.BillingPortal.Session,
264
+ ...args: unknown[]
265
+ ) => Promise<Entities['CreateBillingPortalMapper']>;
266
+ };
267
+ UpdateBillingPortalMapper: {
268
+ toEntity: (
269
+ dto: Dto['UpdateBillingPortalMapper'],
270
+ em: EntityManager,
271
+ stripeSession: stripe__default.BillingPortal.Session,
272
+ ...args: unknown[]
273
+ ) => Promise<Entities['UpdateBillingPortalMapper']>;
274
+ };
275
+ };
276
+
277
+ type StripeCheckoutSessionMappers<
278
+ StatusEnum,
279
+ Entities extends StripeCheckoutSessionEntities<StatusEnum>,
280
+ Dto extends StripeCheckoutSessionDtos<StatusEnum>
281
+ > = {
282
+ CheckoutSessionMapper: {
283
+ toDto: (
284
+ entity: Entities['CheckoutSessionMapper']
285
+ ) => Promise<Dto['CheckoutSessionMapper']>;
286
+ };
287
+ CreateCheckoutSessionMapper: {
288
+ toEntity: (
289
+ dto: Dto['CreateCheckoutSessionMapper'],
290
+ em: EntityManager,
291
+ stripeSession: stripe__default.Checkout.Session,
292
+ ...args: unknown[]
293
+ ) => Promise<Entities['CreateCheckoutSessionMapper']>;
294
+ };
295
+ UpdateCheckoutSessionMapper: {
296
+ toEntity: (
297
+ dto: Dto['UpdateCheckoutSessionMapper'],
298
+ em: EntityManager,
299
+ stripeSession: stripe__default.Checkout.Session,
300
+ ...args: unknown[]
301
+ ) => Promise<Entities['UpdateCheckoutSessionMapper']>;
302
+ };
303
+ };
304
+
305
+ type StripePaymentLinkMappers<
306
+ StatusEnum,
307
+ Entities extends StripePaymentLinkEntities<StatusEnum>,
308
+ Dto extends StripePaymentLinkDtos<StatusEnum>
309
+ > = {
310
+ PaymentLinkMapper: {
311
+ toDto: (
312
+ entity: Entities['PaymentLinkMapper']
313
+ ) => Promise<Dto['PaymentLinkMapper']>;
314
+ };
315
+ CreatePaymentLinkMapper: {
316
+ toEntity: (
317
+ dto: Dto['CreatePaymentLinkMapper'],
318
+ em: EntityManager,
319
+ stripePaymentLink: stripe__default.PaymentLink,
320
+ ...args: unknown[]
321
+ ) => Promise<Entities['CreatePaymentLinkMapper']>;
322
+ };
323
+ UpdatePaymentLinkMapper: {
324
+ toEntity: (
325
+ dto: Dto['UpdatePaymentLinkMapper'],
326
+ em: EntityManager,
327
+ stripePaymentLink: stripe__default.PaymentLink,
328
+ ...args: unknown[]
329
+ ) => Promise<Entities['UpdatePaymentLinkMapper']>;
330
+ };
331
+ };
332
+
333
+ type StripePlanMappers<
334
+ Entities extends StripePlanEntities,
335
+ Dto extends StripePlanDtos
336
+ > = {
337
+ PlanMapper: {
338
+ toDto: (entity: Entities['PlanMapper']) => Promise<Dto['PlanMapper']>;
339
+ };
340
+ CreatePlanMapper: {
341
+ toEntity: (
342
+ dto: Dto['CreatePlanMapper'],
343
+ em: EntityManager,
344
+ stripePlan: stripe__default.Plan,
345
+ ...args: unknown[]
346
+ ) => Promise<Entities['CreatePlanMapper']>;
347
+ };
348
+ UpdatePlanMapper: {
349
+ toEntity: (
350
+ dto: Dto['UpdatePlanMapper'],
351
+ em: EntityManager,
352
+ stripePlan: stripe__default.Plan,
353
+ ...args: unknown[]
354
+ ) => Promise<Entities['UpdatePlanMapper']>;
355
+ };
356
+ };
357
+
358
+ type StripeSubscriptionMappers<
359
+ PartyType,
360
+ Entities extends StripeSubscriptionEntities<PartyType>,
361
+ Dto extends StripeSubscriptionDtos<PartyType>
362
+ > = {
363
+ SubscriptionMapper: {
364
+ toDto: (
365
+ entity: Entities['SubscriptionMapper']
366
+ ) => Promise<Dto['SubscriptionMapper']>;
367
+ };
368
+ CreateSubscriptionMapper: {
369
+ toEntity: (
370
+ dto: Dto['CreateSubscriptionMapper'],
371
+ em: EntityManager,
372
+ stripeSubscription: stripe__default.Subscription,
373
+ ...args: unknown[]
374
+ ) => Promise<Entities['CreateSubscriptionMapper']>;
375
+ };
376
+ UpdateSubscriptionMapper: {
377
+ toEntity: (
378
+ dto: Dto['UpdateSubscriptionMapper'],
379
+ em: EntityManager,
380
+ stripeSubscription: stripe__default.Subscription,
381
+ ...args: unknown[]
382
+ ) => Promise<Entities['UpdateSubscriptionMapper']>;
383
+ };
384
+ };
385
+
249
386
  export type {
250
387
  StripeBillingPortalDto,
251
388
  StripeBillingPortalDtos,
252
389
  StripeBillingPortalEntities,
253
390
  StripeBillingPortalEntity,
391
+ StripeBillingPortalMappers,
254
392
  StripeCheckoutSessionDto,
255
393
  StripeCheckoutSessionDtos,
256
394
  StripeCheckoutSessionEntities,
257
395
  StripeCheckoutSessionEntity,
396
+ StripeCheckoutSessionMappers,
258
397
  StripeCreateBillingPortalDto,
259
398
  StripeCreateCheckoutSessionDto,
260
399
  StripeCreatePaymentLinkDto,
@@ -264,14 +403,17 @@ export type {
264
403
  StripePaymentLinkDtos,
265
404
  StripePaymentLinkEntities,
266
405
  StripePaymentLinkEntity,
406
+ StripePaymentLinkMappers,
267
407
  StripePlanDto,
268
408
  StripePlanDtos,
269
409
  StripePlanEntities,
270
410
  StripePlanEntity,
411
+ StripePlanMappers,
271
412
  StripeSubscriptionDto,
272
413
  StripeSubscriptionDtos,
273
414
  StripeSubscriptionEntities,
274
415
  StripeSubscriptionEntity,
416
+ StripeSubscriptionMappers,
275
417
  StripeUpdateBillingPortalDto,
276
418
  StripeUpdateCheckoutSessionDto,
277
419
  StripeUpdatePaymentLinkDto,
@@ -1,3 +1,5 @@
1
+ import { EntityManager } from '@mikro-orm/core';
2
+ import stripe__default from 'stripe';
1
3
  import {
2
4
  BillingPortalDto,
3
5
  CreateBillingPortalDto,
@@ -15,7 +17,6 @@ import {
15
17
  CreateSubscriptionDto,
16
18
  UpdateSubscriptionDto
17
19
  } from '@forklaunch/interfaces-billing/types';
18
- import Stripe__default from 'stripe';
19
20
  import {
20
21
  PaymentMethodEnum,
21
22
  CurrencyEnum,
@@ -29,7 +30,7 @@ type StripeCreateBillingPortalDto = Omit<
29
30
  'providerFields'
30
31
  > & {
31
32
  stripeFields: Omit<
32
- Stripe__default.BillingPortal.SessionCreateParams,
33
+ stripe__default.BillingPortal.SessionCreateParams,
33
34
  BillingPortalOmissions
34
35
  >;
35
36
  };
@@ -38,12 +39,12 @@ type StripeUpdateBillingPortalDto = Omit<
38
39
  'providerFields'
39
40
  > & {
40
41
  stripeFields?: Omit<
41
- Stripe__default.BillingPortal.SessionCreateParams,
42
+ stripe__default.BillingPortal.SessionCreateParams,
42
43
  BillingPortalOmissions
43
44
  >;
44
45
  };
45
46
  type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
46
- stripeFields: Stripe__default.BillingPortal.Session;
47
+ stripeFields: stripe__default.BillingPortal.Session;
47
48
  };
48
49
  type StripeBillingPortalDtos = {
49
50
  BillingPortalMapper: StripeBillingPortalDto;
@@ -64,7 +65,7 @@ type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<
64
65
  'providerFields'
65
66
  > & {
66
67
  stripeFields: Omit<
67
- Stripe__default.Checkout.SessionCreateParams,
68
+ stripe__default.Checkout.SessionCreateParams,
68
69
  CheckoutSessionOmissions
69
70
  >;
70
71
  };
@@ -77,7 +78,7 @@ type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<
77
78
  'providerFields'
78
79
  > & {
79
80
  stripeFields?: Omit<
80
- Stripe__default.Checkout.SessionCreateParams,
81
+ stripe__default.Checkout.SessionCreateParams,
81
82
  CheckoutSessionOmissions
82
83
  >;
83
84
  };
@@ -85,7 +86,7 @@ type StripeCheckoutSessionDto<StatusEnum> = Omit<
85
86
  CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
86
87
  'providerFields'
87
88
  > & {
88
- stripeFields: Stripe__default.Checkout.Session;
89
+ stripeFields: stripe__default.Checkout.Session;
89
90
  };
90
91
  type StripeCheckoutSessionDtos<StatusEnum> = {
91
92
  CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
@@ -100,7 +101,7 @@ type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
100
101
  >,
101
102
  'providerFields'
102
103
  > & {
103
- stripeFields: Stripe__default.PaymentLinkCreateParams;
104
+ stripeFields: stripe__default.PaymentLinkCreateParams;
104
105
  };
105
106
  type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
106
107
  UpdatePaymentLinkDto<
@@ -110,13 +111,13 @@ type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
110
111
  >,
111
112
  'providerFields'
112
113
  > & {
113
- stripeFields?: Stripe__default.PaymentLinkUpdateParams;
114
+ stripeFields?: stripe__default.PaymentLinkUpdateParams;
114
115
  };
115
116
  type StripePaymentLinkDto<StatusEnum> = Omit<
116
117
  PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
117
118
  'providerFields'
118
119
  > & {
119
- stripeFields: Stripe__default.PaymentLink;
120
+ stripeFields: stripe__default.PaymentLink;
120
121
  };
121
122
  type StripePaymentLinkDtos<StatusEnum> = {
122
123
  PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
@@ -132,7 +133,7 @@ type StripeCreatePlanDto = Omit<
132
133
  >,
133
134
  'providerFields'
134
135
  > & {
135
- stripeFields: Omit<Stripe__default.PlanCreateParams, PlanOmissions>;
136
+ stripeFields: Omit<stripe__default.PlanCreateParams, PlanOmissions>;
136
137
  };
137
138
  type StripeUpdatePlanDto = Omit<
138
139
  UpdatePlanDto<
@@ -142,7 +143,7 @@ type StripeUpdatePlanDto = Omit<
142
143
  >,
143
144
  'providerFields'
144
145
  > & {
145
- stripeFields?: Omit<Stripe__default.PlanUpdateParams, PlanOmissions>;
146
+ stripeFields?: Omit<stripe__default.PlanUpdateParams, PlanOmissions>;
146
147
  };
147
148
  type StripePlanDto = Omit<
148
149
  PlanDto<
@@ -152,7 +153,7 @@ type StripePlanDto = Omit<
152
153
  >,
153
154
  'providerFields'
154
155
  > & {
155
- stripeFields: Stripe__default.Plan;
156
+ stripeFields: stripe__default.Plan;
156
157
  };
157
158
  type StripePlanDtos = {
158
159
  PlanMapper: StripePlanDto;
@@ -165,7 +166,7 @@ type StripeCreateSubscriptionDto<PartyType> = Omit<
165
166
  'providerFields'
166
167
  > & {
167
168
  stripeFields: Omit<
168
- Stripe__default.SubscriptionCreateParams,
169
+ stripe__default.SubscriptionCreateParams,
169
170
  SubscriptionOmissions
170
171
  >;
171
172
  };
@@ -174,7 +175,7 @@ type StripeUpdateSubscriptionDto<PartyType> = Omit<
174
175
  'providerFields'
175
176
  > & {
176
177
  stripeFields?: Omit<
177
- Stripe__default.SubscriptionUpdateParams,
178
+ stripe__default.SubscriptionUpdateParams,
178
179
  SubscriptionOmissions
179
180
  >;
180
181
  };
@@ -182,7 +183,7 @@ type StripeSubscriptionDto<PartyType> = Omit<
182
183
  SubscriptionDto<PartyType, typeof BillingProviderEnum>,
183
184
  'providerFields'
184
185
  > & {
185
- stripeFields: Stripe__default.Subscription;
186
+ stripeFields: stripe__default.Subscription;
186
187
  };
187
188
  type StripeSubscriptionDtos<PartyType> = {
188
189
  SubscriptionMapper: StripeSubscriptionDto<PartyType>;
@@ -191,7 +192,7 @@ type StripeSubscriptionDtos<PartyType> = {
191
192
  };
192
193
 
193
194
  type StripeBillingPortalEntity = BillingPortalDto & {
194
- providerFields: Stripe__default.BillingPortal.Session;
195
+ providerFields: stripe__default.BillingPortal.Session;
195
196
  };
196
197
  type StripeBillingPortalEntities = {
197
198
  BillingPortalMapper: StripeBillingPortalEntity;
@@ -203,7 +204,7 @@ type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
203
204
  typeof CurrencyEnum,
204
205
  StatusEnum
205
206
  > & {
206
- providerFields: Stripe__default.Checkout.Session;
207
+ providerFields: stripe__default.Checkout.Session;
207
208
  };
208
209
  type StripeCheckoutSessionEntities<StatusEnum> = {
209
210
  CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
@@ -215,7 +216,7 @@ type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
215
216
  typeof CurrencyEnum,
216
217
  StatusEnum
217
218
  > & {
218
- providerFields: Stripe__default.PaymentLink;
219
+ providerFields: stripe__default.PaymentLink;
219
220
  };
220
221
  type StripePaymentLinkEntities<StatusEnum> = {
221
222
  PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
@@ -227,7 +228,7 @@ type StripePlanEntity = PlanDto<
227
228
  typeof CurrencyEnum,
228
229
  typeof BillingProviderEnum
229
230
  > & {
230
- providerFields: Stripe__default.Plan;
231
+ providerFields: stripe__default.Plan;
231
232
  };
232
233
  type StripePlanEntities = {
233
234
  PlanMapper: StripePlanEntity;
@@ -238,7 +239,7 @@ type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
238
239
  PartyType,
239
240
  typeof BillingProviderEnum
240
241
  > & {
241
- providerFields: Stripe__default.Subscription;
242
+ providerFields: stripe__default.Subscription;
242
243
  };
243
244
  type StripeSubscriptionEntities<PartyType> = {
244
245
  SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
@@ -246,15 +247,153 @@ type StripeSubscriptionEntities<PartyType> = {
246
247
  UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
247
248
  };
248
249
 
250
+ type StripeBillingPortalMappers<
251
+ Entities extends StripeBillingPortalEntities,
252
+ Dto extends StripeBillingPortalDtos
253
+ > = {
254
+ BillingPortalMapper: {
255
+ toDto: (
256
+ entity: Entities['BillingPortalMapper']
257
+ ) => Promise<Dto['BillingPortalMapper']>;
258
+ };
259
+ CreateBillingPortalMapper: {
260
+ toEntity: (
261
+ dto: Dto['CreateBillingPortalMapper'],
262
+ em: EntityManager,
263
+ stripeSession: stripe__default.BillingPortal.Session,
264
+ ...args: unknown[]
265
+ ) => Promise<Entities['CreateBillingPortalMapper']>;
266
+ };
267
+ UpdateBillingPortalMapper: {
268
+ toEntity: (
269
+ dto: Dto['UpdateBillingPortalMapper'],
270
+ em: EntityManager,
271
+ stripeSession: stripe__default.BillingPortal.Session,
272
+ ...args: unknown[]
273
+ ) => Promise<Entities['UpdateBillingPortalMapper']>;
274
+ };
275
+ };
276
+
277
+ type StripeCheckoutSessionMappers<
278
+ StatusEnum,
279
+ Entities extends StripeCheckoutSessionEntities<StatusEnum>,
280
+ Dto extends StripeCheckoutSessionDtos<StatusEnum>
281
+ > = {
282
+ CheckoutSessionMapper: {
283
+ toDto: (
284
+ entity: Entities['CheckoutSessionMapper']
285
+ ) => Promise<Dto['CheckoutSessionMapper']>;
286
+ };
287
+ CreateCheckoutSessionMapper: {
288
+ toEntity: (
289
+ dto: Dto['CreateCheckoutSessionMapper'],
290
+ em: EntityManager,
291
+ stripeSession: stripe__default.Checkout.Session,
292
+ ...args: unknown[]
293
+ ) => Promise<Entities['CreateCheckoutSessionMapper']>;
294
+ };
295
+ UpdateCheckoutSessionMapper: {
296
+ toEntity: (
297
+ dto: Dto['UpdateCheckoutSessionMapper'],
298
+ em: EntityManager,
299
+ stripeSession: stripe__default.Checkout.Session,
300
+ ...args: unknown[]
301
+ ) => Promise<Entities['UpdateCheckoutSessionMapper']>;
302
+ };
303
+ };
304
+
305
+ type StripePaymentLinkMappers<
306
+ StatusEnum,
307
+ Entities extends StripePaymentLinkEntities<StatusEnum>,
308
+ Dto extends StripePaymentLinkDtos<StatusEnum>
309
+ > = {
310
+ PaymentLinkMapper: {
311
+ toDto: (
312
+ entity: Entities['PaymentLinkMapper']
313
+ ) => Promise<Dto['PaymentLinkMapper']>;
314
+ };
315
+ CreatePaymentLinkMapper: {
316
+ toEntity: (
317
+ dto: Dto['CreatePaymentLinkMapper'],
318
+ em: EntityManager,
319
+ stripePaymentLink: stripe__default.PaymentLink,
320
+ ...args: unknown[]
321
+ ) => Promise<Entities['CreatePaymentLinkMapper']>;
322
+ };
323
+ UpdatePaymentLinkMapper: {
324
+ toEntity: (
325
+ dto: Dto['UpdatePaymentLinkMapper'],
326
+ em: EntityManager,
327
+ stripePaymentLink: stripe__default.PaymentLink,
328
+ ...args: unknown[]
329
+ ) => Promise<Entities['UpdatePaymentLinkMapper']>;
330
+ };
331
+ };
332
+
333
+ type StripePlanMappers<
334
+ Entities extends StripePlanEntities,
335
+ Dto extends StripePlanDtos
336
+ > = {
337
+ PlanMapper: {
338
+ toDto: (entity: Entities['PlanMapper']) => Promise<Dto['PlanMapper']>;
339
+ };
340
+ CreatePlanMapper: {
341
+ toEntity: (
342
+ dto: Dto['CreatePlanMapper'],
343
+ em: EntityManager,
344
+ stripePlan: stripe__default.Plan,
345
+ ...args: unknown[]
346
+ ) => Promise<Entities['CreatePlanMapper']>;
347
+ };
348
+ UpdatePlanMapper: {
349
+ toEntity: (
350
+ dto: Dto['UpdatePlanMapper'],
351
+ em: EntityManager,
352
+ stripePlan: stripe__default.Plan,
353
+ ...args: unknown[]
354
+ ) => Promise<Entities['UpdatePlanMapper']>;
355
+ };
356
+ };
357
+
358
+ type StripeSubscriptionMappers<
359
+ PartyType,
360
+ Entities extends StripeSubscriptionEntities<PartyType>,
361
+ Dto extends StripeSubscriptionDtos<PartyType>
362
+ > = {
363
+ SubscriptionMapper: {
364
+ toDto: (
365
+ entity: Entities['SubscriptionMapper']
366
+ ) => Promise<Dto['SubscriptionMapper']>;
367
+ };
368
+ CreateSubscriptionMapper: {
369
+ toEntity: (
370
+ dto: Dto['CreateSubscriptionMapper'],
371
+ em: EntityManager,
372
+ stripeSubscription: stripe__default.Subscription,
373
+ ...args: unknown[]
374
+ ) => Promise<Entities['CreateSubscriptionMapper']>;
375
+ };
376
+ UpdateSubscriptionMapper: {
377
+ toEntity: (
378
+ dto: Dto['UpdateSubscriptionMapper'],
379
+ em: EntityManager,
380
+ stripeSubscription: stripe__default.Subscription,
381
+ ...args: unknown[]
382
+ ) => Promise<Entities['UpdateSubscriptionMapper']>;
383
+ };
384
+ };
385
+
249
386
  export type {
250
387
  StripeBillingPortalDto,
251
388
  StripeBillingPortalDtos,
252
389
  StripeBillingPortalEntities,
253
390
  StripeBillingPortalEntity,
391
+ StripeBillingPortalMappers,
254
392
  StripeCheckoutSessionDto,
255
393
  StripeCheckoutSessionDtos,
256
394
  StripeCheckoutSessionEntities,
257
395
  StripeCheckoutSessionEntity,
396
+ StripeCheckoutSessionMappers,
258
397
  StripeCreateBillingPortalDto,
259
398
  StripeCreateCheckoutSessionDto,
260
399
  StripeCreatePaymentLinkDto,
@@ -264,14 +403,17 @@ export type {
264
403
  StripePaymentLinkDtos,
265
404
  StripePaymentLinkEntities,
266
405
  StripePaymentLinkEntity,
406
+ StripePaymentLinkMappers,
267
407
  StripePlanDto,
268
408
  StripePlanDtos,
269
409
  StripePlanEntities,
270
410
  StripePlanEntity,
411
+ StripePlanMappers,
271
412
  StripeSubscriptionDto,
272
413
  StripeSubscriptionDtos,
273
414
  StripeSubscriptionEntities,
274
415
  StripeSubscriptionEntity,
416
+ StripeSubscriptionMappers,
275
417
  StripeUpdateBillingPortalDto,
276
418
  StripeUpdateCheckoutSessionDto,
277
419
  StripeUpdatePaymentLinkDto,