@driveflux/api-functions 0.0.3 → 0.0.4

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.
Files changed (50) hide show
  1. package/dist/auth/confirm.js +73 -327
  2. package/dist/auth/emails.js +43 -210
  3. package/dist/auth/formatter.js +11 -11
  4. package/dist/auth/otp.js +122 -392
  5. package/dist/auth/register.d.ts +1 -1
  6. package/dist/auth/register.js +100 -396
  7. package/dist/auth/tokens.js +115 -430
  8. package/dist/auth/verifications.js +154 -512
  9. package/dist/constants.js +5 -4
  10. package/dist/mailjet/calls/manage-contacts-in-list.js +22 -166
  11. package/dist/mailjet/calls/manage-subscription-status.js +13 -153
  12. package/dist/mailjet/calls/request-service.js +18 -183
  13. package/dist/mailjet/refresh-email-preferences.js +26 -225
  14. package/dist/mailjet/set-contact.js +23 -214
  15. package/dist/mailjet/types.js +2 -1
  16. package/dist/mailjet/utils/convert-to-array.js +9 -58
  17. package/dist/mailjet/utils/extract-email-preferences.js +41 -217
  18. package/dist/mailjet/utils/lists.js +30 -249
  19. package/dist/mailjet/utils/update-email-references.js +27 -208
  20. package/dist/notion/client.js +48 -197
  21. package/dist/notion/helpful.js +29 -170
  22. package/dist/notion/schemas/block.js +49 -43
  23. package/dist/notion/schemas/common.js +17 -14
  24. package/dist/notion/schemas/database.js +125 -159
  25. package/dist/notion/schemas/emoji.js +3 -2
  26. package/dist/notion/schemas/file.js +10 -10
  27. package/dist/notion/schemas/kb.js +9 -8
  28. package/dist/notion/schemas/page.js +126 -171
  29. package/dist/notion/schemas/parent.js +9 -8
  30. package/dist/notion/schemas/user.js +21 -20
  31. package/dist/reservation/agree.js +19 -158
  32. package/dist/reservation/checks.js +23 -178
  33. package/dist/reservation/display-vehicle.js +142 -514
  34. package/dist/reservation/fetch-or-create.js +197 -482
  35. package/dist/reservation/invoice.d.ts.map +1 -1
  36. package/dist/reservation/invoice.js +199 -501
  37. package/dist/reservation/invoice.js.map +1 -1
  38. package/dist/reservation/payer.js +28 -177
  39. package/dist/reservation/reserve.js +31 -191
  40. package/dist/reservation/types.js +2 -1
  41. package/dist/reservation/vehicle.js +24 -186
  42. package/dist/slack.js +67 -273
  43. package/dist/validation.d.ts +11 -11
  44. package/dist/validation.d.ts.map +1 -1
  45. package/dist/validation.js +63 -96
  46. package/dist/validation.js.map +1 -1
  47. package/dist/vehicle/vehicle-pricing/constants.js +33 -36
  48. package/dist/vehicle/vehicle-pricing/index.js +99 -257
  49. package/dist/vehicle/vehicle-pricing/types.js +2 -1
  50. package/package.json +10 -10
