@dapex-tech/elite-online-services 0.0.23 → 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.
@@ -2,9 +2,9 @@ export type DriverLocationUpdateDto = {
2
2
  /**
3
3
  * Latitude in decimal degrees
4
4
  */
5
- latitude: number;
5
+ latitude?: number;
6
6
  /**
7
7
  * Longitude in decimal degrees
8
8
  */
9
- longitude: number;
9
+ longitude?: number;
10
10
  };
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dapex-tech/elite-online-services",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "private": false,
@@ -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, PAUSED_TRAFFIC, 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, PAUSED_TRAFFIC, 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, PAUSED_TRAFFIC, 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, PAUSED_TRAFFIC, 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,
@@ -174,6 +174,7 @@ class DriverPaymentsService {
174
174
  errors: {
175
175
  400: `Invalid voucher inquiry request or trip has no voucher`,
176
176
  404: `Trip not found`,
177
+ 502: `Voucher gateway unreachable or returned an error`,
177
178
  },
178
179
  });
179
180
  }
@@ -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, PAUSED_TRAFFIC, 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, PAUSED_TRAFFIC, 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
- setToken(token) {
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)