react-semaphor 0.1.309 → 0.1.311

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.
Files changed (51) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +4 -4
  3. package/dist/chunks/{braces-DEq8EJtw.js → braces-CSECDaJQ.js} +1 -1
  4. package/dist/chunks/{braces-BHDm9arh.js → braces-DwaAt32i.js} +1 -1
  5. package/dist/chunks/{chevrons-up-down-DDEY9beZ.js → chevrons-up-down-3vBEM7eI.js} +1 -1
  6. package/dist/chunks/{chevrons-up-down-Cbtggnqv.js → chevrons-up-down-DJhB8JNW.js} +1 -1
  7. package/dist/chunks/common-types-4bjoIgvm.js +75 -0
  8. package/dist/chunks/common-types-C73-Ud1-.js +1 -0
  9. package/dist/chunks/{dashboard-controls-Cp41403T.js → dashboard-controls-CeKjYa7s.js} +83 -83
  10. package/dist/chunks/{dashboard-controls-C_vjMmt2.js → dashboard-controls-Ds8Hmo3Q.js} +1 -1
  11. package/dist/chunks/{dashboard-filter-controls-button-tfjDO4D4.js → dashboard-filter-controls-button-CWL2jJcu.js} +1 -1
  12. package/dist/chunks/{dashboard-filter-controls-button-DFKZjkD4.js → dashboard-filter-controls-button-Tk5lhwVV.js} +4 -4
  13. package/dist/chunks/{dashboard-json-QR7WNDuO.js → dashboard-json-B_rQbUUz.js} +1 -1
  14. package/dist/chunks/{dashboard-json-Cc8S_uIr.js → dashboard-json-GL_IXTCk.js} +2 -2
  15. package/dist/chunks/{dashboard-summary-settings-dialog-qH6FOt7O.js → dashboard-summary-settings-dialog-CcszMc1A.js} +3 -3
  16. package/dist/chunks/{dashboard-summary-settings-dialog-CxXxzyRP.js → dashboard-summary-settings-dialog-DgqFlYl9.js} +1 -1
  17. package/dist/chunks/edit-dashboard-visual-Bu2rxJjm.js +183 -0
  18. package/dist/chunks/{edit-dashboard-visual-_BZQa5yI.js → edit-dashboard-visual-nGSsSTYx.js} +7057 -6964
  19. package/dist/chunks/{index-CSgoL0P9.js → index-9v7DehZd.js} +33036 -32819
  20. package/dist/chunks/{index-AerZtbg0.js → index-CGCrm-dj.js} +220 -220
  21. package/dist/chunks/{palette-CteErylX.js → palette-C5o9bLo6.js} +1 -1
  22. package/dist/chunks/{palette-CNKSAIrt.js → palette-CI2J34i6.js} +1 -1
  23. package/dist/chunks/{resource-management-panel-DbYkAk1I.js → resource-management-panel-CNmVHnCz.js} +1 -1
  24. package/dist/chunks/{resource-management-panel-CcFT7lpL.js → resource-management-panel-DTg9_DI9.js} +3 -3
  25. package/dist/chunks/{save-BVVnWGeb.js → save-CMv91_Hz.js} +1 -1
  26. package/dist/chunks/{save-B1-nDZwS.js → save-Cpz6BWx9.js} +1 -1
  27. package/dist/chunks/{switch-BZn7R_Cp.js → switch-Dhoqe3OE.js} +3534 -3494
  28. package/dist/chunks/switch-otrSiyjH.js +168 -0
  29. package/dist/chunks/{use-create-flow-overlay-state-CczjbVZY.js → use-create-flow-overlay-state-C8WGfC8T.js} +4 -4
  30. package/dist/chunks/{use-create-flow-overlay-state-DImkf832.js → use-create-flow-overlay-state-DiH6M1Cd.js} +1 -1
  31. package/dist/chunks/{use-visual-utils-BdHwrbtr.js → use-visual-utils-BeJ73yvV.js} +1 -1
  32. package/dist/chunks/{use-visual-utils-DczvWVbd.js → use-visual-utils-RkPa2gqQ.js} +2 -2
  33. package/dist/dashboard/index.cjs +1 -1
  34. package/dist/dashboard/index.js +2 -2
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.js +107 -104
  37. package/dist/style.css +1 -1
  38. package/dist/surfboard/index.cjs +1 -1
  39. package/dist/surfboard/index.js +3 -3
  40. package/dist/types/dashboard.d.ts +22 -7
  41. package/dist/types/index.cjs +1 -1
  42. package/dist/types/index.js +16 -7
  43. package/dist/types/main.d.ts +51 -7
  44. package/dist/types/shared.d.ts +22 -7
  45. package/dist/types/surfboard.d.ts +22 -7
  46. package/dist/types/types.d.ts +314 -58
  47. package/package.json +6 -1
  48. package/dist/chunks/common-types-C6cAQgyh.js +0 -9
  49. package/dist/chunks/common-types-nBuCd3u2.js +0 -1
  50. package/dist/chunks/edit-dashboard-visual-J7cHkCD6.js +0 -183
  51. package/dist/chunks/switch-BG4RWnrq.js +0 -168