@@ -1,4 +1,4 @@
1
- var knownCountryCodes = [
1
+ const knownCountryCodes = [
2
2
  '1',
3
3
  '376',
4
4
  '93',
@@ -221,20 +221,19 @@ var knownCountryCodes = [
221
221
  '246',
222
222
  '269',
223
223
  '692',
224
- '383'
224
+ '383',
225
225
  ];
226
- export var cleanupPhoneNumber = function(phoneNumber) {
226
+ export const cleanupPhoneNumber = (phoneNumber) => {
227
227
  // Remove all characters except numbers and +
228
- var cleaned = phoneNumber.replace(/[^\d+]/g, '');
228
+ const cleaned = phoneNumber.replace(/[^\d+]/g, '');
229
229
  // If it doesn't start with +, add it
230
- var withPlus = cleaned.startsWith('+') ? cleaned : "+".concat(cleaned);
230
+ const withPlus = cleaned.startsWith('+') ? cleaned : `+${cleaned}`;
231
231
  // Find the country code by checking against known codes
232
- var countryCode = '';
233
- var remainingNumber = '';
232
+ let countryCode = '';
233
+ let remainingNumber = '';
234
234
  // Try to find the country code by checking the longest matches first
235
- for(var i = 4; i >= 1; i--){
236
- var potentialCode = withPlus.substring(1, 1 + i) // Skip the + and take i digits
237
- ;
235
+ for (let i = 4; i >= 1; i--) {
236
+ const potentialCode = withPlus.substring(1, 1 + i); // Skip the + and take i digits
238
237
  if (knownCountryCodes.includes(potentialCode)) {
239
238
  countryCode = potentialCode;
240
239
  remainingNumber = withPlus.substring(1 + i); // Everything after the country code
@@ -243,7 +242,8 @@ export var cleanupPhoneNumber = function(phoneNumber) {
243
242
  }
244
243
  // If we found a country code and the remaining number starts with 0, remove it
245
244
  if (countryCode && remainingNumber.startsWith('0')) {
246
- return "+".concat(countryCode).concat(remainingNumber.substring(1));
245
+ return `+${countryCode}${remainingNumber.substring(1)}`;
247
246
  }
248
247
  return withPlus;
249
248
  };
249
+ //# sourceMappingURL=formatter.js.map
package/dist/auth/otp.js CHANGED
@@ -1,424 +1,154 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
- return arr2;
5
- }
6
- function _array_without_holes(arr) {
7
- if (Array.isArray(arr)) return _array_like_to_array(arr);
8
- }
9
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10
- try {
11
- var info = gen[key](arg);
12
- var value = info.value;
13
- } catch (error) {
14
- reject(error);
15
- return;
16
- }
17
- if (info.done) {
18
- resolve(value);
19
- } else {
20
- Promise.resolve(value).then(_next, _throw);
21
- }
22
- }
23
- function _async_to_generator(fn) {
24
- return function() {
25
- var self = this, args = arguments;
26
- return new Promise(function(resolve, reject) {
27
- var gen = fn.apply(self, args);
28
- function _next(value) {
29
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
30
- }
31
- function _throw(err) {
32
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
33
- }
34
- _next(undefined);
35
- });
36
- };
37
- }
38
- function _iterable_to_array(iter) {
39
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
40
- }
41
- function _non_iterable_spread() {
42
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
43
- }
44
- function _to_consumable_array(arr) {
45
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
46
- }
47
- function _unsupported_iterable_to_array(o, minLen) {
48
- if (!o) return;
49
- if (typeof o === "string") return _array_like_to_array(o, minLen);
50
- var n = Object.prototype.toString.call(o).slice(8, -1);
51
- if (n === "Object" && o.constructor) n = o.constructor.name;
52
- if (n === "Map" || n === "Set") return Array.from(n);
53
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
54
- }
55
- function _ts_generator(thisArg, body) {
56
- var f, y, t, _ = {
57
- label: 0,
58
- sent: function() {
59
- if (t[0] & 1) throw t[1];
60
- return t[1];
61
- },
62
- trys: [],
63
- ops: []
64
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
65
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
66
- return this;
67
- }), g;
68
- function verb(n) {
69
- return function(v) {
70
- return step([
71
- n,
72
- v
73
- ]);
74
- };
75
- }
76
- function step(op) {
77
- if (f) throw new TypeError("Generator is already executing.");
78
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
79
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
80
- if (y = 0, t) op = [
81
- op[0] & 2,
82
- t.value
83
- ];
84
- switch(op[0]){
85
- case 0:
86
- case 1:
87
- t = op;
88
- break;
89
- case 4:
90
- _.label++;
91
- return {
92
- value: op[1],
93
- done: false
94
- };
95
- case 5:
96
- _.label++;
97
- y = op[1];
98
- op = [
99
- 0
100
- ];
101
- continue;
102
- case 7:
103
- op = _.ops.pop();
104
- _.trys.pop();
105
- continue;
106
- default:
107
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
108
- _ = 0;
109
- continue;
110
- }
111
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
112
- _.label = op[1];
113
- break;
114
- }
115
- if (op[0] === 6 && _.label < t[1]) {
116
- _.label = t[1];
117
- t = op;
118
- break;
119
- }
120
- if (t && _.label < t[2]) {
121
- _.label = t[2];
122
- _.ops.push(op);
123
- break;
124
- }
125
- if (t[2]) _.ops.pop();
126
- _.trys.pop();
127
- continue;
128
- }
129
- op = body.call(thisArg, _);
130
- } catch (e) {
131
- op = [
132
- 6,
133
- e
134
- ];
135
- y = 0;
136
- } finally{
137
- f = t = 0;
138
- }
139
- if (op[0] & 5) throw op[1];
140
- return {
141
- value: op[0] ? op[1] : void 0,
142
- done: true
143
- };
144
- }
145
- }
146
1
  import { ROLES } from '@driveflux/auth/authorization/constants';
