@forklaunch/implementation-billing-stripe 0.0.2 → 0.0.3

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.
Files changed (35) hide show
  1. package/lib/domain/enum/index.d.mts +194 -0
  2. package/lib/domain/enum/index.d.ts +194 -0
  3. package/lib/domain/enum/index.js +236 -0
  4. package/lib/domain/enum/index.mjs +201 -0
  5. package/lib/domain/schemas/index.d.mts +4142 -0
  6. package/lib/domain/schemas/index.d.ts +4142 -0
  7. package/lib/{schemas → domain/schemas}/index.js +349 -269
  8. package/lib/{schemas → domain/schemas}/index.mjs +222 -217
  9. package/lib/domain/types/index.d.mts +280 -0
  10. package/lib/domain/types/index.d.ts +280 -0
  11. package/lib/{types → domain/types}/index.js +9 -5
  12. package/lib/eject/domain/schemas/checkoutSession.schema.ts +3 -2
  13. package/lib/eject/services/billingPortal.service.ts +2 -2
  14. package/lib/eject/services/checkoutSession.service.ts +4 -4
  15. package/lib/eject/services/paymentLink.service.ts +4 -4
  16. package/lib/eject/services/plan.service.ts +5 -5
  17. package/lib/eject/services/subscription.service.ts +3 -3
  18. package/lib/eject/services/webhook.service.ts +5 -5
  19. package/lib/services/index.d.mts +709 -194
  20. package/lib/services/index.d.ts +709 -194
  21. package/lib/services/index.js +359 -244
  22. package/lib/services/index.mjs +298 -205
  23. package/package.json +15 -15
  24. package/lib/enum/index.d.mts +0 -189
  25. package/lib/enum/index.d.ts +0 -189
  26. package/lib/enum/index.js +0 -231
  27. package/lib/enum/index.mjs +0 -201
  28. package/lib/schemas/index.d.mts +0 -376
  29. package/lib/schemas/index.d.ts +0 -376
  30. package/lib/types/index.d.mts +0 -121
  31. package/lib/types/index.d.ts +0 -121
  32. /package/lib/{types → domain/types}/index.mjs +0 -0
  33. /package/lib/eject/{types → domain/types}/index.ts +0 -0
  34. /package/lib/eject/{types → domain/types}/stripe.dto.types.ts +0 -0
  35. /package/lib/eject/{types → domain/types}/stripe.entity.types.ts +0 -0
