vr-commons 1.0.146 → 1.0.147

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.
@@ -29,68 +29,6 @@ export declare const createDevicePairsSchema: z.ZodObject<{
29
29
  pairIds: string[];
30
30
  };
31
31
  }>;
32
- export declare const createDeviceSchema: z.ZodObject<{
33
- body: z.ZodObject<{
34
- serialNumber: z.ZodString;
35
- productId: z.ZodString;
36
- }, "strip", z.ZodTypeAny, {
37
- productId: string;
38
- serialNumber: string;
39
- }, {
40
- productId: string;
41
- serialNumber: string;
42
- }>;
43
- }, "strip", z.ZodTypeAny, {
44
- body: {
45
- productId: string;
46
- serialNumber: string;
47
- };
48
- }, {
49
- body: {
50
- productId: string;
51
- serialNumber: string;
52
- };
53
- }>;
54
- export declare const updateDeviceSchema: z.ZodObject<{
55
- params: z.ZodObject<{
56
- id: z.ZodString;
57
- }, "strip", z.ZodTypeAny, {
58
- id: string;
59
- }, {
60
- id: string;
61
- }>;
62
- body: z.ZodObject<{
63
- serialNumber: z.ZodOptional<z.ZodString>;
64
- status: z.ZodOptional<z.ZodEnum<["locked", "unlocked", "disabled"]>>;
65
- dedicatedUser: z.ZodOptional<z.ZodNullable<z.ZodEnum<["PASSENGER", "RIDER", "N/A"]>>>;
66
- }, "strip", z.ZodTypeAny, {
67
- status?: "locked" | "unlocked" | "disabled" | undefined;
68
- serialNumber?: string | undefined;
69
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
70
- }, {
71
- status?: "locked" | "unlocked" | "disabled" | undefined;
72
- serialNumber?: string | undefined;
73
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
74
- }>;
75
- }, "strip", z.ZodTypeAny, {
76
- params: {
77
- id: string;
78
- };
79
- body: {
80
- status?: "locked" | "unlocked" | "disabled" | undefined;
81
- serialNumber?: string | undefined;
82
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
83
- };
84
- }, {
85
- params: {
86
- id: string;
87
- };
88
- body: {
89
- status?: "locked" | "unlocked" | "disabled" | undefined;
90
- serialNumber?: string | undefined;
91
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | null | undefined;
92
- };
93
- }>;
94
32
  export declare const getDeviceSchema: z.ZodObject<{
95
33
  params: z.ZodObject<{
96
34
  id: z.ZodString;
@@ -123,9 +61,9 @@ export declare const getDevicesSchema: z.ZodObject<{
123
61
  }, "strip", z.ZodTypeAny, {
124
62
  productId?: string | undefined;
125
63
  status?: "locked" | "unlocked" | "disabled" | undefined;
126
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
127
64
  page?: number | undefined;
128
65
  limit?: number | undefined;
66
+ dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
129
67
  isPermanentlyUnlocked?: "true" | "false" | undefined;
130
68
  isAssigned?: "true" | "false" | undefined;
131
69
  search?: string | undefined;
@@ -134,9 +72,9 @@ export declare const getDevicesSchema: z.ZodObject<{
134
72
  }, {
135
73
  productId?: string | undefined;
136
74
  status?: "locked" | "unlocked" | "disabled" | undefined;
137
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
138
75
  page?: string | undefined;
139
76
  limit?: string | undefined;
77
+ dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
140
78
  isPermanentlyUnlocked?: "true" | "false" | undefined;
141
79
  isAssigned?: "true" | "false" | undefined;
142
80
  search?: string | undefined;
@@ -147,9 +85,9 @@ export declare const getDevicesSchema: z.ZodObject<{
147
85
  query: {
148
86
  productId?: string | undefined;
149
87
  status?: "locked" | "unlocked" | "disabled" | undefined;
150
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
151
88
  page?: number | undefined;
152
89
  limit?: number | undefined;
90
+ dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
153
91
  isPermanentlyUnlocked?: "true" | "false" | undefined;
154
92
  isAssigned?: "true" | "false" | undefined;
155
93
  search?: string | undefined;
@@ -160,9 +98,9 @@ export declare const getDevicesSchema: z.ZodObject<{
160
98
  query: {
161
99
  productId?: string | undefined;
162
100
  status?: "locked" | "unlocked" | "disabled" | undefined;
163
- dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
164
101
  page?: string | undefined;
165
102
  limit?: string | undefined;
103
+ dedicatedUser?: "PASSENGER" | "RIDER" | "N/A" | undefined;
166
104
  isPermanentlyUnlocked?: "true" | "false" | undefined;
167
105
  isAssigned?: "true" | "false" | undefined;
168
106
  search?: string | undefined;
@@ -284,22 +222,17 @@ export declare const makePermanentSchema: z.ZodObject<{
284
222
  export declare const checkAvailabilitySchema: z.ZodObject<{
285
223
  query: z.ZodObject<{
286
224
  productId: z.ZodString;
287
- quantity: z.ZodEffects<z.ZodEnum<["1", "2"]>, number, "1" | "2">;
288
225
  }, "strip", z.ZodTypeAny, {
289
226
  productId: string;
290
- quantity: number;
291
227
  }, {
292
228
  productId: string;
293
- quantity: "1" | "2";
294
229
  }>;
295
230
  }, "strip", z.ZodTypeAny, {
296
231
  query: {
297
232
  productId: string;
298
- quantity: number;
299
233
  };
300
234
  }, {
301
235
  query: {
302
236
  productId: string;
303
- quantity: "1" | "2";
304
237
  };
305
238
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkAvailabilitySchema = exports.makePermanentSchema = exports.disableDeviceSchema = exports.adminUnlockDeviceSchema = exports.adminLockDeviceSchema = exports.deleteDeviceSchema = exports.getDevicesSchema = exports.getDeviceSchema = exports.updateDeviceSchema = exports.createDeviceSchema = exports.createDevicePairsSchema = exports.deduplicatePairIds = exports.PAIR_ID_REGEX = void 0;
3
+ exports.checkAvailabilitySchema = exports.makePermanentSchema = exports.disableDeviceSchema = exports.adminUnlockDeviceSchema = exports.adminLockDeviceSchema = exports.deleteDeviceSchema = exports.getDevicesSchema = exports.getDeviceSchema = exports.createDevicePairsSchema = exports.deduplicatePairIds = exports.PAIR_ID_REGEX = void 0;
4
4
  // src/validations/device.validations.ts
5
5
  const zod_1 = require("zod");
6
6
  const vr_models_1 = require("vr-models");
@@ -36,7 +36,7 @@ exports.createDevicePairsSchema = zod_1.z.object({
36
36
  pairIds: zod_1.z
37
37
  .array(zod_1.z.string().regex(exports.PAIR_ID_REGEX, PAIR_ID_ERROR))
38
38
  .min(1, "At least one pair ID required")
39
- .max(50, "Cannot create more than 50 pairs at once"),
39
+ .max(100, "Cannot create more than 100 pairs at once"),
40
40
  })
41
41
  .transform((data) => {
42
42
  // ✅ Remove duplicates and keep unique pair IDs
@@ -47,26 +47,6 @@ exports.createDevicePairsSchema = zod_1.z.object({
47
47
  };
48
48
  }),
49
49
  });
50
- // Create device schema (admin adds new stock)
51
- exports.createDeviceSchema = zod_1.z.object({
52
- body: zod_1.z.object({
53
- serialNumber: deviceBaseSchema.serialNumber,
54
- productId: deviceBaseSchema.productId,
55
- // Status defaults to "locked" in model
56
- // dedicatedUser starts as null
57
- }),
58
- });
59
- // Update device schema
60
- exports.updateDeviceSchema = zod_1.z.object({
61
- params: zod_1.z.object({
62
- id: zod_1.z.string().uuid("Invalid device ID"),
63
- }),
64
- body: zod_1.z.object({
65
- serialNumber: deviceBaseSchema.serialNumber.optional(),
66
- status: deviceBaseSchema.status,
67
- dedicatedUser: deviceBaseSchema.dedicatedUser,
68
- }),
69
- });
70
50
  // Get device by ID schema
71
51
  exports.getDeviceSchema = zod_1.z.object({
72
52
  params: zod_1.z.object({
@@ -130,6 +110,5 @@ exports.makePermanentSchema = zod_1.z.object({
130
110
  exports.checkAvailabilitySchema = zod_1.z.object({
131
111
  query: zod_1.z.object({
132
112
  productId: zod_1.z.string().uuid("Invalid product ID"),
133
- quantity: zod_1.z.enum(["1", "2"]).transform(Number), // 1 or 2 devices
134
113
  }),
135
114
  });
@@ -10,6 +10,6 @@ export { updateProfileSchema, requestPhoneChangeSchema, verifyPhoneChangeSchema,
10
10
  export { updateAdminSchema, updateRiderSchema, deleteUserSchema, getUserSchema, getUsersSchema, hireAdminSchema, promoteAdminSchema, demoteAdminSchema, fireEmployeeSchema, upgradeToRiderSchema, resetPasswordSchema, } from "./users.admin.validations";
11
11
  export { createProductSchema, updateProductSchema, getProductSchema, getProductsSchema, deactivateProductSchema, activateProductSchema, deleteProductSchema, updateStockSchema, } from "./product.validations";
12
12
  export { createPricingSchema, updatePricingSchema, getPricingSchema, getPricingsSchema, deletePricingSchema, } from "./pricings.validations";
13
- export { checkAvailabilitySchema, createDevicePairsSchema, adminLockDeviceSchema, adminUnlockDeviceSchema, updateDeviceSchema, getDeviceSchema, getDevicesSchema, deleteDeviceSchema, disableDeviceSchema, makePermanentSchema, } from "./admin.devices.validations";
13
+ export { checkAvailabilitySchema, createDevicePairsSchema, adminLockDeviceSchema, adminUnlockDeviceSchema, getDeviceSchema, getDevicesSchema, deleteDeviceSchema, disableDeviceSchema, makePermanentSchema, } from "./admin.devices.validations";
14
14
  export { createPlanSchema, limitedUpdateSchema, getDevicePlanSchema, getPlanSchema, getUserPlansSchema, listPlansSchema, recordPaymentSchema, deletePlanSchema, } from "./admin.devicePayment.validations";
15
15
  export { listEventLogsSchema, getEventLogSchema, } from "./eventlogs.admin.validations";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAppSpecsSchema = exports.activateAppSpecsSchema = exports.getActiveAppSpecsSchema = exports.listAppSpecsSchema = exports.updateAppSpecsSchema = exports.createAppSpecsSchema = exports.exportBansSchema = exports.createSuspensionSchema = exports.createBanSchema = exports.extendSuspensionSchema = exports.revokeSuspensionSchema = exports.revokeBanSchema = exports.reviewAppealSchema = exports.listSuspensionsSchema = exports.listPendingAppealsSchema = exports.listBansSchema = exports.getUserBansSchema = exports.getUserSuspensionsSchema = exports.getSuspensionSchema = exports.getUserRestrictionsSchema = exports.getBanSchema = exports.submitSuspensionAppealSchema = exports.submitBanAppealSchema = exports.deactivateAccountSchema = exports.createRiderSchema = exports.updateRiderProfileSchema = exports.updatePassengerProfileSchema = exports.passengerSignupSchema = exports.viewProfileSchema = exports.getAllUsersSchema = exports.updateUserProfileSchema = exports.getUserByIdSchema = exports.createUserSchema = exports.googleLoginSchema = exports.completePassengerProfileSchema = exports.checkRiderAccountSchema = exports.setRiderPasswordSchema = exports.riderPasswordRegex = exports.passwordRegex = exports.emailRegex = exports.phoneRegex = exports.requestOtpSchema = exports.resendOtpSchema = exports.verifyOtpSchema = exports.registerSchema = exports.refreshTokenSchema = exports.userLoginSchema = exports.forgotPasswordSchema = exports.riderLoginSchema = exports.validate = void 0;
4
- exports.makePermanentSchema = exports.disableDeviceSchema = exports.deleteDeviceSchema = exports.getDevicesSchema = exports.getDeviceSchema = exports.updateDeviceSchema = exports.adminUnlockDeviceSchema = exports.adminLockDeviceSchema = exports.createDevicePairsSchema = exports.checkAvailabilitySchema = exports.deletePricingSchema = exports.getPricingsSchema = exports.getPricingSchema = exports.updatePricingSchema = exports.createPricingSchema = exports.updateStockSchema = exports.deleteProductSchema = exports.activateProductSchema = exports.deactivateProductSchema = exports.getProductsSchema = exports.getProductSchema = exports.updateProductSchema = exports.createProductSchema = exports.resetPasswordSchema = exports.upgradeToRiderSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.updateAdminSchema = exports.registerRiderSchema = exports.riderPasswordSchema = exports.changePasswordSchema = exports.strongPasswordRegex = exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = exports.getInstallmentsSchema = exports.getInstallmentByIdSchema = exports.payInstallmentSchema = exports.serialRegex = exports.extendSessionSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = void 0;
5
- exports.getEventLogSchema = exports.listEventLogsSchema = exports.deletePlanSchema = exports.recordPaymentSchema = exports.listPlansSchema = exports.getUserPlansSchema = exports.getPlanSchema = exports.getDevicePlanSchema = exports.limitedUpdateSchema = exports.createPlanSchema = void 0;
4
+ exports.createPlanSchema = exports.makePermanentSchema = exports.disableDeviceSchema = exports.deleteDeviceSchema = exports.getDevicesSchema = exports.getDeviceSchema = exports.adminUnlockDeviceSchema = exports.adminLockDeviceSchema = exports.createDevicePairsSchema = exports.checkAvailabilitySchema = exports.deletePricingSchema = exports.getPricingsSchema = exports.getPricingSchema = exports.updatePricingSchema = exports.createPricingSchema = exports.updateStockSchema = exports.deleteProductSchema = exports.activateProductSchema = exports.deactivateProductSchema = exports.getProductsSchema = exports.getProductSchema = exports.updateProductSchema = exports.createProductSchema = exports.resetPasswordSchema = exports.upgradeToRiderSchema = exports.fireEmployeeSchema = exports.demoteAdminSchema = exports.promoteAdminSchema = exports.hireAdminSchema = exports.getUsersSchema = exports.getUserSchema = exports.deleteUserSchema = exports.updateRiderSchema = exports.updateAdminSchema = exports.registerRiderSchema = exports.riderPasswordSchema = exports.changePasswordSchema = exports.strongPasswordRegex = exports.deleteAccountSchema = exports.verifyPhoneChangeSchema = exports.requestPhoneChangeSchema = exports.updateProfileSchema = exports.getInstallmentsSchema = exports.getInstallmentByIdSchema = exports.payInstallmentSchema = exports.serialRegex = exports.extendSessionSchema = exports.unlockDeviceSchema = exports.getUserPaymentPlanSchema = exports.listUserPaymentPlansSchema = void 0;
5
+ exports.getEventLogSchema = exports.listEventLogsSchema = exports.deletePlanSchema = exports.recordPaymentSchema = exports.listPlansSchema = exports.getUserPlansSchema = exports.getPlanSchema = exports.getDevicePlanSchema = exports.limitedUpdateSchema = void 0;
6
6
  var validate_validations_1 = require("./validate.validations");
7
7
  Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_validations_1.validate; } });
8
8
  var auth_validations_1 = require("./auth.validations");
@@ -118,7 +118,6 @@ Object.defineProperty(exports, "checkAvailabilitySchema", { enumerable: true, ge
118
118
  Object.defineProperty(exports, "createDevicePairsSchema", { enumerable: true, get: function () { return admin_devices_validations_1.createDevicePairsSchema; } });
119
119
  Object.defineProperty(exports, "adminLockDeviceSchema", { enumerable: true, get: function () { return admin_devices_validations_1.adminLockDeviceSchema; } });
120
120
  Object.defineProperty(exports, "adminUnlockDeviceSchema", { enumerable: true, get: function () { return admin_devices_validations_1.adminUnlockDeviceSchema; } });
121
- Object.defineProperty(exports, "updateDeviceSchema", { enumerable: true, get: function () { return admin_devices_validations_1.updateDeviceSchema; } });
122
121
  Object.defineProperty(exports, "getDeviceSchema", { enumerable: true, get: function () { return admin_devices_validations_1.getDeviceSchema; } });
123
122
  Object.defineProperty(exports, "getDevicesSchema", { enumerable: true, get: function () { return admin_devices_validations_1.getDevicesSchema; } });
124
123
  Object.defineProperty(exports, "deleteDeviceSchema", { enumerable: true, get: function () { return admin_devices_validations_1.deleteDeviceSchema; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.146",
3
+ "version": "1.0.147",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",