@databrainhq/plugin 0.14.18 → 0.14.19
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/components/GenerateMetric/index.d.ts +3 -0
- package/dist/consts/api.d.ts +2 -0
- package/dist/hooks/useGenerateMetric.d.ts +37 -0
- package/dist/queries/externalDashboard.mutation.d.ts +7 -1
- package/dist/types/metricCreate.d.ts +20 -0
- package/dist/types/queryTypes.d.ts +3 -0
- package/dist/webcomponents.es.js +25089 -24701
- package/dist/webcomponents.umd.js +163 -163
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EmbeddedMetricCreationProps } from '@/types';
|
|
3
|
+
export declare const GenerateMetric: ({ clientId, companyId, externalDashboardId, isLiveMode, isShowMetricCreateModal, setShowMetricCreateModal, userProvidedDashboardId, workspaceId, chartColors, metric, metricData, variant, }: EmbeddedMetricCreationProps) => React.JSX.Element;
|
package/dist/consts/api.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare const DASHBOARD_DATASET_METRIC_PATH: string;
|
|
|
26
26
|
export declare const DASHBOARD_DATASET_METRIC_MUTATION = "datasetMetricCreation";
|
|
27
27
|
export declare const DASHBOARD_PREVIEW_TABLE_PATH: string;
|
|
28
28
|
export declare const DASHBOARD_PREVIEW_TABLE_MUTATION = "previewTable";
|
|
29
|
+
export declare const DASHBOARD_GEN_METRIC_DATA_PATH: string;
|
|
30
|
+
export declare const DASHBOARD_GEN_METRIC_DATA_MUTATION = "/generatetMetricData";
|
|
29
31
|
export declare const METRIC_QUERY_PATH: string;
|
|
30
32
|
export declare const METRIC_QUERY_QUERY = "query";
|
|
31
33
|
export declare const METRIC_RAW_DOWNLOAD_SETTINGS_PATH: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import EChartsReact from 'echarts-for-react';
|
|
4
|
+
import { ColumnSizingState } from '@tanstack/react-table';
|
|
5
|
+
import { ChartSettingsType, ConfigType, GenerateMetricState } from '@/types';
|
|
6
|
+
declare const useGenerateMetric: (config: ConfigType) => {
|
|
7
|
+
isDisableSaveBtn: boolean;
|
|
8
|
+
setChartSettings: import("react").Dispatch<import("react").SetStateAction<ChartSettingsType>>;
|
|
9
|
+
setShowSaveMetricModal: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
10
|
+
isShowSaveMetricModal: boolean;
|
|
11
|
+
register: import("react-hook-form").UseFormRegister<FieldValues>;
|
|
12
|
+
errors: import("react-hook-form").FieldErrors<FieldValues>;
|
|
13
|
+
onSubmitQuery: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
|
|
14
|
+
generateMetricState: GenerateMetricState;
|
|
15
|
+
chartTabType: "CHART" | "ERROR" | "LOADING" | "INIT";
|
|
16
|
+
chartSettings: ChartSettingsType;
|
|
17
|
+
chartRef: import("react").RefObject<EChartsReact>;
|
|
18
|
+
onColumnSizingChange: (columnSizing: ColumnSizingState) => void;
|
|
19
|
+
watch: import("react-hook-form").UseFormWatch<FieldValues>;
|
|
20
|
+
createExternalMetric: (data: FieldValues) => void;
|
|
21
|
+
saveError: string;
|
|
22
|
+
updateExternalMetric: (data: FieldValues) => void;
|
|
23
|
+
clientSubsetData: any;
|
|
24
|
+
previewTable: import("react-query").UseMutateFunction<{
|
|
25
|
+
data: unknown;
|
|
26
|
+
}, unknown, {
|
|
27
|
+
data: import("../types/queryTypes").UsePreviewTableMutationInputType;
|
|
28
|
+
token: string;
|
|
29
|
+
}, unknown>;
|
|
30
|
+
token: string | undefined;
|
|
31
|
+
dashboardOptions: {
|
|
32
|
+
value: any;
|
|
33
|
+
label: any;
|
|
34
|
+
}[];
|
|
35
|
+
isCreatingMetric: boolean;
|
|
36
|
+
};
|
|
37
|
+
export default useGenerateMetric;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UseCreateMetricMutationInputType, UseDatatsetMetricMutationInputType, UseDeleteDashboardScheduleReportMutationInputType, UseGenerateMetricMutationInputType, UsePreviewTableMutationInputType, UseSaveDashboardLayoutMutationInputType, UseSaveDashboardScheduleReportMutationInputType, UseUpdateAdminMetricMutationInputType, UseUpdateMetricMutationInputType } from '@/types/queryTypes';
|
|
1
|
+
import { UseCreateMetricMutationInputType, UseDatatsetMetricMutationInputType, UseDeleteDashboardScheduleReportMutationInputType, UseGenerateMetricDataMutationInputType, UseGenerateMetricMutationInputType, UsePreviewTableMutationInputType, UseSaveDashboardLayoutMutationInputType, UseSaveDashboardScheduleReportMutationInputType, UseUpdateAdminMetricMutationInputType, UseUpdateMetricMutationInputType } from '@/types/queryTypes';
|
|
2
2
|
export declare const useSaveDashboardLayoutMutation: () => import("react-query").UseMutationResult<{
|
|
3
3
|
data: unknown;
|
|
4
4
|
}, unknown, UseSaveDashboardLayoutMutationInputType, unknown>;
|
|
@@ -47,3 +47,9 @@ export declare const usePreviewTableMutation: () => import("react-query").UseMut
|
|
|
47
47
|
data: UsePreviewTableMutationInputType;
|
|
48
48
|
token: string;
|
|
49
49
|
}, unknown>;
|
|
50
|
+
export declare const useGenerateMetricDataMutation: () => import("react-query").UseMutationResult<{
|
|
51
|
+
data: unknown;
|
|
52
|
+
}, unknown, {
|
|
53
|
+
data: UseGenerateMetricDataMutationInputType;
|
|
54
|
+
token: string;
|
|
55
|
+
}, unknown>;
|
|
@@ -324,6 +324,26 @@ export type ConfigType = {
|
|
|
324
324
|
metric: ExternalMetrics | undefined;
|
|
325
325
|
metricData: Record<string, any>[] | undefined;
|
|
326
326
|
};
|
|
327
|
+
export type GenerateConfigType = {
|
|
328
|
+
clientId: string;
|
|
329
|
+
companyId: string;
|
|
330
|
+
isLiveMode: boolean;
|
|
331
|
+
externalDashboardId: string;
|
|
332
|
+
userProvidedDashboardId: string;
|
|
333
|
+
chartColors: string[] | undefined;
|
|
334
|
+
isShowMetricCreateModal: boolean;
|
|
335
|
+
setShowMetricCreateModal: React.Dispatch<React.SetStateAction<boolean>>;
|
|
336
|
+
metric: ExternalMetrics | undefined;
|
|
337
|
+
metricData: Record<string, any>[] | undefined;
|
|
338
|
+
workspaceId: string;
|
|
339
|
+
variant: 'static' | 'floating' | undefined;
|
|
340
|
+
};
|
|
341
|
+
export type GenerateMetricState = {
|
|
342
|
+
data: Record<string, any>[];
|
|
343
|
+
error: string;
|
|
344
|
+
query: string;
|
|
345
|
+
isLoading: boolean;
|
|
346
|
+
};
|
|
327
347
|
export type DatasetConfig = {
|
|
328
348
|
clientSubsetData: any;
|
|
329
349
|
clientId: string;
|
|
@@ -166,6 +166,9 @@ export type UsePreviewTableMutationInputType = {
|
|
|
166
166
|
integrationId?: string;
|
|
167
167
|
integrationName?: string;
|
|
168
168
|
};
|
|
169
|
+
export type UseGenerateMetricDataMutationInputType = {
|
|
170
|
+
questionString: string;
|
|
171
|
+
};
|
|
169
172
|
export type UseGenerateMetricMutationInputType = {
|
|
170
173
|
userInputs?: any;
|
|
171
174
|
integrationName?: string;
|