@forklaunch/implementation-billing-stripe 1.1.25 → 1.1.27

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 (88) hide show
  1. package/lib/domain/enum/billingProvider.enum.d.ts +5 -0
  2. package/lib/domain/enum/billingProvider.enum.d.ts.map +1 -0
  3. package/lib/domain/enum/currency.enum.d.ts +72 -0
  4. package/lib/domain/enum/currency.enum.d.ts.map +1 -0
  5. package/lib/domain/enum/index.d.ts +5 -126
  6. package/lib/domain/enum/index.d.ts.map +1 -0
  7. package/lib/domain/enum/paymentMethod.enum.d.ts +41 -0
  8. package/lib/domain/enum/paymentMethod.enum.d.ts.map +1 -0
  9. package/lib/domain/enum/planCadence.enum.d.ts +7 -0
  10. package/lib/domain/enum/planCadence.enum.d.ts.map +1 -0
  11. package/lib/domain/schemas/billingPortal.schema.d.ts +50 -0
  12. package/lib/domain/schemas/billingPortal.schema.d.ts.map +1 -0
  13. package/lib/domain/schemas/checkoutSession.schema.d.ts +12 -0
  14. package/lib/domain/schemas/checkoutSession.schema.d.ts.map +1 -0
  15. package/lib/domain/schemas/index.d.ts +6 -384
  16. package/lib/domain/schemas/index.d.ts.map +1 -0
  17. package/lib/domain/schemas/index.js +4 -4
  18. package/lib/domain/schemas/index.mjs +4 -4
  19. package/lib/domain/schemas/paymentLink.schema.d.ts +12 -0
  20. package/lib/domain/schemas/paymentLink.schema.d.ts.map +1 -0
  21. package/lib/domain/schemas/plan.schema.d.ts +88 -0
  22. package/lib/domain/schemas/plan.schema.d.ts.map +1 -0
  23. package/lib/domain/schemas/subscription.schema.d.ts +12 -0
  24. package/lib/domain/schemas/subscription.schema.d.ts.map +1 -0
  25. package/lib/domain/schemas/typebox/billingPortal.schema.d.ts +47 -0
  26. package/lib/domain/schemas/typebox/billingPortal.schema.d.ts.map +1 -0
  27. package/lib/domain/schemas/typebox/checkoutSession.schema.d.ts +46 -0
  28. package/lib/domain/schemas/typebox/checkoutSession.schema.d.ts.map +1 -0
  29. package/lib/domain/schemas/typebox/paymentLink.schema.d.ts +33 -0
  30. package/lib/domain/schemas/typebox/paymentLink.schema.d.ts.map +1 -0
  31. package/lib/domain/schemas/typebox/plan.schema.d.ts +85 -0
  32. package/lib/domain/schemas/typebox/plan.schema.d.ts.map +1 -0
  33. package/lib/domain/schemas/typebox/subscription.schema.d.ts +51 -0
  34. package/lib/domain/schemas/typebox/subscription.schema.d.ts.map +1 -0
  35. package/lib/domain/schemas/zod/billingPortal.schema.d.ts +47 -0
  36. package/lib/domain/schemas/zod/billingPortal.schema.d.ts.map +1 -0
  37. package/lib/domain/schemas/zod/checkoutSession.schema.d.ts +46 -0
  38. package/lib/domain/schemas/zod/checkoutSession.schema.d.ts.map +1 -0
  39. package/lib/domain/schemas/zod/paymentLink.schema.d.ts +34 -0
  40. package/lib/domain/schemas/zod/paymentLink.schema.d.ts.map +1 -0
  41. package/lib/domain/schemas/zod/plan.schema.d.ts +88 -0
  42. package/lib/domain/schemas/zod/plan.schema.d.ts.map +1 -0
  43. package/lib/domain/schemas/zod/subscription.schema.d.ts +54 -0
  44. package/lib/domain/schemas/zod/subscription.schema.d.ts.map +1 -0
  45. package/lib/domain/types/billingPortal.mapper.types.d.ts +19 -0
  46. package/lib/domain/types/billingPortal.mapper.types.d.ts.map +1 -0
  47. package/lib/domain/types/checkoutSession.mapper.types.d.ts +19 -0
  48. package/lib/domain/types/checkoutSession.mapper.types.d.ts.map +1 -0
  49. package/lib/domain/types/index.d.ts +8 -518
  50. package/lib/domain/types/index.d.ts.map +1 -0
  51. package/lib/domain/types/paymentLink.mapper.types.d.ts +19 -0
  52. package/lib/domain/types/paymentLink.mapper.types.d.ts.map +1 -0
  53. package/lib/domain/types/plan.mapper.types.d.ts +19 -0
  54. package/lib/domain/types/plan.mapper.types.d.ts.map +1 -0
  55. package/lib/domain/types/stripe.dto.types.d.ts +113 -0
  56. package/lib/domain/types/stripe.dto.types.d.ts.map +1 -0
  57. package/lib/domain/types/stripe.entity.types.d.ts +103 -0
  58. package/lib/domain/types/stripe.entity.types.d.ts.map +1 -0
  59. package/lib/domain/types/subscription.mapper.types.d.ts +19 -0
  60. package/lib/domain/types/subscription.mapper.types.d.ts.map +1 -0
  61. package/lib/eject/domain/schemas/plan.schema.ts +1 -1
  62. package/lib/eject/domain/schemas/subscription.schema.ts +1 -1
  63. package/lib/eject/domain/types/stripe.entity.types.ts +24 -6
  64. package/lib/persistence/entities/index.d.ts +437 -0
  65. package/lib/persistence/entities/index.d.ts.map +1 -0
  66. package/lib/services/billingPortal.service.d.ts +39 -0
  67. package/lib/services/billingPortal.service.d.ts.map +1 -0
  68. package/lib/services/checkoutSession.service.d.ts +40 -0
  69. package/lib/services/checkoutSession.service.d.ts.map +1 -0
  70. package/lib/services/index.d.ts +7 -188
  71. package/lib/services/index.d.ts.map +1 -0
  72. package/lib/services/index.js +2 -2
  73. package/lib/services/index.mjs +2 -2
  74. package/lib/services/paymentLink.service.d.ts +43 -0
  75. package/lib/services/paymentLink.service.d.ts.map +1 -0
  76. package/lib/services/plan.service.d.ts +41 -0
  77. package/lib/services/plan.service.d.ts.map +1 -0
  78. package/lib/services/subscription.service.d.ts +43 -0
  79. package/lib/services/subscription.service.d.ts.map +1 -0
  80. package/lib/services/webhook.service.d.ts +39 -0
  81. package/lib/services/webhook.service.d.ts.map +1 -0
  82. package/package.json +43 -16
  83. package/lib/domain/enum/index.d.mts +0 -126
  84. package/lib/domain/schemas/index.d.mts +0 -384
  85. package/lib/domain/types/index.d.mts +0 -518
  86. package/lib/services/index.d.mts +0 -190
  87. package/lib/stripe.dto.types-62tPCNUc.d.mts +0 -111
  88. package/lib/stripe.dto.types-BnAQ5iRQ.d.ts +0 -111
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../persistence/entities/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAOxB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAU1B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAUtB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAYf,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAWvB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAkB7B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { IdDto } from '@forklaunch/common';
2
+ import { TtlCache } from '@forklaunch/core/cache';
3
+ import { MetricsDefinition, OpenTelemetryCollector, TelemetryOptions } from '@forklaunch/core/http';
4
+ import { BaseBillingPortalService } from '@forklaunch/implementation-billing-base/services';
5
+ import { BillingPortalService } from '@forklaunch/interfaces-billing/interfaces';
6
+ import { AnySchemaValidator } from '@forklaunch/validator';
7
+ import { EntityManager } from '@mikro-orm/core';
8
+ import Stripe from 'stripe';
9
+ import { StripeBillingPortalMappers } from '../domain/types/billingPortal.mapper.types';
10
+ import { StripeBillingPortalDtos, StripeCreateBillingPortalDto, StripeUpdateBillingPortalDto } from '../domain/types/stripe.dto.types';
11
+ import { StripeBillingPortalEntities } from '../domain/types/stripe.entity.types';
12
+ export declare class StripeBillingPortalService<SchemaValidator extends AnySchemaValidator, Entities extends StripeBillingPortalEntities, Dto extends StripeBillingPortalDtos = StripeBillingPortalDtos> implements BillingPortalService<{
13
+ CreateBillingPortalDto: Dto['CreateBillingPortalMapper'];
14
+ UpdateBillingPortalDto: Dto['UpdateBillingPortalMapper'];
15
+ BillingPortalDto: Dto['BillingPortalMapper'];
16
+ IdDto: IdDto;
17
+ }> {
18
+ readonly options?: {
19
+ enableDatabaseBackup?: boolean;
20
+ telemetry?: TelemetryOptions;
21
+ } | undefined;
22
+ baseBillingPortalService: BaseBillingPortalService<SchemaValidator, Entities, Dto>;
23
+ protected readonly stripeClient: Stripe;
24
+ protected readonly em: EntityManager;
25
+ protected readonly cache: TtlCache;
26
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
27
+ protected readonly schemaValidator: SchemaValidator;
28
+ private readonly billingPortalSessionExpiryDurationMs;
29
+ protected readonly mappers: StripeBillingPortalMappers<Entities, Dto>;
30
+ constructor(stripeClient: Stripe, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeBillingPortalMappers<Entities, Dto>, options?: {
31
+ enableDatabaseBackup?: boolean;
32
+ telemetry?: TelemetryOptions;
33
+ } | undefined);
34
+ createBillingPortalSession(billingPortalDto: StripeCreateBillingPortalDto, ...args: unknown[]): Promise<Dto['BillingPortalMapper']>;
35
+ getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
36
+ expireBillingPortalSession(idDto: IdDto): Promise<void>;
37
+ updateBillingPortalSession(billingPortalDto: StripeUpdateBillingPortalDto, ...args: unknown[]): Promise<Dto['BillingPortalMapper']>;
38
+ }
39
+ //# sourceMappingURL=billingPortal.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billingPortal.service.d.ts","sourceRoot":"","sources":["../../services/billingPortal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAA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ector, TelemetryOptions } from '@forklaunch/core/http';
4
+ import { BaseCheckoutSessionService } from '@forklaunch/implementation-billing-base/services';
5
+ import { CheckoutSessionService } from '@forklaunch/interfaces-billing/interfaces';
6
+ import { AnySchemaValidator } from '@forklaunch/validator';
7
+ import { EntityManager } from '@mikro-orm/core';
8
+ import Stripe from 'stripe';
9
+ import { CurrencyEnum } from '../domain/enum/currency.enum';
10
+ import { PaymentMethodEnum } from '../domain/enum/paymentMethod.enum';
11
+ import { StripeCheckoutSessionMappers } from '../domain/types/checkoutSession.mapper.types';
12
+ import { StripeCheckoutSessionDtos, StripeCreateCheckoutSessionDto } from '../domain/types/stripe.dto.types';
13
+ import { StripeCheckoutSessionEntities } from '../domain/types/stripe.entity.types';
14
+ export declare class StripeCheckoutSessionService<SchemaValidator extends AnySchemaValidator, StatusEnum, MapperEntities extends StripeCheckoutSessionEntities<StatusEnum>, Dto extends StripeCheckoutSessionDtos<StatusEnum> = StripeCheckoutSessionDtos<StatusEnum>> implements CheckoutSessionService<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
15
+ CreateCheckoutSessionDto: Dto['CreateCheckoutSessionMapper'];
16
+ CheckoutSessionDto: Dto['CheckoutSessionMapper'];
17
+ IdDto: IdDto;
18
+ }> {
19
+ readonly options?: {
20
+ enableDatabaseBackup?: boolean;
21
+ telemetry?: TelemetryOptions;
22
+ } | undefined;
23
+ baseCheckoutSessionService: BaseCheckoutSessionService<SchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, MapperEntities, Dto>;
24
+ protected readonly stripeClient: Stripe;
25
+ protected readonly em: EntityManager;
26
+ protected readonly cache: TtlCache;
27
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
28
+ protected readonly schemaValidator: SchemaValidator;
29
+ protected readonly mappers: StripeCheckoutSessionMappers<StatusEnum, MapperEntities, Dto>;
30
+ constructor(stripeClient: Stripe, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeCheckoutSessionMappers<StatusEnum, MapperEntities, Dto>, options?: {
31
+ enableDatabaseBackup?: boolean;
32
+ telemetry?: TelemetryOptions;
33
+ } | undefined);
34
+ createCheckoutSession(checkoutSessionDto: StripeCreateCheckoutSessionDto<StatusEnum>, ...args: unknown[]): Promise<Dto['CheckoutSessionMapper']>;
35
+ getCheckoutSession(idDto: IdDto): Promise<Dto['CheckoutSessionMapper']>;
36
+ expireCheckoutSession({ id }: IdDto): Promise<void>;
37
+ handleCheckoutSuccess({ id }: IdDto): Promise<void>;
38
+ handleCheckoutFailure({ id }: IdDto): Promise<void>;
39
+ }
40
+ //# sourceMappingURL=checkoutSession.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkoutSession.service.d.ts","sourceRoot":"","sources":["../../services/checkoutSession.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAE9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,E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ChC,OAAO,EAAE,4BAA4B,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,CAAC,EAC7D,OAAO,CAAC,EAAE;QACjB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,SAAS,CAAC,EAAE,gBAAgB,CAAC;KAC9B,YAAA,EAsBF;IAEK,qBAAqB,CACzB,kBAAkB,EAAE,8BAA8B,CAAC,UAAU,CAAC,EAC9D,GAAG,IAAI,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAsBvC;IAEK,kBAAkB,CACtB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAUvC;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxD;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxD;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxD;CACF"}
@@ -1,190 +1,9 @@
1
- import { IdDto, IdsDto } from '@forklaunch/common';
2
- import { TtlCache } from '@forklaunch/core/cache';
3
- import { TelemetryOptions, OpenTelemetryCollector, MetricsDefinition } from '@forklaunch/core/http';
4
- import { BaseBillingPortalService, BaseCheckoutSessionService, BasePaymentLinkService, BasePlanService, BaseSubscriptionService } from '@forklaunch/implementation-billing-base/services';
5
- import { BillingPortalService, CheckoutSessionService, PaymentLinkService, PlanService, SubscriptionService } from '@forklaunch/interfaces-billing/interfaces';
1
+ export * from './billingPortal.service';
2
+ export * from './checkoutSession.service';
3
+ export * from './paymentLink.service';
4
+ export * from './plan.service';
5
+ export * from './subscription.service';
6
+ export * from './webhook.service';
6
7
  export * from '@forklaunch/interfaces-billing/interfaces';
