@databrainhq/plugin 0.14.55 → 0.14.56

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.
@@ -12,4 +12,6 @@ export declare const logos: {
12
12
  databricks: string;
13
13
  clickhouse: string;
14
14
  mssql: string;
15
+ duckdb: string;
16
+ awss3: string;
15
17
  };
@@ -40,5 +40,6 @@ export type ExternalMetricListProps = {
40
40
  radius: string;
41
41
  };
42
42
  optionsIcon?: 'kebab-menu-vertical' | 'download';
43
+ token: string;
43
44
  };
44
45
  export declare const ExternalMetricList: React.FC<ExternalMetricListProps>;
@@ -15,6 +15,7 @@ export type FullScreenViewProps = {
15
15
  onMinimize: () => void;
16
16
  onArchive?: (metricId: string) => void;
17
17
  clientId: string;
18
+ encryptedClient?: string;
18
19
  tenancyLevel: string;
19
20
  externalDashboardId: string;
20
21
  userProvidedDashboardId: string;
@@ -31,5 +32,7 @@ export type FullScreenViewProps = {
31
32
  id: string;
32
33
  isInProgress: boolean;
33
34
  }[];
35
+ isFrontendApp: boolean;
36
+ guestToken?: string;
34
37
  };
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;
38
+ 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, isFrontendApp, guestToken, encryptedClient, }: FullScreenViewProps) => React.JSX.Element;
@@ -10,6 +10,7 @@ export type MetricCardProps = {
10
10
  };
11
11
  metricItem: any;
12
12
  client: ClientType['value'];
13
+ encryptedClient?: ClientType['value'];
13
14
  onMaximize?: (metric: ExternalMetrics, rlsFilters?: {
14
15
  param: any;
15
16
  filterValues: Record<string, string>;
@@ -59,5 +60,7 @@ export type MetricCardProps = {
59
60
  label?: string;
60
61
  };
61
62
  };
63
+ isFrontendApp: boolean;
64
+ guestToken?: string;
62
65
  };
63
- 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, appearanceOptions, }: MetricCardProps) => React.JSX.Element;
66
+ 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, appearanceOptions, isFrontendApp, guestToken, encryptedClient, }: MetricCardProps) => React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Aggregate } from '@/types';
2
3
  type DataRow = Record<string, any>;
3
4
  type PivotTableProps = {
4
5
  data: DataRow[];
@@ -10,8 +11,9 @@ type PivotTableProps = {
10
11
  color?: string;
11
12
  isEnabled?: boolean;
12
13
  };
14
+ measures: Aggregate[];
13
15
  };
