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