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
@@ -205,6 +205,28 @@ declare interface CalculatedFieldFormula {
205
205
  declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
206
206
 
207
207
  declare interface CardConfig {
208
+ /**
209
+ * Matrix table is the shared analytics-spine successor for pivot and
210
+ * hierarchical aggregate tables. Dashboard cards store the public matrix
211
+ * intent shape so Data Apps, MCP, and dashboard runtime consume one contract.
212
+ */
213
+ matrixIntent?: SemaphorMatrixIntent;
214
+ /**
215
+ * Deprecated compatibility fields for older matrix table drafts. New
216
+ * dashboard-authored matrix cards should use `matrixIntent` so normal
217
+ * `filters` can remain the explorer/card-level `FilterGroup`.
218
+ */
219
+ version?: SemaphorMatrixIntent['version'];
220
+ source?: SemaphorMatrixIntent['source'];
221
+ rows?: SemaphorMatrixIntent['rows'];
222
+ columns?: SemaphorMatrixIntent['columns'];
223
+ values?: SemaphorMatrixIntent['values'];
224
+ inputs?: SemaphorMatrixIntent['inputs'];
225
+ totals?: SemaphorMatrixIntent['totals'];
226
+ sort?: SemaphorMatrixIntent['sort'];
227
+ expansion?: SemaphorMatrixIntent['expansion'];
228
+ layout?: SemaphorMatrixIntent['layout'];
229
+ displayLimits?: SemaphorMatrixIntent['displayLimits'];
208
230
  groupByColumns?: GroupByField[];
209
231
  metricColumns?: MetricField[];
210
232
  pivotByColumns?: PivotByField[];
@@ -1924,6 +1946,37 @@ declare type SemanticExecutionPayload = {
1924
1946
 
1925
1947
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
1926
1948
 
1949
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
1950
+
1951
+ declare type SemaphorAnalyticsFilterBase = {
1952
+ id?: string;
1953
+ field: SemaphorFieldRef;
1954
+ /**
1955
+ * Controls where the filter is applied in an aggregate query.
1956
+ *
1957
+ * `row` means pre-aggregation filtering (`WHERE`).
1958
+ * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
1959
+ * for measure fields the execution engine can aggregate safely.
1960
+ */
1961
+ scope?: 'row' | 'aggregate';
1962
+ };
1963
+
1964
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
1965
+
1966
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
1967
+ operator: SemaphorAnalyticsNullFilterOperator;
1968
+ values?: never;
1969
+ };
1970
+
1971
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
1972
+
1973
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
1974
+ operator?: SemaphorAnalyticsValueFilterOperator;
1975
+ values: unknown[];
1976
+ };
1977
+
1978
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
1979
+
1927
1980
  declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
1928
1981
 
1929
1982
  declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
@@ -1944,7 +1997,7 @@ declare type SemaphorDerivedFieldDefinition = {
1944
1997
  defaultAggregate?: SemaphorAggregateFunction;
1945
1998
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
1946
1999
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
1947
- format?: unknown;
2000
+ format?: SemaphorValueFormat;
1948
2001
  tags?: string[];
1949
2002
  };
1950
2003
 
@@ -1964,6 +2017,14 @@ declare type SemaphorDerivedFieldResultRole = 'measure' | 'group' | 'date' | 'id
1964
2017
 
1965
2018
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1966
2019
 
2020
+ /**
2021
+ * Explorer-backed table source. This is intentionally distinct from raw SQL:
2022
+ * matrix planning needs stable source metadata, fields, and dialect context.
2023
+ */
2024
+ declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
2025
+ kind: 'physical';
2026
+ }>;
2027
+
1967
2028
  declare type SemaphorFieldRef = {
1968
2029
  name: string;
1969
2030
  label?: string;
@@ -1973,6 +2034,166 @@ declare type SemaphorFieldRef = {
1973
2034
  aggregate?: SemaphorAggregateFunction;
1974
2035
  };
1975
2036
 
2037
+ declare type SemaphorInputBinding = {
2038
+ inputId: string;
2039
+ kind?: 'filter' | 'control';
2040
+ controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
2041
+ operator?: SemaphorInputOperator;
2042
+ field?: SemaphorFieldRef;
2043
+ };
2044
+
2045
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
2046
+
2047
+ declare type SemaphorMatrixAxisExpansionOptions = {
2048
+ defaultDepth?: number;
2049
+ lazy?: boolean;
2050
+ expandedPaths?: SemaphorMatrixMemberPathSegment[][];
2051
+ };
2052
+
2053
+ declare type SemaphorMatrixAxisLevel = {
2054
+ id?: string;
2055
+ field: SemaphorFieldRef;
2056
+ grain?: SemaphorTimeGrain;
2057
+ label?: string;
2058
+ subtotal?: boolean | SemaphorMatrixSubtotalOptions;
2059
+ sortBy?: SemaphorMatrixAxisSortRule;
2060
+ };
2061
+
2062
+ declare type SemaphorMatrixAxisSortRule = {
2063
+ direction: 'asc' | 'desc';
2064
+ by: {
2065
+ kind: 'label';
2066
+ } | {
2067
+ kind: 'field';
2068
+ field: SemaphorFieldRef;
2069
+ aggregate?: SemaphorAggregateFunction;
2070
+ };
2071
+ nulls?: 'warehouseDefault' | 'first' | 'last';
2072
+ scope?: 'global' | 'withinParent';
2073
+ };
2074
+
2075
+ declare type SemaphorMatrixDisplayLimitOptions = {
2076
+ rows?: SemaphorMatrixDisplayLimitRule;
2077
+ columns?: SemaphorMatrixDisplayLimitRule;
2078
+ };
2079
+
2080
+ declare type SemaphorMatrixDisplayLimitRule = {
2081
+ limit: number;
2082
+ by?: 'label' | 'value';
2083
+ direction?: 'top' | 'bottom';
2084
+ others?: boolean | {
2085
+ label?: string;
2086
+ };
2087
+ };
2088
+
2089
+ declare type SemaphorMatrixExpansionOptions = {
2090
+ rows?: SemaphorMatrixAxisExpansionOptions;
2091
+ columns?: SemaphorMatrixAxisExpansionOptions;
2092
+ };
2093
+
2094
+ declare type SemaphorMatrixIntent = {
2095
+ kind: 'matrix';
2096
+ version?: SemaphorProtocolVersion;
2097
+ id?: string;
2098
+ label?: string;
2099
+ source: SemaphorMatrixSourceRef;
2100
+ rows: SemaphorMatrixAxisLevel[];
2101
+ columns?: SemaphorMatrixAxisLevel[];
2102
+ values: SemaphorMatrixValueField[];
2103
+ filters?: SemaphorAnalyticsFilter[];
2104
+ inputs?: SemaphorInputBinding[];
2105
+ totals?: SemaphorMatrixTotalOptions;
2106
+ sort?: SemaphorMatrixSortRule[];
2107
+ expansion?: SemaphorMatrixExpansionOptions;
2108
+ layout?: SemaphorMatrixLayoutOptions;
2109
+ displayLimits?: SemaphorMatrixDisplayLimitOptions;
2110
+ };
2111
+
2112
+ declare type SemaphorMatrixLayoutOptions = {
2113
+ hierarchy?: 'compact' | 'tabular' | 'outline';
2114
+ valuesPlacement?: 'columns' | 'rows';
2115
+ stickyRowHeaders?: boolean;
2116
+ stickyColumnHeaders?: boolean;
2117
+ };
2118
+
2119
+ declare type SemaphorMatrixMemberPathSegment = {
2120
+ levelId: string;
2121
+ value: unknown;
2122
+ };
2123
+
2124
+ declare type SemaphorMatrixSortRule = {
2125
+ axis: 'row' | 'column';
2126
+ targetId?: string;
2127
+ direction: 'asc' | 'desc';
2128
+ by: {
2129
+ kind: 'label';
2130
+ } | {
2131
+ kind: 'field';
2132
+ field: SemaphorFieldRef;
2133
+ aggregate?: SemaphorAggregateFunction;
2134
+ } | {
2135
+ kind: 'value';
2136
+ valueId: string;
2137
+ rowPath?: SemaphorMatrixMemberPathSegment[];
2138
+ columnPath?: SemaphorMatrixMemberPathSegment[];
2139
+ };
2140
+ nulls?: 'warehouseDefault' | 'first' | 'last';
2141
+ scope?: 'global' | 'withinParent';
2142
+ };
2143
+
2144
+ declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
2145
+
2146
+ declare type SemaphorMatrixSubtotalOptions = {
2147
+ enabled?: boolean;
2148
+ position?: 'before' | 'after';
2149
+ label?: string;
2150
+ };
2151
+
2152
+ declare type SemaphorMatrixTotalCalculation = {
2153
+ kind: 'defaultAggregate';
2154
+ } | {
2155
+ kind: 'blank';
2156
+ } | {
2157
+ kind: 'labelOnly';
2158
+ label?: string;
2159
+ } | {
2160
+ kind: 'customAggregate';
2161
+ aggregate: SemaphorAggregateFunction;
2162
+ } | {
2163
+ kind: 'percentOfParent';
2164
+ } | {
2165
+ kind: 'percentOfGrandTotal';
2166
+ } | {
2167
+ kind: 'customExpression';
2168
+ expressionId: string;
2169
+ };
2170
+
2171
+ declare type SemaphorMatrixTotalOptions = {
2172
+ rows?: boolean | 'perLevel';
2173
+ columns?: boolean | 'perLevel';
2174
+ grandTotal?: boolean | {
2175
+ rows?: boolean;
2176
+ columns?: boolean;
2177
+ };
2178
+ rowPosition?: 'top' | 'bottom';
2179
+ columnPosition?: 'left' | 'right';
2180
+ };
2181
+
2182
+ declare type SemaphorMatrixValueField = {
2183
+ id?: string;
2184
+ field: SemaphorFieldRef;
2185
+ aggregate?: SemaphorAggregateFunction;
2186
+ label?: string;
2187
+ format?: SemaphorValueFormat;
2188
+ totalBehavior?: SemaphorMatrixTotalCalculation;
2189
+ };
2190
+
2191
+ declare type SemaphorProtocolVersion = 1;
2192
+
2193
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
2194
+ kind: 'semantic';
2195
+ }>;
2196
+
1976
2197
  declare type SemaphorSourceRef = {
1977
2198
  kind: 'semantic';
1978
2199
  domainId: string;
@@ -1996,6 +2217,46 @@ declare type SemaphorSourceRef = {
1996
2217
  label?: string;
1997
2218
  };
1998
2219
 
2220
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
2221
+
2222
+ declare type SemaphorValueFormat = {
2223
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
2224
+ locale?: string;
2225
+ minimumFractionDigits?: number;
2226
+ maximumFractionDigits?: number;
2227
+ useGrouping?: boolean;
2228
+ prefix?: string;
2229
+ suffix?: string;
2230
+ negativeStyle?: 'minus' | 'parentheses';
2231
+ compact?: boolean;
2232
+ scale?: number;
2233
+ currency?: string;
2234
+ percentValueMode?: 'fraction' | 'whole';
2235
+ } | {
2236
+ type: 'date' | 'datetime';
2237
+ locale?: string;
2238
+ pattern?: string;
2239
+ relative?: boolean;
2240
+ timezone?: string;
2241
+ sourceTimezone?: string;
2242
+ prefix?: string;
2243
+ suffix?: string;
2244
+ } | {
2245
+ type: 'duration';
2246
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2247
+ outputStyle?: 'compact' | 'digital' | 'long';
2248
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2249
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2250
+ maxUnits?: number;
2251
+ prefix?: string;
2252
+ suffix?: string;
2253
+ negativeStyle?: 'minus' | 'parentheses';
2254
+ } | {
2255
+ type: 'string';
2256
+ prefix?: string;
2257
+ suffix?: string;
2258
+ };
2259
+
1999
2260
  declare interface SortByField extends Field {
2000
2261
  role: 'sortby';
2001
2262
  direction: 'asc' | 'desc';
@@ -2549,7 +2810,7 @@ export declare type TChartOptions = {
2549
2810
  treemapColorMode?: 'branch' | 'category';
2550
2811
  };
2551
2812
 
2552
- 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';
2813
+ 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';
2553
2814
 
2554
2815
  export declare type TColumnSetting<T extends DisplayDataType> = {
2555
2816
  columnIdx: number;
@@ -600,7 +600,7 @@ declare type SemaphorDerivedFieldDefinition = {
600
600
  defaultAggregate?: SemaphorAggregateFunction;
601
601
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
602
602
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
603
- format?: unknown;
603
+ format?: SemaphorValueFormat;
604
604
  tags?: string[];
605
605
  };
606
606
 
@@ -799,6 +799,7 @@ declare type SemaphorMatrixValueField = {
799
799
  field: SemaphorFieldRef;
800
800
  aggregate?: SemaphorAggregateFunction;
801
801
  label?: string;
802
+ format?: SemaphorValueFormat;
802
803
  totalBehavior?: SemaphorMatrixTotalCalculation;
803
804
  };
804
805
 
@@ -921,6 +922,44 @@ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' |
921
922
 
922
923
  declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
923
924
 
925
+ declare type SemaphorValueFormat = {
926
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
927
+ locale?: string;
928
+ minimumFractionDigits?: number;
929
+ maximumFractionDigits?: number;
930
+ useGrouping?: boolean;
931
+ prefix?: string;
932
+ suffix?: string;
933
+ negativeStyle?: 'minus' | 'parentheses';
934
+ compact?: boolean;
935
+ scale?: number;
936
+ currency?: string;
937
+ percentValueMode?: 'fraction' | 'whole';
938
+ } | {
939
+ type: 'date' | 'datetime';
940
+ locale?: string;
941
+ pattern?: string;
942
+ relative?: boolean;
943
+ timezone?: string;
944
+ sourceTimezone?: string;
945
+ prefix?: string;
946
+ suffix?: string;
947
+ } | {
948
+ type: 'duration';
949
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
950
+ outputStyle?: 'compact' | 'digital' | 'long';
951
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
952
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
953
+ maxUnits?: number;
954
+ prefix?: string;
955
+ suffix?: string;
956
+ negativeStyle?: 'minus' | 'parentheses';
957
+ } | {
958
+ type: 'string';
959
+ prefix?: string;
960
+ suffix?: string;
961
+ };
962
+
924
963
  export declare type WorkspaceContext = {
925
964
  projectRoot?: string;
926
965
  framework?: string;
@@ -36,44 +36,27 @@ declare type MatrixAxisLevelDescriptor = {
36
36
  subtotal?: SemaphorMatrixSubtotalOptions;
37
37
  };
38
38
 
39
- declare type MatrixAxisPayload = {
39
+ declare type MatrixAxisResultPayload = {
40
40
  id: 'rows' | 'columns';
41
41
  levels: MatrixAxisLevelDescriptor[];
42
- nodes: MatrixNode[];
42
+ nodeIds: string[];
43
43
  };
44
44
 
45
- declare type MatrixCapability = 'rowHierarchy' | 'columnHierarchy' | 'rowSubtotals' | 'columnSubtotals' | 'grandTotals' | 'lazyRows' | 'lazyColumns' | 'conditionalFormatting' | 'visualExport' | (string & {});
46
-
47
- declare type MatrixCell = {
45
+ declare type MatrixCalculationDescriptor = {
48
46
  id: string;
49
- rowNodeId: string;
50
- columnNodeId?: string;
51
- measureInstanceId: string;
52
- rowPath: MatrixMemberPathSegment[];
53
- columnPath: MatrixMemberPathSegment[];
54
- rawValue: unknown;
55
- presence: MatrixCellPresence;
56
- formattedValue?: string;
57
- role: MatrixCellRole;
58
- aggregateFunction?: SemaphorAggregateFunction;
59
- formattingScope: MatrixCellFormattingScope;
60
- actions?: MatrixCellAction[];
61
- };
62
-
63
- declare type MatrixCellAction = {
64
- kind: 'requestSubgoal' | 'filter' | 'copyValue' | 'explainCalculation' | 'inspectContributingRows' | 'drillThrough' | (string & {});
47
+ measureId: string;
48
+ aggregate?: SemaphorAggregateFunction;
65
49
  label?: string;
66
- payload?: Record<string, unknown>;
50
+ source: 'measureDefault' | 'rowSubtotal' | 'columnSubtotal' | 'subtotalIntersection' | 'rowGrandTotal' | 'columnGrandTotal' | 'matrixGrandTotal' | 'custom';
51
+ scope?: {
52
+ rowLevelId?: string;
53
+ columnLevelId?: string;
54
+ rowNodeId?: string;
55
+ columnNodeId?: string;
56
+ };
67
57
  };
68
58
 
69
- declare type MatrixCellFormattingScope = {
70
- rowNodeId: string;
71
- columnNodeId?: string;
72
- measureInstanceId: string;
73
- role: MatrixCellRole;
74
- rowPath: MatrixMemberPathSegment[];
75
- columnPath: MatrixMemberPathSegment[];
76
- };
59
+ declare type MatrixCapability = 'rowHierarchy' | 'columnHierarchy' | 'rowSubtotals' | 'columnSubtotals' | 'grandTotals' | 'lazyRows' | 'lazyColumns' | 'conditionalFormatting' | 'visualExport' | (string & {});
77
60
 
78
61
  declare type MatrixCellPresence = 'present' | 'presentNull' | 'missing' | 'densified';
79
62
 
@@ -114,10 +97,6 @@ declare type MatrixFieldDescriptor = {
114
97
  label?: string;
115
98
  };
116
99
 
117
- declare type MatrixFieldDirectory = {
118
- fieldsByInstanceId: Record<string, MatrixFieldDescriptor>;
119
- };
120
-
121
100
  declare type MatrixFormattingContext = {
122
101
  domains?: Record<string, {
123
102
  min?: number;
@@ -126,19 +105,6 @@ declare type MatrixFormattingContext = {
126
105
  rules?: Array<Record<string, unknown>>;
127
106
  };
128
107
 
129
- declare type MatrixGridCell = {
130
- id: string;
131
- columnId: string;
132
- cellId?: string;
133
- rawValue: unknown;
134
- formattedValue?: string;
135
- presence: MatrixCellPresence;
136
- role: MatrixCellRole;
137
- measureInstanceId: string;
138
- rowPath: MatrixMemberPathSegment[];
139
- columnPath: MatrixMemberPathSegment[];
140
- };
141
-
142
108
  declare type MatrixGridColumn = {
143
109
  id: string;
144
110
  label: string;
@@ -163,42 +129,32 @@ declare type MatrixGridHeaderRow = {
163
129
  cells: MatrixGridHeaderCell[];
164
130
  };
165
131
 
166
- declare type MatrixGridProjection = {
167
- schemaVersion: 1;
168
- shape: MatrixShape;
169
- rowHeaderLevels: MatrixGridRowHeaderLevel[];
170
- columnHeaderRows: MatrixGridHeaderRow[];
171
- columns: MatrixGridColumn[];
172
- rows: MatrixGridRow[];
173
- };
174
-
175
- declare type MatrixGridRow = {
176
- id: string;
177
- rowNodeId: string;
178
- rowPath: MatrixMemberPathSegment[];
179
- depth: number;
180
- label: string;
181
- role: 'value' | 'rowSubtotal' | 'rowGrandTotal';
182
- isExpanded?: boolean;
183
- hasChildren?: boolean;
184
- cells: MatrixGridCell[];
185
- };
186
-
187
132
  declare type MatrixGridRowHeaderLevel = {
188
133
  id: string;
189
134
  label: string;
190
135
  fieldInstanceId: string;
191
136
  };
192
137
 
138
+ declare type MatrixLayoutProjection = {
139
+ rowHeaderLevels: MatrixGridRowHeaderLevel[];
140
+ columnHeaderRows: MatrixGridHeaderRow[];
141
+ columns: MatrixGridColumn[];
142
+ };
143
+
193
144
  declare type MatrixMeasureDescriptor = {
194
145
  instanceId: string;
195
146
  fieldKey: string;
196
147
  label: string;
197
148
  field: SemaphorFieldRef;
198
149
  aggregate?: SemaphorAggregateFunction;
150
+ format?: SemaphorValueFormat;
199
151
  totalBehavior?: SemaphorMatrixTotalCalculation;
200
152
  };
201
153
 
154
+ declare type MatrixMeasureResultDescriptor = MatrixMeasureDescriptor & {
155
+ semantics: MatrixMeasureSemantics;
156
+ };
157
+
202
158
  declare type MatrixMeasureSemantics = {
203
159
  kind: 'additive';
204
160
  aggregate?: SemaphorAggregateFunction;
@@ -257,29 +213,6 @@ declare type MatrixPageInfo = {
257
213
  hasMoreColumns?: boolean;
258
214
  };
259
215
 
260
- declare type MatrixPayload = {
261
- kind: 'matrixPayload';
262
- schemaVersion: 1;
263
- shape: MatrixShape;
264
- capabilities: MatrixCapability[];
265
- executionMetadata: MatrixExecutionMetadata;
266
- axes: {
267
- rows: MatrixAxisPayload;
268
- columns: MatrixAxisPayload;
269
- };
270
- measures: MatrixMeasureDescriptor[];
271
- measureSemantics: Record<string, MatrixMeasureSemantics>;
272
- fieldDirectory: MatrixFieldDirectory;
273
- rowNodes: MatrixNode[];
274
- columnNodes: MatrixNode[];
275
- cells: MatrixCell[];
276
- totals: MatrixTotals;
277
- sort: MatrixResolvedSort[];
278
- formattingContext: MatrixFormattingContext;
279
- pageInfo?: MatrixPageInfo;
280
- warnings?: MatrixWarning[];
281
- };
282
-
283
216
  declare type MatrixQueryStrategy = 'tall' | 'wide' | 'lazy' | 'export';
284
217
 
285
218
  declare type MatrixResolvedSort = {
@@ -292,6 +225,17 @@ declare type MatrixResolvedSort = {
292
225
  by: SemaphorMatrixSortRule['by'];
293
226
  };
294
227
 
228
+ declare type MatrixResultCell = {
229
+ rowId: string;
230
+ columnId?: string;
231
+ measureId: string;
232
+ value: unknown;
233
+ formattedValue?: string;
234
+ presence: MatrixCellPresence;
235
+ role: MatrixCellRole;
236
+ calculationId?: string;
237
+ };
238
+
295
239
  declare type MatrixShape = 'hierarchical' | 'pivot';
296
240
 
297
241
  declare type MatrixTotals = {
@@ -303,13 +247,6 @@ declare type MatrixTotals = {
303
247
  };
304
248
  };
305
249
 
306
- declare type MatrixWarning = {
307
- code: string;
308
- message: string;
309
- path?: string;
310
- severity?: 'info' | 'warning' | 'error';
311
- };
312
-
313
250
  export declare function normalizeSemaphorAnalysisQueryOptions(value: unknown, options?: {
314
251
  pathPrefix?: string;
315
252
  validateTimezone?: SemaphorAnalysisTimezoneValidator;
@@ -567,7 +504,7 @@ declare type SemaphorDerivedFieldDefinition = {
567
504
  defaultAggregate?: SemaphorAggregateFunction;
568
505
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
569
506
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
570
- format?: unknown;
507
+ format?: SemaphorValueFormat;
571
508
  tags?: string[];
572
509
  };
573
510
 
@@ -801,9 +738,25 @@ declare type SemaphorMatrixQuerySpec = Omit<SemaphorMatrixIntent, 'kind' | 'vers
801
738
 
802
739
  declare type SemaphorMatrixResult = SemaphorAnalyticsResultBase & {
803
740
  kind: 'matrix';
804
- intent: SemaphorMatrixIntent;
805
- payload: MatrixPayload;
806
- grid: MatrixGridProjection;
741
+ schemaVersion: 1;
742
+ intent?: SemaphorMatrixIntent;
743
+ shape: MatrixShape;
744
+ capabilities: MatrixCapability[];
745
+ executionMetadata: MatrixExecutionMetadata;
746
+ fieldsById: Record<string, MatrixFieldDescriptor>;
747
+ measuresById: Record<string, MatrixMeasureResultDescriptor>;
748
+ calculationsById?: Record<string, MatrixCalculationDescriptor>;
749
+ axes: {
750
+ rows: MatrixAxisResultPayload;
751
+ columns: MatrixAxisResultPayload;
752
+ };
753
+ nodesById: Record<string, MatrixNode>;
754
+ layout: MatrixLayoutProjection;
755
+ cells: MatrixResultCell[];
756
+ totals: MatrixTotals;
757
+ sort: MatrixResolvedSort[];
758
+ formattingContext: MatrixFormattingContext;
759
+ pageInfo?: MatrixPageInfo;
807
760
  expansion?: MatrixExpansionResponseHints;
808
761
  };
809
762
 
@@ -870,6 +823,7 @@ declare type SemaphorMatrixValueField = {
870
823
  field: SemaphorFieldRef;
871
824
  aggregate?: SemaphorAggregateFunction;
872
825
  label?: string;
826
+ format?: SemaphorValueFormat;
873
827
  totalBehavior?: SemaphorMatrixTotalCalculation;
874
828
  };
875
829
 
@@ -1179,6 +1133,44 @@ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' |
1179
1133
 
1180
1134
  declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
1181
1135
 
1136
+ declare type SemaphorValueFormat = {
1137
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1138
+ locale?: string;
1139
+ minimumFractionDigits?: number;
1140
+ maximumFractionDigits?: number;
1141
+ useGrouping?: boolean;
1142
+ prefix?: string;
1143
+ suffix?: string;
1144
+ negativeStyle?: 'minus' | 'parentheses';
1145
+ compact?: boolean;
1146
+ scale?: number;
1147
+ currency?: string;
1148
+ percentValueMode?: 'fraction' | 'whole';
1149
+ } | {
1150
+ type: 'date' | 'datetime';
1151
+ locale?: string;
1152
+ pattern?: string;
1153
+ relative?: boolean;
1154
+ timezone?: string;
1155
+ sourceTimezone?: string;
1156
+ prefix?: string;
1157
+ suffix?: string;
1158
+ } | {
1159
+ type: 'duration';
1160
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1161
+ outputStyle?: 'compact' | 'digital' | 'long';
1162
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1163
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1164
+ maxUnits?: number;
1165
+ prefix?: string;
1166
+ suffix?: string;
1167
+ negativeStyle?: 'minus' | 'parentheses';
1168
+ } | {
1169
+ type: 'string';
1170
+ prefix?: string;
1171
+ suffix?: string;
1172
+ };
1173
+
1182
1174
  export declare function validateSemaphorDataAppQuerySpecs(input: {
1183
1175
  queries: SemaphorDataAppQuerySpecEnvelope[];
1184
1176
  fieldCatalogs?: SemaphorDataAppFieldCatalog[];