@dapex-tech/elite-online-services 0.0.20 → 0.0.22

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.
Files changed (97) hide show
  1. package/createClient.d.ts +1 -0
  2. package/createClient.js +1 -1
  3. package/models/AdminDto.d.ts +2 -1
  4. package/models/AdminLoginResponseDto.d.ts +2 -1
  5. package/models/CustomerDto.d.ts +5 -0
  6. package/models/CustomerLocationCreateDto.d.ts +2 -16
  7. package/models/CustomerLocationCreateDto.js +0 -18
  8. package/models/CustomerLocationDto.d.ts +2 -16
  9. package/models/CustomerLocationDto.js +0 -18
  10. package/models/CustomerLocationUpdateDto.d.ts +2 -16
  11. package/models/CustomerLocationUpdateDto.js +0 -18
  12. package/models/CustomerLoginResponseDto.d.ts +5 -0
  13. package/models/DriverAssignmentModes.d.ts +4 -0
  14. package/models/DriverAssignmentModes.js +12 -0
  15. package/models/DriverDto.d.ts +2 -1
  16. package/models/DriverLoginResponseDto.d.ts +2 -1
  17. package/models/EstimateTripCostDto.d.ts +18 -0
  18. package/models/EstimateTripCostDto.js +2 -0
  19. package/models/JobSummaryDto.d.ts +42 -0
  20. package/models/JobSummaryDto.js +2 -0
  21. package/models/JobsListResponseDto.d.ts +7 -0
  22. package/models/JobsListResponseDto.js +2 -0
  23. package/models/LocationTypes.d.ts +13 -0
  24. package/models/LocationTypes.js +21 -0
  25. package/models/PaymentTypes.d.ts +8 -0
  26. package/models/PaymentTypes.js +16 -0
  27. package/models/QueueJobCountsDto.d.ts +26 -0
  28. package/models/QueueJobCountsDto.js +2 -0
  29. package/models/QueueSummaryDto.d.ts +11 -0
  30. package/models/QueueSummaryDto.js +2 -0
  31. package/models/Role.d.ts +8 -0
  32. package/models/Role.js +16 -0
  33. package/models/SectionContentCreateDto.d.ts +2 -10
  34. package/models/SectionContentCreateDto.js +0 -12
  35. package/models/SectionContentDto.d.ts +2 -10
  36. package/models/SectionContentDto.js +0 -12
  37. package/models/SectionContentUpdateDto.d.ts +2 -10
  38. package/models/SectionContentUpdateDto.js +0 -12
  39. package/models/SectionContentsTypes.d.ts +8 -0
  40. package/models/SectionContentsTypes.js +16 -0
  41. package/models/SystemSettingResponseDto.d.ts +18 -0
  42. package/models/SystemSettingResponseDto.js +2 -0
  43. package/models/TripDto.d.ts +14 -57
  44. package/models/TripDto.js +0 -58
  45. package/models/TripSources.d.ts +5 -0
  46. package/models/TripSources.js +13 -0
  47. package/models/TripUpdateDriverAssignmentModeDto.d.ts +2 -1
  48. package/models/TripUpdateDto.d.ts +2 -11
  49. package/models/TripUpdateDto.js +0 -13
  50. package/models/TripUpdateTripsStatusDto.d.ts +2 -22
  51. package/models/TripUpdateTripsStatusDto.js +0 -24
  52. package/models/TwilioTokenResponse.d.ts +10 -0
  53. package/models/TwilioTokenResponse.js +2 -0
  54. package/models/UpdateSystemSettingDto.d.ts +10 -0
  55. package/models/UpdateSystemSettingDto.js +2 -0
  56. package/models/VehicleCreateDto.d.ts +2 -1
  57. package/models/VehicleDto.d.ts +4 -2
  58. package/models/VehicleStatus.d.ts +7 -0
  59. package/models/VehicleStatus.js +15 -0
  60. package/models/VehicleTypes.d.ts +8 -0
  61. package/models/VehicleTypes.js +16 -0
  62. package/models/VehicleUpdateDto.d.ts +2 -1
  63. package/models/index.d.ts +16 -0
  64. package/models/index.js +16 -0
  65. package/package.json +1 -1
  66. package/services/AdminDriversService.d.ts +7 -0
  67. package/services/AdminDriversService.js +12 -0
  68. package/services/AdminQueuesService.d.ts +30 -0
  69. package/services/AdminQueuesService.js +62 -0
  70. package/services/AdminSectionContentService.d.ts +2 -1
  71. package/services/AdminService.d.ts +7 -0
  72. package/services/AdminService.js +11 -0
  73. package/services/AdminSettingsService.d.ts +20 -3
  74. package/services/AdminSettingsService.js +41 -2
  75. package/services/AdminTripsService.d.ts +10 -1
  76. package/services/AdminTripsService.js +17 -1
  77. package/services/CustomerSectionContentsService.d.ts +13 -0
  78. package/services/CustomerSectionContentsService.js +26 -0
  79. package/services/CustomerTripsService.d.ts +8 -0
  80. package/services/CustomerTripsService.js +14 -0
  81. package/services/CustomersService.d.ts +7 -0
  82. package/services/CustomersService.js +11 -0
  83. package/services/DriverTripsService.d.ts +8 -0
  84. package/services/DriverTripsService.js +14 -0
  85. package/services/DriversService.d.ts +14 -0
  86. package/services/DriversService.js +22 -0
  87. package/services/HealthService.d.ts +0 -10
  88. package/services/HealthService.js +0 -13
  89. package/services/index.d.ts +1 -0
  90. package/services/index.js +1 -0
  91. package/socketService.d.ts +2 -0
  92. package/socketService.js +11 -0
  93. package/types/realtime/active-trip.d.ts +3 -1
  94. package/types/realtime/driver-status.d.ts +2 -0
  95. package/types/realtime/driver-status.js +7 -0
  96. package/socketService.bak.d.ts +0 -54
  97. package/socketService.bak.js +0 -99
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminQueuesService = void 0;
4
+ const OpenAPI_1 = require("../core/OpenAPI");
5
+ const request_1 = require("../core/request");
6
+ class AdminQueuesService {
7
+ /**
8
+ * List BullMQ queues with job counts
9
+ * @returns QueueSummaryDto Queue summaries with job counts by state
10
+ * @throws ApiError
11
+ */
12
+ static getQueues() {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/admins/queues',
16
+ });
17
+ }
18
+ /**
19
+ * List jobs in a queue by state
20
+ * @param queueName Queue name
21
+ * @param start Start index for pagination
22
+ * @param end End index for pagination (inclusive)
23
+ * @param state Filter by job state(s). Can be repeated for multiple states.
24
+ * @returns JobsListResponseDto List of jobs in the queue
25
+ * @throws ApiError
26
+ */
27
+ static getJobs(queueName, start, end, state) {
28
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
29
+ method: 'GET',
30
+ url: '/admins/queues/{queueName}/jobs',
31
+ path: {
32
+ 'queueName': queueName,
33
+ },
34
+ query: {
35
+ 'start': start,
36
+ 'end': end,
37
+ 'state': state,
38
+ },
39
+ });
40
+ }
41
+ /**
42
+ * Get a single BullMQ job by ID
43
+ * @param queueName Queue name
44
+ * @param jobId BullMQ job ID
45
+ * @returns JobSummaryDto Job details
46
+ * @throws ApiError
47
+ */
48
+ static getJob(queueName, jobId) {
49
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
50
+ method: 'GET',
51
+ url: '/admins/queues/{queueName}/jobs/{jobId}',
52
+ path: {
53
+ 'queueName': queueName,
54
+ 'jobId': jobId,
55
+ },
56
+ errors: {
57
+ 404: `Job or queue not found`,
58
+ },
59
+ });
60
+ }
61
+ }
62
+ exports.AdminQueuesService = AdminQueuesService;
@@ -2,6 +2,7 @@ import type { MessageResponseDto } from '../models/MessageResponseDto';
2
2
  import type { OrderDto } from '../models/OrderDto';