14
- export declare const PivotTableV2: ({ props: { data, rows, columns, values, headerSettings }, }: {
16
+ export declare const PivotTableV2: ({ props: { data, rows, columns, values, headerSettings, measures }, }: {
15
17
  props: PivotTableProps;
16
18
  }) => React.JSX.Element;
17
19
  export {};
@@ -1,6 +1,7 @@
1
1
  export declare const API_BASE_URL: any;
2
2
  export declare const DASHBOARD_PATH = "/api/v2/dashboard";
3
3
  export declare const METRIC_PATH = "/api/v2/metric";
4
+ export declare const NEW_METRIC_PATH = "/api/v3/metric";
4
5
  export declare const DASHBOARD_DATA_QUERY = "dashboardData";
5
6
  export declare const DASHBOARD_EMBEDDED_METRIC_PATH: string;
6
7
  export declare const DASHBOARD_EMBEDDED_METRIC_QUERY = "embeddedMetric";
@@ -33,6 +34,7 @@ export declare const DASHBOARD_CHAT_RESPONSE_MUTATION = "getOpenaiChatResponse";
33
34
  export declare const DASHBOARD_THEME_PATH: string;
34
35
  export declare const DASHBOARD_THEME_QUERY = "getTheme";
35
36
  export declare const METRIC_QUERY_PATH: string;
37
+ export declare const NEW_METRIC_QUERY_PATH: string;
36
38
  export declare const METRIC_QUERY_QUERY = "query";
37
39
  export declare const METRIC_RAW_DOWNLOAD_SETTINGS_PATH: string;
38
40
  export declare const METRIC_RAW_DOWNLOAD_SETTINGS_QUERY = "rawDownloadSettings";
@@ -47,5 +49,3 @@ export declare const METRIC_MARK_ARCHIVED_MUTATION = "markArchived";
47
49
  export declare const METRIC_EXECUTE_PYTHON_CODE_PATH: string;
48
50
  export declare const METRIC_EXECUTE_PYTHON_CODE_MUTATION = "executePython";
49
51
  export declare const METRIC_DOWNLOAD_RAW_CSV_PATH: string;
50
- export declare const WORLD_MAP_PATH = "../../utils/world.json";
51
- export declare const USA_MAP_PATH = "../../utils/usa.json";
@@ -123,11 +123,12 @@ export declare const REDSHIFT = "redshift";
123
123
  export declare const SNOWFLAKE = "snowflake";
124
124
  export declare const BIGQUERY = "bigquery";
125
125
  export declare const MYSQL = "mysql";
126
+ export declare const MSSQL = "mssql";
126
127
  export declare const POSTGRES = "postgres";
127
128
  export declare const MONGODB = "mongodb";
128
129
  export declare const DATABRICKS = "databricks";
129
130
  export declare const CLICKHOUSE = "clickhouse";
130
- export declare const MSSQL = "mssql";
131
+ export declare const AWSS3 = "awss3";
131
132
  export declare const DOWNLOAD_DATA_OPTIONS: {
132
133
  RAW_DATA: string;
133
134
  DOWNLOAD_WITHOUT_FILTERS: string;
@@ -141,3 +142,4 @@ export declare const CAST_COLUMN_AS: {
141
142
  label: string;
142
143
  icon: string;
143
144
  }[];
145
+ export declare const arithmeticOperators: FloatingDropDownOption[];
@@ -0,0 +1,7 @@
1
+ import { Aggregate, Dimension, FloatingDropDownOption, SelectedColumn } from '@/types';
2
+ export declare const functionOptions: (col?: SelectedColumn, dataType?: string) => FloatingDropDownOption[];
3
+ export declare const getColumnType: (column: SelectedColumn) => "default" | "custom" | "arithmetic_column";
4
+ export declare const getDimensionsAndAggregates: (columns: SelectedColumn[]) => {
5
+ dimensions: Dimension[];
6
+ aggregates: Aggregate[];
7
+ };
@@ -1,2 +1,2 @@
1
- declare const getColumnTypes: (data: Record<string, any>[]) => Record<string, string>;
1
+ export declare const getColumnTypes: (data: Record<string, any>[]) => Record<string, string>;
2
2
  export default getColumnTypes;
@@ -8,3 +8,4 @@ export * from './checkIsElementInViewport';
8
8
  export * from './areArraysEqual';
9
9
  export * from './generateTimeRangeWhereClause';
10
10
  export * from './getColumnType';
11
+ export * from './createMetric';
@@ -45,7 +45,7 @@ declare const useGenerateMetric: (config: ConfigType) => {
45
45
  selectedColumns: SelectedColumn[];
46
46
  setSelectedColumns: import("react").Dispatch<import("react").SetStateAction<SelectedColumn[]>>;
47
47
  functionOptions: (col?: SelectedColumn, colDatatype?: string) => FloatingDropDownOption[];
48
- setChartFields: ({ chartType, chartDimensions, chartMetrics, chartAggregateColumns, }: SetChartFieldParams) => void;
48
+ setChartFields: ({ chartType, chartDimensions, chartMetrics, chartAggregateColumns, configAggregates, }: SetChartFieldParams) => void;
49
49
  onSubmitSearch: () => void;
50
50
  onChangeHelperFunction: ({ column, helperFunction, functionConfiguration, }: OnChangeHelperFunctionParams) => void;
51
51
  onChangeAlias: ({ alias, column }: OnChangeAliasParams) => void;
@@ -4,6 +4,7 @@ import { MetricCardProps } from '@/components';
4
4
  type UseMetricCardProps = {
5
5
  metric: Record<string, any>;
6
6
  clientId: string;
7
+ encryptedClientId?: string;
7
8
  tenancyLevel: string;
8
9
  globalFilters?: MetricCardProps['globalFilters'];
9
10
  rlsFilters?: any;
@@ -15,8 +16,10 @@ type UseMetricCardProps = {
15
16
  crossDashboardFilters?: RlsCondition[];
16
17
  metricFilterOptions?: MetricFilterOptionsType;
17
18
  isAllClient?: boolean;
19
+ isFrontendApp: boolean;
20
+ guestToken?: string;
18
21
  };
19
- export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, tenancyLevel, isInternalApp, appFilters, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, isAllClient, }: UseMetricCardProps) => {
22
+ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, tenancyLevel, isInternalApp, appFilters, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, isAllClient, isFrontendApp, guestToken, encryptedClientId, }: UseMetricCardProps) => {
20
23
  onDrillLevelClick: (index: number) => void;
21
24
  onDrillDown: (params: any, rowFilters?: {
22
25
  columnName: string;
@@ -1,5 +1,10 @@
1
1
  import { UseMetricQueryQueryInputType } from '@/types/queryTypes';
2
- export declare const useMetricDataQuery: (data: UseMetricQueryQueryInputType) => import("react-query").UseQueryResult<{
2
+ export declare const useMetricDataQuery: ({ clientId, data, token, isFrontendApp, }: {
3
+ data: UseMetricQueryQueryInputType;
4
+ clientId: string;
5
+ token?: string | undefined;
6
+ isFrontendApp: boolean;
7
+ }) => import("react-query").UseQueryResult<{
3
8
  data: unknown;
4
9
  }, unknown>;
5
10
  export declare const useMetricRawDownloadSettingsQuery: (workspaceId: string) => import("react-query").UseQueryResult<{
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { ColumnSizingState } from '@tanstack/react-table';
3
- import { TableObjectType } from './metricCreate';
3
+ import { SelectedColumn, TableObjectType, Aggregate } from './metricCreate';
4
4
  import { CHART_TYPES, ICONS_LIST } from '@/consts';
5
5
  export type ChildrenProps = {
6
6
  children: ReactNode;
@@ -194,7 +194,7 @@ export type CustomSettings = {
194
194
  };
195
195
  export type Colors = 'primary' | 'primary-dark' | 'secondary' | 'secondary-dark' | 'alert' | 'alert-dark' | 'alert-light' | 'success' | 'success-dark' | 'success-light' | 'warning' | 'warning-dark' | 'info' | 'info-light' | 'white' | 'gray' | 'gray-dark' | 'light' | 'dark' | 'infoAlert';
196
196
  export type IconType = (typeof ICONS_LIST)[number];
197
- export type LogoType = 'redshift' | 'postgres' | 'mysql' | 'mongodb' | 'bigquery' | 'snowflake' | 'microsoft' | 'google' | 'elasticsearch' | 'redis' | 'databricks' | 'clickhouse' | 'mssql';
197
+ export type LogoType = 'redshift' | 'postgres' | 'mysql' | 'mongodb' | 'bigquery' | 'snowflake' | 'microsoft' | 'google' | 'elasticsearch' | 'redis' | 'databricks' | 'clickhouse' | 'mssql' | 'awss3';
198
198
  export type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
199
199
  export type IconConfig = {
200
200
  size: IconSizes;
@@ -266,6 +266,7 @@ export type LabelSettings = {
266
266
  truncateLabel?: boolean;
267
267
  truncateLabelValue?: number;
268
268
  showLabelLine?: boolean;
269
+ isEnableValueSummation?: boolean;
269
270
  XAxisStyle?: {
270
271
  size?: number;
271
272
  family?: string;
@@ -295,6 +296,7 @@ export type PivotSettingsType2 = {
295
296
  dimensions?: string[];
296
297
  headers?: string[];
297
298
  isDynamicHeaders?: boolean;
299
+ aggregates?: Aggregate[];
298
300
  };
299
301
  export type GaugeSettingsType = {
300
302
  metric?: string;
@@ -417,6 +419,7 @@ export type FloatingDropDownOption = {
417
419
  alias?: string;
418
420
  table?: TableObjectType;
419
421
  isImportEnabled?: boolean;
422
+ column?: SelectedColumn;
420
423
  };
421
424
  export type FilterType = {
422
425
  tableName: string;
@@ -84,6 +84,7 @@ export type SetChartFieldParams = {
84
84
  chartDimensions?: string[];
85
85
  chartAggregateColumns?: string[];
86
86
  chartType?: ChartSettingsType['chartType'];
87
+ configAggregates?: Aggregate[];
87
88
  };
88
89
  export type CastColumn = 'integer' | 'decimal' | 'date';
89
90
  export type SelectedColumn = {
@@ -93,7 +94,7 @@ export type SelectedColumn = {
93
94
  alias: string;
94
95
  parentAlias: string;
95
96
  helperFunction?: string;
96
- type: 'DEFAULT' | 'HELPER_FUNCTION' | 'CUSTOM' | 'PYTHON';
97
+ type: 'DEFAULT' | 'HELPER_FUNCTION' | 'CUSTOM' | 'PYTHON' | 'ARITHMETIC';
97
98
  index: number;
98
99
  configType: 'DIMENSION' | 'AGGREGATE' | 'FILTER';
99
100
  dropType: 'METRIC' | 'DIMENSION' | 'FILTER';
@@ -121,6 +122,11 @@ export type SelectedColumn = {
121
122
  draggableItemData: DraggableMetricItemData;
122
123
  keyword?: string;
123
124
  cast?: FloatingDropDownOption;
125
+ arithmeticConfig?: {
126
+ firstOperand: SelectedColumn;
127
+ secondOperand: SelectedColumn;
128
+ operator: FloatingDropDownOption;
129
+ };
124
130
  };
125
131
  export type SelectedFilter = {
126
132
  method: string;
@@ -340,16 +346,20 @@ export type Aggregate = {
340
346
  columnName: string;
341
347
  alias: string;
342
348
  parentAlias: string;
343
- type: 'custom' | 'default';
344
349
  dataType: string;
345
350
  cast?: CastColumn;
351
+ type: 'custom' | 'default' | 'arithmetic_column';
352
+ arithmeticConfig?: {
353
+ firstOperand: Aggregate;
354
+ secondOperand: Aggregate;
355
+ operator: string;
356
+ };
346
357
  };
347
358
  export type Dimension = {
348
359
  columnName: string;
349
360
  alias: string;
350
361
  parentAlias: string;
351
362
  timeGrain?: string;
352
- type: 'custom' | 'default';
353
363
  dataType: string;
354
364
  helperFunction?: string;
355
365
  labelType?: string;
@@ -357,6 +367,12 @@ export type Dimension = {
357
367
  dateFormat?: string;
358
368
  };
359
369
  cast?: CastColumn;
370
+ type: 'custom' | 'default' | 'arithmetic_column';
371
+ arithmeticConfig?: {
372
+ firstOperand: Dimension;
373
+ secondOperand: Dimension;
374
+ operator: string;
375
+ };
360
376
  };
361
377
  export type Filter = {
362
378
  method: string;
@@ -488,4 +504,10 @@ export type MetricFilterDemoThemeType = {
488
504
  variant: 'static' | 'floating';
489
505
  radius: string;
490
506
  };
507
+ export type MetricConfigType = 'DIMENSION' | 'METRIC';
508
+ export type OnSaveArithmeticColumnParams = {
509
+ column: SelectedColumn['arithmeticConfig'];
510
+ type: MetricConfigType;
511
+ alias: string;
512
+ };
491
513
  export {};