react-semaphor 0.1.344 → 0.1.346

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.
@@ -309,7 +309,7 @@ export declare type SemaphorAnalyticsExecutionResult = {
309
309
  coverage?: {
310
310
  answeredObligations: string[];
311
311
  missingObligations: string[];
312
- warnings: SemaphorAnalyticsValidationIssue[];
312
+ warnings?: SemaphorAnalyticsValidationIssue[];
313
313
  };
314
314
  missingFields?: string[];
315
315
  warnings?: string[];
@@ -652,11 +652,7 @@ export declare type SemaphorRecordsIntent = {
652
652
 
653
653
  export declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
654
654
  kind: 'records';
655
- columns: Array<{
656
- name: string;
657
- label?: string;
658
- dataType?: SemaphorFieldRef['dataType'];
659
- }>;
655
+ columns: SemaphorResultColumn[];
660
656
  records: Array<Record<string, unknown>>;
661
657
  };
662
658
 
@@ -689,6 +685,26 @@ export declare type SemaphorRelationshipDiagnostics = {
689
685
 
690
686
  export declare type SemaphorRelationshipDiagnosticStatus = 'not_required' | 'resolved' | 'missing' | 'ambiguous' | 'fanout_risk' | 'unknown';
691
687
 
688
+ export declare type SemaphorResultColumn = {
689
+ /**
690
+ * Stable row accessor for this result. Consumers should read values with
691
+ * `row[column.key]`; labels are display-only and may change.
692
+ */
693
+ key: string;
694
+ /**
695
+ * Semantic/source field name before result-key disambiguation.
696
+ */
697
+ name: string;
698
+ /**
699
+ * Human-facing display label.
700
+ */
701
+ label: string;
702
+ role?: SemaphorFieldRef['role'];
703
+ dataType?: SemaphorFieldRef['dataType'];
704
+ aggregate?: SemaphorFieldRef['aggregate'];
705
+ source?: SemaphorFieldRef['source'];
706
+ };
707
+
692
708
  export declare type SemaphorSourceCoordinateInput = {
693
709
  databaseName?: string;
694
710
  schemaName?: string;
@@ -1579,6 +1579,7 @@ declare interface Join {
1579
1579
  relationshipId?: string;
1580
1580
  relationshipName?: string;
1581
1581
  relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1582
+ relationshipTraversalDirection?: 'forward' | 'reverse';
1582
1583
  }
1583
1584
 
1584
1585
  declare interface JoinKey {
@@ -1622,6 +1622,7 @@ declare interface Join {
1622
1622
  relationshipId?: string;
1623
1623
  relationshipName?: string;
1624
1624
  relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1625
+ relationshipTraversalDirection?: 'forward' | 'reverse';
1625
1626
  }
1626
1627
 
1627
1628
  declare interface JoinKey {
@@ -2,20 +2,29 @@ import { Context } from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
3
  import { ReactNode } from 'react';
4
4
 
5
- export declare function createSemaphorDataAppExecutor(): SemaphorDataAppExecutor;
5
+ export declare function createSemaphorQueryExecutor(): SemaphorQueryExecutor;
6
6
 
7
7
  export declare function hasSemaphorInputValue(value: unknown): boolean;
8
8
 
9
9
  export declare function normalizeSemaphorInputOptions(options?: Array<{
10
10
  label: string;
11
- value: SemaphorDataAppOptionValue;
12
- } | SemaphorDataAppOptionValue>): {
11
+ value: SemaphorOptionValue;
12
+ } | SemaphorOptionValue>): {
13
13
  label: string;
14
- value: SemaphorDataAppOptionValue;
14
+ value: SemaphorOptionValue;
15
15
  }[];
16
16
 
17
17
  export declare function readWindowRuntime(): SemaphorDataAppWindowRuntime | undefined;
18
18
 
19
+ export declare type SemaphorActiveInput<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBinding & {
20
+ kind: 'filter' | 'control';
21
+ label?: string;
22
+ value?: TValue;
23
+ isActive: boolean;
24
+ operator?: SemaphorInputOperator;
25
+ controlRole?: SemaphorControlRole;
26
+ };
27
+
19
28
  declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
20
29
 
21
30
  declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
@@ -43,108 +52,164 @@ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
43
52
 
44
53
  declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
45
54
 
46
- export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
47
-
48
- export declare type SemaphorDataAppControlInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
55
+ export declare type SemaphorControlInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBase<TValue> & {
49
56
  kind: 'control';
50
- role: SemaphorDataAppControlRole;
57
+ role: SemaphorControlRole;
51
58
  };
52
59
 
53
- export declare type SemaphorDataAppControlRole = 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
60
+ export declare type SemaphorControlRole = 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
54
61
 
55
- export declare type SemaphorDataAppExecutor = {
56
- executeMetric(intent: SemaphorMetricIntent, context: SemaphorDataAppExecutorContext): Promise<SemaphorDataAppMetricData>;
57
- executeRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(intent: SemaphorRecordsIntent, context: SemaphorDataAppExecutorContext): Promise<SemaphorDataAppRecordsData<TRecord>>;
58
- executeInputOptions(intent: Extract<SemaphorAnalyticsIntent, {
59
- kind: 'inputOptions';
60
- }>, context: SemaphorDataAppExecutorContext): Promise<SemaphorDataAppInputOptionsData>;
62
+ export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
63
+
64
+ export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
65
+
66
+ export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext & {
67
+ executor?: SemaphorQueryExecutor;
68
+ children: ReactNode;
61
69
  };
62
70
 
63
- export declare type SemaphorDataAppExecutorContext = {
64
- token?: string;
71
+ export declare type SemaphorDataAppRuntime = SemaphorQueryExecutorContext & {
72
+ executor?: SemaphorQueryExecutor;
73
+ };
74
+
75
+ declare type SemaphorDataAppWindowRuntime = {
65
76
  apiBaseUrl?: string;
66
- activeInputs?: SemaphorDataAppInputSnapshot[];
77
+ dataApiBaseUrl?: string;
78
+ authToken?: null | {
79
+ accessToken?: string;
80
+ };
67
81
  };
68
82
 
69
- export declare type SemaphorDataAppFieldSpec = SemaphorFieldRef;
83
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
70
84
 
71
- export declare type SemaphorDataAppFilterInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
85
+ declare type SemaphorFieldRef = {
86
+ name: string;
87
+ label?: string;
88
+ role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
89
+ dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
90
+ source?: SemaphorSourceRef;
91
+ aggregate?: SemaphorAggregateFunction;
92
+ };
93
+
94
+ export declare type SemaphorFilterInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBase<TValue> & {
72
95
  kind: 'filter';
73
- field: SemaphorDataAppFieldSpec;
96
+ field: SemaphorQueryField;
74
97
  operator?: SemaphorInputOperator;
75
98
  multi?: boolean;
76
99
  };
77
100
 
78
- declare type SemaphorDataAppInputBase<TValue extends SemaphorDataAppInputValue> = {
101
+ declare type SemaphorInputBase<TValue extends SemaphorInputValue> = {
79
102
  id: string;
80
103
  label?: string;
81
104
  value?: TValue;
82
105
  defaultValue?: TValue;
83
106
  onValueChange?: (value: TValue | undefined) => void;
84
- options?: Array<SemaphorDataAppInputOption | SemaphorDataAppOptionValue>;
107
+ options?: Array<SemaphorInputOption | SemaphorOptionValue>;
85
108
  };
86
109
 
87
- export declare type SemaphorDataAppInputHandle<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = {
110
+ declare type SemaphorInputBinding = {
111
+ inputId: string;
112
+ field?: SemaphorFieldRef;
113
+ };
114
+
115
+ export declare type SemaphorInputHandle<TValue extends SemaphorInputValue = SemaphorInputValue> = {
88
116
  id: string;
89
117
  kind: 'filter' | 'control';
90
118
  label?: string;
91
119
  field?: SemaphorFieldRef;
92
120
  operator?: SemaphorInputOperator;
93
- controlRole?: SemaphorDataAppControlRole;
121
+ controlRole?: SemaphorControlRole;
94
122
  value: TValue | undefined;
95
- options: SemaphorDataAppInputOption[];
123
+ options: SemaphorInputOption[];
96
124
  isActive: boolean;
97
125
  setValue(value: TValue | undefined): void;
98
126
  clear(): void;
99
- toAnalyticsInput(): SemaphorDataAppInputSnapshot<TValue>;
127
+ toAnalyticsInput(): SemaphorActiveInput<TValue>;
100
128
  };
101
129
 
102
- export declare type SemaphorDataAppInputOption = {
130
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
131
+
132
+ export declare type SemaphorInputOption = {
103
133
  label: string;
104
- value: SemaphorDataAppOptionValue;
134
+ value: SemaphorOptionValue;
105
135
  count?: number;
106
136
  };
107
137
 
108
- export declare type SemaphorDataAppInputOptionsData = {
109
- options: SemaphorDataAppInputOption[];
138
+ declare type SemaphorInputOptionsIntent = {
139
+ kind: 'inputOptions';
140
+ version?: SemaphorProtocolVersion;
141
+ id?: string;
142
+ label?: string;
143
+ source: SemaphorSourceRef;
144
+ field: SemaphorFieldRef;
145
+ search?: string;
146
+ limit?: number;
110
147
  };
111
148
 
112
- export declare type SemaphorDataAppInputOptionsResult = SemaphorDataAppQueryState & SemaphorDataAppInputOptionsData & {
149
+ export declare type SemaphorInputOptionsPayload = {
150
+ options: SemaphorInputOption[];
151
+ };
152
+
153
+ export declare type SemaphorInputOptionsQueryResult = SemaphorQueryState & SemaphorInputOptionsPayload & {
113
154
  id?: string;
114
155
  intent?: Extract<SemaphorAnalyticsIntent, {
115
156
  kind: 'inputOptions';
116
157
  }>;
117
158
  };
118
159
 
119
- export declare type SemaphorDataAppInputOptionsSpec = SemaphorDataAppSourceSpec & {
160
+ export declare type SemaphorInputOptionsQuerySpec = SemaphorQuerySourceSpec & {
120
161
  id?: string;
121
162
  label?: string;
122
- field: SemaphorDataAppFieldSpec;
163
+ field: SemaphorQueryField;
123
164
  search?: string;
124
165
  limit?: number;
125
166
  };
126
167
 
127
- export declare type SemaphorDataAppInputReference = SemaphorInputBinding | SemaphorDataAppInputSnapshot | SemaphorDataAppInputHandle;
168
+ export declare type SemaphorInputReference = SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle;
128
169
 
129
- export declare type SemaphorDataAppInputSnapshot<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorInputBinding & {
130
- kind: 'filter' | 'control';
131
- label?: string;
132
- value?: TValue;
133
- isActive: boolean;
134
- operator?: SemaphorInputOperator;
135
- controlRole?: SemaphorDataAppControlRole;
136
- };
170
+ export declare type SemaphorInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorFilterInputSpec<TValue> | SemaphorControlInputSpec<TValue>;
137
171
 
138
- export declare type SemaphorDataAppInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppFilterInputSpec<TValue> | SemaphorDataAppControlInputSpec<TValue>;
172
+ export declare type SemaphorInputValue = SemaphorScalar | SemaphorScalar[];
139
173
 
140
- export declare type SemaphorDataAppInputValue = SemaphorDataAppScalar | SemaphorDataAppScalar[];
174
+ declare type SemaphorMetricAnalysis = {
175
+ kind: 'period_change';
176
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
177
+ direction?: 'increase' | 'decrease' | 'both';
178
+ timeWindow?: SemaphorTimeWindow;
179
+ };
141
180
 
142
- export declare type SemaphorDataAppMetricComparison = {
181
+ export declare type SemaphorMetricComparison = {
143
182
  kind: 'previous_period' | 'previous_year' | 'target';
144
183
  targetValue?: number;
145
184
  };
146
185
 
147
- export declare type SemaphorDataAppMetricData = {
186
+ declare type SemaphorMetricIntent = {
187
+ kind: 'metric';
188
+ version?: SemaphorProtocolVersion;
189
+ id?: string;
190
+ source: SemaphorSourceRef;
191
+ metrics: SemaphorFieldRef[];
192
+ primaryMetric?: SemaphorFieldRef;
193
+ label?: string;
194
+ dateField?: SemaphorFieldRef;
195
+ timeGrain?: SemaphorTimeGrain;
196
+ timeWindow?: SemaphorTimeWindow;
197
+ dimensions?: SemaphorFieldRef[];
198
+ filters?: SemaphorAnalyticsFilter[];
199
+ comparison?: {
200
+ kind: 'previous_period' | 'previous_year' | 'target';
201
+ targetValue?: number;
202
+ };
203
+ analysis?: SemaphorMetricAnalysis;
204
+ orderBy?: {
205
+ field: SemaphorFieldRef;
206
+ direction: 'asc' | 'desc';
207
+ };
208
+ inputs?: SemaphorInputBinding[];
209
+ limit?: number;
210
+ };
211
+
212
+ export declare type SemaphorMetricPayload = {
148
213
  value: number | string | null;
149
214
  metrics?: Record<string, number | string | null>;
150
215
  comparisonValue?: number | string | null;
@@ -153,168 +218,77 @@ export declare type SemaphorDataAppMetricData = {
153
218
  records?: Array<Record<string, unknown>>;
154
219
  };
155
220
 
156
- export declare type SemaphorDataAppMetricResult = SemaphorDataAppQueryState & SemaphorDataAppMetricData & {
221
+ export declare type SemaphorMetricQueryResult = SemaphorQueryState & SemaphorMetricPayload & {
157
222
  id?: string;
158
223
  intent?: SemaphorMetricIntent;
159
224
  };
160
225
 
161
- export declare type SemaphorDataAppMetricSpec = SemaphorDataAppSourceSpec & {
226
+ export declare type SemaphorMetricQuerySpec = SemaphorQuerySourceSpec & {
162
227
  id?: string;
163
228
  label?: string;
164
- metrics: SemaphorDataAppNonEmptyArray<SemaphorDataAppFieldSpec>;
165
- primaryMetric?: SemaphorDataAppFieldSpec;
166
- dateField?: SemaphorDataAppFieldSpec;
229
+ metrics: SemaphorNonEmptyArray<SemaphorQueryField>;
230
+ primaryMetric?: SemaphorQueryField;
231
+ dateField?: SemaphorQueryField;
167
232
  timeGrain?: SemaphorTimeGrain;
168
- dimensions?: SemaphorDataAppFieldSpec[];
169
- comparison?: SemaphorDataAppMetricComparison;
170
- orderBy?: SemaphorDataAppOrderBy;
171
- inputs?: SemaphorDataAppInputReference[];
233
+ dimensions?: SemaphorQueryField[];
234
+ comparison?: SemaphorMetricComparison;
235
+ orderBy?: SemaphorQueryOrderBy;
236
+ inputs?: SemaphorInputReference[];
172
237
  limit?: number;
173
238
  };
174
239
 
175
- export declare type SemaphorDataAppNonEmptyArray<T> = [T, ...T[]];
176
-
177
- export declare type SemaphorDataAppOptionValue = string | number | boolean;
178
-
179
- export declare type SemaphorDataAppOrderBy = {
180
- field: SemaphorDataAppFieldSpec;
181
- direction: 'asc' | 'desc';
182
- };
183
-
184
- export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
240
+ export declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
185
241
 
186
- export declare type SemaphorDataAppProviderProps = SemaphorDataAppExecutorContext & {
187
- executor?: SemaphorDataAppExecutor;
188
- children: ReactNode;
189
- };
242
+ export declare type SemaphorOptionValue = string | number | boolean;
190
243
 
191
- export declare type SemaphorDataAppQueryState = {
192
- status: SemaphorDataAppQueryStatus;
193
- isLoading: boolean;
194
- error: Error | null;
195
- };
196
-
197
- export declare type SemaphorDataAppQueryStatus = 'idle' | 'loading' | 'success' | 'error';
198
-
199
- declare type SemaphorDataAppRecordsBaseSpec = SemaphorDataAppSourceSpec & {
200
- id?: string;
201
- label?: string;
202
- dateField?: SemaphorDataAppFieldSpec;
203
- timeGrain?: SemaphorTimeGrain;
204
- orderBy?: SemaphorDataAppRecordsOrderBy;
205
- inputs?: SemaphorDataAppInputReference[];
206
- limit?: number;
207
- };
208
-
209
- export declare type SemaphorDataAppRecordsData<TRecord extends Record<string, unknown> = Record<string, unknown>> = {
210
- records: TRecord[];
211
- columns?: Array<{
212
- name: string;
213
- label?: string;
214
- dataType?: SemaphorFieldRef['dataType'];
215
- role?: SemaphorFieldRef['role'];
216
- }>;
217
- rowCount?: number;
218
- };
219
-
220
- export declare type SemaphorDataAppRecordsFieldSpec = SemaphorFieldRef & {
221
- role: NonNullable<SemaphorFieldRef['role']>;
222
- };
223
-
224
- export declare type SemaphorDataAppRecordsOrderBy = SemaphorDataAppOrderBy;
225
-
226
- export declare type SemaphorDataAppRecordsResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorDataAppQueryState & SemaphorDataAppRecordsData<TRecord> & {
227
- id?: string;
228
- intent?: SemaphorRecordsIntent;
229
- };
230
-
231
- declare type SemaphorDataAppRecordsSelectorSpec = {
232
- fields: SemaphorDataAppNonEmptyArray<SemaphorDataAppRecordsFieldSpec>;
233
- };
234
-
235
- export declare type SemaphorDataAppRecordsSpec = SemaphorDataAppRecordsBaseSpec & SemaphorDataAppRecordsSelectorSpec;
236
-
237
- export declare type SemaphorDataAppRuntime = SemaphorDataAppExecutorContext & {
238
- executor?: SemaphorDataAppExecutor;
239
- };
240
-
241
- export declare type SemaphorDataAppScalar = string | number | boolean | null;
244
+ declare type SemaphorProtocolVersion = 1;
242
245
 
243
- export declare type SemaphorDataAppSourceSpec = {
244
- source: SemaphorSourceRef;
246
+ export declare type SemaphorQueryExecutor = {
247
+ executeMetric(intent: SemaphorMetricIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorMetricPayload>;
248
+ executeRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(intent: SemaphorRecordsIntent, context: SemaphorQueryExecutorContext): Promise<SemaphorRecordsPayload<TRecord>>;
249
+ executeInputOptions(intent: Extract<SemaphorAnalyticsIntent, {
250
+ kind: 'inputOptions';
251
+ }>, context: SemaphorQueryExecutorContext): Promise<SemaphorInputOptionsPayload>;
245
252
  };
246
253
 
247
- declare type SemaphorDataAppWindowRuntime = {
254
+ export declare type SemaphorQueryExecutorContext = {
255
+ token?: string;
248
256
  apiBaseUrl?: string;
249
- dataApiBaseUrl?: string;
250
- authToken?: null | {
251
- accessToken?: string;
252
- };
257
+ activeInputs?: SemaphorActiveInput[];
253
258
  };
254
259
 
255
- declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
256
-
257
- declare type SemaphorFieldRef = {
258
- name: string;
259
- label?: string;
260
- role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
261
- dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
262
- source?: SemaphorSourceRef;
263
- aggregate?: SemaphorAggregateFunction;
264
- };
260
+ export declare type SemaphorQueryField = SemaphorFieldRef;
265
261
 
266
- declare type SemaphorInputBinding = {
267
- inputId: string;
268
- field?: SemaphorFieldRef;
262
+ export declare type SemaphorQueryOrderBy = {
263
+ field: SemaphorQueryField;
264
+ direction: 'asc' | 'desc';
269
265
  };
270
266
 
271
- declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
272
-
273
- declare type SemaphorInputOptionsIntent = {
274
- kind: 'inputOptions';
275
- version?: SemaphorProtocolVersion;
276
- id?: string;
277
- label?: string;
267
+ export declare type SemaphorQuerySourceSpec = {
278
268
  source: SemaphorSourceRef;
279
- field: SemaphorFieldRef;
280
- search?: string;
281
- limit?: number;
282
269
  };
283
270
 
284
- declare type SemaphorMetricAnalysis = {
285
- kind: 'period_change';
286
- orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
287
- direction?: 'increase' | 'decrease' | 'both';
288
- timeWindow?: SemaphorTimeWindow;
271
+ export declare type SemaphorQueryState = {
272
+ status: SemaphorQueryStatus;
273
+ isLoading: boolean;
274
+ error: Error | null;
289
275
  };
290
276
 
291
- declare type SemaphorMetricIntent = {
292
- kind: 'metric';
293
- version?: SemaphorProtocolVersion;
277
+ export declare type SemaphorQueryStatus = 'idle' | 'loading' | 'success' | 'error';
278
+
279
+ declare type SemaphorRecordsBaseQuerySpec = SemaphorQuerySourceSpec & {
294
280
  id?: string;
295
- source: SemaphorSourceRef;
296
- metrics: SemaphorFieldRef[];
297
- primaryMetric?: SemaphorFieldRef;
298
281
  label?: string;
299
- dateField?: SemaphorFieldRef;
282
+ dateField?: SemaphorQueryField;
300
283
  timeGrain?: SemaphorTimeGrain;
301
- timeWindow?: SemaphorTimeWindow;
302
- dimensions?: SemaphorFieldRef[];
303
- filters?: SemaphorAnalyticsFilter[];
304
- comparison?: {
305
- kind: 'previous_period' | 'previous_year' | 'target';
306
- targetValue?: number;
307
- };
308
- analysis?: SemaphorMetricAnalysis;
309
- orderBy?: {
310
- field: SemaphorFieldRef;
311
- direction: 'asc' | 'desc';
312
- };
313
- inputs?: SemaphorInputBinding[];
284
+ orderBy?: SemaphorRecordsOrderBy;
285
+ inputs?: SemaphorInputReference[];
314
286
  limit?: number;
315
287
  };
316
288
 
317
- declare type SemaphorProtocolVersion = 1;
289
+ export declare type SemaphorRecordsField = SemaphorFieldRef & {
290
+ role: NonNullable<SemaphorFieldRef['role']>;
291
+ };
318
292
 
319
293
  declare type SemaphorRecordsIntent = {
320
294
  kind: 'records';
@@ -333,6 +307,47 @@ declare type SemaphorRecordsIntent = {
333
307
  inputs?: SemaphorInputBinding[];
334
308
  };
335
309
 
310
+ export declare type SemaphorRecordsOrderBy = SemaphorQueryOrderBy;
311
+
312
+ export declare type SemaphorRecordsPayload<TRecord extends Record<string, unknown> = Record<string, unknown>> = {
313
+ records: TRecord[];
314
+ columns?: SemaphorResultColumn[];
315
+ rowCount?: number;
316
+ };
317
+
318
+ export declare type SemaphorRecordsQueryResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorQueryState & SemaphorRecordsPayload<TRecord> & {
319
+ id?: string;
320
+ intent?: SemaphorRecordsIntent;
321
+ };
322
+
323
+ export declare type SemaphorRecordsQuerySpec = SemaphorRecordsBaseQuerySpec & SemaphorRecordsSelectorSpec;
324
+
325
+ declare type SemaphorRecordsSelectorSpec = {
326
+ fields: SemaphorNonEmptyArray<SemaphorRecordsField>;
327
+ };
328
+
329
+ export declare type SemaphorResultColumn = {
330
+ /**
331
+ * Stable row accessor for this result. Consumers should read values with
332
+ * `row[column.key]`; labels are display-only and may change.
333
+ */
334
+ key: string;
335
+ /**
336
+ * Semantic/source field name before result-key disambiguation.
337
+ */
338
+ name: string;
339
+ /**
340
+ * Human-facing display label.
341
+ */
342
+ label: string;
343
+ role?: SemaphorFieldRef['role'];
344
+ dataType?: SemaphorFieldRef['dataType'];
345
+ aggregate?: SemaphorFieldRef['aggregate'];
346
+ source?: SemaphorFieldRef['source'];
347
+ };
348
+
349
+ export declare type SemaphorScalar = string | number | boolean | null;
350
+
336
351
  declare type SemaphorSourceRef = {
337
352
  kind: 'semantic';
338
353
  domainId: string;
@@ -382,37 +397,37 @@ declare type SemaphorTimeWindow = {
382
397
  completeness?: 'include_partial' | 'complete_periods';
383
398
  };
384
399
 
385
- export declare function toSemaphorActiveInputSnapshots(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorDataAppInputSnapshot[];
400
+ export declare function toSemaphorActiveInputSnapshots(inputs: SemaphorInputReference[] | undefined): SemaphorActiveInput[];
386
401
 
387
- export declare function toSemaphorInputBinding(input: SemaphorDataAppInputReference): SemaphorInputBinding;
402
+ export declare function toSemaphorInputBinding(input: SemaphorInputReference): SemaphorInputBinding;
388
403
 
389
- export declare function toSemaphorInputBindings(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorInputBinding[] | undefined;
404
+ export declare function toSemaphorInputBindings(inputs: SemaphorInputReference[] | undefined): SemaphorInputBinding[] | undefined;
390
405
 
391
- export declare function toSemaphorInputOptionsIntent(spec: SemaphorDataAppInputOptionsSpec): Extract<SemaphorAnalyticsIntent, {
406
+ export declare function toSemaphorInputOptionsIntent(spec: SemaphorInputOptionsQuerySpec): Extract<SemaphorAnalyticsIntent, {
392
407
  kind: 'inputOptions';
393
408
  }>;
394
409
 
395
- export declare function toSemaphorInputSnapshots(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorDataAppInputSnapshot[];
410
+ export declare function toSemaphorInputSnapshots(inputs: SemaphorInputReference[] | undefined): SemaphorActiveInput[];
396
411
 
397
- export declare function toSemaphorInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue>(spec: SemaphorDataAppInputSpec<TValue>): SemaphorInputBinding & {
398
- kind: SemaphorDataAppInputSpec['kind'];
412
+ export declare function toSemaphorInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputBinding & {
413
+ kind: SemaphorInputSpec['kind'];
399
414
  label?: string;
400
415
  field?: SemaphorFieldRef;
401
416
  operator?: SemaphorInputOperator;
402
417
  };
403
418
 
404
- export declare function toSemaphorMetricIntent(spec: SemaphorDataAppMetricSpec): SemaphorMetricIntent;
419
+ export declare function toSemaphorMetricIntent(spec: SemaphorMetricQuerySpec): SemaphorMetricIntent;
405
420
 
406
- export declare function toSemaphorRecordsIntent(spec: SemaphorDataAppRecordsSpec): SemaphorRecordsIntent;
421
+ export declare function toSemaphorRecordsIntent(spec: SemaphorRecordsQuerySpec): SemaphorRecordsIntent;
407
422
 
408
423
  export declare function useSemaphorDataAppRuntime(): SemaphorDataAppRuntime;
409
424
 
410
- export declare function useSemaphorInput<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue>(spec: SemaphorDataAppInputSpec<TValue>): SemaphorDataAppInputHandle;
425
+ export declare function useSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputHandle;
411
426
 
412
- export declare function useSemaphorInputOptions(spec: SemaphorDataAppInputOptionsSpec): SemaphorDataAppInputOptionsResult;
427
+ export declare function useSemaphorInputOptions(spec: SemaphorInputOptionsQuerySpec): SemaphorInputOptionsQueryResult;
413
428
 
414
- export declare function useSemaphorMetric(spec: SemaphorDataAppMetricSpec): SemaphorDataAppMetricResult;
429
+ export declare function useSemaphorMetric(spec: SemaphorMetricQuerySpec): SemaphorMetricQueryResult;
415
430
 
416
- export declare function useSemaphorRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorDataAppRecordsSpec): SemaphorDataAppRecordsResult<TRecord>;
431
+ export declare function useSemaphorRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorRecordsQuerySpec): SemaphorRecordsQueryResult<TRecord>;
417
432
 
418
433
  export { }
@@ -3785,6 +3785,7 @@ export declare interface Join {
3785
3785
  relationshipId?: string;
3786
3786
  relationshipName?: string;
3787
3787
  relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
3788
+ relationshipTraversalDirection?: 'forward' | 'reverse';
3788
3789
  }
3789
3790
 
3790
3791
  export declare interface JoinKey {
@@ -1359,6 +1359,7 @@ declare interface Join {
1359
1359
  relationshipId?: string;
1360
1360
  relationshipName?: string;
1361
1361
  relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1362
+ relationshipTraversalDirection?: 'forward' | 'reverse';
1362
1363
  }
1363
1364
 
1364
1365
  declare interface JoinKey {
@@ -1632,6 +1632,7 @@ declare interface Join {
1632
1632
  relationshipId?: string;
1633
1633
  relationshipName?: string;
1634
1634
  relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1635
+ relationshipTraversalDirection?: 'forward' | 'reverse';
1635
1636
  }
1636
1637
 
1637
1638
  declare interface JoinKey {
@@ -2229,6 +2229,7 @@ export declare interface Join {
2229
2229
  relationshipId?: string;
2230
2230
  relationshipName?: string;
2231
2231
  relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
2232
+ relationshipTraversalDirection?: 'forward' | 'reverse';
2232
2233
  }
2233
2234
 
2234
2235
  export declare interface JoinKey {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.344",
8
+ "version": "0.1.346",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",