@forklaunch/interfaces-billing 0.1.1 → 0.1.2

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 (72) hide show
  1. package/package.json +2 -12
  2. package/tsconfig.json +7 -0
  3. package/lib/eject/interfaces/interfaces/billingPortal.service.interface.ts +0 -18
  4. package/lib/eject/interfaces/interfaces/checkoutSession.service.interface.ts +0 -19
  5. package/lib/eject/interfaces/interfaces/index.ts +0 -5
  6. package/lib/eject/interfaces/paymentLink.service.interface.ts +0 -27
  7. package/lib/eject/interfaces/plan.service.interface.ts +0 -29
  8. package/lib/eject/interfaces/subscription.service.interface.ts +0 -49
  9. package/lib/eject/types/types/billingPortal.service.types.ts +0 -19
  10. package/lib/eject/types/types/checkoutSession.service.types.ts +0 -21
  11. package/lib/eject/types/types/index.ts +0 -5
  12. package/lib/eject/types/types/paymentLink.service.types.ts +0 -23
  13. package/lib/eject/types/types/plan.service.types.ts +0 -26
  14. package/lib/eject/types/types/subscription.service.types.ts +0 -28
  15. package/lib/index.d.ts +0 -3
  16. package/lib/index.d.ts.map +0 -1
  17. package/lib/interfaces/billingPortal.service.interface.d.ts +0 -8
  18. package/lib/interfaces/billingPortal.service.interface.d.ts.map +0 -1
  19. package/lib/interfaces/billingPortal.service.interface.js +0 -1
  20. package/lib/interfaces/checkoutSession.service.interface.d.ts +0 -9
  21. package/lib/interfaces/checkoutSession.service.interface.d.ts.map +0 -1
  22. package/lib/interfaces/checkoutSession.service.interface.js +0 -1
  23. package/lib/interfaces/index.d.ts +0 -6
  24. package/lib/interfaces/index.d.ts.map +0 -1
  25. package/lib/interfaces/index.js +0 -5
  26. package/lib/interfaces/paymentLink.service.interface.d.ts +0 -11
  27. package/lib/interfaces/paymentLink.service.interface.d.ts.map +0 -1
  28. package/lib/interfaces/paymentLink.service.interface.js +0 -1
  29. package/lib/interfaces/plan.service.interface.d.ts +0 -10
  30. package/lib/interfaces/plan.service.interface.d.ts.map +0 -1
  31. package/lib/interfaces/plan.service.interface.js +0 -1
  32. package/lib/interfaces/subscription.service.interface.d.ts +0 -14
  33. package/lib/interfaces/subscription.service.interface.d.ts.map +0 -1
  34. package/lib/interfaces/subscription.service.interface.js +0 -1
  35. package/lib/jest.config.d.ts +0 -4
  36. package/lib/jest.config.d.ts.map +0 -1
  37. package/lib/jest.config.js +0 -19
  38. package/lib/tsconfig.tsbuildinfo +0 -1
  39. package/lib/types/billingPortal.service.types.d.ts +0 -16
  40. package/lib/types/billingPortal.service.types.d.ts.map +0 -1
  41. package/lib/types/billingPortal.service.types.js +0 -1
  42. package/lib/types/checkoutSession.service.types.d.ts +0 -17
  43. package/lib/types/checkoutSession.service.types.d.ts.map +0 -1
  44. package/lib/types/checkoutSession.service.types.js +0 -1
  45. package/lib/types/index.d.ts +0 -6
  46. package/lib/types/index.d.ts.map +0 -1
  47. package/lib/types/index.js +0 -5
  48. package/lib/types/paymentLink.service.types.d.ts +0 -19
  49. package/lib/types/paymentLink.service.types.d.ts.map +0 -1
  50. package/lib/types/paymentLink.service.types.js +0 -1
  51. package/lib/types/plan.service.types.d.ts +0 -22
  52. package/lib/types/plan.service.types.d.ts.map +0 -1
  53. package/lib/types/plan.service.types.js +0 -1
  54. package/lib/types/subscription.service.types.d.ts +0 -24
  55. package/lib/types/subscription.service.types.d.ts.map +0 -1
  56. package/lib/types/subscription.service.types.js +0 -1
  57. package/lib/vitest.config.d.ts +0 -3
  58. package/lib/vitest.config.d.ts.map +0 -1
  59. package/lib/vitest.config.js +0 -7
  60. /package/{lib/index.js → index.ts} +0 -0
  61. /package/{lib/eject/interfaces → interfaces}/billingPortal.service.interface.ts +0 -0
  62. /package/{lib/eject/interfaces → interfaces}/checkoutSession.service.interface.ts +0 -0
  63. /package/{lib/eject/interfaces → interfaces}/index.ts +0 -0
  64. /package/{lib/eject/interfaces/interfaces → interfaces}/paymentLink.service.interface.ts +0 -0
  65. /package/{lib/eject/interfaces/interfaces → interfaces}/plan.service.interface.ts +0 -0
  66. /package/{lib/eject/interfaces/interfaces → interfaces}/subscription.service.interface.ts +0 -0
  67. /package/{lib/eject/types → types}/billingPortal.service.types.ts +0 -0
  68. /package/{lib/eject/types → types}/checkoutSession.service.types.ts +0 -0
  69. /package/{lib/eject/types → types}/index.ts +0 -0
  70. /package/{lib/eject/types → types}/paymentLink.service.types.ts +0 -0
  71. /package/{lib/eject/types → types}/plan.service.types.ts +0 -0
  72. /package/{lib/eject/types → types}/subscription.service.types.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/interfaces-billing",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Billing interfaces for forklaunch",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -12,9 +12,7 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "author": "Forklift Technologies, Inc.",
