@alfabit/keycloak 0.0.20 → 0.0.21
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.
- package/package.json +1 -1
- package/src/api/wallet/client.ts +0 -50
- package/src/api/wallet/swagger-types.ts +0 -12450
- package/src/api/wallet/types-ext.ts +0 -59
package/package.json
CHANGED
package/src/api/wallet/client.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// import { WALLET_API_HOST } from '@alfabit/constants';
|
|
2
|
-
// import { Api } from './swagger-types';
|
|
3
|
-
// import { getToken } from '../../composables';
|
|
4
|
-
|
|
5
|
-
// const client = new Api({
|
|
6
|
-
// baseUrl: WALLET_API_HOST,
|
|
7
|
-
// });
|
|
8
|
-
|
|
9
|
-
// export const getBearerToken = () => {
|
|
10
|
-
// const token = getToken();
|
|
11
|
-
// return token ? `Bearer ${token}` : '';
|
|
12
|
-
// };
|
|
13
|
-
|
|
14
|
-
// const api = client.public;
|
|
15
|
-
|
|
16
|
-
// type ApiMethod = (...args: any[]) => Promise<any>;
|
|
17
|
-
|
|
18
|
-
// // Подмешаем токен в заголовок каждого запроса
|
|
19
|
-
// Object.keys(client.public).forEach((methodName) => {
|
|
20
|
-
// const nativeMethod = client.public[methodName as keyof typeof client.public] as ApiMethod;
|
|
21
|
-
// const argsNumber = nativeMethod.length;
|
|
22
|
-
|
|
23
|
-
// api[methodName as keyof typeof api] = function (...args: any[]) {
|
|
24
|
-
// let params: Record<string, unknown> = {};
|
|
25
|
-
|
|
26
|
-
// if (args.length > argsNumber) {
|
|
27
|
-
// params = args.pop();
|
|
28
|
-
// }
|
|
29
|
-
|
|
30
|
-
// if (typeof params !== 'object' || params === null) {
|
|
31
|
-
// params = {};
|
|
32
|
-
// }
|
|
33
|
-
|
|
34
|
-
// if (!('headers' in params)) {
|
|
35
|
-
// params.headers = {};
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
// const headers = {
|
|
39
|
-
// ...((params.headers as Record<string, string>) ?? {}),
|
|
40
|
-
// Authorization: getBearerToken(),
|
|
41
|
-
// };
|
|
42
|
-
|
|
43
|
-
// return nativeMethod(...args, {
|
|
44
|
-
// ...params,
|
|
45
|
-
// headers,
|
|
46
|
-
// });
|
|
47
|
-
// } as ApiMethod;
|
|
48
|
-
// });
|
|
49
|
-
|
|
50
|
-
// export default client;
|