react-semaphor 0.1.359 → 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-BeZvsJV0.js → calendar-preferences-dialog-BEKBpwMY.js} +1 -1
  2. package/dist/chunks/{calendar-preferences-dialog-BHq3bPkF.js → calendar-preferences-dialog-GwtaSN53.js} +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-gm3YPxOh.js → dashboard-briefing-launcher-D6gGO5wz.js} +3 -3
  4. package/dist/chunks/{dashboard-briefing-launcher-Dr6trdJw.js → dashboard-briefing-launcher-DYxd4856.js} +1 -1
  5. package/dist/chunks/{dashboard-controls-BZljC-GB.js → dashboard-controls-B4u5RsKl.js} +3 -3
  6. package/dist/chunks/{dashboard-controls-4a3fKtuD.js → dashboard-controls-C_rExqPw.js} +1 -1
  7. package/dist/chunks/{dashboard-json-wTRw_VIn.js → dashboard-json-BWWU6a7V.js} +1 -1
  8. package/dist/chunks/{dashboard-json-4uDp0D6Y.js → dashboard-json-CPGTofhm.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-CqnMxF8h.js → edit-dashboard-visual-D_jZ-iix.js} +1 -1
  10. package/dist/chunks/{edit-dashboard-visual-BztJSdkR.js → edit-dashboard-visual-biMO829J.js} +3 -3
  11. package/dist/chunks/{index-DZ3lq1Pk.js → index-CJ2IEuKz.js} +31368 -31127
  12. package/dist/chunks/index-Db1XVmfU.js +1411 -0
  13. package/dist/chunks/{resource-management-panel-CEVKKwSW.js → resource-management-panel-B9-5VHYe.js} +2 -2
  14. package/dist/chunks/{resource-management-panel-BajPY5IU.js → resource-management-panel-Bam-yvnt.js} +1 -1
  15. package/dist/chunks/{use-create-flow-overlay-state-CT1BlsPJ.js → use-create-flow-overlay-state-DAvEqaJV.js} +2 -2
  16. package/dist/chunks/{use-create-flow-overlay-state-D010FtSh.js → use-create-flow-overlay-state-dhxgdLYo.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-CIHFvxpt.js → use-visual-utils-CAKdXsr5.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-H2FXMsGo.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-YZnHD2NF.js +0 -1410
@@ -2,10 +2,44 @@ import { Context } from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
3
  import { ReactNode } from 'react';
4
4
 
5
+ /**
6
+ * Calendar context for timezone-aware date operations.
7
+ * Controls how dates are interpreted, grouped, and displayed.
8
+ */
9
+ declare type CalendarContext = {
10
+ /**
11
+ * IANA timezone identifier.
12
+ * @example 'America/Chicago', 'Europe/London', 'Asia/Tokyo', 'UTC'
13
+ * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
14
+ */
15
+ tz: string;
16
+ /**
17
+ * Day the week starts on.
18
+ * 0 = Sunday (US, Canada, Japan)
19
+ * 1 = Monday (ISO standard, most of Europe)
20
+ * 6 = Saturday (Middle East)
21
+ * @default 1 (Monday) for backward compatibility
22
+ */
23
+ weekStart: WeekStart;
24
+ /**
25
+ * Date anchor for relative date calculations.
26
+ * - 'now': Use current time (default, live dashboards)
27
+ * - { iso: string }: Fixed ISO 8601 date for reproducible views
28
+ */
29
+ anchor: 'now' | {
30
+ iso: string;
31
+ };
32
+ };
33
+
5
34
  export declare function createSemaphorQueryExecutor(): SemaphorQueryExecutor;
6
35
 
7
36
  export declare function hasSemaphorInputValue(value: unknown): boolean;
8
37
 
38
+ export declare function normalizeSemaphorAnalysisQueryOptions(value: unknown, options?: {
39
+ pathPrefix?: string;
40
+ validateTimezone?: SemaphorAnalysisTimezoneValidator;
41
+ }): SemaphorAnalysisQueryOptionsValidationResult;
42
+
9
43
  export declare function normalizeSemaphorInputOptions(options?: Array<{
10
44
  label: string;
11
45
  value: SemaphorOptionValue;
@@ -33,6 +67,89 @@ export declare type SemaphorActiveInput<TValue extends SemaphorInputValue = Sema
33
67
 
34
68
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
35
69
 
70
+ export declare type SemaphorAnalysisDriverMode = 'absolute_delta' | 'largest_negative' | 'largest_positive' | 'positive_and_negative' | 'all';
71
+
72
+ export declare type SemaphorAnalysisPayload = {
73
+ answerSummary?: string;
74
+ mode?: string;
75
+ data?: Record<string, unknown>;
76
+ records?: Array<Record<string, unknown>>;
77
+ changes?: Array<Record<string, unknown>>;
78
+ drivers?: Array<Record<string, unknown>>;
79
+ largestNegativeChanges?: Array<Record<string, unknown>>;
80
+ largestPositiveChanges?: Array<Record<string, unknown>>;
81
+ largestNegativeDrivers?: Array<Record<string, unknown>>;
82
+ largestPositiveDrivers?: Array<Record<string, unknown>>;
83
+ comparison?: Record<string, unknown>;
84
+ fieldsUsed?: Record<string, unknown>;
85
+ metadata?: Record<string, unknown>;
86
+ querySpec?: Record<string, unknown>;
87
+ sql?: Record<string, unknown>;
88
+ executionResult?: SemaphorAnalyticsExecutionResult;
89
+ [key: string]: unknown;
90
+ };
91
+
92
+ export declare type SemaphorAnalysisQueryOptions = {
93
+ chartTitle?: string;
94
+ chartType?: string;
95
+ driverMode?: SemaphorAnalysisDriverMode;
96
+ includePopulation?: boolean;
97
+ calendarContext?: CalendarContext;
98
+ };
99
+
100
+ export declare type SemaphorAnalysisQueryOptionsValidationIssue = {
101
+ code: 'invalid_analysis_option';
102
+ message: string;
103
+ path: string;
104
+ };
105
+
106
+ export declare type SemaphorAnalysisQueryOptionsValidationResult = {
107
+ ok: true;
108
+ analysisOptions?: SemaphorAnalysisQueryOptions;
109
+ } | {
110
+ ok: false;
111
+ issues: SemaphorAnalysisQueryOptionsValidationIssue[];
112
+ };
113
+
114
+ export declare type SemaphorAnalysisQueryResult = SemaphorQueryState & SemaphorAnalysisPayload & {
115
+ id?: string;
116
+ intent?: SemaphorMetricIntent;
117
+ };
118
+
119
+ export declare type SemaphorAnalysisQuerySpec = SemaphorMetricQuerySpec & SemaphorAnalysisQueryOptions & {
120
+ analysis?: SemaphorMetricIntent['analysis'];
121
+ timeWindow?: SemaphorMetricIntent['timeWindow'];
122
+ filters?: SemaphorAnalyticsFilter[];
123
+ };
124
+
125
+ export declare type SemaphorAnalysisTimezoneValidator = (tz: string) => string | null;
126
+
127
+ declare type SemaphorAnalyticsExecutionResult = {
128
+ intentId?: string;
129
+ queryId?: string;
130
+ status: SemaphorAnalyticsExecutionStatus;
131
+ resultShape?: SemaphorAnalyticsResult['kind'] | 'period_change';
132
+ intent?: SemaphorAnalyticsIntent;
133
+ compiledQuery?: SemaphorCompiledQuery;
134
+ fieldsUsed?: SemaphorExecutionFieldRef[];
135
+ result?: SemaphorAnalyticsResult;
136
+ validation: SemaphorAnalyticsValidationResult;
137
+ coverage?: {
138
+ answeredObligations: string[];
139
+ missingObligations: string[];
140
+ warnings?: SemaphorAnalyticsValidationIssue[];
141
+ };
142
+ missingFields?: string[];
143
+ warnings?: string[];
144
+ relationshipDiagnostics?: SemaphorRelationshipDiagnostics;
145
+ population?: SemaphorAnalyticsPopulation;
146
+ metadata?: Record<string, unknown>;
147
+ };
148
+
149
+ declare type SemaphorAnalyticsExecutionStatus = 'answered' | 'partial' | 'failed';
150
+
151
+ declare type SemaphorAnalyticsFieldRole = 'metric' | 'dateField' | 'dimension' | 'input' | 'source' | 'sql';
152
+
36
153
  declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
37
154
 
38
155
  declare type SemaphorAnalyticsFilterBase = {
@@ -59,6 +176,48 @@ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
59
176
 
60
177
  declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
61
178
 
179
+ declare type SemaphorAnalyticsPopulation = {
180
+ scope: 'filtered_query';
181
+ metrics: Record<string, number | string | null>;
182
+ };
183
+
184
+ declare type SemaphorAnalyticsRepairHint = {
185
+ code: SemaphorAnalyticsValidationCode | string;
186
+ message?: string;
187
+ invalidField?: string;
188
+ fieldRole?: SemaphorAnalyticsFieldRole;
189
+ validMetricCandidates?: string[];
190
+ validDateCandidates?: string[];
191
+ validDimensionCandidates?: string[];
192
+ recommendedNextStep: string;
193
+ };
194
+
195
+ declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult;
196
+
197
+ declare type SemaphorAnalyticsResultBase = {
198
+ intentId?: string;
199
+ queryPath: SemaphorQueryPath;
200
+ warnings?: string[];
201
+ rowCount?: number;
202
+ rowLimitExceeded?: boolean;
203
+ limit?: number;
204
+ };
205
+
206
+ 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';
207
+
208
+ declare type SemaphorAnalyticsValidationIssue = SemaphorProtocolIssue & {
209
+ code: SemaphorAnalyticsValidationCode | string;
210
+ fieldRole?: SemaphorAnalyticsFieldRole;
211
+ repairHint?: SemaphorAnalyticsRepairHint;
212
+ };
213
+
214
+ declare type SemaphorAnalyticsValidationResult = {
215
+ ok: boolean;
216
+ errors: SemaphorAnalyticsValidationIssue[];
217
+ warnings: SemaphorAnalyticsValidationIssue[];
218
+ repairHints: SemaphorAnalyticsRepairHint[];
219
+ };
220
+
62
221
  declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
63
222
  operator?: SemaphorAnalyticsValueFilterOperator;
64
223
  values: unknown[];
@@ -66,6 +225,33 @@ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
66
225
 
67
226
  declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
68
227
 
228
+ declare type SemaphorCompiledQuery = {
229
+ kind: 'config';
230
+ queryId: string;
231
+ source: SemaphorSourceRef;
232
+ cardType: string;
233
+ connectionId: string;
234
+ cardConfig: unknown;
235
+ cardDataSource: unknown;
236
+ activeFilters?: SemaphorAnalyticsFilter[];
237
+ rowLimit: number;
238
+ analyticsIntent?: SemaphorAnalyticsIntent;
239
+ } | {
240
+ kind: 'sql';
241
+ queryId: string;
242
+ source: Extract<SemaphorSourceRef, {
243
+ kind: 'sql';
244
+ }>;
245
+ connectionId: string;
246
+ dialect: SemaphorDialect;
247
+ sql: string;
248
+ parameters?: Record<string, unknown>;
249
+ pythonCode?: string;
250
+ activeFilters?: SemaphorAnalyticsFilter[];
251
+ rowLimit: number;
252
+ analyticsIntent?: SemaphorAnalyticsIntent;
253
+ };
254
+
69
255
  export declare type SemaphorControlInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBase<TValue> & {
70
256
  kind: 'control';
71
257
  role: SemaphorControlRole;
@@ -75,6 +261,34 @@ export declare type SemaphorControlRole = 'grain' | 'metric' | 'dimension' | 'ag
75
261
 
76
262
  export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
77
263
 
264
+ export declare type SemaphorDataAppFieldCatalog = {
265
+ source: SemaphorSourceRef;
266
+ sourceAliases?: SemaphorSourceRef[];
267
+ fields: SemaphorFieldRef[];
268
+ };
269
+
270
+ export declare type SemaphorDataAppHookSpec = {
271
+ hook: 'useSemaphorAnalysis';
272
+ spec: SemaphorAnalysisQuerySpec;
273
+ } | {
274
+ hook: 'useSemaphorMetric';
275
+ spec: SemaphorMetricQuerySpec;
276
+ } | {
277
+ hook: 'useSemaphorRecords';
278
+ spec: SemaphorRecordsQuerySpec;
279
+ } | {
280
+ hook: 'useSemaphorInputOptions';
281
+ spec: SemaphorInputOptionsQuerySpec;
282
+ };
283
+
284
+ export declare type SemaphorDataAppHookValidation = {
285
+ hook: SemaphorDataAppHookSpec['hook'];
286
+ hookId?: string;
287
+ intent?: SemaphorAnalyticsIntent;
288
+ diagnostics: SemaphorDataAppValidationDiagnostic[];
289
+ executionResult: SemaphorAnalyticsExecutionResult;
290
+ };
291
+
78
292
  export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
79
293
 
80
294
  export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext & {
@@ -86,6 +300,26 @@ export declare type SemaphorDataAppRuntime = SemaphorQueryExecutorContext & {
86
300
  executor?: SemaphorQueryExecutor;
87
301
  };
88
302
 
303
+ export declare type SemaphorDataAppValidationDiagnostic = {
304
+ severity: 'error' | 'warning';
305
+ code: 'invalid_hook_spec' | 'invalid_analytics_intent' | 'invalid_source_ref' | 'missing_field' | 'unsupported_input_filter_composition' | string;
306
+ message: string;
307
+ path?: string;
308
+ hook?: SemaphorDataAppHookSpec['hook'];
309
+ hookId?: string;
310
+ intentId?: string;
311
+ source?: SemaphorSourceRef;
312
+ field?: SemaphorFieldRef;
313
+ };
314
+
315
+ export declare type SemaphorDataAppValidationResult = {
316
+ ok: boolean;
317
+ diagnostics: SemaphorDataAppValidationDiagnostic[];
318
+ hooks: SemaphorDataAppHookValidation[];
319
+ intents: SemaphorAnalyticsIntent[];
320
+ executionResults: SemaphorAnalyticsExecutionResult[];
321
+ };
322
+
89
323
  declare type SemaphorDataAppWindowRuntime = {
90
324
  apiBaseUrl?: string;
91
325
  dataApiBaseUrl?: string;
@@ -96,6 +330,12 @@ declare type SemaphorDataAppWindowRuntime = {
96
330
 
97
331
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
98
332
 
333
+ declare type SemaphorExecutionFieldRef = SemaphorFieldRef & {
334
+ semanticAggregate?: SemaphorAggregateFunction;
335
+ effectiveAggregate?: SemaphorAggregateFunction;
336
+ aggregateSource?: SemaphorMetricAggregateSource;
337
+ };
338
+
99
339
  declare type SemaphorFieldRef = {
100
340
  name: string;
101
341
  label?: string;
@@ -162,6 +402,7 @@ declare type SemaphorInputOptionsIntent = {
162
402
 
163
403
  export declare type SemaphorInputOptionsPayload = {
164
404
  options: SemaphorInputOption[];
405
+ executionResult?: SemaphorAnalyticsExecutionResult;
165
406
  };
166
407
 
167
408
  export declare type SemaphorInputOptionsQueryResult = SemaphorQueryState & SemaphorInputOptionsPayload & {
@@ -179,12 +420,23 @@ export declare type SemaphorInputOptionsQuerySpec = SemaphorQuerySourceSpec & {
179
420
  limit?: number;
180
421
  };
181
422
 
423
+ declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
424
+ kind: 'inputOptions';
425
+ options: Array<{
426
+ label: string;
427
+ value: unknown;
428
+ count?: number;
429
+ }>;
430
+ };
431
+
182
432
  export declare type SemaphorInputReference = SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle;
183
433
 
184
434
  export declare type SemaphorInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorFilterInputSpec<TValue> | SemaphorControlInputSpec<TValue>;
185
435
 
186
436
  export declare type SemaphorInputValue = SemaphorScalar | SemaphorScalar[];
187
437
 
438
+ declare type SemaphorMetricAggregateSource = 'semantic_model' | 'caller_override' | 'default_sum';
439
+
188
440
  declare type SemaphorMetricAnalysis = {
189
441
  kind: 'period_change';
190
442
  orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
@@ -230,6 +482,7 @@ export declare type SemaphorMetricPayload = {
230
482
  delta?: number | null;
231
483
  deltaPercent?: number | null;
232
484
  records?: Array<Record<string, unknown>>;
485
+ executionResult?: SemaphorAnalyticsExecutionResult;
233
486
  };
234
487
 
235
488
  export declare type SemaphorMetricQueryResult = SemaphorQueryState & SemaphorMetricPayload & {
@@ -251,13 +504,31 @@ export declare type SemaphorMetricQuerySpec = SemaphorQuerySourceSpec & {
251
504
  limit?: number;
252
505
  };
253
506
 
507
+ declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
508
+ kind: 'metric';
509
+ value: number | string | null;
510
+ comparison?: {
511
+ kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
512
+ value?: number | string | null;
513
+ delta?: number | null;
514
+ deltaPercent?: number | null;
515
+ };
516
+ };
517
+
254
518
  export declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
255
519
 
256
520
  export declare type SemaphorOptionValue = string | number | boolean;
257
521
 
522
+ declare type SemaphorProtocolIssue = {
523
+ code: string;
524
+ message: string;
525
+ path?: string;
526
+ };
527
+
258
528
  declare type SemaphorProtocolVersion = 1;
259
529
 
260
530
  export declare type SemaphorQueryExecutor = {
531
+ executeAnalysis(intent: SemaphorMetricIntent, context: SemaphorQueryExecutorContext, options?: SemaphorAnalysisQueryOptions): Promise<SemaphorAnalysisPayload>;
261
532
  executeMetric(intent: SemaphorMetricIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorMetricPayload>;
262
533
  executeRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(intent: SemaphorRecordsIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorRecordsPayload<TRecord>>;
263
534
  executeInputOptions(intent: Extract<SemaphorAnalyticsIntent, {
@@ -278,6 +549,8 @@ export declare type SemaphorQueryOrderBy = {
278
549
  direction: 'asc' | 'desc';
279
550
  };
280
551
 
552
+ declare type SemaphorQueryPath = 'query_spec' | 'sql' | 'sql_python';
553
+
281
554
  export declare type SemaphorQuerySourceSpec = {
282
555
  source: SemaphorSourceRef;
283
556
  };
@@ -327,6 +600,7 @@ export declare type SemaphorRecordsPayload<TRecord extends Record<string, unknow
327
600
  records: TRecord[];
328
601
  columns?: SemaphorResultColumn[];
329
602
  rowCount?: number;
603
+ executionResult?: SemaphorAnalyticsExecutionResult;
330
604
  };
331
605
 
332
606
  export declare type SemaphorRecordsQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorQueryState & SemaphorRecordsPayload<TRecord> & {
@@ -336,10 +610,37 @@ export declare type SemaphorRecordsQueryResult<TRecord extends Record<string, un
336
610
 
337
611
  export declare type SemaphorRecordsQuerySpec = SemaphorRecordsBaseQuerySpec & SemaphorRecordsSelectorSpec;
338
612
 
613
+ declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
614
+ kind: 'records';
615
+ columns: SemaphorResultColumn[];
616
+ records: Array<Record<string, unknown>>;
617
+ };
618
+
339
619
  declare type SemaphorRecordsSelectorSpec = {
340
620
  fields: SemaphorNonEmptyArray<SemaphorRecordsField>;
341
621
  };
342
622
 
623
+ declare type SemaphorRelationshipDiagnostics = {
624
+ status: SemaphorRelationshipDiagnosticStatus;
625
+ requiredSources?: SemaphorSourceRef[];
626
+ relationshipsUsed?: string[];
627
+ missingSources?: string[];
628
+ warnings?: string[];
629
+ message?: string;
630
+ recommendedNextStep?: string;
631
+ joinPlanSummary?: {
632
+ baseSource?: SemaphorSourceRef;
633
+ joinedSources?: SemaphorSourceRef[];
634
+ joinCount?: number;
635
+ };
636
+ fanoutRisk?: {
637
+ status: 'none' | 'warning' | 'error' | 'unknown';
638
+ message?: string;
639
+ };
640
+ };
641
+
642
+ declare type SemaphorRelationshipDiagnosticStatus = 'not_required' | 'resolved' | 'missing' | 'ambiguous' | 'fanout_risk' | 'unknown';
643
+
343
644
  declare type SemaphorRelativeTimeWindow = {
344
645
  kind?: 'relative';
345
646
  unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
@@ -410,12 +711,27 @@ declare type SemaphorSqlIntent = {
410
711
  inputs?: SemaphorInputBinding[];
411
712
  };
412
713
 
714
+ declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
715
+ kind: 'sql';
716
+ columns: SemaphorRecordsResult['columns'];
717
+ records: SemaphorRecordsResult['records'];
718
+ sqlShape?: {
719
+ statementType?: string;
720
+ explicitLimit?: number;
721
+ hasPythonCode?: boolean;
722
+ };
723
+ };
724
+
413
725
  declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
414
726
 
415
727
  declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
416
728
 
417
729
  export declare function toSemaphorActiveInputSnapshots(inputs: SemaphorInputReference[] | undefined): SemaphorActiveInput[];
418
730
 
731
+ export declare function toSemaphorAnalysisIntent(spec: SemaphorAnalysisQuerySpec): SemaphorMetricIntent;
732
+
733
+ export declare function toSemaphorAnalysisQueryOptions(spec: SemaphorAnalysisQuerySpec): SemaphorAnalysisQueryOptions;
734
+
419
735
  export declare function toSemaphorInputBinding(input: SemaphorInputReference): SemaphorInputBinding;
420
736
 
421
737
  export declare function toSemaphorInputBindings(inputs: SemaphorInputReference[] | undefined): SemaphorInputBinding[] | undefined;
@@ -437,6 +753,8 @@ export declare function toSemaphorMetricIntent(spec: SemaphorMetricQuerySpec): S
437
753
 
438
754
  export declare function toSemaphorRecordsIntent(spec: SemaphorRecordsQuerySpec): SemaphorRecordsIntent;
439
755
 
756
+ export declare function useSemaphorAnalysis(spec: SemaphorAnalysisQuerySpec): SemaphorAnalysisQueryResult;
757
+
440
758
  export declare function useSemaphorDataAppRuntime(): SemaphorDataAppRuntime;
441
759
 
442
760
  export declare function useSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputHandle;
@@ -447,4 +765,19 @@ export declare function useSemaphorMetric(spec: SemaphorMetricQuerySpec): Semaph
447
765
 
448
766
  export declare function useSemaphorRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorRecordsQuerySpec): SemaphorRecordsQueryResult<TRecord>;
449
767
 
768
+ export declare function validateSemaphorDataAppHookSpecs(input: {
769
+ hooks: SemaphorDataAppHookSpec[];
770
+ fieldCatalogs?: SemaphorDataAppFieldCatalog[];
771
+ requireFieldCatalog?: boolean;
772
+ validateTimezone?: SemaphorAnalysisTimezoneValidator;
773
+ }): SemaphorDataAppValidationResult;
774
+
775
+ /**
776
+ * Week start day type.
777
+ * 0 = Sunday (US, Canada, Japan)
778
+ * 1 = Monday (ISO standard, most of Europe)
779
+ * 6 = Saturday (Middle East)
780
+ */
781
+ declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
782
+
450
783
  export { }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.359",
8
+ "version": "0.1.360",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -72,6 +72,11 @@
72
72
  "import": "./dist/data-app-sdk/index.js",
73
73
  "require": "./dist/data-app-sdk/index.cjs"
74
74
  },
75
+ "./data-app-sdk/validation": {
76
+ "types": "./dist/types/data-app-sdk-validation.d.ts",
77
+ "import": "./dist/data-app-sdk-validation/index.js",
78
+ "require": "./dist/data-app-sdk-validation/index.cjs"
79
+ },
75
80
  "./data-app-builder": {
76
81
  "types": "./dist/types/data-app-builder.d.ts",
77
82
  "import": "./dist/data-app-builder/index.js",