@forklaunch/implementation-billing-stripe 0.3.0 → 0.3.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.
- package/lib/domain/enum/index.d.mts +112 -119
- package/lib/domain/enum/index.d.ts +112 -119
- package/lib/domain/enum/index.js +119 -124
- package/lib/domain/enum/index.mjs +109 -109
- package/lib/domain/schemas/index.d.mts +323 -2908
- package/lib/domain/schemas/index.d.ts +323 -2908
- package/lib/domain/schemas/index.js +187 -257
- package/lib/domain/schemas/index.mjs +136 -131
- package/lib/domain/types/index.d.mts +135 -373
- package/lib/domain/types/index.d.ts +135 -373
- package/lib/domain/types/index.js +4 -8
- package/lib/eject/domain/schemas/checkoutSession.schema.ts +3 -0
- package/lib/eject/domain/types/stripe.dto.types.ts +4 -2
- package/lib/services/index.d.mts +148 -461
- package/lib/services/index.d.ts +148 -461
- package/lib/services/index.js +131 -229
- package/lib/services/index.mjs +103 -194
- package/package.json +9 -9
package/lib/services/index.d.mts
CHANGED
|
@@ -1,490 +1,177 @@
|
|
|
1
1
|
import { IdDto, IdsDto } from '@forklaunch/common';
|
|
2
2
|
import { TtlCache } from '@forklaunch/core/cache';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
MetricsDefinition
|
|
7
|
-
} from '@forklaunch/core/http';
|
|
8
|
-
import {
|
|
9
|
-
BaseBillingPortalService,
|
|
10
|
-
BaseCheckoutSessionService,
|
|
11
|
-
BasePaymentLinkService,
|
|
12
|
-
BasePlanService,
|
|
13
|
-
BaseSubscriptionService
|
|
14
|
-
} from '@forklaunch/implementation-billing-base/services';
|
|
15
|
-
import {
|
|
16
|
-
BillingPortalService,
|
|
17
|
-
CheckoutSessionService,
|
|
18
|
-
PaymentLinkService,
|
|
19
|
-
PlanService,
|
|
20
|
-
SubscriptionService
|
|
21
|
-
} from '@forklaunch/interfaces-billing/interfaces';
|
|
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';
|
|
22
6
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
23
7
|
import { EntityManager } from '@mikro-orm/core';
|
|
24
8
|
import stripe__default from 'stripe';
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
StripeBillingPortalDtos,
|
|
28
|
-
StripeBillingPortalMappers,
|
|
29
|
-
StripeCreateBillingPortalDto,
|
|
30
|
-
StripeUpdateBillingPortalDto,
|
|
31
|
-
StripeCheckoutSessionEntities,
|
|
32
|
-
StripeCheckoutSessionDtos,
|
|
33
|
-
StripeCheckoutSessionMappers,
|
|
34
|
-
StripeCreateCheckoutSessionDto,
|
|
35
|
-
StripePaymentLinkEntities,
|
|
36
|
-
StripePaymentLinkDtos,
|
|
37
|
-
StripeCreatePaymentLinkDto,
|
|
38
|
-
StripeUpdatePaymentLinkDto,
|
|
39
|
-
StripePaymentLinkDto,
|
|
40
|
-
StripePaymentLinkMappers,
|
|
41
|
-
StripePlanEntities,
|
|
42
|
-
StripePlanDtos,
|
|
43
|
-
StripeCreatePlanDto,
|
|
44
|
-
StripeUpdatePlanDto,
|
|
45
|
-
StripePlanDto,
|
|
46
|
-
StripePlanMappers,
|
|
47
|
-
StripeSubscriptionEntities,
|
|
48
|
-
StripeSubscriptionDtos,
|
|
49
|
-
StripeCreateSubscriptionDto,
|
|
50
|
-
StripeUpdateSubscriptionDto,
|
|
51
|
-
StripeSubscriptionDto,
|
|
52
|
-
StripeSubscriptionMappers
|
|
53
|
-
} from '../domain/types/index.mjs';
|
|
54
|
-
import {
|
|
55
|
-
PaymentMethodEnum,
|
|
56
|
-
CurrencyEnum,
|
|
57
|
-
PlanCadenceEnum,
|
|
58
|
-
BillingProviderEnum
|
|
59
|
-
} from '../domain/enum/index.mjs';
|
|
9
|
+
import { StripeBillingPortalEntities, StripeBillingPortalDtos, StripeBillingPortalMappers, StripeCreateBillingPortalDto, StripeUpdateBillingPortalDto, StripeCheckoutSessionEntities, StripeCheckoutSessionDtos, StripeCheckoutSessionMappers, StripeCreateCheckoutSessionDto, StripePaymentLinkEntities, StripePaymentLinkDtos, StripeCreatePaymentLinkDto, StripeUpdatePaymentLinkDto, StripePaymentLinkDto, StripePaymentLinkMappers, StripePlanEntities, StripePlanDtos, StripeCreatePlanDto, StripeUpdatePlanDto, StripePlanDto, StripePlanMappers, StripeSubscriptionEntities, StripeSubscriptionDtos, StripeCreateSubscriptionDto, StripeUpdateSubscriptionDto, StripeSubscriptionDto, StripeSubscriptionMappers } from '../domain/types/index.mjs';
|
|
10
|
+
import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../domain/enum/index.mjs';
|
|
60
11
|
import '@forklaunch/interfaces-billing/types';
|
|
61
12
|
|
|
62
|
-
declare class StripeBillingPortalService<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
UpdateBillingPortalDto: Dto['UpdateBillingPortalMapper'];
|
|
70
|
-
BillingPortalDto: Dto['BillingPortalMapper'];
|
|
71
|
-
IdDto: IdDto;
|
|
72
|
-
}>
|
|
73
|
-
{
|
|
74
|
-
readonly options?:
|
|
75
|
-
| {
|
|
13
|
+
declare class StripeBillingPortalService<SchemaValidator extends AnySchemaValidator, Entities extends StripeBillingPortalEntities, Dto extends StripeBillingPortalDtos = StripeBillingPortalDtos> implements BillingPortalService<{
|
|
14
|
+
CreateBillingPortalDto: Dto['CreateBillingPortalMapper'];
|
|
15
|
+
UpdateBillingPortalDto: Dto['UpdateBillingPortalMapper'];
|
|
16
|
+
BillingPortalDto: Dto['BillingPortalMapper'];
|
|
17
|
+
IdDto: IdDto;
|
|
18
|
+
}> {
|
|
19
|
+
readonly options?: {
|
|
76
20
|
enableDatabaseBackup?: boolean;
|
|
77
21
|
telemetry?: TelemetryOptions;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
cache: TtlCache,
|
|
96
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
97
|
-
schemaValidator: SchemaValidator,
|
|
98
|
-
mappers: StripeBillingPortalMappers<Entities, Dto>,
|
|
99
|
-
options?:
|
|
100
|
-
| {
|
|
101
|
-
enableDatabaseBackup?: boolean;
|
|
102
|
-
telemetry?: TelemetryOptions;
|
|
103
|
-
}
|
|
104
|
-
| undefined
|
|
105
|
-
);
|
|
106
|
-
createBillingPortalSession(
|
|
107
|
-
billingPortalDto: StripeCreateBillingPortalDto,
|
|
108
|
-
...args: unknown[]
|
|
109
|
-
): Promise<Dto['BillingPortalMapper']>;
|
|
110
|
-
getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
|
|
111
|
-
expireBillingPortalSession(idDto: IdDto): Promise<void>;
|
|
112
|
-
updateBillingPortalSession(
|
|
113
|
-
billingPortalDto: StripeUpdateBillingPortalDto,
|
|
114
|
-
...args: unknown[]
|
|
115
|
-
): Promise<Dto['BillingPortalMapper']>;
|
|
22
|
+
} | undefined;
|
|
23
|
+
baseBillingPortalService: BaseBillingPortalService<SchemaValidator, Entities, Dto>;
|
|
24
|
+
protected readonly stripeClient: stripe__default;
|
|
25
|
+
protected readonly em: EntityManager;
|
|
26
|
+
protected readonly cache: TtlCache;
|
|
27
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
28
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
29
|
+
private readonly billingPortalSessionExpiryDurationMs;
|
|
30
|
+
protected readonly mappers: StripeBillingPortalMappers<Entities, Dto>;
|
|
31
|
+
constructor(stripeClient: stripe__default, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeBillingPortalMappers<Entities, Dto>, options?: {
|
|
32
|
+
enableDatabaseBackup?: boolean;
|
|
33
|
+
telemetry?: TelemetryOptions;
|
|
34
|
+
} | undefined);
|
|
35
|
+
createBillingPortalSession(billingPortalDto: StripeCreateBillingPortalDto, ...args: unknown[]): Promise<Dto['BillingPortalMapper']>;
|
|
36
|
+
getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
|
|
37
|
+
expireBillingPortalSession(idDto: IdDto): Promise<void>;
|
|
38
|
+
updateBillingPortalSession(billingPortalDto: StripeUpdateBillingPortalDto, ...args: unknown[]): Promise<Dto['BillingPortalMapper']>;
|
|
116
39
|
}
|
|
117
40
|
|
|
118
|
-
declare class StripeCheckoutSessionService<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
> implements
|
|
125
|
-
CheckoutSessionService<
|
|
126
|
-
typeof PaymentMethodEnum,
|
|
127
|
-
typeof CurrencyEnum,
|
|
128
|
-
StatusEnum,
|
|
129
|
-
{
|
|
130
|
-
CreateCheckoutSessionDto: Dto['CreateCheckoutSessionMapper'];
|
|
131
|
-
CheckoutSessionDto: Dto['CheckoutSessionMapper'];
|
|
132
|
-
IdDto: IdDto;
|
|
133
|
-
}
|
|
134
|
-
>
|
|
135
|
-
{
|
|
136
|
-
readonly options?:
|
|
137
|
-
| {
|
|
41
|
+
declare class StripeCheckoutSessionService<SchemaValidator extends AnySchemaValidator, StatusEnum, Entities extends StripeCheckoutSessionEntities<StatusEnum>, Dto extends StripeCheckoutSessionDtos<StatusEnum> = StripeCheckoutSessionDtos<StatusEnum>> implements CheckoutSessionService<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
|
|
42
|
+
CreateCheckoutSessionDto: Dto['CreateCheckoutSessionMapper'];
|
|
43
|
+
CheckoutSessionDto: Dto['CheckoutSessionMapper'];
|
|
44
|
+
IdDto: IdDto;
|
|
45
|
+
}> {
|
|
46
|
+
readonly options?: {
|
|
138
47
|
enableDatabaseBackup?: boolean;
|
|
139
48
|
telemetry?: TelemetryOptions;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Entities,
|
|
148
|
-
Dto
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
Entities,
|
|
158
|
-
Dto
|
|
159
|
-
>;
|
|
160
|
-
constructor(
|
|
161
|
-
stripeClient: stripe__default,
|
|
162
|
-
em: EntityManager,
|
|
163
|
-
cache: TtlCache,
|
|
164
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
165
|
-
schemaValidator: SchemaValidator,
|
|
166
|
-
mappers: StripeCheckoutSessionMappers<StatusEnum, Entities, Dto>,
|
|
167
|
-
options?:
|
|
168
|
-
| {
|
|
169
|
-
enableDatabaseBackup?: boolean;
|
|
170
|
-
telemetry?: TelemetryOptions;
|
|
171
|
-
}
|
|
172
|
-
| undefined
|
|
173
|
-
);
|
|
174
|
-
createCheckoutSession(
|
|
175
|
-
checkoutSessionDto: StripeCreateCheckoutSessionDto<StatusEnum>,
|
|
176
|
-
...args: unknown[]
|
|
177
|
-
): Promise<Dto['CheckoutSessionMapper']>;
|
|
178
|
-
getCheckoutSession(idDto: IdDto): Promise<Dto['CheckoutSessionMapper']>;
|
|
179
|
-
expireCheckoutSession({ id }: IdDto): Promise<void>;
|
|
180
|
-
handleCheckoutSuccess({ id }: IdDto): Promise<void>;
|
|
181
|
-
handleCheckoutFailure({ id }: IdDto): Promise<void>;
|
|
49
|
+
} | undefined;
|
|
50
|
+
baseCheckoutSessionService: BaseCheckoutSessionService<SchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, Entities, Dto>;
|
|
51
|
+
protected readonly stripeClient: stripe__default;
|
|
52
|
+
protected readonly em: EntityManager;
|
|
53
|
+
protected readonly cache: TtlCache;
|
|
54
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
55
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
56
|
+
protected readonly mappers: StripeCheckoutSessionMappers<StatusEnum, Entities, Dto>;
|
|
57
|
+
constructor(stripeClient: stripe__default, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeCheckoutSessionMappers<StatusEnum, Entities, Dto>, options?: {
|
|
58
|
+
enableDatabaseBackup?: boolean;
|
|
59
|
+
telemetry?: TelemetryOptions;
|
|
60
|
+
} | undefined);
|
|
61
|
+
createCheckoutSession(checkoutSessionDto: StripeCreateCheckoutSessionDto<StatusEnum>, ...args: unknown[]): Promise<Dto['CheckoutSessionMapper']>;
|
|
62
|
+
getCheckoutSession(idDto: IdDto): Promise<Dto['CheckoutSessionMapper']>;
|
|
63
|
+
expireCheckoutSession({ id }: IdDto): Promise<void>;
|
|
64
|
+
handleCheckoutSuccess({ id }: IdDto): Promise<void>;
|
|
65
|
+
handleCheckoutFailure({ id }: IdDto): Promise<void>;
|
|
182
66
|
}
|
|
183
67
|
|
|
184
|
-
declare class StripePaymentLinkService<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
{
|
|
204
|
-
readonly options?:
|
|
205
|
-
| {
|
|
68
|
+
declare class StripePaymentLinkService<SchemaValidator extends AnySchemaValidator, StatusEnum, Entities extends StripePaymentLinkEntities<StatusEnum>, Dto extends StripePaymentLinkDtos<StatusEnum> = StripePaymentLinkDtos<StatusEnum>> implements PaymentLinkService<PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
|
|
69
|
+
CreatePaymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>;
|
|
70
|
+
UpdatePaymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>;
|
|
71
|
+
PaymentLinkDto: StripePaymentLinkDto<StatusEnum>;
|
|
72
|
+
IdDto: IdDto;
|
|
73
|
+
IdsDto: IdsDto;
|
|
74
|
+
}> {
|
|
75
|
+
readonly options?: {
|
|
76
|
+
enableDatabaseBackup?: boolean;
|
|
77
|
+
telemetry?: TelemetryOptions;
|
|
78
|
+
} | undefined;
|
|
79
|
+
basePaymentLinkService: BasePaymentLinkService<SchemaValidator, PaymentMethodEnum, CurrencyEnum, StatusEnum, Entities, Dto>;
|
|
80
|
+
protected readonly stripeClient: stripe__default;
|
|
81
|
+
protected readonly em: EntityManager;
|
|
82
|
+
protected readonly cache: TtlCache;
|
|
83
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
84
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
85
|
+
protected readonly mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>;
|
|
86
|
+
constructor(stripeClient: stripe__default, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>, options?: {
|
|
206
87
|
enableDatabaseBackup?: boolean;
|
|
207
88
|
telemetry?: TelemetryOptions;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
Dto
|
|
217
|
-
>;
|
|
218
|
-
protected readonly stripeClient: stripe__default;
|
|
219
|
-
protected readonly em: EntityManager;
|
|
220
|
-
protected readonly cache: TtlCache;
|
|
221
|
-
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
222
|
-
protected readonly schemaValidator: SchemaValidator;
|
|
223
|
-
protected readonly mappers: StripePaymentLinkMappers<
|
|
224
|
-
StatusEnum,
|
|
225
|
-
Entities,
|
|
226
|
-
Dto
|
|
227
|
-
>;
|
|
228
|
-
constructor(
|
|
229
|
-
stripeClient: stripe__default,
|
|
230
|
-
em: EntityManager,
|
|
231
|
-
cache: TtlCache,
|
|
232
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
233
|
-
schemaValidator: SchemaValidator,
|
|
234
|
-
mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>,
|
|
235
|
-
options?:
|
|
236
|
-
| {
|
|
237
|
-
enableDatabaseBackup?: boolean;
|
|
238
|
-
telemetry?: TelemetryOptions;
|
|
239
|
-
}
|
|
240
|
-
| undefined
|
|
241
|
-
);
|
|
242
|
-
createPaymentLink(
|
|
243
|
-
paymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>,
|
|
244
|
-
...args: unknown[]
|
|
245
|
-
): Promise<Dto['PaymentLinkMapper']>;
|
|
246
|
-
updatePaymentLink(
|
|
247
|
-
paymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>,
|
|
248
|
-
...args: unknown[]
|
|
249
|
-
): Promise<Dto['PaymentLinkMapper']>;
|
|
250
|
-
getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
|
|
251
|
-
expirePaymentLink({ id }: IdDto): Promise<void>;
|
|
252
|
-
handlePaymentSuccess({ id }: IdDto): Promise<void>;
|
|
253
|
-
handlePaymentFailure({ id }: IdDto): Promise<void>;
|
|
254
|
-
listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
|
|
89
|
+
} | undefined);
|
|
90
|
+
createPaymentLink(paymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>, ...args: unknown[]): Promise<Dto['PaymentLinkMapper']>;
|
|
91
|
+
updatePaymentLink(paymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>, ...args: unknown[]): Promise<Dto['PaymentLinkMapper']>;
|
|
92
|
+
getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
|
|
93
|
+
expirePaymentLink({ id }: IdDto): Promise<void>;
|
|
94
|
+
handlePaymentSuccess({ id }: IdDto): Promise<void>;
|
|
95
|
+
handlePaymentFailure({ id }: IdDto): Promise<void>;
|
|
96
|
+
listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
|
|
255
97
|
}
|
|
256
98
|
|
|
257
|
-
declare class StripePlanService<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
{
|
|
275
|
-
readonly options?:
|
|
276
|
-
| {
|
|
99
|
+
declare class StripePlanService<SchemaValidator extends AnySchemaValidator, Entities extends StripePlanEntities, Dto extends StripePlanDtos = StripePlanDtos> implements PlanService<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum, {
|
|
100
|
+
CreatePlanDto: StripeCreatePlanDto;
|
|
101
|
+
UpdatePlanDto: StripeUpdatePlanDto;
|
|
102
|
+
PlanDto: StripePlanDto;
|
|
103
|
+
IdDto: IdDto;
|
|
104
|
+
IdsDto: IdsDto;
|
|
105
|
+
}> {
|
|
106
|
+
readonly options?: {
|
|
107
|
+
telemetry?: TelemetryOptions;
|
|
108
|
+
databaseTableName?: string;
|
|
109
|
+
} | undefined;
|
|
110
|
+
basePlanService: BasePlanService<SchemaValidator, PlanCadenceEnum, CurrencyEnum, BillingProviderEnum, Entities, Dto>;
|
|
111
|
+
protected readonly stripeClient: stripe__default;
|
|
112
|
+
protected readonly em: EntityManager;
|
|
113
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
114
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
115
|
+
protected readonly mappers: StripePlanMappers<Entities, Dto>;
|
|
116
|
+
constructor(stripeClient: stripe__default, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripePlanMappers<Entities, Dto>, options?: {
|
|
277
117
|
telemetry?: TelemetryOptions;
|
|
278
118
|
databaseTableName?: string;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
Dto
|
|
288
|
-
>;
|
|
289
|
-
protected readonly stripeClient: stripe__default;
|
|
290
|
-
protected readonly em: EntityManager;
|
|
291
|
-
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
292
|
-
protected readonly schemaValidator: SchemaValidator;
|
|
293
|
-
protected readonly mappers: StripePlanMappers<Entities, Dto>;
|
|
294
|
-
constructor(
|
|
295
|
-
stripeClient: stripe__default,
|
|
296
|
-
em: EntityManager,
|
|
297
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
298
|
-
schemaValidator: SchemaValidator,
|
|
299
|
-
mappers: StripePlanMappers<Entities, Dto>,
|
|
300
|
-
options?:
|
|
301
|
-
| {
|
|
302
|
-
telemetry?: TelemetryOptions;
|
|
303
|
-
databaseTableName?: string;
|
|
304
|
-
}
|
|
305
|
-
| undefined
|
|
306
|
-
);
|
|
307
|
-
createPlan(
|
|
308
|
-
planDto: StripeCreatePlanDto,
|
|
309
|
-
em?: EntityManager
|
|
310
|
-
): Promise<Dto['PlanMapper']>;
|
|
311
|
-
getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
312
|
-
updatePlan(
|
|
313
|
-
planDto: StripeUpdatePlanDto,
|
|
314
|
-
em?: EntityManager
|
|
315
|
-
): Promise<Dto['PlanMapper']>;
|
|
316
|
-
deletePlan(
|
|
317
|
-
idDto: {
|
|
318
|
-
id: string;
|
|
319
|
-
},
|
|
320
|
-
em?: EntityManager
|
|
321
|
-
): Promise<void>;
|
|
322
|
-
listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
|
|
119
|
+
} | undefined);
|
|
120
|
+
createPlan(planDto: StripeCreatePlanDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
121
|
+
getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
122
|
+
updatePlan(planDto: StripeUpdatePlanDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
123
|
+
deletePlan(idDto: {
|
|
124
|
+
id: string;
|
|
125
|
+
}, em?: EntityManager): Promise<void>;
|
|
126
|
+
listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
|
|
323
127
|
}
|
|
324
128
|
|
|
325
|
-
declare class StripeSubscriptionService<
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
{
|
|
344
|
-
readonly options?:
|
|
345
|
-
| {
|
|
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__default;
|
|
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__default, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>, options?: {
|
|
346
147
|
telemetry?: TelemetryOptions;
|
|
347
148
|
databaseTableName?: string;
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
protected readonly schemaValidator: SchemaValidator;
|
|
361
|
-
protected readonly mappers: StripeSubscriptionMappers<
|
|
362
|
-
PartyType,
|
|
363
|
-
Entities,
|
|
364
|
-
Dto
|
|
365
|
-
>;
|
|
366
|
-
constructor(
|
|
367
|
-
stripeClient: stripe__default,
|
|
368
|
-
em: EntityManager,
|
|
369
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
370
|
-
schemaValidator: SchemaValidator,
|
|
371
|
-
mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>,
|
|
372
|
-
options?:
|
|
373
|
-
| {
|
|
374
|
-
telemetry?: TelemetryOptions;
|
|
375
|
-
databaseTableName?: string;
|
|
376
|
-
}
|
|
377
|
-
| undefined
|
|
378
|
-
);
|
|
379
|
-
createSubscription(
|
|
380
|
-
subscriptionDto: StripeCreateSubscriptionDto<PartyType>,
|
|
381
|
-
em?: EntityManager
|
|
382
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
383
|
-
getSubscription(
|
|
384
|
-
idDto: IdDto,
|
|
385
|
-
em?: EntityManager
|
|
386
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
387
|
-
getUserSubscription(
|
|
388
|
-
idDto: IdDto,
|
|
389
|
-
em?: EntityManager
|
|
390
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
391
|
-
getOrganizationSubscription(
|
|
392
|
-
idDto: IdDto,
|
|
393
|
-
em?: EntityManager
|
|
394
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
395
|
-
updateSubscription(
|
|
396
|
-
subscriptionDto: StripeUpdateSubscriptionDto<PartyType>,
|
|
397
|
-
em?: EntityManager
|
|
398
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
399
|
-
deleteSubscription(
|
|
400
|
-
idDto: {
|
|
401
|
-
id: string;
|
|
402
|
-
},
|
|
403
|
-
em?: EntityManager
|
|
404
|
-
): Promise<void>;
|
|
405
|
-
listSubscriptions(
|
|
406
|
-
idsDto: IdsDto,
|
|
407
|
-
em?: EntityManager
|
|
408
|
-
): Promise<Dto['SubscriptionMapper'][]>;
|
|
409
|
-
cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
410
|
-
resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
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>, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
|
|
155
|
+
deleteSubscription(idDto: {
|
|
156
|
+
id: string;
|
|
157
|
+
}, em?: EntityManager): Promise<void>;
|
|
158
|
+
listSubscriptions(idsDto: IdsDto, em?: EntityManager): Promise<Dto['SubscriptionMapper'][]>;
|
|
159
|
+
cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
160
|
+
resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
411
161
|
}
|
|
412
162
|
|
|
413
|
-
declare class StripeWebhookService<
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
StripeSubscriptionEntities<PartyEnum> = StripeSubscriptionEntities<PartyEnum>
|
|
426
|
-
> {
|
|
427
|
-
protected readonly stripeClient: stripe__default;
|
|
428
|
-
protected readonly em: EntityManager;
|
|
429
|
-
protected readonly schemaValidator: SchemaValidator;
|
|
430
|
-
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
431
|
-
protected readonly billingPortalService: StripeBillingPortalService<
|
|
432
|
-
SchemaValidator,
|
|
433
|
-
BillingPortalEntities
|
|
434
|
-
>;
|
|
435
|
-
protected readonly checkoutSessionService: StripeCheckoutSessionService<
|
|
436
|
-
SchemaValidator,
|
|
437
|
-
StatusEnum,
|
|
438
|
-
CheckoutSessionEntities
|
|
439
|
-
>;
|
|
440
|
-
protected readonly paymentLinkService: StripePaymentLinkService<
|
|
441
|
-
SchemaValidator,
|
|
442
|
-
StatusEnum,
|
|
443
|
-
PaymentLinkEntities
|
|
444
|
-
>;
|
|
445
|
-
protected readonly planService: StripePlanService<
|
|
446
|
-
SchemaValidator,
|
|
447
|
-
PlanEntities
|
|
448
|
-
>;
|
|
449
|
-
protected readonly subscriptionService: StripeSubscriptionService<
|
|
450
|
-
SchemaValidator,
|
|
451
|
-
PartyEnum,
|
|
452
|
-
SubscriptionEntities
|
|
453
|
-
>;
|
|
454
|
-
constructor(
|
|
455
|
-
stripeClient: stripe__default,
|
|
456
|
-
em: EntityManager,
|
|
457
|
-
schemaValidator: SchemaValidator,
|
|
458
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
459
|
-
billingPortalService: StripeBillingPortalService<
|
|
460
|
-
SchemaValidator,
|
|
461
|
-
BillingPortalEntities
|
|
462
|
-
>,
|
|
463
|
-
checkoutSessionService: StripeCheckoutSessionService<
|
|
464
|
-
SchemaValidator,
|
|
465
|
-
StatusEnum,
|
|
466
|
-
CheckoutSessionEntities
|
|
467
|
-
>,
|
|
468
|
-
paymentLinkService: StripePaymentLinkService<
|
|
469
|
-
SchemaValidator,
|
|
470
|
-
StatusEnum,
|
|
471
|
-
PaymentLinkEntities
|
|
472
|
-
>,
|
|
473
|
-
planService: StripePlanService<SchemaValidator, PlanEntities>,
|
|
474
|
-
subscriptionService: StripeSubscriptionService<
|
|
475
|
-
SchemaValidator,
|
|
476
|
-
PartyEnum,
|
|
477
|
-
SubscriptionEntities
|
|
478
|
-
>
|
|
479
|
-
);
|
|
480
|
-
handleWebhookEvent(event: stripe__default.Event): Promise<void>;
|
|
163
|
+
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>> {
|
|
164
|
+
protected readonly stripeClient: stripe__default;
|
|
165
|
+
protected readonly em: EntityManager;
|
|
166
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
167
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
168
|
+
protected readonly billingPortalService: StripeBillingPortalService<SchemaValidator, BillingPortalEntities>;
|
|
169
|
+
protected readonly checkoutSessionService: StripeCheckoutSessionService<SchemaValidator, StatusEnum, CheckoutSessionEntities>;
|
|
170
|
+
protected readonly paymentLinkService: StripePaymentLinkService<SchemaValidator, StatusEnum, PaymentLinkEntities>;
|
|
171
|
+
protected readonly planService: StripePlanService<SchemaValidator, PlanEntities>;
|
|
172
|
+
protected readonly subscriptionService: StripeSubscriptionService<SchemaValidator, PartyEnum, SubscriptionEntities>;
|
|
173
|
+
constructor(stripeClient: stripe__default, 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>);
|
|
174
|
+
handleWebhookEvent(event: stripe__default.Event): Promise<void>;
|
|
481
175
|
}
|
|
482
176
|
|
|
483
|
-
export {
|
|
484
|
-
StripeBillingPortalService,
|
|
485
|
-
StripeCheckoutSessionService,
|
|
486
|
-
StripePaymentLinkService,
|
|
487
|
-
StripePlanService,
|
|
488
|
-
StripeSubscriptionService,
|
|
489
|
-
StripeWebhookService
|
|
490
|
-
};
|
|
177
|
+
export { StripeBillingPortalService, StripeCheckoutSessionService, StripePaymentLinkService, StripePlanService, StripeSubscriptionService, StripeWebhookService };
|