react-semaphor 0.1.337 → 0.1.339

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 (59) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +58 -57
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +3 -3
  5. package/dist/chunks/{braces-Q86XHDaD.js → braces-Ccvdip75.js} +1 -1
  6. package/dist/chunks/{braces-BLa_lORs.js → braces-DDHkbW1c.js} +1 -1
  7. package/dist/chunks/{calendar-preferences-dialog-Cocogo9H.js → calendar-preferences-dialog-2IbYrrP1.js} +3 -3
  8. package/dist/chunks/{calendar-preferences-dialog-Bm7ji3k9.js → calendar-preferences-dialog-8-KE5sVX.js} +1 -1
  9. package/dist/chunks/catalog-field-grounding-DoEBOXQd.js +100 -0
  10. package/dist/chunks/catalog-field-grounding-Du6mKDcF.js +1 -0
  11. package/dist/chunks/{chevrons-up-down-BBTZ5pAY.js → chevrons-up-down-B9fTSds9.js} +1 -1
  12. package/dist/chunks/{chevrons-up-down-CYuWasy_.js → chevrons-up-down-pV0i9ptS.js} +1 -1
  13. package/dist/chunks/{dashboard-briefing-launcher-BtqtLx1-.js → dashboard-briefing-launcher-CcqDPVke.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-DF4CoaRn.js → dashboard-briefing-launcher-DtxDRAiu.js} +4 -4
  15. package/dist/chunks/{dashboard-controls-B5U-VUxs.js → dashboard-controls-Bi98DhYD.js} +6 -6
  16. package/dist/chunks/{dashboard-controls-0VMAeMoa.js → dashboard-controls-By7aKmDj.js} +1 -1
  17. package/dist/chunks/{dashboard-json-CqbLOfnr.js → dashboard-json-BOyLuhS6.js} +1 -1
  18. package/dist/chunks/{dashboard-json-Hmc0Ri5z.js → dashboard-json-CGxIsTEP.js} +2 -2
  19. package/dist/chunks/{edit-dashboard-visual-D4VVu-QQ.js → edit-dashboard-visual-Ba8LenNc.js} +6 -6
  20. package/dist/chunks/{edit-dashboard-visual-C0EDM0QB.js → edit-dashboard-visual-BuXlHmJH.js} +1 -1
  21. package/dist/chunks/{index-DE0vIuYG.js → index-DT9osgRT.js} +2 -2
  22. package/dist/chunks/{index-DzyUhzV3.js → index-DVPvpd8u.js} +5 -5
  23. package/dist/chunks/{palette-DalASD28.js → palette-BMXS-AcI.js} +1 -1
  24. package/dist/chunks/{palette-B9AbDw0n.js → palette-DKecBucs.js} +1 -1
  25. package/dist/chunks/{resource-management-panel-C4YydU9I.js → resource-management-panel-98Hy6SYB.js} +3 -3
  26. package/dist/chunks/{resource-management-panel-P9iNqBM1.js → resource-management-panel-ByR-FD3h.js} +1 -1
  27. package/dist/chunks/{switch-BAYfpAEb.js → switch-CP7SmEIZ.js} +1 -1
  28. package/dist/chunks/{switch-CyRoZr5T.js → switch-DYRgERrC.js} +1 -1
  29. package/dist/chunks/{use-create-flow-overlay-state-P1LMwQ89.js → use-create-flow-overlay-state-D5uvjbwY.js} +3 -3
  30. package/dist/chunks/{use-create-flow-overlay-state-CbhjxI3W.js → use-create-flow-overlay-state-uNxArZdj.js} +1 -1
  31. package/dist/chunks/{use-visual-utils-lB-3Zk0b.js → use-visual-utils-BLh9mKic.js} +2 -2
  32. package/dist/chunks/{use-visual-utils-CV6_-y4p.js → use-visual-utils-CpaqIHoc.js} +1 -1
  33. package/dist/chunks/{validators-BOqiGymD.js → validators-CPEQojnV.js} +325 -250
  34. package/dist/chunks/validators-CfP-49k9.js +1 -0
  35. package/dist/dashboard/index.cjs +1 -1
  36. package/dist/dashboard/index.js +1 -1
  37. package/dist/dashboard-authoring/index.cjs +3 -3
  38. package/dist/dashboard-authoring/index.js +424 -561
  39. package/dist/data-app-builder/index.cjs +1 -1
  40. package/dist/data-app-builder/index.js +1 -1
  41. package/dist/data-app-sdk/index.cjs +1 -1
  42. package/dist/data-app-sdk/index.js +313 -308
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.js +7 -7
  45. package/dist/surfboard/index.cjs +1 -1
  46. package/dist/surfboard/index.js +2 -2
  47. package/dist/types/analytics-protocol.d.ts +74 -48
  48. package/dist/types/dashboard-authoring.d.ts +33 -52
  49. package/dist/types/dashboard.d.ts +32 -0
  50. package/dist/types/data-app-builder.d.ts +23 -13
  51. package/dist/types/data-app-sdk.d.ts +33 -46
  52. package/dist/types/main.d.ts +37 -51
  53. package/dist/types/shared.d.ts +32 -0
  54. package/dist/types/surfboard.d.ts +32 -0
  55. package/dist/types/types.d.ts +32 -0
  56. package/package.json +1 -1
  57. package/dist/chunks/catalog-field-grounding-DmT7aGUA.js +0 -191
  58. package/dist/chunks/catalog-field-grounding-VgVzDd25.js +0 -1
  59. package/dist/chunks/validators-BtFXY3S_.js +0 -2