3
3
  import type { SectionContentCreateDto } from '../models/SectionContentCreateDto';
4
4
  import type { SectionContentDto } from '../models/SectionContentDto';
5
+ import type { SectionContentsTypes } from '../models/SectionContentsTypes';
5
6
  import type { SectionContentUpdateDto } from '../models/SectionContentUpdateDto';
6
7
  import type { CancelablePromise } from '../core/CancelablePromise';
7
8
  export declare class AdminSectionContentService {
@@ -20,7 +21,7 @@ export declare class AdminSectionContentService {
20
21
  * @returns SectionContentDto List of section contents
21
22
  * @throws ApiError
22
23
  */
23
- static findAll(q?: string, type?: 'legal' | 'help', order?: OrderDto): CancelablePromise<Array<SectionContentDto>>;
24
+ static findAll(q?: string, type?: SectionContentsTypes, order?: OrderDto): CancelablePromise<Array<SectionContentDto>>;
24
25
  /**
25
26
  * Get a single section content by ID
26
27
  * @param id
@@ -5,8 +5,15 @@ import type { AdminUpdateDto } from '../models/AdminUpdateDto';
5
5
  import type { MessageResponseDto } from '../models/MessageResponseDto';
6
6
  import type { OrderDto } from '../models/OrderDto';
7
7
  import type { SeniorCenterDto } from '../models/SeniorCenterDto';
8
+ import type { TwilioTokenResponse } from '../models/TwilioTokenResponse';
8
9
  import type { CancelablePromise } from '../core/CancelablePromise';
9
10
  export declare class AdminService {
11
+ /**
12
+ * Get Twilio access token for admin
13
+ * @returns TwilioTokenResponse Twilio access token retrieved successfully.
14
+ * @throws ApiError
15
+ */
16
+ static getTwilioToken(): CancelablePromise<TwilioTokenResponse>;
10
17
  /**
11
18
  * Get all senior centers
12
19
  * @returns SeniorCenterDto List of senior centers
@@ -4,6 +4,17 @@ exports.AdminService = void 0;
4
4
  const OpenAPI_1 = require("../core/OpenAPI");
5
5
  const request_1 = require("../core/request");
6
6
  class AdminService {
7
+ /**
8
+ * Get Twilio access token for admin
9
+ * @returns TwilioTokenResponse Twilio access token retrieved successfully.
10
+ * @throws ApiError
11
+ */
12
+ static getTwilioToken() {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/admins/twilio-access-token',
16
+ });
17
+ }
7
18
  /**
8
19
  * Get all senior centers
9
20
  * @returns SeniorCenterDto List of senior centers
@@ -1,9 +1,26 @@
1
+ import type { SystemSettingResponseDto } from '../models/SystemSettingResponseDto';
2
+ import type { UpdateSystemSettingDto } from '../models/UpdateSystemSettingDto';
1
3
  import type { CancelablePromise } from '../core/CancelablePromise';
2
4
  export declare class AdminSettingsService {
3
5
  /**
4
- * Get all settings
5
- * @returns any List of all system settings
6
+ * Get all system settings
7
+ * @returns SystemSettingResponseDto List of all system settings (key, type, value).
6
8
  * @throws ApiError
7
9
  */
