@dapex-tech/elite-online-services 0.0.22 → 0.0.24
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/createClient.d.ts +2 -0
- package/models/AdminRedisActiveTripResponseDto.d.ts +29 -0
- package/models/AdminRedisDeleteResponseDto.d.ts +3 -0
- package/models/AdminRedisDeleteResponseDto.js +2 -0
- package/models/AdminRedisRuntimeResetResponseDto.d.ts +8 -0
- package/models/AdminRedisRuntimeResetResponseDto.js +2 -0
- package/models/AdminSearchCustomersResponseDto.d.ts +6 -6
- package/models/AdminSearchManualCustomersBucketDto.d.ts +14 -0
- package/models/AdminSearchManualCustomersBucketDto.js +2 -0
- package/models/AdminSearchRegisteredCustomersBucketDto.d.ts +14 -0
- package/models/AdminSearchRegisteredCustomersBucketDto.js +2 -0
- package/models/AdminSearchVouchersBucketDto.d.ts +14 -0
- package/models/AdminSearchVouchersBucketDto.js +2 -0
- package/models/CustomerLoginDto.d.ts +1 -1
- package/models/DriverCreateDto.d.ts +4 -0
- package/models/DriverDto.d.ts +13 -0
- package/models/DriverLocationUpdateDto.d.ts +10 -0
- package/models/DriverLocationUpdateDto.js +2 -0
- package/models/DriverLoginDto.d.ts +9 -1
- package/models/DriverLoginResponseDto.d.ts +13 -0
- package/models/DriverStatusResponseDto.d.ts +10 -0
- package/models/DriverStatusResponseDto.js +2 -0
- package/models/DriverUpdateDto.d.ts +4 -0
- package/models/ManualCustomerCreateDto.d.ts +1 -1
- package/models/ManualCustomerDto.d.ts +1 -1
- package/models/ManualCustomerUpdateDto.d.ts +1 -1
- package/models/PaginatedTripsDto.d.ts +16 -0
- package/models/PaginatedTripsDto.js +2 -0
- package/models/PaymentDto.d.ts +32 -0
- package/models/QueueSummaryDto.d.ts +1 -1
- package/models/ResetPasswordDto.d.ts +4 -0
- package/models/SendDriverPushDto.d.ts +8 -0
- package/models/SendDriverPushDto.js +2 -0
- package/models/TripAssignDriverDto.d.ts +2 -2
- package/models/TripDto.d.ts +2 -4
- package/models/TripLanguages.d.ts +4 -0
- package/models/TripLanguages.js +12 -0
- package/models/TripUpdateDto.d.ts +63 -2
- package/models/index.d.ts +11 -1
- package/models/index.js +11 -1
- package/package.json +1 -1
- package/services/AdminAuthService.d.ts +1 -8
- package/services/AdminAuthService.js +1 -14
- package/services/AdminDispatchService.d.ts +27 -0
- package/services/AdminDispatchService.js +54 -0
- package/services/AdminDriversService.d.ts +18 -1
- package/services/AdminDriversService.js +35 -1
- package/services/AdminQueuesService.d.ts +2 -2
- package/services/AdminRedisService.d.ts +46 -0
- package/services/AdminRedisService.js +89 -0
- package/services/AdminService.d.ts +6 -4
- package/services/AdminService.js +8 -4
- package/services/AdminTripsService.d.ts +15 -3
- package/services/AdminTripsService.js +24 -3
- package/services/CustomerTripsService.d.ts +15 -3
- package/services/CustomerTripsService.js +24 -3
- package/services/CustomersAuthService.d.ts +1 -8
- package/services/CustomersAuthService.js +1 -14
- package/services/DriverAuthService.d.ts +1 -8
- package/services/DriverAuthService.js +1 -14
- package/services/DriverPaymentsService.js +1 -0
- package/services/DriverTripsService.d.ts +23 -3
- package/services/DriverTripsService.js +40 -3
- package/services/DriversService.d.ts +21 -0
- package/services/DriversService.js +35 -0
- package/services/MainService.d.ts +8 -0
- package/services/MainService.js +19 -0
- package/services/index.d.ts +2 -0
- package/services/index.js +2 -0
- package/socketService.js +17 -1
- package/types/realtime/active-trip.d.ts +3 -2
- package/models/ValidateResetCodeDto.d.ts +0 -14
- /package/models/{ValidateResetCodeDto.js → AdminRedisActiveTripResponseDto.js} +0 -0
|
@@ -19,20 +19,26 @@ class CustomerTripsService {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Get
|
|
22
|
+
* Get trips for a customer (paginated)
|
|
23
|
+
* @param page Page number
|
|
24
|
+
* @param pageSize Items per page
|
|
23
25
|
* @param q Text to search for in trip fields
|
|
26
|
+
* @param status Comma-separated trip status values. Valid values: SCHEDULED, REQUESTED, DRIVER_SEARCHING, DRIVER_ASSIGNED, DRIVER_ASSIGNED_PENDING, DRIVER_ONWAY, DRIVER_AT_PICKUP, IN_PROGRESS, PAUSED, PAUSED_TRAFFIC, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
24
27
|
* @param order Sorting options
|
|
25
28
|
* @param customerId Filter by customer ID (scope to customer)
|
|
26
29
|
* @param driverId Filter by driver ID (scope to driver)
|
|
27
|
-
* @returns
|
|
30
|
+
* @returns PaginatedTripsDto Paginated list of trips
|
|
28
31
|
* @throws ApiError
|
|
29
32
|
*/
|
|
30
|
-
static findAll(q, order, customerId, driverId) {
|
|
33
|
+
static findAll(page = 1, pageSize = 12, q, status, order, customerId, driverId) {
|
|
31
34
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
32
35
|
method: 'GET',
|
|
33
36
|
url: '/customers/trips',
|
|
34
37
|
query: {
|
|
38
|
+
'page': page,
|
|
39
|
+
'pageSize': pageSize,
|
|
35
40
|
'q': q,
|
|
41
|
+
'status': status,
|
|
36
42
|
'order': order,
|
|
37
43
|
'customerId': customerId,
|
|
38
44
|
'driverId': driverId,
|
|
@@ -64,6 +70,21 @@ class CustomerTripsService {
|
|
|
64
70
|
url: '/customers/trips/active',
|
|
65
71
|
});
|
|
66
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Get trip location points
|
|
75
|
+
* @param id
|
|
76
|
+
* @returns TripLocationPointDto List of trip location points
|
|
77
|
+
* @throws ApiError
|
|
78
|
+
*/
|
|
79
|
+
static getTripLocationPoints(id) {
|
|
80
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
81
|
+
method: 'GET',
|
|
82
|
+
url: '/customers/trips/{id}/location-points',
|
|
83
|
+
path: {
|
|
84
|
+
'id': id,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
67
88
|
/**
|
|
68
89
|
* Get a single trip by ID
|
|
69
90
|
* @param id
|
|
@@ -9,7 +9,6 @@ import type { GenerateVerificationCodeDto } from '../models/GenerateVerification
|
|
|
9
9
|
import type { MessageResponseDto } from '../models/MessageResponseDto';
|
|
10
10
|
import type { ResetPasswordDto } from '../models/ResetPasswordDto';
|
|
11
11
|
import type { TokensDto } from '../models/TokensDto';
|
|
12
|
-
import type { ValidateResetCodeDto } from '../models/ValidateResetCodeDto';
|
|
13
12
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
14
13
|
export declare class CustomersAuthService {
|
|
15
14
|
/**
|
|
@@ -59,15 +58,9 @@ export declare class CustomersAuthService {
|
|
|
59
58
|
* @throws ApiError
|
|
60
59
|
*/
|
|
61
60
|
static generateResetCode(requestBody: GenerateResetCodeDto): CancelablePromise<MessageResponseDto>;
|
|
62
|
-
/**
|
|
63
|
-
* Validate Password Reset Code
|
|
64
|
-
* @param requestBody
|
|
65
|
-
* @returns MessageResponseDto Reset code is valid
|
|
66
|
-
* @throws ApiError
|
|
67
|
-
*/
|
|
68
|
-
static validateResetCode(requestBody: ValidateResetCodeDto): CancelablePromise<MessageResponseDto>;
|
|
69
61
|
/**
|
|
70
62
|
* Reset Customer Password
|
|
63
|
+
* Requires the SMS reset code from forgot-password together with the new password.
|
|
71
64
|
* @param requestBody
|
|
72
65
|
* @returns MessageResponseDto Password reset successfully
|
|
73
66
|
* @throws ApiError
|
|
@@ -94,22 +94,9 @@ class CustomersAuthService {
|
|
|
94
94
|
mediaType: 'application/json',
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Validate Password Reset Code
|
|
99
|
-
* @param requestBody
|
|
100
|
-
* @returns MessageResponseDto Reset code is valid
|
|
101
|
-
* @throws ApiError
|
|
102
|
-
*/
|
|
103
|
-
static validateResetCode(requestBody) {
|
|
104
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
105
|
-
method: 'POST',
|
|
106
|
-
url: '/auth/customers/validate-reset-code',
|
|
107
|
-
body: requestBody,
|
|
108
|
-
mediaType: 'application/json',
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
97
|
/**
|
|
112
98
|
* Reset Customer Password
|
|
99
|
+
* Requires the SMS reset code from forgot-password together with the new password.
|
|
113
100
|
* @param requestBody
|
|
114
101
|
* @returns MessageResponseDto Password reset successfully
|
|
115
102
|
* @throws ApiError
|
|
@@ -5,7 +5,6 @@ import type { GenerateResetCodeDto } from '../models/GenerateResetCodeDto';
|
|
|
5
5
|
import type { MessageResponseDto } from '../models/MessageResponseDto';
|
|
6
6
|
import type { ResetPasswordDto } from '../models/ResetPasswordDto';
|
|
7
7
|
import type { TokensDto } from '../models/TokensDto';
|
|
8
|
-
import type { ValidateResetCodeDto } from '../models/ValidateResetCodeDto';
|
|
9
8
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
10
9
|
export declare class DriverAuthService {
|
|
11
10
|
/**
|
|
@@ -40,15 +39,9 @@ export declare class DriverAuthService {
|
|
|
40
39
|
* @throws ApiError
|
|
41
40
|
*/
|
|
42
41
|
static generateResetCode(requestBody: GenerateResetCodeDto): CancelablePromise<MessageResponseDto>;
|
|
43
|
-
/**
|
|
44
|
-
* Validate Password Reset Code
|
|
45
|
-
* @param requestBody
|
|
46
|
-
* @returns MessageResponseDto Reset code is valid
|
|
47
|
-
* @throws ApiError
|
|
48
|
-
*/
|
|
49
|
-
static validateResetCode(requestBody: ValidateResetCodeDto): CancelablePromise<MessageResponseDto>;
|
|
50
42
|
/**
|
|
51
43
|
* Reset Driver Password
|
|
44
|
+
* Requires the SMS reset code from forgot-password together with the new password.
|
|
52
45
|
* @param requestBody
|
|
53
46
|
* @returns MessageResponseDto Password reset successfully
|
|
54
47
|
* @throws ApiError
|
|
@@ -65,22 +65,9 @@ class DriverAuthService {
|
|
|
65
65
|
mediaType: 'application/json',
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Validate Password Reset Code
|
|
70
|
-
* @param requestBody
|
|
71
|
-
* @returns MessageResponseDto Reset code is valid
|
|
72
|
-
* @throws ApiError
|
|
73
|
-
*/
|
|
74
|
-
static validateResetCode(requestBody) {
|
|
75
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
76
|
-
method: 'POST',
|
|
77
|
-
url: '/auth/drivers/validate-reset-code',
|
|
78
|
-
body: requestBody,
|
|
79
|
-
mediaType: 'application/json',
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
68
|
/**
|
|
83
69
|
* Reset Driver Password
|
|
70
|
+
* Requires the SMS reset code from forgot-password together with the new password.
|
|
84
71
|
* @param requestBody
|
|
85
72
|
* @returns MessageResponseDto Password reset successfully
|
|
86
73
|
* @throws ApiError
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DriverTripActions } from '../models/DriverTripActions';
|
|
2
2
|
import type { EstimateTripCostDto } from '../models/EstimateTripCostDto';
|
|
3
3
|
import type { OrderDto } from '../models/OrderDto';
|
|
4
|
+
import type { PaginatedTripsDto } from '../models/PaginatedTripsDto';
|
|
4
5
|
import type { TripDto } from '../models/TripDto';
|
|
6
|
+
import type { TripLocationPointDto } from '../models/TripLocationPointDto';
|
|
5
7
|
import type { TripUpdateDto } from '../models/TripUpdateDto';
|
|
6
8
|
import type { VoucherDriverCreateDto } from '../models/VoucherDriverCreateDto';
|
|
7
9
|
import type { VoucherDto } from '../models/VoucherDto';
|
|
@@ -15,15 +17,18 @@ export declare class DriverTripsService {
|
|
|
15
17
|
*/
|
|
16
18
|
static create(requestBody: TripDto): CancelablePromise<TripDto>;
|
|
17
19
|
/**
|
|
18
|
-
* Get
|
|
20
|
+
* Get trips for a driver (paginated)
|
|
21
|
+
* @param page Page number
|
|
22
|
+
* @param pageSize Items per page
|
|
19
23
|
* @param q Text to search for in trip fields
|
|
24
|
+
* @param status Comma-separated trip status values. Valid values: SCHEDULED, REQUESTED, DRIVER_SEARCHING, DRIVER_ASSIGNED, DRIVER_ASSIGNED_PENDING, DRIVER_ONWAY, DRIVER_AT_PICKUP, IN_PROGRESS, PAUSED, PAUSED_TRAFFIC, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
20
25
|
* @param order Sorting options
|
|
21
26
|
* @param customerId Filter by customer ID (scope to customer)
|
|
22
27
|
* @param driverId Filter by driver ID (scope to driver)
|
|
23
|
-
* @returns
|
|
28
|
+
* @returns PaginatedTripsDto Paginated list of trips
|
|
24
29
|
* @throws ApiError
|
|
25
30
|
*/
|
|
26
|
-
static findAll(q?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<
|
|
31
|
+
static findAll(page?: number, pageSize?: number, q?: string, status?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
27
32
|
/**
|
|
28
33
|
* Estimate trip cost by origin and destination
|
|
29
34
|
* @param requestBody
|
|
@@ -52,6 +57,13 @@ export declare class DriverTripsService {
|
|
|
52
57
|
* @throws ApiError
|
|
53
58
|
*/
|
|
54
59
|
static getActiveTrip(): CancelablePromise<TripDto>;
|
|
60
|
+
/**
|
|
61
|
+
* Get trip location points
|
|
62
|
+
* @param id
|
|
63
|
+
* @returns TripLocationPointDto List of trip location points
|
|
64
|
+
* @throws ApiError
|
|
65
|
+
*/
|
|
66
|
+
static getTripLocationPoints(id: number): CancelablePromise<Array<TripLocationPointDto>>;
|
|
55
67
|
/**
|
|
56
68
|
* Create voucher for trip (new senior not yet reported by city)
|
|
57
69
|
* @param id Trip ID
|
|
@@ -68,4 +80,12 @@ export declare class DriverTripsService {
|
|
|
68
80
|
* @throws ApiError
|
|
69
81
|
*/
|
|
70
82
|
static executeTripAction(id: number, action: DriverTripActions): CancelablePromise<TripDto>;
|
|
83
|
+
/**
|
|
84
|
+
* Send pickup notification (voice call + SMS) to the customer
|
|
85
|
+
* Trip must be in DRIVER_ONWAY or DRIVER_AT_PICKUP status. Message language is determined by the trip language setting.
|
|
86
|
+
* @param id Trip ID
|
|
87
|
+
* @returns any Notifications dispatched.
|
|
88
|
+
* @throws ApiError
|
|
89
|
+
*/
|
|
90
|
+
static sendPickupNotification(id: number): CancelablePromise<any>;
|
|
71
91
|
}
|
|
@@ -19,20 +19,26 @@ class DriverTripsService {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Get
|
|
22
|
+
* Get trips for a driver (paginated)
|
|
23
|
+
* @param page Page number
|
|
24
|
+
* @param pageSize Items per page
|
|
23
25
|
* @param q Text to search for in trip fields
|
|
26
|
+
* @param status Comma-separated trip status values. Valid values: SCHEDULED, REQUESTED, DRIVER_SEARCHING, DRIVER_ASSIGNED, DRIVER_ASSIGNED_PENDING, DRIVER_ONWAY, DRIVER_AT_PICKUP, IN_PROGRESS, PAUSED, PAUSED_TRAFFIC, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
24
27
|
* @param order Sorting options
|
|
25
28
|
* @param customerId Filter by customer ID (scope to customer)
|
|
26
29
|
* @param driverId Filter by driver ID (scope to driver)
|
|
27
|
-
* @returns
|
|
30
|
+
* @returns PaginatedTripsDto Paginated list of trips
|
|
28
31
|
* @throws ApiError
|
|
29
32
|
*/
|
|
30
|
-
static findAll(q, order, customerId, driverId) {
|
|
33
|
+
static findAll(page = 1, pageSize = 12, q, status, order, customerId, driverId) {
|
|
31
34
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
32
35
|
method: 'GET',
|
|
33
36
|
url: '/drivers/trips',
|
|
34
37
|
query: {
|
|
38
|
+
'page': page,
|
|
39
|
+
'pageSize': pageSize,
|
|
35
40
|
'q': q,
|
|
41
|
+
'status': status,
|
|
36
42
|
'order': order,
|
|
37
43
|
'customerId': customerId,
|
|
38
44
|
'driverId': driverId,
|
|
@@ -97,6 +103,21 @@ class DriverTripsService {
|
|
|
97
103
|
url: '/drivers/trips/active',
|
|
98
104
|
});
|
|
99
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Get trip location points
|
|
108
|
+
* @param id
|
|
109
|
+
* @returns TripLocationPointDto List of trip location points
|
|
110
|
+
* @throws ApiError
|
|
111
|
+
*/
|
|
112
|
+
static getTripLocationPoints(id) {
|
|
113
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
114
|
+
method: 'GET',
|
|
115
|
+
url: '/drivers/trips/{id}/location-points',
|
|
116
|
+
path: {
|
|
117
|
+
'id': id,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
100
121
|
/**
|
|
101
122
|
* Create voucher for trip (new senior not yet reported by city)
|
|
102
123
|
* @param id Trip ID
|
|
@@ -132,5 +153,21 @@ class DriverTripsService {
|
|
|
132
153
|
},
|
|
133
154
|
});
|
|
134
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Send pickup notification (voice call + SMS) to the customer
|
|
158
|
+
* Trip must be in DRIVER_ONWAY or DRIVER_AT_PICKUP status. Message language is determined by the trip language setting.
|
|
159
|
+
* @param id Trip ID
|
|
160
|
+
* @returns any Notifications dispatched.
|
|
161
|
+
* @throws ApiError
|
|
162
|
+
*/
|
|
163
|
+
static sendPickupNotification(id) {
|
|
164
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
165
|
+
method: 'POST',
|
|
166
|
+
url: '/drivers/trips/{id}/send-pickup-notification',
|
|
167
|
+
path: {
|
|
168
|
+
'id': id,
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
}
|
|
135
172
|
}
|
|
136
173
|
exports.DriverTripsService = DriverTripsService;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { AdminSearchCustomersResponseDto } from '../models/AdminSearchCustomersResponseDto';
|
|
1
2
|
import type { DriverDto } from '../models/DriverDto';
|
|
3
|
+
import type { DriverLocationUpdateDto } from '../models/DriverLocationUpdateDto';
|
|
4
|
+
import type { DriverStatusResponseDto } from '../models/DriverStatusResponseDto';
|
|
2
5
|
import type { DriverUpdateDto } from '../models/DriverUpdateDto';
|
|
3
6
|
import type { MessageResponseDto } from '../models/MessageResponseDto';
|
|
7
|
+
import type { OrderDto } from '../models/OrderDto';
|
|
4
8
|
import type { SeniorCenterDto } from '../models/SeniorCenterDto';
|
|
5
9
|
import type { TwilioTokenResponse } from '../models/TwilioTokenResponse';
|
|
6
10
|
import type { UpdateFcmTokenDto } from '../models/UpdateFcmTokenDto';
|
|
@@ -56,4 +60,21 @@ export declare class DriversService {
|
|
|
56
60
|
* @throws ApiError
|
|
57
61
|
*/
|
|
58
62
|
static findAllSeniorCenters(): CancelablePromise<Array<SeniorCenterDto>>;
|
|
63
|
+
/**
|
|
64
|
+
* Search customers (registered + manual + vouchers), paginated per bucket
|
|
65
|
+
* @param page Page number
|
|
66
|
+
* @param pageSize Items per page
|
|
67
|
+
* @param q Text to search for in customers (registered customers + manual customers + vouchers)
|
|
68
|
+
* @param order Sorting options (each bucket uses its own table default when omitted)
|
|
69
|
+
* @returns AdminSearchCustomersResponseDto Each of registeredCustomers, vouchers, and manualCustomers includes page, pageSize, total, and items
|
|
70
|
+
* @throws ApiError
|
|
71
|
+
*/
|
|
72
|
+
static searchCustomers(page?: number, pageSize?: number, q?: string, order?: OrderDto): CancelablePromise<AdminSearchCustomersResponseDto>;
|
|
73
|
+
/**
|
|
74
|
+
* Update driver live location
|
|
75
|
+
* @param requestBody
|
|
76
|
+
* @returns DriverStatusResponseDto Updated driver status snapshot stored in Redis
|
|
77
|
+
* @throws ApiError
|
|
78
|
+
*/
|
|
79
|
+
static updateDriverLocation(requestBody: DriverLocationUpdateDto): CancelablePromise<DriverStatusResponseDto>;
|
|
59
80
|
}
|
|
@@ -102,5 +102,40 @@ class DriversService {
|
|
|
102
102
|
url: '/drivers/senior-centers',
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Search customers (registered + manual + vouchers), paginated per bucket
|
|
107
|
+
* @param page Page number
|
|
108
|
+
* @param pageSize Items per page
|
|
109
|
+
* @param q Text to search for in customers (registered customers + manual customers + vouchers)
|
|
110
|
+
* @param order Sorting options (each bucket uses its own table default when omitted)
|
|
111
|
+
* @returns AdminSearchCustomersResponseDto Each of registeredCustomers, vouchers, and manualCustomers includes page, pageSize, total, and items
|
|
112
|
+
* @throws ApiError
|
|
113
|
+
*/
|
|
114
|
+
static searchCustomers(page = 1, pageSize = 12, q, order) {
|
|
115
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
116
|
+
method: 'GET',
|
|
117
|
+
url: '/drivers/search-customers',
|
|
118
|
+
query: {
|
|
119
|
+
'page': page,
|
|
120
|
+
'pageSize': pageSize,
|
|
121
|
+
'q': q,
|
|
122
|
+
'order': order,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Update driver live location
|
|
128
|
+
* @param requestBody
|
|
129
|
+
* @returns DriverStatusResponseDto Updated driver status snapshot stored in Redis
|
|
130
|
+
* @throws ApiError
|
|
131
|
+
*/
|
|
132
|
+
static updateDriverLocation(requestBody) {
|
|
133
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
134
|
+
method: 'PATCH',
|
|
135
|
+
url: '/drivers/status',
|
|
136
|
+
body: requestBody,
|
|
137
|
+
mediaType: 'application/json',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
105
140
|
}
|
|
106
141
|
exports.DriversService = DriversService;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SendDriverPushDto } from '../models/SendDriverPushDto';
|
|
1
2
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
2
3
|
export declare class MainService {
|
|
3
4
|
/**
|
|
@@ -5,6 +6,13 @@ export declare class MainService {
|
|
|
5
6
|
* @throws ApiError
|
|
6
7
|
*/
|
|
7
8
|
static getHello(): CancelablePromise<any>;
|
|
9
|
+
/**
|
|
10
|
+
* Send a push notification to a driver
|
|
11
|
+
* @param requestBody
|
|
12
|
+
* @returns any Notification sent successfully.
|
|
13
|
+
* @throws ApiError
|
|
14
|
+
*/
|
|
15
|
+
static sendDriverPushNotification(requestBody: SendDriverPushDto): CancelablePromise<any>;
|
|
8
16
|
/**
|
|
9
17
|
* @returns any
|
|
10
18
|
* @throws ApiError
|
package/services/MainService.js
CHANGED
|
@@ -14,6 +14,25 @@ class MainService {
|
|
|
14
14
|
url: '/',
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Send a push notification to a driver
|
|
19
|
+
* @param requestBody
|
|
20
|
+
* @returns any Notification sent successfully.
|
|
21
|
+
* @throws ApiError
|
|
22
|
+
*/
|
|
23
|
+
static sendDriverPushNotification(requestBody) {
|
|
24
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
url: '/drivers/push-notification',
|
|
27
|
+
body: requestBody,
|
|
28
|
+
mediaType: 'application/json',
|
|
29
|
+
errors: {
|
|
30
|
+
400: `Driver has no FCM token.`,
|
|
31
|
+
404: `Driver not found.`,
|
|
32
|
+
500: `FCM send failed.`,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
17
36
|
/**
|
|
18
37
|
* @returns any
|
|
19
38
|
* @throws ApiError
|
package/services/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './AdminAuthService';
|
|
2
2
|
export * from './AdminCustomerService';
|
|
3
|
+
export * from './AdminDispatchService';
|
|
3
4
|
export * from './AdminDriversService';
|
|
4
5
|
export * from './AdminPaymentsService';
|
|
5
6
|
export * from './AdminQueuesService';
|
|
7
|
+
export * from './AdminRedisService';
|
|
6
8
|
export * from './AdminSectionContentService';
|
|
7
9
|
export * from './AdminService';
|
|
8
10
|
export * from './AdminSettingsService';
|
package/services/index.js
CHANGED
|
@@ -16,9 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AdminAuthService"), exports);
|
|
18
18
|
__exportStar(require("./AdminCustomerService"), exports);
|
|
19
|
+
__exportStar(require("./AdminDispatchService"), exports);
|
|
19
20
|
__exportStar(require("./AdminDriversService"), exports);
|
|
20
21
|
__exportStar(require("./AdminPaymentsService"), exports);
|
|
21
22
|
__exportStar(require("./AdminQueuesService"), exports);
|
|
23
|
+
__exportStar(require("./AdminRedisService"), exports);
|
|
22
24
|
__exportStar(require("./AdminSectionContentService"), exports);
|
|
23
25
|
__exportStar(require("./AdminService"), exports);
|
|
24
26
|
__exportStar(require("./AdminSettingsService"), exports);
|
package/socketService.js
CHANGED
|
@@ -11,6 +11,10 @@ class SocketService {
|
|
|
11
11
|
path,
|
|
12
12
|
transports: ['websocket'],
|
|
13
13
|
autoConnect: false,
|
|
14
|
+
reconnection: true,
|
|
15
|
+
reconnectionAttempts: Infinity,
|
|
16
|
+
reconnectionDelay: 1000,
|
|
17
|
+
timeout: 20000,
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
20
|
splitSocketUrl(baseUrl) {
|
|
@@ -35,15 +39,27 @@ class SocketService {
|
|
|
35
39
|
}
|
|
36
40
|
return instance;
|
|
37
41
|
}
|
|
38
|
-
|
|
42
|
+
/*
|
|
43
|
+
setToken(token: string) {
|
|
39
44
|
this.token = token;
|
|
40
45
|
this.socket.auth = { token };
|
|
46
|
+
|
|
41
47
|
// always force re-auth
|
|
42
48
|
if (this.socket.connected) {
|
|
43
49
|
this.socket.disconnect();
|
|
44
50
|
}
|
|
45
51
|
this.socket.connect();
|
|
46
52
|
}
|
|
53
|
+
*/
|
|
54
|
+
setToken(token) {
|
|
55
|
+
if (this.token === token)
|
|
56
|
+
return;
|
|
57
|
+
this.token = token;
|
|
58
|
+
this.socket.auth = { token };
|
|
59
|
+
if (this.socket.connected) {
|
|
60
|
+
this.socket.disconnect().connect();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
47
63
|
clearToken() {
|
|
48
64
|
this.token = undefined;
|
|
49
65
|
if (!this.socket || !this.socket.auth)
|
|
@@ -12,8 +12,9 @@ export interface ActiveTrip {
|
|
|
12
12
|
paymentType?: PaymentTypes;
|
|
13
13
|
status: TripStatuses;
|
|
14
14
|
driverAssignmentMode?: DriverAssignmentModes;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/** Live driver position on the trip; null until known (not defaulted to 0,0). */
|
|
16
|
+
currentLatitude: number | null;
|
|
17
|
+
currentLongitude: number | null;
|
|
17
18
|
lastUpdate?: Date;
|
|
18
19
|
deltaDistanceMeters?: number;
|
|
19
20
|
deltaTotalMilliseconds?: number;
|
|
File without changes
|