semaphor 0.0.95 → 0.0.97

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.
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={database:null,schema:null,table:null};exports.EMPTY_SELECTION=e;
@@ -1 +1,8 @@
1
-
1
+ const l = {
2
+ database: null,
3
+ schema: null,
4
+ table: null
5
+ };
6
+ export {
7
+ l as EMPTY_SELECTION
8
+ };
@@ -2,6 +2,7 @@ import { AIScopeTable as AIScopeTable_2 } from '..';
2
2
  import { CacheConfig as CacheConfig_2 } from '..';
3
3
  import { Chart } from 'chart.js';
4
4
  import { ChartConfiguration } from 'chart.js';
5
+ import { ComboBoxOption as ComboBoxOption_2 } from '../../components/surfboard/filter/types';
5
6
  import { CustomCard as CustomCard_2 } from '..';
6
7
  import { DateRange } from 'react-day-picker';
7
8
  import { default as default_2 } from 'react-grid-layout';
@@ -13,13 +14,17 @@ import { RefetchOptions } from '@tanstack/query-core';
13
14
  import { StoreApi } from 'zustand';
14
15
  import { TBaseQuery as TBaseQuery_2 } from '..';
15
16
  import { TFilter as TFilter_2 } from '../surfboard/filter/types';
17
+ import { TFilterValue as TFilterValue_2 } from '..';
16
18
  import { TStyle as TStyle_2 } from '..';
17
19
  import { UseBoundStore } from 'zustand';
18
20
  import { WritableDraft } from 'immer';
19
21
 