8
- static findAll(): CancelablePromise<any>;
10
+ static findAll(): CancelablePromise<Array<SystemSettingResponseDto>>;
11
+ /**
12
+ * Get a system setting by key
13
+ * @param key System setting key (e.g. CUSTOMER_APP_ENABLED, CUSTOMER_APP_SYSTEM_NOTIFICATION)
14
+ * @returns SystemSettingResponseDto The system setting for the given key.
15
+ * @throws ApiError
16
+ */
17
+ static findByKey(key: string): CancelablePromise<SystemSettingResponseDto>;
18
+ /**
19
+ * Update a system setting by key
20
+ * @param key System setting key (e.g. CUSTOMER_APP_ENABLED, CUSTOMER_APP_SYSTEM_NOTIFICATION)
21
+ * @param requestBody
22
+ * @returns SystemSettingResponseDto The updated system setting.
23
+ * @throws ApiError
24
+ */
25
+ static updateByKey(key: string, requestBody: UpdateSystemSettingDto): CancelablePromise<SystemSettingResponseDto>;
9
26
  }
@@ -5,8 +5,8 @@ const OpenAPI_1 = require("../core/OpenAPI");
5
5
  const request_1 = require("../core/request");
6
6
  class AdminSettingsService {
7
7
  /**
8
- * Get all settings
9
- * @returns any List of all system settings
8
+ * Get all system settings
9
+ * @returns SystemSettingResponseDto List of all system settings (key, type, value).
10
10
  * @throws ApiError
11
11
  */
12
12
  static findAll() {
@@ -15,5 +15,44 @@ class AdminSettingsService {
15
15
  url: '/admins/settings',
16
16
  });
17
17
  }