@@ -0,0 +1,280 @@
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';
18
+ import Stripe__default from 'stripe';
19
+ import {
20
+ PaymentMethodEnum,
21
+ CurrencyEnum,
22
+ PlanCadenceEnum,
23
+ BillingProviderEnum
24
+ } from '../enum/index.mjs';
25
+
26
+ type BillingPortalOmissions = 'customer';
27
+ type StripeCreateBillingPortalDto = Omit<
28
+ CreateBillingPortalDto,
29
+ 'providerFields'
30
+ > & {
31
+ stripeFields: Omit<
32
+ Stripe__default.BillingPortal.SessionCreateParams,
33
+ BillingPortalOmissions
34
+ >;
35
+ };
36
+ type StripeUpdateBillingPortalDto = Omit<
37
+ UpdateBillingPortalDto,
38
+ 'providerFields'
39
+ > & {
40
+ stripeFields?: Omit<
41
+ Stripe__default.BillingPortal.SessionCreateParams,
42
+ BillingPortalOmissions
43
+ >;
44
+ };
45
+ type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
46
+ stripeFields: Stripe__default.BillingPortal.Session;
47
+ };
48
+ type StripeBillingPortalDtos = {
49
+ BillingPortalMapper: StripeBillingPortalDto;
50
+ CreateBillingPortalMapper: StripeCreateBillingPortalDto;
51
+ UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
52
+ };
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
+ >;
70
+ };
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
+ >;
83
+ };
84
+ type StripeCheckoutSessionDto<StatusEnum> = Omit<
85
+ CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
86
+ 'providerFields'
87
+ > & {
88
+ stripeFields: Stripe__default.Checkout.Session;
89
+ };
90
+ type StripeCheckoutSessionDtos<StatusEnum> = {
91
+ CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
92
+ CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
93
+ UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
94
+ };
95
+ type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
96
+ CreatePaymentLinkDto<
97
+ typeof PaymentMethodEnum,
98
+ typeof CurrencyEnum,
99
+ StatusEnum
100
+ >,
101
+ 'providerFields'
102
+ > & {
103
+ stripeFields: Stripe__default.PaymentLinkCreateParams;
104
+ };
105
+ type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
106
+ UpdatePaymentLinkDto<
107
+ typeof PaymentMethodEnum,
108
+ typeof CurrencyEnum,
109
+ StatusEnum
110
+ >,
111
+ 'providerFields'
112
+ > & {
113
+ stripeFields?: Stripe__default.PaymentLinkUpdateParams;
114
+ };
115
+ type StripePaymentLinkDto<StatusEnum> = Omit<
116
+ PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
117
+ 'providerFields'
118
+ > & {
119
+ stripeFields: Stripe__default.PaymentLink;
120
+ };
121
+ type StripePaymentLinkDtos<StatusEnum> = {
122
+ PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
123
+ CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
124
+ UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
125
+ };
126
+ type PlanOmissions = 'product' | 'interval' | 'currency';
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>;
136
+ };
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>;
146
+ };
147
+ type StripePlanDto = Omit<
148
+ PlanDto<
149
+ typeof PlanCadenceEnum,
150
+ typeof CurrencyEnum,
151
+ typeof BillingProviderEnum
152
+ >,
153
+ 'providerFields'
154
+ > & {
155
+ stripeFields: Stripe__default.Plan;
156
+ };
157
+ type StripePlanDtos = {
158
+ PlanMapper: StripePlanDto;
159
+ CreatePlanMapper: StripeCreatePlanDto;
160
+ UpdatePlanMapper: StripeUpdatePlanDto;
161
+ };
162
+ type SubscriptionOmissions = 'items' | 'customer';
163
+ type StripeCreateSubscriptionDto<PartyType> = Omit<
164
+ CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
165
+ 'providerFields'
166
+ > & {
167
+ stripeFields: Omit<
168
+ Stripe__default.SubscriptionCreateParams,
169
+ SubscriptionOmissions
170
+ >;
171
+ };
172
+ type StripeUpdateSubscriptionDto<PartyType> = Omit<
173
+ UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
174
+ 'providerFields'
175
+ > & {
176
+ stripeFields?: Omit<
177
+ Stripe__default.SubscriptionUpdateParams,
178
+ SubscriptionOmissions
179
+ >;
180
+ };
181
+ type StripeSubscriptionDto<PartyType> = Omit<
182
+ SubscriptionDto<PartyType, typeof BillingProviderEnum>,
183
+ 'providerFields'
184
+ > & {
185
+ stripeFields: Stripe__default.Subscription;
186
+ };
187
+ type StripeSubscriptionDtos<PartyType> = {
188
+ SubscriptionMapper: StripeSubscriptionDto<PartyType>;
189
+ CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
190
+ UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
191
+ };
192
+
193
+ type StripeBillingPortalEntity = BillingPortalDto & {
194
+ providerFields: Stripe__default.BillingPortal.Session;
195
+ };
196
+ type StripeBillingPortalEntities = {
197
+ BillingPortalMapper: StripeBillingPortalEntity;
198
+ CreateBillingPortalMapper: StripeBillingPortalEntity;
199
+ UpdateBillingPortalMapper: StripeBillingPortalEntity;
200
+ };
201
+ type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
202
+ typeof PaymentMethodEnum,
203
+ typeof CurrencyEnum,
204
+ StatusEnum
205
+ > & {
206
+ providerFields: Stripe__default.Checkout.Session;
207
+ };
208
+ type StripeCheckoutSessionEntities<StatusEnum> = {
209
+ CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
210
+ CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
211
+ UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
212
+ };
213
+ type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
214
+ typeof PaymentMethodEnum,
215
+ typeof CurrencyEnum,
216
+ StatusEnum
217
+ > & {
218
+ providerFields: Stripe__default.PaymentLink;
219
+ };
220
+ type StripePaymentLinkEntities<StatusEnum> = {
221
+ PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
222
+ CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
223
+ UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
224
+ };
225
+ type StripePlanEntity = PlanDto<
226
+ typeof PlanCadenceEnum,
227
+ typeof CurrencyEnum,
228
+ typeof BillingProviderEnum
229
+ > & {
230
+ providerFields: Stripe__default.Plan;
231
+ };
232
+ type StripePlanEntities = {
233
+ PlanMapper: StripePlanEntity;
234
+ CreatePlanMapper: StripePlanEntity;
235
+ UpdatePlanMapper: StripePlanEntity;
236
+ };
237
+ type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
238
+ PartyType,
239
+ typeof BillingProviderEnum
240
+ > & {
241
+ providerFields: Stripe__default.Subscription;
242
+ };
243
+ type StripeSubscriptionEntities<PartyType> = {
244
+ SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
245
+ CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
246
+ UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
247
+ };
248
+
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
+ };
@@ -0,0 +1,280 @@
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';
18
+ import Stripe__default from 'stripe';
19
+ import {
20
+ PaymentMethodEnum,
21
+ CurrencyEnum,
22
+ PlanCadenceEnum,
23
+ BillingProviderEnum
24
+ } from '../enum/index.js';
25
+
26
+ type BillingPortalOmissions = 'customer';
27
+ type StripeCreateBillingPortalDto = Omit<
28
+ CreateBillingPortalDto,
29
+ 'providerFields'
30
+ > & {
31
+ stripeFields: Omit<
32
+ Stripe__default.BillingPortal.SessionCreateParams,
33
+ BillingPortalOmissions
34
+ >;
35
+ };
36
+ type StripeUpdateBillingPortalDto = Omit<
37
+ UpdateBillingPortalDto,
38
+ 'providerFields'
39
+ > & {
40
+ stripeFields?: Omit<
41
+ Stripe__default.BillingPortal.SessionCreateParams,
42
+ BillingPortalOmissions
43
+ >;
44
+ };
45
+ type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
46
+ stripeFields: Stripe__default.BillingPortal.Session;
47
+ };
48
+ type StripeBillingPortalDtos = {
49
+ BillingPortalMapper: StripeBillingPortalDto;
50
+ CreateBillingPortalMapper: StripeCreateBillingPortalDto;
51
+ UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
52
+ };
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
+ >;
70
+ };
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
+ >;
83
+ };
84
+ type StripeCheckoutSessionDto<StatusEnum> = Omit<
85
+ CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
86
+ 'providerFields'
87
+ > & {
88
+ stripeFields: Stripe__default.Checkout.Session;
89
+ };
90
+ type StripeCheckoutSessionDtos<StatusEnum> = {
91
+ CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
92
+ CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
93
+ UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
94
+ };
95
+ type StripeCreatePaymentLinkDto<StatusEnum> = Omit<
96
+ CreatePaymentLinkDto<
97
+ typeof PaymentMethodEnum,
98
+ typeof CurrencyEnum,
99
+ StatusEnum
100
+ >,
101
+ 'providerFields'
102
+ > & {
103
+ stripeFields: Stripe__default.PaymentLinkCreateParams;
104
+ };
105
+ type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<
106
+ UpdatePaymentLinkDto<
107
+ typeof PaymentMethodEnum,
108
+ typeof CurrencyEnum,
109
+ StatusEnum
110
+ >,
111
+ 'providerFields'
112
+ > & {
113
+ stripeFields?: Stripe__default.PaymentLinkUpdateParams;
114
+ };
115
+ type StripePaymentLinkDto<StatusEnum> = Omit<
116
+ PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>,
117
+ 'providerFields'
118
+ > & {
119
+ stripeFields: Stripe__default.PaymentLink;
120
+ };
121
+ type StripePaymentLinkDtos<StatusEnum> = {
122
+ PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
123
+ CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
124
+ UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
125
+ };
126
+ type PlanOmissions = 'product' | 'interval' | 'currency';
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>;
136
+ };
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>;
146
+ };
147
+ type StripePlanDto = Omit<
148
+ PlanDto<
149
+ typeof PlanCadenceEnum,
150
+ typeof CurrencyEnum,
151
+ typeof BillingProviderEnum
152
+ >,
153
+ 'providerFields'
154
+ > & {
155
+ stripeFields: Stripe__default.Plan;
156
+ };
157
+ type StripePlanDtos = {
158
+ PlanMapper: StripePlanDto;
159
+ CreatePlanMapper: StripeCreatePlanDto;
160
+ UpdatePlanMapper: StripeUpdatePlanDto;
161
+ };
162
+ type SubscriptionOmissions = 'items' | 'customer';
163
+ type StripeCreateSubscriptionDto<PartyType> = Omit<
164
+ CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
165
+ 'providerFields'
166
+ > & {
167
+ stripeFields: Omit<
168
+ Stripe__default.SubscriptionCreateParams,
169
+ SubscriptionOmissions
170
+ >;
171
+ };
172
+ type StripeUpdateSubscriptionDto<PartyType> = Omit<
173
+ UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>,
174
+ 'providerFields'
175
+ > & {
176
+ stripeFields?: Omit<
177
+ Stripe__default.SubscriptionUpdateParams,
178
+ SubscriptionOmissions
179
+ >;
180
+ };
181
+ type StripeSubscriptionDto<PartyType> = Omit<
182
+ SubscriptionDto<PartyType, typeof BillingProviderEnum>,
183
+ 'providerFields'
184
+ > & {
185
+ stripeFields: Stripe__default.Subscription;
186
+ };
187
+ type StripeSubscriptionDtos<PartyType> = {
188
+ SubscriptionMapper: StripeSubscriptionDto<PartyType>;
189
+ CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
190
+ UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
191
+ };
192
+
193
+ type StripeBillingPortalEntity = BillingPortalDto & {
194
+ providerFields: Stripe__default.BillingPortal.Session;
195
+ };
196
+ type StripeBillingPortalEntities = {
197
+ BillingPortalMapper: StripeBillingPortalEntity;
198
+ CreateBillingPortalMapper: StripeBillingPortalEntity;
199
+ UpdateBillingPortalMapper: StripeBillingPortalEntity;
200
+ };
201
+ type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<
202
+ typeof PaymentMethodEnum,
203
+ typeof CurrencyEnum,
204
+ StatusEnum
205
+ > & {
206
+ providerFields: Stripe__default.Checkout.Session;
207
+ };
208
+ type StripeCheckoutSessionEntities<StatusEnum> = {
209
+ CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
210
+ CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
211
+ UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
212
+ };
213
+ type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<
214
+ typeof PaymentMethodEnum,
215
+ typeof CurrencyEnum,
216
+ StatusEnum
217
+ > & {
218
+ providerFields: Stripe__default.PaymentLink;
219
+ };
220
+ type StripePaymentLinkEntities<StatusEnum> = {
221
+ PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
222
+ CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
223
+ UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
224
+ };
225
+ type StripePlanEntity = PlanDto<
226
+ typeof PlanCadenceEnum,
227
+ typeof CurrencyEnum,
228
+ typeof BillingProviderEnum
229
+ > & {
230
+ providerFields: Stripe__default.Plan;
231
+ };
232
+ type StripePlanEntities = {
233
+ PlanMapper: StripePlanEntity;
234
+ CreatePlanMapper: StripePlanEntity;
235
+ UpdatePlanMapper: StripePlanEntity;
236
+ };
237
+ type StripeSubscriptionEntity<PartyType> = SubscriptionDto<
238
+ PartyType,
239
+ typeof BillingProviderEnum
240
+ > & {
241
+ providerFields: Stripe__default.Subscription;
242
+ };
243
+ type StripeSubscriptionEntities<PartyType> = {
244
+ SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
245
+ CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
246
+ UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
247
+ };
248
+
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
+ };
@@ -1,18 +1,22 @@
1
- "use strict";
1
+ 'use strict';
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
7
+ if ((from && typeof from === 'object') || typeof from === 'function') {
8
8
  for (let key of __getOwnPropNames(from))
9
9
  if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
11
14
  }
