@alfabit/keycloak 0.0.19 → 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/endpoints/index.ts +1 -3
- package/src/api/wallet/client.ts +0 -50
- package/src/api/wallet/endpoints/public/index.ts +0 -1
- package/src/api/wallet/endpoints/public/public/index.ts +0 -1
- package/src/api/wallet/endpoints/public/public/post.web-login.ts +0 -12
- package/src/api/wallet/swagger-types.ts +0 -12450
- package/src/api/wallet/types-ext.ts +0 -59
package/package.json
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// export * from './public';
|
|
2
|
-
|
|
3
1
|
import { REF_KEY, WALLET_API_HOST } from '@alfabit/constants';
|
|
4
2
|
import { getToken } from '../../../composables';
|
|
5
3
|
|
|
@@ -22,7 +20,7 @@ export const postWebLogin = async () => {
|
|
|
22
20
|
const res = await fetch(`${WALLET_API_HOST}/public/web/login/`, params);
|
|
23
21
|
|
|
24
22
|
if (!res.ok) {
|
|
25
|
-
throw new Error(`HTTP error: ${res.status}`);
|
|
23
|
+
throw new Error(`postWebLogin /public/web/login/: HTTP error: ${res.status}`);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
const data = await res.json();
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './public';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// export * from './post.web-login';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// import { REF_KEY } from '@alfabit/constants';
|
|
2
|
-
// import api from '../../../client';
|
|
3
|
-
|
|
4
|
-
// export const postWebLogin = async () => {
|
|
5
|
-
// if (typeof window === 'undefined') return;
|
|
6
|
-
// const referral_token = localStorage.getItem(REF_KEY) ?? null;
|
|
7
|
-
// const { data: data_1 } = await api.public.loginPublicWebLoginPost({
|
|
8
|
-
// referral_token,
|
|
9
|
-
// });
|
|
10
|
-
// if (referral_token) localStorage.removeItem(REF_KEY);
|
|
11
|
-
// return data_1;
|
|
12
|
-
// };
|