@forklaunch/implementation-billing-stripe 0.0.1 → 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 (43) 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 +351 -275
  8. package/lib/{schemas → domain/schemas}/index.mjs +224 -223
  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/enum/billingProvider.enum.ts +3 -0
  13. package/lib/eject/domain/enum/currency.enum.ts +137 -0
  14. package/lib/eject/domain/enum/index.ts +4 -0
  15. package/lib/eject/domain/enum/paymentMethod.enum.ts +39 -0
  16. package/lib/eject/domain/enum/planCadence.enum.ts +5 -0
  17. package/lib/eject/domain/schemas/checkoutSession.schema.ts +2 -2
  18. package/lib/eject/domain/schemas/paymentLink.schema.ts +2 -2
  19. package/lib/eject/domain/schemas/plan.schema.ts +3 -3
  20. package/lib/eject/domain/schemas/subscription.schema.ts +1 -1
  21. package/lib/eject/{types → domain/types}/stripe.dto.types.ts +4 -4
  22. package/lib/eject/{types → domain/types}/stripe.entity.types.ts +4 -4
  23. package/lib/eject/services/billingPortal.service.ts +2 -2
  24. package/lib/eject/services/checkoutSession.service.ts +4 -4
  25. package/lib/eject/services/paymentLink.service.ts +4 -4
  26. package/lib/eject/services/plan.service.ts +5 -5
  27. package/lib/eject/services/subscription.service.ts +3 -3
  28. package/lib/eject/services/webhook.service.ts +5 -5
  29. package/lib/services/index.d.mts +709 -194
  30. package/lib/services/index.d.ts +709 -194
  31. package/lib/services/index.js +359 -244
  32. package/lib/services/index.mjs +298 -205
  33. package/package.json +16 -16
  34. package/lib/domain/index.d.mts +0 -189
  35. package/lib/domain/index.d.ts +0 -189
  36. package/lib/domain/index.js +0 -231
  37. package/lib/domain/index.mjs +0 -201
  38. package/lib/schemas/index.d.mts +0 -376
  39. package/lib/schemas/index.d.ts +0 -376
  40. package/lib/types/index.d.mts +0 -121
  41. package/lib/types/index.d.ts +0 -121
  42. /package/lib/{types → domain/types}/index.mjs +0 -0
  43. /package/lib/eject/{types → domain/types}/index.ts +0 -0
@@ -1,121 +0,0 @@
1
- import { BillingPortalDto, CreateBillingPortalDto, UpdateBillingPortalDto, CheckoutSessionDto, CreateCheckoutSessionDto, UpdateCheckoutSessionDto, PaymentLinkDto, CreatePaymentLinkDto, UpdatePaymentLinkDto, PlanDto, CreatePlanDto, UpdatePlanDto, SubscriptionDto, CreateSubscriptionDto, UpdateSubscriptionDto } from '@forklaunch/interfaces-billing/types';
2
- import Stripe__default from 'stripe';
3
- import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../domain/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 { BillingPortalDto, CreateBillingPortalDto, UpdateBillingPortalDto, CheckoutSessionDto, CreateCheckoutSessionDto, UpdateCheckoutSessionDto, PaymentLinkDto, CreatePaymentLinkDto, UpdatePaymentLinkDto, PlanDto, CreatePlanDto, UpdatePlanDto, SubscriptionDto, CreateSubscriptionDto, UpdateSubscriptionDto } from '@forklaunch/interfaces-billing/types';
2
- import Stripe__default from 'stripe';
3
- import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../domain/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