@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
@@ -1,121 +0,0 @@
1
- import { CreateBillingPortalDto, UpdateBillingPortalDto, BillingPortalDto, CreateCheckoutSessionDto, UpdateCheckoutSessionDto, CheckoutSessionDto, CreatePaymentLinkDto, UpdatePaymentLinkDto, PaymentLinkDto, CreatePlanDto, UpdatePlanDto, PlanDto, CreateSubscriptionDto, UpdateSubscriptionDto, SubscriptionDto } from '@forklaunch/interfaces-billing/types';
2
- import Stripe__default from 'stripe';
3
- import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../enum/index.mjs';
4
-
5
- type BillingPortalOmissions = 'customer';
6
- type StripeCreateBillingPortalDto = Omit<CreateBillingPortalDto, 'providerFields'> & {
7
- stripeFields: Omit<Stripe__default.BillingPortal.SessionCreateParams, BillingPortalOmissions>;
8
- };
9
- type StripeUpdateBillingPortalDto = Omit<UpdateBillingPortalDto, 'providerFields'> & {
10
- stripeFields?: Omit<Stripe__default.BillingPortal.SessionCreateParams, BillingPortalOmissions>;
11
- };
12
- type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
13
- stripeFields: Stripe__default.BillingPortal.Session;
14
- };
15
- type StripeBillingPortalDtos = {
16
- BillingPortalMapper: StripeBillingPortalDto;
17
- CreateBillingPortalMapper: StripeCreateBillingPortalDto;
18
- UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
19
- };
20
- type CheckoutSessionOmissions = 'payment_method_types' | 'currency' | 'success_url' | 'cancel_url';
21
- type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<CreateCheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
22
- stripeFields: Omit<Stripe__default.Checkout.SessionCreateParams, CheckoutSessionOmissions>;
23
- };
24
- type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<UpdateCheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
25
- stripeFields?: Omit<Stripe__default.Checkout.SessionCreateParams, CheckoutSessionOmissions>;
26
- };
27
- type StripeCheckoutSessionDto<StatusEnum> = Omit<CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
28
- stripeFields: Stripe__default.Checkout.Session;
29
- };
30
- type StripeCheckoutSessionDtos<StatusEnum> = {
31
- CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
32
- CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
33
- UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
34
- };
35
- type StripeCreatePaymentLinkDto<StatusEnum> = Omit<CreatePaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
36
- stripeFields: Stripe__default.PaymentLinkCreateParams;
37
- };
38
- type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<UpdatePaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
39
- stripeFields?: Stripe__default.PaymentLinkUpdateParams;
40
- };
41
- type StripePaymentLinkDto<StatusEnum> = Omit<PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
42
- stripeFields: Stripe__default.PaymentLink;
43
- };
44
- type StripePaymentLinkDtos<StatusEnum> = {
45
- PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
46
- CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
47
- UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
48
- };
49
- type PlanOmissions = 'product' | 'interval' | 'currency';
50
- type StripeCreatePlanDto = Omit<CreatePlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
51
- stripeFields: Omit<Stripe__default.PlanCreateParams, PlanOmissions>;
52
- };
53
- type StripeUpdatePlanDto = Omit<UpdatePlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
54
- stripeFields?: Omit<Stripe__default.PlanUpdateParams, PlanOmissions>;
55
- };
56
- type StripePlanDto = Omit<PlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
57
- stripeFields: Stripe__default.Plan;
58
- };
59
- type StripePlanDtos = {
60
- PlanMapper: StripePlanDto;
61
- CreatePlanMapper: StripeCreatePlanDto;
62
- UpdatePlanMapper: StripeUpdatePlanDto;
63
- };
64
- type SubscriptionOmissions = 'items' | 'customer';
65
- type StripeCreateSubscriptionDto<PartyType> = Omit<CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
66
- stripeFields: Omit<Stripe__default.SubscriptionCreateParams, SubscriptionOmissions>;
67
- };
68
- type StripeUpdateSubscriptionDto<PartyType> = Omit<UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
69
- stripeFields?: Omit<Stripe__default.SubscriptionUpdateParams, SubscriptionOmissions>;
70
- };
71
- type StripeSubscriptionDto<PartyType> = Omit<SubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
72
- stripeFields: Stripe__default.Subscription;
73
- };
74
- type StripeSubscriptionDtos<PartyType> = {
75
- SubscriptionMapper: StripeSubscriptionDto<PartyType>;
76
- CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
77
- UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
78
- };
79
-
80
- type StripeBillingPortalEntity = BillingPortalDto & {
81
- providerFields: Stripe__default.BillingPortal.Session;
82
- };
83
- type StripeBillingPortalEntities = {
84
- BillingPortalMapper: StripeBillingPortalEntity;
85
- CreateBillingPortalMapper: StripeBillingPortalEntity;
86
- UpdateBillingPortalMapper: StripeBillingPortalEntity;
87
- };
88
- type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum> & {
89
- providerFields: Stripe__default.Checkout.Session;
90
- };
91
- type StripeCheckoutSessionEntities<StatusEnum> = {
92
- CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
93
- CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
94
- UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
95
- };
96
- type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum> & {
97
- providerFields: Stripe__default.PaymentLink;
98
- };
99
- type StripePaymentLinkEntities<StatusEnum> = {
100
- PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
101
- CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
102
- UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
103
- };
104
- type StripePlanEntity = PlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum> & {
105
- providerFields: Stripe__default.Plan;
106
- };
107
- type StripePlanEntities = {
108
- PlanMapper: StripePlanEntity;
109
- CreatePlanMapper: StripePlanEntity;
110
- UpdatePlanMapper: StripePlanEntity;
111
- };
112
- type StripeSubscriptionEntity<PartyType> = SubscriptionDto<PartyType, typeof BillingProviderEnum> & {
113
- providerFields: Stripe__default.Subscription;
114
- };
115
- type StripeSubscriptionEntities<PartyType> = {
116
- SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
117
- CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
118
- UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
119
- };
120
-
121
- export type { StripeBillingPortalDto, StripeBillingPortalDtos, StripeBillingPortalEntities, StripeBillingPortalEntity, StripeCheckoutSessionDto, StripeCheckoutSessionDtos, StripeCheckoutSessionEntities, StripeCheckoutSessionEntity, StripeCreateBillingPortalDto, StripeCreateCheckoutSessionDto, StripeCreatePaymentLinkDto, StripeCreatePlanDto, StripeCreateSubscriptionDto, StripePaymentLinkDto, StripePaymentLinkDtos, StripePaymentLinkEntities, StripePaymentLinkEntity, StripePlanDto, StripePlanDtos, StripePlanEntities, StripePlanEntity, StripeSubscriptionDto, StripeSubscriptionDtos, StripeSubscriptionEntities, StripeSubscriptionEntity, StripeUpdateBillingPortalDto, StripeUpdateCheckoutSessionDto, StripeUpdatePaymentLinkDto, StripeUpdatePlanDto, StripeUpdateSubscriptionDto };
@@ -1,121 +0,0 @@
1
- import { CreateBillingPortalDto, UpdateBillingPortalDto, BillingPortalDto, CreateCheckoutSessionDto, UpdateCheckoutSessionDto, CheckoutSessionDto, CreatePaymentLinkDto, UpdatePaymentLinkDto, PaymentLinkDto, CreatePlanDto, UpdatePlanDto, PlanDto, CreateSubscriptionDto, UpdateSubscriptionDto, SubscriptionDto } from '@forklaunch/interfaces-billing/types';
2
- import Stripe__default from 'stripe';
3
- import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../enum/index.js';
4
-
5
- type BillingPortalOmissions = 'customer';
6
- type StripeCreateBillingPortalDto = Omit<CreateBillingPortalDto, 'providerFields'> & {
7
- stripeFields: Omit<Stripe__default.BillingPortal.SessionCreateParams, BillingPortalOmissions>;
8
- };
9
- type StripeUpdateBillingPortalDto = Omit<UpdateBillingPortalDto, 'providerFields'> & {
10
- stripeFields?: Omit<Stripe__default.BillingPortal.SessionCreateParams, BillingPortalOmissions>;
11
- };
12
- type StripeBillingPortalDto = Omit<BillingPortalDto, 'providerFields'> & {
13
- stripeFields: Stripe__default.BillingPortal.Session;
14
- };
15
- type StripeBillingPortalDtos = {
16
- BillingPortalMapper: StripeBillingPortalDto;
17
- CreateBillingPortalMapper: StripeCreateBillingPortalDto;
18
- UpdateBillingPortalMapper: StripeUpdateBillingPortalDto;
19
- };
20
- type CheckoutSessionOmissions = 'payment_method_types' | 'currency' | 'success_url' | 'cancel_url';
21
- type StripeCreateCheckoutSessionDto<StatusEnum> = Omit<CreateCheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
22
- stripeFields: Omit<Stripe__default.Checkout.SessionCreateParams, CheckoutSessionOmissions>;
23
- };
24
- type StripeUpdateCheckoutSessionDto<StatusEnum> = Omit<UpdateCheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
25
- stripeFields?: Omit<Stripe__default.Checkout.SessionCreateParams, CheckoutSessionOmissions>;
26
- };
27
- type StripeCheckoutSessionDto<StatusEnum> = Omit<CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
28
- stripeFields: Stripe__default.Checkout.Session;
29
- };
30
- type StripeCheckoutSessionDtos<StatusEnum> = {
31
- CheckoutSessionMapper: StripeCheckoutSessionDto<StatusEnum>;
32
- CreateCheckoutSessionMapper: StripeCreateCheckoutSessionDto<StatusEnum>;
33
- UpdateCheckoutSessionMapper: StripeUpdateCheckoutSessionDto<StatusEnum>;
34
- };
35
- type StripeCreatePaymentLinkDto<StatusEnum> = Omit<CreatePaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
36
- stripeFields: Stripe__default.PaymentLinkCreateParams;
37
- };
38
- type StripeUpdatePaymentLinkDto<StatusEnum> = Omit<UpdatePaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
39
- stripeFields?: Stripe__default.PaymentLinkUpdateParams;
40
- };
41
- type StripePaymentLinkDto<StatusEnum> = Omit<PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum>, 'providerFields'> & {
42
- stripeFields: Stripe__default.PaymentLink;
43
- };
44
- type StripePaymentLinkDtos<StatusEnum> = {
45
- PaymentLinkMapper: StripePaymentLinkDto<StatusEnum>;
46
- CreatePaymentLinkMapper: StripeCreatePaymentLinkDto<StatusEnum>;
47
- UpdatePaymentLinkMapper: StripeUpdatePaymentLinkDto<StatusEnum>;
48
- };
49
- type PlanOmissions = 'product' | 'interval' | 'currency';
50
- type StripeCreatePlanDto = Omit<CreatePlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
51
- stripeFields: Omit<Stripe__default.PlanCreateParams, PlanOmissions>;
52
- };
53
- type StripeUpdatePlanDto = Omit<UpdatePlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
54
- stripeFields?: Omit<Stripe__default.PlanUpdateParams, PlanOmissions>;
55
- };
56
- type StripePlanDto = Omit<PlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum>, 'providerFields'> & {
57
- stripeFields: Stripe__default.Plan;
58
- };
59
- type StripePlanDtos = {
60
- PlanMapper: StripePlanDto;
61
- CreatePlanMapper: StripeCreatePlanDto;
62
- UpdatePlanMapper: StripeUpdatePlanDto;
63
- };
64
- type SubscriptionOmissions = 'items' | 'customer';
65
- type StripeCreateSubscriptionDto<PartyType> = Omit<CreateSubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
66
- stripeFields: Omit<Stripe__default.SubscriptionCreateParams, SubscriptionOmissions>;
67
- };
68
- type StripeUpdateSubscriptionDto<PartyType> = Omit<UpdateSubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
69
- stripeFields?: Omit<Stripe__default.SubscriptionUpdateParams, SubscriptionOmissions>;
70
- };
71
- type StripeSubscriptionDto<PartyType> = Omit<SubscriptionDto<PartyType, typeof BillingProviderEnum>, 'providerFields'> & {
72
- stripeFields: Stripe__default.Subscription;
73
- };
74
- type StripeSubscriptionDtos<PartyType> = {
75
- SubscriptionMapper: StripeSubscriptionDto<PartyType>;
76
- CreateSubscriptionMapper: StripeCreateSubscriptionDto<PartyType>;
77
- UpdateSubscriptionMapper: StripeUpdateSubscriptionDto<PartyType>;
78
- };
79
-
80
- type StripeBillingPortalEntity = BillingPortalDto & {
81
- providerFields: Stripe__default.BillingPortal.Session;
82
- };
83
- type StripeBillingPortalEntities = {
84
- BillingPortalMapper: StripeBillingPortalEntity;
85
- CreateBillingPortalMapper: StripeBillingPortalEntity;
86
- UpdateBillingPortalMapper: StripeBillingPortalEntity;
87
- };
88
- type StripeCheckoutSessionEntity<StatusEnum> = CheckoutSessionDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum> & {
89
- providerFields: Stripe__default.Checkout.Session;
90
- };
91
- type StripeCheckoutSessionEntities<StatusEnum> = {
92
- CheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
93
- CreateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
94
- UpdateCheckoutSessionMapper: StripeCheckoutSessionEntity<StatusEnum>;
95
- };
96
- type StripePaymentLinkEntity<StatusEnum> = PaymentLinkDto<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum> & {
97
- providerFields: Stripe__default.PaymentLink;
98
- };
99
- type StripePaymentLinkEntities<StatusEnum> = {
100
- PaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
101
- CreatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
102
- UpdatePaymentLinkMapper: StripePaymentLinkEntity<StatusEnum>;
103
- };
104
- type StripePlanEntity = PlanDto<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum> & {
105
- providerFields: Stripe__default.Plan;
106
- };
107
- type StripePlanEntities = {
108
- PlanMapper: StripePlanEntity;
109
- CreatePlanMapper: StripePlanEntity;
110
- UpdatePlanMapper: StripePlanEntity;
111
- };
112
- type StripeSubscriptionEntity<PartyType> = SubscriptionDto<PartyType, typeof BillingProviderEnum> & {
113
- providerFields: Stripe__default.Subscription;
114
- };
115
- type StripeSubscriptionEntities<PartyType> = {
116
- SubscriptionMapper: StripeSubscriptionEntity<PartyType>;
117
- CreateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
118
- UpdateSubscriptionMapper: StripeSubscriptionEntity<PartyType>;
119
- };
120
-
121
- export type { StripeBillingPortalDto, StripeBillingPortalDtos, StripeBillingPortalEntities, StripeBillingPortalEntity, StripeCheckoutSessionDto, StripeCheckoutSessionDtos, StripeCheckoutSessionEntities, StripeCheckoutSessionEntity, StripeCreateBillingPortalDto, StripeCreateCheckoutSessionDto, StripeCreatePaymentLinkDto, StripeCreatePlanDto, StripeCreateSubscriptionDto, StripePaymentLinkDto, StripePaymentLinkDtos, StripePaymentLinkEntities, StripePaymentLinkEntity, StripePlanDto, StripePlanDtos, StripePlanEntities, StripePlanEntity, StripeSubscriptionDto, StripeSubscriptionDtos, StripeSubscriptionEntities, StripeSubscriptionEntity, StripeUpdateBillingPortalDto, StripeUpdateCheckoutSessionDto, StripeUpdatePaymentLinkDto, StripeUpdatePlanDto, StripeUpdateSubscriptionDto };
File without changes
File without changes