vms-nest-prisma-api-document 190.0.0 → 191.0.0

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,7 @@ interface DriverResponse extends Record<string, unknown> {
18
18
  access_token: string;
19
19
  user: MasterDriver;
20
20
  }
21
- declare const ChangePasswordSchema: z.ZodObject<{
21
+ declare const UserChangePasswordSchema: z.ZodObject<{
22
22
  user_id: z.ZodEffects<z.ZodString, string, string>;
23
23
  old_password: z.ZodEffects<z.ZodString, string, string>;
24
24
  new_password: z.ZodEffects<z.ZodString, string, string>;
@@ -31,8 +31,8 @@ declare const ChangePasswordSchema: z.ZodObject<{
31
31
  old_password: string;
32
32
  new_password: string;
33
33
  }>;
34
- type UserChangePasswordDTO = z.infer<typeof ChangePasswordSchema>;
35
- declare const LoginUserSchema: z.ZodObject<{
34
+ type UserChangePasswordDTO = z.infer<typeof UserChangePasswordSchema>;
35
+ declare const UserLoginSchema: z.ZodObject<{
36
36
  identifier: z.ZodEffects<z.ZodString, string, string>;
37
37
  password: z.ZodEffects<z.ZodString, string, string>;
38
38
  fcm_token: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
@@ -75,8 +75,8 @@ declare const LoginUserSchema: z.ZodObject<{
75
75
  browser_version?: string | undefined;
76
76
  app_version?: string | undefined;
77
77
  }>;
78
- type LoginUserDTO = z.infer<typeof LoginUserSchema>;
79
- declare const LogoutSchema: z.ZodObject<{
78
+ type UserLoginDTO = z.infer<typeof UserLoginSchema>;
79
+ declare const UserLogoutSchema: z.ZodObject<{
80
80
  fcm_token: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
81
81
  device_id: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
82
82
  }, "strip", z.ZodTypeAny, {
@@ -86,7 +86,7 @@ declare const LogoutSchema: z.ZodObject<{
86
86
  fcm_token?: string | undefined;
87
87
  device_id?: string | undefined;
88
88
  }>;
89
- type LogoutDTO = z.infer<typeof LogoutSchema>;
89
+ type UserLogoutDTO = z.infer<typeof UserLogoutSchema>;
90
90
  declare const DriverChangePasswordSchema: z.ZodObject<{
91
91
  driver_id: z.ZodEffects<z.ZodString, string, string>;
92
92
  old_password: z.ZodEffects<z.ZodString, string, string>;
@@ -101,7 +101,8 @@ declare const DriverChangePasswordSchema: z.ZodObject<{
101
101
  driver_id: string;
102
102
  }>;
103
103
  type DriverChangePasswordDTO = z.infer<typeof DriverChangePasswordSchema>;
104
- declare const LoginDriverSchema: z.ZodObject<{
104
+ declare const DriverLoginSchema: z.ZodObject<{
105
+ organisation_id: z.ZodEffects<z.ZodString, string, string>;
105
106
  identifier: z.ZodEffects<z.ZodString, string, string>;
106
107
  password: z.ZodEffects<z.ZodString, string, string>;
107
108
  fcm_token: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
@@ -129,9 +130,11 @@ declare const LoginDriverSchema: z.ZodObject<{
129
130
  browser_name: string;
130
131
  browser_version: string;
131
132
  app_version: string;
133
+ organisation_id: string;
132
134
  }, {
133
135
  identifier: string;
134
136
  password: string;
137
+ organisation_id: string;
135
138
  fcm_token?: string | undefined;
136
139
  platform?: LoginFrom | undefined;
137
140
  user_agent?: string | undefined;
@@ -144,7 +147,7 @@ declare const LoginDriverSchema: z.ZodObject<{
144
147
  browser_version?: string | undefined;
145
148
  app_version?: string | undefined;
146
149
  }>;
147
- type LoginDriverDTO = z.infer<typeof LoginDriverSchema>;
150
+ type DriverLoginDTO = z.infer<typeof DriverLoginSchema>;
148
151
  declare const DriverLogoutSchema: z.ZodObject<{
149
152
  fcm_token: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
150
153
  device_id: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
@@ -156,17 +159,6 @@ declare const DriverLogoutSchema: z.ZodObject<{
156
159
  device_id?: string | undefined;
157
160
  }>;
158
161
  type DriverLogoutDTO = z.infer<typeof DriverLogoutSchema>;
159
- declare const LoginAdminSchema: z.ZodObject<{
160
- email: z.ZodEffects<z.ZodString, string, string>;
161
- password: z.ZodEffects<z.ZodString, string, string>;
162
- }, "strip", z.ZodTypeAny, {
163
- password: string;
164
- email: string;
165
- }, {
166
- password: string;
167
- email: string;
168
- }>;
169
- type LoginAdminDTO = z.infer<typeof LoginAdminSchema>;
170
162
  declare const AdminChangePasswordSchema: z.ZodObject<{
171
163
  admin_id: z.ZodEffects<z.ZodString, string, string>;
172
164
  old_password: z.ZodEffects<z.ZodString, string, string>;
@@ -181,13 +173,69 @@ declare const AdminChangePasswordSchema: z.ZodObject<{
181
173
  admin_id: string;
182
174
  }>;
183
175
  type AdminChangePasswordDTO = z.infer<typeof AdminChangePasswordSchema>;
184
- declare const user_login: (data: LoginUserDTO) => Promise<BR<UserResponse>>;
185
- declare const user_logout: (data: LogoutDTO) => Promise<SBR>;
176
+ declare const AdminLoginSchema: z.ZodObject<{
177
+ identifier: z.ZodEffects<z.ZodString, string, string>;
178
+ password: z.ZodEffects<z.ZodString, string, string>;
179
+ fcm_token: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
180
+ platform: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof LoginFrom>>>;
181
+ user_agent: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
182
+ ip_address: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
183
+ device_id: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
184
+ device_model: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
185
+ os_name: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
186
+ os_version: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
187
+ browser_name: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
188
+ browser_version: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
189
+ app_version: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ identifier: string;
192
+ password: string;
193
+ fcm_token: string;
194
+ platform: LoginFrom;
195
+ user_agent: string;
196
+ ip_address: string;
197
+ device_id: string;
198
+ device_model: string;
199
+ os_name: string;
200
+ os_version: string;
201
+ browser_name: string;
202
+ browser_version: string;
203
+ app_version: string;
204
+ }, {
205
+ identifier: string;
206
+ password: string;
207
+ fcm_token?: string | undefined;
208
+ platform?: LoginFrom | undefined;
209
+ user_agent?: string | undefined;
210
+ ip_address?: string | undefined;
211
+ device_id?: string | undefined;
212
+ device_model?: string | undefined;
213
+ os_name?: string | undefined;
214
+ os_version?: string | undefined;
215
+ browser_name?: string | undefined;
216
+ browser_version?: string | undefined;
217
+ app_version?: string | undefined;
218
+ }>;
219
+ type AdminLoginDTO = z.infer<typeof AdminLoginSchema>;
220
+ declare const AdminLogoutSchema: z.ZodObject<{
221
+ fcm_token: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
222
+ device_id: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ fcm_token: string;
225
+ device_id: string;
226
+ }, {
227
+ fcm_token?: string | undefined;
228
+ device_id?: string | undefined;
229
+ }>;
230
+ type AdminLogoutDTO = z.infer<typeof AdminLogoutSchema>;
231
+ declare const user_login: (data: UserLoginDTO) => Promise<BR<UserResponse>>;
232
+ declare const user_logout: (data: UserLogoutDTO) => Promise<SBR>;
186
233
  declare const user_change_password: (data: UserChangePasswordDTO) => Promise<SBR>;
187
- declare const admin_login: (data: LoginAdminDTO) => Promise<BR<AdminResponse>>;
234
+ declare const admin_login: (data: AdminLoginDTO) => Promise<BR<AdminResponse>>;
235
+ declare const admin_logout: (data: AdminLogoutDTO) => Promise<SBR>;
188
236
  declare const admin_change_password: (data: AdminChangePasswordDTO) => Promise<SBR>;
189
- declare const driver_login: (data: LoginDriverDTO) => Promise<BR<DriverResponse>>;
237
+ declare const driver_login: (data: DriverLoginDTO) => Promise<BR<DriverResponse>>;
190
238
  declare const driver_logout: (data: DriverLogoutDTO) => Promise<SBR>;
191
239
  declare const driver_change_password: (data: DriverChangePasswordDTO) => Promise<SBR>;
192
240
 
193
- export { type AdminChangePasswordDTO, AdminChangePasswordSchema, type AdminResponse, ChangePasswordSchema, type DriverChangePasswordDTO, DriverChangePasswordSchema, type DriverLogoutDTO, DriverLogoutSchema, type DriverResponse, type LoginAdminDTO, LoginAdminSchema, type LoginDriverDTO, LoginDriverSchema, type LoginUserDTO, LoginUserSchema, type LogoutDTO, LogoutSchema, type UserChangePasswordDTO, type UserResponse, admin_change_password, admin_login, driver_change_password, driver_login, driver_logout, user_change_password, user_login, user_logout };
241
+ export { type AdminChangePasswordDTO, AdminChangePasswordSchema, type AdminLoginDTO, AdminLoginSchema, type AdminLogoutDTO, AdminLogoutSchema, type AdminResponse, type DriverChangePasswordDTO, DriverChangePasswordSchema, type DriverLoginDTO, DriverLoginSchema, type DriverLogoutDTO, DriverLogoutSchema, type DriverResponse, type UserChangePasswordDTO, UserChangePasswordSchema, type UserLoginDTO, UserLoginSchema, type UserLogoutDTO, UserLogoutSchema, type UserResponse, admin_change_password, admin_login, admin_logout, driver_change_password, driver_login, driver_logout, user_change_password, user_login, user_logout };
@@ -60,14 +60,15 @@ var ENDPOINTS = {
60
60
  driver_logout: `${URL}/driver_logout`,
61
61
  driver_change_password: `${URL}/driver_change_password`,
62
62
  admin_login: `${URL}/admin_login`,
63
+ admin_logout: `${URL}/admin_logout`,
63
64
  admin_change_password: `${URL}/admin_change_password`
64
65
  };
65
- var ChangePasswordSchema = z2.object({
66
+ var UserChangePasswordSchema = z2.object({
66
67
  user_id: stringUUIDMandatory("user_id"),
67
68
  old_password: stringMandatory("Old Password", 3, 20),
68
69
  new_password: stringMandatory("New Password Size", 3, 20)
69
70
  });
70
- var LoginUserSchema = z2.object({
71
+ var UserLoginSchema = z2.object({
71
72
  identifier: stringMandatory("Identifier", 3, 100),
72
73
  password: stringMandatory("Password", 3, 20),
73
74
  fcm_token: stringOptional("fcm_token", 0, 1e4),
@@ -82,7 +83,7 @@ var LoginUserSchema = z2.object({
82
83
  browser_version: stringOptional("browser_version", 0, 60),
83
84
  app_version: stringOptional("app_version", 0, 40)
84
85
  });
85
- var LogoutSchema = z2.object({
86
+ var UserLogoutSchema = z2.object({
86
87
  fcm_token: stringOptional("fcm_token", 0, 1e4),
87
88
  device_id: stringOptional("device_id", 0, 120)
88
89
  });
@@ -91,7 +92,8 @@ var DriverChangePasswordSchema = z2.object({
91
92
  old_password: stringMandatory("Old Password", 3, 20),
92
93
  new_password: stringMandatory("New Password Size", 3, 20)
93
94
  });
94
- var LoginDriverSchema = z2.object({
95
+ var DriverLoginSchema = z2.object({
96
+ organisation_id: stringUUIDMandatory("organisation_id"),
95
97
  identifier: stringMandatory("Identifier", 3, 100),
96
98
  password: stringMandatory("Password", 3, 20),
97
99
  fcm_token: stringOptional("fcm_token", 0, 1e4),
@@ -110,15 +112,30 @@ var DriverLogoutSchema = z2.object({
110
112
  fcm_token: stringOptional("fcm_token", 0, 1e4),
111
113
  device_id: stringOptional("device_id", 0, 120)
112
114
  });
113
- var LoginAdminSchema = z2.object({
114
- email: stringMandatory("Email", 3, 100),
115
- password: stringMandatory("Password", 3, 20)
116
- });
117
115
  var AdminChangePasswordSchema = z2.object({
118
116
  admin_id: stringUUIDMandatory("admin_id"),
119
117
  old_password: stringMandatory("Old Password", 3, 20),
120
118
  new_password: stringMandatory("New Password Size", 3, 20)
121
119
  });
120
+ var AdminLoginSchema = z2.object({
121
+ identifier: stringMandatory("Identifier", 3, 100),
122
+ password: stringMandatory("Password", 3, 20),
123
+ fcm_token: stringOptional("fcm_token", 0, 1e4),
124
+ platform: enumOptional("Login From", LoginFrom, "Web" /* Web */),
125
+ user_agent: stringOptional("user_agent", 0, 500),
126
+ ip_address: stringOptional("ip_address", 0, 45),
127
+ device_id: stringOptional("device_id", 0, 120),
128
+ device_model: stringOptional("device_model", 0, 120),
129
+ os_name: stringOptional("os_name", 0, 80),
130
+ os_version: stringOptional("os_version", 0, 60),
131
+ browser_name: stringOptional("browser_name", 0, 80),
132
+ browser_version: stringOptional("browser_version", 0, 60),
133
+ app_version: stringOptional("app_version", 0, 40)
134
+ });
135
+ var AdminLogoutSchema = z2.object({
136
+ fcm_token: stringOptional("fcm_token", 0, 1e4),
137
+ device_id: stringOptional("device_id", 0, 120)
138
+ });
122
139
  var user_login = async (data) => {
123
140
  return apiPost(ENDPOINTS.user_login, data);
124
141
  };
@@ -131,6 +148,9 @@ var user_change_password = async (data) => {
131
148
  var admin_login = async (data) => {
132
149
  return apiPost(ENDPOINTS.admin_login, data);
133
150
  };
151
+ var admin_logout = async (data) => {
152
+ return apiPost(ENDPOINTS.admin_logout, data);
153
+ };
134
154
  var admin_change_password = async (data) => {
135
155
  return apiPost(ENDPOINTS.admin_change_password, data);
136
156
  };
@@ -145,15 +165,17 @@ var driver_change_password = async (data) => {
145
165
  };
146
166
  export {
147
167
  AdminChangePasswordSchema,
148
- ChangePasswordSchema,
168
+ AdminLoginSchema,
169
+ AdminLogoutSchema,
149
170
  DriverChangePasswordSchema,
171
+ DriverLoginSchema,
150
172
  DriverLogoutSchema,
151
- LoginAdminSchema,
152
- LoginDriverSchema,
153
- LoginUserSchema,
154
- LogoutSchema,
173
+ UserChangePasswordSchema,
174
+ UserLoginSchema,
175
+ UserLogoutSchema,
155
176
  admin_change_password,
156
177
  admin_login,
178
+ admin_logout,
157
179
  driver_change_password,
158
180
  driver_login,
159
181
  driver_logout,
@@ -29,18 +29,18 @@ declare const MasterSparePartSubCategorySchema: z.ZodObject<{
29
29
  description: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
30
30
  status: z.ZodType<Status, z.ZodTypeDef, Status>;
31
31
  }, "strip", z.ZodTypeAny, {
32
- sub_category_name: string;
33
- sub_category_code: string;
32
+ spare_part_category_id: string;
34
33
  description: string;
35
34
  status: Status;
36
35
  organisation_id: string;
37
- spare_part_category_id: string;
38
- }, {
39
36
  sub_category_name: string;
40
37
  sub_category_code: string;
38
+ }, {
39
+ spare_part_category_id: string;
41
40
  status: Status;
42
41
  organisation_id: string;
43
- spare_part_category_id: string;
42
+ sub_category_name: string;
43
+ sub_category_code: string;
44
44
  description?: string | undefined;
45
45
  }>;
46
46
  type MasterSparePartSubCategoryDTO = z.infer<typeof MasterSparePartSubCategorySchema>;
@@ -162,16 +162,16 @@ declare const MasterSparePartCategorySchema: z.ZodObject<{
162
162
  description: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
163
163
  status: z.ZodType<Status, z.ZodTypeDef, Status>;
164
164
  }, "strip", z.ZodTypeAny, {
165
+ category_name: string;
166
+ category_code: string;
165
167
  description: string;
166
168
  status: Status;
167
169
  organisation_id: string;
170
+ }, {
168
171
  category_name: string;
169
172
  category_code: string;
170
- }, {
171
173
  status: Status;
172
174
  organisation_id: string;
173
- category_name: string;
174
- category_code: string;
175
175
  description?: string | undefined;
176
176
  }>;
177
177
  type MasterSparePartCategoryDTO = z.infer<typeof MasterSparePartCategorySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vms-nest-prisma-api-document",
3
- "version": "190.0.0",
3
+ "version": "191.0.0",
4
4
  "description": "Reusable API SDK built with NestJS, Prisma, Axios, and Zod for VMS frontends.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",