18
+ /**
19
+ * Get a system setting by key
20
+ * @param key System setting key (e.g. CUSTOMER_APP_ENABLED, CUSTOMER_APP_SYSTEM_NOTIFICATION)
21
+ * @returns SystemSettingResponseDto The system setting for the given key.
22
+ * @throws ApiError
23
+ */
24
+ static findByKey(key) {
25
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
26
+ method: 'GET',
27
+ url: '/admins/settings/{key}',
28
+ path: {
29
+ 'key': key,
30
+ },
31
+ errors: {
32
+ 404: `Setting with the given key not found`,
33
+ },
34
+ });
35
+ }
36
+ /**
37
+ * Update a system setting by key
38
+ * @param key System setting key (e.g. CUSTOMER_APP_ENABLED, CUSTOMER_APP_SYSTEM_NOTIFICATION)
39
+ * @param requestBody
40
+ * @returns SystemSettingResponseDto The updated system setting.
41
+ * @throws ApiError
42
+ */
43
+ static updateByKey(key, requestBody) {
44
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
45
+ method: 'PATCH',
46
+ url: '/admins/settings/{key}',
47
+ path: {
48
+ 'key': key,
49
+ },
50
+ body: requestBody,
51
+ mediaType: 'application/json',
52
+ errors: {
53
+ 404: `Setting with the given key not found`,
54
+ },
55
+ });
56
+ }
18
57
  }
19
58
  exports.AdminSettingsService = AdminSettingsService;
@@ -1,3 +1,4 @@
1
+ import type { EstimateTripCostDto } from '../models/EstimateTripCostDto';
1
2
  import type { OrderDto } from '../models/OrderDto';
2
3
  import type { TripAssignDriverDto } from '../models/TripAssignDriverDto';
3
4
  import type { TripDto } from '../models/TripDto';
@@ -23,15 +24,23 @@ export declare class AdminTripsService {
23
24
  * @throws ApiError
24
25
  */
25
26
  static create(requestBody: TripDto): CancelablePromise<TripDto>;
27
+ /**
28
+ * Estimate trip cost by origin and destination
29
+ * @param requestBody
30
+ * @returns any Estimated cost (pickupCost, distanceCost, waitingCost, trafficDelayCost, totalCost)
31
+ * @throws ApiError
32
+ */
33
+ static estimateTripCost(requestBody: EstimateTripCostDto): CancelablePromise<any>;
26
34
  /**
27
35
  * Get last 5 trips by phone/email/senior card
28
36
  * @param phone Phone number
29
37
  * @param email Email address
30
38
  * @param seniorCardNumber Senior card number
39
+ * @param filterTripStatuses Filter out trips with these statuses (comma-separated, e.g. COMPLETED,DRIVER_SEARCHING)
31
40
  * @returns TripDto List of up to 5 trips
32
41
  * @throws ApiError
33
42
  */
34
- static findLast5Trips(phone?: string, email?: string, seniorCardNumber?: string): CancelablePromise<Array<TripDto>>;
43
+ static findLast5Trips(phone?: string, email?: string, seniorCardNumber?: string, filterTripStatuses?: Array<string>): CancelablePromise<Array<TripDto>>;
35
44
  /**
36
45
  * Get a single trip by ID
37
46
  * @param id
@@ -39,15 +39,30 @@ class AdminTripsService {
39
39
  mediaType: 'application/json',
40
40
  });
41
41
  }
42
+ /**
43
+ * Estimate trip cost by origin and destination
44
+ * @param requestBody
45
+ * @returns any Estimated cost (pickupCost, distanceCost, waitingCost, trafficDelayCost, totalCost)
46
+ * @throws ApiError
47
+ */
48
+ static estimateTripCost(requestBody) {
49
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
50
+ method: 'POST',
51
+ url: '/admins/trips/estimate-cost',
52
+ body: requestBody,
53
+ mediaType: 'application/json',
54
+ });
55
+ }
42
56
  /**
43
57
  * Get last 5 trips by phone/email/senior card
44
58
  * @param phone Phone number
45
59
  * @param email Email address
46
60
  * @param seniorCardNumber Senior card number
61
+ * @param filterTripStatuses Filter out trips with these statuses (comma-separated, e.g. COMPLETED,DRIVER_SEARCHING)
47
62
  * @returns TripDto List of up to 5 trips
48
63
  * @throws ApiError
49
64
  */
