@forklaunch/implementation-billing-base 0.6.3 → 0.6.5
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 +1196 -342
- package/lib/domain/schemas/index.d.ts +1196 -342
- package/lib/domain/schemas/index.js +389 -250
- package/lib/domain/schemas/index.mjs +281 -225
- package/lib/domain/types/index.d.mts +282 -84
- package/lib/domain/types/index.d.ts +282 -84
- package/lib/domain/types/index.js +8 -4
- package/lib/eject/domain/schemas/billingPortal.schema.ts +1 -7
- package/lib/services/index.d.mts +361 -105
- package/lib/services/index.d.ts +361 -105
- package/lib/services/index.js +198 -161
- package/lib/services/index.mjs +182 -160
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// domain/schemas/billingPortal.schema.ts
|
|
2
|
-
import { serviceSchemaResolver } from
|
|
2
|
+
import { serviceSchemaResolver } from '@forklaunch/internal';
|
|
3
3
|
|
|
4
4
|
// domain/schemas/typebox/billingPortal.schema.ts
|
|
5
5
|
import {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
string,
|
|
9
9
|
unknown,
|
|
10
10
|
uuid
|
|
11
|
-
} from
|
|
11
|
+
} from '@forklaunch/validator/typebox';
|
|
12
12
|
var CreateBillingPortalSchema = {
|
|
13
13
|
customerId: string,
|
|
14
14
|
expiresAt: date,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
string as string2,
|
|
44
44
|
unknown as unknown2,
|
|
45
45
|
uuid as uuid2
|
|
46
|
-
} from
|
|
46
|
+
} from '@forklaunch/validator/zod';
|
|
47
47
|
var CreateBillingPortalSchema2 = {
|
|
48
48
|
customerId: string2,
|
|
49
49
|
expiresAt: date2,
|
|
@@ -78,7 +78,7 @@ var BaseBillingPortalServiceSchemas3 = serviceSchemaResolver(
|
|
|
78
78
|
);
|
|
79
79
|
|
|
80
80
|
// domain/schemas/checkoutSession.schema.ts
|
|
81
|
-
import { serviceSchemaResolver as serviceSchemaResolver2 } from
|
|
81
|
+
import { serviceSchemaResolver as serviceSchemaResolver2 } from '@forklaunch/internal';
|
|
82
82
|
|
|
83
83
|
// domain/schemas/typebox/checkoutSession.schema.ts
|
|
84
84
|
import {
|
|
@@ -89,8 +89,12 @@ import {
|
|
|
89
89
|
string as string3,
|
|
90
90
|
unknown as unknown3,
|
|
91
91
|
uuid as uuid3
|
|
92
|
-
} from
|
|
93
|
-
var CreateCheckoutSessionSchema = (
|
|
92
|
+
} from '@forklaunch/validator/typebox';
|
|
93
|
+
var CreateCheckoutSessionSchema = (
|
|
94
|
+
PaymentMethodEnum,
|
|
95
|
+
CurrencyEnum,
|
|
96
|
+
StatusEnum
|
|
97
|
+
) => ({
|
|
94
98
|
customerId: string3,
|
|
95
99
|
paymentMethods: array(enum_(PaymentMethodEnum)),
|
|
96
100
|
currency: enum_(CurrencyEnum),
|
|
@@ -101,32 +105,36 @@ var CreateCheckoutSessionSchema = (PaymentMethodEnum, CurrencyEnum, StatusEnum)
|
|
|
101
105
|
status: enum_(StatusEnum),
|
|
102
106
|
providerFields: optional3(unknown3)
|
|
103
107
|
});
|
|
104
|
-
var UpdateCheckoutSessionSchema =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
108
|
+
var UpdateCheckoutSessionSchema =
|
|
109
|
+
({ uuidId }) =>
|
|
110
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
111
|
+
id: uuidId ? uuid3 : string3,
|
|
112
|
+
customerId: optional3(string3),
|
|
113
|
+
paymentMethods: optional3(array(enum_(PaymentMethodEnum))),
|
|
114
|
+
currency: optional3(enum_(CurrencyEnum)),
|
|
115
|
+
uri: optional3(string3),
|
|
116
|
+
successRedirectUri: optional3(string3),
|
|
117
|
+
cancelRedirectUri: optional3(string3),
|
|
118
|
+
expiresAt: optional3(date3),
|
|
119
|
+
status: optional3(enum_(StatusEnum)),
|
|
120
|
+
providerFields: optional3(unknown3)
|
|
121
|
+
});
|
|
122
|
+
var CheckoutSessionSchema =
|
|
123
|
+
({ uuidId }) =>
|
|
124
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
125
|
+
id: uuidId ? uuid3 : string3,
|
|
126
|
+
customerId: string3,
|
|
127
|
+
paymentMethods: array(enum_(PaymentMethodEnum)),
|
|
128
|
+
currency: enum_(CurrencyEnum),
|
|
129
|
+
uri: optional3(string3),
|
|
130
|
+
successRedirectUri: optional3(string3),
|
|
131
|
+
cancelRedirectUri: optional3(string3),
|
|
132
|
+
expiresAt: date3,
|
|
133
|
+
status: enum_(StatusEnum),
|
|
134
|
+
providerFields: optional3(unknown3),
|
|
135
|
+
createdAt: optional3(date3),
|
|
136
|
+
updatedAt: optional3(date3)
|
|
137
|
+
});
|
|
130
138
|
var BaseCheckoutSessionServiceSchemas = (options) => ({
|
|
131
139
|
CreateCheckoutSessionSchema,
|
|
132
140
|
UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema(options),
|
|
@@ -142,8 +150,12 @@ import {
|
|
|
142
150
|
string as string4,
|
|
143
151
|
unknown as unknown4,
|
|
144
152
|
uuid as uuid4
|
|
145
|
-
} from
|
|
146
|
-
var CreateCheckoutSessionSchema2 = (
|
|
153
|
+
} from '@forklaunch/validator/zod';
|
|
154
|
+
var CreateCheckoutSessionSchema2 = (
|
|
155
|
+
PaymentMethodEnum,
|
|
156
|
+
CurrencyEnum,
|
|
157
|
+
StatusEnum
|
|
158
|
+
) => ({
|
|
147
159
|
customerId: string4,
|
|
148
160
|
paymentMethods: array2(enum_2(PaymentMethodEnum)),
|
|
149
161
|
currency: enum_2(CurrencyEnum),
|
|
@@ -154,32 +166,36 @@ var CreateCheckoutSessionSchema2 = (PaymentMethodEnum, CurrencyEnum, StatusEnum)
|
|
|
154
166
|
status: enum_2(StatusEnum),
|
|
155
167
|
providerFields: optional4(unknown4)
|
|
156
168
|
});
|
|
157
|
-
var UpdateCheckoutSessionSchema2 =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
169
|
+
var UpdateCheckoutSessionSchema2 =
|
|
170
|
+
({ uuidId }) =>
|
|
171
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
172
|
+
id: uuidId ? uuid4 : string4,
|
|
173
|
+
customerId: optional4(string4),
|
|
174
|
+
paymentMethods: optional4(array2(enum_2(PaymentMethodEnum))),
|
|
175
|
+
currency: optional4(enum_2(CurrencyEnum)),
|
|
176
|
+
uri: optional4(string4),
|
|
177
|
+
successRedirectUri: optional4(string4),
|
|
178
|
+
cancelRedirectUri: optional4(string4),
|
|
179
|
+
expiresAt: optional4(date4),
|
|
180
|
+
status: optional4(enum_2(StatusEnum)),
|
|
181
|
+
providerFields: optional4(unknown4)
|
|
182
|
+
});
|
|
183
|
+
var CheckoutSessionSchema2 =
|
|
184
|
+
({ uuidId }) =>
|
|
185
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
186
|
+
id: uuidId ? uuid4 : string4,
|
|
187
|
+
customerId: string4,
|
|
188
|
+
paymentMethods: array2(enum_2(PaymentMethodEnum)),
|
|
189
|
+
currency: enum_2(CurrencyEnum),
|
|
190
|
+
uri: optional4(string4),
|
|
191
|
+
successRedirectUri: optional4(string4),
|
|
192
|
+
cancelRedirectUri: optional4(string4),
|
|
193
|
+
expiresAt: date4,
|
|
194
|
+
status: enum_2(StatusEnum),
|
|
195
|
+
providerFields: optional4(unknown4),
|
|
196
|
+
createdAt: optional4(date4),
|
|
197
|
+
updatedAt: optional4(date4)
|
|
198
|
+
});
|
|
183
199
|
var BaseCheckoutSessionServiceSchemas2 = (options) => ({
|
|
184
200
|
CreateCheckoutSessionSchema: CreateCheckoutSessionSchema2,
|
|
185
201
|
UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema2(options),
|
|
@@ -193,7 +209,7 @@ var BaseCheckoutSessionServiceSchemas3 = serviceSchemaResolver2(
|
|
|
193
209
|
);
|
|
194
210
|
|
|
195
211
|
// domain/schemas/paymentLink.schema.ts
|
|
196
|
-
import { serviceSchemaResolver as serviceSchemaResolver3 } from
|
|
212
|
+
import { serviceSchemaResolver as serviceSchemaResolver3 } from '@forklaunch/internal';
|
|
197
213
|
|
|
198
214
|
// domain/schemas/typebox/paymentLink.schema.ts
|
|
199
215
|
import {
|
|
@@ -205,32 +221,40 @@ import {
|
|
|
205
221
|
string as string5,
|
|
206
222
|
unknown as unknown5,
|
|
207
223
|
uuid as uuid5
|
|
208
|
-
} from
|
|
209
|
-
var CreatePaymentLinkSchema = (
|
|
224
|
+
} from '@forklaunch/validator/typebox';
|
|
225
|
+
var CreatePaymentLinkSchema = (
|
|
226
|
+
PaymentMethodEnum,
|
|
227
|
+
CurrencyEnum,
|
|
228
|
+
StatusEnum
|
|
229
|
+
) => ({
|
|
210
230
|
amount: number,
|
|
211
231
|
paymentMethods: array3(enum_3(PaymentMethodEnum)),
|
|
212
232
|
currency: enum_3(CurrencyEnum),
|
|
213
233
|
status: enum_3(StatusEnum),
|
|
214
234
|
providerFields: optional5(unknown5)
|
|
215
235
|
});
|
|
216
|
-
var UpdatePaymentLinkSchema =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
236
|
+
var UpdatePaymentLinkSchema =
|
|
237
|
+
({ uuidId }) =>
|
|
238
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
239
|
+
id: uuidId ? uuid5 : string5,
|
|
240
|
+
amount: optional5(number),
|
|
241
|
+
paymentMethods: optional5(array3(enum_3(PaymentMethodEnum))),
|
|
242
|
+
currency: optional5(enum_3(CurrencyEnum)),
|
|
243
|
+
status: optional5(enum_3(StatusEnum)),
|
|
244
|
+
providerFields: optional5(unknown5)
|
|
245
|
+
});
|
|
246
|
+
var PaymentLinkSchema =
|
|
247
|
+
({ uuidId }) =>
|
|
248
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
249
|
+
id: uuidId ? uuid5 : string5,
|
|
250
|
+
amount: number,
|
|
251
|
+
currency: enum_3(CurrencyEnum),
|
|
252
|
+
paymentMethods: array3(enum_3(PaymentMethodEnum)),
|
|
253
|
+
status: enum_3(StatusEnum),
|
|
254
|
+
providerFields: optional5(unknown5),
|
|
255
|
+
createdAt: optional5(date5),
|
|
256
|
+
updatedAt: optional5(date5)
|
|
257
|
+
});
|
|
234
258
|
var BasePaymentLinkServiceSchemas = (options) => ({
|
|
235
259
|
CreatePaymentLinkSchema,
|
|
236
260
|
UpdatePaymentLinkSchema: UpdatePaymentLinkSchema(options),
|
|
@@ -247,32 +271,40 @@ import {
|
|
|
247
271
|
string as string6,
|
|
248
272
|
unknown as unknown6,
|
|
249
273
|
uuid as uuid6
|
|
250
|
-
} from
|
|
251
|
-
var CreatePaymentLinkSchema2 = (
|
|
274
|
+
} from '@forklaunch/validator/zod';
|
|
275
|
+
var CreatePaymentLinkSchema2 = (
|
|
276
|
+
PaymentMethodEnum,
|
|
277
|
+
CurrencyEnum,
|
|
278
|
+
StatusEnum
|
|
279
|
+
) => ({
|
|
252
280
|
amount: number2,
|
|
253
281
|
paymentMethods: array4(enum_4(PaymentMethodEnum)),
|
|
254
282
|
currency: enum_4(CurrencyEnum),
|
|
255
283
|
status: enum_4(StatusEnum),
|
|
256
284
|
providerFields: optional6(unknown6)
|
|
257
285
|
});
|
|
258
|
-
var UpdatePaymentLinkSchema2 =
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
286
|
+
var UpdatePaymentLinkSchema2 =
|
|
287
|
+
({ uuidId }) =>
|
|
288
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
289
|
+
id: uuidId ? uuid6 : string6,
|
|
290
|
+
amount: optional6(number2),
|
|
291
|
+
paymentMethods: optional6(array4(enum_4(PaymentMethodEnum))),
|
|
292
|
+
currency: optional6(enum_4(CurrencyEnum)),
|
|
293
|
+
status: optional6(enum_4(StatusEnum)),
|
|
294
|
+
providerFields: optional6(unknown6)
|
|
295
|
+
});
|
|
296
|
+
var PaymentLinkSchema2 =
|
|
297
|
+
({ uuidId }) =>
|
|
298
|
+
(PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
299
|
+
id: uuidId ? uuid6 : string6,
|
|
300
|
+
amount: number2,
|
|
301
|
+
paymentMethods: array4(enum_4(PaymentMethodEnum)),
|
|
302
|
+
currency: enum_4(CurrencyEnum),
|
|
303
|
+
status: enum_4(StatusEnum),
|
|
304
|
+
providerFields: optional6(unknown6),
|
|
305
|
+
createdAt: optional6(date6),
|
|
306
|
+
updatedAt: optional6(date6)
|
|
307
|
+
});
|
|
276
308
|
var BasePaymentLinkServiceSchemas2 = (options) => ({
|
|
277
309
|
CreatePaymentLinkSchema: CreatePaymentLinkSchema2,
|
|
278
310
|
UpdatePaymentLinkSchema: UpdatePaymentLinkSchema2(options),
|
|
@@ -286,7 +318,7 @@ var BasePaymentLinkServiceSchemas3 = serviceSchemaResolver3(
|
|
|
286
318
|
);
|
|
287
319
|
|
|
288
320
|
// domain/schemas/plan.schema.ts
|
|
289
|
-
import { serviceSchemaResolver as serviceSchemaResolver4 } from
|
|
321
|
+
import { serviceSchemaResolver as serviceSchemaResolver4 } from '@forklaunch/internal';
|
|
290
322
|
|
|
291
323
|
// domain/schemas/typebox/plan.schema.ts
|
|
292
324
|
import {
|
|
@@ -299,8 +331,12 @@ import {
|
|
|
299
331
|
string as string7,
|
|
300
332
|
unknown as unknown7,
|
|
301
333
|
uuid as uuid7
|
|
302
|
-
} from
|
|
303
|
-
var CreatePlanSchema = (
|
|
334
|
+
} from '@forklaunch/validator/typebox';
|
|
335
|
+
var CreatePlanSchema = (
|
|
336
|
+
PlanCadenceEnum,
|
|
337
|
+
CurrencyEnum,
|
|
338
|
+
BillingProviderEnum
|
|
339
|
+
) => ({
|
|
304
340
|
name: string7,
|
|
305
341
|
description: optional7(string7),
|
|
306
342
|
price: number3,
|
|
@@ -312,34 +348,38 @@ var CreatePlanSchema = (PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => (
|
|
|
312
348
|
active: boolean,
|
|
313
349
|
providerFields: optional7(unknown7)
|
|
314
350
|
});
|
|
315
|
-
var UpdatePlanSchema =
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
351
|
+
var UpdatePlanSchema =
|
|
352
|
+
({ uuidId }) =>
|
|
353
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
354
|
+
id: uuidId ? uuid7 : string7,
|
|
355
|
+
name: optional7(string7),
|
|
356
|
+
description: optional7(string7),
|
|
357
|
+
price: optional7(number3),
|
|
358
|
+
cadence: optional7(enum_5(PlanCadenceEnum)),
|
|
359
|
+
currency: optional7(enum_5(CurrencyEnum)),
|
|
360
|
+
features: optional7(array5(string7)),
|
|
361
|
+
externalId: optional7(string7),
|
|
362
|
+
billingProvider: optional7(enum_5(BillingProviderEnum)),
|
|
363
|
+
active: optional7(boolean),
|
|
364
|
+
providerFields: optional7(unknown7)
|
|
365
|
+
});
|
|
366
|
+
var PlanSchema =
|
|
367
|
+
({ uuidId }) =>
|
|
368
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
369
|
+
id: uuidId ? uuid7 : string7,
|
|
370
|
+
name: string7,
|
|
371
|
+
description: optional7(string7),
|
|
372
|
+
price: number3,
|
|
373
|
+
cadence: enum_5(PlanCadenceEnum),
|
|
374
|
+
currency: enum_5(CurrencyEnum),
|
|
375
|
+
features: optional7(array5(string7)),
|
|
376
|
+
externalId: string7,
|
|
377
|
+
billingProvider: optional7(enum_5(BillingProviderEnum)),
|
|
378
|
+
active: boolean,
|
|
379
|
+
providerFields: optional7(unknown7),
|
|
380
|
+
createdAt: optional7(date7),
|
|
381
|
+
updatedAt: optional7(date7)
|
|
382
|
+
});
|
|
343
383
|
var BasePlanServiceSchemas = (options) => ({
|
|
344
384
|
CreatePlanSchema,
|
|
345
385
|
UpdatePlanSchema: UpdatePlanSchema(options),
|
|
@@ -357,8 +397,12 @@ import {
|
|
|
357
397
|
string as string8,
|
|
358
398
|
unknown as unknown8,
|
|
359
399
|
uuid as uuid8
|
|
360
|
-
} from
|
|
361
|
-
var CreatePlanSchema2 = (
|
|
400
|
+
} from '@forklaunch/validator/zod';
|
|
401
|
+
var CreatePlanSchema2 = (
|
|
402
|
+
PlanCadenceEnum,
|
|
403
|
+
CurrencyEnum,
|
|
404
|
+
BillingProviderEnum
|
|
405
|
+
) => ({
|
|
362
406
|
name: string8,
|
|
363
407
|
description: optional8(string8),
|
|
364
408
|
price: number4,
|
|
@@ -370,34 +414,38 @@ var CreatePlanSchema2 = (PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) =>
|
|
|
370
414
|
active: boolean2,
|
|
371
415
|
providerFields: optional8(unknown8)
|
|
372
416
|
});
|
|
373
|
-
var UpdatePlanSchema2 =
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
417
|
+
var UpdatePlanSchema2 =
|
|
418
|
+
({ uuidId }) =>
|
|
419
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
420
|
+
id: uuidId ? uuid8 : string8,
|
|
421
|
+
name: optional8(string8),
|
|
422
|
+
description: optional8(string8),
|
|
423
|
+
price: optional8(number4),
|
|
424
|
+
cadence: optional8(enum_6(PlanCadenceEnum)),
|
|
425
|
+
currency: optional8(enum_6(CurrencyEnum)),
|
|
426
|
+
features: optional8(array6(string8)),
|
|
427
|
+
externalId: optional8(string8),
|
|
428
|
+
billingProvider: optional8(enum_6(BillingProviderEnum)),
|
|
429
|
+
active: optional8(boolean2),
|
|
430
|
+
providerFields: optional8(unknown8)
|
|
431
|
+
});
|
|
432
|
+
var PlanSchema2 =
|
|
433
|
+
({ uuidId }) =>
|
|
434
|
+
(PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
435
|
+
id: uuidId ? uuid8 : string8,
|
|
436
|
+
name: string8,
|
|
437
|
+
description: optional8(string8),
|
|
438
|
+
price: number4,
|
|
439
|
+
cadence: enum_6(PlanCadenceEnum),
|
|
440
|
+
currency: enum_6(CurrencyEnum),
|
|
441
|
+
features: optional8(array6(string8)),
|
|
442
|
+
externalId: string8,
|
|
443
|
+
billingProvider: optional8(enum_6(BillingProviderEnum)),
|
|
444
|
+
active: boolean2,
|
|
445
|
+
providerFields: optional8(unknown8),
|
|
446
|
+
createdAt: optional8(date8),
|
|
447
|
+
updatedAt: optional8(date8)
|
|
448
|
+
});
|
|
401
449
|
var BasePlanServiceSchemas2 = (options) => ({
|
|
402
450
|
CreatePlanSchema: CreatePlanSchema2,
|
|
403
451
|
UpdatePlanSchema: UpdatePlanSchema2(options),
|
|
@@ -411,7 +459,7 @@ var BasePlanServiceSchemas3 = serviceSchemaResolver4(
|
|
|
411
459
|
);
|
|
412
460
|
|
|
413
461
|
// domain/schemas/subscription.schema.ts
|
|
414
|
-
import { serviceSchemaResolver as serviceSchemaResolver5 } from
|
|
462
|
+
import { serviceSchemaResolver as serviceSchemaResolver5 } from '@forklaunch/internal';
|
|
415
463
|
|
|
416
464
|
// domain/schemas/typebox/subscription.schema.ts
|
|
417
465
|
import {
|
|
@@ -422,7 +470,7 @@ import {
|
|
|
422
470
|
string as string9,
|
|
423
471
|
unknown as unknown9,
|
|
424
472
|
uuid as uuid9
|
|
425
|
-
} from
|
|
473
|
+
} from '@forklaunch/validator/typebox';
|
|
426
474
|
var CreateSubscriptionSchema = (PartyEnum, BillingProviderEnum) => ({
|
|
427
475
|
partyId: string9,
|
|
428
476
|
partyType: enum_7(PartyEnum),
|
|
@@ -436,36 +484,40 @@ var CreateSubscriptionSchema = (PartyEnum, BillingProviderEnum) => ({
|
|
|
436
484
|
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
437
485
|
providerFields: optional9(unknown9)
|
|
438
486
|
});
|
|
439
|
-
var UpdateSubscriptionSchema =
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
487
|
+
var UpdateSubscriptionSchema =
|
|
488
|
+
({ uuidId }) =>
|
|
489
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
490
|
+
id: uuidId ? uuid9 : string9,
|
|
491
|
+
partyId: optional9(string9),
|
|
492
|
+
partyType: optional9(enum_7(PartyEnum)),
|
|
493
|
+
productId: optional9(string9),
|
|
494
|
+
description: optional9(string9),
|
|
495
|
+
active: optional9(boolean3),
|
|
496
|
+
externalId: optional9(string9),
|
|
497
|
+
startDate: optional9(date9),
|
|
498
|
+
endDate: optional9(date9),
|
|
499
|
+
status: optional9(string9),
|
|
500
|
+
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
501
|
+
providerFields: optional9(unknown9)
|
|
502
|
+
});
|
|
503
|
+
var SubscriptionSchema =
|
|
504
|
+
({ uuidId }) =>
|
|
505
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
506
|
+
id: uuidId ? uuid9 : string9,
|
|
507
|
+
partyId: string9,
|
|
508
|
+
partyType: enum_7(PartyEnum),
|
|
509
|
+
productId: string9,
|
|
510
|
+
description: optional9(string9),
|
|
511
|
+
active: boolean3,
|
|
512
|
+
externalId: string9,
|
|
513
|
+
startDate: date9,
|
|
514
|
+
endDate: optional9(date9),
|
|
515
|
+
status: string9,
|
|
516
|
+
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
517
|
+
providerFields: optional9(unknown9),
|
|
518
|
+
createdAt: optional9(date9),
|
|
519
|
+
updatedAt: optional9(date9)
|
|
520
|
+
});
|
|
469
521
|
var BaseSubscriptionServiceSchemas = (options) => ({
|
|
470
522
|
CreateSubscriptionSchema,
|
|
471
523
|
UpdateSubscriptionSchema: UpdateSubscriptionSchema(options),
|
|
@@ -481,7 +533,7 @@ import {
|
|
|
481
533
|
string as string10,
|
|
482
534
|
unknown as unknown10,
|
|
483
535
|
uuid as uuid10
|
|
484
|
-
} from
|
|
536
|
+
} from '@forklaunch/validator/zod';
|
|
485
537
|
var CreateSubscriptionSchema2 = (PartyEnum, BillingProviderEnum) => ({
|
|
486
538
|
partyId: string10,
|
|
487
539
|
partyType: enum_8(PartyEnum),
|
|
@@ -495,36 +547,40 @@ var CreateSubscriptionSchema2 = (PartyEnum, BillingProviderEnum) => ({
|
|
|
495
547
|
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
496
548
|
providerFields: optional10(unknown10)
|
|
497
549
|
});
|
|
498
|
-
var UpdateSubscriptionSchema2 =
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
550
|
+
var UpdateSubscriptionSchema2 =
|
|
551
|
+
({ uuidId }) =>
|
|
552
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
553
|
+
id: uuidId ? uuid10 : string10,
|
|
554
|
+
partyId: optional10(string10),
|
|
555
|
+
partyType: optional10(enum_8(PartyEnum)),
|
|
556
|
+
productId: optional10(string10),
|
|
557
|
+
description: optional10(string10),
|
|
558
|
+
active: optional10(boolean4),
|
|
559
|
+
externalId: optional10(string10),
|
|
560
|
+
startDate: optional10(date10),
|
|
561
|
+
endDate: optional10(date10),
|
|
562
|
+
status: optional10(string10),
|
|
563
|
+
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
564
|
+
providerFields: optional10(unknown10)
|
|
565
|
+
});
|
|
566
|
+
var SubscriptionSchema2 =
|
|
567
|
+
({ uuidId }) =>
|
|
568
|
+
(PartyEnum, BillingProviderEnum) => ({
|
|
569
|
+
id: uuidId ? uuid10 : string10,
|
|
570
|
+
partyId: string10,
|
|
571
|
+
partyType: enum_8(PartyEnum),
|
|
572
|
+
productId: string10,
|
|
573
|
+
description: optional10(string10),
|
|
574
|
+
active: boolean4,
|
|
575
|
+
externalId: string10,
|
|
576
|
+
startDate: date10,
|
|
577
|
+
endDate: optional10(date10),
|
|
578
|
+
status: string10,
|
|
579
|
+
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
580
|
+
providerFields: optional10(unknown10),
|
|
581
|
+
createdAt: optional10(date10),
|
|
582
|
+
updatedAt: optional10(date10)
|
|
583
|
+
});
|
|
528
584
|
var BaseSubscriptionServiceSchemas2 = (options) => ({
|
|
529
585
|
CreateSubscriptionSchema: CreateSubscriptionSchema2,
|
|
530
586
|
UpdateSubscriptionSchema: UpdateSubscriptionSchema2(options),
|