react-semaphor 0.1.372 → 0.1.374

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 (53) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/chunks/{calendar-preferences-dialog-Dn6o2r2Y.js → calendar-preferences-dialog-94DoRSW_.js} +1 -1
  4. package/dist/chunks/{calendar-preferences-dialog-ClBAkMmF.js → calendar-preferences-dialog-DmBRXOH6.js} +1 -1
  5. package/dist/chunks/{dashboard-briefing-launcher-BO-kXtEd.js → dashboard-briefing-launcher-CAFCkwG3.js} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-D3Xfc_26.js → dashboard-briefing-launcher-l0ylhcAv.js} +104 -104
  7. package/dist/chunks/{dashboard-controls-DcXMFgGR.js → dashboard-controls-BX47yuCH.js} +1 -1
  8. package/dist/chunks/{dashboard-controls-B3sdy_Zx.js → dashboard-controls-DyzG0r5f.js} +167 -167
  9. package/dist/chunks/{dashboard-json-BWfkEy48.js → dashboard-json-B8kke4ES.js} +1 -1
  10. package/dist/chunks/{dashboard-json-CFURS_OR.js → dashboard-json-BlPA6wRT.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-DjdhKiP2.js → edit-dashboard-visual-CgJxTZLJ.js} +6592 -6565
  12. package/dist/chunks/{edit-dashboard-visual-BD2AJLiT.js → edit-dashboard-visual-DA8SaE4h.js} +37 -37
  13. package/dist/chunks/index-BJ971AL_.js +1361 -0
  14. package/dist/chunks/{index-C0Qnfr_7.js → index-BiDFY4Gr.js} +36742 -34869
  15. package/dist/chunks/{resource-management-panel-YvIfaphX.js → resource-management-panel-Bssc5uaX.js} +51 -51
  16. package/dist/chunks/{resource-management-panel-DytUMSGA.js → resource-management-panel-C14F7VSc.js} +1 -1
  17. package/dist/chunks/{use-create-flow-overlay-state-BETXykC9.js → use-create-flow-overlay-state-BGhwg121.js} +35 -35
  18. package/dist/chunks/{use-create-flow-overlay-state-CwIG1Ekp.js → use-create-flow-overlay-state-DAVI3fO1.js} +1 -1
  19. package/dist/chunks/{use-visual-utils-Bk135OgA.js → use-visual-utils-47dkDwLK.js} +12 -12
  20. package/dist/chunks/{use-visual-utils-BzFjIykb.js → use-visual-utils-K0yQRSI7.js} +1 -1
  21. package/dist/chunks/{validation-D4Zz6WPD.js → validation-1V7bWmYw.js} +1 -1
  22. package/dist/chunks/{validation-CQFpcSSP.js → validation-DlrTIf1N.js} +1 -1
  23. package/dist/chunks/{validators-CuKnUZFO.js → validators-CtNmgsvG.js} +409 -314
  24. package/dist/chunks/validators-jpoYhpHh.js +1 -0
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/dashboard-authoring/index.cjs +1 -1
  28. package/dist/dashboard-authoring/index.js +1 -1
  29. package/dist/data-app-builder/index.cjs +1 -1
  30. package/dist/data-app-builder/index.js +1 -1
  31. package/dist/data-app-sdk/index.cjs +1 -1
  32. package/dist/data-app-sdk/index.js +32 -32
  33. package/dist/data-app-sdk-validation/index.cjs +1 -1
  34. package/dist/data-app-sdk-validation/index.js +2 -2
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.js +127 -126
  37. package/dist/style.css +1 -1
  38. package/dist/surfboard/index.cjs +1 -1
  39. package/dist/surfboard/index.js +2 -2
  40. package/dist/types/analytics-protocol.d.ts +102 -11
  41. package/dist/types/dashboard-assistant.d.ts +117 -103
  42. package/dist/types/dashboard-authoring.d.ts +63 -2
  43. package/dist/types/dashboard.d.ts +263 -2
  44. package/dist/types/data-app-builder.d.ts +40 -1
  45. package/dist/types/data-app-sdk-validation.d.ts +94 -102
  46. package/dist/types/data-app-sdk.d.ts +106 -11
  47. package/dist/types/main.d.ts +473 -2
  48. package/dist/types/shared.d.ts +263 -2
  49. package/dist/types/surfboard.d.ts +263 -2
  50. package/dist/types/types.d.ts +529 -2
  51. package/package.json +1 -1
  52. package/dist/chunks/index-DlLvzmJF.js +0 -1361
  53. package/dist/chunks/validators-DHee9kM2.js +0 -1
