@dapex-tech/elite-online-services 0.0.13 → 0.0.14

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.
@@ -23,4 +23,8 @@ export type CustomerDto = {
23
23
  * Customer Phone Number
24
24
  */
25
25
  phone: string;
26
+ /**
27
+ * Customer Verified Status
28
+ */
29
+ isVerified?: boolean;
26
30
  };
@@ -23,6 +23,10 @@ export type CustomerLoginResponseDto = {
23
23
  * Customer Phone Number
24
24
  */
25
25
  phone: string;
26
+ /**
27
+ * Customer Verified Status
28
+ */
29
+ isVerified?: boolean;
26
30
  /**
27
31
  * Access Token
28
32
  */
@@ -0,0 +1,3 @@
1
+ export declare enum CustomerTripActions {
2
+ CANCEL = "cancel"
3
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerTripActions = void 0;
4
+ /* generated using openapi-typescript-codegen -- do not edit */
5
+ /* istanbul ignore file */
6
+ /* tslint:disable */
7
+ /* eslint-disable */
8
+ var CustomerTripActions;
9
+ (function (CustomerTripActions) {
10
+ CustomerTripActions["CANCEL"] = "cancel";
11
+ })(CustomerTripActions || (exports.CustomerTripActions = CustomerTripActions = {}));
package/models/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './CustomerLocationUpdateDto';
10
10
  export * from './CustomerLoginDto';
11
11
  export * from './CustomerLoginResponseDto';
12
12
  export * from './CustomerRegisterDto';
13
+ export * from './CustomerTripActions';
13
14
  export * from './CustomerUpdatedDto';
14
15
  export * from './CustomerVerifyAccountDto';
15
16
  export * from './DriverCreateDto';
package/models/index.js CHANGED
@@ -26,6 +26,7 @@ __exportStar(require("./CustomerLocationUpdateDto"), exports);
26
26
  __exportStar(require("./CustomerLoginDto"), exports);
27
27
  __exportStar(require("./CustomerLoginResponseDto"), exports);
28
28
  __exportStar(require("./CustomerRegisterDto"), exports);
29
+ __exportStar(require("./CustomerTripActions"), exports);
29
30
  __exportStar(require("./CustomerUpdatedDto"), exports);
30
31
  __exportStar(require("./CustomerVerifyAccountDto"), exports);
31
32
  __exportStar(require("./DriverCreateDto"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dapex-tech/elite-online-services",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "private": false,
@@ -1,3 +1,4 @@
1
+ import type { CustomerTripActions } from '../models/CustomerTripActions';
1
2
  import type { TripDto } from '../models/TripDto';
2
3
  import type { TripUpdateDto } from '../models/TripUpdateDto';
3
4
  import type { TripUpdateTripsStatusDto } from '../models/TripUpdateTripsStatusDto';
@@ -55,9 +56,10 @@ export declare class CustomerTripsService {
55
56
  static cancelTrip(id: number): CancelablePromise<TripDto>;
56
57
  /**
57
58
  * Execute an action on a trip
58
- * @param id
59
+ * @param id Trip ID
60
+ * @param action Action to be executed on the trip
59
61
  * @returns TripDto Trip action executed successfully.
60
62
  * @throws ApiError
61
63
  */
62
- static executeTripAction(id: number): CancelablePromise<TripDto>;
64
+ static executeTripAction(id: number, action: CustomerTripActions): CancelablePromise<TripDto>;
63
65
  }
@@ -112,16 +112,18 @@ class CustomerTripsService {
112
112
  }
113
113
  /**
114
114
  * Execute an action on a trip
115
- * @param id
115
+ * @param id Trip ID
116
+ * @param action Action to be executed on the trip
116
117
  * @returns TripDto Trip action executed successfully.
117
118
  * @throws ApiError
118
119
  */
119
- static executeTripAction(id) {
120
+ static executeTripAction(id, action) {
120
121
  return (0, request_1.request)(OpenAPI_1.OpenAPI, {
121
122
  method: 'PATCH',
122
123
  url: '/customers/trips/{id}/action/{action}',
123
124
  path: {
124
125
  'id': id,
126
+ 'action': action,
125
127
  },
126
128
  });
127
129
  }
@@ -1,3 +1,4 @@
1
+ import type { DriverStatus } from './types';
1
2
  export declare class SocketService {
2
3
  private socket;
3
4
  private token;
@@ -19,9 +20,9 @@ export declare class SocketService {
19
20
  offConnected(cb?: (data: any) => void): void;
20
21
  onDisconnected(cb: (data: any) => void): void;
21
22
  offDisconnected(cb?: (data: any) => void): void;
22
- onDriverStatusUpdate(cb: (data: any) => void): void;
23
- offDriverStatusUpdate(cb?: (data: any) => void): void;
23
+ onDriverStatusUpdate(cb: (data: DriverStatus) => void): void;
24
+ offDriverStatusUpdate(cb?: (data: DriverStatus) => void): void;
24
25
  onTripUpdate(cb: (data: any) => void): void;
25
26
  offTripUpdate(cb?: (data: any) => void): void;
26
- updateDriverStatus(data: Object): void;
27
+ emitDriverStatusUpdate(data: DriverStatus): void;
27
28
  }
package/socketService.js CHANGED
@@ -119,8 +119,8 @@ class SocketService {
119
119
  this.socket.removeAllListeners('tripUpdate');
120
120
  }
121
121
  }
122
- updateDriverStatus(data) {
123
- this.emit('updateDriverStatus', { ...data });
122
+ emitDriverStatusUpdate(data) {
123
+ this.emit('driverStatusUpdate', { ...data });
124
124
  }
125
125
  }
126
126
  exports.SocketService = SocketService;
package/types/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './driver-location.entity';
2
2
  export * from './user.entity';
3
+ export * from './realtime';
package/types/index.js CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./driver-location.entity"), exports);
18
18
  __exportStar(require("./user.entity"), exports);
19
+ __exportStar(require("./realtime"), exports);
@@ -0,0 +1,5 @@
1
+ import { DriverTripActions } from '../..';
2
+ export interface DriverExecuteTripAction {
3
+ tripId: number;
4
+ action: DriverTripActions;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface DriverStatus {
2
+ id?: number;
3
+ lat?: number;
4
+ lng?: number;
5
+ heartbeat?: string;
6
+ isOnline?: boolean;
7
+ activeTripId?: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './driver-execute-trip-action';
2
+ export * from './driver-status';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./driver-execute-trip-action"), exports);
18
+ __exportStar(require("./driver-status"), exports);