react-semaphor 0.1.398 → 0.1.400

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 +2 -2
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/chunks/analyze-result-contract-BUgK3759.js +1833 -0
  6. package/dist/chunks/analyze-result-contract-S8u7CcPL.js +1 -0
  7. package/dist/chunks/{calendar-preferences-dialog-DwLeBLy2.js → calendar-preferences-dialog-Ci3rHHgA.js} +1 -1
  8. package/dist/chunks/{calendar-preferences-dialog-49fcEPXS.js → calendar-preferences-dialog-i3-jBIYS.js} +3 -3
  9. package/dist/chunks/{dashboard-briefing-launcher-cgPKz1yX.js → dashboard-briefing-launcher-BpwjeJsQ.js} +4 -4
  10. package/dist/chunks/{dashboard-briefing-launcher-CgkSKkZR.js → dashboard-briefing-launcher-DiEpMS9E.js} +1 -1
  11. package/dist/chunks/{dashboard-controls-D12ZSUP_.js → dashboard-controls-BaUUrvSI.js} +1 -1
  12. package/dist/chunks/{dashboard-controls-VMFm3OP4.js → dashboard-controls-Bkjpgr3d.js} +5 -5
  13. package/dist/chunks/{dashboard-json-CvK0oI24.js → dashboard-json-CxNyExRm.js} +1 -1
  14. package/dist/chunks/{dashboard-json-C-GG5yC7.js → dashboard-json-DvULhhN2.js} +3 -3
  15. package/dist/chunks/{edit-dashboard-visual-B5KB7dx4.js → edit-dashboard-visual-DBrsgEtL.js} +4 -4
  16. package/dist/chunks/{edit-dashboard-visual-ql99faTz.js → edit-dashboard-visual-DJRPiKdY.js} +1 -1
  17. package/dist/chunks/{index-DXCBPLDu.js → index-BepF6hoa.js} +2 -2
  18. package/dist/chunks/{index-CQmKDEbe.js → index-Drz04wqE.js} +5 -5
  19. package/dist/chunks/{switch-B79Hn4Qh.js → switch-D2oOmorN.js} +1 -1
  20. package/dist/chunks/{switch-BXQAlSuW.js → switch-qUw8u-gU.js} +1 -1
  21. package/dist/chunks/update-policy-BmtOqvbf.js +3 -0
  22. package/dist/chunks/update-policy-KImUg4Od.js +831 -0
  23. package/dist/chunks/{use-create-flow-overlay-state-Bw5LRkf9.js → use-create-flow-overlay-state-CFJIHt5D.js} +3 -3
  24. package/dist/chunks/{use-create-flow-overlay-state-7MFN3PWX.js → use-create-flow-overlay-state-DrkYiyQz.js} +1 -1
  25. package/dist/chunks/{validators-4EGCWWga.js → validators-B1Mgdr3T.js} +279 -242
  26. package/dist/chunks/{validators-CPtkrola.js → validators-DFOX0tYY.js} +1 -1
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/dashboard-authoring/index.cjs +1 -1
  30. package/dist/dashboard-authoring/index.js +2 -2
  31. package/dist/data-app-builder/index.cjs +1 -1
  32. package/dist/data-app-builder/index.js +2 -2
  33. package/dist/data-app-codegen/index.cjs +1 -0
  34. package/dist/data-app-codegen/index.js +22 -0
  35. package/dist/data-app-codegen-node/index.cjs +462 -0
  36. package/dist/data-app-codegen-node/index.js +1424 -0
  37. package/dist/data-app-sdk/index.cjs +2 -2
  38. package/dist/data-app-sdk/index.js +3 -2
  39. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  40. package/dist/data-app-sdk-adapters/index.js +20 -12
  41. package/dist/data-app-sdk-validation/index.cjs +1 -1
  42. package/dist/data-app-sdk-validation/index.js +2 -2
  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 +101 -2
  48. package/dist/types/dashboard-assistant.d.ts +14 -0
  49. package/dist/types/dashboard-authoring.d.ts +6 -0
  50. package/dist/types/data-app-builder.d.ts +6 -0
  51. package/dist/types/data-app-codegen-node.d.ts +1165 -0
  52. package/dist/types/data-app-codegen.d.ts +1137 -0
  53. package/dist/types/data-app-sdk-adapters.d.ts +7 -0
  54. package/dist/types/data-app-sdk-validation.d.ts +15 -0
  55. package/dist/types/data-app-sdk.d.ts +18 -0
  56. package/dist/types/main.d.ts +6 -0
  57. package/package.json +9 -1
  58. package/dist/chunks/analyze-result-contract-C9Gv2_qW.js +0 -1585
  59. package/dist/chunks/analyze-result-contract-Zgg-Bbpj.js +0 -1