@@ -480,19 +480,32 @@ export declare type GeneratedRevision = {
480
480
 
481
481
  export declare type ReasoningEffort = 'low' | 'medium' | 'high';
482
482
 
483
- declare type SemaphorAnalyticsFilter = {
483
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
484
+
485
+ declare type SemaphorAnalyticsFilterBase = {
484
486
  id?: string;
485
487
  field: SemaphorFieldRef;
486
- operator?: SemaphorAnalyticsFilterOperator;
487
- value?: unknown;
488
- values?: unknown[];
489
488
  };
490
489
 
491
490
  declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
492
491
 
493
492
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
494
493
 
495
- declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
494
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
495
+ operator: SemaphorAnalyticsNullFilterOperator;
496
+ values?: never;
497
+ };
498
+
499
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
500
+
501
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
502
+ operator?: SemaphorAnalyticsValueFilterOperator;
503
+ values: unknown[];
504
+ };
505
+
506
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
507
+
508
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
496
509
 
497
510
  declare type SemaphorFieldRef = {
498
511
  name: string;
@@ -532,9 +545,8 @@ declare type SemaphorMetricIntent = {
532
545
  version?: SemaphorProtocolVersion;
533
546
  id?: string;
534
547
  source: SemaphorSourceRef;
535
- metrics: string[];
536
- primaryMetric?: string;
537
- metricRefs?: SemaphorFieldRef[];
548
+ metrics: SemaphorFieldRef[];
549
+ primaryMetric?: SemaphorFieldRef;
538
550
  label?: string;
539
551
  dateField?: SemaphorFieldRef;
540
552
  timeGrain?: SemaphorTimeGrain;
@@ -559,12 +571,11 @@ declare type SemaphorRecordsIntent = {
559
571
  id?: string;
560
572
  label?: string;
561
573
  fields: SemaphorFieldRef[];
562
- measures?: string[];
563
574
  dateField?: SemaphorFieldRef;
564
575
  timeGrain?: SemaphorTimeGrain;
565
576
  limit?: number;
566
577
  orderBy?: {
567
- field: string;
578
+ field: SemaphorFieldRef;
568
579
  direction: 'asc' | 'desc';
569
580
  };
570
581
  inputs?: SemaphorInputBinding[];
@@ -589,7 +600,6 @@ declare type SemaphorSourceRef = {
589
600
  } | {
590
601
  kind: 'sql';
591
602
  connectionId: string;
592
- sql: string;
593
603
  dialect?: SemaphorDialect;
594
604
  label?: string;
595
605
  };
@@ -600,9 +610,9 @@ declare type SemaphorSqlIntent = {
600
610
  id?: string;
601
611
  label?: string;
602
612
  source: Extract<SemaphorSourceRef, {
603
- kind: 'sql' | 'physical';
613
+ kind: 'sql';
604
614
  }>;
605
- sql?: string;
615
+ sql: string;
606
616
  parameters?: Record<string, unknown>;
607
617
  pythonCode?: string;
608
618
  limit?: number;
@@ -16,18 +16,31 @@ export declare function normalizeSemaphorInputOptions(options?: Array<{
16
16
 
17
17
  export declare function readWindowRuntime(): SemaphorDataAppWindowRuntime | undefined;
18
18
 
19
- declare type SemaphorAnalyticsFilter = {
19
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
20
+
21
+ declare type SemaphorAnalyticsFilterBase = {
20
22
  id?: string;
21
23
  field: SemaphorFieldRef;
22
- operator?: SemaphorAnalyticsFilterOperator;
23
- value?: unknown;
24
- values?: unknown[];
25
24
  };
26
25
 
27
26
  declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
28
27
 
29
28
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
30
29
 
30
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
31
+ operator: SemaphorAnalyticsNullFilterOperator;
32
+ values?: never;
33
+ };
34
+
35
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
36
+
37
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
38
+ operator?: SemaphorAnalyticsValueFilterOperator;
39
+ values: unknown[];
40
+ };
41
+
42
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
43
+
31
44
  export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
32
45
 
33
46
  export declare type SemaphorDataAppControlInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
@@ -51,14 +64,13 @@ export declare type SemaphorDataAppExecutorContext = {
51
64
  activeInputs?: SemaphorDataAppInputSnapshot[];
52
65
  };
53
66
 
54
- export declare type SemaphorDataAppFieldSpec = string | SemaphorFieldRef;
67
+ export declare type SemaphorDataAppFieldSpec = SemaphorFieldRef;
55
68
 
56
69
  export declare type SemaphorDataAppFilterInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
57
70
  kind: 'filter';
58
71
  field: SemaphorDataAppFieldSpec;
59
72
  operator?: SemaphorInputOperator;
60
73
  multi?: boolean;
61
- source?: SemaphorSourceRef;
62
74
  };
63
75
 
64
76
  declare type SemaphorDataAppInputBase<TValue extends SemaphorDataAppInputValue> = {
@@ -76,7 +88,6 @@ export declare type SemaphorDataAppInputHandle<TValue extends SemaphorDataAppInp
76
88
  label?: string;
77
89
  field?: SemaphorFieldRef;
78
90
  operator?: SemaphorInputOperator;
79
- source?: SemaphorSourceRef;
80
91
  controlRole?: SemaphorDataAppControlRole;
81
92
  value: TValue | undefined;
82
93
  options: SemaphorDataAppInputOption[];
@@ -119,7 +130,6 @@ export declare type SemaphorDataAppInputSnapshot<TValue extends SemaphorDataAppI
119
130
  value?: TValue;
120
131
  isActive: boolean;
121
132
  operator?: SemaphorInputOperator;
122
- source?: SemaphorSourceRef;
123
133
  controlRole?: SemaphorDataAppControlRole;
124
134
  };
125
135
 
@@ -127,7 +137,7 @@ export declare type SemaphorDataAppInputSpec<TValue extends SemaphorDataAppInput
127
137
 
128
138
  export declare type SemaphorDataAppInputValue = SemaphorDataAppScalar | SemaphorDataAppScalar[];
129
139
 
130
- export declare type SemaphorDataAppMetricComparison = 'none' | 'previous_period' | 'same_period_last_year' | 'previous_year' | {
140
+ export declare type SemaphorDataAppMetricComparison = {
131
141
  kind: 'previous_period' | 'previous_year' | 'target';
132
142
  targetValue?: number;
133
143
  };
@@ -149,8 +159,8 @@ export declare type SemaphorDataAppMetricResult = SemaphorDataAppQueryState & Se
149
159
  export declare type SemaphorDataAppMetricSpec = SemaphorDataAppSourceSpec & {
150
160
  id?: string;
151
161
  label?: string;
152
- metrics: SemaphorDataAppNonEmptyArray<string>;
153
- primaryMetric?: string;
162
+ metrics: SemaphorDataAppNonEmptyArray<SemaphorDataAppFieldSpec>;
163
+ primaryMetric?: SemaphorDataAppFieldSpec;
154
164
  dateField?: SemaphorDataAppFieldSpec;
155
165
  timeGrain?: SemaphorTimeGrain;
156
166
  dimensions?: SemaphorDataAppFieldSpec[];
@@ -199,8 +209,12 @@ export declare type SemaphorDataAppRecordsData<TRecord extends Record<string, un
199
209
  rowCount?: number;
200
210
  };
201
211
 
212
+ export declare type SemaphorDataAppRecordsFieldSpec = SemaphorFieldRef & {
213
+ role: NonNullable<SemaphorFieldRef['role']>;
214
+ };
215
+
202
216
  export declare type SemaphorDataAppRecordsOrderBy = {
203
- field: string;
217
+ field: SemaphorDataAppFieldSpec;
204
218
  direction: 'asc' | 'desc';
205
219
  };
206
220
 
@@ -210,17 +224,7 @@ export declare type SemaphorDataAppRecordsResult<TRecord extends Record<string,
210
224
  };
211
225
 
212
226
  declare type SemaphorDataAppRecordsSelectorSpec = {
213
- fields: SemaphorDataAppNonEmptyArray<SemaphorDataAppFieldSpec>;
214
- dimensions?: SemaphorDataAppFieldSpec[];
215
- measures?: string[];
216
- } | {
217
- fields?: SemaphorDataAppFieldSpec[];
218
- dimensions: SemaphorDataAppNonEmptyArray<SemaphorDataAppFieldSpec>;
219
- measures?: string[];
220
- } | {
221
- fields?: SemaphorDataAppFieldSpec[];
222
- dimensions?: SemaphorDataAppFieldSpec[];
223
- measures: SemaphorDataAppNonEmptyArray<string>;
227
+ fields: SemaphorDataAppNonEmptyArray<SemaphorDataAppRecordsFieldSpec>;
224
228
  };
225
229
 
226
230
  export declare type SemaphorDataAppRecordsSpec = SemaphorDataAppRecordsBaseSpec & SemaphorDataAppRecordsSelectorSpec;
@@ -233,19 +237,6 @@ export declare type SemaphorDataAppScalar = string | number | boolean | null;
233
237
 
234
238
  export declare type SemaphorDataAppSourceSpec = {
235
239
  source: SemaphorSourceRef;
236
- domainId?: never;
237
- dataset?: never;
238
- datasetName?: never;
239
- datasetId?: never;
240
- connectionId?: never;
241
- } | {
242
- source?: never;
243
- domainId: string;
244
- dataset?: string;
245
- datasetName?: string;
246
- datasetId?: string;
247
- connectionId?: string;
248
- sourceLabel?: string;
249
240
  };
250
241
 
251
242
  declare type SemaphorDataAppWindowRuntime = {
@@ -256,7 +247,7 @@ declare type SemaphorDataAppWindowRuntime = {
256
247
  };
257
248
  };
258
249
 
259
- declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
250
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
260
251
 
261
252
  declare type SemaphorFieldRef = {
262
253
  name: string;
@@ -296,9 +287,8 @@ declare type SemaphorMetricIntent = {
296
287
  version?: SemaphorProtocolVersion;
297
288
  id?: string;
298
289
  source: SemaphorSourceRef;
299
- metrics: string[];
300
- primaryMetric?: string;
301
- metricRefs?: SemaphorFieldRef[];
290
+ metrics: SemaphorFieldRef[];
291
+ primaryMetric?: SemaphorFieldRef;
302
292
  label?: string;
303
293
  dateField?: SemaphorFieldRef;
304
294
  timeGrain?: SemaphorTimeGrain;
@@ -323,12 +313,11 @@ declare type SemaphorRecordsIntent = {
323
313
  id?: string;
324
314
  label?: string;
325
315
  fields: SemaphorFieldRef[];
326
- measures?: string[];
327
316
  dateField?: SemaphorFieldRef;
328
317
  timeGrain?: SemaphorTimeGrain;
329
318
  limit?: number;
330
319
  orderBy?: {
331
- field: string;
320
+ field: SemaphorFieldRef;
332
321
  direction: 'asc' | 'desc';
333
322
  };
334
323
  inputs?: SemaphorInputBinding[];
@@ -353,7 +342,6 @@ declare type SemaphorSourceRef = {
353
342
  } | {
354
343
  kind: 'sql';
355
344
  connectionId: string;
356
- sql: string;
357
345
  dialect?: SemaphorDialect;
358
346
  label?: string;
359
347
  };
@@ -364,9 +352,9 @@ declare type SemaphorSqlIntent = {
364
352
  id?: string;
365
353
  label?: string;
366
354
  source: Extract<SemaphorSourceRef, {
367
- kind: 'sql' | 'physical';
355
+ kind: 'sql';
368
356
  }>;
369
- sql?: string;
357
+ sql: string;
370
358
  parameters?: Record<string, unknown>;
371
359
  pythonCode?: string;
372
360
  limit?: number;
@@ -400,7 +388,6 @@ export declare function toSemaphorInputSpec<TValue extends SemaphorDataAppInputV
400
388
  label?: string;
401
389
  field?: SemaphorFieldRef;
402
390
  operator?: SemaphorInputOperator;
403
- source?: SemaphorSourceRef;
404
391
  };
405
392
 
406
393
  export declare function toSemaphorMetricIntent(spec: SemaphorDataAppMetricSpec): SemaphorMetricIntent;
@@ -1179,6 +1179,13 @@ export declare interface CardConfig {
1179
1179
  pivotByColumns?: PivotByField[];
1180
1180
  sortByColumns?: SortByField[];
1181
1181
  detailColumns?: DetailField[];
1182
+ /**
1183
+ * Typed source that anchors the query before auto-join materializes an
1184
+ * executable joinPlan.baseEntity. This is distinct from
1185
+ * DataSource.selectedEntities, which lists available datasets but does not
1186
+ * define join-root semantics.
1187
+ */
1188
+ queryBaseSource?: SemaphorSourceRef;
1182
1189
  /** Preserves non-detail config when switching to detail tables. */
1183
1190
  detailTableBackup?: DetailTableBackupConfig;
1184
1191
  filters?: FilterGroup;
@@ -1723,21 +1730,9 @@ declare type DashboardAIContext = AIContext & {
1723
1730
 
1724
1731
  declare type DashboardAIContextMode = 'auto' | 'fixed';
1725
1732
 
1726
- declare type DashboardAuthoringDatasetRef = {
1727
- kind: 'semantic';
1728
- domainId: string;
1729
- datasetName: string;
1730
- datasetId?: string;
1731
- label?: string;
1732
- connectionId?: string;
1733
- } | {
1734
- kind: 'physical';
1735
- connectionId: string;
1736
- databaseName?: string;
1737
- schemaName?: string;
1738
- tableName: string;
1739
- label?: string;
1740
- };
1733
+ declare type DashboardAuthoringDatasetRef = Extract<SemaphorSourceRef, {
1734
+ kind: 'semantic' | 'physical';
1735
+ }>;
1741
1736
 
1742
1737
  export declare type DashboardAuthoringSource = DashboardAuthoringDatasetRef & {
1743
1738
  domainName?: string;
@@ -1772,24 +1767,6 @@ export declare type DashboardBriefingLauncherProps = {
1772
1767
  client?: Partial<DashboardBriefingLauncherClient>;
1773
1768
  };
1774
1769
 
1775
- declare type DashboardCardQueryFieldRef = {
1776
- name: string;
1777
- source?: DashboardAuthoringDatasetRef;
1778
- };
1779
-
1780
- declare type DashboardCardQueryIntent = {
1781
- metrics?: string[];
1782
- primaryMetric?: string;
1783
- metricRefs?: DashboardCardQueryFieldRef[];
1784
- dateField?: string;
1785
- dateFieldRef?: DashboardCardQueryFieldRef;
1786
- timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
1787
- dimensions?: string[];
1788
- dimensionRefs?: DashboardCardQueryFieldRef[];
1789
- filters?: SemaphorAnalyticsFilter[];
1790
- limit?: number;
1791
- };
1792
-
1793
1770
  declare type DashboardCardSizeIntent = 'kpi' | 'chart' | 'table' | 'text';
1794
1771
 
1795
1772
  declare type DashboardControlsModelOptions = {
@@ -2032,7 +2009,7 @@ declare type DashboardPlan = {
2032
2009
  id: string;
2033
2010
  title: string;
2034
2011
  description?: string;
2035
- datasets: DashboardAuthoringDatasetRef[];
2012
+ datasets: SemaphorSourceRef[];
2036
2013
  sheets: DashboardPlanSheet[];
2037
2014
  filterInputs?: DashboardPlanFilterInput[];
2038
2015
  calculatedFields?: DashboardPlanCalculatedField[];
@@ -2060,7 +2037,6 @@ declare type DashboardPlanCard = {
2060
2037
  role: DashboardCardSizeIntent;
2061
2038
  priority: number;
2062
2039
  section?: string;
2063
- query?: DashboardCardQueryIntent;
2064
2040
  analyticsIntent?: SemaphorAnalyticsIntent;
2065
2041
  text?: string;
2066
2042
  };
@@ -2076,7 +2052,7 @@ declare type DashboardPlanFilterInput = {
2076
2052
 
2077
2053
  declare type DashboardPlanRequest = {
2078
2054
  prompt: string;
2079
- dataset: DashboardAuthoringDatasetRef;
2055
+ dataset: SemaphorSourceRef;
2080
2056
  } | {
2081
2057
  prompt: string;
2082
2058
  domainId: string;
@@ -2298,7 +2274,7 @@ declare type DashboardSuggestion = {
2298
2274
  declare type DashboardSuggestionPreviewKind = 'kpi' | 'line' | 'bar' | 'donut' | 'table';
2299
2275
 
2300
2276
  declare type DashboardSuggestionRequest = {
2301
- dataset: DashboardAuthoringDatasetRef;
2277
+ dataset: SemaphorSourceRef;
2302
2278
  instruction?: string;
2303
2279
  } | {
2304
2280
  domainId: string;
@@ -4417,24 +4393,37 @@ declare type SemanticExecutionPayload = {
4417
4393
  }>;
4418
4394
  };
4419
4395
 
4420
- declare type SemaphorAnalyticsFilter = {
4396
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
4397
+
4398
+ declare type SemaphorAnalyticsFilterBase = {
4421
4399
  id?: string;
4422
4400
  field: SemaphorFieldRef;
4423
- operator?: SemaphorAnalyticsFilterOperator;
4424
- value?: unknown;
4425
- values?: unknown[];
4426
4401
  };
4427
4402
 
4428
4403
  declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
4429
4404
 
4430
4405
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
4431
4406
 
4407
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
4408
+ operator: SemaphorAnalyticsNullFilterOperator;
4409
+ values?: never;
4410
+ };
4411
+
4412
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
4413
+
4414
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
4415
+ operator?: SemaphorAnalyticsValueFilterOperator;
4416
+ values: unknown[];
4417
+ };
4418
+
4419
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
4420
+
4432
4421
  export declare const SemaphorContextProvider: ({ children, dashboardProps, }: {
4433
4422
  children: React.ReactNode;
4434
4423
  dashboardProps: DashboardProps;
4435
4424
  }) => JSX.Element;
4436
4425
 
4437
- declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
4426
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
4438
4427
 
4439
4428
  declare type SemaphorFieldRef = {
4440
4429
  name: string;
@@ -4474,9 +4463,8 @@ declare type SemaphorMetricIntent = {
4474
4463
  version?: SemaphorProtocolVersion;
4475
4464
  id?: string;
4476
4465
  source: SemaphorSourceRef;
4477
- metrics: string[];
4478
- primaryMetric?: string;
4479
- metricRefs?: SemaphorFieldRef[];
4466
+ metrics: SemaphorFieldRef[];
4467
+ primaryMetric?: SemaphorFieldRef;
4480
4468
  label?: string;
4481
4469
  dateField?: SemaphorFieldRef;
4482
4470
  timeGrain?: SemaphorTimeGrain;
@@ -4507,12 +4495,11 @@ declare type SemaphorRecordsIntent = {
4507
4495
  id?: string;
4508
4496
  label?: string;
4509
4497
  fields: SemaphorFieldRef[];
4510
- measures?: string[];
4511
4498
  dateField?: SemaphorFieldRef;
4512
4499
  timeGrain?: SemaphorTimeGrain;
4513
4500
  limit?: number;
4514
4501
  orderBy?: {
4515
- field: string;
4502
+ field: SemaphorFieldRef;
4516
4503
  direction: 'asc' | 'desc';
4517
4504
  };
4518
4505
  inputs?: SemaphorInputBinding[];
@@ -4537,7 +4524,6 @@ declare type SemaphorSourceRef = {
4537
4524
  } | {
4538
4525
  kind: 'sql';
4539
4526
  connectionId: string;
4540
- sql: string;
4541
4527
  dialect?: SemaphorDialect;
4542
4528
  label?: string;
4543
4529
  };
@@ -4548,9 +4534,9 @@ declare type SemaphorSqlIntent = {
4548
4534
  id?: string;
4549
4535
  label?: string;
4550
4536
  source: Extract<SemaphorSourceRef, {
4551
- kind: 'sql' | 'physical';
4537
+ kind: 'sql';
4552
4538
  }>;
4553
- sql?: string;
4539
+ sql: string;
4554
4540
  parameters?: Record<string, unknown>;
4555
4541
  pythonCode?: string;
4556
4542
  limit?: number;
@@ -6418,7 +6404,7 @@ export declare function useTextFilterHook(filterId: string): {
6418
6404
  activeFilterValue: TFilterValue | undefined;
6419
6405
  isSearching: boolean;
6420
6406
  searchError: boolean;
6421
- resultSource: "server" | "both" | "local";
6407
+ resultSource: "both" | "server" | "local";
6422
6408
  };
6423
6409
 
6424
6410
  export declare function validateBriefingFormDraft(draft: BriefingFormDraft): BriefingFormValidationResult;
@@ -119,6 +119,13 @@ declare interface CardConfig {
119
119
  pivotByColumns?: PivotByField[];
120
120
  sortByColumns?: SortByField[];
121
121
  detailColumns?: DetailField[];
122
+ /**
123
+ * Typed source that anchors the query before auto-join materializes an
124
+ * executable joinPlan.baseEntity. This is distinct from
125
+ * DataSource.selectedEntities, which lists available datasets but does not
126
+ * define join-root semantics.
127
+ */
128
+ queryBaseSource?: SemaphorSourceRef;
122
129
  /** Preserves non-detail config when switching to detail tables. */
123
130
  detailTableBackup?: DetailTableBackupConfig;
124
131
  filters?: FilterGroup;
@@ -1548,6 +1555,31 @@ declare type SelectedEntities = SelectedEntity[];
1548
1555
 
1549
1556
  declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
1550
1557
 
1558
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1559
+
1560
+ declare type SemaphorSourceRef = {
1561
+ kind: 'semantic';
1562
+ domainId: string;
1563
+ datasetName: string;
1564
+ datasetId?: string;
1565
+ label?: string;
1566
+ connectionId?: string;
1567
+ } | {
1568
+ kind: 'physical';
1569
+ connectionId: string;
1570
+ connectionType?: string;
1571
+ tableName: string;
1572
+ databaseName?: string;
1573
+ schemaName?: string;
1574
+ label?: string;
1575
+ dialect?: SemaphorDialect;
1576
+ } | {
1577
+ kind: 'sql';
1578
+ connectionId: string;
1579
+ dialect?: SemaphorDialect;
1580
+ label?: string;
1581
+ };
1582
+
1551
1583
  /**
1552
1584
  * Stable serializer for dashboard dirty checks.
1553
1585
  * This consolidates normalization + serialization into one call site, so
@@ -211,6 +211,13 @@ declare interface CardConfig {
211
211
  pivotByColumns?: PivotByField[];
212
212
  sortByColumns?: SortByField[];
213
213
  detailColumns?: DetailField[];
214
+ /**
215
+ * Typed source that anchors the query before auto-join materializes an
216
+ * executable joinPlan.baseEntity. This is distinct from
217
+ * DataSource.selectedEntities, which lists available datasets but does not
218
+ * define join-root semantics.
219
+ */
220
+ queryBaseSource?: SemaphorSourceRef;
214
221
  /** Preserves non-detail config when switching to detail tables. */
215
222
  detailTableBackup?: DetailTableBackupConfig;
216
223
  filters?: FilterGroup;
@@ -1908,6 +1915,31 @@ declare type SemanticExecutionPayload = {
1908
1915
  }>;
1909
1916
  };
1910
1917
 
1918
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1919
+
1920
+ declare type SemaphorSourceRef = {
1921
+ kind: 'semantic';
1922
+ domainId: string;
1923
+ datasetName: string;
1924
+ datasetId?: string;
1925
+ label?: string;
1926
+ connectionId?: string;
1927
+ } | {
1928
+ kind: 'physical';
1929
+ connectionId: string;
1930
+ connectionType?: string;
1931
+ tableName: string;
1932
+ databaseName?: string;
1933
+ schemaName?: string;
1934
+ label?: string;
1935
+ dialect?: SemaphorDialect;
1936
+ } | {
1937
+ kind: 'sql';
1938
+ connectionId: string;
1939
+ dialect?: SemaphorDialect;
1940
+ label?: string;
1941
+ };
1942
+
1911
1943
  declare interface SortByField extends Field {
1912
1944
  role: 'sortby';
1913
1945
  direction: 'asc' | 'desc';
@@ -653,6 +653,13 @@ export declare interface CardConfig {
653
653
  pivotByColumns?: PivotByField[];
654
654
  sortByColumns?: SortByField[];
655
655
  detailColumns?: DetailField[];
656
+ /**
657
+ * Typed source that anchors the query before auto-join materializes an
658
+ * executable joinPlan.baseEntity. This is distinct from
659
+ * DataSource.selectedEntities, which lists available datasets but does not
660
+ * define join-root semantics.
661
+ */
662
+ queryBaseSource?: SemaphorSourceRef;
656
663
  /** Preserves non-detail config when switching to detail tables. */
657
664
  detailTableBackup?: DetailTableBackupConfig;
658
665
  filters?: FilterGroup;
@@ -2668,6 +2675,31 @@ declare type SemanticExecutionPayload = {
2668
2675
  }>;
2669
2676
  };
2670
2677
 
2678
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
2679
+
2680
+ declare type SemaphorSourceRef = {
2681
+ kind: 'semantic';
2682
+ domainId: string;
2683
+ datasetName: string;
2684
+ datasetId?: string;
2685
+ label?: string;
2686
+ connectionId?: string;
2687
+ } | {
2688
+ kind: 'physical';
2689
+ connectionId: string;
2690
+ connectionType?: string;
2691
+ tableName: string;
2692
+ databaseName?: string;
2693
+ schemaName?: string;
2694
+ label?: string;
2695
+ dialect?: SemaphorDialect;
2696
+ } | {
2697
+ kind: 'sql';
2698
+ connectionId: string;
2699
+ dialect?: SemaphorDialect;
2700
+ label?: string;
2701
+ };
2702
+
2671
2703
  export declare interface SortByField extends Field {
2672
2704
  role: 'sortby';
2673
2705
  direction: 'asc' | 'desc';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.337",
8
+ "version": "0.1.339",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",