50
- static findLast5Trips(phone, email, seniorCardNumber) {
65
+ static findLast5Trips(phone, email, seniorCardNumber, filterTripStatuses) {
51
66
  return (0, request_1.request)(OpenAPI_1.OpenAPI, {
52
67
  method: 'GET',
53
68
  url: '/admins/trips/last5',
@@ -55,6 +70,7 @@ class AdminTripsService {
55
70
  'phone': phone,
56
71
  'email': email,
57
72
  'seniorCardNumber': seniorCardNumber,
73
+ 'filterTripStatuses': filterTripStatuses,
58
74
  },
59
75
  });
60
76
  }
@@ -7,6 +7,12 @@ export declare class CustomerSectionContentsService {
7
7
  * @throws ApiError
8
8
  */
9
9
  static findLegal(): CancelablePromise<Array<SectionContentDto>>;
10
+ /**
11
+ * Get FAQ section contents
12
+ * @returns SectionContentDto List of FAQ section contents
13
+ * @throws ApiError
14
+ */
15
+ static findFaq(): CancelablePromise<Array<SectionContentDto>>;
10
16
  /**
11
17
  * Get Legal section content by ID
12
18
  * @param id
@@ -27,4 +33,11 @@ export declare class CustomerSectionContentsService {
27
33
  * @throws ApiError
28
34
  */
29
35
  static findHelpById(id: number): CancelablePromise<SectionContentDto>;
36
+ /**
37
+ * Get FAQ section content by ID
38
+ * @param id
39
+ * @returns SectionContentDto Section content found
40
+ * @throws ApiError
41
+ */
42
+ static findFaqById(id: number): CancelablePromise<SectionContentDto>;
30
43
  }
@@ -15,6 +15,17 @@ class CustomerSectionContentsService {
15
15
  url: '/customers/section-contents/legal',
16
16
  });
17
17
  }
18
+ /**
19
+ * Get FAQ section contents
20
+ * @returns SectionContentDto List of FAQ section contents
21
+ * @throws ApiError
22
+ */
23
+ static findFaq() {
24
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
25
+ method: 'GET',
26
+ url: '/customers/section-contents/faq',
27
+ });
28
+ }
18
29
  /**
19
30
  * Get Legal section content by ID
20
31
  * @param id
@@ -56,5 +67,20 @@ class CustomerSectionContentsService {
56
67
  },
57
68
  });
58
69
  }
70
+ /**
71
+ * Get FAQ section content by ID
72
+ * @param id
73
+ * @returns SectionContentDto Section content found
74
+ * @throws ApiError
75
+ */
76
+ static findFaqById(id) {
77
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
78
+ method: 'GET',
79
+ url: '/customers/section-contents/faq/{id}',
80
+ path: {
81
+ 'id': id,
82
+ },
83
+ });
84
+ }
59
85
  }
60
86
  exports.CustomerSectionContentsService = CustomerSectionContentsService;
@@ -1,4 +1,5 @@
1
1
  import type { CustomerTripActions } from '../models/CustomerTripActions';
2
+ import type { EstimateTripCostDto } from '../models/EstimateTripCostDto';
2
3
  import type { OrderDto } from '../models/OrderDto';
3
4
  import type { TripDto } from '../models/TripDto';
4
5
  import type { TripUpdateDto } from '../models/TripUpdateDto';
