react-semaphor 0.1.358 → 0.1.360

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 (38) hide show
  1. package/dist/chunks/{calendar-preferences-dialog-DGA5mlpS.js → calendar-preferences-dialog-BEKBpwMY.js} +1 -1
  2. package/dist/chunks/{calendar-preferences-dialog-BzAHg2dH.js → calendar-preferences-dialog-GwtaSN53.js} +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-BV4oNYVr.js → dashboard-briefing-launcher-D6gGO5wz.js} +3 -3
  4. package/dist/chunks/{dashboard-briefing-launcher-Cx8GVVDP.js → dashboard-briefing-launcher-DYxd4856.js} +1 -1
  5. package/dist/chunks/{dashboard-controls-Aqn8jM53.js → dashboard-controls-B4u5RsKl.js} +3 -3
  6. package/dist/chunks/{dashboard-controls-2Yydgr4q.js → dashboard-controls-C_rExqPw.js} +1 -1
  7. package/dist/chunks/{dashboard-json-D0Pc1dwB.js → dashboard-json-BWWU6a7V.js} +1 -1
  8. package/dist/chunks/{dashboard-json-DCDAthMc.js → dashboard-json-CPGTofhm.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-C-yLMahk.js → edit-dashboard-visual-D_jZ-iix.js} +1 -1
  10. package/dist/chunks/{edit-dashboard-visual-BdVNDANy.js → edit-dashboard-visual-biMO829J.js} +3 -3
  11. package/dist/chunks/{index-Cs6rC7Qx.js → index-CJ2IEuKz.js} +31372 -31127
  12. package/dist/chunks/index-Db1XVmfU.js +1411 -0
  13. package/dist/chunks/{resource-management-panel-CuFOHM8_.js → resource-management-panel-B9-5VHYe.js} +2 -2
  14. package/dist/chunks/{resource-management-panel-D6zRXAE_.js → resource-management-panel-Bam-yvnt.js} +1 -1
  15. package/dist/chunks/{use-create-flow-overlay-state-dPApJpMV.js → use-create-flow-overlay-state-DAvEqaJV.js} +2 -2
  16. package/dist/chunks/{use-create-flow-overlay-state-CcAzq169.js → use-create-flow-overlay-state-dhxgdLYo.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-Dg4iuSLu.js → use-visual-utils-CAKdXsr5.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-BUSgtvLJ.js → use-visual-utils-FoHNPwpu.js} +1 -1
  19. package/dist/chunks/validation-C_WDLZdp.js +1 -0
  20. package/dist/chunks/validation-McK0uXpV.js +669 -0
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/data-app-builder/index.cjs +1 -1
  24. package/dist/data-app-builder/index.js +1 -1
  25. package/dist/data-app-sdk/index.cjs +1 -1
  26. package/dist/data-app-sdk/index.js +308 -440
  27. package/dist/data-app-sdk-validation/index.cjs +1 -0
  28. package/dist/data-app-sdk-validation/index.js +7 -0
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +5 -5
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +2 -2
  34. package/dist/types/data-app-builder.d.ts +68 -9
  35. package/dist/types/data-app-sdk-validation.d.ts +595 -0
  36. package/dist/types/data-app-sdk.d.ts +333 -0
  37. package/package.json +6 -1
  38. package/dist/chunks/index-BMQsLAi3.js +0 -1410
