vr-commons 1.0.176 → 1.0.177
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/constants/regex.constants.d.ts +19 -0
- package/dist/constants/regex.constants.js +24 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/middlewares/admin/admin.auth.middleware.js +60 -0
- package/dist/middlewares/index.d.ts +4 -5
- package/dist/middlewares/index.js +11 -14
- package/dist/middlewares/shared/auth.admin.middlewares.d.ts +3 -0
- package/dist/middlewares/{auth.admin.middlewares.js → shared/auth.admin.middlewares.js} +7 -7
- package/dist/middlewares/{account.shared.middlewares.js → shared/shared.account.middleware.js} +8 -8
- package/dist/middlewares/{errorHandler.middleware.js → shared/shared.errorHandler.middleware.js} +0 -1
- package/dist/middlewares/{auth.users.middlewares.js → users/users.auth.middleware.js} +10 -10
- package/dist/utils/{admin.devicePayment.utils.js → admin/admin.devicePayments.utils.js} +0 -1
- package/dist/utils/{admin.device.utils.d.ts → admin/admin.devices.utils.d.ts} +1 -1
- package/dist/utils/{admin.device.utils.js → admin/admin.devices.utils.js} +11 -12
- package/dist/utils/{eventlogs.admin.utils.js → admin/admin.eventLogs.utils.js} +0 -1
- package/dist/utils/{hierarchy.utils.js → admin/admin.hierarchy.utils.js} +0 -2
- package/dist/utils/{product.utils.d.ts → admin/admin.products.utils.d.ts} +1 -1
- package/dist/utils/{systemLog.utils.js → admin/admin.systemLogs.utils.js} +0 -1
- package/dist/utils/index.d.ts +16 -18
- package/dist/utils/index.js +88 -99
- package/dist/utils/{account.utils.js → shared/shared.accounts.utils.js} +0 -1
- package/dist/utils/{profiles.utils.d.ts → shared/shared.profiles.utils.d.ts} +2 -1
- package/dist/utils/{profiles.utils.js → shared/shared.profiles.utils.js} +3 -2
- package/dist/utils/{verification.utils.d.ts → users/users.verification.utils.d.ts} +1 -1
- package/dist/utils/{verification.utils.js → users/users.verification.utils.js} +3 -2
- package/dist/validations/{admin.devicePayment.validations.js → admin/admin.devicePayments.validations.js} +3 -2
- package/dist/validations/{admin.devices.validations.js → admin/admin.devices.validations.js} +4 -5
- package/dist/validations/{eventlogs.admin.validations.js → admin/admin.eventLogs.validations.js} +2 -2
- package/dist/validations/{admin.installment.validations.js → admin/admin.installments.validations.js} +4 -3
- package/dist/validations/{pricings.validations.js → admin/admin.pricings.validations.js} +5 -5
- package/dist/validations/{product.validations.js → admin/admin.products.validations.js} +4 -3
- package/dist/validations/{users.admin.validations.js → admin/admin.users.validations.js} +13 -13
- package/dist/validations/index.d.ts +16 -15
- package/dist/validations/index.js +132 -125
- package/dist/validations/{account.validations.js → shared/shared.account.validations.js} +7 -7
- package/dist/validations/{appSpecs.validations.js → shared/shared.appSpecs.validations.js} +0 -1
- package/dist/validations/{auth.validations.js → shared/shared.auth.validations.js} +6 -6
- package/dist/validations/{dateRange.validations.js → shared/shared.dateRanges.validations.js} +5 -5
- package/dist/validations/{moderation.validations.js → shared/shared.moderation.validations.js} +24 -25
- package/dist/validations/{profiles.validations.js → shared/shared.profiles.validations.js} +22 -21
- package/dist/validations/{devices.validations.js → users/users.devices.validations.js} +2 -1
- package/package.json +1 -1
- package/dist/middlewares/idempotency.middlewares.d.ts +0 -3
- package/dist/middlewares/idempotency.middlewares.js +0 -74
- package/dist/utils/deviceUtils.d.ts +0 -2
- package/dist/utils/deviceUtils.js +0 -21
- package/dist/utils/session.utils.d.ts +0 -6
- package/dist/utils/session.utils.js +0 -25
- package/dist/validations/appeals.validations.d.ts +0 -61
- package/dist/validations/appeals.validations.js +0 -31
- package/dist/validations/payinstallment.validations.d.ts +0 -56
- package/dist/validations/payinstallment.validations.js +0 -23
- package/dist/validations/pricing.validations.d.ts +0 -313
- package/dist/validations/pricing.validations.js +0 -376
- /package/dist/middlewares/{auth.admin.middlewares.d.ts → admin/admin.auth.middleware.d.ts} +0 -0
- /package/dist/middlewares/{account.shared.middlewares.d.ts → shared/shared.account.middleware.d.ts} +0 -0
- /package/dist/middlewares/{errorHandler.middleware.d.ts → shared/shared.errorHandler.middleware.d.ts} +0 -0
- /package/dist/middlewares/{auth.users.middlewares.d.ts → users/users.auth.middleware.d.ts} +0 -0
- /package/dist/utils/{bans.utils.d.ts → admin/admin.bans.utils.d.ts} +0 -0
- /package/dist/utils/{bans.utils.js → admin/admin.bans.utils.js} +0 -0
- /package/dist/utils/{admin.devicePayment.utils.d.ts → admin/admin.devicePayments.utils.d.ts} +0 -0
- /package/dist/utils/{eventlogs.admin.utils.d.ts → admin/admin.eventLogs.utils.d.ts} +0 -0
- /package/dist/utils/{hierarchy.utils.d.ts → admin/admin.hierarchy.utils.d.ts} +0 -0
- /package/dist/utils/{moderation.utils.d.ts → admin/admin.moderation.utils.d.ts} +0 -0
- /package/dist/utils/{moderation.utils.js → admin/admin.moderation.utils.js} +0 -0
- /package/dist/utils/{product.utils.js → admin/admin.products.utils.js} +0 -0
- /package/dist/utils/{suspension.utils.d.ts → admin/admin.suspensions.utils.d.ts} +0 -0
- /package/dist/utils/{suspension.utils.js → admin/admin.suspensions.utils.js} +0 -0
- /package/dist/utils/{systemLog.utils.d.ts → admin/admin.systemLogs.utils.d.ts} +0 -0
- /package/dist/utils/{account.utils.d.ts → shared/shared.accounts.utils.d.ts} +0 -0
- /package/dist/utils/{authTokens.utils.d.ts → shared/shared.authTokens.utils.d.ts} +0 -0
- /package/dist/utils/{authTokens.utils.js → shared/shared.authTokens.utils.js} +0 -0
- /package/dist/utils/{eventLog.utils.d.ts → shared/shared.eventLogs.utils.d.ts} +0 -0
- /package/dist/utils/{eventLog.utils.js → shared/shared.eventLogs.utils.js} +0 -0
- /package/dist/utils/{response.utils.d.ts → shared/shared.responses.utils.d.ts} +0 -0
- /package/dist/utils/{response.utils.js → shared/shared.responses.utils.js} +0 -0
- /package/dist/utils/{types.d.ts → shared/shared.types.d.ts} +0 -0
- /package/dist/utils/{types.js → shared/shared.types.js} +0 -0
- /package/dist/validations/{bans.validations.d.ts → admin/admin.bans.validations.d.ts} +0 -0
- /package/dist/validations/{bans.validations.js → admin/admin.bans.validations.js} +0 -0
- /package/dist/validations/{admin.devicePayment.validations.d.ts → admin/admin.devicePayments.validations.d.ts} +0 -0
- /package/dist/validations/{admin.devices.validations.d.ts → admin/admin.devices.validations.d.ts} +0 -0
- /package/dist/validations/{eventlogs.admin.validations.d.ts → admin/admin.eventLogs.validations.d.ts} +0 -0
- /package/dist/validations/{admin.installment.validations.d.ts → admin/admin.installments.validations.d.ts} +0 -0
- /package/dist/validations/{pricings.validations.d.ts → admin/admin.pricings.validations.d.ts} +0 -0
- /package/dist/validations/{product.validations.d.ts → admin/admin.products.validations.d.ts} +0 -0
- /package/dist/validations/{suspensions.validations.d.ts → admin/admin.suspensions.validations.d.ts} +0 -0
- /package/dist/validations/{suspensions.validations.js → admin/admin.suspensions.validations.js} +0 -0
- /package/dist/validations/{users.admin.validations.d.ts → admin/admin.users.validations.d.ts} +0 -0
- /package/dist/validations/{account.validations.d.ts → shared/shared.account.validations.d.ts} +0 -0
- /package/dist/validations/{appSpecs.validations.d.ts → shared/shared.appSpecs.validations.d.ts} +0 -0
- /package/dist/validations/{auth.validations.d.ts → shared/shared.auth.validations.d.ts} +0 -0
- /package/dist/validations/{dateRange.validations.d.ts → shared/shared.dateRanges.validations.d.ts} +0 -0
- /package/dist/validations/{moderation.validations.d.ts → shared/shared.moderation.validations.d.ts} +0 -0
- /package/dist/validations/{profiles.validations.d.ts → shared/shared.profiles.validations.d.ts} +0 -0
- /package/dist/validations/{validate.validations.d.ts → shared/shared.validate.validations.d.ts} +0 -0
- /package/dist/validations/{validate.validations.js → shared/shared.validate.validations.js} +0 -0
- /package/dist/validations/{devicePaymentPlan.validations.d.ts → users/users.devicePaymentPlans.validations.d.ts} +0 -0
- /package/dist/validations/{devicePaymentPlan.validations.js → users/users.devicePaymentPlans.validations.js} +0 -0
- /package/dist/validations/{devices.validations.d.ts → users/users.devices.validations.d.ts} +0 -0
|
@@ -1,120 +1,127 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.activateAppSpecsSchema = exports.getAppSpecsByNameSchema = exports.getActiveAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = exports.exportBansSchema = exports.createSuspensionSchema = exports.createBanSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.reviewAppealSchema = exports.listSuspensionsSchema = exports.listPendingAppealsSchema = exports.listBansSchema = exports.getUserBansSchema = exports.getUserSuspensionsSchema = exports.getSuspensionSchema = exports.getUserRestrictionsSchema = exports.getBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.deactivateAccountSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.googleLoginSchema = exports.completePassengerProfileSchema = exports.checkRiderAccountSchema = exports.setRiderPasswordSchema = exports.riderPasswordRegex = exports.passwordRegex = exports.emailRegex = exports.phoneRegex = exports.requestOtpSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
|
|
4
|
-
exports.enableDevicesSchema = exports.disableDevicesSchema = exports.permanentDeleteDevicesByPairsSchema = exports.makeDevicesPermanentSchema = exports.deleteDevicesByPairsSchema = exports.unlockDevicesSchema = exports.lockDevicesSchema = exports.createDevicePairsSchema = exports.checkAvailabilitySchema = exports.deletePricingSchema = exports.getPricingsSchema = exports.getPricingSchema = exports.updatePricingSchema = exports.createPricingSchema = exports.updateStockSchema = exports.deleteProductSchema = exports.activateProductSchema = exports.deactivateProductSchema = exports.getProductsSchema = exports.getProductSchema = exports.updateProductSchema = exports.createProductSchema = exports.resetPasswordSchema = exports.upgradeToRiderSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.updateAdminSchema = exports.
|
|
18
|
+
exports.enableDevicesSchema = exports.disableDevicesSchema = exports.permanentDeleteDevicesByPairsSchema = exports.makeDevicesPermanentSchema = exports.deleteDevicesByPairsSchema = exports.unlockDevicesSchema = exports.lockDevicesSchema = exports.createDevicePairsSchema = exports.checkAvailabilitySchema = exports.deletePricingSchema = exports.getPricingsSchema = exports.getPricingSchema = exports.updatePricingSchema = exports.createPricingSchema = exports.updateStockSchema = exports.deleteProductSchema = exports.activateProductSchema = exports.deactivateProductSchema = exports.getProductsSchema = exports.getProductSchema = exports.updateProductSchema = exports.createProductSchema = exports.resetPasswordSchema = exports.upgradeToRiderSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.updateAdminSchema = exports.getInstallmentsSchema = exports.getInstallmentByIdSchema = exports.payInstallmentSchema = exports.serialRegex = exports.extendSessionSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = exports.registerRiderSchema = exports.riderPasswordSchema = exports.changePasswordSchema = exports.strongPasswordRegex = exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = exports.getAppSpecsSchema = void 0;
|
|
5
19
|
exports.getEventLogSchema = exports.listEventLogsSchema = exports.deletePlanSchema = exports.recordPaymentSchema = exports.listPlansSchema = exports.getUserPlansSchema = exports.getPlanSchema = exports.getDevicePlanSchema = exports.limitedUpdateSchema = exports.createPlanSchema = exports.customDeviceResetSchema = exports.triggerDeviceResetSchema = exports.getDevicesSchema = exports.getDeviceSchema = void 0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "
|
|
11
|
-
Object.defineProperty(exports, "
|
|
12
|
-
Object.defineProperty(exports, "
|
|
13
|
-
Object.defineProperty(exports, "
|
|
14
|
-
Object.defineProperty(exports, "
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
Object.defineProperty(exports, "
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
Object.defineProperty(exports, "
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Object.defineProperty(exports, "createUserSchema", { enumerable: true, get: function () { return
|
|
28
|
-
Object.defineProperty(exports, "getUserByIdSchema", { enumerable: true, get: function () { return
|
|
29
|
-
Object.defineProperty(exports, "updateUserProfileSchema", { enumerable: true, get: function () { return
|
|
30
|
-
Object.defineProperty(exports, "getAllUsersSchema", { enumerable: true, get: function () { return
|
|
31
|
-
|
|
32
|
-
Object.defineProperty(exports, "
|
|
33
|
-
|
|
34
|
-
Object.defineProperty(exports, "
|
|
35
|
-
Object.defineProperty(exports, "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Object.defineProperty(exports, "
|
|
39
|
-
|
|
40
|
-
Object.defineProperty(exports, "
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Object.defineProperty(exports, "
|
|
44
|
-
Object.defineProperty(exports, "
|
|
45
|
-
Object.defineProperty(exports, "
|
|
46
|
-
Object.defineProperty(exports, "
|
|
47
|
-
Object.defineProperty(exports, "
|
|
48
|
-
Object.defineProperty(exports, "
|
|
49
|
-
Object.defineProperty(exports, "
|
|
50
|
-
|
|
51
|
-
Object.defineProperty(exports, "
|
|
52
|
-
Object.defineProperty(exports, "
|
|
53
|
-
Object.defineProperty(exports, "
|
|
54
|
-
Object.defineProperty(exports, "
|
|
55
|
-
|
|
56
|
-
Object.defineProperty(exports, "
|
|
57
|
-
Object.defineProperty(exports, "
|
|
58
|
-
Object.defineProperty(exports, "
|
|
59
|
-
Object.defineProperty(exports, "
|
|
60
|
-
|
|
61
|
-
Object.defineProperty(exports, "
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Object.defineProperty(exports, "
|
|
65
|
-
Object.defineProperty(exports, "
|
|
66
|
-
Object.defineProperty(exports, "
|
|
67
|
-
Object.defineProperty(exports, "
|
|
68
|
-
Object.defineProperty(exports, "
|
|
69
|
-
Object.defineProperty(exports, "
|
|
70
|
-
|
|
71
|
-
Object.defineProperty(exports, "
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Object.defineProperty(exports, "
|
|
75
|
-
|
|
76
|
-
Object.defineProperty(exports, "
|
|
77
|
-
|
|
78
|
-
Object.defineProperty(exports, "
|
|
79
|
-
|
|
80
|
-
Object.defineProperty(exports, "
|
|
81
|
-
|
|
82
|
-
Object.defineProperty(exports, "
|
|
83
|
-
|
|
84
|
-
Object.defineProperty(exports, "
|
|
85
|
-
Object.defineProperty(exports, "
|
|
86
|
-
Object.defineProperty(exports, "
|
|
87
|
-
Object.defineProperty(exports, "
|
|
88
|
-
Object.defineProperty(exports, "
|
|
89
|
-
Object.defineProperty(exports, "
|
|
90
|
-
|
|
91
|
-
Object.defineProperty(exports, "
|
|
92
|
-
Object.defineProperty(exports, "
|
|
93
|
-
Object.defineProperty(exports, "
|
|
94
|
-
Object.defineProperty(exports, "
|
|
95
|
-
|
|
96
|
-
Object.defineProperty(exports, "
|
|
97
|
-
Object.defineProperty(exports, "
|
|
98
|
-
Object.defineProperty(exports, "
|
|
99
|
-
Object.defineProperty(exports, "
|
|
100
|
-
Object.defineProperty(exports, "
|
|
101
|
-
Object.defineProperty(exports, "
|
|
102
|
-
|
|
103
|
-
Object.defineProperty(exports, "
|
|
104
|
-
|
|
105
|
-
Object.defineProperty(exports, "
|
|
106
|
-
Object.defineProperty(exports, "
|
|
107
|
-
Object.defineProperty(exports, "
|
|
108
|
-
Object.defineProperty(exports, "
|
|
109
|
-
Object.defineProperty(exports, "
|
|
110
|
-
|
|
111
|
-
var pricings_validations_1 = require("./pricings.validations");
|
|
112
|
-
Object.defineProperty(exports, "createPricingSchema", { enumerable: true, get: function () { return pricings_validations_1.createPricingSchema; } });
|
|
113
|
-
Object.defineProperty(exports, "updatePricingSchema", { enumerable: true, get: function () { return pricings_validations_1.updatePricingSchema; } });
|
|
114
|
-
Object.defineProperty(exports, "getPricingSchema", { enumerable: true, get: function () { return pricings_validations_1.getPricingSchema; } });
|
|
115
|
-
Object.defineProperty(exports, "getPricingsSchema", { enumerable: true, get: function () { return pricings_validations_1.getPricingsSchema; } });
|
|
116
|
-
Object.defineProperty(exports, "deletePricingSchema", { enumerable: true, get: function () { return pricings_validations_1.deletePricingSchema; } });
|
|
117
|
-
var admin_devices_validations_1 = require("./admin.devices.validations");
|
|
20
|
+
__exportStar(require("../constants/regex.constants"), exports);
|
|
21
|
+
var shared_validate_validations_1 = require("./shared/shared.validate.validations");
|
|
22
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return shared_validate_validations_1.validate; } });
|
|
23
|
+
var shared_auth_validations_1 = require("./shared/shared.auth.validations");
|
|
24
|
+
Object.defineProperty(exports, "riderLoginSchema", { enumerable: true, get: function () { return shared_auth_validations_1.riderLoginSchema; } });
|
|
25
|
+
Object.defineProperty(exports, "forgotPasswordSchema", { enumerable: true, get: function () { return shared_auth_validations_1.forgotPasswordSchema; } });
|
|
26
|
+
Object.defineProperty(exports, "userLoginSchema", { enumerable: true, get: function () { return shared_auth_validations_1.userLoginSchema; } });
|
|
27
|
+
Object.defineProperty(exports, "refreshTokenSchema", { enumerable: true, get: function () { return shared_auth_validations_1.refreshTokenSchema; } });
|
|
28
|
+
Object.defineProperty(exports, "registerSchema", { enumerable: true, get: function () { return shared_auth_validations_1.registerSchema; } });
|
|
29
|
+
Object.defineProperty(exports, "verifyOtpSchema", { enumerable: true, get: function () { return shared_auth_validations_1.verifyOtpSchema; } });
|
|
30
|
+
Object.defineProperty(exports, "resendOtpSchema", { enumerable: true, get: function () { return shared_auth_validations_1.resendOtpSchema; } });
|
|
31
|
+
Object.defineProperty(exports, "requestOtpSchema", { enumerable: true, get: function () { return shared_auth_validations_1.requestOtpSchema; } });
|
|
32
|
+
Object.defineProperty(exports, "phoneRegex", { enumerable: true, get: function () { return shared_auth_validations_1.phoneRegex; } });
|
|
33
|
+
Object.defineProperty(exports, "emailRegex", { enumerable: true, get: function () { return shared_auth_validations_1.emailRegex; } });
|
|
34
|
+
Object.defineProperty(exports, "passwordRegex", { enumerable: true, get: function () { return shared_auth_validations_1.passwordRegex; } });
|
|
35
|
+
Object.defineProperty(exports, "riderPasswordRegex", { enumerable: true, get: function () { return shared_auth_validations_1.riderPasswordRegex; } });
|
|
36
|
+
Object.defineProperty(exports, "setRiderPasswordSchema", { enumerable: true, get: function () { return shared_auth_validations_1.setRiderPasswordSchema; } });
|
|
37
|
+
Object.defineProperty(exports, "checkRiderAccountSchema", { enumerable: true, get: function () { return shared_auth_validations_1.checkRiderAccountSchema; } });
|
|
38
|
+
Object.defineProperty(exports, "completePassengerProfileSchema", { enumerable: true, get: function () { return shared_auth_validations_1.completePassengerProfileSchema; } });
|
|
39
|
+
Object.defineProperty(exports, "googleLoginSchema", { enumerable: true, get: function () { return shared_auth_validations_1.googleLoginSchema; } });
|
|
40
|
+
var shared_profiles_validations_1 = require("./shared/shared.profiles.validations");
|
|
41
|
+
Object.defineProperty(exports, "createUserSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.createUserSchema; } });
|
|
42
|
+
Object.defineProperty(exports, "getUserByIdSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.getUserByIdSchema; } });
|
|
43
|
+
Object.defineProperty(exports, "updateUserProfileSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.updateUserProfileSchema; } });
|
|
44
|
+
Object.defineProperty(exports, "getAllUsersSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.getAllUsersSchema; } });
|
|
45
|
+
Object.defineProperty(exports, "viewProfileSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.viewProfileSchema; } });
|
|
46
|
+
Object.defineProperty(exports, "passengerSignupSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.passengerSignupSchema; } });
|
|
47
|
+
Object.defineProperty(exports, "updatePassengerProfileSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.updatePassengerProfileSchema; } });
|
|
48
|
+
Object.defineProperty(exports, "updateRiderProfileSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.updateRiderProfileSchema; } });
|
|
49
|
+
Object.defineProperty(exports, "createRiderSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.createRiderSchema; } });
|
|
50
|
+
Object.defineProperty(exports, "deactivateAccountSchema", { enumerable: true, get: function () { return shared_profiles_validations_1.deactivateAccountSchema; } });
|
|
51
|
+
var shared_moderation_validations_1 = require("./shared/shared.moderation.validations");
|
|
52
|
+
Object.defineProperty(exports, "submitBanAppealSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.submitBanAppealSchema; } });
|
|
53
|
+
Object.defineProperty(exports, "submitSuspensionAppealSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.submitSuspensionAppealSchema; } });
|
|
54
|
+
Object.defineProperty(exports, "getBanSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.getBanSchema; } });
|
|
55
|
+
Object.defineProperty(exports, "getUserRestrictionsSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.getUserRestrictionsSchema; } });
|
|
56
|
+
Object.defineProperty(exports, "getSuspensionSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.getSuspensionSchema; } });
|
|
57
|
+
Object.defineProperty(exports, "getUserSuspensionsSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.getUserSuspensionsSchema; } });
|
|
58
|
+
Object.defineProperty(exports, "getUserBansSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.getUserBansSchema; } });
|
|
59
|
+
Object.defineProperty(exports, "listBansSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.listBansSchema; } });
|
|
60
|
+
Object.defineProperty(exports, "listPendingAppealsSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.listPendingAppealsSchema; } });
|
|
61
|
+
Object.defineProperty(exports, "listSuspensionsSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.listSuspensionsSchema; } });
|
|
62
|
+
Object.defineProperty(exports, "reviewAppealSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.reviewAppealSchema; } });
|
|
63
|
+
Object.defineProperty(exports, "revokeBanSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.revokeBanSchema; } });
|
|
64
|
+
Object.defineProperty(exports, "revokeSuspensionSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.revokeSuspensionSchema; } });
|
|
65
|
+
Object.defineProperty(exports, "extendSuspensionSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.extendSuspensionSchema; } });
|
|
66
|
+
Object.defineProperty(exports, "createBanSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.createBanSchema; } });
|
|
67
|
+
Object.defineProperty(exports, "createSuspensionSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.createSuspensionSchema; } });
|
|
68
|
+
Object.defineProperty(exports, "exportBansSchema", { enumerable: true, get: function () { return shared_moderation_validations_1.exportBansSchema; } });
|
|
69
|
+
var shared_appSpecs_validations_1 = require("./shared/shared.appSpecs.validations");
|
|
70
|
+
Object.defineProperty(exports, "createAppSpecsSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.createAppSpecsSchema; } });
|
|
71
|
+
Object.defineProperty(exports, "updateAppSpecsSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.updateAppSpecsSchema; } });
|
|
72
|
+
Object.defineProperty(exports, "listAppSpecsSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.listAppSpecsSchema; } });
|
|
73
|
+
Object.defineProperty(exports, "getActiveAppSpecsSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.getActiveAppSpecsSchema; } });
|
|
74
|
+
Object.defineProperty(exports, "getAppSpecsByNameSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.getAppSpecsByNameSchema; } });
|
|
75
|
+
Object.defineProperty(exports, "activateAppSpecsSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.activateAppSpecsSchema; } });
|
|
76
|
+
Object.defineProperty(exports, "getAppSpecsSchema", { enumerable: true, get: function () { return shared_appSpecs_validations_1.getAppSpecsSchema; } });
|
|
77
|
+
var shared_account_validations_1 = require("./shared/shared.account.validations");
|
|
78
|
+
Object.defineProperty(exports, "updateProfileSchema", { enumerable: true, get: function () { return shared_account_validations_1.updateProfileSchema; } });
|
|
79
|
+
Object.defineProperty(exports, "requestPhoneChangeSchema", { enumerable: true, get: function () { return shared_account_validations_1.requestPhoneChangeSchema; } });
|
|
80
|
+
Object.defineProperty(exports, "verifyPhoneChangeSchema", { enumerable: true, get: function () { return shared_account_validations_1.verifyPhoneChangeSchema; } });
|
|
81
|
+
Object.defineProperty(exports, "deleteAccountSchema", { enumerable: true, get: function () { return shared_account_validations_1.deleteAccountSchema; } });
|
|
82
|
+
Object.defineProperty(exports, "strongPasswordRegex", { enumerable: true, get: function () { return shared_account_validations_1.strongPasswordRegex; } });
|
|
83
|
+
Object.defineProperty(exports, "changePasswordSchema", { enumerable: true, get: function () { return shared_account_validations_1.changePasswordSchema; } });
|
|
84
|
+
Object.defineProperty(exports, "riderPasswordSchema", { enumerable: true, get: function () { return shared_account_validations_1.riderPasswordSchema; } });
|
|
85
|
+
Object.defineProperty(exports, "registerRiderSchema", { enumerable: true, get: function () { return shared_account_validations_1.registerRiderSchema; } });
|
|
86
|
+
var users_devicePaymentPlans_validations_1 = require("./users/users.devicePaymentPlans.validations");
|
|
87
|
+
Object.defineProperty(exports, "listUserPaymentPlansSchema", { enumerable: true, get: function () { return users_devicePaymentPlans_validations_1.listUserPaymentPlansSchema; } });
|
|
88
|
+
Object.defineProperty(exports, "getUserPaymentPlanSchema", { enumerable: true, get: function () { return users_devicePaymentPlans_validations_1.getUserPaymentPlanSchema; } });
|
|
89
|
+
var users_devices_validations_1 = require("./users/users.devices.validations");
|
|
90
|
+
Object.defineProperty(exports, "unlockDeviceSchema", { enumerable: true, get: function () { return users_devices_validations_1.unlockDeviceSchema; } });
|
|
91
|
+
Object.defineProperty(exports, "extendSessionSchema", { enumerable: true, get: function () { return users_devices_validations_1.extendSessionSchema; } });
|
|
92
|
+
Object.defineProperty(exports, "serialRegex", { enumerable: true, get: function () { return users_devices_validations_1.serialRegex; } });
|
|
93
|
+
var admin_installments_validations_1 = require("./admin/admin.installments.validations");
|
|
94
|
+
Object.defineProperty(exports, "payInstallmentSchema", { enumerable: true, get: function () { return admin_installments_validations_1.payInstallmentSchema; } });
|
|
95
|
+
Object.defineProperty(exports, "getInstallmentByIdSchema", { enumerable: true, get: function () { return admin_installments_validations_1.getInstallmentByIdSchema; } });
|
|
96
|
+
Object.defineProperty(exports, "getInstallmentsSchema", { enumerable: true, get: function () { return admin_installments_validations_1.getInstallmentsSchema; } });
|
|
97
|
+
var admin_users_validations_1 = require("./admin/admin.users.validations");
|
|
98
|
+
Object.defineProperty(exports, "updateAdminSchema", { enumerable: true, get: function () { return admin_users_validations_1.updateAdminSchema; } });
|
|
99
|
+
Object.defineProperty(exports, "updateRiderSchema", { enumerable: true, get: function () { return admin_users_validations_1.updateRiderSchema; } });
|
|
100
|
+
Object.defineProperty(exports, "deleteUserSchema", { enumerable: true, get: function () { return admin_users_validations_1.deleteUserSchema; } });
|
|
101
|
+
Object.defineProperty(exports, "getUserSchema", { enumerable: true, get: function () { return admin_users_validations_1.getUserSchema; } });
|
|
102
|
+
Object.defineProperty(exports, "getUsersSchema", { enumerable: true, get: function () { return admin_users_validations_1.getUsersSchema; } });
|
|
103
|
+
Object.defineProperty(exports, "hireAdminSchema", { enumerable: true, get: function () { return admin_users_validations_1.hireAdminSchema; } });
|
|
104
|
+
Object.defineProperty(exports, "promoteAdminSchema", { enumerable: true, get: function () { return admin_users_validations_1.promoteAdminSchema; } });
|
|
105
|
+
Object.defineProperty(exports, "demoteAdminSchema", { enumerable: true, get: function () { return admin_users_validations_1.demoteAdminSchema; } });
|
|
106
|
+
Object.defineProperty(exports, "fireEmployeeSchema", { enumerable: true, get: function () { return admin_users_validations_1.fireEmployeeSchema; } });
|
|
107
|
+
Object.defineProperty(exports, "upgradeToRiderSchema", { enumerable: true, get: function () { return admin_users_validations_1.upgradeToRiderSchema; } });
|
|
108
|
+
Object.defineProperty(exports, "resetPasswordSchema", { enumerable: true, get: function () { return admin_users_validations_1.resetPasswordSchema; } });
|
|
109
|
+
var admin_products_validations_1 = require("./admin/admin.products.validations");
|
|
110
|
+
Object.defineProperty(exports, "createProductSchema", { enumerable: true, get: function () { return admin_products_validations_1.createProductSchema; } });
|
|
111
|
+
Object.defineProperty(exports, "updateProductSchema", { enumerable: true, get: function () { return admin_products_validations_1.updateProductSchema; } });
|
|
112
|
+
Object.defineProperty(exports, "getProductSchema", { enumerable: true, get: function () { return admin_products_validations_1.getProductSchema; } });
|
|
113
|
+
Object.defineProperty(exports, "getProductsSchema", { enumerable: true, get: function () { return admin_products_validations_1.getProductsSchema; } });
|
|
114
|
+
Object.defineProperty(exports, "deactivateProductSchema", { enumerable: true, get: function () { return admin_products_validations_1.deactivateProductSchema; } });
|
|
115
|
+
Object.defineProperty(exports, "activateProductSchema", { enumerable: true, get: function () { return admin_products_validations_1.activateProductSchema; } });
|
|
116
|
+
Object.defineProperty(exports, "deleteProductSchema", { enumerable: true, get: function () { return admin_products_validations_1.deleteProductSchema; } });
|
|
117
|
+
Object.defineProperty(exports, "updateStockSchema", { enumerable: true, get: function () { return admin_products_validations_1.updateStockSchema; } });
|
|
118
|
+
var admin_pricings_validations_1 = require("./admin/admin.pricings.validations");
|
|
119
|
+
Object.defineProperty(exports, "createPricingSchema", { enumerable: true, get: function () { return admin_pricings_validations_1.createPricingSchema; } });
|
|
120
|
+
Object.defineProperty(exports, "updatePricingSchema", { enumerable: true, get: function () { return admin_pricings_validations_1.updatePricingSchema; } });
|
|
121
|
+
Object.defineProperty(exports, "getPricingSchema", { enumerable: true, get: function () { return admin_pricings_validations_1.getPricingSchema; } });
|
|
122
|
+
Object.defineProperty(exports, "getPricingsSchema", { enumerable: true, get: function () { return admin_pricings_validations_1.getPricingsSchema; } });
|
|
123
|
+
Object.defineProperty(exports, "deletePricingSchema", { enumerable: true, get: function () { return admin_pricings_validations_1.deletePricingSchema; } });
|
|
124
|
+
var admin_devices_validations_1 = require("./admin/admin.devices.validations");
|
|
118
125
|
Object.defineProperty(exports, "checkAvailabilitySchema", { enumerable: true, get: function () { return admin_devices_validations_1.checkAvailabilitySchema; } });
|
|
119
126
|
Object.defineProperty(exports, "createDevicePairsSchema", { enumerable: true, get: function () { return admin_devices_validations_1.createDevicePairsSchema; } });
|
|
120
127
|
Object.defineProperty(exports, "lockDevicesSchema", { enumerable: true, get: function () { return admin_devices_validations_1.lockDevicesSchema; } });
|
|
@@ -128,15 +135,15 @@ Object.defineProperty(exports, "getDeviceSchema", { enumerable: true, get: funct
|
|
|
128
135
|
Object.defineProperty(exports, "getDevicesSchema", { enumerable: true, get: function () { return admin_devices_validations_1.getDevicesSchema; } });
|
|
129
136
|
Object.defineProperty(exports, "triggerDeviceResetSchema", { enumerable: true, get: function () { return admin_devices_validations_1.triggerDeviceResetSchema; } });
|
|
130
137
|
Object.defineProperty(exports, "customDeviceResetSchema", { enumerable: true, get: function () { return admin_devices_validations_1.customDeviceResetSchema; } });
|
|
131
|
-
var
|
|
132
|
-
Object.defineProperty(exports, "createPlanSchema", { enumerable: true, get: function () { return
|
|
133
|
-
Object.defineProperty(exports, "limitedUpdateSchema", { enumerable: true, get: function () { return
|
|
134
|
-
Object.defineProperty(exports, "getDevicePlanSchema", { enumerable: true, get: function () { return
|
|
135
|
-
Object.defineProperty(exports, "getPlanSchema", { enumerable: true, get: function () { return
|
|
136
|
-
Object.defineProperty(exports, "getUserPlansSchema", { enumerable: true, get: function () { return
|
|
137
|
-
Object.defineProperty(exports, "listPlansSchema", { enumerable: true, get: function () { return
|
|
138
|
-
Object.defineProperty(exports, "recordPaymentSchema", { enumerable: true, get: function () { return
|
|
139
|
-
Object.defineProperty(exports, "deletePlanSchema", { enumerable: true, get: function () { return
|
|
140
|
-
var
|
|
141
|
-
Object.defineProperty(exports, "listEventLogsSchema", { enumerable: true, get: function () { return
|
|
142
|
-
Object.defineProperty(exports, "getEventLogSchema", { enumerable: true, get: function () { return
|
|
138
|
+
var admin_devicePayments_validations_1 = require("./admin/admin.devicePayments.validations");
|
|
139
|
+
Object.defineProperty(exports, "createPlanSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.createPlanSchema; } });
|
|
140
|
+
Object.defineProperty(exports, "limitedUpdateSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.limitedUpdateSchema; } });
|
|
141
|
+
Object.defineProperty(exports, "getDevicePlanSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.getDevicePlanSchema; } });
|
|
142
|
+
Object.defineProperty(exports, "getPlanSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.getPlanSchema; } });
|
|
143
|
+
Object.defineProperty(exports, "getUserPlansSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.getUserPlansSchema; } });
|
|
144
|
+
Object.defineProperty(exports, "listPlansSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.listPlansSchema; } });
|
|
145
|
+
Object.defineProperty(exports, "recordPaymentSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.recordPaymentSchema; } });
|
|
146
|
+
Object.defineProperty(exports, "deletePlanSchema", { enumerable: true, get: function () { return admin_devicePayments_validations_1.deletePlanSchema; } });
|
|
147
|
+
var admin_eventLogs_validations_1 = require("./admin/admin.eventLogs.validations");
|
|
148
|
+
Object.defineProperty(exports, "listEventLogsSchema", { enumerable: true, get: function () { return admin_eventLogs_validations_1.listEventLogsSchema; } });
|
|
149
|
+
Object.defineProperty(exports, "getEventLogSchema", { enumerable: true, get: function () { return admin_eventLogs_validations_1.getEventLogSchema; } });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerRiderSchema = exports.riderPasswordSchema = exports.resetPasswordSchema = exports.forgotPasswordSchema = exports.loginSchema = exports.changePasswordSchema = exports.deleteAccountSchema = exports.confirmVerificationSchema = exports.verifyContactSchema = exports.setPrimaryContactSchema = exports.deleteContactSchema = exports.addContactSchema = exports.verifyEmailChangeSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.changeEmailSchema = exports.updateContactSchema = exports.updateProfileSchema = exports.validateContactValue = exports.detectContactType = exports.strongPasswordRegex = exports.emailRegex = exports.phoneRegex = void 0;
|
|
4
|
-
// src/modules/account/validations/account.schema.ts
|
|
5
4
|
const zod_1 = require("zod");
|
|
5
|
+
const regex_constants_1 = require("../../constants/regex.constants");
|
|
6
6
|
// ==================== REGEX PATTERNS ====================
|
|
7
|
-
exports.phoneRegex =
|
|
8
|
-
exports.emailRegex =
|
|
9
|
-
const plateRegex =
|
|
10
|
-
exports.strongPasswordRegex =
|
|
7
|
+
exports.phoneRegex = regex_constants_1.PHONE_NUMBER_REGEX;
|
|
8
|
+
exports.emailRegex = regex_constants_1.EMAIL_ADDRESS_REGEX;
|
|
9
|
+
const plateRegex = regex_constants_1.RWANDA_PLATE_NUMBER_REGEX;
|
|
10
|
+
exports.strongPasswordRegex = regex_constants_1.STRONG_PASSWORD_REGEX;
|
|
11
11
|
// ==================== CONTACT VALIDATION HELPERS ====================
|
|
12
12
|
const detectContactType = (value) => {
|
|
13
13
|
if (!value)
|
|
@@ -201,7 +201,7 @@ const isValidBirthDate = (date, month, year) => {
|
|
|
201
201
|
exports.riderPasswordSchema = zod_1.z
|
|
202
202
|
.string()
|
|
203
203
|
.length(4, "Password must be exactly 4 digits")
|
|
204
|
-
.regex(
|
|
204
|
+
.regex(regex_constants_1.FOUR_DIGIT_PIN_REGEX, "Password must contain only digits")
|
|
205
205
|
.refine((password) => {
|
|
206
206
|
// Check if all 4 digits are the same
|
|
207
207
|
const uniqueDigits = new Set(password.split("")).size;
|
|
@@ -226,7 +226,7 @@ exports.registerRiderSchema = zod_1.z.object({
|
|
|
226
226
|
.regex(exports.phoneRegex, "Invalid phone number format. Must be a valid Rwandan phone number (+250...) followed by 7 digits."),
|
|
227
227
|
jacketId: zod_1.z
|
|
228
228
|
.string()
|
|
229
|
-
.regex(
|
|
229
|
+
.regex(regex_constants_1.JACKET_ID_REGEX, "Jacket ID must be in format JKT-XXXXXXXXX")
|
|
230
230
|
.optional()
|
|
231
231
|
.nullable(),
|
|
232
232
|
plateNumber: zod_1.z
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAppSpecsByNameSchema = exports.getActiveAppSpecsSchema = exports.activateAppSpecsSchema = exports.getAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = void 0;
|
|
4
|
-
// src/validations/appSpecs.validations.ts
|
|
5
4
|
const zod_1 = require("zod");
|
|
6
5
|
const urlRegex = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
|
|
7
6
|
const optionalUrl = zod_1.z.preprocess((value) => typeof value === "string" && value.trim() === "" ? null : value, zod_1.z.string().url().nullable().optional());
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addContactSchema = exports.updateContactSchema = exports.createUserSchema = exports.completePassengerProfileSchema = exports.googleLoginSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.requestOtpSchema = exports.riderLoginSchema = exports.setRiderPasswordSchema = exports.checkRiderAccountSchema = exports.riderPasswordRegex = exports.registerSchema = exports.refreshTokenSchema = exports.changePasswordSchema = exports.forgotPasswordSchema = exports.userLoginSchema = exports.validateContactValue = exports.detectContactType = exports.strongPasswordRegex = exports.passwordRegex = exports.emailRegex = exports.phoneRegex = void 0;
|
|
4
|
-
// src/validations/auth.schema.ts
|
|
5
4
|
const zod_1 = require("zod");
|
|
5
|
+
const regex_constants_1 = require("../../constants/regex.constants");
|
|
6
6
|
// ==================== REGEX PATTERNS ====================
|
|
7
|
-
exports.phoneRegex =
|
|
8
|
-
exports.emailRegex =
|
|
9
|
-
exports.passwordRegex =
|
|
10
|
-
exports.strongPasswordRegex =
|
|
7
|
+
exports.phoneRegex = regex_constants_1.PHONE_NUMBER_REGEX;
|
|
8
|
+
exports.emailRegex = regex_constants_1.EMAIL_ADDRESS_REGEX;
|
|
9
|
+
exports.passwordRegex = regex_constants_1.PASSWORD_REGEX;
|
|
10
|
+
exports.strongPasswordRegex = regex_constants_1.STRONG_PASSWORD_REGEX;
|
|
11
11
|
// ==================== CONTACT VALIDATION HELPERS ====================
|
|
12
12
|
const detectContactType = (value) => {
|
|
13
13
|
if (!value)
|
|
@@ -97,7 +97,7 @@ exports.registerSchema = zod_1.z.object({
|
|
|
97
97
|
});
|
|
98
98
|
// ==================== USER (RIDER/PASSENGER) AUTH VALIDATIONS ====================
|
|
99
99
|
// Rider login with contact
|
|
100
|
-
exports.riderPasswordRegex =
|
|
100
|
+
exports.riderPasswordRegex = regex_constants_1.RIDER_PIN_REGEX;
|
|
101
101
|
exports.checkRiderAccountSchema = zod_1.z.object({
|
|
102
102
|
body: zod_1.z.object({
|
|
103
103
|
phoneNumber: zod_1.z
|
package/dist/validations/{dateRange.validations.js → shared/shared.dateRanges.validations.js}
RENAMED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ddMmYyyySchema = exports.yyyyMmDdSchema = exports.dateRangeSchema = exports.createDateSchema = exports.normalizeDate = exports.dateValidator = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const regex_constants_1 = require("../../constants/regex.constants");
|
|
5
6
|
// Regular expressions for date formats
|
|
6
|
-
const YYYY_MM_DD_REGEX =
|
|
7
|
-
const DD_MM_YYYY_REGEX =
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const YYYY_MM_DD_SLASH_REGEX = /^\d{4}\/\d{2}\/\d{2}$/;
|
|
7
|
+
const YYYY_MM_DD_REGEX = regex_constants_1.ISO_DATE_REGEX;
|
|
8
|
+
const DD_MM_YYYY_REGEX = regex_constants_1.DAY_MONTH_YEAR_REGEX;
|
|
9
|
+
const DD_MM_YYYY_SLASH_REGEX = regex_constants_1.DAY_MONTH_YEAR_SLASH_REGEX;
|
|
10
|
+
const YYYY_MM_DD_SLASH_REGEX = regex_constants_1.ISO_DATE_SLASH_REGEX;
|
|
11
11
|
/**
|
|
12
12
|
* Validates if a string is a valid date in any of the supported formats
|
|
13
13
|
* Supported formats:
|
package/dist/validations/{moderation.validations.js → shared/shared.moderation.validations.js}
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.exportSuspensionsSchema = exports.exportBansSchema = exports.reviewAppealSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.listPendingAppealsSchema = exports.listSuspensionsSchema = exports.listBansSchema = exports.createSuspensionSchema = exports.createBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.getUserSuspensionsSchema = exports.getUserBansSchema = exports.getUserRestrictionsSchema = exports.getSuspensionSchema = exports.getBanSchema = void 0;
|
|
4
|
-
// src/validations/moderation.validations.ts
|
|
5
4
|
const zod_1 = require("zod");
|
|
6
|
-
const
|
|
5
|
+
const shared_dateRanges_validations_1 = require("./shared.dateRanges.validations");
|
|
7
6
|
const uuidSchema = zod_1.z.string().uuid("Invalid UUID format");
|
|
8
7
|
// ==================== BASE SCHEMAS ====================
|
|
9
8
|
const paginationSchema = zod_1.z.object({
|
|
@@ -123,18 +122,18 @@ exports.listBansSchema = zod_1.z.object({
|
|
|
123
122
|
status: zod_1.z.enum(["active", "revoked"]).optional(),
|
|
124
123
|
appealStatus: zod_1.z.enum(["pending", "approved", "rejected"]).optional(),
|
|
125
124
|
isPermanent: zod_1.z.enum(["true", "false"]).optional(),
|
|
126
|
-
fromDate:
|
|
127
|
-
toDate:
|
|
125
|
+
fromDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
126
|
+
toDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
128
127
|
search: zod_1.z.string().optional(),
|
|
129
128
|
sortBy: zod_1.z.enum(["bannedAt", "createdAt", "reason"]).optional(),
|
|
130
129
|
sortOrder: zod_1.z.enum(["ASC", "DESC"]).optional(),
|
|
131
130
|
})
|
|
132
131
|
.transform((data) => {
|
|
133
132
|
if (data.fromDate) {
|
|
134
|
-
data.fromDate = (0,
|
|
133
|
+
data.fromDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.fromDate);
|
|
135
134
|
}
|
|
136
135
|
if (data.toDate) {
|
|
137
|
-
data.toDate = (0,
|
|
136
|
+
data.toDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.toDate);
|
|
138
137
|
}
|
|
139
138
|
return data;
|
|
140
139
|
}),
|
|
@@ -145,18 +144,18 @@ exports.listSuspensionsSchema = zod_1.z.object({
|
|
|
145
144
|
userId: zod_1.z.string().uuid("Invalid user ID").optional(),
|
|
146
145
|
status: zod_1.z.enum(["active", "expired", "revoked"]).optional(),
|
|
147
146
|
appealStatus: zod_1.z.enum(["pending", "approved", "rejected"]).optional(),
|
|
148
|
-
fromDate:
|
|
149
|
-
toDate:
|
|
147
|
+
fromDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
148
|
+
toDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
150
149
|
search: zod_1.z.string().optional(),
|
|
151
150
|
sortBy: zod_1.z.enum(["startedAt", "endsAt", "createdAt", "reason"]).optional(),
|
|
152
151
|
sortOrder: zod_1.z.enum(["ASC", "DESC"]).optional(),
|
|
153
152
|
})
|
|
154
153
|
.transform((data) => {
|
|
155
154
|
if (data.fromDate) {
|
|
156
|
-
data.fromDate = (0,
|
|
155
|
+
data.fromDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.fromDate);
|
|
157
156
|
}
|
|
158
157
|
if (data.toDate) {
|
|
159
|
-
data.toDate = (0,
|
|
158
|
+
data.toDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.toDate);
|
|
160
159
|
}
|
|
161
160
|
return data;
|
|
162
161
|
}),
|
|
@@ -165,15 +164,15 @@ exports.listPendingAppealsSchema = zod_1.z.object({
|
|
|
165
164
|
query: paginationSchema
|
|
166
165
|
.extend({
|
|
167
166
|
type: zod_1.z.enum(["ban", "suspension"]).optional(),
|
|
168
|
-
fromDate:
|
|
169
|
-
toDate:
|
|
167
|
+
fromDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
168
|
+
toDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
170
169
|
})
|
|
171
170
|
.transform((data) => {
|
|
172
171
|
if (data.fromDate) {
|
|
173
|
-
data.fromDate = (0,
|
|
172
|
+
data.fromDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.fromDate);
|
|
174
173
|
}
|
|
175
174
|
if (data.toDate) {
|
|
176
|
-
data.toDate = (0,
|
|
175
|
+
data.toDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.toDate);
|
|
177
176
|
}
|
|
178
177
|
return data;
|
|
179
178
|
}),
|
|
@@ -192,8 +191,8 @@ exports.extendSuspensionSchema = zod_1.z.object({
|
|
|
192
191
|
params: zod_1.z.object({ suspensionId: uuidSchema }),
|
|
193
192
|
body: zod_1.z
|
|
194
193
|
.object({
|
|
195
|
-
newEndDate:
|
|
196
|
-
const normalizedDate = (0,
|
|
194
|
+
newEndDate: shared_dateRanges_validations_1.dateValidator.refine((date) => {
|
|
195
|
+
const normalizedDate = (0, shared_dateRanges_validations_1.normalizeDate)(date);
|
|
197
196
|
return new Date(normalizedDate) > new Date();
|
|
198
197
|
}, { message: "New end date must be in the future" }),
|
|
199
198
|
extensionReason: zod_1.z.string().max(500).optional(),
|
|
@@ -201,7 +200,7 @@ exports.extendSuspensionSchema = zod_1.z.object({
|
|
|
201
200
|
.strict()
|
|
202
201
|
.transform((data) => ({
|
|
203
202
|
...data,
|
|
204
|
-
newEndDate: (0,
|
|
203
|
+
newEndDate: (0, shared_dateRanges_validations_1.normalizeDate)(data.newEndDate),
|
|
205
204
|
})),
|
|
206
205
|
});
|
|
207
206
|
// Process Appeals
|
|
@@ -221,16 +220,16 @@ exports.reviewAppealSchema = zod_1.z.object({
|
|
|
221
220
|
exports.exportBansSchema = zod_1.z.object({
|
|
222
221
|
query: zod_1.z
|
|
223
222
|
.object({
|
|
224
|
-
fromDate:
|
|
225
|
-
toDate:
|
|
223
|
+
fromDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
224
|
+
toDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
226
225
|
format: zod_1.z.enum(["csv"]).default("csv"),
|
|
227
226
|
})
|
|
228
227
|
.transform((data) => {
|
|
229
228
|
if (data.fromDate) {
|
|
230
|
-
data.fromDate = (0,
|
|
229
|
+
data.fromDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.fromDate);
|
|
231
230
|
}
|
|
232
231
|
if (data.toDate) {
|
|
233
|
-
data.toDate = (0,
|
|
232
|
+
data.toDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.toDate);
|
|
234
233
|
}
|
|
235
234
|
return data;
|
|
236
235
|
}),
|
|
@@ -238,16 +237,16 @@ exports.exportBansSchema = zod_1.z.object({
|
|
|
238
237
|
exports.exportSuspensionsSchema = zod_1.z.object({
|
|
239
238
|
query: zod_1.z
|
|
240
239
|
.object({
|
|
241
|
-
fromDate:
|
|
242
|
-
toDate:
|
|
240
|
+
fromDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
241
|
+
toDate: shared_dateRanges_validations_1.dateValidator.optional(),
|
|
243
242
|
format: zod_1.z.enum(["csv"]).default("csv"),
|
|
244
243
|
})
|
|
245
244
|
.transform((data) => {
|
|
246
245
|
if (data.fromDate) {
|
|
247
|
-
data.fromDate = (0,
|
|
246
|
+
data.fromDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.fromDate);
|
|
248
247
|
}
|
|
249
248
|
if (data.toDate) {
|
|
250
|
-
data.toDate = (0,
|
|
249
|
+
data.toDate = (0, shared_dateRanges_validations_1.normalizeDate)(data.toDate);
|
|
251
250
|
}
|
|
252
251
|
return data;
|
|
253
252
|
}),
|