@forklaunch/implementation-billing-stripe 0.0.3 → 0.0.4
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 +177 -182
- package/lib/domain/enum/index.d.ts +177 -182
- package/lib/domain/enum/index.js +186 -191
- package/lib/domain/enum/index.mjs +176 -176
- package/lib/domain/schemas/index.d.mts +318 -4084
- package/lib/domain/schemas/index.d.ts +318 -4084
- package/lib/domain/schemas/index.js +248 -324
- package/lib/domain/schemas/index.mjs +197 -198
- package/lib/domain/types/index.d.mts +72 -231
- package/lib/domain/types/index.d.ts +72 -231
- package/lib/domain/types/index.js +4 -8
- package/lib/eject/domain/schemas/billingPortal.schema.ts +2 -2
- package/lib/eject/domain/schemas/checkoutSession.schema.ts +4 -4
- package/lib/eject/domain/schemas/paymentLink.schema.ts +4 -4
- package/lib/eject/domain/schemas/plan.schema.ts +5 -5
- package/lib/eject/domain/schemas/subscription.schema.ts +3 -3
- package/lib/services/index.d.mts +194 -709
- package/lib/services/index.d.ts +194 -709
- package/lib/services/index.js +244 -359
- package/lib/services/index.mjs +205 -298
- package/package.json +2 -2
package/lib/services/index.d.ts
CHANGED
|
@@ -1,738 +1,223 @@
|
|
|
1
1
|
import { IdDto, InstanceTypeRecord, IdsDto } from '@forklaunch/common';
|
|
2
2
|
import { TtlCache } from '@forklaunch/core/cache';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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';
|
|
22
|
-
import {
|
|
23
|
-
ResponseMapperConstructor,
|
|
24
|
-
RequestMapperConstructor,
|
|
25
|
-
InternalMapper
|
|
26
|
-
} from '@forklaunch/internal';
|
|
3
|
+
import { OpenTelemetryCollector, MetricsDefinition, TelemetryOptions } 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';
|
|
6
|
+
import { ResponseMapperConstructor, RequestMapperConstructor, InternalMapper } from '@forklaunch/internal';
|
|
27
7
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
28
8
|
import { EntityManager } from '@mikro-orm/core';
|
|
29
9
|
import Stripe__default from 'stripe';
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
StripeBillingPortalDtos,
|
|
33
|
-
StripeCreateBillingPortalDto,
|
|
34
|
-
StripeUpdateBillingPortalDto,
|
|
35
|
-
StripeBillingPortalDto,
|
|
36
|
-
StripeCheckoutSessionEntities,
|
|
37
|
-
StripeCheckoutSessionDtos,
|
|
38
|
-
StripePaymentLinkEntities,
|
|
39
|
-
StripePaymentLinkDtos,
|
|
40
|
-
StripeCreatePaymentLinkDto,
|
|
41
|
-
StripeUpdatePaymentLinkDto,
|
|
42
|
-
StripePaymentLinkDto,
|
|
43
|
-
StripePlanEntities,
|
|
44
|
-
StripePlanDtos,
|
|
45
|
-
StripeCreatePlanDto,
|
|
46
|
-
StripeUpdatePlanDto,
|
|
47
|
-
StripePlanDto,
|
|
48
|
-
StripeSubscriptionEntities,
|
|
49
|
-
StripeSubscriptionDtos,
|
|
50
|
-
StripeCreateSubscriptionDto,
|
|
51
|
-
StripeUpdateSubscriptionDto,
|
|
52
|
-
StripeSubscriptionDto
|
|
53
|
-
} from '../domain/types/index.js';
|
|
54
|
-
import {
|
|
55
|
-
PaymentMethodEnum,
|
|
56
|
-
CurrencyEnum,
|
|
57
|
-
PlanCadenceEnum,
|
|
58
|
-
BillingProviderEnum
|
|
59
|
-
} from '../domain/enum/index.js';
|
|
10
|
+
import { StripeBillingPortalEntities, StripeBillingPortalDtos, StripeCreateBillingPortalDto, StripeUpdateBillingPortalDto, StripeBillingPortalDto, StripeCheckoutSessionEntities, StripeCheckoutSessionDtos, StripePaymentLinkEntities, StripePaymentLinkDtos, StripeCreatePaymentLinkDto, StripeUpdatePaymentLinkDto, StripePaymentLinkDto, StripePlanEntities, StripePlanDtos, StripeCreatePlanDto, StripeUpdatePlanDto, StripePlanDto, StripeSubscriptionEntities, StripeSubscriptionDtos, StripeCreateSubscriptionDto, StripeUpdateSubscriptionDto, StripeSubscriptionDto } from '../domain/types/index.js';
|
|
11
|
+
import { PaymentMethodEnum, CurrencyEnum, PlanCadenceEnum, BillingProviderEnum } from '../domain/enum/index.js';
|
|
60
12
|
import '@forklaunch/interfaces-billing/types';
|
|
61
13
|
|
|
62
|
-
declare class StripeBillingPortalService<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
protected mappers: {
|
|
80
|
-
BillingPortalMapper: ResponseMapperConstructor<
|
|
81
|
-
SchemaValidator,
|
|
82
|
-
Dto['BillingPortalMapper'],
|
|
83
|
-
Entities['BillingPortalMapper']
|
|
84
|
-
>;
|
|
85
|
-
CreateBillingPortalMapper: RequestMapperConstructor<
|
|
86
|
-
SchemaValidator,
|
|
87
|
-
Dto['CreateBillingPortalMapper'],
|
|
88
|
-
Entities['CreateBillingPortalMapper'],
|
|
89
|
-
(
|
|
90
|
-
dto: Dto['CreateBillingPortalMapper'],
|
|
91
|
-
em: EntityManager,
|
|
92
|
-
session: Stripe__default.BillingPortal.Session
|
|
93
|
-
) => Promise<Entities['CreateBillingPortalMapper']>
|
|
94
|
-
>;
|
|
95
|
-
UpdateBillingPortalMapper: RequestMapperConstructor<
|
|
96
|
-
SchemaValidator,
|
|
97
|
-
Dto['UpdateBillingPortalMapper'],
|
|
98
|
-
Entities['UpdateBillingPortalMapper'],
|
|
99
|
-
(
|
|
100
|
-
dto: Dto['UpdateBillingPortalMapper'],
|
|
101
|
-
em: EntityManager,
|
|
102
|
-
session: Stripe__default.BillingPortal.Session
|
|
103
|
-
) => Promise<Entities['UpdateBillingPortalMapper']>
|
|
104
|
-
>;
|
|
105
|
-
};
|
|
106
|
-
readonly options?:
|
|
107
|
-
| {
|
|
14
|
+
declare class StripeBillingPortalService<SchemaValidator extends AnySchemaValidator, Entities extends StripeBillingPortalEntities, Dto extends StripeBillingPortalDtos = StripeBillingPortalDtos> implements BillingPortalService<{
|
|
15
|
+
CreateBillingPortalDto: StripeCreateBillingPortalDto;
|
|
16
|
+
UpdateBillingPortalDto: StripeUpdateBillingPortalDto;
|
|
17
|
+
BillingPortalDto: StripeBillingPortalDto;
|
|
18
|
+
IdDto: IdDto;
|
|
19
|
+
}> {
|
|
20
|
+
protected stripeClient: Stripe__default;
|
|
21
|
+
protected em: EntityManager;
|
|
22
|
+
protected cache: TtlCache;
|
|
23
|
+
protected openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
24
|
+
protected schemaValidator: SchemaValidator;
|
|
25
|
+
protected mappers: {
|
|
26
|
+
BillingPortalMapper: ResponseMapperConstructor<SchemaValidator, Dto['BillingPortalMapper'], Entities['BillingPortalMapper']>;
|
|
27
|
+
CreateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateBillingPortalMapper'], Entities['CreateBillingPortalMapper'], (dto: Dto['CreateBillingPortalMapper'], em: EntityManager, session: Stripe__default.BillingPortal.Session) => Promise<Entities['CreateBillingPortalMapper']>>;
|
|
28
|
+
UpdateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateBillingPortalMapper'], Entities['UpdateBillingPortalMapper'], (dto: Dto['UpdateBillingPortalMapper'], em: EntityManager, session: Stripe__default.BillingPortal.Session) => Promise<Entities['UpdateBillingPortalMapper']>>;
|
|
29
|
+
};
|
|
30
|
+
readonly options?: {
|
|
108
31
|
telemetry?: TelemetryOptions;
|
|
109
32
|
enableDatabaseBackup?: boolean;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
SchemaValidator,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
},
|
|
152
|
-
options?:
|
|
153
|
-
| {
|
|
154
|
-
telemetry?: TelemetryOptions;
|
|
155
|
-
enableDatabaseBackup?: boolean;
|
|
156
|
-
}
|
|
157
|
-
| undefined
|
|
158
|
-
);
|
|
159
|
-
createBillingPortalSession(
|
|
160
|
-
billingPortalDto: Dto['CreateBillingPortalMapper']
|
|
161
|
-
): Promise<Dto['BillingPortalMapper']>;
|
|
162
|
-
getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
|
|
163
|
-
expireBillingPortalSession(idDto: IdDto): Promise<void>;
|
|
164
|
-
updateBillingPortalSession(
|
|
165
|
-
billingPortalDto: Dto['UpdateBillingPortalMapper']
|
|
166
|
-
): Promise<Dto['BillingPortalMapper']>;
|
|
33
|
+
} | undefined;
|
|
34
|
+
private readonly billingPortalSessionExpiryDurationMs;
|
|
35
|
+
baseBillingPortalService: BaseBillingPortalService<SchemaValidator, Entities, Entities>;
|
|
36
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
37
|
+
constructor(stripeClient: Stripe__default, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
|
|
38
|
+
BillingPortalMapper: ResponseMapperConstructor<SchemaValidator, Dto['BillingPortalMapper'], Entities['BillingPortalMapper']>;
|
|
39
|
+
CreateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateBillingPortalMapper'], Entities['CreateBillingPortalMapper'], (dto: Dto['CreateBillingPortalMapper'], em: EntityManager, session: Stripe__default.BillingPortal.Session) => Promise<Entities['CreateBillingPortalMapper']>>;
|
|
40
|
+
UpdateBillingPortalMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateBillingPortalMapper'], Entities['UpdateBillingPortalMapper'], (dto: Dto['UpdateBillingPortalMapper'], em: EntityManager, session: Stripe__default.BillingPortal.Session) => Promise<Entities['UpdateBillingPortalMapper']>>;
|
|
41
|
+
}, options?: {
|
|
42
|
+
telemetry?: TelemetryOptions;
|
|
43
|
+
enableDatabaseBackup?: boolean;
|
|
44
|
+
} | undefined);
|
|
45
|
+
createBillingPortalSession(billingPortalDto: Dto['CreateBillingPortalMapper']): Promise<Dto['BillingPortalMapper']>;
|
|
46
|
+
getBillingPortalSession(idDto: IdDto): Promise<Dto['BillingPortalMapper']>;
|
|
47
|
+
expireBillingPortalSession(idDto: IdDto): Promise<void>;
|
|
48
|
+
updateBillingPortalSession(billingPortalDto: Dto['UpdateBillingPortalMapper']): Promise<Dto['BillingPortalMapper']>;
|
|
167
49
|
}
|
|
168
50
|
|
|
169
|
-
declare class StripeCheckoutSessionService<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
>
|
|
186
|
-
{
|
|
187
|
-
protected readonly stripeClient: Stripe__default;
|
|
188
|
-
protected readonly em: EntityManager;
|
|
189
|
-
protected readonly cache: TtlCache;
|
|
190
|
-
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
191
|
-
protected readonly schemaValidator: SchemaValidator;
|
|
192
|
-
protected readonly mappers: {
|
|
193
|
-
CheckoutSessionMapper: ResponseMapperConstructor<
|
|
194
|
-
SchemaValidator,
|
|
195
|
-
Dto['CheckoutSessionMapper'],
|
|
196
|
-
Entities['CheckoutSessionMapper']
|
|
197
|
-
>;
|
|
198
|
-
CreateCheckoutSessionMapper: RequestMapperConstructor<
|
|
199
|
-
SchemaValidator,
|
|
200
|
-
Dto['CreateCheckoutSessionMapper'],
|
|
201
|
-
Entities['CreateCheckoutSessionMapper'],
|
|
202
|
-
(
|
|
203
|
-
dto: Dto['CreateCheckoutSessionMapper'],
|
|
204
|
-
em: EntityManager,
|
|
205
|
-
session: Stripe__default.Checkout.Session
|
|
206
|
-
) => Promise<Entities['CreateCheckoutSessionMapper']>
|
|
207
|
-
>;
|
|
208
|
-
UpdateCheckoutSessionMapper: RequestMapperConstructor<
|
|
209
|
-
SchemaValidator,
|
|
210
|
-
Dto['UpdateCheckoutSessionMapper'],
|
|
211
|
-
Entities['UpdateCheckoutSessionMapper'],
|
|
212
|
-
(
|
|
213
|
-
dto: Dto['UpdateCheckoutSessionMapper'],
|
|
214
|
-
em: EntityManager,
|
|
215
|
-
session: Stripe__default.Checkout.Session
|
|
216
|
-
) => Promise<Entities['UpdateCheckoutSessionMapper']>
|
|
217
|
-
>;
|
|
218
|
-
};
|
|
219
|
-
readonly options?:
|
|
220
|
-
| {
|
|
51
|
+
declare class StripeCheckoutSessionService<SchemaValidator extends AnySchemaValidator, StatusEnum, Entities extends StripeCheckoutSessionEntities<StatusEnum>, Dto extends StripeCheckoutSessionDtos<StatusEnum> = StripeCheckoutSessionDtos<StatusEnum>> implements CheckoutSessionService<typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, {
|
|
52
|
+
CreateCheckoutSessionDto: Dto['CreateCheckoutSessionMapper'];
|
|
53
|
+
CheckoutSessionDto: Dto['CheckoutSessionMapper'];
|
|
54
|
+
IdDto: IdDto;
|
|
55
|
+
}> {
|
|
56
|
+
protected readonly stripeClient: Stripe__default;
|
|
57
|
+
protected readonly em: EntityManager;
|
|
58
|
+
protected readonly cache: TtlCache;
|
|
59
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
60
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
61
|
+
protected readonly mappers: {
|
|
62
|
+
CheckoutSessionMapper: ResponseMapperConstructor<SchemaValidator, Dto['CheckoutSessionMapper'], Entities['CheckoutSessionMapper']>;
|
|
63
|
+
CreateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateCheckoutSessionMapper'], Entities['CreateCheckoutSessionMapper'], (dto: Dto['CreateCheckoutSessionMapper'], em: EntityManager, session: Stripe__default.Checkout.Session) => Promise<Entities['CreateCheckoutSessionMapper']>>;
|
|
64
|
+
UpdateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateCheckoutSessionMapper'], Entities['UpdateCheckoutSessionMapper'], (dto: Dto['UpdateCheckoutSessionMapper'], em: EntityManager, session: Stripe__default.Checkout.Session) => Promise<Entities['UpdateCheckoutSessionMapper']>>;
|
|
65
|
+
};
|
|
66
|
+
readonly options?: {
|
|
221
67
|
enableDatabaseBackup?: boolean;
|
|
222
68
|
telemetry?: TelemetryOptions;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
SchemaValidator,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
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
|
-
},
|
|
267
|
-
options?:
|
|
268
|
-
| {
|
|
269
|
-
enableDatabaseBackup?: boolean;
|
|
270
|
-
telemetry?: TelemetryOptions;
|
|
271
|
-
}
|
|
272
|
-
| undefined
|
|
273
|
-
);
|
|
274
|
-
createCheckoutSession(
|
|
275
|
-
checkoutSessionDto: Dto['CreateCheckoutSessionMapper']
|
|
276
|
-
): Promise<Dto['CheckoutSessionMapper']>;
|
|
277
|
-
getCheckoutSession({ id }: IdDto): Promise<Dto['CheckoutSessionMapper']>;
|
|
278
|
-
expireCheckoutSession({ id }: IdDto): Promise<void>;
|
|
279
|
-
handleCheckoutSuccess({ id }: IdDto): Promise<void>;
|
|
280
|
-
handleCheckoutFailure({ id }: IdDto): Promise<void>;
|
|
69
|
+
} | undefined;
|
|
70
|
+
baseCheckoutSessionService: BaseCheckoutSessionService<SchemaValidator, typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, Entities, Entities>;
|
|
71
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
72
|
+
constructor(stripeClient: Stripe__default, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
|
|
73
|
+
CheckoutSessionMapper: ResponseMapperConstructor<SchemaValidator, Dto['CheckoutSessionMapper'], Entities['CheckoutSessionMapper']>;
|
|
74
|
+
CreateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateCheckoutSessionMapper'], Entities['CreateCheckoutSessionMapper'], (dto: Dto['CreateCheckoutSessionMapper'], em: EntityManager, session: Stripe__default.Checkout.Session) => Promise<Entities['CreateCheckoutSessionMapper']>>;
|
|
75
|
+
UpdateCheckoutSessionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateCheckoutSessionMapper'], Entities['UpdateCheckoutSessionMapper'], (dto: Dto['UpdateCheckoutSessionMapper'], em: EntityManager, session: Stripe__default.Checkout.Session) => Promise<Entities['UpdateCheckoutSessionMapper']>>;
|
|
76
|
+
}, options?: {
|
|
77
|
+
enableDatabaseBackup?: boolean;
|
|
78
|
+
telemetry?: TelemetryOptions;
|
|
79
|
+
} | undefined);
|
|
80
|
+
createCheckoutSession(checkoutSessionDto: Dto['CreateCheckoutSessionMapper']): Promise<Dto['CheckoutSessionMapper']>;
|
|
81
|
+
getCheckoutSession({ id }: IdDto): Promise<Dto['CheckoutSessionMapper']>;
|
|
82
|
+
expireCheckoutSession({ id }: IdDto): Promise<void>;
|
|
83
|
+
handleCheckoutSuccess({ id }: IdDto): Promise<void>;
|
|
84
|
+
handleCheckoutFailure({ id }: IdDto): Promise<void>;
|
|
281
85
|
}
|
|
282
86
|
|
|
283
|
-
declare class StripePaymentLinkService<
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
Dto['PaymentLinkMapper'],
|
|
312
|
-
Entities['PaymentLinkMapper']
|
|
313
|
-
>;
|
|
314
|
-
CreatePaymentLinkMapper: RequestMapperConstructor<
|
|
315
|
-
SchemaValidator,
|
|
316
|
-
Dto['CreatePaymentLinkMapper'],
|
|
317
|
-
Entities['CreatePaymentLinkMapper'],
|
|
318
|
-
(
|
|
319
|
-
dto: Dto['CreatePaymentLinkMapper'],
|
|
320
|
-
em: EntityManager,
|
|
321
|
-
paymentLink: Stripe__default.PaymentLink
|
|
322
|
-
) => Promise<Entities['CreatePaymentLinkMapper']>
|
|
323
|
-
>;
|
|
324
|
-
UpdatePaymentLinkMapper: RequestMapperConstructor<
|
|
325
|
-
SchemaValidator,
|
|
326
|
-
Dto['UpdatePaymentLinkMapper'],
|
|
327
|
-
Entities['UpdatePaymentLinkMapper'],
|
|
328
|
-
(
|
|
329
|
-
dto: Dto['UpdatePaymentLinkMapper'],
|
|
330
|
-
em: EntityManager,
|
|
331
|
-
paymentLink: Stripe__default.PaymentLink
|
|
332
|
-
) => Promise<Entities['UpdatePaymentLinkMapper']>
|
|
333
|
-
>;
|
|
334
|
-
};
|
|
335
|
-
readonly options?:
|
|
336
|
-
| {
|
|
87
|
+
declare class StripePaymentLinkService<SchemaValidator extends AnySchemaValidator, StatusEnum, Entities extends StripePaymentLinkEntities<StatusEnum>, Dto extends StripePaymentLinkDtos<StatusEnum> = StripePaymentLinkDtos<StatusEnum>> implements PaymentLinkService<PaymentMethodEnum, CurrencyEnum, StatusEnum, {
|
|
88
|
+
CreatePaymentLinkDto: StripeCreatePaymentLinkDto<StatusEnum>;
|
|
89
|
+
UpdatePaymentLinkDto: StripeUpdatePaymentLinkDto<StatusEnum>;
|
|
90
|
+
PaymentLinkDto: StripePaymentLinkDto<StatusEnum>;
|
|
91
|
+
IdDto: IdDto;
|
|
92
|
+
IdsDto: IdsDto;
|
|
93
|
+
}> {
|
|
94
|
+
protected readonly stripeClient: Stripe__default;
|
|
95
|
+
protected readonly em: EntityManager;
|
|
96
|
+
protected readonly cache: TtlCache;
|
|
97
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
98
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
99
|
+
protected readonly mappers: {
|
|
100
|
+
PaymentLinkMapper: ResponseMapperConstructor<SchemaValidator, Dto['PaymentLinkMapper'], Entities['PaymentLinkMapper']>;
|
|
101
|
+
CreatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePaymentLinkMapper'], Entities['CreatePaymentLinkMapper'], (dto: Dto['CreatePaymentLinkMapper'], em: EntityManager, paymentLink: Stripe__default.PaymentLink) => Promise<Entities['CreatePaymentLinkMapper']>>;
|
|
102
|
+
UpdatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePaymentLinkMapper'], Entities['UpdatePaymentLinkMapper'], (dto: Dto['UpdatePaymentLinkMapper'], em: EntityManager, paymentLink: Stripe__default.PaymentLink) => Promise<Entities['UpdatePaymentLinkMapper']>>;
|
|
103
|
+
};
|
|
104
|
+
readonly options?: {
|
|
105
|
+
enableDatabaseBackup?: boolean;
|
|
106
|
+
telemetry?: TelemetryOptions;
|
|
107
|
+
} | undefined;
|
|
108
|
+
basePaymentLinkService: BasePaymentLinkService<SchemaValidator, typeof PaymentMethodEnum, typeof CurrencyEnum, StatusEnum, Entities, Entities>;
|
|
109
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
110
|
+
constructor(stripeClient: Stripe__default, em: EntityManager, cache: TtlCache, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
|
|
111
|
+
PaymentLinkMapper: ResponseMapperConstructor<SchemaValidator, Dto['PaymentLinkMapper'], Entities['PaymentLinkMapper']>;
|
|
112
|
+
CreatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePaymentLinkMapper'], Entities['CreatePaymentLinkMapper'], (dto: Dto['CreatePaymentLinkMapper'], em: EntityManager, paymentLink: Stripe__default.PaymentLink) => Promise<Entities['CreatePaymentLinkMapper']>>;
|
|
113
|
+
UpdatePaymentLinkMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePaymentLinkMapper'], Entities['UpdatePaymentLinkMapper'], (dto: Dto['UpdatePaymentLinkMapper'], em: EntityManager, paymentLink: Stripe__default.PaymentLink) => Promise<Entities['UpdatePaymentLinkMapper']>>;
|
|
114
|
+
}, options?: {
|
|
337
115
|
enableDatabaseBackup?: boolean;
|
|
338
116
|
telemetry?: TelemetryOptions;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
Entities
|
|
348
|
-
>;
|
|
349
|
-
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
350
|
-
constructor(
|
|
351
|
-
stripeClient: Stripe__default,
|
|
352
|
-
em: EntityManager,
|
|
353
|
-
cache: TtlCache,
|
|
354
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
355
|
-
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
|
-
},
|
|
383
|
-
options?:
|
|
384
|
-
| {
|
|
385
|
-
enableDatabaseBackup?: boolean;
|
|
386
|
-
telemetry?: TelemetryOptions;
|
|
387
|
-
}
|
|
388
|
-
| undefined
|
|
389
|
-
);
|
|
390
|
-
createPaymentLink(
|
|
391
|
-
paymentLinkDto: Dto['CreatePaymentLinkMapper']
|
|
392
|
-
): Promise<Dto['PaymentLinkMapper']>;
|
|
393
|
-
updatePaymentLink(
|
|
394
|
-
paymentLinkDto: Dto['UpdatePaymentLinkMapper']
|
|
395
|
-
): Promise<Dto['PaymentLinkMapper']>;
|
|
396
|
-
getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
|
|
397
|
-
expirePaymentLink({ id }: IdDto): Promise<void>;
|
|
398
|
-
handlePaymentSuccess({ id }: IdDto): Promise<void>;
|
|
399
|
-
handlePaymentFailure({ id }: IdDto): Promise<void>;
|
|
400
|
-
listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
|
|
117
|
+
} | undefined);
|
|
118
|
+
createPaymentLink(paymentLinkDto: Dto['CreatePaymentLinkMapper']): Promise<Dto['PaymentLinkMapper']>;
|
|
119
|
+
updatePaymentLink(paymentLinkDto: Dto['UpdatePaymentLinkMapper']): Promise<Dto['PaymentLinkMapper']>;
|
|
120
|
+
getPaymentLink({ id }: IdDto): Promise<Dto['PaymentLinkMapper']>;
|
|
121
|
+
expirePaymentLink({ id }: IdDto): Promise<void>;
|
|
122
|
+
handlePaymentSuccess({ id }: IdDto): Promise<void>;
|
|
123
|
+
handlePaymentFailure({ id }: IdDto): Promise<void>;
|
|
124
|
+
listPaymentLinks(idsDto?: IdsDto): Promise<Dto['PaymentLinkMapper'][]>;
|
|
401
125
|
}
|
|
402
126
|
|
|
403
|
-
declare class StripePlanService<
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
>;
|
|
431
|
-
CreatePlanMapper: RequestMapperConstructor<
|
|
432
|
-
SchemaValidator,
|
|
433
|
-
Dto['CreatePlanMapper'],
|
|
434
|
-
Entities['CreatePlanMapper'],
|
|
435
|
-
(
|
|
436
|
-
dto: Dto['CreatePlanMapper'],
|
|
437
|
-
em: EntityManager,
|
|
438
|
-
plan: Stripe__default.Plan
|
|
439
|
-
) => Promise<Entities['CreatePlanMapper']>
|
|
440
|
-
>;
|
|
441
|
-
UpdatePlanMapper: RequestMapperConstructor<
|
|
442
|
-
SchemaValidator,
|
|
443
|
-
Dto['UpdatePlanMapper'],
|
|
444
|
-
Entities['UpdatePlanMapper'],
|
|
445
|
-
(
|
|
446
|
-
dto: Dto['UpdatePlanMapper'],
|
|
447
|
-
em: EntityManager,
|
|
448
|
-
plan: Stripe__default.Plan
|
|
449
|
-
) => Promise<Entities['UpdatePlanMapper']>
|
|
450
|
-
>;
|
|
451
|
-
};
|
|
452
|
-
readonly options?:
|
|
453
|
-
| {
|
|
127
|
+
declare class StripePlanService<SchemaValidator extends AnySchemaValidator, Entities extends StripePlanEntities, Dto extends StripePlanDtos = StripePlanDtos> implements PlanService<typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum, {
|
|
128
|
+
CreatePlanDto: StripeCreatePlanDto;
|
|
129
|
+
UpdatePlanDto: StripeUpdatePlanDto;
|
|
130
|
+
PlanDto: StripePlanDto;
|
|
131
|
+
IdDto: IdDto;
|
|
132
|
+
IdsDto: IdsDto;
|
|
133
|
+
}> {
|
|
134
|
+
protected readonly stripeClient: Stripe__default;
|
|
135
|
+
protected readonly em: EntityManager;
|
|
136
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
137
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
138
|
+
protected readonly mappers: {
|
|
139
|
+
PlanMapper: ResponseMapperConstructor<SchemaValidator, Dto['PlanMapper'], Entities['PlanMapper']>;
|
|
140
|
+
CreatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePlanMapper'], Entities['CreatePlanMapper'], (dto: Dto['CreatePlanMapper'], em: EntityManager, plan: Stripe__default.Plan) => Promise<Entities['CreatePlanMapper']>>;
|
|
141
|
+
UpdatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePlanMapper'], Entities['UpdatePlanMapper'], (dto: Dto['UpdatePlanMapper'], em: EntityManager, plan: Stripe__default.Plan) => Promise<Entities['UpdatePlanMapper']>>;
|
|
142
|
+
};
|
|
143
|
+
readonly options?: {
|
|
144
|
+
telemetry?: TelemetryOptions;
|
|
145
|
+
databaseTableName?: string;
|
|
146
|
+
} | undefined;
|
|
147
|
+
basePlanService: BasePlanService<SchemaValidator, typeof PlanCadenceEnum, typeof CurrencyEnum, typeof BillingProviderEnum, Entities, Entities>;
|
|
148
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
149
|
+
constructor(stripeClient: Stripe__default, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
|
|
150
|
+
PlanMapper: ResponseMapperConstructor<SchemaValidator, Dto['PlanMapper'], Entities['PlanMapper']>;
|
|
151
|
+
CreatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['CreatePlanMapper'], Entities['CreatePlanMapper'], (dto: Dto['CreatePlanMapper'], em: EntityManager, plan: Stripe__default.Plan) => Promise<Entities['CreatePlanMapper']>>;
|
|
152
|
+
UpdatePlanMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdatePlanMapper'], Entities['UpdatePlanMapper'], (dto: Dto['UpdatePlanMapper'], em: EntityManager, plan: Stripe__default.Plan) => Promise<Entities['UpdatePlanMapper']>>;
|
|
153
|
+
}, options?: {
|
|
454
154
|
telemetry?: TelemetryOptions;
|
|
455
155
|
databaseTableName?: string;
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
Entities
|
|
465
|
-
>;
|
|
466
|
-
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
467
|
-
constructor(
|
|
468
|
-
stripeClient: Stripe__default,
|
|
469
|
-
em: EntityManager,
|
|
470
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
471
|
-
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
|
-
},
|
|
499
|
-
options?:
|
|
500
|
-
| {
|
|
501
|
-
telemetry?: TelemetryOptions;
|
|
502
|
-
databaseTableName?: string;
|
|
503
|
-
}
|
|
504
|
-
| undefined
|
|
505
|
-
);
|
|
506
|
-
createPlan(
|
|
507
|
-
planDto: Dto['CreatePlanMapper'],
|
|
508
|
-
em?: EntityManager
|
|
509
|
-
): Promise<Dto['PlanMapper']>;
|
|
510
|
-
getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
511
|
-
updatePlan(
|
|
512
|
-
planDto: Dto['UpdatePlanMapper'],
|
|
513
|
-
em?: EntityManager
|
|
514
|
-
): Promise<Dto['PlanMapper']>;
|
|
515
|
-
deletePlan(
|
|
516
|
-
idDto: {
|
|
517
|
-
id: string;
|
|
518
|
-
},
|
|
519
|
-
em?: EntityManager
|
|
520
|
-
): Promise<void>;
|
|
521
|
-
listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
|
|
156
|
+
} | undefined);
|
|
157
|
+
createPlan(planDto: Dto['CreatePlanMapper'], em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
158
|
+
getPlan(idDto: IdDto, em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
159
|
+
updatePlan(planDto: Dto['UpdatePlanMapper'], em?: EntityManager): Promise<Dto['PlanMapper']>;
|
|
160
|
+
deletePlan(idDto: {
|
|
161
|
+
id: string;
|
|
162
|
+
}, em?: EntityManager): Promise<void>;
|
|
163
|
+
listPlans(idsDto?: IdsDto, em?: EntityManager): Promise<Dto['PlanMapper'][]>;
|
|
522
164
|
}
|
|
523
165
|
|
|
524
|
-
declare class StripeSubscriptionService<
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
>
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
Entities['SubscriptionMapper']
|
|
552
|
-
>;
|
|
553
|
-
CreateSubscriptionMapper: RequestMapperConstructor<
|
|
554
|
-
SchemaValidator,
|
|
555
|
-
Dto['CreateSubscriptionMapper'],
|
|
556
|
-
Entities['CreateSubscriptionMapper'],
|
|
557
|
-
(
|
|
558
|
-
dto: Dto['CreateSubscriptionMapper'],
|
|
559
|
-
em: EntityManager,
|
|
560
|
-
subscription: Stripe__default.Subscription
|
|
561
|
-
) => Promise<Entities['CreateSubscriptionMapper']>
|
|
562
|
-
>;
|
|
563
|
-
UpdateSubscriptionMapper: RequestMapperConstructor<
|
|
564
|
-
SchemaValidator,
|
|
565
|
-
Dto['UpdateSubscriptionMapper'],
|
|
566
|
-
Entities['UpdateSubscriptionMapper'],
|
|
567
|
-
(
|
|
568
|
-
dto: Dto['UpdateSubscriptionMapper'],
|
|
569
|
-
em: EntityManager,
|
|
570
|
-
subscription: Stripe__default.Subscription
|
|
571
|
-
) => Promise<Entities['UpdateSubscriptionMapper']>
|
|
572
|
-
>;
|
|
573
|
-
};
|
|
574
|
-
readonly options?:
|
|
575
|
-
| {
|
|
166
|
+
declare class StripeSubscriptionService<SchemaValidator extends AnySchemaValidator, PartyType, Entities extends StripeSubscriptionEntities<PartyType>, Dto extends StripeSubscriptionDtos<PartyType> = StripeSubscriptionDtos<PartyType>> implements SubscriptionService<PartyType, typeof BillingProviderEnum, {
|
|
167
|
+
CreateSubscriptionDto: StripeCreateSubscriptionDto<PartyType>;
|
|
168
|
+
UpdateSubscriptionDto: StripeUpdateSubscriptionDto<PartyType>;
|
|
169
|
+
SubscriptionDto: StripeSubscriptionDto<PartyType>;
|
|
170
|
+
IdDto: IdDto;
|
|
171
|
+
IdsDto: IdsDto;
|
|
172
|
+
}> {
|
|
173
|
+
protected readonly stripe: Stripe__default;
|
|
174
|
+
protected readonly em: EntityManager;
|
|
175
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
176
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
177
|
+
protected readonly mappers: {
|
|
178
|
+
SubscriptionMapper: ResponseMapperConstructor<SchemaValidator, Dto['SubscriptionMapper'], Entities['SubscriptionMapper']>;
|
|
179
|
+
CreateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateSubscriptionMapper'], Entities['CreateSubscriptionMapper'], (dto: Dto['CreateSubscriptionMapper'], em: EntityManager, subscription: Stripe__default.Subscription) => Promise<Entities['CreateSubscriptionMapper']>>;
|
|
180
|
+
UpdateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateSubscriptionMapper'], Entities['UpdateSubscriptionMapper'], (dto: Dto['UpdateSubscriptionMapper'], em: EntityManager, subscription: Stripe__default.Subscription) => Promise<Entities['UpdateSubscriptionMapper']>>;
|
|
181
|
+
};
|
|
182
|
+
readonly options?: {
|
|
183
|
+
telemetry?: TelemetryOptions;
|
|
184
|
+
databaseTableName?: string;
|
|
185
|
+
} | undefined;
|
|
186
|
+
baseSubscriptionService: BaseSubscriptionService<SchemaValidator, PartyType, typeof BillingProviderEnum, Entities, Entities>;
|
|
187
|
+
protected _mappers: InternalMapper<InstanceTypeRecord<typeof this.mappers>>;
|
|
188
|
+
constructor(stripe: Stripe__default, em: EntityManager, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, schemaValidator: SchemaValidator, mappers: {
|
|
189
|
+
SubscriptionMapper: ResponseMapperConstructor<SchemaValidator, Dto['SubscriptionMapper'], Entities['SubscriptionMapper']>;
|
|
190
|
+
CreateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['CreateSubscriptionMapper'], Entities['CreateSubscriptionMapper'], (dto: Dto['CreateSubscriptionMapper'], em: EntityManager, subscription: Stripe__default.Subscription) => Promise<Entities['CreateSubscriptionMapper']>>;
|
|
191
|
+
UpdateSubscriptionMapper: RequestMapperConstructor<SchemaValidator, Dto['UpdateSubscriptionMapper'], Entities['UpdateSubscriptionMapper'], (dto: Dto['UpdateSubscriptionMapper'], em: EntityManager, subscription: Stripe__default.Subscription) => Promise<Entities['UpdateSubscriptionMapper']>>;
|
|
192
|
+
}, options?: {
|
|
576
193
|
telemetry?: TelemetryOptions;
|
|
577
194
|
databaseTableName?: string;
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
em: EntityManager,
|
|
591
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
592
|
-
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
|
-
},
|
|
620
|
-
options?:
|
|
621
|
-
| {
|
|
622
|
-
telemetry?: TelemetryOptions;
|
|
623
|
-
databaseTableName?: string;
|
|
624
|
-
}
|
|
625
|
-
| undefined
|
|
626
|
-
);
|
|
627
|
-
createSubscription(
|
|
628
|
-
subscriptionDto: Dto['CreateSubscriptionMapper'],
|
|
629
|
-
em?: EntityManager
|
|
630
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
631
|
-
getSubscription(
|
|
632
|
-
idDto: IdDto,
|
|
633
|
-
em?: EntityManager
|
|
634
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
635
|
-
getUserSubscription(
|
|
636
|
-
idDto: IdDto,
|
|
637
|
-
em?: EntityManager
|
|
638
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
639
|
-
getOrganizationSubscription(
|
|
640
|
-
idDto: IdDto,
|
|
641
|
-
em?: EntityManager
|
|
642
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
643
|
-
updateSubscription(
|
|
644
|
-
subscriptionDto: Dto['UpdateSubscriptionMapper'],
|
|
645
|
-
em?: EntityManager
|
|
646
|
-
): Promise<Dto['SubscriptionMapper']>;
|
|
647
|
-
deleteSubscription(
|
|
648
|
-
idDto: {
|
|
649
|
-
id: string;
|
|
650
|
-
},
|
|
651
|
-
em?: EntityManager
|
|
652
|
-
): Promise<void>;
|
|
653
|
-
listSubscriptions(
|
|
654
|
-
idsDto: IdsDto,
|
|
655
|
-
em?: EntityManager
|
|
656
|
-
): Promise<Dto['SubscriptionMapper'][]>;
|
|
657
|
-
cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
658
|
-
resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
195
|
+
} | undefined);
|
|
196
|
+
createSubscription(subscriptionDto: Dto['CreateSubscriptionMapper'], em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
|
|
197
|
+
getSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
|
|
198
|
+
getUserSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
|
|
199
|
+
getOrganizationSubscription(idDto: IdDto, em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
|
|
200
|
+
updateSubscription(subscriptionDto: Dto['UpdateSubscriptionMapper'], em?: EntityManager): Promise<Dto['SubscriptionMapper']>;
|
|
201
|
+
deleteSubscription(idDto: {
|
|
202
|
+
id: string;
|
|
203
|
+
}, em?: EntityManager): Promise<void>;
|
|
204
|
+
listSubscriptions(idsDto: IdsDto, em?: EntityManager): Promise<Dto['SubscriptionMapper'][]>;
|
|
205
|
+
cancelSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
206
|
+
resumeSubscription(idDto: IdDto, em?: EntityManager): Promise<void>;
|
|
659
207
|
}
|
|
660
208
|
|
|
661
|
-
declare class StripeWebhookService<
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
StripeSubscriptionEntities<PartyEnum> = StripeSubscriptionEntities<PartyEnum>
|
|
674
|
-
> {
|
|
675
|
-
protected readonly stripeClient: Stripe__default;
|
|
676
|
-
protected readonly em: EntityManager;
|
|
677
|
-
protected readonly schemaValidator: SchemaValidator;
|
|
678
|
-
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
679
|
-
protected readonly billingPortalService: StripeBillingPortalService<
|
|
680
|
-
SchemaValidator,
|
|
681
|
-
BillingPortalEntities
|
|
682
|
-
>;
|
|
683
|
-
protected readonly checkoutSessionService: StripeCheckoutSessionService<
|
|
684
|
-
SchemaValidator,
|
|
685
|
-
StatusEnum,
|
|
686
|
-
CheckoutSessionEntities
|
|
687
|
-
>;
|
|
688
|
-
protected readonly paymentLinkService: StripePaymentLinkService<
|
|
689
|
-
SchemaValidator,
|
|
690
|
-
StatusEnum,
|
|
691
|
-
PaymentLinkEntities
|
|
692
|
-
>;
|
|
693
|
-
protected readonly planService: StripePlanService<
|
|
694
|
-
SchemaValidator,
|
|
695
|
-
PlanEntities
|
|
696
|
-
>;
|
|
697
|
-
protected readonly subscriptionService: StripeSubscriptionService<
|
|
698
|
-
SchemaValidator,
|
|
699
|
-
PartyEnum,
|
|
700
|
-
SubscriptionEntities
|
|
701
|
-
>;
|
|
702
|
-
constructor(
|
|
703
|
-
stripeClient: Stripe__default,
|
|
704
|
-
em: EntityManager,
|
|
705
|
-
schemaValidator: SchemaValidator,
|
|
706
|
-
openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>,
|
|
707
|
-
billingPortalService: StripeBillingPortalService<
|
|
708
|
-
SchemaValidator,
|
|
709
|
-
BillingPortalEntities
|
|
710
|
-
>,
|
|
711
|
-
checkoutSessionService: StripeCheckoutSessionService<
|
|
712
|
-
SchemaValidator,
|
|
713
|
-
StatusEnum,
|
|
714
|
-
CheckoutSessionEntities
|
|
715
|
-
>,
|
|
716
|
-
paymentLinkService: StripePaymentLinkService<
|
|
717
|
-
SchemaValidator,
|
|
718
|
-
StatusEnum,
|
|
719
|
-
PaymentLinkEntities
|
|
720
|
-
>,
|
|
721
|
-
planService: StripePlanService<SchemaValidator, PlanEntities>,
|
|
722
|
-
subscriptionService: StripeSubscriptionService<
|
|
723
|
-
SchemaValidator,
|
|
724
|
-
PartyEnum,
|
|
725
|
-
SubscriptionEntities
|
|
726
|
-
>
|
|
727
|
-
);
|
|
728
|
-
handleWebhookEvent(event: Stripe__default.Event): Promise<void>;
|
|
209
|
+
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>> {
|
|
210
|
+
protected readonly stripeClient: Stripe__default;
|
|
211
|
+
protected readonly em: EntityManager;
|
|
212
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
213
|
+
protected readonly openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>;
|
|
214
|
+
protected readonly billingPortalService: StripeBillingPortalService<SchemaValidator, BillingPortalEntities>;
|
|
215
|
+
protected readonly checkoutSessionService: StripeCheckoutSessionService<SchemaValidator, StatusEnum, CheckoutSessionEntities>;
|
|
216
|
+
protected readonly paymentLinkService: StripePaymentLinkService<SchemaValidator, StatusEnum, PaymentLinkEntities>;
|
|
217
|
+
protected readonly planService: StripePlanService<SchemaValidator, PlanEntities>;
|
|
218
|
+
protected readonly subscriptionService: StripeSubscriptionService<SchemaValidator, PartyEnum, SubscriptionEntities>;
|
|
219
|
+
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>);
|
|
220
|
+
handleWebhookEvent(event: Stripe__default.Event): Promise<void>;
|
|
729
221
|
}
|
|
730
222
|
|
|
731
|
-
export {
|
|
732
|
-
StripeBillingPortalService,
|
|
733
|
-
StripeCheckoutSessionService,
|
|
734
|
-
StripePaymentLinkService,
|
|
735
|
-
StripePlanService,
|
|
736
|
-
StripeSubscriptionService,
|
|
737
|
-
StripeWebhookService
|
|
738
|
-
};
|
|
223
|
+
export { StripeBillingPortalService, StripeCheckoutSessionService, StripePaymentLinkService, StripePlanService, StripeSubscriptionService, StripeWebhookService };
|