@forklaunch/interfaces-billing 0.1.9 → 0.1.10
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 +14 -6
- package/lib/interfaces/checkoutSession.service.interface.d.ts +15 -7
- package/lib/interfaces/index.d.ts +1 -1
- package/lib/interfaces/paymentLink.service.interface.d.ts +19 -9
- package/lib/interfaces/plan.service.interface.d.ts +26 -7
- package/lib/interfaces/subscription.service.interface.d.ts +45 -11
- 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 +12 -10
- package/lib/types/checkoutSession.service.types.d.ts +15 -12
- package/lib/types/index.d.ts +1 -1
- package/lib/types/paymentLink.service.types.d.ts +17 -14
- package/lib/types/plan.service.types.d.ts +20 -17
- package/lib/types/subscription.service.types.d.ts +22 -19
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +9 -9
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { BillingPortalServiceParameters } from '../types/billingPortal.service.types';
|
|
2
|
-
export interface BillingPortalService<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export interface BillingPortalService<
|
|
3
|
+
Params extends BillingPortalServiceParameters = BillingPortalServiceParameters
|
|
4
|
+
> {
|
|
5
|
+
createBillingPortalSession: (
|
|
6
|
+
billingPortalDto: Params['CreateBillingPortalDto']
|
|
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>;
|
|
7
15
|
}
|
|
8
|
-
//# sourceMappingURL=billingPortal.service.interface.d.ts.map
|
|
16
|
+
//# sourceMappingURL=billingPortal.service.interface.d.ts.map
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { CheckoutSessionServiceParameters } from '../types/checkoutSession.service.types';
|
|
2
|
-
export interface CheckoutSessionService<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export interface CheckoutSessionService<
|
|
3
|
+
PaymentMethodEnum,
|
|
4
|
+
Params extends
|
|
5
|
+
CheckoutSessionServiceParameters<PaymentMethodEnum> = CheckoutSessionServiceParameters<PaymentMethodEnum>
|
|
6
|
+
> {
|
|
7
|
+
createCheckoutSession: (
|
|
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>;
|
|
8
16
|
}
|
|
9
|
-
//# sourceMappingURL=checkoutSession.service.interface.d.ts.map
|
|
17
|
+
//# 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,11 +1,21 @@
|
|
|
1
1
|
import { PaymentLinkServiceParameters } from '../types/paymentLink.service.types';
|
|
2
|
-
export interface PaymentLinkService<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export interface PaymentLinkService<
|
|
3
|
+
CurrencyEnum,
|
|
4
|
+
Params extends
|
|
5
|
+
PaymentLinkServiceParameters<CurrencyEnum> = PaymentLinkServiceParameters<CurrencyEnum>
|
|
6
|
+
> {
|
|
7
|
+
createPaymentLink: (
|
|
8
|
+
paymentLink: Params['CreatePaymentLinkDto']
|
|
9
|
+
) => Promise<Params['PaymentLinkDto']>;
|
|
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'][]>;
|
|
10
20
|
}
|
|
11
|
-
//# sourceMappingURL=paymentLink.service.interface.d.ts.map
|
|
21
|
+
//# sourceMappingURL=paymentLink.service.interface.d.ts.map
|
|
@@ -1,10 +1,29 @@
|
|
|
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
|
-
|
|
3
|
+
export interface PlanService<
|
|
4
|
+
PlanCadenceEnum,
|
|
5
|
+
BillingProviderEnum,
|
|
6
|
+
Params extends PlanServiceParameters<
|
|
7
|
+
PlanCadenceEnum,
|
|
8
|
+
BillingProviderEnum
|
|
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'][]>;
|
|
9
28
|
}
|
|
10
|
-
//# sourceMappingURL=plan.service.interface.d.ts.map
|
|
29
|
+
//# sourceMappingURL=plan.service.interface.d.ts.map
|
|
@@ -1,14 +1,48 @@
|
|
|
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
|
-
|
|
3
|
+
export interface SubscriptionService<
|
|
4
|
+
PartyType,
|
|
5
|
+
BillingProviderType,
|
|
6
|
+
Params extends SubscriptionServiceParameters<
|
|
7
|
+
PartyType,
|
|
8
|
+
BillingProviderType
|
|
9
|
+
> = SubscriptionServiceParameters<PartyType, BillingProviderType>
|
|
10
|
+
> {
|
|
11
|
+
createSubscription: (
|
|
12
|
+
subscriptionDto: Params['CreateSubscriptionDto'],
|
|
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>;
|
|
13
47
|
}
|
|
14
|
-
//# sourceMappingURL=subscription.service.interface.d.ts.map
|
|
48
|
+
//# 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;
|