@dapex-tech/elite-online-services 0.0.1 → 0.0.5

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 (62) 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} +0 -5
  18. package/models/AdminDto.js +2 -0
  19. package/models/{DriverDto.ts → DriverDto.d.ts} +0 -5
  20. package/models/DriverDto.js +2 -0
  21. package/models/{LoginDto.ts → LoginDto.d.ts} +0 -5
  22. package/models/LoginDto.js +2 -0
  23. package/models/{UserDto.ts → UserDto.d.ts} +0 -5
  24. package/models/UserDto.js +2 -0
  25. package/models/index.d.ts +4 -0
  26. package/models/index.js +20 -0
  27. package/package.json +1 -1
  28. package/services/AdminService.d.ts +42 -0
  29. package/services/{AdminService.ts → AdminService.js} +17 -32
  30. package/services/DriversService.d.ts +42 -0
  31. package/services/{DriversService.ts → DriversService.js} +17 -32
  32. package/services/LoginsService.d.ts +25 -0
  33. package/services/{LoginsService.ts → LoginsService.js} +13 -21
  34. package/services/MainService.d.ts +8 -0
  35. package/services/MainService.js +18 -0
  36. package/services/UsersService.d.ts +42 -0
  37. package/services/{UsersService.ts → UsersService.js} +17 -32
  38. package/services/index.js +21 -0
  39. package/socketService.js +99 -0
  40. package/tsconfig.json +14 -0
  41. package/types/{driver-location.entity.ts → driver-location.entity.d.ts} +5 -7
  42. package/types/driver-location.entity.js +2 -0
  43. package/types/index.js +18 -0
  44. package/types/user.entity.d.ts +5 -0
  45. package/types/user.entity.js +6 -0
  46. package/core/ApiError.ts +0 -25
  47. package/core/CancelablePromise.ts +0 -131
  48. package/createClient.ts +0 -12
  49. package/index.ts +0 -10
  50. package/models/CreateAdminDto.ts +0 -31
  51. package/models/CreateDriverDto.ts +0 -47
  52. package/models/CreateUserDto.ts +0 -27
  53. package/models/UpdateAdminDto.ts +0 -31
  54. package/models/UpdateDriverDto.ts +0 -47
  55. package/models/UpdateUserDto.ts +0 -27
  56. package/models/index.ts +0 -10
  57. package/services/MainService.ts +0 -19
  58. package/socketService.ts +0 -105
  59. package/types/user.entity.ts +0 -5
  60. /package/core/{index.ts → index.d.ts} +0 -0
  61. /package/services/{index.ts → index.d.ts} +0 -0
  62. /package/types/{index.ts → index.d.ts} +0 -0
@@ -1,256 +1,234 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.request = exports.catchErrorCodes = exports.getResponseBody = exports.getResponseHeader = exports.sendRequest = exports.getRequestBody = exports.getHeaders = exports.resolve = exports.getFormData = exports.getQueryString = exports.base64 = exports.isFormData = exports.isBlob = exports.isStringWithValue = exports.isString = exports.isDefined = void 0;
1
4
  /* generated using openapi-typescript-codegen -- do not edit */
2
5
  /* istanbul ignore file */
3
6
  /* tslint:disable */
4
7
  /* eslint-disable */
5
- import { ApiError } from './ApiError';
6
- import type { ApiRequestOptions } from './ApiRequestOptions';
7
- import type { ApiResult } from './ApiResult';
8
- import { CancelablePromise } from './CancelablePromise';
9
- import type { OnCancel } from './CancelablePromise';
10
- import type { OpenAPIConfig } from './OpenAPI';
11
-
12
- export const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
8
+ const ApiError_1 = require("./ApiError");
9
+ const CancelablePromise_1 = require("./CancelablePromise");
10
+ const isDefined = (value) => {
13
11
  return value !== undefined && value !== null;
14
12
  };
