ag-common 0.0.111 → 0.0.112
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AxiosWrapper } from './jwt';
|
|
2
2
|
import { ICallOpenApi } from './types';
|
|
3
|
-
export declare const callOpenApi: <T, TDefaultApi>({ func, apiUrl, overrideAuth, refreshToken, logout, newDefaultApi, }: ICallOpenApi<T, TDefaultApi>) => Promise<AxiosWrapper<T
|
|
3
|
+
export declare const callOpenApi: <T, TDefaultApi>({ func, apiUrl, overrideAuth, refreshToken, logout, newDefaultApi, }: ICallOpenApi<T, TDefaultApi>) => Promise<AxiosWrapper<T>>;
|
|
@@ -17,7 +17,7 @@ const callOpenApi = ({ func, apiUrl, overrideAuth, refreshToken, logout, newDefa
|
|
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
19
|
let error;
|
|
20
|
-
let data;
|
|
20
|
+
let data = undefined;
|
|
21
21
|
const config = {
|
|
22
22
|
basePath: apiUrl,
|
|
23
23
|
baseOptions: { headers: { authorization: '' } },
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AxiosResponse } from 'axios';
|
|
2
1
|
import { CacheItems } from './routes';
|
|
3
|
-
import { AxiosWrapper
|
|
4
|
-
import {
|
|
2
|
+
import { AxiosWrapper } from './jwt';
|
|
3
|
+
import { ICallOpenApi } from './types';
|
|
5
4
|
export declare const deleteMutexData: (key: string) => void;
|
|
6
5
|
export declare const setMutexData: ({ key, data, ttlSeconds, }: {
|
|
7
6
|
key: string;
|
|
@@ -14,16 +13,9 @@ export declare const getMutexData: <T>(key: string) => AxiosWrapper<T>;
|
|
|
14
13
|
* @param overrideAuth - auth automatically picked up from id_token cookie, can override value here, but not required
|
|
15
14
|
* @returns
|
|
16
15
|
*/
|
|
17
|
-
export declare const useOpenApiStore: <T, TDefaultApi>(p: {
|
|
16
|
+
export declare const useOpenApiStore: <T, TDefaultApi>(p: ICallOpenApi<T, TDefaultApi> & {
|
|
18
17
|
ttlSeconds?: number | undefined;
|
|
19
|
-
func: (f: TDefaultApi) => Promise<AxiosResponse<T, any>>;
|
|
20
18
|
cacheKey: string;
|
|
21
|
-
logout: () => void;
|
|
22
|
-
refreshToken: () => Promise<User | undefined>;
|
|
23
|
-
disabled?: boolean | undefined;
|
|
24
|
-
apiUrl: string;
|
|
25
|
-
newDefaultApi: (config: any) => TDefaultApi;
|
|
26
|
-
overrideAuth?: OverrideAuth | undefined;
|
|
27
19
|
/**
|
|
28
20
|
* will shortcut and return the appropriate axioswrapper data if cachekey is found
|
|
29
21
|
*/
|