7
- import { AnySchemaValidator } from '@forklaunch/validator';
8
- import { EntityManager } from '@mikro-orm/core';
9
- import Stripe from 'stripe';
10
- import { StripeBillingPortalEntities, StripeBillingPortalMappers, StripeCheckoutSessionEntities, StripeCheckoutSessionMappers, StripePaymentLinkEntities, StripePaymentLinkMappers, StripePlanEntities, StripePlanMappers, StripeSubscriptionEntities, StripeSubscriptionMappers } from '../domain/types/index.js';
11
- import { m as StripeBillingPortalDtos, n as StripeCreateBillingPortalDto, o as StripeUpdateBillingPortalDto, p as StripeCheckoutSessionDtos, q as StripeCreateCheckoutSessionDto, r as StripePaymentLinkDtos, s as StripeCreatePaymentLinkDto, t as StripeUpdatePaymentLinkDto, u as StripePaymentLinkDto, v as StripePlanDtos, w as StripeCreatePlanDto, x as StripeUpdatePlanDto, y as StripePlanDto, z as StripeSubscriptionDtos, A as StripeCreateSubscriptionDto, B as StripeUpdateSubscriptionDto, C as StripeSubscriptionDto } from '../stripe.dto.types-BnAQ5iRQ.js';
12
- import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../domain/enum/index.js';
13
8
  export * from '@forklaunch/interfaces-billing/types';
