vr-commons 1.0.37 → 1.0.39
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.
|
@@ -455,6 +455,91 @@ export declare const createRiderSchema: z.ZodObject<{
|
|
|
455
455
|
params?: {} | undefined;
|
|
456
456
|
query?: {} | undefined;
|
|
457
457
|
}>;
|
|
458
|
+
export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
459
|
+
params: z.ZodObject<{
|
|
460
|
+
id: z.ZodString;
|
|
461
|
+
}, "strip", z.ZodTypeAny, {
|
|
462
|
+
id: string;
|
|
463
|
+
}, {
|
|
464
|
+
id: string;
|
|
465
|
+
}>;
|
|
466
|
+
body: z.ZodEffects<z.ZodObject<{
|
|
467
|
+
firstName: z.ZodString;
|
|
468
|
+
lastName: z.ZodString;
|
|
469
|
+
phoneNumber: z.ZodString;
|
|
470
|
+
nationalId: z.ZodString;
|
|
471
|
+
plateNumber: z.ZodString;
|
|
472
|
+
jacketId: z.ZodString;
|
|
473
|
+
}, "strip", z.ZodTypeAny, {
|
|
474
|
+
firstName: string;
|
|
475
|
+
lastName: string;
|
|
476
|
+
phoneNumber: string;
|
|
477
|
+
nationalId: string;
|
|
478
|
+
plateNumber: string;
|
|
479
|
+
jacketId: string;
|
|
480
|
+
}, {
|
|
481
|
+
firstName: string;
|
|
482
|
+
lastName: string;
|
|
483
|
+
phoneNumber: string;
|
|
484
|
+
nationalId: string;
|
|
485
|
+
plateNumber: string;
|
|
486
|
+
jacketId: string;
|
|
487
|
+
}>, {
|
|
488
|
+
firstName: string;
|
|
489
|
+
lastName: string;
|
|
490
|
+
phoneNumber: string;
|
|
491
|
+
nationalId: string;
|
|
492
|
+
plateNumber: string;
|
|
493
|
+
jacketId: string;
|
|
494
|
+
}, {
|
|
495
|
+
firstName: string;
|
|
496
|
+
lastName: string;
|
|
497
|
+
phoneNumber: string;
|
|
498
|
+
nationalId: string;
|
|
499
|
+
plateNumber: string;
|
|
500
|
+
jacketId: string;
|
|
501
|
+
}>;
|
|
502
|
+
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
503
|
+
headers: z.ZodObject<{
|
|
504
|
+
authorization: z.ZodString;
|
|
505
|
+
}, "strip", z.ZodTypeAny, {
|
|
506
|
+
authorization: string;
|
|
507
|
+
}, {
|
|
508
|
+
authorization: string;
|
|
509
|
+
}>;
|
|
510
|
+
}, "strip", z.ZodTypeAny, {
|
|
511
|
+
params: {
|
|
512
|
+
id: string;
|
|
513
|
+
};
|
|
514
|
+
body: {
|
|
515
|
+
firstName: string;
|
|
516
|
+
lastName: string;
|
|
517
|
+
phoneNumber: string;
|
|
518
|
+
nationalId: string;
|
|
519
|
+
plateNumber: string;
|
|
520
|
+
jacketId: string;
|
|
521
|
+
};
|
|
522
|
+
headers: {
|
|
523
|
+
authorization: string;
|
|
524
|
+
};
|
|
525
|
+
query?: {} | undefined;
|
|
526
|
+
}, {
|
|
527
|
+
params: {
|
|
528
|
+
id: string;
|
|
529
|
+
};
|
|
530
|
+
body: {
|
|
531
|
+
firstName: string;
|
|
532
|
+
lastName: string;
|
|
533
|
+
phoneNumber: string;
|
|
534
|
+
nationalId: string;
|
|
535
|
+
plateNumber: string;
|
|
536
|
+
jacketId: string;
|
|
537
|
+
};
|
|
538
|
+
headers: {
|
|
539
|
+
authorization: string;
|
|
540
|
+
};
|
|
541
|
+
query?: {} | undefined;
|
|
542
|
+
}>;
|
|
458
543
|
export declare const changePasswordSchema: z.ZodObject<{
|
|
459
544
|
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
460
545
|
body: z.ZodObject<{
|
|
@@ -569,91 +654,6 @@ export declare const deleteAccountSchema: z.ZodObject<{
|
|
|
569
654
|
};
|
|
570
655
|
params?: {} | undefined;
|
|
571
656
|
}>;
|
|
572
|
-
export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
573
|
-
params: z.ZodObject<{
|
|
574
|
-
riderId: z.ZodString;
|
|
575
|
-
}, "strip", z.ZodTypeAny, {
|
|
576
|
-
riderId: string;
|
|
577
|
-
}, {
|
|
578
|
-
riderId: string;
|
|
579
|
-
}>;
|
|
580
|
-
body: z.ZodEffects<z.ZodObject<{
|
|
581
|
-
firstName: z.ZodString;
|
|
582
|
-
lastName: z.ZodString;
|
|
583
|
-
phoneNumber: z.ZodString;
|
|
584
|
-
nationalId: z.ZodString;
|
|
585
|
-
plateNumber: z.ZodString;
|
|
586
|
-
jacketId: z.ZodString;
|
|
587
|
-
}, "strip", z.ZodTypeAny, {
|
|
588
|
-
firstName: string;
|
|
589
|
-
lastName: string;
|
|
590
|
-
phoneNumber: string;
|
|
591
|
-
nationalId: string;
|
|
592
|
-
plateNumber: string;
|
|
593
|
-
jacketId: string;
|
|
594
|
-
}, {
|
|
595
|
-
firstName: string;
|
|
596
|
-
lastName: string;
|
|
597
|
-
phoneNumber: string;
|
|
598
|
-
nationalId: string;
|
|
599
|
-
plateNumber: string;
|
|
600
|
-
jacketId: string;
|
|
601
|
-
}>, {
|
|
602
|
-
firstName: string;
|
|
603
|
-
lastName: string;
|
|
604
|
-
phoneNumber: string;
|
|
605
|
-
nationalId: string;
|
|
606
|
-
plateNumber: string;
|
|
607
|
-
jacketId: string;
|
|
608
|
-
}, {
|
|
609
|
-
firstName: string;
|
|
610
|
-
lastName: string;
|
|
611
|
-
phoneNumber: string;
|
|
612
|
-
nationalId: string;
|
|
613
|
-
plateNumber: string;
|
|
614
|
-
jacketId: string;
|
|
615
|
-
}>;
|
|
616
|
-
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
617
|
-
headers: z.ZodObject<{
|
|
618
|
-
authorization: z.ZodString;
|
|
619
|
-
}, "strip", z.ZodTypeAny, {
|
|
620
|
-
authorization: string;
|
|
621
|
-
}, {
|
|
622
|
-
authorization: string;
|
|
623
|
-
}>;
|
|
624
|
-
}, "strip", z.ZodTypeAny, {
|
|
625
|
-
params: {
|
|
626
|
-
riderId: string;
|
|
627
|
-
};
|
|
628
|
-
body: {
|
|
629
|
-
firstName: string;
|
|
630
|
-
lastName: string;
|
|
631
|
-
phoneNumber: string;
|
|
632
|
-
nationalId: string;
|
|
633
|
-
plateNumber: string;
|
|
634
|
-
jacketId: string;
|
|
635
|
-
};
|
|
636
|
-
headers: {
|
|
637
|
-
authorization: string;
|
|
638
|
-
};
|
|
639
|
-
query?: {} | undefined;
|
|
640
|
-
}, {
|
|
641
|
-
params: {
|
|
642
|
-
riderId: string;
|
|
643
|
-
};
|
|
644
|
-
body: {
|
|
645
|
-
firstName: string;
|
|
646
|
-
lastName: string;
|
|
647
|
-
phoneNumber: string;
|
|
648
|
-
nationalId: string;
|
|
649
|
-
plateNumber: string;
|
|
650
|
-
jacketId: string;
|
|
651
|
-
};
|
|
652
|
-
headers: {
|
|
653
|
-
authorization: string;
|
|
654
|
-
};
|
|
655
|
-
query?: {} | undefined;
|
|
656
|
-
}>;
|
|
657
657
|
export type CreateUserInput = z.infer<typeof createUserSchema>;
|
|
658
658
|
export type GetUserByIdInput = z.infer<typeof getUserByIdSchema>;
|
|
659
659
|
export type UpdateUserProfileInput = z.infer<typeof updateUserProfileSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.updateRiderProfileSchema = exports.createRiderSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ============================================================================
|
|
6
6
|
// COMMON VALIDATIONS
|
|
@@ -263,6 +263,44 @@ exports.createRiderSchema = zod_1.z.object({
|
|
|
263
263
|
params: zod_1.z.object({}).optional(),
|
|
264
264
|
query: zod_1.z.object({}).optional(),
|
|
265
265
|
});
|
|
266
|
+
// Update Rider Profile Schema
|
|
267
|
+
exports.updateRiderProfileSchema = zod_1.z.object({
|
|
268
|
+
params: zod_1.z.object({
|
|
269
|
+
id: zod_1.z.string().uuid("Invalid rider ID format"),
|
|
270
|
+
}),
|
|
271
|
+
body: zod_1.z
|
|
272
|
+
.object({
|
|
273
|
+
firstName: zod_1.z
|
|
274
|
+
.string()
|
|
275
|
+
.min(2, "First name must be at least 2 characters")
|
|
276
|
+
.max(100, "First name cannot exceed 100 characters"),
|
|
277
|
+
lastName: zod_1.z
|
|
278
|
+
.string()
|
|
279
|
+
.min(2, "Last name must be at least 2 characters")
|
|
280
|
+
.max(100, "Last name cannot exceed 100 characters"),
|
|
281
|
+
phoneNumber: zod_1.z
|
|
282
|
+
.string()
|
|
283
|
+
.regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
284
|
+
nationalId: zod_1.z
|
|
285
|
+
.string()
|
|
286
|
+
.regex(nationalIdRegex, "National ID must be 16 digits"),
|
|
287
|
+
plateNumber: zod_1.z
|
|
288
|
+
.string()
|
|
289
|
+
.max(20, "Plate number cannot exceed 20 characters"),
|
|
290
|
+
jacketId: zod_1.z
|
|
291
|
+
.string()
|
|
292
|
+
.regex(jacketIdRegex, "jacketId required and must be of format JKT-"),
|
|
293
|
+
})
|
|
294
|
+
.refine((data) => Object.keys(data).length > 0, {
|
|
295
|
+
message: "At least one field must be provided for update",
|
|
296
|
+
}),
|
|
297
|
+
query: zod_1.z.object({}).optional(),
|
|
298
|
+
headers: zod_1.z.object({
|
|
299
|
+
authorization: zod_1.z.string().regex(/^Bearer /, {
|
|
300
|
+
message: "Authorization header must start with 'Bearer '",
|
|
301
|
+
}),
|
|
302
|
+
}),
|
|
303
|
+
});
|
|
266
304
|
// ============================================================================
|
|
267
305
|
// ACCOUNT MANAGEMENT SCHEMAS
|
|
268
306
|
// ============================================================================
|
|
@@ -318,41 +356,3 @@ exports.deleteAccountSchema = zod_1.z.object({
|
|
|
318
356
|
}),
|
|
319
357
|
}),
|
|
320
358
|
});
|
|
321
|
-
// Update Rider Profile Schema
|
|
322
|
-
exports.updateRiderProfileSchema = zod_1.z.object({
|
|
323
|
-
params: zod_1.z.object({
|
|
324
|
-
riderId: zod_1.z.string().uuid("Invalid rider ID format"),
|
|
325
|
-
}),
|
|
326
|
-
body: zod_1.z
|
|
327
|
-
.object({
|
|
328
|
-
firstName: zod_1.z
|
|
329
|
-
.string()
|
|
330
|
-
.min(2, "First name must be at least 2 characters")
|
|
331
|
-
.max(100, "First name cannot exceed 100 characters"),
|
|
332
|
-
lastName: zod_1.z
|
|
333
|
-
.string()
|
|
334
|
-
.min(2, "Last name must be at least 2 characters")
|
|
335
|
-
.max(100, "Last name cannot exceed 100 characters"),
|
|
336
|
-
phoneNumber: zod_1.z
|
|
337
|
-
.string()
|
|
338
|
-
.regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
339
|
-
nationalId: zod_1.z
|
|
340
|
-
.string()
|
|
341
|
-
.regex(nationalIdRegex, "National ID must be 16 digits"),
|
|
342
|
-
plateNumber: zod_1.z
|
|
343
|
-
.string()
|
|
344
|
-
.max(20, "Plate number cannot exceed 20 characters"),
|
|
345
|
-
jacketId: zod_1.z
|
|
346
|
-
.string()
|
|
347
|
-
.regex(jacketIdRegex, "jacketId required and must be of format JKT-"),
|
|
348
|
-
})
|
|
349
|
-
.refine((data) => Object.keys(data).length > 0, {
|
|
350
|
-
message: "At least one field must be provided for update",
|
|
351
|
-
}),
|
|
352
|
-
query: zod_1.z.object({}).optional(),
|
|
353
|
-
headers: zod_1.z.object({
|
|
354
|
-
authorization: zod_1.z.string().regex(/^Bearer /, {
|
|
355
|
-
message: "Authorization header must start with 'Bearer '",
|
|
356
|
-
}),
|
|
357
|
-
}),
|
|
358
|
-
});
|