@@ -0,0 +1,595 @@
1
+ /**
2
+ * Calendar context for timezone-aware date operations.
3
+ * Controls how dates are interpreted, grouped, and displayed.
4
+ */
5
+ declare type CalendarContext = {
6
+ /**
7
+ * IANA timezone identifier.
8
+ * @example 'America/Chicago', 'Europe/London', 'Asia/Tokyo', 'UTC'
9
+ * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
10
+ */
11
+ tz: string;
12
+ /**
13
+ * Day the week starts on.
14
+ * 0 = Sunday (US, Canada, Japan)
15
+ * 1 = Monday (ISO standard, most of Europe)
16
+ * 6 = Saturday (Middle East)
17
+ * @default 1 (Monday) for backward compatibility
18
+ */
19
+ weekStart: WeekStart;
20
+ /**
21
+ * Date anchor for relative date calculations.
22
+ * - 'now': Use current time (default, live dashboards)
23
+ * - { iso: string }: Fixed ISO 8601 date for reproducible views
24
+ */
25
+ anchor: 'now' | {
26
+ iso: string;
27
+ };
28
+ };
29
+
30
+ export declare function normalizeSemaphorAnalysisQueryOptions(value: unknown, options?: {
31
+ pathPrefix?: string;
32
+ validateTimezone?: SemaphorAnalysisTimezoneValidator;
33
+ }): SemaphorAnalysisQueryOptionsValidationResult;
34
+
35
+ declare type SemaphorAbsoluteTimeWindow = {
36
+ kind: 'absolute';
37
+ start: string;
38
+ end: string;
39
+ };
40
+
41
+ declare type SemaphorActiveInput<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBinding & {
42
+ kind: 'filter' | 'control';
43
+ label?: string;
44
+ value?: TValue;
45
+ isActive: boolean;
46
+ operator?: SemaphorInputOperator;
47
+ controlRole?: SemaphorControlRole;
48
+ };
49
+
50
+ declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
51
+
52
+ declare type SemaphorAnalysisDriverMode = 'absolute_delta' | 'largest_negative' | 'largest_positive' | 'positive_and_negative' | 'all';
53
+
54
+ export declare type SemaphorAnalysisQueryOptions = {
55
+ chartTitle?: string;
56
+ chartType?: string;
57
+ driverMode?: SemaphorAnalysisDriverMode;
58
+ includePopulation?: boolean;
59
+ calendarContext?: CalendarContext;
60
+ };
61
+
62
+ export declare type SemaphorAnalysisQueryOptionsValidationIssue = {
63
+ code: 'invalid_analysis_option';
64
+ message: string;
65
+ path: string;
66
+ };
67
+
68
+ export declare type SemaphorAnalysisQueryOptionsValidationResult = {
69
+ ok: true;
70
+ analysisOptions?: SemaphorAnalysisQueryOptions;
71
+ } | {
72
+ ok: false;
73
+ issues: SemaphorAnalysisQueryOptionsValidationIssue[];
74
+ };
75
+
76
+ declare type SemaphorAnalysisQuerySpec = SemaphorMetricQuerySpec & SemaphorAnalysisQueryOptions & {
77
+ analysis?: SemaphorMetricIntent['analysis'];
78
+ timeWindow?: SemaphorMetricIntent['timeWindow'];
79
+ filters?: SemaphorAnalyticsFilter[];
80
+ };
81
+
82
+ export declare type SemaphorAnalysisTimezoneValidator = (tz: string) => string | null;
83
+
84
+ declare type SemaphorAnalyticsExecutionResult = {
85
+ intentId?: string;
86
+ queryId?: string;
87
+ status: SemaphorAnalyticsExecutionStatus;
88
+ resultShape?: SemaphorAnalyticsResult['kind'] | 'period_change';
89
+ intent?: SemaphorAnalyticsIntent;
90
+ compiledQuery?: SemaphorCompiledQuery;
91
+ fieldsUsed?: SemaphorExecutionFieldRef[];
92
+ result?: SemaphorAnalyticsResult;
93
+ validation: SemaphorAnalyticsValidationResult;
94
+ coverage?: {
95
+ answeredObligations: string[];
96
+ missingObligations: string[];
97
+ warnings?: SemaphorAnalyticsValidationIssue[];
98
+ };
99
+ missingFields?: string[];
100
+ warnings?: string[];
101
+ relationshipDiagnostics?: SemaphorRelationshipDiagnostics;
102
+ population?: SemaphorAnalyticsPopulation;
103
+ metadata?: Record<string, unknown>;
104
+ };
105
+
106
+ declare type SemaphorAnalyticsExecutionStatus = 'answered' | 'partial' | 'failed';
107
+
108
+ declare type SemaphorAnalyticsFieldRole = 'metric' | 'dateField' | 'dimension' | 'input' | 'source' | 'sql';
109
+
110
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
111
+
112
+ declare type SemaphorAnalyticsFilterBase = {
113
+ id?: string;
114
+ field: SemaphorFieldRef;
115
+ /**
116
+ * Controls where the filter is applied in an aggregate query.
117
+ *
118
+ * `row` means pre-aggregation filtering (`WHERE`).
119
+ * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
120
+ * for measure fields the execution engine can aggregate safely.
121
+ */
122
+ scope?: 'row' | 'aggregate';
123
+ };
124
+
125
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
126
+
127
+ declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
128
+
129
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
130
+ operator: SemaphorAnalyticsNullFilterOperator;
131
+ values?: never;
132
+ };
133
+
134
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
135
+
136
+ declare type SemaphorAnalyticsPopulation = {
137
+ scope: 'filtered_query';
138
+ metrics: Record<string, number | string | null>;
139
+ };
140
+
141
+ declare type SemaphorAnalyticsRepairHint = {
142
+ code: SemaphorAnalyticsValidationCode | string;
143
+ message?: string;
144
+ invalidField?: string;
145
+ fieldRole?: SemaphorAnalyticsFieldRole;
146
+ validMetricCandidates?: string[];
147
+ validDateCandidates?: string[];
148
+ validDimensionCandidates?: string[];
149
+ recommendedNextStep: string;
150
+ };
151
+
152
+ declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult;
153
+
154
+ declare type SemaphorAnalyticsResultBase = {
155
+ intentId?: string;
156
+ queryPath: SemaphorQueryPath;
157
+ warnings?: string[];
158
+ rowCount?: number;
159
+ rowLimitExceeded?: boolean;
160
+ limit?: number;
161
+ };
162
+
163
+ declare type SemaphorAnalyticsValidationCode = 'missing_source' | 'invalid_source_kind' | 'missing_semantic_domain' | 'missing_dataset_name' | 'missing_connection_id' | 'missing_table_name' | 'missing_sql' | 'missing_metric' | 'missing_record_fields' | 'missing_input_options_field' | 'invalid_metric' | 'invalid_metric_list' | 'invalid_date_field' | 'invalid_dimension' | 'invalid_metric_dimensions' | 'conflicting_sql' | 'sql_policy_violation' | 'unsupported_intent_for_adapter' | 'invalid_analytics_kind' | 'invalid_analytics_intent';
164
+
165
+ declare type SemaphorAnalyticsValidationIssue = SemaphorProtocolIssue & {
166
+ code: SemaphorAnalyticsValidationCode | string;
167
+ fieldRole?: SemaphorAnalyticsFieldRole;
168
+ repairHint?: SemaphorAnalyticsRepairHint;
169
+ };
170
+
171
+ declare type SemaphorAnalyticsValidationResult = {
172
+ ok: boolean;
173
+ errors: SemaphorAnalyticsValidationIssue[];
174
+ warnings: SemaphorAnalyticsValidationIssue[];
175
+ repairHints: SemaphorAnalyticsRepairHint[];
176
+ };
177
+
178
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
179
+ operator?: SemaphorAnalyticsValueFilterOperator;
180
+ values: unknown[];
181
+ };
182
+
183
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
184
+
185
+ declare type SemaphorCompiledQuery = {
186
+ kind: 'config';
187
+ queryId: string;
188
+ source: SemaphorSourceRef;
189
+ cardType: string;
190
+ connectionId: string;
191
+ cardConfig: unknown;
192
+ cardDataSource: unknown;
193
+ activeFilters?: SemaphorAnalyticsFilter[];
194
+ rowLimit: number;
195
+ analyticsIntent?: SemaphorAnalyticsIntent;
196
+ } | {
197
+ kind: 'sql';
198
+ queryId: string;
199
+ source: Extract<SemaphorSourceRef, {
200
+ kind: 'sql';
201
+ }>;
202
+ connectionId: string;
203
+ dialect: SemaphorDialect;
204
+ sql: string;
205
+ parameters?: Record<string, unknown>;
206
+ pythonCode?: string;
207
+ activeFilters?: SemaphorAnalyticsFilter[];
208
+ rowLimit: number;
209
+ analyticsIntent?: SemaphorAnalyticsIntent;
210
+ };
211
+
212
+ declare type SemaphorControlRole = 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
213
+
214
+ export declare type SemaphorDataAppFieldCatalog = {
215
+ source: SemaphorSourceRef;
216
+ sourceAliases?: SemaphorSourceRef[];
217
+ fields: SemaphorFieldRef[];
218
+ };
219
+
220
+ export declare type SemaphorDataAppHookSpec = {
221
+ hook: 'useSemaphorAnalysis';
222
+ spec: SemaphorAnalysisQuerySpec;
223
+ } | {
224
+ hook: 'useSemaphorMetric';
225
+ spec: SemaphorMetricQuerySpec;
226
+ } | {
227
+ hook: 'useSemaphorRecords';
228
+ spec: SemaphorRecordsQuerySpec;
229
+ } | {
230
+ hook: 'useSemaphorInputOptions';
231
+ spec: SemaphorInputOptionsQuerySpec;
232
+ };
233
+
234
+ export declare type SemaphorDataAppHookValidation = {
235
+ hook: SemaphorDataAppHookSpec['hook'];
236
+ hookId?: string;
237
+ intent?: SemaphorAnalyticsIntent;
238
+ diagnostics: SemaphorDataAppValidationDiagnostic[];
239
+ executionResult: SemaphorAnalyticsExecutionResult;
240
+ };
241
+
242
+ export declare type SemaphorDataAppValidationDiagnostic = {
243
+ severity: 'error' | 'warning';
244
+ code: 'invalid_hook_spec' | 'invalid_analytics_intent' | 'invalid_source_ref' | 'missing_field' | 'unsupported_input_filter_composition' | string;
245
+ message: string;
246
+ path?: string;
247
+ hook?: SemaphorDataAppHookSpec['hook'];
248
+ hookId?: string;
249
+ intentId?: string;
250
+ source?: SemaphorSourceRef;
251
+ field?: SemaphorFieldRef;
252
+ };
253
+
254
+ export declare type SemaphorDataAppValidationResult = {
255
+ ok: boolean;
256
+ diagnostics: SemaphorDataAppValidationDiagnostic[];
257
+ hooks: SemaphorDataAppHookValidation[];
258
+ intents: SemaphorAnalyticsIntent[];
259
+ executionResults: SemaphorAnalyticsExecutionResult[];
260
+ };
261
+
262
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
263
+
264
+ declare type SemaphorExecutionFieldRef = SemaphorFieldRef & {
265
+ semanticAggregate?: SemaphorAggregateFunction;
266
+ effectiveAggregate?: SemaphorAggregateFunction;
267
+ aggregateSource?: SemaphorMetricAggregateSource;
268
+ };
269
+
270
+ declare type SemaphorFieldRef = {
271
+ name: string;
272
+ label?: string;
273
+ role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
274
+ dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
275
+ source?: SemaphorSourceRef;
276
+ aggregate?: SemaphorAggregateFunction;
277
+ };
278
+
279
+ declare type SemaphorInputBinding = {
280
+ inputId: string;
281
+ field?: SemaphorFieldRef;
282
+ };
283
+
284
+ declare type SemaphorInputHandle<TValue extends SemaphorInputValue = SemaphorInputValue> = {
285
+ id: string;
286
+ kind: 'filter' | 'control';
287
+ label?: string;
288
+ field?: SemaphorFieldRef;
289
+ operator?: SemaphorInputOperator;
290
+ controlRole?: SemaphorControlRole;
291
+ value: TValue | undefined;
292
+ options: SemaphorInputOption[];
293
+ isActive: boolean;
294
+ setValue(value: TValue | undefined): void;
295
+ clear(): void;
296
+ toAnalyticsInput(): SemaphorActiveInput<TValue>;
297
+ };
298
+
299
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
300
+
301
+ declare type SemaphorInputOption = {
302
+ label: string;
303
+ value: SemaphorOptionValue;
304
+ count?: number;
305
+ };
306
+
307
+ declare type SemaphorInputOptionsIntent = {
308
+ kind: 'inputOptions';
309
+ version?: SemaphorProtocolVersion;
310
+ id?: string;
311
+ label?: string;
312
+ source: SemaphorSourceRef;
313
+ field: SemaphorFieldRef;
314
+ search?: string;
315
+ limit?: number;
316
+ };
317
+
318
+ declare type SemaphorInputOptionsQuerySpec = SemaphorQuerySourceSpec & {
319
+ id?: string;
320
+ label?: string;
321
+ field: SemaphorQueryField;
322
+ search?: string;
323
+ limit?: number;
324
+ };
325
+
326
+ declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
327
+ kind: 'inputOptions';
328
+ options: Array<{
329
+ label: string;
330
+ value: unknown;
331
+ count?: number;
332
+ }>;
333
+ };
334
+
335
+ declare type SemaphorInputReference = SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle;
336
+
337
+ declare type SemaphorInputValue = SemaphorScalar | SemaphorScalar[];
338
+
339
+ declare type SemaphorMetricAggregateSource = 'semantic_model' | 'caller_override' | 'default_sum';
340
+
341
+ declare type SemaphorMetricAnalysis = {
342
+ kind: 'period_change';
343
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
344
+ direction?: 'increase' | 'decrease' | 'both';
345
+ timeWindow?: SemaphorTimeWindow;
346
+ };
347
+
348
+ declare type SemaphorMetricComparison = {
349
+ kind: 'previous_period' | 'previous_year' | 'target';
350
+ targetValue?: number;
351
+ };
352
+
353
+ declare type SemaphorMetricIntent = {
354
+ kind: 'metric';
355
+ version?: SemaphorProtocolVersion;
356
+ id?: string;
357
+ source: SemaphorSourceRef;
358
+ metrics: SemaphorFieldRef[];
359
+ primaryMetric?: SemaphorFieldRef;
360
+ label?: string;
361
+ dateField?: SemaphorFieldRef;
362
+ timeGrain?: SemaphorTimeGrain;
363
+ timeWindow?: SemaphorTimeWindow;
364
+ dimensions?: SemaphorFieldRef[];
365
+ filters?: SemaphorAnalyticsFilter[];
366
+ comparison?: {
367
+ kind: 'previous_period' | 'previous_year' | 'target';
368
+ targetValue?: number;
369
+ };
370
+ analysis?: SemaphorMetricAnalysis;
371
+ orderBy?: {
372
+ field: SemaphorFieldRef;
373
+ direction: 'asc' | 'desc';
374
+ };
375
+ inputs?: SemaphorInputBinding[];
376
+ limit?: number;
377
+ };
378
+
379
+ declare type SemaphorMetricQuerySpec = SemaphorQuerySourceSpec & {
380
+ id?: string;
381
+ label?: string;
382
+ metrics: SemaphorNonEmptyArray<SemaphorQueryField>;
383
+ primaryMetric?: SemaphorQueryField;
384
+ dateField?: SemaphorQueryField;
385
+ timeGrain?: SemaphorTimeGrain;
386
+ dimensions?: SemaphorQueryField[];
387
+ comparison?: SemaphorMetricComparison;
388
+ orderBy?: SemaphorQueryOrderBy;
389
+ inputs?: SemaphorInputReference[];
390
+ limit?: number;
391
+ };
392
+
393
+ declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
394
+ kind: 'metric';
395
+ value: number | string | null;
396
+ comparison?: {
397
+ kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
398
+ value?: number | string | null;
399
+ delta?: number | null;
400
+ deltaPercent?: number | null;
401
+ };
402
+ };
403
+
404
+ declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
405
+
406
+ declare type SemaphorOptionValue = string | number | boolean;
407
+
408
+ declare type SemaphorProtocolIssue = {
409
+ code: string;
410
+ message: string;
411
+ path?: string;
412
+ };
413
+
414
+ declare type SemaphorProtocolVersion = 1;
415
+
416
+ declare type SemaphorQueryField = SemaphorFieldRef;
417
+
418
+ declare type SemaphorQueryOrderBy = {
419
+ field: SemaphorQueryField;
420
+ direction: 'asc' | 'desc';
421
+ };
422
+
423
+ declare type SemaphorQueryPath = 'query_spec' | 'sql' | 'sql_python';
424
+
425
+ declare type SemaphorQuerySourceSpec = {
426
+ source: SemaphorSourceRef;
427
+ };
428
+
429
+ declare type SemaphorRecordsBaseQuerySpec = SemaphorQuerySourceSpec & {
430
+ id?: string;
431
+ label?: string;
432
+ dateField?: SemaphorQueryField;
433
+ timeGrain?: SemaphorTimeGrain;
434
+ orderBy?: SemaphorRecordsOrderBy;
435
+ inputs?: SemaphorInputReference[];
436
+ limit?: number;
437
+ };
438
+
439
+ declare type SemaphorRecordsField = SemaphorFieldRef & {
440
+ role: NonNullable<SemaphorFieldRef['role']>;
441
+ };
442
+
443
+ declare type SemaphorRecordsIntent = {
444
+ kind: 'records';
445
+ version?: SemaphorProtocolVersion;
446
+ source: SemaphorSourceRef;
447
+ id?: string;
448
+ label?: string;
449
+ fields: SemaphorFieldRef[];
450
+ dateField?: SemaphorFieldRef;
451
+ timeGrain?: SemaphorTimeGrain;
452
+ limit?: number;
453
+ orderBy?: {
454
+ field: SemaphorFieldRef;
455
+ direction: 'asc' | 'desc';
456
+ };
457
+ inputs?: SemaphorInputBinding[];
458
+ };
459
+
460
+ declare type SemaphorRecordsOrderBy = SemaphorQueryOrderBy;
461
+
462
+ declare type SemaphorRecordsQuerySpec = SemaphorRecordsBaseQuerySpec & SemaphorRecordsSelectorSpec;
463
+
464
+ declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
465
+ kind: 'records';
466
+ columns: SemaphorResultColumn[];
467
+ records: Array<Record<string, unknown>>;
468
+ };
469
+
470
+ declare type SemaphorRecordsSelectorSpec = {
471
+ fields: SemaphorNonEmptyArray<SemaphorRecordsField>;
472
+ };
473
+
474
+ declare type SemaphorRelationshipDiagnostics = {
475
+ status: SemaphorRelationshipDiagnosticStatus;
476
+ requiredSources?: SemaphorSourceRef[];
477
+ relationshipsUsed?: string[];
478
+ missingSources?: string[];
479
+ warnings?: string[];
480
+ message?: string;
481
+ recommendedNextStep?: string;
482
+ joinPlanSummary?: {
483
+ baseSource?: SemaphorSourceRef;
484
+ joinedSources?: SemaphorSourceRef[];
485
+ joinCount?: number;
486
+ };
487
+ fanoutRisk?: {
488
+ status: 'none' | 'warning' | 'error' | 'unknown';
489
+ message?: string;
490
+ };
491
+ };
492
+
493
+ declare type SemaphorRelationshipDiagnosticStatus = 'not_required' | 'resolved' | 'missing' | 'ambiguous' | 'fanout_risk' | 'unknown';
494
+
495
+ declare type SemaphorRelativeTimeWindow = {
496
+ kind?: 'relative';
497
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
498
+ value: number;
499
+ anchor?: 'now' | 'latest_available';
500
+ completeness?: 'include_partial' | 'complete_periods';
501
+ };
502
+
503
+ declare type SemaphorResultColumn = {
504
+ /**
505
+ * Stable row accessor for this result. Consumers should read values with
506
+ * `row[column.key]`; labels are display-only and may change.
507
+ */
508
+ key: string;
509
+ /**
510
+ * Semantic/source field name before result-key disambiguation.
511
+ */
512
+ name: string;
513
+ /**
514
+ * Human-facing display label.
515
+ */
516
+ label: string;
517
+ role?: SemaphorFieldRef['role'];
518
+ dataType?: SemaphorFieldRef['dataType'];
519
+ aggregate?: SemaphorFieldRef['aggregate'];
520
+ source?: SemaphorFieldRef['source'];
521
+ };
522
+
523
+ declare type SemaphorScalar = string | number | boolean | null;
524
+
525
+ declare type SemaphorSourceRef = {
526
+ kind: 'semantic';
527
+ domainId: string;
528
+ datasetName: string;
529
+ datasetId?: string;
530
+ label?: string;
531
+ connectionId?: string;
532
+ } | {
533
+ kind: 'physical';
534
+ connectionId: string;
535
+ connectionType?: string;
536
+ tableName: string;
537
+ databaseName?: string;
538
+ schemaName?: string;
539
+ label?: string;
540
+ dialect?: SemaphorDialect;
541
+ } | {
542
+ kind: 'sql';
543
+ connectionId: string;
544
+ dialect?: SemaphorDialect;
545
+ label?: string;
546
+ };
547
+
548
+ declare type SemaphorSqlIntent = {
549
+ kind: 'sql';
550
+ version?: SemaphorProtocolVersion;
551
+ id?: string;
552
+ label?: string;
553
+ source: Extract<SemaphorSourceRef, {
554
+ kind: 'sql';
555
+ }>;
556
+ sql: string;
557
+ parameters?: Record<string, unknown>;
558
+ pythonCode?: string;
559
+ limit?: number;
560
+ rationale?: string;
561
+ fields?: SemaphorFieldRef[];
562
+ inputs?: SemaphorInputBinding[];
563
+ };
564
+
565
+ declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
566
+ kind: 'sql';
567
+ columns: SemaphorRecordsResult['columns'];
568
+ records: SemaphorRecordsResult['records'];
569
+ sqlShape?: {
570
+ statementType?: string;
571
+ explicitLimit?: number;
572
+ hasPythonCode?: boolean;
573
+ };
574
+ };
575
+
576
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
577
+
578
+ declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
579
+
580
+ export declare function validateSemaphorDataAppHookSpecs(input: {
581
+ hooks: SemaphorDataAppHookSpec[];
582
+ fieldCatalogs?: SemaphorDataAppFieldCatalog[];
583
+ requireFieldCatalog?: boolean;
584
+ validateTimezone?: SemaphorAnalysisTimezoneValidator;
585
+ }): SemaphorDataAppValidationResult;
586
+
587
+ /**
588
+ * Week start day type.
589
+ * 0 = Sunday (US, Canada, Japan)
590
+ * 1 = Monday (ISO standard, most of Europe)
591
+ * 6 = Saturday (Middle East)
592
+ */
593
+ declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
594
+
595
+ export { }