@@ -22,6 +23,13 @@ export declare class CustomerTripsService {
22
23
  * @throws ApiError
23
24
  */
24
25
  static findAll(q?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<Array<TripDto>>;
26
+ /**
27
+ * Estimate trip cost by origin and destination
28
+ * @param requestBody
29
+ * @returns any Estimated cost (pickupCost, distanceCost, waitingCost, trafficDelayCost, totalCost)
30
+ * @throws ApiError
31
+ */
32
+ static estimateTripCost(requestBody: EstimateTripCostDto): CancelablePromise<any>;
25
33
  /**
26
34
  * Get active trip for a customer
27
35
  * @returns TripDto Active trip found
@@ -39,6 +39,20 @@ class CustomerTripsService {
39
39
  },
40
40
  });
41
41
  }
42
+ /**
43
+ * Estimate trip cost by origin and destination
44
+ * @param requestBody
45
+ * @returns any Estimated cost (pickupCost, distanceCost, waitingCost, trafficDelayCost, totalCost)
46
+ * @throws ApiError
47
+ */
48
+ static estimateTripCost(requestBody) {
49
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
50
+ method: 'POST',
51
+ url: '/customers/trips/estimate-cost',
52
+ body: requestBody,
53
+ mediaType: 'application/json',
54
+ });
55
+ }
42
56
  /**
43
57
  * Get active trip for a customer
44
58
  * @returns TripDto Active trip found
@@ -1,9 +1,16 @@
1
1
  import type { CustomerDto } from '../models/CustomerDto';
2
2
  import type { CustomerUpdatedDto } from '../models/CustomerUpdatedDto';
3
3
  import type { MessageResponseDto } from '../models/MessageResponseDto';
4
+ import type { TwilioTokenResponse } from '../models/TwilioTokenResponse';
4
5
  import type { UpdateFcmTokenDto } from '../models/UpdateFcmTokenDto';
5
6
  import type { CancelablePromise } from '../core/CancelablePromise';
6
7
  export declare class CustomersService {
8
+ /**
9
+ * Get Twilio access token for customer
10
+ * @returns TwilioTokenResponse Twilio access token retrieved successfully.
11
+ * @throws ApiError
12
+ */
13
+ static getTwilioToken(): CancelablePromise<TwilioTokenResponse>;
7
14
  /**
8
15
  * Update a customer by ID
9
16
  * @param requestBody
@@ -4,6 +4,17 @@ exports.CustomersService = void 0;
4
4
  const OpenAPI_1 = require("../core/OpenAPI");
5
5
  const request_1 = require("../core/request");
6
6
  class CustomersService {
7
+ /**
8
+ * Get Twilio access token for customer
9
+ * @returns TwilioTokenResponse Twilio access token retrieved successfully.
10
+ * @throws ApiError
11
+ */
12
+ static getTwilioToken() {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/customers/twilio-access-token',
16
+ });
17
+ }
7
18
  /**
8
19
  * Update a customer by ID
9
20
  * @param requestBody
@@ -1,4 +1,5 @@
1
1
  import type { DriverTripActions } from '../models/DriverTripActions';
2
+ import type { EstimateTripCostDto } from '../models/EstimateTripCostDto';
2
3
  import type { OrderDto } from '../models/OrderDto';
3
4
  import type { TripDto } from '../models/TripDto';
4
5
  import type { TripUpdateDto } from '../models/TripUpdateDto';
@@ -23,6 +24,13 @@ export declare class DriverTripsService {
23
24
  * @throws ApiError
24
25
  */
25
26
  static findAll(q?: string, order?: OrderDto, customerId?: number, driverId?: number): CancelablePromise<Array<TripDto>>;
