react-semaphor 0.1.368 → 0.1.370
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.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/brand-studio/index.cjs +5 -5
- package/dist/brand-studio/index.js +24 -23
- package/dist/chunks/{braces-Cc86y9Ov.js → braces-C3-w6xDL.js} +1 -1
- package/dist/chunks/{braces-CXvY9MwQ.js → braces-C8QqW4wu.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-BOFlzOJg.js → calendar-preferences-dialog-6q51A6XC.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-ZzwfJv2J.js → calendar-preferences-dialog-CUGzkNcE.js} +1 -1
- package/dist/chunks/{chevrons-up-down-CUZL1zaU.js → chevrons-up-down-CnCSGY02.js} +1 -1
- package/dist/chunks/{chevrons-up-down-qQMadOWA.js → chevrons-up-down-DSvLu4Ye.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-9-PCYMjR.js → dashboard-briefing-launcher-BEZnvIla.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-D2lBFqAd.js → dashboard-briefing-launcher-ptERmNJr.js} +176 -177
- package/dist/chunks/{dashboard-controls-D4bUHAjX.js → dashboard-controls-CGt6_hMf.js} +11 -11
- package/dist/chunks/{dashboard-controls-BIk094Ah.js → dashboard-controls-CqKC5oEk.js} +77 -77
- package/dist/chunks/{dashboard-json-DImOf512.js → dashboard-json-6SgPm_QW.js} +13 -14
- package/dist/chunks/dashboard-json-CYSbOdmE.js +1 -0
- package/dist/chunks/{edit-dashboard-visual-DTxkV6Fl.js → edit-dashboard-visual-ByQx_M2i.js} +8 -9
- package/dist/chunks/{edit-dashboard-visual-BHKlcqQR.js → edit-dashboard-visual-w6hKbjlw.js} +1 -1
- package/dist/chunks/index-BtqYNH_S.js +1361 -0
- package/dist/chunks/{index-BVEIk-rB.js → index-CPyEi9gS.js} +72498 -76193
- package/dist/chunks/{palette-DPuAc82h.js → palette-D-f4-82S.js} +1 -1
- package/dist/chunks/{palette-C1k347Tb.js → palette-DUGktM-M.js} +1 -1
- package/dist/chunks/{resource-management-panel-BeHceP2D.js → resource-management-panel-Bf8-3eUf.js} +1 -1
- package/dist/chunks/{resource-management-panel-BOfbSf48.js → resource-management-panel-mJ84NxzC.js} +152 -152
- package/dist/chunks/save-D3YYinDz.js +6 -0
- package/dist/chunks/save-kkBEBeLg.js +21 -0
- package/dist/chunks/{switch-xcWLtWs0.js → switch-Dkx2qEOr.js} +758 -776
- package/dist/chunks/{switch-C0S63HAv.js → switch-fIkmwzUt.js} +27 -32
- package/dist/chunks/{use-create-flow-overlay-state-B5FygfQL.js → use-create-flow-overlay-state-BfoXDDrd.js} +190 -189
- package/dist/chunks/use-create-flow-overlay-state-c6rCm36x.js +26 -0
- package/dist/chunks/{use-visual-utils-DxDE8S8M.js → use-visual-utils-C_c-aiqi.js} +1 -1
- package/dist/chunks/{use-visual-utils-CszWnFBW.js → use-visual-utils-NN0e3fBP.js} +13 -13
- package/dist/chunks/validation-DYL3ArlL.js +1 -0
- package/dist/chunks/validation-PPSpYtVf.js +900 -0
- package/dist/chunks/validators-CgxWT8UX.js +1 -0
- package/dist/chunks/validators-DBNa-eb1.js +1799 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-builder/index.cjs +51 -1
- package/dist/data-app-builder/index.js +3666 -2
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +661 -389
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +472 -3
- package/dist/types/dashboard-assistant.d.ts +469 -3
- package/dist/types/dashboard-authoring.d.ts +170 -2
- package/dist/types/data-app-builder.d.ts +167 -2
- package/dist/types/data-app-sdk-validation.d.ts +576 -25
- package/dist/types/data-app-sdk.d.ts +655 -37
- package/dist/types/main.d.ts +167 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-json-Bo1kX6W1.js +0 -1
- package/dist/chunks/index-HjDeEytV.js +0 -1411
- package/dist/chunks/use-create-flow-overlay-state-DOXTbTcQ.js +0 -26
- package/dist/chunks/validation-CrUjNWby.js +0 -689
- package/dist/chunks/validation-DGl8wnTt.js +0 -1
- package/dist/chunks/validators-Dq5X4mp0.js +0 -1
- package/dist/chunks/validators-L0xEXtjf.js +0 -965
|
@@ -33,8 +33,295 @@ declare type CalendarContext = {
|
|
|
33
33
|
|
|
34
34
|
export declare function createSemaphorQueryExecutor(): SemaphorQueryExecutor;
|
|
35
35
|
|
|
36
|
+
export declare function defineSemaphorDataApp<TDefinition extends SemaphorDataAppDefinition>(definition: TDefinition): TDefinition;
|
|
37
|
+
|
|
38
|
+
export declare function defineSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputSpec<TValue>;
|
|
39
|
+
|
|
36
40
|
export declare function hasSemaphorInputValue(value: unknown): boolean;
|
|
37
41
|
|
|
42
|
+
declare type MatrixAxisLevelDescriptor = {
|
|
43
|
+
instanceId: string;
|
|
44
|
+
fieldKey: string;
|
|
45
|
+
label: string;
|
|
46
|
+
field: SemaphorFieldRef;
|
|
47
|
+
grain?: SemaphorTimeGrain;
|
|
48
|
+
subtotal?: SemaphorMatrixSubtotalOptions;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare type MatrixAxisPayload = {
|
|
52
|
+
id: 'rows' | 'columns';
|
|
53
|
+
levels: MatrixAxisLevelDescriptor[];
|
|
54
|
+
nodes: MatrixNode[];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare type MatrixCapability = 'rowHierarchy' | 'columnHierarchy' | 'rowSubtotals' | 'columnSubtotals' | 'grandTotals' | 'lazyRows' | 'lazyColumns' | 'conditionalFormatting' | 'visualExport' | (string & {});
|
|
58
|
+
|
|
59
|
+
declare type MatrixCell = {
|
|
60
|
+
id: string;
|
|
61
|
+
rowNodeId: string;
|
|
62
|
+
columnNodeId?: string;
|
|
63
|
+
measureInstanceId: string;
|
|
64
|
+
rowPath: MatrixMemberPathSegment[];
|
|
65
|
+
columnPath: MatrixMemberPathSegment[];
|
|
66
|
+
rawValue: unknown;
|
|
67
|
+
presence: MatrixCellPresence;
|
|
68
|
+
formattedValue?: string;
|
|
69
|
+
role: MatrixCellRole;
|
|
70
|
+
aggregateFunction?: SemaphorAggregateFunction;
|
|
71
|
+
formattingScope: MatrixCellFormattingScope;
|
|
72
|
+
actions?: MatrixCellAction[];
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
declare type MatrixCellAction = {
|
|
76
|
+
kind: 'requestSubgoal' | 'filter' | 'copyValue' | 'explainCalculation' | 'inspectContributingRows' | 'drillThrough' | (string & {});
|
|
77
|
+
label?: string;
|
|
78
|
+
payload?: Record<string, unknown>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare type MatrixCellFormattingScope = {
|
|
82
|
+
rowNodeId: string;
|
|
83
|
+
columnNodeId?: string;
|
|
84
|
+
measureInstanceId: string;
|
|
85
|
+
role: MatrixCellRole;
|
|
86
|
+
rowPath: MatrixMemberPathSegment[];
|
|
87
|
+
columnPath: MatrixMemberPathSegment[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
declare type MatrixCellPresence = 'present' | 'presentNull' | 'missing' | 'densified';
|
|
91
|
+
|
|
92
|
+
declare type MatrixCellRole = 'value' | 'rowSubtotal' | 'columnSubtotal' | 'subtotalIntersection' | 'rowGrandTotal' | 'columnGrandTotal' | 'matrixGrandTotal';
|
|
93
|
+
|
|
94
|
+
declare type MatrixExecutionMetadata = {
|
|
95
|
+
strategy?: MatrixQueryStrategy;
|
|
96
|
+
dialect?: SemaphorDialect;
|
|
97
|
+
rowNodeCount?: number;
|
|
98
|
+
columnNodeCount?: number;
|
|
99
|
+
cellCount?: number;
|
|
100
|
+
groupingSetCount?: number;
|
|
101
|
+
queryDurationMs?: number;
|
|
102
|
+
budgetRejected?: boolean;
|
|
103
|
+
cacheStatus?: 'hit' | 'miss' | 'bypass';
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare type MatrixExpansionRequest = {
|
|
108
|
+
axis: 'row' | 'column';
|
|
109
|
+
path: MatrixMemberPathSegment[];
|
|
110
|
+
depth?: number;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export declare type MatrixExpansionResponseHints = {
|
|
114
|
+
rowLazyLoading?: boolean;
|
|
115
|
+
columnLazyLoading?: boolean;
|
|
116
|
+
expandableRowNodeIds?: string[];
|
|
117
|
+
expandableColumnNodeIds?: string[];
|
|
118
|
+
nextRequests?: MatrixExpansionRequest[];
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
declare type MatrixFieldDescriptor = {
|
|
122
|
+
instanceId: string;
|
|
123
|
+
fieldKey: string;
|
|
124
|
+
field: SemaphorFieldRef;
|
|
125
|
+
role: 'row' | 'column' | 'measure' | 'sort' | 'filter';
|
|
126
|
+
label?: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
declare type MatrixFieldDirectory = {
|
|
130
|
+
fieldsByInstanceId: Record<string, MatrixFieldDescriptor>;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
declare type MatrixFormattingContext = {
|
|
134
|
+
domains?: Record<string, {
|
|
135
|
+
min?: number;
|
|
136
|
+
max?: number;
|
|
137
|
+
}>;
|
|
138
|
+
rules?: Array<Record<string, unknown>>;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
declare type MatrixGridCell = {
|
|
142
|
+
id: string;
|
|
143
|
+
columnId: string;
|
|
144
|
+
cellId?: string;
|
|
145
|
+
rawValue: unknown;
|
|
146
|
+
formattedValue?: string;
|
|
147
|
+
presence: MatrixCellPresence;
|
|
148
|
+
role: MatrixCellRole;
|
|
149
|
+
measureInstanceId: string;
|
|
150
|
+
rowPath: MatrixMemberPathSegment[];
|
|
151
|
+
columnPath: MatrixMemberPathSegment[];
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
declare type MatrixGridColumn = {
|
|
155
|
+
id: string;
|
|
156
|
+
label: string;
|
|
157
|
+
columnNodeId?: string;
|
|
158
|
+
columnPath: MatrixMemberPathSegment[];
|
|
159
|
+
measureInstanceId: string;
|
|
160
|
+
role: 'value' | 'columnSubtotal' | 'columnGrandTotal';
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
declare type MatrixGridHeaderCell = {
|
|
164
|
+
id: string;
|
|
165
|
+
label: string;
|
|
166
|
+
role: 'rowHeader' | 'columnHeader' | 'measureHeader' | 'subtotal' | 'grandTotal';
|
|
167
|
+
colSpan: number;
|
|
168
|
+
rowSpan: number;
|
|
169
|
+
columnPath: MatrixMemberPathSegment[];
|
|
170
|
+
measureInstanceId?: string;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
declare type MatrixGridHeaderRow = {
|
|
174
|
+
id: string;
|
|
175
|
+
cells: MatrixGridHeaderCell[];
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export declare type MatrixGridProjection = {
|
|
179
|
+
schemaVersion: 1;
|
|
180
|
+
shape: MatrixShape;
|
|
181
|
+
rowHeaderLevels: MatrixGridRowHeaderLevel[];
|
|
182
|
+
columnHeaderRows: MatrixGridHeaderRow[];
|
|
183
|
+
columns: MatrixGridColumn[];
|
|
184
|
+
rows: MatrixGridRow[];
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
declare type MatrixGridRow = {
|
|
188
|
+
id: string;
|
|
189
|
+
rowNodeId: string;
|
|
190
|
+
rowPath: MatrixMemberPathSegment[];
|
|
191
|
+
depth: number;
|
|
192
|
+
label: string;
|
|
193
|
+
role: 'value' | 'rowSubtotal' | 'rowGrandTotal';
|
|
194
|
+
isExpanded?: boolean;
|
|
195
|
+
hasChildren?: boolean;
|
|
196
|
+
cells: MatrixGridCell[];
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
declare type MatrixGridRowHeaderLevel = {
|
|
200
|
+
id: string;
|
|
201
|
+
label: string;
|
|
202
|
+
fieldInstanceId: string;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
declare type MatrixMeasureDescriptor = {
|
|
206
|
+
instanceId: string;
|
|
207
|
+
fieldKey: string;
|
|
208
|
+
label: string;
|
|
209
|
+
field: SemaphorFieldRef;
|
|
210
|
+
aggregate?: SemaphorAggregateFunction;
|
|
211
|
+
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
declare type MatrixMeasureSemantics = {
|
|
215
|
+
kind: 'additive';
|
|
216
|
+
aggregate?: SemaphorAggregateFunction;
|
|
217
|
+
} | {
|
|
218
|
+
kind: 'semiAdditive';
|
|
219
|
+
aggregate?: SemaphorAggregateFunction;
|
|
220
|
+
grain?: SemaphorTimeGrain;
|
|
221
|
+
} | {
|
|
222
|
+
kind: 'nonAdditive';
|
|
223
|
+
aggregate?: SemaphorAggregateFunction;
|
|
224
|
+
} | {
|
|
225
|
+
kind: 'ratio';
|
|
226
|
+
numeratorMeasureInstanceId?: string;
|
|
227
|
+
denominatorMeasureInstanceId?: string;
|
|
228
|
+
} | {
|
|
229
|
+
kind: 'custom';
|
|
230
|
+
expressionId?: string;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
declare type MatrixMemberPathSegment = {
|
|
234
|
+
instanceId: string;
|
|
235
|
+
fieldKey: string;
|
|
236
|
+
value: unknown;
|
|
237
|
+
label: string;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
declare type MatrixNode = {
|
|
241
|
+
id: string;
|
|
242
|
+
axis: 'row' | 'column';
|
|
243
|
+
path: MatrixMemberPathSegment[];
|
|
244
|
+
level: number;
|
|
245
|
+
label: string;
|
|
246
|
+
value: unknown;
|
|
247
|
+
parentId?: string;
|
|
248
|
+
hasChildren: boolean;
|
|
249
|
+
isExpanded?: boolean;
|
|
250
|
+
isSubtotal?: boolean;
|
|
251
|
+
isGrandTotal?: boolean;
|
|
252
|
+
subtotalFunction?: SemaphorAggregateFunction;
|
|
253
|
+
childCount?: number;
|
|
254
|
+
actions?: MatrixNodeAction[];
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
declare type MatrixNodeAction = {
|
|
258
|
+
kind: 'expand' | 'collapse' | 'requestSubgoal' | 'filter' | 'drillThrough' | 'openRelatedRecords' | (string & {});
|
|
259
|
+
label?: string;
|
|
260
|
+
payload?: Record<string, unknown>;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
declare type MatrixPageInfo = {
|
|
264
|
+
rowOffset?: number;
|
|
265
|
+
rowLimit?: number;
|
|
266
|
+
columnOffset?: number;
|
|
267
|
+
columnLimit?: number;
|
|
268
|
+
hasMoreRows?: boolean;
|
|
269
|
+
hasMoreColumns?: boolean;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export declare type MatrixPayload = {
|
|
273
|
+
kind: 'matrixPayload';
|
|
274
|
+
schemaVersion: 1;
|
|
275
|
+
shape: MatrixShape;
|
|
276
|
+
capabilities: MatrixCapability[];
|
|
277
|
+
executionMetadata: MatrixExecutionMetadata;
|
|
278
|
+
axes: {
|
|
279
|
+
rows: MatrixAxisPayload;
|
|
280
|
+
columns: MatrixAxisPayload;
|
|
281
|
+
};
|
|
282
|
+
measures: MatrixMeasureDescriptor[];
|
|
283
|
+
measureSemantics: Record<string, MatrixMeasureSemantics>;
|
|
284
|
+
fieldDirectory: MatrixFieldDirectory;
|
|
285
|
+
rowNodes: MatrixNode[];
|
|
286
|
+
columnNodes: MatrixNode[];
|
|
287
|
+
cells: MatrixCell[];
|
|
288
|
+
totals: MatrixTotals;
|
|
289
|
+
sort: MatrixResolvedSort[];
|
|
290
|
+
formattingContext: MatrixFormattingContext;
|
|
291
|
+
pageInfo?: MatrixPageInfo;
|
|
292
|
+
warnings?: MatrixWarning[];
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
declare type MatrixQueryStrategy = 'tall' | 'wide' | 'lazy' | 'export';
|
|
296
|
+
|
|
297
|
+
declare type MatrixResolvedSort = {
|
|
298
|
+
id: string;
|
|
299
|
+
axis: 'row' | 'column';
|
|
300
|
+
targetInstanceId?: string;
|
|
301
|
+
direction: 'asc' | 'desc';
|
|
302
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
303
|
+
scope?: 'global' | 'withinParent';
|
|
304
|
+
by: SemaphorMatrixSortRule['by'];
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
declare type MatrixShape = 'hierarchical' | 'pivot';
|
|
308
|
+
|
|
309
|
+
declare type MatrixTotals = {
|
|
310
|
+
rows?: boolean;
|
|
311
|
+
columns?: boolean;
|
|
312
|
+
grandTotal?: boolean | {
|
|
313
|
+
rows?: boolean;
|
|
314
|
+
columns?: boolean;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
declare type MatrixWarning = {
|
|
319
|
+
code: string;
|
|
320
|
+
message: string;
|
|
321
|
+
path?: string;
|
|
322
|
+
severity?: 'info' | 'warning' | 'error';
|
|
323
|
+
};
|
|
324
|
+
|
|
38
325
|
export declare function normalizeSemaphorAnalysisPayload(payload: SemaphorAnalysisPayload | undefined | null): SemaphorAnalysisPayload;
|
|
39
326
|
|
|
40
327
|
export declare function normalizeSemaphorAnalysisQueryOptions(value: unknown, options?: {
|
|
@@ -52,6 +339,18 @@ export declare function normalizeSemaphorInputOptions(options?: Array<{
|
|
|
52
339
|
|
|
53
340
|
export declare function readWindowRuntime(): SemaphorDataAppWindowRuntime | undefined;
|
|
54
341
|
|
|
342
|
+
export declare const semaphor: {
|
|
343
|
+
filter<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: Omit<SemaphorFilterInputSpec<TValue>, "kind">): SemaphorFilterInputSpec<TValue>;
|
|
344
|
+
control<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorControlBuilderSpec<TValue>): SemaphorControlInputSpec<TValue>;
|
|
345
|
+
sqlParam<TValue extends SemaphorSqlParameterValue = SemaphorSqlParameterValue>(spec: SemaphorSqlParamInputSpec<TValue>): SemaphorControlInputSpec<TValue>;
|
|
346
|
+
metric(spec: SemaphorMetricQuerySpec): SemaphorMetricQueryDefinition;
|
|
347
|
+
analysis(spec: SemaphorAnalysisQuerySpec): SemaphorAnalysisQueryDefinition;
|
|
348
|
+
records(spec: SemaphorRecordsQuerySpec): SemaphorRecordsQueryDefinition;
|
|
349
|
+
inputOptions(spec: SemaphorInputOptionsQuerySpec): SemaphorInputOptionsQueryDefinition;
|
|
350
|
+
sql(spec: SemaphorSqlQuerySpec): SemaphorSqlQueryDefinition;
|
|
351
|
+
matrix(spec: SemaphorMatrixQuerySpec): SemaphorMatrixQueryDefinition;
|
|
352
|
+
};
|
|
353
|
+
|
|
55
354
|
declare type SemaphorAbsoluteTimeWindow = {
|
|
56
355
|
kind: 'absolute';
|
|
57
356
|
start: string;
|
|
@@ -94,6 +393,10 @@ export declare type SemaphorAnalysisPayload = {
|
|
|
94
393
|
[key: string]: unknown;
|
|
95
394
|
};
|
|
96
395
|
|
|
396
|
+
export declare type SemaphorAnalysisQueryDefinition = SemaphorAnalysisQuerySpec & {
|
|
397
|
+
queryKind: 'analysis';
|
|
398
|
+
};
|
|
399
|
+
|
|
97
400
|
export declare type SemaphorAnalysisQueryOptions = {
|
|
98
401
|
chartTitle?: string;
|
|
99
402
|
chartType?: string;
|
|
@@ -178,7 +481,7 @@ declare type SemaphorAnalyticsFilterBase = {
|
|
|
178
481
|
|
|
179
482
|
declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
|
|
180
483
|
|
|
181
|
-
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
484
|
+
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent | SemaphorMatrixIntent;
|
|
182
485
|
|
|
183
486
|
declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
|
|
184
487
|
operator: SemaphorAnalyticsNullFilterOperator;
|
|
@@ -203,7 +506,7 @@ declare type SemaphorAnalyticsRepairHint = {
|
|
|
203
506
|
recommendedNextStep: string;
|
|
204
507
|
};
|
|
205
508
|
|
|
206
|
-
declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult;
|
|
509
|
+
declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult | SemaphorMatrixResult;
|
|
207
510
|
|
|
208
511
|
declare type SemaphorAnalyticsResultBase = {
|
|
209
512
|
intentId?: string;
|
|
@@ -212,6 +515,7 @@ declare type SemaphorAnalyticsResultBase = {
|
|
|
212
515
|
rowCount?: number;
|
|
213
516
|
rowLimitExceeded?: boolean;
|
|
214
517
|
limit?: number;
|
|
518
|
+
pagination?: SemaphorPaginationMetadata;
|
|
215
519
|
};
|
|
216
520
|
|
|
217
521
|
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';
|
|
@@ -236,6 +540,8 @@ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
|
|
|
236
540
|
|
|
237
541
|
declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
|
|
238
542
|
|
|
543
|
+
export declare type SemaphorAnyQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorQueryResult<TRecord>;
|
|
544
|
+
|
|
239
545
|
declare type SemaphorCompiledQuery = {
|
|
240
546
|
kind: 'config';
|
|
241
547
|
queryId: string;
|
|
@@ -263,6 +569,10 @@ declare type SemaphorCompiledQuery = {
|
|
|
263
569
|
analyticsIntent?: SemaphorAnalyticsIntent;
|
|
264
570
|
};
|
|
265
571
|
|
|
572
|
+
export declare type SemaphorControlBuilderSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = Omit<SemaphorControlInputSpec<TValue>, 'kind'> & {
|
|
573
|
+
role: SemaphorControlRole;
|
|
574
|
+
};
|
|
575
|
+
|
|
266
576
|
export declare type SemaphorControlInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBase<TValue> & {
|
|
267
577
|
kind: 'control';
|
|
268
578
|
role: SemaphorControlRole;
|
|
@@ -272,34 +582,21 @@ export declare type SemaphorControlRole = 'grain' | 'metric' | 'dimension' | 'ag
|
|
|
272
582
|
|
|
273
583
|
export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
|
|
274
584
|
|
|
585
|
+
export declare type SemaphorDataAppDefinition = {
|
|
586
|
+
id?: string;
|
|
587
|
+
title?: string;
|
|
588
|
+
description?: string;
|
|
589
|
+
inputs?: Record<string, SemaphorInputSpec> | SemaphorInputSpec[];
|
|
590
|
+
queries?: Record<string, SemaphorQueryDefinition>;
|
|
591
|
+
views: SemaphorDataAppViewDefinition[];
|
|
592
|
+
};
|
|
593
|
+
|
|
275
594
|
export declare type SemaphorDataAppFieldCatalog = {
|
|
276
595
|
source: SemaphorSourceRef;
|
|
277
596
|
sourceAliases?: SemaphorSourceRef[];
|
|
278
597
|
fields: SemaphorFieldRef[];
|
|
279
598
|
};
|
|
280
599
|
|
|
281
|
-
export declare type SemaphorDataAppHookSpec = {
|
|
282
|
-
hook: 'useSemaphorAnalysis';
|
|
283
|
-
spec: SemaphorAnalysisQuerySpec;
|
|
284
|
-
} | {
|
|
285
|
-
hook: 'useSemaphorMetric';
|
|
286
|
-
spec: SemaphorMetricQuerySpec;
|
|
287
|
-
} | {
|
|
288
|
-
hook: 'useSemaphorRecords';
|
|
289
|
-
spec: SemaphorRecordsQuerySpec;
|
|
290
|
-
} | {
|
|
291
|
-
hook: 'useSemaphorInputOptions';
|
|
292
|
-
spec: SemaphorInputOptionsQuerySpec;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
export declare type SemaphorDataAppHookValidation = {
|
|
296
|
-
hook: SemaphorDataAppHookSpec['hook'];
|
|
297
|
-
hookId?: string;
|
|
298
|
-
intent?: SemaphorAnalyticsIntent;
|
|
299
|
-
diagnostics: SemaphorDataAppValidationDiagnostic[];
|
|
300
|
-
executionResult: SemaphorAnalyticsExecutionResult;
|
|
301
|
-
};
|
|
302
|
-
|
|
303
600
|
export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
|
|
304
601
|
|
|
305
602
|
export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext & {
|
|
@@ -307,17 +604,30 @@ export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext
|
|
|
307
604
|
children: ReactNode;
|
|
308
605
|
};
|
|
309
606
|
|
|
607
|
+
export declare type SemaphorDataAppQuerySpecEnvelope = {
|
|
608
|
+
queryHook: 'useSemaphorQuery';
|
|
609
|
+
spec: SemaphorQueryDefinition;
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
export declare type SemaphorDataAppQueryValidation = {
|
|
613
|
+
queryHook: SemaphorDataAppQuerySpecEnvelope['queryHook'];
|
|
614
|
+
queryId?: string;
|
|
615
|
+
intent?: SemaphorAnalyticsIntent;
|
|
616
|
+
diagnostics: SemaphorDataAppValidationDiagnostic[];
|
|
617
|
+
executionResult: SemaphorAnalyticsExecutionResult;
|
|
618
|
+
};
|
|
619
|
+
|
|
310
620
|
export declare type SemaphorDataAppRuntime = SemaphorQueryExecutorContext & {
|
|
311
621
|
executor?: SemaphorQueryExecutor;
|
|
312
622
|
};
|
|
313
623
|
|
|
314
624
|
export declare type SemaphorDataAppValidationDiagnostic = {
|
|
315
625
|
severity: 'error' | 'warning';
|
|
316
|
-
code: '
|
|
626
|
+
code: 'invalid_query_spec' | 'invalid_analytics_intent' | 'invalid_source_ref' | 'missing_field' | 'unsupported_input_filter_composition' | string;
|
|
317
627
|
message: string;
|
|
318
628
|
path?: string;
|
|
319
|
-
|
|
320
|
-
|
|
629
|
+
queryHook?: SemaphorDataAppQuerySpecEnvelope['queryHook'];
|
|
630
|
+
queryId?: string;
|
|
321
631
|
intentId?: string;
|
|
322
632
|
source?: SemaphorSourceRef;
|
|
323
633
|
field?: SemaphorFieldRef;
|
|
@@ -326,11 +636,19 @@ export declare type SemaphorDataAppValidationDiagnostic = {
|
|
|
326
636
|
export declare type SemaphorDataAppValidationResult = {
|
|
327
637
|
ok: boolean;
|
|
328
638
|
diagnostics: SemaphorDataAppValidationDiagnostic[];
|
|
329
|
-
|
|
639
|
+
queries: SemaphorDataAppQueryValidation[];
|
|
330
640
|
intents: SemaphorAnalyticsIntent[];
|
|
331
641
|
executionResults: SemaphorAnalyticsExecutionResult[];
|
|
332
642
|
};
|
|
333
643
|
|
|
644
|
+
export declare type SemaphorDataAppViewDefinition<TQuery extends SemaphorQueryDefinition = SemaphorQueryDefinition> = {
|
|
645
|
+
id: string;
|
|
646
|
+
title?: string;
|
|
647
|
+
description?: string;
|
|
648
|
+
query: TQuery;
|
|
649
|
+
inputs?: SemaphorInputReference[];
|
|
650
|
+
};
|
|
651
|
+
|
|
334
652
|
declare type SemaphorDataAppWindowRuntime = {
|
|
335
653
|
apiBaseUrl?: string;
|
|
336
654
|
dataApiBaseUrl?: string;
|
|
@@ -347,6 +665,14 @@ declare type SemaphorExecutionFieldRef = SemaphorFieldRef & {
|
|
|
347
665
|
aggregateSource?: SemaphorMetricAggregateSource;
|
|
348
666
|
};
|
|
349
667
|
|
|
668
|
+
/**
|
|
669
|
+
* Explorer-backed table source. This is intentionally distinct from raw SQL:
|
|
670
|
+
* matrix planning needs stable source metadata, fields, and dialect context.
|
|
671
|
+
*/
|
|
672
|
+
declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
|
|
673
|
+
kind: 'physical';
|
|
674
|
+
}>;
|
|
675
|
+
|
|
350
676
|
export declare type SemaphorFieldRef = {
|
|
351
677
|
name: string;
|
|
352
678
|
label?: string;
|
|
@@ -368,12 +694,17 @@ declare type SemaphorInputBase<TValue extends SemaphorInputValue> = {
|
|
|
368
694
|
label?: string;
|
|
369
695
|
value?: TValue;
|
|
370
696
|
defaultValue?: TValue;
|
|
371
|
-
onValueChange?:
|
|
697
|
+
onValueChange?: {
|
|
698
|
+
bivarianceHack(value: TValue | undefined): void;
|
|
699
|
+
}['bivarianceHack'];
|
|
372
700
|
options?: Array<SemaphorInputOption | SemaphorOptionValue>;
|
|
373
701
|
};
|
|
374
702
|
|
|
375
703
|
declare type SemaphorInputBinding = {
|
|
376
704
|
inputId: string;
|
|
705
|
+
kind?: 'filter' | 'control';
|
|
706
|
+
controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
|
|
707
|
+
operator?: SemaphorInputOperator;
|
|
377
708
|
field?: SemaphorFieldRef;
|
|
378
709
|
};
|
|
379
710
|
|
|
@@ -420,6 +751,10 @@ export declare type SemaphorInputOptionsPayload = {
|
|
|
420
751
|
executionResult?: SemaphorAnalyticsExecutionResult;
|
|
421
752
|
};
|
|
422
753
|
|
|
754
|
+
export declare type SemaphorInputOptionsQueryDefinition = SemaphorInputOptionsQuerySpec & {
|
|
755
|
+
queryKind: 'inputOptions';
|
|
756
|
+
};
|
|
757
|
+
|
|
423
758
|
export declare type SemaphorInputOptionsQueryResult = SemaphorQueryState & SemaphorInputOptionsPayload & {
|
|
424
759
|
id?: string;
|
|
425
760
|
intent?: Extract<SemaphorAnalyticsIntent, {
|
|
@@ -444,12 +779,196 @@ declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
|
|
|
444
779
|
}>;
|
|
445
780
|
};
|
|
446
781
|
|
|
447
|
-
export declare type SemaphorInputReference = SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle;
|
|
782
|
+
export declare type SemaphorInputReference = SemaphorInputSpec | SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle;
|
|
448
783
|
|
|
449
784
|
export declare type SemaphorInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorFilterInputSpec<TValue> | SemaphorControlInputSpec<TValue>;
|
|
450
785
|
|
|
451
786
|
export declare type SemaphorInputValue = SemaphorScalar | SemaphorScalar[];
|
|
452
787
|
|
|
788
|
+
declare type SemaphorMatrixAxisExpansionOptions = {
|
|
789
|
+
defaultDepth?: number;
|
|
790
|
+
lazy?: boolean;
|
|
791
|
+
expandedPaths?: SemaphorMatrixMemberPathSegment[][];
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
export declare type SemaphorMatrixAxisLevel = {
|
|
795
|
+
id?: string;
|
|
796
|
+
field: SemaphorFieldRef;
|
|
797
|
+
grain?: SemaphorTimeGrain;
|
|
798
|
+
label?: string;
|
|
799
|
+
subtotal?: boolean | SemaphorMatrixSubtotalOptions;
|
|
800
|
+
sortBy?: SemaphorMatrixAxisSortRule;
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
export declare type SemaphorMatrixAxisLevelInput = SemaphorQueryField | SemaphorMatrixAxisLevel;
|
|
804
|
+
|
|
805
|
+
declare type SemaphorMatrixAxisSortRule = {
|
|
806
|
+
direction: 'asc' | 'desc';
|
|
807
|
+
by: {
|
|
808
|
+
kind: 'label';
|
|
809
|
+
} | {
|
|
810
|
+
kind: 'field';
|
|
811
|
+
field: SemaphorFieldRef;
|
|
812
|
+
aggregate?: SemaphorAggregateFunction;
|
|
813
|
+
};
|
|
814
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
815
|
+
scope?: 'global' | 'withinParent';
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
export declare type SemaphorMatrixDisplayLimitOptions = {
|
|
819
|
+
rows?: SemaphorMatrixDisplayLimitRule;
|
|
820
|
+
columns?: SemaphorMatrixDisplayLimitRule;
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
declare type SemaphorMatrixDisplayLimitRule = {
|
|
824
|
+
limit: number;
|
|
825
|
+
by?: 'label' | 'value';
|
|
826
|
+
direction?: 'top' | 'bottom';
|
|
827
|
+
others?: boolean | {
|
|
828
|
+
label?: string;
|
|
829
|
+
};
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
export declare type SemaphorMatrixExpansionOptions = {
|
|
833
|
+
rows?: SemaphorMatrixAxisExpansionOptions;
|
|
834
|
+
columns?: SemaphorMatrixAxisExpansionOptions;
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
export declare type SemaphorMatrixIntent = {
|
|
838
|
+
kind: 'matrix';
|
|
839
|
+
version?: SemaphorProtocolVersion;
|
|
840
|
+
id?: string;
|
|
841
|
+
label?: string;
|
|
842
|
+
source: SemaphorMatrixSourceRef;
|
|
843
|
+
rows: SemaphorMatrixAxisLevel[];
|
|
844
|
+
columns?: SemaphorMatrixAxisLevel[];
|
|
845
|
+
values: SemaphorMatrixValueField[];
|
|
846
|
+
filters?: SemaphorAnalyticsFilter[];
|
|
847
|
+
inputs?: SemaphorInputBinding[];
|
|
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
|
+
export declare type SemaphorMatrixPayload = {
|
|
868
|
+
payload?: MatrixPayload;
|
|
869
|
+
grid?: MatrixGridProjection;
|
|
870
|
+
expansion?: MatrixExpansionResponseHints;
|
|
871
|
+
executionResult?: SemaphorAnalyticsExecutionResult;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
export declare type SemaphorMatrixQueryDefinition = SemaphorMatrixQuerySpec & {
|
|
875
|
+
queryKind: 'matrix';
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
export declare type SemaphorMatrixQueryResult = SemaphorQueryState & SemaphorMatrixPayload & {
|
|
879
|
+
id?: string;
|
|
880
|
+
intent?: SemaphorMatrixIntent;
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
export declare type SemaphorMatrixQuerySpec = Omit<SemaphorMatrixIntent, 'kind' | 'version' | 'rows' | 'columns' | 'values' | 'source' | 'inputs'> & {
|
|
884
|
+
source: SemaphorMatrixSourceRef;
|
|
885
|
+
rows: SemaphorNonEmptyArray<SemaphorMatrixAxisLevelInput>;
|
|
886
|
+
columns?: SemaphorMatrixAxisLevelInput[];
|
|
887
|
+
values: SemaphorNonEmptyArray<SemaphorMatrixValueFieldInput>;
|
|
888
|
+
inputs?: SemaphorInputReference[];
|
|
889
|
+
totals?: SemaphorMatrixTotalOptions;
|
|
890
|
+
sort?: SemaphorMatrixSortRule[];
|
|
891
|
+
expansion?: SemaphorMatrixExpansionOptions;
|
|
892
|
+
layout?: SemaphorMatrixIntent['layout'];
|
|
893
|
+
displayLimits?: SemaphorMatrixDisplayLimitOptions;
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
declare type SemaphorMatrixResult = SemaphorAnalyticsResultBase & {
|
|
897
|
+
kind: 'matrix';
|
|
898
|
+
intent: SemaphorMatrixIntent;
|
|
899
|
+
payload: MatrixPayload;
|
|
900
|
+
grid: MatrixGridProjection;
|
|
901
|
+
expansion?: MatrixExpansionResponseHints;
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
export declare type SemaphorMatrixSortRule = {
|
|
905
|
+
axis: 'row' | 'column';
|
|
906
|
+
targetId?: string;
|
|
907
|
+
direction: 'asc' | 'desc';
|
|
908
|
+
by: {
|
|
909
|
+
kind: 'label';
|
|
910
|
+
} | {
|
|
911
|
+
kind: 'field';
|
|
912
|
+
field: SemaphorFieldRef;
|
|
913
|
+
aggregate?: SemaphorAggregateFunction;
|
|
914
|
+
} | {
|
|
915
|
+
kind: 'value';
|
|
916
|
+
valueId: string;
|
|
917
|
+
rowPath?: SemaphorMatrixMemberPathSegment[];
|
|
918
|
+
columnPath?: SemaphorMatrixMemberPathSegment[];
|
|
919
|
+
};
|
|
920
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
921
|
+
scope?: 'global' | 'withinParent';
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
export declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
|
|
925
|
+
|
|
926
|
+
declare type SemaphorMatrixSubtotalOptions = {
|
|
927
|
+
enabled?: boolean;
|
|
928
|
+
position?: 'before' | 'after';
|
|
929
|
+
label?: string;
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
declare type SemaphorMatrixTotalCalculation = {
|
|
933
|
+
kind: 'defaultAggregate';
|
|
934
|
+
} | {
|
|
935
|
+
kind: 'blank';
|
|
936
|
+
} | {
|
|
937
|
+
kind: 'labelOnly';
|
|
938
|
+
label?: string;
|
|
939
|
+
} | {
|
|
940
|
+
kind: 'customAggregate';
|
|
941
|
+
aggregate: SemaphorAggregateFunction;
|
|
942
|
+
} | {
|
|
943
|
+
kind: 'percentOfParent';
|
|
944
|
+
} | {
|
|
945
|
+
kind: 'percentOfGrandTotal';
|
|
946
|
+
} | {
|
|
947
|
+
kind: 'customExpression';
|
|
948
|
+
expressionId: string;
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
export declare type SemaphorMatrixTotalOptions = {
|
|
952
|
+
rows?: boolean | 'perLevel';
|
|
953
|
+
columns?: boolean | 'perLevel';
|
|
954
|
+
grandTotal?: boolean | {
|
|
955
|
+
rows?: boolean;
|
|
956
|
+
columns?: boolean;
|
|
957
|
+
};
|
|
958
|
+
rowPosition?: 'top' | 'bottom';
|
|
959
|
+
columnPosition?: 'left' | 'right';
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
export declare type SemaphorMatrixValueField = {
|
|
963
|
+
id?: string;
|
|
964
|
+
field: SemaphorFieldRef;
|
|
965
|
+
aggregate?: SemaphorAggregateFunction;
|
|
966
|
+
label?: string;
|
|
967
|
+
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
export declare type SemaphorMatrixValueFieldInput = SemaphorQueryField | SemaphorMatrixValueField;
|
|
971
|
+
|
|
453
972
|
declare type SemaphorMetricAggregateSource = 'semantic_model' | 'caller_override' | 'default_sum';
|
|
454
973
|
|
|
455
974
|
declare type SemaphorMetricAnalysis = {
|
|
@@ -500,6 +1019,10 @@ export declare type SemaphorMetricPayload = {
|
|
|
500
1019
|
executionResult?: SemaphorAnalyticsExecutionResult;
|
|
501
1020
|
};
|
|
502
1021
|
|
|
1022
|
+
export declare type SemaphorMetricQueryDefinition = SemaphorMetricQuerySpec & {
|
|
1023
|
+
queryKind: 'metric';
|
|
1024
|
+
};
|
|
1025
|
+
|
|
503
1026
|
export declare type SemaphorMetricQueryResult = SemaphorQueryState & SemaphorMetricPayload & {
|
|
504
1027
|
id?: string;
|
|
505
1028
|
intent?: SemaphorMetricIntent;
|
|
@@ -534,6 +1057,20 @@ export declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
|
|
|
534
1057
|
|
|
535
1058
|
export declare type SemaphorOptionValue = string | number | boolean;
|
|
536
1059
|
|
|
1060
|
+
export declare type SemaphorPaginationMetadata = {
|
|
1061
|
+
page: number;
|
|
1062
|
+
pageSize: number;
|
|
1063
|
+
pageCount: number;
|
|
1064
|
+
totalCount: number;
|
|
1065
|
+
hasNextPage: boolean;
|
|
1066
|
+
hasPrevPage: boolean;
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
export declare type SemaphorPaginationRequest = {
|
|
1070
|
+
page: number;
|
|
1071
|
+
pageSize: number;
|
|
1072
|
+
};
|
|
1073
|
+
|
|
537
1074
|
declare type SemaphorProtocolIssue = {
|
|
538
1075
|
code: string;
|
|
539
1076
|
message: string;
|
|
@@ -542,6 +1079,8 @@ declare type SemaphorProtocolIssue = {
|
|
|
542
1079
|
|
|
543
1080
|
declare type SemaphorProtocolVersion = 1;
|
|
544
1081
|
|
|
1082
|
+
export declare type SemaphorQueryDefinition = SemaphorMetricQueryDefinition | SemaphorAnalysisQueryDefinition | SemaphorRecordsQueryDefinition | SemaphorInputOptionsQueryDefinition | SemaphorSqlQueryDefinition | SemaphorMatrixQueryDefinition;
|
|
1083
|
+
|
|
545
1084
|
export declare type SemaphorQueryExecutor = {
|
|
546
1085
|
executeAnalysis?(intent: SemaphorMetricIntent, context: SemaphorQueryExecutorContext, options?: SemaphorAnalysisQueryOptions): Promise<SemaphorAnalysisPayload>;
|
|
547
1086
|
executeMetric(intent: SemaphorMetricIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorMetricPayload>;
|
|
@@ -549,6 +1088,8 @@ export declare type SemaphorQueryExecutor = {
|
|
|
549
1088
|
executeInputOptions(intent: Extract<SemaphorAnalyticsIntent, {
|
|
550
1089
|
kind: 'inputOptions';
|
|
551
1090
|
}>, context: SemaphorQueryExecutorContext): Promise<SemaphorInputOptionsPayload>;
|
|
1091
|
+
executeSql?<TRecord extends Record<string, unknown> = Record<string, unknown>>(intent: SemaphorSqlIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorSqlPayload<TRecord>>;
|
|
1092
|
+
executeMatrix?(intent: SemaphorMatrixIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorMatrixPayload>;
|
|
552
1093
|
};
|
|
553
1094
|
|
|
554
1095
|
export declare type SemaphorQueryExecutorContext = {
|
|
@@ -566,6 +1107,14 @@ export declare type SemaphorQueryOrderBy = {
|
|
|
566
1107
|
|
|
567
1108
|
declare type SemaphorQueryPath = 'query_spec' | 'sql' | 'sql_python';
|
|
568
1109
|
|
|
1110
|
+
export declare type SemaphorQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorMetricQueryResult | SemaphorAnalysisQueryResult | SemaphorRowsQueryResult<TRecord> | SemaphorInputOptionsQueryResult | SemaphorMatrixQueryResult;
|
|
1111
|
+
|
|
1112
|
+
export declare type SemaphorQueryResultFor<TQuery extends SemaphorQueryDefinition, TRecord extends Record<string, unknown> = Record<string, unknown>> = TQuery extends SemaphorMetricQueryDefinition ? SemaphorMetricQueryResult : TQuery extends SemaphorAnalysisQueryDefinition ? SemaphorAnalysisQueryResult : TQuery extends SemaphorRecordsQueryDefinition ? SemaphorRecordsQueryResult<TRecord> : TQuery extends SemaphorInputOptionsQueryDefinition ? SemaphorInputOptionsQueryResult : TQuery extends SemaphorSqlQueryDefinition ? SemaphorSqlQueryResult<TRecord> : TQuery extends SemaphorMatrixQueryDefinition ? SemaphorMatrixQueryResult : never;
|
|
1113
|
+
|
|
1114
|
+
export declare type SemaphorQueryRuntimeOptions = {
|
|
1115
|
+
inputs?: SemaphorInputReference[];
|
|
1116
|
+
};
|
|
1117
|
+
|
|
569
1118
|
export declare type SemaphorQuerySourceSpec = {
|
|
570
1119
|
source: SemaphorSourceRef;
|
|
571
1120
|
};
|
|
@@ -588,6 +1137,7 @@ declare type SemaphorRecordsBaseQuerySpec = SemaphorQuerySourceSpec & {
|
|
|
588
1137
|
orderBy?: SemaphorRecordsOrderBy;
|
|
589
1138
|
inputs?: SemaphorInputReference[];
|
|
590
1139
|
limit?: number;
|
|
1140
|
+
pagination?: SemaphorPaginationRequest;
|
|
591
1141
|
};
|
|
592
1142
|
|
|
593
1143
|
export declare type SemaphorRecordsField = SemaphorFieldRef & {
|
|
@@ -606,6 +1156,7 @@ declare type SemaphorRecordsIntent = {
|
|
|
606
1156
|
timeWindow?: SemaphorTimeWindow;
|
|
607
1157
|
filters?: SemaphorAnalyticsFilter[];
|
|
608
1158
|
limit?: number;
|
|
1159
|
+
pagination?: SemaphorPaginationRequest;
|
|
609
1160
|
orderBy?: {
|
|
610
1161
|
field: SemaphorFieldRef;
|
|
611
1162
|
direction: 'asc' | 'desc';
|
|
@@ -619,9 +1170,14 @@ export declare type SemaphorRecordsPayload<TRecord extends Record<string, unknow
|
|
|
619
1170
|
records: TRecord[];
|
|
620
1171
|
columns?: SemaphorResultColumn[];
|
|
621
1172
|
rowCount?: number;
|
|
1173
|
+
pagination?: SemaphorPaginationMetadata;
|
|
622
1174
|
executionResult?: SemaphorAnalyticsExecutionResult;
|
|
623
1175
|
};
|
|
624
1176
|
|
|
1177
|
+
export declare type SemaphorRecordsQueryDefinition = SemaphorRecordsQuerySpec & {
|
|
1178
|
+
queryKind: 'records';
|
|
1179
|
+
};
|
|
1180
|
+
|
|
625
1181
|
export declare type SemaphorRecordsQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorQueryState & SemaphorRecordsPayload<TRecord> & {
|
|
626
1182
|
id?: string;
|
|
627
1183
|
intent?: SemaphorRecordsIntent;
|
|
@@ -688,8 +1244,14 @@ export declare type SemaphorResultColumn = {
|
|
|
688
1244
|
source?: SemaphorFieldRef['source'];
|
|
689
1245
|
};
|
|
690
1246
|
|
|
1247
|
+
export declare type SemaphorRowsQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorRecordsQueryResult<TRecord> | SemaphorSqlQueryResult<TRecord>;
|
|
1248
|
+
|
|
691
1249
|
export declare type SemaphorScalar = string | number | boolean | null;
|
|
692
1250
|
|
|
1251
|
+
declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
|
|
1252
|
+
kind: 'semantic';
|
|
1253
|
+
}>;
|
|
1254
|
+
|
|
693
1255
|
export declare type SemaphorSourceRef = {
|
|
694
1256
|
kind: 'semantic';
|
|
695
1257
|
domainId: string;
|
|
@@ -722,14 +1284,53 @@ declare type SemaphorSqlIntent = {
|
|
|
722
1284
|
kind: 'sql';
|
|
723
1285
|
}>;
|
|
724
1286
|
sql: string;
|
|
725
|
-
|
|
1287
|
+
defaultParameters?: Record<string, unknown>;
|
|
726
1288
|
pythonCode?: string;
|
|
727
1289
|
limit?: number;
|
|
1290
|
+
pagination?: SemaphorPaginationRequest;
|
|
728
1291
|
rationale?: string;
|
|
729
1292
|
fields?: SemaphorFieldRef[];
|
|
730
1293
|
inputs?: SemaphorInputBinding[];
|
|
731
1294
|
};
|
|
732
1295
|
|
|
1296
|
+
export declare type SemaphorSqlParameterValue = SemaphorScalar | SemaphorScalar[];
|
|
1297
|
+
|
|
1298
|
+
export declare type SemaphorSqlParamInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = Omit<SemaphorControlInputSpec<TValue>, 'kind' | 'role'> & {
|
|
1299
|
+
defaultValue?: TValue;
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
export declare type SemaphorSqlPayload<TRecord extends Record<string, unknown> = Record<string, unknown>> = {
|
|
1303
|
+
records: TRecord[];
|
|
1304
|
+
columns?: SemaphorResultColumn[];
|
|
1305
|
+
rowCount?: number;
|
|
1306
|
+
pagination?: SemaphorPaginationMetadata;
|
|
1307
|
+
output?: string;
|
|
1308
|
+
rowLimitExceeded?: boolean;
|
|
1309
|
+
executionResult?: SemaphorAnalyticsExecutionResult;
|
|
1310
|
+
};
|
|
1311
|
+
|
|
1312
|
+
export declare type SemaphorSqlQueryDefinition = SemaphorSqlQuerySpec & {
|
|
1313
|
+
queryKind: 'sql';
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
export declare type SemaphorSqlQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorQueryState & SemaphorSqlPayload<TRecord> & {
|
|
1317
|
+
id?: string;
|
|
1318
|
+
intent?: SemaphorSqlIntent;
|
|
1319
|
+
};
|
|
1320
|
+
|
|
1321
|
+
export declare type SemaphorSqlQuerySpec = SemaphorSqlSourceSpec & {
|
|
1322
|
+
id?: string;
|
|
1323
|
+
label?: string;
|
|
1324
|
+
sql: string;
|
|
1325
|
+
defaultParameters?: Record<string, SemaphorSqlParameterValue>;
|
|
1326
|
+
pythonCode?: string;
|
|
1327
|
+
fields?: SemaphorFieldRef[];
|
|
1328
|
+
inputs?: SemaphorInputReference[];
|
|
1329
|
+
limit?: number;
|
|
1330
|
+
pagination?: SemaphorPaginationRequest;
|
|
1331
|
+
rationale?: string;
|
|
1332
|
+
};
|
|
1333
|
+
|
|
733
1334
|
declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
|
|
734
1335
|
kind: 'sql';
|
|
735
1336
|
columns: SemaphorRecordsResult['columns'];
|
|
@@ -741,6 +1342,12 @@ declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
|
|
|
741
1342
|
};
|
|
742
1343
|
};
|
|
743
1344
|
|
|
1345
|
+
export declare type SemaphorSqlSourceSpec = {
|
|
1346
|
+
source: Extract<SemaphorSourceRef, {
|
|
1347
|
+
kind: 'sql';
|
|
1348
|
+
}>;
|
|
1349
|
+
};
|
|
1350
|
+
|
|
744
1351
|
declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
745
1352
|
|
|
746
1353
|
export declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
|
|
@@ -766,26 +1373,37 @@ export declare function toSemaphorInputSpec<TValue extends SemaphorInputValue =
|
|
|
766
1373
|
label?: string;
|
|
767
1374
|
field?: SemaphorFieldRef;
|
|
768
1375
|
operator?: SemaphorInputOperator;
|
|
1376
|
+
controlRole?: SemaphorControlRole;
|
|
769
1377
|
};
|
|
770
1378
|
|
|
1379
|
+
export declare function toSemaphorMatrixIntent(spec: SemaphorMatrixQuerySpec): SemaphorMatrixIntent;
|
|
1380
|
+
|
|
771
1381
|
export declare function toSemaphorMetricIntent(spec: SemaphorMetricQuerySpec): SemaphorMetricIntent;
|
|
772
1382
|
|
|
773
1383
|
export declare function toSemaphorRecordsIntent(spec: SemaphorRecordsQuerySpec): SemaphorRecordsIntent;
|
|
774
1384
|
|
|
775
|
-
export declare function
|
|
1385
|
+
export declare function toSemaphorSqlIntent(spec: SemaphorSqlQuerySpec): SemaphorSqlIntent;
|
|
776
1386
|
|
|
777
1387
|
export declare function useSemaphorDataAppRuntime(): SemaphorDataAppRuntime;
|
|
778
1388
|
|
|
779
1389
|
export declare function useSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputHandle;
|
|
780
1390
|
|
|
781
|
-
export declare function
|
|
1391
|
+
export declare function useSemaphorInputs(specs: readonly SemaphorInputSpec[]): SemaphorInputHandle[];
|
|
1392
|
+
|
|
1393
|
+
export declare function useSemaphorQuery(spec: SemaphorMetricQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorMetricQueryResult;
|
|
1394
|
+
|
|
1395
|
+
export declare function useSemaphorQuery(spec: SemaphorAnalysisQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorAnalysisQueryResult;
|
|
1396
|
+
|
|
1397
|
+
export declare function useSemaphorQuery<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorRecordsQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorRecordsQueryResult<TRecord>;
|
|
1398
|
+
|
|
1399
|
+
export declare function useSemaphorQuery(spec: SemaphorInputOptionsQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorInputOptionsQueryResult;
|
|
782
1400
|
|
|
783
|
-
export declare function
|
|
1401
|
+
export declare function useSemaphorQuery<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorSqlQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorSqlQueryResult<TRecord>;
|
|
784
1402
|
|
|
785
|
-
export declare function
|
|
1403
|
+
export declare function useSemaphorQuery(spec: SemaphorMatrixQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorMatrixQueryResult;
|
|
786
1404
|
|
|
787
|
-
export declare function
|
|
788
|
-
|
|
1405
|
+
export declare function validateSemaphorDataAppQuerySpecs(input: {
|
|
1406
|
+
queries: SemaphorDataAppQuerySpecEnvelope[];
|
|
789
1407
|
fieldCatalogs?: SemaphorDataAppFieldCatalog[];
|
|
790
1408
|
requireFieldCatalog?: boolean;
|
|
791
1409
|
validateTimezone?: SemaphorAnalysisTimezoneValidator;
|