semaphor 0.0.94 → 0.0.96
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/CHANGELOG.md +54 -0
- package/dist/chunks/{index-Bxe28vCB.js → index-B2_LiBan.js} +24495 -18476
- package/dist/chunks/index-DzbI-g5k.js +386 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +4 -2
- package/dist/index.cjs +117 -67
- package/dist/index.js +5552 -3890
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -0
- package/dist/types/dashboard.d.ts +83 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -1
- package/dist/types/main.d.ts +160 -16
- package/dist/types/surfboard.d.ts +83 -1
- package/dist/types/types.d.ts +83 -1
- package/package.json +8 -3
- package/dist/chunks/index-C4q37U5v.js +0 -369
package/dist/types/main.d.ts
CHANGED
|
@@ -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,6 +14,7 @@ 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';
|
|
@@ -20,6 +22,7 @@ import { WritableDraft } from 'immer';
|
|
|
20
22
|
declare type Actions = {
|
|
21
23
|
setInitStore: () => void;
|
|
22
24
|
setGlobalStyle: (style: TStyle) => void;
|
|
25
|
+
setDefaultFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
23
26
|
updateEmailSettings: (emailSettings: EmailSettings) => void;
|
|
24
27
|
setIsDownloadingPdf: (isDownloadingPdf: boolean) => void;
|
|
25
28
|
setLenses: (lenses: TLens[]) => void;
|
|
@@ -96,6 +99,35 @@ declare type Actions = {
|
|
|
96
99
|
};
|
|
97
100
|
|
|
98
101
|
declare type Actions_2 = {
|
|
102
|
+
setLowerIsBetter: (lowerIsBetter: boolean) => void;
|
|
103
|
+
removeEditorFilter: (filterColumn: FilterByColumn) => void;
|
|
104
|
+
updateEditorFilterValue: (filterColumnName: string, filterValue: FilterValue, clearFilter?: boolean) => void;
|
|
105
|
+
setTempQueryData: (tempQueryData: {
|
|
106
|
+
queryKey: string[];
|
|
107
|
+
queryData: any;
|
|
108
|
+
}) => void;
|
|
109
|
+
clearQueryConfig: () => void;
|
|
110
|
+
setQueryConfig: (queryConfig: QueryConfig | undefined) => void;
|
|
111
|
+
setIsDevMode: (isDevMode: boolean) => void;
|
|
112
|
+
setOrderByColumns: (orderByColumns: OrderBy[]) => void;
|
|
113
|
+
addOrderByColumn: (orderByColumn: OrderBy) => void;
|
|
114
|
+
removeOrderByColumn: (orderByColumn: OrderBy) => void;
|
|
115
|
+
updateOrderByColumn: (orderByColumn: OrderBy) => void;
|
|
116
|
+
setGroupByColumns: (groupByColumns: GroupByColumn[]) => void;
|
|
117
|
+
setMetricColumns: (metricColumns: MetricColumn[]) => void;
|
|
118
|
+
setPivotByColumns: (pivotColumns: GroupByColumn[]) => void;
|
|
119
|
+
removeColumnFromGroupBy: (columnId: string) => void;
|
|
120
|
+
removeColumnFromMetricColumns: (columnId: string) => void;
|
|
121
|
+
removeColumnFromPivotBy: (columnId: string) => void;
|
|
122
|
+
addColumnToGroupBy: (column: GroupByColumn) => void;
|
|
123
|
+
addColumnToMetricColumns: (column: MetricColumn) => void;
|
|
124
|
+
setFilterColumns: (filterColumns: FilterByColumn[]) => void;
|
|
125
|
+
addColumnToFilterColumns: (column: FilterByColumn) => void;
|
|
126
|
+
removeColumnFromFilterColumns: (columnId: string) => void;
|
|
127
|
+
updateMetricColumn: (columnId: string, column: MetricColumn) => void;
|
|
128
|
+
updateGroupByColumn: (columnId: string, column: GroupByColumn) => void;
|
|
129
|
+
updatePivotByColumn: (columnId: string, column: GroupByColumn) => void;
|
|
130
|
+
updateFilterColumn: (columnId: string, column: FilterByColumn) => void;
|
|
99
131
|
setCurrentAssitantScope: (currentAssitantScope: AIScopeTable[]) => void;
|
|
100
132
|
setChartGrid: (chartGrid: 'xy' | 'x' | 'y' | 'none') => void;
|
|
101
133
|
setLegendOptions: (legendOptions: TLegendOptions) => void;
|
|
@@ -139,7 +171,6 @@ declare type Actions_2 = {
|
|
|
139
171
|
setSelectedDatabaseName: (databaseName: string) => void;
|
|
140
172
|
setSelectedSchemaName: (schemaName: string) => void;
|
|
141
173
|
setSelectedTableName: (tableName: string) => void;
|
|
142
|
-
setCurrentColumns: (columns: TDataColumn[]) => void;
|
|
143
174
|
setOnConnectionChange: (onConnectionChange: (connectionId: string) => void) => void;
|
|
144
175
|
setOnDatabaseChange: (onDatabaseChange: (databaseName: string) => void) => void;
|
|
145
176
|
setOnSchemaChange: (onSchemaChange: (schemaName: string) => void) => void;
|
|
@@ -150,6 +181,8 @@ declare type Actions_2 = {
|
|
|
150
181
|
|
|
151
182
|
export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
|
|
152
183
|
|
|
184
|
+
export declare type AggregateFunction = 'SUM' | 'AVG' | 'COUNT' | 'MAX' | 'MIN' | 'DISTINCT';
|
|
185
|
+
|
|
153
186
|
export declare type AIScopeTable = {
|
|
154
187
|
connectionId: string;
|
|
155
188
|
connectionType: string;
|
|
@@ -165,6 +198,14 @@ export declare type AuthToken = {
|
|
|
165
198
|
refreshToken?: string;
|
|
166
199
|
};
|
|
167
200
|
|
|
201
|
+
export declare interface BaseColumn {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
label?: string;
|
|
205
|
+
type: ColumnType;
|
|
206
|
+
table?: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
168
209
|
declare type BaseCustomCard = {
|
|
169
210
|
cardId: string;
|
|
170
211
|
replaceDefault?: boolean;
|
|
@@ -211,6 +252,16 @@ export declare type ColorRange = {
|
|
|
211
252
|
color: string;
|
|
212
253
|
};
|
|
213
254
|
|
|
255
|
+
export declare type ColumnRole = 'groupby' | 'trendby' | 'metric' | 'filter';
|
|
256
|
+
|
|
257
|
+
export declare type ColumnType = 'string' | 'number' | 'date';
|
|
258
|
+
|
|
259
|
+
declare type ComboBoxOption = {
|
|
260
|
+
id: number | string;
|
|
261
|
+
value: string;
|
|
262
|
+
[key: string]: number | string;
|
|
263
|
+
};
|
|
264
|
+
|
|
214
265
|
export declare type ConnectionPolicy = {
|
|
215
266
|
connectionId?: string;
|
|
216
267
|
name: string;
|
|
@@ -284,7 +335,7 @@ export declare type DashboardStore = {
|
|
|
284
335
|
showFilters: boolean;
|
|
285
336
|
filterValues?: TFilterValue[];
|
|
286
337
|
onEvent?: (event: TEvent) => void;
|
|
287
|
-
onSaveFunction?: (dashboard: TDashboard) => void;
|
|
338
|
+
onSaveFunction?: (dashboard: TDashboard, description?: string) => void;
|
|
288
339
|
onAddFrame?: (card: TFrame, sheetId: string) => void;
|
|
289
340
|
onAcceptChanges?: (frame: TFrame, dashboard: TDashboard) => void;
|
|
290
341
|
onUpdateCard?: (card: TCard, sheetId: string) => void;
|
|
@@ -306,7 +357,14 @@ export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'n
|
|
|
306
357
|
|
|
307
358
|
export declare function downloadPdf(): Promise<void>;
|
|
308
359
|
|
|
360
|
+
export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
|
|
361
|
+
|
|
309
362
|
declare type EditorStore = {
|
|
363
|
+
tempQueryData?: {
|
|
364
|
+
queryKey: string[];
|
|
365
|
+
queryData: any;
|
|
366
|
+
};
|
|
367
|
+
isDevMode: boolean;
|
|
310
368
|
isShowingVisual: boolean;
|
|
311
369
|
showAIDialog: boolean;
|
|
312
370
|
userInputForAI: string;
|
|
@@ -329,7 +387,6 @@ declare type EditorStore = {
|
|
|
329
387
|
selectedDatabaseName?: string;
|
|
330
388
|
selectedSchemaName?: string;
|
|
331
389
|
selectedTableName?: string;
|
|
332
|
-
currentColumns?: TDataColumn[];
|
|
333
390
|
currentAssitantScope?: AIScopeTable[];
|
|
334
391
|
onConnectionChange?: (connectionId: string) => void;
|
|
335
392
|
onDatamodelChange?: (datamodelId: string) => void;
|
|
@@ -347,10 +404,22 @@ export declare type EmailSettings = {
|
|
|
347
404
|
senderTitle: string;
|
|
348
405
|
};
|
|
349
406
|
|
|
407
|
+
export declare const EMPTY_SELECTION: SelectionState;
|
|
408
|
+
|
|
350
409
|
export declare type ErrorProps = {
|
|
351
410
|
message?: string;
|
|
352
411
|
};
|
|
353
412
|
|
|
413
|
+
export declare interface FilterByColumn extends BaseColumn {
|
|
414
|
+
role: 'filter';
|
|
415
|
+
operators?: string[];
|
|
416
|
+
sql?: string;
|
|
417
|
+
fetchValues?: boolean;
|
|
418
|
+
fetchLimit?: number;
|
|
419
|
+
valueSource?: 'distinct' | 'static' | 'range';
|
|
420
|
+
staticValues?: string[];
|
|
421
|
+
}
|
|
422
|
+
|
|
354
423
|
declare type FilterForBetween = BaseFilter & {
|
|
355
424
|
operation: 'between' | 'not between';
|
|
356
425
|
values: [number, number];
|
|
@@ -388,6 +457,8 @@ declare type FilterOnClick = {
|
|
|
388
457
|
columnIndex: number;
|
|
389
458
|
};
|
|
390
459
|
|
|
460
|
+
export declare type FilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
461
|
+
|
|
391
462
|
export declare function fmt(str: string): string;
|
|
392
463
|
|
|
393
464
|
export declare function getColumnDataType(column: TDataColumn): string;
|
|
@@ -418,6 +489,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
|
|
|
418
489
|
globalStyle?: TStyle_2;
|
|
419
490
|
globalCacheConfig?: CacheConfig_2;
|
|
420
491
|
emailSettings?: EmailSettings_2;
|
|
492
|
+
defaultFilterValues?: TFilterValue_2[];
|
|
421
493
|
};
|
|
422
494
|
|
|
423
495
|
export declare type GetDashboardResponse = {
|
|
@@ -429,11 +501,12 @@ export declare type GetDashboardResponse = {
|
|
|
429
501
|
|
|
430
502
|
export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
|
|
431
503
|
|
|
432
|
-
export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, connectionType, }: {
|
|
504
|
+
export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, connectionType, databaseName, }: {
|
|
433
505
|
schemaName: string;
|
|
434
506
|
tableName: string;
|
|
435
507
|
modelName: string | undefined;
|
|
436
508
|
connectionType: string;
|
|
509
|
+
databaseName: string;
|
|
437
510
|
}): string;
|
|
438
511
|
|
|
439
512
|
export declare type GetPluginsResponse = {
|
|
@@ -443,9 +516,22 @@ export declare type GetPluginsResponse = {
|
|
|
443
516
|
}[];
|
|
444
517
|
};
|
|
445
518
|
|
|
446
|
-
export declare function getQualifiedTableName(schemaName
|
|
519
|
+
export declare function getQualifiedTableName({ schemaName, tableName, connectionType, databaseName, }: {
|
|
520
|
+
schemaName: string;
|
|
521
|
+
tableName: string;
|
|
522
|
+
connectionType: string;
|
|
523
|
+
databaseName: string;
|
|
524
|
+
}): string;
|
|
447
525
|
|
|
448
|
-
export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, connectionType: string): string | undefined;
|
|
526
|
+
export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, connectionType: string, databaseName: string): string | undefined;
|
|
527
|
+
|
|
528
|
+
export declare type Granularity = 'day' | 'week' | 'month' | 'year';
|
|
529
|
+
|
|
530
|
+
export declare interface GroupByColumn extends BaseColumn {
|
|
531
|
+
role: 'groupby';
|
|
532
|
+
granularity?: Granularity;
|
|
533
|
+
format?: string;
|
|
534
|
+
}
|
|
449
535
|
|
|
450
536
|
export declare type HtmlOptions = {
|
|
451
537
|
html: string;
|
|
@@ -469,10 +555,18 @@ export declare type KPICardProps = {
|
|
|
469
555
|
renderFilterInfo?: () => JSX.Element | null;
|
|
470
556
|
};
|
|
471
557
|
|
|
558
|
+
export declare type Level = 'database' | 'schema' | 'table';
|
|
559
|
+
|
|
472
560
|
export declare type LoadingProps = {
|
|
473
561
|
message?: string;
|
|
474
562
|
};
|
|
475
563
|
|
|
564
|
+
export declare interface MetricColumn extends BaseColumn {
|
|
565
|
+
role: 'metric';
|
|
566
|
+
aggregate: AggregateFunction;
|
|
567
|
+
aliasTemplate?: string;
|
|
568
|
+
}
|
|
569
|
+
|
|
476
570
|
declare type NoneOptions = {};
|
|
477
571
|
|
|
478
572
|
export declare type NumberAxisFormat = {
|
|
@@ -499,6 +593,11 @@ declare type OptionsMap = {
|
|
|
499
593
|
none: NoneOptions;
|
|
500
594
|
};
|
|
501
595
|
|
|
596
|
+
export declare interface OrderBy {
|
|
597
|
+
columnId: string;
|
|
598
|
+
direction: 'asc' | 'desc';
|
|
599
|
+
}
|
|
600
|
+
|
|
502
601
|
declare type Params = {
|
|
503
602
|
[key: string]: string | number | string[] | number[];
|
|
504
603
|
};
|
|
@@ -514,6 +613,29 @@ export declare type Placeholders = {
|
|
|
514
613
|
SessionExpired?: React.ReactNode;
|
|
515
614
|
};
|
|
516
615
|
|
|
616
|
+
export declare type QueryColumn = GroupByColumn | MetricColumn | FilterByColumn;
|
|
617
|
+
|
|
618
|
+
export declare interface QueryConfig {
|
|
619
|
+
groupByColumns?: GroupByColumn[];
|
|
620
|
+
pivotColumns?: GroupByColumn[];
|
|
621
|
+
metricColumns?: MetricColumn[];
|
|
622
|
+
filterColumns?: FilterByColumn[];
|
|
623
|
+
filters?: {
|
|
624
|
+
filterColumnName: string;
|
|
625
|
+
filterValue: FilterValue;
|
|
626
|
+
exclude?: boolean;
|
|
627
|
+
}[];
|
|
628
|
+
limit?: number;
|
|
629
|
+
orderBy?: OrderBy[];
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export declare type RangeValue = {
|
|
633
|
+
gte?: string | number;
|
|
634
|
+
lte?: string | number;
|
|
635
|
+
lt?: string | number;
|
|
636
|
+
gt?: string | number;
|
|
637
|
+
};
|
|
638
|
+
|
|
517
639
|
export declare function resolveDatamodelName(datamodelName: string): string;
|
|
518
640
|
|
|
519
641
|
export declare const resolveDataType: (value: any) => string;
|
|
@@ -522,7 +644,9 @@ export declare function ScheduleDashboard({ triggerButtonClassName, }: {
|
|
|
522
644
|
triggerButtonClassName?: string;
|
|
523
645
|
}): JSX_2.Element;
|
|
524
646
|
|
|
525
|
-
export declare function SelectComponent({ title, items, value, isLoading, isError, refetch,
|
|
647
|
+
export declare function SelectComponent({ title, items, value, isLoading, isError, refetch, onChange, showNone, className, disabled, type, }: SelectProps): JSX_2.Element;
|
|
648
|
+
|
|
649
|
+
export declare type SelectionState = Record<Level, string | null>;
|
|
526
650
|
|
|
527
651
|
declare type SelectProps = {
|
|
528
652
|
title: string;
|
|
@@ -604,6 +728,13 @@ export declare type StyleProps = {
|
|
|
604
728
|
|
|
605
729
|
export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
|
|
606
730
|
|
|
731
|
+
export declare type TableConfig = {
|
|
732
|
+
databaseName: string;
|
|
733
|
+
schemaName: string;
|
|
734
|
+
tableName: string;
|
|
735
|
+
datamodelId: string;
|
|
736
|
+
};
|
|
737
|
+
|
|
607
738
|
export declare type TBaseQuery = {
|
|
608
739
|
id: string;
|
|
609
740
|
name: string;
|
|
@@ -625,6 +756,7 @@ export declare type TCard = {
|
|
|
625
756
|
type: TChartType;
|
|
626
757
|
sql?: string;
|
|
627
758
|
python?: string;
|
|
759
|
+
queryConfig?: QueryConfig;
|
|
628
760
|
customCfg?: any;
|
|
629
761
|
preferences?: TCardPreferences;
|
|
630
762
|
customCardPreferences?: TCustomCardPreferences;
|
|
@@ -675,6 +807,9 @@ export declare type TCardPreferences = {
|
|
|
675
807
|
projectionOffset?: [number, number];
|
|
676
808
|
colorScale?: string;
|
|
677
809
|
};
|
|
810
|
+
kpiVisualOptions?: {
|
|
811
|
+
lowerIsBetter?: boolean;
|
|
812
|
+
};
|
|
678
813
|
};
|
|
679
814
|
|
|
680
815
|
declare type TChartConfiguration = ChartConfiguration;
|
|
@@ -714,7 +849,7 @@ export declare type TChartOptions = {
|
|
|
714
849
|
};
|
|
715
850
|
};
|
|
716
851
|
|
|
717
|
-
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
|
|
852
|
+
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
|
|
718
853
|
|
|
719
854
|
export declare type TColumnSetting<T extends DisplayDataType> = {
|
|
720
855
|
columnIdx: number;
|
|
@@ -756,6 +891,7 @@ export declare type TDashboard = {
|
|
|
756
891
|
globalStyle?: TStyle;
|
|
757
892
|
globalCacheConfig?: CacheConfig;
|
|
758
893
|
emailSettings?: EmailSettings;
|
|
894
|
+
defaultFilterValues?: TFilterValue[];
|
|
759
895
|
};
|
|
760
896
|
|
|
761
897
|
export declare type TDataColumn = {
|
|
@@ -777,6 +913,11 @@ export declare type TDatasetOptions = {
|
|
|
777
913
|
};
|
|
778
914
|
};
|
|
779
915
|
|
|
916
|
+
export declare type TDbCapabilities = {
|
|
917
|
+
path: Level[];
|
|
918
|
+
labels?: Partial<Record<Level, string>>;
|
|
919
|
+
};
|
|
920
|
+
|
|
780
921
|
export declare type TEvent = {
|
|
781
922
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
782
923
|
message: any;
|
|
@@ -825,11 +966,7 @@ export declare type TLens = {
|
|
|
825
966
|
shared?: boolean;
|
|
826
967
|
};
|
|
827
968
|
|
|
828
|
-
export declare type TSelectedRecord =
|
|
829
|
-
id: number | string;
|
|
830
|
-
value: string;
|
|
831
|
-
[key: string]: number | string;
|
|
832
|
-
};
|
|
969
|
+
export declare type TSelectedRecord = ComboBoxOption;
|
|
833
970
|
|
|
834
971
|
export declare type TSheet = {
|
|
835
972
|
id: string;
|
|
@@ -852,6 +989,7 @@ export declare type TStyle = {
|
|
|
852
989
|
export declare function useCard(cardId: string): {
|
|
853
990
|
data: any;
|
|
854
991
|
card: TCard;
|
|
992
|
+
isPending: boolean;
|
|
855
993
|
isError: boolean;
|
|
856
994
|
isLoading: boolean;
|
|
857
995
|
isFetching: boolean;
|
|
@@ -876,12 +1014,14 @@ export declare function useDateFilterHook(filterId: string): {
|
|
|
876
1014
|
dateRange: DateRange | undefined;
|
|
877
1015
|
handleClear: () => void;
|
|
878
1016
|
handleChange: (date: DateRange | undefined) => void;
|
|
1017
|
+
handleReset: () => void;
|
|
879
1018
|
};
|
|
880
1019
|
|
|
881
1020
|
export declare const useEditorActions: () => Actions_2;
|
|
882
1021
|
|
|
883
1022
|
export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?: string): {
|
|
884
1023
|
connectionItems: any;
|
|
1024
|
+
selectedConnectionId: string | undefined;
|
|
885
1025
|
isConnectionsLoading: boolean;
|
|
886
1026
|
isConnectionsError: boolean;
|
|
887
1027
|
modelItems: any;
|
|
@@ -889,13 +1029,16 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
|
|
|
889
1029
|
selectedDatamodelName: any;
|
|
890
1030
|
isModelsLoading: boolean;
|
|
891
1031
|
isModelsError: boolean;
|
|
1032
|
+
selectedDatabaseName: string | undefined;
|
|
892
1033
|
databaseItems: any;
|
|
893
1034
|
isDatabasesLoadingOrFetching: boolean;
|
|
894
1035
|
isDatabaseError: boolean;
|
|
895
1036
|
schemaItems: any;
|
|
1037
|
+
selectedSchemaName: string | undefined;
|
|
896
1038
|
isSchemaLoadingOrFetching: boolean;
|
|
897
1039
|
isSchemaError: boolean;
|
|
898
1040
|
tableItems: any;
|
|
1041
|
+
selectedTableName: string | undefined;
|
|
899
1042
|
isTableLoadingOrFetching: boolean;
|
|
900
1043
|
isTableError: boolean;
|
|
901
1044
|
columns: TDataColumn[];
|
|
@@ -904,6 +1047,7 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
|
|
|
904
1047
|
isNonDbConnection: boolean;
|
|
905
1048
|
connectionType: any;
|
|
906
1049
|
tableName: any;
|
|
1050
|
+
formattedTableName: string;
|
|
907
1051
|
schemaName: string;
|
|
908
1052
|
refetchConnections: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
|
|
909
1053
|
refetchModels: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
|
|
@@ -925,12 +1069,12 @@ export declare function useTextFilterHook(filterId: string): {
|
|
|
925
1069
|
isLoading: boolean;
|
|
926
1070
|
isFetching: boolean;
|
|
927
1071
|
isError: boolean;
|
|
928
|
-
records:
|
|
929
|
-
selectedRecords:
|
|
1072
|
+
records: ComboBoxOption_2[];
|
|
1073
|
+
selectedRecords: ComboBoxOption_2[];
|
|
930
1074
|
handleChange: (selectedRecords: TSelectedRecord[]) => void;
|
|
931
1075
|
handleClear: () => void;
|
|
932
1076
|
handleSelectAll: (checked: boolean) => void;
|
|
933
|
-
filteredRecords:
|
|
1077
|
+
filteredRecords: ComboBoxOption_2[];
|
|
934
1078
|
isSingleSelect: boolean;
|
|
935
1079
|
allSelected: boolean;
|
|
936
1080
|
};
|
|
@@ -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;
|
|
@@ -18,6 +20,14 @@ export declare type AuthToken = {
|
|
|
18
20
|
refreshToken?: string;
|
|
19
21
|
};
|
|
20
22
|
|
|
23
|
+
declare interface BaseColumn {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
type: ColumnType;
|
|
28
|
+
table?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
declare type BaseCustomCard = {
|
|
22
32
|
cardId: string;
|
|
23
33
|
replaceDefault?: boolean;
|
|
@@ -62,6 +72,8 @@ export declare type ColorRange = {
|
|
|
62
72
|
color: string;
|
|
63
73
|
};
|
|
64
74
|
|
|
75
|
+
declare type ColumnType = 'string' | 'number' | 'date';
|
|
76
|
+
|
|
65
77
|
export declare type ConnectionPolicy = {
|
|
66
78
|
connectionId?: string;
|
|
67
79
|
name: string;
|
|
@@ -117,6 +129,8 @@ export declare type DateOptions = {
|
|
|
117
129
|
|
|
118
130
|
export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
119
131
|
|
|
132
|
+
export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
|
|
133
|
+
|
|
120
134
|
export declare type EmailSettings = {
|
|
121
135
|
companyName: string;
|
|
122
136
|
dashboardUrl: string;
|
|
@@ -124,10 +138,22 @@ export declare type EmailSettings = {
|
|
|
124
138
|
senderTitle: string;
|
|
125
139
|
};
|
|
126
140
|
|
|
141
|
+
export declare const EMPTY_SELECTION: SelectionState;
|
|
142
|
+
|
|
127
143
|
export declare type ErrorProps = {
|
|
128
144
|
message?: string;
|
|
129
145
|
};
|
|
130
146
|
|
|
147
|
+
declare interface FilterByColumn extends BaseColumn {
|
|
148
|
+
role: 'filter';
|
|
149
|
+
operators?: string[];
|
|
150
|
+
sql?: string;
|
|
151
|
+
fetchValues?: boolean;
|
|
152
|
+
fetchLimit?: number;
|
|
153
|
+
valueSource?: 'distinct' | 'static' | 'range';
|
|
154
|
+
staticValues?: string[];
|
|
155
|
+
}
|
|
156
|
+
|
|
131
157
|
declare type FilterForBetween = BaseFilter & {
|
|
132
158
|
operation: 'between' | 'not between';
|
|
133
159
|
values: [number, number];
|
|
@@ -165,6 +191,8 @@ declare type FilterOnClick = {
|
|
|
165
191
|
columnIndex: number;
|
|
166
192
|
};
|
|
167
193
|
|
|
194
|
+
declare type FilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
195
|
+
|
|
168
196
|
export declare type GetDashboardResponse = {
|
|
169
197
|
dashboard: TDashboard;
|
|
170
198
|
lenses: TLens[];
|
|
@@ -179,6 +207,14 @@ export declare type GetPluginsResponse = {
|
|
|
179
207
|
}[];
|
|
180
208
|
};
|
|
181
209
|
|
|
210
|
+
declare type Granularity = 'day' | 'week' | 'month' | 'year';
|
|
211
|
+
|
|
212
|
+
declare interface GroupByColumn extends BaseColumn {
|
|
213
|
+
role: 'groupby';
|
|
214
|
+
granularity?: Granularity;
|
|
215
|
+
format?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
182
218
|
export declare type HtmlOptions = {
|
|
183
219
|
html: string;
|
|
184
220
|
};
|
|
@@ -189,10 +225,18 @@ export declare type KPICardProps = {
|
|
|
189
225
|
renderFilterInfo?: () => JSX.Element | null;
|
|
190
226
|
};
|
|
191
227
|
|
|
228
|
+
export declare type Level = 'database' | 'schema' | 'table';
|
|
229
|
+
|
|
192
230
|
export declare type LoadingProps = {
|
|
193
231
|
message?: string;
|
|
194
232
|
};
|
|
195
233
|
|
|
234
|
+
declare interface MetricColumn extends BaseColumn {
|
|
235
|
+
role: 'metric';
|
|
236
|
+
aggregate: AggregateFunction;
|
|
237
|
+
aliasTemplate?: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
196
240
|
declare type NoneOptions = {};
|
|
197
241
|
|
|
198
242
|
export declare type NumberAxisFormat = {
|
|
@@ -219,6 +263,11 @@ declare type OptionsMap = {
|
|
|
219
263
|
none: NoneOptions;
|
|
220
264
|
};
|
|
221
265
|
|
|
266
|
+
declare interface OrderBy {
|
|
267
|
+
columnId: string;
|
|
268
|
+
direction: 'asc' | 'desc';
|
|
269
|
+
}
|
|
270
|
+
|
|
222
271
|
declare type Params = {
|
|
223
272
|
[key: string]: string | number | string[] | number[];
|
|
224
273
|
};
|
|
@@ -234,6 +283,29 @@ export declare type Placeholders = {
|
|
|
234
283
|
SessionExpired?: React.ReactNode;
|
|
235
284
|
};
|
|
236
285
|
|
|
286
|
+
declare interface QueryConfig {
|
|
287
|
+
groupByColumns?: GroupByColumn[];
|
|
288
|
+
pivotColumns?: GroupByColumn[];
|
|
289
|
+
metricColumns?: MetricColumn[];
|
|
290
|
+
filterColumns?: FilterByColumn[];
|
|
291
|
+
filters?: {
|
|
292
|
+
filterColumnName: string;
|
|
293
|
+
filterValue: FilterValue;
|
|
294
|
+
exclude?: boolean;
|
|
295
|
+
}[];
|
|
296
|
+
limit?: number;
|
|
297
|
+
orderBy?: OrderBy[];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare type RangeValue = {
|
|
301
|
+
gte?: string | number;
|
|
302
|
+
lte?: string | number;
|
|
303
|
+
lt?: string | number;
|
|
304
|
+
gt?: string | number;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export declare type SelectionState = Record<Level, string | null>;
|
|
308
|
+
|
|
237
309
|
export declare type SqlGen = {
|
|
238
310
|
measures?: {
|
|
239
311
|
name: string;
|
|
@@ -310,6 +382,7 @@ export declare type TCard = {
|
|
|
310
382
|
type: TChartType;
|
|
311
383
|
sql?: string;
|
|
312
384
|
python?: string;
|
|
385
|
+
queryConfig?: QueryConfig;
|
|
313
386
|
customCfg?: any;
|
|
314
387
|
preferences?: TCardPreferences;
|
|
315
388
|
customCardPreferences?: TCustomCardPreferences;
|
|
@@ -360,6 +433,9 @@ export declare type TCardPreferences = {
|
|
|
360
433
|
projectionOffset?: [number, number];
|
|
361
434
|
colorScale?: string;
|
|
362
435
|
};
|
|
436
|
+
kpiVisualOptions?: {
|
|
437
|
+
lowerIsBetter?: boolean;
|
|
438
|
+
};
|
|
363
439
|
};
|
|
364
440
|
|
|
365
441
|
export declare type TChartOptions = {
|
|
@@ -397,7 +473,7 @@ export declare type TChartOptions = {
|
|
|
397
473
|
};
|
|
398
474
|
};
|
|
399
475
|
|
|
400
|
-
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
|
|
476
|
+
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
|
|
401
477
|
|
|
402
478
|
export declare type TColumnSetting<T extends DisplayDataType> = {
|
|
403
479
|
columnIdx: number;
|
|
@@ -439,6 +515,7 @@ export declare type TDashboard = {
|
|
|
439
515
|
globalStyle?: TStyle;
|
|
440
516
|
globalCacheConfig?: CacheConfig;
|
|
441
517
|
emailSettings?: EmailSettings;
|
|
518
|
+
defaultFilterValues?: TFilterValue[];
|
|
442
519
|
};
|
|
443
520
|
|
|
444
521
|
export declare type TDataColumn = {
|
|
@@ -460,6 +537,11 @@ export declare type TDatasetOptions = {
|
|
|
460
537
|
};
|
|
461
538
|
};
|
|
462
539
|
|
|
540
|
+
export declare type TDbCapabilities = {
|
|
541
|
+
path: Level[];
|
|
542
|
+
labels?: Partial<Record<Level, string>>;
|
|
543
|
+
};
|
|
544
|
+
|
|
463
545
|
export declare type TEvent = {
|
|
464
546
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
465
547
|
message: any;
|