vr-commons 1.0.188 → 1.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/middlewares/index.d.ts +1 -0
- package/dist/middlewares/index.js +4 -1
- package/dist/middlewares/shared/shared.appVersion.middleware.d.ts +9 -0
- package/dist/middlewares/shared/shared.appVersion.middleware.js +175 -0
- package/dist/validations/admin/admin.devicePayments.validations.d.ts +6 -6
- package/dist/validations/admin/admin.devices.validations.d.ts +12 -12
- package/dist/validations/admin/admin.eventLogs.validations.d.ts +24 -24
- package/dist/validations/admin/admin.installments.validations.d.ts +4 -4
- package/dist/validations/admin/admin.pricings.validations.d.ts +8 -8
- package/dist/validations/admin/admin.products.validations.d.ts +12 -12
- package/dist/validations/admin/admin.users.validations.d.ts +50 -50
- package/dist/validations/shared/shared.account.validations.d.ts +10 -10
- package/dist/validations/shared/shared.appSpecs.validations.d.ts +70 -48
- package/dist/validations/shared/shared.appSpecs.validations.js +7 -2
- package/dist/validations/shared/shared.auth.validations.d.ts +28 -28
- package/dist/validations/shared/shared.moderation.validations.d.ts +18 -18
- package/dist/validations/shared/shared.profiles.validations.d.ts +86 -86
- package/dist/validations/users/users.devicePaymentPlans.validations.d.ts +6 -6
- package/package.json +2 -2
|
@@ -3,3 +3,4 @@ export { checkUserAuthentication } from "./users/users.auth.middleware";
|
|
|
3
3
|
export { checkIsUserBanned, checkIsUserSuspended, checkUserAccountStatus, } from "./shared/shared.account.middleware";
|
|
4
4
|
export { errorHandler } from "./shared/shared.errorHandler.middleware";
|
|
5
5
|
export { loadAppRuntimeConfig } from "./shared/shared.appSpecs.middleware";
|
|
6
|
+
export { clearAppVersionMinimumsCache, enforceMinimumMobileAppVersion, } from "./shared/shared.appVersion.middleware";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadAppRuntimeConfig = exports.errorHandler = exports.checkUserAccountStatus = exports.checkIsUserSuspended = exports.checkIsUserBanned = exports.checkUserAuthentication = exports.checkAdminAuthentication = void 0;
|
|
3
|
+
exports.enforceMinimumMobileAppVersion = exports.clearAppVersionMinimumsCache = exports.loadAppRuntimeConfig = exports.errorHandler = exports.checkUserAccountStatus = exports.checkIsUserSuspended = exports.checkIsUserBanned = exports.checkUserAuthentication = exports.checkAdminAuthentication = void 0;
|
|
4
4
|
var admin_auth_middleware_1 = require("./admin/admin.auth.middleware");
|
|
5
5
|
Object.defineProperty(exports, "checkAdminAuthentication", { enumerable: true, get: function () { return admin_auth_middleware_1.checkAdminAuthentication; } });
|
|
6
6
|
var users_auth_middleware_1 = require("./users/users.auth.middleware");
|
|
@@ -13,3 +13,6 @@ var shared_errorHandler_middleware_1 = require("./shared/shared.errorHandler.mid
|
|
|
13
13
|
Object.defineProperty(exports, "errorHandler", { enumerable: true, get: function () { return shared_errorHandler_middleware_1.errorHandler; } });
|
|
14
14
|
var shared_appSpecs_middleware_1 = require("./shared/shared.appSpecs.middleware");
|
|
15
15
|
Object.defineProperty(exports, "loadAppRuntimeConfig", { enumerable: true, get: function () { return shared_appSpecs_middleware_1.loadAppRuntimeConfig; } });
|
|
16
|
+
var shared_appVersion_middleware_1 = require("./shared/shared.appVersion.middleware");
|
|
17
|
+
Object.defineProperty(exports, "clearAppVersionMinimumsCache", { enumerable: true, get: function () { return shared_appVersion_middleware_1.clearAppVersionMinimumsCache; } });
|
|
18
|
+
Object.defineProperty(exports, "enforceMinimumMobileAppVersion", { enumerable: true, get: function () { return shared_appVersion_middleware_1.enforceMinimumMobileAppVersion; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from "express";
|
|
2
|
+
/** Clear this process's cached app-version policy after an AppSpecs update. */
|
|
3
|
+
export declare function clearAppVersionMinimumsCache(appName?: string): void;
|
|
4
|
+
/**
|
|
5
|
+
* Enforce the platform-specific minimum app version/build for requests that
|
|
6
|
+
* explicitly identify as Viberide mobile. Requests from Postman, tests, and
|
|
7
|
+
* other clients without X-App-Client pass through unchanged.
|
|
8
|
+
*/
|
|
9
|
+
export declare function enforceMinimumMobileAppVersion(appName?: string): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearAppVersionMinimumsCache = clearAppVersionMinimumsCache;
|
|
4
|
+
exports.enforceMinimumMobileAppVersion = enforceMinimumMobileAppVersion;
|
|
5
|
+
const vr_models_1 = require("vr-models");
|
|
6
|
+
const MOBILE_APP_CLIENT = "VIBERIDE-MOBILE-APP";
|
|
7
|
+
const DEFAULT_APP_NAME = "VIBERIDE-MOBILE-APP";
|
|
8
|
+
const CACHE_TTL_MS = 30_000;
|
|
9
|
+
const minimumsCache = new Map();
|
|
10
|
+
const minimumsLoads = new Map();
|
|
11
|
+
function nullableString(value) {
|
|
12
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
13
|
+
}
|
|
14
|
+
async function loadVersionMinimums(appName) {
|
|
15
|
+
const cached = minimumsCache.get(appName);
|
|
16
|
+
if (cached && cached.expiresAt > Date.now())
|
|
17
|
+
return cached.value;
|
|
18
|
+
const pending = minimumsLoads.get(appName);
|
|
19
|
+
if (pending)
|
|
20
|
+
return pending;
|
|
21
|
+
const load = (async () => {
|
|
22
|
+
const specs = await vr_models_1.AppSpecs.getByAppName(appName);
|
|
23
|
+
const value = {
|
|
24
|
+
androidVersion: nullableString(specs?.minimumAndroidAppVersion),
|
|
25
|
+
androidBuild: typeof specs?.minimumAndroidAppBuild === "number"
|
|
26
|
+
? specs.minimumAndroidAppBuild
|
|
27
|
+
: null,
|
|
28
|
+
iosVersion: nullableString(specs?.minimumIosAppVersion),
|
|
29
|
+
iosBuild: nullableString(specs?.minimumIosAppBuild),
|
|
30
|
+
forceUpdateMessage: nullableString(specs?.forceUpdateMessage),
|
|
31
|
+
};
|
|
32
|
+
minimumsCache.set(appName, { value, expiresAt: Date.now() + CACHE_TTL_MS });
|
|
33
|
+
return value;
|
|
34
|
+
})();
|
|
35
|
+
minimumsLoads.set(appName, load);
|
|
36
|
+
try {
|
|
37
|
+
return await load;
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
if (minimumsLoads.get(appName) === load)
|
|
41
|
+
minimumsLoads.delete(appName);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Clear this process's cached app-version policy after an AppSpecs update. */
|
|
45
|
+
function clearAppVersionMinimumsCache(appName) {
|
|
46
|
+
if (appName)
|
|
47
|
+
minimumsCache.delete(appName);
|
|
48
|
+
else
|
|
49
|
+
minimumsCache.clear();
|
|
50
|
+
}
|
|
51
|
+
function parseDottedNumbers(value) {
|
|
52
|
+
if (!/^\d+(?:\.\d+)*$/.test(value))
|
|
53
|
+
return null;
|
|
54
|
+
const parts = value.split(".").map(Number);
|
|
55
|
+
return parts.every(Number.isSafeInteger) ? parts : null;
|
|
56
|
+
}
|
|
57
|
+
function compareDottedNumbers(left, right) {
|
|
58
|
+
const leftParts = parseDottedNumbers(left);
|
|
59
|
+
const rightParts = parseDottedNumbers(right);
|
|
60
|
+
if (!leftParts || !rightParts)
|
|
61
|
+
return null;
|
|
62
|
+
const length = Math.max(leftParts.length, rightParts.length);
|
|
63
|
+
for (let index = 0; index < length; index += 1) {
|
|
64
|
+
const leftPart = leftParts[index] ?? 0;
|
|
65
|
+
const rightPart = rightParts[index] ?? 0;
|
|
66
|
+
if (leftPart !== rightPart)
|
|
67
|
+
return leftPart < rightPart ? -1 : 1;
|
|
68
|
+
}
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
function compareBuild(platform, current, minimum) {
|
|
72
|
+
if (platform === "android") {
|
|
73
|
+
if (!/^\d+$/.test(current) || !/^\d+$/.test(minimum))
|
|
74
|
+
return null;
|
|
75
|
+
const currentNumber = Number(current);
|
|
76
|
+
const minimumNumber = Number(minimum);
|
|
77
|
+
if (!Number.isSafeInteger(currentNumber) || !Number.isSafeInteger(minimumNumber))
|
|
78
|
+
return null;
|
|
79
|
+
return currentNumber === minimumNumber ? 0 : currentNumber < minimumNumber ? -1 : 1;
|
|
80
|
+
}
|
|
81
|
+
return compareDottedNumbers(current, minimum);
|
|
82
|
+
}
|
|
83
|
+
function compareAppVersion(current, minimum) {
|
|
84
|
+
const currentParts = parseDottedNumbers(current);
|
|
85
|
+
const minimumParts = parseDottedNumbers(minimum);
|
|
86
|
+
if (!currentParts || !minimumParts || currentParts.length !== 3 || minimumParts.length !== 3) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return compareDottedNumbers(current, minimum);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Enforce the platform-specific minimum app version/build for requests that
|
|
93
|
+
* explicitly identify as Viberide mobile. Requests from Postman, tests, and
|
|
94
|
+
* other clients without X-App-Client pass through unchanged.
|
|
95
|
+
*/
|
|
96
|
+
function enforceMinimumMobileAppVersion(appName = DEFAULT_APP_NAME) {
|
|
97
|
+
return async (req, res, next) => {
|
|
98
|
+
const appClient = req.get("X-App-Client")?.trim() || null;
|
|
99
|
+
const platformHeader = req.get("X-App-Platform")?.trim().toLowerCase() || null;
|
|
100
|
+
const appVersion = req.get("X-App-Version")?.trim() || null;
|
|
101
|
+
const appBuild = req.get("X-App-Build")?.trim() || null;
|
|
102
|
+
// Log only app metadata; never dump authorization or other request headers.
|
|
103
|
+
console.info("[APP VERSION REQUEST]", { appClient, platform: platformHeader, appVersion, appBuild });
|
|
104
|
+
if (appClient?.toUpperCase() !== MOBILE_APP_CLIENT) {
|
|
105
|
+
next();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if ((platformHeader !== "android" && platformHeader !== "ios") ||
|
|
109
|
+
!appVersion ||
|
|
110
|
+
!appBuild) {
|
|
111
|
+
res.status(400).json({
|
|
112
|
+
success: false,
|
|
113
|
+
code: "INVALID_APP_VERSION_HEADERS",
|
|
114
|
+
message: "The mobile app version headers are missing or invalid.",
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const platform = platformHeader;
|
|
119
|
+
const parsedVersion = parseDottedNumbers(appVersion);
|
|
120
|
+
const parsedBuild = platform === "android"
|
|
121
|
+
? /^\d+$/.test(appBuild) && Number.isSafeInteger(Number(appBuild))
|
|
122
|
+
: parseDottedNumbers(appBuild) !== null;
|
|
123
|
+
if (!parsedVersion || parsedVersion.length !== 3 || !parsedBuild) {
|
|
124
|
+
res.status(400).json({
|
|
125
|
+
success: false,
|
|
126
|
+
code: "INVALID_APP_VERSION_HEADERS",
|
|
127
|
+
message: "The mobile app version headers are missing or invalid.",
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
const minimums = await loadVersionMinimums(appName);
|
|
133
|
+
const minimumVersion = platform === "android"
|
|
134
|
+
? minimums.androidVersion
|
|
135
|
+
: minimums.iosVersion;
|
|
136
|
+
const minimumBuildValue = platform === "android"
|
|
137
|
+
? minimums.androidBuild
|
|
138
|
+
: minimums.iosBuild;
|
|
139
|
+
const minimumBuild = minimumBuildValue === null ? null : String(minimumBuildValue);
|
|
140
|
+
const versionComparison = minimumVersion
|
|
141
|
+
? compareAppVersion(appVersion, minimumVersion)
|
|
142
|
+
: null;
|
|
143
|
+
const buildComparison = minimumBuild
|
|
144
|
+
? compareBuild(platform, appBuild, minimumBuild)
|
|
145
|
+
: null;
|
|
146
|
+
if (versionComparison === null && minimumVersion) {
|
|
147
|
+
throw new Error(`Invalid configured minimum ${platform} app version: ${minimumVersion}`);
|
|
148
|
+
}
|
|
149
|
+
if (buildComparison === null && minimumBuild) {
|
|
150
|
+
throw new Error(`Invalid configured minimum ${platform} app build: ${minimumBuild}`);
|
|
151
|
+
}
|
|
152
|
+
const belowVersion = versionComparison !== null && versionComparison < 0;
|
|
153
|
+
const belowBuild = buildComparison !== null && buildComparison < 0;
|
|
154
|
+
if (belowVersion || belowBuild) {
|
|
155
|
+
res.status(426).json({
|
|
156
|
+
success: false,
|
|
157
|
+
code: "APP_UPDATE_REQUIRED",
|
|
158
|
+
message: minimums.forceUpdateMessage || "Please update Viberide to continue.",
|
|
159
|
+
data: {
|
|
160
|
+
platform,
|
|
161
|
+
minimumAppVersion: minimumVersion,
|
|
162
|
+
minimumAppBuild: minimumBuild,
|
|
163
|
+
currentAppVersion: appVersion,
|
|
164
|
+
currentAppBuild: appBuild,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
next();
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
next(error);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
@@ -45,17 +45,17 @@ export declare const listPlansSchema: z.ZodObject<{
|
|
|
45
45
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
46
46
|
isOverdue?: "true" | "false" | undefined;
|
|
47
47
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
48
|
-
sortOrder?: "
|
|
48
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
49
49
|
deviceId?: string | undefined;
|
|
50
50
|
}, {
|
|
51
51
|
search?: string | undefined;
|
|
52
52
|
limit?: string | undefined;
|
|
53
53
|
userId?: string | undefined;
|
|
54
|
-
page?: string | undefined;
|
|
55
54
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
56
55
|
isOverdue?: "true" | "false" | undefined;
|
|
56
|
+
page?: string | undefined;
|
|
57
57
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
58
|
-
sortOrder?: "
|
|
58
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
59
59
|
deviceId?: string | undefined;
|
|
60
60
|
}>;
|
|
61
61
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -67,7 +67,7 @@ export declare const listPlansSchema: z.ZodObject<{
|
|
|
67
67
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
68
68
|
isOverdue?: "true" | "false" | undefined;
|
|
69
69
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
70
|
-
sortOrder?: "
|
|
70
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
71
71
|
deviceId?: string | undefined;
|
|
72
72
|
};
|
|
73
73
|
}, {
|
|
@@ -75,11 +75,11 @@ export declare const listPlansSchema: z.ZodObject<{
|
|
|
75
75
|
search?: string | undefined;
|
|
76
76
|
limit?: string | undefined;
|
|
77
77
|
userId?: string | undefined;
|
|
78
|
-
page?: string | undefined;
|
|
79
78
|
status?: "ACTIVE" | "DEFAULTED" | "PENDING" | "COMPLETED" | "CANCELLED" | undefined;
|
|
80
79
|
isOverdue?: "true" | "false" | undefined;
|
|
80
|
+
page?: string | undefined;
|
|
81
81
|
sortBy?: "createdAt" | "updatedAt" | "paidAmount" | "outstandingAmount" | "nextInstallmentDueAt" | undefined;
|
|
82
|
-
sortOrder?: "
|
|
82
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
83
83
|
deviceId?: string | undefined;
|
|
84
84
|
};
|
|
85
85
|
}>;
|
|
@@ -68,23 +68,23 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
68
68
|
}, "strip", z.ZodTypeAny, {
|
|
69
69
|
search?: string | undefined;
|
|
70
70
|
limit?: number | undefined;
|
|
71
|
-
page?: number | undefined;
|
|
72
71
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
73
72
|
productId?: string | undefined;
|
|
73
|
+
page?: number | undefined;
|
|
74
74
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
75
|
-
sortOrder?: "
|
|
76
|
-
dedicatedUser?: "
|
|
75
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
76
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
77
77
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
78
78
|
isAssigned?: "true" | "false" | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
search?: string | undefined;
|
|
81
81
|
limit?: string | undefined;
|
|
82
|
-
page?: string | undefined;
|
|
83
82
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
84
83
|
productId?: string | undefined;
|
|
84
|
+
page?: string | undefined;
|
|
85
85
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
86
|
-
sortOrder?: "
|
|
87
|
-
dedicatedUser?: "
|
|
86
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
87
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
88
88
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
89
89
|
isAssigned?: "true" | "false" | undefined;
|
|
90
90
|
}>;
|
|
@@ -92,12 +92,12 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
92
92
|
query: {
|
|
93
93
|
search?: string | undefined;
|
|
94
94
|
limit?: number | undefined;
|
|
95
|
-
page?: number | undefined;
|
|
96
95
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
97
96
|
productId?: string | undefined;
|
|
97
|
+
page?: number | undefined;
|
|
98
98
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
99
|
-
sortOrder?: "
|
|
100
|
-
dedicatedUser?: "
|
|
99
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
100
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
101
101
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
102
102
|
isAssigned?: "true" | "false" | undefined;
|
|
103
103
|
};
|
|
@@ -105,12 +105,12 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
105
105
|
query: {
|
|
106
106
|
search?: string | undefined;
|
|
107
107
|
limit?: string | undefined;
|
|
108
|
-
page?: string | undefined;
|
|
109
108
|
status?: "locked" | "unlocked" | "disabled" | undefined;
|
|
110
109
|
productId?: string | undefined;
|
|
110
|
+
page?: string | undefined;
|
|
111
111
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
112
|
-
sortOrder?: "
|
|
113
|
-
dedicatedUser?: "
|
|
112
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
113
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
114
114
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
115
115
|
isAssigned?: "true" | "false" | undefined;
|
|
116
116
|
};
|
|
@@ -20,19 +20,19 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
20
20
|
}, "strip", z.ZodTypeAny, {
|
|
21
21
|
limit: number;
|
|
22
22
|
page: number;
|
|
23
|
-
sortBy: "createdAt" | "
|
|
24
|
-
sortOrder: "
|
|
23
|
+
sortBy: "createdAt" | "actorType" | "action" | "entity";
|
|
24
|
+
sortOrder: "DESC" | "ASC";
|
|
25
25
|
hasDeviceSession: boolean;
|
|
26
26
|
search?: string | undefined;
|
|
27
27
|
firstName?: string | undefined;
|
|
28
28
|
lastName?: string | undefined;
|
|
29
|
-
|
|
29
|
+
fromDate?: string | undefined;
|
|
30
|
+
toDate?: string | undefined;
|
|
31
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
30
32
|
actorId?: string | undefined;
|
|
31
33
|
action?: string | undefined;
|
|
32
34
|
entity?: string | undefined;
|
|
33
|
-
|
|
34
|
-
toDate?: string | undefined;
|
|
35
|
-
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
35
|
+
entityId?: string | undefined;
|
|
36
36
|
actorName?: string | undefined;
|
|
37
37
|
}, {
|
|
38
38
|
search?: string | undefined;
|
|
@@ -40,15 +40,15 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
40
40
|
firstName?: string | undefined;
|
|
41
41
|
lastName?: string | undefined;
|
|
42
42
|
page?: string | undefined;
|
|
43
|
-
|
|
43
|
+
sortBy?: "createdAt" | "actorType" | "action" | "entity" | undefined;
|
|
44
|
+
fromDate?: string | undefined;
|
|
45
|
+
toDate?: string | undefined;
|
|
46
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
47
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
44
48
|
actorId?: string | undefined;
|
|
45
49
|
action?: string | undefined;
|
|
46
50
|
entity?: string | undefined;
|
|
47
|
-
|
|
48
|
-
fromDate?: string | undefined;
|
|
49
|
-
toDate?: string | undefined;
|
|
50
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
51
|
-
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
51
|
+
entityId?: string | undefined;
|
|
52
52
|
actorName?: string | undefined;
|
|
53
53
|
hasDeviceSession?: string | undefined;
|
|
54
54
|
}>, any, {
|
|
@@ -57,15 +57,15 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
57
57
|
firstName?: string | undefined;
|
|
58
58
|
lastName?: string | undefined;
|
|
59
59
|
page?: string | undefined;
|
|
60
|
-
|
|
60
|
+
sortBy?: "createdAt" | "actorType" | "action" | "entity" | undefined;
|
|
61
|
+
fromDate?: string | undefined;
|
|
62
|
+
toDate?: string | undefined;
|
|
63
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
64
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
61
65
|
actorId?: string | undefined;
|
|
62
66
|
action?: string | undefined;
|
|
63
67
|
entity?: string | undefined;
|
|
64
|
-
|
|
65
|
-
fromDate?: string | undefined;
|
|
66
|
-
toDate?: string | undefined;
|
|
67
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
68
|
-
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
68
|
+
entityId?: string | undefined;
|
|
69
69
|
actorName?: string | undefined;
|
|
70
70
|
hasDeviceSession?: string | undefined;
|
|
71
71
|
}>;
|
|
@@ -78,15 +78,15 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
78
78
|
firstName?: string | undefined;
|
|
79
79
|
lastName?: string | undefined;
|
|
80
80
|
page?: string | undefined;
|
|
81
|
-
|
|
81
|
+
sortBy?: "createdAt" | "actorType" | "action" | "entity" | undefined;
|
|
82
|
+
fromDate?: string | undefined;
|
|
83
|
+
toDate?: string | undefined;
|
|
84
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
85
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
82
86
|
actorId?: string | undefined;
|
|
83
87
|
action?: string | undefined;
|
|
84
88
|
entity?: string | undefined;
|
|
85
|
-
|
|
86
|
-
fromDate?: string | undefined;
|
|
87
|
-
toDate?: string | undefined;
|
|
88
|
-
sortOrder?: "ASC" | "DESC" | undefined;
|
|
89
|
-
actorType?: "RIDER" | "PASSENGER" | "AGENT" | "ADMIN" | "SUPER_ADMIN" | undefined;
|
|
89
|
+
entityId?: string | undefined;
|
|
90
90
|
actorName?: string | undefined;
|
|
91
91
|
hasDeviceSession?: string | undefined;
|
|
92
92
|
};
|
|
@@ -7,27 +7,27 @@ export declare const getInstallmentsSchema: z.ZodObject<{
|
|
|
7
7
|
limit: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
limit?: number | undefined;
|
|
10
|
-
page?: number | undefined;
|
|
11
10
|
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
11
|
+
page?: number | undefined;
|
|
12
12
|
planId?: string | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
limit?: string | undefined;
|
|
15
|
-
page?: string | undefined;
|
|
16
15
|
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
16
|
+
page?: string | undefined;
|
|
17
17
|
planId?: string | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
20
|
query: {
|
|
21
21
|
limit?: number | undefined;
|
|
22
|
-
page?: number | undefined;
|
|
23
22
|
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
23
|
+
page?: number | undefined;
|
|
24
24
|
planId?: string | undefined;
|
|
25
25
|
};
|
|
26
26
|
}, {
|
|
27
27
|
query: {
|
|
28
28
|
limit?: string | undefined;
|
|
29
|
-
page?: string | undefined;
|
|
30
29
|
status?: "PENDING" | "PAID" | "OVERDUE" | "SKIPPED" | undefined;
|
|
30
|
+
page?: string | undefined;
|
|
31
31
|
planId?: string | undefined;
|
|
32
32
|
};
|
|
33
33
|
}>;
|
|
@@ -249,10 +249,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
249
249
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
250
250
|
limit?: number | undefined;
|
|
251
251
|
isActive?: "true" | "false" | undefined;
|
|
252
|
-
page?: number | undefined;
|
|
253
252
|
productId?: string | undefined;
|
|
253
|
+
page?: number | undefined;
|
|
254
254
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
255
|
-
sortOrder?: "
|
|
255
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
256
256
|
minAmount?: number | undefined;
|
|
257
257
|
maxAmount?: number | undefined;
|
|
258
258
|
}, {
|
|
@@ -260,10 +260,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
260
260
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
261
261
|
limit?: string | undefined;
|
|
262
262
|
isActive?: "true" | "false" | undefined;
|
|
263
|
-
page?: string | undefined;
|
|
264
263
|
productId?: string | undefined;
|
|
264
|
+
page?: string | undefined;
|
|
265
265
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
266
|
-
sortOrder?: "
|
|
266
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
267
267
|
minAmount?: string | undefined;
|
|
268
268
|
maxAmount?: string | undefined;
|
|
269
269
|
}>;
|
|
@@ -273,10 +273,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
273
273
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
274
274
|
limit?: number | undefined;
|
|
275
275
|
isActive?: "true" | "false" | undefined;
|
|
276
|
-
page?: number | undefined;
|
|
277
276
|
productId?: string | undefined;
|
|
277
|
+
page?: number | undefined;
|
|
278
278
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
279
|
-
sortOrder?: "
|
|
279
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
280
280
|
minAmount?: number | undefined;
|
|
281
281
|
maxAmount?: number | undefined;
|
|
282
282
|
};
|
|
@@ -286,10 +286,10 @@ export declare const getPricingsSchema: z.ZodObject<{
|
|
|
286
286
|
type?: "HIRE_PURCHASE" | "FULL_PAYMENT" | undefined;
|
|
287
287
|
limit?: string | undefined;
|
|
288
288
|
isActive?: "true" | "false" | undefined;
|
|
289
|
-
page?: string | undefined;
|
|
290
289
|
productId?: string | undefined;
|
|
290
|
+
page?: string | undefined;
|
|
291
291
|
sortBy?: "createdAt" | "updatedAt" | "name" | "unitPrice" | undefined;
|
|
292
|
-
sortOrder?: "
|
|
292
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
293
293
|
minAmount?: string | undefined;
|
|
294
294
|
maxAmount?: string | undefined;
|
|
295
295
|
};
|
|
@@ -40,20 +40,20 @@ export declare const updateProductSchema: z.ZodObject<{
|
|
|
40
40
|
stock: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
41
41
|
isActive: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
description?: string | null | undefined;
|
|
44
43
|
isActive?: boolean | undefined;
|
|
44
|
+
description?: string | null | undefined;
|
|
45
45
|
name?: string | undefined;
|
|
46
46
|
stock?: number | undefined;
|
|
47
47
|
}, {
|
|
48
|
-
description?: unknown;
|
|
49
48
|
isActive?: unknown;
|
|
49
|
+
description?: unknown;
|
|
50
50
|
name?: unknown;
|
|
51
51
|
stock?: unknown;
|
|
52
52
|
}>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
54
|
body: {
|
|
55
|
-
description?: string | null | undefined;
|
|
56
55
|
isActive?: boolean | undefined;
|
|
56
|
+
description?: string | null | undefined;
|
|
57
57
|
name?: string | undefined;
|
|
58
58
|
stock?: number | undefined;
|
|
59
59
|
};
|
|
@@ -62,8 +62,8 @@ export declare const updateProductSchema: z.ZodObject<{
|
|
|
62
62
|
};
|
|
63
63
|
}, {
|
|
64
64
|
body: {
|
|
65
|
-
description?: unknown;
|
|
66
65
|
isActive?: unknown;
|
|
66
|
+
description?: unknown;
|
|
67
67
|
name?: unknown;
|
|
68
68
|
stock?: unknown;
|
|
69
69
|
};
|
|
@@ -103,7 +103,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
103
103
|
isActive?: "true" | "false" | undefined;
|
|
104
104
|
page?: number | undefined;
|
|
105
105
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
106
|
-
sortOrder?: "
|
|
106
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
107
107
|
minStock?: number | undefined;
|
|
108
108
|
}, {
|
|
109
109
|
search?: string | undefined;
|
|
@@ -111,7 +111,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
111
111
|
isActive?: "true" | "false" | undefined;
|
|
112
112
|
page?: string | undefined;
|
|
113
113
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
114
|
-
sortOrder?: "
|
|
114
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
115
115
|
minStock?: string | undefined;
|
|
116
116
|
}>;
|
|
117
117
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -121,7 +121,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
121
121
|
isActive?: "true" | "false" | undefined;
|
|
122
122
|
page?: number | undefined;
|
|
123
123
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
124
|
-
sortOrder?: "
|
|
124
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
125
125
|
minStock?: number | undefined;
|
|
126
126
|
};
|
|
127
127
|
}, {
|
|
@@ -131,7 +131,7 @@ export declare const getProductsSchema: z.ZodObject<{
|
|
|
131
131
|
isActive?: "true" | "false" | undefined;
|
|
132
132
|
page?: string | undefined;
|
|
133
133
|
sortBy?: "createdAt" | "updatedAt" | "name" | "stock" | undefined;
|
|
134
|
-
sortOrder?: "
|
|
134
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
135
135
|
minStock?: string | undefined;
|
|
136
136
|
};
|
|
137
137
|
}>;
|
|
@@ -199,15 +199,15 @@ export declare const updateStockSchema: z.ZodObject<{
|
|
|
199
199
|
amount: z.ZodNumber;
|
|
200
200
|
}, "strip", z.ZodTypeAny, {
|
|
201
201
|
amount: number;
|
|
202
|
-
operation: "
|
|
202
|
+
operation: "increment" | "decrement" | "set";
|
|
203
203
|
}, {
|
|
204
204
|
amount: number;
|
|
205
|
-
operation: "
|
|
205
|
+
operation: "increment" | "decrement" | "set";
|
|
206
206
|
}>;
|
|
207
207
|
}, "strip", z.ZodTypeAny, {
|
|
208
208
|
body: {
|
|
209
209
|
amount: number;
|
|
210
|
-
operation: "
|
|
210
|
+
operation: "increment" | "decrement" | "set";
|
|
211
211
|
};
|
|
212
212
|
params: {
|
|
213
213
|
id: string;
|
|
@@ -215,7 +215,7 @@ export declare const updateStockSchema: z.ZodObject<{
|
|
|
215
215
|
}, {
|
|
216
216
|
body: {
|
|
217
217
|
amount: number;
|
|
218
|
-
operation: "
|
|
218
|
+
operation: "increment" | "decrement" | "set";
|
|
219
219
|
};
|
|
220
220
|
params: {
|
|
221
221
|
id: string;
|