27
+ /**
28
+ * Estimate trip cost by origin and destination
29
+ * @param requestBody
30
+ * @returns any Estimated cost (pickupCost, distanceCost, waitingCost, trafficDelayCost, totalCost)
31
+ * @throws ApiError
32
+ */
33
+ static estimateTripCost(requestBody: EstimateTripCostDto): CancelablePromise<any>;
26
34
  /**
27
35
  * Update a trip by ID
28
36
  * @param id
@@ -39,6 +39,20 @@ class DriverTripsService {
39
39
  },
40
40
  });
41
41
  }
42
+ /**
43
+ * Estimate trip cost by origin and destination
44
+ * @param requestBody
45
+ * @returns any Estimated cost (pickupCost, distanceCost, waitingCost, trafficDelayCost, totalCost)
46
+ * @throws ApiError
47
+ */
48
+ static estimateTripCost(requestBody) {
49
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
50
+ method: 'POST',
51
+ url: '/drivers/trips/estimate-cost',
52
+ body: requestBody,
53
+ mediaType: 'application/json',
54
+ });
55
+ }
42
56
  /**
43
57
  * Update a trip by ID
44
58
  * @param id
@@ -1,9 +1,17 @@
1
1
  import type { DriverDto } from '../models/DriverDto';
2
2
  import type { DriverUpdateDto } from '../models/DriverUpdateDto';
3
3
  import type { MessageResponseDto } from '../models/MessageResponseDto';
4
+ import type { SeniorCenterDto } from '../models/SeniorCenterDto';
5
+ import type { TwilioTokenResponse } from '../models/TwilioTokenResponse';
4
6
  import type { UpdateFcmTokenDto } from '../models/UpdateFcmTokenDto';
5
7
  import type { CancelablePromise } from '../core/CancelablePromise';
6
8
  export declare class DriversService {
9
+ /**
10
+ * Get Twilio access token for driver
11
+ * @returns TwilioTokenResponse Twilio access token retrieved successfully.
12
+ * @throws ApiError
13
+ */
14
+ static getTwilioToken(): CancelablePromise<TwilioTokenResponse>;
7
15
  /**
8
16
  * Update the current driver
9
17
  * @param requestBody
@@ -42,4 +50,10 @@ export declare class DriversService {
42
50
  * @throws ApiError
43
51
  */
44
52
  static updateDriverFcmToken(requestBody: UpdateFcmTokenDto): CancelablePromise<MessageResponseDto>;
53
+ /**
54
+ * Get all senior centers
55
+ * @returns SeniorCenterDto List of senior centers
56
+ * @throws ApiError
57
+ */
58
+ static findAllSeniorCenters(): CancelablePromise<Array<SeniorCenterDto>>;
45
59
  }
@@ -4,6 +4,17 @@ exports.DriversService = void 0;
4
4
  const OpenAPI_1 = require("../core/OpenAPI");
5
5
  const request_1 = require("../core/request");
6
6
  class DriversService {
7
+ /**
8
+ * Get Twilio access token for driver
9
+ * @returns TwilioTokenResponse Twilio access token retrieved successfully.
10
+ * @throws ApiError
11
+ */
12
+ static getTwilioToken() {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/drivers/twilio-access-token',
16
+ });
17
+ }
7
18
  /**
8
19
  * Update the current driver
9
20
  * @param requestBody
@@ -80,5 +91,16 @@ class DriversService {
80
91
  },
81
92
  });
82
93
  }
94
+ /**
95
+ * Get all senior centers
96
+ * @returns SeniorCenterDto List of senior centers
97
+ * @throws ApiError
98
+ */
99
+ static findAllSeniorCenters() {
100
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
101
+ method: 'GET',
102
+ url: '/drivers/senior-centers',
103
+ });
104
+ }
83
105
  }
84
106
  exports.DriversService = DriversService;
@@ -10,14 +10,4 @@ export declare class HealthService {
10
10
  error?: Record<string, Record<string, any>> | null;
11
11
  details?: Record<string, Record<string, any>>;
12
12
  }>;
13
- /**
14
- * @returns any The Health Check is successful
15
- * @throws ApiError
16
- */
17
- static readiness(): CancelablePromise<{
18
- status?: string;
19
- info?: Record<string, Record<string, any>> | null;
20
- error?: Record<string, Record<string, any>> | null;
21
- details?: Record<string, Record<string, any>>;
22
- }>;
23
13
  }
@@ -17,18 +17,5 @@ class HealthService {
17
17
  },
18
18
  });
19
19
  }
