@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
@@ -0,0 +1,137 @@
1
+ export enum CurrencyEnum {
2
+ USD = 'USD',
3
+ AED = 'AED',
4
+ AFN = 'AFN',
5
+ ALL = 'ALL',
6
+ AMD = 'AMD',
7
+ ANG = 'ANG',
8
+ AOA = 'AOA',
9
+ ARS = 'ARS',
10
+ AUD = 'AUD',
11
+ AWG = 'AWG',
12
+ AZN = 'AZN',
13
+ BAM = 'BAM',
14
+ BBD = 'BBD',
15
+ BDT = 'BDT',
16
+ BGN = 'BGN',
17
+ BIF = 'BIF',
18
+ BMD = 'BMD',
19
+ BND = 'BND',
20
+ BOB = 'BOB',
21
+ BRL = 'BRL',
22
+ BSD = 'BSD',
23
+ BWP = 'BWP',
24
+ BYN = 'BYN',
25
+ BZD = 'BZD',
26
+ CAD = 'CAD',
27
+ CDF = 'CDF',
28
+ CHF = 'CHF',
29
+ CLP = 'CLP',
30
+ CNY = 'CNY',
31
+ COP = 'COP',
32
+ CRC = 'CRC',
33
+ CVE = 'CVE',
34
+ CZK = 'CZK',
35
+ DJF = 'DJF',
36
+ DKK = 'DKK',
37
+ DOP = 'DOP',
38
+ DZD = 'DZD',
39
+ EGP = 'EGP',
40
+ ETB = 'ETB',
41
+ EUR = 'EUR',
42
+ FJD = 'FJD',
43
+ FKP = 'FKP',
44
+ GBP = 'GBP',
45
+ GEL = 'GEL',
46
+ GIP = 'GIP',
47
+ GMD = 'GMD',
48
+ GNF = 'GNF',
49
+ GTQ = 'GTQ',
50
+ GYD = 'GYD',
51
+ HKD = 'HKD',
52
+ HNL = 'HNL',
53
+ HTG = 'HTG',
54
+ HUF = 'HUF',
55
+ IDR = 'IDR',
56
+ ILS = 'ILS',
57
+ INR = 'INR',
58
+ ISK = 'ISK',
59
+ JMD = 'JMD',
60
+ JPY = 'JPY',
61
+ KES = 'KES',
62
+ KGS = 'KGS',
63
+ KHR = 'KHR',
64
+ KMF = 'KMF',
65
+ KRW = 'KRW',
66
+ KYD = 'KYD',
67
+ KZT = 'KZT',
68
+ LAK = 'LAK',
69
+ LBP = 'LBP',
70
+ LKR = 'LKR',
71
+ LRD = 'LRD',
72
+ LSL = 'LSL',
73
+ MAD = 'MAD',
74
+ MDL = 'MDL',
75
+ MGA = 'MGA',
76
+ MKD = 'MKD',
77
+ MMK = 'MMK',
78
+ MNT = 'MNT',
79
+ MOP = 'MOP',
80
+ MUR = 'MUR',
81
+ MVR = 'MVR',
82
+ MWK = 'MWK',
83
+ MXN = 'MXN',
84
+ MYR = 'MYR',
85
+ MZN = 'MZN',
86
+ NAD = 'NAD',
87
+ NGN = 'NGN',
88
+ NIO = 'NIO',
89
+ NOK = 'NOK',
90
+ NPR = 'NPR',
91
+ NZD = 'NZD',
92
+ PAB = 'PAB',
93
+ PEN = 'PEN',
94
+ PGK = 'PGK',
95
+ PHP = 'PHP',
96
+ PKR = 'PKR',
97
+ PLN = 'PLN',
98
+ PYG = 'PYG',
99
+ QAR = 'QAR',
100
+ RON = 'RON',
101
+ RSD = 'RSD',
102
+ RUB = 'RUB',
103
+ RWF = 'RWF',
104
+ SAR = 'SAR',
105
+ SBD = 'SBD',
106
+ SCR = 'SCR',
107
+ SEK = 'SEK',
108
+ SGD = 'SGD',
109
+ SHP = 'SHP',
110
+ SLE = 'SLE',
111
+ SOS = 'SOS',
112
+ SRD = 'SRD',
113
+ STD = 'STD',
114
+ SZL = 'SZL',
115
+ THB = 'THB',
116
+ TJS = 'TJS',
117
+ TOP = 'TOP',
118
+ TRY = 'TRY',
119
+ TTD = 'TTD',
120
+ TWD = 'TWD',
121
+ TZS = 'TZS',
122
+ UAH = 'UAH',
123
+ UGX = 'UGX',
124
+ UYU = 'UYU',
125
+ UZS = 'UZS',
126
+ VND = 'VND',
127
+ VUV = 'VUV',
128
+ WST = 'WST',
129
+ XAF = 'XAF',
130
+ XCD = 'XCD',
131
+ XCG = 'XCG',
132
+ XOF = 'XOF',
133
+ XPF = 'XPF',
134
+ YER = 'YER',
135
+ ZAR = 'ZAR',
136
+ ZMW = 'ZMW'
137
+ }
@@ -0,0 +1,4 @@
1
+ export * from './billingProvider.enum';
2
+ export * from './currency.enum';
3
+ export * from './paymentMethod.enum';
4
+ export * from './planCadence.enum';
@@ -0,0 +1,39 @@
1
+ export enum PaymentMethodEnum {
2
+ AFFIRM = 'affirm',
3
+ AFTERPAY_CLEARPAY = 'afterpay_clearpay',
4
+ ALIPAY = 'alipay',
5
+ ALMA = 'alma',
6
+ AU_BECS_DEBIT = 'au_becs_debit',
7
+ BACS_DEBIT = 'bacs_debit',
8
+ BANCONTACT = 'bancontact',
9
+ BILLIE = 'billie',
10
+ BLIK = 'blik',
11
+ BOLETO = 'boleto',
12
+ CARD = 'card',
13
+ CASHAPP = 'cashapp',
14
+ EPS = 'eps',
15
+ FPX = 'fpx',
16
+ GIROPAY = 'giropay',
17
+ GRABPAY = 'grabpay',
18
+ IDEAL = 'ideal',
19
+ KLARNA = 'klarna',
20
+ KONBINI = 'konbini',
21
+ LINK = 'link',
22
+ MOBILEPAY = 'mobilepay',
23
+ MULTIBANCO = 'multibanco',
24
+ OXXO = 'oxxo',
25
+ P24 = 'p24',
26
+ PAY_BY_BANK = 'pay_by_bank',
27
+ PAYNOW = 'paynow',
28
+ PAYPAL = 'paypal',
29
+ PIX = 'pix',
30
+ PROMPTPAY = 'promptpay',
31
+ SATISPAY = 'satispay',
32
+ SEPA_DEBIT = 'sepa_debit',
33
+ SOFORT = 'sofort',
34
+ SWISH = 'swish',
35
+ TWINT = 'twint',
36
+ US_BANK_ACCOUNT = 'us_bank_account',
37
+ WECHAT_PAY = 'wechat_pay',
38
+ ZIP = 'zip'
39
+ }
@@ -0,0 +1,5 @@
1
+ export enum PlanCadenceEnum {
2
+ WEEKLY = 'week',
3
+ MONTHLY = 'month',
4
+ ANNUALLY = 'year'
5
+ }
@@ -8,8 +8,8 @@ import {
8
8
  type,
9
9
  unknown
10
10
  } from '@{{app_name}}/core';
