@forklaunch/implementation-billing-base 0.1.13 → 0.1.14
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/__test__/schemaEquality.test.d.ts +1 -1
- package/lib/__test__/schemaEquality.test.js +305 -146
- package/lib/eject/domain/schemas/billingPortal.schema.ts +1 -7
- package/lib/jest.config.d.ts +1 -1
- package/lib/jest.config.js +16 -16
- package/lib/schemas/billingPortal.schema.d.ts +107 -34
- package/lib/schemas/billingPortal.schema.js +4 -1
- package/lib/schemas/checkoutSession.schema.d.ts +169 -54
- package/lib/schemas/checkoutSession.schema.js +4 -1
- package/lib/schemas/index.d.ts +1 -1
- package/lib/schemas/paymentLink.schema.d.ts +210 -64
- package/lib/schemas/paymentLink.schema.js +4 -1
- package/lib/schemas/plan.schema.d.ts +326 -76
- package/lib/schemas/plan.schema.js +4 -1
- package/lib/schemas/subscription.schema.d.ts +364 -88
- package/lib/schemas/subscription.schema.js +4 -1
- package/lib/schemas/typebox/billingPortal.schema.d.ts +172 -38
- package/lib/schemas/typebox/billingPortal.schema.js +23 -17
- package/lib/schemas/typebox/checkoutSession.schema.d.ts +197 -55
- package/lib/schemas/typebox/checkoutSession.schema.js +25 -13
- package/lib/schemas/typebox/paymentLink.schema.d.ts +275 -65
- package/lib/schemas/typebox/paymentLink.schema.js +27 -15
- package/lib/schemas/typebox/plan.schema.d.ts +409 -77
- package/lib/schemas/typebox/plan.schema.js +31 -17
- package/lib/schemas/typebox/subscription.schema.d.ts +481 -89
- package/lib/schemas/typebox/subscription.schema.js +31 -19
- package/lib/schemas/zod/billingPortal.schema.d.ts +42 -38
- package/lib/schemas/zod/billingPortal.schema.js +23 -17
- package/lib/schemas/zod/checkoutSession.schema.d.ts +107 -55
- package/lib/schemas/zod/checkoutSession.schema.js +25 -13
- package/lib/schemas/zod/paymentLink.schema.d.ts +99 -65
- package/lib/schemas/zod/paymentLink.schema.js +27 -15
- package/lib/schemas/zod/plan.schema.d.ts +177 -77
- package/lib/schemas/zod/plan.schema.js +31 -17
- package/lib/schemas/zod/subscription.schema.d.ts +181 -89
- package/lib/schemas/zod/subscription.schema.js +31 -19
- package/lib/services/billingPortal.service.d.ts +77 -28
- package/lib/services/billingPortal.service.js +64 -45
- package/lib/services/checkoutSession.service.d.ts +77 -29
- package/lib/services/checkoutSession.service.js +54 -43
- package/lib/services/index.d.ts +1 -1
- package/lib/services/paymentLink.service.d.ts +82 -32
- package/lib/services/paymentLink.service.js +84 -66
- package/lib/services/plan.service.d.ts +73 -26
- package/lib/services/plan.service.js +45 -40
- package/lib/services/subscription.service.d.ts +136 -44
- package/lib/services/subscription.service.js +111 -88
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +8 -8
|
@@ -1,84 +1,416 @@
|
|
|
1
1
|
import { LiteralSchema } from '@forklaunch/validator';
|
|
2
|
-
export declare const CreatePlanSchema: <
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
export declare const CreatePlanSchema: <
|
|
3
|
+
T extends Record<string, LiteralSchema>,
|
|
4
|
+
U extends Record<string, LiteralSchema>
|
|
5
|
+
>(
|
|
6
|
+
PlanCadenceEnum: T,
|
|
7
|
+
BillingProviderEnum: U
|
|
8
|
+
) => {
|
|
9
|
+
name: import('@sinclair/typebox').TString;
|
|
10
|
+
description: import('@sinclair/typebox').TOptional<
|
|
11
|
+
import('@sinclair/typebox').TString
|
|
12
|
+
>;
|
|
13
|
+
price: import('@sinclair/typebox').TTransform<
|
|
14
|
+
import('@sinclair/typebox').TUnion<
|
|
15
|
+
[
|
|
16
|
+
import('@sinclair/typebox').TNumber,
|
|
17
|
+
import('@sinclair/typebox').TString,
|
|
18
|
+
import('@sinclair/typebox').TBoolean,
|
|
19
|
+
import('@sinclair/typebox').TNull,
|
|
20
|
+
import('@sinclair/typebox').TDate,
|
|
21
|
+
import('@sinclair/typebox').TBigInt
|
|
22
|
+
]
|
|
23
|
+
>,
|
|
24
|
+
number
|
|
25
|
+
>;
|
|
26
|
+
cadence: import('@sinclair/typebox').TUnion<
|
|
27
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
28
|
+
>;
|
|
29
|
+
features: import('@sinclair/typebox').TArray<
|
|
30
|
+
import('@sinclair/typebox').TString
|
|
31
|
+
>;
|
|
32
|
+
extraFields: import('@sinclair/typebox').TOptional<
|
|
33
|
+
import('@sinclair/typebox').TUnknown
|
|
34
|
+
>;
|
|
35
|
+
externalId: import('@sinclair/typebox').TString;
|
|
36
|
+
billingProvider: import('@sinclair/typebox').TOptional<
|
|
37
|
+
import('@sinclair/typebox').TUnion<
|
|
38
|
+
[
|
|
39
|
+
{
|
|
40
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
41
|
+
}[keyof U]
|
|
42
|
+
]
|
|
43
|
+
>
|
|
44
|
+
>;
|
|
45
|
+
active: import('@sinclair/typebox').TTransform<
|
|
46
|
+
import('@sinclair/typebox').TUnion<
|
|
47
|
+
[
|
|
48
|
+
import('@sinclair/typebox').TBoolean,
|
|
49
|
+
import('@sinclair/typebox').TString
|
|
50
|
+
]
|
|
51
|
+
>,
|
|
52
|
+
boolean
|
|
53
|
+
>;
|
|
12
54
|
};
|
|
13
|
-
export declare const UpdatePlanSchema: ({
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
export declare const UpdatePlanSchema: ({
|
|
56
|
+
uuidId
|
|
57
|
+
}: {
|
|
58
|
+
uuidId: boolean;
|
|
59
|
+
}) => <
|
|
60
|
+
T extends Record<string, LiteralSchema>,
|
|
61
|
+
U extends Record<string, LiteralSchema>
|
|
62
|
+
>(
|
|
63
|
+
PlanCadenceEnum: T,
|
|
64
|
+
BillingProviderEnum: U
|
|
65
|
+
) => {
|
|
66
|
+
id: import('@sinclair/typebox').TString;
|
|
67
|
+
name: import('@sinclair/typebox').TOptional<
|
|
68
|
+
import('@sinclair/typebox').TString
|
|
69
|
+
>;
|
|
70
|
+
description: import('@sinclair/typebox').TOptional<
|
|
71
|
+
import('@sinclair/typebox').TString
|
|
72
|
+
>;
|
|
73
|
+
price: import('@sinclair/typebox').TOptional<
|
|
74
|
+
import('@sinclair/typebox').TTransform<
|
|
75
|
+
import('@sinclair/typebox').TUnion<
|
|
76
|
+
[
|
|
77
|
+
import('@sinclair/typebox').TNumber,
|
|
78
|
+
import('@sinclair/typebox').TString,
|
|
79
|
+
import('@sinclair/typebox').TBoolean,
|
|
80
|
+
import('@sinclair/typebox').TNull,
|
|
81
|
+
import('@sinclair/typebox').TDate,
|
|
82
|
+
import('@sinclair/typebox').TBigInt
|
|
83
|
+
]
|
|
84
|
+
>,
|
|
85
|
+
number
|
|
86
|
+
>
|
|
87
|
+
>;
|
|
88
|
+
cadence: import('@sinclair/typebox').TOptional<
|
|
89
|
+
import('@sinclair/typebox').TUnion<
|
|
90
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
91
|
+
>
|
|
92
|
+
>;
|
|
93
|
+
features: import('@sinclair/typebox').TOptional<
|
|
94
|
+
import('@sinclair/typebox').TArray<import('@sinclair/typebox').TString>
|
|
95
|
+
>;
|
|
96
|
+
extraFields: import('@sinclair/typebox').TOptional<
|
|
97
|
+
import('@sinclair/typebox').TUnknown
|
|
98
|
+
>;
|
|
99
|
+
externalId: import('@sinclair/typebox').TOptional<
|
|
100
|
+
import('@sinclair/typebox').TString
|
|
101
|
+
>;
|
|
102
|
+
billingProvider: import('@sinclair/typebox').TOptional<
|
|
103
|
+
import('@sinclair/typebox').TUnion<
|
|
104
|
+
[
|
|
105
|
+
{
|
|
106
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
107
|
+
}[keyof U]
|
|
108
|
+
]
|
|
109
|
+
>
|
|
110
|
+
>;
|
|
111
|
+
active: import('@sinclair/typebox').TOptional<
|
|
112
|
+
import('@sinclair/typebox').TTransform<
|
|
113
|
+
import('@sinclair/typebox').TUnion<
|
|
114
|
+
[
|
|
115
|
+
import('@sinclair/typebox').TBoolean,
|
|
116
|
+
import('@sinclair/typebox').TString
|
|
117
|
+
]
|
|
118
|
+
>,
|
|
119
|
+
boolean
|
|
120
|
+
>
|
|
121
|
+
>;
|
|
26
122
|
};
|
|
27
|
-
export declare const PlanSchema: ({
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
123
|
+
export declare const PlanSchema: ({
|
|
124
|
+
uuidId
|
|
125
|
+
}: {
|
|
126
|
+
uuidId: boolean;
|
|
127
|
+
}) => <
|
|
128
|
+
T extends Record<string, LiteralSchema>,
|
|
129
|
+
U extends Record<string, LiteralSchema>
|
|
130
|
+
>(
|
|
131
|
+
PlanCadenceEnum: T,
|
|
132
|
+
BillingProviderEnum: U
|
|
133
|
+
) => {
|
|
134
|
+
id: import('@sinclair/typebox').TString;
|
|
135
|
+
name: import('@sinclair/typebox').TString;
|
|
136
|
+
description: import('@sinclair/typebox').TOptional<
|
|
137
|
+
import('@sinclair/typebox').TString
|
|
138
|
+
>;
|
|
139
|
+
price: import('@sinclair/typebox').TTransform<
|
|
140
|
+
import('@sinclair/typebox').TUnion<
|
|
141
|
+
[
|
|
142
|
+
import('@sinclair/typebox').TNumber,
|
|
143
|
+
import('@sinclair/typebox').TString,
|
|
144
|
+
import('@sinclair/typebox').TBoolean,
|
|
145
|
+
import('@sinclair/typebox').TNull,
|
|
146
|
+
import('@sinclair/typebox').TDate,
|
|
147
|
+
import('@sinclair/typebox').TBigInt
|
|
148
|
+
]
|
|
149
|
+
>,
|
|
150
|
+
number
|
|
151
|
+
>;
|
|
152
|
+
cadence: import('@sinclair/typebox').TUnion<
|
|
153
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
154
|
+
>;
|
|
155
|
+
features: import('@sinclair/typebox').TOptional<
|
|
156
|
+
import('@sinclair/typebox').TArray<import('@sinclair/typebox').TString>
|
|
157
|
+
>;
|
|
158
|
+
extraFields: import('@sinclair/typebox').TOptional<
|
|
159
|
+
import('@sinclair/typebox').TUnknown
|
|
160
|
+
>;
|
|
161
|
+
externalId: import('@sinclair/typebox').TString;
|
|
162
|
+
billingProvider: import('@sinclair/typebox').TOptional<
|
|
163
|
+
import('@sinclair/typebox').TUnion<
|
|
164
|
+
[
|
|
165
|
+
{
|
|
166
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
167
|
+
}[keyof U]
|
|
168
|
+
]
|
|
169
|
+
>
|
|
170
|
+
>;
|
|
171
|
+
active: import('@sinclair/typebox').TTransform<
|
|
172
|
+
import('@sinclair/typebox').TUnion<
|
|
173
|
+
[
|
|
174
|
+
import('@sinclair/typebox').TBoolean,
|
|
175
|
+
import('@sinclair/typebox').TString
|
|
176
|
+
]
|
|
177
|
+
>,
|
|
178
|
+
boolean
|
|
179
|
+
>;
|
|
180
|
+
createdAt: import('@sinclair/typebox').TOptional<
|
|
181
|
+
import('@sinclair/typebox').TTransform<
|
|
182
|
+
import('@sinclair/typebox').TUnion<
|
|
183
|
+
[
|
|
184
|
+
import('@sinclair/typebox').TDate,
|
|
185
|
+
import('@sinclair/typebox').TNumber,
|
|
186
|
+
import('@sinclair/typebox').TString,
|
|
187
|
+
import('@sinclair/typebox').TBoolean,
|
|
188
|
+
import('@sinclair/typebox').TNull
|
|
189
|
+
]
|
|
190
|
+
>,
|
|
191
|
+
Date
|
|
192
|
+
>
|
|
193
|
+
>;
|
|
194
|
+
updatedAt: import('@sinclair/typebox').TOptional<
|
|
195
|
+
import('@sinclair/typebox').TTransform<
|
|
196
|
+
import('@sinclair/typebox').TUnion<
|
|
197
|
+
[
|
|
198
|
+
import('@sinclair/typebox').TDate,
|
|
199
|
+
import('@sinclair/typebox').TNumber,
|
|
200
|
+
import('@sinclair/typebox').TString,
|
|
201
|
+
import('@sinclair/typebox').TBoolean,
|
|
202
|
+
import('@sinclair/typebox').TNull
|
|
203
|
+
]
|
|
204
|
+
>,
|
|
205
|
+
Date
|
|
206
|
+
>
|
|
207
|
+
>;
|
|
42
208
|
};
|
|
43
209
|
export declare const BasePlanServiceSchemas: (options: {
|
|
44
|
-
|
|
210
|
+
uuidId: boolean;
|
|
45
211
|
}) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
212
|
+
CreatePlanSchema: <
|
|
213
|
+
T extends Record<string, LiteralSchema>,
|
|
214
|
+
U extends Record<string, LiteralSchema>
|
|
215
|
+
>(
|
|
216
|
+
PlanCadenceEnum: T,
|
|
217
|
+
BillingProviderEnum: U
|
|
218
|
+
) => {
|
|
219
|
+
name: import('@sinclair/typebox').TString;
|
|
220
|
+
description: import('@sinclair/typebox').TOptional<
|
|
221
|
+
import('@sinclair/typebox').TString
|
|
222
|
+
>;
|
|
223
|
+
price: import('@sinclair/typebox').TTransform<
|
|
224
|
+
import('@sinclair/typebox').TUnion<
|
|
225
|
+
[
|
|
226
|
+
import('@sinclair/typebox').TNumber,
|
|
227
|
+
import('@sinclair/typebox').TString,
|
|
228
|
+
import('@sinclair/typebox').TBoolean,
|
|
229
|
+
import('@sinclair/typebox').TNull,
|
|
230
|
+
import('@sinclair/typebox').TDate,
|
|
231
|
+
import('@sinclair/typebox').TBigInt
|
|
232
|
+
]
|
|
233
|
+
>,
|
|
234
|
+
number
|
|
235
|
+
>;
|
|
236
|
+
cadence: import('@sinclair/typebox').TUnion<
|
|
237
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
238
|
+
>;
|
|
239
|
+
features: import('@sinclair/typebox').TArray<
|
|
240
|
+
import('@sinclair/typebox').TString
|
|
241
|
+
>;
|
|
242
|
+
extraFields: import('@sinclair/typebox').TOptional<
|
|
243
|
+
import('@sinclair/typebox').TUnknown
|
|
244
|
+
>;
|
|
245
|
+
externalId: import('@sinclair/typebox').TString;
|
|
246
|
+
billingProvider: import('@sinclair/typebox').TOptional<
|
|
247
|
+
import('@sinclair/typebox').TUnion<
|
|
248
|
+
[
|
|
249
|
+
{
|
|
250
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
251
|
+
}[keyof U]
|
|
252
|
+
]
|
|
253
|
+
>
|
|
254
|
+
>;
|
|
255
|
+
active: import('@sinclair/typebox').TTransform<
|
|
256
|
+
import('@sinclair/typebox').TUnion<
|
|
257
|
+
[
|
|
258
|
+
import('@sinclair/typebox').TBoolean,
|
|
259
|
+
import('@sinclair/typebox').TString
|
|
260
|
+
]
|
|
261
|
+
>,
|
|
262
|
+
boolean
|
|
263
|
+
>;
|
|
264
|
+
};
|
|
265
|
+
UpdatePlanSchema: <
|
|
266
|
+
T extends Record<string, LiteralSchema>,
|
|
267
|
+
U extends Record<string, LiteralSchema>
|
|
268
|
+
>(
|
|
269
|
+
PlanCadenceEnum: T,
|
|
270
|
+
BillingProviderEnum: U
|
|
271
|
+
) => {
|
|
272
|
+
id: import('@sinclair/typebox').TString;
|
|
273
|
+
name: import('@sinclair/typebox').TOptional<
|
|
274
|
+
import('@sinclair/typebox').TString
|
|
275
|
+
>;
|
|
276
|
+
description: import('@sinclair/typebox').TOptional<
|
|
277
|
+
import('@sinclair/typebox').TString
|
|
278
|
+
>;
|
|
279
|
+
price: import('@sinclair/typebox').TOptional<
|
|
280
|
+
import('@sinclair/typebox').TTransform<
|
|
281
|
+
import('@sinclair/typebox').TUnion<
|
|
282
|
+
[
|
|
283
|
+
import('@sinclair/typebox').TNumber,
|
|
284
|
+
import('@sinclair/typebox').TString,
|
|
285
|
+
import('@sinclair/typebox').TBoolean,
|
|
286
|
+
import('@sinclair/typebox').TNull,
|
|
287
|
+
import('@sinclair/typebox').TDate,
|
|
288
|
+
import('@sinclair/typebox').TBigInt
|
|
289
|
+
]
|
|
290
|
+
>,
|
|
291
|
+
number
|
|
292
|
+
>
|
|
293
|
+
>;
|
|
294
|
+
cadence: import('@sinclair/typebox').TOptional<
|
|
295
|
+
import('@sinclair/typebox').TUnion<
|
|
296
|
+
[
|
|
297
|
+
{
|
|
298
|
+
[K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]>;
|
|
299
|
+
}[keyof T]
|
|
300
|
+
]
|
|
301
|
+
>
|
|
302
|
+
>;
|
|
303
|
+
features: import('@sinclair/typebox').TOptional<
|
|
304
|
+
import('@sinclair/typebox').TArray<import('@sinclair/typebox').TString>
|
|
305
|
+
>;
|
|
306
|
+
extraFields: import('@sinclair/typebox').TOptional<
|
|
307
|
+
import('@sinclair/typebox').TUnknown
|
|
308
|
+
>;
|
|
309
|
+
externalId: import('@sinclair/typebox').TOptional<
|
|
310
|
+
import('@sinclair/typebox').TString
|
|
311
|
+
>;
|
|
312
|
+
billingProvider: import('@sinclair/typebox').TOptional<
|
|
313
|
+
import('@sinclair/typebox').TUnion<
|
|
314
|
+
[
|
|
315
|
+
{
|
|
316
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
317
|
+
}[keyof U]
|
|
318
|
+
]
|
|
319
|
+
>
|
|
320
|
+
>;
|
|
321
|
+
active: import('@sinclair/typebox').TOptional<
|
|
322
|
+
import('@sinclair/typebox').TTransform<
|
|
323
|
+
import('@sinclair/typebox').TUnion<
|
|
324
|
+
[
|
|
325
|
+
import('@sinclair/typebox').TBoolean,
|
|
326
|
+
import('@sinclair/typebox').TString
|
|
327
|
+
]
|
|
328
|
+
>,
|
|
329
|
+
boolean
|
|
330
|
+
>
|
|
331
|
+
>;
|
|
332
|
+
};
|
|
333
|
+
PlanSchema: <
|
|
334
|
+
T extends Record<string, LiteralSchema>,
|
|
335
|
+
U extends Record<string, LiteralSchema>
|
|
336
|
+
>(
|
|
337
|
+
PlanCadenceEnum: T,
|
|
338
|
+
BillingProviderEnum: U
|
|
339
|
+
) => {
|
|
340
|
+
id: import('@sinclair/typebox').TString;
|
|
341
|
+
name: import('@sinclair/typebox').TString;
|
|
342
|
+
description: import('@sinclair/typebox').TOptional<
|
|
343
|
+
import('@sinclair/typebox').TString
|
|
344
|
+
>;
|
|
345
|
+
price: import('@sinclair/typebox').TTransform<
|
|
346
|
+
import('@sinclair/typebox').TUnion<
|
|
347
|
+
[
|
|
348
|
+
import('@sinclair/typebox').TNumber,
|
|
349
|
+
import('@sinclair/typebox').TString,
|
|
350
|
+
import('@sinclair/typebox').TBoolean,
|
|
351
|
+
import('@sinclair/typebox').TNull,
|
|
352
|
+
import('@sinclair/typebox').TDate,
|
|
353
|
+
import('@sinclair/typebox').TBigInt
|
|
354
|
+
]
|
|
355
|
+
>,
|
|
356
|
+
number
|
|
357
|
+
>;
|
|
358
|
+
cadence: import('@sinclair/typebox').TUnion<
|
|
359
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
360
|
+
>;
|
|
361
|
+
features: import('@sinclair/typebox').TOptional<
|
|
362
|
+
import('@sinclair/typebox').TArray<import('@sinclair/typebox').TString>
|
|
363
|
+
>;
|
|
364
|
+
extraFields: import('@sinclair/typebox').TOptional<
|
|
365
|
+
import('@sinclair/typebox').TUnknown
|
|
366
|
+
>;
|
|
367
|
+
externalId: import('@sinclair/typebox').TString;
|
|
368
|
+
billingProvider: import('@sinclair/typebox').TOptional<
|
|
369
|
+
import('@sinclair/typebox').TUnion<
|
|
370
|
+
[
|
|
371
|
+
{
|
|
372
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
373
|
+
}[keyof U]
|
|
374
|
+
]
|
|
375
|
+
>
|
|
376
|
+
>;
|
|
377
|
+
active: import('@sinclair/typebox').TTransform<
|
|
378
|
+
import('@sinclair/typebox').TUnion<
|
|
379
|
+
[
|
|
380
|
+
import('@sinclair/typebox').TBoolean,
|
|
381
|
+
import('@sinclair/typebox').TString
|
|
382
|
+
]
|
|
383
|
+
>,
|
|
384
|
+
boolean
|
|
385
|
+
>;
|
|
386
|
+
createdAt: import('@sinclair/typebox').TOptional<
|
|
387
|
+
import('@sinclair/typebox').TTransform<
|
|
388
|
+
import('@sinclair/typebox').TUnion<
|
|
389
|
+
[
|
|
390
|
+
import('@sinclair/typebox').TDate,
|
|
391
|
+
import('@sinclair/typebox').TNumber,
|
|
392
|
+
import('@sinclair/typebox').TString,
|
|
393
|
+
import('@sinclair/typebox').TBoolean,
|
|
394
|
+
import('@sinclair/typebox').TNull
|
|
395
|
+
]
|
|
396
|
+
>,
|
|
397
|
+
Date
|
|
398
|
+
>
|
|
399
|
+
>;
|
|
400
|
+
updatedAt: import('@sinclair/typebox').TOptional<
|
|
401
|
+
import('@sinclair/typebox').TTransform<
|
|
402
|
+
import('@sinclair/typebox').TUnion<
|
|
403
|
+
[
|
|
404
|
+
import('@sinclair/typebox').TDate,
|
|
405
|
+
import('@sinclair/typebox').TNumber,
|
|
406
|
+
import('@sinclair/typebox').TString,
|
|
407
|
+
import('@sinclair/typebox').TBoolean,
|
|
408
|
+
import('@sinclair/typebox').TNull
|
|
409
|
+
]
|
|
410
|
+
>,
|
|
411
|
+
Date
|
|
412
|
+
>
|
|
413
|
+
>;
|
|
414
|
+
};
|
|
83
415
|
};
|
|
84
|
-
//# sourceMappingURL=plan.schema.d.ts.map
|
|
416
|
+
//# sourceMappingURL=plan.schema.d.ts.map
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
array,
|
|
3
|
+
boolean,
|
|
4
|
+
date,
|
|
5
|
+
enum_,
|
|
6
|
+
number,
|
|
7
|
+
optional,
|
|
8
|
+
string,
|
|
9
|
+
unknown,
|
|
10
|
+
uuid
|
|
11
|
+
} from '@forklaunch/validator/typebox';
|
|
2
12
|
export const CreatePlanSchema = (PlanCadenceEnum, BillingProviderEnum) => ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
name: string,
|
|
14
|
+
description: optional(string),
|
|
15
|
+
price: number,
|
|
16
|
+
cadence: enum_(PlanCadenceEnum),
|
|
17
|
+
features: array(string),
|
|
18
|
+
extraFields: optional(unknown),
|
|
19
|
+
externalId: string,
|
|
20
|
+
billingProvider: optional(enum_(BillingProviderEnum)),
|
|
21
|
+
active: boolean
|
|
12
22
|
});
|
|
13
|
-
export const UpdatePlanSchema =
|
|
23
|
+
export const UpdatePlanSchema =
|
|
24
|
+
({ uuidId }) =>
|
|
25
|
+
(PlanCadenceEnum, BillingProviderEnum) => ({
|
|
14
26
|
id: uuidId ? uuid : string,
|
|
15
27
|
name: optional(string),
|
|
16
28
|
description: optional(string),
|
|
@@ -21,8 +33,10 @@ export const UpdatePlanSchema = ({ uuidId }) => (PlanCadenceEnum, BillingProvide
|
|
|
21
33
|
externalId: optional(string),
|
|
22
34
|
billingProvider: optional(enum_(BillingProviderEnum)),
|
|
23
35
|
active: optional(boolean)
|
|
24
|
-
});
|
|
25
|
-
export const PlanSchema =
|
|
36
|
+
});
|
|
37
|
+
export const PlanSchema =
|
|
38
|
+
({ uuidId }) =>
|
|
39
|
+
(PlanCadenceEnum, BillingProviderEnum) => ({
|
|
26
40
|
id: uuidId ? uuid : string,
|
|
27
41
|
name: string,
|
|
28
42
|
description: optional(string),
|
|
@@ -35,9 +49,9 @@ export const PlanSchema = ({ uuidId }) => (PlanCadenceEnum, BillingProviderEnum)
|
|
|
35
49
|
active: boolean,
|
|
36
50
|
createdAt: optional(date),
|
|
37
51
|
updatedAt: optional(date)
|
|
38
|
-
});
|
|
52
|
+
});
|
|
39
53
|
export const BasePlanServiceSchemas = (options) => ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
CreatePlanSchema,
|
|
55
|
+
UpdatePlanSchema: UpdatePlanSchema(options),
|
|
56
|
+
PlanSchema: PlanSchema(options)
|
|
43
57
|
});
|