react-semaphor 0.1.443 → 0.1.445

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 (133) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/analytics-protocol/index.cjs +1 -1
  3. package/dist/analytics-protocol/index.js +123 -107
  4. package/dist/appearance/index.cjs +1 -1
  5. package/dist/brand-studio/index.cjs +2 -2
  6. package/dist/brand-studio/index.js +5 -4
  7. package/dist/briefings/index.cjs +1 -1
  8. package/dist/briefings/index.js +526 -457
  9. package/dist/chunks/analyze-result-contract-BHb7sUUW.cjs +1 -0
  10. package/dist/chunks/analyze-result-contract-DUv3QnMl.js +29 -0
  11. package/dist/chunks/{braces-CbO-aIwH.js → braces-BKimshER.cjs} +1 -1
  12. package/dist/chunks/{code-editor-BpADiIlq.js → code-editor-B4gTfvc5.js} +6800 -6560
  13. package/dist/chunks/code-editor-BYVorgOf.cjs +138 -0
  14. package/dist/chunks/common-types-CQ6SHfLk.cjs +1 -0
  15. package/dist/chunks/{common-types-ClkOI-3O.js → common-types-DFsDdpH7.js} +22 -21
  16. package/dist/chunks/dashboard-CAiwJW3L.cjs +1397 -0
  17. package/dist/chunks/{dashboard-briefing-launcher-C60n8LqW.js → dashboard-briefing-launcher-2SLNOaTg.js} +26 -24
  18. package/dist/chunks/{dashboard-briefing-launcher-BYMLjZxG.js → dashboard-briefing-launcher-CHwjpUYz.cjs} +2 -2
  19. package/dist/chunks/{dashboard-controls-ti9Rcel2.js → dashboard-controls-BfL14aqO.js} +11 -9
  20. package/dist/chunks/{dashboard-controls-BH_fZYDU.js → dashboard-controls-BgGTg4yw.cjs} +2 -2
  21. package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +1 -0
  22. package/dist/chunks/dashboard-json-BOv8tCa9.cjs +1 -0
  23. package/dist/chunks/{dashboard-json-Bturr634.js → dashboard-json-BZwq3EcS.js} +14 -12
  24. package/dist/chunks/{dashboard-Bd1Quco-.js → dashboard-u61yfU6u.js} +50081 -47351
  25. package/dist/chunks/edit-dashboard-visual-BdVCH0DJ.cjs +182 -0
  26. package/dist/chunks/{edit-dashboard-visual-DglMds57.js → edit-dashboard-visual-njLPYip3.js} +6825 -6656
  27. package/dist/chunks/{editor-action-buttons-CRi0fhVW.js → editor-action-buttons-BhLX5Q6m.js} +24 -23
  28. package/dist/chunks/{editor-action-buttons-Cxo7_tNG.js → editor-action-buttons-CBVMFipA.cjs} +1 -1
  29. package/dist/chunks/{index-D7KJindZ.js → format-types-CSv0V7mm.cjs} +1 -1
  30. package/dist/chunks/{index-CnujJ3fa.js → format-types-CZH5w1lo.js} +23 -17
  31. package/dist/chunks/{layout-grid-B08pP7v6.js → layout-grid-3-HWzEwU.cjs} +1 -1
  32. package/dist/chunks/{metric-comparison-CPoDx56y.js → metric-comparison-BJ_Qu1ZF.js} +1 -1
  33. package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +1 -0
  34. package/dist/chunks/{palette-C0yjT5Tv.js → palette-DW_l7Jr0.cjs} +1 -1
  35. package/dist/chunks/pivot-result-identity-B6QCWOSi.js +94 -0
  36. package/dist/chunks/pivot-result-identity-CDLRT-YG.cjs +1 -0
  37. package/dist/chunks/pivot-result-lifecycle-BM3Pl-D1.js +914 -0
  38. package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +4 -0
  39. package/dist/chunks/presentation-execution-BTV-Q43g.cjs +1 -0
  40. package/dist/chunks/presentation-execution-CGlb7YZ6.js +637 -0
  41. package/dist/chunks/{report-preferences-dialog-TtwdAuNn.js → report-preferences-dialog-D_NJu2wU.js} +7 -6
  42. package/dist/chunks/report-preferences-dialog-r8QzOSFb.cjs +1 -0
  43. package/dist/chunks/report-runtime-context-C8LZFsqV.cjs +1 -0
  44. package/dist/chunks/report-runtime-context-Qzn11HQe.js +387 -0
  45. package/dist/chunks/{save-Xdc4pnys.js → save-4_uMnE6s.cjs} +1 -1
  46. package/dist/chunks/{search-Dcud9ajy.js → search-6ZmeMq55.cjs} +1 -1
  47. package/dist/chunks/temporal-bucket-BnPxGrAi.js +446 -0
  48. package/dist/chunks/temporal-bucket-authoring-BUZMuVca.js +205 -0
  49. package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +1 -0
  50. package/dist/chunks/temporal-bucket-contract-B2bJ1oe4.js +108 -0
  51. package/dist/chunks/temporal-bucket-contract-ChDBWX8I.cjs +1 -0
  52. package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +1 -0
  53. package/dist/chunks/{comparison-document-migration-Dj6xZMCb.js → temporal-result-owner-Cb27SSG9.js} +152 -123
  54. package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +1 -0
  55. package/dist/chunks/token-types-BdQ8kHBm.cjs +1 -0
  56. package/dist/chunks/token-types-DLo91nOf.js +8 -0
  57. package/dist/chunks/{update-policy-DnF_74zC.js → update-policy-BxvYMYz0.cjs} +1 -1
  58. package/dist/chunks/{update-policy-De2NswtM.js → update-policy-eg59mQqv.js} +1 -1
  59. package/dist/chunks/validators-9D4KBqKD.cjs +1 -0
  60. package/dist/chunks/validators-wZ2WlNHc.js +4640 -0
  61. package/dist/dashboard/index.cjs +1 -1
  62. package/dist/dashboard/index.js +2 -2
  63. package/dist/dashboard-authoring/index.cjs +3 -3
  64. package/dist/dashboard-authoring/index.js +136 -126
  65. package/dist/data-app-builder/index.cjs +1 -1
  66. package/dist/data-app-builder/index.js +2 -2
  67. package/dist/data-app-codegen/index.cjs +1 -1
  68. package/dist/data-app-codegen/index.js +2 -2
  69. package/dist/data-app-codegen-node/index.cjs +1 -1
  70. package/dist/data-app-codegen-node/index.js +3 -3
  71. package/dist/data-app-sdk/index.cjs +2 -2
  72. package/dist/data-app-sdk/index.js +34 -35
  73. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  74. package/dist/data-app-sdk-adapters/index.js +5 -5
  75. package/dist/data-app-sdk-validation/index.cjs +1 -1
  76. package/dist/data-app-sdk-validation/index.js +9 -10
  77. package/dist/format-utils/index.cjs +3 -3
  78. package/dist/format-utils/index.js +155 -176
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.js +180 -174
  81. package/dist/report-runtime-context/index.cjs +1 -1
  82. package/dist/report-runtime-context/index.js +7 -392
  83. package/dist/shared/index.cjs +1 -1
  84. package/dist/style.css +1 -1
  85. package/dist/surfboard/index.cjs +1 -1
  86. package/dist/surfboard/index.js +3 -3
  87. package/dist/types/analytics-protocol.d.ts +257 -48
  88. package/dist/types/briefings.d.ts +138 -50
  89. package/dist/types/dashboard-assistant.d.ts +207 -52
  90. package/dist/types/dashboard-authoring.d.ts +182 -50
  91. package/dist/types/dashboard.d.ts +290 -48
  92. package/dist/types/data-app-builder.d.ts +48 -42
  93. package/dist/types/data-app-codegen-node.d.ts +50 -44
  94. package/dist/types/data-app-codegen.d.ts +50 -44
  95. package/dist/types/data-app-sdk-adapters.d.ts +48 -42
  96. package/dist/types/data-app-sdk-validation.d.ts +81 -43
  97. package/dist/types/data-app-sdk.d.ts +83 -45
  98. package/dist/types/format-utils.d.ts +645 -67
  99. package/dist/types/index.cjs +1 -1
  100. package/dist/types/index.js +19 -19
  101. package/dist/types/main.d.ts +298 -94
  102. package/dist/types/report-runtime-context.d.ts +3 -0
  103. package/dist/types/shared.d.ts +116 -41
  104. package/dist/types/surfboard.d.ts +290 -48
  105. package/dist/types/types.d.ts +455 -65
  106. package/package.json +3 -1
  107. package/dist/chunks/analyze-result-contract-BswhsmWT.js +0 -1
  108. package/dist/chunks/analyze-result-contract-CfOBEwaC.js +0 -1998
  109. package/dist/chunks/code-editor-M7HTUhdF.js +0 -138
  110. package/dist/chunks/common-types-C73-Ud1-.js +0 -1
  111. package/dist/chunks/comparison-document-migration-DbU_BTxR.js +0 -1
  112. package/dist/chunks/csv-utils-BZDvO2Fw.js +0 -376
  113. package/dist/chunks/csv-utils-Co0WxHke.js +0 -4
  114. package/dist/chunks/dashboard-cB3xmTNn.js +0 -1402
  115. package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +0 -1
  116. package/dist/chunks/dashboard-json-Dw_55vSZ.js +0 -1
  117. package/dist/chunks/edit-dashboard-visual-BUc3NBQ4.js +0 -182
  118. package/dist/chunks/metric-comparison-DVy3fll_.js +0 -1
  119. package/dist/chunks/numeric-presentation-BJs5lSar.js +0 -517
  120. package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +0 -1
  121. package/dist/chunks/report-preferences-dialog-CCvFqH4Q.js +0 -1
  122. package/dist/chunks/source-identity-5OPV4gvg.js +0 -92
  123. package/dist/chunks/source-identity-Cbo2LOHQ.js +0 -1
  124. package/dist/chunks/validators-B2vUAqTf.js +0 -1
  125. package/dist/chunks/validators-Bce_J7Vd.js +0 -2448
  126. /package/dist/chunks/{card-config-utils-15sRtebL.js → card-config-utils-15sRtebL.cjs} +0 -0
  127. /package/dist/chunks/{catalog-field-grounding-Bnx-3tE0.js → catalog-field-grounding-Bnx-3tE0.cjs} +0 -0
  128. /package/dist/chunks/{dashboard-input-contract-DV3cshjz.js → dashboard-input-contract-DV3cshjz.cjs} +0 -0
  129. /package/dist/chunks/{index-Dpm_VET4.js → index-Dpm_VET4.cjs} +0 -0
  130. /package/dist/chunks/{index-jSrCwPQz.js → index-jSrCwPQz.cjs} +0 -0
  131. /package/dist/chunks/{normalize-dashboard-for-dirty-check-BXRUMVb2.js → normalize-dashboard-for-dirty-check-BXRUMVb2.cjs} +0 -0
  132. /package/dist/chunks/{operators-DrTQsJXv.js → operators-DrTQsJXv.cjs} +0 -0
  133. /package/dist/chunks/{use-debounced-dirty-check-XHSwAefL.js → use-debounced-dirty-check-XHSwAefL.cjs} +0 -0