@@ -120,6 +120,28 @@ declare interface CalculatedFieldFormula {
120
120
  declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
121
121
 
122
122
  declare interface CardConfig {
123
+ /**
124
+ * Matrix table is the shared analytics-spine successor for pivot and
125
+ * hierarchical aggregate tables. Dashboard cards store the public matrix
126
+ * intent shape so Data Apps, MCP, and dashboard runtime consume one contract.
127
+ */
128
+ matrixIntent?: SemaphorMatrixIntent;
129
+ /**
130
+ * Deprecated compatibility fields for older matrix table drafts. New
131
+ * dashboard-authored matrix cards should use `matrixIntent` so normal
132
+ * `filters` can remain the explorer/card-level `FilterGroup`.
133
+ */
134
+ version?: SemaphorMatrixIntent['version'];
135
+ source?: SemaphorMatrixIntent['source'];
136
+ rows?: SemaphorMatrixIntent['rows'];
137
+ columns?: SemaphorMatrixIntent['columns'];
138
+ values?: SemaphorMatrixIntent['values'];
139
+ inputs?: SemaphorMatrixIntent['inputs'];
140
+ totals?: SemaphorMatrixIntent['totals'];
141
+ sort?: SemaphorMatrixIntent['sort'];
142
+ expansion?: SemaphorMatrixIntent['expansion'];
143
+ layout?: SemaphorMatrixIntent['layout'];
144
+ displayLimits?: SemaphorMatrixIntent['displayLimits'];
123
145
  groupByColumns?: GroupByField[];
124
146
  metricColumns?: MetricField[];
125
147
  pivotByColumns?: PivotByField[];
@@ -1574,6 +1596,37 @@ declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference
1574
1596
 
1575
1597
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
1576
1598
 
1599
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
1600
+
1601
+ declare type SemaphorAnalyticsFilterBase = {
1602
+ id?: string;
1603
+ field: SemaphorFieldRef;
1604
+ /**
1605
+ * Controls where the filter is applied in an aggregate query.
1606
+ *
1607
+ * `row` means pre-aggregation filtering (`WHERE`).
1608
+ * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
1609
+ * for measure fields the execution engine can aggregate safely.
1610
+ */
1611
+ scope?: 'row' | 'aggregate';
1612
+ };
1613
+
1614
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
1615
+
1616
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
1617
+ operator: SemaphorAnalyticsNullFilterOperator;
1618
+ values?: never;
1619
+ };
1620
+
1621
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
1622
+
1623
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
1624
+ operator?: SemaphorAnalyticsValueFilterOperator;
1625
+ values: unknown[];
1626
+ };
1627
+
1628
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
1629
+
1577
1630
  declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
1578
1631
 
1579
1632
  declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
@@ -1594,7 +1647,7 @@ declare type SemaphorDerivedFieldDefinition = {
1594
1647
  defaultAggregate?: SemaphorAggregateFunction;
1595
1648
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
1596
1649
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
1597
- format?: unknown;
1650
+ format?: SemaphorValueFormat;
1598
1651
  tags?: string[];
1599
1652
  };
1600
1653
 
@@ -1614,6 +1667,14 @@ declare type SemaphorDerivedFieldResultRole = 'measure' | 'group' | 'date' | 'id
1614
1667
 
1615
1668
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1616
1669
 