@@ -0,0 +1,1137 @@
1
+ export declare function assertValidCodegenSummary(value: unknown): void;
2
+
3
+ export declare function buildSemaphorGeneratedActiveInput({ input, filterContract, binding, option, codegenSummary, }: {
4
+ input: unknown;
5
+ filterContract: unknown;
6
+ binding: unknown;
7
+ option: {
8
+ value?: SemaphorInputValue;
9
+ };
10
+ codegenSummary: unknown;
11
+ }): SemaphorActiveInput;
12
+
13
+ export declare function buildSemaphorGeneratedInputOptionIntent({ input, filterContract, codegenSummary, }: {
14
+ input: unknown;
15
+ filterContract: unknown;
16
+ codegenSummary: unknown;
17
+ }): Extract<SemaphorAnalyticsIntent, {
18
+ kind: 'inputOptions';
19
+ }> | null;
20
+
21
+ export declare function buildSemaphorGeneratedViewExecutionRequest(view: unknown, contextOrSummary: GeneratedRefContext | unknown): Omit<SemaphorGeneratedViewExecutionRequest, 'viewId'> | null;
22
+
23
+ export declare function buildSemaphorGeneratedViewExecutionRequests(codegenSummary: unknown): SemaphorGeneratedViewExecutionRequestsResult;
24
+
25
+ /**
26
+ * Calendar context for timezone-aware date operations.
27
+ * Controls how dates are interpreted, grouped, and displayed.
28
+ */
29
+ declare type CalendarContext = {
30
+ /**
31
+ * IANA timezone identifier.
32
+ * @example 'America/Chicago', 'Europe/London', 'Asia/Tokyo', 'UTC'
33
+ * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
34
+ */
35
+ tz: string;
36
+ /**
37
+ * Day the week starts on.
38
+ * 0 = Sunday (US, Canada, Japan)
39
+ * 1 = Monday (ISO standard, most of Europe)
40
+ * 6 = Saturday (Middle East)
41
+ * @default 1 (Monday) for backward compatibility
42
+ */
43
+ weekStart: WeekStart;
44
+ /**
45
+ * Date anchor for relative date calculations.
46
+ * - 'now': Use current time (default, live dashboards)
47
+ * - { iso: string }: Fixed ISO 8601 date for reproducible views
48
+ */
49
+ anchor: 'now' | {
50
+ iso: string;
51
+ };
52
+ };
53
+
54
+ export declare const CODEGEN_SUMMARY_SCHEMA_VERSION: "semaphor-data-app-codegen-summary/v1";
55
+
56
+ export declare const CODEGEN_SUMMARY_VALIDATOR_VERSION: "semaphor-data-app-codegen-summary-validator/v2";
57
+
58
+ export declare const CONTRACT_MANIFEST_SCHEMA_VERSION = "semaphor-generated-data-app-contract-manifest/v1";
59
+
60
+ export declare function evaluateSemaphorDataAppContractUpdatePolicy({ beforeSummary, afterSummary, migrationReport, operationIntent, preferences, }: SemaphorDataAppContractUpdatePolicyInput): SemaphorDataAppContractUpdatePolicyResult;
61
+
62
+ export declare const GENERATED_CONTRACT_SCHEMA_VERSION = "semaphor-generated-data-app-contract/v1";
63
+
64
+ export declare const GENERATED_CONTRACT_TYPESCRIPT_FILES: readonly ["sources.ts", "fields.ts", "inputs.ts", "queries.ts", "bindings.ts", "accessors.ts", "metadata.ts", "index.ts"];
65
+
66
+ declare type GeneratedRefContext = {
67
+ sourcesByKey: Map<string, JsonRecord>;
68
+ };
69
+
70
+ export declare function isSemaphorDataAppCodegenSummary(value: unknown): value is SemaphorDataAppCodegenSummary;
71
+
72
+ declare type JsonRecord = Record<string, unknown>;
73
+
74
+ export declare const REQUIRED_GENERATED_CONTRACT_FILES: readonly ["sources.ts", "fields.ts", "inputs.ts", "queries.ts", "bindings.ts", "accessors.ts", "metadata.ts", "index.ts", "contract.manifest.json"];
75
+
76
+ export declare const SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION: "semaphor-data-app-codegen-summary/v1";
77
+
78
+ export declare const SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION: "semaphor-data-app-codegen-summary-validator/v2";
79
+
80
+ declare type SemaphorAbsoluteTimeWindow = {
81
+ kind: 'absolute';
82
+ start: string;
83
+ end: string;
84
+ };
85
+
86
+ declare type SemaphorActiveInput<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBinding & {
87
+ kind: 'filter' | 'control';
88
+ label?: string;
89
+ value?: TValue;
90
+ isActive: boolean;
91
+ operator?: SemaphorInputOperator;
92
+ controlRole?: SemaphorControlRole;
93
+ };
94
+
95
+ declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
96
+
97
+ declare type SemaphorAnalysisDriverMode = 'absolute_delta' | 'largest_negative' | 'largest_positive' | 'positive_and_negative' | 'all';
98
+
99
+ declare type SemaphorAnalysisQueryOptions = {
100
+ chartTitle?: string;
101
+ chartType?: string;
102
+ driverMode?: SemaphorAnalysisDriverMode;
103
+ includePopulation?: boolean;
104
+ calendarContext?: CalendarContext;
105
+ };
106
+
107
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
108
+
109
+ declare type SemaphorAnalyticsFilterBase = {
110
+ id?: string;
111
+ field: SemaphorFieldRef;
112
+ /**
113
+ * Controls where the filter is applied in an aggregate query.
114
+ *
115
+ * `row` means pre-aggregation filtering (`WHERE`).
116
+ * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
117
+ * for measure fields the execution engine can aggregate safely.
118
+ */
119
+ scope?: 'row' | 'aggregate';
120
+ };
121
+
122
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
123
+
124
+ declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent | SemaphorMatrixIntent;
125
+
126
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
127
+ operator: SemaphorAnalyticsNullFilterOperator;
128
+ values?: never;
129
+ };
130
+
131
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
132
+
133
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
134
+ operator?: SemaphorAnalyticsValueFilterOperator;
135
+ values: unknown[];
136
+ };
137
+
138
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
139
+
140
+ declare type SemaphorControlRole = 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
141
+
142
+ declare type SemaphorDataAppChecklistBinding = {
143
+ inputId?: string;
144
+ inputLabel?: string;
145
+ fieldRef?: SemaphorDataAppCodegenFieldRef;
146
+ optionValueField?: SemaphorDataAppCodegenFieldRef;
147
+ optionLabelField?: SemaphorDataAppCodegenFieldRef;
148
+ relationshipHint?: SemaphorRelationshipHint;
149
+ relationshipsUsed?: SemaphorDataAppCodegenRelationshipUse[];
150
+ };
151
+
152
+ declare type SemaphorDataAppCodegenAnalysisIntent = SemaphorDataAppCodegenMetricIntent & {
153
+ analysis?: SemaphorMetricIntent['analysis'];
154
+ timeWindow?: SemaphorTimeWindow;
155
+ filters?: SemaphorDataAppCodegenAnalyticsFilter[];
156
+ driverMode?: 'absolute_delta' | 'largest_negative' | 'largest_positive' | 'positive_and_negative' | 'all';
157
+ includePopulation?: boolean;
158
+ calendarContext?: {
159
+ tz?: string;
160
+ weekStart?: number;
161
+ anchor?: 'now' | {
162
+ iso: string;
163
+ };
164
+ };
165
+ };
166
+
167
+ declare type SemaphorDataAppCodegenAnalyticsFilter = SemaphorAnalyticsFilter & {
168
+ field: SemaphorDataAppCodegenFieldRef;
169
+ };
170
+
171
+ declare type SemaphorDataAppCodegenComputation = {
172
+ kind: 'server_query';
173
+ queryKind: SemaphorDataAppCodegenQueryKind;
174
+ queryOwnership?: 'view_owned' | 'shared_query';
175
+ sourceKeys?: string[];
176
+ fieldNames?: string[];
177
+ inputIds?: string[];
178
+ tableExecution?: {
179
+ mode?: 'bounded' | 'server_paginated' | 'server_windowed';
180
+ initialLimit?: number;
181
+ sort?: 'server' | 'client_for_bounded_rows';
182
+ pagination?: 'offset' | 'cursor' | 'window' | 'not_needed';
183
+ };
184
+ reason?: string;
185
+ } | {
186
+ kind: 'derived';
187
+ upstreamViewId: string;
188
+ derivation: string;
189
+ caveat?: string;
190
+ } | {
191
+ kind: 'presentation_only';
192
+ reason?: string;
193
+ } | {
194
+ kind: 'unsupported';
195
+ reason: string;
196
+ suggestedModelingFix: string;
197
+ };
198
+
199
+ declare type SemaphorDataAppCodegenExecutableView = {
200
+ id: string;
201
+ title?: string;
202
+ purpose?: string;
203
+ sourcePresentation?: SemaphorDataAppCodegenSourcePresentation;
204
+ visual?: string;
205
+ visualSpec?: SemaphorDataAppCodegenVisualSpec;
206
+ queryKind: SemaphorDataAppCodegenQueryKind;
207
+ sdkBuilder?: SemaphorDataAppCodegenSdkBuilder;
208
+ sdkSpec: SemaphorDataAppCodegenSdkSpec;
209
+ fields: SemaphorDataAppCodegenFieldRef[];
210
+ computation?: SemaphorDataAppCodegenComputation;
211
+ uxExpectations?: string[];
212
+ validation?: SemaphorDataAppCodegenViewValidation;
213
+ };
214
+
215
+ declare type SemaphorDataAppCodegenFallbackReason = {
216
+ code?: string;
217
+ message?: string;
218
+ governedAlternativesTried?: string[];
219
+ requiredModelingFix?: string;
220
+ acceptedByUser?: boolean;
221
+ };
222
+
223
+ declare type SemaphorDataAppCodegenFieldRef = SemaphorFieldRef & {
224
+ sourceKey?: string;
225
+ };
226
+
227
+ declare type SemaphorDataAppCodegenInput = {
228
+ id: string;
229
+ label?: string;
230
+ type?: string;
231
+ serverSide?: boolean;
232
+ fieldRef?: SemaphorDataAppCodegenFieldRef;
233
+ optionQuery?: SemaphorDataAppCodegenInputOptionQuery;
234
+ bindings?: SemaphorDataAppCodegenInputBinding[];
235
+ appliesToViewIds: string[];
236
+ relationshipHint?: SemaphorRelationshipHint;
237
+ relationshipsUsed?: SemaphorDataAppCodegenRelationshipUse[];
238
+ };
239
+
240
+ declare type SemaphorDataAppCodegenInputBinding = {
241
+ appliesToViewIds: string[];
242
+ fieldRef: SemaphorDataAppCodegenFieldRef;
243
+ relationshipHint?: SemaphorRelationshipHint;
244
+ relationshipsUsed?: SemaphorDataAppCodegenRelationshipUse[];
245
+ };
246
+
247
+ declare type SemaphorDataAppCodegenInputOptionQuery = {
248
+ id?: string;
249
+ builder: 'semaphor.inputOptions';
250
+ source?: SemaphorSourceRef;
251
+ sourceKey?: string;
252
+ valueFieldRef: SemaphorDataAppCodegenFieldRef;
253
+ labelFieldRef: SemaphorDataAppCodegenFieldRef;
254
+ filterFieldRef?: SemaphorDataAppCodegenFieldRef;
255
+ population?: SemaphorInputOptionsIntent['population'];
256
+ dependencies?: SemaphorInputOptionsIntent['dependencies'];
257
+ limit?: number;
258
+ spec?: SemaphorDataAppCodegenInputOptionsIntent;
259
+ };
260
+
261
+ declare type SemaphorDataAppCodegenInputOptionsIntent = Omit<SemaphorInputOptionsIntent, 'kind' | 'labelField' | 'valueField' | 'searchField' | 'disambiguationFields'> & {
262
+ labelField: SemaphorDataAppCodegenFieldRef;
263
+ valueField: SemaphorDataAppCodegenFieldRef;
264
+ searchField?: SemaphorDataAppCodegenFieldRef;
265
+ disambiguationFields?: SemaphorDataAppCodegenFieldRef[];
266
+ };
267
+
268
+ declare type SemaphorDataAppCodegenMatrixIntent = {
269
+ source: Extract<SemaphorDataAppCodegenSource, {
270
+ kind: 'semantic' | 'physical';
271
+ }>;
272
+ id?: string;
273
+ label?: string;
274
+ filters?: SemaphorDataAppCodegenAnalyticsFilter[];
275
+ relationshipHint?: SemaphorRelationshipHint;
276
+ rows: Array<{
277
+ id?: string;
278
+ field?: SemaphorDataAppCodegenFieldRef;
279
+ grain?: SemaphorTimeGrain;
280
+ label?: string;
281
+ subtotal?: boolean | {
282
+ enabled?: boolean;
283
+ label?: string;
284
+ };
285
+ }>;
286
+ columns?: Array<{
287
+ id?: string;
288
+ field?: SemaphorDataAppCodegenFieldRef;
289
+ grain?: SemaphorTimeGrain;
290
+ label?: string;
291
+ subtotal?: boolean | {
292
+ enabled?: boolean;
293
+ label?: string;
294
+ };
295
+ }>;
296
+ values: Array<{
297
+ id?: string;
298
+ field?: SemaphorDataAppCodegenFieldRef;
299
+ aggregate?: SemaphorFieldRef['aggregate'];
300
+ label?: string;
301
+ }>;
302
+ totals?: SemaphorMatrixTotalOptions;
303
+ sort?: SemaphorDataAppCodegenMatrixSortRule[];
304
+ expansion?: SemaphorMatrixExpansionOptions;
305
+ layout?: {
306
+ hierarchy?: 'compact' | 'tabular' | 'outline';
307
+ valuesPlacement?: 'columns' | 'rows';
308
+ stickyRowHeaders?: boolean;
309
+ stickyColumnHeaders?: boolean;
310
+ };
311
+ displayLimits?: SemaphorMatrixDisplayLimitOptions;
312
+ };
313
+
314
+ declare type SemaphorDataAppCodegenMatrixSortRule = Omit<SemaphorMatrixSortRule, 'by'> & {
315
+ by: {
316
+ kind: 'label';
317
+ } | {
318
+ kind: 'field';
319
+ field: SemaphorDataAppCodegenFieldRef;
320
+ aggregate?: SemaphorFieldRef['aggregate'];
321
+ } | {
322
+ kind: 'value';
323
+ valueId: string;
324
+ rowPath?: SemaphorMatrixSortRule['by'] extends infer T ? T extends {
325
+ kind: 'value';
326
+ rowPath?: infer R;
327
+ } ? R : never : never;
328
+ columnPath?: SemaphorMatrixSortRule['by'] extends infer T ? T extends {
329
+ kind: 'value';
330
+ columnPath?: infer C;
331
+ } ? C : never : never;
332
+ };
333
+ };
334
+
335
+ declare type SemaphorDataAppCodegenMetricIntent = {
336
+ source: SemaphorDataAppCodegenSource;
337
+ id?: string;
338
+ label?: string;
339
+ measures: SemaphorDataAppCodegenFieldRef[];
340
+ primaryMeasure?: SemaphorDataAppCodegenFieldRef;
341
+ dateField?: SemaphorDataAppCodegenFieldRef;
342
+ timeGrain?: SemaphorTimeGrain;
343
+ dimensions?: SemaphorDataAppCodegenFieldRef[];
344
+ comparison?: SemaphorMetricIntent['comparison'];
345
+ orderBy?: {
346
+ field: SemaphorDataAppCodegenFieldRef;
347
+ direction: 'asc' | 'desc';
348
+ };
349
+ filters?: SemaphorDataAppCodegenAnalyticsFilter[];
350
+ relationshipHint?: SemaphorRelationshipHint;
351
+ limit?: number;
352
+ derivedFields?: SemaphorMetricIntent['derivedFields'];
353
+ };
354
+
355
+ declare type SemaphorDataAppCodegenPresentationView = {
356
+ id: string;
357
+ title?: string;
358
+ purpose?: string;
359
+ sourcePresentation?: SemaphorDataAppCodegenSourcePresentation;
360
+ visual?: 'text_block' | 'narrative' | string;
361
+ visualSpec?: SemaphorDataAppCodegenVisualSpec;
362
+ queryKind?: never;
363
+ sdkBuilder?: never;
364
+ sdkSpec?: never;
365
+ fields?: SemaphorDataAppCodegenFieldRef[];
366
+ computation: Extract<SemaphorDataAppCodegenComputation, {
367
+ kind: 'presentation_only' | 'unsupported' | 'derived';
368
+ }>;
369
+ uxExpectations?: string[];
370
+ validation?: SemaphorDataAppCodegenViewValidation;
371
+ };
372
+
373
+ declare type SemaphorDataAppCodegenQueryKind = 'metric' | 'records' | 'matrix' | 'analysis' | 'sql_fallback';
374
+
375
+ declare type SemaphorDataAppCodegenRecordsIntent = {
376
+ source: SemaphorDataAppCodegenSource;
377
+ id?: string;
378
+ label?: string;
379
+ fields: SemaphorDataAppCodegenFieldRef[];
380
+ dateField?: SemaphorDataAppCodegenFieldRef;
381
+ timeGrain?: SemaphorTimeGrain;
382
+ timeWindow?: SemaphorTimeWindow;
383
+ filters?: SemaphorDataAppCodegenAnalyticsFilter[];
384
+ orderBy?: {
385
+ field: SemaphorDataAppCodegenFieldRef;
386
+ direction: 'asc' | 'desc';
387
+ };
388
+ relationshipHint?: SemaphorRelationshipHint;
389
+ limit?: number;
390
+ pagination?: SemaphorPaginationRequest;
391
+ totals?: SemaphorDataAppCodegenRecordsServerTotalsRequest;
392
+ derivedFields?: SemaphorMetricIntent['derivedFields'];
393
+ };
394
+
395
+ declare type SemaphorDataAppCodegenRecordsServerTotalsRequest = {
396
+ mode: 'server';
397
+ measures: SemaphorDataAppCodegenSourceBearingFieldRef[];
398
+ };
399
+
400
+ declare type SemaphorDataAppCodegenRelationshipUse = {
401
+ id?: string;
402
+ fromSourceKey?: string;
403
+ toSourceKey?: string;
404
+ fields?: SemaphorDataAppCodegenFieldRef[];
405
+ };
406
+
407
+ declare type SemaphorDataAppCodegenSdkBuilder = 'semaphor.metric' | 'semaphor.records' | 'semaphor.matrix' | 'semaphor.analysis' | 'semaphor.sql';
408
+
409
+ declare type SemaphorDataAppCodegenSdkSpec = {
410
+ builder: 'semaphor.metric';
411
+ spec: SemaphorDataAppCodegenMetricIntent;
412
+ } | {
413
+ builder: 'semaphor.records';
414
+ spec: SemaphorDataAppCodegenRecordsIntent;
415
+ } | {
416
+ builder: 'semaphor.matrix';
417
+ spec: SemaphorDataAppCodegenMatrixIntent;
418
+ } | {
419
+ builder: 'semaphor.analysis';
420
+ spec: SemaphorDataAppCodegenAnalysisIntent;
421
+ } | {
422
+ builder: 'semaphor.sql';
423
+ spec: SemaphorDataAppCodegenSqlIntent;
424
+ fallbackReason?: SemaphorDataAppCodegenFallbackReason;
425
+ };
426
+
427
+ declare type SemaphorDataAppCodegenSource = SemaphorSourceRef & {
428
+ sourceKey?: string;
429
+ datasetRole?: string;
430
+ relationshipCount?: number;
431
+ datasetShape?: 'event' | 'daily_snapshot' | 'latest_snapshot' | 'entity_state' | 'dimension' | 'bridge' | 'unknown';
432
+ dateSemantics?: {
433
+ primaryDateField?: SemaphorDataAppCodegenFieldRef;
434
+ primaryDateFieldSource?: 'authored' | 'single_candidate' | 'missing' | 'ambiguous' | 'authored_missing';
435
+ defaultTimeGrain?: SemaphorMetricIntent['timeGrain'];
436
+ defaultTimeWindow?: SemaphorMetricIntent['timeWindow'];
437
+ snapshot?: {
438
+ kind?: 'not_snapshot' | 'daily_snapshot' | 'latest_snapshot';
439
+ selector?: 'not_needed' | 'latest_available';
440
+ selectorSupported?: boolean;
441
+ dateField?: SemaphorDataAppCodegenFieldRef;
442
+ unsupportedReason?: string;
443
+ };
444
+ };
445
+ };
446
+
447
+ declare type SemaphorDataAppCodegenSourceBearingFieldRef = SemaphorDataAppCodegenFieldRef & ({
448
+ sourceKey: string;
449
+ } | {
450
+ source: SemaphorSourceRef;
451
+ });
452
+
453
+ declare type SemaphorDataAppCodegenSourcePresentation = {
454
+ sourceKeys?: string[];
455
+ sourceLabels?: string[];
456
+ };
457
+
458
+ declare type SemaphorDataAppCodegenSqlIntent = Omit<SemaphorSqlIntent, 'kind' | 'fields'> & {
459
+ fields?: SemaphorDataAppCodegenFieldRef[];
460
+ };
461
+
462
+ export declare type SemaphorDataAppCodegenSummary = {
463
+ schemaVersion: SemaphorDataAppCodegenSummarySchemaVersion;
464
+ title: string;
465
+ purpose?: string;
466
+ userGoal?: string;
467
+ nextStep?: string;
468
+ sources: SemaphorDataAppCodegenSource[];
469
+ inputs: SemaphorDataAppCodegenInput[];
470
+ views: SemaphorDataAppCodegenView[];
471
+ filterContracts: SemaphorDataAppFilterContract[];
472
+ implementationChecklist: SemaphorDataAppImplementationChecklist;
473
+ nextRequiredTool?: {
474
+ name: string;
475
+ reason?: string;
476
+ };
477
+ unsupportedInsights?: SemaphorDataAppUnsupportedInsight[];
478
+ assumptions?: string[];
479
+ validation?: {
480
+ status?: 'ready' | 'partial' | 'blocked';
481
+ warnings?: string[];
482
+ };
483
+ };
484
+
485
+ export declare type SemaphorDataAppCodegenSummarySchemaVersion = typeof SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;
486
+
487
+ export declare type SemaphorDataAppCodegenSummaryValidatorVersion = typeof SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;
488
+
489
+ declare type SemaphorDataAppCodegenTableBehavior = {
490
+ tableMode: 'bounded' | 'server_paginated' | 'server_windowed';
491
+ height: {
492
+ maxPx: number;
493
+ scroll: 'vertical' | 'both';
494
+ stickyHeader: boolean;
495
+ };
496
+ pagination: {
497
+ mode: 'none' | 'server' | 'client_for_bounded_rows';
498
+ pageSize?: number;
499
+ readsFrom?: 'result.pagination';
500
+ };
501
+ sorting: {
502
+ mode: 'server' | 'client_for_bounded_rows';
503
+ defaultField?: string;
504
+ defaultDirection?: 'asc' | 'desc';
505
+ resetPageOnChange?: boolean;
506
+ };
507
+ totals: {
508
+ mode: 'none';
509
+ } | SemaphorDataAppCodegenRecordsServerTotalsRequest | {
510
+ mode: 'local';
511
+ label: 'Displayed rows' | 'Current page';
512
+ };
513
+ serverSideRequired: boolean;
514
+ };
515
+
516
+ declare type SemaphorDataAppCodegenView = SemaphorDataAppCodegenExecutableView | SemaphorDataAppCodegenPresentationView;
517
+
518
+ declare type SemaphorDataAppCodegenViewValidation = {
519
+ status?: 'ready' | 'partial' | 'blocked' | 'unsupported';
520
+ evidence?: string[];
521
+ warnings?: string[];
522
+ };
523
+
524
+ declare type SemaphorDataAppCodegenVisualSpec = {
525
+ visualType: 'kpi' | 'line_chart' | 'bar_chart' | 'stacked_bar_chart' | 'pie_chart' | 'donut_chart' | 'area_chart' | 'table' | 'matrix' | 'narrative' | 'text_block' | 'custom';
526
+ title?: string;
527
+ subtitle?: string;
528
+ encoding?: {
529
+ x?: string;
530
+ y?: string;
531
+ color?: string;
532
+ size?: string;
533
+ columns?: string[];
534
+ value?: string;
535
+ };
536
+ text?: {
537
+ body?: string;
538
+ variant?: 'plain' | 'parameterized';
539
+ };
540
+ sort?: {
541
+ field?: string;
542
+ direction?: 'asc' | 'desc';
543
+ execution?: 'server' | 'client_for_bounded_rows';
544
+ };
545
+ limit?: number;
546
+ interactions?: string[];
547
+ states?: string[];
548
+ tableBehavior?: SemaphorDataAppCodegenTableBehavior;
549
+ };
550
+
551
+ export declare type SemaphorDataAppContractUpdatePolicy = {
552
+ kind: string;
553
+ mode: 'invalid_update_preferences' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
554
+ reason: string;
555
+ allowedViewChangeReasons?: string[];
556
+ targetViewIds?: string[];
557
+ };
558
+
559
+ export declare type SemaphorDataAppContractUpdatePolicyInput = {
560
+ beforeSummary?: unknown;
561
+ afterSummary?: unknown;
562
+ migrationReport?: unknown;
563
+ operationIntent?: unknown;
564
+ preferences?: unknown;
565
+ };
566
+
567
+ export declare type SemaphorDataAppContractUpdatePolicyResult = {
568
+ ok: boolean;
569
+ policy: SemaphorDataAppContractUpdatePolicy;
570
+ violations: SemaphorDataAppContractUpdatePolicyViolation[];
571
+ };
572
+
573
+ export declare type SemaphorDataAppContractUpdatePolicyViolation = {
574
+ path: string;
575
+ reason: string;
576
+ };
577
+
578
+ declare type SemaphorDataAppFilterContract = {
579
+ inputId: string;
580
+ label?: string;
581
+ type?: string;
582
+ serverSide?: boolean;
583
+ fieldRef?: SemaphorDataAppCodegenFieldRef;
584
+ optionQuery?: SemaphorDataAppCodegenInputOptionQuery;
585
+ bindings: SemaphorDataAppFilterContractBinding[];
586
+ appliesToViewIds: string[];
587
+ notAppliedToViewIds: string[];
588
+ };
589
+
590
+ declare type SemaphorDataAppFilterContractBinding = {
591
+ viewId: string;
592
+ fieldRef: SemaphorDataAppCodegenFieldRef;
593
+ relationshipHint?: SemaphorRelationshipHint;
594
+ relationshipsUsed?: SemaphorDataAppCodegenRelationshipUse[];
595
+ };
596
+
597
+ declare type SemaphorDataAppFilterScope = {
598
+ inputId?: string;
599
+ label?: string;
600
+ type?: string;
601
+ scope?: 'dashboard' | 'section' | 'card';
602
+ appliesToViewIds?: string[];
603
+ notAppliedToViewIds?: string[];
604
+ cardAffordanceRequired?: boolean;
605
+ };
606
+
607
+ declare type SemaphorDataAppImplementationChecklist = {
608
+ schemaVersion?: string;
609
+ requiredDevtools: {
610
+ mountRootDevtools: boolean;
611
+ providerDebugBridge?: string;
612
+ panelPosition?: string;
613
+ forbidden?: string[];
614
+ };
615
+ requiredInputOptions: SemaphorDataAppRequiredInputOption[];
616
+ filterScopeByInput: SemaphorDataAppFilterScope[];
617
+ bindingsByView: Record<string, SemaphorDataAppChecklistBinding[]>;
618
+ validationCommands: string[];
619
+ browserSmokeChecks: string[];
620
+ };
621
+
622
+ declare type SemaphorDataAppRelationshipCandidate = {
623
+ source: SemaphorDataAppRelationshipCandidateSource;
624
+ sourceFields: SemaphorDataAppRelationshipCandidateField[];
625
+ target: SemaphorDataAppRelationshipCandidateSource;
626
+ targetFields: SemaphorDataAppRelationshipCandidateField[];
627
+ };
628
+
629
+ declare type SemaphorDataAppRelationshipCandidateField = Pick<SemaphorDataAppCodegenFieldRef, 'name' | 'label' | 'role' | 'dataType'>;
630
+
631
+ declare type SemaphorDataAppRelationshipCandidateSource = {
632
+ kind: 'semantic';
633
+ domainId: string;
634
+ datasetName: string;
635
+ datasetId?: string;
636
+ label?: string;
637
+ sourceKey?: string;
638
+ };
639
+
640
+ declare type SemaphorDataAppRequiredInputOption = {
641
+ inputId?: string;
642
+ label?: string;
643
+ builder?: 'semaphor.inputOptions';
644
+ appliesToViewIds?: string[];
645
+ optionSourceKey?: string;
646
+ visibleLabelField?: SemaphorDataAppCodegenFieldRef;
647
+ optionValueField?: SemaphorDataAppCodegenFieldRef;
648
+ runtimeFilterField?: SemaphorDataAppCodegenFieldRef;
649
+ population?: SemaphorInputOptionsIntent['population'];
650
+ dependencies?: SemaphorInputOptionsIntent['dependencies'];
651
+ };
652
+
653
+ declare type SemaphorDataAppUnsupportedInsight = {
654
+ title: string;
655
+ requestedQuestion: string;
656
+ reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'invalid_ranker_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
657
+ suggestedModelingFix: string;
658
+ relationshipCandidate?: SemaphorDataAppRelationshipCandidate;
659
+ nextRepairAction?: {
660
+ tool: 'semaphor_propose_semantic_model_change';
661
+ reason: 'missing_relationship';
662
+ };
663
+ };
664
+
665
+ declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
666
+
667
+ declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
668
+
669
+ declare type SemaphorDerivedFieldComputeStage = 'row' | 'aggregate';
670
+
671
+ declare type SemaphorDerivedFieldDefinition = {
672
+ kind: 'derived_field';
673
+ name: string;
674
+ label: string;
675
+ description?: string;
676
+ resultRole: SemaphorDerivedFieldResultRole;
677
+ dataType: NonNullable<SemaphorFieldRef['dataType']>;
678
+ computeStage: SemaphorDerivedFieldComputeStage;
679
+ expression: string;
680
+ expressionLanguage?: 'semaphor_sql_template';
681
+ inputs: Record<string, SemaphorDerivedFieldInput>;
682
+ defaultAggregate?: SemaphorAggregateFunction;
683
+ aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
684
+ aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
685
+ format?: SemaphorValueFormat;
686
+ tags?: string[];
687
+ };
688
+
689
+ declare type SemaphorDerivedFieldInput = {
690
+ kind: 'field';
691
+ field: SemaphorFieldRef;
692
+ aggregate?: SemaphorAggregateFunction;
693
+ };
694
+
695
+ declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
696
+
697
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
698
+
699
+ /**
700
+ * Explorer-backed table source. This is intentionally distinct from raw SQL:
701
+ * matrix planning needs stable source metadata, fields, and dialect context.
702
+ */
703
+ declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
704
+ kind: 'physical';
705
+ }>;
706
+
707
+ declare type SemaphorFieldRef = {
708
+ name: string;
709
+ label?: string;
710
+ role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
711
+ dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
712
+ source?: SemaphorSourceRef;
713
+ aggregate?: SemaphorAggregateFunction;
714
+ };
715
+
716
+ export declare type SemaphorGeneratedContractFileName = (typeof REQUIRED_GENERATED_CONTRACT_FILES)[number];
717
+
718
+ export declare type SemaphorGeneratedContractFiles = Record<SemaphorGeneratedContractFileName, string>;
719
+
720
+ export declare type SemaphorGeneratedContractTypescriptFileName = (typeof GENERATED_CONTRACT_TYPESCRIPT_FILES)[number];
721
+
722
+ export declare type SemaphorGeneratedContractValidationInput = {
723
+ manifest: unknown;
724
+ generatedFiles?: Record<string, string>;
725
+ };
726
+
727
+ export declare type SemaphorGeneratedContractValidationIssue = {
728
+ path?: string;
729
+ message: string;
730
+ repairHint?: string;
731
+ };
732
+
733
+ export declare type SemaphorGeneratedContractValidationResult = {
734
+ issues: SemaphorGeneratedContractValidationIssue[];
735
+ };
736
+
737
+ declare type SemaphorGeneratedQueryResultShape = 'metric' | 'records' | 'analysis' | 'matrix' | 'sql' | 'inputOptions';
738
+
739
+ export declare type SemaphorGeneratedViewExecutionRequest = {
740
+ viewId: string;
741
+ intent: SemaphorAnalyticsIntent;
742
+ resultShape: SemaphorGeneratedQueryResultShape;
743
+ analysisOptions?: SemaphorAnalysisQueryOptions;
744
+ };
745
+
746
+ export declare type SemaphorGeneratedViewExecutionRequestIssue = {
747
+ viewId?: string;
748
+ path?: string;
749
+ message: string;
750
+ };
751
+
752
+ export declare type SemaphorGeneratedViewExecutionRequestsResult = {
753
+ requests: SemaphorGeneratedViewExecutionRequest[];
754
+ issues: SemaphorGeneratedViewExecutionRequestIssue[];
755
+ };
756
+
757
+ declare type SemaphorInputBinding = {
758
+ inputId: string;
759
+ kind?: 'filter' | 'control';
760
+ controlRole?: 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
761
+ operator?: SemaphorInputOperator;
762
+ field?: SemaphorFieldRef;
763
+ relationshipHint?: SemaphorRelationshipHint;
764
+ };
765
+
766
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
767
+
768
+ declare type SemaphorInputOptionsIntent = {
769
+ kind: 'inputOptions';
770
+ version?: SemaphorProtocolVersion;
771
+ id?: string;
772
+ label?: string;
773
+ inputId: string;
774
+ source: SemaphorSourceRef;
775
+ labelField: SemaphorFieldRef;
776
+ valueField: SemaphorFieldRef;
777
+ searchField?: SemaphorFieldRef;
778
+ disambiguationFields?: SemaphorFieldRef[];
779
+ population?: SemaphorOptionPopulation;
780
+ dependencies?: SemaphorOptionDependencies;
781
+ search?: string;
782
+ limit?: number;
783
+ inputs?: SemaphorInputBinding[];
784
+ derivedFields?: SemaphorDerivedFieldDefinition[];
785
+ };
786
+
787
+ declare type SemaphorInputValue = SemaphorScalar | SemaphorScalar[];
788
+
789
+ declare type SemaphorMatrixAxisExpansionOptions = {
790
+ defaultDepth?: number;
791
+ lazy?: boolean;
792
+ expandedPaths?: SemaphorMatrixMemberPathSegment[][];
793
+ };
794
+
795
+ declare type SemaphorMatrixAxisLevel = {
796
+ id?: string;
797
+ field: SemaphorFieldRef;
798
+ grain?: SemaphorTimeGrain;
799
+ label?: string;
800
+ subtotal?: boolean | SemaphorMatrixSubtotalOptions;
801
+ sortBy?: SemaphorMatrixAxisSortRule;
802
+ };
803
+
804
+ declare type SemaphorMatrixAxisSortRule = {
805
+ direction: 'asc' | 'desc';
806
+ by: {
807
+ kind: 'label';
808
+ } | {
809
+ kind: 'field';
810
+ field: SemaphorFieldRef;
811
+ aggregate?: SemaphorAggregateFunction;
812
+ };
813
+ nulls?: 'warehouseDefault' | 'first' | 'last';
814
+ scope?: 'global' | 'withinParent';
815
+ };
816
+
817
+ declare type SemaphorMatrixDisplayLimitOptions = {
818
+ rows?: SemaphorMatrixDisplayLimitRule;
819
+ columns?: SemaphorMatrixDisplayLimitRule;
820
+ };
821
+
822
+ declare type SemaphorMatrixDisplayLimitRule = {
823
+ limit: number;
824
+ by?: 'label' | 'value';
825
+ direction?: 'top' | 'bottom';
826
+ others?: boolean | {
827
+ label?: string;
828
+ };
829
+ };
830
+
831
+ declare type SemaphorMatrixExpansionOptions = {
832
+ rows?: SemaphorMatrixAxisExpansionOptions;
833
+ columns?: SemaphorMatrixAxisExpansionOptions;
834
+ };
835
+
836
+ declare type SemaphorMatrixIntent = {
837
+ kind: 'matrix';
838
+ version?: SemaphorProtocolVersion;
839
+ id?: string;
840
+ label?: string;
841
+ source: SemaphorMatrixSourceRef;
842
+ rows: SemaphorMatrixAxisLevel[];
843
+ columns?: SemaphorMatrixAxisLevel[];
844
+ values: SemaphorMatrixValueField[];
845
+ filters?: SemaphorAnalyticsFilter[];
846
+ inputs?: SemaphorInputBinding[];
847
+ relationshipHint?: SemaphorRelationshipHint;
848
+ totals?: SemaphorMatrixTotalOptions;
849
+ sort?: SemaphorMatrixSortRule[];
850
+ expansion?: SemaphorMatrixExpansionOptions;
851
+ layout?: SemaphorMatrixLayoutOptions;
852
+ displayLimits?: SemaphorMatrixDisplayLimitOptions;
853
+ };
854
+
855
+ declare type SemaphorMatrixLayoutOptions = {
856
+ hierarchy?: 'compact' | 'tabular' | 'outline';
857
+ valuesPlacement?: 'columns' | 'rows';
858
+ stickyRowHeaders?: boolean;
859
+ stickyColumnHeaders?: boolean;
860
+ };
861
+
862
+ declare type SemaphorMatrixMemberPathSegment = {
863
+ levelId: string;
864
+ value: unknown;
865
+ };
866
+
867
+ declare type SemaphorMatrixSortRule = {
868
+ axis: 'row' | 'column';
869
+ targetId?: string;
870
+ direction: 'asc' | 'desc';
871
+ by: {
872
+ kind: 'label';
873
+ } | {
874
+ kind: 'field';
875
+ field: SemaphorFieldRef;
876
+ aggregate?: SemaphorAggregateFunction;
877
+ } | {
878
+ kind: 'value';
879
+ valueId: string;
880
+ rowPath?: SemaphorMatrixMemberPathSegment[];
881
+ columnPath?: SemaphorMatrixMemberPathSegment[];
882
+ };
883
+ nulls?: 'warehouseDefault' | 'first' | 'last';
884
+ scope?: 'global' | 'withinParent';
885
+ };
886
+
887
+ declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
888
+
889
+ declare type SemaphorMatrixSubtotalOptions = {
890
+ enabled?: boolean;
891
+ position?: 'before' | 'after';
892
+ label?: string;
893
+ };
894
+
895
+ declare type SemaphorMatrixTotalCalculation = {
896
+ kind: 'defaultAggregate';
897
+ } | {
898
+ kind: 'blank';
899
+ } | {
900
+ kind: 'labelOnly';
901
+ label?: string;
902
+ } | {
903
+ kind: 'customAggregate';
904
+ aggregate: SemaphorAggregateFunction;
905
+ } | {
906
+ kind: 'percentOfParent';
907
+ } | {
908
+ kind: 'percentOfGrandTotal';
909
+ } | {
910
+ kind: 'customExpression';
911
+ expressionId: string;
912
+ };
913
+
914
+ declare type SemaphorMatrixTotalOptions = {
915
+ rows?: boolean | 'perLevel';
916
+ columns?: boolean | 'perLevel';
917
+ grandTotal?: boolean | {
918
+ rows?: boolean;
919
+ columns?: boolean;
920
+ };
921
+ rowPosition?: 'top' | 'bottom';
922
+ columnPosition?: 'left' | 'right';
923
+ };
924
+
925
+ declare type SemaphorMatrixValueField = {
926
+ id?: string;
927
+ field: SemaphorFieldRef;
928
+ aggregate?: SemaphorAggregateFunction;
929
+ label?: string;
930
+ format?: SemaphorValueFormat;
931
+ totalBehavior?: SemaphorMatrixTotalCalculation;
932
+ };
933
+
934
+ declare type SemaphorMetricAnalysis = {
935
+ kind: 'period_change';
936
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
937
+ direction?: 'increase' | 'decrease' | 'both';
938
+ timeWindow?: SemaphorTimeWindow;
939
+ };
940
+
941
+ declare type SemaphorMetricIntent = {
942
+ kind: 'metric';
943
+ version?: SemaphorProtocolVersion;
944
+ id?: string;
945
+ source: SemaphorSourceRef;
946
+ measures: SemaphorFieldRef[];
947
+ primaryMeasure?: SemaphorFieldRef;
948
+ label?: string;
949
+ dateField?: SemaphorFieldRef;
950
+ timeGrain?: SemaphorTimeGrain;
951
+ timeWindow?: SemaphorTimeWindow;
952
+ dimensions?: SemaphorFieldRef[];
953
+ filters?: SemaphorAnalyticsFilter[];
954
+ comparison?: {
955
+ kind: 'previous_period' | 'previous_year' | 'target';
956
+ targetValue?: number;
957
+ };
958
+ analysis?: SemaphorMetricAnalysis;
959
+ orderBy?: {
960
+ field: SemaphorFieldRef;
961
+ direction: 'asc' | 'desc';
962
+ };
963
+ inputs?: SemaphorInputBinding[];
964
+ relationshipHint?: SemaphorRelationshipHint;
965
+ limit?: number;
966
+ derivedFields?: SemaphorDerivedFieldDefinition[];
967
+ };
968
+
969
+ declare type SemaphorOptionDependencies = {
970
+ mode?: 'auto' | 'independent' | 'explicit';
971
+ includeInputIds?: string[];
972
+ excludeInputIds?: string[];
973
+ };
974
+
975
+ declare type SemaphorOptionPopulation = {
976
+ kind: 'option_source';
977
+ baseSource?: never;
978
+ } | {
979
+ kind: 'related_population';
980
+ baseSource: SemaphorSourceRef;
981
+ relationshipHint?: SemaphorRelationshipHint;
982
+ };
983
+
984
+ declare type SemaphorPaginationRequest = {
985
+ page: number;
986
+ pageSize: number;
987
+ };
988
+
989
+ declare type SemaphorProtocolVersion = 1;
990
+
991
+ declare type SemaphorRecordsIntent = {
992
+ kind: 'records';
993
+ version?: SemaphorProtocolVersion;
994
+ source: SemaphorSourceRef;
995
+ id?: string;
996
+ label?: string;
997
+ fields: SemaphorFieldRef[];
998
+ dateField?: SemaphorFieldRef;
999
+ timeGrain?: SemaphorTimeGrain;
1000
+ timeWindow?: SemaphorTimeWindow;
1001
+ filters?: SemaphorAnalyticsFilter[];
1002
+ limit?: number;
1003
+ pagination?: SemaphorPaginationRequest;
1004
+ orderBy?: {
1005
+ field: SemaphorFieldRef;
1006
+ direction: 'asc' | 'desc';
1007
+ };
1008
+ inputs?: SemaphorInputBinding[];
1009
+ relationshipHint?: SemaphorRelationshipHint;
1010
+ derivedFields?: SemaphorDerivedFieldDefinition[];
1011
+ totals?: SemaphorRecordsServerTotalsRequest;
1012
+ };
1013
+
1014
+ declare type SemaphorRecordsServerTotalsRequest = {
1015
+ mode: 'server';
1016
+ measures: SemaphorFieldRef[];
1017
+ };
1018
+
1019
+ declare type SemaphorRelationshipHint = {
1020
+ relationshipIds?: string[];
1021
+ };
1022
+
1023
+ declare type SemaphorRelativeTimeWindow = {
1024
+ kind?: 'relative';
1025
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1026
+ value: number;
1027
+ anchor?: 'now' | 'latest_available';
1028
+ completeness?: 'include_partial' | 'complete_periods';
1029
+ };
1030
+
1031
+ declare type SemaphorScalar = string | number | boolean | null;
1032
+
1033
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
1034
+ kind: 'semantic';
1035
+ }>;
1036
+
1037
+ declare type SemaphorSourceRef = {
1038
+ kind: 'semantic';
1039
+ domainId: string;
1040
+ datasetName: string;
1041
+ datasetId?: string;
1042
+ label?: string;
1043
+ connectionId?: string;
1044
+ } | {
1045
+ kind: 'physical';
1046
+ connectionId: string;
1047
+ connectionType?: string;
1048
+ tableName: string;
1049
+ databaseName?: string;
1050
+ schemaName?: string;
1051
+ label?: string;
1052
+ dialect?: SemaphorDialect;
1053
+ } | {
1054
+ kind: 'sql';
1055
+ connectionId: string;
1056
+ dialect?: SemaphorDialect;
1057
+ label?: string;
1058
+ };
1059
+
1060
+ declare type SemaphorSqlIntent = {
1061
+ kind: 'sql';
1062
+ version?: SemaphorProtocolVersion;
1063
+ id?: string;
1064
+ label?: string;
1065
+ source: Extract<SemaphorSourceRef, {
1066
+ kind: 'sql';
1067
+ }>;
1068
+ sql: string;
1069
+ defaultParameters?: Record<string, unknown>;
1070
+ pythonCode?: string;
1071
+ limit?: number;
1072
+ pagination?: SemaphorPaginationRequest;
1073
+ rationale?: string;
1074
+ fields?: SemaphorFieldRef[];
1075
+ inputs?: SemaphorInputBinding[];
1076
+ };
1077
+
1078
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1079
+
1080
+ declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
1081
+
1082
+ declare type SemaphorValueFormat = {
1083
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1084
+ locale?: string;
1085
+ minimumFractionDigits?: number;
1086
+ maximumFractionDigits?: number;
1087
+ useGrouping?: boolean;
1088
+ prefix?: string;
1089
+ suffix?: string;
1090
+ negativeStyle?: 'minus' | 'parentheses';
1091
+ compact?: boolean;
1092
+ scale?: number;
1093
+ currency?: string;
1094
+ percentValueMode?: 'fraction' | 'whole';
1095
+ } | {
1096
+ type: 'date' | 'datetime';
1097
+ locale?: string;
1098
+ pattern?: string;
1099
+ relative?: boolean;
1100
+ timezone?: string;
1101
+ sourceTimezone?: string;
1102
+ prefix?: string;
1103
+ suffix?: string;
1104
+ } | {
1105
+ type: 'duration';
1106
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1107
+ outputStyle?: 'compact' | 'digital' | 'long';
1108
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1109
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1110
+ maxUnits?: number;
1111
+ prefix?: string;
1112
+ suffix?: string;
1113
+ negativeStyle?: 'minus' | 'parentheses';
1114
+ } | {
1115
+ type: 'string';
1116
+ prefix?: string;
1117
+ suffix?: string;
1118
+ };
1119
+
1120
+ export declare function validateCodegenSummary(value: unknown): string[];
1121
+
1122
+ export declare function validateSemaphorDataAppCodegenSummary(value: unknown): {
1123
+ ok: boolean;
1124
+ issues: string[];
1125
+ };
1126
+
1127
+ export declare function validateSemaphorGeneratedContract({ manifest, generatedFiles, }: SemaphorGeneratedContractValidationInput): Promise<SemaphorGeneratedContractValidationResult>;
1128
+
1129
+ /**
1130
+ * Week start day type.
1131
+ * 0 = Sunday (US, Canada, Japan)
1132
+ * 1 = Monday (ISO standard, most of Europe)
1133
+ * 6 = Saturday (Middle East)
1134
+ */
1135
+ declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
1136
+
1137
+ export { }