15
-
16
- export const isString = (value: any): value is string => {
13
+ exports.isDefined = isDefined;
14
+ const isString = (value) => {
17
15
  return typeof value === 'string';
18
16
  };
19
-
20
- export const isStringWithValue = (value: any): value is string => {
21
- return isString(value) && value !== '';
17
+ exports.isString = isString;
18
+ const isStringWithValue = (value) => {
19
+ return (0, exports.isString)(value) && value !== '';
22
20
  };
23
-
24
- export const isBlob = (value: any): value is Blob => {
25
- return (
26
- typeof value === 'object' &&
21
+ exports.isStringWithValue = isStringWithValue;
22
+ const isBlob = (value) => {
23
+ return (typeof value === 'object' &&
27
24
  typeof value.type === 'string' &&
28
25
  typeof value.stream === 'function' &&
29
26
  typeof value.arrayBuffer === 'function' &&
30
27
  typeof value.constructor === 'function' &&
31
28
  typeof value.constructor.name === 'string' &&
32
29
  /^(Blob|File)$/.test(value.constructor.name) &&
33
- /^(Blob|File)$/.test(value[Symbol.toStringTag])
34
- );
30
+ /^(Blob|File)$/.test(value[Symbol.toStringTag]));
35
31
  };
36
-
37
- export const isFormData = (value: any): value is FormData => {
32
+ exports.isBlob = isBlob;
33
+ const isFormData = (value) => {
38
34
  return value instanceof FormData;
39
35
  };
40
-
41
- export const base64 = (str: string): string => {
36
+ exports.isFormData = isFormData;
37
+ const base64 = (str) => {
42
38
  try {
43
39
  return btoa(str);
44
- } catch (err) {
40
+ }
41
+ catch (err) {
45
42
  // @ts-ignore
46
43
  return Buffer.from(str).toString('base64');
47
44
  }
48
45
  };
49
-
50
- export const getQueryString = (params: Record<string, any>): string => {
51
- const qs: string[] = [];
52
-
53
- const append = (key: string, value: any) => {
46
+ exports.base64 = base64;
47
+ const getQueryString = (params) => {
48
+ const qs = [];
49
+ const append = (key, value) => {
54
50
  qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
55
51
  };
56
-
57
- const process = (key: string, value: any) => {
58
- if (isDefined(value)) {
52
+ const process = (key, value) => {
53
+ if ((0, exports.isDefined)(value)) {
59
54
  if (Array.isArray(value)) {
60
55
  value.forEach(v => {
61
56
  process(key, v);
62
57
  });
63
- } else if (typeof value === 'object') {
58
+ }
59
+ else if (typeof value === 'object') {
64
60
  Object.entries(value).forEach(([k, v]) => {
65
61
  process(`${key}[${k}]`, v);
66
62
  });
67
- } else {
63
+ }
64
+ else {
68
65
  append(key, value);
69
66
  }
70
67
  }
71
68
  };
72
-
73
69
  Object.entries(params).forEach(([key, value]) => {
74
70
  process(key, value);
75
71
  });
76
-
77
72
  if (qs.length > 0) {
78
73
  return `?${qs.join('&')}`;
79
74
  }
80
-
81
75
  return '';
82
76
  };
83
-
84
- const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
77
+ exports.getQueryString = getQueryString;
78
+ const getUrl = (config, options) => {
85
79
  const encoder = config.ENCODE_PATH || encodeURI;
86
-
87
80
  const path = options.url
88
81
  .replace('{api-version}', config.VERSION)
89
- .replace(/{(.*?)}/g, (substring: string, group: string) => {
90
- if (options.path?.hasOwnProperty(group)) {
91
- return encoder(String(options.path[group]));
92
- }
93
- return substring;
94
- });
95
-
82
+ .replace(/{(.*?)}/g, (substring, group) => {
83
+ if (options.path?.hasOwnProperty(group)) {
84
+ return encoder(String(options.path[group]));
85
+ }
86
+ return substring;
87
+ });
96
88
  const url = `${config.BASE}${path}`;
97
89
  if (options.query) {
98
- return `${url}${getQueryString(options.query)}`;
90
+ return `${url}${(0, exports.getQueryString)(options.query)}`;
99
91
  }
100
92
  return url;
101
93
  };
102
-
103
- export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
94
+ const getFormData = (options) => {
104
95
  if (options.formData) {
105
96
  const formData = new FormData();
106
-
107
- const process = (key: string, value: any) => {
108
- if (isString(value) || isBlob(value)) {
97
+ const process = (key, value) => {
98
+ if ((0, exports.isString)(value) || (0, exports.isBlob)(value)) {
109
99
  formData.append(key, value);
110
- } else {
100
+ }
101
+ else {
111
102
  formData.append(key, JSON.stringify(value));
112
103
  }
113
104
  };
114
-
115
105
  Object.entries(options.formData)
116
- .filter(([_, value]) => isDefined(value))
106
+ .filter(([_, value]) => (0, exports.isDefined)(value))
117
107
  .forEach(([key, value]) => {
118
- if (Array.isArray(value)) {
119
- value.forEach(v => process(key, v));
120
- } else {
121
- process(key, value);
122
- }
123
- });
124
-
108
+ if (Array.isArray(value)) {
109
+ value.forEach(v => process(key, v));
110
+ }
111
+ else {
112
+ process(key, value);
113
+ }
114
+ });
125
115
  return formData;
126
116
  }
127
117
  return undefined;
128
118
  };
129
-
130
- type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
131
-
132
- export const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
119
+ exports.getFormData = getFormData;
120
+ const resolve = async (options, resolver) => {
133
121
  if (typeof resolver === 'function') {
134
- return (resolver as Resolver<T>)(options);
122
+ return resolver(options);
135
123
  }
136
124
  return resolver;
137
125
  };
138
-
139
- export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise<Headers> => {
126
+ exports.resolve = resolve;
127
+ const getHeaders = async (config, options) => {
140
128
  const [token, username, password, additionalHeaders] = await Promise.all([
141
- resolve(options, config.TOKEN),
142
- resolve(options, config.USERNAME),
143
- resolve(options, config.PASSWORD),
144
- resolve(options, config.HEADERS),
129
+ (0, exports.resolve)(options, config.TOKEN),
130
+ (0, exports.resolve)(options, config.USERNAME),
131
+ (0, exports.resolve)(options, config.PASSWORD),
132
+ (0, exports.resolve)(options, config.HEADERS),
145
133
  ]);
146
-
147
134
  const headers = Object.entries({
148
135
  Accept: 'application/json',
149
136
  ...additionalHeaders,
150
137
  ...options.headers,
151
138
  })
152
- .filter(([_, value]) => isDefined(value))
139
+ .filter(([_, value]) => (0, exports.isDefined)(value))
153
140
  .reduce((headers, [key, value]) => ({
154
- ...headers,
155
- [key]: String(value),
156
- }), {} as Record<string, string>);
157
-
158
- if (isStringWithValue(token)) {
141
+ ...headers,
142
+ [key]: String(value),
143
+ }), {});
144
+ if ((0, exports.isStringWithValue)(token)) {
159
145
  headers['Authorization'] = `Bearer ${token}`;
160
146
  }
161
-
162
- if (isStringWithValue(username) && isStringWithValue(password)) {
163
- const credentials = base64(`${username}:${password}`);
147
+ if ((0, exports.isStringWithValue)(username) && (0, exports.isStringWithValue)(password)) {
148
+ const credentials = (0, exports.base64)(`${username}:${password}`);
164
149
  headers['Authorization'] = `Basic ${credentials}`;
165
150
  }
166
-
167
151
  if (options.body !== undefined) {
168
152
  if (options.mediaType) {
169
153
  headers['Content-Type'] = options.mediaType;
170
- } else if (isBlob(options.body)) {
154
+ }
155
+ else if ((0, exports.isBlob)(options.body)) {
171
156
  headers['Content-Type'] = options.body.type || 'application/octet-stream';
172
- } else if (isString(options.body)) {
157
+ }
158
+ else if ((0, exports.isString)(options.body)) {
173
159
  headers['Content-Type'] = 'text/plain';
174
- } else if (!isFormData(options.body)) {
160
+ }
161
+ else if (!(0, exports.isFormData)(options.body)) {
175
162
  headers['Content-Type'] = 'application/json';
176
163
  }
177
164
  }
178
-
179
165
  return new Headers(headers);
180
166
  };
181
-
182
- export const getRequestBody = (options: ApiRequestOptions): any => {
167
+ exports.getHeaders = getHeaders;
168
+ const getRequestBody = (options) => {
183
169
  if (options.body !== undefined) {
184
170
  if (options.mediaType?.includes('/json')) {
185
- return JSON.stringify(options.body)
186
- } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
171
+ return JSON.stringify(options.body);
172
+ }
173
+ else if ((0, exports.isString)(options.body) || (0, exports.isBlob)(options.body) || (0, exports.isFormData)(options.body)) {
187
174
  return options.body;
188
- } else {
175
+ }
176
+ else {
189
177
  return JSON.stringify(options.body);
190
178
  }
191
179
  }
192
180
  return undefined;
193
181
  };
194
-
195
- export const sendRequest = async (
196
- config: OpenAPIConfig,
197
- options: ApiRequestOptions,
198
- url: string,
199
- body: any,
200
- formData: FormData | undefined,
201
- headers: Headers,
202
- onCancel: OnCancel
203
- ): Promise<Response> => {
182
+ exports.getRequestBody = getRequestBody;
183
+ const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
204
184
  const controller = new AbortController();
205
-
206
- const request: RequestInit = {
185
+ const request = {
207
186
  headers,
208
187
  body: body ?? formData,
209
188
  method: options.method,
210
189
  signal: controller.signal,
211
190
  };
212
-
213
191
  if (config.WITH_CREDENTIALS) {
214
192
  request.credentials = config.CREDENTIALS;
215
193
  }
216
-
217
194
  onCancel(() => controller.abort());
218
-
219
195
  return await fetch(url, request);
220
196
  };
221
-
222
- export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
197
+ exports.sendRequest = sendRequest;
198
+ const getResponseHeader = (response, responseHeader) => {
223
199
  if (responseHeader) {
224
200
  const content = response.headers.get(responseHeader);
225
- if (isString(content)) {
201
+ if ((0, exports.isString)(content)) {
226
202
  return content;
227
203
  }
228
204
  }
229
205
  return undefined;
230
206
  };
231
-
232
- export const getResponseBody = async (response: Response): Promise<any> => {
207
+ exports.getResponseHeader = getResponseHeader;
208
+ const getResponseBody = async (response) => {
233
209
  if (response.status !== 204) {
234
210
  try {
235
211
  const contentType = response.headers.get('Content-Type');
236
212
  if (contentType) {
237
- const jsonTypes = ['application/json', 'application/problem+json']
213
+ const jsonTypes = ['application/json', 'application/problem+json'];
238
214
  const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type));
239
215
  if (isJSON) {
240
216
  return await response.json();
241
- } else {
217
+ }
218
+ else {
242
219
  return await response.text();
243
220
  }
244
221
  }
245
- } catch (error) {
222
+ }
223
+ catch (error) {
246
224
  console.error(error);
247
225
  }
248
226
  }
249
227
  return undefined;
250
228
  };
251
-
252
- export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
253
- const errors: Record<number, string> = {
229
+ exports.getResponseBody = getResponseBody;
230
+ const catchErrorCodes = (options, result) => {
231
+ const errors = {
254
232
  400: 'Bad Request',
255
233
  401: 'Unauthorized',
256
234
  403: 'Forbidden',
@@ -259,30 +237,26 @@ export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult):
259
237
  502: 'Bad Gateway',
260
238
  503: 'Service Unavailable',
261
239
  ...options.errors,
262
- }
263
-
240
+ };
264
241
  const error = errors[result.status];
265
242
  if (error) {
266
- throw new ApiError(options, result, error);
243
+ throw new ApiError_1.ApiError(options, result, error);
267
244
  }
268
-
269
245
  if (!result.ok) {
270
246
  const errorStatus = result.status ?? 'unknown';
271
247
  const errorStatusText = result.statusText ?? 'unknown';
272
248
  const errorBody = (() => {
273
249
  try {
274
250
  return JSON.stringify(result.body, null, 2);
275
- } catch (e) {
251
+ }
252
+ catch (e) {
276
253
  return undefined;
277
254
  }
278
255
  })();
279
-
280
- throw new ApiError(options, result,
281
- `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
282
- );
256
+ throw new ApiError_1.ApiError(options, result, `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`);
283
257
  }
284
258
  };
285
-
259
+ exports.catchErrorCodes = catchErrorCodes;
286
260
  /**
287
261
  * Request method
288
262
  * @param config The OpenAPI configuration object
@@ -290,33 +264,31 @@ export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult):
290
264
  * @returns CancelablePromise<T>
291
265
  * @throws ApiError
292
266
  */
293
- export const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise<T> => {
294
- return new CancelablePromise(async (resolve, reject, onCancel) => {
267
+ const request = (config, options) => {
268
+ return new CancelablePromise_1.CancelablePromise(async (resolve, reject, onCancel) => {
295
269
  try {
296
270
  const url = getUrl(config, options);
297
- const formData = getFormData(options);
298
- const body = getRequestBody(options);
299
- const headers = await getHeaders(config, options);
300
-
271
+ const formData = (0, exports.getFormData)(options);
272
+ const body = (0, exports.getRequestBody)(options);
273
+ const headers = await (0, exports.getHeaders)(config, options);
301
274
  if (!onCancel.isCancelled) {
302
- const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
303
- const responseBody = await getResponseBody(response);
304
- const responseHeader = getResponseHeader(response, options.responseHeader);
305
-
306
- const result: ApiResult = {
275
+ const response = await (0, exports.sendRequest)(config, options, url, body, formData, headers, onCancel);
276
+ const responseBody = await (0, exports.getResponseBody)(response);
277
+ const responseHeader = (0, exports.getResponseHeader)(response, options.responseHeader);
278
+ const result = {
307
279
  url,
308
280
  ok: response.ok,
309
281
  status: response.status,
310
282
  statusText: response.statusText,
311
283
  body: responseHeader ?? responseBody,
312
284
  };
313
-
314
- catchErrorCodes(options, result);
315
-
285
+ (0, exports.catchErrorCodes)(options, result);
316
286
  resolve(result.body);
317
287
  }
318
- } catch (error) {
288
+ }
289
+ catch (error) {
319
290
  reject(error);
320
291
  }
321
292
  });
322
293
  };
294
+ exports.request = request;
@@ -0,0 +1,48 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.createClient = createClient;
37
+ const OpenAPI_1 = require("./core/OpenAPI");
38
+ const services = __importStar(require("./services"));
39
+ /**
40
+ * Crea un cliente SDK con la URL base configurada
41
+ */
42
+ function createClient(baseUrl, token) {
43
+ OpenAPI_1.OpenAPI.BASE = baseUrl || process.env.API_URL || 'http://localhost:3000';
44
+ OpenAPI_1.OpenAPI.TOKEN = token || process.env.API_TOKEN || '';
45
+ return {
46
+ ...services, // todos los servicios agrupados
47
+ };
48
+ }
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from './models';
2
+ export * from './core';
3
+ export * from './services';
4
+ export * from './types';
5
+ export * from './createClient';
6
+ export * from './socketService';
package/index.js ADDED
@@ -0,0 +1,22 @@
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("./models"), exports);
18
+ __exportStar(require("./core"), exports);
19
+ __exportStar(require("./services"), exports);
20
+ __exportStar(require("./types"), exports);
21
+ __exportStar(require("./createClient"), exports);
22
+ __exportStar(require("./socketService"), exports);
@@ -1,7 +1,3 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
1
  export type AdminDto = {
6
2
  /**
7
3
  * Admin First Name
@@ -28,4 +24,3 @@ export type AdminDto = {
28
24
  */
29
25
  role_id: number;
30
26
  };
31
-
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,3 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
1
  export type DriverDto = {
6
2
  /**
7
3
  * Driver First Name
@@ -44,4 +40,3 @@ export type DriverDto = {
44
40
  */
45
41
  last_heartbeat?: string;
46
42
  };
47
-
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,3 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
1
  export type LoginDto = {
6
2
  /**
7
3
  * Email must be valid
@@ -12,4 +8,3 @@ export type LoginDto = {
12
8
  */
13
9
  password: string;
14
10
  };
15
-
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,3 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
1
  export type UserDto = {
6
2
  /**
7
3
  * User First Name
@@ -24,4 +20,3 @@ export type UserDto = {
24
20
  */
25
21
  phone: string;
26
22
  };
27
-
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export * from './AdminDto';
2
+ export * from './DriverDto';
3
+ export * from './LoginDto';
4
+ export * from './UserDto';
@@ -0,0 +1,20 @@
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("./AdminDto"), exports);
18
+ __exportStar(require("./DriverDto"), exports);
19
+ __exportStar(require("./LoginDto"), exports);
20
+ __exportStar(require("./UserDto"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dapex-tech/elite-online-services",
3
- "version": "0.0.1",
3
+ "version": "0.0.5",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "private": false,
@@ -0,0 +1,42 @@
1
+ import type { AdminDto } from '../models/AdminDto';
2
+ import type { CancelablePromise } from '../core/CancelablePromise';
3
+ export declare class AdminService {
4
+ /**
5
+ * Create a new admin
6
+ * @param requestBody
7
+ * @returns any Admin created successfully.
8
+ * @throws ApiError
9
+ */
10
+ static create(requestBody: AdminDto): CancelablePromise<any>;
11
+ /**
12
+ * Get all admins
13
+ * @param search
14
+ * @param orderBy
15
+ * @param order
16
+ * @returns any List of admins
17
+ * @throws ApiError
18
+ */
19
+ static findAll(search: string, orderBy: string, order: string): CancelablePromise<any>;
20
+ /**
21
+ * Get a single admin by ID
22
+ * @param id
23
+ * @returns any Admin found
24
+ * @throws ApiError
25
+ */
26
+ static findOne(id: number): CancelablePromise<any>;
27
+ /**
28
+ * Update an admin by ID
29
+ * @param id
30
+ * @param requestBody
31
+ * @returns any Admin updated successfully.
32
+ * @throws ApiError
33
+ */
34
+ static update(id: number, requestBody: AdminDto): CancelablePromise<any>;
35
+ /**
36
+ * Delete an admin by ID
37
+ * @param id
38
+ * @returns any Admin deleted successfully.
39
+ * @throws ApiError
40
+ */
41
+ static remove(id: number): CancelablePromise<any>;
42
+ }