@databrainhq/plugin 0.14.21 → 0.14.23

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.
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { FloatingDropDownOption, OnChangeAliasParams, OnChangeHelperFunctionParams, SelectedColumn } from '@/types';
3
+ export type AutoCompleteDropdownProps = {
4
+ setSelectedOptions: React.Dispatch<React.SetStateAction<SelectedColumn[]>>;
5
+ selectedOption: SelectedColumn[];
6
+ options: SelectedColumn[];
7
+ label?: string;
8
+ isDisabled?: boolean;
9
+ placeholder?: string;
10
+ functionOptions?: (col?: SelectedColumn | undefined, colDatatype?: string | undefined) => FloatingDropDownOption[];
11
+ onChangeHelperFunction?: ({ column, helperFunction, functionConfiguration, }: OnChangeHelperFunctionParams) => void;
12
+ onChangeAlias: ({ alias, column }: OnChangeAliasParams) => void;
13
+ };
14
+ export declare const AutoCompleteDropdown: ({ label, selectedOption, setSelectedOptions, options, isDisabled, placeholder, functionOptions, onChangeHelperFunction, onChangeAlias, }: AutoCompleteDropdownProps) => React.JSX.Element;
@@ -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;
@@ -51,3 +51,4 @@ export * from './ChartTypePanel';
51
51
  export * from './Badge';
52
52
  export * from './DraggableItem';
53
53
  export * from './SkeletonLoader';
54
+ export * from './Flex';
@@ -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 DATASET_TIME_HELPER_FUNCTIONS: {
75
- value: string;
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;
@@ -84,6 +82,8 @@ export declare const DATASET_NUMBER_HELPER_FUNCTIONS: {
84
82
  label: string;
85
83
  }[];
86
84
  export declare const aggregateStrings: string[];
85
+ export declare const FUNCTIONS_SYNONYMNS: Record<string, string[]>;
86
+ export declare const SORT_SYNONYMNS: Record<string, string[]>;
87
87
  export declare const DATASET_OTHER_HELPER_FUNCTIONS: {
88
88
  value: string;
89
89
  label: string;
@@ -92,3 +92,11 @@ export declare const DATASET_NUM_HELPER_FUNCTIONS: {
92
92
  value: string;
93
93
  label: string;
94
94
  }[];
95
+ export declare const REDSHIFT = "redshift";
96
+ export declare const SNOWFLAKE = "snowflake";
97
+ export declare const BIGQUERY = "bigquery";
98
+ export declare const MYSQL = "mysql";
99
+ export declare const POSTGRES = "postgres";
100
+ export declare const MONGODB = "mongodb";
101
+ export declare const DATABRICKS = "databricks";
102
+ export declare const CLICKHOUSE = "clickhouse";
@@ -38,6 +38,7 @@ export declare const useExternalMetric: ({ onSuccess, companyIntegrationId, sele
38
38
  token: string;
39
39
  }, unknown>;
40
40
  token: string | undefined;
41
+ workspaceId: any;
41
42
  dashboardOptions: {
42
43
  value: any;
43
44
  label: any;
@@ -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, OnChangeAliasParams, OnChangeHelperFunctionParams, SelectedColumn, SetChartFieldParams, 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("../types/queryTypes").UsePreviewTableMutationInputType;
27
+ data: import("@/types/queryTypes").UsePreviewTableMutationInputType;
28
28
  token: string;
29
29
  }, unknown>;
30
30
  token: string | undefined;
@@ -33,5 +33,22 @@ 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[];
48
+ setChartFields: ({ chartType, chartDimensions, chartMetrics, chartAggregateColumns, }: SetChartFieldParams) => void;
49
+ onSubmitSearch: () => void;
50
+ onChangeHelperFunction: ({ column, helperFunction, functionConfiguration, }: OnChangeHelperFunctionParams) => void;
51
+ onChangeAlias: ({ alias, column }: OnChangeAliasParams) => void;
52
+ chartOptions: FloatingDropDownOption[];
36
53
  };
37
54
  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>;
@@ -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 { RlsCondition, FloatingDropDownOption, ChartSettingsType } from './app';
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,61 @@ 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 SetChartFieldParams = {
83
+ chartMetrics?: string[];
84
+ chartDimensions?: string[];
85
+ chartAggregateColumns?: string[];
86
+ chartType?: ChartSettingsType['chartType'];
87
+ };
88
+ export type SelectedColumn = {
89
+ name: string;
90
+ datatype: string;
91
+ table: TableObjectType;
92
+ alias: string;
93
+ parentAlias: string;
94
+ helperFunction?: string;
95
+ type: 'DEFAULT' | 'HELPER_FUNCTION' | 'CUSTOM' | 'PYTHON';
96
+ index: number;
97
+ configType: 'DIMENSION' | 'AGGREGATE';
98
+ dropType: 'METRIC' | 'DIMENSION';
99
+ sql: string;
100
+ draggableItemData: DraggableMetricItemData;
101
+ functionConfiguration?: {
102
+ dateFormat?: string;
103
+ };
104
+ synonyms?: string[];
105
+ };
50
106
  export type DatasetSettings = {
51
107
  timeColumn: FloatingDropDownOption;
52
108
  timeGrainValue: string;
@@ -233,6 +289,7 @@ export type Table = {
233
289
  schema: string;
234
290
  id: string;
235
291
  joins: Join[];
292
+ type?: 'custom' | 'default';
236
293
  };
237
294
  export type Aggregate = {
238
295
  method: string;
@@ -251,6 +308,9 @@ export type Dimension = {
251
308
  dataType: string;
252
309
  helperFunction?: string;
253
310
  labelType?: string;
311
+ functionConfiguration?: {
312
+ dateFormat?: string;
313
+ };
254
314
  };
255
315
  export type Filter = {
256
316
  method: string;
@@ -290,6 +350,7 @@ export type Forcast = {
290
350
  };
291
351
  growth: string;
292
352
  };
353
+ export type TableType = string;
293
354
  export type GroupByColumn = {
294
355
  columnName: string;
295
356
  alias: string;
@@ -298,8 +359,10 @@ export type GroupByColumn = {
298
359
  helperFunction?: string;
299
360
  type: 'custom' | 'default';
300
361
  dataType: string;
362
+ functionConfiguration?: {
363
+ dateFormat?: string;
364
+ };
301
365
  };
302
- export type TableType = string;
303
366
  export type DatasetMetricCreationConfiguration = {
304
367
  table: Table;
305
368
  aggregates: Aggregate[];
@@ -311,6 +374,19 @@ export type DatasetMetricCreationConfiguration = {
311
374
  forecast?: Forcast;
312
375
  rlsValues?: Record<string, string | number>;
313
376
  groupByColumnList?: GroupByColumn[];
377
+ rlsConditions?: RlsCondition[];
378
+ isAllClient?: boolean;
379
+ };
380
+ export type OnChangeHelperFunctionParams = {
381
+ column: SelectedColumn;
382
+ helperFunction: FloatingDropDownOption;
383
+ functionConfiguration?: {
384
+ dateFormat?: string;
385
+ };
386
+ };
387
+ export type OnChangeAliasParams = {
388
+ column: SelectedColumn;
389
+ alias: string;
314
390
  };
315
391
  export type ConfigType = {
316
392
  clientId: 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
+ };