@@ -4,7 +4,17 @@ import { JSX } from 'react';
4
4
 
5
5
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
6
6
 
7
- declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
7
+ /**
8
+ * Configuration for which aggregate functions to use and at which levels (by Field.id)
9
+ */
10
+ export declare interface AggregateConfig {
11
+ functions: AggregateFunction[];
12
+ levels?: string[];
13
+ }
14
+
15
+ export declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
16
+
17
+ export declare type AggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
8
18
 
9
19
  declare type AIContext = {
10
20
  selectedEntities: SelectedEntities;
@@ -347,6 +357,30 @@ export declare type CacheConfig = {
347
357
  status: 'on' | 'on-refresh' | 'off';
348
358
  };
349
359
 
360
+ /**
361
+ * Special entity name marker for calculated fields.
362
+ *
363
+ * Calculated fields are virtual/derived fields created from SQL expressions
364
+ * combining other metrics. They don't belong to any physical table/dataset.
365
+ *
366
+ * This marker is used to:
367
+ * 1. Identify calculated fields throughout the application
368
+ * 2. Exclude them from join resolution (since they're expressions, not table columns)
369
+ * 3. Distinguish them from actual table names in the system
370
+ *
371
+ * The join resolver filters out any fields with this entityName to avoid
372
+ * attempting to join to a non-existent "calculated" table.
373
+ *
374
+ * @example
375
+ * // A calculated field combining two metrics:
376
+ * {
377
+ * name: "profit",
378
+ * entityName: CALCULATED_FIELD_ENTITY_MARKER,
379
+ * expression: "(SUM(revenue) - SUM(cost))"
380
+ * }
381
+ */
382
+ export declare const CALCULATED_FIELD_ENTITY_MARKER: "SEMAPHOR_CALCULATED_FIELD";
383
+
350
384
  /**
351
385
  * Formula metadata for calculated fields (UI-only metadata)
352
386
  * This is supplementary data to help the UI display and edit calculated fields.
@@ -355,7 +389,7 @@ export declare type CacheConfig = {
355
389
  * IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
356
390
  * Both are generated together from the same dialog inputs, preventing drift.
357
391
  */
358
- declare interface CalculatedFieldFormula {
392
+ export declare interface CalculatedFieldFormula {
359
393
  operation: CalculatedFieldOperation;
360
394
  /**
361
395
  * Array of full MetricField objects used as inputs to the calculated field.
@@ -387,7 +421,7 @@ declare interface CalculatedFieldFormula {
387
421
  /**
388
422
  * Operations supported for calculated fields
389
423
  */
390
- declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
424
+ export declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
391
425
 
392
426
  /**
393
427
  * Calendar context for timezone-aware date operations.
@@ -418,9 +452,9 @@ export declare type CalendarContext = {
418
452
  };
419
453
  };
420
454
 
421
- declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | StringCanonicalFormat;
455
+ export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | StringCanonicalFormat;
422
456
 
423
- declare interface CardConfig {
457
+ export declare interface CardConfig {
424
458
  groupByColumns?: GroupByField[];
425
459
  metricColumns?: MetricField[];
426
460
  pivotByColumns?: PivotByField[];
@@ -487,7 +521,7 @@ declare interface CardInteractionConfig {
487
521
  drillHierarchies?: DrillHierarchy[];
488
522
  }
489
523
 
490
- declare type CardMode = 'explorer' | 'dev';
524
+ export declare type CardMode = 'explorer' | 'dev';
491
525
 
492
526
  declare type CardWithContent = BaseCustomCard & {
493
527
  content: React.FC<{
@@ -589,7 +623,7 @@ declare interface ColumnSettings {
589
623
  minWidth?: number;
590
624
  maxWidth?: number;
591
625
  textOverflow?: 'ellipsis' | 'wrap' | 'clip';
592
- textWrap: 'wrap' | 'nowrap';
626
+ textWrap: ColumnTextWrap;
593
627
  /** Deprecated/inert. Totals are controlled by tablePrefs.tableStyle.totals. */
594
628
  totalsBehavior?: TotalsBehavior;
595
629
  totalsLabel?: string;
@@ -628,6 +662,8 @@ declare interface ColumnSettings {
628
662
 
629
663
  declare type ColumnSettingsMap = Record<string, ColumnSettings>;
630
664
 
665
+ declare type ColumnTextWrap = 'default' | 'truncate' | 'wrap' | 'nowrap' | 'preserve';
666
+
631
667
  declare type ColumnType = 'string' | 'number' | 'date';
632
668
 
633
669
  declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
@@ -720,7 +756,9 @@ export declare type ConnectionPolicy = {
720
756
  params: Params;
721
757
  };
722
758
 
723
- declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
759
+ export declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
760
+
761
+ export declare type ContainerId = 'groupBy' | 'metrics' | 'pivotBy' | 'sortBy' | 'detailColumns' | 'source';
724
762
 
725
763
  export declare type ContextSource = {
726
764
  kind: AlertContextSourceKind;
@@ -1049,7 +1087,7 @@ export declare type DashboardProps = {
1049
1087
  preferences?: DashboardPreferences;
1050
1088
  };
1051
1089
 
1052
- declare interface DatabaseEntityReference {
1090
+ export declare interface DatabaseEntityReference {
1053
1091
  connectionId: string;
1054
1092
  connectionType: ConnectionType;
1055
1093
  type: EntityType;
@@ -1060,27 +1098,27 @@ declare interface DatabaseEntityReference {
1060
1098
  name: string;
1061
1099
  }
1062
1100
 
1063
- declare type DatabaseEntityType = 'table' | 'view' | 'materialized view';
1101
+ export declare type DatabaseEntityType = 'table' | 'view' | 'materialized view';
1064
1102
 
1065
- declare interface DataModelEntityReference extends DatabaseEntityReference {
1103
+ export declare interface DataModelEntityReference extends DatabaseEntityReference {
1066
1104
  type: 'model';
1067
1105
  id: string;
1068
1106
  label: string;
1069
1107
  description: string;
1070
1108
  }
1071
1109
 
1072
- declare interface DatasetEntityReference extends DatabaseEntityReference {
1110
+ export declare interface DatasetEntityReference extends DatabaseEntityReference {
1073
1111
  type: 'dataset';
1074
1112
  datasetType: 'physical' | 'virtual';
1075
- datamodelId: string;
1076
- sql: string;
1113
+ datamodelId?: string | null;
1114
+ sql?: string | null;
1077
1115
  id: string;
1078
1116
  domainId: string;
1079
1117
  label: string;
1080
- description: string;
1118
+ description?: string;
1081
1119
  }
1082
1120
 
1083
- declare interface DataSource {
1121
+ export declare interface DataSource {
1084
1122
  connectionId: string;
1085
1123
  semanticDomainId?: string;
1086
1124
  connectionType: string;
@@ -1093,7 +1131,9 @@ declare interface DataSource {
1093
1131
  selectedEntities: SelectedEntities;
1094
1132
  }
1095
1133
 
1096
- 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", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "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"];
1134
+ export declare type DataType = 'string' | 'number' | 'date' | 'datetime' | 'boolean' | 'json' | 'geo';
1135
+
1136
+ export 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", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "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"];
1097
1137
 
1098
1138
  declare type DateCanonicalFormat = {
1099
1139
  type: 'date';
@@ -1106,7 +1146,14 @@ declare type DateCanonicalFormat = {
1106
1146
  suffix?: string;
1107
1147
  };
1108
1148
 
1109
- declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
1149
+ export declare type DateComparisonOperation = Extract<Operation, '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'not between' | 'is null' | 'is not null'>;
1150
+
1151
+ export declare type DateFormatOption = {
1152
+ value: DateFormatValue;
1153
+ label: string;
1154
+ };
1155
+
1156
+ export declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
1110
1157
 
1111
1158
  export declare type DateOptions = {
1112
1159
  locale: string;
@@ -1114,9 +1161,11 @@ export declare type DateOptions = {
1114
1161
  options: Intl.DateTimeFormatOptions;
1115
1162
  };
1116
1163
 
1117
- declare type DateSelectionMode = 'range' | 'months';
1164
+ export declare type DateSelectionMode = 'range' | 'months';
1165
+
1166
+ export declare type DateUnit = RelativeDateFilter['unit'];
1118
1167
 
1119
- declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
1168
+ declare type DateUnit_2 = 'day' | 'week' | 'month' | 'quarter' | 'year';
1120
1169
 
1121
1170
  /**
1122
1171
  * Default CalendarContext when not provided.
@@ -1141,7 +1190,7 @@ export declare type DeliveryConfig = {
1141
1190
  * Unlike GroupByField, DetailField does not support aggregation or granularity.
1142
1191
  * Columns are selected and displayed as-is from the database.
1143
1192
  */
1144
- declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
1193
+ export declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
1145
1194
  role: 'detail';
1146
1195
  dateFormat?: DateFormatValue;
1147
1196
  customFormat?: string;
@@ -1155,7 +1204,7 @@ declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
1155
1204
  calculatedFormula?: CalculatedFieldFormula;
1156
1205
  }
1157
1206
 
1158
- declare interface DetailTableBackupConfig {
1207
+ export declare interface DetailTableBackupConfig {
1159
1208
  groupByColumns?: GroupByField[];
1160
1209
  metricColumns?: MetricField[];
1161
1210
  pivotByColumns?: PivotByField[];
@@ -1173,7 +1222,14 @@ declare interface DetailTableBackupConfig {
1173
1222
  comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
1174
1223
  }
1175
1224
 
1176
- declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
1225
+ export declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
1226
+
1227
+ export declare type DimensionInputReference = {
1228
+ dataset: string;
1229
+ field: string;
1230
+ } | {
1231
+ dimension: string;
1232
+ };
1177
1233
 
1178
1234
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
1179
1235
 
@@ -1369,6 +1425,29 @@ export declare type DocumentVariableRef = {
1369
1425
  key: 'generatedAt' | 'pageNumber' | 'pageCount';
1370
1426
  };
1371
1427
 
1428
+ export declare interface DomainCalculatedDimension {
1429
+ name: string;
1430
+ label: string;
1431
+ description?: string;
1432
+ expression: string;
1433
+ inputs: Record<string, DimensionInputReference>;
1434
+ dataType?: DataType;
1435
+ tags?: string[];
1436
+ }
1437
+
1438
+ export declare interface DomainCalculatedMetric {
1439
+ name: string;
1440
+ label: string;
1441
+ description?: string;
1442
+ expression: string;
1443
+ inputs: Record<string, InputReference>;
1444
+ metricType?: 'base' | 'derived' | 'calculated';
1445
+ format?: FormatSpec;
1446
+ tags?: string[];
1447
+ isCertified?: boolean;
1448
+ aggregationStrategy?: AggregationStrategy;
1449
+ }
1450
+
1372
1451
  declare interface DrillDownInteraction {
1373
1452
  mode: 'drillDown';
1374
1453
  /**
@@ -1519,7 +1598,17 @@ export declare type EmailSettings = {
1519
1598
 
1520
1599
  export declare const EMPTY_SELECTION: SelectionState;
1521
1600
 
1522
- declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
1601
+ export declare type EntityColumnGroup = {
1602
+ entityId: string;
1603
+ entityType: EntityType;
1604
+ entityName: string;
1605
+ qualifiedEntityName: string;
1606
+ label?: string;
1607
+ description?: string;
1608
+ columns: Field[];
1609
+ };
1610
+
1611
+ export declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
1523
1612
 
1524
1613
  export declare type ErrorProps = {
1525
1614
  message?: string;
@@ -1532,7 +1621,7 @@ export declare type ExportDataPayload = {
1532
1621
  sql: string;
1533
1622
  };
1534
1623
 
1535
- declare interface Field {
1624
+ export declare interface Field {
1536
1625
  /**
1537
1626
  * Unique identifier for this field instance (for joins, UI state, etc.).
1538
1627
  * Should be unique within the context of the query or data model.
@@ -1553,6 +1642,7 @@ declare interface Field {
1553
1642
  * If not provided, should be auto-generated from label or name.
1554
1643
  */
1555
1644
  alias?: string;
1645
+ sourceField?: string;
1556
1646
  qualifiedFieldName: string;
1557
1647
  dataType: string;
1558
1648
  description?: string;
@@ -1570,7 +1660,7 @@ declare interface Field {
1570
1660
  fieldScope?: FieldScope;
1571
1661
  }
1572
1662
 
1573
- declare type FieldScope = 'card' | 'dashboard' | 'domain';
1663
+ export declare type FieldScope = 'card' | 'sheet' | 'dashboard' | 'domain';
1574
1664
 
1575
1665
  declare type FileAttachment = {
1576
1666
  id: string;
@@ -1583,7 +1673,7 @@ declare type FileAttachment = {
1583
1673
  uploadProgress?: number;
1584
1674
  };
1585
1675
 
1586
- declare interface FileEntityReference extends DatabaseEntityReference {
1676
+ export declare interface FileEntityReference extends DatabaseEntityReference {
1587
1677
  id: string;
1588
1678
  type: 'file' | 'url' | 'upload';
1589
1679
  label: string;
@@ -1604,7 +1694,7 @@ declare interface FilterByColumn extends BaseColumn {
1604
1694
  staticValues?: string[];
1605
1695
  }
1606
1696
 
1607
- declare interface FilterCondition {
1697
+ export declare interface FilterCondition {
1608
1698
  id: string;
1609
1699
  field: Field;
1610
1700
  operator: Operator;
@@ -1624,7 +1714,7 @@ export declare type FilterDashboardInput = DashboardInputBase & {
1624
1714
  */
1625
1715
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
1626
1716
 
1627
- declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
1717
+ export declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
1628
1718
  entityName?: Field['entityName'];
1629
1719
  entityType?: string;
1630
1720
  expression?: string;
@@ -1667,7 +1757,7 @@ declare type FilterForString = BaseFilter & {
1667
1757
  values: [string];
1668
1758
  };
1669
1759
 
1670
- declare interface FilterGroup {
1760
+ export declare interface FilterGroup {
1671
1761
  id: string;
1672
1762
  logicalOperator: LogicalOperator;
1673
1763
  negate: boolean;
@@ -1705,21 +1795,21 @@ export declare type FilterLayoutSettings = {
1705
1795
  toolbarItemOrder?: string[];
1706
1796
  };
1707
1797
 
1708
- declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
1798
+ export declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
1709
1799
 
1710
1800
  declare type FilterOnClick = {
1711
1801
  expression?: string;
1712
1802
  columnIndex: number;
1713
1803
  };
1714
1804
 
1715
- declare type FilterSemanticContext = {
1805
+ export declare type FilterSemanticContext = {
1716
1806
  semanticDomainId?: string;
1717
1807
  selectedEntities?: unknown[];
1718
1808
  connectionId?: string;
1719
1809
  connectionType?: string;
1720
1810
  };
1721
1811
 
1722
- declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1812
+ export declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1723
1813
 
1724
1814
  /**
1725
1815
  * Absolute fixed month/year default used by Month Picker defaults.
@@ -1732,9 +1822,11 @@ declare type FixedMonthDefaultDateFilter = {
1732
1822
  month: number;
1733
1823
  };
1734
1824
 
1825
+ export declare type FlatTableTotalsBehavior = 'sum' | 'avg' | 'count' | 'label';
1826
+
1735
1827
  export declare type FormatProfile = 'concise' | 'balanced' | 'detailed';
1736
1828
 
1737
- declare type FormatSpec = {
1829
+ export declare type FormatSpec = {
1738
1830
  type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1739
1831
  locale?: string;
1740
1832
  minimumFractionDigits?: number;
@@ -1772,6 +1864,8 @@ export declare type GetDashboardResponse = {
1772
1864
  organizationAppearance?: AppearanceSpec | null;
1773
1865
  };
1774
1866
 
1867
+ export declare function getFieldRuntimeColumnName(field: Pick<Field, 'name' | 'sourceField'> | null | undefined): string;
1868
+
1775
1869
  export declare type GetPluginsResponse = {
1776
1870
  plugins: {
1777
1871
  label: string;
@@ -1788,7 +1882,7 @@ declare interface GroupByColumn extends BaseColumn {
1788
1882
  format?: string;
1789
1883
  }
1790
1884
 
1791
- declare interface GroupByField extends Field {
1885
+ export declare interface GroupByField extends Field {
1792
1886
  role: 'groupby';
1793
1887
  granularity?: TimeGranularity;
1794
1888
  /**
@@ -1800,6 +1894,10 @@ declare interface GroupByField extends Field {
1800
1894
  calculatedFormula?: CalculatedFieldFormula;
1801
1895
  }
1802
1896
 
1897
+ export declare function hasCalculatedFieldMarker(field: Pick<Field, 'entityName' | 'entityId'> | null | undefined): boolean;
1898
+
1899
+ export declare function hasCalculatedFormulaInputs(field: Field | null | undefined): boolean;
1900
+
1803
1901
  export declare type HtmlOptions = {
1804
1902
  html: string;
1805
1903
  };
@@ -1840,6 +1938,16 @@ declare interface InlineDrillInteraction {
1840
1938
  label?: string;
1841
1939
  }
1842
1940
 
1941
+ export declare type InputReference = {
1942
+ dataset: string;
1943
+ field: string;
1944
+ aggregate?: AggregateFunction;
1945
+ } | {
1946
+ metric: string;
1947
+ } | {
1948
+ dimension: string;
1949
+ };
1950
+
1843
1951
  /**
1844
1952
  * Unified Interaction type (V2)
1845
1953
  * Combines all interaction types into a single union for the new interactions array.
@@ -1881,29 +1989,63 @@ declare type InteractiveSurfaceAppearance = BaseSurfaceAppearance & {
1881
1989
  toolbarBackground?: string;
1882
1990
  };
1883
1991
 
1884
- declare interface Join {
1992
+ /**
1993
+ * Type guard to identify calculated dimensions
1994
+ */
1995
+ export declare function isCalculatedDimension(field: GroupByField): field is GroupByField & {
1996
+ expression: string;
1997
+ };
1998
+
1999
+ /**
2000
+ * Generic type guard for any calculated field
2001
+ */
2002
+ export declare function isCalculatedField(field: Field): boolean;
2003
+
2004
+ /**
2005
+ * IMPORTANT: Why we store qualifiedFieldNames as strings instead of Field objects
2006
+ *
2007
+ * Field IDs are ephemeral and change on drag-and-drop operations. Storing
2008
+ * qualifiedFieldNames as strings provides:
2009
+ * - No data duplication (metricColumns is the single source of truth)
2010
+ * - Smaller payload size
2011
+ * - Stable references (qualifiedFieldName doesn't change)
2012
+ * - Backend can look up fresh aggregate info from metricColumns
2013
+ * - Enables proper post-aggregation: SUM(t0.sales) / COUNT(t0.order_id)
2014
+ * instead of incorrect: SUM(t0.sales / t0.order_id)
2015
+ */
2016
+ /**
2017
+ * Type guard to identify calculated metrics
2018
+ */
2019
+ export declare function isCalculatedMetric(field: Field): field is MetricField & {
2020
+ expression: string;
2021
+ };
2022
+
2023
+ export declare interface Join {
1885
2024
  id: string;
1886
2025
  source: DatabaseEntityReference;
1887
2026
  target: DatabaseEntityReference;
1888
2027
  joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
1889
2028
  joinKeyGroups: JoinKeyGroup[];
1890
2029
  sequence: number;
2030
+ relationshipId?: string;
2031
+ relationshipName?: string;
2032
+ relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1891
2033
  }
1892
2034
 
1893
- declare interface JoinKey {
2035
+ export declare interface JoinKey {
1894
2036
  id?: string;
1895
2037
  source: Field;
1896
2038
  target: Field;
1897
2039
  operator: string;
1898
2040
  }
1899
2041
 
1900
- declare interface JoinKeyGroup {
2042
+ export declare interface JoinKeyGroup {
1901
2043
  id: string;
1902
2044
  operator: string;
1903
2045
  keys: JoinKey[];
1904
2046
  }
1905
2047
 
1906
- declare interface JoinPlan {
2048
+ export declare interface JoinPlan {
1907
2049
  baseEntity: DatabaseEntityReference;
1908
2050
  joins: Join[];
1909
2051
  }
@@ -1928,7 +2070,7 @@ export declare type LoadingProps = {
1928
2070
  message?: string;
1929
2071
  };
1930
2072
 
1931
- declare type LogicalOperator = 'AND' | 'OR';
2073
+ export declare type LogicalOperator = 'AND' | 'OR';
1932
2074
 
1933
2075
  declare interface MetricColumn extends BaseColumn {
1934
2076
  role: 'metric';
@@ -1936,7 +2078,7 @@ declare interface MetricColumn extends BaseColumn {
1936
2078
  aliasTemplate?: string;
1937
2079
  }
1938
2080
 
1939
- declare interface MetricField extends Field {
2081
+ export declare interface MetricField extends Field {
1940
2082
  role: 'metric';
1941
2083
  aggregate?: AggregateFunction;
1942
2084
  /**
@@ -1978,6 +2120,12 @@ declare interface MetricField extends Field {
1978
2120
  * Both are generated together from the same dialog inputs, preventing drift.
1979
2121
  */
1980
2122
  calculatedFormula?: CalculatedFieldFormula;
2123
+ /**
2124
+ * Indicates the metric expression must be evaluated after row-level filtering,
2125
+ * either because it contains an aggregate function directly or depends on a
2126
+ * pre-aggregated metric input.
2127
+ */
2128
+ isPreAggregated?: boolean;
1981
2129
  comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
1982
2130
  comparisonDisplay?: 'column' | 'inline' | 'hover';
1983
2131
  targetValue?: number;
@@ -2020,9 +2168,9 @@ declare type NumericCanonicalFormat = {
2020
2168
 
2021
2169
  declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
2022
2170
 
2023
- declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
2171
+ export declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
2024
2172
 
2025
- declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
2173
+ export declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'like' | 'not like' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
2026
2174
 
2027
2175
  declare type OptionsMap = {
2028
2176
  number: NumberOptions;
@@ -2040,11 +2188,23 @@ declare interface OrderBy {
2040
2188
  /**
2041
2189
  * Pagination configuration for table queries
2042
2190
  */
2043
- declare interface PaginationConfig {
2191
+ export declare interface PaginationConfig {
2044
2192
  page: number;
2045
2193
  pageSize: number;
2046
2194
  }
2047
2195
 
2196
+ /**
2197
+ * Pagination metadata returned with query results
2198
+ */
2199
+ export declare interface PaginationMetadata {
2200
+ page: number;
2201
+ pageSize: number;
2202
+ pageCount: number;
2203
+ totalCount: number;
2204
+ hasNextPage: boolean;
2205
+ hasPrevPage: boolean;
2206
+ }
2207
+
2048
2208
  declare type Params = {
2049
2209
  [key: string]: string | number | string[] | number[];
2050
2210
  };
@@ -2053,10 +2213,49 @@ declare type PersistedInteraction = Interaction & {
2053
2213
  id?: string;
2054
2214
  };
2055
2215
 
2056
- declare interface PivotByField extends Field {
2216
+ export declare interface PivotByField extends Field {
2057
2217
  role: 'pivotby';
2058
2218
  }
2059
2219
 
2220
+ export declare interface PivotColumnSchema {
2221
+ alias: string;
2222
+ metricId: string;
2223
+ metricName: string;
2224
+ metricLabel?: string;
2225
+ pivotValues: string[];
2226
+ pivotFields?: string[];
2227
+ displayLabel?: string;
2228
+ isPivotColumn?: boolean;
2229
+ isMetricColumn?: boolean;
2230
+ isGroupByColumn?: boolean;
2231
+ aggregate?: AggregateFunction;
2232
+ }
2233
+
2234
+ /**
2235
+ const config: CardConfig = {
2236
+ groupByColumns: [
2237
+ { id: 'region', name: 'region', label: 'Region', ... },
2238
+ { id: 'country', name: 'country', label: 'Country', ... }
2239
+ ],
2240
+ pivotByColumns: [
2241
+ { id: 'year', name: 'year', label: 'Year', ... },
2242
+ { id: 'quarter', name: 'quarter', label: 'Quarter', ... }
2243
+ ],
2244
+ metricColumns: [ ... ],
2245
+ rowAggregates: ['SUM', 'AVG'],
2246
+ columnAggregates: ['SUM'],
2247
+ subtotals: {
2248
+ groupBy: { functions: ['SUM'], levels: ['region'] }, // subtotal at region level
2249
+ pivotBy: { functions: ['SUM'], levels: ['year'] } // subtotal at year level
2250
+ }
2251
+ };
2252
+ */
2253
+ export declare enum PivotMarkerEnum {
2254
+ SUBTOTAL = "__SUBTOTAL__",
2255
+ TOTAL = "__TOTAL__",
2256
+ ALL = "__ALL__"
2257
+ }
2258
+
2060
2259
  export declare type Placeholders = {
2061
2260
  /**
2062
2261
  * Placeholder for the card when there are no records to display.
@@ -2070,6 +2269,20 @@ export declare type Placeholders = {
2070
2269
 
2071
2270
  export declare type PluginType = 'custom' | 'standard';
2072
2271
 
2272
+ export declare interface QueryColumnKeyMap {
2273
+ version: 1;
2274
+ source: 'explorer';
2275
+ byFieldId: Record<string, QueryColumnKeyMapEntry>;
2276
+ }
2277
+
2278
+ export declare interface QueryColumnKeyMapEntry {
2279
+ role: QueryColumnKeyRole;
2280
+ rawKey: string;
2281
+ outputKey?: string;
2282
+ }
2283
+
2284
+ export declare type QueryColumnKeyRole = 'groupby' | 'metric' | 'pivotby' | 'detail';
2285
+
2073
2286
  declare interface QueryConfig {
2074
2287
  groupByColumns?: GroupByColumn[];
2075
2288
  pivotColumns?: GroupByColumn[];
@@ -2080,6 +2293,26 @@ declare interface QueryConfig {
2080
2293
  orderBy?: OrderBy[];
2081
2294
  }
2082
2295
 
2296
+ /**
2297
+ * Response structure for query execution (standard queries and comparison queries)
2298
+ */
2299
+ export declare interface QueryExecutionResponse {
2300
+ records: any[];
2301
+ output: string;
2302
+ rowLimitExceeded: boolean;
2303
+ sql?: string;
2304
+ userSql?: string;
2305
+ pivotSchema?: any;
2306
+ pagination?: PaginationMetadata;
2307
+ subtotalColumns?: string[];
2308
+ columnSubtotalMeta?: any;
2309
+ columnMetadata?: Record<string, any>;
2310
+ columnKeyMap?: QueryColumnKeyMap;
2311
+ tableTotalsByColumnId?: Record<string, string | number | null>;
2312
+ documentTableTotalsBaseSql?: string;
2313
+ metadata?: any;
2314
+ }
2315
+
2083
2316
  declare type QueryFilter = {
2084
2317
  filterColumnName: string;
2085
2318
  filterValue: OldFilterValue;
@@ -2092,21 +2325,21 @@ declare type RangeValue = {
2092
2325
  gt?: string | number;
2093
2326
  };
2094
2327
 
2095
- declare type RelativeDateFilter = {
2328
+ export declare type RelativeDateFilter = {
2096
2329
  mode: 'last';
2097
2330
  n: number;
2098
- unit: DateUnit;
2331
+ unit: DateUnit_2;
2099
2332
  complete?: boolean;
2100
2333
  } | {
2101
2334
  mode: 'this';
2102
- unit: DateUnit;
2335
+ unit: DateUnit_2;
2103
2336
  toDate?: boolean;
2104
2337
  } | {
2105
2338
  mode: 'previous';
2106
- unit: DateUnit;
2339
+ unit: DateUnit_2;
2107
2340
  } | {
2108
2341
  mode: 'between';
2109
- unit: DateUnit;
2342
+ unit: DateUnit_2;
2110
2343
  from: number;
2111
2344
  to: number;
2112
2345
  };
@@ -2183,7 +2416,9 @@ export declare type ResolvedTokenParams = Omit<TokenParams, 'calendarContext'> &
2183
2416
  calendarContext: CalendarContext;
2184
2417
  };
2185
2418
 
2186
- declare type SelectedEntities = Array<DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference>;
2419
+ export declare type SelectedEntities = SelectedEntity[];
2420
+
2421
+ export declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
2187
2422
 
2188
2423
  export declare type SelectionState = Record<Level, string | null>;
2189
2424
 
@@ -2217,11 +2452,13 @@ declare type SemanticExecutionPayload = {
2217
2452
 
2218
2453
  export declare type SensitivityPreset = 'low_noise' | 'standard' | 'early_warning';
2219
2454
 
2220
- declare interface SortByField extends Field {
2455
+ export declare interface SortByField extends Field {
2221
2456
  role: 'sortby';
2222
2457
  direction: 'asc' | 'desc';
2223
2458
  }
2224
2459
 
2460
+ export declare type SortDirection = 'asc' | 'desc';
2461
+
2225
2462
  export declare type SqlGen = {
2226
2463
  measures?: {
2227
2464
  name: string;
@@ -2293,6 +2530,14 @@ export declare type StyleProps = {
2293
2530
  };
2294
2531
  };
2295
2532
 
2533
+ /**
2534
+ * Subtotal configuration for groupBy and pivotBy axes
2535
+ */
2536
+ export declare interface SubtotalConfig {
2537
+ groupBy?: AggregateConfig;
2538
+ pivotBy?: AggregateConfig;
2539
+ }
2540
+
2296
2541
  declare type TableAppearance = {
2297
2542
  density?: AppearanceDensity;
2298
2543
  container?: {
@@ -2406,6 +2651,16 @@ declare type TableStylePreferences = {
2406
2651
 
2407
2652
  declare type TableTotalsFontWeight = 'normal' | 'medium' | 'semibold' | 'bold';
2408
2653
 
2654
+ export declare type TableTotalsRequest = {
2655
+ source: 'documentFlatTable';
2656
+ columns: Array<{
2657
+ fieldId: string;
2658
+ role: 'detail' | 'groupby' | 'metric';
2659
+ behavior: FlatTableTotalsBehavior;
2660
+ label?: string;
2661
+ }>;
2662
+ };
2663
+
2409
2664
  declare type TableTotalsStylePreferences = {
2410
2665
  enabled?: boolean;
2411
2666
  backgroundColor?: string;
@@ -2761,7 +3016,7 @@ export declare type TChartOptions = {
2761
3016
  treemapColorMode?: 'branch' | 'category';
2762
3017
  };
2763
3018
 
2764
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
3019
+ export declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2765
3020
 
2766
3021
  export declare type TColumnSetting<T extends DisplayDataType> = {
2767
3022
  columnIdx: number;
@@ -2811,6 +3066,7 @@ export declare type TDashboard = {
2811
3066
  };
2812
3067
  description?: string;
2813
3068
  sheets?: TSheet[];
3069
+ calculatedFields?: Field[];
2814
3070
  style?: TStyle;
2815
3071
  filters?: TFilter[];
2816
3072
  customCards?: CustomCard[];
@@ -2944,7 +3200,7 @@ export declare type TEvent = {
2944
3200
  message: any;
2945
3201
  };
2946
3202
 
2947
- declare type TFilter = {
3203
+ export declare type TFilter = {
2948
3204
  kind?: FilterKind;
2949
3205
  type?: 'single' | 'multiple';
2950
3206
  uiType?: 'radio' | 'dropdown' | 'tabs';
@@ -2997,7 +3253,7 @@ declare type TFilter = {
2997
3253
  displayMode?: FilterDisplayMode;
2998
3254
  };
2999
3255
 
3000
- declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
3256
+ export declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
3001
3257
 
3002
3258
  export declare type TFormatOptions = {
3003
3259
  type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
@@ -3081,7 +3337,7 @@ declare interface TimeDrillStep {
3081
3337
  rollingWindow?: number;
3082
3338
  }
3083
3339
 
3084
- declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
3340
+ export declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
3085
3341
 
3086
3342
  /**
3087
3343
  * Inline filter definition stored on a card.
@@ -3563,9 +3819,9 @@ export declare type VisualDisplayPreferences = {
3563
3819
  */
3564
3820
  export declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
3565
3821
 
3566
- declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
3822
+ export declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
3567
3823
 
3568
- declare interface WindowTransform {
3824
+ export declare interface WindowTransform {
3569
3825
  function: WindowFunction;
3570
3826
  orderBy?: {
3571
3827
  fieldId: string;