vr-commons 1.0.88 → 1.0.89

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.
@@ -10,5 +10,4 @@ export { listUserPaymentPlansSchema, getUserPaymentPlanSchema, } from "./deviceP
10
10
  export { unlockDeviceSchema, extendSessionSchema } from "./devices.validations";
11
11
  export { payInstallmentSchema } from "./payinstallment.validations";
12
12
  export { updateProfileSchema, requestPhoneChangeSchema, verifyPhoneChangeSchema, deleteAccountSchema, strongPasswordRegex, changePasswordSchema, } from "./account.validations";
13
- export { upgradeToRiderSchema } from "./user.management.validations";
14
- export { updateUserSchema, getUserSchema, deleteUserSchema, getUsersSchema, } from "./users.operation.validations";
13
+ export { updateAdminSchema, updateRiderSchema, deleteUserSchema, getUserSchema, getUsersSchema, hireAdminSchema, promoteAdminSchema, demoteAdminSchema, fireEmployeeSchema, upgradeToRiderSchema, resetPasswordSchema, bulkResetPasswordSchema, } from "./users.admin.validations";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = 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.deactivateAccountSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.requestOtpSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
4
- exports.getUsersSchema = exports.deleteUserSchema = exports.getUserSchema = exports.updateUserSchema = exports.upgradeToRiderSchema = exports.changePasswordSchema = exports.strongPasswordRegex = void 0;
4
+ exports.bulkResetPasswordSchema = 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 = void 0;
5
5
  var validate_validations_1 = require("./validate.validations");
6
6
  Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
7
7
  var auth_validations_1 = require("./auth.validations");
@@ -71,10 +71,16 @@ Object.defineProperty(exports, "verifyPhoneChangeSchema", { enumerable: true, ge
71
71
  Object.defineProperty(exports, "deleteAccountSchema", { enumerable: true, get: function () { return account_validations_1.deleteAccountSchema; } });
72
72
  Object.defineProperty(exports, "strongPasswordRegex", { enumerable: true, get: function () { return account_validations_1.strongPasswordRegex; } });
73
73
  Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return account_validations_1.changePasswordSchema; } });
