vr-commons 1.0.59 → 1.0.61

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.
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // src/middlewares/auth/checkUserAuthentication.middleware.ts
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
4
  };
@@ -8,6 +7,7 @@ exports.checkUserAuthentication = void 0;
8
7
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
9
8
  const vr_models_1 = require("vr-models");
10
9
  const __1 = require("..");
10
+ const authTokens_utils_1 = require("../utils/authTokens.utils");
11
11
  const checkUserAuthentication = (allowedRoles) => async (req, res, next) => {
12
12
  try {
13
13
  const authHeader = req.headers.authorization;
@@ -21,14 +21,10 @@ const checkUserAuthentication = (allowedRoles) => async (req, res, next) => {
21
21
  }
22
22
  catch (error) {
23
23
  if (error instanceof jsonwebtoken_1.default.TokenExpiredError) {
24
- return (0, __1.sendErrorResponse)(res, "Token expired", 401);
24
+ return (0, __1.sendErrorResponse)(res, "Token expired. Please re-verify your phone.", 401);
25
25
  }
26
26
  return (0, __1.sendErrorResponse)(res, "Token invalid", 401);
27
27
  }
28
- // Validate that sessionId exists in payload
29
- if (!payload.sessionId) {
30
- return (0, __1.sendErrorResponse)(res, "Invalid token format: missing session", 401);
31
- }
32
28
  const user = await vr_models_1.User.findOne({
33
29
  where: { id: payload.userId },
34
30
  include: [
@@ -45,34 +41,40 @@ const checkUserAuthentication = (allowedRoles) => async (req, res, next) => {
45
41
  // Check account moderation status
46
42
  const moderation = await (0, __1.checkIsUserBannedOrSuspended)(user.id);
47
43
  if (moderation.isRestricted) {
48
- return (0, __1.sendErrorResponse)(res, "Restricted", 403, moderation);
44
+ return (0, __1.sendErrorResponse)(res, "Account restricted", 403, moderation);
49
45
  }
50
46
  // 🔐 Token versioning (logout all devices)
51
47
  if (user.tokenVersion !== payload.tokenVersion) {
52
- return (0, __1.sendErrorResponse)(res, "Session expired - token version mismatch", 401);
48
+ return (0, __1.sendErrorResponse)(res, "Session expired. Please re-verify your phone.", 401);
53
49
  }
54
50
  // 🧱 Role enforcement
55
51
  if (!allowedRoles.includes(user.securityClearance.role)) {
56
52
  return (0, __1.sendErrorResponse)(res, "Access denied", 403);
57
53
  }
58
- // Reconstruct session from payload
59
- const currentTime = Math.floor(Date.now() / 1000);
60
- const session = {
61
- sessionId: payload.sessionId,
62
- startedAt: payload.iat ? payload.iat * 1000 : Date.now(), // Convert to ms if exists
63
- expiresAt: payload.exp
64
- ? payload.exp * 1000
65
- : Date.now() + 15 * 60 * 1000, // Default 15min if no exp
66
- userId: user.id,
67
- tokenVersion: user.tokenVersion,
68
- };
69
- // ✅ Extend req with user info AND session
54
+ // Extend req with user info
70
55
  req.userId = user.id;
71
56
  req.firstName = user.firstName;
72
57
  req.lastName = user.lastName;
73
58
  req.scRole = user.securityClearance.role;
74
59
  req.scLevel = user.securityClearance.level;
75
- req.session = session;
60
+ req.tokenVersion = user.tokenVersion;
61
+ // Optional: Add sessionId if present in payload (for backward compatibility)
62
+ if (payload.sessionId) {
63
+ req.sessionId = payload.sessionId;
64
+ }
65
+ // 🔄 Auto-refresh token if it's about to expire (within 5 days)
66
+ if ((0, authTokens_utils_1.shouldRefreshToken)(token)) {
67
+ const newToken = (0, authTokens_utils_1.generateToken)(user.id, user.securityClearance.role, user.securityClearance.level, user.tokenVersion, payload.sessionId, // Preserve sessionId if exists
68
+ user.securityClearance.role === "ADMIN"
69
+ ? "ADMIN"
70
+ : user.securityClearance.role === "RIDER"
71
+ ? "RIDER"
72
+ : "PASSENGER");
73
+ // Set new token in response header for client to update
74
+ res.setHeader("X-New-Token", newToken);
75
+ res.setHeader("X-Token-Refreshed", "true");
76
+ console.log(`🔄 Auto-refreshed token for user ${user.id}`);
77
+ }
76
78
  next();
77
79
  }
78
80
  catch (error) {
@@ -4,14 +4,15 @@ export interface JWTPayload {
4
4
  role: string;
5
5
  level: number;
6
6
  tokenVersion: number;
7
- sessionId: string;
7
+ sessionId?: string;
8
8
  iat?: number;
9
9
  exp?: number;
10
10
  }
11
- export declare const generateToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId: string, type: "ADMIN" | "PASSENGER" | "RIDER") => string;
12
- export declare const generateAdminToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId: string) => string;
13
- export declare const generatePassengerToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId: string) => string;
14
- export declare const generateRiderToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId: string) => string;
11
+ export declare const generateToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId?: string, // Made optional for new flow
12
+ type?: "ADMIN" | "PASSENGER" | "RIDER") => string;
13
+ export declare const generateAdminToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId?: string) => string;
14
+ export declare const generatePassengerToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId?: string) => string;
15
+ export declare const generateRiderToken: (userId: string, role: UserRole, level: number, tokenVersion: number, sessionId?: string) => string;
15
16
  export declare const verifyToken: (token: string) => Promise<JWTPayload>;
16
17
  export declare const shouldRefreshToken: (token: string) => boolean;
17
18
  export declare const getTokenTimeRemaining: (token: string) => number | null;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.formatTimeRemaining = exports.getTokenTimeRemaining = exports.shouldRefreshToken = exports.verifyToken = exports.generateRiderToken = exports.generatePassengerToken = exports.generateAdminToken = exports.generateToken = void 0;
7
7
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
8
- // Get token lifespan from env with fallback to 15 minutes (in seconds)
8
+ // Get token lifespan from env with fallback to 30 days (in seconds)
9
9
  const getTokenLifespan = (type) => {
10
10
  const envVar = `${type}_TOKEN_LIFE_SPAN`;
11
11
  const value = process.env[envVar];
@@ -15,23 +15,24 @@ const getTokenLifespan = (type) => {
15
15
  return parsed;
16
16
  }
17
17
  }
18
- // Default to 15 minutes (900 seconds)
19
- console.warn(`⚠️ ${envVar} not set or invalid, using default 15 minutes (900 seconds)`);
20
- return 900;
18
+ // Default to 30 days (2,592,000 seconds)
19
+ console.warn(`⚠️ ${envVar} not set or invalid, using default 30 days (2,592,000 seconds)`);
20
+ return 30 * 24 * 60 * 60;
21
21
  };
