@dapex-tech/elite-online-services 0.0.2 → 0.0.6

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 (69) hide show
  1. package/core/ApiError.d.ts +10 -0
  2. package/core/ApiError.js +15 -0
  3. package/core/{ApiRequestOptions.ts → ApiRequestOptions.d.ts} +0 -4
  4. package/core/ApiRequestOptions.js +2 -0
  5. package/core/{ApiResult.ts → ApiResult.d.ts} +0 -4
  6. package/core/ApiResult.js +2 -0
  7. package/core/CancelablePromise.d.ts +20 -0
  8. package/core/CancelablePromise.js +116 -0
  9. package/core/{OpenAPI.ts → OpenAPI.d.ts} +2 -18
  10. package/core/OpenAPI.js +14 -0
  11. package/core/index.js +22 -0
  12. package/core/request.d.ts +30 -0
  13. package/core/{request.ts → request.js} +117 -145
  14. package/createClient.js +48 -0
  15. package/index.d.ts +6 -0
  16. package/index.js +22 -0
  17. package/models/{AdminDto.ts → AdminDto.d.ts} +1 -6
  18. package/models/AdminDto.js +2 -0
  19. package/models/AdminUpdateDto.d.ts +26 -0
  20. package/models/AdminUpdateDto.js +2 -0
  21. package/models/{CreateDriverDto.ts → DriverDto.d.ts} +4 -9
  22. package/models/DriverDto.js +2 -0
  23. package/models/{UpdateDriverDto.ts → DriverUpdateDto.d.ts} +3 -8
  24. package/models/DriverUpdateDto.js +2 -0
  25. package/models/{LoginDto.ts → LoginDto.d.ts} +0 -5
  26. package/models/LoginDto.js +2 -0
  27. package/models/OrderDto.d.ts +19 -0
  28. package/models/OrderDto.js +14 -0
  29. package/models/{UserDto.ts → UserDto.d.ts} +1 -6
  30. package/models/UserDto.js +2 -0
  31. package/models/{CreateUserDto.ts → UserUpdatedDto.d.ts} +2 -7
  32. package/models/UserUpdatedDto.js +2 -0
  33. package/models/index.d.ts +8 -0
  34. package/models/index.js +24 -0
  35. package/package.json +1 -1
  36. package/services/AdminService.d.ts +43 -0
  37. package/services/{AdminService.ts → AdminService.js} +20 -37
  38. package/services/DriversService.d.ts +43 -0
  39. package/services/{DriversService.ts → DriversService.js} +20 -37
  40. package/services/LoginsService.d.ts +43 -0
  41. package/services/LoginsService.js +96 -0
  42. package/services/MainService.d.ts +8 -0
  43. package/services/MainService.js +18 -0
  44. package/services/UsersService.d.ts +43 -0
  45. package/services/{UsersService.ts → UsersService.js} +20 -37
  46. package/services/index.js +21 -0
  47. package/socketService.js +104 -0
  48. package/tsconfig.json +14 -0
  49. package/types/{driver-location.entity.ts → driver-location.entity.d.ts} +5 -7
  50. package/types/driver-location.entity.js +2 -0
  51. package/types/index.js +18 -0
  52. package/types/user.entity.d.ts +5 -0
  53. package/types/user.entity.js +6 -0
  54. package/core/ApiError.ts +0 -25
  55. package/core/CancelablePromise.ts +0 -131
  56. package/createClient.ts +0 -13
  57. package/index.ts +0 -10
  58. package/models/CreateAdminDto.ts +0 -31
  59. package/models/DriverDto.ts +0 -47
  60. package/models/UpdateAdminDto.ts +0 -31
  61. package/models/UpdateUserDto.ts +0 -27
  62. package/models/index.ts +0 -10
  63. package/services/LoginsService.ts +0 -67
  64. package/services/MainService.ts +0 -19
  65. package/socketService.ts +0 -125
  66. package/types/user.entity.ts +0 -5
  67. /package/core/{index.ts → index.d.ts} +0 -0
  68. /package/services/{index.ts → index.d.ts} +0 -0
  69. /package/types/{index.ts → index.d.ts} +0 -0
