vr-commons 1.0.122 → 1.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/authTokens.utils.js +1 -1
- package/dist/validations/account.validations.d.ts +10 -10
- package/dist/validations/account.validations.js +2 -2
- package/dist/validations/auth.validations.d.ts +142 -44
- package/dist/validations/auth.validations.js +64 -11
- package/dist/validations/devices.validations.js +2 -4
- package/dist/validations/index.d.ts +1 -1
- package/dist/validations/index.js +8 -3
- package/dist/validations/users.admin.validations.d.ts +86 -86
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ const getTokenLifespan = (type) => {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
// Default to 30 days (2,592,000 seconds)
|
|
18
|
-
console.warn(`⚠️ Token
|
|
18
|
+
console.warn(`⚠️ Token life span not set or invalid, using default 30 days (2,592,000 seconds)`);
|
|
19
19
|
return 30 * 24 * 60 * 60;
|
|
20
20
|
};
|
|
21
21
|
// Helper to generate token with 30-day expiry
|
|
@@ -84,24 +84,24 @@ export declare const requestPhoneChangeSchema: z.ZodObject<{
|
|
|
84
84
|
}>;
|
|
85
85
|
export declare const verifyPhoneChangeSchema: z.ZodObject<{
|
|
86
86
|
body: z.ZodObject<{
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
oldContactOtp: z.ZodString;
|
|
88
|
+
newContactOtp: z.ZodString;
|
|
89
89
|
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
oldContactOtp: string;
|
|
91
|
+
newContactOtp: string;
|
|
92
92
|
}, {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
oldContactOtp: string;
|
|
94
|
+
newContactOtp: string;
|
|
95
95
|
}>;
|
|
96
96
|
}, "strip", z.ZodTypeAny, {
|
|
97
97
|
body: {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
oldContactOtp: string;
|
|
99
|
+
newContactOtp: string;
|
|
100
100
|
};
|
|
101
101
|
}, {
|
|
102
102
|
body: {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
oldContactOtp: string;
|
|
104
|
+
newContactOtp: string;
|
|
105
105
|
};
|
|
106
106
|
}>;
|
|
107
107
|
export declare const verifyEmailChangeSchema: z.ZodObject<{
|
|
@@ -69,8 +69,8 @@ exports.requestPhoneChangeSchema = zod_1.z.object({
|
|
|
69
69
|
// Schema for verifying phone change with OTP
|
|
70
70
|
exports.verifyPhoneChangeSchema = zod_1.z.object({
|
|
71
71
|
body: zod_1.z.object({
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
oldContactOtp: zod_1.z.string().length(6, "Old contact OTP must be 6 digits"),
|
|
73
|
+
newContactOtp: zod_1.z.string().length(6, "New contact OTP must be 6 digits"),
|
|
74
74
|
}),
|
|
75
75
|
});
|
|
76
76
|
// Schema for verifying email change with OTP
|
|
@@ -10,21 +10,21 @@ export declare const userLoginSchema: z.ZodObject<{
|
|
|
10
10
|
contactValue: z.ZodEffects<z.ZodString, string, string>;
|
|
11
11
|
password: z.ZodString;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
password: string;
|
|
14
13
|
contactValue: string;
|
|
15
|
-
}, {
|
|
16
14
|
password: string;
|
|
15
|
+
}, {
|
|
17
16
|
contactValue: string;
|
|
17
|
+
password: string;
|
|
18
18
|
}>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
20
|
body: {
|
|
21
|
-
password: string;
|
|
22
21
|
contactValue: string;
|
|
22
|
+
password: string;
|
|
23
23
|
};
|
|
24
24
|
}, {
|
|
25
25
|
body: {
|
|
26
|
-
password: string;
|
|
27
26
|
contactValue: string;
|
|
27
|
+
password: string;
|
|
28
28
|
};
|
|
29
29
|
}>;
|
|
30
30
|
export declare const forgotPasswordSchema: z.ZodObject<{
|
|
@@ -95,33 +95,33 @@ export declare const registerSchema: z.ZodObject<{
|
|
|
95
95
|
birthMonth: z.ZodOptional<z.ZodNumber>;
|
|
96
96
|
birthYear: z.ZodOptional<z.ZodNumber>;
|
|
97
97
|
}, "strict", z.ZodTypeAny, {
|
|
98
|
+
contactValue: string;
|
|
99
|
+
password: string;
|
|
98
100
|
firstName: string;
|
|
99
101
|
lastName: string;
|
|
100
|
-
password: string;
|
|
101
102
|
role: "RIDER" | "PASSENGER";
|
|
102
|
-
contactValue: string;
|
|
103
103
|
gender?: "male" | "female" | undefined;
|
|
104
104
|
birthDate?: number | undefined;
|
|
105
105
|
birthMonth?: number | undefined;
|
|
106
106
|
birthYear?: number | undefined;
|
|
107
107
|
}, {
|
|
108
|
+
contactValue: string;
|
|
109
|
+
password: string;
|
|
108
110
|
firstName: string;
|
|
109
111
|
lastName: string;
|
|
110
|
-
|
|
111
|
-
contactValue: string;
|
|
112
|
+
role?: "RIDER" | "PASSENGER" | undefined;
|
|
112
113
|
gender?: "male" | "female" | undefined;
|
|
113
114
|
birthDate?: number | undefined;
|
|
114
115
|
birthMonth?: number | undefined;
|
|
115
116
|
birthYear?: number | undefined;
|
|
116
|
-
role?: "RIDER" | "PASSENGER" | undefined;
|
|
117
117
|
}>;
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
119
|
body: {
|
|
120
|
+
contactValue: string;
|
|
121
|
+
password: string;
|
|
120
122
|
firstName: string;
|
|
121
123
|
lastName: string;
|
|
122
|
-
password: string;
|
|
123
124
|
role: "RIDER" | "PASSENGER";
|
|
124
|
-
contactValue: string;
|
|
125
125
|
gender?: "male" | "female" | undefined;
|
|
126
126
|
birthDate?: number | undefined;
|
|
127
127
|
birthMonth?: number | undefined;
|
|
@@ -129,47 +129,91 @@ export declare const registerSchema: z.ZodObject<{
|
|
|
129
129
|
};
|
|
130
130
|
}, {
|
|
131
131
|
body: {
|
|
132
|
+
contactValue: string;
|
|
133
|
+
password: string;
|
|
132
134
|
firstName: string;
|
|
133
135
|
lastName: string;
|
|
134
|
-
|
|
135
|
-
contactValue: string;
|
|
136
|
+
role?: "RIDER" | "PASSENGER" | undefined;
|
|
136
137
|
gender?: "male" | "female" | undefined;
|
|
137
138
|
birthDate?: number | undefined;
|
|
138
139
|
birthMonth?: number | undefined;
|
|
139
140
|
birthYear?: number | undefined;
|
|
140
|
-
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
export declare const riderPasswordRegex: RegExp;
|
|
144
|
+
export declare const checkRiderAccountSchema: z.ZodObject<{
|
|
145
|
+
body: z.ZodObject<{
|
|
146
|
+
phoneNumber: z.ZodString;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
phoneNumber: string;
|
|
149
|
+
}, {
|
|
150
|
+
phoneNumber: string;
|
|
151
|
+
}>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
body: {
|
|
154
|
+
phoneNumber: string;
|
|
155
|
+
};
|
|
156
|
+
}, {
|
|
157
|
+
body: {
|
|
158
|
+
phoneNumber: string;
|
|
159
|
+
};
|
|
160
|
+
}>;
|
|
161
|
+
export declare const setRiderPasswordSchema: z.ZodObject<{
|
|
162
|
+
body: z.ZodEffects<z.ZodObject<{
|
|
163
|
+
phoneNumber: z.ZodString;
|
|
164
|
+
password: z.ZodString;
|
|
165
|
+
confirmPassword: z.ZodString;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
password: string;
|
|
168
|
+
phoneNumber: string;
|
|
169
|
+
confirmPassword: string;
|
|
170
|
+
}, {
|
|
171
|
+
password: string;
|
|
172
|
+
phoneNumber: string;
|
|
173
|
+
confirmPassword: string;
|
|
174
|
+
}>, {
|
|
175
|
+
password: string;
|
|
176
|
+
phoneNumber: string;
|
|
177
|
+
confirmPassword: string;
|
|
178
|
+
}, {
|
|
179
|
+
password: string;
|
|
180
|
+
phoneNumber: string;
|
|
181
|
+
confirmPassword: string;
|
|
182
|
+
}>;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
body: {
|
|
185
|
+
password: string;
|
|
186
|
+
phoneNumber: string;
|
|
187
|
+
confirmPassword: string;
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
body: {
|
|
191
|
+
password: string;
|
|
192
|
+
phoneNumber: string;
|
|
193
|
+
confirmPassword: string;
|
|
141
194
|
};
|
|
142
195
|
}>;
|
|
143
196
|
export declare const riderLoginSchema: z.ZodObject<{
|
|
144
197
|
body: z.ZodObject<{
|
|
145
|
-
|
|
198
|
+
phoneNumber: z.ZodString;
|
|
146
199
|
password: z.ZodString;
|
|
147
200
|
}, "strip", z.ZodTypeAny, {
|
|
148
201
|
password: string;
|
|
149
|
-
|
|
202
|
+
phoneNumber: string;
|
|
150
203
|
}, {
|
|
151
204
|
password: string;
|
|
152
|
-
|
|
205
|
+
phoneNumber: string;
|
|
153
206
|
}>;
|
|
154
|
-
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
155
|
-
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
156
|
-
headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
157
207
|
}, "strip", z.ZodTypeAny, {
|
|
158
208
|
body: {
|
|
159
209
|
password: string;
|
|
160
|
-
|
|
210
|
+
phoneNumber: string;
|
|
161
211
|
};
|
|
162
|
-
params?: {} | undefined;
|
|
163
|
-
query?: {} | undefined;
|
|
164
|
-
headers?: {} | undefined;
|
|
165
212
|
}, {
|
|
166
213
|
body: {
|
|
167
214
|
password: string;
|
|
168
|
-
|
|
215
|
+
phoneNumber: string;
|
|
169
216
|
};
|
|
170
|
-
params?: {} | undefined;
|
|
171
|
-
query?: {} | undefined;
|
|
172
|
-
headers?: {} | undefined;
|
|
173
217
|
}>;
|
|
174
218
|
export declare const requestOtpSchema: z.ZodObject<{
|
|
175
219
|
body: z.ZodObject<{
|
|
@@ -247,6 +291,60 @@ export declare const resendOtpSchema: z.ZodObject<{
|
|
|
247
291
|
contactValue: string;
|
|
248
292
|
};
|
|
249
293
|
}>;
|
|
294
|
+
export declare const googleLoginSchema: z.ZodObject<{
|
|
295
|
+
body: z.ZodObject<{
|
|
296
|
+
idToken: z.ZodString;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
idToken: string;
|
|
299
|
+
}, {
|
|
300
|
+
idToken: string;
|
|
301
|
+
}>;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
body: {
|
|
304
|
+
idToken: string;
|
|
305
|
+
};
|
|
306
|
+
}, {
|
|
307
|
+
body: {
|
|
308
|
+
idToken: string;
|
|
309
|
+
};
|
|
310
|
+
}>;
|
|
311
|
+
export declare const completePassengerProfileSchema: z.ZodObject<{
|
|
312
|
+
body: z.ZodObject<{
|
|
313
|
+
gender: z.ZodEnum<["male", "female"]>;
|
|
314
|
+
birthDate: z.ZodNumber;
|
|
315
|
+
birthMonth: z.ZodNumber;
|
|
316
|
+
birthYear: z.ZodNumber;
|
|
317
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, "strip", z.ZodTypeAny, {
|
|
319
|
+
gender: "male" | "female";
|
|
320
|
+
birthDate: number;
|
|
321
|
+
birthMonth: number;
|
|
322
|
+
birthYear: number;
|
|
323
|
+
phoneNumber?: string | undefined;
|
|
324
|
+
}, {
|
|
325
|
+
gender: "male" | "female";
|
|
326
|
+
birthDate: number;
|
|
327
|
+
birthMonth: number;
|
|
328
|
+
birthYear: number;
|
|
329
|
+
phoneNumber?: string | undefined;
|
|
330
|
+
}>;
|
|
331
|
+
}, "strip", z.ZodTypeAny, {
|
|
332
|
+
body: {
|
|
333
|
+
gender: "male" | "female";
|
|
334
|
+
birthDate: number;
|
|
335
|
+
birthMonth: number;
|
|
336
|
+
birthYear: number;
|
|
337
|
+
phoneNumber?: string | undefined;
|
|
338
|
+
};
|
|
339
|
+
}, {
|
|
340
|
+
body: {
|
|
341
|
+
gender: "male" | "female";
|
|
342
|
+
birthDate: number;
|
|
343
|
+
birthMonth: number;
|
|
344
|
+
birthYear: number;
|
|
345
|
+
phoneNumber?: string | undefined;
|
|
346
|
+
};
|
|
347
|
+
}>;
|
|
250
348
|
export declare const createUserSchema: z.ZodObject<{
|
|
251
349
|
body: z.ZodObject<{
|
|
252
350
|
firstName: z.ZodString;
|
|
@@ -261,57 +359,57 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
261
359
|
jacketId: z.ZodOptional<z.ZodString>;
|
|
262
360
|
plateNumber: z.ZodOptional<z.ZodString>;
|
|
263
361
|
}, "strip", z.ZodTypeAny, {
|
|
362
|
+
contactValue: string;
|
|
363
|
+
password: string;
|
|
264
364
|
firstName: string;
|
|
265
365
|
lastName: string;
|
|
266
|
-
password: string;
|
|
267
366
|
role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
268
|
-
contactValue: string;
|
|
269
|
-
jacketId?: string | undefined;
|
|
270
|
-
plateNumber?: string | undefined;
|
|
271
367
|
gender?: "male" | "female" | undefined;
|
|
272
368
|
birthDate?: number | undefined;
|
|
273
369
|
birthMonth?: number | undefined;
|
|
274
370
|
birthYear?: number | undefined;
|
|
371
|
+
jacketId?: string | undefined;
|
|
372
|
+
plateNumber?: string | undefined;
|
|
275
373
|
}, {
|
|
374
|
+
contactValue: string;
|
|
375
|
+
password: string;
|
|
276
376
|
firstName: string;
|
|
277
377
|
lastName: string;
|
|
278
|
-
password: string;
|
|
279
378
|
role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
280
|
-
contactValue: string;
|
|
281
|
-
jacketId?: string | undefined;
|
|
282
|
-
plateNumber?: string | undefined;
|
|
283
379
|
gender?: "male" | "female" | undefined;
|
|
284
380
|
birthDate?: number | undefined;
|
|
285
381
|
birthMonth?: number | undefined;
|
|
286
382
|
birthYear?: number | undefined;
|
|
383
|
+
jacketId?: string | undefined;
|
|
384
|
+
plateNumber?: string | undefined;
|
|
287
385
|
}>;
|
|
288
386
|
}, "strip", z.ZodTypeAny, {
|
|
289
387
|
body: {
|
|
388
|
+
contactValue: string;
|
|
389
|
+
password: string;
|
|
290
390
|
firstName: string;
|
|
291
391
|
lastName: string;
|
|
292
|
-
password: string;
|
|
293
392
|
role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
294
|
-
contactValue: string;
|
|
295
|
-
jacketId?: string | undefined;
|
|
296
|
-
plateNumber?: string | undefined;
|
|
297
393
|
gender?: "male" | "female" | undefined;
|
|
298
394
|
birthDate?: number | undefined;
|
|
299
395
|
birthMonth?: number | undefined;
|
|
300
396
|
birthYear?: number | undefined;
|
|
397
|
+
jacketId?: string | undefined;
|
|
398
|
+
plateNumber?: string | undefined;
|
|
301
399
|
};
|
|
302
400
|
}, {
|
|
303
401
|
body: {
|
|
402
|
+
contactValue: string;
|
|
403
|
+
password: string;
|
|
304
404
|
firstName: string;
|
|
305
405
|
lastName: string;
|
|
306
|
-
password: string;
|
|
307
406
|
role: "RIDER" | "PASSENGER" | "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
308
|
-
contactValue: string;
|
|
309
|
-
jacketId?: string | undefined;
|
|
310
|
-
plateNumber?: string | undefined;
|
|
311
407
|
gender?: "male" | "female" | undefined;
|
|
312
408
|
birthDate?: number | undefined;
|
|
313
409
|
birthMonth?: number | undefined;
|
|
314
410
|
birthYear?: number | undefined;
|
|
411
|
+
jacketId?: string | undefined;
|
|
412
|
+
plateNumber?: string | undefined;
|
|
315
413
|
};
|
|
316
414
|
}>;
|
|
317
415
|
export declare const updateContactSchema: z.ZodObject<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addContactSchema = exports.updateContactSchema = exports.createUserSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.requestOtpSchema = exports.riderLoginSchema = exports.registerSchema = exports.refreshTokenSchema = exports.changePasswordSchema = exports.forgotPasswordSchema = exports.userLoginSchema = exports.validateContactValue = exports.detectContactType = exports.strongPasswordRegex = exports.passwordRegex = exports.emailRegex = exports.phoneRegex = void 0;
|
|
3
|
+
exports.addContactSchema = exports.updateContactSchema = exports.createUserSchema = exports.completePassengerProfileSchema = exports.googleLoginSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.requestOtpSchema = exports.riderLoginSchema = exports.setRiderPasswordSchema = exports.checkRiderAccountSchema = exports.riderPasswordRegex = exports.registerSchema = exports.refreshTokenSchema = exports.changePasswordSchema = exports.forgotPasswordSchema = exports.userLoginSchema = exports.validateContactValue = exports.detectContactType = exports.strongPasswordRegex = exports.passwordRegex = exports.emailRegex = exports.phoneRegex = void 0;
|
|
4
4
|
// src/validations/auth.schema.ts
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
// ==================== REGEX PATTERNS ====================
|
|
@@ -97,19 +97,37 @@ exports.registerSchema = zod_1.z.object({
|
|
|
97
97
|
});
|
|
98
98
|
// ==================== USER (RIDER/PASSENGER) AUTH VALIDATIONS ====================
|
|
99
99
|
// Rider login with contact
|
|
100
|
+
exports.riderPasswordRegex = /^(?!(\d)\1{3})\d{4}$/;
|
|
101
|
+
exports.checkRiderAccountSchema = zod_1.z.object({
|
|
102
|
+
body: zod_1.z.object({
|
|
103
|
+
phoneNumber: zod_1.z
|
|
104
|
+
.string()
|
|
105
|
+
.regex(exports.phoneRegex, "Invalid phone number format. Must be a valid Rwandan phone number (+250...) followed by 7 digits _ washyizemo nimero itabaho onger ugenzure neza ko itangizwa na 07"),
|
|
106
|
+
}),
|
|
107
|
+
});
|
|
108
|
+
exports.setRiderPasswordSchema = zod_1.z.object({
|
|
109
|
+
body: zod_1.z
|
|
110
|
+
.object({
|
|
111
|
+
phoneNumber: zod_1.z
|
|
112
|
+
.string()
|
|
113
|
+
.regex(exports.phoneRegex, "Invalid phone number format. Must be a valid Rwandan phone number (+250...) followed by 7 digits _ washyizemo nimero itabaho onger ugenzure neza ko itangizwa na 07"),
|
|
114
|
+
password: zod_1.z
|
|
115
|
+
.string()
|
|
116
|
+
.regex(exports.riderPasswordRegex, "Password must 4 digits _ umubare w' ibanga ugomba kuba ugizwe n' imibare 4 idasa yose, urugero 4991"),
|
|
117
|
+
confirmPassword: zod_1.z.string(),
|
|
118
|
+
})
|
|
119
|
+
.refine((data) => data.password === data.confirmPassword, {
|
|
120
|
+
message: "Passwords do not match",
|
|
121
|
+
path: ["confirmPassword"],
|
|
122
|
+
}),
|
|
123
|
+
});
|
|
100
124
|
exports.riderLoginSchema = zod_1.z.object({
|
|
101
125
|
body: zod_1.z.object({
|
|
102
|
-
|
|
126
|
+
phoneNumber: zod_1.z
|
|
103
127
|
.string()
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
message: "Invalid contact value. Must be a valid email or Rwandan phone number (+250...)",
|
|
107
|
-
}),
|
|
108
|
-
password: zod_1.z.string().min(6, "Password must be at least 6 characters"),
|
|
128
|
+
.regex(exports.phoneRegex, "Invalid phone number format. Must be a valid Rwandan phone number (+250...) followed by 7 digits _ washyizemo nimero itabaho onger ugenzure neza ko itangizwa na 07"),
|
|
129
|
+
password: zod_1.z.string().min(1, "Password is required"),
|
|
109
130
|
}),
|
|
110
|
-
query: zod_1.z.object({}).optional(),
|
|
111
|
-
params: zod_1.z.object({}).optional(),
|
|
112
|
-
headers: zod_1.z.object({}).optional(),
|
|
113
131
|
});
|
|
114
132
|
// Request OTP (for phone verification)
|
|
115
133
|
exports.requestOtpSchema = zod_1.z.object({
|
|
@@ -166,6 +184,37 @@ exports.resendOtpSchema = zod_1.z.object({
|
|
|
166
184
|
}),
|
|
167
185
|
}),
|
|
168
186
|
});
|
|
187
|
+
// ==================== 0AUTH SCHEMAS ====================
|
|
188
|
+
exports.googleLoginSchema = zod_1.z.object({
|
|
189
|
+
body: zod_1.z.object({
|
|
190
|
+
idToken: zod_1.z.string().min(1, "Google ID token is required"),
|
|
191
|
+
}),
|
|
192
|
+
});
|
|
193
|
+
exports.completePassengerProfileSchema = zod_1.z.object({
|
|
194
|
+
body: zod_1.z.object({
|
|
195
|
+
gender: zod_1.z.enum(["male", "female"], {
|
|
196
|
+
errorMap: () => ({
|
|
197
|
+
message: "Gender must be either 'male' or 'female'",
|
|
198
|
+
}),
|
|
199
|
+
}),
|
|
200
|
+
birthDate: zod_1.z
|
|
201
|
+
.number()
|
|
202
|
+
.min(1, "Birth date must be between 1 and 31")
|
|
203
|
+
.max(31, "Birth date must be between 1 and 31"),
|
|
204
|
+
birthMonth: zod_1.z
|
|
205
|
+
.number()
|
|
206
|
+
.min(1, "Birth month must be between 1 and 12")
|
|
207
|
+
.max(12, "Birth month must be between 1 and 12"),
|
|
208
|
+
birthYear: zod_1.z
|
|
209
|
+
.number()
|
|
210
|
+
.min(1900, "Birth year must be between 1900 and current year")
|
|
211
|
+
.max(new Date().getFullYear(), "Birth year cannot be in the future"),
|
|
212
|
+
phoneNumber: zod_1.z
|
|
213
|
+
.string()
|
|
214
|
+
.regex(exports.phoneRegex, "Invalid phone number format. Must be a valid Rwandan phone number (+250...) followed by 7 digits.")
|
|
215
|
+
.optional(),
|
|
216
|
+
}),
|
|
217
|
+
});
|
|
169
218
|
// ==================== ADDITIONAL SCHEMAS ====================
|
|
170
219
|
// For administrators to create users
|
|
171
220
|
exports.createUserSchema = zod_1.z.object({
|
|
@@ -185,7 +234,11 @@ exports.createUserSchema = zod_1.z.object({
|
|
|
185
234
|
gender: zod_1.z.enum(["male", "female"]).optional(),
|
|
186
235
|
birthDate: zod_1.z.number().min(1).max(31).optional(),
|
|
187
236
|
birthMonth: zod_1.z.number().min(1).max(12).optional(),
|
|
188
|
-
birthYear: zod_1.z
|
|
237
|
+
birthYear: zod_1.z
|
|
238
|
+
.number()
|
|
239
|
+
.min(1900)
|
|
240
|
+
.max(Number(new Date().getFullYear()) - 18)
|
|
241
|
+
.optional(),
|
|
189
242
|
jacketId: zod_1.z.string().optional(),
|
|
190
243
|
plateNumber: zod_1.z.string().optional(),
|
|
191
244
|
}),
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extendSessionSchema = exports.unlockDeviceSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const serialRegex = /^[A-
|
|
5
|
+
const serialRegex = /^(VBRD|VIBERIDE)-(PASSENGER|RIDER)-([A-Z]{2}\d{3}[A-Z])$/;
|
|
6
6
|
exports.unlockDeviceSchema = zod_1.z.object({
|
|
7
7
|
body: zod_1.z.object({
|
|
8
8
|
deviceSerialNumber: zod_1.z
|
|
9
9
|
.string()
|
|
10
|
-
.regex(serialRegex, "Invalid serial number format")
|
|
11
|
-
.min(8, "Serial number must be at least 8 characters")
|
|
12
|
-
.max(32, "Serial number cannot exceed 32 characters"),
|
|
10
|
+
.regex(serialRegex, "Invalid serial number format"),
|
|
13
11
|
}),
|
|
14
12
|
});
|
|
15
13
|
exports.extendSessionSchema = zod_1.z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { validate } from "./validate.validations";
|
|
2
|
-
export { riderLoginSchema, forgotPasswordSchema, userLoginSchema, refreshTokenSchema, registerSchema, verifyOtpSchema, resendOtpSchema, requestOtpSchema, phoneRegex, emailRegex, passwordRegex, } from "./auth.validations";
|
|
2
|
+
export { riderLoginSchema, forgotPasswordSchema, userLoginSchema, refreshTokenSchema, registerSchema, verifyOtpSchema, resendOtpSchema, requestOtpSchema, phoneRegex, emailRegex, passwordRegex, riderPasswordRegex, setRiderPasswordSchema, checkRiderAccountSchema, completePassengerProfileSchema, googleLoginSchema, } from "./auth.validations";
|
|
3
3
|
export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema, deactivateAccountSchema, } from "./profiles.validations";
|
|
4
4
|
export { submitBanAppealSchema, submitSuspensionAppealSchema, getBanSchema, getUserRestrictionsSchema, getSuspensionSchema, getUserSuspensionsSchema, getUserBansSchema, listBansSchema, listPendingAppealsSchema, listSuspensionsSchema, reviewAppealSchema, revokeBanSchema, revokeSuspensionSchema, extendSuspensionSchema, createBanSchema, createSuspensionSchema, exportBansSchema, } from "./moderation.validations";
|
|
5
5
|
export { createAppSpecsSchema, updateAppSpecsSchema, listAppSpecsSchema, getActiveAppSpecsSchema, activateAppSpecsSchema, getAppSpecsSchema, } from "./appSpecs.validations";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.getEventLogSchema = void 0;
|
|
3
|
+
exports.getAppSpecsSchema = exports.activateAppSpecsSchema = exports.getActiveAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = exports.exportBansSchema = exports.createSuspensionSchema = exports.createBanSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.reviewAppealSchema = exports.listSuspensionsSchema = exports.listPendingAppealsSchema = exports.listBansSchema = exports.getUserBansSchema = exports.getUserSuspensionsSchema = exports.getSuspensionSchema = exports.getUserRestrictionsSchema = exports.getBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.deactivateAccountSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.googleLoginSchema = exports.completePassengerProfileSchema = exports.checkRiderAccountSchema = exports.setRiderPasswordSchema = exports.riderPasswordRegex = exports.passwordRegex = exports.emailRegex = exports.phoneRegex = exports.requestOtpSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
|
|
4
|
+
exports.getPlanSchema = exports.getDevicePlanSchema = exports.limitedUpdateSchema = exports.createPlanSchema = exports.createDeviceSchema = exports.makePermanentSchema = exports.disableDeviceSchema = exports.deleteDeviceSchema = exports.getDevicesSchema = exports.getDeviceSchema = exports.updateDeviceSchema = exports.adminUnlockDeviceSchema = exports.adminLockDeviceSchema = exports.bulkCreateDevicesSchema = exports.checkAvailabilitySchema = exports.deletePricingSchema = exports.getPricingsSchema = exports.getPricingSchema = exports.updatePricingSchema = exports.createPricingSchema = exports.updateStockSchema = exports.deleteProductSchema = exports.activateProductSchema = exports.deactivateProductSchema = exports.getProductsSchema = exports.getProductSchema = exports.updateProductSchema = exports.createProductSchema = exports.resetPasswordSchema = exports.upgradeToRiderSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.updateAdminSchema = exports.changePasswordSchema = exports.strongPasswordRegex = exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = exports.payInstallmentSchema = exports.extendSessionSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = void 0;
|
|
5
|
+
exports.getEventLogSchema = exports.listEventLogsSchema = exports.deletePlanSchema = exports.recordPaymentSchema = exports.listPlansSchema = exports.getUserPlansSchema = void 0;
|
|
6
6
|
var validate_validations_1 = require("./validate.validations");
|
|
7
7
|
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
|
|
8
8
|
var auth_validations_1 = require("./auth.validations");
|
|
@@ -17,6 +17,11 @@ Object.defineProperty(exports, "requestOtpSchema", { enumerable: true, get: func
|
|
|
17
17
|
Object.defineProperty(exports, "phoneRegex", { enumerable: true, get: function () { return auth_validations_1.phoneRegex; } });
|
|
18
18
|
Object.defineProperty(exports, "emailRegex", { enumerable: true, get: function () { return auth_validations_1.emailRegex; } });
|
|
19
19
|
Object.defineProperty(exports, "passwordRegex", { enumerable: true, get: function () { return auth_validations_1.passwordRegex; } });
|
|
20
|
+
Object.defineProperty(exports, "riderPasswordRegex", { enumerable: true, get: function () { return auth_validations_1.riderPasswordRegex; } });
|
|
21
|
+
Object.defineProperty(exports, "setRiderPasswordSchema", { enumerable: true, get: function () { return auth_validations_1.setRiderPasswordSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "checkRiderAccountSchema", { enumerable: true, get: function () { return auth_validations_1.checkRiderAccountSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "completePassengerProfileSchema", { enumerable: true, get: function () { return auth_validations_1.completePassengerProfileSchema; } });
|
|
24
|
+
Object.defineProperty(exports, "googleLoginSchema", { enumerable: true, get: function () { return auth_validations_1.googleLoginSchema; } });
|
|
20
25
|
var profiles_validations_1 = require("./profiles.validations");
|
|
21
26
|
// Admin/Super Admin Schema
|
|
22
27
|
Object.defineProperty(exports, "createUserSchema", { enumerable: true, get: function () { return profiles_validations_1.createUserSchema; } });
|
|
@@ -16,36 +16,36 @@ export declare const upgradeToRiderSchema: z.ZodObject<{
|
|
|
16
16
|
birthMonth: z.ZodNumber;
|
|
17
17
|
birthYear: z.ZodNumber;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
jacketId: string;
|
|
20
19
|
contactValue: string;
|
|
21
20
|
gender: "male" | "female";
|
|
22
21
|
birthDate: number;
|
|
23
22
|
birthMonth: number;
|
|
24
23
|
birthYear: number;
|
|
24
|
+
jacketId: string;
|
|
25
25
|
plateNumber?: string | undefined;
|
|
26
26
|
}, {
|
|
27
|
-
jacketId: string;
|
|
28
27
|
contactValue: string;
|
|
29
28
|
gender: "male" | "female";
|
|
30
29
|
birthDate: number;
|
|
31
30
|
birthMonth: number;
|
|
32
31
|
birthYear: number;
|
|
32
|
+
jacketId: string;
|
|
33
33
|
plateNumber?: string | undefined;
|
|
34
34
|
}>, {
|
|
35
|
-
jacketId: string;
|
|
36
35
|
contactValue: string;
|
|
37
36
|
gender: "male" | "female";
|
|
38
37
|
birthDate: number;
|
|
39
38
|
birthMonth: number;
|
|
40
39
|
birthYear: number;
|
|
40
|
+
jacketId: string;
|
|
41
41
|
plateNumber?: string | undefined;
|
|
42
42
|
}, {
|
|
43
|
-
jacketId: string;
|
|
44
43
|
contactValue: string;
|
|
45
44
|
gender: "male" | "female";
|
|
46
45
|
birthDate: number;
|
|
47
46
|
birthMonth: number;
|
|
48
47
|
birthYear: number;
|
|
48
|
+
jacketId: string;
|
|
49
49
|
plateNumber?: string | undefined;
|
|
50
50
|
}>;
|
|
51
51
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -53,12 +53,12 @@ export declare const upgradeToRiderSchema: z.ZodObject<{
|
|
|
53
53
|
userId: string;
|
|
54
54
|
};
|
|
55
55
|
body: {
|
|
56
|
-
jacketId: string;
|
|
57
56
|
contactValue: string;
|
|
58
57
|
gender: "male" | "female";
|
|
59
58
|
birthDate: number;
|
|
60
59
|
birthMonth: number;
|
|
61
60
|
birthYear: number;
|
|
61
|
+
jacketId: string;
|
|
62
62
|
plateNumber?: string | undefined;
|
|
63
63
|
};
|
|
64
64
|
}, {
|
|
@@ -66,12 +66,12 @@ export declare const upgradeToRiderSchema: z.ZodObject<{
|
|
|
66
66
|
userId: string;
|
|
67
67
|
};
|
|
68
68
|
body: {
|
|
69
|
-
jacketId: string;
|
|
70
69
|
contactValue: string;
|
|
71
70
|
gender: "male" | "female";
|
|
72
71
|
birthDate: number;
|
|
73
72
|
birthMonth: number;
|
|
74
73
|
birthYear: number;
|
|
74
|
+
jacketId: string;
|
|
75
75
|
plateNumber?: string | undefined;
|
|
76
76
|
};
|
|
77
77
|
}>;
|
|
@@ -94,75 +94,75 @@ export declare const updateRiderSchema: z.ZodObject<{
|
|
|
94
94
|
birthMonth: z.ZodOptional<z.ZodNumber>;
|
|
95
95
|
birthYear: z.ZodOptional<z.ZodNumber>;
|
|
96
96
|
}, "strip", z.ZodTypeAny, {
|
|
97
|
-
jacketId?: string | undefined;
|
|
98
97
|
contactValue?: string | undefined;
|
|
99
|
-
|
|
98
|
+
firstName?: string | undefined;
|
|
99
|
+
lastName?: string | undefined;
|
|
100
100
|
gender?: "male" | "female" | undefined;
|
|
101
101
|
birthDate?: number | undefined;
|
|
102
102
|
birthMonth?: number | undefined;
|
|
103
103
|
birthYear?: number | undefined;
|
|
104
|
-
firstName?: string | undefined;
|
|
105
|
-
lastName?: string | undefined;
|
|
106
|
-
}, {
|
|
107
104
|
jacketId?: string | undefined;
|
|
108
|
-
contactValue?: string | undefined;
|
|
109
105
|
plateNumber?: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
contactValue?: string | undefined;
|
|
108
|
+
firstName?: string | undefined;
|
|
109
|
+
lastName?: string | undefined;
|
|
110
110
|
gender?: "male" | "female" | undefined;
|
|
111
111
|
birthDate?: number | undefined;
|
|
112
112
|
birthMonth?: number | undefined;
|
|
113
113
|
birthYear?: number | undefined;
|
|
114
|
-
firstName?: string | undefined;
|
|
115
|
-
lastName?: string | undefined;
|
|
116
|
-
}>, {
|
|
117
114
|
jacketId?: string | undefined;
|
|
118
|
-
contactValue?: string | undefined;
|
|
119
115
|
plateNumber?: string | undefined;
|
|
116
|
+
}>, {
|
|
117
|
+
contactValue?: string | undefined;
|
|
118
|
+
firstName?: string | undefined;
|
|
119
|
+
lastName?: string | undefined;
|
|
120
120
|
gender?: "male" | "female" | undefined;
|
|
121
121
|
birthDate?: number | undefined;
|
|
122
122
|
birthMonth?: number | undefined;
|
|
123
123
|
birthYear?: number | undefined;
|
|
124
|
-
firstName?: string | undefined;
|
|
125
|
-
lastName?: string | undefined;
|
|
126
|
-
}, {
|
|
127
124
|
jacketId?: string | undefined;
|
|
128
|
-
contactValue?: string | undefined;
|
|
129
125
|
plateNumber?: string | undefined;
|
|
126
|
+
}, {
|
|
127
|
+
contactValue?: string | undefined;
|
|
128
|
+
firstName?: string | undefined;
|
|
129
|
+
lastName?: string | undefined;
|
|
130
130
|
gender?: "male" | "female" | undefined;
|
|
131
131
|
birthDate?: number | undefined;
|
|
132
132
|
birthMonth?: number | undefined;
|
|
133
133
|
birthYear?: number | undefined;
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
jacketId?: string | undefined;
|
|
135
|
+
plateNumber?: string | undefined;
|
|
136
136
|
}>;
|
|
137
137
|
}, "strip", z.ZodTypeAny, {
|
|
138
138
|
params: {
|
|
139
139
|
userId: string;
|
|
140
140
|
};
|
|
141
141
|
body: {
|
|
142
|
-
jacketId?: string | undefined;
|
|
143
142
|
contactValue?: string | undefined;
|
|
144
|
-
|
|
143
|
+
firstName?: string | undefined;
|
|
144
|
+
lastName?: string | undefined;
|
|
145
145
|
gender?: "male" | "female" | undefined;
|
|
146
146
|
birthDate?: number | undefined;
|
|
147
147
|
birthMonth?: number | undefined;
|
|
148
148
|
birthYear?: number | undefined;
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
jacketId?: string | undefined;
|
|
150
|
+
plateNumber?: string | undefined;
|
|
151
151
|
};
|
|
152
152
|
}, {
|
|
153
153
|
params: {
|
|
154
154
|
userId: string;
|
|
155
155
|
};
|
|
156
156
|
body: {
|
|
157
|
-
jacketId?: string | undefined;
|
|
158
157
|
contactValue?: string | undefined;
|
|
159
|
-
|
|
158
|
+
firstName?: string | undefined;
|
|
159
|
+
lastName?: string | undefined;
|
|
160
160
|
gender?: "male" | "female" | undefined;
|
|
161
161
|
birthDate?: number | undefined;
|
|
162
162
|
birthMonth?: number | undefined;
|
|
163
163
|
birthYear?: number | undefined;
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
jacketId?: string | undefined;
|
|
165
|
+
plateNumber?: string | undefined;
|
|
166
166
|
};
|
|
167
167
|
}>;
|
|
168
168
|
export declare const deleteUserSchema: z.ZodObject<{
|
|
@@ -212,52 +212,52 @@ export declare const getUsersSchema: z.ZodObject<{
|
|
|
212
212
|
sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "firstName", "lastName", "gender"]>>;
|
|
213
213
|
sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
|
|
214
214
|
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
role?: string | undefined;
|
|
215
216
|
gender?: "male" | "female" | undefined;
|
|
216
217
|
page?: number | undefined;
|
|
217
218
|
limit?: number | undefined;
|
|
218
219
|
search?: string | undefined;
|
|
219
220
|
isActive?: "true" | "false" | undefined;
|
|
220
221
|
isDeactivated?: "true" | "false" | undefined;
|
|
221
|
-
role?: string | undefined;
|
|
222
222
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
223
|
-
sortBy?: "
|
|
223
|
+
sortBy?: "firstName" | "lastName" | "gender" | "createdAt" | undefined;
|
|
224
224
|
sortOrder?: "ASC" | "DESC" | undefined;
|
|
225
225
|
}, {
|
|
226
|
+
role?: string | undefined;
|
|
226
227
|
gender?: "male" | "female" | undefined;
|
|
227
228
|
page?: string | undefined;
|
|
228
229
|
limit?: string | undefined;
|
|
229
230
|
search?: string | undefined;
|
|
230
231
|
isActive?: "true" | "false" | undefined;
|
|
231
232
|
isDeactivated?: "true" | "false" | undefined;
|
|
232
|
-
role?: string | undefined;
|
|
233
233
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
234
|
-
sortBy?: "
|
|
234
|
+
sortBy?: "firstName" | "lastName" | "gender" | "createdAt" | undefined;
|
|
235
235
|
sortOrder?: "ASC" | "DESC" | undefined;
|
|
236
236
|
}>;
|
|
237
237
|
}, "strip", z.ZodTypeAny, {
|
|
238
238
|
query: {
|
|
239
|
+
role?: string | undefined;
|
|
239
240
|
gender?: "male" | "female" | undefined;
|
|
240
241
|
page?: number | undefined;
|
|
241
242
|
limit?: number | undefined;
|
|
242
243
|
search?: string | undefined;
|
|
243
244
|
isActive?: "true" | "false" | undefined;
|
|
244
245
|
isDeactivated?: "true" | "false" | undefined;
|
|
245
|
-
role?: string | undefined;
|
|
246
246
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
247
|
-
sortBy?: "
|
|
247
|
+
sortBy?: "firstName" | "lastName" | "gender" | "createdAt" | undefined;
|
|
248
248
|
sortOrder?: "ASC" | "DESC" | undefined;
|
|
249
249
|
};
|
|
250
250
|
}, {
|
|
251
251
|
query: {
|
|
252
|
+
role?: string | undefined;
|
|
252
253
|
gender?: "male" | "female" | undefined;
|
|
253
254
|
page?: string | undefined;
|
|
254
255
|
limit?: string | undefined;
|
|
255
256
|
search?: string | undefined;
|
|
256
257
|
isActive?: "true" | "false" | undefined;
|
|
257
258
|
isDeactivated?: "true" | "false" | undefined;
|
|
258
|
-
role?: string | undefined;
|
|
259
259
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
260
|
-
sortBy?: "
|
|
260
|
+
sortBy?: "firstName" | "lastName" | "gender" | "createdAt" | undefined;
|
|
261
261
|
sortOrder?: "ASC" | "DESC" | undefined;
|
|
262
262
|
};
|
|
263
263
|
}>;
|
|
@@ -275,95 +275,95 @@ export declare const hireAdminSchema: z.ZodObject<{
|
|
|
275
275
|
birthYear: z.ZodNumber;
|
|
276
276
|
}, "strip", z.ZodTypeAny, {
|
|
277
277
|
contactValue: string;
|
|
278
|
+
password: string;
|
|
279
|
+
firstName: string;
|
|
280
|
+
lastName: string;
|
|
281
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
278
282
|
gender: "male" | "female";
|
|
279
283
|
birthDate: number;
|
|
280
284
|
birthMonth: number;
|
|
281
285
|
birthYear: number;
|
|
282
|
-
firstName: string;
|
|
283
|
-
lastName: string;
|
|
284
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
285
|
-
password: string;
|
|
286
286
|
superAdminPassword?: string | undefined;
|
|
287
287
|
}, {
|
|
288
288
|
contactValue: string;
|
|
289
|
+
password: string;
|
|
290
|
+
firstName: string;
|
|
291
|
+
lastName: string;
|
|
292
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
289
293
|
gender: "male" | "female";
|
|
290
294
|
birthDate: number;
|
|
291
295
|
birthMonth: number;
|
|
292
296
|
birthYear: number;
|
|
293
|
-
firstName: string;
|
|
294
|
-
lastName: string;
|
|
295
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
296
|
-
password: string;
|
|
297
297
|
superAdminPassword?: string | undefined;
|
|
298
298
|
}>, {
|
|
299
299
|
contactValue: string;
|
|
300
|
+
password: string;
|
|
301
|
+
firstName: string;
|
|
302
|
+
lastName: string;
|
|
303
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
300
304
|
gender: "male" | "female";
|
|
301
305
|
birthDate: number;
|
|
302
306
|
birthMonth: number;
|
|
303
307
|
birthYear: number;
|
|
304
|
-
firstName: string;
|
|
305
|
-
lastName: string;
|
|
306
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
307
|
-
password: string;
|
|
308
308
|
superAdminPassword?: string | undefined;
|
|
309
309
|
}, {
|
|
310
310
|
contactValue: string;
|
|
311
|
+
password: string;
|
|
312
|
+
firstName: string;
|
|
313
|
+
lastName: string;
|
|
314
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
311
315
|
gender: "male" | "female";
|
|
312
316
|
birthDate: number;
|
|
313
317
|
birthMonth: number;
|
|
314
318
|
birthYear: number;
|
|
315
|
-
firstName: string;
|
|
316
|
-
lastName: string;
|
|
317
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
318
|
-
password: string;
|
|
319
319
|
superAdminPassword?: string | undefined;
|
|
320
320
|
}>, {
|
|
321
321
|
contactValue: string;
|
|
322
|
+
password: string;
|
|
323
|
+
firstName: string;
|
|
324
|
+
lastName: string;
|
|
325
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
322
326
|
gender: "male" | "female";
|
|
323
327
|
birthDate: number;
|
|
324
328
|
birthMonth: number;
|
|
325
329
|
birthYear: number;
|
|
326
|
-
firstName: string;
|
|
327
|
-
lastName: string;
|
|
328
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
329
|
-
password: string;
|
|
330
330
|
superAdminPassword?: string | undefined;
|
|
331
331
|
}, {
|
|
332
332
|
contactValue: string;
|
|
333
|
+
password: string;
|
|
334
|
+
firstName: string;
|
|
335
|
+
lastName: string;
|
|
336
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
333
337
|
gender: "male" | "female";
|
|
334
338
|
birthDate: number;
|
|
335
339
|
birthMonth: number;
|
|
336
340
|
birthYear: number;
|
|
337
|
-
firstName: string;
|
|
338
|
-
lastName: string;
|
|
339
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
340
|
-
password: string;
|
|
341
341
|
superAdminPassword?: string | undefined;
|
|
342
342
|
}>;
|
|
343
343
|
}, "strip", z.ZodTypeAny, {
|
|
344
344
|
body: {
|
|
345
345
|
contactValue: string;
|
|
346
|
+
password: string;
|
|
347
|
+
firstName: string;
|
|
348
|
+
lastName: string;
|
|
349
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
346
350
|
gender: "male" | "female";
|
|
347
351
|
birthDate: number;
|
|
348
352
|
birthMonth: number;
|
|
349
353
|
birthYear: number;
|
|
350
|
-
firstName: string;
|
|
351
|
-
lastName: string;
|
|
352
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
353
|
-
password: string;
|
|
354
354
|
superAdminPassword?: string | undefined;
|
|
355
355
|
};
|
|
356
356
|
}, {
|
|
357
357
|
body: {
|
|
358
358
|
contactValue: string;
|
|
359
|
+
password: string;
|
|
360
|
+
firstName: string;
|
|
361
|
+
lastName: string;
|
|
362
|
+
role: "ADMIN" | "AGENT" | "SUPER_ADMIN";
|
|
359
363
|
gender: "male" | "female";
|
|
360
364
|
birthDate: number;
|
|
361
365
|
birthMonth: number;
|
|
362
366
|
birthYear: number;
|
|
363
|
-
firstName: string;
|
|
364
|
-
lastName: string;
|
|
365
|
-
role: "AGENT" | "ADMIN" | "SUPER_ADMIN";
|
|
366
|
-
password: string;
|
|
367
367
|
superAdminPassword?: string | undefined;
|
|
368
368
|
};
|
|
369
369
|
}>;
|
|
@@ -413,23 +413,23 @@ export declare const demoteAdminSchema: z.ZodObject<{
|
|
|
413
413
|
body: z.ZodObject<{
|
|
414
414
|
targetRole: z.ZodEnum<["AGENT", "ADMIN"]>;
|
|
415
415
|
}, "strip", z.ZodTypeAny, {
|
|
416
|
-
targetRole: "
|
|
416
|
+
targetRole: "ADMIN" | "AGENT";
|
|
417
417
|
}, {
|
|
418
|
-
targetRole: "
|
|
418
|
+
targetRole: "ADMIN" | "AGENT";
|
|
419
419
|
}>;
|
|
420
420
|
}, "strip", z.ZodTypeAny, {
|
|
421
421
|
params: {
|
|
422
422
|
userId: string;
|
|
423
423
|
};
|
|
424
424
|
body: {
|
|
425
|
-
targetRole: "
|
|
425
|
+
targetRole: "ADMIN" | "AGENT";
|
|
426
426
|
};
|
|
427
427
|
}, {
|
|
428
428
|
params: {
|
|
429
429
|
userId: string;
|
|
430
430
|
};
|
|
431
431
|
body: {
|
|
432
|
-
targetRole: "
|
|
432
|
+
targetRole: "ADMIN" | "AGENT";
|
|
433
433
|
};
|
|
434
434
|
}>;
|
|
435
435
|
export declare const fireEmployeeSchema: z.ZodObject<{
|
|
@@ -480,36 +480,36 @@ export declare const updateAdminSchema: z.ZodObject<{
|
|
|
480
480
|
birthYear: z.ZodOptional<z.ZodNumber>;
|
|
481
481
|
}, "strip", z.ZodTypeAny, {
|
|
482
482
|
contactValue?: string | undefined;
|
|
483
|
+
firstName?: string | undefined;
|
|
484
|
+
lastName?: string | undefined;
|
|
483
485
|
gender?: "male" | "female" | undefined;
|
|
484
486
|
birthDate?: number | undefined;
|
|
485
487
|
birthMonth?: number | undefined;
|
|
486
488
|
birthYear?: number | undefined;
|
|
487
|
-
firstName?: string | undefined;
|
|
488
|
-
lastName?: string | undefined;
|
|
489
489
|
}, {
|
|
490
490
|
contactValue?: string | undefined;
|
|
491
|
+
firstName?: string | undefined;
|
|
492
|
+
lastName?: string | undefined;
|
|
491
493
|
gender?: "male" | "female" | undefined;
|
|
492
494
|
birthDate?: number | undefined;
|
|
493
495
|
birthMonth?: number | undefined;
|
|
494
496
|
birthYear?: number | undefined;
|
|
495
|
-
firstName?: string | undefined;
|
|
496
|
-
lastName?: string | undefined;
|
|
497
497
|
}>, {
|
|
498
498
|
contactValue?: string | undefined;
|
|
499
|
+
firstName?: string | undefined;
|
|
500
|
+
lastName?: string | undefined;
|
|
499
501
|
gender?: "male" | "female" | undefined;
|
|
500
502
|
birthDate?: number | undefined;
|
|
501
503
|
birthMonth?: number | undefined;
|
|
502
504
|
birthYear?: number | undefined;
|
|
503
|
-
firstName?: string | undefined;
|
|
504
|
-
lastName?: string | undefined;
|
|
505
505
|
}, {
|
|
506
506
|
contactValue?: string | undefined;
|
|
507
|
+
firstName?: string | undefined;
|
|
508
|
+
lastName?: string | undefined;
|
|
507
509
|
gender?: "male" | "female" | undefined;
|
|
508
510
|
birthDate?: number | undefined;
|
|
509
511
|
birthMonth?: number | undefined;
|
|
510
512
|
birthYear?: number | undefined;
|
|
511
|
-
firstName?: string | undefined;
|
|
512
|
-
lastName?: string | undefined;
|
|
513
513
|
}>;
|
|
514
514
|
}, "strip", z.ZodTypeAny, {
|
|
515
515
|
params: {
|
|
@@ -517,12 +517,12 @@ export declare const updateAdminSchema: z.ZodObject<{
|
|
|
517
517
|
};
|
|
518
518
|
body: {
|
|
519
519
|
contactValue?: string | undefined;
|
|
520
|
+
firstName?: string | undefined;
|
|
521
|
+
lastName?: string | undefined;
|
|
520
522
|
gender?: "male" | "female" | undefined;
|
|
521
523
|
birthDate?: number | undefined;
|
|
522
524
|
birthMonth?: number | undefined;
|
|
523
525
|
birthYear?: number | undefined;
|
|
524
|
-
firstName?: string | undefined;
|
|
525
|
-
lastName?: string | undefined;
|
|
526
526
|
};
|
|
527
527
|
}, {
|
|
528
528
|
params: {
|
|
@@ -530,12 +530,12 @@ export declare const updateAdminSchema: z.ZodObject<{
|
|
|
530
530
|
};
|
|
531
531
|
body: {
|
|
532
532
|
contactValue?: string | undefined;
|
|
533
|
+
firstName?: string | undefined;
|
|
534
|
+
lastName?: string | undefined;
|
|
533
535
|
gender?: "male" | "female" | undefined;
|
|
534
536
|
birthDate?: number | undefined;
|
|
535
537
|
birthMonth?: number | undefined;
|
|
536
538
|
birthYear?: number | undefined;
|
|
537
|
-
firstName?: string | undefined;
|
|
538
|
-
lastName?: string | undefined;
|
|
539
539
|
};
|
|
540
540
|
}>;
|
|
541
541
|
export declare const resetPasswordSchema: z.ZodObject<{
|