@forklaunch/implementation-billing-base 0.2.0 → 0.2.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/__test__/schemaEquality.test.js +35 -14
- package/lib/eject/domain/schemas/billingPortal.schema.ts +1 -7
- package/lib/eject/domain/schemas/checkoutSession.schema.ts +24 -4
- package/lib/eject/domain/schemas/paymentLink.schema.ts +24 -4
- package/lib/eject/services/billingPortal.service.ts +97 -25
- package/lib/eject/services/checkoutSession.service.ts +106 -23
- package/lib/eject/services/paymentLink.service.ts +104 -25
- package/lib/eject/services/plan.service.ts +41 -5
- package/lib/eject/services/subscription.service.ts +56 -3
- package/lib/schemas/checkoutSession.schema.d.ts +97 -11
- package/lib/schemas/checkoutSession.schema.d.ts.map +1 -1
- package/lib/schemas/paymentLink.schema.d.ts +101 -12
- package/lib/schemas/paymentLink.schema.d.ts.map +1 -1
- package/lib/schemas/typebox/checkoutSession.schema.d.ts +130 -10
- package/lib/schemas/typebox/checkoutSession.schema.d.ts.map +1 -1
- package/lib/schemas/typebox/checkoutSession.schema.js +9 -3
- package/lib/schemas/typebox/paymentLink.schema.d.ts +144 -12
- package/lib/schemas/typebox/paymentLink.schema.d.ts.map +1 -1
- package/lib/schemas/typebox/paymentLink.schema.js +9 -3
- package/lib/schemas/zod/checkoutSession.schema.d.ts +66 -12
- package/lib/schemas/zod/checkoutSession.schema.d.ts.map +1 -1
- package/lib/schemas/zod/checkoutSession.schema.js +9 -3
- package/lib/schemas/zod/paymentLink.schema.d.ts +66 -12
- package/lib/schemas/zod/paymentLink.schema.d.ts.map +1 -1
- package/lib/schemas/zod/paymentLink.schema.js +9 -3
- package/lib/services/billingPortal.service.d.ts +20 -2
- package/lib/services/billingPortal.service.d.ts.map +1 -1
- package/lib/services/billingPortal.service.js +83 -25
- package/lib/services/checkoutSession.service.d.ts +58 -15
- package/lib/services/checkoutSession.service.d.ts.map +1 -1
- package/lib/services/checkoutSession.service.js +61 -10
- package/lib/services/paymentLink.service.d.ts +34 -15
- package/lib/services/paymentLink.service.d.ts.map +1 -1
- package/lib/services/paymentLink.service.js +79 -11
- package/lib/services/plan.service.d.ts +14 -2
- package/lib/services/plan.service.d.ts.map +1 -1
- package/lib/services/plan.service.js +35 -5
- package/lib/services/subscription.service.d.ts +16 -2
- package/lib/services/subscription.service.d.ts.map +1 -1
- package/lib/services/subscription.service.js +49 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -12,9 +12,11 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
12
12
|
uuidId: boolean;
|
|
13
13
|
}) => {
|
|
14
14
|
CreatePaymentLinkSchema: <
|
|
15
|
-
T extends Record<string, import('@forklaunch/validator').LiteralSchema
|
|
15
|
+
T extends Record<string, import('@forklaunch/validator').LiteralSchema>,
|
|
16
|
+
U extends Record<string, import('@forklaunch/validator').LiteralSchema>
|
|
16
17
|
>(
|
|
17
|
-
CurrencyEnum: T
|
|
18
|
+
CurrencyEnum: T,
|
|
19
|
+
StatusEnum: U
|
|
18
20
|
) => {
|
|
19
21
|
amount: import('@sinclair/typebox').TTransform<
|
|
20
22
|
import('@sinclair/typebox').TUnion<
|
|
@@ -44,14 +46,33 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
44
46
|
>;
|
|
45
47
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
46
48
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
49
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
50
|
+
import('@sinclair/typebox').TUnion<
|
|
51
|
+
[
|
|
52
|
+
import('@sinclair/typebox').TString,
|
|
53
|
+
import('@sinclair/typebox').TNumber,
|
|
54
|
+
import('@sinclair/typebox').TDate
|
|
55
|
+
]
|
|
56
|
+
>,
|
|
57
|
+
Date
|
|
58
|
+
>;
|
|
59
|
+
status: import('@sinclair/typebox').TUnion<
|
|
60
|
+
[
|
|
61
|
+
{
|
|
62
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
63
|
+
}[keyof U]
|
|
64
|
+
]
|
|
65
|
+
>;
|
|
47
66
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
48
67
|
import('@sinclair/typebox').TUnknown
|
|
49
68
|
>;
|
|
50
69
|
};
|
|
51
70
|
UpdatePaymentLinkSchema: <
|
|
52
|
-
T extends Record<string, import('@forklaunch/validator').LiteralSchema
|
|
71
|
+
T extends Record<string, import('@forklaunch/validator').LiteralSchema>,
|
|
72
|
+
U_1 extends Record<string, import('@forklaunch/validator').LiteralSchema>
|
|
53
73
|
>(
|
|
54
|
-
CurrencyEnum: T
|
|
74
|
+
CurrencyEnum: T,
|
|
75
|
+
StatusEnum: U_1
|
|
55
76
|
) => {
|
|
56
77
|
id: import('@sinclair/typebox').TString;
|
|
57
78
|
amount: import('@sinclair/typebox').TOptional<
|
|
@@ -90,14 +111,39 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
90
111
|
cancelRedirectUri: import('@sinclair/typebox').TOptional<
|
|
91
112
|
import('@sinclair/typebox').TString
|
|
92
113
|
>;
|
|
114
|
+
expiresAt: import('@sinclair/typebox').TOptional<
|
|
115
|
+
import('@sinclair/typebox').TTransform<
|
|
116
|
+
import('@sinclair/typebox').TUnion<
|
|
117
|
+
[
|
|
118
|
+
import('@sinclair/typebox').TString,
|
|
119
|
+
import('@sinclair/typebox').TNumber,
|
|
120
|
+
import('@sinclair/typebox').TDate
|
|
121
|
+
]
|
|
122
|
+
>,
|
|
123
|
+
Date
|
|
124
|
+
>
|
|
125
|
+
>;
|
|
126
|
+
status: import('@sinclair/typebox').TOptional<
|
|
127
|
+
import('@sinclair/typebox').TUnion<
|
|
128
|
+
[
|
|
129
|
+
{
|
|
130
|
+
[K_1 in keyof U_1]: import('@sinclair/typebox').TLiteral<
|
|
131
|
+
U_1[K_1]
|
|
132
|
+
>;
|
|
133
|
+
}[keyof U_1]
|
|
134
|
+
]
|
|
135
|
+
>
|
|
136
|
+
>;
|
|
93
137
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
94
138
|
import('@sinclair/typebox').TUnknown
|
|
95
139
|
>;
|
|
96
140
|
};
|
|
97
141
|
PaymentLinkSchema: <
|
|
98
|
-
T extends Record<string, import('@forklaunch/validator').LiteralSchema
|
|
142
|
+
T extends Record<string, import('@forklaunch/validator').LiteralSchema>,
|
|
143
|
+
U_2 extends Record<string, import('@forklaunch/validator').LiteralSchema>
|
|
99
144
|
>(
|
|
100
|
-
CurrencyEnum: T
|
|
145
|
+
CurrencyEnum: T,
|
|
146
|
+
StatusEnum: U_2
|
|
101
147
|
) => {
|
|
102
148
|
id: import('@sinclair/typebox').TString;
|
|
103
149
|
amount: import('@sinclair/typebox').TTransform<
|
|
@@ -128,6 +174,23 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
128
174
|
>;
|
|
129
175
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
130
176
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
177
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
178
|
+
import('@sinclair/typebox').TUnion<
|
|
179
|
+
[
|
|
180
|
+
import('@sinclair/typebox').TString,
|
|
181
|
+
import('@sinclair/typebox').TNumber,
|
|
182
|
+
import('@sinclair/typebox').TDate
|
|
183
|
+
]
|
|
184
|
+
>,
|
|
185
|
+
Date
|
|
186
|
+
>;
|
|
187
|
+
status: import('@sinclair/typebox').TUnion<
|
|
188
|
+
[
|
|
189
|
+
{
|
|
190
|
+
[K_1 in keyof U_2]: import('@sinclair/typebox').TLiteral<U_2[K_1]>;
|
|
191
|
+
}[keyof U_2]
|
|
192
|
+
]
|
|
193
|
+
>;
|
|
131
194
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
132
195
|
import('@sinclair/typebox').TUnknown
|
|
133
196
|
>;
|
|
@@ -161,9 +224,11 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
161
224
|
uuidId: boolean;
|
|
162
225
|
}) => {
|
|
163
226
|
CreatePaymentLinkSchema: <
|
|
164
|
-
T extends Record<string, import('@forklaunch/validator').LiteralSchema
|
|
227
|
+
T extends Record<string, import('@forklaunch/validator').LiteralSchema>,
|
|
228
|
+
U_3 extends Record<string, import('@forklaunch/validator').LiteralSchema>
|
|
165
229
|
>(
|
|
166
|
-
CurrencyEnum: T
|
|
230
|
+
CurrencyEnum: T,
|
|
231
|
+
StatusEnum: U_3
|
|
167
232
|
) => {
|
|
168
233
|
amount: import('zod').ZodEffects<
|
|
169
234
|
import('zod').ZodNumber,
|
|
@@ -177,12 +242,18 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
177
242
|
metadata: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
178
243
|
successRedirectUri: import('zod').ZodString;
|
|
179
244
|
cancelRedirectUri: import('zod').ZodString;
|
|
245
|
+
expiresAt: import('zod').ZodEffects<import('zod').ZodDate, Date, unknown>;
|
|
246
|
+
status: import('zod').ZodUnion<
|
|
247
|
+
[{ [K_1 in keyof U_3]: import('zod').ZodLiteral<U_3[K_1]> }[keyof U_3]]
|
|
248
|
+
>;
|
|
180
249
|
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
181
250
|
};
|
|
182
251
|
UpdatePaymentLinkSchema: <
|
|
183
|
-
T extends Record<string, import('@forklaunch/validator').LiteralSchema
|
|
252
|
+
T extends Record<string, import('@forklaunch/validator').LiteralSchema>,
|
|
253
|
+
U_4 extends Record<string, import('@forklaunch/validator').LiteralSchema>
|
|
184
254
|
>(
|
|
185
|
-
CurrencyEnum: T
|
|
255
|
+
CurrencyEnum: T,
|
|
256
|
+
StatusEnum: U_4
|
|
186
257
|
) => {
|
|
187
258
|
id: import('zod').ZodString;
|
|
188
259
|
amount: import('zod').ZodOptional<
|
|
@@ -197,12 +268,26 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
197
268
|
metadata: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
198
269
|
successRedirectUri: import('zod').ZodOptional<import('zod').ZodString>;
|
|
199
270
|
cancelRedirectUri: import('zod').ZodOptional<import('zod').ZodString>;
|
|
271
|
+
expiresAt: import('zod').ZodOptional<
|
|
272
|
+
import('zod').ZodEffects<import('zod').ZodDate, Date, unknown>
|
|
273
|
+
>;
|
|
274
|
+
status: import('zod').ZodOptional<
|
|
275
|
+
import('zod').ZodUnion<
|
|
276
|
+
[
|
|
277
|
+
{
|
|
278
|
+
[K_1 in keyof U_4]: import('zod').ZodLiteral<U_4[K_1]>;
|
|
279
|
+
}[keyof U_4]
|
|
280
|
+
]
|
|
281
|
+
>
|
|
282
|
+
>;
|
|
200
283
|
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
201
284
|
};
|
|
202
285
|
PaymentLinkSchema: <
|
|
203
|
-
T extends Record<string, import('@forklaunch/validator').LiteralSchema
|
|
286
|
+
T extends Record<string, import('@forklaunch/validator').LiteralSchema>,
|
|
287
|
+
U_5 extends Record<string, import('@forklaunch/validator').LiteralSchema>
|
|
204
288
|
>(
|
|
205
|
-
CurrencyEnum: T
|
|
289
|
+
CurrencyEnum: T,
|
|
290
|
+
StatusEnum: U_5
|
|
206
291
|
) => {
|
|
207
292
|
id: import('zod').ZodString;
|
|
208
293
|
amount: import('zod').ZodEffects<
|
|
@@ -217,6 +302,10 @@ export declare const BasePaymentLinkServiceSchemas: <
|
|
|
217
302
|
metadata: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
218
303
|
successRedirectUri: import('zod').ZodString;
|
|
219
304
|
cancelRedirectUri: import('zod').ZodString;
|
|
305
|
+
expiresAt: import('zod').ZodEffects<import('zod').ZodDate, Date, unknown>;
|
|
306
|
+
status: import('zod').ZodUnion<
|
|
307
|
+
[{ [K_1 in keyof U_5]: import('zod').ZodLiteral<U_5[K_1]> }[keyof U_5]]
|
|
308
|
+
>;
|
|
220
309
|
extraFields: import('zod').ZodOptional<import('zod').ZodUnknown>;
|
|
221
310
|
createdAt: import('zod').ZodOptional<
|
|
222
311
|
import('zod').ZodEffects<import('zod').ZodDate, Date, unknown>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentLink.schema.d.ts","sourceRoot":"","sources":["../../schemas/paymentLink.schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"paymentLink.schema.d.ts","sourceRoot":"","sources":["../../schemas/paymentLink.schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzC,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { LiteralSchema } from '@forklaunch/validator';
|
|
|
2
2
|
export declare const CreateCheckoutSessionSchema: <
|
|
3
3
|
T extends Record<string, LiteralSchema>
|
|
4
4
|
>(
|
|
5
|
-
PaymentMethodEnum: T
|
|
5
|
+
PaymentMethodEnum: T,
|
|
6
|
+
StatusEnum: T
|
|
6
7
|
) => {
|
|
7
8
|
customerId: import('@sinclair/typebox').TString;
|
|
8
9
|
paymentMethods: import('@sinclair/typebox').TArray<
|
|
@@ -12,6 +13,19 @@ export declare const CreateCheckoutSessionSchema: <
|
|
|
12
13
|
>;
|
|
13
14
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
14
15
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
16
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
17
|
+
import('@sinclair/typebox').TUnion<
|
|
18
|
+
[
|
|
19
|
+
import('@sinclair/typebox').TString,
|
|
20
|
+
import('@sinclair/typebox').TNumber,
|
|
21
|
+
import('@sinclair/typebox').TDate
|
|
22
|
+
]
|
|
23
|
+
>,
|
|
24
|
+
Date
|
|
25
|
+
>;
|
|
26
|
+
status: import('@sinclair/typebox').TUnion<
|
|
27
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
28
|
+
>;
|
|
15
29
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
16
30
|
import('@sinclair/typebox').TUnknown
|
|
17
31
|
>;
|
|
@@ -20,8 +34,12 @@ export declare const UpdateCheckoutSessionSchema: ({
|
|
|
20
34
|
uuidId
|
|
21
35
|
}: {
|
|
22
36
|
uuidId: boolean;
|
|
23
|
-
}) => <
|
|
24
|
-
|
|
37
|
+
}) => <
|
|
38
|
+
T extends Record<string, LiteralSchema>,
|
|
39
|
+
U extends Record<string, LiteralSchema>
|
|
40
|
+
>(
|
|
41
|
+
PaymentMethodEnum: T,
|
|
42
|
+
StatusEnum: U
|
|
25
43
|
) => {
|
|
26
44
|
id: import('@sinclair/typebox').TString;
|
|
27
45
|
customerId: import('@sinclair/typebox').TOptional<
|
|
@@ -44,6 +62,27 @@ export declare const UpdateCheckoutSessionSchema: ({
|
|
|
44
62
|
cancelRedirectUri: import('@sinclair/typebox').TOptional<
|
|
45
63
|
import('@sinclair/typebox').TString
|
|
46
64
|
>;
|
|
65
|
+
expiresAt: import('@sinclair/typebox').TOptional<
|
|
66
|
+
import('@sinclair/typebox').TTransform<
|
|
67
|
+
import('@sinclair/typebox').TUnion<
|
|
68
|
+
[
|
|
69
|
+
import('@sinclair/typebox').TString,
|
|
70
|
+
import('@sinclair/typebox').TNumber,
|
|
71
|
+
import('@sinclair/typebox').TDate
|
|
72
|
+
]
|
|
73
|
+
>,
|
|
74
|
+
Date
|
|
75
|
+
>
|
|
76
|
+
>;
|
|
77
|
+
status: import('@sinclair/typebox').TOptional<
|
|
78
|
+
import('@sinclair/typebox').TUnion<
|
|
79
|
+
[
|
|
80
|
+
{
|
|
81
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
82
|
+
}[keyof U]
|
|
83
|
+
]
|
|
84
|
+
>
|
|
85
|
+
>;
|
|
47
86
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
48
87
|
import('@sinclair/typebox').TUnknown
|
|
49
88
|
>;
|
|
@@ -52,8 +91,12 @@ export declare const CheckoutSessionSchema: ({
|
|
|
52
91
|
uuidId
|
|
53
92
|
}: {
|
|
54
93
|
uuidId: boolean;
|
|
55
|
-
}) => <
|
|
56
|
-
|
|
94
|
+
}) => <
|
|
95
|
+
T extends Record<string, LiteralSchema>,
|
|
96
|
+
U extends Record<string, LiteralSchema>
|
|
97
|
+
>(
|
|
98
|
+
PaymentMethodEnum: T,
|
|
99
|
+
StatusEnum: U
|
|
57
100
|
) => {
|
|
58
101
|
id: import('@sinclair/typebox').TString;
|
|
59
102
|
customerId: import('@sinclair/typebox').TString;
|
|
@@ -67,6 +110,23 @@ export declare const CheckoutSessionSchema: ({
|
|
|
67
110
|
>;
|
|
68
111
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
69
112
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
113
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
114
|
+
import('@sinclair/typebox').TUnion<
|
|
115
|
+
[
|
|
116
|
+
import('@sinclair/typebox').TString,
|
|
117
|
+
import('@sinclair/typebox').TNumber,
|
|
118
|
+
import('@sinclair/typebox').TDate
|
|
119
|
+
]
|
|
120
|
+
>,
|
|
121
|
+
Date
|
|
122
|
+
>;
|
|
123
|
+
status: import('@sinclair/typebox').TUnion<
|
|
124
|
+
[
|
|
125
|
+
{
|
|
126
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
127
|
+
}[keyof U]
|
|
128
|
+
]
|
|
129
|
+
>;
|
|
70
130
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
71
131
|
import('@sinclair/typebox').TUnknown
|
|
72
132
|
>;
|
|
@@ -99,7 +159,8 @@ export declare const BaseCheckoutSessionServiceSchemas: (options: {
|
|
|
99
159
|
uuidId: boolean;
|
|
100
160
|
}) => {
|
|
101
161
|
CreateCheckoutSessionSchema: <T extends Record<string, LiteralSchema>>(
|
|
102
|
-
PaymentMethodEnum: T
|
|
162
|
+
PaymentMethodEnum: T,
|
|
163
|
+
StatusEnum: T
|
|
103
164
|
) => {
|
|
104
165
|
customerId: import('@sinclair/typebox').TString;
|
|
105
166
|
paymentMethods: import('@sinclair/typebox').TArray<
|
|
@@ -113,12 +174,29 @@ export declare const BaseCheckoutSessionServiceSchemas: (options: {
|
|
|
113
174
|
>;
|
|
114
175
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
115
176
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
177
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
178
|
+
import('@sinclair/typebox').TUnion<
|
|
179
|
+
[
|
|
180
|
+
import('@sinclair/typebox').TString,
|
|
181
|
+
import('@sinclair/typebox').TNumber,
|
|
182
|
+
import('@sinclair/typebox').TDate
|
|
183
|
+
]
|
|
184
|
+
>,
|
|
185
|
+
Date
|
|
186
|
+
>;
|
|
187
|
+
status: import('@sinclair/typebox').TUnion<
|
|
188
|
+
[{ [K in keyof T]: import('@sinclair/typebox').TLiteral<T[K]> }[keyof T]]
|
|
189
|
+
>;
|
|
116
190
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
117
191
|
import('@sinclair/typebox').TUnknown
|
|
118
192
|
>;
|
|
119
193
|
};
|
|
120
|
-
UpdateCheckoutSessionSchema: <
|
|
121
|
-
|
|
194
|
+
UpdateCheckoutSessionSchema: <
|
|
195
|
+
T extends Record<string, LiteralSchema>,
|
|
196
|
+
U extends Record<string, LiteralSchema>
|
|
197
|
+
>(
|
|
198
|
+
PaymentMethodEnum: T,
|
|
199
|
+
StatusEnum: U
|
|
122
200
|
) => {
|
|
123
201
|
id: import('@sinclair/typebox').TString;
|
|
124
202
|
customerId: import('@sinclair/typebox').TOptional<
|
|
@@ -141,12 +219,37 @@ export declare const BaseCheckoutSessionServiceSchemas: (options: {
|
|
|
141
219
|
cancelRedirectUri: import('@sinclair/typebox').TOptional<
|
|
142
220
|
import('@sinclair/typebox').TString
|
|
143
221
|
>;
|
|
222
|
+
expiresAt: import('@sinclair/typebox').TOptional<
|
|
223
|
+
import('@sinclair/typebox').TTransform<
|
|
224
|
+
import('@sinclair/typebox').TUnion<
|
|
225
|
+
[
|
|
226
|
+
import('@sinclair/typebox').TString,
|
|
227
|
+
import('@sinclair/typebox').TNumber,
|
|
228
|
+
import('@sinclair/typebox').TDate
|
|
229
|
+
]
|
|
230
|
+
>,
|
|
231
|
+
Date
|
|
232
|
+
>
|
|
233
|
+
>;
|
|
234
|
+
status: import('@sinclair/typebox').TOptional<
|
|
235
|
+
import('@sinclair/typebox').TUnion<
|
|
236
|
+
[
|
|
237
|
+
{
|
|
238
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
239
|
+
}[keyof U]
|
|
240
|
+
]
|
|
241
|
+
>
|
|
242
|
+
>;
|
|
144
243
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
145
244
|
import('@sinclair/typebox').TUnknown
|
|
146
245
|
>;
|
|
147
246
|
};
|
|
148
|
-
CheckoutSessionSchema: <
|
|
149
|
-
|
|
247
|
+
CheckoutSessionSchema: <
|
|
248
|
+
T extends Record<string, LiteralSchema>,
|
|
249
|
+
U extends Record<string, LiteralSchema>
|
|
250
|
+
>(
|
|
251
|
+
PaymentMethodEnum: T,
|
|
252
|
+
StatusEnum: U
|
|
150
253
|
) => {
|
|
151
254
|
id: import('@sinclair/typebox').TString;
|
|
152
255
|
customerId: import('@sinclair/typebox').TString;
|
|
@@ -164,6 +267,23 @@ export declare const BaseCheckoutSessionServiceSchemas: (options: {
|
|
|
164
267
|
>;
|
|
165
268
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
166
269
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
270
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
271
|
+
import('@sinclair/typebox').TUnion<
|
|
272
|
+
[
|
|
273
|
+
import('@sinclair/typebox').TString,
|
|
274
|
+
import('@sinclair/typebox').TNumber,
|
|
275
|
+
import('@sinclair/typebox').TDate
|
|
276
|
+
]
|
|
277
|
+
>,
|
|
278
|
+
Date
|
|
279
|
+
>;
|
|
280
|
+
status: import('@sinclair/typebox').TUnion<
|
|
281
|
+
[
|
|
282
|
+
{
|
|
283
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
284
|
+
}[keyof U]
|
|
285
|
+
]
|
|
286
|
+
>;
|
|
167
287
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
168
288
|
import('@sinclair/typebox').TUnknown
|
|
169
289
|
>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkoutSession.schema.d.ts","sourceRoot":"","sources":["../../../schemas/typebox/checkoutSession.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD,eAAO,MAAM,2BAA2B,GACtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAEvC,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"checkoutSession.schema.d.ts","sourceRoot":"","sources":["../../../schemas/typebox/checkoutSession.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD,eAAO,MAAM,2BAA2B,GACtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAEvC,mBAAmB,CAAC,EACpB,YAAY,CAAC;;;;;;;;CASb,CAAC;AAEH,eAAO,MAAM,2BAA2B,GACrC,YAAY;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,MAE9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACvC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAEvC,mBAAmB,CAAC,EACpB,YAAY,CAAC;;;;;;;;;CAUb,CAAC;AAEL,eAAO,MAAM,qBAAqB,GAC/B,YAAY;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,MAE9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACvC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAEvC,mBAAmB,CAAC,EACpB,YAAY,CAAC;;;;;;;;;;;;CAab,CAAC;AAEL,eAAO,MAAM,iCAAiC,GAAI,SAAS;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB;kCAzDC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,qBAEpB,CAAC,cACR,CAAC;;;;;;;;;kCAcX,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACvC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,qBAEpB,CAAC,cACR,CAAC;;;;;;;;;;4BAeb,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACvC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,qBAEpB,CAAC,cACR,CAAC;;;;;;;;;;;;;CAqBf,CAAC"}
|
|
@@ -7,32 +7,38 @@ import {
|
|
|
7
7
|
unknown,
|
|
8
8
|
uuid
|
|
9
9
|
} from '@forklaunch/validator/typebox';
|
|
10
|
-
export const CreateCheckoutSessionSchema = (PaymentMethodEnum) => ({
|
|
10
|
+
export const CreateCheckoutSessionSchema = (PaymentMethodEnum, StatusEnum) => ({
|
|
11
11
|
customerId: string,
|
|
12
12
|
paymentMethods: array(enum_(PaymentMethodEnum)),
|
|
13
13
|
successRedirectUri: string,
|
|
14
14
|
cancelRedirectUri: string,
|
|
15
|
+
expiresAt: date,
|
|
16
|
+
status: enum_(StatusEnum),
|
|
15
17
|
extraFields: optional(unknown)
|
|
16
18
|
});
|
|
17
19
|
export const UpdateCheckoutSessionSchema =
|
|
18
20
|
({ uuidId }) =>
|
|
19
|
-
(PaymentMethodEnum) => ({
|
|
21
|
+
(PaymentMethodEnum, StatusEnum) => ({
|
|
20
22
|
id: uuidId ? uuid : string,
|
|
21
23
|
customerId: optional(string),
|
|
22
24
|
paymentMethods: optional(array(enum_(PaymentMethodEnum))),
|
|
23
25
|
successRedirectUri: optional(string),
|
|
24
26
|
cancelRedirectUri: optional(string),
|
|
27
|
+
expiresAt: optional(date),
|
|
28
|
+
status: optional(enum_(StatusEnum)),
|
|
25
29
|
extraFields: optional(unknown)
|
|
26
30
|
});
|
|
27
31
|
export const CheckoutSessionSchema =
|
|
28
32
|
({ uuidId }) =>
|
|
29
|
-
(PaymentMethodEnum) => ({
|
|
33
|
+
(PaymentMethodEnum, StatusEnum) => ({
|
|
30
34
|
id: uuidId ? uuid : string,
|
|
31
35
|
customerId: string,
|
|
32
36
|
metadata: optional(unknown),
|
|
33
37
|
paymentMethods: array(enum_(PaymentMethodEnum)),
|
|
34
38
|
successRedirectUri: string,
|
|
35
39
|
cancelRedirectUri: string,
|
|
40
|
+
expiresAt: date,
|
|
41
|
+
status: enum_(StatusEnum),
|
|
36
42
|
extraFields: optional(unknown),
|
|
37
43
|
createdAt: optional(date),
|
|
38
44
|
updatedAt: optional(date)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { LiteralSchema } from '@forklaunch/validator';
|
|
2
2
|
export declare const CreatePaymentLinkSchema: <
|
|
3
|
-
T extends Record<string, LiteralSchema
|
|
3
|
+
T extends Record<string, LiteralSchema>,
|
|
4
|
+
U extends Record<string, LiteralSchema>
|
|
4
5
|
>(
|
|
5
|
-
CurrencyEnum: T
|
|
6
|
+
CurrencyEnum: T,
|
|
7
|
+
StatusEnum: U
|
|
6
8
|
) => {
|
|
7
9
|
amount: import('@sinclair/typebox').TTransform<
|
|
8
10
|
import('@sinclair/typebox').TUnion<
|
|
@@ -28,6 +30,23 @@ export declare const CreatePaymentLinkSchema: <
|
|
|
28
30
|
>;
|
|
29
31
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
30
32
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
33
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
34
|
+
import('@sinclair/typebox').TUnion<
|
|
35
|
+
[
|
|
36
|
+
import('@sinclair/typebox').TString,
|
|
37
|
+
import('@sinclair/typebox').TNumber,
|
|
38
|
+
import('@sinclair/typebox').TDate
|
|
39
|
+
]
|
|
40
|
+
>,
|
|
41
|
+
Date
|
|
42
|
+
>;
|
|
43
|
+
status: import('@sinclair/typebox').TUnion<
|
|
44
|
+
[
|
|
45
|
+
{
|
|
46
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
47
|
+
}[keyof U]
|
|
48
|
+
]
|
|
49
|
+
>;
|
|
31
50
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
32
51
|
import('@sinclair/typebox').TUnknown
|
|
33
52
|
>;
|
|
@@ -36,8 +55,12 @@ export declare const UpdatePaymentLinkSchema: ({
|
|
|
36
55
|
uuidId
|
|
37
56
|
}: {
|
|
38
57
|
uuidId: boolean;
|
|
39
|
-
}) => <
|
|
40
|
-
|
|
58
|
+
}) => <
|
|
59
|
+
T extends Record<string, LiteralSchema>,
|
|
60
|
+
U extends Record<string, LiteralSchema>
|
|
61
|
+
>(
|
|
62
|
+
CurrencyEnum: T,
|
|
63
|
+
StatusEnum: U
|
|
41
64
|
) => {
|
|
42
65
|
id: import('@sinclair/typebox').TString;
|
|
43
66
|
amount: import('@sinclair/typebox').TOptional<
|
|
@@ -72,6 +95,27 @@ export declare const UpdatePaymentLinkSchema: ({
|
|
|
72
95
|
cancelRedirectUri: import('@sinclair/typebox').TOptional<
|
|
73
96
|
import('@sinclair/typebox').TString
|
|
74
97
|
>;
|
|
98
|
+
expiresAt: import('@sinclair/typebox').TOptional<
|
|
99
|
+
import('@sinclair/typebox').TTransform<
|
|
100
|
+
import('@sinclair/typebox').TUnion<
|
|
101
|
+
[
|
|
102
|
+
import('@sinclair/typebox').TString,
|
|
103
|
+
import('@sinclair/typebox').TNumber,
|
|
104
|
+
import('@sinclair/typebox').TDate
|
|
105
|
+
]
|
|
106
|
+
>,
|
|
107
|
+
Date
|
|
108
|
+
>
|
|
109
|
+
>;
|
|
110
|
+
status: import('@sinclair/typebox').TOptional<
|
|
111
|
+
import('@sinclair/typebox').TUnion<
|
|
112
|
+
[
|
|
113
|
+
{
|
|
114
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
115
|
+
}[keyof U]
|
|
116
|
+
]
|
|
117
|
+
>
|
|
118
|
+
>;
|
|
75
119
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
76
120
|
import('@sinclair/typebox').TUnknown
|
|
77
121
|
>;
|
|
@@ -80,8 +124,12 @@ export declare const PaymentLinkSchema: ({
|
|
|
80
124
|
uuidId
|
|
81
125
|
}: {
|
|
82
126
|
uuidId: boolean;
|
|
83
|
-
}) => <
|
|
84
|
-
|
|
127
|
+
}) => <
|
|
128
|
+
T extends Record<string, LiteralSchema>,
|
|
129
|
+
U extends Record<string, LiteralSchema>
|
|
130
|
+
>(
|
|
131
|
+
CurrencyEnum: T,
|
|
132
|
+
StatusEnum: U
|
|
85
133
|
) => {
|
|
86
134
|
id: import('@sinclair/typebox').TString;
|
|
87
135
|
amount: import('@sinclair/typebox').TTransform<
|
|
@@ -108,6 +156,23 @@ export declare const PaymentLinkSchema: ({
|
|
|
108
156
|
>;
|
|
109
157
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
110
158
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
159
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
160
|
+
import('@sinclair/typebox').TUnion<
|
|
161
|
+
[
|
|
162
|
+
import('@sinclair/typebox').TString,
|
|
163
|
+
import('@sinclair/typebox').TNumber,
|
|
164
|
+
import('@sinclair/typebox').TDate
|
|
165
|
+
]
|
|
166
|
+
>,
|
|
167
|
+
Date
|
|
168
|
+
>;
|
|
169
|
+
status: import('@sinclair/typebox').TUnion<
|
|
170
|
+
[
|
|
171
|
+
{
|
|
172
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
173
|
+
}[keyof U]
|
|
174
|
+
]
|
|
175
|
+
>;
|
|
111
176
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
112
177
|
import('@sinclair/typebox').TUnknown
|
|
113
178
|
>;
|
|
@@ -139,8 +204,12 @@ export declare const PaymentLinkSchema: ({
|
|
|
139
204
|
export declare const BasePaymentLinkServiceSchemas: (options: {
|
|
140
205
|
uuidId: boolean;
|
|
141
206
|
}) => {
|
|
142
|
-
CreatePaymentLinkSchema: <
|
|
143
|
-
|
|
207
|
+
CreatePaymentLinkSchema: <
|
|
208
|
+
T extends Record<string, LiteralSchema>,
|
|
209
|
+
U extends Record<string, LiteralSchema>
|
|
210
|
+
>(
|
|
211
|
+
CurrencyEnum: T,
|
|
212
|
+
StatusEnum: U
|
|
144
213
|
) => {
|
|
145
214
|
amount: import('@sinclair/typebox').TTransform<
|
|
146
215
|
import('@sinclair/typebox').TUnion<
|
|
@@ -166,12 +235,33 @@ export declare const BasePaymentLinkServiceSchemas: (options: {
|
|
|
166
235
|
>;
|
|
167
236
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
168
237
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
238
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
239
|
+
import('@sinclair/typebox').TUnion<
|
|
240
|
+
[
|
|
241
|
+
import('@sinclair/typebox').TString,
|
|
242
|
+
import('@sinclair/typebox').TNumber,
|
|
243
|
+
import('@sinclair/typebox').TDate
|
|
244
|
+
]
|
|
245
|
+
>,
|
|
246
|
+
Date
|
|
247
|
+
>;
|
|
248
|
+
status: import('@sinclair/typebox').TUnion<
|
|
249
|
+
[
|
|
250
|
+
{
|
|
251
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
252
|
+
}[keyof U]
|
|
253
|
+
]
|
|
254
|
+
>;
|
|
169
255
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
170
256
|
import('@sinclair/typebox').TUnknown
|
|
171
257
|
>;
|
|
172
258
|
};
|
|
173
|
-
UpdatePaymentLinkSchema: <
|
|
174
|
-
|
|
259
|
+
UpdatePaymentLinkSchema: <
|
|
260
|
+
T extends Record<string, LiteralSchema>,
|
|
261
|
+
U extends Record<string, LiteralSchema>
|
|
262
|
+
>(
|
|
263
|
+
CurrencyEnum: T,
|
|
264
|
+
StatusEnum: U
|
|
175
265
|
) => {
|
|
176
266
|
id: import('@sinclair/typebox').TString;
|
|
177
267
|
amount: import('@sinclair/typebox').TOptional<
|
|
@@ -210,12 +300,37 @@ export declare const BasePaymentLinkServiceSchemas: (options: {
|
|
|
210
300
|
cancelRedirectUri: import('@sinclair/typebox').TOptional<
|
|
211
301
|
import('@sinclair/typebox').TString
|
|
212
302
|
>;
|
|
303
|
+
expiresAt: import('@sinclair/typebox').TOptional<
|
|
304
|
+
import('@sinclair/typebox').TTransform<
|
|
305
|
+
import('@sinclair/typebox').TUnion<
|
|
306
|
+
[
|
|
307
|
+
import('@sinclair/typebox').TString,
|
|
308
|
+
import('@sinclair/typebox').TNumber,
|
|
309
|
+
import('@sinclair/typebox').TDate
|
|
310
|
+
]
|
|
311
|
+
>,
|
|
312
|
+
Date
|
|
313
|
+
>
|
|
314
|
+
>;
|
|
315
|
+
status: import('@sinclair/typebox').TOptional<
|
|
316
|
+
import('@sinclair/typebox').TUnion<
|
|
317
|
+
[
|
|
318
|
+
{
|
|
319
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
320
|
+
}[keyof U]
|
|
321
|
+
]
|
|
322
|
+
>
|
|
323
|
+
>;
|
|
213
324
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
214
325
|
import('@sinclair/typebox').TUnknown
|
|
215
326
|
>;
|
|
216
327
|
};
|
|
217
|
-
PaymentLinkSchema: <
|
|
218
|
-
|
|
328
|
+
PaymentLinkSchema: <
|
|
329
|
+
T extends Record<string, LiteralSchema>,
|
|
330
|
+
U extends Record<string, LiteralSchema>
|
|
331
|
+
>(
|
|
332
|
+
CurrencyEnum: T,
|
|
333
|
+
StatusEnum: U
|
|
219
334
|
) => {
|
|
220
335
|
id: import('@sinclair/typebox').TString;
|
|
221
336
|
amount: import('@sinclair/typebox').TTransform<
|
|
@@ -242,6 +357,23 @@ export declare const BasePaymentLinkServiceSchemas: (options: {
|
|
|
242
357
|
>;
|
|
243
358
|
successRedirectUri: import('@sinclair/typebox').TString;
|
|
244
359
|
cancelRedirectUri: import('@sinclair/typebox').TString;
|
|
360
|
+
expiresAt: import('@sinclair/typebox').TTransform<
|
|
361
|
+
import('@sinclair/typebox').TUnion<
|
|
362
|
+
[
|
|
363
|
+
import('@sinclair/typebox').TString,
|
|
364
|
+
import('@sinclair/typebox').TNumber,
|
|
365
|
+
import('@sinclair/typebox').TDate
|
|
366
|
+
]
|
|
367
|
+
>,
|
|
368
|
+
Date
|
|
369
|
+
>;
|
|
370
|
+
status: import('@sinclair/typebox').TUnion<
|
|
371
|
+
[
|
|
372
|
+
{
|
|
373
|
+
[K_1 in keyof U]: import('@sinclair/typebox').TLiteral<U[K_1]>;
|
|
374
|
+
}[keyof U]
|
|
375
|
+
]
|
|
376
|
+
>;
|
|
245
377
|
extraFields: import('@sinclair/typebox').TOptional<
|
|
246
378
|
import('@sinclair/typebox').TUnknown
|
|
247
379
|
>;
|