20
22
  declare type Actions = {
23
+ setHandleOpenAssistantProfile: (handleOpenAssistantProfile: () => void) => void;
24
+ setFilterMode: (filterId: string, filterMode: 'include' | 'exclude') => void;
21
25
  setInitStore: () => void;
22
26
  setGlobalStyle: (style: TStyle) => void;
27
+ setDefaultFilterValues: (filterValues: TFilterValue[] | undefined) => void;
23
28
  updateEmailSettings: (emailSettings: EmailSettings) => void;
24
29
  setIsDownloadingPdf: (isDownloadingPdf: boolean) => void;
25
30
  setLenses: (lenses: TLens[]) => void;
@@ -96,6 +101,37 @@ declare type Actions = {
96
101
  };
97
102
 
98
103
  declare type Actions_2 = {
104
+ setEditorFilterMode: (filterColumnName: string, filterMode: 'include' | 'exclude') => void;
105
+ setLowerIsBetter: (lowerIsBetter: boolean) => void;
106
+ clearEditorFilter: (filterColumn: FilterByColumn) => void;
107
+ removeEditorFilter: (filterColumn: FilterByColumn) => void;
108
+ updateEditorFilterValue: (filterColumnName: string, filterValue: FilterValue, clearFilter?: boolean) => void;
109
+ setTempQueryData: (tempQueryData: {
110
+ queryKey: string[];
111
+ queryData: any;
112
+ }) => void;
113
+ clearQueryConfig: () => void;
114
+ setQueryConfig: (queryConfig: QueryConfig | undefined) => void;
115
+ setIsDevMode: (isDevMode: boolean) => void;
116
+ setOrderByColumns: (orderByColumns: OrderBy[]) => void;
117
+ addOrderByColumn: (orderByColumn: OrderBy) => void;
118
+ removeOrderByColumn: (orderByColumn: OrderBy) => void;
119
+ updateOrderByColumn: (orderByColumn: OrderBy) => void;
120
+ setGroupByColumns: (groupByColumns: GroupByColumn[]) => void;
121
+ setMetricColumns: (metricColumns: MetricColumn[]) => void;
122
+ setPivotByColumns: (pivotColumns: GroupByColumn[]) => void;
123
+ removeColumnFromGroupBy: (columnId: string) => void;
124
+ removeColumnFromMetricColumns: (columnId: string) => void;
125
+ removeColumnFromPivotBy: (columnId: string) => void;
126
+ addColumnToGroupBy: (column: GroupByColumn) => void;
127
+ addColumnToMetricColumns: (column: MetricColumn) => void;
128
+ setFilterColumns: (filterColumns: FilterByColumn[]) => void;
129
+ addColumnToFilterColumns: (column: FilterByColumn) => void;
130
+ removeColumnFromFilterColumns: (columnId: string) => void;
131
+ updateMetricColumn: (columnId: string, column: MetricColumn) => void;
132
+ updateGroupByColumn: (columnId: string, column: GroupByColumn) => void;
133
+ updatePivotByColumn: (columnId: string, column: GroupByColumn) => void;
134
+ updateFilterColumn: (columnId: string, column: FilterByColumn) => void;
99
135
  setCurrentAssitantScope: (currentAssitantScope: AIScopeTable[]) => void;
100
136
  setChartGrid: (chartGrid: 'xy' | 'x' | 'y' | 'none') => void;
101
137
  setLegendOptions: (legendOptions: TLegendOptions) => void;
@@ -139,7 +175,6 @@ declare type Actions_2 = {
139
175
  setSelectedDatabaseName: (databaseName: string) => void;
140
176
  setSelectedSchemaName: (schemaName: string) => void;
141
177
  setSelectedTableName: (tableName: string) => void;
142
- setCurrentColumns: (columns: TDataColumn[]) => void;
143
178
  setOnConnectionChange: (onConnectionChange: (connectionId: string) => void) => void;
144
179
  setOnDatabaseChange: (onDatabaseChange: (databaseName: string) => void) => void;
145
180
  setOnSchemaChange: (onSchemaChange: (schemaName: string) => void) => void;
@@ -150,6 +185,8 @@ declare type Actions_2 = {
150
185
 
151
186
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
152
187
 
188
+ export declare type AggregateFunction = 'SUM' | 'AVG' | 'COUNT' | 'MAX' | 'MIN' | 'DISTINCT';
189
+
153
190
  export declare type AIScopeTable = {
154
191
  connectionId: string;
155
192
  connectionType: string;
@@ -160,11 +197,21 @@ export declare type AIScopeTable = {
160
197
  datamodelName: string;
161
198
  };
162
199
 
200
+ export declare type AssistantId = 'dashboard-assistant' | 'editor-assistant';
201
+
163
202
  export declare type AuthToken = {
164
203
  accessToken: string;
165
204
  refreshToken?: string;
166
205
  };
167
206
 
207
+ export declare interface BaseColumn {
208
+ id: string;
209
+ name: string;
210
+ label?: string;
211
+ type: ColumnType;
212
+ table?: string;
213
+ }
214
+
168
215
  declare type BaseCustomCard = {
169
216
  cardId: string;
170
217
  replaceDefault?: boolean;
@@ -211,6 +258,16 @@ export declare type ColorRange = {
211
258
  color: string;
212
259
  };
213
260
 
261
+ export declare type ColumnRole = 'groupby' | 'trendby' | 'metric' | 'filter';
262
+
263
+ export declare type ColumnType = 'string' | 'number' | 'date';
264
+
265
+ declare type ComboBoxOption = {
266
+ id: number | string;
267
+ value: string;
268
+ [key: string]: number | string;
269
+ };
270
+
214
271
  export declare type ConnectionPolicy = {
215
272
  connectionId?: string;
216
273
  name: string;
@@ -263,6 +320,7 @@ export declare type DashboardProps = {
263
320
  };
264
321
 
265
322
  export declare type DashboardStore = {
323
+ handleOpenAssistantProfile?: () => void;
266
324
  isDownloadingPdf?: boolean;
267
325
  isSessionExpired: boolean;
268
326
  authToken?: AuthToken;
@@ -284,7 +342,7 @@ export declare type DashboardStore = {
284
342
  showFilters: boolean;
285
343
  filterValues?: TFilterValue[];
286
344
  onEvent?: (event: TEvent) => void;
287
- onSaveFunction?: (dashboard: TDashboard) => void;
345
+ onSaveFunction?: (dashboard: TDashboard, description?: string) => void;
288
346
  onAddFrame?: (card: TFrame, sheetId: string) => void;
289
347
  onAcceptChanges?: (frame: TFrame, dashboard: TDashboard) => void;
290
348
  onUpdateCard?: (card: TCard, sheetId: string) => void;
@@ -306,7 +364,14 @@ export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'n
306
364
 
307
365
  export declare function downloadPdf(): Promise<void>;
308
366
 
367
+ export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
368
+
309
369
  declare type EditorStore = {
370
+ tempQueryData?: {
371
+ queryKey: string[];
372
+ queryData: any;
373
+ };
374
+ isDevMode: boolean;
310
375
  isShowingVisual: boolean;
311
376
  showAIDialog: boolean;
312
377
  userInputForAI: string;
@@ -329,7 +394,6 @@ declare type EditorStore = {
329
394
  selectedDatabaseName?: string;
330
395
  selectedSchemaName?: string;
331
396
  selectedTableName?: string;
332
- currentColumns?: TDataColumn[];
333
397
  currentAssitantScope?: AIScopeTable[];
334
398
  onConnectionChange?: (connectionId: string) => void;
335
399
  onDatamodelChange?: (datamodelId: string) => void;
@@ -347,10 +411,23 @@ export declare type EmailSettings = {
347
411
  senderTitle: string;
348
412
  };
349
413
 
414
+ export declare const EMPTY_SELECTION: SelectionState;
415
+
350
416
  export declare type ErrorProps = {
351
417
  message?: string;
352
418
  };
353
419
 
420
+ export declare interface FilterByColumn extends BaseColumn {
421
+ role: 'filter';
422
+ operators?: string[];
423
+ mode?: 'include' | 'exclude';
424
+ sql?: string;
425
+ fetchValues?: boolean;
426
+ fetchLimit?: number;
427
+ valueSource?: 'distinct' | 'static' | 'range';
428
+ staticValues?: string[];
429
+ }
430
+
354
431
  declare type FilterForBetween = BaseFilter & {
355
432
  operation: 'between' | 'not between';
356
433
  values: [number, number];
@@ -388,6 +465,8 @@ declare type FilterOnClick = {
388
465
  columnIndex: number;
389
466
  };
390
467
 
468
+ export declare type FilterValue = string | number | null | (string | number)[] | RangeValue;
469
+
391
470
  export declare function fmt(str: string): string;
392
471
 
393
472
  export declare function getColumnDataType(column: TDataColumn): string;
@@ -418,6 +497,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
418
497
  globalStyle?: TStyle_2;
419
498
  globalCacheConfig?: CacheConfig_2;
420
499
  emailSettings?: EmailSettings_2;
500
+ defaultFilterValues?: TFilterValue_2[];
421
501
  };
422
502
 
423
503
  export declare type GetDashboardResponse = {
@@ -429,11 +509,12 @@ export declare type GetDashboardResponse = {
429
509
 
430
510
  export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
431
511
 
432
- export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, connectionType, }: {
512
+ export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, connectionType, databaseName, }: {
433
513
  schemaName: string;
434
514
  tableName: string;
435
515
  modelName: string | undefined;
436
516
  connectionType: string;
517
+ databaseName: string;
437
518
  }): string;
438
519
 
439
520
  export declare type GetPluginsResponse = {
@@ -443,9 +524,22 @@ export declare type GetPluginsResponse = {
443
524
  }[];
444
525
  };
445
526
 
446
- export declare function getQualifiedTableName(schemaName: string, tableName: string, connectionType: string): string;
527
+ export declare function getQualifiedTableName({ schemaName, tableName, connectionType, databaseName, }: {
528
+ schemaName: string;
529
+ tableName: string;
530
+ connectionType: string;
531
+ databaseName: string;
532
+ }): string;
447
533
 
448
- export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, connectionType: string): string | undefined;
534
+ export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, connectionType: string, databaseName: string): string | undefined;
535
+
536
+ export declare type Granularity = 'day' | 'week' | 'month' | 'year';
537
+
538
+ export declare interface GroupByColumn extends BaseColumn {
539
+ role: 'groupby';
540
+ granularity?: Granularity;
541
+ format?: string;
542
+ }
449
543
 
450
544
  export declare type HtmlOptions = {
451
545
  html: string;
@@ -469,10 +563,18 @@ export declare type KPICardProps = {
469
563
  renderFilterInfo?: () => JSX.Element | null;
470
564
  };
471
565
 
566
+ export declare type Level = 'database' | 'schema' | 'table';
567
+
472
568
  export declare type LoadingProps = {
473
569
  message?: string;
474
570
  };
475
571
 
572
+ export declare interface MetricColumn extends BaseColumn {
573
+ role: 'metric';
574
+ aggregate: AggregateFunction;
575
+ aliasTemplate?: string;
576
+ }
577
+
476
578
  declare type NoneOptions = {};
477
579
 
478
580
  export declare type NumberAxisFormat = {
@@ -499,6 +601,11 @@ declare type OptionsMap = {
499
601
  none: NoneOptions;
500
602
  };
501
603
 
604
+ export declare interface OrderBy {
605
+ columnId: string;
606
+ direction: 'asc' | 'desc';
607
+ }
608
+
502
609
  declare type Params = {
503
610
  [key: string]: string | number | string[] | number[];
504
611
  };
@@ -514,6 +621,30 @@ export declare type Placeholders = {
514
621
  SessionExpired?: React.ReactNode;
515
622
  };
516
623
 
624
+ export declare type QueryColumn = GroupByColumn | MetricColumn | FilterByColumn;
625
+
626
+ export declare interface QueryConfig {
627
+ groupByColumns?: GroupByColumn[];
628
+ pivotColumns?: GroupByColumn[];
629
+ metricColumns?: MetricColumn[];
630
+ filterColumns?: FilterByColumn[];
631
+ filters?: QueryFilter[];
632
+ limit?: number;
633
+ orderBy?: OrderBy[];
634
+ }
635
+
636
+ export declare type QueryFilter = {
637
+ filterColumnName: string;
638
+ filterValue: FilterValue;
639
+ };
640
+
641
+ export declare type RangeValue = {
642
+ gte?: string | number;
643
+ lte?: string | number;
644
+ lt?: string | number;
645
+ gt?: string | number;
646
+ };
647
+
517
648
  export declare function resolveDatamodelName(datamodelName: string): string;
518
649
 
519
650
  export declare const resolveDataType: (value: any) => string;
@@ -522,7 +653,9 @@ export declare function ScheduleDashboard({ triggerButtonClassName, }: {
522
653
  triggerButtonClassName?: string;
523
654
  }): JSX_2.Element;
524
655
 
525
- export declare function SelectComponent({ title, items, value, isLoading, isError, refetch, connectionTooltip, onChange, showNone, className, showIcon, disabled, type, }: SelectProps): JSX_2.Element;
656
+ export declare function SelectComponent({ title, items, value, isLoading, isError, refetch, onChange, showNone, className, disabled, type, }: SelectProps): JSX_2.Element;
657
+
658
+ export declare type SelectionState = Record<Level, string | null>;
526
659
 
527
660
  declare type SelectProps = {
528
661
  title: string;
@@ -604,6 +737,13 @@ export declare type StyleProps = {
604
737
 
605
738
  export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
606
739
 
740
+ export declare type TableConfig = {
741
+ databaseName: string;
742
+ schemaName: string;
743
+ tableName: string;
744
+ datamodelId: string;
745
+ };
746
+
607
747
  export declare type TBaseQuery = {
608
748
  id: string;
609
749
  name: string;
@@ -625,6 +765,7 @@ export declare type TCard = {
625
765
  type: TChartType;
626
766
  sql?: string;
627
767
  python?: string;
768
+ queryConfig?: QueryConfig;
628
769
  customCfg?: any;
629
770
  preferences?: TCardPreferences;
630
771
  customCardPreferences?: TCustomCardPreferences;
@@ -675,6 +816,9 @@ export declare type TCardPreferences = {
675
816
  projectionOffset?: [number, number];
676
817
  colorScale?: string;
677
818
  };
819
+ kpiVisualOptions?: {
820
+ lowerIsBetter?: boolean;
821
+ };
678
822
  };
679
823
 
680
824
  declare type TChartConfiguration = ChartConfiguration;
@@ -714,7 +858,7 @@ export declare type TChartOptions = {
714
858
  };
715
859
  };
716
860
 
717
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
861
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
718
862
 
719
863
  export declare type TColumnSetting<T extends DisplayDataType> = {
720
864
  columnIdx: number;
@@ -756,6 +900,7 @@ export declare type TDashboard = {
756
900
  globalStyle?: TStyle;
757
901
  globalCacheConfig?: CacheConfig;
758
902
  emailSettings?: EmailSettings;
903
+ defaultFilterValues?: TFilterValue[];
759
904
  };
760
905
 
761
906
  export declare type TDataColumn = {
@@ -777,6 +922,11 @@ export declare type TDatasetOptions = {
777
922
  };
778
923
  };
779
924
 
925
+ export declare type TDbCapabilities = {
926
+ path: Level[];
927
+ labels?: Partial<Record<Level, string>>;
928
+ };
929
+
780
930
  export declare type TEvent = {
781
931
  type: 'success' | 'error' | 'info' | 'warning';
782
932
  message: any;
@@ -825,11 +975,7 @@ export declare type TLens = {
825
975
  shared?: boolean;
826
976
  };
827
977
 
828
- export declare type TSelectedRecord = {
829
- id: number | string;
830
- value: string;
831
- [key: string]: number | string;
832
- };
978
+ export declare type TSelectedRecord = ComboBoxOption;
833
979
 
834
980
  export declare type TSheet = {
835
981
  id: string;
@@ -852,6 +998,7 @@ export declare type TStyle = {
852
998
  export declare function useCard(cardId: string): {
853
999
  data: any;
854
1000
  card: TCard;
1001
+ isPending: boolean;
855
1002
  isError: boolean;
856
1003
  isLoading: boolean;
857
1004
  isFetching: boolean;
@@ -876,12 +1023,14 @@ export declare function useDateFilterHook(filterId: string): {
876
1023
  dateRange: DateRange | undefined;
877
1024
  handleClear: () => void;
878
1025
  handleChange: (date: DateRange | undefined) => void;
1026
+ handleReset: () => void;
879
1027
  };
880
1028
 
881
1029
  export declare const useEditorActions: () => Actions_2;
882
1030
 
883
1031
  export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?: string): {
884
1032
  connectionItems: any;
1033
+ selectedConnectionId: string | undefined;
885
1034
  isConnectionsLoading: boolean;
886
1035
  isConnectionsError: boolean;
887
1036
  modelItems: any;
@@ -889,13 +1038,16 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
889
1038
  selectedDatamodelName: any;
890
1039
  isModelsLoading: boolean;
891
1040
  isModelsError: boolean;
1041
+ selectedDatabaseName: string | undefined;
892
1042
  databaseItems: any;
893
1043
  isDatabasesLoadingOrFetching: boolean;
894
1044
  isDatabaseError: boolean;
895
1045
  schemaItems: any;
1046
+ selectedSchemaName: string | undefined;
896
1047
  isSchemaLoadingOrFetching: boolean;
897
1048
  isSchemaError: boolean;
898
1049
  tableItems: any;
1050
+ selectedTableName: string | undefined;
899
1051
  isTableLoadingOrFetching: boolean;
900
1052
  isTableError: boolean;
901
1053
  columns: TDataColumn[];
@@ -904,6 +1056,7 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
904
1056
  isNonDbConnection: boolean;
905
1057
  connectionType: any;
906
1058
  tableName: any;
1059
+ formattedTableName: string;
907
1060
  schemaName: string;
908
1061
  refetchConnections: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
909
1062
  refetchModels: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
@@ -925,12 +1078,12 @@ export declare function useTextFilterHook(filterId: string): {
925
1078
  isLoading: boolean;
926
1079
  isFetching: boolean;
927
1080
  isError: boolean;
928
- records: TSelectedRecord[];
929
- selectedRecords: TSelectedRecord[];
1081
+ records: ComboBoxOption_2[];
1082
+ selectedRecords: ComboBoxOption_2[];
930
1083
  handleChange: (selectedRecords: TSelectedRecord[]) => void;
931
1084
  handleClear: () => void;
932
1085
  handleSelectAll: (checked: boolean) => void;
933
- filteredRecords: TSelectedRecord[];
1086
+ filteredRecords: ComboBoxOption_2[];
934
1087
  isSingleSelect: boolean;
935
1088
  allSelected: boolean;
936
1089
  };
@@ -3,6 +3,8 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
3
3
 
4
4
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
5
5
 
6
+ declare type AggregateFunction = 'SUM' | 'AVG' | 'COUNT' | 'MAX' | 'MIN' | 'DISTINCT';
7
+
6
8
  export declare type AIScopeTable = {
7
9
  connectionId: string;
8
10
  connectionType: string;
@@ -13,11 +15,21 @@ export declare type AIScopeTable = {
13
15
  datamodelName: string;
14
16
  };
15
17
 
18
+ export declare type AssistantId = 'dashboard-assistant' | 'editor-assistant';
19
+
16
20
  export declare type AuthToken = {
17
21
  accessToken: string;
18
22
  refreshToken?: string;
19
23
  };
20
24
 
25
+ declare interface BaseColumn {
26
+ id: string;
27
+ name: string;
28
+ label?: string;
29
+ type: ColumnType;
30
+ table?: string;
31
+ }
32
+
21
33
  declare type BaseCustomCard = {
22
34
  cardId: string;
23
35
  replaceDefault?: boolean;
@@ -62,6 +74,8 @@ export declare type ColorRange = {
62
74
  color: string;
63
75
  };
64
76
 
77
+ declare type ColumnType = 'string' | 'number' | 'date';
78
+
65
79
  export declare type ConnectionPolicy = {
66
80
  connectionId?: string;
67
81
  name: string;
@@ -117,6 +131,8 @@ export declare type DateOptions = {
117
131
 
118
132
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
119
133
 
134
+ export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
135
+
120
136
  export declare type EmailSettings = {
121
137
  companyName: string;
122
138
  dashboardUrl: string;
@@ -124,10 +140,23 @@ export declare type EmailSettings = {
124
140
  senderTitle: string;
125
141
  };
126
142
 
143
+ export declare const EMPTY_SELECTION: SelectionState;
144
+
127
145
  export declare type ErrorProps = {
128
146
  message?: string;
129
147
  };
130
148
 
149
+ declare interface FilterByColumn extends BaseColumn {
150
+ role: 'filter';
151
+ operators?: string[];
152
+ mode?: 'include' | 'exclude';
153
+ sql?: string;
154
+ fetchValues?: boolean;
155
+ fetchLimit?: number;
156
+ valueSource?: 'distinct' | 'static' | 'range';
157
+ staticValues?: string[];
158
+ }
159
+
131
160
  declare type FilterForBetween = BaseFilter & {
132
161
  operation: 'between' | 'not between';
133
162
  values: [number, number];
@@ -165,6 +194,8 @@ declare type FilterOnClick = {
165
194
  columnIndex: number;
166
195
  };
167
196
 
197
+ declare type FilterValue = string | number | null | (string | number)[] | RangeValue;
198
+
168
199
  export declare type GetDashboardResponse = {
169
200
  dashboard: TDashboard;
170
201
  lenses: TLens[];
@@ -179,6 +210,14 @@ export declare type GetPluginsResponse = {
179
210
  }[];
180
211
  };
181
212
 
213
+ declare type Granularity = 'day' | 'week' | 'month' | 'year';
214
+
215
+ declare interface GroupByColumn extends BaseColumn {
216
+ role: 'groupby';
217
+ granularity?: Granularity;
218
+ format?: string;
219
+ }
220
+
182
221
  export declare type HtmlOptions = {
183
222
  html: string;
184
223
  };
@@ -189,10 +228,18 @@ export declare type KPICardProps = {
189
228
  renderFilterInfo?: () => JSX.Element | null;
190
229
  };
191
230
 
231
+ export declare type Level = 'database' | 'schema' | 'table';
232
+
192
233
  export declare type LoadingProps = {
193
234
  message?: string;
194
235
  };
195
236
 
237
+ declare interface MetricColumn extends BaseColumn {
238
+ role: 'metric';
239
+ aggregate: AggregateFunction;
240
+ aliasTemplate?: string;
241
+ }
242
+
196
243
  declare type NoneOptions = {};
197
244
 
198
245
  export declare type NumberAxisFormat = {
@@ -219,6 +266,11 @@ declare type OptionsMap = {
219
266
  none: NoneOptions;
220
267
  };
221
268
 
269
+ declare interface OrderBy {
270
+ columnId: string;
271
+ direction: 'asc' | 'desc';
272
+ }
273
+
222
274
  declare type Params = {
223
275
  [key: string]: string | number | string[] | number[];
224
276
  };
@@ -234,6 +286,30 @@ export declare type Placeholders = {
234
286
  SessionExpired?: React.ReactNode;
235
287
  };
236
288
 
289
+ declare interface QueryConfig {
290
+ groupByColumns?: GroupByColumn[];
291
+ pivotColumns?: GroupByColumn[];
292
+ metricColumns?: MetricColumn[];
293
+ filterColumns?: FilterByColumn[];
294
+ filters?: QueryFilter[];
295
+ limit?: number;
296
+ orderBy?: OrderBy[];
297
+ }
298
+
299
+ declare type QueryFilter = {
300
+ filterColumnName: string;
301
+ filterValue: FilterValue;
302
+ };
303
+
304
+ declare type RangeValue = {
305
+ gte?: string | number;
306
+ lte?: string | number;
307
+ lt?: string | number;
308
+ gt?: string | number;
309
+ };
310
+
311
+ export declare type SelectionState = Record<Level, string | null>;
312
+
237
313
  export declare type SqlGen = {
238
314
  measures?: {
239
315
  name: string;
@@ -310,6 +386,7 @@ export declare type TCard = {
310
386
  type: TChartType;
311
387
  sql?: string;
312
388
  python?: string;
389
+ queryConfig?: QueryConfig;
313
390
  customCfg?: any;
314
391
  preferences?: TCardPreferences;
315
392
  customCardPreferences?: TCustomCardPreferences;
@@ -360,6 +437,9 @@ export declare type TCardPreferences = {
360
437
  projectionOffset?: [number, number];
361
438
  colorScale?: string;
362
439
  };
440
+ kpiVisualOptions?: {
441
+ lowerIsBetter?: boolean;
442
+ };
363
443
  };
364
444
 
365
445
  export declare type TChartOptions = {
@@ -397,7 +477,7 @@ export declare type TChartOptions = {
397
477
  };
398
478
  };
399
479
 
400
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
480
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
401
481
 
402
482
  export declare type TColumnSetting<T extends DisplayDataType> = {
403
483
  columnIdx: number;
@@ -439,6 +519,7 @@ export declare type TDashboard = {
439
519
  globalStyle?: TStyle;
440
520
  globalCacheConfig?: CacheConfig;
441
521
  emailSettings?: EmailSettings;
522
+ defaultFilterValues?: TFilterValue[];
442
523
  };
443
524
 
444
525
  export declare type TDataColumn = {
@@ -460,6 +541,11 @@ export declare type TDatasetOptions = {
460
541
  };
461
542
  };
462
543
 
544
+ export declare type TDbCapabilities = {
545
+ path: Level[];
546
+ labels?: Partial<Record<Level, string>>;
547
+ };
548
+
463
549
  export declare type TEvent = {
464
550
  type: 'success' | 'error' | 'info' | 'warning';
465
551
  message: any;