vr-commons 1.0.93 → 1.0.94
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/utils/index.d.ts +2 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/product.utils.d.ts +20 -0
- package/dist/utils/product.utils.js +79 -0
- package/dist/utils/types.d.ts +4 -0
- package/dist/validations/appSpecs.validations.d.ts +16 -16
- package/dist/validations/appeals.validations.d.ts +8 -8
- package/dist/validations/auth.validations.d.ts +8 -8
- package/dist/validations/bans.validations.d.ts +8 -8
- package/dist/validations/devicePaymentPlan.validations.d.ts +4 -4
- package/dist/validations/index.d.ts +1 -0
- package/dist/validations/index.js +9 -1
- package/dist/validations/moderation.validations.d.ts +45 -45
- package/dist/validations/payinstallment.validations.d.ts +5 -5
- package/dist/validations/product.validations.d.ts +228 -0
- package/dist/validations/product.validations.js +79 -0
- package/dist/validations/profiles.validations.d.ts +40 -40
- package/dist/validations/suspensions.validations.d.ts +12 -12
- package/dist/validations/users.admin.validations.d.ts +43 -43
- package/package.json +4 -1
package/dist/utils/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { suspensionUtil } from "./suspension.utils";
|
|
|
9
9
|
export { createDeviceSession } from "./session.utils";
|
|
10
10
|
export { generateOTP, getOTPExpiry, getVerificationMethod, sendEmail, sendSMS, sendVerificationCode, } from "./verification.utils";
|
|
11
11
|
export { getUserLevel, isRankEqual, isSubordinate, isSubordinateOrEqual, isSuperior, isSuperiorOrEqual, validateHierarchy, } from "./hierarchy.utils";
|
|
12
|
-
export {
|
|
12
|
+
export { cloudinaryUtil } from "./product.utils";
|
|
13
|
+
export { PendingRegistration, VerificationMethod, ConfirmResponse, UploadResult, } from "./types";
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isRankEqual = exports.getUserLevel = exports.sendVerificationCode = exports.sendSMS = exports.sendEmail = exports.getVerificationMethod = exports.getOTPExpiry = exports.generateOTP = exports.createDeviceSession = exports.suspensionUtil = exports.banUtil = exports.hasHigherAuthority = exports.getModeratableRoles = exports.canModerateUser = exports.canModerate = exports.softDeleteUser = exports.hashPassword = exports.validatePassword = exports.validateUniqueFields = exports.generateJacketId = exports.getSortOrder = exports.generateEventSearchConditions = exports.generateUserSearchConditions = exports.findSecurityClearanceByRole = exports.getUsersByRole = exports.getUserById = exports.isAccountAccessible = exports.canModifyAccount = exports.hasAllPermissions = exports.hasAnyPermission = exports.hasPermission = exports.hasRole = exports.formatUserListResponse = exports.formatUserProfile = exports.sendErrorResponse = exports.sendSuccessResponse = exports.logEvent = exports.formatTimeRemaining = exports.getTokenTimeRemaining = exports.generateToken = exports.shouldRefreshToken = exports.verifyToken = exports.generateRiderToken = exports.generatePassengerToken = exports.generateAdminToken = exports.checkSuspensionStatus = exports.checkIsUserBannedOrSuspended = exports.checkBanStatus = exports.hasActiveDependencies = exports.checkAccountDependencies = void 0;
|
|
4
|
-
exports.validateHierarchy = exports.isSuperiorOrEqual = exports.isSuperior = exports.isSubordinateOrEqual = exports.isSubordinate = void 0;
|
|
4
|
+
exports.cloudinaryUtil = exports.validateHierarchy = exports.isSuperiorOrEqual = exports.isSuperior = exports.isSubordinateOrEqual = exports.isSubordinate = void 0;
|
|
5
5
|
var account_utils_1 = require("./account.utils");
|
|
6
6
|
Object.defineProperty(exports, "checkAccountDependencies", { enumerable: true, get: function () { return account_utils_1.checkAccountDependencies; } });
|
|
7
7
|
Object.defineProperty(exports, "hasActiveDependencies", { enumerable: true, get: function () { return account_utils_1.hasActiveDependencies; } });
|
|
@@ -75,3 +75,5 @@ Object.defineProperty(exports, "isSubordinateOrEqual", { enumerable: true, get:
|
|
|
75
75
|
Object.defineProperty(exports, "isSuperior", { enumerable: true, get: function () { return hierarchy_utils_1.isSuperior; } });
|
|
76
76
|
Object.defineProperty(exports, "isSuperiorOrEqual", { enumerable: true, get: function () { return hierarchy_utils_1.isSuperiorOrEqual; } });
|
|
77
77
|
Object.defineProperty(exports, "validateHierarchy", { enumerable: true, get: function () { return hierarchy_utils_1.validateHierarchy; } });
|
|
78
|
+
var product_utils_1 = require("./product.utils");
|
|
79
|
+
Object.defineProperty(exports, "cloudinaryUtil", { enumerable: true, get: function () { return product_utils_1.cloudinaryUtil; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Request } from "express";
|
|
2
|
+
import { UploadResult } from "./types";
|
|
3
|
+
export declare const cloudinaryUtil: {
|
|
4
|
+
/**
|
|
5
|
+
* Upload file buffer to Cloudinary
|
|
6
|
+
*/
|
|
7
|
+
uploadFromBuffer: (fileBuffer: Buffer, folder?: string) => Promise<UploadResult>;
|
|
8
|
+
/**
|
|
9
|
+
* Upload file from request
|
|
10
|
+
*/
|
|
11
|
+
uploadFromRequest: (req: Request, folder?: string) => Promise<UploadResult | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Delete file from Cloudinary
|
|
14
|
+
*/
|
|
15
|
+
deleteFromUrl: (imageUrl: string) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Delete file by public ID
|
|
18
|
+
*/
|
|
19
|
+
deleteByPublicId: (publicId: string) => Promise<void>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cloudinaryUtil = void 0;
|
|
7
|
+
const cloudinary_1 = require("cloudinary");
|
|
8
|
+
const streamifier_1 = __importDefault(require("streamifier"));
|
|
9
|
+
// Configure Cloudinary
|
|
10
|
+
cloudinary_1.v2.config({
|
|
11
|
+
cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
|
|
12
|
+
api_key: process.env.CLOUDINARY_API_KEY,
|
|
13
|
+
api_secret: process.env.CLOUDINARY_API_SECRET,
|
|
14
|
+
});
|
|
15
|
+
exports.cloudinaryUtil = {
|
|
16
|
+
/**
|
|
17
|
+
* Upload file buffer to Cloudinary
|
|
18
|
+
*/
|
|
19
|
+
uploadFromBuffer: (fileBuffer, folder = "products") => {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const uploadStream = cloudinary_1.v2.uploader.upload_stream({
|
|
22
|
+
folder,
|
|
23
|
+
resource_type: "auto",
|
|
24
|
+
}, (error, result) => {
|
|
25
|
+
if (error || !result) {
|
|
26
|
+
reject(error || new Error("Upload failed"));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
resolve({
|
|
30
|
+
url: result.secure_url,
|
|
31
|
+
publicId: result.public_id,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
streamifier_1.default.createReadStream(fileBuffer).pipe(uploadStream);
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Upload file from request
|
|
40
|
+
*/
|
|
41
|
+
uploadFromRequest: async (req, folder = "products") => {
|
|
42
|
+
//@ts-ignore
|
|
43
|
+
if (!req.file)
|
|
44
|
+
return null; //@ts-ignore
|
|
45
|
+
return await exports.cloudinaryUtil.uploadFromBuffer(req.file.buffer, folder);
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Delete file from Cloudinary
|
|
49
|
+
*/
|
|
50
|
+
deleteFromUrl: async (imageUrl) => {
|
|
51
|
+
try {
|
|
52
|
+
if (!imageUrl)
|
|
53
|
+
return;
|
|
54
|
+
// Extract public ID from Cloudinary URL
|
|
55
|
+
// URL format: https://res.cloudinary.com/cloud_name/image/upload/v1234567890/folder/public_id.jpg
|
|
56
|
+
const urlParts = imageUrl.split("/");
|
|
57
|
+
const publicIdWithExtension = urlParts[urlParts.length - 1];
|
|
58
|
+
const publicId = publicIdWithExtension.split(".")[0];
|
|
59
|
+
const folder = urlParts[urlParts.length - 2];
|
|
60
|
+
const fullPublicId = folder !== "upload" ? `${folder}/${publicId}` : publicId;
|
|
61
|
+
await cloudinary_1.v2.uploader.destroy(fullPublicId);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.log("Error deleting from Cloudinary:", error);
|
|
65
|
+
// Don't throw - deletion failure shouldn't break the main operation
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Delete file by public ID
|
|
70
|
+
*/
|
|
71
|
+
deleteByPublicId: async (publicId) => {
|
|
72
|
+
try {
|
|
73
|
+
await cloudinary_1.v2.uploader.destroy(publicId);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.log("Error deleting from Cloudinary:", error);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -616,6 +616,9 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
616
616
|
sentryDsn?: string | null | undefined;
|
|
617
617
|
}>;
|
|
618
618
|
}, "strip", z.ZodTypeAny, {
|
|
619
|
+
params: {
|
|
620
|
+
id: string;
|
|
621
|
+
};
|
|
619
622
|
body: {
|
|
620
623
|
appName?: string | undefined;
|
|
621
624
|
appShortName?: string | null | undefined;
|
|
@@ -692,10 +695,10 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
692
695
|
facebookPixelId?: string | null | undefined;
|
|
693
696
|
sentryDsn?: string | null | undefined;
|
|
694
697
|
};
|
|
698
|
+
}, {
|
|
695
699
|
params: {
|
|
696
700
|
id: string;
|
|
697
701
|
};
|
|
698
|
-
}, {
|
|
699
702
|
body: {
|
|
700
703
|
appName?: string | undefined;
|
|
701
704
|
appShortName?: string | null | undefined;
|
|
@@ -772,9 +775,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
772
775
|
facebookPixelId?: string | null | undefined;
|
|
773
776
|
sentryDsn?: string | null | undefined;
|
|
774
777
|
};
|
|
775
|
-
params: {
|
|
776
|
-
id: string;
|
|
777
|
-
};
|
|
778
778
|
}>;
|
|
779
779
|
export declare const listAppSpecsSchema: z.ZodObject<{
|
|
780
780
|
query: z.ZodObject<{
|
|
@@ -785,37 +785,37 @@ export declare const listAppSpecsSchema: z.ZodObject<{
|
|
|
785
785
|
sortBy: z.ZodOptional<z.ZodEnum<["version", "createdAt", "updatedAt"]>>;
|
|
786
786
|
sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
|
|
787
787
|
}, "strip", z.ZodTypeAny, {
|
|
788
|
-
limit: number;
|
|
789
788
|
page: number;
|
|
790
|
-
|
|
789
|
+
limit: number;
|
|
791
790
|
isActive?: "true" | "false" | undefined;
|
|
791
|
+
search?: string | undefined;
|
|
792
792
|
sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
|
|
793
|
-
sortOrder?: "
|
|
793
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
794
794
|
}, {
|
|
795
|
-
search?: string | undefined;
|
|
796
|
-
limit?: string | undefined;
|
|
797
795
|
isActive?: "true" | "false" | undefined;
|
|
798
796
|
page?: string | undefined;
|
|
797
|
+
limit?: string | undefined;
|
|
798
|
+
search?: string | undefined;
|
|
799
799
|
sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
|
|
800
|
-
sortOrder?: "
|
|
800
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
801
801
|
}>;
|
|
802
802
|
}, "strip", z.ZodTypeAny, {
|
|
803
803
|
query: {
|
|
804
|
-
limit: number;
|
|
805
804
|
page: number;
|
|
806
|
-
|
|
805
|
+
limit: number;
|
|
807
806
|
isActive?: "true" | "false" | undefined;
|
|
807
|
+
search?: string | undefined;
|
|
808
808
|
sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
|
|
809
|
-
sortOrder?: "
|
|
809
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
810
810
|
};
|
|
811
811
|
}, {
|
|
812
812
|
query: {
|
|
813
|
-
search?: string | undefined;
|
|
814
|
-
limit?: string | undefined;
|
|
815
813
|
isActive?: "true" | "false" | undefined;
|
|
816
814
|
page?: string | undefined;
|
|
815
|
+
limit?: string | undefined;
|
|
816
|
+
search?: string | undefined;
|
|
817
817
|
sortBy?: "createdAt" | "updatedAt" | "version" | undefined;
|
|
818
|
-
sortOrder?: "
|
|
818
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
819
819
|
};
|
|
820
820
|
}>;
|
|
821
821
|
export declare const getAppSpecsSchema: z.ZodObject<{
|
|
@@ -15,19 +15,19 @@ export declare const submitBanAppealSchema: z.ZodObject<{
|
|
|
15
15
|
appealReason: string;
|
|
16
16
|
}>;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
body: {
|
|
19
|
-
appealReason: string;
|
|
20
|
-
};
|
|
21
18
|
params: {
|
|
22
19
|
banId: string;
|
|
23
20
|
};
|
|
24
|
-
}, {
|
|
25
21
|
body: {
|
|
26
22
|
appealReason: string;
|
|
27
23
|
};
|
|
24
|
+
}, {
|
|
28
25
|
params: {
|
|
29
26
|
banId: string;
|
|
30
27
|
};
|
|
28
|
+
body: {
|
|
29
|
+
appealReason: string;
|
|
30
|
+
};
|
|
31
31
|
}>;
|
|
32
32
|
export declare const submitSuspensionAppealSchema: z.ZodObject<{
|
|
33
33
|
params: z.ZodObject<{
|
|
@@ -45,17 +45,17 @@ export declare const submitSuspensionAppealSchema: z.ZodObject<{
|
|
|
45
45
|
appealReason: string;
|
|
46
46
|
}>;
|
|
47
47
|
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
body: {
|
|
49
|
-
appealReason: string;
|
|
50
|
-
};
|
|
51
48
|
params: {
|
|
52
49
|
suspensionId: string;
|
|
53
50
|
};
|
|
54
|
-
}, {
|
|
55
51
|
body: {
|
|
56
52
|
appealReason: string;
|
|
57
53
|
};
|
|
54
|
+
}, {
|
|
58
55
|
params: {
|
|
59
56
|
suspensionId: string;
|
|
60
57
|
};
|
|
58
|
+
body: {
|
|
59
|
+
appealReason: string;
|
|
60
|
+
};
|
|
61
61
|
}>;
|
|
@@ -87,31 +87,31 @@ export declare const registerSchema: z.ZodObject<{
|
|
|
87
87
|
email: z.ZodOptional<z.ZodString>;
|
|
88
88
|
password: z.ZodString;
|
|
89
89
|
}, "strict", z.ZodTypeAny, {
|
|
90
|
-
password: string;
|
|
91
90
|
firstName: string;
|
|
92
91
|
lastName: string;
|
|
92
|
+
password: string;
|
|
93
93
|
phoneNumber: string;
|
|
94
94
|
email?: string | undefined;
|
|
95
95
|
}, {
|
|
96
|
-
password: string;
|
|
97
96
|
firstName: string;
|
|
98
97
|
lastName: string;
|
|
98
|
+
password: string;
|
|
99
99
|
phoneNumber: string;
|
|
100
100
|
email?: string | undefined;
|
|
101
101
|
}>;
|
|
102
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
103
|
body: {
|
|
104
|
-
password: string;
|
|
105
104
|
firstName: string;
|
|
106
105
|
lastName: string;
|
|
106
|
+
password: string;
|
|
107
107
|
phoneNumber: string;
|
|
108
108
|
email?: string | undefined;
|
|
109
109
|
};
|
|
110
110
|
}, {
|
|
111
111
|
body: {
|
|
112
|
-
password: string;
|
|
113
112
|
firstName: string;
|
|
114
113
|
lastName: string;
|
|
114
|
+
password: string;
|
|
115
115
|
phoneNumber: string;
|
|
116
116
|
email?: string | undefined;
|
|
117
117
|
};
|
|
@@ -121,27 +121,27 @@ export declare const riderLoginSchema: z.ZodObject<{
|
|
|
121
121
|
phoneNumber: z.ZodString;
|
|
122
122
|
nationalId: z.ZodString;
|
|
123
123
|
}, "strip", z.ZodTypeAny, {
|
|
124
|
-
phoneNumber: string;
|
|
125
124
|
nationalId: string;
|
|
126
|
-
}, {
|
|
127
125
|
phoneNumber: string;
|
|
126
|
+
}, {
|
|
128
127
|
nationalId: string;
|
|
128
|
+
phoneNumber: string;
|
|
129
129
|
}>;
|
|
130
130
|
query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
131
131
|
params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
132
132
|
headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
133
133
|
}, "strip", z.ZodTypeAny, {
|
|
134
134
|
body: {
|
|
135
|
-
phoneNumber: string;
|
|
136
135
|
nationalId: string;
|
|
136
|
+
phoneNumber: string;
|
|
137
137
|
};
|
|
138
138
|
params?: {} | undefined;
|
|
139
139
|
query?: {} | undefined;
|
|
140
140
|
headers?: {} | undefined;
|
|
141
141
|
}, {
|
|
142
142
|
body: {
|
|
143
|
-
phoneNumber: string;
|
|
144
143
|
nationalId: string;
|
|
144
|
+
phoneNumber: string;
|
|
145
145
|
};
|
|
146
146
|
params?: {} | undefined;
|
|
147
147
|
query?: {} | undefined;
|
|
@@ -32,19 +32,19 @@ export declare const getUserRestrictionsSchema: z.ZodObject<{
|
|
|
32
32
|
includeResolved?: "true" | "false" | undefined;
|
|
33
33
|
}>;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
query: {
|
|
36
|
-
includeResolved?: "true" | "false" | undefined;
|
|
37
|
-
};
|
|
38
35
|
params: {
|
|
39
36
|
userId: string;
|
|
40
37
|
};
|
|
41
|
-
}, {
|
|
42
38
|
query: {
|
|
43
39
|
includeResolved?: "true" | "false" | undefined;
|
|
44
40
|
};
|
|
41
|
+
}, {
|
|
45
42
|
params: {
|
|
46
43
|
userId: string;
|
|
47
44
|
};
|
|
45
|
+
query: {
|
|
46
|
+
includeResolved?: "true" | "false" | undefined;
|
|
47
|
+
};
|
|
48
48
|
}>;
|
|
49
49
|
export declare const createBanSchema: z.ZodObject<{
|
|
50
50
|
params: z.ZodObject<{
|
|
@@ -65,19 +65,19 @@ export declare const createBanSchema: z.ZodObject<{
|
|
|
65
65
|
isPermanent?: boolean | undefined;
|
|
66
66
|
}>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
params: {
|
|
69
|
+
userId: string;
|
|
70
|
+
};
|
|
68
71
|
body: {
|
|
69
72
|
reason: string;
|
|
70
73
|
isPermanent: boolean;
|
|
71
74
|
};
|
|
75
|
+
}, {
|
|
72
76
|
params: {
|
|
73
77
|
userId: string;
|
|
74
78
|
};
|
|
75
|
-
}, {
|
|
76
79
|
body: {
|
|
77
80
|
reason: string;
|
|
78
81
|
isPermanent?: boolean | undefined;
|
|
79
82
|
};
|
|
80
|
-
params: {
|
|
81
|
-
userId: string;
|
|
82
|
-
};
|
|
83
83
|
}>;
|
|
@@ -9,11 +9,11 @@ export declare const listUserPaymentPlansSchema: z.ZodObject<{
|
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
10
|
page: number;
|
|
11
11
|
limit: number;
|
|
12
|
-
status?: "ACTIVE" | "
|
|
12
|
+
status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
|
|
13
13
|
sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
|
|
14
14
|
sortOrder?: "ASC" | "DESC" | undefined;
|
|
15
15
|
}, {
|
|
16
|
-
status?: "ACTIVE" | "
|
|
16
|
+
status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
|
|
17
17
|
page?: string | undefined;
|
|
18
18
|
limit?: string | undefined;
|
|
19
19
|
sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
|
|
@@ -23,13 +23,13 @@ export declare const listUserPaymentPlansSchema: z.ZodObject<{
|
|
|
23
23
|
query: {
|
|
24
24
|
page: number;
|
|
25
25
|
limit: number;
|
|
26
|
-
status?: "ACTIVE" | "
|
|
26
|
+
status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
|
|
27
27
|
sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
|
|
28
28
|
sortOrder?: "ASC" | "DESC" | undefined;
|
|
29
29
|
};
|
|
30
30
|
}, {
|
|
31
31
|
query: {
|
|
32
|
-
status?: "ACTIVE" | "
|
|
32
|
+
status?: "ACTIVE" | "DEFAULTED" | "COMPLETED" | "CANCELLED" | undefined;
|
|
33
33
|
page?: string | undefined;
|
|
34
34
|
limit?: string | undefined;
|
|
35
35
|
sortBy?: "status" | "createdAt" | "updatedAt" | "nextInstallmentDueAt" | undefined;
|
|
@@ -8,3 +8,4 @@ export { unlockDeviceSchema, extendSessionSchema } from "./devices.validations";
|
|
|
8
8
|
export { payInstallmentSchema } from "./payinstallment.validations";
|
|
9
9
|
export { updateProfileSchema, requestPhoneChangeSchema, verifyPhoneChangeSchema, deleteAccountSchema, strongPasswordRegex, changePasswordSchema, } from "./account.validations";
|
|
10
10
|
export { updateAdminSchema, updateRiderSchema, deleteUserSchema, getUserSchema, getUsersSchema, hireAdminSchema, promoteAdminSchema, demoteAdminSchema, fireEmployeeSchema, upgradeToRiderSchema, resetPasswordSchema, } from "./users.admin.validations";
|
|
11
|
+
export { createProductSchema, updateProductSchema, getProductSchema, getProductsSchema, deactivateProductSchema, activateProductSchema, deleteProductSchema, } from "./product.validations";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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.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.requestOtpSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
|
|
4
|
-
exports.resetPasswordSchema = exports.upgradeToRiderSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.updateAdminSchema = exports.changePasswordSchema = exports.strongPasswordRegex = exports.deleteAccountSchema = void 0;
|
|
4
|
+
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.changePasswordSchema = exports.strongPasswordRegex = exports.deleteAccountSchema = 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");
|
|
@@ -84,3 +84,11 @@ Object.defineProperty(exports, "demoteAdminSchema", { enumerable: true, get: fun
|
|
|
84
84
|
Object.defineProperty(exports, "fireEmployeeSchema", { enumerable: true, get: function () { return users_admin_validations_1.fireEmployeeSchema; } });
|
|
85
85
|
Object.defineProperty(exports, "upgradeToRiderSchema", { enumerable: true, get: function () { return users_admin_validations_1.upgradeToRiderSchema; } });
|
|
86
86
|
Object.defineProperty(exports, "resetPasswordSchema", { enumerable: true, get: function () { return users_admin_validations_1.resetPasswordSchema; } });
|
|
87
|
+
var product_validations_1 = require("./product.validations");
|
|
88
|
+
Object.defineProperty(exports, "createProductSchema", { enumerable: true, get: function () { return product_validations_1.createProductSchema; } });
|
|
89
|
+
Object.defineProperty(exports, "updateProductSchema", { enumerable: true, get: function () { return product_validations_1.updateProductSchema; } });
|
|
90
|
+
Object.defineProperty(exports, "getProductSchema", { enumerable: true, get: function () { return product_validations_1.getProductSchema; } });
|
|
91
|
+
Object.defineProperty(exports, "getProductsSchema", { enumerable: true, get: function () { return product_validations_1.getProductsSchema; } });
|
|
92
|
+
Object.defineProperty(exports, "deactivateProductSchema", { enumerable: true, get: function () { return product_validations_1.deactivateProductSchema; } });
|
|
93
|
+
Object.defineProperty(exports, "activateProductSchema", { enumerable: true, get: function () { return product_validations_1.activateProductSchema; } });
|
|
94
|
+
Object.defineProperty(exports, "deleteProductSchema", { enumerable: true, get: function () { return product_validations_1.deleteProductSchema; } });
|
|
@@ -276,78 +276,78 @@ export declare const listBansSchema: z.ZodObject<{
|
|
|
276
276
|
page: number;
|
|
277
277
|
limit: number;
|
|
278
278
|
status?: "active" | "revoked" | undefined;
|
|
279
|
+
search?: string | undefined;
|
|
280
|
+
sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
|
|
281
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
279
282
|
userId?: string | undefined;
|
|
280
283
|
isPermanent?: "true" | "false" | undefined;
|
|
281
284
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
282
285
|
fromDate?: string | undefined;
|
|
283
286
|
toDate?: string | undefined;
|
|
284
|
-
search?: string | undefined;
|
|
285
|
-
sortBy?: "reason" | "bannedAt" | "createdAt" | undefined;
|
|
286
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
287
287
|
}, {
|
|
288
288
|
status?: "active" | "revoked" | undefined;
|
|
289
|
-
userId?: string | undefined;
|
|
290
|
-
isPermanent?: "true" | "false" | undefined;
|
|
291
289
|
page?: string | undefined;
|
|
292
290
|
limit?: string | undefined;
|
|
291
|
+
search?: string | undefined;
|
|
292
|
+
sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
|
|
293
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
294
|
+
userId?: string | undefined;
|
|
295
|
+
isPermanent?: "true" | "false" | undefined;
|
|
293
296
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
294
297
|
fromDate?: string | undefined;
|
|
295
298
|
toDate?: string | undefined;
|
|
296
|
-
search?: string | undefined;
|
|
297
|
-
sortBy?: "reason" | "bannedAt" | "createdAt" | undefined;
|
|
298
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
299
299
|
}>, {
|
|
300
300
|
page: number;
|
|
301
301
|
limit: number;
|
|
302
302
|
status?: "active" | "revoked" | undefined;
|
|
303
|
+
search?: string | undefined;
|
|
304
|
+
sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
|
|
305
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
303
306
|
userId?: string | undefined;
|
|
304
307
|
isPermanent?: "true" | "false" | undefined;
|
|
305
308
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
306
309
|
fromDate?: string | undefined;
|
|
307
310
|
toDate?: string | undefined;
|
|
308
|
-
search?: string | undefined;
|
|
309
|
-
sortBy?: "reason" | "bannedAt" | "createdAt" | undefined;
|
|
310
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
311
311
|
}, {
|
|
312
312
|
status?: "active" | "revoked" | undefined;
|
|
313
|
-
userId?: string | undefined;
|
|
314
|
-
isPermanent?: "true" | "false" | undefined;
|
|
315
313
|
page?: string | undefined;
|
|
316
314
|
limit?: string | undefined;
|
|
315
|
+
search?: string | undefined;
|
|
316
|
+
sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
|
|
317
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
318
|
+
userId?: string | undefined;
|
|
319
|
+
isPermanent?: "true" | "false" | undefined;
|
|
317
320
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
318
321
|
fromDate?: string | undefined;
|
|
319
322
|
toDate?: string | undefined;
|
|
320
|
-
search?: string | undefined;
|
|
321
|
-
sortBy?: "reason" | "bannedAt" | "createdAt" | undefined;
|
|
322
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
323
323
|
}>;
|
|
324
324
|
}, "strip", z.ZodTypeAny, {
|
|
325
325
|
query: {
|
|
326
326
|
page: number;
|
|
327
327
|
limit: number;
|
|
328
328
|
status?: "active" | "revoked" | undefined;
|
|
329
|
+
search?: string | undefined;
|
|
330
|
+
sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
|
|
331
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
329
332
|
userId?: string | undefined;
|
|
330
333
|
isPermanent?: "true" | "false" | undefined;
|
|
331
334
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
332
335
|
fromDate?: string | undefined;
|
|
333
336
|
toDate?: string | undefined;
|
|
334
|
-
search?: string | undefined;
|
|
335
|
-
sortBy?: "reason" | "bannedAt" | "createdAt" | undefined;
|
|
336
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
337
337
|
};
|
|
338
338
|
}, {
|
|
339
339
|
query: {
|
|
340
340
|
status?: "active" | "revoked" | undefined;
|
|
341
|
-
userId?: string | undefined;
|
|
342
|
-
isPermanent?: "true" | "false" | undefined;
|
|
343
341
|
page?: string | undefined;
|
|
344
342
|
limit?: string | undefined;
|
|
343
|
+
search?: string | undefined;
|
|
344
|
+
sortBy?: "createdAt" | "reason" | "bannedAt" | undefined;
|
|
345
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
346
|
+
userId?: string | undefined;
|
|
347
|
+
isPermanent?: "true" | "false" | undefined;
|
|
345
348
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
346
349
|
fromDate?: string | undefined;
|
|
347
350
|
toDate?: string | undefined;
|
|
348
|
-
search?: string | undefined;
|
|
349
|
-
sortBy?: "reason" | "bannedAt" | "createdAt" | undefined;
|
|
350
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
351
351
|
};
|
|
352
352
|
}>;
|
|
353
353
|
export declare const listSuspensionsSchema: z.ZodObject<{
|
|
@@ -367,72 +367,72 @@ export declare const listSuspensionsSchema: z.ZodObject<{
|
|
|
367
367
|
page: number;
|
|
368
368
|
limit: number;
|
|
369
369
|
status?: "active" | "expired" | "revoked" | undefined;
|
|
370
|
+
search?: string | undefined;
|
|
371
|
+
sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
|
|
372
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
370
373
|
userId?: string | undefined;
|
|
371
374
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
372
375
|
fromDate?: string | undefined;
|
|
373
376
|
toDate?: string | undefined;
|
|
374
|
-
search?: string | undefined;
|
|
375
|
-
sortBy?: "reason" | "endsAt" | "createdAt" | "startedAt" | undefined;
|
|
376
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
377
377
|
}, {
|
|
378
378
|
status?: "active" | "expired" | "revoked" | undefined;
|
|
379
|
-
userId?: string | undefined;
|
|
380
379
|
page?: string | undefined;
|
|
381
380
|
limit?: string | undefined;
|
|
381
|
+
search?: string | undefined;
|
|
382
|
+
sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
|
|
383
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
384
|
+
userId?: string | undefined;
|
|
382
385
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
383
386
|
fromDate?: string | undefined;
|
|
384
387
|
toDate?: string | undefined;
|
|
385
|
-
search?: string | undefined;
|
|
386
|
-
sortBy?: "reason" | "endsAt" | "createdAt" | "startedAt" | undefined;
|
|
387
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
388
388
|
}>, {
|
|
389
389
|
page: number;
|
|
390
390
|
limit: number;
|
|
391
391
|
status?: "active" | "expired" | "revoked" | undefined;
|
|
392
|
+
search?: string | undefined;
|
|
393
|
+
sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
|
|
394
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
392
395
|
userId?: string | undefined;
|
|
393
396
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
394
397
|
fromDate?: string | undefined;
|
|
395
398
|
toDate?: string | undefined;
|
|
396
|
-
search?: string | undefined;
|
|
397
|
-
sortBy?: "reason" | "endsAt" | "createdAt" | "startedAt" | undefined;
|
|
398
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
399
399
|
}, {
|
|
400
400
|
status?: "active" | "expired" | "revoked" | undefined;
|
|
401
|
-
userId?: string | undefined;
|
|
402
401
|
page?: string | undefined;
|
|
403
402
|
limit?: string | undefined;
|
|
403
|
+
search?: string | undefined;
|
|
404
|
+
sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
|
|
405
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
406
|
+
userId?: string | undefined;
|
|
404
407
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
405
408
|
fromDate?: string | undefined;
|
|
406
409
|
toDate?: string | undefined;
|
|
407
|
-
search?: string | undefined;
|
|
408
|
-
sortBy?: "reason" | "endsAt" | "createdAt" | "startedAt" | undefined;
|
|
409
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
410
410
|
}>;
|
|
411
411
|
}, "strip", z.ZodTypeAny, {
|
|
412
412
|
query: {
|
|
413
413
|
page: number;
|
|
414
414
|
limit: number;
|
|
415
415
|
status?: "active" | "expired" | "revoked" | undefined;
|
|
416
|
+
search?: string | undefined;
|
|
417
|
+
sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
|
|
418
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
416
419
|
userId?: string | undefined;
|
|
417
420
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
418
421
|
fromDate?: string | undefined;
|
|
419
422
|
toDate?: string | undefined;
|
|
420
|
-
search?: string | undefined;
|
|
421
|
-
sortBy?: "reason" | "endsAt" | "createdAt" | "startedAt" | undefined;
|
|
422
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
423
423
|
};
|
|
424
424
|
}, {
|
|
425
425
|
query: {
|
|
426
426
|
status?: "active" | "expired" | "revoked" | undefined;
|
|
427
|
-
userId?: string | undefined;
|
|
428
427
|
page?: string | undefined;
|
|
429
428
|
limit?: string | undefined;
|
|
429
|
+
search?: string | undefined;
|
|
430
|
+
sortBy?: "createdAt" | "reason" | "endsAt" | "startedAt" | undefined;
|
|
431
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
432
|
+
userId?: string | undefined;
|
|
430
433
|
appealStatus?: "pending" | "approved" | "rejected" | undefined;
|
|
431
434
|
fromDate?: string | undefined;
|
|
432
435
|
toDate?: string | undefined;
|
|
433
|
-
search?: string | undefined;
|
|
434
|
-
sortBy?: "reason" | "endsAt" | "createdAt" | "startedAt" | undefined;
|
|
435
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
436
436
|
};
|
|
437
437
|
}>;
|
|
438
438
|
export declare const listPendingAppealsSchema: z.ZodObject<{
|
|
@@ -21,21 +21,21 @@ export declare const payInstallmentSchema: z.ZodObject<{
|
|
|
21
21
|
provider?: "mtn_momo" | "airtel_money" | undefined;
|
|
22
22
|
}>;
|
|
23
23
|
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
params: {
|
|
25
|
+
planId: string;
|
|
26
|
+
installmentId: string;
|
|
27
|
+
};
|
|
24
28
|
body: {
|
|
25
29
|
phoneNumber: string;
|
|
26
30
|
provider: "mtn_momo" | "airtel_money";
|
|
27
31
|
};
|
|
32
|
+
}, {
|
|
28
33
|
params: {
|
|
29
34
|
planId: string;
|
|
30
35
|
installmentId: string;
|
|
31
36
|
};
|
|
32
|
-
}, {
|
|
33
37
|
body: {
|
|
34
38
|
phoneNumber: string;
|
|
35
39
|
provider?: "mtn_momo" | "airtel_money" | undefined;
|
|
36
40
|
};
|
|
37
|
-
params: {
|
|
38
|
-
planId: string;
|
|
39
|
-
installmentId: string;
|
|
40
|
-
};
|
|
41
41
|
}>;
|