15
- "files": [
16
- "lib"
17
- ],
15
+ "types": "./lib/index.d.ts",
18
16
  "dependencies": {
19
17
  "@forklaunch/common": "^0.2.5",
20
18
  "@mikro-orm/core": "^6.4.11"
@@ -24,12 +22,6 @@
24
22
  "prettier": "^3.5.3",
25
23
  "typedoc": "^0.28.1"
26
24
  },
27
- "mikro-orm": {
28
- "configPaths": [
29
- "./mikro-orm.config.ts",
30
- "./dist/mikro-orm.config.js"
31
- ]
32
- },
33
25
  "scripts": {
34
26
  "build": "tsc && pnpm package:eject",
35
27
  "clean": "rm -rf lib pnpm.lock.yaml node_modules",
@@ -38,8 +30,6 @@
38
30
  "lint": "eslint . -c eslint.config.mjs",
39
31
  "lint:fix": "eslint . -c eslint.config.mjs --fix",
40
32
  "package:eject": "mkdir -p lib/eject && cp -r interfaces lib/eject/interfaces && cp -r types lib/eject/types",
41
- "start": "ENV_FILE_PATH=.env.local NODE_OPTIONS='--import=tsx' node dist/server.js",
42
- "start:bun": "bun run migrate:up && bun dist/server.js",
43
33
  "test": "vitest --passWithNoTests"
44
34
  }
45
35
  }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "lib"
