@forklaunch/implementation-billing-base 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/domain/schemas/index.d.mts +342 -1190
- package/lib/domain/schemas/index.d.ts +342 -1190
- package/lib/domain/schemas/index.js +252 -385
- package/lib/domain/schemas/index.mjs +227 -277
- package/lib/domain/types/index.d.mts +86 -296
- package/lib/domain/types/index.d.ts +86 -296
- package/lib/domain/types/index.js +4 -8
- package/lib/eject/domain/schemas/billingPortal.schema.ts +7 -1
- package/lib/eject/domain/schemas/checkoutSession.schema.ts +3 -0
- package/lib/eject/domain/types/billingPortal.mapper.types.ts +2 -2
- 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 +8 -8
|
@@ -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,49 +89,44 @@ 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),
|
|
97
|
+
uri: optional3(string3),
|
|
101
98
|
successRedirectUri: optional3(string3),
|
|
102
99
|
cancelRedirectUri: optional3(string3),
|
|
103
100
|
expiresAt: date3,
|
|
104
101
|
status: enum_(StatusEnum),
|
|
105
102
|
providerFields: optional3(unknown3)
|
|
106
103
|
});
|
|
107
|
-
var UpdateCheckoutSessionSchema =
|
|
108
|
-
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(PaymentMethodEnum,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
updatedAt: optional3(date3)
|
|
134
|
-
});
|
|
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
|
+
});
|
|
135
130
|
var BaseCheckoutSessionServiceSchemas = (options) => ({
|
|
136
131
|
CreateCheckoutSessionSchema,
|
|
137
132
|
UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema(options),
|
|
@@ -147,49 +142,44 @@ import {
|
|
|
147
142
|
string as string4,
|
|
148
143
|
unknown as unknown4,
|
|
149
144
|
uuid as uuid4
|
|
150
|
-
} from
|
|
151
|
-
var CreateCheckoutSessionSchema2 = (
|
|
152
|
-
PaymentMethodEnum,
|
|
153
|
-
CurrencyEnum,
|
|
154
|
-
StatusEnum
|
|
155
|
-
) => ({
|
|
145
|
+
} from "@forklaunch/validator/zod";
|
|
146
|
+
var CreateCheckoutSessionSchema2 = (PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
156
147
|
customerId: string4,
|
|
157
148
|
paymentMethods: array2(enum_2(PaymentMethodEnum)),
|
|
158
149
|
currency: enum_2(CurrencyEnum),
|
|
150
|
+
uri: optional4(string4),
|
|
159
151
|
successRedirectUri: optional4(string4),
|
|
160
152
|
cancelRedirectUri: optional4(string4),
|
|
161
153
|
expiresAt: date4,
|
|
162
154
|
status: enum_2(StatusEnum),
|
|
163
155
|
providerFields: optional4(unknown4)
|
|
164
156
|
});
|
|
165
|
-
var UpdateCheckoutSessionSchema2 =
|
|
166
|
-
|
|
167
|
-
(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
(PaymentMethodEnum,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
updatedAt: optional4(date4)
|
|
192
|
-
});
|
|
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
|
+
});
|
|
193
183
|
var BaseCheckoutSessionServiceSchemas2 = (options) => ({
|
|
194
184
|
CreateCheckoutSessionSchema: CreateCheckoutSessionSchema2,
|
|
195
185
|
UpdateCheckoutSessionSchema: UpdateCheckoutSessionSchema2(options),
|
|
@@ -203,7 +193,7 @@ var BaseCheckoutSessionServiceSchemas3 = serviceSchemaResolver2(
|
|
|
203
193
|
);
|
|
204
194
|
|
|
205
195
|
// domain/schemas/paymentLink.schema.ts
|
|
206
|
-
import { serviceSchemaResolver as serviceSchemaResolver3 } from
|
|
196
|
+
import { serviceSchemaResolver as serviceSchemaResolver3 } from "@forklaunch/internal";
|
|
207
197
|
|
|
208
198
|
// domain/schemas/typebox/paymentLink.schema.ts
|
|
209
199
|
import {
|
|
@@ -215,40 +205,32 @@ import {
|
|
|
215
205
|
string as string5,
|
|
216
206
|
unknown as unknown5,
|
|
217
207
|
uuid as uuid5
|
|
218
|
-
} from
|
|
219
|
-
var CreatePaymentLinkSchema = (
|
|
220
|
-
PaymentMethodEnum,
|
|
221
|
-
CurrencyEnum,
|
|
222
|
-
StatusEnum
|
|
223
|
-
) => ({
|
|
208
|
+
} from "@forklaunch/validator/typebox";
|
|
209
|
+
var CreatePaymentLinkSchema = (PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
224
210
|
amount: number,
|
|
225
211
|
paymentMethods: array3(enum_3(PaymentMethodEnum)),
|
|
226
212
|
currency: enum_3(CurrencyEnum),
|
|
227
213
|
status: enum_3(StatusEnum),
|
|
228
214
|
providerFields: optional5(unknown5)
|
|
229
215
|
});
|
|
230
|
-
var UpdatePaymentLinkSchema =
|
|
231
|
-
|
|
232
|
-
(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(
|
|
242
|
-
(PaymentMethodEnum,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
providerFields: optional5(unknown5),
|
|
249
|
-
createdAt: optional5(date5),
|
|
250
|
-
updatedAt: optional5(date5)
|
|
251
|
-
});
|
|
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
|
+
});
|
|
252
234
|
var BasePaymentLinkServiceSchemas = (options) => ({
|
|
253
235
|
CreatePaymentLinkSchema,
|
|
254
236
|
UpdatePaymentLinkSchema: UpdatePaymentLinkSchema(options),
|
|
@@ -265,40 +247,32 @@ import {
|
|
|
265
247
|
string as string6,
|
|
266
248
|
unknown as unknown6,
|
|
267
249
|
uuid as uuid6
|
|
268
|
-
} from
|
|
269
|
-
var CreatePaymentLinkSchema2 = (
|
|
270
|
-
PaymentMethodEnum,
|
|
271
|
-
CurrencyEnum,
|
|
272
|
-
StatusEnum
|
|
273
|
-
) => ({
|
|
250
|
+
} from "@forklaunch/validator/zod";
|
|
251
|
+
var CreatePaymentLinkSchema2 = (PaymentMethodEnum, CurrencyEnum, StatusEnum) => ({
|
|
274
252
|
amount: number2,
|
|
275
253
|
paymentMethods: array4(enum_4(PaymentMethodEnum)),
|
|
276
254
|
currency: enum_4(CurrencyEnum),
|
|
277
255
|
status: enum_4(StatusEnum),
|
|
278
256
|
providerFields: optional6(unknown6)
|
|
279
257
|
});
|
|
280
|
-
var UpdatePaymentLinkSchema2 =
|
|
281
|
-
|
|
282
|
-
(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
(
|
|
292
|
-
(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
providerFields: optional6(unknown6),
|
|
299
|
-
createdAt: optional6(date6),
|
|
300
|
-
updatedAt: optional6(date6)
|
|
301
|
-
});
|
|
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
|
+
});
|
|
302
276
|
var BasePaymentLinkServiceSchemas2 = (options) => ({
|
|
303
277
|
CreatePaymentLinkSchema: CreatePaymentLinkSchema2,
|
|
304
278
|
UpdatePaymentLinkSchema: UpdatePaymentLinkSchema2(options),
|
|
@@ -312,7 +286,7 @@ var BasePaymentLinkServiceSchemas3 = serviceSchemaResolver3(
|
|
|
312
286
|
);
|
|
313
287
|
|
|
314
288
|
// domain/schemas/plan.schema.ts
|
|
315
|
-
import { serviceSchemaResolver as serviceSchemaResolver4 } from
|
|
289
|
+
import { serviceSchemaResolver as serviceSchemaResolver4 } from "@forklaunch/internal";
|
|
316
290
|
|
|
317
291
|
// domain/schemas/typebox/plan.schema.ts
|
|
318
292
|
import {
|
|
@@ -325,12 +299,8 @@ import {
|
|
|
325
299
|
string as string7,
|
|
326
300
|
unknown as unknown7,
|
|
327
301
|
uuid as uuid7
|
|
328
|
-
} from
|
|
329
|
-
var CreatePlanSchema = (
|
|
330
|
-
PlanCadenceEnum,
|
|
331
|
-
CurrencyEnum,
|
|
332
|
-
BillingProviderEnum
|
|
333
|
-
) => ({
|
|
302
|
+
} from "@forklaunch/validator/typebox";
|
|
303
|
+
var CreatePlanSchema = (PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
334
304
|
name: string7,
|
|
335
305
|
description: optional7(string7),
|
|
336
306
|
price: number3,
|
|
@@ -342,38 +312,34 @@ var CreatePlanSchema = (
|
|
|
342
312
|
active: boolean,
|
|
343
313
|
providerFields: optional7(unknown7)
|
|
344
314
|
});
|
|
345
|
-
var UpdatePlanSchema =
|
|
346
|
-
|
|
347
|
-
(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
providerFields: optional7(unknown7),
|
|
374
|
-
createdAt: optional7(date7),
|
|
375
|
-
updatedAt: optional7(date7)
|
|
376
|
-
});
|
|
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
|
+
});
|
|
377
343
|
var BasePlanServiceSchemas = (options) => ({
|
|
378
344
|
CreatePlanSchema,
|
|
379
345
|
UpdatePlanSchema: UpdatePlanSchema(options),
|
|
@@ -391,12 +357,8 @@ import {
|
|
|
391
357
|
string as string8,
|
|
392
358
|
unknown as unknown8,
|
|
393
359
|
uuid as uuid8
|
|
394
|
-
} from
|
|
395
|
-
var CreatePlanSchema2 = (
|
|
396
|
-
PlanCadenceEnum,
|
|
397
|
-
CurrencyEnum,
|
|
398
|
-
BillingProviderEnum
|
|
399
|
-
) => ({
|
|
360
|
+
} from "@forklaunch/validator/zod";
|
|
361
|
+
var CreatePlanSchema2 = (PlanCadenceEnum, CurrencyEnum, BillingProviderEnum) => ({
|
|
400
362
|
name: string8,
|
|
401
363
|
description: optional8(string8),
|
|
402
364
|
price: number4,
|
|
@@ -408,38 +370,34 @@ var CreatePlanSchema2 = (
|
|
|
408
370
|
active: boolean2,
|
|
409
371
|
providerFields: optional8(unknown8)
|
|
410
372
|
});
|
|
411
|
-
var UpdatePlanSchema2 =
|
|
412
|
-
|
|
413
|
-
(
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
providerFields: optional8(unknown8),
|
|
440
|
-
createdAt: optional8(date8),
|
|
441
|
-
updatedAt: optional8(date8)
|
|
442
|
-
});
|
|
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
|
+
});
|
|
443
401
|
var BasePlanServiceSchemas2 = (options) => ({
|
|
444
402
|
CreatePlanSchema: CreatePlanSchema2,
|
|
445
403
|
UpdatePlanSchema: UpdatePlanSchema2(options),
|
|
@@ -453,7 +411,7 @@ var BasePlanServiceSchemas3 = serviceSchemaResolver4(
|
|
|
453
411
|
);
|
|
454
412
|
|
|
455
413
|
// domain/schemas/subscription.schema.ts
|
|
456
|
-
import { serviceSchemaResolver as serviceSchemaResolver5 } from
|
|
414
|
+
import { serviceSchemaResolver as serviceSchemaResolver5 } from "@forklaunch/internal";
|
|
457
415
|
|
|
458
416
|
// domain/schemas/typebox/subscription.schema.ts
|
|
459
417
|
import {
|
|
@@ -464,7 +422,7 @@ import {
|
|
|
464
422
|
string as string9,
|
|
465
423
|
unknown as unknown9,
|
|
466
424
|
uuid as uuid9
|
|
467
|
-
} from
|
|
425
|
+
} from "@forklaunch/validator/typebox";
|
|
468
426
|
var CreateSubscriptionSchema = (PartyEnum, BillingProviderEnum) => ({
|
|
469
427
|
partyId: string9,
|
|
470
428
|
partyType: enum_7(PartyEnum),
|
|
@@ -478,40 +436,36 @@ var CreateSubscriptionSchema = (PartyEnum, BillingProviderEnum) => ({
|
|
|
478
436
|
billingProvider: optional9(enum_7(BillingProviderEnum)),
|
|
479
437
|
providerFields: optional9(unknown9)
|
|
480
438
|
});
|
|
481
|
-
var UpdateSubscriptionSchema =
|
|
482
|
-
|
|
483
|
-
(
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
providerFields: optional9(unknown9),
|
|
512
|
-
createdAt: optional9(date9),
|
|
513
|
-
updatedAt: optional9(date9)
|
|
514
|
-
});
|
|
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
|
+
});
|
|
515
469
|
var BaseSubscriptionServiceSchemas = (options) => ({
|
|
516
470
|
CreateSubscriptionSchema,
|
|
517
471
|
UpdateSubscriptionSchema: UpdateSubscriptionSchema(options),
|
|
@@ -527,7 +481,7 @@ import {
|
|
|
527
481
|
string as string10,
|
|
528
482
|
unknown as unknown10,
|
|
529
483
|
uuid as uuid10
|
|
530
|
-
} from
|
|
484
|
+
} from "@forklaunch/validator/zod";
|
|
531
485
|
var CreateSubscriptionSchema2 = (PartyEnum, BillingProviderEnum) => ({
|
|
532
486
|
partyId: string10,
|
|
533
487
|
partyType: enum_8(PartyEnum),
|
|
@@ -541,40 +495,36 @@ var CreateSubscriptionSchema2 = (PartyEnum, BillingProviderEnum) => ({
|
|
|
541
495
|
billingProvider: optional10(enum_8(BillingProviderEnum)),
|
|
542
496
|
providerFields: optional10(unknown10)
|
|
543
497
|
});
|
|
544
|
-
var UpdateSubscriptionSchema2 =
|
|
545
|
-
|
|
546
|
-
(
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
(
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
providerFields: optional10(unknown10),
|
|
575
|
-
createdAt: optional10(date10),
|
|
576
|
-
updatedAt: optional10(date10)
|
|
577
|
-
});
|
|
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
|
+
});
|
|
578
528
|
var BaseSubscriptionServiceSchemas2 = (options) => ({
|
|
579
529
|
CreateSubscriptionSchema: CreateSubscriptionSchema2,
|
|
580
530
|
UpdateSubscriptionSchema: UpdateSubscriptionSchema2(options),
|