vr-commons 1.0.57 → 1.0.58
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/validations/devices.validations.d.ts +18 -0
- package/dist/validations/devices.validations.js +14 -0
- package/dist/validations/index.d.ts +2 -0
- package/dist/validations/index.js +5 -1
- package/dist/validations/payinstallment.validations.d.ts +41 -0
- package/dist/validations/payinstallment.validations.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const unlockDeviceSchema: z.ZodObject<{
|
|
3
|
+
params: z.ZodObject<{
|
|
4
|
+
serial: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
serial: string;
|
|
7
|
+
}, {
|
|
8
|
+
serial: string;
|
|
9
|
+
}>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
params: {
|
|
12
|
+
serial: string;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
params: {
|
|
16
|
+
serial: string;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unlockDeviceSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const serialNumberRegex = /^[A-Z0-9]{8,32}$/i;
|
|
6
|
+
exports.unlockDeviceSchema = zod_1.z.object({
|
|
7
|
+
params: zod_1.z.object({
|
|
8
|
+
serial: zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.regex(serialNumberRegex, "Invalid serial number format")
|
|
11
|
+
.min(8, "Serial number must be at least 8 characters")
|
|
12
|
+
.max(32, "Serial number cannot exceed 32 characters"),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
@@ -7,3 +7,5 @@ export { getBanSchema, getUserRestrictionsSchema, createBanSchema, } from "./ban
|
|
|
7
7
|
export { getSuspensionSchema, getUserSuspensionsSchema, createSuspensionSchema, } from "./suspensions.validations";
|
|
8
8
|
export { createAppSpecsSchema, updateAppSpecsSchema, listAppSpecsSchema, getActiveAppSpecsSchema, activateAppSpecsSchema, getAppSpecsSchema, } from "./appSpecs.validations";
|
|
9
9
|
export { listUserPaymentPlansSchema, getUserPaymentPlanSchema, } from "./devicePaymentPlan.validations";
|
|
10
|
+
export { unlockDeviceSchema } from "./devices.validations";
|
|
11
|
+
export { payInstallmentSchema } from "./payinstallment.validations";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.resendOtpSchema = exports.verifySchema = exports.confirmSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
|
|
3
|
+
exports.payInstallmentSchema = 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.updateProfileSchema = exports.deleteAccountSchema = exports.deactivateAccountSchema = exports.changePasswordSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.resendOtpSchema = exports.verifySchema = exports.confirmSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
|
|
4
4
|
var validate_validations_1 = require("./validate.validations");
|
|
5
5
|
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
|
|
6
6
|
var auth_validations_1 = require("./auth.validations");
|
|
@@ -61,3 +61,7 @@ Object.defineProperty(exports, "getAppSpecsSchema", { enumerable: true, get: fun
|
|
|
61
61
|
var devicePaymentPlan_validations_1 = require("./devicePaymentPlan.validations");
|
|
62
62
|
Object.defineProperty(exports, "listUserPaymentPlansSchema", { enumerable: true, get: function () { return devicePaymentPlan_validations_1.listUserPaymentPlansSchema; } });
|
|
63
63
|
Object.defineProperty(exports, "getUserPaymentPlanSchema", { enumerable: true, get: function () { return devicePaymentPlan_validations_1.getUserPaymentPlanSchema; } });
|
|
64
|
+
var devices_validations_1 = require("./devices.validations");
|
|
65
|
+
Object.defineProperty(exports, "unlockDeviceSchema", { enumerable: true, get: function () { return devices_validations_1.unlockDeviceSchema; } });
|
|
66
|
+
var payinstallment_validations_1 = require("./payinstallment.validations");
|
|
67
|
+
Object.defineProperty(exports, "payInstallmentSchema", { enumerable: true, get: function () { return payinstallment_validations_1.payInstallmentSchema; } });
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const payInstallmentSchema: z.ZodObject<{
|
|
3
|
+
params: z.ZodObject<{
|
|
4
|
+
planId: z.ZodString;
|
|
5
|
+
installmentId: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
planId: string;
|
|
8
|
+
installmentId: string;
|
|
9
|
+
}, {
|
|
10
|
+
planId: string;
|
|
11
|
+
installmentId: string;
|
|
12
|
+
}>;
|
|
13
|
+
body: z.ZodObject<{
|
|
14
|
+
phoneNumber: z.ZodString;
|
|
15
|
+
provider: z.ZodDefault<z.ZodEnum<["mtn_momo", "airtel_money"]>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
phoneNumber: string;
|
|
18
|
+
provider: "mtn_momo" | "airtel_money";
|
|
19
|
+
}, {
|
|
20
|
+
phoneNumber: string;
|
|
21
|
+
provider?: "mtn_momo" | "airtel_money" | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
params: {
|
|
25
|
+
planId: string;
|
|
26
|
+
installmentId: string;
|
|
27
|
+
};
|
|
28
|
+
body: {
|
|
29
|
+
phoneNumber: string;
|
|
30
|
+
provider: "mtn_momo" | "airtel_money";
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
params: {
|
|
34
|
+
planId: string;
|
|
35
|
+
installmentId: string;
|
|
36
|
+
};
|
|
37
|
+
body: {
|
|
38
|
+
phoneNumber: string;
|
|
39
|
+
provider?: "mtn_momo" | "airtel_money" | undefined;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.payInstallmentSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const uuidSchema = zod_1.z.string().uuid("Invalid ID format");
|
|
6
|
+
const phoneRegex = /^(\+?250|0)?[7-9][0-9]{8}$/;
|
|
7
|
+
exports.payInstallmentSchema = zod_1.z.object({
|
|
8
|
+
params: zod_1.z.object({
|
|
9
|
+
planId: uuidSchema,
|
|
10
|
+
installmentId: uuidSchema,
|
|
11
|
+
}),
|
|
12
|
+
body: zod_1.z.object({
|
|
13
|
+
phoneNumber: zod_1.z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(phoneRegex, "Invalid phone number format. Use format: 0788123456 or +250788123456"),
|
|
16
|
+
provider: zod_1.z.enum(["mtn_momo", "airtel_money"]).default("mtn_momo"),
|
|
17
|
+
}),
|
|
18
|
+
});
|