vr-commons 1.0.36 → 1.0.38

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.
@@ -415,7 +415,6 @@ export declare const createRiderSchema: z.ZodObject<{
415
415
  nationalId: z.ZodString;
416
416
  plateNumber: z.ZodString;
417
417
  jacketId: z.ZodString;
418
- securityClearanceId: z.ZodString;
419
418
  }, "strip", z.ZodTypeAny, {
420
419
  firstName: string;
421
420
  lastName: string;
@@ -423,7 +422,6 @@ export declare const createRiderSchema: z.ZodObject<{
423
422
  nationalId: string;
424
423
  plateNumber: string;
425
424
  jacketId: string;
426
- securityClearanceId: string;
427
425
  }, {
428
426
  firstName: string;
429
427
  lastName: string;
@@ -431,7 +429,6 @@ export declare const createRiderSchema: z.ZodObject<{
431
429
  nationalId: string;
432
430
  plateNumber: string;
433
431
  jacketId: string;
434
- securityClearanceId: string;
435
432
  }>;
436
433
  params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
437
434
  query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
@@ -443,7 +440,6 @@ export declare const createRiderSchema: z.ZodObject<{
443
440
  nationalId: string;
444
441
  plateNumber: string;
445
442
  jacketId: string;
446
- securityClearanceId: string;
447
443
  };
448
444
  params?: {} | undefined;
449
445
  query?: {} | undefined;
@@ -455,11 +451,95 @@ export declare const createRiderSchema: z.ZodObject<{
455
451
  nationalId: string;
456
452
  plateNumber: string;
457
453
  jacketId: string;
458
- securityClearanceId: string;
459
454
  };
460
455
  params?: {} | undefined;
461
456
  query?: {} | undefined;
462
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
+ }>;
463
543
  export declare const changePasswordSchema: z.ZodObject<{
464
544
  params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
465
545
  body: z.ZodObject<{
@@ -574,77 +654,6 @@ export declare const deleteAccountSchema: z.ZodObject<{
574
654
  };
575
655
  params?: {} | undefined;
576
656
  }>;
577
- export declare const updateRiderProfileSchema: z.ZodObject<{
578
- params: z.ZodObject<{
579
- riderId: z.ZodString;
580
- }, "strip", z.ZodTypeAny, {
581
- riderId: string;
582
- }, {
583
- riderId: string;
584
- }>;
585
- body: z.ZodEffects<z.ZodObject<{
586
- firstName: z.ZodOptional<z.ZodString>;
587
- lastName: z.ZodOptional<z.ZodString>;
588
- email: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
589
- plateNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
590
- }, "strip", z.ZodTypeAny, {
591
- firstName?: string | undefined;
592
- lastName?: string | undefined;
593
- email?: string | null | undefined;
594
- plateNumber?: string | null | undefined;
595
- }, {
596
- firstName?: string | undefined;
597
- lastName?: string | undefined;
598
- email?: string | null | undefined;
599
- plateNumber?: string | null | undefined;
600
- }>, {
601
- firstName?: string | undefined;
602
- lastName?: string | undefined;
603
- email?: string | null | undefined;
604
- plateNumber?: string | null | undefined;
605
- }, {
606
- firstName?: string | undefined;
607
- lastName?: string | undefined;
608
- email?: string | null | undefined;
609
- plateNumber?: string | null | undefined;
610
- }>;
611
- query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
612
- headers: z.ZodObject<{
613
- authorization: z.ZodString;
614
- }, "strip", z.ZodTypeAny, {
615
- authorization: string;
616
- }, {
617
- authorization: string;
618
- }>;
619
- }, "strip", z.ZodTypeAny, {
620
- params: {
621
- riderId: string;
622
- };
623
- body: {
624
- firstName?: string | undefined;
625
- lastName?: string | undefined;
626
- email?: string | null | undefined;
627
- plateNumber?: string | null | undefined;
628
- };
629
- headers: {
630
- authorization: string;
631
- };
632
- query?: {} | undefined;
633
- }, {
634
- params: {
635
- riderId: string;
636
- };
637
- body: {
638
- firstName?: string | undefined;
639
- lastName?: string | undefined;
640
- email?: string | null | undefined;
641
- plateNumber?: string | null | undefined;
642
- };
643
- headers: {
644
- authorization: string;
645
- };
646
- query?: {} | undefined;
647
- }>;
648
657
  export type CreateUserInput = z.infer<typeof createUserSchema>;
649
658
  export type GetUserByIdInput = z.infer<typeof getUserByIdSchema>;
650
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.updateRiderProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = void 0;
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
@@ -259,11 +259,48 @@ exports.createRiderSchema = zod_1.z.object({
259
259
  jacketId: zod_1.z
260
260
  .string()
261
261
  .regex(jacketIdRegex, "jacketId required and must be of format JKT-"),
262
- securityClearanceId: zod_1.z.string().max(50, "SecurityClearanceId required"),
263
262
  }),
264
263
  params: zod_1.z.object({}).optional(),
265
264
  query: zod_1.z.object({}).optional(),
266
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
+ });
267
304
  // ============================================================================
268
305
  // ACCOUNT MANAGEMENT SCHEMAS
269
306
  // ============================================================================
@@ -319,42 +356,3 @@ exports.deleteAccountSchema = zod_1.z.object({
319
356
  }),
320
357
  }),
321
358
  });
322
- // Update Rider Profile Schema
323
- exports.updateRiderProfileSchema = zod_1.z.object({
324
- params: zod_1.z.object({
325
- riderId: zod_1.z.string().uuid("Invalid rider ID format"),
326
- }),
327
- body: zod_1.z
328
- .object({
329
- firstName: zod_1.z
330
- .string()
331
- .min(2, "First name must be at least 2 characters")
332
- .max(100, "First name cannot exceed 100 characters")
333
- .optional(),
334
- lastName: zod_1.z
335
- .string()
336
- .min(2, "Last name must be at least 2 characters")
337
- .max(100, "Last name cannot exceed 100 characters")
338
- .optional(),
339
- email: zod_1.z
340
- .string()
341
- .email("Invalid email address")
342
- .optional()
343
- .nullable()
344
- .or(zod_1.z.literal("")),
345
- plateNumber: zod_1.z
346
- .string()
347
- .max(20, "Plate number cannot exceed 20 characters")
348
- .optional()
349
- .nullable(),
350
- })
351
- .refine((data) => Object.keys(data).length > 0, {
352
- message: "At least one field must be provided for update",
353
- }),
354
- query: zod_1.z.object({}).optional(),
355
- headers: zod_1.z.object({
356
- authorization: zod_1.z.string().regex(/^Bearer /, {
357
- message: "Authorization header must start with 'Bearer '",
358
- }),
359
- }),
360
- });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",