@forklaunch/interfaces-billing 0.2.2 → 0.3.0
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/index.d.mts +50 -0
- package/lib/interfaces/index.d.ts +50 -6
- package/lib/interfaces/index.js +18 -5
- package/lib/interfaces/index.mjs +0 -0
- package/lib/types/index.d.mts +100 -0
- package/lib/types/index.d.ts +100 -6
- package/lib/types/index.js +18 -5
- package/lib/types/index.mjs +0 -0
- package/package.json +11 -7
- package/lib/interfaces/billingPortal.service.interface.d.ts +0 -16
- package/lib/interfaces/billingPortal.service.interface.d.ts.map +0 -1
- package/lib/interfaces/billingPortal.service.interface.js +0 -1
- package/lib/interfaces/checkoutSession.service.interface.d.ts +0 -20
- package/lib/interfaces/checkoutSession.service.interface.d.ts.map +0 -1
- package/lib/interfaces/checkoutSession.service.interface.js +0 -1
- package/lib/interfaces/index.d.ts.map +0 -1
- package/lib/interfaces/paymentLink.service.interface.d.ts +0 -24
- package/lib/interfaces/paymentLink.service.interface.d.ts.map +0 -1
- package/lib/interfaces/paymentLink.service.interface.js +0 -1
- package/lib/interfaces/plan.service.interface.d.ts +0 -29
- package/lib/interfaces/plan.service.interface.d.ts.map +0 -1
- package/lib/interfaces/plan.service.interface.js +0 -1
- package/lib/interfaces/subscription.service.interface.d.ts +0 -48
- package/lib/interfaces/subscription.service.interface.d.ts.map +0 -1
- package/lib/interfaces/subscription.service.interface.js +0 -1
- package/lib/jest.config.d.ts +0 -4
- package/lib/jest.config.d.ts.map +0 -1
- package/lib/jest.config.js +0 -19
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/billingPortal.service.types.d.ts +0 -18
- package/lib/types/billingPortal.service.types.d.ts.map +0 -1
- package/lib/types/billingPortal.service.types.js +0 -1
- package/lib/types/checkoutSession.service.types.d.ts +0 -25
- package/lib/types/checkoutSession.service.types.d.ts.map +0 -1
- package/lib/types/checkoutSession.service.types.js +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/paymentLink.service.types.d.ts +0 -24
- package/lib/types/paymentLink.service.types.d.ts.map +0 -1
- package/lib/types/paymentLink.service.types.js +0 -1
- package/lib/types/plan.service.types.d.ts +0 -25
- package/lib/types/plan.service.types.d.ts.map +0 -1
- package/lib/types/plan.service.types.js +0 -1
- package/lib/types/subscription.service.types.d.ts +0 -27
- package/lib/types/subscription.service.types.d.ts.map +0 -1
- package/lib/types/subscription.service.types.js +0 -1
- package/lib/vitest.config.d.ts +0 -3
- package/lib/vitest.config.d.ts.map +0 -1
- package/lib/vitest.config.js +0 -7
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BillingPortalServiceParameters, CheckoutSessionServiceParameters, PaymentLinkServiceParameters, PlanServiceParameters, SubscriptionServiceParameters } from '../types/index.mjs';
|
|
2
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
3
|
+
import '@forklaunch/common';
|
|
4
|
+
|
|
5
|
+
interface BillingPortalService<Params extends BillingPortalServiceParameters = BillingPortalServiceParameters> {
|
|
6
|
+
createBillingPortalSession: (billingPortalDto: Params['CreateBillingPortalDto']) => Promise<Params['BillingPortalDto']>;
|
|
7
|
+
getBillingPortalSession: (idDto: Params['IdDto']) => Promise<Params['BillingPortalDto']>;
|
|
8
|
+
updateBillingPortalSession: (billingPortalDto: Params['UpdateBillingPortalDto']) => Promise<Params['BillingPortalDto']>;
|
|
9
|
+
expireBillingPortalSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface CheckoutSessionService<PaymentMethodEnum, StatusEnum, Params extends CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum> = CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum>> {
|
|
13
|
+
createCheckoutSession: (checkoutSessionDto: Params['CreateCheckoutSessionDto']) => Promise<Params['CheckoutSessionDto']>;
|
|
14
|
+
getCheckoutSession: (idDto: Params['IdDto']) => Promise<Params['CheckoutSessionDto']>;
|
|
15
|
+
expireCheckoutSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
16
|
+
handleCheckoutSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
17
|
+
handleCheckoutFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface PaymentLinkService<CurrencyEnum, StatusEnum, Params extends PaymentLinkServiceParameters<CurrencyEnum, StatusEnum> = PaymentLinkServiceParameters<CurrencyEnum, StatusEnum>> {
|
|
21
|
+
createPaymentLink: (paymentLink: Params['CreatePaymentLinkDto']) => Promise<Params['PaymentLinkDto']>;
|
|
22
|
+
updatePaymentLink: (paymentLink: Params['UpdatePaymentLinkDto']) => Promise<Params['PaymentLinkDto']>;
|
|
23
|
+
getPaymentLink: (idDto: Params['IdDto']) => Promise<Params['PaymentLinkDto']>;
|
|
24
|
+
expirePaymentLink: (idDto: Params['IdDto']) => Promise<void>;
|
|
25
|
+
handlePaymentSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
26
|
+
handlePaymentFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
27
|
+
listPaymentLinks: (idsDto?: Params['IdsDto']) => Promise<Params['PaymentLinkDto'][]>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface PlanService<PlanCadenceEnum, BillingProviderEnum, Params extends PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum> = PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum>> {
|
|
31
|
+
createPlan: (planDto: Params['CreatePlanDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
32
|
+
getPlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
33
|
+
updatePlan: (planDto: Params['UpdatePlanDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
34
|
+
deletePlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
35
|
+
listPlans: (idsDto?: Params['IdsDto'], em?: EntityManager) => Promise<Params['PlanDto'][]>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface SubscriptionService<PartyType, BillingProviderType, Params extends SubscriptionServiceParameters<PartyType, BillingProviderType> = SubscriptionServiceParameters<PartyType, BillingProviderType>> {
|
|
39
|
+
createSubscription: (subscriptionDto: Params['CreateSubscriptionDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
40
|
+
getSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
41
|
+
getUserSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
42
|
+
getOrganizationSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
43
|
+
updateSubscription: (subscriptionDto: Params['UpdateSubscriptionDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
44
|
+
deleteSubscription: (id: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
45
|
+
listSubscriptions: (idsDto: Params['IdsDto'], em?: EntityManager) => Promise<Params['SubscriptionDto'][]>;
|
|
46
|
+
cancelSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
47
|
+
resumeSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type { BillingPortalService, CheckoutSessionService, PaymentLinkService, PlanService, SubscriptionService };
|
|
@@ -1,6 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BillingPortalServiceParameters, CheckoutSessionServiceParameters, PaymentLinkServiceParameters, PlanServiceParameters, SubscriptionServiceParameters } from '../types/index.js';
|
|
2
|
+
import { EntityManager } from '@mikro-orm/core';
|
|
3
|
+
import '@forklaunch/common';
|
|
4
|
+
|
|
5
|
+
interface BillingPortalService<Params extends BillingPortalServiceParameters = BillingPortalServiceParameters> {
|
|
6
|
+
createBillingPortalSession: (billingPortalDto: Params['CreateBillingPortalDto']) => Promise<Params['BillingPortalDto']>;
|
|
7
|
+
getBillingPortalSession: (idDto: Params['IdDto']) => Promise<Params['BillingPortalDto']>;
|
|
8
|
+
updateBillingPortalSession: (billingPortalDto: Params['UpdateBillingPortalDto']) => Promise<Params['BillingPortalDto']>;
|
|
9
|
+
expireBillingPortalSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface CheckoutSessionService<PaymentMethodEnum, StatusEnum, Params extends CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum> = CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum>> {
|
|
13
|
+
createCheckoutSession: (checkoutSessionDto: Params['CreateCheckoutSessionDto']) => Promise<Params['CheckoutSessionDto']>;
|
|
14
|
+
getCheckoutSession: (idDto: Params['IdDto']) => Promise<Params['CheckoutSessionDto']>;
|
|
15
|
+
expireCheckoutSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
16
|
+
handleCheckoutSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
17
|
+
handleCheckoutFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface PaymentLinkService<CurrencyEnum, StatusEnum, Params extends PaymentLinkServiceParameters<CurrencyEnum, StatusEnum> = PaymentLinkServiceParameters<CurrencyEnum, StatusEnum>> {
|
|
21
|
+
createPaymentLink: (paymentLink: Params['CreatePaymentLinkDto']) => Promise<Params['PaymentLinkDto']>;
|
|
22
|
+
updatePaymentLink: (paymentLink: Params['UpdatePaymentLinkDto']) => Promise<Params['PaymentLinkDto']>;
|
|
23
|
+
getPaymentLink: (idDto: Params['IdDto']) => Promise<Params['PaymentLinkDto']>;
|
|
24
|
+
expirePaymentLink: (idDto: Params['IdDto']) => Promise<void>;
|
|
25
|
+
handlePaymentSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
26
|
+
handlePaymentFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
27
|
+
listPaymentLinks: (idsDto?: Params['IdsDto']) => Promise<Params['PaymentLinkDto'][]>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface PlanService<PlanCadenceEnum, BillingProviderEnum, Params extends PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum> = PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum>> {
|
|
31
|
+
createPlan: (planDto: Params['CreatePlanDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
32
|
+
getPlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
33
|
+
updatePlan: (planDto: Params['UpdatePlanDto'], em?: EntityManager) => Promise<Params['PlanDto']>;
|
|
34
|
+
deletePlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
35
|
+
listPlans: (idsDto?: Params['IdsDto'], em?: EntityManager) => Promise<Params['PlanDto'][]>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface SubscriptionService<PartyType, BillingProviderType, Params extends SubscriptionServiceParameters<PartyType, BillingProviderType> = SubscriptionServiceParameters<PartyType, BillingProviderType>> {
|
|
39
|
+
createSubscription: (subscriptionDto: Params['CreateSubscriptionDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
40
|
+
getSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
41
|
+
getUserSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
42
|
+
getOrganizationSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
43
|
+
updateSubscription: (subscriptionDto: Params['UpdateSubscriptionDto'], em?: EntityManager) => Promise<Params['SubscriptionDto']>;
|
|
44
|
+
deleteSubscription: (id: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
45
|
+
listSubscriptions: (idsDto: Params['IdsDto'], em?: EntityManager) => Promise<Params['SubscriptionDto'][]>;
|
|
46
|
+
cancelSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
47
|
+
resumeSubscription: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type { BillingPortalService, CheckoutSessionService, PaymentLinkService, PlanService, SubscriptionService };
|
package/lib/interfaces/index.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// interfaces/index.ts
|
|
17
|
+
var interfaces_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(interfaces_exports);
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { IdDto, RecordTimingDto, IdsDto } from '@forklaunch/common';
|
|
2
|
+
|
|
3
|
+
type CreateBillingPortalDto = {
|
|
4
|
+
customerId: string;
|
|
5
|
+
uri: string;
|
|
6
|
+
expiresAt: Date;
|
|
7
|
+
extraFields?: unknown;
|
|
8
|
+
};
|
|
9
|
+
type UpdateBillingPortalDto = IdDto & Partial<CreateBillingPortalDto>;
|
|
10
|
+
type BillingPortalDto = IdDto & CreateBillingPortalDto & Partial<RecordTimingDto>;
|
|
11
|
+
type BillingPortalServiceParameters = {
|
|
12
|
+
CreateBillingPortalDto: CreateBillingPortalDto;
|
|
13
|
+
UpdateBillingPortalDto: UpdateBillingPortalDto;
|
|
14
|
+
BillingPortalDto: BillingPortalDto;
|
|
15
|
+
IdDto: IdDto;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum> = {
|
|
19
|
+
customerId: string;
|
|
20
|
+
paymentMethods: PaymentMethodEnum[keyof PaymentMethodEnum][];
|
|
21
|
+
metadata?: unknown;
|
|
22
|
+
successRedirectUri: string;
|
|
23
|
+
cancelRedirectUri: string;
|
|
24
|
+
expiresAt: Date;
|
|
25
|
+
status: StatusEnum[keyof StatusEnum];
|
|
26
|
+
extraFields?: unknown;
|
|
27
|
+
};
|
|
28
|
+
type UpdateCheckoutSessionDto<PaymentMethodEnum, StatusEnum> = IdDto & Partial<CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum>>;
|
|
29
|
+
type CheckoutSessionDto<PaymentMethodEnum, StatusEnum> = IdDto & CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum> & Partial<RecordTimingDto>;
|
|
30
|
+
type CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum> = {
|
|
31
|
+
CreateCheckoutSessionDto: CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum>;
|
|
32
|
+
CheckoutSessionDto: CheckoutSessionDto<PaymentMethodEnum, StatusEnum>;
|
|
33
|
+
IdDto: IdDto;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type CreatePaymentLinkDto<CurrencyEnum, StatusEnum> = {
|
|
37
|
+
amount: number;
|
|
38
|
+
currency: CurrencyEnum[keyof CurrencyEnum];
|
|
39
|
+
metadata?: unknown;
|
|
40
|
+
successRedirectUri: string;
|
|
41
|
+
cancelRedirectUri: string;
|
|
42
|
+
expiresAt: Date;
|
|
43
|
+
status: StatusEnum[keyof StatusEnum];
|
|
44
|
+
extraFields?: unknown;
|
|
45
|
+
};
|
|
46
|
+
type UpdatePaymentLinkDto<CurrencyEnum, StatusEnum> = IdDto & Partial<CreatePaymentLinkDto<CurrencyEnum, StatusEnum>>;
|
|
47
|
+
type PaymentLinkDto<CurrencyEnum, StatusEnum> = IdDto & CreatePaymentLinkDto<CurrencyEnum, StatusEnum> & Partial<RecordTimingDto>;
|
|
48
|
+
type PaymentLinkServiceParameters<CurrencyEnum, StatusEnum> = {
|
|
49
|
+
CreatePaymentLinkDto: CreatePaymentLinkDto<CurrencyEnum, StatusEnum>;
|
|
50
|
+
UpdatePaymentLinkDto: UpdatePaymentLinkDto<CurrencyEnum, StatusEnum>;
|
|
51
|
+
PaymentLinkDto: PaymentLinkDto<CurrencyEnum, StatusEnum>;
|
|
52
|
+
IdDto: IdDto;
|
|
53
|
+
IdsDto: IdsDto;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type CreatePlanDto<PlanCadenceEnum, BillingProviderEnum> = {
|
|
57
|
+
active: boolean;
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
price: number;
|
|
61
|
+
cadence: PlanCadenceEnum[keyof PlanCadenceEnum];
|
|
62
|
+
features?: string[];
|
|
63
|
+
extraFields?: unknown;
|
|
64
|
+
externalId: string;
|
|
65
|
+
billingProvider?: BillingProviderEnum[keyof BillingProviderEnum];
|
|
66
|
+
};
|
|
67
|
+
type UpdatePlanDto<PlanCadenceEnum, BillingProviderEnum> = IdDto & Partial<CreatePlanDto<PlanCadenceEnum, BillingProviderEnum>>;
|
|
68
|
+
type PlanDto<PlanCadenceEnum, BillingProviderEnum> = IdDto & CreatePlanDto<PlanCadenceEnum, BillingProviderEnum> & Partial<RecordTimingDto>;
|
|
69
|
+
type PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum> = {
|
|
70
|
+
CreatePlanDto: CreatePlanDto<PlanCadenceEnum, BillingProviderEnum>;
|
|
71
|
+
UpdatePlanDto: UpdatePlanDto<PlanCadenceEnum, BillingProviderEnum>;
|
|
72
|
+
PlanDto: PlanDto<PlanCadenceEnum, BillingProviderEnum>;
|
|
73
|
+
IdDto: IdDto;
|
|
74
|
+
IdsDto: IdsDto;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
type CreateSubscriptionDto<PartyType, BillingProviderType> = {
|
|
78
|
+
partyId: string;
|
|
79
|
+
partyType: PartyType[keyof PartyType];
|
|
80
|
+
description?: string;
|
|
81
|
+
active: boolean;
|
|
82
|
+
productId: string;
|
|
83
|
+
extraFields?: unknown;
|
|
84
|
+
externalId: string;
|
|
85
|
+
billingProvider?: BillingProviderType[keyof BillingProviderType];
|
|
86
|
+
startDate: Date;
|
|
87
|
+
endDate: Date;
|
|
88
|
+
status: string;
|
|
89
|
+
};
|
|
90
|
+
type UpdateSubscriptionDto<PartyType, BillingProviderType> = IdDto & Partial<CreateSubscriptionDto<PartyType, BillingProviderType>>;
|
|
91
|
+
type SubscriptionDto<PartyType, BillingProviderType> = IdDto & CreateSubscriptionDto<PartyType, BillingProviderType> & Partial<RecordTimingDto>;
|
|
92
|
+
type SubscriptionServiceParameters<PartyType, BillingProviderType> = {
|
|
93
|
+
CreateSubscriptionDto: CreateSubscriptionDto<PartyType, BillingProviderType>;
|
|
94
|
+
UpdateSubscriptionDto: UpdateSubscriptionDto<PartyType, BillingProviderType>;
|
|
95
|
+
SubscriptionDto: SubscriptionDto<PartyType, BillingProviderType>;
|
|
96
|
+
IdDto: IdDto;
|
|
97
|
+
IdsDto: IdsDto;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type { BillingPortalDto, BillingPortalServiceParameters, CheckoutSessionDto, CheckoutSessionServiceParameters, CreateBillingPortalDto, CreateCheckoutSessionDto, CreatePaymentLinkDto, CreatePlanDto, CreateSubscriptionDto, PaymentLinkDto, PaymentLinkServiceParameters, PlanDto, PlanServiceParameters, SubscriptionDto, SubscriptionServiceParameters, UpdateBillingPortalDto, UpdateCheckoutSessionDto, UpdatePaymentLinkDto, UpdatePlanDto, UpdateSubscriptionDto };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { IdDto, RecordTimingDto, IdsDto } from '@forklaunch/common';
|
|
2
|
+
|
|
3
|
+
type CreateBillingPortalDto = {
|
|
4
|
+
customerId: string;
|
|
5
|
+
uri: string;
|
|
6
|
+
expiresAt: Date;
|
|
7
|
+
extraFields?: unknown;
|
|
8
|
+
};
|
|
9
|
+
type UpdateBillingPortalDto = IdDto & Partial<CreateBillingPortalDto>;
|
|
10
|
+
type BillingPortalDto = IdDto & CreateBillingPortalDto & Partial<RecordTimingDto>;
|
|
11
|
+
type BillingPortalServiceParameters = {
|
|
12
|
+
CreateBillingPortalDto: CreateBillingPortalDto;
|
|
13
|
+
UpdateBillingPortalDto: UpdateBillingPortalDto;
|
|
14
|
+
BillingPortalDto: BillingPortalDto;
|
|
15
|
+
IdDto: IdDto;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum> = {
|
|
19
|
+
customerId: string;
|
|
20
|
+
paymentMethods: PaymentMethodEnum[keyof PaymentMethodEnum][];
|
|
21
|
+
metadata?: unknown;
|
|
22
|
+
successRedirectUri: string;
|
|
23
|
+
cancelRedirectUri: string;
|
|
24
|
+
expiresAt: Date;
|
|
25
|
+
status: StatusEnum[keyof StatusEnum];
|
|
26
|
+
extraFields?: unknown;
|
|
27
|
+
};
|
|
28
|
+
type UpdateCheckoutSessionDto<PaymentMethodEnum, StatusEnum> = IdDto & Partial<CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum>>;
|
|
29
|
+
type CheckoutSessionDto<PaymentMethodEnum, StatusEnum> = IdDto & CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum> & Partial<RecordTimingDto>;
|
|
30
|
+
type CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum> = {
|
|
31
|
+
CreateCheckoutSessionDto: CreateCheckoutSessionDto<PaymentMethodEnum, StatusEnum>;
|
|
32
|
+
CheckoutSessionDto: CheckoutSessionDto<PaymentMethodEnum, StatusEnum>;
|
|
33
|
+
IdDto: IdDto;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type CreatePaymentLinkDto<CurrencyEnum, StatusEnum> = {
|
|
37
|
+
amount: number;
|
|
38
|
+
currency: CurrencyEnum[keyof CurrencyEnum];
|
|
39
|
+
metadata?: unknown;
|
|
40
|
+
successRedirectUri: string;
|
|
41
|
+
cancelRedirectUri: string;
|
|
42
|
+
expiresAt: Date;
|
|
43
|
+
status: StatusEnum[keyof StatusEnum];
|
|
44
|
+
extraFields?: unknown;
|
|
45
|
+
};
|
|
46
|
+
type UpdatePaymentLinkDto<CurrencyEnum, StatusEnum> = IdDto & Partial<CreatePaymentLinkDto<CurrencyEnum, StatusEnum>>;
|
|
47
|
+
type PaymentLinkDto<CurrencyEnum, StatusEnum> = IdDto & CreatePaymentLinkDto<CurrencyEnum, StatusEnum> & Partial<RecordTimingDto>;
|
|
48
|
+
type PaymentLinkServiceParameters<CurrencyEnum, StatusEnum> = {
|
|
49
|
+
CreatePaymentLinkDto: CreatePaymentLinkDto<CurrencyEnum, StatusEnum>;
|
|
50
|
+
UpdatePaymentLinkDto: UpdatePaymentLinkDto<CurrencyEnum, StatusEnum>;
|
|
51
|
+
PaymentLinkDto: PaymentLinkDto<CurrencyEnum, StatusEnum>;
|
|
52
|
+
IdDto: IdDto;
|
|
53
|
+
IdsDto: IdsDto;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type CreatePlanDto<PlanCadenceEnum, BillingProviderEnum> = {
|
|
57
|
+
active: boolean;
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
price: number;
|
|
61
|
+
cadence: PlanCadenceEnum[keyof PlanCadenceEnum];
|
|
62
|
+
features?: string[];
|
|
63
|
+
extraFields?: unknown;
|
|
64
|
+
externalId: string;
|
|
65
|
+
billingProvider?: BillingProviderEnum[keyof BillingProviderEnum];
|
|
66
|
+
};
|
|
67
|
+
type UpdatePlanDto<PlanCadenceEnum, BillingProviderEnum> = IdDto & Partial<CreatePlanDto<PlanCadenceEnum, BillingProviderEnum>>;
|
|
68
|
+
type PlanDto<PlanCadenceEnum, BillingProviderEnum> = IdDto & CreatePlanDto<PlanCadenceEnum, BillingProviderEnum> & Partial<RecordTimingDto>;
|
|
69
|
+
type PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum> = {
|
|
70
|
+
CreatePlanDto: CreatePlanDto<PlanCadenceEnum, BillingProviderEnum>;
|
|
71
|
+
UpdatePlanDto: UpdatePlanDto<PlanCadenceEnum, BillingProviderEnum>;
|
|
72
|
+
PlanDto: PlanDto<PlanCadenceEnum, BillingProviderEnum>;
|
|
73
|
+
IdDto: IdDto;
|
|
74
|
+
IdsDto: IdsDto;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
type CreateSubscriptionDto<PartyType, BillingProviderType> = {
|
|
78
|
+
partyId: string;
|
|
79
|
+
partyType: PartyType[keyof PartyType];
|
|
80
|
+
description?: string;
|
|
81
|
+
active: boolean;
|
|
82
|
+
productId: string;
|
|
83
|
+
extraFields?: unknown;
|
|
84
|
+
externalId: string;
|
|
85
|
+
billingProvider?: BillingProviderType[keyof BillingProviderType];
|
|
86
|
+
startDate: Date;
|
|
87
|
+
endDate: Date;
|
|
88
|
+
status: string;
|
|
89
|
+
};
|
|
90
|
+
type UpdateSubscriptionDto<PartyType, BillingProviderType> = IdDto & Partial<CreateSubscriptionDto<PartyType, BillingProviderType>>;
|
|
91
|
+
type SubscriptionDto<PartyType, BillingProviderType> = IdDto & CreateSubscriptionDto<PartyType, BillingProviderType> & Partial<RecordTimingDto>;
|
|
92
|
+
type SubscriptionServiceParameters<PartyType, BillingProviderType> = {
|
|
93
|
+
CreateSubscriptionDto: CreateSubscriptionDto<PartyType, BillingProviderType>;
|
|
94
|
+
UpdateSubscriptionDto: UpdateSubscriptionDto<PartyType, BillingProviderType>;
|
|
95
|
+
SubscriptionDto: SubscriptionDto<PartyType, BillingProviderType>;
|
|
96
|
+
IdDto: IdDto;
|
|
97
|
+
IdsDto: IdsDto;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type { BillingPortalDto, BillingPortalServiceParameters, CheckoutSessionDto, CheckoutSessionServiceParameters, CreateBillingPortalDto, CreateCheckoutSessionDto, CreatePaymentLinkDto, CreatePlanDto, CreateSubscriptionDto, PaymentLinkDto, PaymentLinkServiceParameters, PlanDto, PlanServiceParameters, SubscriptionDto, SubscriptionServiceParameters, UpdateBillingPortalDto, UpdateCheckoutSessionDto, UpdatePaymentLinkDto, UpdatePlanDto, UpdateSubscriptionDto };
|
package/lib/types/index.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// types/index.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/interfaces-billing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Billing interfaces for forklaunch",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -15,29 +15,33 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
"./interfaces": {
|
|
17
17
|
"types": "./lib/interfaces/index.d.ts",
|
|
18
|
-
"import": "./lib/interfaces/index.
|
|
19
|
-
"require": "./lib/interfaces/index.js"
|
|
18
|
+
"import": "./lib/interfaces/index.mjs",
|
|
19
|
+
"require": "./lib/interfaces/index.js",
|
|
20
|
+
"default": "./lib/interfaces/index.js"
|
|
20
21
|
},
|
|
21
22
|
"./types": {
|
|
22
23
|
"types": "./lib/types/index.d.ts",
|
|
23
|
-
"import": "./lib/types/index.
|
|
24
|
-
"require": "./lib/types/index.js"
|
|
24
|
+
"import": "./lib/types/index.mjs",
|
|
25
|
+
"require": "./lib/types/index.js",
|
|
26
|
+
"default": "./lib/types/index.js"
|
|
25
27
|
}
|
|
26
28
|
},
|
|
29
|
+
"types": "lib/index.d.ts",
|
|
27
30
|
"files": [
|
|
28
31
|
"lib/**"
|
|
29
32
|
],
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"@forklaunch/common": "^0.3.
|
|
34
|
+
"@forklaunch/common": "^0.3.11",
|
|
32
35
|
"@mikro-orm/core": "^6.4.16"
|
|
33
36
|
},
|
|
34
37
|
"devDependencies": {
|
|
38
|
+
"@typescript/native-preview": "7.0.0-dev.20250611.1",
|
|
35
39
|
"depcheck": "^1.4.7",
|
|
36
40
|
"prettier": "^3.5.3",
|
|
37
41
|
"typedoc": "^0.28.5"
|
|
38
42
|
},
|
|
39
43
|
"scripts": {
|
|
40
|
-
"build": "
|
|
44
|
+
"build": "tsgo --noEmit && tsup interfaces/index.ts types/index.ts --format cjs,esm --no-splitting --dts --tsconfig tsconfig.json --out-dir lib --clean && if [ -f eject-package.bash ]; then pnpm package:eject; fi",
|
|
41
45
|
"clean": "rm -rf lib pnpm.lock.yaml node_modules",
|
|
42
46
|
"docs": "typedoc --out docs *",
|
|
43
47
|
"format": "prettier --ignore-path=.prettierignore --config .prettierrc '**/*.{ts,tsx,json}' --write",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BillingPortalServiceParameters } from '../types/billingPortal.service.types';
|
|
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>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=billingPortal.service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"billingPortal.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/billingPortal.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF,MAAM,WAAW,oBAAoB,CACnC,MAAM,SAAS,8BAA8B,GAAG,8BAA8B;IAI9E,0BAA0B,EAAE,CAC1B,gBAAgB,EAAE,MAAM,CAAC,wBAAwB,CAAC,KAC/C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACzC,uBAAuB,EAAE,CACvB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KACnB,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACzC,0BAA0B,EAAE,CAC1B,gBAAgB,EAAE,MAAM,CAAC,wBAAwB,CAAC,KAC/C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACzC,0BAA0B,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CheckoutSessionServiceParameters } from '../types/checkoutSession.service.types';
|
|
2
|
-
export interface CheckoutSessionService<
|
|
3
|
-
PaymentMethodEnum,
|
|
4
|
-
StatusEnum,
|
|
5
|
-
Params extends CheckoutSessionServiceParameters<
|
|
6
|
-
PaymentMethodEnum,
|
|
7
|
-
StatusEnum
|
|
8
|
-
> = CheckoutSessionServiceParameters<PaymentMethodEnum, StatusEnum>
|
|
9
|
-
> {
|
|
10
|
-
createCheckoutSession: (
|
|
11
|
-
checkoutSessionDto: Params['CreateCheckoutSessionDto']
|
|
12
|
-
) => Promise<Params['CheckoutSessionDto']>;
|
|
13
|
-
getCheckoutSession: (
|
|
14
|
-
idDto: Params['IdDto']
|
|
15
|
-
) => Promise<Params['CheckoutSessionDto']>;
|
|
16
|
-
expireCheckoutSession: (idDto: Params['IdDto']) => Promise<void>;
|
|
17
|
-
handleCheckoutSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
18
|
-
handleCheckoutFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=checkoutSession.service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutSession.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/checkoutSession.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC1F,MAAM,WAAW,sBAAsB,CACrC,iBAAiB,EACjB,UAAU,EACV,MAAM,SAAS,gCAAgC,CAC7C,iBAAiB,EACjB,UAAU,CACX,GAAG,gCAAgC,CAAC,iBAAiB,EAAE,UAAU,CAAC;IAInE,qBAAqB,EAAE,CACrB,kBAAkB,EAAE,MAAM,CAAC,0BAA0B,CAAC,KACnD,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3C,kBAAkB,EAAE,CAClB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KACnB,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3C,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PaymentLinkServiceParameters } from '../types/paymentLink.service.types';
|
|
2
|
-
export interface PaymentLinkService<
|
|
3
|
-
CurrencyEnum,
|
|
4
|
-
StatusEnum,
|
|
5
|
-
Params extends PaymentLinkServiceParameters<
|
|
6
|
-
CurrencyEnum,
|
|
7
|
-
StatusEnum
|
|
8
|
-
> = PaymentLinkServiceParameters<CurrencyEnum, StatusEnum>
|
|
9
|
-
> {
|
|
10
|
-
createPaymentLink: (
|
|
11
|
-
paymentLink: Params['CreatePaymentLinkDto']
|
|
12
|
-
) => Promise<Params['PaymentLinkDto']>;
|
|
13
|
-
updatePaymentLink: (
|
|
14
|
-
paymentLink: Params['UpdatePaymentLinkDto']
|
|
15
|
-
) => Promise<Params['PaymentLinkDto']>;
|
|
16
|
-
getPaymentLink: (idDto: Params['IdDto']) => Promise<Params['PaymentLinkDto']>;
|
|
17
|
-
expirePaymentLink: (idDto: Params['IdDto']) => Promise<void>;
|
|
18
|
-
handlePaymentSuccess: (idDto: Params['IdDto']) => Promise<void>;
|
|
19
|
-
handlePaymentFailure: (idDto: Params['IdDto']) => Promise<void>;
|
|
20
|
-
listPaymentLinks: (
|
|
21
|
-
idsDto?: Params['IdsDto']
|
|
22
|
-
) => Promise<Params['PaymentLinkDto'][]>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=paymentLink.service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paymentLink.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/paymentLink.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF,MAAM,WAAW,kBAAkB,CACjC,YAAY,EACZ,UAAU,EACV,MAAM,SAAS,4BAA4B,CACzC,YAAY,EACZ,UAAU,CACX,GAAG,4BAA4B,CAAC,YAAY,EAAE,UAAU,CAAC;IAK1D,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,CAAC,sBAAsB,CAAC,KACxC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACvC,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,CAAC,sBAAsB,CAAC,KACxC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACvC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC9E,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAGhE,gBAAgB,EAAE,CAChB,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,KACtB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;CAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
-
import { PlanServiceParameters } from '../types/plan.service.types';
|
|
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'][]>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=plan.service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plan.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/plan.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,WAAW,WAAW,CAC1B,eAAe,EACf,mBAAmB,EACnB,MAAM,SAAS,qBAAqB,CAClC,eAAe,EACf,mBAAmB,CACpB,GAAG,qBAAqB,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAE/D,UAAU,EAAE,CACV,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAChC,OAAO,EAAE,CACP,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAChC,UAAU,EAAE,CACV,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAChC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,SAAS,EAAE,CACT,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,EACzB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;CACnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
-
import { SubscriptionServiceParameters } from '../types/subscription.service.types';
|
|
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>;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=subscription.service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.service.interface.d.ts","sourceRoot":"","sources":["../../interfaces/subscription.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEpF,MAAM,WAAW,mBAAmB,CAClC,SAAS,EACT,mBAAmB,EACnB,MAAM,SAAS,6BAA6B,CAC1C,SAAS,EACT,mBAAmB,CACpB,GAAG,6BAA6B,CAAC,SAAS,EAAE,mBAAmB,CAAC;IAGjE,kBAAkB,EAAE,CAClB,eAAe,EAAE,MAAM,CAAC,uBAAuB,CAAC,EAChD,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxC,eAAe,EAAE,CACf,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxC,mBAAmB,EAAE,CACnB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxC,2BAA2B,EAAE,CAC3B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxC,kBAAkB,EAAE,CAClB,eAAe,EAAE,MAAM,CAAC,uBAAuB,CAAC,EAChD,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxC,kBAAkB,EAAE,CAClB,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EACnB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,iBAAiB,EAAE,CACjB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EACxB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC1C,kBAAkB,EAAE,CAClB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,kBAAkB,EAAE,CAClB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EACtB,EAAE,CAAC,EAAE,aAAa,KACf,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/jest.config.d.ts
DELETED
package/lib/jest.config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,oBAiBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|