22
- // Helper to ensure expiration is exactly 15 minutes from now
23
- const generateToken = (userId, role, level, tokenVersion, sessionId, type) => {
22
+ // Helper to generate token with 30-day expiry
23
+ const generateToken = (userId, role, level, tokenVersion, sessionId, // Made optional for new flow
24
+ type = "PASSENGER") => {
24
25
  const payload = {
25
26
  userId,
26
27
  role,
27
28
  level,
28
29
  tokenVersion,
29
- sessionId,
30
+ ...(sessionId && { sessionId }), // Only include sessionId if provided
30
31
  };
31
32
  const expiresIn = getTokenLifespan(type);
32
- console.log(`🔐 Generating ${type} token for user ${userId} with ${expiresIn}s expiry`);
33
+ console.log(`🔐 Generating ${type} token for user ${userId} with ${expiresIn}s expiry (${expiresIn / 86400} days)`);
33
34
  return jsonwebtoken_1.default.sign(payload, process.env.JWT_SECRET, {
34
- expiresIn, // This ensures exp is set to (iat + expiresIn)
35
+ expiresIn,
35
36
  });
36
37
  };
37
38
  exports.generateToken = generateToken;
@@ -55,9 +56,10 @@ const verifyToken = async (token) => {
55
56
  // Log token expiration info for debugging
56
57
  if (decoded.exp) {
57
58
  const expiresIn = decoded.exp - Math.floor(Date.now() / 1000);
58
- console.log(`🔍 Token expires in ${expiresIn} seconds`);
59
- if (expiresIn < 300) {
60
- // Less than 5 minutes
59
+ const daysRemaining = expiresIn / 86400;
60
+ console.log(`🔍 Token expires in ${expiresIn} seconds (${daysRemaining.toFixed(1)} days)`);
61
+ if (expiresIn < 5 * 24 * 60 * 60) {
62
+ // Less than 5 days
61
63
  console.warn(`⚠️ Token expiring soon: ${expiresIn} seconds remaining`);
62
64
  }
63
65
  }
@@ -76,7 +78,7 @@ const verifyToken = async (token) => {
76
78
  }
77
79
  };
78
80
  exports.verifyToken = verifyToken;
79
- // Helper to check if token needs refresh (within 5 minutes of expiry)
81
+ // Helper to check if token needs refresh (within 5 days of expiry)
80
82
  const shouldRefreshToken = (token) => {
81
83
  try {
82
84
  const decoded = jsonwebtoken_1.default.decode(token);
@@ -84,7 +86,7 @@ const shouldRefreshToken = (token) => {
84
86
  return false;
85
87
  const now = Math.floor(Date.now() / 1000);
86
88
  const timeUntilExpiry = decoded.exp - now;
87
- const refreshThreshold = 300; // 5 minutes in seconds
89
+ const refreshThreshold = 5 * 24 * 60 * 60; // 5 days in seconds
88
90
  return timeUntilExpiry < refreshThreshold && timeUntilExpiry > 0;
89
91
  }
90
92
  catch {
@@ -108,10 +110,16 @@ const getTokenTimeRemaining = (token) => {
108
110
  exports.getTokenTimeRemaining = getTokenTimeRemaining;
109
111
  // Format time remaining in a human-readable format
110
112
  const formatTimeRemaining = (seconds) => {
111
- if (seconds < 60)
112
- return `${seconds} seconds`;
113
- if (seconds < 3600)
114
- return `${Math.floor(seconds / 60)} minutes ${seconds % 60} seconds`;
115
- return `${Math.floor(seconds / 3600)} hours ${Math.floor((seconds % 3600) / 60)} minutes`;
113
+ const days = Math.floor(seconds / 86400);
114
+ const hours = Math.floor((seconds % 86400) / 3600);
115
+ const minutes = Math.floor((seconds % 3600) / 60);
116
+ const secs = seconds % 60;
117
+ if (days > 0)
118
+ return `${days} days, ${hours} hours`;
119
+ if (hours > 0)
120
+ return `${hours} hours, ${minutes} minutes`;
121
+ if (minutes > 0)
122
+ return `${minutes} minutes, ${secs} seconds`;
123
+ return `${secs} seconds`;
116
124
  };
117
125
  exports.formatTimeRemaining = formatTimeRemaining;
@@ -6,6 +6,6 @@ export { formatUserProfile, formatUserListResponse, hasRole, hasPermission, hasA
6
6
  export { canModerate, canModerateUser, getModeratableRoles, hasHigherAuthority, } from "./moderation.utils";
7
7
  export { banUtil } from "./bans.utils";
8
8
  export { suspensionUtil } from "./suspension.utils";
9
- export { createSession, getTokenTimeRemaining, shouldRefreshToken, } from "./session.utils";
9
+ export { createDeviceSession } from "./session.utils";
10
10
  export { generateOTP, getOTPExpiry, getVerificationMethod, sendEmail, sendSMS, sendVerificationCode, } from "./verification.utils";
11
11
  export { PendingRegistration, VerificationMethod, ConfirmResponse, } from "./types";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendVerificationCode = exports.sendSMS = exports.sendEmail = exports.getVerificationMethod = exports.getOTPExpiry = exports.generateOTP = exports.shouldRefreshToken = exports.getTokenTimeRemaining = exports.createSession = exports.suspensionUtil = exports.banUtil = exports.hasHigherAuthority = exports.getModeratableRoles = exports.canModerateUser = exports.canModerate = exports.softDeleteUser = exports.hashPassword = exports.validatePassword = exports.validateUniqueFields = exports.generateJacketId = exports.getSortOrder = exports.generateEventSearchConditions = exports.generateUserSearchConditions = exports.findSecurityClearanceByRole = exports.getUsersByRole = exports.getUserById = exports.isAccountAccessible = exports.canModifyAccount = exports.hasAllPermissions = exports.hasAnyPermission = exports.hasPermission = exports.hasRole = exports.formatUserListResponse = exports.formatUserProfile = exports.sendErrorResponse = exports.sendSuccessResponse = exports.logEvent = exports.verifyToken = exports.generateRiderToken = exports.generatePassengerToken = exports.generateAdminToken = exports.checkSuspensionStatus = exports.checkIsUserBannedOrSuspended = exports.checkBanStatus = exports.hasActiveDependencies = exports.checkAccountDependencies = void 0;
3
+ exports.sendVerificationCode = exports.sendSMS = exports.sendEmail = exports.getVerificationMethod = exports.getOTPExpiry = exports.generateOTP = exports.createDeviceSession = exports.suspensionUtil = exports.banUtil = exports.hasHigherAuthority = exports.getModeratableRoles = exports.canModerateUser = exports.canModerate = exports.softDeleteUser = exports.hashPassword = exports.validatePassword = exports.validateUniqueFields = exports.generateJacketId = exports.getSortOrder = exports.generateEventSearchConditions = exports.generateUserSearchConditions = exports.findSecurityClearanceByRole = exports.getUsersByRole = exports.getUserById = exports.isAccountAccessible = exports.canModifyAccount = exports.hasAllPermissions = exports.hasAnyPermission = exports.hasPermission = exports.hasRole = exports.formatUserListResponse = exports.formatUserProfile = exports.sendErrorResponse = exports.sendSuccessResponse = exports.logEvent = exports.verifyToken = exports.generateRiderToken = exports.generatePassengerToken = exports.generateAdminToken = exports.checkSuspensionStatus = exports.checkIsUserBannedOrSuspended = exports.checkBanStatus = exports.hasActiveDependencies = exports.checkAccountDependencies = void 0;
4
4
  var account_utils_1 = require("./account.utils");
5
5
  Object.defineProperty(exports, "checkAccountDependencies", { enumerable: true, get: function () { return account_utils_1.checkAccountDependencies; } });
6
6
  Object.defineProperty(exports, "hasActiveDependencies", { enumerable: true, get: function () { return account_utils_1.hasActiveDependencies; } });
@@ -54,9 +54,7 @@ Object.defineProperty(exports, "banUtil", { enumerable: true, get: function () {
54
54
  var suspension_utils_1 = require("./suspension.utils");
55
55
  Object.defineProperty(exports, "suspensionUtil", { enumerable: true, get: function () { return suspension_utils_1.suspensionUtil; } });
56
56
  var session_utils_1 = require("./session.utils");
57
- Object.defineProperty(exports, "createSession", { enumerable: true, get: function () { return session_utils_1.createSession; } });
58
- Object.defineProperty(exports, "getTokenTimeRemaining", { enumerable: true, get: function () { return session_utils_1.getTokenTimeRemaining; } });
59
- Object.defineProperty(exports, "shouldRefreshToken", { enumerable: true, get: function () { return session_utils_1.shouldRefreshToken; } });
57
+ Object.defineProperty(exports, "createDeviceSession", { enumerable: true, get: function () { return session_utils_1.createDeviceSession; } });
60
58
  var verification_utils_1 = require("./verification.utils");
61
59
  Object.defineProperty(exports, "generateOTP", { enumerable: true, get: function () { return verification_utils_1.generateOTP; } });
62
60
  Object.defineProperty(exports, "getOTPExpiry", { enumerable: true, get: function () { return verification_utils_1.getOTPExpiry; } });
@@ -1,17 +1,6 @@
1
1
  import { SessionPayload } from "vr-models";
2
2
  /**
3
- * Create a new session
3
+ * Create a new device session (for BLE unlock)
4
+ * This is separate from the long-lasting auth token
4
5
  */
5
- export declare const createSession: (userId: string, tokenVersion: number) => SessionPayload;
6
- /**
7
- * Check if token needs refresh (within 5 minutes of expiry)
8
- */
9
- export declare const shouldRefreshToken: (token: string) => boolean;
10
- /**
11
- * Get time remaining on token in seconds
12
- */
13
- export declare const getTokenTimeRemaining: (token: string) => number | null;
14
- /**
15
- * Format time remaining in a human-readable format
16
- */
17
- export declare const formatTimeRemaining: (seconds: number) => string;
6
+ export declare const createDeviceSession: (userId: string, tokenVersion: number) => SessionPayload;
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.formatTimeRemaining = exports.getTokenTimeRemaining = exports.shouldRefreshToken = exports.createSession = void 0;
3
+ exports.createDeviceSession = void 0;
7
4
  const uuid_1 = require("uuid");
8
- const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
9
- const SESSION_DURATION = parseInt(process.env.SESSION_DURATION || "15") * 60 * 1000; // Convert minutes to milliseconds
5
+ // Session duration for device unlock sessions (15 minutes)
6
+ const SESSION_DURATION = parseInt(process.env.DEVICE_SESSION_DURATION || "15") * 60 * 1000; // Convert minutes to milliseconds
10
7
  /**
11
- * Create a new session
8
+ * Create a new device session (for BLE unlock)
9
+ * This is separate from the long-lasting auth token
12
10
  */
13
- const createSession = (userId, tokenVersion) => {
11
+ const createDeviceSession = (userId, tokenVersion) => {
14
12
  const now = Date.now();
15
13
  return {
16
14
  sessionId: (0, uuid_1.v4)(),
@@ -20,49 +18,6 @@ const createSession = (userId, tokenVersion) => {
20
18
  tokenVersion,
21
19
  };
22
20
  };
23
- exports.createSession = createSession;
24
- /**
25
- * Check if token needs refresh (within 5 minutes of expiry)
26
- */
27
- const shouldRefreshToken = (token) => {
28
- try {
29
- const decoded = jsonwebtoken_1.default.decode(token);
30
- if (!decoded || !decoded.exp)
31
- return false;
32
- const now = Math.floor(Date.now() / 1000);
33
- const timeUntilExpiry = decoded.exp - now;
34
- const refreshThreshold = 300; // 5 minutes in seconds
35
- return timeUntilExpiry < refreshThreshold && timeUntilExpiry > 0;
36
- }
37
- catch {
38
- return false;
39
- }
40
- };
41
- exports.shouldRefreshToken = shouldRefreshToken;
42
- /**
43
- * Get time remaining on token in seconds
44
- */
45
- const getTokenTimeRemaining = (token) => {
46
- try {
47
- const decoded = jsonwebtoken_1.default.decode(token);
48
- if (!decoded || !decoded.exp)
49
- return null;
50
- const now = Math.floor(Date.now() / 1000);
51
- return Math.max(0, decoded.exp - now);
52
- }
53
- catch {
54
- return null;
55
- }
56
- };
57
- exports.getTokenTimeRemaining = getTokenTimeRemaining;
58
- /**
59
- * Format time remaining in a human-readable format
60
- */
61
- const formatTimeRemaining = (seconds) => {
62
- if (seconds < 60)
63
- return `${seconds} seconds`;
64
- if (seconds < 3600)
65
- return `${Math.floor(seconds / 60)} minutes ${seconds % 60} seconds`;
66
- return `${Math.floor(seconds / 3600)} hours ${Math.floor((seconds % 3600) / 60)} minutes`;
67
- };
68
- exports.formatTimeRemaining = formatTimeRemaining;
21
+ exports.createDeviceSession = createDeviceSession;
22
+ // Note: We no longer need session-related functions for auth tokens
23
+ // since we're using a single 30-day token without session tracking
@@ -616,9 +616,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
616
616
  sentryDsn?: string | null | undefined;
617
617
  }>;
618
618
  }, "strip", z.ZodTypeAny, {
619
- params: {
620
- id: string;
621
- };
622
619
  body: {
623
620
  appName?: string | undefined;
624
621
  appShortName?: string | null | undefined;
@@ -695,10 +692,10 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
695
692
  facebookPixelId?: string | null | undefined;
696
693
  sentryDsn?: string | null | undefined;
697
694
  };
698
- }, {
699
695
  params: {
700
696
  id: string;
701
697
  };
698
+ }, {
702
699
  body: {
703
700
  appName?: string | undefined;
704
701
  appShortName?: string | null | undefined;
@@ -775,6 +772,9 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
775
772
  facebookPixelId?: string | null | undefined;
776
773
  sentryDsn?: string | null | undefined;
777
774
  };
775
+ params: {
776
+ id: string;
777
+ };
778
778
  }>;
779
779
  export declare const listAppSpecsSchema: z.ZodObject<{
780
780
  query: z.ZodObject<{
@@ -785,37 +785,37 @@ export declare const listAppSpecsSchema: z.ZodObject<{
785
785
  sortBy: z.ZodOptional<z.ZodEnum<["version", "createdAt", "updatedAt"]>>;
786
786
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
787
787
  }, "strip", z.ZodTypeAny, {
788
- page: number;
789
788
  limit: number;
790
- sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
791
- sortOrder?: "ASC" | "DESC" | undefined;
789
+ page: number;
792
790
  search?: string | undefined;
793
791
  isActive?: "true" | "false" | undefined;
794
- }, {
795
- page?: string | undefined;
796
- limit?: string | undefined;
797
792
  sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
798
- sortOrder?: "ASC" | "DESC" | undefined;
793
+ sortOrder?: "DESC" | "ASC" | undefined;
794
+ }, {
799
795
  search?: string | undefined;
796
+ limit?: string | undefined;
800
797
  isActive?: "true" | "false" | undefined;
798
+ page?: string | undefined;
799
+ sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
800
+ sortOrder?: "DESC" | "ASC" | undefined;
801
801
  }>;
802
802
  }, "strip", z.ZodTypeAny, {
803
803
  query: {
804
- page: number;
805
804
  limit: number;
806
- sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
807
- sortOrder?: "ASC" | "DESC" | undefined;
805
+ page: number;
808
806
  search?: string | undefined;
809
807
  isActive?: "true" | "false" | undefined;
808
+ sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
809
+ sortOrder?: "DESC" | "ASC" | undefined;
810
810
  };
811
811
  }, {
812
812
  query: {
813
- page?: string | undefined;
814
- limit?: string | undefined;
815
- sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
816
- sortOrder?: "ASC" | "DESC" | undefined;
817
813
  search?: string | undefined;
814
+ limit?: string | undefined;
818
815
  isActive?: "true" | "false" | undefined;
816
+ page?: string | undefined;
817
+ sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
818
+ sortOrder?: "DESC" | "ASC" | undefined;
819
819
  };
820
820
  }>;
821
821
  export declare const getAppSpecsSchema: z.ZodObject<{
@@ -15,19 +15,19 @@ export declare const submitBanAppealSchema: z.ZodObject<{
15
15
  appealReason: string;
16
16
  }>;
17
17
  }, "strip", z.ZodTypeAny, {
18
- params: {
19
- banId: string;
20
- };
21
18
  body: {
22
19
  appealReason: string;
23
20
  };
24
- }, {
25
21
  params: {
26
22
  banId: string;
27
23
  };
24
+ }, {
28
25
  body: {
29
26
  appealReason: string;
30
27
  };
28
+ params: {
29
+ banId: string;
30
+ };
31
31
  }>;
32
32
  export declare const submitSuspensionAppealSchema: z.ZodObject<{
33
33
  params: z.ZodObject<{
@@ -45,17 +45,17 @@ export declare const submitSuspensionAppealSchema: z.ZodObject<{
45
45
  appealReason: string;
46
46
  }>;
47
47
  }, "strip", z.ZodTypeAny, {
48
- params: {
49
- suspensionId: string;
50
- };
51
48
  body: {
52
49
  appealReason: string;
53
50
  };
54
- }, {
55
51
  params: {
56
52
  suspensionId: string;
57
53
  };
54
+ }, {
58
55
  body: {
59
56
  appealReason: string;
60
57
  };
58
+ params: {
59
+ suspensionId: string;
60
+ };
61
61
  }>;
@@ -20,16 +20,16 @@ export declare const riderLoginSchema: z.ZodObject<{
20
20
  phoneNumber: string;
21
21
  nationalId: string;
22
22
  };
23
- params?: {} | undefined;
24
23
  query?: {} | undefined;
24
+ params?: {} | undefined;
25
25
  headers?: {} | undefined;
26
26
  }, {
27
27
  body: {
28
28
  phoneNumber: string;
29
29
  nationalId: string;
30
30
  };
31
- params?: {} | undefined;
32
31
  query?: {} | undefined;
32
+ params?: {} | undefined;
33
33
  headers?: {} | undefined;
34
34
  }>;
35
35
  export declare const userLoginSchema: z.ZodObject<{
@@ -32,19 +32,19 @@ export declare const getUserRestrictionsSchema: z.ZodObject<{
32
32
  includeResolved?: "true" | "false" | undefined;
33
33
  }>;
34
34
  }, "strip", z.ZodTypeAny, {
35
- params: {
36
- userId: string;
37
- };
38
35
  query: {
39
36
  includeResolved?: "true" | "false" | undefined;
40
37
  };
41
- }, {
42
38
  params: {
43
39
  userId: string;
44
40
  };
41
+ }, {
45
42
  query: {
46
43
  includeResolved?: "true" | "false" | undefined;
47
44
  };
45
+ params: {
46
+ userId: string;
47
+ };
48
48
  }>;
49
49
  export declare const createBanSchema: z.ZodObject<{
50
50
  params: z.ZodObject<{
@@ -65,19 +65,19 @@ export declare const createBanSchema: z.ZodObject<{
65
65
  isPermanent?: boolean | undefined;
66
66
  }>;
67
67
  }, "strip", z.ZodTypeAny, {
68
- params: {
69
- userId: string;
70
- };
71
68
  body: {
72
69
  reason: string;
73
70
  isPermanent: boolean;
74
71
  };
75
- }, {
76
72
  params: {
77
73
  userId: string;
78
74
  };
75
+ }, {
79
76
  body: {
80
77
  reason: string;
81
78
  isPermanent?: boolean | undefined;
82
79
  };
80
+ params: {
81
+ userId: string;
82
+ };
83
83
  }>;
@@ -7,33 +7,33 @@ export declare const listUserPaymentPlansSchema: z.ZodObject<{
7
7
  sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "updatedAt", "nextInstallmentDueAt", "status"]>>;
8
8
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
9
9
  }, "strip", z.ZodTypeAny, {
10
- page: number;
11
10
  limit: number;
11
+ page: number;
12
12
  status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
13
- sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
14
- sortOrder?: "ASC" | "DESC" | undefined;
13
+ sortBy?: "createdAt" | "updatedAt" | "status" | "nextInstallmentDueAt" | undefined;
14
+ sortOrder?: "DESC" | "ASC" | undefined;
15
15
  }, {
16
+ limit?: string | undefined;
16
17
  status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
17
18
  page?: string | undefined;
18
- limit?: string | undefined;
19
- sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
20
- sortOrder?: "ASC" | "DESC" | undefined;
19
+ sortBy?: "createdAt" | "updatedAt" | "status" | "nextInstallmentDueAt" | undefined;
20
+ sortOrder?: "DESC" | "ASC" | undefined;
21
21
  }>;
22
22
  }, "strip", z.ZodTypeAny, {
23
23
  query: {
24
- page: number;
25
24
  limit: number;
25
+ page: number;
26
26
  status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
27
- sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
28
- sortOrder?: "ASC" | "DESC" | undefined;
27
+ sortBy?: "createdAt" | "updatedAt" | "status" | "nextInstallmentDueAt" | undefined;
28
+ sortOrder?: "DESC" | "ASC" | undefined;
29
29
  };
30
30
  }, {
31
31
  query: {
32
+ limit?: string | undefined;
32
33
  status?: "ACTIVE" | "COMPLETED" | "DEFAULTED" | "CANCELLED" | undefined;
33
34
  page?: string | undefined;
34
- limit?: string | undefined;
35
- sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
36
- sortOrder?: "ASC" | "DESC" | undefined;
35
+ sortBy?: "createdAt" | "updatedAt" | "status" | "nextInstallmentDueAt" | undefined;
36
+ sortOrder?: "DESC" | "ASC" | undefined;
37
37
  };
38
38
  }>;
39
39
  export declare const getUserPaymentPlanSchema: z.ZodObject<{
@@ -7,5 +7,5 @@ export { getBanSchema, getUserRestrictionsSchema, createBanSchema, } from "./ban
7
7
  export { getSuspensionSchema, getUserSuspensionsSchema, createSuspensionSchema, } from "./suspensions.validations";
8
8
  export { createAppSpecsSchema, updateAppSpecsSchema, listAppSpecsSchema, getActiveAppSpecsSchema, activateAppSpecsSchema, getAppSpecsSchema, } from "./appSpecs.validations";
9
9
  export { listUserPaymentPlansSchema, getUserPaymentPlanSchema, } from "./devicePaymentPlan.validations";
10
- export { unlockDeviceSchema } from "./devices.validations";
10
+ export { unlockDeviceSchema, extendSessionSchema } from "./devices.validations";
11
11
  export { payInstallmentSchema } from "./payinstallment.validations";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.payInstallmentSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = exports.getAppSpecsSchema = exports.activateAppSpecsSchema = exports.getActiveAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = exports.createSuspensionSchema = exports.getUserSuspensionsSchema = exports.getSuspensionSchema = exports.createBanSchema = exports.getUserRestrictionsSchema = exports.getBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.exportBansSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.reviewAppealSchema = exports.listSuspensionsSchema = exports.listPendingAppealsSchema = exports.listBansSchema = exports.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.resendOtpSchema = exports.verifySchema = exports.confirmSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
3
+ exports.payInstallmentSchema = exports.extendSessionSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = exports.getAppSpecsSchema = exports.activateAppSpecsSchema = exports.getActiveAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = exports.createSuspensionSchema = exports.getUserSuspensionsSchema = exports.getSuspensionSchema = exports.createBanSchema = exports.getUserRestrictionsSchema = exports.getBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.exportBansSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.reviewAppealSchema = exports.listSuspensionsSchema = exports.listPendingAppealsSchema = exports.listBansSchema = exports.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.resendOtpSchema = exports.verifySchema = exports.confirmSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
4
4
  var validate_validations_1 = require("./validate.validations");
5
5
  Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
6
6
  var auth_validations_1 = require("./auth.validations");
@@ -63,5 +63,6 @@ Object.defineProperty(exports, "listUserPaymentPlansSchema", { enumerable: true,
63
63
  Object.defineProperty(exports, "getUserPaymentPlanSchema", { enumerable: true, get: function () { return devicePaymentPlan_validations_1.getUserPaymentPlanSchema; } });
64
64
  var devices_validations_1 = require("./devices.validations");
65
65
  Object.defineProperty(exports, "unlockDeviceSchema", { enumerable: true, get: function () { return devices_validations_1.unlockDeviceSchema; } });
66
+ Object.defineProperty(exports, "extendSessionSchema", { enumerable: true, get: function () { return devices_validations_1.extendSessionSchema; } });
66
67
  var payinstallment_validations_1 = require("./payinstallment.validations");
67
68
  Object.defineProperty(exports, "payInstallmentSchema", { enumerable: true, get: function () { return payinstallment_validations_1.payInstallmentSchema; } });
@@ -14,81 +14,81 @@ export declare const listBansSchema: z.ZodObject<{
14
14
  sortBy: z.ZodOptional<z.ZodEnum<["bannedAt", "createdAt", "reason"]>>;
15
15
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
16
16
  }, "strip", z.ZodTypeAny, {
17
- page: number;
18
17
  limit: number;
19
- status?: "active" | "revoked" | undefined;
20
- sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
21
- sortOrder?: "ASC" | "DESC" | undefined;
18
+ page: number;
22
19
  search?: string | undefined;
23
20
  userId?: string | undefined;
24
21
  isPermanent?: "true" | "false" | undefined;
25
22
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
23
+ status?: "active" | "revoked" | undefined;
24
+ sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
26
25
  fromDate?: string | undefined;
27
26
  toDate?: string | undefined;
27
+ sortOrder?: "DESC" | "ASC" | undefined;
28
28
  }, {
29
- status?: "active" | "revoked" | undefined;
30
- page?: string | undefined;
31
- limit?: string | undefined;
32
- sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
33
- sortOrder?: "ASC" | "DESC" | undefined;
34
29
  search?: string | undefined;
30
+ limit?: string | undefined;
35
31
  userId?: string | undefined;
36
32
  isPermanent?: "true" | "false" | undefined;
37
33
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
34
+ status?: "active" | "revoked" | undefined;
35
+ page?: string | undefined;
36
+ sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
38
37
  fromDate?: string | undefined;
39
38
  toDate?: string | undefined;
39
+ sortOrder?: "DESC" | "ASC" | undefined;
40
40
  }>, {
41
- page: number;
42
41
  limit: number;
43
- status?: "active" | "revoked" | undefined;
44
- sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
45
- sortOrder?: "ASC" | "DESC" | undefined;
42
+ page: number;
46
43
  search?: string | undefined;
47
44
  userId?: string | undefined;
48
45
  isPermanent?: "true" | "false" | undefined;
49
46
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
47
+ status?: "active" | "revoked" | undefined;
48
+ sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
50
49
  fromDate?: string | undefined;
51
50
  toDate?: string | undefined;
51
+ sortOrder?: "DESC" | "ASC" | undefined;
52
52
  }, {
53
- status?: "active" | "revoked" | undefined;
54
- page?: string | undefined;
55
- limit?: string | undefined;
56
- sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
57
- sortOrder?: "ASC" | "DESC" | undefined;
58
53
  search?: string | undefined;
54
+ limit?: string | undefined;
59
55
  userId?: string | undefined;
60
56
  isPermanent?: "true" | "false" | undefined;
61
57
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
58
+ status?: "active" | "revoked" | undefined;
59
+ page?: string | undefined;
60
+ sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
62
61
  fromDate?: string | undefined;
63
62
  toDate?: string | undefined;
63
+ sortOrder?: "DESC" | "ASC" | undefined;
64
64
  }>;
65
65
  }, "strip", z.ZodTypeAny, {
66
66
  query: {
67
- page: number;
68
67
  limit: number;
69
- status?: "active" | "revoked" | undefined;
70
- sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
71
- sortOrder?: "ASC" | "DESC" | undefined;
68
+ page: number;
72
69
  search?: string | undefined;
73
70
  userId?: string | undefined;
74
71
  isPermanent?: "true" | "false" | undefined;
75
72
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
73
+ status?: "active" | "revoked" | undefined;
74
+ sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
76
75
  fromDate?: string | undefined;
77
76
  toDate?: string | undefined;
77
+ sortOrder?: "DESC" | "ASC" | undefined;
78
78
  };
79
79
  }, {
80
80
  query: {
81
- status?: "active" | "revoked" | undefined;
82
- page?: string | undefined;
83
- limit?: string | undefined;
84
- sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
85
- sortOrder?: "ASC" | "DESC" | undefined;
86
81
  search?: string | undefined;
82
+ limit?: string | undefined;
87
83
  userId?: string | undefined;
88
84
  isPermanent?: "true" | "false" | undefined;
89
85
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
86
+ status?: "active" | "revoked" | undefined;
87
+ page?: string | undefined;
88
+ sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
90
89
  fromDate?: string | undefined;
91
90
  toDate?: string | undefined;
91
+ sortOrder?: "DESC" | "ASC" | undefined;
92
92
  };
93
93
  }>;
94
94
  export declare const listSuspensionsSchema: z.ZodObject<{
@@ -105,75 +105,75 @@ export declare const listSuspensionsSchema: z.ZodObject<{
105
105
  sortBy: z.ZodOptional<z.ZodEnum<["startedAt", "endsAt", "createdAt", "reason"]>>;
106
106
  sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
107
107
  }, "strip", z.ZodTypeAny, {
108
- page: number;
109
108
  limit: number;
110
- status?: "active" | "revoked" | "expired" | undefined;
111
- sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
112
- sortOrder?: "ASC" | "DESC" | undefined;
109
+ page: number;
113
110
  search?: string | undefined;
114
111
  userId?: string | undefined;
115
112
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
113
+ status?: "active" | "revoked" | "expired" | undefined;
114
+ sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
116
115
  fromDate?: string | undefined;
117
116
  toDate?: string | undefined;
117
+ sortOrder?: "DESC" | "ASC" | undefined;
118
118
  }, {
119
- status?: "active" | "revoked" | "expired" | undefined;
120
- page?: string | undefined;
121
- limit?: string | undefined;
122
- sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
123
- sortOrder?: "ASC" | "DESC" | undefined;
124
119
  search?: string | undefined;
120
+ limit?: string | undefined;
125
121
  userId?: string | undefined;
126
122
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
123
+ status?: "active" | "revoked" | "expired" | undefined;
124
+ page?: string | undefined;
125
+ sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
127
126
  fromDate?: string | undefined;
128
127
  toDate?: string | undefined;
128
+ sortOrder?: "DESC" | "ASC" | undefined;
129
129
  }>, {
130
- page: number;
131
130
  limit: number;
132
- status?: "active" | "revoked" | "expired" | undefined;
133
- sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
134
- sortOrder?: "ASC" | "DESC" | undefined;
131
+ page: number;
135
132
  search?: string | undefined;
136
133
  userId?: string | undefined;
137
134
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
135
+ status?: "active" | "revoked" | "expired" | undefined;
136
+ sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
138
137
  fromDate?: string | undefined;
139
138
  toDate?: string | undefined;
139
+ sortOrder?: "DESC" | "ASC" | undefined;
140
140
  }, {
141
- status?: "active" | "revoked" | "expired" | undefined;
142
- page?: string | undefined;
143
- limit?: string | undefined;
144
- sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
145
- sortOrder?: "ASC" | "DESC" | undefined;
146
141
  search?: string | undefined;
142
+ limit?: string | undefined;
147
143
  userId?: string | undefined;
148
144
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
145
+ status?: "active" | "revoked" | "expired" | undefined;
146
+ page?: string | undefined;
147
+ sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
149
148
  fromDate?: string | undefined;
150
149
  toDate?: string | undefined;
150
+ sortOrder?: "DESC" | "ASC" | undefined;
151
151
  }>;
152
152
  }, "strip", z.ZodTypeAny, {
153
153
  query: {
154
- page: number;
155
154
  limit: number;
156
- status?: "active" | "revoked" | "expired" | undefined;
157
- sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
158
- sortOrder?: "ASC" | "DESC" | undefined;
155
+ page: number;
159
156
  search?: string | undefined;
160
157
  userId?: string | undefined;
161
158
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
159
+ status?: "active" | "revoked" | "expired" | undefined;
160
+ sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
162
161
  fromDate?: string | undefined;
163
162
  toDate?: string | undefined;
163
+ sortOrder?: "DESC" | "ASC" | undefined;
164
164
  };
165
165
  }, {
166
166
  query: {
167
- status?: "active" | "revoked" | "expired" | undefined;
168
- page?: string | undefined;
169
- limit?: string | undefined;
170
- sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
171
- sortOrder?: "ASC" | "DESC" | undefined;
172
167
  search?: string | undefined;
168
+ limit?: string | undefined;
173
169
  userId?: string | undefined;
174
170
  appealStatus?: "pending" | "approved" | "rejected" | undefined;
171
+ status?: "active" | "revoked" | "expired" | undefined;
172
+ page?: string | undefined;
173
+ sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
175
174
  fromDate?: string | undefined;
176
175
  toDate?: string | undefined;
176
+ sortOrder?: "DESC" | "ASC" | undefined;
177
177
  };
178
178
  }>;
179
179
  export declare const revokeBanSchema: z.ZodObject<{
@@ -192,19 +192,19 @@ export declare const revokeBanSchema: z.ZodObject<{
192
192
  revocationReason?: string | undefined;
193
193
  }>;
194
194
  }, "strip", z.ZodTypeAny, {
195
- params: {
196
- banId: string;
197
- };
198
195
  body: {
199
196
  revocationReason?: string | undefined;
200
197
  };
201
- }, {
202
198
  params: {
203
199
  banId: string;
204
200
  };
201
+ }, {
205
202
  body: {
206
203
  revocationReason?: string | undefined;
207
204
  };
205
+ params: {
206
+ banId: string;
207
+ };
208
208
  }>;
209
209
  export declare const revokeSuspensionSchema: z.ZodObject<{
210
210
  params: z.ZodObject<{
@@ -222,19 +222,19 @@ export declare const revokeSuspensionSchema: z.ZodObject<{
222
222
  revocationReason?: string | undefined;
223
223
  }>;
224
224
  }, "strip", z.ZodTypeAny, {
225
- params: {
226
- suspensionId: string;
227
- };
228
225
  body: {
229
226
  revocationReason?: string | undefined;
230
227
  };
231
- }, {
232
228
  params: {
233
229
  suspensionId: string;
234
230
  };
231
+ }, {
235
232
  body: {
236
233
  revocationReason?: string | undefined;
237
234
  };
235
+ params: {
236
+ suspensionId: string;
237
+ };
238
238
  }>;
239
239
  export declare const extendSuspensionSchema: z.ZodObject<{
240
240
  params: z.ZodObject<{
@@ -261,21 +261,21 @@ export declare const extendSuspensionSchema: z.ZodObject<{
261
261
  extensionReason?: string | undefined;
262
262
  }>;
263
263
  }, "strip", z.ZodTypeAny, {
264
- params: {
265
- suspensionId: string;
266
- };
267
264
  body: {
268
265
  newEndDate: string;
269
266
  extensionReason?: string | undefined;
270
267
  };
271
- }, {
272
268
  params: {
273
269
  suspensionId: string;
274
270
  };
271
+ }, {
275
272
  body: {
276
273
  newEndDate: string;
277
274
  extensionReason?: string | undefined;
278
275
  };
276
+ params: {
277
+ suspensionId: string;
278
+ };
279
279
  }>;
280
280
  export declare const listPendingAppealsSchema: z.ZodObject<{
281
281
  query: z.ZodEffects<z.ZodObject<{
@@ -286,34 +286,34 @@ export declare const listPendingAppealsSchema: z.ZodObject<{
286
286
  fromDate: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
287
287
  toDate: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
288
288
  }, "strip", z.ZodTypeAny, {
289
- page: number;
290
289
  limit: number;
290
+ page: number;
291
291
  type?: "ban" | "suspension" | undefined;
292
292
  fromDate?: string | undefined;
293
293
  toDate?: string | undefined;
294
294
  }, {
295
295
  type?: "ban" | "suspension" | undefined;
296
- page?: string | undefined;
297
296
  limit?: string | undefined;
297
+ page?: string | undefined;
298
298
  fromDate?: string | undefined;
299
299
  toDate?: string | undefined;
300
300
  }>, {
301
- page: number;
302
301
  limit: number;
302
+ page: number;
303
303
  type?: "ban" | "suspension" | undefined;
304
304
  fromDate?: string | undefined;
305
305
  toDate?: string | undefined;
306
306
  }, {
307
307
  type?: "ban" | "suspension" | undefined;
308
- page?: string | undefined;
309
308
  limit?: string | undefined;
309
+ page?: string | undefined;
310
310
  fromDate?: string | undefined;
311
311
  toDate?: string | undefined;
312
312
  }>;
313
313
  }, "strip", z.ZodTypeAny, {
314
314
  query: {
315
- page: number;
316
315
  limit: number;
316
+ page: number;
317
317
  type?: "ban" | "suspension" | undefined;
318
318
  fromDate?: string | undefined;
319
319
  toDate?: string | undefined;
@@ -321,8 +321,8 @@ export declare const listPendingAppealsSchema: z.ZodObject<{
321
321
  }, {
322
322
  query: {
323
323
  type?: "ban" | "suspension" | undefined;
324
- page?: string | undefined;
325
324
  limit?: string | undefined;
325
+ page?: string | undefined;
326
326
  fromDate?: string | undefined;
327
327
  toDate?: string | undefined;
328
328
  };
@@ -349,23 +349,23 @@ export declare const reviewAppealSchema: z.ZodObject<{
349
349
  adminNotes?: string | undefined;
350
350
  }>;
351
351
  }, "strip", z.ZodTypeAny, {
352
- params: {
353
- banId?: string | undefined;
354
- suspensionId?: string | undefined;
355
- };
356
352
  body: {
357
353
  appealStatus: "approved" | "rejected";
358
354
  adminNotes?: string | undefined;
359
355
  };
360
- }, {
361
356
  params: {
362
357
  banId?: string | undefined;
363
358
  suspensionId?: string | undefined;
364
359
  };
360
+ }, {
365
361
  body: {
366
362
  appealStatus: "approved" | "rejected";
367
363
  adminNotes?: string | undefined;
368
364
  };
365
+ params: {
366
+ banId?: string | undefined;
367
+ suspensionId?: string | undefined;
368
+ };
369
369
  }>;
370
370
  export declare const exportBansSchema: z.ZodObject<{
371
371
  query: z.ZodEffects<z.ZodObject<{
@@ -21,21 +21,21 @@ export declare const payInstallmentSchema: z.ZodObject<{
21
21
  provider?: "mtn_momo" | "airtel_money" | undefined;
22
22
  }>;
23
23
  }, "strip", z.ZodTypeAny, {
24
- params: {
25
- planId: string;
26
- installmentId: string;
27
- };
28
24
  body: {
29
25
  phoneNumber: string;
30
26
  provider: "mtn_momo" | "airtel_money";
31
27
  };
32
- }, {
33
28
  params: {
34
29
  planId: string;
35
30
  installmentId: string;
36
31
  };
32
+ }, {
37
33
  body: {
38
34
  phoneNumber: string;
39
35
  provider?: "mtn_momo" | "airtel_money" | undefined;
40
36
  };
37
+ params: {
38
+ planId: string;
39
+ installmentId: string;
40
+ };
41
41
  }>;
@@ -170,9 +170,6 @@ export declare const updateUserProfileSchema: z.ZodObject<{
170
170
  authorization: string;
171
171
  }>;
172
172
  }, "strip", z.ZodTypeAny, {
173
- params: {
174
- userId: string;
175
- };
176
173
  body: {
177
174
  firstName?: string | undefined;
178
175
  lastName?: string | undefined;
@@ -184,13 +181,13 @@ export declare const updateUserProfileSchema: z.ZodObject<{
184
181
  isDeactivated?: boolean | undefined;
185
182
  isSuspended?: boolean | undefined;
186
183
  };
184
+ params: {
185
+ userId: string;
186
+ };
187
187
  headers: {
188
188
  authorization: string;
189
189
  };
190
190
  }, {
191
- params: {
192
- userId: string;
193
- };
194
191
  body: {
195
192
  firstName?: string | undefined;
196
193
  lastName?: string | undefined;
@@ -202,6 +199,9 @@ export declare const updateUserProfileSchema: z.ZodObject<{
202
199
  isDeactivated?: boolean | undefined;
203
200
  isSuspended?: boolean | undefined;
204
201
  };
202
+ params: {
203
+ userId: string;
204
+ };
205
205
  headers: {
206
206
  authorization: string;
207
207
  };
@@ -220,29 +220,29 @@ export declare const getAllUsersSchema: z.ZodObject<{
220
220
  sortBy: z.ZodDefault<z.ZodEnum<["firstName", "lastLoginAt", "createdAt"]>>;
221
221
  order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
222
222
  }, "strip", z.ZodTypeAny, {
223
- sortBy: "createdAt" | "firstName" | "lastLoginAt";
224
223
  order: "asc" | "desc";
225
- page?: number | undefined;
226
- limit?: number | undefined;
224
+ sortBy: "firstName" | "lastLoginAt" | "createdAt";
227
225
  search?: string | undefined;
226
+ limit?: number | undefined;
228
227
  isActive?: boolean | undefined;
229
228
  role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
230
229
  isBanned?: boolean | undefined;
231
230
  isSuspended?: boolean | undefined;
231
+ page?: number | undefined;
232
232
  startDate?: string | undefined;
233
233
  endDate?: string | undefined;
234
234
  }, {
235
- page?: string | undefined;
236
- limit?: string | undefined;
237
- sortBy?: "createdAt" | "firstName" | "lastLoginAt" | undefined;
238
235
  search?: string | undefined;
239
236
  order?: "asc" | "desc" | undefined;
237
+ limit?: string | undefined;
240
238
  isActive?: "true" | "false" | undefined;
241
239
  role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
242
240
  isBanned?: "true" | "false" | undefined;
243
241
  isSuspended?: "true" | "false" | undefined;
242
+ page?: string | undefined;
244
243
  startDate?: string | undefined;
245
244
  endDate?: string | undefined;
245
+ sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
246
246
  }>;
247
247
  headers: z.ZodObject<{
248
248
  authorization: z.ZodString;
@@ -253,15 +253,15 @@ export declare const getAllUsersSchema: z.ZodObject<{
253
253
  }>;
254
254
  }, "strip", z.ZodTypeAny, {
255
255
  query: {
256
- sortBy: "createdAt" | "firstName" | "lastLoginAt";
257
256
  order: "asc" | "desc";
258
- page?: number | undefined;
259
- limit?: number | undefined;
257
+ sortBy: "firstName" | "lastLoginAt" | "createdAt";
260
258
  search?: string | undefined;
259
+ limit?: number | undefined;
261
260
  isActive?: boolean | undefined;
262
261
  role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
263
262
  isBanned?: boolean | undefined;
264
263
  isSuspended?: boolean | undefined;
264
+ page?: number | undefined;
265
265
  startDate?: string | undefined;
266
266
  endDate?: string | undefined;
267
267
  };
@@ -270,17 +270,17 @@ export declare const getAllUsersSchema: z.ZodObject<{
270
270
  };
271
271
  }, {
272
272
  query: {
273
- page?: string | undefined;
274
- limit?: string | undefined;
275
- sortBy?: "createdAt" | "firstName" | "lastLoginAt" | undefined;
276
273
  search?: string | undefined;
277
274
  order?: "asc" | "desc" | undefined;
275
+ limit?: string | undefined;
278
276
  isActive?: "true" | "false" | undefined;
279
277
  role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
280
278
  isBanned?: "true" | "false" | undefined;
281
279
  isSuspended?: "true" | "false" | undefined;
280
+ page?: string | undefined;
282
281
  startDate?: string | undefined;
283
282
  endDate?: string | undefined;
283
+ sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
284
284
  };
285
285
  headers: {
286
286
  authorization: string;
@@ -301,16 +301,16 @@ export declare const viewProfileSchema: z.ZodObject<{
301
301
  headers: {
302
302
  authorization: string;
303
303
  };
304
- params?: {} | undefined;
305
- query?: {} | undefined;
306
304
  body?: {} | undefined;
305
+ query?: {} | undefined;
306
+ params?: {} | undefined;
307
307
  }, {
308
308
  headers: {
309
309
  authorization: string;
310
310
  };
311
- params?: {} | undefined;
312
- query?: {} | undefined;
313
311
  body?: {} | undefined;
312
+ query?: {} | undefined;
313
+ params?: {} | undefined;
314
314
  }>;
315
315
  export declare const passengerSignupSchema: z.ZodObject<{
316
316
  body: z.ZodObject<{
@@ -445,8 +445,8 @@ export declare const createRiderSchema: z.ZodObject<{
445
445
  plateNumber: string;
446
446
  nationalId: string;
447
447
  };
448
- params?: {} | undefined;
449
448
  query?: {} | undefined;
449
+ params?: {} | undefined;
450
450
  }, {
451
451
  body: {
452
452
  firstName: string;
@@ -456,8 +456,8 @@ export declare const createRiderSchema: z.ZodObject<{
456
456
  plateNumber: string;
457
457
  nationalId: string;
458
458
  };
459
- params?: {} | undefined;
460
459
  query?: {} | undefined;
460
+ params?: {} | undefined;
461
461
  }>;
462
462
  export declare const updateRiderProfileSchema: z.ZodObject<{
463
463
  params: z.ZodObject<{
@@ -512,9 +512,6 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
512
512
  authorization: string;
513
513
  }>;
514
514
  }, "strip", z.ZodTypeAny, {
515
- params: {
516
- id: string;
517
- };
518
515
  body: {
519
516
  firstName: string;
520
517
  lastName: string;
@@ -523,14 +520,14 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
523
520
  plateNumber: string;
524
521
  nationalId: string;
525
522
  };
523
+ params: {
524
+ id: string;
525
+ };
526
526
  headers: {
527
527
  authorization: string;
528
528
  };
529
529
  query?: {} | undefined;
530
530
  }, {
531
- params: {
532
- id: string;
533
- };
534
531
  body: {
535
532
  firstName: string;
536
533
  lastName: string;
@@ -539,6 +536,9 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
539
536
  plateNumber: string;
540
537
  nationalId: string;
541
538
  };
539
+ params: {
540
+ id: string;
541
+ };
542
542
  headers: {
543
543
  authorization: string;
544
544
  };
@@ -35,21 +35,21 @@ export declare const getUserSuspensionsSchema: z.ZodObject<{
35
35
  includeResolved?: "true" | "false" | undefined;
36
36
  }>;
37
37
  }, "strip", z.ZodTypeAny, {
38
- params: {
39
- userId: string;
40
- };
41
38
  query: {
42
39
  status?: "active" | "revoked" | "expired" | undefined;
43
40
  includeResolved?: "true" | "false" | undefined;
44
41
  };
45
- }, {
46
42
  params: {
47
43
  userId: string;
48
44
  };
45
+ }, {
49
46
  query: {
50
47
  status?: "active" | "revoked" | "expired" | undefined;
51
48
  includeResolved?: "true" | "false" | undefined;
52
49
  };
50
+ params: {
51
+ userId: string;
52
+ };
53
53
  }>;
54
54
  export declare const createSuspensionSchema: z.ZodObject<{
55
55
  params: z.ZodObject<{
@@ -70,19 +70,19 @@ export declare const createSuspensionSchema: z.ZodObject<{
70
70
  endsAt: string;
71
71
  }>;
72
72
  }, "strip", z.ZodTypeAny, {
73
- params: {
74
- userId: string;
75
- };
76
73
  body: {
77
74
  reason: string;
78
75
  endsAt: string;
79
76
  };
80
- }, {
81
77
  params: {
82
78
  userId: string;
83
79
  };
80
+ }, {
84
81
  body: {
85
82
  reason: string;
86
83
  endsAt: string;
87
84
  };
85
+ params: {
86
+ userId: string;
87
+ };
88
88
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",