vr-commons 1.0.75 → 1.0.77
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/middlewares/index.d.ts +1 -1
- package/dist/middlewares/index.js +2 -1
- package/dist/validations/account.validations.d.ts +23 -0
- package/dist/validations/account.validations.js +10 -1
- package/dist/validations/index.d.ts +2 -2
- package/dist/validations/index.js +4 -3
- package/dist/validations/profiles.validations.d.ts +59 -98
- package/dist/validations/profiles.validations.js +1 -17
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { checkUserAuthentication } from "./auth.middlewares";
|
|
1
|
+
export { checkUserAuthentication, checkAdminAuthentication, } from "./auth.middlewares";
|
|
2
2
|
export { checkUserAccountStatus, checkIsUserBanned, checkIsUserSuspended, } from "./account.middlewares";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkIsUserSuspended = exports.checkIsUserBanned = exports.checkUserAccountStatus = exports.checkUserAuthentication = void 0;
|
|
3
|
+
exports.checkIsUserSuspended = exports.checkIsUserBanned = exports.checkUserAccountStatus = exports.checkAdminAuthentication = exports.checkUserAuthentication = void 0;
|
|
4
4
|
var auth_middlewares_1 = require("./auth.middlewares");
|
|
5
5
|
Object.defineProperty(exports, "checkUserAuthentication", { enumerable: true, get: function () { return auth_middlewares_1.checkUserAuthentication; } });
|
|
6
|
+
Object.defineProperty(exports, "checkAdminAuthentication", { enumerable: true, get: function () { return auth_middlewares_1.checkAdminAuthentication; } });
|
|
6
7
|
var account_middlewares_1 = require("./account.middlewares");
|
|
7
8
|
Object.defineProperty(exports, "checkUserAccountStatus", { enumerable: true, get: function () { return account_middlewares_1.checkUserAccountStatus; } });
|
|
8
9
|
Object.defineProperty(exports, "checkIsUserBanned", { enumerable: true, get: function () { return account_middlewares_1.checkIsUserBanned; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const phoneRegex: RegExp;
|
|
3
|
+
export declare const strongPasswordRegex: RegExp;
|
|
3
4
|
export declare const updateProfileSchema: z.ZodObject<{
|
|
4
5
|
body: z.ZodObject<{
|
|
5
6
|
firstName: z.ZodOptional<z.ZodString>;
|
|
@@ -88,3 +89,25 @@ export declare const deleteAccountSchema: z.ZodObject<{
|
|
|
88
89
|
reason?: string | undefined;
|
|
89
90
|
};
|
|
90
91
|
}>;
|
|
92
|
+
export declare const changePasswordSchema: z.ZodObject<{
|
|
93
|
+
body: z.ZodObject<{
|
|
94
|
+
oldPassword: z.ZodString;
|
|
95
|
+
newPassword: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
oldPassword: string;
|
|
98
|
+
newPassword: string;
|
|
99
|
+
}, {
|
|
100
|
+
oldPassword: string;
|
|
101
|
+
newPassword: string;
|
|
102
|
+
}>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
body: {
|
|
105
|
+
oldPassword: string;
|
|
106
|
+
newPassword: string;
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
body: {
|
|
110
|
+
oldPassword: string;
|
|
111
|
+
newPassword: string;
|
|
112
|
+
};
|
|
113
|
+
}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = exports.phoneRegex = void 0;
|
|
3
|
+
exports.changePasswordSchema = exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = exports.strongPasswordRegex = exports.phoneRegex = void 0;
|
|
4
4
|
// src/modules/account/validations/account.schema.ts
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.phoneRegex = /^\+250(78|79|73|72)[0-9]{7}$/;
|
|
7
7
|
const plateRegex = /^[A-Z0-9]{3,10}$/i;
|
|
8
|
+
exports.strongPasswordRegex = /^(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#^()_\-+=])[A-Za-z\d@$!%*?&#^()_\-+=]{8,}$/;
|
|
8
9
|
exports.updateProfileSchema = zod_1.z.object({
|
|
9
10
|
body: zod_1.z.object({
|
|
10
11
|
firstName: zod_1.z.string().min(2).max(50).optional(),
|
|
@@ -35,3 +36,11 @@ exports.deleteAccountSchema = zod_1.z.object({
|
|
|
35
36
|
reason: zod_1.z.string().max(500).optional(),
|
|
36
37
|
}),
|
|
37
38
|
});
|
|
39
|
+
exports.changePasswordSchema = zod_1.z.object({
|
|
40
|
+
body: zod_1.z.object({
|
|
41
|
+
oldPassword: zod_1.z.string().min(1, "Old password is required"),
|
|
42
|
+
newPassword: zod_1.z
|
|
43
|
+
.string()
|
|
44
|
+
.regex(exports.strongPasswordRegex, "Password must be at least 8 characters, include 1 uppercase letter, 1 number and 1 symbol"),
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { validate } from "./validate.validations";
|
|
2
2
|
export { riderLoginSchema, forgotPasswordSchema, userLoginSchema, refreshTokenSchema, registerSchema, verifyOtpSchema, resendOtpSchema, requestOtpSchema, } from "./auth.validations";
|
|
3
|
-
export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema,
|
|
3
|
+
export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema, deactivateAccountSchema, } 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";
|
|
@@ -9,5 +9,5 @@ export { createAppSpecsSchema, updateAppSpecsSchema, listAppSpecsSchema, getActi
|
|
|
9
9
|
export { listUserPaymentPlansSchema, getUserPaymentPlanSchema, } from "./devicePaymentPlan.validations";
|
|
10
10
|
export { unlockDeviceSchema, extendSessionSchema } from "./devices.validations";
|
|
11
11
|
export { payInstallmentSchema } from "./payinstallment.validations";
|
|
12
|
-
export { updateProfileSchema, requestPhoneChangeSchema, verifyPhoneChangeSchema, deleteAccountSchema, } from "./account.validations";
|
|
12
|
+
export { updateProfileSchema, requestPhoneChangeSchema, verifyPhoneChangeSchema, deleteAccountSchema, strongPasswordRegex, changePasswordSchema, } from "./account.validations";
|
|
13
13
|
export { upgradeToRiderSchema } from "./user.management.validations";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.
|
|
4
|
-
exports.upgradeToRiderSchema = exports.
|
|
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.upgradeToRiderSchema = 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");
|
|
@@ -28,7 +28,6 @@ Object.defineProperty(exports, "updatePassengerProfileSchema", { enumerable: tru
|
|
|
28
28
|
Object.defineProperty(exports, "updateRiderProfileSchema", { enumerable: true, get: function () { return profiles_validations_1.updateRiderProfileSchema; } });
|
|
29
29
|
Object.defineProperty(exports, "createRiderSchema", { enumerable: true, get: function () { return profiles_validations_1.createRiderSchema; } });
|
|
30
30
|
// Account Management Schemas
|
|
31
|
-
Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return profiles_validations_1.changePasswordSchema; } });
|
|
32
31
|
Object.defineProperty(exports, "deactivateAccountSchema", { enumerable: true, get: function () { return profiles_validations_1.deactivateAccountSchema; } });
|
|
33
32
|
var moderation_validations_1 = require("./moderation.validations");
|
|
34
33
|
Object.defineProperty(exports, "listBansSchema", { enumerable: true, get: function () { return moderation_validations_1.listBansSchema; } });
|
|
@@ -70,5 +69,7 @@ Object.defineProperty(exports, "updateProfileSchema", { enumerable: true, get: f
|
|
|
70
69
|
Object.defineProperty(exports, "requestPhoneChangeSchema", { enumerable: true, get: function () { return account_validations_1.requestPhoneChangeSchema; } });
|
|
71
70
|
Object.defineProperty(exports, "verifyPhoneChangeSchema", { enumerable: true, get: function () { return account_validations_1.verifyPhoneChangeSchema; } });
|
|
72
71
|
Object.defineProperty(exports, "deleteAccountSchema", { enumerable: true, get: function () { return account_validations_1.deleteAccountSchema; } });
|
|
72
|
+
Object.defineProperty(exports, "strongPasswordRegex", { enumerable: true, get: function () { return account_validations_1.strongPasswordRegex; } });
|
|
73
|
+
Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return account_validations_1.changePasswordSchema; } });
|
|
73
74
|
var user_management_validations_1 = require("./user.management.validations");
|
|
74
75
|
Object.defineProperty(exports, "upgradeToRiderSchema", { enumerable: true, get: function () { return user_management_validations_1.upgradeToRiderSchema; } });
|
|
@@ -14,21 +14,21 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
14
14
|
plateNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
15
15
|
jacketId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
16
|
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
firstName: string;
|
|
18
|
+
lastName: string;
|
|
17
19
|
phoneNumber: string;
|
|
18
20
|
nationalId: string;
|
|
19
21
|
password: string;
|
|
20
|
-
firstName: string;
|
|
21
|
-
lastName: string;
|
|
22
22
|
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
23
23
|
email?: string | null | undefined;
|
|
24
24
|
plateNumber?: string | null | undefined;
|
|
25
25
|
jacketId?: string | null | undefined;
|
|
26
26
|
}, {
|
|
27
|
+
firstName: string;
|
|
28
|
+
lastName: string;
|
|
27
29
|
phoneNumber: string;
|
|
28
30
|
nationalId: string;
|
|
29
31
|
password: string;
|
|
30
|
-
firstName: string;
|
|
31
|
-
lastName: string;
|
|
32
32
|
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
33
33
|
email?: string | null | undefined;
|
|
34
34
|
plateNumber?: string | null | undefined;
|
|
@@ -43,11 +43,11 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
43
43
|
}>;
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
45
|
body: {
|
|
46
|
+
firstName: string;
|
|
47
|
+
lastName: string;
|
|
46
48
|
phoneNumber: string;
|
|
47
49
|
nationalId: string;
|
|
48
50
|
password: string;
|
|
49
|
-
firstName: string;
|
|
50
|
-
lastName: string;
|
|
51
51
|
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
52
52
|
email?: string | null | undefined;
|
|
53
53
|
plateNumber?: string | null | undefined;
|
|
@@ -58,11 +58,11 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
58
58
|
};
|
|
59
59
|
}, {
|
|
60
60
|
body: {
|
|
61
|
+
firstName: string;
|
|
62
|
+
lastName: string;
|
|
61
63
|
phoneNumber: string;
|
|
62
64
|
nationalId: string;
|
|
63
65
|
password: string;
|
|
64
|
-
firstName: string;
|
|
65
|
-
lastName: string;
|
|
66
66
|
role: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN";
|
|
67
67
|
email?: string | null | undefined;
|
|
68
68
|
plateNumber?: string | null | undefined;
|
|
@@ -121,41 +121,41 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
121
121
|
isDeactivated: z.ZodOptional<z.ZodBoolean>;
|
|
122
122
|
password: z.ZodOptional<z.ZodString>;
|
|
123
123
|
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
firstName?: string | undefined;
|
|
125
|
+
lastName?: string | undefined;
|
|
124
126
|
phoneNumber?: string | undefined;
|
|
125
127
|
email?: string | null | undefined;
|
|
126
128
|
password?: string | undefined;
|
|
127
|
-
firstName?: string | undefined;
|
|
128
|
-
lastName?: string | undefined;
|
|
129
129
|
plateNumber?: string | null | undefined;
|
|
130
130
|
isActive?: boolean | undefined;
|
|
131
131
|
isSuspended?: boolean | undefined;
|
|
132
132
|
isDeactivated?: boolean | undefined;
|
|
133
133
|
}, {
|
|
134
|
+
firstName?: string | undefined;
|
|
135
|
+
lastName?: string | undefined;
|
|
134
136
|
phoneNumber?: string | undefined;
|
|
135
137
|
email?: string | null | undefined;
|
|
136
138
|
password?: string | undefined;
|
|
137
|
-
firstName?: string | undefined;
|
|
138
|
-
lastName?: string | undefined;
|
|
139
139
|
plateNumber?: string | null | undefined;
|
|
140
140
|
isActive?: boolean | undefined;
|
|
141
141
|
isSuspended?: boolean | undefined;
|
|
142
142
|
isDeactivated?: boolean | undefined;
|
|
143
143
|
}>, {
|
|
144
|
+
firstName?: string | undefined;
|
|
145
|
+
lastName?: string | undefined;
|
|
144
146
|
phoneNumber?: string | undefined;
|
|
145
147
|
email?: string | null | undefined;
|
|
146
148
|
password?: string | undefined;
|
|
147
|
-
firstName?: string | undefined;
|
|
148
|
-
lastName?: string | undefined;
|
|
149
149
|
plateNumber?: string | null | undefined;
|
|
150
150
|
isActive?: boolean | undefined;
|
|
151
151
|
isSuspended?: boolean | undefined;
|
|
152
152
|
isDeactivated?: boolean | undefined;
|
|
153
153
|
}, {
|
|
154
|
+
firstName?: string | undefined;
|
|
155
|
+
lastName?: string | undefined;
|
|
154
156
|
phoneNumber?: string | undefined;
|
|
155
157
|
email?: string | null | undefined;
|
|
156
158
|
password?: string | undefined;
|
|
157
|
-
firstName?: string | undefined;
|
|
158
|
-
lastName?: string | undefined;
|
|
159
159
|
plateNumber?: string | null | undefined;
|
|
160
160
|
isActive?: boolean | undefined;
|
|
161
161
|
isSuspended?: boolean | undefined;
|
|
@@ -173,11 +173,11 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
173
173
|
userId: string;
|
|
174
174
|
};
|
|
175
175
|
body: {
|
|
176
|
+
firstName?: string | undefined;
|
|
177
|
+
lastName?: string | undefined;
|
|
176
178
|
phoneNumber?: string | undefined;
|
|
177
179
|
email?: string | null | undefined;
|
|
178
180
|
password?: string | undefined;
|
|
179
|
-
firstName?: string | undefined;
|
|
180
|
-
lastName?: string | undefined;
|
|
181
181
|
plateNumber?: string | null | undefined;
|
|
182
182
|
isActive?: boolean | undefined;
|
|
183
183
|
isSuspended?: boolean | undefined;
|
|
@@ -191,11 +191,11 @@ export declare const updateUserProfileSchema: z.ZodObject<{
|
|
|
191
191
|
userId: string;
|
|
192
192
|
};
|
|
193
193
|
body: {
|
|
194
|
+
firstName?: string | undefined;
|
|
195
|
+
lastName?: string | undefined;
|
|
194
196
|
phoneNumber?: string | undefined;
|
|
195
197
|
email?: string | null | undefined;
|
|
196
198
|
password?: string | undefined;
|
|
197
|
-
firstName?: string | undefined;
|
|
198
|
-
lastName?: string | undefined;
|
|
199
199
|
plateNumber?: string | null | undefined;
|
|
200
200
|
isActive?: boolean | undefined;
|
|
201
201
|
isSuspended?: boolean | undefined;
|
|
@@ -251,6 +251,9 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
251
251
|
authorization: string;
|
|
252
252
|
}>;
|
|
253
253
|
}, "strip", z.ZodTypeAny, {
|
|
254
|
+
headers: {
|
|
255
|
+
authorization: string;
|
|
256
|
+
};
|
|
254
257
|
query: {
|
|
255
258
|
sortBy: "firstName" | "lastLoginAt" | "createdAt";
|
|
256
259
|
order: "asc" | "desc";
|
|
@@ -264,10 +267,10 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
264
267
|
startDate?: string | undefined;
|
|
265
268
|
endDate?: string | undefined;
|
|
266
269
|
};
|
|
270
|
+
}, {
|
|
267
271
|
headers: {
|
|
268
272
|
authorization: string;
|
|
269
273
|
};
|
|
270
|
-
}, {
|
|
271
274
|
query: {
|
|
272
275
|
role?: "AGENT" | "RIDER" | "PASSENGER" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
273
276
|
isActive?: "true" | "false" | undefined;
|
|
@@ -281,9 +284,6 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
281
284
|
sortBy?: "firstName" | "lastLoginAt" | "createdAt" | undefined;
|
|
282
285
|
order?: "asc" | "desc" | undefined;
|
|
283
286
|
};
|
|
284
|
-
headers: {
|
|
285
|
-
authorization: string;
|
|
286
|
-
};
|
|
287
287
|
}>;
|
|
288
288
|
export declare const viewProfileSchema: z.ZodObject<{
|
|
289
289
|
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
@@ -322,19 +322,19 @@ export declare const passengerSignupSchema: z.ZodObject<{
|
|
|
322
322
|
password: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
323
323
|
plateNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
324
324
|
}, "strip", z.ZodTypeAny, {
|
|
325
|
-
phoneNumber: string;
|
|
326
|
-
nationalId: string;
|
|
327
325
|
firstName: string;
|
|
328
326
|
lastName: string;
|
|
327
|
+
phoneNumber: string;
|
|
328
|
+
nationalId: string;
|
|
329
329
|
email?: string | null | undefined;
|
|
330
330
|
password?: string | null | undefined;
|
|
331
331
|
plateNumber?: string | null | undefined;
|
|
332
332
|
jacketId?: string | undefined;
|
|
333
333
|
}, {
|
|
334
|
-
phoneNumber: string;
|
|
335
|
-
nationalId: string;
|
|
336
334
|
firstName: string;
|
|
337
335
|
lastName: string;
|
|
336
|
+
phoneNumber: string;
|
|
337
|
+
nationalId: string;
|
|
338
338
|
email?: string | null | undefined;
|
|
339
339
|
password?: string | null | undefined;
|
|
340
340
|
plateNumber?: string | null | undefined;
|
|
@@ -343,10 +343,10 @@ export declare const passengerSignupSchema: z.ZodObject<{
|
|
|
343
343
|
headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
344
344
|
}, "strip", z.ZodTypeAny, {
|
|
345
345
|
body: {
|
|
346
|
-
phoneNumber: string;
|
|
347
|
-
nationalId: string;
|
|
348
346
|
firstName: string;
|
|
349
347
|
lastName: string;
|
|
348
|
+
phoneNumber: string;
|
|
349
|
+
nationalId: string;
|
|
350
350
|
email?: string | null | undefined;
|
|
351
351
|
password?: string | null | undefined;
|
|
352
352
|
plateNumber?: string | null | undefined;
|
|
@@ -355,10 +355,10 @@ export declare const passengerSignupSchema: z.ZodObject<{
|
|
|
355
355
|
headers?: {} | undefined;
|
|
356
356
|
}, {
|
|
357
357
|
body: {
|
|
358
|
-
phoneNumber: string;
|
|
359
|
-
nationalId: string;
|
|
360
358
|
firstName: string;
|
|
361
359
|
lastName: string;
|
|
360
|
+
phoneNumber: string;
|
|
361
|
+
nationalId: string;
|
|
362
362
|
email?: string | null | undefined;
|
|
363
363
|
password?: string | null | undefined;
|
|
364
364
|
plateNumber?: string | null | undefined;
|
|
@@ -419,17 +419,17 @@ export declare const createRiderSchema: z.ZodObject<{
|
|
|
419
419
|
plateNumber: z.ZodString;
|
|
420
420
|
jacketId: z.ZodString;
|
|
421
421
|
}, "strip", z.ZodTypeAny, {
|
|
422
|
-
phoneNumber: string;
|
|
423
|
-
nationalId: string;
|
|
424
422
|
firstName: string;
|
|
425
423
|
lastName: string;
|
|
424
|
+
phoneNumber: string;
|
|
425
|
+
nationalId: string;
|
|
426
426
|
plateNumber: string;
|
|
427
427
|
jacketId: string;
|
|
428
428
|
}, {
|
|
429
|
-
phoneNumber: string;
|
|
430
|
-
nationalId: string;
|
|
431
429
|
firstName: string;
|
|
432
430
|
lastName: string;
|
|
431
|
+
phoneNumber: string;
|
|
432
|
+
nationalId: string;
|
|
433
433
|
plateNumber: string;
|
|
434
434
|
jacketId: string;
|
|
435
435
|
}>;
|
|
@@ -437,10 +437,10 @@ export declare const createRiderSchema: z.ZodObject<{
|
|
|
437
437
|
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
438
438
|
}, "strip", z.ZodTypeAny, {
|
|
439
439
|
body: {
|
|
440
|
-
phoneNumber: string;
|
|
441
|
-
nationalId: string;
|
|
442
440
|
firstName: string;
|
|
443
441
|
lastName: string;
|
|
442
|
+
phoneNumber: string;
|
|
443
|
+
nationalId: string;
|
|
444
444
|
plateNumber: string;
|
|
445
445
|
jacketId: string;
|
|
446
446
|
};
|
|
@@ -448,10 +448,10 @@ export declare const createRiderSchema: z.ZodObject<{
|
|
|
448
448
|
query?: {} | undefined;
|
|
449
449
|
}, {
|
|
450
450
|
body: {
|
|
451
|
-
phoneNumber: string;
|
|
452
|
-
nationalId: string;
|
|
453
451
|
firstName: string;
|
|
454
452
|
lastName: string;
|
|
453
|
+
phoneNumber: string;
|
|
454
|
+
nationalId: string;
|
|
455
455
|
plateNumber: string;
|
|
456
456
|
jacketId: string;
|
|
457
457
|
};
|
|
@@ -474,31 +474,31 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
|
474
474
|
plateNumber: z.ZodString;
|
|
475
475
|
jacketId: z.ZodString;
|
|
476
476
|
}, "strip", z.ZodTypeAny, {
|
|
477
|
-
phoneNumber: string;
|
|
478
|
-
nationalId: string;
|
|
479
477
|
firstName: string;
|
|
480
478
|
lastName: string;
|
|
479
|
+
phoneNumber: string;
|
|
480
|
+
nationalId: string;
|
|
481
481
|
plateNumber: string;
|
|
482
482
|
jacketId: string;
|
|
483
483
|
}, {
|
|
484
|
-
phoneNumber: string;
|
|
485
|
-
nationalId: string;
|
|
486
484
|
firstName: string;
|
|
487
485
|
lastName: string;
|
|
486
|
+
phoneNumber: string;
|
|
487
|
+
nationalId: string;
|
|
488
488
|
plateNumber: string;
|
|
489
489
|
jacketId: string;
|
|
490
490
|
}>, {
|
|
491
|
-
phoneNumber: string;
|
|
492
|
-
nationalId: string;
|
|
493
491
|
firstName: string;
|
|
494
492
|
lastName: string;
|
|
493
|
+
phoneNumber: string;
|
|
494
|
+
nationalId: string;
|
|
495
495
|
plateNumber: string;
|
|
496
496
|
jacketId: string;
|
|
497
497
|
}, {
|
|
498
|
-
phoneNumber: string;
|
|
499
|
-
nationalId: string;
|
|
500
498
|
firstName: string;
|
|
501
499
|
lastName: string;
|
|
500
|
+
phoneNumber: string;
|
|
501
|
+
nationalId: string;
|
|
502
502
|
plateNumber: string;
|
|
503
503
|
jacketId: string;
|
|
504
504
|
}>;
|
|
@@ -515,10 +515,10 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
|
515
515
|
id: string;
|
|
516
516
|
};
|
|
517
517
|
body: {
|
|
518
|
-
phoneNumber: string;
|
|
519
|
-
nationalId: string;
|
|
520
518
|
firstName: string;
|
|
521
519
|
lastName: string;
|
|
520
|
+
phoneNumber: string;
|
|
521
|
+
nationalId: string;
|
|
522
522
|
plateNumber: string;
|
|
523
523
|
jacketId: string;
|
|
524
524
|
};
|
|
@@ -531,10 +531,10 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
|
531
531
|
id: string;
|
|
532
532
|
};
|
|
533
533
|
body: {
|
|
534
|
-
phoneNumber: string;
|
|
535
|
-
nationalId: string;
|
|
536
534
|
firstName: string;
|
|
537
535
|
lastName: string;
|
|
536
|
+
phoneNumber: string;
|
|
537
|
+
nationalId: string;
|
|
538
538
|
plateNumber: string;
|
|
539
539
|
jacketId: string;
|
|
540
540
|
};
|
|
@@ -543,44 +543,6 @@ export declare const updateRiderProfileSchema: z.ZodObject<{
|
|
|
543
543
|
};
|
|
544
544
|
query?: {} | undefined;
|
|
545
545
|
}>;
|
|
546
|
-
export declare const changePasswordSchema: z.ZodObject<{
|
|
547
|
-
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
548
|
-
body: z.ZodObject<{
|
|
549
|
-
currentPassword: z.ZodString;
|
|
550
|
-
newPassword: z.ZodString;
|
|
551
|
-
}, "strip", z.ZodTypeAny, {
|
|
552
|
-
currentPassword: string;
|
|
553
|
-
newPassword: string;
|
|
554
|
-
}, {
|
|
555
|
-
currentPassword: string;
|
|
556
|
-
newPassword: string;
|
|
557
|
-
}>;
|
|
558
|
-
headers: z.ZodObject<{
|
|
559
|
-
authorization: z.ZodString;
|
|
560
|
-
}, "strip", z.ZodTypeAny, {
|
|
561
|
-
authorization: string;
|
|
562
|
-
}, {
|
|
563
|
-
authorization: string;
|
|
564
|
-
}>;
|
|
565
|
-
}, "strip", z.ZodTypeAny, {
|
|
566
|
-
body: {
|
|
567
|
-
currentPassword: string;
|
|
568
|
-
newPassword: string;
|
|
569
|
-
};
|
|
570
|
-
headers: {
|
|
571
|
-
authorization: string;
|
|
572
|
-
};
|
|
573
|
-
params?: {} | undefined;
|
|
574
|
-
}, {
|
|
575
|
-
body: {
|
|
576
|
-
currentPassword: string;
|
|
577
|
-
newPassword: string;
|
|
578
|
-
};
|
|
579
|
-
headers: {
|
|
580
|
-
authorization: string;
|
|
581
|
-
};
|
|
582
|
-
params?: {} | undefined;
|
|
583
|
-
}>;
|
|
584
546
|
export declare const deactivateAccountSchema: z.ZodObject<{
|
|
585
547
|
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
586
548
|
body: z.ZodObject<{
|
|
@@ -665,33 +627,33 @@ export declare const updateProfileSchema: z.ZodObject<{
|
|
|
665
627
|
email: z.ZodOptional<z.ZodString>;
|
|
666
628
|
nationalId: z.ZodOptional<z.ZodString>;
|
|
667
629
|
}, "strict", z.ZodTypeAny, {
|
|
630
|
+
firstName?: string | undefined;
|
|
631
|
+
lastName?: string | undefined;
|
|
668
632
|
phoneNumber?: string | undefined;
|
|
669
633
|
nationalId?: string | undefined;
|
|
670
634
|
email?: string | undefined;
|
|
635
|
+
}, {
|
|
671
636
|
firstName?: string | undefined;
|
|
672
637
|
lastName?: string | undefined;
|
|
673
|
-
}, {
|
|
674
638
|
phoneNumber?: string | undefined;
|
|
675
639
|
nationalId?: string | undefined;
|
|
676
640
|
email?: string | undefined;
|
|
677
|
-
firstName?: string | undefined;
|
|
678
|
-
lastName?: string | undefined;
|
|
679
641
|
}>;
|
|
680
642
|
}, "strip", z.ZodTypeAny, {
|
|
681
643
|
body: {
|
|
644
|
+
firstName?: string | undefined;
|
|
645
|
+
lastName?: string | undefined;
|
|
682
646
|
phoneNumber?: string | undefined;
|
|
683
647
|
nationalId?: string | undefined;
|
|
684
648
|
email?: string | undefined;
|
|
685
|
-
firstName?: string | undefined;
|
|
686
|
-
lastName?: string | undefined;
|
|
687
649
|
};
|
|
688
650
|
}, {
|
|
689
651
|
body: {
|
|
652
|
+
firstName?: string | undefined;
|
|
653
|
+
lastName?: string | undefined;
|
|
690
654
|
phoneNumber?: string | undefined;
|
|
691
655
|
nationalId?: string | undefined;
|
|
692
656
|
email?: string | undefined;
|
|
693
|
-
firstName?: string | undefined;
|
|
694
|
-
lastName?: string | undefined;
|
|
695
657
|
};
|
|
696
658
|
}>;
|
|
697
659
|
export type CreateUserInput = z.infer<typeof createUserSchema>;
|
|
@@ -703,6 +665,5 @@ export type PassengerSignupInput = z.infer<typeof passengerSignupSchema>;
|
|
|
703
665
|
export type UpdatePassengerProfileInput = z.infer<typeof updatePassengerProfileSchema>;
|
|
704
666
|
export type CreateRiderInput = z.infer<typeof createRiderSchema>;
|
|
705
667
|
export type UpdateRiderProfileInput = z.infer<typeof updateRiderProfileSchema>;
|
|
706
|
-
export type ChangePasswordInput = z.infer<typeof changePasswordSchema>;
|
|
707
668
|
export type DeactivateAccountInput = z.infer<typeof deactivateAccountSchema>;
|
|
708
669
|
export type DeleteAccountInput = z.infer<typeof deleteAccountSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.
|
|
3
|
+
exports.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.updateRiderProfileSchema = exports.createRiderSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.jacketIdRegex = exports.nationalIdRegex = exports.phoneNumberRegex = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ============================================================================
|
|
6
6
|
// COMMON VALIDATIONS
|
|
@@ -305,22 +305,6 @@ exports.updateRiderProfileSchema = zod_1.z.object({
|
|
|
305
305
|
// ============================================================================
|
|
306
306
|
// ACCOUNT MANAGEMENT SCHEMAS
|
|
307
307
|
// ============================================================================
|
|
308
|
-
// Change Password Schema
|
|
309
|
-
exports.changePasswordSchema = zod_1.z.object({
|
|
310
|
-
params: zod_1.z.object({}).optional(),
|
|
311
|
-
body: zod_1.z.object({
|
|
312
|
-
currentPassword: zod_1.z.string().min(1, "Current password is required"),
|
|
313
|
-
newPassword: zod_1.z
|
|
314
|
-
.string()
|
|
315
|
-
.min(6, "New password must be at least 6 characters")
|
|
316
|
-
.max(100, "New password cannot exceed 100 characters"),
|
|
317
|
-
}),
|
|
318
|
-
headers: zod_1.z.object({
|
|
319
|
-
authorization: zod_1.z.string().regex(/^Bearer /, {
|
|
320
|
-
message: "Authorization header must start with 'Bearer '",
|
|
321
|
-
}),
|
|
322
|
-
}),
|
|
323
|
-
});
|
|
324
308
|
// Deactivate Account Schema
|
|
325
309
|
exports.deactivateAccountSchema = zod_1.z.object({
|
|
326
310
|
params: zod_1.z.object({}).optional(),
|