@devtable/dashboard 10.36.0 → 10.37.0
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/dist/api-caller/request.d.ts +30 -9
- package/dist/dashboard.es.js +4136 -4107
- package/dist/dashboard.umd.js +68 -68
- package/dist/index.d.ts +2 -0
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,45 @@
|
|
|
1
|
-
import { Method } from 'axios';
|
|
1
|
+
import { AxiosRequestConfig, Method } from 'axios';
|
|
2
2
|
import { DataSourceType } from '~/model';
|
|
3
3
|
import { AnyObject, IDashboardConfig } from '..';
|
|
4
|
-
declare type TQueryPayload = {
|
|
4
|
+
export declare type TQueryPayload = {
|
|
5
5
|
type: DataSourceType;
|
|
6
6
|
key: string;
|
|
7
7
|
query: string;
|
|
8
8
|
env?: AnyObject;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export interface IAPIClientRequestOptions {
|
|
11
|
+
string?: boolean;
|
|
12
|
+
params?: AnyObject;
|
|
13
|
+
headers?: AnyObject;
|
|
14
|
+
}
|
|
15
|
+
export interface IAPIClient {
|
|
16
|
+
getRequest: <T = $TSFixMe>(method: Method, signal?: AbortSignal) => (url: string, data: AnyObject, options?: IAPIClientRequestOptions) => Promise<T>;
|
|
17
|
+
query: <T = $TSFixMe>(signal?: AbortSignal) => (data: TQueryPayload, options?: AnyObject) => Promise<T>;
|
|
18
|
+
}
|
|
19
|
+
export declare class DefaultApiClient implements IAPIClient {
|
|
11
20
|
baseURL: string;
|
|
12
21
|
app_id: string;
|
|
13
22
|
app_secret: string;
|
|
14
|
-
|
|
23
|
+
makeQueryENV: (() => AnyObject) | null;
|
|
24
|
+
constructor();
|
|
25
|
+
getAuthentication(params: Record<string, unknown>): {
|
|
15
26
|
app_id: string;
|
|
16
27
|
nonce_str: string;
|
|
17
28
|
sign: string;
|
|
18
29
|
} | undefined;
|
|
19
|
-
getRequest(method: Method, signal?: AbortSignal
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
getRequest(method: Method, signal?: AbortSignal): (url: string, data: AnyObject, options?: IAPIClientRequestOptions) => Promise<any>;
|
|
31
|
+
buildAxiosConfig(method: Method, url: string, data: AnyObject, options: IAPIClientRequestOptions, headers: AnyObject, signal: AbortSignal | undefined): AxiosRequestConfig<any>;
|
|
32
|
+
buildHeader(options: IAPIClientRequestOptions): AnyObject;
|
|
33
|
+
query(signal?: AbortSignal): (data: TQueryPayload, options?: AnyObject) => Promise<any>;
|
|
34
|
+
}
|
|
23
35
|
export declare function configureAPIClient(config: IDashboardConfig): void;
|
|
24
|
-
export {
|
|
36
|
+
export declare class FacadeApiClient implements IAPIClient {
|
|
37
|
+
implementation: IAPIClient;
|
|
38
|
+
getRequest<T>(method: Method, signal?: AbortSignal): (url: string, data: AnyObject, options?: IAPIClientRequestOptions) => Promise<T>;
|
|
39
|
+
query<T>(signal?: AbortSignal): (data: TQueryPayload, options?: AnyObject) => Promise<T>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @example facadeApiClient.implementation = new MyAPIClient();
|
|
43
|
+
*/
|
|
44
|
+
export declare const facadeApiClient: FacadeApiClient;
|
|
45
|
+
export declare const APIClient: IAPIClient;
|