vr-commons 1.0.82 → 1.0.84

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.
@@ -18,7 +18,6 @@ const checkUserAuthentication = (allowedRoles) => async (req, res, next) => {
18
18
  let payload;
19
19
  try {
20
20
  payload = jsonwebtoken_1.default.verify(token, process.env.JWT_SECRET);
21
- console.log(">>>>>>>decoded", payload);
22
21
  }
23
22
  catch (error) {
24
23
  if (error instanceof jsonwebtoken_1.default.TokenExpiredError) {
@@ -6,30 +6,30 @@ export declare const riderLoginSchema: z.ZodObject<{
6
6
  phoneNumber: z.ZodString;
7
7
  nationalId: z.ZodString;
8
8
  }, "strip", z.ZodTypeAny, {
9
- nationalId: string;
10
9
  phoneNumber: string;
11
- }, {
12
10
  nationalId: string;
11
+ }, {
13
12
  phoneNumber: string;
13
+ nationalId: string;
14
14
  }>;
15
15
  query: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
16
16
  params: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
17
17
  headers: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
18
18
  }, "strip", z.ZodTypeAny, {
19
19
  body: {
20
- nationalId: string;
21
20
  phoneNumber: string;
21
+ nationalId: string;
22
22
  };
23
- query?: {} | undefined;
24
23
  params?: {} | undefined;
24
+ query?: {} | undefined;
25
25
  headers?: {} | undefined;
26
26
  }, {
27
27
  body: {
28
- nationalId: string;
29
28
  phoneNumber: string;
29
+ nationalId: string;
30
30
  };
31
- query?: {} | undefined;
32
31
  params?: {} | undefined;
32
+ query?: {} | undefined;
33
33
  headers?: {} | undefined;
34
34
  }>;
35
35
  export declare const userLoginSchema: z.ZodObject<{
@@ -96,32 +96,32 @@ export declare const registerSchema: z.ZodObject<{
96
96
  email: z.ZodOptional<z.ZodString>;
97
97
  password: z.ZodString;
98
98
  }, "strict", z.ZodTypeAny, {
99
+ phoneNumber: string;
100
+ password: string;
99
101
  firstName: string;
100
102
  lastName: string;
101
- password: string;
102
- phoneNumber: string;
103
103
  email?: string | undefined;
104
104
  }, {
105
+ phoneNumber: string;
106
+ password: string;
105
107
  firstName: string;
106
108
  lastName: string;
107
- password: string;
108
- phoneNumber: string;
109
109
  email?: string | undefined;
110
110
  }>;
111
111
  }, "strip", z.ZodTypeAny, {
112
112
  body: {
113
+ phoneNumber: string;
114
+ password: string;
113
115
  firstName: string;
114
116
  lastName: string;
115
- password: string;
116
- phoneNumber: string;
117
117
  email?: string | undefined;
118
118
  };
119
119
  }, {
120
120
  body: {
121
+ phoneNumber: string;
122
+ password: string;
121
123
  firstName: string;
122
124
  lastName: string;
123
- password: string;
124
- phoneNumber: string;
125
125
  email?: string | undefined;
126
126
  };
127
127
  }>;
@@ -146,42 +146,42 @@ export declare const verifyOtpSchema: z.ZodObject<{
146
146
  body: z.ZodEffects<z.ZodObject<{
147
147
  phoneNumber: z.ZodString;
148
148
  otp: z.ZodString;
149
- firstName: z.ZodOptional<z.ZodString>;
150
- lastName: z.ZodOptional<z.ZodString>;
149
+ firstName: z.ZodString;
150
+ lastName: z.ZodString;
151
151
  }, "strip", z.ZodTypeAny, {
152
152
  phoneNumber: string;
153
+ firstName: string;
154
+ lastName: string;
153
155
  otp: string;
154
- firstName?: string | undefined;
155
- lastName?: string | undefined;
156
156
  }, {
157
157
  phoneNumber: string;
158
+ firstName: string;
159
+ lastName: string;
158
160
  otp: string;
159
- firstName?: string | undefined;
160
- lastName?: string | undefined;
161
161
  }>, {
162
162
  phoneNumber: string;
163
+ firstName: string;
164
+ lastName: string;
163
165
  otp: string;
164
- firstName?: string | undefined;
165
- lastName?: string | undefined;
166
166
  }, {
167
167
  phoneNumber: string;
168
+ firstName: string;
169
+ lastName: string;
168
170
  otp: string;
169
- firstName?: string | undefined;
170
- lastName?: string | undefined;
171
171
  }>;
172
172
  }, "strip", z.ZodTypeAny, {
173
173
  body: {
174
174
  phoneNumber: string;
175
+ firstName: string;
176
+ lastName: string;
175
177
  otp: string;
176
- firstName?: string | undefined;
177
- lastName?: string | undefined;
178
178
  };
179
179
  }, {
180
180
  body: {
181
181
  phoneNumber: string;
182
+ firstName: string;
183
+ lastName: string;
182
184
  otp: string;
183
- firstName?: string | undefined;
184
- lastName?: string | undefined;
185
185
  };
186
186
  }>;
187
187
  export declare const resendOtpSchema: z.ZodObject<{
@@ -67,13 +67,11 @@ exports.verifyOtpSchema = zod_1.z.object({
67
67
  firstName: zod_1.z
68
68
  .string()
69
69
  .min(2, "First name must be at least 2 characters")
70
- .max(50)
71
- .optional(),
70
+ .max(50),
72
71
  lastName: zod_1.z
73
72
  .string()
74
73
  .min(2, "Last name must be at least 2 characters")
75
- .max(50)
76
- .optional(),
74
+ .max(50),
77
75
  })
78
76
  .refine((data) => {
79
77
  // If it's a new user, firstName and lastName are required
@@ -13,44 +13,44 @@ export declare const upgradeToRiderSchema: z.ZodObject<{
13
13
  phoneNumber: z.ZodEffects<z.ZodString, string, string>;
14
14
  plateNumber: z.ZodOptional<z.ZodString>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- jacketId: string;
17
- nationalId: string;
18
16
  phoneNumber: string;
17
+ nationalId: string;
18
+ jacketId: string;
19
19
  plateNumber?: string | undefined;
20
20
  }, {
21
- jacketId: string;
22
- nationalId: string;
23
21
  phoneNumber: string;
22
+ nationalId: string;
23
+ jacketId: string;
24
24
  plateNumber?: string | undefined;
25
25
  }>, {
26
- jacketId: string;
27
- nationalId: string;
28
26
  phoneNumber: string;
27
+ nationalId: string;
28
+ jacketId: string;
29
29
  plateNumber?: string | undefined;
30
30
  }, {
31
- jacketId: string;
32
- nationalId: string;
33
31
  phoneNumber: string;
32
+ nationalId: string;
33
+ jacketId: string;
34
34
  plateNumber?: string | undefined;
35
35
  }>;
36
36
  }, "strip", z.ZodTypeAny, {
37
+ params: {
38
+ userId: string;
39
+ };
37
40
  body: {
38
- jacketId: string;
39
- nationalId: string;
40
41
  phoneNumber: string;
42
+ nationalId: string;
43
+ jacketId: string;
41
44
  plateNumber?: string | undefined;
42
45
  };
46
+ }, {
43
47
  params: {
44
48
  userId: string;
45
49
  };
46
- }, {
47
50
  body: {
48
- jacketId: string;
49
- nationalId: string;
50
51
  phoneNumber: string;
52
+ nationalId: string;
53
+ jacketId: string;
51
54
  plateNumber?: string | undefined;
52
55
  };
53
- params: {
54
- userId: string;
55
- };
56
56
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.82",
3
+ "version": "1.0.84",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",