vr-commons 1.0.67 → 1.0.69
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.
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const updateProfileSchema: z.ZodObject<{
|
|
3
|
+
body: z.ZodObject<{
|
|
4
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
5
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
6
|
+
plateNumber: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
firstName?: string | undefined;
|
|
9
|
+
lastName?: string | undefined;
|
|
10
|
+
plateNumber?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
firstName?: string | undefined;
|
|
13
|
+
lastName?: string | undefined;
|
|
14
|
+
plateNumber?: string | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
body: {
|
|
18
|
+
firstName?: string | undefined;
|
|
19
|
+
lastName?: string | undefined;
|
|
20
|
+
plateNumber?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
body: {
|
|
24
|
+
firstName?: string | undefined;
|
|
25
|
+
lastName?: string | undefined;
|
|
26
|
+
plateNumber?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export declare const requestPhoneChangeSchema: z.ZodObject<{
|
|
30
|
+
body: z.ZodObject<{
|
|
31
|
+
newPhoneNumber: z.ZodString;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
newPhoneNumber: string;
|
|
34
|
+
}, {
|
|
35
|
+
newPhoneNumber: string;
|
|
36
|
+
}>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
body: {
|
|
39
|
+
newPhoneNumber: string;
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
body: {
|
|
43
|
+
newPhoneNumber: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
export declare const verifyPhoneChangeSchema: z.ZodObject<{
|
|
47
|
+
body: z.ZodObject<{
|
|
48
|
+
oldPhoneOtp: z.ZodString;
|
|
49
|
+
newPhoneOtp: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
oldPhoneOtp: string;
|
|
52
|
+
newPhoneOtp: string;
|
|
53
|
+
}, {
|
|
54
|
+
oldPhoneOtp: string;
|
|
55
|
+
newPhoneOtp: string;
|
|
56
|
+
}>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
body: {
|
|
59
|
+
oldPhoneOtp: string;
|
|
60
|
+
newPhoneOtp: string;
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
body: {
|
|
64
|
+
oldPhoneOtp: string;
|
|
65
|
+
newPhoneOtp: string;
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
export declare const deleteAccountSchema: z.ZodObject<{
|
|
69
|
+
body: z.ZodObject<{
|
|
70
|
+
confirmation: z.ZodLiteral<"DELETE">;
|
|
71
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
confirmation: "DELETE";
|
|
74
|
+
reason?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
confirmation: "DELETE";
|
|
77
|
+
reason?: string | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
body: {
|
|
81
|
+
confirmation: "DELETE";
|
|
82
|
+
reason?: string | undefined;
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
body: {
|
|
86
|
+
confirmation: "DELETE";
|
|
87
|
+
reason?: string | undefined;
|
|
88
|
+
};
|
|
89
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = void 0;
|
|
4
|
+
// src/modules/account/validations/account.schema.ts
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const phoneRegex = /^\+?[0-9]{10,15}$/;
|
|
7
|
+
const plateRegex = /^[A-Z0-9]{3,10}$/i;
|
|
8
|
+
exports.updateProfileSchema = zod_1.z.object({
|
|
9
|
+
body: zod_1.z.object({
|
|
10
|
+
firstName: zod_1.z.string().min(2).max(50).optional(),
|
|
11
|
+
lastName: zod_1.z.string().min(2).max(50).optional(),
|
|
12
|
+
plateNumber: zod_1.z
|
|
13
|
+
.string()
|
|
14
|
+
.regex(plateRegex, "Invalid plate number")
|
|
15
|
+
.optional(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
exports.requestPhoneChangeSchema = zod_1.z.object({
|
|
19
|
+
body: zod_1.z.object({
|
|
20
|
+
newPhoneNumber: zod_1.z.string().regex(phoneRegex, "Invalid phone number format"),
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
// Updated validation schema
|
|
24
|
+
exports.verifyPhoneChangeSchema = zod_1.z.object({
|
|
25
|
+
body: zod_1.z.object({
|
|
26
|
+
oldPhoneOtp: zod_1.z.string().length(6, "Old phone OTP must be 6 digits"),
|
|
27
|
+
newPhoneOtp: zod_1.z.string().length(6, "New phone OTP must be 6 digits"),
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
exports.deleteAccountSchema = zod_1.z.object({
|
|
31
|
+
body: zod_1.z.object({
|
|
32
|
+
confirmation: zod_1.z.literal("DELETE", {
|
|
33
|
+
errorMap: () => ({ message: 'Type "DELETE" to confirm' }),
|
|
34
|
+
}),
|
|
35
|
+
reason: zod_1.z.string().max(500).optional(),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
@@ -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, changePasswordSchema, deactivateAccountSchema,
|
|
3
|
+
export { createUserSchema, getUserByIdSchema, updateUserProfileSchema, getAllUsersSchema, viewProfileSchema, passengerSignupSchema, updatePassengerProfileSchema, updateRiderProfileSchema, createRiderSchema, changePasswordSchema, 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,3 +9,4 @@ 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";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.payInstallmentSchema = exports.extendSessionSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = exports.getAppSpecsSchema = exports.activateAppSpecsSchema = exports.getActiveAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = exports.createSuspensionSchema = exports.getUserSuspensionsSchema = exports.getSuspensionSchema = exports.createBanSchema = exports.getUserRestrictionsSchema = exports.getBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.exportBansSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.reviewAppealSchema = exports.listSuspensionsSchema = exports.listPendingAppealsSchema = exports.listBansSchema = exports.
|
|
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.changePasswordSchema = 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.deleteAccountSchema = void 0;
|
|
4
5
|
var validate_validations_1 = require("./validate.validations");
|
|
5
6
|
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
|
|
6
7
|
var auth_validations_1 = require("./auth.validations");
|
|
@@ -29,8 +30,6 @@ Object.defineProperty(exports, "createRiderSchema", { enumerable: true, get: fun
|
|
|
29
30
|
// Account Management Schemas
|
|
30
31
|
Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return profiles_validations_1.changePasswordSchema; } });
|
|
31
32
|
Object.defineProperty(exports, "deactivateAccountSchema", { enumerable: true, get: function () { return profiles_validations_1.deactivateAccountSchema; } });
|
|
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; } });
|
|
34
33
|
var moderation_validations_1 = require("./moderation.validations");
|
|
35
34
|
Object.defineProperty(exports, "listBansSchema", { enumerable: true, get: function () { return moderation_validations_1.listBansSchema; } });
|
|
36
35
|
Object.defineProperty(exports, "listPendingAppealsSchema", { enumerable: true, get: function () { return moderation_validations_1.listPendingAppealsSchema; } });
|
|
@@ -66,3 +65,8 @@ Object.defineProperty(exports, "unlockDeviceSchema", { enumerable: true, get: fu
|
|
|
66
65
|
Object.defineProperty(exports, "extendSessionSchema", { enumerable: true, get: function () { return devices_validations_1.extendSessionSchema; } });
|
|
67
66
|
var payinstallment_validations_1 = require("./payinstallment.validations");
|
|
68
67
|
Object.defineProperty(exports, "payInstallmentSchema", { enumerable: true, get: function () { return payinstallment_validations_1.payInstallmentSchema; } });
|
|
68
|
+
var account_validations_1 = require("./account.validations");
|
|
69
|
+
Object.defineProperty(exports, "updateProfileSchema", { enumerable: true, get: function () { return account_validations_1.updateProfileSchema; } });
|
|
70
|
+
Object.defineProperty(exports, "requestPhoneChangeSchema", { enumerable: true, get: function () { return account_validations_1.requestPhoneChangeSchema; } });
|
|
71
|
+
Object.defineProperty(exports, "verifyPhoneChangeSchema", { enumerable: true, get: function () { return account_validations_1.verifyPhoneChangeSchema; } });
|
|
72
|
+
Object.defineProperty(exports, "deleteAccountSchema", { enumerable: true, get: function () { return account_validations_1.deleteAccountSchema; } });
|