@forklaunch/interfaces-billing 0.1.11 → 0.1.13
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.
- package/lib/interfaces/billingPortal.service.interface.d.ts +6 -14
- package/lib/interfaces/checkoutSession.service.interface.d.ts +7 -15
- package/lib/interfaces/index.d.ts +1 -1
- package/lib/interfaces/paymentLink.service.interface.d.ts +9 -19
- package/lib/interfaces/plan.service.interface.d.ts +7 -26
- package/lib/interfaces/subscription.service.interface.d.ts +11 -45
- package/lib/jest.config.d.ts +1 -1
- package/lib/jest.config.js +16 -16
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/billingPortal.service.types.d.ts +10 -12
- package/lib/types/checkoutSession.service.types.d.ts +12 -15
- package/lib/types/index.d.ts +1 -1
- package/lib/types/paymentLink.service.types.d.ts +14 -17
- package/lib/types/plan.service.types.d.ts +17 -20
- package/lib/types/subscription.service.types.d.ts +19 -22
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +2 -2
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { BillingPortalServiceParameters } from '../types/billingPortal.service.types';
|
|
2
|
-
export interface BillingPortalService<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
) => Promise<Params['BillingPortalDto']>;
|
|
8
|
-
getBillingPortalSession: (
|
|
9
|
-
idDto: Params['IdDto']
|
|
10
|
-
) => Promise<Params['BillingPortalDto']>;
|
|
11
|
-
updateBillingPortalSession: (
|
|
12
|
-
billingPortalDto: Params['UpdateBillingPortalDto']
|
|
13
|
-
) => Promise<Params['BillingPortalDto']>;
|
|
14
|
-
expireBillingPortalSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
2
|
+
export interface BillingPortalService<Params extends BillingPortalServiceParameters = BillingPortalServiceParameters> {
|
|
3
|
+
createBillingPortalSession: (billingPortalDto: Params['CreateBillingPortalDto']) => Promise<Params['BillingPortalDto']>;
|
|
4
|
+
getBillingPortalSession: (idDto: Params['IdDto']) => Promise<Params['BillingPortalDto']>;
|
|
5
|
+
updateBillingPortalSession: (billingPortalDto: Params['UpdateBillingPortalDto']) => Promise<Params['BillingPortalDto']>;
|
|
6
|
+
expireBillingPortalSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
15
7
|
}
|
|
16
|
-
//# sourceMappingURL=billingPortal.service.interface.d.ts.map
|
|
8
|
+
//# sourceMappingURL=billingPortal.service.interface.d.ts.map
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { CheckoutSessionServiceParameters } from '../types/checkoutSession.service.types';
|
|
2
|
-
export interface CheckoutSessionService<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
checkoutSessionDto: Params['CreateCheckoutSessionDto']
|
|
9
|
-
) => Promise<Params['CheckoutSessionDto']>;
|
|
10
|
-
getCheckoutSession: (
|
|
11
|
-
idDto: Params['IdDto']
|
|
12
|
-
) => Promise<Params['CheckoutSessionDto']>;
|
|
13
|
-
expireCheckoutSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
14
|
-
handleCheckoutSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
15
|
-
handleCheckoutFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
2
|
+
export interface CheckoutSessionService<PaymentMethodEnum, Params extends CheckoutSessionServiceParameters<PaymentMethodEnum> = CheckoutSessionServiceParameters<PaymentMethodEnum>> {
|
|
3
|
+
createCheckoutSession: (checkoutSessionDto: Params['CreateCheckoutSessionDto']) => Promise<Params['CheckoutSessionDto']>;
|
|
4
|
+
getCheckoutSession: (idDto: Params['IdDto']) => Promise<Params['CheckoutSessionDto']>;
|
|
5
|
+
expireCheckoutSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
6
|
+
handleCheckoutSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
7
|
+
handleCheckoutFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
16
8
|
}
|
|
17
|
-
//# sourceMappingURL=checkoutSession.service.interface.d.ts.map
|
|
9
|
+
//# sourceMappingURL=checkoutSession.service.interface.d.ts.map
|
|
@@ -3,4 +3,4 @@ export * from './checkoutSession.service.interface';
|
|
|
3
3
|
export * from './paymentLink.service.interface';
|
|
4
4
|
export * from './plan.service.interface';
|
|
5
5
|
export * from './subscription.service.interface';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { PaymentLinkServiceParameters } from '../types/paymentLink.service.types';
|
|
2
|
-
export interface PaymentLinkService<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
updatePaymentLink: (
|
|
11
|
-
paymentLink: Params['UpdatePaymentLinkDto']
|
|
12
|
-
) => Promise<Params['PaymentLinkDto']>;
|
|
13
|
-
getPaymentLink: (idDto: Params['IdDto']) => Promise<Params['PaymentLinkDto']>;
|
|
14
|
-
expirePaymentLink: (idDto: Params['IdDto']) => Promise<void>;
|
|
15
|
-
handlePaymentSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
16
|
-
handlePaymentFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
17
|
-
listPaymentLinks: (
|
|
18
|
-
idsDto?: Params['IdsDto']
|
|
19
|
-
) => Promise<Params['PaymentLinkDto'][]>;
|
|
2
|
+
export interface PaymentLinkService<CurrencyEnum, Params extends PaymentLinkServiceParameters<CurrencyEnum> = PaymentLinkServiceParameters<CurrencyEnum>> {
|
|
3
|
+
createPaymentLink: (paymentLink: Params['CreatePaymentLinkDto']) => Promise<Params['PaymentLinkDto']>;
|
|
4
|
+
updatePaymentLink: (paymentLink: Params['UpdatePaymentLinkDto']) => Promise<Params['PaymentLinkDto']>;
|
|
5
|
+
getPaymentLink: (idDto: Params['IdDto']) => Promise<Params['PaymentLinkDto']>;
|
|
6
|
+
expirePaymentLink: (idDto: Params['IdDto']) => Promise<void>;
|
|
7
|
+
handlePaymentSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
8
|
+
handlePaymentFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
9
|
+
listPaymentLinks: (idsDto?: Params['IdsDto']) => Promise<Params['PaymentLinkDto'][]>;
|
|
20
10
|
}
|
|
21
|
-
//# sourceMappingURL=paymentLink.service.interface.d.ts.map
|
|
11
|
+
//# sourceMappingURL=paymentLink.service.interface.d.ts.map
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
import { EntityManager } from '@mikro-orm/core';
|
|
2
2
|
import { PlanServiceParameters } from '../types/plan.service.types';
|
|
3
|
-
export interface PlanService<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
> = PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum>
|
|
10
|
-
> {
|
|
11
|
-
createPlan: (
|
|
12
|
-
planDto: Params['CreatePlanDto'],
|
|
13
|
-
em?: EntityManager
|
|
14
|
-
) => Promise<Params['PlanDto']>;
|
|
15
|
-
getPlan: (
|
|
16
|
-
idDto: Params['IdDto'],
|
|
17
|
-
em?: EntityManager
|
|
18
|
-
) => Promise<Params['PlanDto']>;
|
|
19
|
-
updatePlan: (
|
|
20
|
-
planDto: Params['UpdatePlanDto'],
|
|
21
|
-
em?: EntityManager
|
|
22
|
-
) => Promise<Params['PlanDto']>;
|
|
23
|
-
deletePlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
24
|
-
listPlans: (
|
|
25
|
-
idsDto?: Params['IdsDto'],
|
|
26
|
-
em?: EntityManager
|
|
27
|
-
) => Promise<Params['PlanDto'][]>;
|
|
3
|
+
export interface PlanService<PlanCadenceEnum, BillingProviderEnum, Params extends PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum> = PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum>> {
|
|
4
|
+
createPlan: (planDto: Params['CreatePlanDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
5
|
+
getPlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
6
|
+
updatePlan: (planDto: Params['UpdatePlanDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
7
|
+
deletePlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
8
|
+
listPlans: (idsDto?: Params['IdsDto'], em?: EntityManager) => Promise<Params['PlanDto'][]>;
|
|
28
9
|
}
|
|
29
|
-
//# sourceMappingURL=plan.service.interface.d.ts.map
|
|
10
|
+
//# sourceMappingURL=plan.service.interface.d.ts.map
|
|
@@ -1,48 +1,14 @@
|
|
|
1
1
|
import { EntityManager } from '@mikro-orm/core';
|
|
2
2
|
import { SubscriptionServiceParameters } from '../types/subscription.service.types';
|
|
3
|
-
export interface SubscriptionService<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
em?: EntityManager
|
|
14
|
-
) => Promise<Params['SubscriptionDto']>;
|
|
15
|
-
getSubscription: (
|
|
16
|
-
idDto: Params['IdDto'],
|
|
17
|
-
em?: EntityManager
|
|
18
|
-
) => Promise<Params['SubscriptionDto']>;
|
|
19
|
-
getUserSubscription: (
|
|
20
|
-
idDto: Params['IdDto'],
|
|
21
|
-
em?: EntityManager
|
|
22
|
-
) => Promise<Params['SubscriptionDto']>;
|
|
23
|
-
getOrganizationSubscription: (
|
|
24
|
-
idDto: Params['IdDto'],
|
|
25
|
-
em?: EntityManager
|
|
26
|
-
) => Promise<Params['SubscriptionDto']>;
|
|
27
|
-
updateSubscription: (
|
|
28
|
-
subscriptionDto: Params['UpdateSubscriptionDto'],
|
|
29
|
-
em?: EntityManager
|
|
30
|
-
) => Promise<Params['SubscriptionDto']>;
|
|
31
|
-
deleteSubscription: (
|
|
32
|
-
id: Params['IdDto'],
|
|
33
|
-
em?: EntityManager
|
|
34
|
-
) => Promise<void>;
|
|
35
|
-
listSubscriptions: (
|
|
36
|
-
idsDto: Params['IdsDto'],
|
|
37
|
-
em?: EntityManager
|
|
38
|
-
) => Promise<Params['SubscriptionDto'][]>;
|
|
39
|
-
cancelSubscription: (
|
|
40
|
-
idDto: Params['IdDto'],
|
|
41
|
-
em?: EntityManager
|
|
42
|
-
) => Promise<void>;
|
|
43
|
-
resumeSubscription: (
|
|
44
|
-
idDto: Params['IdDto'],
|
|
45
|
-
em?: EntityManager
|
|
46
|
-
) => Promise<void>;
|
|
3
|
+
export interface SubscriptionService<PartyType, BillingProviderType, Params extends SubscriptionServiceParameters<PartyType, BillingProviderType> = SubscriptionServiceParameters<PartyType, BillingProviderType>> {
|
|
4
|
+
createSubscription: (subscriptionDto: Params['CreateSubscriptionDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
5
|
+
getSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
6
|
+
getUserSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
7
|
+
getOrganizationSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
8
|
+
updateSubscription: (subscriptionDto: Params['UpdateSubscriptionDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
9
|
+
deleteSubscription: (id: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
10
|
+
listSubscriptions: (idsDto: Params['IdsDto'], em?: EntityManager) => Promise<Params['SubscriptionDto'][]>;
|
|
11
|
+
cancelSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
12
|
+
resumeSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
47
13
|
}
|
|
48
|
-
//# sourceMappingURL=subscription.service.interface.d.ts.map
|
|
14
|
+
//# sourceMappingURL=subscription.service.interface.d.ts.map
|
package/lib/jest.config.d.ts
CHANGED
package/lib/jest.config.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
const jestConfig = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
preset: 'ts-jest/presets/default-esm', // or other ESM presets
|
|
3
|
+
moduleNameMapper: {
|
|
4
|
+
'^(\\.{1,2}/.*)\\.js$': '$1'
|
|
5
|
+
},
|
|
6
|
+
transform: {
|
|
7
|
+
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
|
|
8
|
+
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
|
|
9
|
+
'^.+\\.[tj]sx?$': [
|
|
10
|
+
'ts-jest',
|
|
11
|
+
{
|
|
12
|
+
useESM: true
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
'^.+\\.js$': 'babel-jest'
|
|
16
|
+
},
|
|
17
|
+
testPathIgnorePatterns: ['.*dist/', '.*node_modules/']
|
|
18
18
|
};
|
|
19
19
|
export default jestConfig;
|