14
-
15
- declare class StripeBillingPortalService<SchemaValidator extends AnySchemaValidator, Entities extends StripeBillingPortalEntities, Dto extends StripeBillingPortalDtos = StripeBillingPortalDtos> implements BillingPortalService<{
16
- CreateBillingPortalDto: Dto['CreateBillingPortalMapper'];
17
- UpdateBillingPortalDto: Dto['UpdateBillingPortalMapper'];
18
- BillingPortalDto: Dto['BillingPortalMapper'];
19
- IdDto: IdDto;
20
- }> {
21
- readonly options?: {
22
- enableDatabaseBackup?: boolean;
23
- telemetry?: TelemetryOptions;
24
- } | undefined;
25
- baseBillingPortalService: BaseBillingPortalService<SchemaValidator, Entities, Dto>;
26
- protected readonly stripeClient: Stripe;
27
- protected readonly em: EntityManager;
28
- protected readonly cache: TtlCache;
29
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
30
- protected readonly schemaValidator: SchemaValidator;
31
- private readonly billingPortalSessionExpiryDurationMs;
32
- protected readonly mappers: StripeBillingPortalMappers<Entities, Dto>;
33
- constructor(stripeClient: Stripe, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeBillingPortalMappers<Entities, Dto>, options?: {
34
- enableDatabaseBackup?: boolean;
35
- telemetry?: TelemetryOptions;
36
- } | undefined);
37
- createBillingPortalSession(billingPortalDto: StripeCreateBillingPortalDto, ...args: unknown[]): Promise<Dto['BillingPortalMapper']>;
38
- getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
39
- expireBillingPortalSession(idDto: IdDto): Promise<void>;
40
- updateBillingPortalSession(billingPortalDto: StripeUpdateBillingPortalDto, ...args: unknown[]): Promise<Dto['BillingPortalMapper']>;
41
- }
42
-
43
- declare class StripeCheckoutSessionService<SchemaValidator extends AnySchemaValidator, StatusEnum, MapperEntities extends StripeCheckoutSessionEntities<StatusEnum>, Dto extends StripeCheckoutSessionDtos<StatusEnum> = StripeCheckoutSessionDtos<StatusEnum>> implements CheckoutSessionService<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
44
- CreateCheckoutSessionDto: Dto['CreateCheckoutSessionMapper'];
45
- CheckoutSessionDto: Dto['CheckoutSessionMapper'];
46
- IdDto: IdDto;
47
- }> {
48
- readonly options?: {
49
- enableDatabaseBackup?: boolean;
50
- telemetry?: TelemetryOptions;
51
- } | undefined;
52
- baseCheckoutSessionService: BaseCheckoutSessionService<SchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, MapperEntities, Dto>;
53
- protected readonly stripeClient: Stripe;
54
- protected readonly em: EntityManager;
55
- protected readonly cache: TtlCache;
56
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
57
- protected readonly schemaValidator: SchemaValidator;
58
- protected readonly mappers: StripeCheckoutSessionMappers<StatusEnum, MapperEntities, Dto>;
59
- constructor(stripeClient: Stripe, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeCheckoutSessionMappers<StatusEnum, MapperEntities, Dto>, options?: {
60
- enableDatabaseBackup?: boolean;
61
- telemetry?: TelemetryOptions;
62
- } | undefined);
63
- createCheckoutSession(checkoutSessionDto: StripeCreateCheckoutSessionDto<StatusEnum>, ...args: unknown[]): Promise<Dto['CheckoutSessionMapper']>;
64
- getCheckoutSession(idDto: IdDto): Promise<Dto['CheckoutSessionMapper']>;
65
- expireCheckoutSession({ id }: IdDto): Promise<void>;
66
- handleCheckoutSuccess({ id }: IdDto): Promise<void>;
67
- handleCheckoutFailure({ id }: IdDto): Promise<void>;
68
- }
69
-
70
- declare class StripePaymentLinkService<SchemaValidator extends AnySchemaValidator, StatusEnum, Entities extends StripePaymentLinkEntities<StatusEnum>, Dto extends StripePaymentLinkDtos<StatusEnum> = StripePaymentLinkDtos<StatusEnum>> implements PaymentLinkService<PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
71
- CreatePaymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>;
72
- UpdatePaymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>;
73
- PaymentLinkDto: StripePaymentLinkDto<StatusEnum>;
74
- IdDto: IdDto;
75
- IdsDto: IdsDto;
76
- }> {
77
- readonly options?: {
78
- enableDatabaseBackup?: boolean;
79
- telemetry?: TelemetryOptions;
80
- } | undefined;
81
- basePaymentLinkService: BasePaymentLinkService<SchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, Entities, Dto>;
82
- protected readonly stripeClient: Stripe;
83
- protected readonly em: EntityManager;
84
- protected readonly cache: TtlCache;
85
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
86
- protected readonly schemaValidator: SchemaValidator;
87
- protected readonly mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>;
88
- constructor(stripeClient: Stripe, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>, options?: {
89
- enableDatabaseBackup?: boolean;
90
- telemetry?: TelemetryOptions;
91
- } | undefined);
92
- createPaymentLink(paymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>, ...args: unknown[]): Promise<Dto['PaymentLinkMapper']>;
93
- updatePaymentLink(paymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>, ...args: unknown[]): Promise<Dto['PaymentLinkMapper']>;
94
- getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
95
- expirePaymentLink({ id }: IdDto): Promise<void>;
96
- handlePaymentSuccess({ id }: IdDto): Promise<void>;
97
- handlePaymentFailure({ id }: IdDto): Promise<void>;
98
- listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
99
- }
100
-
101
- declare class StripePlanService<SchemaValidator extends AnySchemaValidator, Entities extends StripePlanEntities, Dto extends StripePlanDtos = StripePlanDtos> implements PlanService<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum, {
102
- CreatePlanDto: StripeCreatePlanDto;
103
- UpdatePlanDto: StripeUpdatePlanDto;
104
- PlanDto: StripePlanDto;
105
- IdDto: IdDto;
106
- IdsDto: IdsDto;
107
- }> {
108
- readonly options?: {
109
- telemetry?: TelemetryOptions;
110
- databaseTableName?: string;
111
- } | undefined;
112
- basePlanService: BasePlanService<SchemaValidator, PlanCadenceEnum, CurrencyEnum, BillingProviderEnum, Entities, Dto>;
113
- protected readonly stripeClient: Stripe;
114
- protected readonly em: EntityManager;
115
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
116
- protected readonly schemaValidator: SchemaValidator;
117
- protected readonly mappers: StripePlanMappers<Entities, Dto>;
118
- constructor(stripeClient: Stripe, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripePlanMappers<Entities, Dto>, options?: {
119
- telemetry?: TelemetryOptions;
120
- databaseTableName?: string;
121
- } | undefined);
122
- createPlan(planDto: StripeCreatePlanDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
123
- getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
124
- updatePlan(planDto: StripeUpdatePlanDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
125
- deletePlan(idDto: IdDto, em?: EntityManager): Promise<void>;
126
- listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
127
- }
128
-
129
- declare class StripeSubscriptionService<SchemaValidator extends AnySchemaValidator, PartyType, Entities extends StripeSubscriptionEntities<PartyType>, Dto extends StripeSubscriptionDtos<PartyType> = StripeSubscriptionDtos<PartyType>> implements SubscriptionService<PartyType, typeof BillingProviderEnum, {
130
- CreateSubscriptionDto: StripeCreateSubscriptionDto<PartyType>;
131
- UpdateSubscriptionDto: StripeUpdateSubscriptionDto<PartyType>;
132
- SubscriptionDto: StripeSubscriptionDto<PartyType>;
133
- IdDto: IdDto;
134
- IdsDto: IdsDto;
135
- }> {
136
- readonly options?: {
137
- telemetry?: TelemetryOptions;
138
- databaseTableName?: string;
139
- } | undefined;
140
- baseSubscriptionService: BaseSubscriptionService<SchemaValidator, PartyType, BillingProviderEnum, Entities, Dto>;
141
- protected readonly stripeClient: Stripe;
142
- protected readonly em: EntityManager;
143
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
144
- protected readonly schemaValidator: SchemaValidator;
145
- protected readonly mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>;
146
- constructor(stripeClient: Stripe, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>, options?: {
147
- telemetry?: TelemetryOptions;
148
- databaseTableName?: string;
149
- } | undefined);
150
- createSubscription(subscriptionDto: StripeCreateSubscriptionDto<PartyType>, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
151
- getSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
152
- getUserSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
153
- getOrganizationSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
154
- updateSubscription(subscriptionDto: StripeUpdateSubscriptionDto<PartyType> & IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
155
- deleteSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
156
- listSubscriptions(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['SubscriptionMapper'][]>;
157
- cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
158
- resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
159
- }
160
-
161
- declare class StripeWebhookService<SchemaValidator extends AnySchemaValidator, StatusEnum, PartyEnum, BillingPortalEntities extends StripeBillingPortalEntities = StripeBillingPortalEntities, CheckoutSessionEntities extends StripeCheckoutSessionEntities<StatusEnum> = StripeCheckoutSessionEntities<StatusEnum>, PaymentLinkEntities extends StripePaymentLinkEntities<StatusEnum> = StripePaymentLinkEntities<StatusEnum>, PlanEntities extends StripePlanEntities = StripePlanEntities, SubscriptionEntities extends StripeSubscriptionEntities<PartyEnum> = StripeSubscriptionEntities<PartyEnum>> {
162
- protected readonly partyEnum: PartyEnum;
163
- protected readonly stripeClient: Stripe;
164
- protected readonly em: EntityManager;
165
- protected readonly schemaValidator: SchemaValidator;
166
- protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
167
- protected readonly billingPortalService: StripeBillingPortalService<SchemaValidator, BillingPortalEntities>;
168
- protected readonly checkoutSessionService: StripeCheckoutSessionService<SchemaValidator, StatusEnum, CheckoutSessionEntities>;
169
- protected readonly paymentLinkService: StripePaymentLinkService<SchemaValidator, StatusEnum, PaymentLinkEntities>;
170
- protected readonly planService: StripePlanService<SchemaValidator, PlanEntities>;
171
- protected readonly subscriptionService: StripeSubscriptionService<SchemaValidator, PartyEnum, SubscriptionEntities>;
172
- constructor(stripeClient: Stripe, em: EntityManager, schemaValidator: SchemaValidator, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, billingPortalService: StripeBillingPortalService<SchemaValidator, BillingPortalEntities>, checkoutSessionService: StripeCheckoutSessionService<SchemaValidator, StatusEnum, CheckoutSessionEntities>, paymentLinkService: StripePaymentLinkService<SchemaValidator, StatusEnum, PaymentLinkEntities>, planService: StripePlanService<SchemaValidator, PlanEntities>, subscriptionService: StripeSubscriptionService<SchemaValidator, PartyEnum, SubscriptionEntities>, partyEnum: PartyEnum);
173
- /**
174
- * Resolve the party type for a subscription event.
175
- * Stripe subscriptions are customer-scoped — customers map to users
176
- * by default. Override this method to implement organization-level
177
- * subscriptions or other party resolution logic.
178
- */
179
- protected resolvePartyType(_event: Stripe.Event): PartyEnum[keyof PartyEnum];
180
- /**
181
- * Extract features from Stripe product metadata.
182
- * Features can be stored as:
183
- * - metadata.features: comma-separated string (e.g., "feature1,feature2,feature3")
184
- * - metadata.features: JSON array string (e.g., '["feature1","feature2"]')
185
- */
186
- private extractFeaturesFromProduct;
187
- handleWebhookEvent(event: Stripe.Event): Promise<void>;
188
- }
189
-
190
- export { StripeBillingPortalService, StripeCheckoutSessionService, StripePaymentLinkService, StripePlanService, StripeSubscriptionService, StripeWebhookService };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../services/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAElC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC"}
@@ -666,7 +666,7 @@ var Plan = (0, import_persistence.defineComplianceEntity)({
666
666
  externalId: import_persistence.fp.string().compliance("none"),
667
667
  cadence: import_persistence.fp.enum().compliance("none"),
668
668
  currency: import_persistence.fp.enum().compliance("none"),
669
- billingProvider: import_persistence.fp.enum().compliance("none"),
669
+ billingProvider: import_persistence.fp.enum().nullable().compliance("none"),
670
670
  providerFields: import_persistence.fp.json().compliance("pci")
671
671
  }
672
672
  });
@@ -677,7 +677,7 @@ var Subscription = (0, import_persistence.defineComplianceEntity)({
677
677
  partyId: import_persistence.fp.string().compliance("none"),
678
678
  externalId: import_persistence.fp.string().compliance("none"),
679
679
  partyType: import_persistence.fp.enum().compliance("none"),
680
- billingProvider: import_persistence.fp.enum().compliance("none"),
680
+ billingProvider: import_persistence.fp.enum().nullable().compliance("none"),
681
681
  active: import_persistence.fp.boolean().compliance("none"),
682
682
  providerFields: import_persistence.fp.json().compliance("pci")
683
683
  }
@@ -634,7 +634,7 @@ var Plan = defineComplianceEntity({
634
634
  externalId: fp.string().compliance("none"),
635
635
  cadence: fp.enum().compliance("none"),
636
636
  currency: fp.enum().compliance("none"),
637
- billingProvider: fp.enum().compliance("none"),
637
+ billingProvider: fp.enum().nullable().compliance("none"),
638
638
  providerFields: fp.json().compliance("pci")
639
639
  }
640
640
  });
@@ -645,7 +645,7 @@ var Subscription = defineComplianceEntity({
645
645
  partyId: fp.string().compliance("none"),
646
646
  externalId: fp.string().compliance("none"),
647
647
  partyType: fp.enum().compliance("none"),
648
- billingProvider: fp.enum().compliance("none"),
648
+ billingProvider: fp.enum().nullable().compliance("none"),
649
649
  active: fp.boolean().compliance("none"),
650
650
  providerFields: fp.json().compliance("pci")
651
651
  }
@@ -0,0 +1,43 @@
1
+ import { IdDto, IdsDto } from '@forklaunch/common';
2
+ import { TtlCache } from '@forklaunch/core/cache';
3
+ import { MetricsDefinition, OpenTelemetryCollector, TelemetryOptions } from '@forklaunch/core/http';
4
+ import { BasePaymentLinkService } from '@forklaunch/implementation-billing-base/services';
5
+ import { PaymentLinkService } from '@forklaunch/interfaces-billing/interfaces';
6
+ import { AnySchemaValidator } from '@forklaunch/validator';
7
+ import { EntityManager } from '@mikro-orm/core';
8
+ import Stripe from 'stripe';
9
+ import { CurrencyEnum, PaymentMethodEnum } from '../domain/enum';
10
+ import { StripePaymentLinkMappers } from '../domain/types/paymentLink.mapper.types';
11
+ import { StripeCreatePaymentLinkDto, StripePaymentLinkDto, StripePaymentLinkDtos, StripeUpdatePaymentLinkDto } from '../domain/types/stripe.dto.types';
12
+ import { StripePaymentLinkEntities } from '../domain/types/stripe.entity.types';
13
+ export declare class StripePaymentLinkService<SchemaValidator extends AnySchemaValidator, StatusEnum, Entities extends StripePaymentLinkEntities<StatusEnum>, Dto extends StripePaymentLinkDtos<StatusEnum> = StripePaymentLinkDtos<StatusEnum>> implements PaymentLinkService<PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
14
+ CreatePaymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>;
15
+ UpdatePaymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>;
16
+ PaymentLinkDto: StripePaymentLinkDto<StatusEnum>;
17
+ IdDto: IdDto;
18
+ IdsDto: IdsDto;
19
+ }> {
20
+ readonly options?: {
21
+ enableDatabaseBackup?: boolean;
22
+ telemetry?: TelemetryOptions;
23
+ } | undefined;
24
+ basePaymentLinkService: BasePaymentLinkService<SchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, Entities, Dto>;
25
+ protected readonly stripeClient: Stripe;
26
+ protected readonly em: EntityManager;
27
+ protected readonly cache: TtlCache;
28
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
29
+ protected readonly schemaValidator: SchemaValidator;
30
+ protected readonly mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>;
31
+ constructor(stripeClient: Stripe, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>, options?: {
32
+ enableDatabaseBackup?: boolean;
33
+ telemetry?: TelemetryOptions;
34
+ } | undefined);
35
+ createPaymentLink(paymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>, ...args: unknown[]): Promise<Dto['PaymentLinkMapper']>;
36
+ updatePaymentLink(paymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>, ...args: unknown[]): Promise<Dto['PaymentLinkMapper']>;
37
+ getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
38
+ expirePaymentLink({ id }: IdDto): Promise<void>;
39
+ handlePaymentSuccess({ id }: IdDto): Promise<void>;
40
+ handlePaymentFailure({ id }: IdDto): Promise<void>;
41
+ listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
42
+ }
43
+ //# sourceMappingURL=paymentLink.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentLink.service.d.ts","sourceRoot":"","sources":["../../services/paymentLink.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAE1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,qB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/core/http';
3
+ import { BasePlanService } from '@forklaunch/implementation-billing-base/services';
4
+ import { PlanService } from '@forklaunch/interfaces-billing/interfaces';
5
+ import { AnySchemaValidator } from '@forklaunch/validator';
6
+ import { EntityManager } from '@mikro-orm/core';
7
+ import Stripe from 'stripe';
8
+ import { BillingProviderEnum } from '../domain/enum/billingProvider.enum';
9
+ import { CurrencyEnum } from '../domain/enum/currency.enum';
10
+ import { PlanCadenceEnum } from '../domain/enum/planCadence.enum';
11
+ import { StripePlanMappers } from '../domain/types/plan.mapper.types';
12
+ import { StripeCreatePlanDto, StripePlanDto, StripePlanDtos, StripeUpdatePlanDto } from '../domain/types/stripe.dto.types';
13
+ import { StripePlanEntities } from '../domain/types/stripe.entity.types';
14
+ export declare class StripePlanService<SchemaValidator extends AnySchemaValidator, Entities extends StripePlanEntities, Dto extends StripePlanDtos = StripePlanDtos> implements PlanService<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum, {
15
+ CreatePlanDto: StripeCreatePlanDto;
16
+ UpdatePlanDto: StripeUpdatePlanDto;
17
+ PlanDto: StripePlanDto;
18
+ IdDto: IdDto;
19
+ IdsDto: IdsDto;
20
+ }> {
21
+ readonly options?: {
22
+ telemetry?: TelemetryOptions;
23
+ databaseTableName?: string;
24
+ } | undefined;
25
+ basePlanService: BasePlanService<SchemaValidator, PlanCadenceEnum, CurrencyEnum, BillingProviderEnum, Entities, Dto>;
26
+ protected readonly stripeClient: Stripe;
27
+ protected readonly em: EntityManager;
28
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
29
+ protected readonly schemaValidator: SchemaValidator;
30
+ protected readonly mappers: StripePlanMappers<Entities, Dto>;
31
+ constructor(stripeClient: Stripe, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripePlanMappers<Entities, Dto>, options?: {
32
+ telemetry?: TelemetryOptions;
33
+ databaseTableName?: string;
34
+ } | undefined);
35
+ createPlan(planDto: StripeCreatePlanDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
36
+ getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
37
+ updatePlan(planDto: StripeUpdatePlanDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
38
+ deletePlan(idDto: IdDto, em?: EntityManager): Promise<void>;
39
+ listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
40
+ }
41
+ //# sourceMappingURL=plan.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.service.d.ts","sourceRoot":"","sources":["../../services/plan.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,qBAAa,iBAAiB,CAC5B,eAAe,SAAS,kBAAkB,EAC1C,QAAQ,SAAS,kBAAkB,EACn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O,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAyB5B;IAEK,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAU1E;IAEK,UAAU,CACd,OAAO,EAAE,mBAAmB,EAC5B,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAiD5B;IAEK,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhE;IAEK,SAAS,CACb,MAAM,CAAC,EAAE,MAAM,EACf,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CA6B9B;CACF"}
@@ -0,0 +1,43 @@
1
+ import { IdDto, IdsDto } from '@forklaunch/common';
2
+ import { MetricsDefinition, OpenTelemetryCollector, TelemetryOptions } from '@forklaunch/core/http';
3
+ import { BaseSubscriptionService } from '@forklaunch/implementation-billing-base/services';
4
+ import { SubscriptionService } from '@forklaunch/interfaces-billing/interfaces';
5
+ import { AnySchemaValidator } from '@forklaunch/validator';
6
+ import { EntityManager } from '@mikro-orm/core';
7
+ import Stripe from 'stripe';
8
+ import { BillingProviderEnum } from '../domain/enum/billingProvider.enum';
9
+ import { StripeCreateSubscriptionDto, StripeSubscriptionDto, StripeSubscriptionDtos, StripeUpdateSubscriptionDto } from '../domain/types/stripe.dto.types';
10
+ import { StripeSubscriptionEntities } from '../domain/types/stripe.entity.types';
11
+ import { StripeSubscriptionMappers } from '../domain/types/subscription.mapper.types';
12
+ export declare class StripeSubscriptionService<SchemaValidator extends AnySchemaValidator, PartyType, Entities extends StripeSubscriptionEntities<PartyType>, Dto extends StripeSubscriptionDtos<PartyType> = StripeSubscriptionDtos<PartyType>> implements SubscriptionService<PartyType, typeof BillingProviderEnum, {
13
+ CreateSubscriptionDto: StripeCreateSubscriptionDto<PartyType>;
14
+ UpdateSubscriptionDto: StripeUpdateSubscriptionDto<PartyType>;
15
+ SubscriptionDto: StripeSubscriptionDto<PartyType>;
16
+ IdDto: IdDto;
17
+ IdsDto: IdsDto;
18
+ }> {
19
+ readonly options?: {
20
+ telemetry?: TelemetryOptions;
21
+ databaseTableName?: string;
22
+ } | undefined;
23
+ baseSubscriptionService: BaseSubscriptionService<SchemaValidator, PartyType, BillingProviderEnum, Entities, Dto>;
24
+ protected readonly stripeClient: Stripe;
25
+ protected readonly em: EntityManager;
26
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
27
+ protected readonly schemaValidator: SchemaValidator;
28
+ protected readonly mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>;
29
+ constructor(stripeClient: Stripe, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>, options?: {
30
+ telemetry?: TelemetryOptions;
31
+ databaseTableName?: string;
32
+ } | undefined);
33
+ createSubscription(subscriptionDto: StripeCreateSubscriptionDto<PartyType>, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
34
+ getSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
35
+ getUserSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
36
+ getOrganizationSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
37
+ updateSubscription(subscriptionDto: StripeUpdateSubscriptionDto<PartyType> & IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
38
+ deleteSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
39
+ listSubscriptions(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['SubscriptionMapper'][]>;
40
+ cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
41
+ resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
42
+ }
43
+ //# sourceMappingURL=subscription.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.service.d.ts","sourceRoot":"","sources":["../../services/subscription.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAE3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,qBAAa,yBAAyB,CACpC,eAAe,SAAS,kBAAkB,EAC1C,SAAS,EACT,QAAQ,SAAS,0BAA0B,CAAC,SAAS,CAAC,EACtD,GAAG,SACD,sBAAsB,CAAC,SAAS,CAAC,GAAG,sBAAsB,CAAC,SAAS,CAAC,CACvE,YACE,mBAAmB,CACjB,SAAS,EACT,OAAO,mBAAmB,EAC1B;IACE,qBAAqB,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAC9D,qBAAqB,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAC9D,eAAe,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC;IACb,MAA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EACZ,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAWpC;IAEK,2BAA2B,CAC/B,KAAK,EAAE,KAAK,EACZ,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAWpC;IAEK,kBAAkB,CACtB,eAAe,EAAE,2BAA2B,CAAC,SAAS,CAAC,GAAG,KAAK,EAC/D,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAyCpC;IAEK,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;IAEK,iBAAiB,CACrB,MAAM,CAAC,EAAE,MAAM,EACf,EAAE,CAAC,EAAE,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC,CA4BtC;IAEK,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;IAEK,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;CACF"}
@@ -0,0 +1,39 @@
1
+ import { MetricsDefinition, OpenTelemetryCollector } from '@forklaunch/core/http';
2
+ import { AnySchemaValidator } from '@forklaunch/validator';
3
+ import { EntityManager } from '@mikro-orm/core';
4
+ import Stripe from 'stripe';
5
+ import { StripeBillingPortalEntities, StripeCheckoutSessionEntities, StripePaymentLinkEntities, StripePlanEntities, StripeSubscriptionEntities } from '../domain/types/stripe.entity.types';
6
+ import { StripeBillingPortalService } from './billingPortal.service';
7
+ import { StripeCheckoutSessionService } from './checkoutSession.service';
8
+ import { StripePaymentLinkService } from './paymentLink.service';
9
+ import { StripePlanService } from './plan.service';
10
+ import { StripeSubscriptionService } from './subscription.service';
11
+ export declare class StripeWebhookService<SchemaValidator extends AnySchemaValidator, StatusEnum, PartyEnum, BillingPortalEntities extends StripeBillingPortalEntities = StripeBillingPortalEntities, CheckoutSessionEntities extends StripeCheckoutSessionEntities<StatusEnum> = StripeCheckoutSessionEntities<StatusEnum>, PaymentLinkEntities extends StripePaymentLinkEntities<StatusEnum> = StripePaymentLinkEntities<StatusEnum>, PlanEntities extends StripePlanEntities = StripePlanEntities, SubscriptionEntities extends StripeSubscriptionEntities<PartyEnum> = StripeSubscriptionEntities<PartyEnum>> {
12
+ protected readonly partyEnum: PartyEnum;
13
+ protected readonly stripeClient: Stripe;
14
+ protected readonly em: EntityManager;
15
+ protected readonly schemaValidator: SchemaValidator;
16
+ protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
17
+ protected readonly billingPortalService: StripeBillingPortalService<SchemaValidator, BillingPortalEntities>;
18
+ protected readonly checkoutSessionService: StripeCheckoutSessionService<SchemaValidator, StatusEnum, CheckoutSessionEntities>;
19
+ protected readonly paymentLinkService: StripePaymentLinkService<SchemaValidator, StatusEnum, PaymentLinkEntities>;
20
+ protected readonly planService: StripePlanService<SchemaValidator, PlanEntities>;
21
+ protected readonly subscriptionService: StripeSubscriptionService<SchemaValidator, PartyEnum, SubscriptionEntities>;
22
+ constructor(stripeClient: Stripe, em: EntityManager, schemaValidator: SchemaValidator, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, billingPortalService: StripeBillingPortalService<SchemaValidator, BillingPortalEntities>, checkoutSessionService: StripeCheckoutSessionService<SchemaValidator, StatusEnum, CheckoutSessionEntities>, paymentLinkService: StripePaymentLinkService<SchemaValidator, StatusEnum, PaymentLinkEntities>, planService: StripePlanService<SchemaValidator, PlanEntities>, subscriptionService: StripeSubscriptionService<SchemaValidator, PartyEnum, SubscriptionEntities>, partyEnum: PartyEnum);
23
+ /**
24
+ * Resolve the party type for a subscription event.
25
+ * Stripe subscriptions are customer-scoped — customers map to users
26
+ * by default. Override this method to implement organization-level
27
+ * subscriptions or other party resolution logic.
28
+ */
29
+ protected resolvePartyType(_event: Stripe.Event): PartyEnum[keyof PartyEnum];
30
+ /**
31
+ * Extract features from Stripe product metadata.
32
+ * Features can be stored as:
33
+ * - metadata.features: comma-separated string (e.g., "feature1,feature2,feature3")
34
+ * - metadata.features: JSON array string (e.g., '["feature1","feature2"]')
35
+ */
36
+ private extractFeaturesFromProduct;
37
+ handleWebhookEvent(event: Stripe.Event): Promise<void>;
38
+ }
39
+ //# sourceMappingURL=webhook.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.service.d.ts","sourceRoot":"","sources":["../../services/webhook.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAK5B,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,qBAAa,oBAAoB,CAC/B,eAAe,SAAS,kBAAkB,EAC1C,UAAU,EACV,SAAS,EACT,qBAAqB,SACnB,2BAA2B,GAAG,2BAA2B,EAC3D,uBAAuB,SACrB,6BAA6B,CAAC,UAAU,CAAC,GAAG,6BAA6B,CAAC,UA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