74
- var user_management_validations_1 = require("./user.management.validations");
75
- Object.defineProperty(exports, "upgradeToRiderSchema", { enumerable: true, get: function () { return user_management_validations_1.upgradeToRiderSchema; } });
76
- var users_operation_validations_1 = require("./users.operation.validations");
77
- Object.defineProperty(exports, "updateUserSchema", { enumerable: true, get: function () { return users_operation_validations_1.updateUserSchema; } });
78
- Object.defineProperty(exports, "getUserSchema", { enumerable: true, get: function () { return users_operation_validations_1.getUserSchema; } });
79
- Object.defineProperty(exports, "deleteUserSchema", { enumerable: true, get: function () { return users_operation_validations_1.deleteUserSchema; } });
80
- Object.defineProperty(exports, "getUsersSchema", { enumerable: true, get: function () { return users_operation_validations_1.getUsersSchema; } });
74
+ var users_admin_validations_1 = require("./users.admin.validations");
75
+ Object.defineProperty(exports, "updateAdminSchema", { enumerable: true, get: function () { return users_admin_validations_1.updateAdminSchema; } });
76
+ Object.defineProperty(exports, "updateRiderSchema", { enumerable: true, get: function () { return users_admin_validations_1.updateRiderSchema; } });
77
+ Object.defineProperty(exports, "deleteUserSchema", { enumerable: true, get: function () { return users_admin_validations_1.deleteUserSchema; } });
78
+ Object.defineProperty(exports, "getUserSchema", { enumerable: true, get: function () { return users_admin_validations_1.getUserSchema; } });
79
+ Object.defineProperty(exports, "getUsersSchema", { enumerable: true, get: function () { return users_admin_validations_1.getUsersSchema; } });
80
+ Object.defineProperty(exports, "hireAdminSchema", { enumerable: true, get: function () { return users_admin_validations_1.hireAdminSchema; } });
81
+ Object.defineProperty(exports, "promoteAdminSchema", { enumerable: true, get: function () { return users_admin_validations_1.promoteAdminSchema; } });
82
+ Object.defineProperty(exports, "demoteAdminSchema", { enumerable: true, get: function () { return users_admin_validations_1.demoteAdminSchema; } });
83
+ Object.defineProperty(exports, "fireEmployeeSchema", { enumerable: true, get: function () { return users_admin_validations_1.fireEmployeeSchema; } });
84
+ Object.defineProperty(exports, "upgradeToRiderSchema", { enumerable: true, get: function () { return users_admin_validations_1.upgradeToRiderSchema; } });
85
+ Object.defineProperty(exports, "resetPasswordSchema", { enumerable: true, get: function () { return users_admin_validations_1.resetPasswordSchema; } });
86
+ Object.defineProperty(exports, "bulkResetPasswordSchema", { enumerable: true, get: function () { return users_admin_validations_1.bulkResetPasswordSchema; } });
@@ -0,0 +1,387 @@
1
+ import { z } from "zod";
2
+ export declare const upgradeToRiderSchema: z.ZodObject<{
3
+ params: z.ZodObject<{
4
+ userId: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ userId: string;
7
+ }, {
8
+ userId: string;
9
+ }>;
10
+ body: z.ZodObject<{
11
+ jacketId: z.ZodString;
12
+ nationalId: z.ZodString;
13
+ phoneNumber: z.ZodString;
14
+ plateNumber: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ jacketId: string;
17
+ nationalId: string;
18
+ phoneNumber: string;
19
+ plateNumber?: string | undefined;
20
+ }, {
21
+ jacketId: string;
22
+ nationalId: string;
23
+ phoneNumber: string;
24
+ plateNumber?: string | undefined;
25
+ }>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ params: {
28
+ userId: string;
29
+ };
30
+ body: {
31
+ jacketId: string;
32
+ nationalId: string;
33
+ phoneNumber: string;
34
+ plateNumber?: string | undefined;
35
+ };
36
+ }, {
37
+ params: {
38
+ userId: string;
39
+ };
40
+ body: {
41
+ jacketId: string;
42
+ nationalId: string;
43
+ phoneNumber: string;
44
+ plateNumber?: string | undefined;
45
+ };
46
+ }>;
47
+ export declare const updateRiderSchema: z.ZodObject<{
48
+ params: z.ZodObject<{
49
+ userId: z.ZodString;
50
+ }, "strip", z.ZodTypeAny, {
51
+ userId: string;
52
+ }, {
53
+ userId: string;
54
+ }>;
55
+ body: z.ZodObject<{
56
+ firstName: z.ZodOptional<z.ZodString>;
57
+ lastName: z.ZodOptional<z.ZodString>;
58
+ phoneNumber: z.ZodOptional<z.ZodString>;
59
+ jacketId: z.ZodOptional<z.ZodString>;
60
+ plateNumber: z.ZodOptional<z.ZodString>;
61
+ nationalId: z.ZodOptional<z.ZodString>;
62
+ email: z.ZodOptional<z.ZodString>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ jacketId?: string | undefined;
65
+ nationalId?: string | undefined;
66
+ phoneNumber?: string | undefined;
67
+ plateNumber?: string | undefined;
68
+ firstName?: string | undefined;
69
+ lastName?: string | undefined;
70
+ email?: string | undefined;
71
+ }, {
72
+ jacketId?: string | undefined;
73
+ nationalId?: string | undefined;
74
+ phoneNumber?: string | undefined;
75
+ plateNumber?: string | undefined;
76
+ firstName?: string | undefined;
77
+ lastName?: string | undefined;
78
+ email?: string | undefined;
79
+ }>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ params: {
82
+ userId: string;
83
+ };
84
+ body: {
85
+ jacketId?: string | undefined;
86
+ nationalId?: string | undefined;
87
+ phoneNumber?: string | undefined;
88
+ plateNumber?: string | undefined;
89
+ firstName?: string | undefined;
90
+ lastName?: string | undefined;
91
+ email?: string | undefined;
92
+ };
93
+ }, {
94
+ params: {
95
+ userId: string;
96
+ };
97
+ body: {
98
+ jacketId?: string | undefined;
99
+ nationalId?: string | undefined;
100
+ phoneNumber?: string | undefined;
101
+ plateNumber?: string | undefined;
102
+ firstName?: string | undefined;
103
+ lastName?: string | undefined;
104
+ email?: string | undefined;
105
+ };
106
+ }>;
107
+ export declare const deleteUserSchema: z.ZodObject<{
108
+ params: z.ZodObject<{
109
+ userId: z.ZodString;
110
+ }, "strip", z.ZodTypeAny, {
111
+ userId: string;
112
+ }, {
113
+ userId: string;
114
+ }>;
115
+ }, "strip", z.ZodTypeAny, {
116
+ params: {
117
+ userId: string;
118
+ };
119
+ }, {
120
+ params: {
121
+ userId: string;
122
+ };
123
+ }>;
124
+ export declare const getUserSchema: z.ZodObject<{
125
+ params: z.ZodObject<{
126
+ userId: z.ZodString;
127
+ }, "strip", z.ZodTypeAny, {
128
+ userId: string;
129
+ }, {
130
+ userId: string;
131
+ }>;
132
+ }, "strip", z.ZodTypeAny, {
133
+ params: {
134
+ userId: string;
135
+ };
136
+ }, {
137
+ params: {
138
+ userId: string;
139
+ };
140
+ }>;
141
+ export declare const getUsersSchema: z.ZodObject<{
142
+ query: z.ZodObject<{
143
+ page: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
144
+ limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
145
+ search: z.ZodOptional<z.ZodString>;
146
+ isActive: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
147
+ isDeactivated: z.ZodOptional<z.ZodEnum<["true", "false"]>>;
148
+ role: z.ZodOptional<z.ZodString>;
149
+ sortBy: z.ZodOptional<z.ZodEnum<["createdAt", "firstName", "lastName"]>>;
150
+ sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ page?: number | undefined;
153
+ limit?: number | undefined;
154
+ search?: string | undefined;
155
+ isActive?: "true" | "false" | undefined;
156
+ isDeactivated?: "true" | "false" | undefined;
157
+ role?: string | undefined;
158
+ sortBy?: "firstName" | "lastName" | "createdAt" | undefined;
159
+ sortOrder?: "ASC" | "DESC" | undefined;
160
+ }, {
161
+ page?: string | undefined;
162
+ limit?: string | undefined;
163
+ search?: string | undefined;
164
+ isActive?: "true" | "false" | undefined;
165
+ isDeactivated?: "true" | "false" | undefined;
166
+ role?: string | undefined;
167
+ sortBy?: "firstName" | "lastName" | "createdAt" | undefined;
168
+ sortOrder?: "ASC" | "DESC" | undefined;
169
+ }>;
170
+ }, "strip", z.ZodTypeAny, {
171
+ query: {
172
+ page?: number | undefined;
173
+ limit?: number | undefined;
174
+ search?: string | undefined;
175
+ isActive?: "true" | "false" | undefined;
176
+ isDeactivated?: "true" | "false" | undefined;
177
+ role?: string | undefined;
178
+ sortBy?: "firstName" | "lastName" | "createdAt" | undefined;
179
+ sortOrder?: "ASC" | "DESC" | undefined;
180
+ };
181
+ }, {
182
+ query: {
183
+ page?: string | undefined;
184
+ limit?: string | undefined;
185
+ search?: string | undefined;
186
+ isActive?: "true" | "false" | undefined;
187
+ isDeactivated?: "true" | "false" | undefined;
188
+ role?: string | undefined;
189
+ sortBy?: "firstName" | "lastName" | "createdAt" | undefined;
190
+ sortOrder?: "ASC" | "DESC" | undefined;
191
+ };
192
+ }>;
193
+ export declare const hireAdminSchema: z.ZodObject<{
194
+ body: z.ZodObject<{
195
+ email: z.ZodString;
196
+ firstName: z.ZodString;
197
+ lastName: z.ZodString;
198
+ phoneNumber: z.ZodString;
199
+ password: z.ZodString;
200
+ role: z.ZodEnum<["AGENT", "ADMIN"]>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ phoneNumber: string;
203
+ firstName: string;
204
+ lastName: string;
205
+ email: string;
206
+ role: "AGENT" | "ADMIN";
207
+ password: string;
208
+ }, {
209
+ phoneNumber: string;
210
+ firstName: string;
211
+ lastName: string;
212
+ email: string;
213
+ role: "AGENT" | "ADMIN";
214
+ password: string;
215
+ }>;
216
+ }, "strip", z.ZodTypeAny, {
217
+ body: {
218
+ phoneNumber: string;
219
+ firstName: string;
220
+ lastName: string;
221
+ email: string;
222
+ role: "AGENT" | "ADMIN";
223
+ password: string;
224
+ };
225
+ }, {
226
+ body: {
227
+ phoneNumber: string;
228
+ firstName: string;
229
+ lastName: string;
230
+ email: string;
231
+ role: "AGENT" | "ADMIN";
232
+ password: string;
233
+ };
234
+ }>;
235
+ export declare const promoteAdminSchema: z.ZodObject<{
236
+ params: z.ZodObject<{
237
+ userId: z.ZodString;
238
+ }, "strip", z.ZodTypeAny, {
239
+ userId: string;
240
+ }, {
241
+ userId: string;
242
+ }>;
243
+ body: z.ZodObject<{
244
+ targetRole: z.ZodEnum<["ADMIN", "SUPER_ADMIN"]>;
245
+ password: z.ZodOptional<z.ZodString>;
246
+ }, "strip", z.ZodTypeAny, {
247
+ targetRole: "ADMIN" | "SUPER_ADMIN";
248
+ password?: string | undefined;
249
+ }, {
250
+ targetRole: "ADMIN" | "SUPER_ADMIN";
251
+ password?: string | undefined;
252
+ }>;
253
+ }, "strip", z.ZodTypeAny, {
254
+ params: {
255
+ userId: string;
256
+ };
257
+ body: {
258
+ targetRole: "ADMIN" | "SUPER_ADMIN";
259
+ password?: string | undefined;
260
+ };
261
+ }, {
262
+ params: {
263
+ userId: string;
264
+ };
265
+ body: {
266
+ targetRole: "ADMIN" | "SUPER_ADMIN";
267
+ password?: string | undefined;
268
+ };
269
+ }>;
270
+ export declare const demoteAdminSchema: z.ZodObject<{
271
+ params: z.ZodObject<{
272
+ userId: z.ZodString;
273
+ }, "strip", z.ZodTypeAny, {
274
+ userId: string;
275
+ }, {
276
+ userId: string;
277
+ }>;
278
+ body: z.ZodObject<{
279
+ targetRole: z.ZodEnum<["AGENT", "ADMIN"]>;
280
+ }, "strip", z.ZodTypeAny, {
281
+ targetRole: "AGENT" | "ADMIN";
282
+ }, {
283
+ targetRole: "AGENT" | "ADMIN";
284
+ }>;
285
+ }, "strip", z.ZodTypeAny, {
286
+ params: {
287
+ userId: string;
288
+ };
289
+ body: {
290
+ targetRole: "AGENT" | "ADMIN";
291
+ };
292
+ }, {
293
+ params: {
294
+ userId: string;
295
+ };
296
+ body: {
297
+ targetRole: "AGENT" | "ADMIN";
298
+ };
299
+ }>;
300
+ export declare const fireEmployeeSchema: z.ZodObject<{
301
+ params: z.ZodObject<{
302
+ userId: z.ZodString;
303
+ }, "strip", z.ZodTypeAny, {
304
+ userId: string;
305
+ }, {
306
+ userId: string;
307
+ }>;
308
+ body: z.ZodObject<{
309
+ reason: z.ZodOptional<z.ZodString>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ reason?: string | undefined;
312
+ }, {
313
+ reason?: string | undefined;
314
+ }>;
315
+ }, "strip", z.ZodTypeAny, {
316
+ params: {
317
+ userId: string;
318
+ };
319
+ body: {
320
+ reason?: string | undefined;
321
+ };
322
+ }, {
323
+ params: {
324
+ userId: string;
325
+ };
326
+ body: {
327
+ reason?: string | undefined;
328
+ };
329
+ }>;
330
+ export declare const updateAdminSchema: z.ZodObject<{
331
+ params: z.ZodObject<{
332
+ userId: z.ZodString;
333
+ }, "strip", z.ZodTypeAny, {
334
+ userId: string;
335
+ }, {
336
+ userId: string;
337
+ }>;
338
+ body: z.ZodObject<{
339
+ firstName: z.ZodOptional<z.ZodString>;
340
+ lastName: z.ZodOptional<z.ZodString>;
341
+ email: z.ZodOptional<z.ZodString>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ firstName?: string | undefined;
344
+ lastName?: string | undefined;
345
+ email?: string | undefined;
346
+ }, {
347
+ firstName?: string | undefined;
348
+ lastName?: string | undefined;
349
+ email?: string | undefined;
350
+ }>;
351
+ }, "strip", z.ZodTypeAny, {
352
+ params: {
353
+ userId: string;
354
+ };
355
+ body: {
356
+ firstName?: string | undefined;
357
+ lastName?: string | undefined;
358
+ email?: string | undefined;
359
+ };
360
+ }, {
361
+ params: {
362
+ userId: string;
363
+ };
364
+ body: {
365
+ firstName?: string | undefined;
366
+ lastName?: string | undefined;
367
+ email?: string | undefined;
368
+ };
369
+ }>;
370
+ export declare const resetPasswordSchema: z.ZodObject<{
371
+ params: z.ZodObject<{
372
+ userId: z.ZodString;
373
+ }, "strip", z.ZodTypeAny, {
374
+ userId: string;
375
+ }, {
376
+ userId: string;
377
+ }>;
378
+ }, "strip", z.ZodTypeAny, {
379
+ params: {
380
+ userId: string;
381
+ };
382
+ }, {
383
+ params: {
384
+ userId: string;
385
+ };
386
+ }>;
387
+ export declare const bulkResetPasswordSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulkResetPasswordSchema = exports.resetPasswordSchema = exports.updateAdminSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.upgradeToRiderSchema = void 0;
4
+ // src/validations/users.validations.ts
5
+ const zod_1 = require("zod");
6
+ const auth_validations_1 = require("./auth.validations");
7
+ // Operations Schemas
8
+ exports.upgradeToRiderSchema = zod_1.z.object({
9
+ params: zod_1.z.object({
10
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
11
+ }),
12
+ body: zod_1.z.object({
13
+ jacketId: zod_1.z.string().min(5).max(20),
14
+ nationalId: zod_1.z.string().min(5).max(20),
15
+ phoneNumber: zod_1.z.string().regex(auth_validations_1.phoneRegex, "Invalid phone number format"),
16
+ plateNumber: zod_1.z.string().min(3).max(10).optional(),
17
+ }),
18
+ });
19
+ exports.updateRiderSchema = zod_1.z.object({
20
+ params: zod_1.z.object({
21
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
22
+ }),
23
+ body: zod_1.z.object({
24
+ firstName: zod_1.z.string().min(2).max(100).optional(),
25
+ lastName: zod_1.z.string().min(2).max(100).optional(),
26
+ phoneNumber: zod_1.z.string().regex(auth_validations_1.phoneRegex).optional(),
27
+ jacketId: zod_1.z.string().min(5).max(20).optional(),
28
+ plateNumber: zod_1.z.string().min(3).max(10).optional(),
29
+ nationalId: zod_1.z.string().min(5).max(20).optional(),
30
+ email: zod_1.z.string().email().optional(),
31
+ }),
32
+ });
33
+ exports.deleteUserSchema = zod_1.z.object({
34
+ params: zod_1.z.object({
35
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
36
+ }),
37
+ });
38
+ exports.getUserSchema = zod_1.z.object({
39
+ params: zod_1.z.object({
40
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
41
+ }),
42
+ });
43
+ exports.getUsersSchema = zod_1.z.object({
44
+ query: zod_1.z.object({
45
+ page: zod_1.z.string().regex(/^\d+$/).transform(Number).optional(),
46
+ limit: zod_1.z.string().regex(/^\d+$/).transform(Number).optional(),
47
+ search: zod_1.z.string().optional(),
48
+ isActive: zod_1.z.enum(["true", "false"]).optional(),
49
+ isDeactivated: zod_1.z.enum(["true", "false"]).optional(),
50
+ role: zod_1.z.string().optional(),
51
+ sortBy: zod_1.z.enum(["createdAt", "firstName", "lastName"]).optional(),
52
+ sortOrder: zod_1.z.enum(["ASC", "DESC"]).optional(),
53
+ }),
54
+ });
55
+ // Management Schemas
56
+ exports.hireAdminSchema = zod_1.z.object({
57
+ body: zod_1.z.object({
58
+ email: zod_1.z.string().email(),
59
+ firstName: zod_1.z.string().min(2).max(100),
60
+ lastName: zod_1.z.string().min(2).max(100),
61
+ phoneNumber: zod_1.z.string().regex(auth_validations_1.phoneRegex),
62
+ password: zod_1.z.string().min(6),
63
+ role: zod_1.z.enum(["AGENT", "ADMIN"]),
64
+ }),
65
+ });
66
+ exports.promoteAdminSchema = zod_1.z.object({
67
+ params: zod_1.z.object({
68
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
69
+ }),
70
+ body: zod_1.z.object({
71
+ targetRole: zod_1.z.enum(["ADMIN", "SUPER_ADMIN"]),
72
+ password: zod_1.z.string().optional(),
73
+ }),
74
+ });
75
+ exports.demoteAdminSchema = zod_1.z.object({
76
+ params: zod_1.z.object({
77
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
78
+ }),
79
+ body: zod_1.z.object({
80
+ targetRole: zod_1.z.enum(["AGENT", "ADMIN"]),
81
+ }),
82
+ });
83
+ exports.fireEmployeeSchema = zod_1.z.object({
84
+ params: zod_1.z.object({
85
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
86
+ }),
87
+ body: zod_1.z.object({
88
+ reason: zod_1.z.string().min(1).optional(),
89
+ }),
90
+ });
91
+ exports.updateAdminSchema = zod_1.z.object({
92
+ params: zod_1.z.object({
93
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
94
+ }),
95
+ body: zod_1.z.object({
96
+ firstName: zod_1.z.string().min(2).max(100).optional(),
97
+ lastName: zod_1.z.string().min(2).max(100).optional(),
98
+ email: zod_1.z.string().email().optional(),
99
+ }),
100
+ });
101
+ exports.resetPasswordSchema = zod_1.z.object({
102
+ params: zod_1.z.object({
103
+ userId: zod_1.z.string().uuid("Invalid user ID format"),
104
+ }),
105
+ });
106
+ exports.bulkResetPasswordSchema = zod_1.z.object({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",