@@ -1,67 +0,0 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
- import type { LoginDto } from '../models/LoginDto';
6
- import type { CancelablePromise } from '../core/CancelablePromise';
7
- import { OpenAPI } from '../core/OpenAPI';
8
- import { request as __request } from '../core/request';
9
- export class LoginsService {
10
- /**
11
- * User Login
12
- * @param requestBody
13
- * @returns any Login successful
14
- * @throws ApiError
15
- */
16
- public static login(
17
- requestBody: LoginDto,
18
- ): CancelablePromise<any> {
19
- return __request(OpenAPI, {
20
- method: 'POST',
21
- url: '/auth/users/login',
22
- body: requestBody,
23
- mediaType: 'application/json',
24
- errors: {
25
- 401: `Invalid credentials`,
26
- },
27
- });
28
- }
29
- /**
30
- * Admin Login
31
- * @param requestBody
32
- * @returns any Login successful
33
- * @throws ApiError
34
- */
35
- public static login1(
36
- requestBody: LoginDto,
37
- ): CancelablePromise<any> {
38
- return __request(OpenAPI, {
39
- method: 'POST',
40
- url: '/auth/admins/login',
41
- body: requestBody,
42
- mediaType: 'application/json',
43
- errors: {
44
- 401: `Invalid credentials`,
45
- },
46
- });
47
- }
48
- /**
49
- * Driver Login
50
- * @param requestBody
51
- * @returns any Login successful
52
- * @throws ApiError
53
- */
54
- public static login2(
55
- requestBody: LoginDto,
56
- ): CancelablePromise<any> {
57
- return __request(OpenAPI, {
58
- method: 'POST',
59
- url: '/auth/drivers/login',
60
- body: requestBody,
61
- mediaType: 'application/json',
62
- errors: {
63
- 401: `Invalid credentials`,
64
- },
65
- });
66
- }
67
- }
@@ -1,19 +0,0 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
- import type { CancelablePromise } from '../core/CancelablePromise';
6
- import { OpenAPI } from '../core/OpenAPI';
7
- import { request as __request } from '../core/request';
8
- export class MainService {
9
- /**
10
- * @returns any
11
- * @throws ApiError
12
- */
13
- public static getHello(): CancelablePromise<any> {
14
- return __request(OpenAPI, {
15
- method: 'GET',
16
- url: '/',
17
- });
18
- }
19
- }
package/socketService.ts DELETED
@@ -1,125 +0,0 @@
1
- import { io, Socket } from 'socket.io-client';
2
- import { DriverLocationMap, DriverLocationWithClientID } from './types';
3
-
4
- export class SocketService {
5
- private socket: Socket;
6
-
7
- /*
8
- constructor(baseUrl: string) {
9
- this.socket = io(baseUrl, { transports: ['websocket'] });
10
- }
11
- */
12
-
13
- constructor(baseUrl: string, token?: string) {
14
- this.socket = io(baseUrl, {
15
- transports: ['websocket'],
16
- auth: token ? { token } : undefined, // ✅ send token if available
17
- });
18
- }
19
-
20
- connect() {
21
- this.socket.connect();
22
- }
23
-
24
- disconnect() {
25
- this.socket.disconnect();
26
- }
27
-
28
- isConnected(): boolean {
29
- return this.socket.connected;
30
- }
31
-
32
- isActive(): boolean {
33
- return this.socket.active;
34
- }
35
-
36
- on<T = any>(event: string, cb: (data: T) => void) {
37
- this.socket.on(event, cb);
38
- }
39
-
40
- off(event: string, cb?: (...args: any[]) => void) {
41
- if (cb) {
42
- this.socket.off(event, cb);
43
- } else {
44
- this.socket.removeAllListeners(event);
45
- }
46
- }
47
-
48
- emit<T = any>(event: string, data: T) {
49
- this.socket.emit(event, data);
50
- }
51
-
52
- // Custom methods
53
- sendMessage(message: string) {
54
- this.emit('message', { text: message });
55
- }
56
-
57
- onMessageReceived(cb: (data: { text: string }) => void) {
58
- this.on('messageReceived', cb);
59
- }
60
-
61
- offMessageReceived(cb: (data: { text: string }) => void) {
62
- this.off('messageReceived', cb);
63
- }
64
-
65
- updateLocation(data: DriverLocationWithClientID) {
66
- this.emit('updateLocation', { ...data });
67
- }
68
-
69
- onLocationUpdated(cb: (data: DriverLocationMap) => void) {
70
- this.on('locationUpdated', cb);
71
- }
72
-
73
- offLocationUpdated(cb: (data: DriverLocationMap) => void) {
74
- this.off('locationUpdated', cb);
75
- }
76
-
77
- onAllLocations(cb: (data: DriverLocationMap) => void) {
78
- this.on('allLocations', cb);
79
- }
80
-
81
- offAllLocations(cb: (data: DriverLocationMap) => void) {
82
- this.off('allLocations', cb);
83
- }
84
-
85
- sendHeartbeat(clientID: string) {
86
- this.emit('heartbeat', { clientID });
87
- }
88
-
89
- onHeartbeatReceived(cb: (data: { clientID: string; timestamp: number }) => void) {
90
- this.on('heartbeatReceived', cb);
91
- }
92
-
93
- offHeartbeatReceived(cb: (data: { clientID: string; timestamp: number }) => void) {
94
- this.off('heartbeatReceived', cb);
95
- }
96
-
97
- onAllHeartbeats(cb: (data: { [clientID: string]: number }) => void) {
98
- this.on('allHeartbeats', cb);
99
- }
100
-
101
- offAllHeartbeats(cb: (data: { [clientID: string]: number }) => void) {
102
- this.off('allHeartbeats', cb);
103
- }
104
-
105
- updateServiceOrderStatus(orderID: string, status: number) {
106
- this.emit('serviceOrderStatusUpdate', { orderID, status });
107
- }
108
-
109
- onServiceOrderStatusUpdated(callback: (data: { orderID: string, status: number }) => void) {
110
- this.on('serviceOrderStatusUpdated', callback);
111
- }
112
-
113
- offServiceOrderStatusUpdated(callback: (data: { orderID: string, status: number }) => void) {
114
- this.off('serviceOrderStatusUpdated', callback);
115
- }
116
-
117
- onAllServiceOrderStatuses(callback: (statuses: { [orderID: string]: number }) => void) {
118
- this.on('allServiceOrderStatuses', callback);
119
- }
120
-
121
- offAllServiceOrderStatuses(callback: (statuses: { [orderID: string]: number }) => void) {
122
- this.off('allServiceOrderStatuses', callback);
123
- }
124
-
125
- }
@@ -1,5 +0,0 @@
1
- export class User {
2
- id: number;
3
- name: string;
4
- email: string;
5
- }
File without changes
File without changes
File without changes