1670
+ /**
1671
+ * Explorer-backed table source. This is intentionally distinct from raw SQL:
1672
+ * matrix planning needs stable source metadata, fields, and dialect context.
1673
+ */
1674
+ declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
1675
+ kind: 'physical';
1676
+ }>;
1677
+
1617
1678
  declare type SemaphorFieldRef = {
1618
1679
  name: string;
1619
1680
  label?: string;
@@ -1623,6 +1684,166 @@ declare type SemaphorFieldRef = {
1623
1684
  aggregate?: SemaphorAggregateFunction;
1624
1685
  };
1625
1686
 
1687
+ declare type SemaphorInputBinding = {
1688
+ inputId: string;
1689
+ kind?: 'filter' | 'control';
1690
+ controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
1691
+ operator?: SemaphorInputOperator;
1692
+ field?: SemaphorFieldRef;
1693
+ };
1694
+
1695
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
1696
+
1697
+ declare type SemaphorMatrixAxisExpansionOptions = {
1698
+ defaultDepth?: number;
1699
+ lazy?: boolean;
1700
+ expandedPaths?: SemaphorMatrixMemberPathSegment[][];
1701
+ };
1702
+
1703
+ declare type SemaphorMatrixAxisLevel = {
1704
+ id?: string;
1705
+ field: SemaphorFieldRef;
1706
+ grain?: SemaphorTimeGrain;
1707
+ label?: string;
1708
+ subtotal?: boolean | SemaphorMatrixSubtotalOptions;
1709
+ sortBy?: SemaphorMatrixAxisSortRule;
1710
+ };
1711
+
1712
+ declare type SemaphorMatrixAxisSortRule = {
1713
+ direction: 'asc' | 'desc';
1714
+ by: {
1715
+ kind: 'label';
1716
+ } | {
1717
+ kind: 'field';
1718
+ field: SemaphorFieldRef;
1719
+ aggregate?: SemaphorAggregateFunction;
1720
+ };
1721
+ nulls?: 'warehouseDefault' | 'first' | 'last';
1722
+ scope?: 'global' | 'withinParent';
1723
+ };
1724
+
1725
+ declare type SemaphorMatrixDisplayLimitOptions = {
1726
+ rows?: SemaphorMatrixDisplayLimitRule;
1727
+ columns?: SemaphorMatrixDisplayLimitRule;
1728
+ };
1729
+
1730
+ declare type SemaphorMatrixDisplayLimitRule = {
1731
+ limit: number;
1732
+ by?: 'label' | 'value';
1733
+ direction?: 'top' | 'bottom';
1734
+ others?: boolean | {
1735
+ label?: string;
1736
+ };
1737
+ };
1738
+
1739
+ declare type SemaphorMatrixExpansionOptions = {
1740
+ rows?: SemaphorMatrixAxisExpansionOptions;
1741
+ columns?: SemaphorMatrixAxisExpansionOptions;
1742
+ };
1743
+
1744
+ declare type SemaphorMatrixIntent = {
1745
+ kind: 'matrix';
1746
+ version?: SemaphorProtocolVersion;
1747
+ id?: string;
1748
+ label?: string;
1749
+ source: SemaphorMatrixSourceRef;
1750
+ rows: SemaphorMatrixAxisLevel[];
1751
+ columns?: SemaphorMatrixAxisLevel[];
1752
+ values: SemaphorMatrixValueField[];
1753
+ filters?: SemaphorAnalyticsFilter[];
1754
+ inputs?: SemaphorInputBinding[];
1755
+ totals?: SemaphorMatrixTotalOptions;
1756
+ sort?: SemaphorMatrixSortRule[];
1757
+ expansion?: SemaphorMatrixExpansionOptions;
1758
+ layout?: SemaphorMatrixLayoutOptions;
1759
+ displayLimits?: SemaphorMatrixDisplayLimitOptions;
1760
+ };
1761
+
1762
+ declare type SemaphorMatrixLayoutOptions = {
1763
+ hierarchy?: 'compact' | 'tabular' | 'outline';
1764
+ valuesPlacement?: 'columns' | 'rows';
1765
+ stickyRowHeaders?: boolean;
1766
+ stickyColumnHeaders?: boolean;
1767
+ };
1768
+
1769
+ declare type SemaphorMatrixMemberPathSegment = {
1770
+ levelId: string;
1771
+ value: unknown;
1772
+ };
1773
+
1774
+ declare type SemaphorMatrixSortRule = {
1775
+ axis: 'row' | 'column';
1776
+ targetId?: string;
1777
+ direction: 'asc' | 'desc';
1778
+ by: {
1779
+ kind: 'label';
1780
+ } | {
1781
+ kind: 'field';
1782
+ field: SemaphorFieldRef;
1783
+ aggregate?: SemaphorAggregateFunction;
1784
+ } | {
1785
+ kind: 'value';
1786
+ valueId: string;
1787
+ rowPath?: SemaphorMatrixMemberPathSegment[];
1788
+ columnPath?: SemaphorMatrixMemberPathSegment[];
1789
+ };
1790
+ nulls?: 'warehouseDefault' | 'first' | 'last';
1791
+ scope?: 'global' | 'withinParent';
1792
+ };
1793
+
1794
+ declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
1795
+
1796
+ declare type SemaphorMatrixSubtotalOptions = {
1797
+ enabled?: boolean;
1798
+ position?: 'before' | 'after';
1799
+ label?: string;
1800
+ };
1801
+
1802
+ declare type SemaphorMatrixTotalCalculation = {
1803
+ kind: 'defaultAggregate';
1804
+ } | {
1805
+ kind: 'blank';
1806
+ } | {
1807
+ kind: 'labelOnly';
1808
+ label?: string;
1809
+ } | {
1810
+ kind: 'customAggregate';
1811
+ aggregate: SemaphorAggregateFunction;
1812
+ } | {
1813
+ kind: 'percentOfParent';
1814
+ } | {
1815
+ kind: 'percentOfGrandTotal';
1816
+ } | {
1817
+ kind: 'customExpression';
1818
+ expressionId: string;
1819
+ };
1820
+
1821
+ declare type SemaphorMatrixTotalOptions = {
1822
+ rows?: boolean | 'perLevel';
1823
+ columns?: boolean | 'perLevel';
1824
+ grandTotal?: boolean | {
1825
+ rows?: boolean;
1826
+ columns?: boolean;
1827
+ };
1828
+ rowPosition?: 'top' | 'bottom';
1829
+ columnPosition?: 'left' | 'right';
1830
+ };
1831
+
1832
+ declare type SemaphorMatrixValueField = {
1833
+ id?: string;
1834
+ field: SemaphorFieldRef;
1835
+ aggregate?: SemaphorAggregateFunction;
1836
+ label?: string;
1837
+ format?: SemaphorValueFormat;
1838
+ totalBehavior?: SemaphorMatrixTotalCalculation;
1839
+ };
1840
+
1841
+ declare type SemaphorProtocolVersion = 1;
1842
+
1843
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
1844
+ kind: 'semantic';
1845
+ }>;
1846
+
1626
1847
  declare type SemaphorSourceRef = {
1627
1848
  kind: 'semantic';
1628
1849
  domainId: string;
@@ -1646,6 +1867,46 @@ declare type SemaphorSourceRef = {
1646
1867
  label?: string;
1647
1868
  };
1648
1869
 
1870
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1871
+
1872
+ declare type SemaphorValueFormat = {
1873
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1874
+ locale?: string;
1875
+ minimumFractionDigits?: number;
1876
+ maximumFractionDigits?: number;
1877
+ useGrouping?: boolean;
1878
+ prefix?: string;
1879
+ suffix?: string;
1880
+ negativeStyle?: 'minus' | 'parentheses';
1881
+ compact?: boolean;
1882
+ scale?: number;
1883
+ currency?: string;
1884
+ percentValueMode?: 'fraction' | 'whole';
1885
+ } | {
1886
+ type: 'date' | 'datetime';
1887
+ locale?: string;
1888
+ pattern?: string;
1889
+ relative?: boolean;
1890
+ timezone?: string;
1891
+ sourceTimezone?: string;
1892
+ prefix?: string;
1893
+ suffix?: string;
1894
+ } | {
1895
+ type: 'duration';
1896
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1897
+ outputStyle?: 'compact' | 'digital' | 'long';
1898
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1899
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1900
+ maxUnits?: number;
1901
+ prefix?: string;
1902
+ suffix?: string;
1903
+ negativeStyle?: 'minus' | 'parentheses';
1904
+ } | {
1905
+ type: 'string';
1906
+ prefix?: string;
1907
+ suffix?: string;
1908
+ };
1909
+
1649
1910
  /**
1650
1911
  * Stable serializer for dashboard dirty checks.
1651
1912
  * This consolidates normalization + serialization into one call site, so
@@ -2145,7 +2406,7 @@ declare type TChartOptions = {
2145
2406
  treemapColorMode?: 'branch' | 'category';
2146
2407
  };
2147
2408
 
2148
- 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';
2409
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'matrixTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2149
2410
 
2150
2411
  declare type TColumnSetting<T extends DisplayDataType> = {
2151
2412
  columnIdx: number;
@@ -212,6 +212,28 @@ declare interface CalendarPreferencesDialogProps {
212
212
  }
213
213
 
214
214
  declare interface CardConfig {
215
+ /**
216
+ * Matrix table is the shared analytics-spine successor for pivot and
217
+ * hierarchical aggregate tables. Dashboard cards store the public matrix
218
+ * intent shape so Data Apps, MCP, and dashboard runtime consume one contract.
219
+ */
220
+ matrixIntent?: SemaphorMatrixIntent;
221
+ /**
222
+ * Deprecated compatibility fields for older matrix table drafts. New
223
+ * dashboard-authored matrix cards should use `matrixIntent` so normal
224
+ * `filters` can remain the explorer/card-level `FilterGroup`.
225
+ */
226
+ version?: SemaphorMatrixIntent['version'];
227
+ source?: SemaphorMatrixIntent['source'];
228
+ rows?: SemaphorMatrixIntent['rows'];
229
+ columns?: SemaphorMatrixIntent['columns'];
230
+ values?: SemaphorMatrixIntent['values'];
231
+ inputs?: SemaphorMatrixIntent['inputs'];
232
+ totals?: SemaphorMatrixIntent['totals'];
233
+ sort?: SemaphorMatrixIntent['sort'];
234
+ expansion?: SemaphorMatrixIntent['expansion'];
235
+ layout?: SemaphorMatrixIntent['layout'];
236
+ displayLimits?: SemaphorMatrixIntent['displayLimits'];
215
237
  groupByColumns?: GroupByField[];
216
238
  metricColumns?: MetricField[];
217
239
  pivotByColumns?: PivotByField[];
@@ -1934,6 +1956,37 @@ declare type SemanticExecutionPayload = {
1934
1956
 
1935
1957
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
1936
1958
 
1959
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
1960
+
1961
+ declare type SemaphorAnalyticsFilterBase = {
1962
+ id?: string;
1963
+ field: SemaphorFieldRef;
1964
+ /**
1965
+ * Controls where the filter is applied in an aggregate query.
1966
+ *
1967
+ * `row` means pre-aggregation filtering (`WHERE`).
1968
+ * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
1969
+ * for measure fields the execution engine can aggregate safely.
1970
+ */
1971
+ scope?: 'row' | 'aggregate';
1972
+ };
1973
+
1974
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
1975
+
1976
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
1977
+ operator: SemaphorAnalyticsNullFilterOperator;
1978
+ values?: never;
1979
+ };
1980
+
1981
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
1982
+
1983
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
1984
+ operator?: SemaphorAnalyticsValueFilterOperator;
1985
+ values: unknown[];
1986
+ };
1987
+
1988
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
1989
+
1937
1990
  declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