12
15
  return to;
13
16
  };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
17
+ var __toCommonJS = (mod) =>
18
+ __copyProps(__defProp({}, '__esModule', { value: true }), mod);
15
19
 
16
- // types/index.ts
20
+ // domain/types/index.ts
17
21
  var types_exports = {};
18
22
  module.exports = __toCommonJS(types_exports);
@@ -45,8 +45,9 @@ export const UpdateCheckoutSessionSchema = <
45
45
  cancelRedirectUri: optional(string),
46
46
  expiresAt: optional(date),
47
47
  status: optional(enum_(StatusEnum)),
48
- stripeFields:
49
- optional(type<StripeUpdateCheckoutSessionDto<T>['stripeFields']>())
48
+ stripeFields: optional(
49
+ type<StripeUpdateCheckoutSessionDto<T>['stripeFields']>()
50
+ )
50
51
  });
51
52
 
52
53
  export const CheckoutSessionSchema = <T extends Record<string, LiteralSchema>>(
@@ -23,8 +23,8 @@ import {
23
23
  StripeBillingPortalDtos,
24
24
  StripeCreateBillingPortalDto,
25
25
  StripeUpdateBillingPortalDto
26
- } from '../types/stripe.dto.types';
27
- import { StripeBillingPortalEntities } from '../types/stripe.entity.types';
26
+ } from '../domain/types/stripe.dto.types';
27
+ import { StripeBillingPortalEntities } from '../domain/types/stripe.entity.types';
28
28
 
