@dapex-tech/elite-online-services 0.0.23 → 0.0.25
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/models/DriverLocationUpdateDto.d.ts +2 -2
- package/models/DriverStatusResponseDto.d.ts +2 -0
- package/models/PaymentDto.d.ts +32 -0
- package/models/TripLocationPointDto.d.ts +2 -1
- package/models/TripStatuses.d.ts +1 -1
- package/models/TripStatuses.js +1 -1
- package/package.json +1 -1
- package/services/AdminTripsService.d.ts +2 -1
- package/services/AdminTripsService.js +3 -1
- package/services/CustomerTripsService.d.ts +2 -1
- package/services/CustomerTripsService.js +3 -1
- package/services/DriverPaymentsService.js +1 -0
- package/services/DriverTripsService.d.ts +2 -1
- package/services/DriverTripsService.js +3 -1
- package/socketService.js +17 -1
- package/types/realtime/driver-status.d.ts +4 -0
package/models/PaymentDto.d.ts
CHANGED
|
@@ -19,4 +19,36 @@ export type PaymentDto = {
|
|
|
19
19
|
* Payment amount
|
|
20
20
|
*/
|
|
21
21
|
amount?: Record<string, any> | null;
|
|
22
|
+
/**
|
|
23
|
+
* When the payment was created
|
|
24
|
+
*/
|
|
25
|
+
createdAt?: Record<string, any> | null;
|
|
26
|
+
/**
|
|
27
|
+
* Voucher ID
|
|
28
|
+
*/
|
|
29
|
+
voucherId?: Record<string, any> | null;
|
|
30
|
+
/**
|
|
31
|
+
* Gateway transaction ID (Authorize.net)
|
|
32
|
+
*/
|
|
33
|
+
gatewayTransactionId?: Record<string, any> | null;
|
|
34
|
+
/**
|
|
35
|
+
* Gateway customer profile ID
|
|
36
|
+
*/
|
|
37
|
+
gatewayCustomerProfileId?: Record<string, any> | null;
|
|
38
|
+
/**
|
|
39
|
+
* Gateway payment profile ID
|
|
40
|
+
*/
|
|
41
|
+
gatewayPaymentProfileId?: Record<string, any> | null;
|
|
42
|
+
/**
|
|
43
|
+
* Card brand
|
|
44
|
+
*/
|
|
45
|
+
cardBrand?: Record<string, any> | null;
|
|
46
|
+
/**
|
|
47
|
+
* Last four digits of the card
|
|
48
|
+
*/
|
|
49
|
+
cardLast4?: Record<string, any> | null;
|
|
50
|
+
/**
|
|
51
|
+
* Customer payment method ID
|
|
52
|
+
*/
|
|
53
|
+
customerPaymentMethodId?: Record<string, any> | null;
|
|
22
54
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TripStatuses } from './TripStatuses';
|
|
1
2
|
export type TripLocationPointDto = {
|
|
2
3
|
/**
|
|
3
4
|
* Location point ID
|
|
@@ -18,7 +19,7 @@ export type TripLocationPointDto = {
|
|
|
18
19
|
/**
|
|
19
20
|
* Status
|
|
20
21
|
*/
|
|
21
|
-
status?:
|
|
22
|
+
status?: TripStatuses | null;
|
|
22
23
|
/**
|
|
23
24
|
* Created at timestamp
|
|
24
25
|
*/
|
package/models/TripStatuses.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare enum TripStatuses {
|
|
|
8
8
|
DRIVER_AT_PICKUP = "DRIVER_AT_PICKUP",
|
|
9
9
|
IN_PROGRESS = "IN_PROGRESS",
|
|
10
10
|
PAUSED = "PAUSED",
|
|
11
|
-
|
|
11
|
+
TRAFFIC_DELAY = "TRAFFIC_DELAY",
|
|
12
12
|
COMPLETED = "COMPLETED",
|
|
13
13
|
CANCELED_PASSENGER = "CANCELED_PASSENGER",
|
|
14
14
|
CANCELED_DRIVER = "CANCELED_DRIVER",
|
package/models/TripStatuses.js
CHANGED
|
@@ -16,7 +16,7 @@ var TripStatuses;
|
|
|
16
16
|
TripStatuses["DRIVER_AT_PICKUP"] = "DRIVER_AT_PICKUP";
|
|
17
17
|
TripStatuses["IN_PROGRESS"] = "IN_PROGRESS";
|
|
18
18
|
TripStatuses["PAUSED"] = "PAUSED";
|
|
19
|
-
TripStatuses["
|
|
19
|
+
TripStatuses["TRAFFIC_DELAY"] = "TRAFFIC_DELAY";
|
|
20
20
|
TripStatuses["COMPLETED"] = "COMPLETED";
|
|
21
21
|
TripStatuses["CANCELED_PASSENGER"] = "CANCELED_PASSENGER";
|
|
22
22
|
TripStatuses["CANCELED_DRIVER"] = "CANCELED_DRIVER";
|
package/package.json
CHANGED
|
@@ -14,13 +14,14 @@ export declare class AdminTripsService {
|
|
|
14
14
|
* @param page Page number
|
|
15
15
|
* @param pageSize Items per page
|
|
16
16
|
* @param q Text to search for in trip fields
|
|
17
|
+
* @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, TRAFFIC_DELAY, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
17
18
|
* @param order Sorting options
|
|
18
19
|
* @param customerId Filter by customer ID (scope to customer)
|
|
19
20
|
* @param driverId Filter by driver ID (scope to driver)
|
|
20
21
|
* @returns PaginatedTripsDto Paginated list of trips
|
|
21
22
|
* @throws ApiError
|
|
22
23
|
*/
|
|
23
|
-
static findAll(page?: number, pageSize?: number, q?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
24
|
+
static findAll(page?: number, pageSize?: number, q?: string, status?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
24
25
|
/**
|
|
25
26
|
* Create a new trip/service order
|
|
26
27
|
* @param requestBody
|
|
@@ -9,13 +9,14 @@ class AdminTripsService {
|
|
|
9
9
|
* @param page Page number
|
|
10
10
|
* @param pageSize Items per page
|
|
11
11
|
* @param q Text to search for in trip fields
|
|
12
|
+
* @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, TRAFFIC_DELAY, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
12
13
|
* @param order Sorting options
|
|
13
14
|
* @param customerId Filter by customer ID (scope to customer)
|
|
14
15
|
* @param driverId Filter by driver ID (scope to driver)
|
|
15
16
|
* @returns PaginatedTripsDto Paginated list of trips
|
|
16
17
|
* @throws ApiError
|
|
17
18
|
*/
|
|
18
|
-
static findAll(page = 1, pageSize = 12, q, order, customerId, driverId) {
|
|
19
|
+
static findAll(page = 1, pageSize = 12, q, status, order, customerId, driverId) {
|
|
19
20
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
20
21
|
method: 'GET',
|
|
21
22
|
url: '/admins/trips',
|
|
@@ -23,6 +24,7 @@ class AdminTripsService {
|
|
|
23
24
|
'page': page,
|
|
24
25
|
'pageSize': pageSize,
|
|
25
26
|
'q': q,
|
|
27
|
+
'status': status,
|
|
26
28
|
'order': order,
|
|
27
29
|
'customerId': customerId,
|
|
28
30
|
'driverId': driverId,
|
|
@@ -20,13 +20,14 @@ export declare class CustomerTripsService {
|
|
|
20
20
|
* @param page Page number
|
|
21
21
|
* @param pageSize Items per page
|
|
22
22
|
* @param q Text to search for in trip fields
|
|
23
|
+
* @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, TRAFFIC_DELAY, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
23
24
|
* @param order Sorting options
|
|
24
25
|
* @param customerId Filter by customer ID (scope to customer)
|
|
25
26
|
* @param driverId Filter by driver ID (scope to driver)
|
|
26
27
|
* @returns PaginatedTripsDto Paginated list of trips
|
|
27
28
|
* @throws ApiError
|
|
28
29
|
*/
|
|
29
|
-
static findAll(page?: number, pageSize?: number, q?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
30
|
+
static findAll(page?: number, pageSize?: number, q?: string, status?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
30
31
|
/**
|
|
31
32
|
* Estimate trip cost by origin and destination
|
|
32
33
|
* @param requestBody
|
|
@@ -23,13 +23,14 @@ class CustomerTripsService {
|
|
|
23
23
|
* @param page Page number
|
|
24
24
|
* @param pageSize Items per page
|
|
25
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, TRAFFIC_DELAY, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
26
27
|
* @param order Sorting options
|
|
27
28
|
* @param customerId Filter by customer ID (scope to customer)
|
|
28
29
|
* @param driverId Filter by driver ID (scope to driver)
|
|
29
30
|
* @returns PaginatedTripsDto Paginated list of trips
|
|
30
31
|
* @throws ApiError
|
|
31
32
|
*/
|
|
32
|
-
static findAll(page = 1, pageSize = 12, q, order, customerId, driverId) {
|
|
33
|
+
static findAll(page = 1, pageSize = 12, q, status, order, customerId, driverId) {
|
|
33
34
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
34
35
|
method: 'GET',
|
|
35
36
|
url: '/customers/trips',
|
|
@@ -37,6 +38,7 @@ class CustomerTripsService {
|
|
|
37
38
|
'page': page,
|
|
38
39
|
'pageSize': pageSize,
|
|
39
40
|
'q': q,
|
|
41
|
+
'status': status,
|
|
40
42
|
'order': order,
|
|
41
43
|
'customerId': customerId,
|
|
42
44
|
'driverId': driverId,
|
|
@@ -21,13 +21,14 @@ export declare class DriverTripsService {
|
|
|
21
21
|
* @param page Page number
|
|
22
22
|
* @param pageSize Items per page
|
|
23
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, TRAFFIC_DELAY, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
24
25
|
* @param order Sorting options
|
|
25
26
|
* @param customerId Filter by customer ID (scope to customer)
|
|
26
27
|
* @param driverId Filter by driver ID (scope to driver)
|
|
27
28
|
* @returns PaginatedTripsDto Paginated list of trips
|
|
28
29
|
* @throws ApiError
|
|
29
30
|
*/
|
|
30
|
-
static findAll(page?: number, pageSize?: number, q?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
31
|
+
static findAll(page?: number, pageSize?: number, q?: string, status?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<PaginatedTripsDto>;
|
|
31
32
|
/**
|
|
32
33
|
* Estimate trip cost by origin and destination
|
|
33
34
|
* @param requestBody
|
|
@@ -23,13 +23,14 @@ class DriverTripsService {
|
|
|
23
23
|
* @param page Page number
|
|
24
24
|
* @param pageSize Items per page
|
|
25
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, TRAFFIC_DELAY, COMPLETED, CANCELED_PASSENGER, CANCELED_DRIVER, CANCELED_ADMIN.
|
|
26
27
|
* @param order Sorting options
|
|
27
28
|
* @param customerId Filter by customer ID (scope to customer)
|
|
28
29
|
* @param driverId Filter by driver ID (scope to driver)
|
|
29
30
|
* @returns PaginatedTripsDto Paginated list of trips
|
|
30
31
|
* @throws ApiError
|
|
31
32
|
*/
|
|
32
|
-
static findAll(page = 1, pageSize = 12, q, order, customerId, driverId) {
|
|
33
|
+
static findAll(page = 1, pageSize = 12, q, status, order, customerId, driverId) {
|
|
33
34
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
34
35
|
method: 'GET',
|
|
35
36
|
url: '/drivers/trips',
|
|
@@ -37,6 +38,7 @@ class DriverTripsService {
|
|
|
37
38
|
'page': page,
|
|
38
39
|
'pageSize': pageSize,
|
|
39
40
|
'q': q,
|
|
41
|
+
'status': status,
|
|
40
42
|
'order': order,
|
|
41
43
|
'customerId': customerId,
|
|
42
44
|
'driverId': driverId,
|
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)
|
|
@@ -7,5 +7,9 @@ export interface DriverStatus {
|
|
|
7
7
|
isOnline?: boolean;
|
|
8
8
|
waitingTripIds?: number[];
|
|
9
9
|
activeTripId?: number;
|
|
10
|
+
/** Set by scheduler after first stale-heartbeat warning; cleared on heartbeat. */
|
|
11
|
+
onlineTimeoutWarningFirstSent?: boolean;
|
|
12
|
+
/** Set by scheduler after second stale-heartbeat warning; cleared on heartbeat. */
|
|
13
|
+
onlineTimeoutWarningSecondSent?: boolean;
|
|
10
14
|
}
|
|
11
15
|
export declare function isValidDriverStatus(driverStatus: DriverStatus): boolean;
|