5
+ },
6
+ "exclude": ["node_modules", "lib", "eslint.config.mjs"]
7
+ }
@@ -1,18 +0,0 @@
1
- import { BillingPortalServiceParameters } from '../types/billingPortal.service.types';
2
-
3
- export interface BillingPortalService<
4
- Params extends BillingPortalServiceParameters = BillingPortalServiceParameters
5
- > {
6
- // for generating external links
7
- // store in cache, for permissions
8
- createBillingPortalSession: (
9
- billingPortalDto: Params['CreateBillingPortalDto']
10
- ) => Promise<Params['BillingPortalDto']>;
11
- getBillingPortalSession: (
12
- idDto: Params['IdDto']
13
- ) => Promise<Params['BillingPortalDto']>;
14
- updateBillingPortalSession: (
15
- billingPortalDto: Params['UpdateBillingPortalDto']
16
- ) => Promise<Params['BillingPortalDto']>;
17
- expireBillingPortalSession: (idDto: Params['IdDto']) => Promise<void>;
18
- }
@@ -1,19 +0,0 @@
1
- import { CheckoutSessionServiceParameters } from '../types/checkoutSession.service.types';
2
- export interface CheckoutSessionService<
3
- PaymentMethodEnum,
4
- Params extends
5
- CheckoutSessionServiceParameters<PaymentMethodEnum> = CheckoutSessionServiceParameters<PaymentMethodEnum>
6
- > {
7
- // for generating external links
8
- // store in cache, for permissions
9
- createCheckoutSession: (
10
- checkoutSessionDto: Params['CreateCheckoutSessionDto']
11
- ) => Promise<Params['CheckoutSessionDto']>;
12
- getCheckoutSession: (
13
- idDto: Params['IdDto']
14
- ) => Promise<Params['CheckoutSessionDto']>;
15
- expireCheckoutSession: (idDto: Params['IdDto']) => Promise<void>;
16
-
17
- handleCheckoutSuccess: (idDto: Params['IdDto']) => Promise<void>;
18
- handleCheckoutFailure: (idDto: Params['IdDto']) => Promise<void>;
19
- }
@@ -1,5 +0,0 @@
1
- export * from './billingPortal.service.interface';
2
- export * from './checkoutSession.service.interface';
3
- export * from './paymentLink.service.interface';
4
- export * from './plan.service.interface';
5
- export * from './subscription.service.interface';
@@ -1,27 +0,0 @@
1
- import { PaymentLinkServiceParameters } from '../types/paymentLink.service.types';
2
-
3
- export interface PaymentLinkService<
4
- CurrencyEnum,
5
- Params extends
6
- PaymentLinkServiceParameters<CurrencyEnum> = PaymentLinkServiceParameters<CurrencyEnum>
7
- > {
8
- // for one off products that are not part of a subscription
9
- // think about how permissions work on payment links, but these should be ephemeral
10
- // store in cache, for permissions
11
- createPaymentLink: (
12
- paymentLink: Params['CreatePaymentLinkDto']
13
- ) => Promise<Params['PaymentLinkDto']>;
14
- updatePaymentLink: (
15
- paymentLink: Params['UpdatePaymentLinkDto']
16
- ) => Promise<Params['PaymentLinkDto']>;
17
- getPaymentLink: (idDto: Params['IdDto']) => Promise<Params['PaymentLinkDto']>;
18
- expirePaymentLink: (idDto: Params['IdDto']) => Promise<void>;
19
-
20
- handlePaymentSuccess: (idDto: Params['IdDto']) => Promise<void>;
21
- handlePaymentFailure: (idDto: Params['IdDto']) => Promise<void>;
22
-
23
- // admin API, make sure that permissions are correct here
24
- listPaymentLinks: (
25
- idsDto?: Params['IdsDto']
26
- ) => Promise<Params['PaymentLinkDto'][]>;
27
- }
@@ -1,29 +0,0 @@
1
- import { EntityManager } from '@mikro-orm/core';
2
- import { PlanServiceParameters } from '../types/plan.service.types';
3
-
4
- export interface PlanService<
5
- PlanCadenceEnum,
6
- BillingProviderEnum,
7
- Params extends PlanServiceParameters<
8
- PlanCadenceEnum,
9
- BillingProviderEnum
10
- > = PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum>
11
- > {
12
- createPlan: (
13
- planDto: Params['CreatePlanDto'],
14
- em?: EntityManager
15
- ) => Promise<Params['PlanDto']>;
16
- getPlan: (
17
- idDto: Params['IdDto'],
18
- em?: EntityManager
19
- ) => Promise<Params['PlanDto']>;
20
- updatePlan: (
21
- planDto: Params['UpdatePlanDto'],
22
- em?: EntityManager
23
- ) => Promise<Params['PlanDto']>;
24
- deletePlan: (idDto: Params['IdDto'], em?: EntityManager) => Promise<void>;
25
- listPlans: (
26
- idsDto?: Params['IdsDto'],
27
- em?: EntityManager
28
- ) => Promise<Params['PlanDto'][]>;
29
- }
@@ -1,49 +0,0 @@
1
- import { EntityManager } from '@mikro-orm/core';
2
- import { SubscriptionServiceParameters } from '../types/subscription.service.types';
3
-
4
- export interface SubscriptionService<
5
- PartyType,
6
- BillingProviderType,
7
- Params extends SubscriptionServiceParameters<
8
- PartyType,
9
- BillingProviderType
10
- > = SubscriptionServiceParameters<PartyType, BillingProviderType>
11
- > {
12
- // store this in a table
13
- createSubscription: (
14
- subscriptionDto: Params['CreateSubscriptionDto'],
15
- em?: EntityManager
16
- ) => Promise<Params['SubscriptionDto']>;
17
- getSubscription: (
18
- idDto: Params['IdDto'],
19
- em?: EntityManager
20
- ) => Promise<Params['SubscriptionDto']>;
21
- getUserSubscription: (
22
- idDto: Params['IdDto'],
23
- em?: EntityManager
24
- ) => Promise<Params['SubscriptionDto']>;
25
- getOrganizationSubscription: (
26
- idDto: Params['IdDto'],
27
- em?: EntityManager
28
- ) => Promise<Params['SubscriptionDto']>;
29
- updateSubscription: (
30
- subscriptionDto: Params['UpdateSubscriptionDto'],
31
- em?: EntityManager
32
- ) => Promise<Params['SubscriptionDto']>;
33
- deleteSubscription: (
34
- id: Params['IdDto'],
35
- em?: EntityManager
36
- ) => Promise<void>;
37
- listSubscriptions: (
38
- idsDto: Params['IdsDto'],
39
- em?: EntityManager
40
- ) => Promise<Params['SubscriptionDto'][]>;
41
- cancelSubscription: (
42
- idDto: Params['IdDto'],
43
- em?: EntityManager
44
- ) => Promise<void>;
45
- resumeSubscription: (
46
- idDto: Params['IdDto'],
47
- em?: EntityManager
48
- ) => Promise<void>;
49
- }
@@ -1,19 +0,0 @@
1
- import { IdDto, RecordTimingDto } from '@forklaunch/common';
2
-
3
- export type CreateBillingPortalDto = {
4
- customerId: string;
5
- uri: string;
6
- expiresAt: Date;
7
- extraFields?: unknown;
8
- };
9
- export type UpdateBillingPortalDto = IdDto & Partial<CreateBillingPortalDto>;
10
- export type BillingPortalDto = IdDto &
11
- CreateBillingPortalDto &
12
- Partial<RecordTimingDto>;
13
-
14
- export type BillingPortalServiceParameters = {
15
- CreateBillingPortalDto: CreateBillingPortalDto;
16
- UpdateBillingPortalDto: UpdateBillingPortalDto;
17
- BillingPortalDto: BillingPortalDto;
18
- IdDto: IdDto;
19
- };
@@ -1,21 +0,0 @@
1
- import { IdDto, RecordTimingDto } from '@forklaunch/common';
2
-
3
- export type CreateCheckoutSessionDto<PaymentMethodEnum> = {
4
- customerId: string;
5
- paymentMethods: PaymentMethodEnum[keyof PaymentMethodEnum][];
6
- metadata?: unknown;
7
- successRedirectUri: string;
8
- cancelRedirectUri: string;
9
- extraFields?: unknown;
10
- };
11
- export type UpdateCheckoutSessionDto<PaymentMethodEnum> = IdDto &
12
- Partial<CreateCheckoutSessionDto<PaymentMethodEnum>>;
13
- export type CheckoutSessionDto<PaymentMethodEnum> = IdDto &
14
- CreateCheckoutSessionDto<PaymentMethodEnum> &
15
- Partial<RecordTimingDto>;
16
-
17
- export type CheckoutSessionServiceParameters<PaymentMethodEnum> = {
18
- CreateCheckoutSessionDto: CreateCheckoutSessionDto<PaymentMethodEnum>;
19
- CheckoutSessionDto: CheckoutSessionDto<PaymentMethodEnum>;
20
- IdDto: IdDto;
21
- };
@@ -1,5 +0,0 @@
1
- export * from './billingPortal.service.types';
2
- export * from './checkoutSession.service.types';
3
- export * from './paymentLink.service.types';
4
- export * from './plan.service.types';
5
- export * from './subscription.service.types';
@@ -1,23 +0,0 @@
1
- import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
2
-
3
- export type CreatePaymentLinkDto<CurrencyEnum> = {
4
- amount: number;
5
- currency: CurrencyEnum[keyof CurrencyEnum];
6
- metadata?: unknown;
7
- successRedirectUri: string;
8
- cancelRedirectUri: string;
9
- extraFields?: unknown;
10
- };
11
- export type UpdatePaymentLinkDto<CurrencyEnum> = IdDto &
12
- Partial<CreatePaymentLinkDto<CurrencyEnum>>;
13
- export type PaymentLinkDto<CurrencyEnum> = IdDto &
14
- CreatePaymentLinkDto<CurrencyEnum> &
15
- Partial<RecordTimingDto>;
16
-
17
- export type PaymentLinkServiceParameters<CurrencyEnum> = {
18
- CreatePaymentLinkDto: CreatePaymentLinkDto<CurrencyEnum>;
19
- UpdatePaymentLinkDto: UpdatePaymentLinkDto<CurrencyEnum>;
20
- PaymentLinkDto: PaymentLinkDto<CurrencyEnum>;
21
- IdDto: IdDto;
22
- IdsDto: IdsDto;
23
- };
@@ -1,26 +0,0 @@
1
- import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
2
-
3
- export type CreatePlanDto<PlanCadenceEnum, BillingProviderEnum> = {
4
- active: boolean;
5
- name: string;
6
- description?: string;
7
- price: number;
8
- cadence: PlanCadenceEnum[keyof PlanCadenceEnum];
9
- features?: string[];
10
- extraFields?: unknown;
11
- externalId: string;
12
- billingProvider?: BillingProviderEnum[keyof BillingProviderEnum];
13
- };
14
- export type UpdatePlanDto<PlanCadenceEnum, BillingProviderEnum> = IdDto &
15
- Partial<CreatePlanDto<PlanCadenceEnum, BillingProviderEnum>>;
16
- export type PlanDto<PlanCadenceEnum, BillingProviderEnum> = IdDto &
17
- CreatePlanDto<PlanCadenceEnum, BillingProviderEnum> &
18
- Partial<RecordTimingDto>;
19
-
20
- export type PlanServiceParameters<PlanCadenceEnum, BillingProviderEnum> = {
21
- CreatePlanDto: CreatePlanDto<PlanCadenceEnum, BillingProviderEnum>;
22
- UpdatePlanDto: UpdatePlanDto<PlanCadenceEnum, BillingProviderEnum>;
23
- PlanDto: PlanDto<PlanCadenceEnum, BillingProviderEnum>;
24
- IdDto: IdDto;
25
- IdsDto: IdsDto;
26
- };
@@ -1,28 +0,0 @@
1
- import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
2
-
3
- export type CreateSubscriptionDto<PartyType, BillingProviderType> = {
4
- partyId: string;
5
- partyType: PartyType[keyof PartyType];
6
- description?: string;
7
- active: boolean;
8
- productId: string;
9
- extraFields?: unknown;
10
- externalId: string;
11
- billingProvider?: BillingProviderType[keyof BillingProviderType];
12
- startDate: Date;
13
- endDate: Date;
14
- status: string;
15
- };
16
- export type UpdateSubscriptionDto<PartyType, BillingProviderType> = IdDto &
17
- Partial<CreateSubscriptionDto<PartyType, BillingProviderType>>;
18
- export type SubscriptionDto<PartyType, BillingProviderType> = IdDto &
19
- CreateSubscriptionDto<PartyType, BillingProviderType> &
20
- Partial<RecordTimingDto>;
21
-
22
- export type SubscriptionServiceParameters<PartyType, BillingProviderType> = {
23
- CreateSubscriptionDto: CreateSubscriptionDto<PartyType, BillingProviderType>;
24
- UpdateSubscriptionDto: UpdateSubscriptionDto<PartyType, BillingProviderType>;
25
- SubscriptionDto: SubscriptionDto<PartyType, BillingProviderType>;
26
- IdDto: IdDto;
27
- IdsDto: IdsDto;
28
- };
package/lib/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './interfaces';
2
- export * from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -1,8 +0,0 @@
1
- import { BillingPortalServiceParameters } from '../types/billingPortal.service.types';
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>;
7
- }
8
- //# 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,9 +0,0 @@
1
- import { CheckoutSessionServiceParameters } from '../types/checkoutSession.service.types';
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>;
8
- }
9
- //# 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,MAAM,SACJ,gCAAgC,CAAC,iBAAiB,CAAC,GAAG,gCAAgC,CAAC,iBAAiB,CAAC;IAI3G,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,6 +0,0 @@
1
- export * from './billingPortal.service.interface';
2
- export * from './checkoutSession.service.interface';
3
- export * from './paymentLink.service.interface';
4
- export * from './plan.service.interface';
5
- export * from './subscription.service.interface';
6
- //# sourceMappingURL=index.d.ts.map
@@ -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,5 +0,0 @@
1
- export * from './billingPortal.service.interface';
2
- export * from './checkoutSession.service.interface';
3
- export * from './paymentLink.service.interface';
4
- export * from './plan.service.interface';
5
- export * from './subscription.service.interface';
@@ -1,11 +0,0 @@
1
- import { PaymentLinkServiceParameters } from '../types/paymentLink.service.types';
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'][]>;
10
- }
11
- //# 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,MAAM,SACJ,4BAA4B,CAAC,YAAY,CAAC,GAAG,4BAA4B,CAAC,YAAY,CAAC;IAKzF,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,10 +0,0 @@
1
- import { EntityManager } from '@mikro-orm/core';
2
- import { PlanServiceParameters } from '../types/plan.service.types';
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'][]>;
9
- }
10
- //# 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,14 +0,0 @@
1
- import { EntityManager } from '@mikro-orm/core';
2
- import { SubscriptionServiceParameters } from '../types/subscription.service.types';
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>;
13
- }
14
- //# 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 {};
@@ -1,4 +0,0 @@
1
- import type { JestConfigWithTsJest } from 'ts-jest';
2
- declare const jestConfig: JestConfigWithTsJest;
3
- export default jestConfig;
4
- //# sourceMappingURL=jest.config.d.ts.map
@@ -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"}
@@ -1,19 +0,0 @@
1
- const jestConfig = {
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
- };
19
- export default jestConfig;