@@ -315,6 +315,7 @@ export declare type BriefingDraft = {
315
315
  presentation?: Partial<BriefingPresentation>;
316
316
  limits?: BriefingLimits;
317
317
  deliveryConfig?: BriefingDeliveryConfig | null;
318
+ resolvedFormats?: ResolvedPresentationEntry[];
318
319
  };
319
320
 
320
321
  export declare type BriefingEntityPresentation = {
@@ -337,6 +338,7 @@ declare type BriefingFragments = {
337
338
  export declare type BriefingJobConfig = {
338
339
  kind: BriefingKind;
339
340
  reportContext: ReportRuntimeContext;
341
+ resolvedFormats?: ResolvedPresentationEntry[];
340
342
  source: BriefingSource;
341
343
  body: BriefingBody;
342
344
  attachments: BriefingAttachment[];
@@ -605,9 +607,6 @@ declare interface CardConfig {
605
607
  * Configuration for on-click dashboard filters triggered by this card.
606
608
  */
607
609
  clickFilterInteractions?: ClickFilterInteraction[];
608
- showTrendline?: boolean;
609
- trendlineWindow?: number;
610
- trendlineGranularity?: 'day' | 'week' | 'month';
611
610
  summary?: {
612
611
  enabled?: boolean;
613
612
  showOnCard?: boolean;
@@ -901,7 +900,10 @@ declare type ControlOption = {
901
900
  label: string;
902
901
  presentation?: {
903
902
  granularity?: TimeGranularity;
903
+ format?: TemporalBucketFormat;
904
+ /** Saved-dashboard compatibility only. New authoring writes `format`. */
904
905
  dateFormat?: DateFormatValue;
906
+ /** Saved-dashboard compatibility only. New authoring writes `format`. */
905
907
  customFormat?: string;
906
908
  };
907
909
  };
@@ -937,6 +939,7 @@ export declare type CreateBriefingRequest = {
937
939
  presentation: BriefingPresentation;
938
940
  limits?: BriefingLimits;
939
941
  deliveryConfig: BriefingDeliveryConfig | null;
942
+ resolvedFormats?: ResolvedPresentationEntry[];
940
943
  };
941
944
 
942
945
  declare type CurrencyPresentationBinding = {
@@ -1229,8 +1232,9 @@ declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'fi
1229
1232
 
1230
1233
  declare interface Field {
1231
1234
  /**
1232
- * Unique identifier for this field instance (for joins, UI state, etc.).
1233
- * Should be unique within the context of the query or data model.
1235
+ * Stable authored/semantic field identifier (for joins, UI state, etc.).
1236
+ * It is normally unique within a role, but one saved query may reuse it in
1237
+ * different roles; result bindings must therefore include the role.
1234
1238
  * Example: 'orders.customer_id', 'expr_12345', etc.
1235
1239
  */
1236
1240
  id: string;
@@ -1272,6 +1276,12 @@ declare interface Field {
1272
1276
  */
1273
1277
  derivedField?: SemaphorDerivedFieldDefinition;
1274
1278
  format?: FormatSpec;
1279
+ /**
1280
+ * Source-level temporal presentation keeps the semantic grain that authored
1281
+ * the format. The card's mutable `granularity` remains the active query
1282
+ * grain, so changing it cannot accidentally retarget a semantic default.
1283
+ */
1284
+ semanticTemporalPresentation?: SemanticTemporalPresentation;
1275
1285
  aggregate?: AggregateFunction;
1276
1286
  fieldScope?: FieldScope;
1277
1287
  }
@@ -1304,6 +1314,10 @@ declare interface FilterCondition {
1304
1314
  field: Field;
1305
1315
  operator: Operator;
1306
1316
  value: FilterValue;
1317
+ /** Display-only label for canonical grouped-temporal values. */
1318
+ label?: string;
1319
+ /** Governed meaning for a canonical grouped-temporal scalar. */
1320
+ temporalBucket?: TemporalBucketMetadata;
1307
1321
  }
1308
1322
 
1309
1323
  declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
@@ -1389,7 +1403,7 @@ declare type FormatSpec = {
1389
1403
  type: 'string';
1390
1404
  prefix?: string;
1391
1405
  suffix?: string;
1392
- };
1406
+ } | TemporalBucketFormat;
1393
1407
 
1394
1408
  export declare function getBriefingCardAttachmentCapability(card: TCard): BriefingCardAttachmentCapability;
1395
1409
 
@@ -1424,7 +1438,7 @@ export declare function getDefaultBriefingCardAttachmentFormat(input: {
1424
1438
  allowDownload?: boolean;
1425
1439
  }): BriefingAttachmentFormat;
1426
1440
 
1427
- declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1441
+ declare type Granularity = SemaphorTimeGrain;
1428
1442
 
1429
1443
  declare interface GroupByColumn extends BaseColumn {
1430
1444
  role: 'groupby';
@@ -1435,6 +1449,11 @@ declare interface GroupByColumn extends BaseColumn {
1435
1449
  declare interface GroupByField extends Field {
1436
1450
  role: 'groupby';
1437
1451
  granularity?: TimeGranularity;
1452
+ /**
1453
+ * Query transport policy for grouped temporal values. This is projected
1454
+ * into executable card config and is not persisted authoring state.
1455
+ */
1456
+ dateValueMode?: 'canonical' | 'formatted';
1438
1457
  /**
1439
1458
  * Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
1440
1459
  * If present, used in SELECT and GROUP BY instead of just the column name.
@@ -1691,15 +1710,6 @@ declare type NumberOptions = {
1691
1710
  colorRanges?: ColorRange[];
1692
1711
  };
1693
1712
 
1694
- /**
1695
- * Shared format types for export system
1696
- * IMPORTANT: No React imports allowed in this file
1697
- *
1698
- * These types are used by:
1699
- * - react-semaphor (browser) for client-side exports
1700
- * - semaphor-app (Next.js) for API routes
1701
- * - Lambda (Node.js) for async export processing
1702
- */
1703
1713
  declare type NumericCanonicalFormat = {
1704
1714
  type: 'number' | 'currency' | 'percent' | 'scientific';
1705
1715
  locale?: string;
@@ -1773,8 +1783,19 @@ declare type PersistedInteraction = Interaction & {
1773
1783
 
1774
1784
  declare interface PivotByField extends Field {
1775
1785
  role: 'pivotby';
1786
+ /**
1787
+ * Query transport policy for grouped temporal pivot members. This is
1788
+ * projected into executable config and is never persisted authoring state.
1789
+ */
1790
+ dateValueMode?: 'canonical' | 'formatted';
1776
1791
  }
1777
1792
 
1793
+ declare type PresentationScope = {
1794
+ dashboardId: string;
1795
+ cardId?: string;
1796
+ attachmentIndex?: number;
1797
+ };
1798
+
1778
1799
  declare interface QueryConfig {
1779
1800
  groupByColumns?: GroupByColumn[];
1780
1801
  pivotColumns?: GroupByColumn[];
@@ -1841,6 +1862,24 @@ declare type ResolvedCalendarPreferenceSources = {
1841
1862
  weekStart: ReportPreferenceSource;
1842
1863
  };
1843
1864
 
1865
+ declare type ResolvedNumericPresentationEntry = {
1866
+ scope: PresentationScope;
1867
+ target: NumericPresentationTarget;
1868
+ format: NumericCanonicalFormat;
1869
+ };
1870
+
1871
+ declare type ResolvedPresentationEntry = ResolvedNumericPresentationEntry | ResolvedTemporalBucketPresentationEntry;
1872
+
1873
+ declare type ResolvedTemporalBucketFormat = TemporalBucketFormat & {
1874
+ locale: string;
1875
+ };
1876
+
1877
+ declare type ResolvedTemporalBucketPresentationEntry = {
1878
+ scope: PresentationScope;
1879
+ target: TemporalBucketPresentationTarget;
1880
+ format: ResolvedTemporalBucketFormat;
1881
+ };
1882
+
1844
1883
  declare type ResolvedValueFormatPreferences = {
1845
1884
  locale: string;
1846
1885
  dateStyle: LocaleStyle;
@@ -1865,6 +1904,15 @@ declare type SelectedEntities = SelectedEntity[];
1865
1904
 
1866
1905
  declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
1867
1906
 
1907
+ declare type SemanticTemporalPresentation = {
1908
+ granularity: SemaphorTimeGrain;
1909
+ format: TemporalBucketFormat;
1910
+ };
1911
+
1912
+ declare const SEMAPHOR_MATRIX_TIME_GRAINS: ["hour", "day", "week", "month", "quarter", "year"];
1913
+
1914
+ declare const SEMAPHOR_TIME_GRAINS: readonly ["second", "minute", "hour", "day", "week", "month", "quarter", "year"];
1915
+
1868
1916
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
1869
1917
 
1870
1918
  declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
@@ -1918,7 +1966,7 @@ declare type SemaphorDerivedFieldDefinition = {
1918
1966
  defaultAggregate?: SemaphorAggregateFunction;
1919
1967
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
1920
1968
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
1921
- format?: SemaphorValueFormat;
1969
+ format?: SemaphorScalarValueFormat;
1922
1970
  tags?: string[];
1923
1971
  };
1924
1972
 
@@ -1969,7 +2017,7 @@ declare type SemaphorMatrixAxisExpansionOptions = {
1969
2017
  declare type SemaphorMatrixAxisLevel = {
1970
2018
  id?: string;
1971
2019
  field: SemaphorFieldRef;
1972
- grain?: SemaphorTimeGrain;
2020
+ grain?: SemaphorMatrixTimeGrain;
1973
2021
  label?: string;
1974
2022
  subtotal?: boolean | SemaphorMatrixSubtotalOptions;
1975
2023
  sortBy?: SemaphorMatrixAxisSortRule;
@@ -2061,6 +2109,8 @@ declare type SemaphorMatrixSubtotalOptions = {
2061
2109
  label?: string;
2062
2110
  };
2063
2111
 
2112
+ declare type SemaphorMatrixTimeGrain = (typeof SEMAPHOR_MATRIX_TIME_GRAINS)[number];
2113
+
2064
2114
  declare type SemaphorMatrixTotalCalculation = {
2065
2115
  kind: 'defaultAggregate';
2066
2116
  } | {
@@ -2096,7 +2146,7 @@ declare type SemaphorMatrixValueField = {
2096
2146
  field: SemaphorFieldRef;
2097
2147
  aggregate?: SemaphorAggregateFunction;
2098
2148
  label?: string;
2099
- format?: SemaphorValueFormat;
2149
+ format?: SemaphorScalarValueFormat;
2100
2150
  totalBehavior?: SemaphorMatrixTotalCalculation;
2101
2151
  };
2102
2152
 
@@ -2106,36 +2156,7 @@ declare type SemaphorRelationshipHint = {
2106
2156
  relationshipIds?: string[];
2107
2157
  };
2108
2158
 
2109
- declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
2110
- kind: 'semantic';
2111
- }>;
2112
-
2113
- declare type SemaphorSourceRef = {
2114
- kind: 'semantic';
2115
- domainId: string;
2116
- datasetName: string;
2117
- datasetId?: string;
2118
- label?: string;
2119
- connectionId?: string;
2120
- } | {
2121
- kind: 'physical';
2122
- connectionId: string;
2123
- connectionType?: string;
2124
- tableName: string;
2125
- databaseName?: string;
2126
- schemaName?: string;
2127
- label?: string;
2128
- dialect?: SemaphorDialect;
2129
- } | {
2130
- kind: 'sql';
2131
- connectionId: string;
2132
- dialect?: SemaphorDialect;
2133
- label?: string;
2134
- };
2135
-
2136
- declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
2137
-
2138
- declare type SemaphorValueFormat = {
2159
+ declare type SemaphorScalarValueFormat = {
2139
2160
  type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
2140
2161
  minimumFractionDigits?: number;
2141
2162
  maximumFractionDigits?: number;
@@ -2172,6 +2193,35 @@ declare type SemaphorValueFormat = {
2172
2193
  suffix?: string;
2173
2194
  };
2174
2195
 
2196
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
2197
+ kind: 'semantic';
2198
+ }>;
2199
+
2200
+ declare type SemaphorSourceRef = {
2201
+ kind: 'semantic';
2202
+ domainId: string;
2203
+ datasetName: string;
2204
+ datasetId?: string;
2205
+ label?: string;
2206
+ connectionId?: string;
2207
+ } | {
2208
+ kind: 'physical';
2209
+ connectionId: string;
2210
+ connectionType?: string;
2211
+ tableName: string;
2212
+ databaseName?: string;
2213
+ schemaName?: string;
2214
+ label?: string;
2215
+ dialect?: SemaphorDialect;
2216
+ } | {
2217
+ kind: 'sql';
2218
+ connectionId: string;
2219
+ dialect?: SemaphorDialect;
2220
+ label?: string;
2221
+ };
2222
+
2223
+ declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
2224
+
2175
2225
  declare interface SortByField extends Field {
2176
2226
  role: 'sortby';
2177
2227
  direction: 'asc' | 'desc';
@@ -2703,6 +2753,44 @@ declare type TDynamicVisualIntent = {
2703
2753
  includesKpis: boolean;
2704
2754
  };
2705
2755
 
2756
+ declare const TEMPORAL_BUCKET_PRESETS: readonly ["week_of_short", "week_of_long", "quarter_short", "quarter_long", "fiscal_quarter_short", "fiscal_year"];
2757
+
2758
+ declare type TemporalBucketFormat = {
2759
+ type: 'temporal_bucket';
2760
+ presentation: TemporalBucketPresentation;
2761
+ };
2762
+
2763
+ declare type TemporalBucketMetadata = {
2764
+ kind: 'temporal_bucket';
2765
+ granularity: SemaphorTimeGrain;
2766
+ calendar: Pick<CalendarContext, 'tz' | 'weekStart' | 'fiscalCalendar'>;
2767
+ };
2768
+
2769
+ declare type TemporalBucketPresentation = {
2770
+ mode: 'auto';
2771
+ } | {
2772
+ mode: 'preset';
2773
+ preset: TemporalBucketPreset;
2774
+ } | {
2775
+ mode: 'pattern';
2776
+ pattern: string;
2777
+ };
2778
+
2779
+ declare type TemporalBucketPresentationTarget = {
2780
+ kind: 'field';
2781
+ fieldId: string;
2782
+ /** Distinguishes one semantic field used on both pivot axes. */
2783
+ role?: 'groupby' | 'pivotby';
2784
+ } | {
2785
+ kind: 'column';
2786
+ columnKey: string;
2787
+ } | {
2788
+ kind: 'matrix_axis';
2789
+ axisInstanceId: string;
2790
+ };
2791
+
2792
+ declare type TemporalBucketPreset = (typeof TEMPORAL_BUCKET_PRESETS)[number];
2793
+
2706
2794
  declare type TextCardInlineFormat = {
2707
2795
  bold?: boolean;
2708
2796
  italic?: boolean;
@@ -2824,7 +2912,7 @@ declare interface TimeDrillStep {
2824
2912
  rollingWindow?: number;
2825
2913
  }
2826
2914
 
2827
- declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
2915
+ declare type TimeGranularity = SemaphorTimeGrain;
2828
2916
 
2829
2917
  /**
2830
2918
  * Inline filter definition stored on a card.