vr-commons 1.0.187 → 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/constants/regex.constants.d.ts +2 -2
- package/dist/constants/regex.constants.js +6 -3
- 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/utils/admin/admin.devices.utils.d.ts +3 -5
- package/dist/utils/admin/admin.devices.utils.js +14 -11
- package/dist/validations/admin/admin.devicePayments.validations.js +2 -2
- package/dist/validations/admin/admin.devices.validations.d.ts +4 -4
- package/dist/validations/admin/admin.devices.validations.js +11 -8
- package/dist/validations/admin/admin.eventLogs.validations.d.ts +4 -4
- package/dist/validations/shared/shared.appSpecs.validations.d.ts +108 -86
- package/dist/validations/shared/shared.appSpecs.validations.js +7 -2
- package/dist/validations/shared/shared.auth.validations.d.ts +8 -8
- package/dist/validations/shared/shared.profiles.validations.d.ts +10 -10
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEVICE_SERIAL_PREFIXES, DEVICE_PAIR_ID_REGEX, DEVICE_PAIR_ID_SUFFIX_REGEX, DEVICE_SERIAL_NUMBER_REGEX } from "vr-models";
|
|
1
2
|
/** Shared regular expressions used across validation and utility modules. */
|
|
2
3
|
export declare const PHONE_NUMBER_REGEX: RegExp;
|
|
3
4
|
export declare const LOCAL_RWANDA_PHONE_NUMBER_REGEX: RegExp;
|
|
@@ -9,8 +10,7 @@ export declare const FOUR_DIGIT_PIN_REGEX: RegExp;
|
|
|
9
10
|
export declare const JACKET_ID_REGEX: RegExp;
|
|
10
11
|
export declare const PLATE_NUMBER_REGEX: RegExp;
|
|
11
12
|
export declare const RWANDA_PLATE_NUMBER_REGEX: RegExp;
|
|
12
|
-
export
|
|
13
|
-
export declare const DEVICE_PAIR_ID_REGEX: RegExp;
|
|
13
|
+
export { DEVICE_SERIAL_PREFIXES, DEVICE_SERIAL_NUMBER_REGEX, DEVICE_PAIR_ID_REGEX, DEVICE_PAIR_ID_SUFFIX_REGEX, };
|
|
14
14
|
export declare const ISO_DATE_REGEX: RegExp;
|
|
15
15
|
export declare const DAY_MONTH_YEAR_REGEX: RegExp;
|
|
16
16
|
export declare const DAY_MONTH_YEAR_SLASH_REGEX: RegExp;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BEARER_TOKEN_PREFIX_REGEX = exports.NUMERIC_STRING_REGEX = exports.ISO_DATE_SLASH_REGEX = exports.DAY_MONTH_YEAR_SLASH_REGEX = exports.DAY_MONTH_YEAR_REGEX = exports.ISO_DATE_REGEX = exports.DEVICE_PAIR_ID_REGEX = exports.DEVICE_SERIAL_NUMBER_REGEX = exports.RWANDA_PLATE_NUMBER_REGEX = exports.PLATE_NUMBER_REGEX = exports.JACKET_ID_REGEX = exports.FOUR_DIGIT_PIN_REGEX = exports.RIDER_PIN_REGEX = exports.STRONG_PASSWORD_REGEX = exports.PASSWORD_REGEX = exports.EMAIL_ADDRESS_REGEX = exports.LOCAL_RWANDA_PHONE_NUMBER_REGEX = exports.PHONE_NUMBER_REGEX = void 0;
|
|
3
|
+
exports.BEARER_TOKEN_PREFIX_REGEX = exports.NUMERIC_STRING_REGEX = exports.ISO_DATE_SLASH_REGEX = exports.DAY_MONTH_YEAR_SLASH_REGEX = exports.DAY_MONTH_YEAR_REGEX = exports.ISO_DATE_REGEX = exports.DEVICE_PAIR_ID_SUFFIX_REGEX = exports.DEVICE_PAIR_ID_REGEX = exports.DEVICE_SERIAL_NUMBER_REGEX = exports.DEVICE_SERIAL_PREFIXES = exports.RWANDA_PLATE_NUMBER_REGEX = exports.PLATE_NUMBER_REGEX = exports.JACKET_ID_REGEX = exports.FOUR_DIGIT_PIN_REGEX = exports.RIDER_PIN_REGEX = exports.STRONG_PASSWORD_REGEX = exports.PASSWORD_REGEX = exports.EMAIL_ADDRESS_REGEX = exports.LOCAL_RWANDA_PHONE_NUMBER_REGEX = exports.PHONE_NUMBER_REGEX = void 0;
|
|
4
|
+
const vr_models_1 = require("vr-models");
|
|
5
|
+
Object.defineProperty(exports, "DEVICE_SERIAL_PREFIXES", { enumerable: true, get: function () { return vr_models_1.DEVICE_SERIAL_PREFIXES; } });
|
|
6
|
+
Object.defineProperty(exports, "DEVICE_PAIR_ID_REGEX", { enumerable: true, get: function () { return vr_models_1.DEVICE_PAIR_ID_REGEX; } });
|
|
7
|
+
Object.defineProperty(exports, "DEVICE_PAIR_ID_SUFFIX_REGEX", { enumerable: true, get: function () { return vr_models_1.DEVICE_PAIR_ID_SUFFIX_REGEX; } });
|
|
8
|
+
Object.defineProperty(exports, "DEVICE_SERIAL_NUMBER_REGEX", { enumerable: true, get: function () { return vr_models_1.DEVICE_SERIAL_NUMBER_REGEX; } });
|
|
4
9
|
/** Shared regular expressions used across validation and utility modules. */
|
|
5
10
|
exports.PHONE_NUMBER_REGEX = /^\+250(78|79|73|72)[0-9]{7}$/;
|
|
6
11
|
exports.LOCAL_RWANDA_PHONE_NUMBER_REGEX = /^(078|079|072|073)\d{7}$/;
|
|
@@ -14,8 +19,6 @@ exports.JACKET_ID_REGEX = /^JKT-\d{9}$/;
|
|
|
14
19
|
// centralized until the product requirements choose one canonical plate format.
|
|
15
20
|
exports.PLATE_NUMBER_REGEX = /^[A-Z0-9]{3,10}$/i;
|
|
16
21
|
exports.RWANDA_PLATE_NUMBER_REGEX = /^R[ABCDEFGHIJKLMNPQRSTUVWXYZ]\s?\d{3}\s?[ABCDEFGHIJKLMNPQRSTUVWXYZ]$/;
|
|
17
|
-
exports.DEVICE_SERIAL_NUMBER_REGEX = /^(VBRD|VIBERIDE)-(PASSENGER|RIDER)-([A-Z]{2}\d{3}[A-Z])$/;
|
|
18
|
-
exports.DEVICE_PAIR_ID_REGEX = /^[A-NP-Z]{2}[0-9]{3}[A-NP-Z]{1}$/;
|
|
19
22
|
exports.ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
20
23
|
exports.DAY_MONTH_YEAR_REGEX = /^\d{2}-\d{2}-\d{4}$/;
|
|
21
24
|
exports.DAY_MONTH_YEAR_SLASH_REGEX = /^\d{2}\/\d{2}\/\d{4}$/;
|
|
@@ -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
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Device, UserRole } from "vr-models";
|
|
2
|
+
import type { DeviceSerialPrefix, DeviceSerialRole } from "vr-models";
|
|
2
3
|
import { Transaction } from "sequelize";
|
|
3
4
|
import { DeviceResetOptions, DeviceResetResult, StockChangeResult } from "../shared/shared.types";
|
|
4
5
|
export declare const stockUtil: {
|
|
@@ -56,11 +57,8 @@ export declare const stockUtil: {
|
|
|
56
57
|
transaction?: Transaction;
|
|
57
58
|
actorId?: string;
|
|
58
59
|
}): Promise<StockChangeResult>;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
* Format: VIBERIDE-{RIDER|PASSENGER}-{pairId}
|
|
62
|
-
*/
|
|
63
|
-
generateSerialNumber(pairId: string, dedication: string): string;
|
|
60
|
+
/** Generate a device serial from a raw suffix or namespaced pair ID. */
|
|
61
|
+
generateSerialNumber(pairId: string, dedication: DeviceSerialRole, serialPrefix?: DeviceSerialPrefix): string;
|
|
64
62
|
/**
|
|
65
63
|
* Validate pair ID format
|
|
66
64
|
* No letter 'O' to avoid confusion with 0
|
|
@@ -14,11 +14,8 @@ const isValidUUID = (str) => {
|
|
|
14
14
|
* Extract dedication from serial number
|
|
15
15
|
*/
|
|
16
16
|
const extractDedicationFromSerial = (serialNumber) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (serialNumber.includes("PASSENGER"))
|
|
20
|
-
return "PASSENGER";
|
|
21
|
-
return "N/A";
|
|
17
|
+
const match = vr_models_1.SERIAL_PATTERN.exec(serialNumber);
|
|
18
|
+
return match ? match[2] : "N/A";
|
|
22
19
|
};
|
|
23
20
|
// ==================== HELPER FUNCTIONS ====================
|
|
24
21
|
function buildWhereClause(condition) {
|
|
@@ -393,12 +390,18 @@ exports.stockUtil = {
|
|
|
393
390
|
actorType: actorType,
|
|
394
391
|
});
|
|
395
392
|
},
|
|
396
|
-
/**
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
393
|
+
/** Generate a device serial from a raw suffix or namespaced pair ID. */
|
|
394
|
+
generateSerialNumber(pairId, dedication, serialPrefix = "VIBERIDE") {
|
|
395
|
+
const pairMatch = vr_models_1.PAIR_ID_PATTERN.exec(pairId);
|
|
396
|
+
if (!pairMatch) {
|
|
397
|
+
throw new Error(`Invalid pair ID format: ${pairId}`);
|
|
398
|
+
}
|
|
399
|
+
const resolvedPrefix = (pairMatch[1] || serialPrefix);
|
|
400
|
+
const serialNumber = `${resolvedPrefix}-${dedication}-${pairMatch[2]}`;
|
|
401
|
+
if (!vr_models_1.SERIAL_PATTERN.test(serialNumber)) {
|
|
402
|
+
throw new Error(`Invalid device serial format: ${serialNumber}`);
|
|
403
|
+
}
|
|
404
|
+
return serialNumber;
|
|
402
405
|
},
|
|
403
406
|
/**
|
|
404
407
|
* Validate pair ID format
|
|
@@ -61,10 +61,10 @@ exports.replacePlanDevicesSchema = zod_1.z.object({
|
|
|
61
61
|
id: zod_1.z.string().uuid("Invalid payment plan ID"),
|
|
62
62
|
}),
|
|
63
63
|
body: zod_1.z.object({
|
|
64
|
-
replacementPrefix: zod_1.z.enum(
|
|
64
|
+
replacementPrefix: zod_1.z.enum(vr_models_1.DEVICE_SERIAL_PREFIXES),
|
|
65
65
|
replacementPairID: zod_1.z
|
|
66
66
|
.string()
|
|
67
|
-
.regex(regex_constants_1.
|
|
67
|
+
.regex(regex_constants_1.DEVICE_PAIR_ID_SUFFIX_REGEX, "Invalid pair ID format"),
|
|
68
68
|
}),
|
|
69
69
|
});
|
|
70
70
|
// ==================== UPDATE ====================
|
|
@@ -73,7 +73,7 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
73
73
|
page?: number | undefined;
|
|
74
74
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
75
75
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
76
|
-
dedicatedUser?: "
|
|
76
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
77
77
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
78
78
|
isAssigned?: "true" | "false" | undefined;
|
|
79
79
|
}, {
|
|
@@ -84,7 +84,7 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
84
84
|
page?: string | undefined;
|
|
85
85
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
86
86
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
87
|
-
dedicatedUser?: "
|
|
87
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
88
88
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
89
89
|
isAssigned?: "true" | "false" | undefined;
|
|
90
90
|
}>;
|
|
@@ -97,7 +97,7 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
97
97
|
page?: number | undefined;
|
|
98
98
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
99
99
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
100
|
-
dedicatedUser?: "
|
|
100
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
101
101
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
102
102
|
isAssigned?: "true" | "false" | undefined;
|
|
103
103
|
};
|
|
@@ -110,7 +110,7 @@ export declare const getDevicesSchema: z.ZodObject<{
|
|
|
110
110
|
page?: string | undefined;
|
|
111
111
|
sortBy?: "createdAt" | "updatedAt" | "status" | "serialNumber" | undefined;
|
|
112
112
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
113
|
-
dedicatedUser?: "
|
|
113
|
+
dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
|
|
114
114
|
isPermanentlyUnlocked?: "true" | "false" | undefined;
|
|
115
115
|
isAssigned?: "true" | "false" | undefined;
|
|
116
116
|
};
|
|
@@ -4,11 +4,14 @@ exports.customDeviceResetSchema = exports.triggerDeviceResetSchema = exports.che
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const vr_models_1 = require("vr-models");
|
|
6
6
|
const regex_constants_1 = require("../../constants/regex.constants");
|
|
7
|
-
//
|
|
8
|
-
// Example: AA001A, AB123B, XZ999Z
|
|
9
|
-
// No letter 'O' to avoid confusion with 0
|
|
7
|
+
// Supports both the raw registration suffix and the persisted namespaced key.
|
|
10
8
|
exports.PAIR_ID_REGEX = regex_constants_1.DEVICE_PAIR_ID_REGEX;
|
|
11
|
-
const PAIR_ID_ERROR = "Pair ID must be
|
|
9
|
+
const PAIR_ID_ERROR = "Pair ID must be a six-character suffix or a namespaced ID such as VBRD-AA001A or VIBERIDE-AA001A";
|
|
10
|
+
const PAIR_ID_SUFFIX_ERROR = "Pair ID suffix must be 6 characters: 2 letters (excluding O) + 3 digits + 1 letter (excluding O). Example: AA001A";
|
|
11
|
+
const pairIdFilterSchema = zod_1.z.union([
|
|
12
|
+
zod_1.z.string().regex(exports.PAIR_ID_REGEX, PAIR_ID_ERROR),
|
|
13
|
+
zod_1.z.array(zod_1.z.string().regex(exports.PAIR_ID_REGEX, PAIR_ID_ERROR)),
|
|
14
|
+
]);
|
|
12
15
|
// ✅ Helper to remove duplicates and return unique pair IDs
|
|
13
16
|
const deduplicatePairIds = (pairIds) => {
|
|
14
17
|
return [...new Set(pairIds)];
|
|
@@ -21,10 +24,10 @@ exports.createDevicePairsSchema = zod_1.z.object({
|
|
|
21
24
|
.object({
|
|
22
25
|
productId: zod_1.z.string().uuid("Invalid product ID"),
|
|
23
26
|
pairIds: zod_1.z
|
|
24
|
-
.array(zod_1.z.string().regex(
|
|
27
|
+
.array(zod_1.z.string().regex(regex_constants_1.DEVICE_PAIR_ID_SUFFIX_REGEX, PAIR_ID_SUFFIX_ERROR))
|
|
25
28
|
.min(1, "At least one pair ID required")
|
|
26
29
|
.max(100, "Cannot create more than 100 pairs at once"),
|
|
27
|
-
serialPrefix: zod_1.z.enum(
|
|
30
|
+
serialPrefix: zod_1.z.enum(vr_models_1.DEVICE_SERIAL_PREFIXES).default("VIBERIDE"),
|
|
28
31
|
})
|
|
29
32
|
.transform((data) => {
|
|
30
33
|
// ✅ Remove duplicates and keep unique pair IDs
|
|
@@ -169,8 +172,8 @@ exports.customDeviceResetSchema = zod_1.z.object({
|
|
|
169
172
|
status: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
170
173
|
excludeStatus: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
171
174
|
isPermanentlyUnlocked: zod_1.z.boolean().optional(),
|
|
172
|
-
pairId:
|
|
173
|
-
excludePairIds:
|
|
175
|
+
pairId: pairIdFilterSchema.optional(),
|
|
176
|
+
excludePairIds: pairIdFilterSchema.optional(),
|
|
174
177
|
productId: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
175
178
|
dedicatedUser: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
176
179
|
createdBefore: zod_1.z.string().datetime().optional(),
|
|
@@ -28,7 +28,7 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
28
28
|
lastName?: string | undefined;
|
|
29
29
|
fromDate?: string | undefined;
|
|
30
30
|
toDate?: string | undefined;
|
|
31
|
-
actorType?: "
|
|
31
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
32
32
|
actorId?: string | undefined;
|
|
33
33
|
action?: string | undefined;
|
|
34
34
|
entity?: string | undefined;
|
|
@@ -44,7 +44,7 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
44
44
|
fromDate?: string | undefined;
|
|
45
45
|
toDate?: string | undefined;
|
|
46
46
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
47
|
-
actorType?: "
|
|
47
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
48
48
|
actorId?: string | undefined;
|
|
49
49
|
action?: string | undefined;
|
|
50
50
|
entity?: string | undefined;
|
|
@@ -61,7 +61,7 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
61
61
|
fromDate?: string | undefined;
|
|
62
62
|
toDate?: string | undefined;
|
|
63
63
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
64
|
-
actorType?: "
|
|
64
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
65
65
|
actorId?: string | undefined;
|
|
66
66
|
action?: string | undefined;
|
|
67
67
|
entity?: string | undefined;
|
|
@@ -82,7 +82,7 @@ export declare const listEventLogsSchema: z.ZodObject<{
|
|
|
82
82
|
fromDate?: string | undefined;
|
|
83
83
|
toDate?: string | undefined;
|
|
84
84
|
sortOrder?: "DESC" | "ASC" | undefined;
|
|
85
|
-
actorType?: "
|
|
85
|
+
actorType?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
86
86
|
actorId?: string | undefined;
|
|
87
87
|
action?: string | undefined;
|
|
88
88
|
entity?: string | undefined;
|
|
@@ -9,6 +9,11 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
9
9
|
developmentBaseUrl: z.ZodString;
|
|
10
10
|
stagingBaseUrl: z.ZodString;
|
|
11
11
|
productionBaseUrl: z.ZodString;
|
|
12
|
+
minimumAndroidAppVersion: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, unknown>;
|
|
13
|
+
minimumAndroidAppBuild: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
14
|
+
minimumIosAppVersion: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, unknown>;
|
|
15
|
+
minimumIosAppBuild: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, unknown>;
|
|
16
|
+
forceUpdateMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
17
|
runtimeConfig: z.ZodOptional<z.ZodObject<{
|
|
13
18
|
googleWebClientId: z.ZodOptional<z.ZodString>;
|
|
14
19
|
paidAccessActivated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -326,11 +331,11 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
326
331
|
identifierPattern: z.ZodEffects<z.ZodString, string, string>;
|
|
327
332
|
}, "strip", z.ZodTypeAny, {
|
|
328
333
|
prefixes: string[];
|
|
329
|
-
roles: ("
|
|
334
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
330
335
|
identifierPattern: string;
|
|
331
336
|
}, {
|
|
332
337
|
prefixes: string[];
|
|
333
|
-
roles: ("
|
|
338
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
334
339
|
identifierPattern: string;
|
|
335
340
|
}>>;
|
|
336
341
|
bleBatches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -391,14 +396,12 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
391
396
|
paymentPlansPageSize?: number | undefined;
|
|
392
397
|
maximumPageSize?: number | undefined;
|
|
393
398
|
}>>;
|
|
394
|
-
minimumAppVersion: z.ZodOptional<z.ZodString>;
|
|
395
|
-
forceUpdateMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
396
399
|
}, "strip", z.ZodTypeAny, {
|
|
397
|
-
googleWebClientId?: string | undefined;
|
|
398
|
-
paidAccessActivated?: boolean | undefined;
|
|
399
400
|
passengerAccess?: {
|
|
400
401
|
mode: "FREE" | "PAID";
|
|
401
402
|
} | undefined;
|
|
403
|
+
paidAccessActivated?: boolean | undefined;
|
|
404
|
+
googleWebClientId?: string | undefined;
|
|
402
405
|
speedGovernor?: {
|
|
403
406
|
isActive: boolean;
|
|
404
407
|
weeklySchedule: {
|
|
@@ -450,7 +453,7 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
450
453
|
} | undefined;
|
|
451
454
|
serialNumber?: {
|
|
452
455
|
prefixes: string[];
|
|
453
|
-
roles: ("
|
|
456
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
454
457
|
identifierPattern: string;
|
|
455
458
|
} | undefined;
|
|
456
459
|
bleBatches?: {
|
|
@@ -475,14 +478,12 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
475
478
|
paymentPlansPageSize?: number | undefined;
|
|
476
479
|
maximumPageSize?: number | undefined;
|
|
477
480
|
} | undefined;
|
|
478
|
-
minimumAppVersion?: string | undefined;
|
|
479
|
-
forceUpdateMessage?: string | null | undefined;
|
|
480
481
|
}, {
|
|
481
|
-
googleWebClientId?: string | undefined;
|
|
482
|
-
paidAccessActivated?: boolean | undefined;
|
|
483
482
|
passengerAccess?: {
|
|
484
483
|
mode: "FREE" | "PAID";
|
|
485
484
|
} | undefined;
|
|
485
|
+
paidAccessActivated?: boolean | undefined;
|
|
486
|
+
googleWebClientId?: string | undefined;
|
|
486
487
|
speedGovernor?: {
|
|
487
488
|
isActive: boolean;
|
|
488
489
|
weeklySchedule: {
|
|
@@ -534,7 +535,7 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
534
535
|
} | undefined;
|
|
535
536
|
serialNumber?: {
|
|
536
537
|
prefixes: string[];
|
|
537
|
-
roles: ("
|
|
538
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
538
539
|
identifierPattern: string;
|
|
539
540
|
} | undefined;
|
|
540
541
|
bleBatches?: {
|
|
@@ -559,8 +560,6 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
559
560
|
paymentPlansPageSize?: number | undefined;
|
|
560
561
|
maximumPageSize?: number | undefined;
|
|
561
562
|
} | undefined;
|
|
562
|
-
minimumAppVersion?: string | undefined;
|
|
563
|
-
forceUpdateMessage?: string | null | undefined;
|
|
564
563
|
}>>;
|
|
565
564
|
privacyPolicy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
566
565
|
privacyPolicyVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -606,14 +605,19 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
606
605
|
enableMomoPayPayment: boolean;
|
|
607
606
|
enableAirtelMoneyPayment: boolean;
|
|
608
607
|
isUnderMaintenance: boolean;
|
|
608
|
+
minimumAndroidAppVersion?: string | null | undefined;
|
|
609
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
610
|
+
minimumIosAppVersion?: string | null | undefined;
|
|
611
|
+
minimumIosAppBuild?: string | null | undefined;
|
|
609
612
|
appShortName?: string | null | undefined;
|
|
610
613
|
appDescription?: string | null | undefined;
|
|
614
|
+
forceUpdateMessage?: string | null | undefined;
|
|
611
615
|
runtimeConfig?: {
|
|
612
|
-
googleWebClientId?: string | undefined;
|
|
613
|
-
paidAccessActivated?: boolean | undefined;
|
|
614
616
|
passengerAccess?: {
|
|
615
617
|
mode: "FREE" | "PAID";
|
|
616
618
|
} | undefined;
|
|
619
|
+
paidAccessActivated?: boolean | undefined;
|
|
620
|
+
googleWebClientId?: string | undefined;
|
|
617
621
|
speedGovernor?: {
|
|
618
622
|
isActive: boolean;
|
|
619
623
|
weeklySchedule: {
|
|
@@ -665,7 +669,7 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
665
669
|
} | undefined;
|
|
666
670
|
serialNumber?: {
|
|
667
671
|
prefixes: string[];
|
|
668
|
-
roles: ("
|
|
672
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
669
673
|
identifierPattern: string;
|
|
670
674
|
} | undefined;
|
|
671
675
|
bleBatches?: {
|
|
@@ -690,8 +694,6 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
690
694
|
paymentPlansPageSize?: number | undefined;
|
|
691
695
|
maximumPageSize?: number | undefined;
|
|
692
696
|
} | undefined;
|
|
693
|
-
minimumAppVersion?: string | undefined;
|
|
694
|
-
forceUpdateMessage?: string | null | undefined;
|
|
695
697
|
} | undefined;
|
|
696
698
|
privacyPolicy?: string | null | undefined;
|
|
697
699
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -719,16 +721,21 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
719
721
|
developmentBaseUrl: string;
|
|
720
722
|
stagingBaseUrl: string;
|
|
721
723
|
productionBaseUrl: string;
|
|
724
|
+
minimumAndroidAppVersion?: unknown;
|
|
725
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
726
|
+
minimumIosAppVersion?: unknown;
|
|
727
|
+
minimumIosAppBuild?: unknown;
|
|
722
728
|
appShortName?: string | null | undefined;
|
|
723
729
|
appDescription?: string | null | undefined;
|
|
724
730
|
appDefaultLanguage?: string | undefined;
|
|
725
731
|
appSupportedLanguages?: string[] | undefined;
|
|
732
|
+
forceUpdateMessage?: string | null | undefined;
|
|
726
733
|
runtimeConfig?: {
|
|
727
|
-
googleWebClientId?: string | undefined;
|
|
728
|
-
paidAccessActivated?: boolean | undefined;
|
|
729
734
|
passengerAccess?: {
|
|
730
735
|
mode: "FREE" | "PAID";
|
|
731
736
|
} | undefined;
|
|
737
|
+
paidAccessActivated?: boolean | undefined;
|
|
738
|
+
googleWebClientId?: string | undefined;
|
|
732
739
|
speedGovernor?: {
|
|
733
740
|
isActive: boolean;
|
|
734
741
|
weeklySchedule: {
|
|
@@ -780,7 +787,7 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
780
787
|
} | undefined;
|
|
781
788
|
serialNumber?: {
|
|
782
789
|
prefixes: string[];
|
|
783
|
-
roles: ("
|
|
790
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
784
791
|
identifierPattern: string;
|
|
785
792
|
} | undefined;
|
|
786
793
|
bleBatches?: {
|
|
@@ -805,8 +812,6 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
805
812
|
paymentPlansPageSize?: number | undefined;
|
|
806
813
|
maximumPageSize?: number | undefined;
|
|
807
814
|
} | undefined;
|
|
808
|
-
minimumAppVersion?: string | undefined;
|
|
809
|
-
forceUpdateMessage?: string | null | undefined;
|
|
810
815
|
} | undefined;
|
|
811
816
|
privacyPolicy?: string | null | undefined;
|
|
812
817
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -854,14 +859,19 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
854
859
|
enableMomoPayPayment: boolean;
|
|
855
860
|
enableAirtelMoneyPayment: boolean;
|
|
856
861
|
isUnderMaintenance: boolean;
|
|
862
|
+
minimumAndroidAppVersion?: string | null | undefined;
|
|
863
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
864
|
+
minimumIosAppVersion?: string | null | undefined;
|
|
865
|
+
minimumIosAppBuild?: string | null | undefined;
|
|
857
866
|
appShortName?: string | null | undefined;
|
|
858
867
|
appDescription?: string | null | undefined;
|
|
868
|
+
forceUpdateMessage?: string | null | undefined;
|
|
859
869
|
runtimeConfig?: {
|
|
860
|
-
googleWebClientId?: string | undefined;
|
|
861
|
-
paidAccessActivated?: boolean | undefined;
|
|
862
870
|
passengerAccess?: {
|
|
863
871
|
mode: "FREE" | "PAID";
|
|
864
872
|
} | undefined;
|
|
873
|
+
paidAccessActivated?: boolean | undefined;
|
|
874
|
+
googleWebClientId?: string | undefined;
|
|
865
875
|
speedGovernor?: {
|
|
866
876
|
isActive: boolean;
|
|
867
877
|
weeklySchedule: {
|
|
@@ -913,7 +923,7 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
913
923
|
} | undefined;
|
|
914
924
|
serialNumber?: {
|
|
915
925
|
prefixes: string[];
|
|
916
|
-
roles: ("
|
|
926
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
917
927
|
identifierPattern: string;
|
|
918
928
|
} | undefined;
|
|
919
929
|
bleBatches?: {
|
|
@@ -938,8 +948,6 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
938
948
|
paymentPlansPageSize?: number | undefined;
|
|
939
949
|
maximumPageSize?: number | undefined;
|
|
940
950
|
} | undefined;
|
|
941
|
-
minimumAppVersion?: string | undefined;
|
|
942
|
-
forceUpdateMessage?: string | null | undefined;
|
|
943
951
|
} | undefined;
|
|
944
952
|
privacyPolicy?: string | null | undefined;
|
|
945
953
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -969,16 +977,21 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
969
977
|
developmentBaseUrl: string;
|
|
970
978
|
stagingBaseUrl: string;
|
|
971
979
|
productionBaseUrl: string;
|
|
980
|
+
minimumAndroidAppVersion?: unknown;
|
|
981
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
982
|
+
minimumIosAppVersion?: unknown;
|
|
983
|
+
minimumIosAppBuild?: unknown;
|
|
972
984
|
appShortName?: string | null | undefined;
|
|
973
985
|
appDescription?: string | null | undefined;
|
|
974
986
|
appDefaultLanguage?: string | undefined;
|
|
975
987
|
appSupportedLanguages?: string[] | undefined;
|
|
988
|
+
forceUpdateMessage?: string | null | undefined;
|
|
976
989
|
runtimeConfig?: {
|
|
977
|
-
googleWebClientId?: string | undefined;
|
|
978
|
-
paidAccessActivated?: boolean | undefined;
|
|
979
990
|
passengerAccess?: {
|
|
980
991
|
mode: "FREE" | "PAID";
|
|
981
992
|
} | undefined;
|
|
993
|
+
paidAccessActivated?: boolean | undefined;
|
|
994
|
+
googleWebClientId?: string | undefined;
|
|
982
995
|
speedGovernor?: {
|
|
983
996
|
isActive: boolean;
|
|
984
997
|
weeklySchedule: {
|
|
@@ -1030,7 +1043,7 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
1030
1043
|
} | undefined;
|
|
1031
1044
|
serialNumber?: {
|
|
1032
1045
|
prefixes: string[];
|
|
1033
|
-
roles: ("
|
|
1046
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1034
1047
|
identifierPattern: string;
|
|
1035
1048
|
} | undefined;
|
|
1036
1049
|
bleBatches?: {
|
|
@@ -1055,8 +1068,6 @@ export declare const createAppSpecsSchema: z.ZodObject<{
|
|
|
1055
1068
|
paymentPlansPageSize?: number | undefined;
|
|
1056
1069
|
maximumPageSize?: number | undefined;
|
|
1057
1070
|
} | undefined;
|
|
1058
|
-
minimumAppVersion?: string | undefined;
|
|
1059
|
-
forceUpdateMessage?: string | null | undefined;
|
|
1060
1071
|
} | undefined;
|
|
1061
1072
|
privacyPolicy?: string | null | undefined;
|
|
1062
1073
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -1098,6 +1109,10 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1098
1109
|
id: string;
|
|
1099
1110
|
}>;
|
|
1100
1111
|
body: z.ZodObject<{
|
|
1112
|
+
minimumAndroidAppVersion: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, unknown>>;
|
|
1113
|
+
minimumAndroidAppBuild: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
1114
|
+
minimumIosAppVersion: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, unknown>>;
|
|
1115
|
+
minimumIosAppBuild: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, unknown>>;
|
|
1101
1116
|
appShortName: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1102
1117
|
appDescription: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1103
1118
|
appDefaultLanguage: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
@@ -1105,6 +1120,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1105
1120
|
developmentBaseUrl: z.ZodOptional<z.ZodString>;
|
|
1106
1121
|
stagingBaseUrl: z.ZodOptional<z.ZodString>;
|
|
1107
1122
|
productionBaseUrl: z.ZodOptional<z.ZodString>;
|
|
1123
|
+
forceUpdateMessage: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1108
1124
|
runtimeConfig: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
1109
1125
|
googleWebClientId: z.ZodOptional<z.ZodString>;
|
|
1110
1126
|
paidAccessActivated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1422,11 +1438,11 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1422
1438
|
identifierPattern: z.ZodEffects<z.ZodString, string, string>;
|
|
1423
1439
|
}, "strip", z.ZodTypeAny, {
|
|
1424
1440
|
prefixes: string[];
|
|
1425
|
-
roles: ("
|
|
1441
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1426
1442
|
identifierPattern: string;
|
|
1427
1443
|
}, {
|
|
1428
1444
|
prefixes: string[];
|
|
1429
|
-
roles: ("
|
|
1445
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1430
1446
|
identifierPattern: string;
|
|
1431
1447
|
}>>;
|
|
1432
1448
|
bleBatches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1487,14 +1503,12 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1487
1503
|
paymentPlansPageSize?: number | undefined;
|
|
1488
1504
|
maximumPageSize?: number | undefined;
|
|
1489
1505
|
}>>;
|
|
1490
|
-
minimumAppVersion: z.ZodOptional<z.ZodString>;
|
|
1491
|
-
forceUpdateMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1492
1506
|
}, "strip", z.ZodTypeAny, {
|
|
1493
|
-
googleWebClientId?: string | undefined;
|
|
1494
|
-
paidAccessActivated?: boolean | undefined;
|
|
1495
1507
|
passengerAccess?: {
|
|
1496
1508
|
mode: "FREE" | "PAID";
|
|
1497
1509
|
} | undefined;
|
|
1510
|
+
paidAccessActivated?: boolean | undefined;
|
|
1511
|
+
googleWebClientId?: string | undefined;
|
|
1498
1512
|
speedGovernor?: {
|
|
1499
1513
|
isActive: boolean;
|
|
1500
1514
|
weeklySchedule: {
|
|
@@ -1546,7 +1560,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1546
1560
|
} | undefined;
|
|
1547
1561
|
serialNumber?: {
|
|
1548
1562
|
prefixes: string[];
|
|
1549
|
-
roles: ("
|
|
1563
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1550
1564
|
identifierPattern: string;
|
|
1551
1565
|
} | undefined;
|
|
1552
1566
|
bleBatches?: {
|
|
@@ -1571,14 +1585,12 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1571
1585
|
paymentPlansPageSize?: number | undefined;
|
|
1572
1586
|
maximumPageSize?: number | undefined;
|
|
1573
1587
|
} | undefined;
|
|
1574
|
-
minimumAppVersion?: string | undefined;
|
|
1575
|
-
forceUpdateMessage?: string | null | undefined;
|
|
1576
1588
|
}, {
|
|
1577
|
-
googleWebClientId?: string | undefined;
|
|
1578
|
-
paidAccessActivated?: boolean | undefined;
|
|
1579
1589
|
passengerAccess?: {
|
|
1580
1590
|
mode: "FREE" | "PAID";
|
|
1581
1591
|
} | undefined;
|
|
1592
|
+
paidAccessActivated?: boolean | undefined;
|
|
1593
|
+
googleWebClientId?: string | undefined;
|
|
1582
1594
|
speedGovernor?: {
|
|
1583
1595
|
isActive: boolean;
|
|
1584
1596
|
weeklySchedule: {
|
|
@@ -1630,7 +1642,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1630
1642
|
} | undefined;
|
|
1631
1643
|
serialNumber?: {
|
|
1632
1644
|
prefixes: string[];
|
|
1633
|
-
roles: ("
|
|
1645
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1634
1646
|
identifierPattern: string;
|
|
1635
1647
|
} | undefined;
|
|
1636
1648
|
bleBatches?: {
|
|
@@ -1655,8 +1667,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1655
1667
|
paymentPlansPageSize?: number | undefined;
|
|
1656
1668
|
maximumPageSize?: number | undefined;
|
|
1657
1669
|
} | undefined;
|
|
1658
|
-
minimumAppVersion?: string | undefined;
|
|
1659
|
-
forceUpdateMessage?: string | null | undefined;
|
|
1660
1670
|
}>>>;
|
|
1661
1671
|
privacyPolicy: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1662
1672
|
privacyPolicyVersion: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -1688,6 +1698,10 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1688
1698
|
maintenanceStartAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1689
1699
|
maintenanceEndAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1690
1700
|
}, "strip", z.ZodTypeAny, {
|
|
1701
|
+
minimumAndroidAppVersion?: string | null | undefined;
|
|
1702
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
1703
|
+
minimumIosAppVersion?: string | null | undefined;
|
|
1704
|
+
minimumIosAppBuild?: string | null | undefined;
|
|
1691
1705
|
appShortName?: string | null | undefined;
|
|
1692
1706
|
appDescription?: string | null | undefined;
|
|
1693
1707
|
appDefaultLanguage?: string | undefined;
|
|
@@ -1695,12 +1709,13 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1695
1709
|
developmentBaseUrl?: string | undefined;
|
|
1696
1710
|
stagingBaseUrl?: string | undefined;
|
|
1697
1711
|
productionBaseUrl?: string | undefined;
|
|
1712
|
+
forceUpdateMessage?: string | null | undefined;
|
|
1698
1713
|
runtimeConfig?: {
|
|
1699
|
-
googleWebClientId?: string | undefined;
|
|
1700
|
-
paidAccessActivated?: boolean | undefined;
|
|
1701
1714
|
passengerAccess?: {
|
|
1702
1715
|
mode: "FREE" | "PAID";
|
|
1703
1716
|
} | undefined;
|
|
1717
|
+
paidAccessActivated?: boolean | undefined;
|
|
1718
|
+
googleWebClientId?: string | undefined;
|
|
1704
1719
|
speedGovernor?: {
|
|
1705
1720
|
isActive: boolean;
|
|
1706
1721
|
weeklySchedule: {
|
|
@@ -1752,7 +1767,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1752
1767
|
} | undefined;
|
|
1753
1768
|
serialNumber?: {
|
|
1754
1769
|
prefixes: string[];
|
|
1755
|
-
roles: ("
|
|
1770
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1756
1771
|
identifierPattern: string;
|
|
1757
1772
|
} | undefined;
|
|
1758
1773
|
bleBatches?: {
|
|
@@ -1777,8 +1792,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1777
1792
|
paymentPlansPageSize?: number | undefined;
|
|
1778
1793
|
maximumPageSize?: number | undefined;
|
|
1779
1794
|
} | undefined;
|
|
1780
|
-
minimumAppVersion?: string | undefined;
|
|
1781
|
-
forceUpdateMessage?: string | null | undefined;
|
|
1782
1795
|
} | undefined;
|
|
1783
1796
|
privacyPolicy?: string | null | undefined;
|
|
1784
1797
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -1810,6 +1823,10 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1810
1823
|
maintenanceStartAt?: string | null | undefined;
|
|
1811
1824
|
maintenanceEndAt?: string | null | undefined;
|
|
1812
1825
|
}, {
|
|
1826
|
+
minimumAndroidAppVersion?: unknown;
|
|
1827
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
1828
|
+
minimumIosAppVersion?: unknown;
|
|
1829
|
+
minimumIosAppBuild?: unknown;
|
|
1813
1830
|
appShortName?: string | null | undefined;
|
|
1814
1831
|
appDescription?: string | null | undefined;
|
|
1815
1832
|
appDefaultLanguage?: string | undefined;
|
|
@@ -1817,12 +1834,13 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1817
1834
|
developmentBaseUrl?: string | undefined;
|
|
1818
1835
|
stagingBaseUrl?: string | undefined;
|
|
1819
1836
|
productionBaseUrl?: string | undefined;
|
|
1837
|
+
forceUpdateMessage?: string | null | undefined;
|
|
1820
1838
|
runtimeConfig?: {
|
|
1821
|
-
googleWebClientId?: string | undefined;
|
|
1822
|
-
paidAccessActivated?: boolean | undefined;
|
|
1823
1839
|
passengerAccess?: {
|
|
1824
1840
|
mode: "FREE" | "PAID";
|
|
1825
1841
|
} | undefined;
|
|
1842
|
+
paidAccessActivated?: boolean | undefined;
|
|
1843
|
+
googleWebClientId?: string | undefined;
|
|
1826
1844
|
speedGovernor?: {
|
|
1827
1845
|
isActive: boolean;
|
|
1828
1846
|
weeklySchedule: {
|
|
@@ -1874,7 +1892,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1874
1892
|
} | undefined;
|
|
1875
1893
|
serialNumber?: {
|
|
1876
1894
|
prefixes: string[];
|
|
1877
|
-
roles: ("
|
|
1895
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
1878
1896
|
identifierPattern: string;
|
|
1879
1897
|
} | undefined;
|
|
1880
1898
|
bleBatches?: {
|
|
@@ -1899,8 +1917,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1899
1917
|
paymentPlansPageSize?: number | undefined;
|
|
1900
1918
|
maximumPageSize?: number | undefined;
|
|
1901
1919
|
} | undefined;
|
|
1902
|
-
minimumAppVersion?: string | undefined;
|
|
1903
|
-
forceUpdateMessage?: string | null | undefined;
|
|
1904
1920
|
} | undefined;
|
|
1905
1921
|
privacyPolicy?: string | null | undefined;
|
|
1906
1922
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -1933,10 +1949,11 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1933
1949
|
maintenanceEndAt?: string | null | undefined;
|
|
1934
1950
|
}>;
|
|
1935
1951
|
}, "strip", z.ZodTypeAny, {
|
|
1936
|
-
params: {
|
|
1937
|
-
id: string;
|
|
1938
|
-
};
|
|
1939
1952
|
body: {
|
|
1953
|
+
minimumAndroidAppVersion?: string | null | undefined;
|
|
1954
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
1955
|
+
minimumIosAppVersion?: string | null | undefined;
|
|
1956
|
+
minimumIosAppBuild?: string | null | undefined;
|
|
1940
1957
|
appShortName?: string | null | undefined;
|
|
1941
1958
|
appDescription?: string | null | undefined;
|
|
1942
1959
|
appDefaultLanguage?: string | undefined;
|
|
@@ -1944,12 +1961,13 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
1944
1961
|
developmentBaseUrl?: string | undefined;
|
|
1945
1962
|
stagingBaseUrl?: string | undefined;
|
|
1946
1963
|
productionBaseUrl?: string | undefined;
|
|
1964
|
+
forceUpdateMessage?: string | null | undefined;
|
|
1947
1965
|
runtimeConfig?: {
|
|
1948
|
-
googleWebClientId?: string | undefined;
|
|
1949
|
-
paidAccessActivated?: boolean | undefined;
|
|
1950
1966
|
passengerAccess?: {
|
|
1951
1967
|
mode: "FREE" | "PAID";
|
|
1952
1968
|
} | undefined;
|
|
1969
|
+
paidAccessActivated?: boolean | undefined;
|
|
1970
|
+
googleWebClientId?: string | undefined;
|
|
1953
1971
|
speedGovernor?: {
|
|
1954
1972
|
isActive: boolean;
|
|
1955
1973
|
weeklySchedule: {
|
|
@@ -2001,7 +2019,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2001
2019
|
} | undefined;
|
|
2002
2020
|
serialNumber?: {
|
|
2003
2021
|
prefixes: string[];
|
|
2004
|
-
roles: ("
|
|
2022
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
2005
2023
|
identifierPattern: string;
|
|
2006
2024
|
} | undefined;
|
|
2007
2025
|
bleBatches?: {
|
|
@@ -2026,8 +2044,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2026
2044
|
paymentPlansPageSize?: number | undefined;
|
|
2027
2045
|
maximumPageSize?: number | undefined;
|
|
2028
2046
|
} | undefined;
|
|
2029
|
-
minimumAppVersion?: string | undefined;
|
|
2030
|
-
forceUpdateMessage?: string | null | undefined;
|
|
2031
2047
|
} | undefined;
|
|
2032
2048
|
privacyPolicy?: string | null | undefined;
|
|
2033
2049
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -2059,11 +2075,15 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2059
2075
|
maintenanceStartAt?: string | null | undefined;
|
|
2060
2076
|
maintenanceEndAt?: string | null | undefined;
|
|
2061
2077
|
};
|
|
2062
|
-
}, {
|
|
2063
2078
|
params: {
|
|
2064
2079
|
id: string;
|
|
2065
2080
|
};
|
|
2081
|
+
}, {
|
|
2066
2082
|
body: {
|
|
2083
|
+
minimumAndroidAppVersion?: unknown;
|
|
2084
|
+
minimumAndroidAppBuild?: number | null | undefined;
|
|
2085
|
+
minimumIosAppVersion?: unknown;
|
|
2086
|
+
minimumIosAppBuild?: unknown;
|
|
2067
2087
|
appShortName?: string | null | undefined;
|
|
2068
2088
|
appDescription?: string | null | undefined;
|
|
2069
2089
|
appDefaultLanguage?: string | undefined;
|
|
@@ -2071,12 +2091,13 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2071
2091
|
developmentBaseUrl?: string | undefined;
|
|
2072
2092
|
stagingBaseUrl?: string | undefined;
|
|
2073
2093
|
productionBaseUrl?: string | undefined;
|
|
2094
|
+
forceUpdateMessage?: string | null | undefined;
|
|
2074
2095
|
runtimeConfig?: {
|
|
2075
|
-
googleWebClientId?: string | undefined;
|
|
2076
|
-
paidAccessActivated?: boolean | undefined;
|
|
2077
2096
|
passengerAccess?: {
|
|
2078
2097
|
mode: "FREE" | "PAID";
|
|
2079
2098
|
} | undefined;
|
|
2099
|
+
paidAccessActivated?: boolean | undefined;
|
|
2100
|
+
googleWebClientId?: string | undefined;
|
|
2080
2101
|
speedGovernor?: {
|
|
2081
2102
|
isActive: boolean;
|
|
2082
2103
|
weeklySchedule: {
|
|
@@ -2128,7 +2149,7 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2128
2149
|
} | undefined;
|
|
2129
2150
|
serialNumber?: {
|
|
2130
2151
|
prefixes: string[];
|
|
2131
|
-
roles: ("
|
|
2152
|
+
roles: ("ADMIN" | "PASSENGER" | "RIDER" | "AGENT")[];
|
|
2132
2153
|
identifierPattern: string;
|
|
2133
2154
|
} | undefined;
|
|
2134
2155
|
bleBatches?: {
|
|
@@ -2153,8 +2174,6 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2153
2174
|
paymentPlansPageSize?: number | undefined;
|
|
2154
2175
|
maximumPageSize?: number | undefined;
|
|
2155
2176
|
} | undefined;
|
|
2156
|
-
minimumAppVersion?: string | undefined;
|
|
2157
|
-
forceUpdateMessage?: string | null | undefined;
|
|
2158
2177
|
} | undefined;
|
|
2159
2178
|
privacyPolicy?: string | null | undefined;
|
|
2160
2179
|
privacyPolicyVersion?: string | null | undefined;
|
|
@@ -2186,6 +2205,9 @@ export declare const updateAppSpecsSchema: z.ZodObject<{
|
|
|
2186
2205
|
maintenanceStartAt?: string | null | undefined;
|
|
2187
2206
|
maintenanceEndAt?: string | null | undefined;
|
|
2188
2207
|
};
|
|
2208
|
+
params: {
|
|
2209
|
+
id: string;
|
|
2210
|
+
};
|
|
2189
2211
|
}>;
|
|
2190
2212
|
export declare const listAppSpecsSchema: z.ZodObject<{
|
|
2191
2213
|
query: z.ZodObject<{
|
|
@@ -2195,33 +2217,33 @@ export declare const listAppSpecsSchema: z.ZodObject<{
|
|
|
2195
2217
|
sortBy: z.ZodOptional<z.ZodEnum<["appName", "createdAt", "updatedAt"]>>;
|
|
2196
2218
|
sortOrder: z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>;
|
|
2197
2219
|
}, "strip", z.ZodTypeAny, {
|
|
2198
|
-
page: number;
|
|
2199
2220
|
limit: number;
|
|
2221
|
+
page: number;
|
|
2200
2222
|
search?: string | undefined;
|
|
2201
|
-
sortBy?: "
|
|
2202
|
-
sortOrder?: "
|
|
2223
|
+
sortBy?: "createdAt" | "updatedAt" | "appName" | undefined;
|
|
2224
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
2203
2225
|
}, {
|
|
2204
|
-
page?: string | undefined;
|
|
2205
|
-
limit?: string | undefined;
|
|
2206
2226
|
search?: string | undefined;
|
|
2207
|
-
|
|
2208
|
-
|
|
2227
|
+
limit?: string | undefined;
|
|
2228
|
+
page?: string | undefined;
|
|
2229
|
+
sortBy?: "createdAt" | "updatedAt" | "appName" | undefined;
|
|
2230
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
2209
2231
|
}>;
|
|
2210
2232
|
}, "strip", z.ZodTypeAny, {
|
|
2211
2233
|
query: {
|
|
2212
|
-
page: number;
|
|
2213
2234
|
limit: number;
|
|
2235
|
+
page: number;
|
|
2214
2236
|
search?: string | undefined;
|
|
2215
|
-
sortBy?: "
|
|
2216
|
-
sortOrder?: "
|
|
2237
|
+
sortBy?: "createdAt" | "updatedAt" | "appName" | undefined;
|
|
2238
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
2217
2239
|
};
|
|
2218
2240
|
}, {
|
|
2219
2241
|
query: {
|
|
2220
|
-
page?: string | undefined;
|
|
2221
|
-
limit?: string | undefined;
|
|
2222
2242
|
search?: string | undefined;
|
|
2223
|
-
|
|
2224
|
-
|
|
2243
|
+
limit?: string | undefined;
|
|
2244
|
+
page?: string | undefined;
|
|
2245
|
+
sortBy?: "createdAt" | "updatedAt" | "appName" | undefined;
|
|
2246
|
+
sortOrder?: "DESC" | "ASC" | undefined;
|
|
2225
2247
|
};
|
|
2226
2248
|
}>;
|
|
2227
2249
|
export declare const getAppSpecsSchema: z.ZodObject<{
|
|
@@ -27,6 +27,8 @@ const speedGovernorSchema = zod_1.z.object({
|
|
|
27
27
|
weeklySchedule: speedGovernorWeeklyScheduleSchema,
|
|
28
28
|
exceptions: zod_1.z.array(zod_1.z.string().trim().min(1).max(100)).optional(),
|
|
29
29
|
});
|
|
30
|
+
const optionalAppVersion = zod_1.z.preprocess((value) => typeof value === "string" && value.trim() === "" ? null : value, zod_1.z.string().regex(/^\d+\.\d+\.\d+$/, "Use MAJOR.MINOR.PATCH format").nullable().optional());
|
|
31
|
+
const optionalIosBuild = zod_1.z.preprocess((value) => typeof value === "string" && value.trim() === "" ? null : value, zod_1.z.string().regex(/^\d+(?:\.\d+)*$/, "Use a numeric iOS build number").max(50).nullable().optional());
|
|
30
32
|
const appSpecsBaseSchema = {
|
|
31
33
|
// App Identity
|
|
32
34
|
appName: zod_1.z.string().min(1).max(100),
|
|
@@ -39,6 +41,11 @@ const appSpecsBaseSchema = {
|
|
|
39
41
|
developmentBaseUrl: zod_1.z.string().url(),
|
|
40
42
|
stagingBaseUrl: zod_1.z.string().url(),
|
|
41
43
|
productionBaseUrl: zod_1.z.string().url(),
|
|
44
|
+
minimumAndroidAppVersion: optionalAppVersion,
|
|
45
|
+
minimumAndroidAppBuild: zod_1.z.number().int().min(1).max(2100000000).nullable().optional(),
|
|
46
|
+
minimumIosAppVersion: optionalAppVersion,
|
|
47
|
+
minimumIosAppBuild: optionalIosBuild,
|
|
48
|
+
forceUpdateMessage: zod_1.z.string().max(1000).nullable().optional(),
|
|
42
49
|
runtimeConfig: zod_1.z.object({
|
|
43
50
|
googleWebClientId: zod_1.z.string().max(255).optional(),
|
|
44
51
|
paidAccessActivated: zod_1.z.boolean().optional(),
|
|
@@ -78,8 +85,6 @@ const appSpecsBaseSchema = {
|
|
|
78
85
|
paymentPlansPageSize: zod_1.z.number().int().min(1).max(100).optional(),
|
|
79
86
|
maximumPageSize: zod_1.z.number().int().min(1).max(100).optional(),
|
|
80
87
|
}).optional(),
|
|
81
|
-
minimumAppVersion: zod_1.z.string().max(30).optional(),
|
|
82
|
-
forceUpdateMessage: zod_1.z.string().nullable().optional(),
|
|
83
88
|
}).optional(),
|
|
84
89
|
// Legal Documents
|
|
85
90
|
privacyPolicy: zod_1.z.string().nullable().optional(),
|
|
@@ -98,7 +98,7 @@ export declare const registerSchema: z.ZodObject<{
|
|
|
98
98
|
firstName: string;
|
|
99
99
|
lastName: string;
|
|
100
100
|
password: string;
|
|
101
|
-
role: "
|
|
101
|
+
role: "PASSENGER" | "RIDER";
|
|
102
102
|
contactValue: string;
|
|
103
103
|
gender?: "male" | "female" | undefined;
|
|
104
104
|
birthDate?: number | undefined;
|
|
@@ -113,14 +113,14 @@ export declare const registerSchema: z.ZodObject<{
|
|
|
113
113
|
birthDate?: number | undefined;
|
|
114
114
|
birthMonth?: number | undefined;
|
|
115
115
|
birthYear?: number | undefined;
|
|
116
|
-
role?: "
|
|
116
|
+
role?: "PASSENGER" | "RIDER" | undefined;
|
|
117
117
|
}>;
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
119
|
body: {
|
|
120
120
|
firstName: string;
|
|
121
121
|
lastName: string;
|
|
122
122
|
password: string;
|
|
123
|
-
role: "
|
|
123
|
+
role: "PASSENGER" | "RIDER";
|
|
124
124
|
contactValue: string;
|
|
125
125
|
gender?: "male" | "female" | undefined;
|
|
126
126
|
birthDate?: number | undefined;
|
|
@@ -137,7 +137,7 @@ export declare const registerSchema: z.ZodObject<{
|
|
|
137
137
|
birthDate?: number | undefined;
|
|
138
138
|
birthMonth?: number | undefined;
|
|
139
139
|
birthYear?: number | undefined;
|
|
140
|
-
role?: "
|
|
140
|
+
role?: "PASSENGER" | "RIDER" | undefined;
|
|
141
141
|
};
|
|
142
142
|
}>;
|
|
143
143
|
export declare const riderPasswordRegex: RegExp;
|
|
@@ -362,7 +362,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
362
362
|
firstName: string;
|
|
363
363
|
lastName: string;
|
|
364
364
|
password: string;
|
|
365
|
-
role: "
|
|
365
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
366
366
|
contactValue: string;
|
|
367
367
|
jacketId?: string | undefined;
|
|
368
368
|
plateNumber?: string | undefined;
|
|
@@ -374,7 +374,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
374
374
|
firstName: string;
|
|
375
375
|
lastName: string;
|
|
376
376
|
password: string;
|
|
377
|
-
role: "
|
|
377
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
378
378
|
contactValue: string;
|
|
379
379
|
jacketId?: string | undefined;
|
|
380
380
|
plateNumber?: string | undefined;
|
|
@@ -388,7 +388,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
388
388
|
firstName: string;
|
|
389
389
|
lastName: string;
|
|
390
390
|
password: string;
|
|
391
|
-
role: "
|
|
391
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
392
392
|
contactValue: string;
|
|
393
393
|
jacketId?: string | undefined;
|
|
394
394
|
plateNumber?: string | undefined;
|
|
@@ -402,7 +402,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
402
402
|
firstName: string;
|
|
403
403
|
lastName: string;
|
|
404
404
|
password: string;
|
|
405
|
-
role: "
|
|
405
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
406
406
|
contactValue: string;
|
|
407
407
|
jacketId?: string | undefined;
|
|
408
408
|
plateNumber?: string | undefined;
|
|
@@ -26,7 +26,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
26
26
|
birthDate: number;
|
|
27
27
|
birthMonth: number;
|
|
28
28
|
birthYear: number;
|
|
29
|
-
role: "
|
|
29
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
30
30
|
contactValue: string;
|
|
31
31
|
jacketId?: string | null | undefined;
|
|
32
32
|
password?: string | undefined;
|
|
@@ -38,7 +38,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
38
38
|
birthDate: number;
|
|
39
39
|
birthMonth: number;
|
|
40
40
|
birthYear: number;
|
|
41
|
-
role: "
|
|
41
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
42
42
|
contactValue: string;
|
|
43
43
|
jacketId?: string | null | undefined;
|
|
44
44
|
password?: string | undefined;
|
|
@@ -50,7 +50,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
50
50
|
birthDate: number;
|
|
51
51
|
birthMonth: number;
|
|
52
52
|
birthYear: number;
|
|
53
|
-
role: "
|
|
53
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
54
54
|
contactValue: string;
|
|
55
55
|
jacketId?: string | null | undefined;
|
|
56
56
|
password?: string | undefined;
|
|
@@ -62,7 +62,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
62
62
|
birthDate: number;
|
|
63
63
|
birthMonth: number;
|
|
64
64
|
birthYear: number;
|
|
65
|
-
role: "
|
|
65
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
66
66
|
contactValue: string;
|
|
67
67
|
jacketId?: string | null | undefined;
|
|
68
68
|
password?: string | undefined;
|
|
@@ -83,7 +83,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
83
83
|
birthDate: number;
|
|
84
84
|
birthMonth: number;
|
|
85
85
|
birthYear: number;
|
|
86
|
-
role: "
|
|
86
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
87
87
|
contactValue: string;
|
|
88
88
|
jacketId?: string | null | undefined;
|
|
89
89
|
password?: string | undefined;
|
|
@@ -100,7 +100,7 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
100
100
|
birthDate: number;
|
|
101
101
|
birthMonth: number;
|
|
102
102
|
birthYear: number;
|
|
103
|
-
role: "
|
|
103
|
+
role: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
|
|
104
104
|
contactValue: string;
|
|
105
105
|
jacketId?: string | null | undefined;
|
|
106
106
|
password?: string | undefined;
|
|
@@ -303,7 +303,7 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
303
303
|
gender?: "male" | "female" | undefined;
|
|
304
304
|
isActive?: boolean | undefined;
|
|
305
305
|
isDeactivated?: boolean | undefined;
|
|
306
|
-
role?: "
|
|
306
|
+
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
307
307
|
page?: number | undefined;
|
|
308
308
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
309
309
|
startDate?: string | undefined;
|
|
@@ -315,7 +315,7 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
315
315
|
gender?: "male" | "female" | undefined;
|
|
316
316
|
isActive?: "true" | "false" | undefined;
|
|
317
317
|
isDeactivated?: "true" | "false" | undefined;
|
|
318
|
-
role?: "
|
|
318
|
+
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
319
319
|
page?: string | undefined;
|
|
320
320
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
321
321
|
startDate?: string | undefined;
|
|
@@ -338,7 +338,7 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
338
338
|
gender?: "male" | "female" | undefined;
|
|
339
339
|
isActive?: boolean | undefined;
|
|
340
340
|
isDeactivated?: boolean | undefined;
|
|
341
|
-
role?: "
|
|
341
|
+
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
342
342
|
page?: number | undefined;
|
|
343
343
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
344
344
|
startDate?: string | undefined;
|
|
@@ -355,7 +355,7 @@ export declare const getAllUsersSchema: z.ZodObject<{
|
|
|
355
355
|
gender?: "male" | "female" | undefined;
|
|
356
356
|
isActive?: "true" | "false" | undefined;
|
|
357
357
|
isDeactivated?: "true" | "false" | undefined;
|
|
358
|
-
role?: "
|
|
358
|
+
role?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
|
|
359
359
|
page?: string | undefined;
|
|
360
360
|
contactType?: "EMAIL" | "PHONE" | "WHATSAPP" | undefined;
|
|
361
361
|
startDate?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vr-commons",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.189",
|
|
4
4
|
"description": "Shared functions package",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"rimraf": "^5.0.5",
|
|
104
104
|
"streamifier": "^0.1.1",
|
|
105
105
|
"typescript": "^5.3.3",
|
|
106
|
-
"vr-models": "^1.0.
|
|
106
|
+
"vr-models": "^1.0.119",
|
|
107
107
|
"zod": "^3.25.20"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|