vr-commons 1.0.55 → 1.0.56
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,6 +1,6 @@
|
|
|
1
1
|
export { validate } from "./validate.validations";
|
|
2
2
|
export { riderLoginSchema, forgotPasswordSchema, userLoginSchema, refreshTokenSchema, registerSchema, confirmSchema, verifySchema, resendOtpSchema, } from "./auth.validations";
|
|
3
|
-
export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema, changePasswordSchema, deactivateAccountSchema, deleteAccountSchema, } from "./profiles.validations";
|
|
3
|
+
export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema, changePasswordSchema, deactivateAccountSchema, deleteAccountSchema, updateProfileSchema, } from "./profiles.validations";
|
|
4
4
|
export { listBansSchema, listPendingAppealsSchema, listSuspensionsSchema, reviewAppealSchema, revokeBanSchema, revokeSuspensionSchema, extendSuspensionSchema, exportBansSchema, } from "./moderation.validations";
|
|
5
5
|
export { submitBanAppealSchema, submitSuspensionAppealSchema, } from "./appeals.validations";
|
|
6
6
|
export { getBanSchema, getUserRestrictionsSchema, createBanSchema, } from "./bans.validations";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.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.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");
|
|
@@ -30,6 +30,7 @@ Object.defineProperty(exports, "createRiderSchema", { enumerable: true, get: fun
|
|
|
30
30
|
Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return profiles_validations_1.changePasswordSchema; } });
|
|
31
31
|
Object.defineProperty(exports, "deactivateAccountSchema", { enumerable: true, get: function () { return profiles_validations_1.deactivateAccountSchema; } });
|
|
32
32
|
Object.defineProperty(exports, "deleteAccountSchema", { enumerable: true, get: function () { return profiles_validations_1.deleteAccountSchema; } });
|
|
33
|
+
Object.defineProperty(exports, "updateProfileSchema", { enumerable: true, get: function () { return profiles_validations_1.updateProfileSchema; } });
|
|
33
34
|
var moderation_validations_1 = require("./moderation.validations");
|
|
34
35
|
Object.defineProperty(exports, "listBansSchema", { enumerable: true, get: function () { return moderation_validations_1.listBansSchema; } });
|
|
35
36
|
Object.defineProperty(exports, "listPendingAppealsSchema", { enumerable: true, get: function () { return moderation_validations_1.listPendingAppealsSchema; } });
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const phoneNumberRegex: RegExp;
|
|
3
|
+
export declare const nationalIdRegex: RegExp;
|
|
4
|
+
export declare const jacketIdRegex: RegExp;
|
|
5
|
+
export declare const phoneRegex: RegExp;
|
|
2
6
|
export declare const createUserSchema: z.ZodObject<{
|
|
3
7
|
body: z.ZodObject<{
|
|
4
8
|
firstName: z.ZodString;
|
|
@@ -14,22 +18,22 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
14
18
|
firstName: string;
|
|
15
19
|
lastName: string;
|
|
16
20
|
phoneNumber: string;
|
|
17
|
-
password: string;
|
|
18
21
|
nationalId: string;
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
password: string;
|
|
23
|
+
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
21
24
|
email?: string | null | undefined;
|
|
22
25
|
plateNumber?: string | null | undefined;
|
|
26
|
+
jacketId?: string | null | undefined;
|
|
23
27
|
}, {
|
|
24
28
|
firstName: string;
|
|
25
29
|
lastName: string;
|
|
26
30
|
phoneNumber: string;
|
|
27
|
-
password: string;
|
|
28
31
|
nationalId: string;
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
password: string;
|
|
33
|
+
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
31
34
|
email?: string | null | undefined;
|
|
32
35
|
plateNumber?: string | null | undefined;
|
|
36
|
+
jacketId?: string | null | undefined;
|
|
33
37
|
}>;
|
|
34
38
|
headers: z.ZodObject<{
|
|
35
39
|
authorization: z.ZodString;
|
|
@@ -43,12 +47,12 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
43
47
|
firstName: string;
|
|
44
48
|
lastName: string;
|
|
45
49
|
phoneNumber: string;
|
|
46
|
-
password: string;
|
|
47
50
|
nationalId: string;
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
password: string;
|
|
52
|
+
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
50
53
|
email?: string | null | undefined;
|
|
51
54
|
plateNumber?: string | null | undefined;
|
|
55
|
+
jacketId?: string | null | undefined;
|
|
52
56
|
};
|
|
53
57
|
headers: {
|
|
54
58
|
authorization: string;
|
|
@@ -58,12 +62,12 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
58
62
|
firstName: string;
|
|
59
63
|
lastName: string;
|
|
60
64
|
phoneNumber: string;
|
|
61
|
-
password: string;
|
|
62
65
|
nationalId: string;
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
password: string;
|
|
67
|
+
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
65
68
|
email?: string | null | undefined;
|
|
66
69
|
plateNumber?: string | null | undefined;
|
|
70
|
+
jacketId?: string | null | undefined;
|
|
67
71
|
};
|
|
68
72
|
headers: {
|
|
69
73
|
authorization: string;
|
|
@@ -125,8 +129,8 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
125
129
|
password?: string | undefined;
|
|
126
130
|
plateNumber?: string | null | undefined;
|
|
127
131
|
isActive?: boolean | undefined;
|
|
128
|
-
isDeactivated?: boolean | undefined;
|
|
129
132
|
isSuspended?: boolean | undefined;
|
|
133
|
+
isDeactivated?: boolean | undefined;
|
|
130
134
|
}, {
|
|
131
135
|
firstName?: string | undefined;
|
|
132
136
|
lastName?: string | undefined;
|
|
@@ -135,8 +139,8 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
135
139
|
password?: string | undefined;
|
|
136
140
|
plateNumber?: string | null | undefined;
|
|
137
141
|
isActive?: boolean | undefined;
|
|
138
|
-
isDeactivated?: boolean | undefined;
|
|
139
142
|
isSuspended?: boolean | undefined;
|
|
143
|
+
isDeactivated?: boolean | undefined;
|
|
140
144
|
}>, {
|
|
141
145
|
firstName?: string | undefined;
|
|
142
146
|
lastName?: string | undefined;
|
|
@@ -145,8 +149,8 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
145
149
|
password?: string | undefined;
|
|
146
150
|
plateNumber?: string | null | undefined;
|
|
147
151
|
isActive?: boolean | undefined;
|
|
148
|
-
isDeactivated?: boolean | undefined;
|
|
149
152
|
isSuspended?: boolean | undefined;
|
|
153
|
+
isDeactivated?: boolean | undefined;
|
|
150
154
|
}, {
|
|
151
155
|
firstName?: string | undefined;
|
|
152
156
|
lastName?: string | undefined;
|
|
@@ -155,8 +159,8 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
155
159
|
password?: string | undefined;
|
|
156
160
|
plateNumber?: string | null | undefined;
|
|
157
161
|
isActive?: boolean | undefined;
|
|
158
|
-
isDeactivated?: boolean | undefined;
|
|
159
162
|
isSuspended?: boolean | undefined;
|
|
163
|
+
isDeactivated?: boolean | undefined;
|
|
160
164
|
}>;
|
|
161
165
|
headers: z.ZodObject<{
|
|
162
166
|
authorization: z.ZodString;
|
|
@@ -166,6 +170,9 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
166
170
|
authorization: string;
|
|
167
171
|
}>;
|
|
168
172
|
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
params: {
|
|
174
|
+
userId: string;
|
|
175
|
+
};
|
|
169
176
|
body: {
|
|
170
177
|
firstName?: string | undefined;
|
|
171
178
|
lastName?: string | undefined;
|
|
@@ -174,16 +181,16 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
174
181
|
password?: string | undefined;
|
|
175
182
|
plateNumber?: string | null | undefined;
|
|
176
183
|
isActive?: boolean | undefined;
|
|
177
|
-
isDeactivated?: boolean | undefined;
|
|
178
184
|
isSuspended?: boolean | undefined;
|
|
179
|
-
|
|
180
|
-
params: {
|
|
181
|
-
userId: string;
|
|
185
|
+
isDeactivated?: boolean | undefined;
|
|
182
186
|
};
|
|
183
187
|
headers: {
|
|
184
188
|
authorization: string;
|
|
185
189
|
};
|
|
186
190
|
}, {
|
|
191
|
+
params: {
|
|
192
|
+
userId: string;
|
|
193
|
+
};
|
|
187
194
|
body: {
|
|
188
195
|
firstName?: string | undefined;
|
|
189
196
|
lastName?: string | undefined;
|
|
@@ -192,11 +199,8 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
192
199
|
password?: string | undefined;
|
|
193
200
|
plateNumber?: string | null | undefined;
|
|
194
201
|
isActive?: boolean | undefined;
|
|
195
|
-
isDeactivated?: boolean | undefined;
|
|
196
202
|
isSuspended?: boolean | undefined;
|
|
197
|
-
|
|
198
|
-
params: {
|
|
199
|
-
userId: string;
|
|
203
|
+
isDeactivated?: boolean | undefined;
|
|
200
204
|
};
|
|
201
205
|
headers: {
|
|
202
206
|
authorization: string;
|
|
@@ -216,29 +220,29 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
216
220
|
sortBy: z.ZodDefault<z.ZodEnum<["firstName", "lastLoginAt", "createdAt"]>>;
|
|
217
221
|
order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
218
222
|
}, "strip", z.ZodTypeAny, {
|
|
219
|
-
order: "asc" | "desc";
|
|
220
223
|
sortBy: "firstName" | "lastLoginAt" | "createdAt";
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
order: "asc" | "desc";
|
|
225
|
+
role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
223
226
|
isActive?: boolean | undefined;
|
|
224
|
-
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
225
|
-
isBanned?: boolean | undefined;
|
|
226
227
|
isSuspended?: boolean | undefined;
|
|
227
228
|
page?: number | undefined;
|
|
229
|
+
limit?: number | undefined;
|
|
230
|
+
isBanned?: boolean | undefined;
|
|
231
|
+
search?: string | undefined;
|
|
228
232
|
startDate?: string | undefined;
|
|
229
233
|
endDate?: string | undefined;
|
|
230
234
|
}, {
|
|
231
|
-
|
|
232
|
-
order?: "asc" | "desc" | undefined;
|
|
233
|
-
limit?: string | undefined;
|
|
235
|
+
role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
234
236
|
isActive?: "true" | "false" | undefined;
|
|
235
|
-
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
236
|
-
isBanned?: "true" | "false" | undefined;
|
|
237
237
|
isSuspended?: "true" | "false" | undefined;
|
|
238
238
|
page?: string | undefined;
|
|
239
|
+
limit?: string | undefined;
|
|
240
|
+
isBanned?: "true" | "false" | undefined;
|
|
241
|
+
search?: string | undefined;
|
|
239
242
|
startDate?: string | undefined;
|
|
240
243
|
endDate?: string | undefined;
|
|
241
244
|
sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
|
|
245
|
+
order?: "asc" | "desc" | undefined;
|
|
242
246
|
}>;
|
|
243
247
|
headers: z.ZodObject<{
|
|
244
248
|
authorization: z.ZodString;
|
|
@@ -248,38 +252,38 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
248
252
|
authorization: string;
|
|
249
253
|
}>;
|
|
250
254
|
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
headers: {
|
|
256
|
+
authorization: string;
|
|
257
|
+
};
|
|
251
258
|
query: {
|
|
252
|
-
order: "asc" | "desc";
|
|
253
259
|
sortBy: "firstName" | "lastLoginAt" | "createdAt";
|
|
254
|
-
|
|
255
|
-
|
|
260
|
+
order: "asc" | "desc";
|
|
261
|
+
role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
256
262
|
isActive?: boolean | undefined;
|
|
257
|
-
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
258
|
-
isBanned?: boolean | undefined;
|
|
259
263
|
isSuspended?: boolean | undefined;
|
|
260
264
|
page?: number | undefined;
|
|
265
|
+
limit?: number | undefined;
|
|
266
|
+
isBanned?: boolean | undefined;
|
|
267
|
+
search?: string | undefined;
|
|
261
268
|
startDate?: string | undefined;
|
|
262
269
|
endDate?: string | undefined;
|
|
263
270
|
};
|
|
271
|
+
}, {
|
|
264
272
|
headers: {
|
|
265
273
|
authorization: string;
|
|
266
274
|
};
|
|
267
|
-
}, {
|
|
268
275
|
query: {
|
|
269
|
-
|
|
270
|
-
order?: "asc" | "desc" | undefined;
|
|
271
|
-
limit?: string | undefined;
|
|
276
|
+
role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
272
277
|
isActive?: "true" | "false" | undefined;
|
|
273
|
-
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
274
|
-
isBanned?: "true" | "false" | undefined;
|
|
275
278
|
isSuspended?: "true" | "false" | undefined;
|
|
276
279
|
page?: string | undefined;
|
|
280
|
+
limit?: string | undefined;
|
|
281
|
+
isBanned?: "true" | "false" | undefined;
|
|
282
|
+
search?: string | undefined;
|
|
277
283
|
startDate?: string | undefined;
|
|
278
284
|
endDate?: string | undefined;
|
|
279
285
|
sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
|
|
280
|
-
|
|
281
|
-
headers: {
|
|
282
|
-
authorization: string;
|
|
286
|
+
order?: "asc" | "desc" | undefined;
|
|
283
287
|
};
|
|
284
288
|
}>;
|
|
285
289
|
export declare const viewProfileSchema: z.ZodObject<{
|
|
@@ -297,16 +301,16 @@ export declare const viewProfileSchema: z.ZodObject<{
|
|
|
297
301
|
headers: {
|
|
298
302
|
authorization: string;
|
|
299
303
|
};
|
|
304
|
+
params?: {} | undefined;
|
|
300
305
|
body?: {} | undefined;
|
|
301
306
|
query?: {} | undefined;
|
|
302
|
-
params?: {} | undefined;
|
|
303
307
|
}, {
|
|
304
308
|
headers: {
|
|
305
309
|
authorization: string;
|
|
306
310
|
};
|
|
311
|
+
params?: {} | undefined;
|
|
307
312
|
body?: {} | undefined;
|
|
308
313
|
query?: {} | undefined;
|
|
309
|
-
params?: {} | undefined;
|
|
310
314
|
}>;
|
|
311
315
|
export declare const passengerSignupSchema: z.ZodObject<{
|
|
312
316
|
body: z.ZodObject<{
|
|
@@ -323,19 +327,19 @@ export declare const passengerSignupSchema: z.ZodObject<{
|
|
|
323
327
|
lastName: string;
|
|
324
328
|
phoneNumber: string;
|
|
325
329
|
nationalId: string;
|
|
326
|
-
jacketId?: string | undefined;
|
|
327
330
|
email?: string | null | undefined;
|
|
328
331
|
password?: string | null | undefined;
|
|
329
332
|
plateNumber?: string | null | undefined;
|
|
333
|
+
jacketId?: string | undefined;
|
|
330
334
|
}, {
|
|
331
335
|
firstName: string;
|
|
332
336
|
lastName: string;
|
|
333
337
|
phoneNumber: string;
|
|
334
338
|
nationalId: string;
|
|
335
|
-
jacketId?: string | undefined;
|
|
336
339
|
email?: string | null | undefined;
|
|
337
340
|
password?: string | null | undefined;
|
|
338
341
|
plateNumber?: string | null | undefined;
|
|
342
|
+
jacketId?: string | undefined;
|
|
339
343
|
}>;
|
|
340
344
|
headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
341
345
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -344,10 +348,10 @@ export declare const passengerSignupSchema: z.ZodObject<{
|
|
|
344
348
|
lastName: string;
|
|
345
349
|
phoneNumber: string;
|
|
346
350
|
nationalId: string;
|
|
347
|
-
jacketId?: string | undefined;
|
|
348
351
|
email?: string | null | undefined;
|
|
349
352
|
password?: string | null | undefined;
|
|
350
353
|
plateNumber?: string | null | undefined;
|
|
354
|
+
jacketId?: string | undefined;
|
|
351
355
|
};
|
|
352
356
|
headers?: {} | undefined;
|
|
353
357
|
}, {
|
|
@@ -356,10 +360,10 @@ export declare const passengerSignupSchema: z.ZodObject<{
|
|
|
356
360
|
lastName: string;
|
|
357
361
|
phoneNumber: string;
|
|
358
362
|
nationalId: string;
|
|
359
|
-
jacketId?: string | undefined;
|
|
360
363
|
email?: string | null | undefined;
|
|
361
364
|
password?: string | null | undefined;
|
|
362
365
|
plateNumber?: string | null | undefined;
|
|
366
|
+
jacketId?: string | undefined;
|
|
363
367
|
};
|
|
364
368
|
headers?: {} | undefined;
|
|
365
369
|
}>;
|
|
@@ -419,16 +423,16 @@ export declare const createRiderSchema: z.ZodObject<{
|
|
|
419
423
|
firstName: string;
|
|
420
424
|
lastName: string;
|
|
421
425
|
phoneNumber: string;
|
|
422
|
-
jacketId: string;
|
|
423
|
-
plateNumber: string;
|
|
424
426
|
nationalId: string;
|
|
427
|
+
plateNumber: string;
|
|
428
|
+
jacketId: string;
|
|
425
429
|
}, {
|
|
426
430
|
firstName: string;
|
|
427
431
|
lastName: string;
|
|
428
432
|
phoneNumber: string;
|
|
429
|
-
jacketId: string;
|
|
430
|
-
plateNumber: string;
|
|
431
433
|
nationalId: string;
|
|
434
|
+
plateNumber: string;
|
|
435
|
+
jacketId: string;
|
|
432
436
|
}>;
|
|
433
437
|
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
434
438
|
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
@@ -437,23 +441,23 @@ export declare const createRiderSchema: z.ZodObject<{
|
|
|
437
441
|
firstName: string;
|
|
438
442
|
lastName: string;
|
|
439
443
|
phoneNumber: string;
|
|
440
|
-
jacketId: string;
|
|
441
|
-
plateNumber: string;
|
|
442
444
|
nationalId: string;
|
|
445
|
+
plateNumber: string;
|
|
446
|
+
jacketId: string;
|
|
443
447
|
};
|
|
444
|
-
query?: {} | undefined;
|
|
445
448
|
params?: {} | undefined;
|
|
449
|
+
query?: {} | undefined;
|
|
446
450
|
}, {
|
|
447
451
|
body: {
|
|
448
452
|
firstName: string;
|
|
449
453
|
lastName: string;
|
|
450
454
|
phoneNumber: string;
|
|
451
|
-
jacketId: string;
|
|
452
|
-
plateNumber: string;
|
|
453
455
|
nationalId: string;
|
|
456
|
+
plateNumber: string;
|
|
457
|
+
jacketId: string;
|
|
454
458
|
};
|
|
455
|
-
query?: {} | undefined;
|
|
456
459
|
params?: {} | undefined;
|
|
460
|
+
query?: {} | undefined;
|
|
457
461
|
}>;
|
|
458
462
|
export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
459
463
|
params: z.ZodObject<{
|
|
@@ -474,30 +478,30 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
|
474
478
|
firstName: string;
|
|
475
479
|
lastName: string;
|
|
476
480
|
phoneNumber: string;
|
|
477
|
-
jacketId: string;
|
|
478
|
-
plateNumber: string;
|
|
479
481
|
nationalId: string;
|
|
482
|
+
plateNumber: string;
|
|
483
|
+
jacketId: string;
|
|
480
484
|
}, {
|
|
481
485
|
firstName: string;
|
|
482
486
|
lastName: string;
|
|
483
487
|
phoneNumber: string;
|
|
484
|
-
jacketId: string;
|
|
485
|
-
plateNumber: string;
|
|
486
488
|
nationalId: string;
|
|
489
|
+
plateNumber: string;
|
|
490
|
+
jacketId: string;
|
|
487
491
|
}>, {
|
|
488
492
|
firstName: string;
|
|
489
493
|
lastName: string;
|
|
490
494
|
phoneNumber: string;
|
|
491
|
-
jacketId: string;
|
|
492
|
-
plateNumber: string;
|
|
493
495
|
nationalId: string;
|
|
496
|
+
plateNumber: string;
|
|
497
|
+
jacketId: string;
|
|
494
498
|
}, {
|
|
495
499
|
firstName: string;
|
|
496
500
|
lastName: string;
|
|
497
501
|
phoneNumber: string;
|
|
498
|
-
jacketId: string;
|
|
499
|
-
plateNumber: string;
|
|
500
502
|
nationalId: string;
|
|
503
|
+
plateNumber: string;
|
|
504
|
+
jacketId: string;
|
|
501
505
|
}>;
|
|
502
506
|
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
503
507
|
headers: z.ZodObject<{
|
|
@@ -508,32 +512,32 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
|
508
512
|
authorization: string;
|
|
509
513
|
}>;
|
|
510
514
|
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
params: {
|
|
516
|
+
id: string;
|
|
517
|
+
};
|
|
511
518
|
body: {
|
|
512
519
|
firstName: string;
|
|
513
520
|
lastName: string;
|
|
514
521
|
phoneNumber: string;
|
|
515
|
-
jacketId: string;
|
|
516
|
-
plateNumber: string;
|
|
517
522
|
nationalId: string;
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
id: string;
|
|
523
|
+
plateNumber: string;
|
|
524
|
+
jacketId: string;
|
|
521
525
|
};
|
|
522
526
|
headers: {
|
|
523
527
|
authorization: string;
|
|
524
528
|
};
|
|
525
529
|
query?: {} | undefined;
|
|
526
530
|
}, {
|
|
531
|
+
params: {
|
|
532
|
+
id: string;
|
|
533
|
+
};
|
|
527
534
|
body: {
|
|
528
535
|
firstName: string;
|
|
529
536
|
lastName: string;
|
|
530
537
|
phoneNumber: string;
|
|
531
|
-
jacketId: string;
|
|
532
|
-
plateNumber: string;
|
|
533
538
|
nationalId: string;
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
id: string;
|
|
539
|
+
plateNumber: string;
|
|
540
|
+
jacketId: string;
|
|
537
541
|
};
|
|
538
542
|
headers: {
|
|
539
543
|
authorization: string;
|
|
@@ -654,6 +658,43 @@ export declare const deleteAccountSchema: z.ZodObject<{
|
|
|
654
658
|
};
|
|
655
659
|
params?: {} | undefined;
|
|
656
660
|
}>;
|
|
661
|
+
export declare const updateProfileSchema: z.ZodObject<{
|
|
662
|
+
body: z.ZodObject<{
|
|
663
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
664
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
665
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
666
|
+
email: z.ZodOptional<z.ZodString>;
|
|
667
|
+
nationalId: z.ZodOptional<z.ZodString>;
|
|
668
|
+
}, "strict", z.ZodTypeAny, {
|
|
669
|
+
firstName?: string | undefined;
|
|
670
|
+
lastName?: string | undefined;
|
|
671
|
+
phoneNumber?: string | undefined;
|
|
672
|
+
nationalId?: string | undefined;
|
|
673
|
+
email?: string | undefined;
|
|
674
|
+
}, {
|
|
675
|
+
firstName?: string | undefined;
|
|
676
|
+
lastName?: string | undefined;
|
|
677
|
+
phoneNumber?: string | undefined;
|
|
678
|
+
nationalId?: string | undefined;
|
|
679
|
+
email?: string | undefined;
|
|
680
|
+
}>;
|
|
681
|
+
}, "strip", z.ZodTypeAny, {
|
|
682
|
+
body: {
|
|
683
|
+
firstName?: string | undefined;
|
|
684
|
+
lastName?: string | undefined;
|
|
685
|
+
phoneNumber?: string | undefined;
|
|
686
|
+
nationalId?: string | undefined;
|
|
687
|
+
email?: string | undefined;
|
|
688
|
+
};
|
|
689
|
+
}, {
|
|
690
|
+
body: {
|
|
691
|
+
firstName?: string | undefined;
|
|
692
|
+
lastName?: string | undefined;
|
|
693
|
+
phoneNumber?: string | undefined;
|
|
694
|
+
nationalId?: string | undefined;
|
|
695
|
+
email?: string | undefined;
|
|
696
|
+
};
|
|
697
|
+
}>;
|
|
657
698
|
export type CreateUserInput = z.infer<typeof createUserSchema>;
|
|
658
699
|
export type GetUserByIdInput = z.infer<typeof getUserByIdSchema>;
|
|
659
700
|
export type UpdateUserProfileInput = z.infer<typeof updateUserProfileSchema>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.updateRiderProfileSchema = exports.createRiderSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = void 0;
|
|
3
|
+
exports.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.updateRiderProfileSchema = exports.createRiderSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.phoneRegex = exports.jacketIdRegex = exports.nationalIdRegex = exports.phoneNumberRegex = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ============================================================================
|
|
6
6
|
// COMMON VALIDATIONS
|
|
7
7
|
// ============================================================================
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
exports.phoneNumberRegex = /^(078|079|072|073)\d{7}$/;
|
|
9
|
+
exports.nationalIdRegex = /^\d{16}$/;
|
|
10
|
+
exports.jacketIdRegex = /^JKT-\d{9}$/;
|
|
11
|
+
exports.phoneRegex = /^[0-9]{10,15}$/;
|
|
11
12
|
// ============================================================================
|
|
12
13
|
// ADMIN/SUPER ADMIN SCHEMAS
|
|
13
14
|
// ============================================================================
|
|
@@ -24,10 +25,10 @@ exports.createUserSchema = zod_1.z.object({
|
|
|
24
25
|
.max(100, "Last name cannot exceed 100 characters"),
|
|
25
26
|
phoneNumber: zod_1.z
|
|
26
27
|
.string()
|
|
27
|
-
.regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
28
|
+
.regex(exports.phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
28
29
|
nationalId: zod_1.z
|
|
29
30
|
.string()
|
|
30
|
-
.regex(nationalIdRegex, "National ID must be 16 digits"),
|
|
31
|
+
.regex(exports.nationalIdRegex, "National ID must be 16 digits"),
|
|
31
32
|
email: zod_1.z
|
|
32
33
|
.string()
|
|
33
34
|
.email("Invalid email address")
|
|
@@ -48,7 +49,7 @@ exports.createUserSchema = zod_1.z.object({
|
|
|
48
49
|
.nullable(),
|
|
49
50
|
jacketId: zod_1.z
|
|
50
51
|
.string()
|
|
51
|
-
.regex(jacketIdRegex, "Jacket ID must be in format JKT-000000000")
|
|
52
|
+
.regex(exports.jacketIdRegex, "Jacket ID must be in format JKT-000000000")
|
|
52
53
|
.optional()
|
|
53
54
|
.nullable(),
|
|
54
55
|
}),
|
|
@@ -94,7 +95,7 @@ exports.updateUserProfileSchema = zod_1.z.object({
|
|
|
94
95
|
.or(zod_1.z.literal("")),
|
|
95
96
|
phoneNumber: zod_1.z
|
|
96
97
|
.string()
|
|
97
|
-
.regex(phoneNumberRegex, "Invalid phone number format")
|
|
98
|
+
.regex(exports.phoneNumberRegex, "Invalid phone number format")
|
|
98
99
|
.optional(),
|
|
99
100
|
plateNumber: zod_1.z
|
|
100
101
|
.string()
|
|
@@ -183,13 +184,13 @@ exports.passengerSignupSchema = zod_1.z.object({
|
|
|
183
184
|
.max(100, "Last name cannot exceed 100 characters"),
|
|
184
185
|
phoneNumber: zod_1.z
|
|
185
186
|
.string()
|
|
186
|
-
.regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
187
|
+
.regex(exports.phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
187
188
|
nationalId: zod_1.z
|
|
188
189
|
.string()
|
|
189
|
-
.regex(nationalIdRegex, "National ID must be 16 digits"),
|
|
190
|
+
.regex(exports.nationalIdRegex, "National ID must be 16 digits"),
|
|
190
191
|
jacketId: zod_1.z
|
|
191
192
|
.string()
|
|
192
|
-
.regex(jacketIdRegex, "Jacket ID must be in format JKT-000000000")
|
|
193
|
+
.regex(exports.jacketIdRegex, "Jacket ID must be in format JKT-000000000")
|
|
193
194
|
.optional(),
|
|
194
195
|
email: zod_1.z
|
|
195
196
|
.string()
|
|
@@ -251,14 +252,14 @@ exports.createRiderSchema = zod_1.z.object({
|
|
|
251
252
|
.max(100, "Last name cannot exceed 100 characters"),
|
|
252
253
|
phoneNumber: zod_1.z
|
|
253
254
|
.string()
|
|
254
|
-
.regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
255
|
+
.regex(exports.phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
255
256
|
nationalId: zod_1.z
|
|
256
257
|
.string()
|
|
257
|
-
.regex(nationalIdRegex, "National ID must be 16 digits"),
|
|
258
|
+
.regex(exports.nationalIdRegex, "National ID must be 16 digits"),
|
|
258
259
|
plateNumber: zod_1.z.string().max(20, "Plate number cannot exceed 20 characters"),
|
|
259
260
|
jacketId: zod_1.z
|
|
260
261
|
.string()
|
|
261
|
-
.regex(jacketIdRegex, "jacketId required and must be of format JKT-"),
|
|
262
|
+
.regex(exports.jacketIdRegex, "jacketId required and must be of format JKT-"),
|
|
262
263
|
}),
|
|
263
264
|
params: zod_1.z.object({}).optional(),
|
|
264
265
|
query: zod_1.z.object({}).optional(),
|
|
@@ -280,16 +281,16 @@ exports.updateRiderProfileSchema = zod_1.z.object({
|
|
|
280
281
|
.max(100, "Last name cannot exceed 100 characters"),
|
|
281
282
|
phoneNumber: zod_1.z
|
|
282
283
|
.string()
|
|
283
|
-
.regex(phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
284
|
+
.regex(exports.phoneNumberRegex, "Phone number must be a valid Rwandan number (078/079/072/073) followed by 7 digits"),
|
|
284
285
|
nationalId: zod_1.z
|
|
285
286
|
.string()
|
|
286
|
-
.regex(nationalIdRegex, "National ID must be 16 digits"),
|
|
287
|
+
.regex(exports.nationalIdRegex, "National ID must be 16 digits"),
|
|
287
288
|
plateNumber: zod_1.z
|
|
288
289
|
.string()
|
|
289
290
|
.max(20, "Plate number cannot exceed 20 characters"),
|
|
290
291
|
jacketId: zod_1.z
|
|
291
292
|
.string()
|
|
292
|
-
.regex(jacketIdRegex, "jacketId required and must be of format JKT-"),
|
|
293
|
+
.regex(exports.jacketIdRegex, "jacketId required and must be of format JKT-"),
|
|
293
294
|
})
|
|
294
295
|
.refine((data) => Object.keys(data).length > 0, {
|
|
295
296
|
message: "At least one field must be provided for update",
|
|
@@ -356,3 +357,17 @@ exports.deleteAccountSchema = zod_1.z.object({
|
|
|
356
357
|
}),
|
|
357
358
|
}),
|
|
358
359
|
});
|
|
360
|
+
exports.updateProfileSchema = zod_1.z.object({
|
|
361
|
+
body: zod_1.z
|
|
362
|
+
.object({
|
|
363
|
+
firstName: zod_1.z.string().min(2).max(50).optional(),
|
|
364
|
+
lastName: zod_1.z.string().min(2).max(50).optional(),
|
|
365
|
+
phoneNumber: zod_1.z
|
|
366
|
+
.string()
|
|
367
|
+
.regex(exports.phoneRegex, "Invalid phone number")
|
|
368
|
+
.optional(),
|
|
369
|
+
email: zod_1.z.string().email("Invalid email").optional(),
|
|
370
|
+
nationalId: zod_1.z.string().min(5).max(20).optional(),
|
|
371
|
+
})
|
|
372
|
+
.strict(),
|
|
373
|
+
});
|