11
- import { CurrencyEnum } from '../../domain/enums/currency.enum';
12
- import { PaymentMethodEnum } from '../../domain/enums/paymentMethod.enum';
11
+ import { CurrencyEnum } from '../../enum/currency.enum';
12
+ import { PaymentMethodEnum } from '../../enum/paymentMethod.enum';
13
13
  import {
14
14
  StripeCheckoutSessionDto,
15
15
  StripeCreateCheckoutSessionDto,
@@ -8,8 +8,8 @@ import {
8
8
  string,
9
9
  type
10
10
  } from '@{{app_name}}/core';
11
- import { CurrencyEnum } from '../../domain/enums/currency.enum';
12
- import { PaymentMethodEnum } from '../../domain/enums/paymentMethod.enum';
11
+ import { CurrencyEnum } from '../../enum/currency.enum';
12
+ import { PaymentMethodEnum } from '../../enum/paymentMethod.enum';
13
13
  import {
14
14
  StripeCreatePaymentLinkDto,
15
15
  StripePaymentLinkDto,
@@ -8,9 +8,9 @@ import {
8
8
  string,
9
9
  type
10
10
  } from '@{{app_name}}/core';
11
- import { BillingProviderEnum } from '../../domain/enums/billingProvider.enum';
12
- import { CurrencyEnum } from '../../domain/enums/currency.enum';
13
- import { PlanCadenceEnum } from '../../domain/enums/planCadence.enum';
11
+ import { BillingProviderEnum } from '../../enum/billingProvider.enum';
12
+ import { CurrencyEnum } from '../../enum/currency.enum';
13
+ import { PlanCadenceEnum } from '../../enum/planCadence.enum';
14
14
  import {
15
15
  StripeCreatePlanDto,
16
16
  StripePlanDto,
@@ -7,7 +7,7 @@ import {
7
7
  string,
8
8
  type
9
9
  } from '@{{app_name}}/core';
10
- import { BillingProviderEnum } from '../../domain/enums/billingProvider.enum';
10
+ import { BillingProviderEnum } from '../../enum/billingProvider.enum';
11
11
  import {
12
12
  StripeCreateSubscriptionDto,
13
13
  StripeSubscriptionDto,
@@ -16,10 +16,10 @@ import {
16
16
  UpdateSubscriptionDto
17
17
  } from '@forklaunch/interfaces-billing/types';
18
18
  import Stripe from 'stripe';
19
- import { BillingProviderEnum } from '../domain/enums/billingProvider.enum';
20
- import { CurrencyEnum } from '../domain/enums/currency.enum';
21
- import { PaymentMethodEnum } from '../domain/enums/paymentMethod.enum';
22
- import { PlanCadenceEnum } from '../domain/enums/planCadence.enum';
19
+ import { BillingProviderEnum } from '../enum/billingProvider.enum';
20
+ import { CurrencyEnum } from '../enum/currency.enum';
21
+ import { PaymentMethodEnum } from '../enum/paymentMethod.enum';
22
+ import { PlanCadenceEnum } from '../enum/planCadence.enum';
23
23
 
24
24
  // Billing Portal Types
25
25
  type BillingPortalOmissions = 'customer';
@@ -6,10 +6,10 @@ import {
6
6
  SubscriptionDto
7
7
  } from '@forklaunch/interfaces-billing/types';
8
8
  import Stripe from 'stripe';
9
- import { BillingProviderEnum } from '../domain/enums/billingProvider.enum';
10
- import { CurrencyEnum } from '../domain/enums/currency.enum';
11
- import { PaymentMethodEnum } from '../domain/enums/paymentMethod.enum';
12
- import { PlanCadenceEnum } from '../domain/enums/planCadence.enum';
9
+ import { BillingProviderEnum } from '../enum/billingProvider.enum';
10
+ import { CurrencyEnum } from '../enum/currency.enum';
11
+ import { PaymentMethodEnum } from '../enum/paymentMethod.enum';
12
+ import { PlanCadenceEnum } from '../enum/planCadence.enum';
13
13
 
14
14
  // Billing Portal Types
15
15
  export type StripeBillingPortalEntity = BillingPortalDto & {
@@ -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 '../domain/enums/currency.enum';
22
- import { PaymentMethodEnum } from '../domain/enums/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 '../domain/enums/currency.enum';
22
- import { PaymentMethodEnum } from '../domain/enums/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 '../domain/enums/billingProvider.enum';
21
- import { CurrencyEnum } from '../domain/enums/currency.enum';
22
- import { PlanCadenceEnum } from '../domain/enums/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 '../domain/enums/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,
@@ -5,17 +5,17 @@ import {
5
5
  import { AnySchemaValidator } from '@forklaunch/validator';
6
6
  import { EntityManager } from '@mikro-orm/core';
7
7
  import Stripe from 'stripe';
8
- import { BillingProviderEnum } from '../domain/enums/billingProvider.enum';
9
- import { CurrencyEnum } from '../domain/enums/currency.enum';
10
- import { PaymentMethodEnum } from '../domain/enums/paymentMethod.enum';
11
- import { PlanCadenceEnum } from '../domain/enums/planCadence.enum';
8
+ import { BillingProviderEnum } from '../domain/enum/billingProvider.enum';
9
+ import { CurrencyEnum } from '../domain/enum/currency.enum';
10
+ import { PaymentMethodEnum } from '../domain/enum/paymentMethod.enum';
11
+ import { PlanCadenceEnum } from '../domain/enum/planCadence.enum';
12
12
  import {
13
13
  StripeBillingPortalEntities,
14
14
  StripeCheckoutSessionEntities,
15
15
  StripePaymentLinkEntities,
16
16
  StripePlanEntities,
17
17
  StripeSubscriptionEntities
18
- } from '../types/stripe.entity.types';
18
+ } from '../domain/types/stripe.entity.types';
19
19
  import { StripeBillingPortalService } from './billingPortal.service';
20
20
  import { StripeCheckoutSessionService } from './checkoutSession.service';
21
21
  import { StripePaymentLinkService } from './paymentLink.service';