react-semaphor 0.0.37719 → 0.1.1

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,22 +1,60 @@
1
+ import { ColumnSizingState } from '@tanstack/react-table';
1
2
  import { FontSpec } from 'chart.js';
2
3
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
4
 
4
5
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
5
6
 
7
+ declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
8
+
9
+ declare type AIContext = {
10
+ selectedEntities: SelectedEntities;
11
+ fileAttachments?: FileAttachment[];
12
+ };
13
+
6
14
  export declare type AIScopeTable = {
7
15
  connectionId: string;
8
16
  connectionType: string;
9
- databaseName?: string;
10
- schemaName?: string;
11
- tableName?: string;
12
- datamodelName?: string;
17
+ databaseName: string;
18
+ schemaName: string;
19
+ tableName: string;
20
+ datamodelId: string;
21
+ datamodelName: string;
13
22
  };
14
23
 
24
+ export declare type AssistantId = 'dashboard-assistant' | 'editor-assistant';
25
+
15
26
  export declare type AuthToken = {
16
27
  accessToken: string;
17
28
  refreshToken?: string;
18
29
  };
19
30
 
31
+ export declare type AxisConfig = {
32
+ enabled?: boolean;
33
+ name?: {
34
+ enabled: boolean;
35
+ text?: string;
36
+ };
37
+ position?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
38
+ labels?: {
39
+ enabled: boolean;
40
+ rotation?: 'auto' | 0 | 45 | 90 | -45 | -90;
41
+ };
42
+ formatOptions?: TFormatOptions;
43
+ scale?: {
44
+ min?: number | 'auto';
45
+ max?: number | 'auto';
46
+ stepSize?: number | 'auto';
47
+ };
48
+ };
49
+
50
+ declare interface BaseColumn {
51
+ id: string;
52
+ name: string;
53
+ label?: string;
54
+ type: ColumnType;
55
+ table?: string;
56
+ }
57
+
20
58
  declare type BaseCustomCard = {
21
59
  cardId: string;
22
60
  replaceDefault?: boolean;
@@ -37,6 +75,59 @@ export declare type CacheConfig = {
37
75
  status: 'on' | 'on-refresh' | 'off';
38
76
  };
39
77
 
78
+ declare interface CardConfig {
79
+ groupByColumns?: GroupByField[];
80
+ metricColumns?: MetricField[];
81
+ pivotByColumns?: PivotByField[];
82
+ sortByColumns?: SortByField[];
83
+ filters?: FilterGroup;
84
+ joinPlan?: JoinPlan;
85
+ rowLimit?: number;
86
+ /**
87
+ * One or more hierarchies that define drillable paths through dimensions.
88
+ */
89
+ drillHierarchies?: DrillHierarchy[];
90
+ /**
91
+ * Optional list of dimensions allowed for dynamic drill-down across this card.
92
+ * Used only when drill steps contain `mode: 'dynamicDrill'` or `type: 'dynamic'`.
93
+ */
94
+ allowedDrillTargets?: Field[];
95
+ /**
96
+ * NOT UOptional preload settings for inline drill previews
97
+ */
98
+ inlineDrillPreview?: {
99
+ enabled: boolean;
100
+ limit: number;
101
+ mode: 'lazy' | 'preloaded';
102
+ };
103
+ /**
104
+ * Configuration for on-click dashboard filters triggered by this card.
105
+ */
106
+ clickFilterInteractions?: ClickFilterInteraction[];
107
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target';
108
+ targetValue?: number;
109
+ showTrendline?: boolean;
110
+ trendlineWindow?: number;
111
+ trendlineGranularity?: 'day' | 'week' | 'month';
112
+ rowAggregates?: Array<{
113
+ label?: string;
114
+ function: AggregateFunction;
115
+ groupLevel: string | 'ALL';
116
+ }>;
117
+ columnAggregates?: Array<{
118
+ label?: string;
119
+ function: AggregateFunction;
120
+ pivotLevel: string | 'ALL';
121
+ }>;
122
+ }
123
+
124
+ declare interface CardInteractionConfig {
125
+ allowedDrillTargets?: Field[];
126
+ drillHierarchies?: DrillHierarchy[];
127
+ drillInteractions?: DrillInteraction[];
128
+ clickFilterInteractions?: ClickFilterInteraction[];
129
+ }
130
+
40
131
  declare type CardWithContent = BaseCustomCard & {
41
132
  content: React.FC<{
42
133
  card: TCard;
@@ -55,21 +146,126 @@ declare type CardWithFooter = BaseCustomCard & {
55
146
  }>;
56
147
  };
57
148
 
149
+ declare interface ClickFilterInteraction {
150
+ mode: 'clickFilter';
151
+ /**
152
+ * Fields from the chart element that should be used as filters.
153
+ * e.g., [region, ship_mode] from a stacked bar chart
154
+ */
155
+ filterFields: Field[];
156
+ /**
157
+ * Should this card visually highlight when clicked?
158
+ */
159
+ highlightSelf?: boolean;
160
+ /**
161
+ * Cards this filter applies to (inclusive).
162
+ * If omitted and `excludeCardIds` is also omitted → applies to all cards except self.
163
+ */
164
+ applyToCardIds?: string[];
165
+ /**
166
+ * Cards to explicitly exclude from receiving this filter.
167
+ * Takes effect only if `applyToCardIds` is undefined (acts as override).
168
+ */
169
+ excludeCardIds?: string[];
170
+ /**
171
+ * Optional UI label or tooltip.
172
+ */
173
+ label?: string;
174
+ }
175
+
176
+ export declare type ColorConfig = {
177
+ segments: Record<string, string>;
178
+ };
179
+
58
180
  export declare type ColorRange = {
59
181
  start: number;
60
182
  end: number;
61
183
  color: string;
62
184
  };
63
185
 
186
+ declare interface ColorRange_2 {
187
+ min: number;
188
+ max: number;
189
+ color: string;
190
+ applyTo: 'cell' | 'row';
191
+ }
192
+
193
+ declare interface ColumnSettings {
194
+ type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
195
+ textAlign: 'left' | 'center' | 'right';
196
+ width: number;
197
+ minWidth?: number;
198
+ maxWidth?: number;
199
+ textOverflow?: 'ellipsis' | 'wrap' | 'clip';
200
+ textWrap: 'wrap' | 'nowrap';
201
+ numberFormat: {
202
+ style: 'decimal' | 'currency' | 'percent';
203
+ currency: string;
204
+ locale: string;
205
+ minimumFractionDigits: number;
206
+ maximumFractionDigits: number;
207
+ showDataBar: boolean;
208
+ dataBarColor: string;
209
+ dataBarMinValue?: number;
210
+ dataBarMaxValue?: number;
211
+ };
212
+ dateFormat: {
213
+ format: string;
214
+ useCustomFormat: boolean;
215
+ customFormat: string;
216
+ useRelativeTime: boolean;
217
+ timezone?: string;
218
+ sourceTimezone?: string;
219
+ };
220
+ colorRanges: ColorRange_2[];
221
+ }
222
+
223
+ declare type ColumnSettingsMap = Record<string, ColumnSettings>;
224
+
225
+ declare type ColumnType = 'string' | 'number' | 'date';
226
+
64
227
  export declare type ConnectionPolicy = {
65
228
  connectionId?: string;
66
229
  name: string;
67
230
  params: Params;
68
231
  };
69
232
 
233
+ declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
234
+
70
235
  export declare type CustomCard = CardWithContent | CardWithFooter;
71
236
 
72
- export declare function Dashboard(props: DashboardProps): JSX_2.Element;
237
+ export declare function Dashboard(props: DashboardProps): JSX_2.Element | null;
238
+
239
+ export declare type DashboardEventHandlers = {
240
+ onExportData?: (payload: ExportDataPayload) => void;
241
+ };
242
+
243
+ /**
244
+ * Unified dashboard preferences for both card display and UI modes
245
+ */
246
+ export declare type DashboardPreferences = {
247
+ /**
248
+ * Visual display preferences for cards
249
+ * Controls how card content is rendered (headers, footers, etc.)
250
+ */
251
+ cardDisplay?: VisualDisplayPreferences;
252
+ /**
253
+ * UI modes for developer and debug features
254
+ * Controls what developer tools and debug panels are available
255
+ */
256
+ uiMode?: {
257
+ /**
258
+ * Enable developer mode
259
+ * Shows additional controls and debug information
260
+ */
261
+ developer?: boolean;
262
+ /**
263
+ * Enable console mode
264
+ * Shows console panel for debugging
265
+ */
266
+ console?: boolean;
267
+ };
268
+ };
73
269
 
74
270
  export declare type DashboardProps = {
75
271
  id?: string;
@@ -80,10 +276,7 @@ export declare type DashboardProps = {
80
276
  /**
81
277
  * Default filter values for the dashboard. The dashboard will be filtered by these values when the user loads the dashboard.
82
278
  */
83
- defaultFilterValues?: {
84
- filterId: string;
85
- values: string[] | number[];
86
- }[] | TFilterValue[];
279
+ defaultFilterValues?: TFilterValue[];
87
280
  customStyle?: TStyle;
88
281
  currentTheme?: Theme;
89
282
  version?: string;
@@ -95,6 +288,7 @@ export declare type DashboardProps = {
95
288
  onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
96
289
  LoadingComponent?: (props: LoadingProps) => React.ReactNode;
97
290
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
291
+ eventHandlers?: DashboardEventHandlers;
98
292
  /**
99
293
  * Placeholders for the dashboard.
100
294
  */
@@ -103,20 +297,201 @@ export declare type DashboardProps = {
103
297
  * The id of the sheet to be selected when the dashboard is loaded.
104
298
  */
105
299
  selectedSheetId?: string;
300
+ /**
301
+ * Unified preferences for dashboard configuration
302
+ * Includes both card display preferences and UI mode settings
303
+ */
304
+ preferences?: DashboardPreferences;
106
305
  };
107
306
 
307
+ declare interface DatabaseEntityReference {
308
+ connectionId: string;
309
+ connectionType: ConnectionType;
310
+ type: EntityType;
311
+ dbObjectType?: string;
312
+ dialect?: Dialect;
313
+ database?: string;
314
+ schema?: string;
315
+ name: string;
316
+ }
317
+
318
+ declare type DatabaseEntityType = 'table' | 'view';
319
+
320
+ declare interface DataModelEntityReference extends DatabaseEntityReference {
321
+ type: 'model';
322
+ id: string;
323
+ label: string;
324
+ description: string;
325
+ }
326
+
327
+ declare interface DataSource {
328
+ connectionId: string;
329
+ semanticDomainId?: string;
330
+ connectionType: string;
331
+ mode: 'database' | 'upload' | 'url' | 'semanticDomain';
332
+ dbSelection?: {
333
+ database: string;
334
+ schema: string;
335
+ entityType: DatabaseEntityType;
336
+ };
337
+ selectedEntities: SelectedEntities;
338
+ }
339
+
340
+ declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
341
+
342
+ declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
343
+
108
344
  export declare type DateOptions = {
109
345
  locale: string;
110
346
  format: string;
111
347
  options: Intl.DateTimeFormatOptions;
112
348
  };
113
349
 
350
+ declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb';
351
+
114
352
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
115
353
 
354
+ declare interface DrillHierarchy {
355
+ id: string;
356
+ label?: string;
357
+ type: 'static';
358
+ steps: DrillHierarchyStep[];
359
+ default?: boolean;
360
+ }
361
+
362
+ declare interface DrillHierarchyStep {
363
+ field: Field;
364
+ mode: 'drillDown';
365
+ preferredChartType?: TChartType;
366
+ breadcrumbLabelTemplate?: string;
367
+ retainFilters?: boolean;
368
+ label?: string;
369
+ linkedInsightId?: string;
370
+ }
371
+
372
+ declare type DrillInteraction = DrillThroughInteraction | DrillToDetailInteraction | DrillToURLInteraction | InlineDrillInteraction;
373
+
374
+ declare interface DrillThroughInteraction {
375
+ mode: 'drillThrough';
376
+ filterFields: Field[];
377
+ targetSheetId: string;
378
+ label?: string;
379
+ }
380
+
381
+ declare interface DrillToDetailInteraction {
382
+ mode: 'drillToDetail';
383
+ filterFields: Field[];
384
+ detailFields?: Field[];
385
+ sortBy?: SortByField[];
386
+ limit?: number;
387
+ detailTitle?: string;
388
+ label?: string;
389
+ }
390
+
391
+ declare interface DrillToURLInteraction {
392
+ mode: 'drillToURL';
393
+ filterFields: Field[];
394
+ urlTemplate: string;
395
+ label?: string;
396
+ }
397
+
398
+ export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
399
+
400
+ export declare type EmailSettings = {
401
+ companyName: string;
402
+ dashboardUrl: string;
403
+ supportEmail: string;
404
+ senderTitle: string;
405
+ };
406
+
407
+ export declare const EMPTY_SELECTION: SelectionState;
408
+
409
+ declare type EntityType = 'table' | 'view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
410
+
116
411
  export declare type ErrorProps = {
117
412
  message?: string;
118
413
  };
119
414
 
415
+ export declare type ExportDataPayload = {
416
+ cardId: string;
417
+ title: string;
418
+ data: Record<string, any>[];
419
+ sql: string;
420
+ };
421
+
422
+ declare interface Field {
423
+ /**
424
+ * Unique identifier for this field instance (for joins, UI state, etc.).
425
+ * Should be unique within the context of the query or data model.
426
+ * Example: 'orders.customer_id', 'expr_12345', etc.
427
+ */
428
+ id: string;
429
+ /**
430
+ * The physical/source column name in the database or data source.
431
+ * Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
432
+ */
433
+ name: string;
434
+ /**
435
+ * Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
436
+ */
437
+ label: string;
438
+ /**
439
+ * Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
440
+ * If not provided, should be auto-generated from label or name.
441
+ */
442
+ alias?: string;
443
+ qualifiedFieldName: string;
444
+ dataType: string;
445
+ description?: string;
446
+ qualifiedEntityName?: string;
447
+ dateFormat?: DateFormatValue;
448
+ customFormat?: string;
449
+ granularity?: TimeGranularity;
450
+ entityId: string;
451
+ entityName: string;
452
+ entityType: EntityType;
453
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
454
+ }
455
+
456
+ declare type FileAttachment = {
457
+ id: string;
458
+ name: string;
459
+ size: number;
460
+ type: string;
461
+ data?: string;
462
+ url?: string;
463
+ preview?: string;
464
+ uploadProgress?: number;
465
+ };
466
+
467
+ declare interface FileEntityReference extends DatabaseEntityReference {
468
+ id: string;
469
+ type: 'file' | 'url' | 'upload';
470
+ label: string;
471
+ description: string;
472
+ originalName: string;
473
+ file?: File;
474
+ url?: string;
475
+ }
476
+
477
+ declare interface FilterByColumn extends BaseColumn {
478
+ role: 'filter';
479
+ operators?: string[];
480
+ mode?: 'include' | 'exclude';
481
+ sql?: string;
482
+ fetchValues?: boolean;
483
+ fetchLimit?: number;
484
+ valueSource?: 'distinct' | 'static' | 'range';
485
+ staticValues?: string[];
486
+ }
487
+
488
+ declare interface FilterCondition {
489
+ id: string;
490
+ field: Field;
491
+ operator: Operator;
492
+ value: FilterValue;
493
+ }
494
+
120
495
  declare type FilterForBetween = BaseFilter & {
121
496
  operation: 'between' | 'not between';
122
497
  values: [number, number];
@@ -147,6 +522,14 @@ declare type FilterForString = BaseFilter & {
147
522
  values: [string];
148
523
  };
149
524
 
525
+ declare interface FilterGroup {
526
+ id: string;
527
+ logicalOperator: LogicalOperator;
528
+ negate: boolean;
529
+ conditions: FilterCondition[];
530
+ groups: FilterGroup[];
531
+ }
532
+
150
533
  declare type FilterLocation = 'dashboard' | 'frame' | undefined;
151
534
 
152
535
  declare type FilterOnClick = {
@@ -154,6 +537,8 @@ declare type FilterOnClick = {
154
537
  columnIndex: number;
155
538
  };
156
539
 
540
+ declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
541
+
157
542
  export declare type GetDashboardResponse = {
158
543
  dashboard: TDashboard;
159
544
  lenses: TLens[];
@@ -165,23 +550,122 @@ export declare type GetPluginsResponse = {
165
550
  plugins: {
166
551
  label: string;
167
552
  value: string;
553
+ type: PluginType;
168
554
  }[];
169
555
  };
170
556
 
557
+ declare type Granularity = 'day' | 'week' | 'month' | 'year';
558
+
559
+ declare interface GroupByColumn extends BaseColumn {
560
+ role: 'groupby';
561
+ granularity?: Granularity;
562
+ format?: string;
563
+ }
564
+
565
+ declare interface GroupByField extends Field {
566
+ role: 'groupby';
567
+ granularity?: 'day' | 'week' | 'month' | 'quarter' | 'year';
568
+ /**
569
+ * Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
570
+ * If present, used in SELECT and GROUP BY instead of just the column name.
571
+ */
572
+ expression?: string;
573
+ timeDrillPath?: TimeDrillStep[];
574
+ }
575
+
171
576
  export declare type HtmlOptions = {
172
577
  html: string;
173
578
  };
174
579
 
580
+ declare interface InlineDrillInteraction {
581
+ mode: 'inlineDrill';
582
+ filterFields: Field[];
583
+ fetchMode?: 'lazy' | 'preloaded';
584
+ inlineLimit?: number;
585
+ label?: string;
586
+ }
587
+
588
+ declare interface Join {
589
+ id: string;
590
+ source: DatabaseEntityReference;
591
+ target: DatabaseEntityReference;
592
+ joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
593
+ joinKeyGroups: JoinKeyGroup[];
594
+ sequence: number;
595
+ }
596
+
597
+ declare interface JoinKey {
598
+ id?: string;
599
+ source: Field;
600
+ target: Field;
601
+ operator: string;
602
+ }
603
+
604
+ declare interface JoinKeyGroup {
605
+ id: string;
606
+ operator: string;
607
+ keys: JoinKey[];
608
+ }
609
+
610
+ declare interface JoinPlan {
611
+ baseEntity: DatabaseEntityReference;
612
+ joins: Join[];
613
+ }
614
+
175
615
  export declare type KPICardProps = {
176
616
  card: TCard;
177
617
  isLoading?: boolean;
178
618
  renderFilterInfo?: () => JSX.Element | null;
179
619
  };
180
620
 
621
+ export declare type Level = 'database' | 'schema' | 'table';
622
+
181
623
  export declare type LoadingProps = {
182
624
  message?: string;
183
625
  };
184
626
 
627
+ declare type LogicalOperator = 'AND' | 'OR';
628
+
629
+ declare interface MetricColumn extends BaseColumn {
630
+ role: 'metric';
631
+ aggregate: AggregateFunction;
632
+ aliasTemplate?: string;
633
+ }
634
+
635
+ declare interface MetricField extends Field {
636
+ role: 'metric';
637
+ aggregate: AggregateFunction;
638
+ /**
639
+ * Optional SQL expression for the metric (e.g., ship_date - order_date).
640
+ * If present, used as aggregate(expression) instead of aggregate(name).
641
+ */
642
+ expression?: string;
643
+ /**
644
+ * Optional parameters for future extensibility (e.g., window functions).
645
+ * * Example:
646
+ * {
647
+ aggregate: "SUM",
648
+ name: "sales",
649
+ parameters: {
650
+ window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
651
+ }
652
+ }
653
+
654
+ {
655
+ aggregate: "COUNT",
656
+ name: "order_id",
657
+ parameters: {
658
+ filter: "status = 'Active'"
659
+ }
660
+ }
661
+ */
662
+ parameters?: {
663
+ filters?: FilterGroup;
664
+ };
665
+ aliasTemplate?: string;
666
+ valueAliases?: Record<string, string>;
667
+ }
668
+
185
669
  declare type NoneOptions = {};
186
670
 
187
671
  export declare type NumberAxisFormat = {
@@ -198,8 +682,12 @@ export declare type NumberOptions = {
198
682
  colorRanges?: ColorRange[];
199
683
  };
200
684
 
685
+ declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
686
+
201
687
  declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
202
688
 
689
+ declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between' | 'isNull' | 'isNotNull';
690
+
203
691
  declare type OptionsMap = {
204
692
  number: NumberOptions;
205
693
  string: StringOptions;
@@ -208,10 +696,27 @@ declare type OptionsMap = {
208
696
  none: NoneOptions;
209
697
  };
210
698
 
699
+ declare interface OrderBy {
700
+ columnId: string;
701
+ direction: 'asc' | 'desc';
702
+ }
703
+
704
+ /**
705
+ * Pagination configuration for table queries
706
+ */
707
+ declare interface PaginationConfig {
708
+ page: number;
709
+ pageSize: number;
710
+ }
711
+
211
712
  declare type Params = {
212
713
  [key: string]: string | number | string[] | number[];
213
714
  };
214
715
 
716
+ declare interface PivotByField extends Field {
717
+ role: 'pivotby';
718
+ }
719
+
215
720
  export declare type Placeholders = {
216
721
  /**
217
722
  * Placeholder for the card when there are no records to display.
@@ -223,6 +728,39 @@ export declare type Placeholders = {
223
728
  SessionExpired?: React.ReactNode;
224
729
  };
225
730
 
731
+ export declare type PluginType = 'custom' | 'standard';
732
+
733
+ declare interface QueryConfig {
734
+ groupByColumns?: GroupByColumn[];
735
+ pivotColumns?: GroupByColumn[];
736
+ metricColumns?: MetricColumn[];
737
+ filterColumns?: FilterByColumn[];
738
+ filters?: QueryFilter[];
739
+ limit?: number;
740
+ orderBy?: OrderBy[];
741
+ }
742
+
743
+ declare type QueryFilter = {
744
+ filterColumnName: string;
745
+ filterValue: OldFilterValue;
746
+ };
747
+
748
+ declare type RangeValue = {
749
+ gte?: string | number;
750
+ lte?: string | number;
751
+ lt?: string | number;
752
+ gt?: string | number;
753
+ };
754
+
755
+ declare type SelectedEntities = DatabaseEntityReference[] | DataModelEntityReference[] | FileEntityReference[];
756
+
757
+ export declare type SelectionState = Record<Level, string | null>;
758
+
759
+ declare interface SortByField extends Field {
760
+ role: 'sortby';
761
+ direction: 'asc' | 'desc';
762
+ }
763
+
226
764
  export declare type SqlGen = {
227
765
  measures?: {
228
766
  name: string;
@@ -250,6 +788,14 @@ export declare type StyleProps = {
250
788
  dashboardCardContainer?: string;
251
789
  dashboardCard?: string;
252
790
  /** grid-layout config */
791
+ /**
792
+ * Border radius for the control inputs such as filter input, tabs, date picker, etc.
793
+ */
794
+ controlInputRadius?: number;
795
+ /**
796
+ * Border radius for the cards
797
+ */
798
+ cardBorderRadius?: number;
253
799
  gridLayout?: {
254
800
  /** css class for `react-grid-layout` */
255
801
  className?: string;
@@ -268,6 +814,15 @@ export declare type StyleProps = {
268
814
  };
269
815
  };
270
816
 
817
+ declare type TablePreferences = {
818
+ columnSettingsMap?: ColumnSettingsMap;
819
+ selectColumnVisible?: boolean;
820
+ columnVisibility?: Record<string, boolean>;
821
+ columnSizing?: ColumnSizingState;
822
+ pageSize?: number;
823
+ enableDevModePagination?: boolean;
824
+ };
825
+
271
826
  export declare type TBaseQuery = {
272
827
  id: string;
273
828
  name: string;
@@ -289,7 +844,11 @@ export declare type TCard = {
289
844
  type: TChartType;
290
845
  sql?: string;
291
846
  python?: string;
292
- cfg?: any;
847
+ dataSource?: DataSource;
848
+ config?: CardConfig;
849
+ interactionConfig?: CardInteractionConfig;
850
+ paginationConfig?: PaginationConfig;
851
+ queryConfig?: QueryConfig;
293
852
  customCfg?: any;
294
853
  preferences?: TCardPreferences;
295
854
  customCardPreferences?: TCustomCardPreferences;
@@ -298,6 +857,11 @@ export declare type TCard = {
298
857
  lastSelectedSchema?: string;
299
858
  lastSelectedTable?: string;
300
859
  refreshInterval?: string;
860
+ /**
861
+ * Card-specific display preferences that override dashboard-level preferences.
862
+ * If not specified, the card will use the dashboard's display preferences.
863
+ */
864
+ displayPreferences?: VisualDisplayPreferences;
301
865
  };
302
866
 
303
867
  export declare type TCardContext = {
@@ -325,6 +889,11 @@ export declare type TCardPreferences = {
325
889
  datasetOptions?: TDatasetOptions[];
326
890
  chartOptions?: TChartOptions;
327
891
  columnSettings?: TColumnSetting<DisplayDataType>[];
892
+ colorConfig?: ColorConfig;
893
+ xAxisConfig?: AxisConfig;
894
+ yAxisConfig?: AxisConfig;
895
+ dataLabelsConfig?: TDataLabelsConfig;
896
+ tablePrefs?: TablePreferences;
328
897
  allowDownload?: boolean;
329
898
  customVisualCode?: string;
330
899
  textVisualOptions?: {
@@ -340,32 +909,83 @@ export declare type TCardPreferences = {
340
909
  projectionOffset?: [number, number];
341
910
  colorScale?: string;
342
911
  };
912
+ kpiVisualOptions?: {
913
+ lowerIsBetter?: boolean;
914
+ countryLogoId?: string;
915
+ valueAlignment?: 'left' | 'center';
916
+ formatOptions?: TFormatOptions;
917
+ metricComparison?: {
918
+ enabled?: boolean;
919
+ calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
920
+ formatOptions?: TFormatOptions;
921
+ showArrow?: boolean;
922
+ showColor?: boolean;
923
+ conditionalLabel?: boolean;
924
+ labelName?: string;
925
+ position?: 'left' | 'right' | 'top';
926
+ conditionalLabels?: {
927
+ increase?: string;
928
+ decrease?: string;
929
+ noChange?: string;
930
+ };
931
+ colorConfig?: {
932
+ increase?: 'green' | 'red' | 'neutral' | string;
933
+ decrease?: 'green' | 'red' | 'neutral' | string;
934
+ noChange?: 'green' | 'red' | 'neutral' | string;
935
+ };
936
+ };
937
+ };
938
+ pivotTableOptions?: {
939
+ showRowTotals?: boolean;
940
+ showColumnTotals?: boolean;
941
+ showGrandTotal?: boolean;
942
+ sortRowsBy?: 'label' | 'total' | 'metric';
943
+ sortColumnsBy?: 'label' | 'total' | 'metric';
944
+ };
945
+ displayOptions?: {
946
+ showFilterInfo?: boolean;
947
+ showCardToolbar?: boolean;
948
+ showChrome?: boolean;
949
+ allowScroll?: boolean;
950
+ };
343
951
  };
344
952
 
345
953
  export declare type TChartOptions = {
346
954
  type?: TChartType;
347
955
  scales?: {
348
956
  y?: {
349
- type: 'linear' | 'logarithmic';
350
- min: number;
351
- max: number;
352
- ticks: {
353
- stepSize: number;
957
+ type?: 'linear' | 'logarithmic';
958
+ min?: number;
959
+ max?: number;
960
+ ticks?: {
961
+ stepSize?: number;
962
+ };
963
+ grid?: {
964
+ display?: boolean;
354
965
  };
355
966
  };
356
967
  x?: {
357
- type: 'linear' | 'logarithmic';
358
- min: number;
359
- max: number;
360
- ticks: {
361
- stepSize: number;
968
+ type?: 'linear' | 'logarithmic';
969
+ min?: number;
970
+ max?: number;
971
+ ticks?: {
972
+ stepSize?: number;
973
+ };
974
+ grid?: {
975
+ display?: boolean;
362
976
  };
363
977
  };
364
978
  };
365
979
  indexAxis?: 'x' | 'y' | undefined;
980
+ plugins?: {
981
+ legend?: TLegendOptions;
982
+ datalabels?: {
983
+ anchor?: string;
984
+ };
985
+ };
366
986
  };
367
987
 
368
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
988
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
369
989
 
370
990
  export declare type TColumnSetting<T extends DisplayDataType> = {
371
991
  columnIdx: number;
@@ -380,6 +1000,7 @@ export declare type TCustomCardPreferences = {
380
1000
  url: string;
381
1001
  componentName: string;
382
1002
  icon?: string;
1003
+ pluginChartType?: string;
383
1004
  type?: 'iframe' | 'component';
384
1005
  visualType?: 'single' | 'multiple';
385
1006
  settings?: any;
@@ -397,6 +1018,7 @@ export declare type TCustomCardPreferences = {
397
1018
  export declare type TDashboard = {
398
1019
  id: string;
399
1020
  title?: string;
1021
+ aiContext?: AIContext;
400
1022
  description?: string;
401
1023
  sheets?: TSheet[];
402
1024
  style?: TStyle;
@@ -406,12 +1028,36 @@ export declare type TDashboard = {
406
1028
  aiScopeTables?: AIScopeTable[];
407
1029
  globalStyle?: TStyle;
408
1030
  globalCacheConfig?: CacheConfig;
1031
+ emailSettings?: EmailSettings;
1032
+ defaultFilterValues?: TFilterValue[];
409
1033
  };
410
1034
 
411
1035
  export declare type TDataColumn = {
412
1036
  column_name: string;
413
1037
  data_type: string;
414
1038
  is_nullable?: string;
1039
+ label?: string;
1040
+ description?: string;
1041
+ qualifiedFieldName?: string;
1042
+ };
1043
+
1044
+ export declare type TDataLabelsConfig = {
1045
+ enabled?: boolean;
1046
+ position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'auto' | 'custom';
1047
+ anchor?: 'center' | 'start' | 'end';
1048
+ align?: 'center' | 'start' | 'end' | 'top' | 'bottom' | number;
1049
+ display?: 'auto' | boolean;
1050
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'none';
1051
+ formatOptions?: TFormatOptions;
1052
+ font?: {
1053
+ size?: number;
1054
+ weight?: 'normal' | 'bold';
1055
+ };
1056
+ color?: 'auto' | string;
1057
+ clamp?: boolean;
1058
+ clip?: boolean;
1059
+ rotation?: number;
1060
+ showTotal?: boolean;
415
1061
  };
416
1062
 
417
1063
  export declare type TDatasetOptions = {
@@ -427,6 +1073,11 @@ export declare type TDatasetOptions = {
427
1073
  };
428
1074
  };
429
1075
 
1076
+ export declare type TDbCapabilities = {
1077
+ path: Level[];
1078
+ labels?: Partial<Record<Level, string>>;
1079
+ };
1080
+
430
1081
  export declare type TEvent = {
431
1082
  type: 'success' | 'error' | 'info' | 'warning';
432
1083
  message: any;
@@ -447,12 +1098,30 @@ declare type TFilter = {
447
1098
  database: string;
448
1099
  sql: string;
449
1100
  operation: Operation;
1101
+ applyToSheetIds?: string[];
1102
+ excludeSheetIds?: string[];
1103
+ applyToCardIds?: string[];
1104
+ excludeCardIds?: string[];
450
1105
  };
451
1106
 
452
1107
  declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForDate;
453
1108
 
1109
+ export declare type TFormatOptions = {
1110
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
1111
+ decimalPlaces?: number;
1112
+ currency?: string;
1113
+ locale?: string;
1114
+ prefix?: string;
1115
+ suffix?: string;
1116
+ useSuffix?: boolean;
1117
+ negativeInParentheses?: boolean;
1118
+ multiplyBy?: number;
1119
+ dateFormat?: string;
1120
+ };
1121
+
454
1122
  export declare type TFrame = {
455
1123
  id: string;
1124
+ visualId?: string;
456
1125
  filterId?: string;
457
1126
  cards: TCard[];
458
1127
  activeCardId: string;
@@ -460,6 +1129,21 @@ export declare type TFrame = {
460
1129
 
461
1130
  export declare type Theme = 'dark' | 'light' | 'system';
462
1131
 
1132
+ declare interface TimeDrillStep {
1133
+ granularity: TimeGranularity;
1134
+ next?: TimeGranularity;
1135
+ comparison?: 'previous_year' | 'previous_period';
1136
+ rollingWindow?: number;
1137
+ }
1138
+
1139
+ declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year';
1140
+
1141
+ export declare type TLegendOptions = {
1142
+ display?: boolean;
1143
+ position?: 'top' | 'left' | 'bottom' | 'right';
1144
+ align?: 'start' | 'center' | 'end';
1145
+ };
1146
+
463
1147
  export declare type TLens = {
464
1148
  id: string;
465
1149
  name: string;
@@ -487,4 +1171,41 @@ export declare type TStyle = {
487
1171
  dark?: StyleProps;
488
1172
  };
489
1173
 
1174
+ /**
1175
+ * Display mode for visual components - controls which UI elements are shown
1176
+ */
1177
+ export declare type VisualDisplayMode = 'full' | 'content-only' | 'print' | 'embed' | 'table-print';
1178
+
1179
+ /**
1180
+ * Display preferences for controlling visual component rendering
1181
+ */
1182
+ export declare type VisualDisplayPreferences = {
1183
+ /**
1184
+ * Predefined display mode
1185
+ * - 'full': All UI elements (default)
1186
+ * - 'content-only': Just the visualization/table content
1187
+ * - 'print': Optimized for printing (shows title and description, hides interactive elements)
1188
+ * - 'embed': Minimal chrome for embedding in other contexts
1189
+ */
1190
+ mode?: VisualDisplayMode;
1191
+ /**
1192
+ * Override specific UI elements visibility
1193
+ * These overrides take precedence over the mode presets
1194
+ */
1195
+ overrides?: {
1196
+ showHeader?: boolean;
1197
+ showTitle?: boolean;
1198
+ showDescription?: boolean;
1199
+ showTabs?: boolean;
1200
+ showFooter?: boolean;
1201
+ showFilters?: boolean;
1202
+ showBreadcrumbs?: boolean;
1203
+ showRefreshIndicator?: boolean;
1204
+ showFilterInfo?: boolean;
1205
+ showPagination?: boolean;
1206
+ showTableToolbar?: boolean;
1207
+ showColumnSettings?: boolean;
1208
+ };
1209
+ };
1210
+
490
1211
  export { }