1938
1991
 
1939
1992
  declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
@@ -1954,7 +2007,7 @@ declare type SemaphorDerivedFieldDefinition = {
1954
2007
  defaultAggregate?: SemaphorAggregateFunction;
1955
2008
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
1956
2009
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
1957
- format?: unknown;
2010
+ format?: SemaphorValueFormat;
1958
2011
  tags?: string[];
1959
2012
  };
1960
2013
 
@@ -1974,6 +2027,14 @@ declare type SemaphorDerivedFieldResultRole = 'measure' | 'group' | 'date' | 'id
1974
2027
 
1975
2028
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1976
2029
 
2030
+ /**
2031
+ * Explorer-backed table source. This is intentionally distinct from raw SQL:
2032
+ * matrix planning needs stable source metadata, fields, and dialect context.
2033
+ */
2034
+ declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
2035
+ kind: 'physical';
2036
+ }>;
2037
+
1977
2038
  declare type SemaphorFieldRef = {
1978
2039
  name: string;
1979
2040
  label?: string;
@@ -1983,6 +2044,166 @@ declare type SemaphorFieldRef = {
1983
2044
  aggregate?: SemaphorAggregateFunction;
1984
2045
  };
1985
2046
 
2047
+ declare type SemaphorInputBinding = {
2048
+ inputId: string;
2049
+ kind?: 'filter' | 'control';
2050
+ controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
2051
+ operator?: SemaphorInputOperator;
2052
+ field?: SemaphorFieldRef;
2053
+ };
2054
+
2055
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
2056
+
2057
+ declare type SemaphorMatrixAxisExpansionOptions = {
2058
+ defaultDepth?: number;
2059
+ lazy?: boolean;
2060
+ expandedPaths?: SemaphorMatrixMemberPathSegment[][];
2061
+ };
2062
+
2063
+ declare type SemaphorMatrixAxisLevel = {
2064
+ id?: string;
2065
+ field: SemaphorFieldRef;
2066
+ grain?: SemaphorTimeGrain;
2067
+ label?: string;
2068
+ subtotal?: boolean | SemaphorMatrixSubtotalOptions;
2069
+ sortBy?: SemaphorMatrixAxisSortRule;
2070
+ };
2071
+
2072
+ declare type SemaphorMatrixAxisSortRule = {
2073
+ direction: 'asc' | 'desc';
2074
+ by: {
2075
+ kind: 'label';
2076
+ } | {
2077
+ kind: 'field';
2078
+ field: SemaphorFieldRef;
2079
+ aggregate?: SemaphorAggregateFunction;
2080
+ };
2081
+ nulls?: 'warehouseDefault' | 'first' | 'last';
2082
+ scope?: 'global' | 'withinParent';
2083
+ };
2084
+
2085
+ declare type SemaphorMatrixDisplayLimitOptions = {
2086
+ rows?: SemaphorMatrixDisplayLimitRule;
2087
+ columns?: SemaphorMatrixDisplayLimitRule;
2088
+ };
2089
+
2090
+ declare type SemaphorMatrixDisplayLimitRule = {
2091
+ limit: number;
2092
+ by?: 'label' | 'value';
2093
+ direction?: 'top' | 'bottom';
2094
+ others?: boolean | {
2095
+ label?: string;
2096
+ };
2097
+ };
2098
+
2099
+ declare type SemaphorMatrixExpansionOptions = {
2100
+ rows?: SemaphorMatrixAxisExpansionOptions;
2101
+ columns?: SemaphorMatrixAxisExpansionOptions;
2102
+ };
2103
+
2104
+ declare type SemaphorMatrixIntent = {
2105
+ kind: 'matrix';
2106
+ version?: SemaphorProtocolVersion;
2107
+ id?: string;
2108
+ label?: string;
2109
+ source: SemaphorMatrixSourceRef;
2110
+ rows: SemaphorMatrixAxisLevel[];
2111
+ columns?: SemaphorMatrixAxisLevel[];
2112
+ values: SemaphorMatrixValueField[];
2113
+ filters?: SemaphorAnalyticsFilter[];
2114
+ inputs?: SemaphorInputBinding[];
2115
+ totals?: SemaphorMatrixTotalOptions;
2116
+ sort?: SemaphorMatrixSortRule[];
2117
+ expansion?: SemaphorMatrixExpansionOptions;
2118
+ layout?: SemaphorMatrixLayoutOptions;
2119
+ displayLimits?: SemaphorMatrixDisplayLimitOptions;
2120
+ };
2121
+
2122
+ declare type SemaphorMatrixLayoutOptions = {
2123
+ hierarchy?: 'compact' | 'tabular' | 'outline';
2124
+ valuesPlacement?: 'columns' | 'rows';
2125
+ stickyRowHeaders?: boolean;
2126
+ stickyColumnHeaders?: boolean;
2127
+ };
2128
+
2129
+ declare type SemaphorMatrixMemberPathSegment = {
2130
+ levelId: string;
2131
+ value: unknown;
2132
+ };
2133
+
2134
+ declare type SemaphorMatrixSortRule = {
2135
+ axis: 'row' | 'column';
2136
+ targetId?: string;
2137
+ direction: 'asc' | 'desc';
2138
+ by: {
2139
+ kind: 'label';
2140
+ } | {
2141
+ kind: 'field';
2142
+ field: SemaphorFieldRef;
2143
+ aggregate?: SemaphorAggregateFunction;
2144
+ } | {
2145
+ kind: 'value';
2146
+ valueId: string;
2147
+ rowPath?: SemaphorMatrixMemberPathSegment[];
2148
+ columnPath?: SemaphorMatrixMemberPathSegment[];
2149
+ };
2150
+ nulls?: 'warehouseDefault' | 'first' | 'last';
2151
+ scope?: 'global' | 'withinParent';
2152
+ };
2153
+
2154
+ declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
2155
+
2156
+ declare type SemaphorMatrixSubtotalOptions = {
2157
+ enabled?: boolean;
2158
+ position?: 'before' | 'after';
2159
+ label?: string;
2160
+ };
2161
+
2162
+ declare type SemaphorMatrixTotalCalculation = {
2163
+ kind: 'defaultAggregate';
2164
+ } | {
2165
+ kind: 'blank';
2166
+ } | {
2167
+ kind: 'labelOnly';
2168
+ label?: string;
2169
+ } | {
2170
+ kind: 'customAggregate';
2171
+ aggregate: SemaphorAggregateFunction;
2172
+ } | {
2173
+ kind: 'percentOfParent';
2174
+ } | {
2175
+ kind: 'percentOfGrandTotal';
2176
+ } | {
2177
+ kind: 'customExpression';
2178
+ expressionId: string;
2179
+ };
2180
+
2181
+ declare type SemaphorMatrixTotalOptions = {
2182
+ rows?: boolean | 'perLevel';
2183
+ columns?: boolean | 'perLevel';
2184
+ grandTotal?: boolean | {
2185
+ rows?: boolean;
2186
+ columns?: boolean;
2187
+ };
2188
+ rowPosition?: 'top' | 'bottom';
2189
+ columnPosition?: 'left' | 'right';
2190
+ };
2191
+
2192
+ declare type SemaphorMatrixValueField = {
2193
+ id?: string;
2194
+ field: SemaphorFieldRef;
2195
+ aggregate?: SemaphorAggregateFunction;
2196
+ label?: string;
2197
+ format?: SemaphorValueFormat;
2198
+ totalBehavior?: SemaphorMatrixTotalCalculation;
2199
+ };
2200
+
2201
+ declare type SemaphorProtocolVersion = 1;
2202
+
2203
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
2204
+ kind: 'semantic';
2205
+ }>;
2206
+
1986
2207
  declare type SemaphorSourceRef = {
1987
2208
  kind: 'semantic';
1988
2209
  domainId: string;
@@ -2006,6 +2227,46 @@ declare type SemaphorSourceRef = {
2006
2227
  label?: string;
2007
2228
  };
2008
2229
 
2230
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
2231
+
2232
+ declare type SemaphorValueFormat = {
2233
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
2234
+ locale?: string;
2235
+ minimumFractionDigits?: number;
2236
+ maximumFractionDigits?: number;
2237
+ useGrouping?: boolean;
2238
+ prefix?: string;
2239
+ suffix?: string;
2240
+ negativeStyle?: 'minus' | 'parentheses';
2241
+ compact?: boolean;
2242
+ scale?: number;
2243
+ currency?: string;
2244
+ percentValueMode?: 'fraction' | 'whole';
2245
+ } | {
2246
+ type: 'date' | 'datetime';
2247
+ locale?: string;
2248
+ pattern?: string;
2249
+ relative?: boolean;
2250
+ timezone?: string;
2251
+ sourceTimezone?: string;
2252
+ prefix?: string;
2253
+ suffix?: string;
2254
+ } | {
2255
+ type: 'duration';
2256
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2257
+ outputStyle?: 'compact' | 'digital' | 'long';
2258
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2259
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2260
+ maxUnits?: number;
2261
+ prefix?: string;
2262
+ suffix?: string;
2263
+ negativeStyle?: 'minus' | 'parentheses';
2264
+ } | {
2265
+ type: 'string';
2266
+ prefix?: string;
2267
+ suffix?: string;
2268
+ };
2269
+
2009
2270
  declare interface SortByField extends Field {
2010
2271
  role: 'sortby';
2011
2272
  direction: 'asc' | 'desc';
@@ -2561,7 +2822,7 @@ export declare type TChartOptions = {
2561
2822
  treemapColorMode?: 'branch' | 'category';
2562
2823
  };
2563
2824
 
2564
- 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';
2825
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'matrixTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2565
2826
 
2566
2827
  export declare type TColumnSetting<T extends DisplayDataType> = {
2567
2828
  columnIdx: number;