@databrainhq/plugin 0.14.21 → 0.14.22
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/Flex/index.d.ts +13 -0
- package/dist/components/MetricChart/RawCsvDownloadButton.d.ts +2 -1
- package/dist/components/MetricList/components/FullScreenView/DownloadButton.d.ts +2 -1
- package/dist/components/MetricList/components/FullScreenView/index.d.ts +6 -1
- package/dist/components/MetricList/components/MetricCards/MetricCard.d.ts +6 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/consts/api.d.ts +2 -0
- package/dist/consts/metricOptions.d.ts +3 -5
- package/dist/hooks/useGenerateMetric.d.ts +14 -2
- package/dist/queries/externalDashboard.mutation.d.ts +7 -1
- package/dist/types/app.d.ts +2 -0
- package/dist/types/metricCreate.d.ts +51 -1
- package/dist/types/queryTypes.d.ts +23 -0
- package/dist/webcomponents.es.js +24248 -23995
- package/dist/webcomponents.umd.js +169 -168
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export declare const Flex: React.MemoExoticComponent<({ direction, justify, width, maxWidth, height, className, alignItems, flexWrap, children, }: {
|
|
4
|
+
direction?: "row" | "col" | undefined;
|
|
5
|
+
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | undefined;
|
|
6
|
+
width?: string | undefined;
|
|
7
|
+
maxWidth?: string | undefined;
|
|
8
|
+
height?: string | undefined;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
alignItems?: "center" | "start" | "end" | "baseline" | "stretch" | null | undefined;
|
|
11
|
+
flexWrap?: "reverse" | "wrap" | "nowrap" | null | undefined;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}) => React.JSX.Element>;
|
|
@@ -6,6 +6,7 @@ type RawCsvDownloadButtonProps = {
|
|
|
6
6
|
query: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
+
updateDownloadProgress: (isEnable: boolean) => void;
|
|
9
10
|
};
|
|
10
|
-
export declare const RawCsvDownloadButton: ({ fileName, companyIntegrationId, integrationName, query, className, children, }: RawCsvDownloadButtonProps) => React.JSX.Element;
|
|
11
|
+
export declare const RawCsvDownloadButton: ({ fileName, companyIntegrationId, integrationName, query, className, children, updateDownloadProgress, }: RawCsvDownloadButtonProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -11,5 +11,6 @@ export type DownloadButtonProps = {
|
|
|
11
11
|
companyIntegrationId: string;
|
|
12
12
|
integrationName: string;
|
|
13
13
|
queryWithNoFilter: string;
|
|
14
|
+
updateDownloadProgress: (isEnable: boolean) => void;
|
|
14
15
|
};
|
|
15
|
-
export declare const DownloadButton: ({ data, chartRef, metricName, onRawCsvData, chartOptions, integrationName, companyIntegrationId, query, queryWithNoFilter, }: DownloadButtonProps) => React.JSX.Element;
|
|
16
|
+
export declare const DownloadButton: ({ data, chartRef, metricName, onRawCsvData, chartOptions, integrationName, companyIntegrationId, query, queryWithNoFilter, updateDownloadProgress, }: DownloadButtonProps) => React.JSX.Element;
|
|
@@ -26,5 +26,10 @@ export type FullScreenViewProps = {
|
|
|
26
26
|
isHideChartSettings?: boolean;
|
|
27
27
|
isHideTablePreview?: boolean;
|
|
28
28
|
isAllClient?: boolean;
|
|
29
|
+
onDownload: (id: string, isEnable: boolean) => void;
|
|
30
|
+
downloadMetrics: {
|
|
31
|
+
id: string;
|
|
32
|
+
isInProgress: boolean;
|
|
33
|
+
}[];
|
|
29
34
|
};
|
|
30
|
-
export declare const FullScreenView: ({ metric, colors, rlsFilters, metricFilterOptions, onMinimize, onArchive, clientId, tenancyLevel, companyId, externalDashboardId, userProvidedDashboardId, isAllowedToUpdateMetrics, sharingSettingsId, appFilters, isInternalApp, isShowChartConfigTab, isHideChartSettings, isHideTablePreview, isAllClient, globalFilters, }: FullScreenViewProps) => React.JSX.Element;
|
|
35
|
+
export declare const FullScreenView: ({ metric, colors, rlsFilters, metricFilterOptions, onMinimize, onArchive, clientId, tenancyLevel, companyId, externalDashboardId, userProvidedDashboardId, isAllowedToUpdateMetrics, sharingSettingsId, appFilters, isInternalApp, isShowChartConfigTab, isHideChartSettings, isHideTablePreview, isAllClient, globalFilters, onDownload, downloadMetrics, }: FullScreenViewProps) => React.JSX.Element;
|
|
@@ -39,5 +39,10 @@ export type MetricCardProps = {
|
|
|
39
39
|
radius: string;
|
|
40
40
|
};
|
|
41
41
|
optionsIcon?: 'kebab-menu-vertical' | 'download';
|
|
42
|
+
downloadMetrics: {
|
|
43
|
+
id: string;
|
|
44
|
+
isInProgress: boolean;
|
|
45
|
+
}[];
|
|
46
|
+
onDownload: (id: string, isEnable: boolean) => void;
|
|
42
47
|
};
|
|
43
|
-
export declare const MetricCard: ({ globalFilters, metricItem, onMaximize, client, colors, param, companyTenancyType, renderHeaderName, isDisableCardClick, onArchive, chartRendererType, isDisableMorePopup, appFilters, isInternalApp, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, onDownloadRawCsv, enableDownloadCsv, enableMultiMetricFilters, disableActions, metricFilterPosition, isAllClient, dropdownTheme, optionsIcon, }: MetricCardProps) => React.JSX.Element;
|
|
48
|
+
export declare const MetricCard: ({ globalFilters, metricItem, onMaximize, client, colors, param, companyTenancyType, renderHeaderName, isDisableCardClick, onArchive, chartRendererType, isDisableMorePopup, appFilters, isInternalApp, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, onDownloadRawCsv, enableDownloadCsv, enableMultiMetricFilters, disableActions, metricFilterPosition, isAllClient, dropdownTheme, optionsIcon, downloadMetrics, onDownload, }: MetricCardProps) => React.JSX.Element;
|
package/dist/consts/api.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export declare const DASHBOARD_PREVIEW_TABLE_PATH: string;
|
|
|
28
28
|
export declare const DASHBOARD_PREVIEW_TABLE_MUTATION = "previewTable";
|
|
29
29
|
export declare const DASHBOARD_GEN_METRIC_DATA_PATH: string;
|
|
30
30
|
export declare const DASHBOARD_GEN_METRIC_DATA_MUTATION = "/generatetMetricData";
|
|
31
|
+
export declare const DASHBOARD_CHAT_RESPONSE_PATH: string;
|
|
32
|
+
export declare const DASHBOARD_CHAT_RESPONSE_MUTATION = "getOpenaiChatResponse";
|
|
31
33
|
export declare const METRIC_QUERY_PATH: string;
|
|
32
34
|
export declare const METRIC_QUERY_QUERY = "query";
|
|
33
35
|
export declare const METRIC_RAW_DOWNLOAD_SETTINGS_PATH: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartSettingsType, DatasetMetricCreationConfiguration } from '@/types';
|
|
1
|
+
import { ChartSettingsType, DatasetMetricCreationConfiguration, FloatingDropDownOption } from '@/types';
|
|
2
2
|
export declare const RowLimitList: {
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
@@ -71,10 +71,8 @@ export declare const TIME_OPERATOR_LIST: {
|
|
|
71
71
|
value: string;
|
|
72
72
|
label: string;
|
|
73
73
|
}[];
|
|
74
|
-
export declare const
|
|
75
|
-
|
|
76
|
-
label: string;
|
|
77
|
-
}[];
|
|
74
|
+
export declare const DBN_SQL_TABLE = "dbn_sql_table";
|
|
75
|
+
export declare const DATASET_TIME_HELPER_FUNCTIONS: FloatingDropDownOption[];
|
|
78
76
|
export declare const DATASET_STRING_HELPER_FUNCTIONS: {
|
|
79
77
|
value: string;
|
|
80
78
|
label: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
3
|
import EChartsReact from 'echarts-for-react';
|
|
4
4
|
import { ColumnSizingState } from '@tanstack/react-table';
|
|
5
|
-
import { ChartSettingsType, ConfigType, GenerateMetricState } from '@/types';
|
|
5
|
+
import { ChartSettingsType, ConfigType, FloatingDropDownOption, GenerateMetricState, SelectedColumn, TableObjectType } from '@/types';
|
|
6
6
|
declare const useGenerateMetric: (config: ConfigType) => {
|
|
7
7
|
isDisableSaveBtn: boolean;
|
|
8
8
|
setChartSettings: import("react").Dispatch<import("react").SetStateAction<ChartSettingsType>>;
|
|
@@ -24,7 +24,7 @@ declare const useGenerateMetric: (config: ConfigType) => {
|
|
|
24
24
|
previewTable: import("react-query").UseMutateFunction<{
|
|
25
25
|
data: unknown;
|
|
26
26
|
}, unknown, {
|
|
27
|
-
data: import("
|
|
27
|
+
data: import("@/types/queryTypes").UsePreviewTableMutationInputType;
|
|
28
28
|
token: string;
|
|
29
29
|
}, unknown>;
|
|
30
30
|
token: string | undefined;
|
|
@@ -33,5 +33,17 @@ declare const useGenerateMetric: (config: ConfigType) => {
|
|
|
33
33
|
label: any;
|
|
34
34
|
}[];
|
|
35
35
|
isCreatingMetric: boolean;
|
|
36
|
+
tableList: TableObjectType[];
|
|
37
|
+
selectedMainTable: TableObjectType | undefined;
|
|
38
|
+
setSelectedMainTable: import("react").Dispatch<import("react").SetStateAction<TableObjectType | undefined>>;
|
|
39
|
+
aiResponseState: {
|
|
40
|
+
isLoading: boolean;
|
|
41
|
+
error: string;
|
|
42
|
+
};
|
|
43
|
+
onAiQuery: () => void;
|
|
44
|
+
autoCompleteDropdownOptions: SelectedColumn[];
|
|
45
|
+
selectedColumns: SelectedColumn[];
|
|
46
|
+
setSelectedColumns: import("react").Dispatch<import("react").SetStateAction<SelectedColumn[]>>;
|
|
47
|
+
functionOptions: (col?: SelectedColumn, colDatatype?: string) => FloatingDropDownOption[];
|
|
36
48
|
};
|
|
37
49
|
export default useGenerateMetric;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UseCreateMetricMutationInputType, UseDatatsetMetricMutationInputType, UseDeleteDashboardScheduleReportMutationInputType, UseGenerateMetricDataMutationInputType, UseGenerateMetricMutationInputType, UsePreviewTableMutationInputType, UseSaveDashboardLayoutMutationInputType, UseSaveDashboardScheduleReportMutationInputType, UseUpdateAdminMetricMutationInputType, UseUpdateMetricMutationInputType } from '@/types/queryTypes';
|
|
1
|
+
import { UseChatApiResponseType, 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>;
|
|
@@ -53,3 +53,9 @@ export declare const useGenerateMetricDataMutation: () => import("react-query").
|
|
|
53
53
|
data: UseGenerateMetricDataMutationInputType;
|
|
54
54
|
token: string;
|
|
55
55
|
}, unknown>;
|
|
56
|
+
export declare const useChatApiResponse: () => import("react-query").UseMutationResult<{
|
|
57
|
+
data: unknown;
|
|
58
|
+
}, unknown, {
|
|
59
|
+
data: UseChatApiResponseType;
|
|
60
|
+
token: string;
|
|
61
|
+
}, unknown>;
|
package/dist/types/app.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { ColumnSizingState } from '@tanstack/react-table';
|
|
3
|
+
import { TableObjectType } from './metricCreate';
|
|
3
4
|
import { CHART_TYPES, ICONS_LIST } from '@/consts';
|
|
4
5
|
export type ChildrenProps = {
|
|
5
6
|
children: ReactNode;
|
|
@@ -375,6 +376,7 @@ export type FloatingDropDownOption = {
|
|
|
375
376
|
labelType?: string;
|
|
376
377
|
aggregate?: string;
|
|
377
378
|
alias?: string;
|
|
379
|
+
table?: TableObjectType;
|
|
378
380
|
};
|
|
379
381
|
export type FilterType = {
|
|
380
382
|
tableName: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { RlsCondition, FloatingDropDownOption, ChartSettingsType, TableColumn } from '@/types';
|
|
3
4
|
import { ExternalMetrics } from '@/types/queryTypes';
|
|
4
5
|
type ColumnData = {
|
|
5
6
|
name: string;
|
|
@@ -47,6 +48,55 @@ export type MetricsValue = {
|
|
|
47
48
|
value: string;
|
|
48
49
|
as: string;
|
|
49
50
|
};
|
|
51
|
+
export type CustomTableObject = {
|
|
52
|
+
tableName: string;
|
|
53
|
+
columns: {
|
|
54
|
+
name: string;
|
|
55
|
+
as: string;
|
|
56
|
+
datatype: string;
|
|
57
|
+
}[];
|
|
58
|
+
clientColumn: string;
|
|
59
|
+
};
|
|
60
|
+
export type TableObjectType = {
|
|
61
|
+
id: string;
|
|
62
|
+
columns: string[];
|
|
63
|
+
companyId: string;
|
|
64
|
+
tableName: string;
|
|
65
|
+
schemaName: string;
|
|
66
|
+
recentUpdatedAt: number;
|
|
67
|
+
columnsWithDataType: TableColumn[];
|
|
68
|
+
type?: string;
|
|
69
|
+
alias?: string;
|
|
70
|
+
sql?: string;
|
|
71
|
+
clientColumn?: string;
|
|
72
|
+
};
|
|
73
|
+
export type AiQueryType = {
|
|
74
|
+
prompt: string;
|
|
75
|
+
values: FieldValues;
|
|
76
|
+
onSuccess: () => void;
|
|
77
|
+
};
|
|
78
|
+
export type DraggableMetricItemData = {
|
|
79
|
+
table: TableObjectType;
|
|
80
|
+
column: TableColumn;
|
|
81
|
+
};
|
|
82
|
+
export type SelectedColumn = {
|
|
83
|
+
name: string;
|
|
84
|
+
datatype: string;
|
|
85
|
+
table: TableObjectType;
|
|
86
|
+
alias: string;
|
|
87
|
+
parentAlias: string;
|
|
88
|
+
helperFunction?: string;
|
|
89
|
+
type: 'DEFAULT' | 'HELPER_FUNCTION' | 'CUSTOM' | 'PYTHON';
|
|
90
|
+
index: number;
|
|
91
|
+
configType: 'DIMENSION' | 'AGGREGATE';
|
|
92
|
+
dropType: 'METRIC' | 'DIMENSION';
|
|
93
|
+
sql: string;
|
|
94
|
+
draggableItemData: DraggableMetricItemData;
|
|
95
|
+
functionConfiguration?: {
|
|
96
|
+
dateFormat?: string;
|
|
97
|
+
};
|
|
98
|
+
synonyms?: string[];
|
|
99
|
+
};
|
|
50
100
|
export type DatasetSettings = {
|
|
51
101
|
timeColumn: FloatingDropDownOption;
|
|
52
102
|
timeGrainValue: string;
|
|
@@ -252,3 +252,26 @@ export type ExternalMetrics = {
|
|
|
252
252
|
timeGrain?: string;
|
|
253
253
|
updatedAt: string;
|
|
254
254
|
};
|
|
255
|
+
export type ChatCompletionRequestMessage = {
|
|
256
|
+
/**
|
|
257
|
+
* The role of the author of this message.
|
|
258
|
+
* @type {string}
|
|
259
|
+
* @memberof ChatCompletionRequestMessage
|
|
260
|
+
*/
|
|
261
|
+
role: 'system' | 'user' | 'assistant';
|
|
262
|
+
/**
|
|
263
|
+
* The contents of the message
|
|
264
|
+
* @type {string}
|
|
265
|
+
* @memberof ChatCompletionRequestMessage
|
|
266
|
+
*/
|
|
267
|
+
content: string;
|
|
268
|
+
/**
|
|
269
|
+
* The name of the user in a multi-user chat
|
|
270
|
+
* @type {string}
|
|
271
|
+
* @memberof ChatCompletionRequestMessage
|
|
272
|
+
*/
|
|
273
|
+
name?: string;
|
|
274
|
+
};
|
|
275
|
+
export type UseChatApiResponseType = {
|
|
276
|
+
messages: ChatCompletionRequestMessage[];
|
|
277
|
+
};
|