147
2
  import { config } from '@driveflux/config/backend';
148
3
  import { prisma } from '@driveflux/db';
149
4
  import { generateId } from '@driveflux/db/id';
150
- import { makeProblem, PROBLEM_CONFLICT, PROBLEM_INVALID_DATA } from '@driveflux/problem';
5
+ import { makeProblem, PROBLEM_CONFLICT, PROBLEM_INVALID_DATA, } from '@driveflux/problem';
151
6
  import { Err, Ok } from '@driveflux/result';
152
7
  import { addDays } from 'date-fns/addDays';
153
8
  import { z } from 'zod';
154
9
  import { sendEmailChangedEmail } from './emails.js';
155
10
  import { clearToken, createSMSToken, verifyToken } from './tokens.js';
156
11
  import { sendVerificationSMS } from './verifications.js';
157
- var SendVerificationSMSBody = z.object({
12
+ const SendVerificationSMSBody = z.object({
158
13
  phoneNumber: z.string(),
159
14
  checkDuplication: z.boolean().optional().nullable(),
160
15
  includeUser: z.boolean().optional().nullable(),
161
- userId: z.string().optional().nullable()
16
+ userId: z.string().optional().nullable(),
162
17
  });
163
- var VerifyOtpBody = z.object({
164
- scope: z.enum([
165
- 'verify-email',
166
- 'verify-phone'
167
- ]),
168
- email: z.email().optional().transform(function(email) {
169
- return email === null || email === void 0 ? void 0 : email.toLowerCase().trim();
170
- }),
18
+ const VerifyOtpBody = z
19
+ .object({
20
+ scope: z.enum(['verify-email', 'verify-phone']),
21
+ email: z
22
+ .email()
23
+ .optional()
24
+ .transform((email) => email?.toLowerCase().trim()),
171
25
  phoneNumber: z.string().optional(),
172
- code: z.string()
173
- }).refine(function(d) {
26
+ code: z.string(),
27
+ })
28
+ .refine((d) => {
174
29
  if (d.scope === 'verify-email' && !d.email) {
175
30
  return false;
176
31
  }
177
32
  return true;
178
33
  }, {
179
- path: [
180
- 'email'
181
- ],
182
- message: 'Email is required'
183
- }).refine(function(d) {
34
+ path: ['email'],
35
+ message: 'Email is required',
36
+ })
37
+ .refine((d) => {
184
38
  if (d.scope === 'verify-phone' && !d.phoneNumber) {
185
39
  return false;
186
40
  }
187
41
  return true;
188
42
  }, {
189
- path: [
190
- 'phoneNumber'
191
- ],
192
- message: 'Phone number is required'
43
+ path: ['phoneNumber'],
44
+ message: 'Phone number is required',
193
45
  });
194
- var INVALID_TOKEN_PROBLEM = makeProblem(PROBLEM_INVALID_DATA, 'Unable to verify token. It could have been expired.');
195
- var VerifyOtpOnlyBody = z.object({
46
+ const INVALID_TOKEN_PROBLEM = makeProblem(PROBLEM_INVALID_DATA, 'Unable to verify token. It could have been expired.');
47
+ const VerifyOtpOnlyBody = z.object({
196
48
  phoneNumber: z.string().optional(),
197
- code: z.string()
49
+ code: z.string(),
198
50
  });
199
- export var handleVerifyOTPOnly = function(param) {
200
- var phoneNumber = param.phoneNumber, code = param.code;
201
- return _async_to_generator(function() {
202
- var tokenResult;
203
- return _ts_generator(this, function(_state) {
204
- switch(_state.label){
205
- case 0:
206
- return [
207
- 4,
208
- verifyToken(code, {
209
- scope: 'verify-phone'
210
- })
211
- ];
212
- case 1:
213
- tokenResult = _state.sent();
214
- if (tokenResult.err) {
215
- console.log('Error verifying token', tokenResult.val);
216
- return [
217
- 2,
218
- new Err(INVALID_TOKEN_PROBLEM)
219
- ];
220
- }
221
- // delete the previous token
222
- // TODO maybe: verify this token when registering one more time then clear it
223
- // await clearToken(tokenResult.val.id)
224
- return [
225
- 2,
226
- new Ok({
227
- phoneNumber: phoneNumber,
228
- phoneNumberVerified: true
229
- })
230
- ];
231
- }
232
- });
233
- })();
51
+ export const handleVerifyOTPOnly = async ({ phoneNumber, code, }) => {
52
+ const tokenResult = await verifyToken(code, { scope: 'verify-phone' });
53
+ if (tokenResult.err) {
54
+ console.log('Error verifying token', tokenResult.val);
55
+ return new Err(INVALID_TOKEN_PROBLEM);
56
+ }
57
+ // delete the previous token
58
+ // TODO maybe: verify this token when registering one more time then clear it
59
+ // await clearToken(tokenResult.val.id)
60
+ return new Ok({
61
+ phoneNumber,
62
+ phoneNumberVerified: true,
63
+ });
234
64
  };
235
- export var handleVerifyOTP = function(b) {
236
- return _async_to_generator(function() {
237
- var _tokenResult_val_user, _VerifyOtpBody_parse, scope, email, preFormattedPhoneNumber, code, phoneNumber, tokenResult, previousUser, userUpdate, userGroups, user, token;
238
- return _ts_generator(this, function(_state) {
239
- switch(_state.label){
240
- case 0:
241
- _VerifyOtpBody_parse = VerifyOtpBody.parse(b), scope = _VerifyOtpBody_parse.scope, email = _VerifyOtpBody_parse.email, preFormattedPhoneNumber = _VerifyOtpBody_parse.phoneNumber, code = _VerifyOtpBody_parse.code;
242
- phoneNumber = "+".concat(preFormattedPhoneNumber === null || preFormattedPhoneNumber === void 0 ? void 0 : preFormattedPhoneNumber.replace(/[^0-9]/g, ''));
243
- return [
244
- 4,
245
- verifyToken(code, {
246
- scope: scope,
247
- metadata: {
248
- email: email,
249
- phoneNumber: phoneNumber
250
- }
251
- }, {
252
- includeUser: true
253
- })
254
- ];
255
- case 1:
256
- tokenResult = _state.sent();
257
- if (tokenResult.err) {
258
- return [
259
- 2,
260
- new Err(INVALID_TOKEN_PROBLEM)
261
- ];
262
- }
263
- if (!tokenResult.val.user) {
264
- return [
265
- 2,
266
- new Err(INVALID_TOKEN_PROBLEM)
267
- ];
268
- }
269
- previousUser = tokenResult.val.user;
270
- userUpdate = scope === 'verify-email' ? {
271
- emailVerified: true,
272
- email: email
273
- } : {
274
- phoneNumberVerified: true,
275
- phoneNumber: phoneNumber
276
- };
277
- userUpdate.temporary = false;
278
- userUpdate.temporaryEmail = null;
279
- userGroups = new Set((_tokenResult_val_user = tokenResult.val.user) === null || _tokenResult_val_user === void 0 ? void 0 : _tokenResult_val_user.groups);
280
- userGroups.add(ROLES.MEMBER);
281
- userUpdate.groups = _to_consumable_array(userGroups);
282
- return [
283
- 4,
284
- prisma.user.update({
285
- where: {
286
- id: tokenResult.val.user.id
287
- },
288
- data: userUpdate
289
- })
290
- ];
291
- case 2:
292
- user = _state.sent();
293
- // delete the previous token
294
- return [
295
- 4,
296
- clearToken(tokenResult.val.id)
297
- ];
298
- case 3:
299
- _state.sent();
300
- return [
301
- 4,
302
- prisma.token.create({
303
- data: {
304
- id: generateId('Token'),
305
- user: {
306
- connect: {
307
- id: user === null || user === void 0 ? void 0 : user.id
308
- }
309
- },
310
- expiresAt: addDays(new Date(), 365),
311
- scope: 'all'
312
- }
313
- })
314
- ];
315
- case 4:
316
- token = _state.sent();
317
- if (!(previousUser.email !== user.email)) return [
318
- 3,
319
- 6
320
- ];
321
- return [
322
- 4,
323
- sendEmailChangedEmail(user.id)
324
- ];
325
- case 5:
326
- _state.sent();
327
- _state.label = 6;
328
- case 6:
329
- return [
330
- 2,
331
- new Ok({
332
- accessToken: token.id,
333
- expiresAt: token.expiresAt,
334
- user: user
335
- })
336
- ];
337
- }
338
- });
339
- })();
65
+ export const handleVerifyOTP = async (b) => {
66
+ const { scope, email, phoneNumber: preFormattedPhoneNumber, code, } = VerifyOtpBody.parse(b);
67
+ const phoneNumber = `+${preFormattedPhoneNumber?.replace(/[^0-9]/g, '')}`;
68
+ const tokenResult = await verifyToken(code, { scope, metadata: { email, phoneNumber } }, { includeUser: true });
69
+ if (tokenResult.err) {
70
+ return new Err(INVALID_TOKEN_PROBLEM);
71
+ }
72
+ if (!tokenResult.val.user) {
73
+ return new Err(INVALID_TOKEN_PROBLEM);
74
+ }
75
+ const previousUser = tokenResult.val.user;
76
+ const userUpdate = scope === 'verify-email'
77
+ ? {
78
+ emailVerified: true,
79
+ email,
80
+ }
81
+ : {
82
+ phoneNumberVerified: true,
83
+ phoneNumber,
84
+ };
85
+ userUpdate.temporary = false;
86
+ userUpdate.temporaryEmail = null;
87
+ const userGroups = new Set(tokenResult.val.user?.groups);
88
+ userGroups.add(ROLES.MEMBER);
89
+ userUpdate.groups = [...userGroups];
90
+ const user = await prisma.user.update({
91
+ where: {
92
+ id: tokenResult.val.user.id,
93
+ },
94
+ data: userUpdate,
95
+ });
96
+ // delete the previous token
97
+ await clearToken(tokenResult.val.id);
98
+ // Login the user
99
+ const token = await prisma.token.create({
100
+ data: {
101
+ id: generateId('Token'),
102
+ user: {
103
+ connect: {
104
+ id: user?.id,
105
+ },
106
+ },
107
+ expiresAt: addDays(new Date(), 365),
108
+ scope: 'all',
109
+ },
110
+ });
111
+ if (previousUser.email !== user.email) {
112
+ await sendEmailChangedEmail(user.id);
113
+ }
114
+ return new Ok({
115
+ accessToken: token.id,
116
+ expiresAt: token.expiresAt,
117
+ user: user,
118
+ });
340
119
  };
341
- export var handleSendVerificationSMS = function(b) {
342
- return _async_to_generator(function() {
343
- var _SendVerificationSMSBody_parse, phoneNumber, checkDuplication, userId, formattedPhoneNumber, user, code, verificationResult;
344
- return _ts_generator(this, function(_state) {
345
- switch(_state.label){
346
- case 0:
347
- _SendVerificationSMSBody_parse = SendVerificationSMSBody.parse(b), phoneNumber = _SendVerificationSMSBody_parse.phoneNumber, checkDuplication = _SendVerificationSMSBody_parse.checkDuplication, userId = _SendVerificationSMSBody_parse.userId;
348
- formattedPhoneNumber = "+".concat(phoneNumber.replace(/[^0-9]/g, ''));
349
- if (!checkDuplication) return [
350
- 3,
351
- 2
352
- ];
353
- return [
354
- 4,
355
- prisma.user.findFirst({
356
- where: {
357
- OR: [
358
- {
359
- phoneNumber: formattedPhoneNumber
360
- },
361
- {
362
- phoneNumber: phoneNumber
363
- }
364
- ],
365
- phoneNumberVerified: true
366
- }
367
- })
368
- ];
369
- case 1:
370
- user = _state.sent();
371
- if (user) {
372
- return [
373
- 2,
374
- new Err(makeProblem(PROBLEM_CONFLICT, 'This phone number is already registered'))
375
- ];
376
- }
377
- _state.label = 2;
378
- case 2:
379
- if (!(!config.isProd && !config.sendSMSOutsideOfProd)) return [
380
- 3,
381
- 4
382
- ];
383
- return [
384
- 4,
385
- createSMSToken(userId || null, formattedPhoneNumber)
386
- ];
387
- case 3:
388
- code = _state.sent();
389
- if (!(code === null || code === void 0 ? void 0 : code.value)) {
390
- return [
391
- 2,
392
- new Err(makeProblem(PROBLEM_INVALID_DATA, 'Invalid Data'))
393
- ];
394
- }
395
- return [
396
- 2,
397
- new Ok({
398
- success: true,
399
- code: code.value
400
- })
401
- ];
402
- case 4:
403
- return [
404
- 4,
405
- sendVerificationSMS(userId || null, phoneNumber)
406
- ];
407
- case 5:
408
- verificationResult = _state.sent();
409
- if (verificationResult.err) {
410
- return [
411
- 2,
412
- verificationResult
413
- ];
414
- }
415
- return [
416
- 2,
417
- new Ok({
418
- success: true
419
- })
420
- ];
421
- }
120
+ export const handleSendVerificationSMS = async (b) => {
121
+ const { phoneNumber, checkDuplication, userId } = SendVerificationSMSBody.parse(b);
122
+ const formattedPhoneNumber = `+${phoneNumber.replace(/[^0-9]/g, '')}`;
123
+ if (checkDuplication) {
124
+ const user = await prisma.user.findFirst({
125
+ where: {
126
+ OR: [
127
+ { phoneNumber: formattedPhoneNumber },
128
+ { phoneNumber: phoneNumber },
129
+ ],
130
+ phoneNumberVerified: true,
131
+ },
422
132
  });
423
- })();
133
+ if (user) {
134
+ return new Err(makeProblem(PROBLEM_CONFLICT, 'This phone number is already registered'));
135
+ }
136
+ }
137
+ if (!config.isProd && !config.sendSMSOutsideOfProd) {
138
+ const code = await createSMSToken(userId || null, formattedPhoneNumber);
139
+ if (!code?.value) {
140
+ return new Err(makeProblem(PROBLEM_INVALID_DATA, 'Invalid Data'));
141
+ }
142
+ return new Ok({
143
+ success: true,
144
+ code: code.value,
145
+ });
146
+ }
147
+ // Send the sms verification
148
+ const verificationResult = await sendVerificationSMS(userId || null, phoneNumber);
149
+ if (verificationResult.err) {
150
+ return verificationResult;
151
+ }
152
+ return new Ok({ success: true });
424
153
  };
154
+ //# sourceMappingURL=otp.js.map
@@ -20,7 +20,7 @@ declare const Body: z.ZodObject<{
20
20
  code: z.ZodNullable<z.ZodOptional<z.ZodString>>;
21
21
  keepCode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
22
22
  email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
23
- dateOfBirth: z.ZodOptional<z.ZodDate>;
23
+ dateOfBirth: z.ZodOptional<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
24
24
  password: z.ZodOptional<z.ZodString>;
25
25
  noMarketing: z.ZodOptional<z.ZodBoolean>;
26
26
  pageSource: z.ZodNullable<z.ZodOptional<z.ZodString>>;