29
29
  export class StripeBillingPortalService<
30
30
  SchemaValidator extends AnySchemaValidator,
@@ -18,10 +18,10 @@ import {
18
18
  import { AnySchemaValidator } from '@forklaunch/validator';
19
19
  import { EntityManager } from '@mikro-orm/core';
20
20
  import Stripe from 'stripe';
21
- import { CurrencyEnum } from '../enum/currency.enum';
22
- import { PaymentMethodEnum } from '../enum/paymentMethod.enum';
23
- import { StripeCheckoutSessionDtos } from '../types/stripe.dto.types';
24
- import { StripeCheckoutSessionEntities } from '../types/stripe.entity.types';
21
+ import { CurrencyEnum } from '../domain/enum/currency.enum';
22
+ import { PaymentMethodEnum } from '../domain/enum/paymentMethod.enum';
23
+ import { StripeCheckoutSessionDtos } from '../domain/types/stripe.dto.types';
24
+ import { StripeCheckoutSessionEntities } from '../domain/types/stripe.entity.types';
25
25
 
26
26
  export class StripeCheckoutSessionService<
27
27
  SchemaValidator extends AnySchemaValidator,
@@ -18,15 +18,15 @@ import {
18
18
  import { AnySchemaValidator } from '@forklaunch/validator';
19
19
  import { EntityManager } from '@mikro-orm/core';
20
20
  import Stripe from 'stripe';
21
- import { CurrencyEnum } from '../enum/currency.enum';
22
- import { PaymentMethodEnum } from '../enum/paymentMethod.enum';
21
+ import { CurrencyEnum } from '../domain/enum/currency.enum';
22
+ import { PaymentMethodEnum } from '../domain/enum/paymentMethod.enum';
23
23
  import {
24
24
  StripeCreatePaymentLinkDto,
25
25
  StripePaymentLinkDto,
26
26
  StripePaymentLinkDtos,
27
27
  StripeUpdatePaymentLinkDto
28
- } from '../types/stripe.dto.types';
29
- import { StripePaymentLinkEntities } from '../types/stripe.entity.types';
28
+ } from '../domain/types/stripe.dto.types';
29
+ import { StripePaymentLinkEntities } from '../domain/types/stripe.entity.types';
30
30
 
31
31
  export class StripePaymentLinkService<
32
32
  SchemaValidator extends AnySchemaValidator,
@@ -17,16 +17,16 @@ import {
17
17
  import { AnySchemaValidator } from '@forklaunch/validator';
18
18
  import { EntityManager } from '@mikro-orm/core';
19
19
  import Stripe from 'stripe';
20
- import { BillingProviderEnum } from '../enum/billingProvider.enum';
21
- import { CurrencyEnum } from '../enum/currency.enum';
22
- import { PlanCadenceEnum } from '../enum/planCadence.enum';
20
+ import { BillingProviderEnum } from '../domain/enum/billingProvider.enum';
21
+ import { CurrencyEnum } from '../domain/enum/currency.enum';
22
+ import { PlanCadenceEnum } from '../domain/enum/planCadence.enum';
23
23
  import {
24
24
  StripeCreatePlanDto,
25
25
  StripePlanDto,
26
26
  StripePlanDtos,
27
27
  StripeUpdatePlanDto
28
- } from '../types/stripe.dto.types';
29
- import { StripePlanEntities } from '../types/stripe.entity.types';
28
+ } from '../domain/types/stripe.dto.types';
29
+ import { StripePlanEntities } from '../domain/types/stripe.entity.types';
30
30
 
31
31
  export class StripePlanService<
32
32
  SchemaValidator extends AnySchemaValidator,
@@ -17,14 +17,14 @@ import {
17
17
  import { AnySchemaValidator } from '@forklaunch/validator';
18
18
  import { EntityManager } from '@mikro-orm/core';
19
19
  import Stripe from 'stripe';
20
- import { BillingProviderEnum } from '../enum/billingProvider.enum';
20
+ import { BillingProviderEnum } from '../domain/enum/billingProvider.enum';
21
21
  import {
22
22
  StripeCreateSubscriptionDto,
23
23
  StripeSubscriptionDto,
24
24
  StripeSubscriptionDtos,
25
25
  StripeUpdateSubscriptionDto
26
- } from '../types/stripe.dto.types';
27
- import { StripeSubscriptionEntities } from '../types/stripe.entity.types';
26
+ } from '../domain/types/stripe.dto.types';
27
+ import { StripeSubscriptionEntities } from '../domain/types/stripe.entity.types';
28
28
 
29
29
  export class StripeSubscriptionService<
30
30
  SchemaValidator extends AnySchemaValidator,