vr-commons 1.0.183 → 1.0.185

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.
@@ -5,6 +5,27 @@ const zod_1 = require("zod");
5
5
  const urlRegex = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
6
6
  const optionalUrl = zod_1.z.preprocess((value) => typeof value === "string" && value.trim() === "" ? null : value, zod_1.z.string().url().nullable().optional());
7
7
  const optionalEmail = zod_1.z.preprocess((value) => typeof value === "string" && value.trim() === "" ? null : value, zod_1.z.string().email().nullable().optional());
8
+ const speedLimitSchema = zod_1.z.number().positive().max(300);
9
+ const speedGovernorDayScheduleSchema = zod_1.z.object({
10
+ daytimeLimitKmh: speedLimitSchema,
11
+ nighttimeLimitKmh: speedLimitSchema,
12
+ });
13
+ const speedGovernorWeeklyScheduleSchema = zod_1.z.object({
14
+ monday: speedGovernorDayScheduleSchema,
15
+ tuesday: speedGovernorDayScheduleSchema,
16
+ wednesday: speedGovernorDayScheduleSchema,
17
+ thursday: speedGovernorDayScheduleSchema,
18
+ friday: speedGovernorDayScheduleSchema,
19
+ saturday: speedGovernorDayScheduleSchema,
20
+ sunday: speedGovernorDayScheduleSchema,
21
+ });
22
+ const speedGovernorSchema = zod_1.z.object({
23
+ isActive: zod_1.z.boolean(),
24
+ speedLimitKmh: speedLimitSchema,
25
+ fallbackSpeedLimit: speedLimitSchema.optional(),
26
+ weeklySchedule: speedGovernorWeeklyScheduleSchema.optional(),
27
+ exceptions: zod_1.z.array(zod_1.z.string().trim().min(1).max(100)).optional(),
28
+ });
8
29
  const appSpecsBaseSchema = {
9
30
  // App Identity
10
31
  appName: zod_1.z.string().min(1).max(100),
@@ -19,11 +40,9 @@ const appSpecsBaseSchema = {
19
40
  productionBaseUrl: zod_1.z.string().url(),
20
41
  runtimeConfig: zod_1.z.object({
21
42
  googleWebClientId: zod_1.z.string().max(255).optional(),
43
+ paidAccessActivated: zod_1.z.boolean().optional(),
22
44
  passengerAccess: zod_1.z.object({ mode: zod_1.z.enum(["FREE", "PAID"]) }).optional(),
23
- speedGovernor: zod_1.z.object({
24
- isActive: zod_1.z.boolean(),
25
- speedLimitKmh: zod_1.z.number().positive().max(300),
26
- }).optional(),
45
+ speedGovernor: speedGovernorSchema.optional(),
27
46
  serialNumber: zod_1.z.object({
28
47
  prefixes: zod_1.z.array(zod_1.z.string().min(1).max(32)).min(1),
29
48
  roles: zod_1.z.array(zod_1.z.enum(["PASSENGER", "RIDER", "AGENT", "ADMIN"])).min(1),
@@ -98,7 +98,7 @@ export declare const registerSchema: z.ZodObject<{
98
98
  firstName: string;
99
99
  lastName: string;
100
100
  password: string;
101
- role: "PASSENGER" | "RIDER";
101
+ role: "RIDER" | "PASSENGER";
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?: "PASSENGER" | "RIDER" | undefined;
116
+ role?: "RIDER" | "PASSENGER" | 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: "PASSENGER" | "RIDER";
123
+ role: "RIDER" | "PASSENGER";
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?: "PASSENGER" | "RIDER" | undefined;
140
+ role?: "RIDER" | "PASSENGER" | 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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
365
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
377
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
391
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
405
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
29
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
41
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
53
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
65
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
86
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN";
103
+ role: "RIDER" | "PASSENGER" | "ADMIN" | "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?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
306
+ role?: "RIDER" | "PASSENGER" | "ADMIN" | "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?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
318
+ role?: "RIDER" | "PASSENGER" | "ADMIN" | "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?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
341
+ role?: "RIDER" | "PASSENGER" | "ADMIN" | "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?: "ADMIN" | "PASSENGER" | "RIDER" | "AGENT" | "SUPER_ADMIN" | undefined;
358
+ role?: "RIDER" | "PASSENGER" | "ADMIN" | "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.183",
3
+ "version": "1.0.185",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",