@dapex-tech/elite-online-services 0.0.5 → 0.0.7
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/.release.config.js +16 -15
- package/models/AdminDto.d.ts +1 -1
- package/models/AdminUpdateDto.d.ts +26 -0
- package/models/AdminUpdateDto.js +2 -0
- package/models/CreateServiceOrderDto.d.ts +46 -0
- package/models/CreateServiceOrderDto.js +2 -0
- package/models/CreateStreetPickupDto.d.ts +10 -0
- package/models/CreateStreetPickupDto.js +2 -0
- package/models/CreateUserLocationDto.d.ts +26 -0
- package/models/CreateUserLocationDto.js +2 -0
- package/models/DriverDto.d.ts +5 -5
- package/models/DriverUpdateDto.d.ts +50 -0
- package/models/DriverUpdateDto.js +2 -0
- package/models/EmailPhoneLoginDto.d.ts +14 -0
- package/models/EmailPhoneLoginDto.js +2 -0
- package/models/GenerateResetCodeDto.d.ts +6 -0
- package/models/GenerateResetCodeDto.js +2 -0
- package/models/GenerateUserResetCodeDto.d.ts +6 -0
- package/models/GenerateUserResetCodeDto.js +2 -0
- package/models/GenerateUserVerificationCodeDto.d.ts +6 -0
- package/models/GenerateUserVerificationCodeDto.js +2 -0
- package/models/OrderDto.d.ts +19 -0
- package/models/OrderDto.js +14 -0
- package/models/ResetDriverPasswordDto.d.ts +10 -0
- package/models/ResetDriverPasswordDto.js +2 -0
- package/models/ResetUserPasswordDto.d.ts +10 -0
- package/models/ResetUserPasswordDto.js +2 -0
- package/models/UpdateDriverStatusDto.d.ts +10 -0
- package/models/UpdateDriverStatusDto.js +2 -0
- package/models/UpdateDriverTripStatusDto.d.ts +14 -0
- package/models/UpdateDriverTripStatusDto.js +2 -0
- package/models/UpdateTripStatusDto.d.ts +10 -0
- package/models/UpdateTripStatusDto.js +2 -0
- package/models/UpdateUserLocationDto.d.ts +26 -0
- package/models/UpdateUserLocationDto.js +2 -0
- package/models/UserDto.d.ts +1 -1
- package/models/UserUpdatedDto.d.ts +18 -0
- package/models/UserUpdatedDto.js +2 -0
- package/models/ValidateDriverResetCodeDto.d.ts +10 -0
- package/models/ValidateDriverResetCodeDto.js +2 -0
- package/models/ValidateUserResetCodeDto.d.ts +10 -0
- package/models/ValidateUserResetCodeDto.js +2 -0
- package/models/VerifyUserAccountDto.d.ts +10 -0
- package/models/VerifyUserAccountDto.js +2 -0
- package/models/index.d.ts +20 -0
- package/models/index.js +20 -0
- package/package.json +18 -22
- package/services/{LoginsService.d.ts → AdminAuthService.d.ts} +13 -10
- package/services/{LoginsService.js → AdminAuthService.js} +26 -22
- package/services/AdminService.d.ts +51 -6
- package/services/AdminService.js +105 -7
- package/services/CatalogsService.d.ts +67 -0
- package/services/CatalogsService.js +142 -0
- package/services/DriverAuthService.d.ts +53 -0
- package/services/DriverAuthService.js +119 -0
- package/services/DriversService.d.ts +43 -6
- package/services/DriversService.js +100 -7
- package/services/UserAuthService.d.ts +85 -0
- package/services/UserAuthService.js +188 -0
- package/services/UsersService.d.ts +44 -5
- package/services/UsersService.js +96 -6
- package/services/index.d.ts +4 -1
- package/services/index.js +4 -1
- package/socketService.js +96 -91
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverAuthService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class DriverAuthService {
|
|
7
|
+
/**
|
|
8
|
+
* Driver Login
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns any Login successful
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static login(requestBody) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/auth/drivers/login',
|
|
17
|
+
body: requestBody,
|
|
18
|
+
mediaType: 'application/json',
|
|
19
|
+
errors: {
|
|
20
|
+
401: `Invalid credentials`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Refresh Driver Token
|
|
26
|
+
* @returns any Token refreshed successfully
|
|
27
|
+
* @throws ApiError
|
|
28
|
+
*/
|
|
29
|
+
static refreshToken() {
|
|
30
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
url: '/auth/drivers/refresh-token',
|
|
33
|
+
errors: {
|
|
34
|
+
401: `Unauthorized`,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get Current Driver
|
|
40
|
+
* @returns any Driver information retrieved
|
|
41
|
+
* @throws ApiError
|
|
42
|
+
*/
|
|
43
|
+
static me() {
|
|
44
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
45
|
+
method: 'GET',
|
|
46
|
+
url: '/auth/drivers/me',
|
|
47
|
+
errors: {
|
|
48
|
+
401: `Unauthorized`,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Driver Logout
|
|
54
|
+
* @returns any Logout successful
|
|
55
|
+
* @throws ApiError
|
|
56
|
+
*/
|
|
57
|
+
static logout() {
|
|
58
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
url: '/auth/drivers/logout',
|
|
61
|
+
errors: {
|
|
62
|
+
401: `Unauthorized`,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generate Password Reset Code
|
|
68
|
+
* @param requestBody
|
|
69
|
+
* @returns any Reset code generated and sent successfully
|
|
70
|
+
* @throws ApiError
|
|
71
|
+
*/
|
|
72
|
+
static generateResetCode(requestBody) {
|
|
73
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
74
|
+
method: 'POST',
|
|
75
|
+
url: '/auth/drivers/forgot-password',
|
|
76
|
+
body: requestBody,
|
|
77
|
+
mediaType: 'application/json',
|
|
78
|
+
errors: {
|
|
79
|
+
401: `Driver not found`,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Validate Password Reset Code
|
|
85
|
+
* @param requestBody
|
|
86
|
+
* @returns any Reset code is valid
|
|
87
|
+
* @throws ApiError
|
|
88
|
+
*/
|
|
89
|
+
static validateResetCode(requestBody) {
|
|
90
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
91
|
+
method: 'POST',
|
|
92
|
+
url: '/auth/drivers/validate-reset-code',
|
|
93
|
+
body: requestBody,
|
|
94
|
+
mediaType: 'application/json',
|
|
95
|
+
errors: {
|
|
96
|
+
401: `Driver not found`,
|
|
97
|
+
403: `Invalid or expired reset code`,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Reset Driver Password
|
|
103
|
+
* @param requestBody
|
|
104
|
+
* @returns any Password reset successfully
|
|
105
|
+
* @throws ApiError
|
|
106
|
+
*/
|
|
107
|
+
static resetPassword(requestBody) {
|
|
108
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
url: '/auth/drivers/reset-password',
|
|
111
|
+
body: requestBody,
|
|
112
|
+
mediaType: 'application/json',
|
|
113
|
+
errors: {
|
|
114
|
+
401: `Driver not found`,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.DriverAuthService = DriverAuthService;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { DriverDto } from '../models/DriverDto';
|
|
2
|
+
import type { DriverUpdateDto } from '../models/DriverUpdateDto';
|
|
3
|
+
import type { OrderDto } from '../models/OrderDto';
|
|
4
|
+
import type { UpdateDriverTripStatusDto } from '../models/UpdateDriverTripStatusDto';
|
|
2
5
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
6
|
export declare class DriversService {
|
|
4
7
|
/**
|
|
@@ -10,20 +13,26 @@ export declare class DriversService {
|
|
|
10
13
|
static create(requestBody: DriverDto): CancelablePromise<any>;
|
|
11
14
|
/**
|
|
12
15
|
* Get all drivers
|
|
13
|
-
* @param search
|
|
14
|
-
* @param
|
|
15
|
-
* @param order
|
|
16
|
+
* @param search Text to search for in name, surname, phone number, license or type
|
|
17
|
+
* @param order Sorting options
|
|
16
18
|
* @returns any List of drivers
|
|
17
19
|
* @throws ApiError
|
|
18
20
|
*/
|
|
19
|
-
static findAll(search
|
|
21
|
+
static findAll(search?: string, order?: OrderDto): CancelablePromise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Get driver last location by ID
|
|
24
|
+
* @param id
|
|
25
|
+
* @returns any Driver last location retrieved successfully.
|
|
26
|
+
* @throws ApiError
|
|
27
|
+
*/
|
|
28
|
+
static getLastLocation(id: number): CancelablePromise<any>;
|
|
20
29
|
/**
|
|
21
30
|
* Get a single driver by ID
|
|
22
31
|
* @param id
|
|
23
32
|
* @returns any Driver found
|
|
24
33
|
* @throws ApiError
|
|
25
34
|
*/
|
|
26
|
-
static
|
|
35
|
+
static findById(id: number): CancelablePromise<any>;
|
|
27
36
|
/**
|
|
28
37
|
* Update a driver by ID
|
|
29
38
|
* @param id
|
|
@@ -31,7 +40,7 @@ export declare class DriversService {
|
|
|
31
40
|
* @returns any Driver updated successfully.
|
|
32
41
|
* @throws ApiError
|
|
33
42
|
*/
|
|
34
|
-
static update(id: number, requestBody:
|
|
43
|
+
static update(id: number, requestBody: DriverUpdateDto): CancelablePromise<any>;
|
|
35
44
|
/**
|
|
36
45
|
* Delete a driver by ID
|
|
37
46
|
* @param id
|
|
@@ -39,4 +48,32 @@ export declare class DriversService {
|
|
|
39
48
|
* @throws ApiError
|
|
40
49
|
*/
|
|
41
50
|
static remove(id: number): CancelablePromise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Update a driver online status by ID
|
|
53
|
+
* @param id
|
|
54
|
+
* @returns any Driver online status updated successfully.
|
|
55
|
+
* @throws ApiError
|
|
56
|
+
*/
|
|
57
|
+
static updateOnlineStatus(id: number): CancelablePromise<any>;
|
|
58
|
+
/**
|
|
59
|
+
* Deactivate a driver account by ID
|
|
60
|
+
* @param id
|
|
61
|
+
* @returns any Driver account deactivated successfully.
|
|
62
|
+
* @throws ApiError
|
|
63
|
+
*/
|
|
64
|
+
static deactivateAccount(id: number): CancelablePromise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* Update a driver account status by ID
|
|
67
|
+
* @param id
|
|
68
|
+
* @returns any Driver account status updated successfully.
|
|
69
|
+
* @throws ApiError
|
|
70
|
+
*/
|
|
71
|
+
static updateAccountStatus(id: number): CancelablePromise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* Update trip status, drivers are only allowed to update the status to IN_PROGRESS or COMPLETED.
|
|
74
|
+
* @param requestBody
|
|
75
|
+
* @returns any Trip status updated successfully
|
|
76
|
+
* @throws ApiError
|
|
77
|
+
*/
|
|
78
|
+
static updateTripStatus(requestBody: UpdateDriverTripStatusDto): CancelablePromise<any>;
|
|
42
79
|
}
|
|
@@ -23,19 +23,17 @@ class DriversService {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Get all drivers
|
|
26
|
-
* @param search
|
|
27
|
-
* @param
|
|
28
|
-
* @param order
|
|
26
|
+
* @param search Text to search for in name, surname, phone number, license or type
|
|
27
|
+
* @param order Sorting options
|
|
29
28
|
* @returns any List of drivers
|
|
30
29
|
* @throws ApiError
|
|
31
30
|
*/
|
|
32
|
-
static findAll(search,
|
|
31
|
+
static findAll(search, order) {
|
|
33
32
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
34
33
|
method: 'GET',
|
|
35
34
|
url: '/drivers',
|
|
36
35
|
query: {
|
|
37
36
|
'search': search,
|
|
38
|
-
'orderBy': orderBy,
|
|
39
37
|
'order': order,
|
|
40
38
|
},
|
|
41
39
|
errors: {
|
|
@@ -43,13 +41,32 @@ class DriversService {
|
|
|
43
41
|
},
|
|
44
42
|
});
|
|
45
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Get driver last location by ID
|
|
46
|
+
* @param id
|
|
47
|
+
* @returns any Driver last location retrieved successfully.
|
|
48
|
+
* @throws ApiError
|
|
49
|
+
*/
|
|
50
|
+
static getLastLocation(id) {
|
|
51
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
52
|
+
method: 'GET',
|
|
53
|
+
url: '/drivers/last-location/{id}',
|
|
54
|
+
path: {
|
|
55
|
+
'id': id,
|
|
56
|
+
},
|
|
57
|
+
errors: {
|
|
58
|
+
401: `Unauthorized`,
|
|
59
|
+
404: `Driver not found`,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
46
63
|
/**
|
|
47
64
|
* Get a single driver by ID
|
|
48
65
|
* @param id
|
|
49
66
|
* @returns any Driver found
|
|
50
67
|
* @throws ApiError
|
|
51
68
|
*/
|
|
52
|
-
static
|
|
69
|
+
static findById(id) {
|
|
53
70
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
54
71
|
method: 'GET',
|
|
55
72
|
url: '/drivers/{id}',
|
|
@@ -71,7 +88,7 @@ class DriversService {
|
|
|
71
88
|
*/
|
|
72
89
|
static update(id, requestBody) {
|
|
73
90
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
74
|
-
method: '
|
|
91
|
+
method: 'PATCH',
|
|
75
92
|
url: '/drivers/{id}',
|
|
76
93
|
path: {
|
|
77
94
|
'id': id,
|
|
@@ -103,5 +120,81 @@ class DriversService {
|
|
|
103
120
|
},
|
|
104
121
|
});
|
|
105
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Update a driver online status by ID
|
|
125
|
+
* @param id
|
|
126
|
+
* @returns any Driver online status updated successfully.
|
|
127
|
+
* @throws ApiError
|
|
128
|
+
*/
|
|
129
|
+
static updateOnlineStatus(id) {
|
|
130
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
131
|
+
method: 'PATCH',
|
|
132
|
+
url: '/drivers/online-status/{id}',
|
|
133
|
+
path: {
|
|
134
|
+
'id': id,
|
|
135
|
+
},
|
|
136
|
+
errors: {
|
|
137
|
+
401: `Unauthorized`,
|
|
138
|
+
404: `Driver not found`,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Deactivate a driver account by ID
|
|
144
|
+
* @param id
|
|
145
|
+
* @returns any Driver account deactivated successfully.
|
|
146
|
+
* @throws ApiError
|
|
147
|
+
*/
|
|
148
|
+
static deactivateAccount(id) {
|
|
149
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
150
|
+
method: 'PATCH',
|
|
151
|
+
url: '/drivers/deactivate-account/{id}',
|
|
152
|
+
path: {
|
|
153
|
+
'id': id,
|
|
154
|
+
},
|
|
155
|
+
errors: {
|
|
156
|
+
401: `Unauthorized`,
|
|
157
|
+
404: `Driver not found`,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Update a driver account status by ID
|
|
163
|
+
* @param id
|
|
164
|
+
* @returns any Driver account status updated successfully.
|
|
165
|
+
* @throws ApiError
|
|
166
|
+
*/
|
|
167
|
+
static updateAccountStatus(id) {
|
|
168
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
169
|
+
method: 'PATCH',
|
|
170
|
+
url: '/drivers/account-status/{id}',
|
|
171
|
+
path: {
|
|
172
|
+
'id': id,
|
|
173
|
+
},
|
|
174
|
+
errors: {
|
|
175
|
+
401: `Unauthorized`,
|
|
176
|
+
404: `Driver not found`,
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Update trip status, drivers are only allowed to update the status to IN_PROGRESS or COMPLETED.
|
|
182
|
+
* @param requestBody
|
|
183
|
+
* @returns any Trip status updated successfully
|
|
184
|
+
* @throws ApiError
|
|
185
|
+
*/
|
|
186
|
+
static updateTripStatus(requestBody) {
|
|
187
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
188
|
+
method: 'PATCH',
|
|
189
|
+
url: '/drivers/trips/status',
|
|
190
|
+
body: requestBody,
|
|
191
|
+
mediaType: 'application/json',
|
|
192
|
+
errors: {
|
|
193
|
+
400: `Bad Request`,
|
|
194
|
+
401: `Unauthorized`,
|
|
195
|
+
404: `Service order not found`,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
}
|
|
106
199
|
}
|
|
107
200
|
exports.DriversService = DriversService;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { EmailPhoneLoginDto } from '../models/EmailPhoneLoginDto';
|
|
2
|
+
import type { GenerateUserResetCodeDto } from '../models/GenerateUserResetCodeDto';
|
|
3
|
+
import type { GenerateUserVerificationCodeDto } from '../models/GenerateUserVerificationCodeDto';
|
|
4
|
+
import type { ResetUserPasswordDto } from '../models/ResetUserPasswordDto';
|
|
5
|
+
import type { UserDto } from '../models/UserDto';
|
|
6
|
+
import type { UserUpdatedDto } from '../models/UserUpdatedDto';
|
|
7
|
+
import type { ValidateUserResetCodeDto } from '../models/ValidateUserResetCodeDto';
|
|
8
|
+
import type { VerifyUserAccountDto } from '../models/VerifyUserAccountDto';
|
|
9
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
10
|
+
export declare class UserAuthService {
|
|
11
|
+
/**
|
|
12
|
+
* User Login
|
|
13
|
+
* @param requestBody
|
|
14
|
+
* @returns any Login successful
|
|
15
|
+
* @throws ApiError
|
|
16
|
+
*/
|
|
17
|
+
static login(requestBody: EmailPhoneLoginDto): CancelablePromise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* User Register
|
|
20
|
+
* @param requestBody
|
|
21
|
+
* @returns any Registration successful
|
|
22
|
+
* @throws ApiError
|
|
23
|
+
*/
|
|
24
|
+
static register(requestBody: UserDto): CancelablePromise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* Refresh User Token
|
|
27
|
+
* @returns any Token refreshed successfully
|
|
28
|
+
* @throws ApiError
|
|
29
|
+
*/
|
|
30
|
+
static refreshToken(): CancelablePromise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Get Current User
|
|
33
|
+
* @returns any User information retrieved
|
|
34
|
+
* @throws ApiError
|
|
35
|
+
*/
|
|
36
|
+
static me(): CancelablePromise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Update User Profile
|
|
39
|
+
* @param requestBody
|
|
40
|
+
* @returns any User profile updated successfully
|
|
41
|
+
* @throws ApiError
|
|
42
|
+
*/
|
|
43
|
+
static updateProfile(requestBody: UserUpdatedDto): CancelablePromise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* User Logout
|
|
46
|
+
* @returns any Logout successful
|
|
47
|
+
* @throws ApiError
|
|
48
|
+
*/
|
|
49
|
+
static logout(): CancelablePromise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* Generate Password Reset Code
|
|
52
|
+
* @param requestBody
|
|
53
|
+
* @returns any Reset code generated and sent successfully
|
|
54
|
+
* @throws ApiError
|
|
55
|
+
*/
|
|
56
|
+
static generateResetCode(requestBody: GenerateUserResetCodeDto): CancelablePromise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Validate Password Reset Code
|
|
59
|
+
* @param requestBody
|
|
60
|
+
* @returns any Reset code is valid
|
|
61
|
+
* @throws ApiError
|
|
62
|
+
*/
|
|
63
|
+
static validateResetCode(requestBody: ValidateUserResetCodeDto): CancelablePromise<any>;
|
|
64
|
+
/**
|
|
65
|
+
* Reset User Password
|
|
66
|
+
* @param requestBody
|
|
67
|
+
* @returns any Password reset successfully
|
|
68
|
+
* @throws ApiError
|
|
69
|
+
*/
|
|
70
|
+
static resetPassword(requestBody: ResetUserPasswordDto): CancelablePromise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* Generate User Verification Code
|
|
73
|
+
* @param requestBody
|
|
74
|
+
* @returns any Verification code generated and sent successfully
|
|
75
|
+
* @throws ApiError
|
|
76
|
+
*/
|
|
77
|
+
static generateVerificationCode(requestBody: GenerateUserVerificationCodeDto): CancelablePromise<any>;
|
|
78
|
+
/**
|
|
79
|
+
* Verify User Account
|
|
80
|
+
* @param requestBody
|
|
81
|
+
* @returns any User verified successfully
|
|
82
|
+
* @throws ApiError
|
|
83
|
+
*/
|
|
84
|
+
static verifyAccount(requestBody: VerifyUserAccountDto): CancelablePromise<any>;
|
|
85
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserAuthService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class UserAuthService {
|
|
7
|
+
/**
|
|
8
|
+
* User Login
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns any Login successful
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static login(requestBody) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/auth/users/login',
|
|
17
|
+
body: requestBody,
|
|
18
|
+
mediaType: 'application/json',
|
|
19
|
+
errors: {
|
|
20
|
+
401: `Invalid credentials`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* User Register
|
|
26
|
+
* @param requestBody
|
|
27
|
+
* @returns any Registration successful
|
|
28
|
+
* @throws ApiError
|
|
29
|
+
*/
|
|
30
|
+
static register(requestBody) {
|
|
31
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
url: '/auth/users/register',
|
|
34
|
+
body: requestBody,
|
|
35
|
+
mediaType: 'application/json',
|
|
36
|
+
errors: {
|
|
37
|
+
400: `Bad Request`,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Refresh User Token
|
|
43
|
+
* @returns any Token refreshed successfully
|
|
44
|
+
* @throws ApiError
|
|
45
|
+
*/
|
|
46
|
+
static refreshToken() {
|
|
47
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
48
|
+
method: 'GET',
|
|
49
|
+
url: '/auth/users/refresh-token',
|
|
50
|
+
errors: {
|
|
51
|
+
401: `Unauthorized`,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get Current User
|
|
57
|
+
* @returns any User information retrieved
|
|
58
|
+
* @throws ApiError
|
|
59
|
+
*/
|
|
60
|
+
static me() {
|
|
61
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
62
|
+
method: 'GET',
|
|
63
|
+
url: '/auth/users/me',
|
|
64
|
+
errors: {
|
|
65
|
+
401: `Unauthorized`,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Update User Profile
|
|
71
|
+
* @param requestBody
|
|
72
|
+
* @returns any User profile updated successfully
|
|
73
|
+
* @throws ApiError
|
|
74
|
+
*/
|
|
75
|
+
static updateProfile(requestBody) {
|
|
76
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
77
|
+
method: 'PATCH',
|
|
78
|
+
url: '/auth/users/update-profile',
|
|
79
|
+
body: requestBody,
|
|
80
|
+
mediaType: 'application/json',
|
|
81
|
+
errors: {
|
|
82
|
+
401: `Unauthorized`,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* User Logout
|
|
88
|
+
* @returns any Logout successful
|
|
89
|
+
* @throws ApiError
|
|
90
|
+
*/
|
|
91
|
+
static logout() {
|
|
92
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
93
|
+
method: 'POST',
|
|
94
|
+
url: '/auth/users/logout',
|
|
95
|
+
errors: {
|
|
96
|
+
401: `Unauthorized`,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Generate Password Reset Code
|
|
102
|
+
* @param requestBody
|
|
103
|
+
* @returns any Reset code generated and sent successfully
|
|
104
|
+
* @throws ApiError
|
|
105
|
+
*/
|
|
106
|
+
static generateResetCode(requestBody) {
|
|
107
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
108
|
+
method: 'POST',
|
|
109
|
+
url: '/auth/users/forgot-password',
|
|
110
|
+
body: requestBody,
|
|
111
|
+
mediaType: 'application/json',
|
|
112
|
+
errors: {
|
|
113
|
+
401: `User not found`,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Validate Password Reset Code
|
|
119
|
+
* @param requestBody
|
|
120
|
+
* @returns any Reset code is valid
|
|
121
|
+
* @throws ApiError
|
|
122
|
+
*/
|
|
123
|
+
static validateResetCode(requestBody) {
|
|
124
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
125
|
+
method: 'POST',
|
|
126
|
+
url: '/auth/users/validate-reset-code',
|
|
127
|
+
body: requestBody,
|
|
128
|
+
mediaType: 'application/json',
|
|
129
|
+
errors: {
|
|
130
|
+
401: `User not found`,
|
|
131
|
+
403: `Invalid or expired reset code`,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Reset User Password
|
|
137
|
+
* @param requestBody
|
|
138
|
+
* @returns any Password reset successfully
|
|
139
|
+
* @throws ApiError
|
|
140
|
+
*/
|
|
141
|
+
static resetPassword(requestBody) {
|
|
142
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
143
|
+
method: 'POST',
|
|
144
|
+
url: '/auth/users/reset-password',
|
|
145
|
+
body: requestBody,
|
|
146
|
+
mediaType: 'application/json',
|
|
147
|
+
errors: {
|
|
148
|
+
401: `User not found`,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Generate User Verification Code
|
|
154
|
+
* @param requestBody
|
|
155
|
+
* @returns any Verification code generated and sent successfully
|
|
156
|
+
* @throws ApiError
|
|
157
|
+
*/
|
|
158
|
+
static generateVerificationCode(requestBody) {
|
|
159
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
160
|
+
method: 'POST',
|
|
161
|
+
url: '/auth/users/generate-verification-code',
|
|
162
|
+
body: requestBody,
|
|
163
|
+
mediaType: 'application/json',
|
|
164
|
+
errors: {
|
|
165
|
+
401: `User not found`,
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Verify User Account
|
|
171
|
+
* @param requestBody
|
|
172
|
+
* @returns any User verified successfully
|
|
173
|
+
* @throws ApiError
|
|
174
|
+
*/
|
|
175
|
+
static verifyAccount(requestBody) {
|
|
176
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
177
|
+
method: 'POST',
|
|
178
|
+
url: '/auth/users/verify-account',
|
|
179
|
+
body: requestBody,
|
|
180
|
+
mediaType: 'application/json',
|
|
181
|
+
errors: {
|
|
182
|
+
401: `User not found`,
|
|
183
|
+
403: `Invalid or expired verification code`,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.UserAuthService = UserAuthService;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type { CreateStreetPickupDto } from '../models/CreateStreetPickupDto';
|
|
2
|
+
import type { CreateUserLocationDto } from '../models/CreateUserLocationDto';
|
|
3
|
+
import type { OrderDto } from '../models/OrderDto';
|
|
4
|
+
import type { UpdateUserLocationDto } from '../models/UpdateUserLocationDto';
|
|
1
5
|
import type { UserDto } from '../models/UserDto';
|
|
6
|
+
import type { UserUpdatedDto } from '../models/UserUpdatedDto';
|
|
2
7
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
8
|
export declare class UsersService {
|
|
4
9
|
/**
|
|
@@ -10,13 +15,47 @@ export declare class UsersService {
|
|
|
10
15
|
static create(requestBody: UserDto): CancelablePromise<any>;
|
|
11
16
|
/**
|
|
12
17
|
* Get all users
|
|
13
|
-
* @param search
|
|
14
|
-
* @param
|
|
15
|
-
* @param order
|
|
18
|
+
* @param search Text to search for in name, surname, phone number or email
|
|
19
|
+
* @param order Sorting options
|
|
16
20
|
* @returns any List of users.
|
|
17
21
|
* @throws ApiError
|
|
18
22
|
*/
|
|
19
|
-
static findAll(search
|
|
23
|
+
static findAll(search?: string, order?: OrderDto): CancelablePromise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new street pickup/service order
|
|
26
|
+
* @param requestBody
|
|
27
|
+
* @returns any Street pickup created successfully.
|
|
28
|
+
* @throws ApiError
|
|
29
|
+
*/
|
|
30
|
+
static createStreetPickup(requestBody: CreateStreetPickupDto): CancelablePromise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Get all locations for the authenticated user
|
|
33
|
+
* @returns any List of user locations.
|
|
34
|
+
* @throws ApiError
|
|
35
|
+
*/
|
|
36
|
+
static getUserLocations(): CancelablePromise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new location for the authenticated user
|
|
39
|
+
* @param requestBody
|
|
40
|
+
* @returns any Location created successfully.
|
|
41
|
+
* @throws ApiError
|
|
42
|
+
*/
|
|
43
|
+
static createUserLocation(requestBody: CreateUserLocationDto): CancelablePromise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* Update a user location
|
|
46
|
+
* @param locationId
|
|
47
|
+
* @param requestBody
|
|
48
|
+
* @returns any Location updated successfully.
|
|
49
|
+
* @throws ApiError
|
|
50
|
+
*/
|
|
51
|
+
static updateUserLocation(locationId: number, requestBody: UpdateUserLocationDto): CancelablePromise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* Delete a user location
|
|
54
|
+
* @param locationId
|
|
55
|
+
* @returns any Location deleted successfully.
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static deleteUserLocation(locationId: number): CancelablePromise<any>;
|
|
20
59
|
/**
|
|
21
60
|
* Get a user by ID
|
|
22
61
|
* @param id
|
|
@@ -31,7 +70,7 @@ export declare class UsersService {
|
|
|
31
70
|
* @returns any User updated successfully.
|
|
32
71
|
* @throws ApiError
|
|
33
72
|
*/
|
|
34
|
-
static update(id: number, requestBody:
|
|
73
|
+
static update(id: number, requestBody: UserUpdatedDto): CancelablePromise<any>;
|
|
35
74
|
/**
|
|
36
75
|
* Delete a user by ID
|
|
37
76
|
* @param id
|