@forklaunch/implementation-billing-stripe 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/domain/schemas/index.d.mts +46 -46
- package/lib/domain/schemas/index.d.ts +46 -46
- package/lib/domain/types/index.d.mts +163 -21
- package/lib/domain/types/index.d.ts +163 -21
- package/lib/eject/domain/types/billingPortal.mapper.types.ts +31 -0
- package/lib/eject/domain/types/checkoutSession.mapper.types.ts +32 -0
- package/lib/eject/domain/types/index.ts +5 -0
- package/lib/eject/domain/types/paymentLink.mapper.types.ts +32 -0
- package/lib/eject/domain/types/plan.mapper.types.ts +29 -0
- package/lib/eject/domain/types/subscription.mapper.types.ts +32 -0
- package/lib/eject/services/billingPortal.service.ts +49 -132
- package/lib/eject/services/checkoutSession.service.ts +47 -108
- package/lib/eject/services/paymentLink.service.ts +82 -136
- package/lib/eject/services/plan.service.ts +44 -105
- package/lib/eject/services/subscription.service.ts +74 -151
- package/lib/eject/services/webhook.service.ts +5 -12
- package/lib/services/index.d.mts +82 -330
- package/lib/services/index.d.ts +82 -330
- package/lib/services/index.js +188 -285
- package/lib/services/index.mjs +188 -290
- package/package.json +12 -12
package/lib/services/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IdDto,
|
|
1
|
+
import { IdDto, IdsDto } from '@forklaunch/common';
|
|
2
2
|
import { TtlCache } from '@forklaunch/core/cache';
|
|
3
3
|
import {
|
|
4
4
|
TelemetryOptions,
|
|
@@ -19,37 +19,37 @@ import {
|
|
|
19
19
|
PlanService,
|
|
20
20
|
SubscriptionService
|
|
21
21
|
} from '@forklaunch/interfaces-billing/interfaces';
|
|
22
|
-
import {
|
|
23
|
-
InternalMapper,
|
|
24
|
-
ResponseMapperConstructor,
|
|
25
|
-
RequestMapperConstructor
|
|
26
|
-
} from '@forklaunch/internal';
|
|
27
22
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
28
23
|
import { EntityManager } from '@mikro-orm/core';
|
|
29
|
-
import
|
|
24
|
+
import stripe__default from 'stripe';
|
|
30
25
|
import {
|
|
31
26
|
StripeBillingPortalEntities,
|
|
32
27
|
StripeBillingPortalDtos,
|
|
28
|
+
StripeBillingPortalMappers,
|
|
33
29
|
StripeCreateBillingPortalDto,
|
|
34
30
|
StripeUpdateBillingPortalDto,
|
|
35
|
-
StripeBillingPortalDto,
|
|
36
31
|
StripeCheckoutSessionEntities,
|
|
37
32
|
StripeCheckoutSessionDtos,
|
|
33
|
+
StripeCheckoutSessionMappers,
|
|
34
|
+
StripeCreateCheckoutSessionDto,
|
|
38
35
|
StripePaymentLinkEntities,
|
|
39
36
|
StripePaymentLinkDtos,
|
|
40
37
|
StripeCreatePaymentLinkDto,
|
|
41
38
|
StripeUpdatePaymentLinkDto,
|
|
42
39
|
StripePaymentLinkDto,
|
|
40
|
+
StripePaymentLinkMappers,
|
|
43
41
|
StripePlanEntities,
|
|
44
42
|
StripePlanDtos,
|
|
45
43
|
StripeCreatePlanDto,
|
|
46
44
|
StripeUpdatePlanDto,
|
|
47
45
|
StripePlanDto,
|
|
46
|
+
StripePlanMappers,
|
|
48
47
|
StripeSubscriptionEntities,
|
|
49
48
|
StripeSubscriptionDtos,
|
|
50
49
|
StripeCreateSubscriptionDto,
|
|
51
50
|
StripeUpdateSubscriptionDto,
|
|
52
|
-
StripeSubscriptionDto
|
|
51
|
+
StripeSubscriptionDto,
|
|
52
|
+
StripeSubscriptionMappers
|
|
53
53
|
} from '../domain/types/index.js';
|
|
54
54
|
import {
|
|
55
55
|
PaymentMethodEnum,
|
|
@@ -65,104 +65,53 @@ declare class StripeBillingPortalService<
|
|
|
65
65
|
Dto extends StripeBillingPortalDtos = StripeBillingPortalDtos
|
|
66
66
|
> implements
|
|
67
67
|
BillingPortalService<{
|
|
68
|
-
CreateBillingPortalDto:
|
|
69
|
-
UpdateBillingPortalDto:
|
|
70
|
-
BillingPortalDto:
|
|
68
|
+
CreateBillingPortalDto: Dto['CreateBillingPortalMapper'];
|
|
69
|
+
UpdateBillingPortalDto: Dto['UpdateBillingPortalMapper'];
|
|
70
|
+
BillingPortalDto: Dto['BillingPortalMapper'];
|
|
71
71
|
IdDto: IdDto;
|
|
72
72
|
}>
|
|
73
73
|
{
|
|
74
74
|
readonly options?:
|
|
75
75
|
| {
|
|
76
|
-
telemetry?: TelemetryOptions;
|
|
77
76
|
enableDatabaseBackup?: boolean;
|
|
77
|
+
telemetry?: TelemetryOptions;
|
|
78
78
|
}
|
|
79
79
|
| undefined;
|
|
80
|
-
private readonly billingPortalSessionExpiryDurationMs;
|
|
81
80
|
baseBillingPortalService: BaseBillingPortalService<
|
|
82
81
|
SchemaValidator,
|
|
83
82
|
Entities,
|
|
84
|
-
|
|
83
|
+
Dto
|
|
85
84
|
>;
|
|
86
|
-
protected
|
|
87
|
-
protected
|
|
88
|
-
protected
|
|
89
|
-
protected
|
|
90
|
-
protected
|
|
91
|
-
|
|
92
|
-
protected mappers:
|
|
93
|
-
BillingPortalMapper: ResponseMapperConstructor<
|
|
94
|
-
SchemaValidator,
|
|
95
|
-
Dto['BillingPortalMapper'],
|
|
96
|
-
Entities['BillingPortalMapper']
|
|
97
|
-
>;
|
|
98
|
-
CreateBillingPortalMapper: RequestMapperConstructor<
|
|
99
|
-
SchemaValidator,
|
|
100
|
-
Dto['CreateBillingPortalMapper'],
|
|
101
|
-
Entities['CreateBillingPortalMapper'],
|
|
102
|
-
(
|
|
103
|
-
dto: Dto['CreateBillingPortalMapper'],
|
|
104
|
-
em: EntityManager,
|
|
105
|
-
session: Stripe__default.BillingPortal.Session
|
|
106
|
-
) => Promise<Entities['CreateBillingPortalMapper']>
|
|
107
|
-
>;
|
|
108
|
-
UpdateBillingPortalMapper: RequestMapperConstructor<
|
|
109
|
-
SchemaValidator,
|
|
110
|
-
Dto['UpdateBillingPortalMapper'],
|
|
111
|
-
Entities['UpdateBillingPortalMapper'],
|
|
112
|
-
(
|
|
113
|
-
dto: Dto['UpdateBillingPortalMapper'],
|
|
114
|
-
em: EntityManager,
|
|
115
|
-
session: Stripe__default.BillingPortal.Session
|
|
116
|
-
) => Promise<Entities['UpdateBillingPortalMapper']>
|
|
117
|
-
>;
|
|
118
|
-
};
|
|
85
|
+
protected readonly stripeClient: stripe__default;
|
|
86
|
+
protected readonly em: EntityManager;
|
|
87
|
+
protected readonly cache: TtlCache;
|
|
88
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
89
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
90
|
+
private readonly billingPortalSessionExpiryDurationMs;
|
|
91
|
+
protected readonly mappers: StripeBillingPortalMappers<Entities, Dto>;
|
|
119
92
|
constructor(
|
|
120
|
-
stripeClient:
|
|
93
|
+
stripeClient: stripe__default,
|
|
121
94
|
em: EntityManager,
|
|
122
95
|
cache: TtlCache,
|
|
123
96
|
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
124
97
|
schemaValidator: SchemaValidator,
|
|
125
|
-
mappers:
|
|
126
|
-
BillingPortalMapper: ResponseMapperConstructor<
|
|
127
|
-
SchemaValidator,
|
|
128
|
-
Dto['BillingPortalMapper'],
|
|
129
|
-
Entities['BillingPortalMapper']
|
|
130
|
-
>;
|
|
131
|
-
CreateBillingPortalMapper: RequestMapperConstructor<
|
|
132
|
-
SchemaValidator,
|
|
133
|
-
Dto['CreateBillingPortalMapper'],
|
|
134
|
-
Entities['CreateBillingPortalMapper'],
|
|
135
|
-
(
|
|
136
|
-
dto: Dto['CreateBillingPortalMapper'],
|
|
137
|
-
em: EntityManager,
|
|
138
|
-
session: Stripe__default.BillingPortal.Session
|
|
139
|
-
) => Promise<Entities['CreateBillingPortalMapper']>
|
|
140
|
-
>;
|
|
141
|
-
UpdateBillingPortalMapper: RequestMapperConstructor<
|
|
142
|
-
SchemaValidator,
|
|
143
|
-
Dto['UpdateBillingPortalMapper'],
|
|
144
|
-
Entities['UpdateBillingPortalMapper'],
|
|
145
|
-
(
|
|
146
|
-
dto: Dto['UpdateBillingPortalMapper'],
|
|
147
|
-
em: EntityManager,
|
|
148
|
-
session: Stripe__default.BillingPortal.Session
|
|
149
|
-
) => Promise<Entities['UpdateBillingPortalMapper']>
|
|
150
|
-
>;
|
|
151
|
-
},
|
|
98
|
+
mappers: StripeBillingPortalMappers<Entities, Dto>,
|
|
152
99
|
options?:
|
|
153
100
|
| {
|
|
154
|
-
telemetry?: TelemetryOptions;
|
|
155
101
|
enableDatabaseBackup?: boolean;
|
|
102
|
+
telemetry?: TelemetryOptions;
|
|
156
103
|
}
|
|
157
104
|
| undefined
|
|
158
105
|
);
|
|
159
106
|
createBillingPortalSession(
|
|
160
|
-
billingPortalDto:
|
|
107
|
+
billingPortalDto: StripeCreateBillingPortalDto,
|
|
108
|
+
...args: unknown[]
|
|
161
109
|
): Promise<Dto['BillingPortalMapper']>;
|
|
162
110
|
getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
|
|
163
111
|
expireBillingPortalSession(idDto: IdDto): Promise<void>;
|
|
164
112
|
updateBillingPortalSession(
|
|
165
|
-
billingPortalDto:
|
|
113
|
+
billingPortalDto: StripeUpdateBillingPortalDto,
|
|
114
|
+
...args: unknown[]
|
|
166
115
|
): Promise<Dto['BillingPortalMapper']>;
|
|
167
116
|
}
|
|
168
117
|
|
|
@@ -192,78 +141,29 @@ declare class StripeCheckoutSessionService<
|
|
|
192
141
|
| undefined;
|
|
193
142
|
baseCheckoutSessionService: BaseCheckoutSessionService<
|
|
194
143
|
SchemaValidator,
|
|
195
|
-
|
|
196
|
-
|
|
144
|
+
PaymentMethodEnum,
|
|
145
|
+
CurrencyEnum,
|
|
197
146
|
StatusEnum,
|
|
198
147
|
Entities,
|
|
199
|
-
|
|
148
|
+
Dto
|
|
200
149
|
>;
|
|
201
|
-
protected
|
|
202
|
-
protected readonly stripeClient: Stripe__default;
|
|
150
|
+
protected readonly stripeClient: stripe__default;
|
|
203
151
|
protected readonly em: EntityManager;
|
|
204
152
|
protected readonly cache: TtlCache;
|
|
205
153
|
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
206
154
|
protected readonly schemaValidator: SchemaValidator;
|
|
207
|
-
protected readonly mappers:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
>;
|
|
213
|
-
CreateCheckoutSessionMapper: RequestMapperConstructor<
|
|
214
|
-
SchemaValidator,
|
|
215
|
-
Dto['CreateCheckoutSessionMapper'],
|
|
216
|
-
Entities['CreateCheckoutSessionMapper'],
|
|
217
|
-
(
|
|
218
|
-
dto: Dto['CreateCheckoutSessionMapper'],
|
|
219
|
-
em: EntityManager,
|
|
220
|
-
session: Stripe__default.Checkout.Session
|
|
221
|
-
) => Promise<Entities['CreateCheckoutSessionMapper']>
|
|
222
|
-
>;
|
|
223
|
-
UpdateCheckoutSessionMapper: RequestMapperConstructor<
|
|
224
|
-
SchemaValidator,
|
|
225
|
-
Dto['UpdateCheckoutSessionMapper'],
|
|
226
|
-
Entities['UpdateCheckoutSessionMapper'],
|
|
227
|
-
(
|
|
228
|
-
dto: Dto['UpdateCheckoutSessionMapper'],
|
|
229
|
-
em: EntityManager,
|
|
230
|
-
session: Stripe__default.Checkout.Session
|
|
231
|
-
) => Promise<Entities['UpdateCheckoutSessionMapper']>
|
|
232
|
-
>;
|
|
233
|
-
};
|
|
155
|
+
protected readonly mappers: StripeCheckoutSessionMappers<
|
|
156
|
+
StatusEnum,
|
|
157
|
+
Entities,
|
|
158
|
+
Dto
|
|
159
|
+
>;
|
|
234
160
|
constructor(
|
|
235
|
-
stripeClient:
|
|
161
|
+
stripeClient: stripe__default,
|
|
236
162
|
em: EntityManager,
|
|
237
163
|
cache: TtlCache,
|
|
238
164
|
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
239
165
|
schemaValidator: SchemaValidator,
|
|
240
|
-
mappers:
|
|
241
|
-
CheckoutSessionMapper: ResponseMapperConstructor<
|
|
242
|
-
SchemaValidator,
|
|
243
|
-
Dto['CheckoutSessionMapper'],
|
|
244
|
-
Entities['CheckoutSessionMapper']
|
|
245
|
-
>;
|
|
246
|
-
CreateCheckoutSessionMapper: RequestMapperConstructor<
|
|
247
|
-
SchemaValidator,
|
|
248
|
-
Dto['CreateCheckoutSessionMapper'],
|
|
249
|
-
Entities['CreateCheckoutSessionMapper'],
|
|
250
|
-
(
|
|
251
|
-
dto: Dto['CreateCheckoutSessionMapper'],
|
|
252
|
-
em: EntityManager,
|
|
253
|
-
session: Stripe__default.Checkout.Session
|
|
254
|
-
) => Promise<Entities['CreateCheckoutSessionMapper']>
|
|
255
|
-
>;
|
|
256
|
-
UpdateCheckoutSessionMapper: RequestMapperConstructor<
|
|
257
|
-
SchemaValidator,
|
|
258
|
-
Dto['UpdateCheckoutSessionMapper'],
|
|
259
|
-
Entities['UpdateCheckoutSessionMapper'],
|
|
260
|
-
(
|
|
261
|
-
dto: Dto['UpdateCheckoutSessionMapper'],
|
|
262
|
-
em: EntityManager,
|
|
263
|
-
session: Stripe__default.Checkout.Session
|
|
264
|
-
) => Promise<Entities['UpdateCheckoutSessionMapper']>
|
|
265
|
-
>;
|
|
266
|
-
},
|
|
166
|
+
mappers: StripeCheckoutSessionMappers<StatusEnum, Entities, Dto>,
|
|
267
167
|
options?:
|
|
268
168
|
| {
|
|
269
169
|
enableDatabaseBackup?: boolean;
|
|
@@ -272,9 +172,10 @@ declare class StripeCheckoutSessionService<
|
|
|
272
172
|
| undefined
|
|
273
173
|
);
|
|
274
174
|
createCheckoutSession(
|
|
275
|
-
checkoutSessionDto:
|
|
175
|
+
checkoutSessionDto: StripeCreateCheckoutSessionDto<StatusEnum>,
|
|
176
|
+
...args: unknown[]
|
|
276
177
|
): Promise<Dto['CheckoutSessionMapper']>;
|
|
277
|
-
getCheckoutSession(
|
|
178
|
+
getCheckoutSession(idDto: IdDto): Promise<Dto['CheckoutSessionMapper']>;
|
|
278
179
|
expireCheckoutSession({ id }: IdDto): Promise<void>;
|
|
279
180
|
handleCheckoutSuccess({ id }: IdDto): Promise<void>;
|
|
280
181
|
handleCheckoutFailure({ id }: IdDto): Promise<void>;
|
|
@@ -308,78 +209,29 @@ declare class StripePaymentLinkService<
|
|
|
308
209
|
| undefined;
|
|
309
210
|
basePaymentLinkService: BasePaymentLinkService<
|
|
310
211
|
SchemaValidator,
|
|
311
|
-
|
|
312
|
-
|
|
212
|
+
PaymentMethodEnum,
|
|
213
|
+
CurrencyEnum,
|
|
313
214
|
StatusEnum,
|
|
314
215
|
Entities,
|
|
315
|
-
|
|
216
|
+
Dto
|
|
316
217
|
>;
|
|
317
|
-
protected
|
|
318
|
-
protected readonly stripeClient: Stripe__default;
|
|
218
|
+
protected readonly stripeClient: stripe__default;
|
|
319
219
|
protected readonly em: EntityManager;
|
|
320
220
|
protected readonly cache: TtlCache;
|
|
321
221
|
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
322
222
|
protected readonly schemaValidator: SchemaValidator;
|
|
323
|
-
protected readonly mappers:
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
>;
|
|
329
|
-
CreatePaymentLinkMapper: RequestMapperConstructor<
|
|
330
|
-
SchemaValidator,
|
|
331
|
-
Dto['CreatePaymentLinkMapper'],
|
|
332
|
-
Entities['CreatePaymentLinkMapper'],
|
|
333
|
-
(
|
|
334
|
-
dto: Dto['CreatePaymentLinkMapper'],
|
|
335
|
-
em: EntityManager,
|
|
336
|
-
paymentLink: Stripe__default.PaymentLink
|
|
337
|
-
) => Promise<Entities['CreatePaymentLinkMapper']>
|
|
338
|
-
>;
|
|
339
|
-
UpdatePaymentLinkMapper: RequestMapperConstructor<
|
|
340
|
-
SchemaValidator,
|
|
341
|
-
Dto['UpdatePaymentLinkMapper'],
|
|
342
|
-
Entities['UpdatePaymentLinkMapper'],
|
|
343
|
-
(
|
|
344
|
-
dto: Dto['UpdatePaymentLinkMapper'],
|
|
345
|
-
em: EntityManager,
|
|
346
|
-
paymentLink: Stripe__default.PaymentLink
|
|
347
|
-
) => Promise<Entities['UpdatePaymentLinkMapper']>
|
|
348
|
-
>;
|
|
349
|
-
};
|
|
223
|
+
protected readonly mappers: StripePaymentLinkMappers<
|
|
224
|
+
StatusEnum,
|
|
225
|
+
Entities,
|
|
226
|
+
Dto
|
|
227
|
+
>;
|
|
350
228
|
constructor(
|
|
351
|
-
stripeClient:
|
|
229
|
+
stripeClient: stripe__default,
|
|
352
230
|
em: EntityManager,
|
|
353
231
|
cache: TtlCache,
|
|
354
232
|
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
355
233
|
schemaValidator: SchemaValidator,
|
|
356
|
-
mappers:
|
|
357
|
-
PaymentLinkMapper: ResponseMapperConstructor<
|
|
358
|
-
SchemaValidator,
|
|
359
|
-
Dto['PaymentLinkMapper'],
|
|
360
|
-
Entities['PaymentLinkMapper']
|
|
361
|
-
>;
|
|
362
|
-
CreatePaymentLinkMapper: RequestMapperConstructor<
|
|
363
|
-
SchemaValidator,
|
|
364
|
-
Dto['CreatePaymentLinkMapper'],
|
|
365
|
-
Entities['CreatePaymentLinkMapper'],
|
|
366
|
-
(
|
|
367
|
-
dto: Dto['CreatePaymentLinkMapper'],
|
|
368
|
-
em: EntityManager,
|
|
369
|
-
paymentLink: Stripe__default.PaymentLink
|
|
370
|
-
) => Promise<Entities['CreatePaymentLinkMapper']>
|
|
371
|
-
>;
|
|
372
|
-
UpdatePaymentLinkMapper: RequestMapperConstructor<
|
|
373
|
-
SchemaValidator,
|
|
374
|
-
Dto['UpdatePaymentLinkMapper'],
|
|
375
|
-
Entities['UpdatePaymentLinkMapper'],
|
|
376
|
-
(
|
|
377
|
-
dto: Dto['UpdatePaymentLinkMapper'],
|
|
378
|
-
em: EntityManager,
|
|
379
|
-
paymentLink: Stripe__default.PaymentLink
|
|
380
|
-
) => Promise<Entities['UpdatePaymentLinkMapper']>
|
|
381
|
-
>;
|
|
382
|
-
},
|
|
234
|
+
mappers: StripePaymentLinkMappers<StatusEnum, Entities, Dto>,
|
|
383
235
|
options?:
|
|
384
236
|
| {
|
|
385
237
|
enableDatabaseBackup?: boolean;
|
|
@@ -388,10 +240,12 @@ declare class StripePaymentLinkService<
|
|
|
388
240
|
| undefined
|
|
389
241
|
);
|
|
390
242
|
createPaymentLink(
|
|
391
|
-
paymentLinkDto:
|
|
243
|
+
paymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>,
|
|
244
|
+
...args: unknown[]
|
|
392
245
|
): Promise<Dto['PaymentLinkMapper']>;
|
|
393
246
|
updatePaymentLink(
|
|
394
|
-
paymentLinkDto:
|
|
247
|
+
paymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>,
|
|
248
|
+
...args: unknown[]
|
|
395
249
|
): Promise<Dto['PaymentLinkMapper']>;
|
|
396
250
|
getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
|
|
397
251
|
expirePaymentLink({ id }: IdDto): Promise<void>;
|
|
@@ -426,76 +280,23 @@ declare class StripePlanService<
|
|
|
426
280
|
| undefined;
|
|
427
281
|
basePlanService: BasePlanService<
|
|
428
282
|
SchemaValidator,
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
283
|
+
PlanCadenceEnum,
|
|
284
|
+
CurrencyEnum,
|
|
285
|
+
BillingProviderEnum,
|
|
432
286
|
Entities,
|
|
433
|
-
|
|
287
|
+
Dto
|
|
434
288
|
>;
|
|
435
|
-
protected
|
|
436
|
-
protected readonly stripeClient: Stripe__default;
|
|
289
|
+
protected readonly stripeClient: stripe__default;
|
|
437
290
|
protected readonly em: EntityManager;
|
|
438
291
|
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
439
292
|
protected readonly schemaValidator: SchemaValidator;
|
|
440
|
-
protected readonly mappers:
|
|
441
|
-
PlanMapper: ResponseMapperConstructor<
|
|
442
|
-
SchemaValidator,
|
|
443
|
-
Dto['PlanMapper'],
|
|
444
|
-
Entities['PlanMapper']
|
|
445
|
-
>;
|
|
446
|
-
CreatePlanMapper: RequestMapperConstructor<
|
|
447
|
-
SchemaValidator,
|
|
448
|
-
Dto['CreatePlanMapper'],
|
|
449
|
-
Entities['CreatePlanMapper'],
|
|
450
|
-
(
|
|
451
|
-
dto: Dto['CreatePlanMapper'],
|
|
452
|
-
em: EntityManager,
|
|
453
|
-
plan: Stripe__default.Plan
|
|
454
|
-
) => Promise<Entities['CreatePlanMapper']>
|
|
455
|
-
>;
|
|
456
|
-
UpdatePlanMapper: RequestMapperConstructor<
|
|
457
|
-
SchemaValidator,
|
|
458
|
-
Dto['UpdatePlanMapper'],
|
|
459
|
-
Entities['UpdatePlanMapper'],
|
|
460
|
-
(
|
|
461
|
-
dto: Dto['UpdatePlanMapper'],
|
|
462
|
-
em: EntityManager,
|
|
463
|
-
plan: Stripe__default.Plan
|
|
464
|
-
) => Promise<Entities['UpdatePlanMapper']>
|
|
465
|
-
>;
|
|
466
|
-
};
|
|
293
|
+
protected readonly mappers: StripePlanMappers<Entities, Dto>;
|
|
467
294
|
constructor(
|
|
468
|
-
stripeClient:
|
|
295
|
+
stripeClient: stripe__default,
|
|
469
296
|
em: EntityManager,
|
|
470
297
|
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
471
298
|
schemaValidator: SchemaValidator,
|
|
472
|
-
mappers:
|
|
473
|
-
PlanMapper: ResponseMapperConstructor<
|
|
474
|
-
SchemaValidator,
|
|
475
|
-
Dto['PlanMapper'],
|
|
476
|
-
Entities['PlanMapper']
|
|
477
|
-
>;
|
|
478
|
-
CreatePlanMapper: RequestMapperConstructor<
|
|
479
|
-
SchemaValidator,
|
|
480
|
-
Dto['CreatePlanMapper'],
|
|
481
|
-
Entities['CreatePlanMapper'],
|
|
482
|
-
(
|
|
483
|
-
dto: Dto['CreatePlanMapper'],
|
|
484
|
-
em: EntityManager,
|
|
485
|
-
plan: Stripe__default.Plan
|
|
486
|
-
) => Promise<Entities['CreatePlanMapper']>
|
|
487
|
-
>;
|
|
488
|
-
UpdatePlanMapper: RequestMapperConstructor<
|
|
489
|
-
SchemaValidator,
|
|
490
|
-
Dto['UpdatePlanMapper'],
|
|
491
|
-
Entities['UpdatePlanMapper'],
|
|
492
|
-
(
|
|
493
|
-
dto: Dto['UpdatePlanMapper'],
|
|
494
|
-
em: EntityManager,
|
|
495
|
-
plan: Stripe__default.Plan
|
|
496
|
-
) => Promise<Entities['UpdatePlanMapper']>
|
|
497
|
-
>;
|
|
498
|
-
},
|
|
299
|
+
mappers: StripePlanMappers<Entities, Dto>,
|
|
499
300
|
options?:
|
|
500
301
|
| {
|
|
501
302
|
telemetry?: TelemetryOptions;
|
|
@@ -504,12 +305,12 @@ declare class StripePlanService<
|
|
|
504
305
|
| undefined
|
|
505
306
|
);
|
|
506
307
|
createPlan(
|
|
507
|
-
planDto:
|
|
308
|
+
planDto: StripeCreatePlanDto,
|
|
508
309
|
em?: EntityManager
|
|
509
310
|
): Promise<Dto['PlanMapper']>;
|
|
510
311
|
getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
511
312
|
updatePlan(
|
|
512
|
-
planDto:
|
|
313
|
+
planDto: StripeUpdatePlanDto,
|
|
513
314
|
em?: EntityManager
|
|
514
315
|
): Promise<Dto['PlanMapper']>;
|
|
515
316
|
deletePlan(
|
|
@@ -549,74 +350,25 @@ declare class StripeSubscriptionService<
|
|
|
549
350
|
baseSubscriptionService: BaseSubscriptionService<
|
|
550
351
|
SchemaValidator,
|
|
551
352
|
PartyType,
|
|
552
|
-
|
|
353
|
+
BillingProviderEnum,
|
|
553
354
|
Entities,
|
|
554
|
-
|
|
355
|
+
Dto
|
|
555
356
|
>;
|
|
556
|
-
protected
|
|
557
|
-
protected readonly stripe: Stripe__default;
|
|
357
|
+
protected readonly stripeClient: stripe__default;
|
|
558
358
|
protected readonly em: EntityManager;
|
|
559
359
|
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
560
360
|
protected readonly schemaValidator: SchemaValidator;
|
|
561
|
-
protected readonly mappers:
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
>;
|
|
567
|
-
CreateSubscriptionMapper: RequestMapperConstructor<
|
|
568
|
-
SchemaValidator,
|
|
569
|
-
Dto['CreateSubscriptionMapper'],
|
|
570
|
-
Entities['CreateSubscriptionMapper'],
|
|
571
|
-
(
|
|
572
|
-
dto: Dto['CreateSubscriptionMapper'],
|
|
573
|
-
em: EntityManager,
|
|
574
|
-
subscription: Stripe__default.Subscription
|
|
575
|
-
) => Promise<Entities['CreateSubscriptionMapper']>
|
|
576
|
-
>;
|
|
577
|
-
UpdateSubscriptionMapper: RequestMapperConstructor<
|
|
578
|
-
SchemaValidator,
|
|
579
|
-
Dto['UpdateSubscriptionMapper'],
|
|
580
|
-
Entities['UpdateSubscriptionMapper'],
|
|
581
|
-
(
|
|
582
|
-
dto: Dto['UpdateSubscriptionMapper'],
|
|
583
|
-
em: EntityManager,
|
|
584
|
-
subscription: Stripe__default.Subscription
|
|
585
|
-
) => Promise<Entities['UpdateSubscriptionMapper']>
|
|
586
|
-
>;
|
|
587
|
-
};
|
|
361
|
+
protected readonly mappers: StripeSubscriptionMappers<
|
|
362
|
+
PartyType,
|
|
363
|
+
Entities,
|
|
364
|
+
Dto
|
|
365
|
+
>;
|
|
588
366
|
constructor(
|
|
589
|
-
|
|
367
|
+
stripeClient: stripe__default,
|
|
590
368
|
em: EntityManager,
|
|
591
369
|
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
592
370
|
schemaValidator: SchemaValidator,
|
|
593
|
-
mappers:
|
|
594
|
-
SubscriptionMapper: ResponseMapperConstructor<
|
|
595
|
-
SchemaValidator,
|
|
596
|
-
Dto['SubscriptionMapper'],
|
|
597
|
-
Entities['SubscriptionMapper']
|
|
598
|
-
>;
|
|
599
|
-
CreateSubscriptionMapper: RequestMapperConstructor<
|
|
600
|
-
SchemaValidator,
|
|
601
|
-
Dto['CreateSubscriptionMapper'],
|
|
602
|
-
Entities['CreateSubscriptionMapper'],
|
|
603
|
-
(
|
|
604
|
-
dto: Dto['CreateSubscriptionMapper'],
|
|
605
|
-
em: EntityManager,
|
|
606
|
-
subscription: Stripe__default.Subscription
|
|
607
|
-
) => Promise<Entities['CreateSubscriptionMapper']>
|
|
608
|
-
>;
|
|
609
|
-
UpdateSubscriptionMapper: RequestMapperConstructor<
|
|
610
|
-
SchemaValidator,
|
|
611
|
-
Dto['UpdateSubscriptionMapper'],
|
|
612
|
-
Entities['UpdateSubscriptionMapper'],
|
|
613
|
-
(
|
|
614
|
-
dto: Dto['UpdateSubscriptionMapper'],
|
|
615
|
-
em: EntityManager,
|
|
616
|
-
subscription: Stripe__default.Subscription
|
|
617
|
-
) => Promise<Entities['UpdateSubscriptionMapper']>
|
|
618
|
-
>;
|
|
619
|
-
},
|
|
371
|
+
mappers: StripeSubscriptionMappers<PartyType, Entities, Dto>,
|
|
620
372
|
options?:
|
|
621
373
|
| {
|
|
622
374
|
telemetry?: TelemetryOptions;
|
|
@@ -625,7 +377,7 @@ declare class StripeSubscriptionService<
|
|
|
625
377
|
| undefined
|
|
626
378
|
);
|
|
627
379
|
createSubscription(
|
|
628
|
-
subscriptionDto:
|
|
380
|
+
subscriptionDto: StripeCreateSubscriptionDto<PartyType>,
|
|
629
381
|
em?: EntityManager
|
|
630
382
|
): Promise<Dto['SubscriptionMapper']>;
|
|
631
383
|
getSubscription(
|
|
@@ -641,7 +393,7 @@ declare class StripeSubscriptionService<
|
|
|
641
393
|
em?: EntityManager
|
|
642
394
|
): Promise<Dto['SubscriptionMapper']>;
|
|
643
395
|
updateSubscription(
|
|
644
|
-
subscriptionDto:
|
|
396
|
+
subscriptionDto: StripeUpdateSubscriptionDto<PartyType>,
|
|
645
397
|
em?: EntityManager
|
|
646
398
|
): Promise<Dto['SubscriptionMapper']>;
|
|
647
399
|
deleteSubscription(
|
|
@@ -672,7 +424,7 @@ declare class StripeWebhookService<
|
|
|
672
424
|
SubscriptionEntities extends
|
|
673
425
|
StripeSubscriptionEntities<PartyEnum> = StripeSubscriptionEntities<PartyEnum>
|
|
674
426
|
> {
|
|
675
|
-
protected readonly stripeClient:
|
|
427
|
+
protected readonly stripeClient: stripe__default;
|
|
676
428
|
protected readonly em: EntityManager;
|
|
677
429
|
protected readonly schemaValidator: SchemaValidator;
|
|
678
430
|
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
@@ -700,7 +452,7 @@ declare class StripeWebhookService<
|
|
|
700
452
|
SubscriptionEntities
|
|
701
453
|
>;
|
|
702
454
|
constructor(
|
|
703
|
-
stripeClient:
|
|
455
|
+
stripeClient: stripe__default,
|
|
704
456
|
em: EntityManager,
|
|
705
457
|
schemaValidator: SchemaValidator,
|
|
706
458
|
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
@@ -725,7 +477,7 @@ declare class StripeWebhookService<
|
|
|
725
477
|
SubscriptionEntities
|
|
726
478
|
>
|
|
727
479
|
);
|
|
728
|
-
handleWebhookEvent(event:
|
|
480
|
+
handleWebhookEvent(event: stripe__default.Event): Promise<void>;
|
|
729
481
|
}
|
|
730
482
|
|
|
731
483
|
export {
|