20
- /**
21
- * @returns any The Health Check is successful
22
- * @throws ApiError
23
- */
24
- static readiness() {
25
- return (0, request_1.request)(OpenAPI_1.OpenAPI, {
26
- method: 'GET',
27
- url: '/health/ready',
28
- errors: {
29
- 503: `The Health Check is not successful`,
30
- },
31
- });
32
- }
33
20
  }
34
21
  exports.HealthService = HealthService;
@@ -2,6 +2,7 @@ export * from './AdminAuthService';
2
2
  export * from './AdminCustomerService';
3
3
  export * from './AdminDriversService';
4
4
  export * from './AdminPaymentsService';
5
+ export * from './AdminQueuesService';
5
6
  export * from './AdminSectionContentService';
6
7
  export * from './AdminService';
7
8
  export * from './AdminSettingsService';
package/services/index.js CHANGED
@@ -18,6 +18,7 @@ __exportStar(require("./AdminAuthService"), exports);
18
18
  __exportStar(require("./AdminCustomerService"), exports);
19
19
  __exportStar(require("./AdminDriversService"), exports);
20
20
  __exportStar(require("./AdminPaymentsService"), exports);
21
+ __exportStar(require("./AdminQueuesService"), exports);
21
22
  __exportStar(require("./AdminSectionContentService"), exports);
22
23
  __exportStar(require("./AdminService"), exports);
23
24
  __exportStar(require("./AdminSettingsService"), exports);
@@ -20,6 +20,8 @@ export declare class SocketService {
20
20
  offConnected(cb?: (data: any) => void): void;
21
21
  onDisconnected(cb: (data: any) => void): void;
22
22
  offDisconnected(cb?: (data: any) => void): void;
23
+ onDisconnect(cb: (data: any) => void): void;
24
+ offDisconnect(cb?: (data: any) => void): void;
23
25
  onDriverStatusUpdate(cb: (data: DriverStatus) => void): void;
24
26
  offDriverStatusUpdate(cb?: (data: DriverStatus) => void): void;
25
27
  onTripUpdate(cb: (data: any) => void): void;
package/socketService.js CHANGED
@@ -97,6 +97,17 @@ class SocketService {
97
97
  this.socket.removeAllListeners('disconnected');
98
98
  }
99
99
  }
100
+ onDisconnect(cb) {
101
+ this.socket.on('disconnect', cb);
102
+ }
103
+ offDisconnect(cb) {
104
+ if (cb) {
105
+ this.socket.off('disconnect', cb);
106
+ }
107
+ else {
108
+ this.socket.removeAllListeners('disconnected');
109
+ }
110
+ }
100
111
  onDriverStatusUpdate(cb) {
101
112
  this.socket.on('driverStatusUpdate', cb);
102
113
  }
@@ -1,4 +1,4 @@
1
- import { TripStatuses } from '../..';
1
+ import { TripStatuses, DriverAssignmentModes, PaymentTypes } from '../..';
2
2
  export interface ActiveTrip {
3
3
  id: number;
4
4
  driverId: number | null;
@@ -9,7 +9,9 @@ export interface ActiveTrip {
9
9
  destinationAddress: string | null;
10
10
  destinationLatitude: number | null;
11
11
  destinationLongitude: number | null;
12
+ paymentType?: PaymentTypes;
12
13
  status: TripStatuses;
14
+ driverAssignmentMode?: DriverAssignmentModes;
13
15
  currentLatitude: number;
14
16
  currentLongitude: number;
15
17
  lastUpdate?: Date;
@@ -3,7 +3,9 @@ export interface DriverStatus {
3
3
  latitude?: number;
4
4
  longitude?: number;
5
5
  heartbeat?: string;
6
+ lastLocationChange?: string;
6
7
  isOnline?: boolean;
7
8
  waitingTripIds?: number[];
8
9
  activeTripId?: number;
9
10
  }
11
+ export declare function isValidDriverStatus(driverStatus: DriverStatus): boolean;
@@ -1,2 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidDriverStatus = isValidDriverStatus;
4
+ function isValidDriverStatus(driverStatus) {
5
+ if (!driverStatus?.id) {
6
+ return false;
7
+ }
8
+ return true;
9
+ }