semaphor 0.0.100 → 0.0.102
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/chunks/dashboard-plus-CA0-C70T.js +410 -0
- package/dist/chunks/dashboard-plus-ZydhJTUT.js +13272 -0
- package/dist/chunks/{index-B7M8EcMr.js → index-Das4K9pB.js} +26160 -20567
- package/dist/chunks/index-W3FSZVh4.js +534 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -369
- package/dist/index.js +51 -8699
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/dashboard.d.ts +210 -3
- package/dist/types/main.d.ts +336 -18
- package/dist/types/surfboard.d.ts +210 -3
- package/dist/types/types.d.ts +210 -3
- package/package.json +4 -3
- package/dist/chunks/index-BYJosMLK.js +0 -432
|
@@ -3,7 +3,11 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
3
3
|
|
|
4
4
|
export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
|
|
5
5
|
|
|
6
|
-
declare type AggregateFunction = 'SUM' | 'AVG' | '
|
|
6
|
+
declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
|
|
7
|
+
|
|
8
|
+
declare type AIContext = {
|
|
9
|
+
selectedEntities: SelectedEntities;
|
|
10
|
+
};
|
|
7
11
|
|
|
8
12
|
export declare type AIScopeTable = {
|
|
9
13
|
connectionId: string;
|
|
@@ -50,6 +54,16 @@ export declare type CacheConfig = {
|
|
|
50
54
|
status: 'on' | 'on-refresh' | 'off';
|
|
51
55
|
};
|
|
52
56
|
|
|
57
|
+
declare interface CardConfig {
|
|
58
|
+
groupByColumns?: GroupByField[];
|
|
59
|
+
metricColumns?: MetricField[];
|
|
60
|
+
pivotByColumns?: PivotByField[];
|
|
61
|
+
sortByColumns?: SortByField[];
|
|
62
|
+
filters?: FilterGroup;
|
|
63
|
+
joinPlan?: JoinPlan;
|
|
64
|
+
rowLimit?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
53
67
|
declare type CardWithContent = BaseCustomCard & {
|
|
54
68
|
content: React.FC<{
|
|
55
69
|
card: TCard;
|
|
@@ -116,6 +130,8 @@ export declare type ConnectionPolicy = {
|
|
|
116
130
|
params: Params;
|
|
117
131
|
};
|
|
118
132
|
|
|
133
|
+
declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
|
|
134
|
+
|
|
119
135
|
export declare type CustomCard = CardWithContent | CardWithFooter;
|
|
120
136
|
|
|
121
137
|
export declare type DashboardEventHandlers = {
|
|
@@ -162,12 +178,50 @@ export declare type DashboardProps = {
|
|
|
162
178
|
selectedSheetId?: string;
|
|
163
179
|
};
|
|
164
180
|
|
|
181
|
+
declare interface DatabaseEntityReference {
|
|
182
|
+
connectionId: string;
|
|
183
|
+
connectionType: ConnectionType;
|
|
184
|
+
type: EntityType;
|
|
185
|
+
dialect?: Dialect;
|
|
186
|
+
database?: string;
|
|
187
|
+
schema?: string;
|
|
188
|
+
name: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare type DatabaseEntityType = 'table' | 'view';
|
|
192
|
+
|
|
193
|
+
declare interface DataModelEntityReference extends DatabaseEntityReference {
|
|
194
|
+
type: 'model';
|
|
195
|
+
id: string;
|
|
196
|
+
label: string;
|
|
197
|
+
description: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
declare interface DataSource {
|
|
201
|
+
connectionId: string;
|
|
202
|
+
semanticDomainId?: string;
|
|
203
|
+
connectionType: string;
|
|
204
|
+
mode: 'database' | 'upload' | 'url' | 'semanticDomain';
|
|
205
|
+
dbSelection?: {
|
|
206
|
+
database: string;
|
|
207
|
+
schema: string;
|
|
208
|
+
entityType: DatabaseEntityType;
|
|
209
|
+
};
|
|
210
|
+
selectedEntities: SelectedEntities;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare const DATE_FORMAT_VALUES: readonly ["YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM", "MMMM YYYY", "custom"];
|
|
214
|
+
|
|
215
|
+
declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
|
|
216
|
+
|
|
165
217
|
export declare type DateOptions = {
|
|
166
218
|
locale: string;
|
|
167
219
|
format: string;
|
|
168
220
|
options: Intl.DateTimeFormatOptions;
|
|
169
221
|
};
|
|
170
222
|
|
|
223
|
+
declare type Dialect = 'mysql' | 'postgresql' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb';
|
|
224
|
+
|
|
171
225
|
export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
172
226
|
|
|
173
227
|
export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
|
|
@@ -181,6 +235,8 @@ export declare type EmailSettings = {
|
|
|
181
235
|
|
|
182
236
|
export declare const EMPTY_SELECTION: SelectionState;
|
|
183
237
|
|
|
238
|
+
declare type EntityType = 'table' | 'view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
|
|
239
|
+
|
|
184
240
|
export declare type ErrorProps = {
|
|
185
241
|
message?: string;
|
|
186
242
|
};
|
|
@@ -192,6 +248,49 @@ export declare type ExportDataPayload = {
|
|
|
192
248
|
sql: string;
|
|
193
249
|
};
|
|
194
250
|
|
|
251
|
+
declare interface Field {
|
|
252
|
+
/**
|
|
253
|
+
* Unique identifier for this field instance (for joins, UI state, etc.).
|
|
254
|
+
* Should be unique within the context of the query or data model.
|
|
255
|
+
* Example: 'orders.customer_id', 'expr_12345', etc.
|
|
256
|
+
*/
|
|
257
|
+
id: string;
|
|
258
|
+
/**
|
|
259
|
+
* The physical/source column name in the database or data source.
|
|
260
|
+
* Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
|
|
261
|
+
*/
|
|
262
|
+
name: string;
|
|
263
|
+
/**
|
|
264
|
+
* Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
|
|
265
|
+
*/
|
|
266
|
+
label: string;
|
|
267
|
+
/**
|
|
268
|
+
* Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
|
|
269
|
+
* If not provided, should be auto-generated from label or name.
|
|
270
|
+
*/
|
|
271
|
+
alias?: string;
|
|
272
|
+
dataType: string;
|
|
273
|
+
description?: string;
|
|
274
|
+
qualifiedEntityName?: string;
|
|
275
|
+
dateFormat?: DateFormatValue;
|
|
276
|
+
customFormat?: string;
|
|
277
|
+
granularity?: TimeGranularity;
|
|
278
|
+
entityId: string;
|
|
279
|
+
entityName: string;
|
|
280
|
+
entityType: EntityType;
|
|
281
|
+
role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare interface FileEntityReference extends DatabaseEntityReference {
|
|
285
|
+
id: string;
|
|
286
|
+
type: 'file' | 'url' | 'upload';
|
|
287
|
+
label: string;
|
|
288
|
+
description: string;
|
|
289
|
+
originalName: string;
|
|
290
|
+
file?: File;
|
|
291
|
+
url?: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
195
294
|
declare interface FilterByColumn extends BaseColumn {
|
|
196
295
|
role: 'filter';
|
|
197
296
|
operators?: string[];
|
|
@@ -203,6 +302,13 @@ declare interface FilterByColumn extends BaseColumn {
|
|
|
203
302
|
staticValues?: string[];
|
|
204
303
|
}
|
|
205
304
|
|
|
305
|
+
declare interface FilterCondition {
|
|
306
|
+
id: string;
|
|
307
|
+
field: Field;
|
|
308
|
+
operator: Operator;
|
|
309
|
+
value: FilterValue;
|
|
310
|
+
}
|
|
311
|
+
|
|
206
312
|
declare type FilterForBetween = BaseFilter & {
|
|
207
313
|
operation: 'between' | 'not between';
|
|
208
314
|
values: [number, number];
|
|
@@ -233,6 +339,14 @@ declare type FilterForString = BaseFilter & {
|
|
|
233
339
|
values: [string];
|
|
234
340
|
};
|
|
235
341
|
|
|
342
|
+
declare interface FilterGroup {
|
|
343
|
+
id: string;
|
|
344
|
+
logicalOperator: LogicalOperator;
|
|
345
|
+
negate: boolean;
|
|
346
|
+
conditions: FilterCondition[];
|
|
347
|
+
groups: FilterGroup[];
|
|
348
|
+
}
|
|
349
|
+
|
|
236
350
|
declare type FilterLocation = 'dashboard' | 'frame' | undefined;
|
|
237
351
|
|
|
238
352
|
declare type FilterOnClick = {
|
|
@@ -240,7 +354,7 @@ declare type FilterOnClick = {
|
|
|
240
354
|
columnIndex: number;
|
|
241
355
|
};
|
|
242
356
|
|
|
243
|
-
declare type FilterValue = string | number |
|
|
357
|
+
declare type FilterValue = string | number | boolean | Date | [number, number] | [string, string] | string[] | number[];
|
|
244
358
|
|
|
245
359
|
export declare type GetDashboardResponse = {
|
|
246
360
|
dashboard: TDashboard;
|
|
@@ -264,10 +378,47 @@ declare interface GroupByColumn extends BaseColumn {
|
|
|
264
378
|
format?: string;
|
|
265
379
|
}
|
|
266
380
|
|
|
381
|
+
declare interface GroupByField extends Field {
|
|
382
|
+
role: 'groupby';
|
|
383
|
+
granularity?: 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
384
|
+
/**
|
|
385
|
+
* Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
|
|
386
|
+
* If present, used in SELECT and GROUP BY instead of just the column name.
|
|
387
|
+
*/
|
|
388
|
+
expression?: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
267
391
|
export declare type HtmlOptions = {
|
|
268
392
|
html: string;
|
|
269
393
|
};
|
|
270
394
|
|
|
395
|
+
declare interface Join {
|
|
396
|
+
id: string;
|
|
397
|
+
source: DatabaseEntityReference;
|
|
398
|
+
target: DatabaseEntityReference;
|
|
399
|
+
joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
|
|
400
|
+
joinKeyGroups: JoinKeyGroup[];
|
|
401
|
+
sequence: number;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
declare interface JoinKey {
|
|
405
|
+
id?: string;
|
|
406
|
+
source: Field;
|
|
407
|
+
target: Field;
|
|
408
|
+
operator: string;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
declare interface JoinKeyGroup {
|
|
412
|
+
id: string;
|
|
413
|
+
operator: string;
|
|
414
|
+
keys: JoinKey[];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
declare interface JoinPlan {
|
|
418
|
+
baseEntity: DatabaseEntityReference;
|
|
419
|
+
joins: Join[];
|
|
420
|
+
}
|
|
421
|
+
|
|
271
422
|
export declare type KPICardProps = {
|
|
272
423
|
card: TCard;
|
|
273
424
|
isLoading?: boolean;
|
|
@@ -280,12 +431,46 @@ export declare type LoadingProps = {
|
|
|
280
431
|
message?: string;
|
|
281
432
|
};
|
|
282
433
|
|
|
434
|
+
declare type LogicalOperator = 'AND' | 'OR';
|
|
435
|
+
|
|
283
436
|
declare interface MetricColumn extends BaseColumn {
|
|
284
437
|
role: 'metric';
|
|
285
438
|
aggregate: AggregateFunction;
|
|
286
439
|
aliasTemplate?: string;
|
|
287
440
|
}
|
|
288
441
|
|
|
442
|
+
declare interface MetricField extends Field {
|
|
443
|
+
role: 'metric';
|
|
444
|
+
aggregate: AggregateFunction;
|
|
445
|
+
/**
|
|
446
|
+
* Optional SQL expression for the metric (e.g., ship_date - order_date).
|
|
447
|
+
* If present, used as aggregate(expression) instead of aggregate(name).
|
|
448
|
+
*/
|
|
449
|
+
expression?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Optional parameters for future extensibility (e.g., window functions).
|
|
452
|
+
* * Example:
|
|
453
|
+
* {
|
|
454
|
+
aggregate: "SUM",
|
|
455
|
+
name: "sales",
|
|
456
|
+
parameters: {
|
|
457
|
+
window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
{
|
|
462
|
+
aggregate: "COUNT",
|
|
463
|
+
name: "order_id",
|
|
464
|
+
parameters: {
|
|
465
|
+
filter: "status = 'Active'"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
*/
|
|
469
|
+
parameters?: Record<string, any>;
|
|
470
|
+
aliasTemplate?: string;
|
|
471
|
+
valueAliases?: Record<string, string>;
|
|
472
|
+
}
|
|
473
|
+
|
|
289
474
|
declare type NoneOptions = {};
|
|
290
475
|
|
|
291
476
|
export declare type NumberAxisFormat = {
|
|
@@ -302,8 +487,12 @@ export declare type NumberOptions = {
|
|
|
302
487
|
colorRanges?: ColorRange[];
|
|
303
488
|
};
|
|
304
489
|
|
|
490
|
+
declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
491
|
+
|
|
305
492
|
declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
306
493
|
|
|
494
|
+
declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in';
|
|
495
|
+
|
|
307
496
|
declare type OptionsMap = {
|
|
308
497
|
number: NumberOptions;
|
|
309
498
|
string: StringOptions;
|
|
@@ -321,6 +510,10 @@ declare type Params = {
|
|
|
321
510
|
[key: string]: string | number | string[] | number[];
|
|
322
511
|
};
|
|
323
512
|
|
|
513
|
+
declare interface PivotByField extends Field {
|
|
514
|
+
role: 'pivotby';
|
|
515
|
+
}
|
|
516
|
+
|
|
324
517
|
export declare type Placeholders = {
|
|
325
518
|
/**
|
|
326
519
|
* Placeholder for the card when there are no records to display.
|
|
@@ -344,7 +537,7 @@ declare interface QueryConfig {
|
|
|
344
537
|
|
|
345
538
|
declare type QueryFilter = {
|
|
346
539
|
filterColumnName: string;
|
|
347
|
-
filterValue:
|
|
540
|
+
filterValue: OldFilterValue;
|
|
348
541
|
};
|
|
349
542
|
|
|
350
543
|
declare type RangeValue = {
|
|
@@ -354,8 +547,15 @@ declare type RangeValue = {
|
|
|
354
547
|
gt?: string | number;
|
|
355
548
|
};
|
|
356
549
|
|
|
550
|
+
declare type SelectedEntities = DatabaseEntityReference[] | DataModelEntityReference[] | FileEntityReference[];
|
|
551
|
+
|
|
357
552
|
export declare type SelectionState = Record<Level, string | null>;
|
|
358
553
|
|
|
554
|
+
declare interface SortByField extends Field {
|
|
555
|
+
role: 'sortby';
|
|
556
|
+
direction: 'asc' | 'desc';
|
|
557
|
+
}
|
|
558
|
+
|
|
359
559
|
export declare type SqlGen = {
|
|
360
560
|
measures?: {
|
|
361
561
|
name: string;
|
|
@@ -439,6 +639,8 @@ export declare type TCard = {
|
|
|
439
639
|
type: TChartType;
|
|
440
640
|
sql?: string;
|
|
441
641
|
python?: string;
|
|
642
|
+
dataSource?: DataSource;
|
|
643
|
+
config?: CardConfig;
|
|
442
644
|
queryConfig?: QueryConfig;
|
|
443
645
|
customCfg?: any;
|
|
444
646
|
preferences?: TCardPreferences;
|
|
@@ -563,6 +765,7 @@ export declare type TCustomCardPreferences = {
|
|
|
563
765
|
export declare type TDashboard = {
|
|
564
766
|
id: string;
|
|
565
767
|
title?: string;
|
|
768
|
+
aiContext?: AIContext;
|
|
566
769
|
description?: string;
|
|
567
770
|
sheets?: TSheet[];
|
|
568
771
|
style?: TStyle;
|
|
@@ -580,6 +783,8 @@ export declare type TDataColumn = {
|
|
|
580
783
|
column_name: string;
|
|
581
784
|
data_type: string;
|
|
582
785
|
is_nullable?: string;
|
|
786
|
+
label?: string;
|
|
787
|
+
description?: string;
|
|
583
788
|
};
|
|
584
789
|
|
|
585
790
|
export declare type TDatasetOptions = {
|
|
@@ -633,6 +838,8 @@ export declare type TFrame = {
|
|
|
633
838
|
|
|
634
839
|
export declare type Theme = 'dark' | 'light' | 'system';
|
|
635
840
|
|
|
841
|
+
declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
842
|
+
|
|
636
843
|
export declare type TLegendOptions = {
|
|
637
844
|
display?: boolean;
|
|
638
845
|
position?: 'top' | 'left' | 'bottom' | 'right';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { FontSpec } from 'chart.js';
|
|
|
2
2
|
|
|
3
3
|
export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
|
|
4
4
|
|
|
5
|
-
declare type AggregateFunction = 'SUM' | 'AVG' | '
|
|
5
|
+
declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
|
|
6
|
+
|
|
7
|
+
declare type AIContext = {
|
|
8
|
+
selectedEntities: SelectedEntities;
|
|
9
|
+
};
|
|
6
10
|
|
|
7
11
|
export declare type AIScopeTable = {
|
|
8
12
|
connectionId: string;
|
|
@@ -49,6 +53,16 @@ export declare type CacheConfig = {
|
|
|
49
53
|
status: 'on' | 'on-refresh' | 'off';
|
|
50
54
|
};
|
|
51
55
|
|
|
56
|
+
declare interface CardConfig {
|
|
57
|
+
groupByColumns?: GroupByField[];
|
|
58
|
+
metricColumns?: MetricField[];
|
|
59
|
+
pivotByColumns?: PivotByField[];
|
|
60
|
+
sortByColumns?: SortByField[];
|
|
61
|
+
filters?: FilterGroup;
|
|
62
|
+
joinPlan?: JoinPlan;
|
|
63
|
+
rowLimit?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
declare type CardWithContent = BaseCustomCard & {
|
|
53
67
|
content: React.FC<{
|
|
54
68
|
card: TCard;
|
|
@@ -115,6 +129,8 @@ export declare type ConnectionPolicy = {
|
|
|
115
129
|
params: Params;
|
|
116
130
|
};
|
|
117
131
|
|
|
132
|
+
declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
|
|
133
|
+
|
|
118
134
|
export declare type CustomCard = CardWithContent | CardWithFooter;
|
|
119
135
|
|
|
120
136
|
export declare type DashboardEventHandlers = {
|
|
@@ -156,12 +172,50 @@ export declare type DashboardProps = {
|
|
|
156
172
|
selectedSheetId?: string;
|
|
157
173
|
};
|
|
158
174
|
|
|
175
|
+
declare interface DatabaseEntityReference {
|
|
176
|
+
connectionId: string;
|
|
177
|
+
connectionType: ConnectionType;
|
|
178
|
+
type: EntityType;
|
|
179
|
+
dialect?: Dialect;
|
|
180
|
+
database?: string;
|
|
181
|
+
schema?: string;
|
|
182
|
+
name: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare type DatabaseEntityType = 'table' | 'view';
|
|
186
|
+
|
|
187
|
+
declare interface DataModelEntityReference extends DatabaseEntityReference {
|
|
188
|
+
type: 'model';
|
|
189
|
+
id: string;
|
|
190
|
+
label: string;
|
|
191
|
+
description: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare interface DataSource {
|
|
195
|
+
connectionId: string;
|
|
196
|
+
semanticDomainId?: string;
|
|
197
|
+
connectionType: string;
|
|
198
|
+
mode: 'database' | 'upload' | 'url' | 'semanticDomain';
|
|
199
|
+
dbSelection?: {
|
|
200
|
+
database: string;
|
|
201
|
+
schema: string;
|
|
202
|
+
entityType: DatabaseEntityType;
|
|
203
|
+
};
|
|
204
|
+
selectedEntities: SelectedEntities;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
declare const DATE_FORMAT_VALUES: readonly ["YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM", "MMMM YYYY", "custom"];
|
|
208
|
+
|
|
209
|
+
declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
|
|
210
|
+
|
|
159
211
|
export declare type DateOptions = {
|
|
160
212
|
locale: string;
|
|
161
213
|
format: string;
|
|
162
214
|
options: Intl.DateTimeFormatOptions;
|
|
163
215
|
};
|
|
164
216
|
|
|
217
|
+
declare type Dialect = 'mysql' | 'postgresql' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb';
|
|
218
|
+
|
|
165
219
|
export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
166
220
|
|
|
167
221
|
export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
|
|
@@ -175,6 +229,8 @@ export declare type EmailSettings = {
|
|
|
175
229
|
|
|
176
230
|
export declare const EMPTY_SELECTION: SelectionState;
|
|
177
231
|
|
|
232
|
+
declare type EntityType = 'table' | 'view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
|
|
233
|
+
|
|
178
234
|
export declare type ErrorProps = {
|
|
179
235
|
message?: string;
|
|
180
236
|
};
|
|
@@ -186,6 +242,49 @@ export declare type ExportDataPayload = {
|
|
|
186
242
|
sql: string;
|
|
187
243
|
};
|
|
188
244
|
|
|
245
|
+
declare interface Field {
|
|
246
|
+
/**
|
|
247
|
+
* Unique identifier for this field instance (for joins, UI state, etc.).
|
|
248
|
+
* Should be unique within the context of the query or data model.
|
|
249
|
+
* Example: 'orders.customer_id', 'expr_12345', etc.
|
|
250
|
+
*/
|
|
251
|
+
id: string;
|
|
252
|
+
/**
|
|
253
|
+
* The physical/source column name in the database or data source.
|
|
254
|
+
* Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
|
|
255
|
+
*/
|
|
256
|
+
name: string;
|
|
257
|
+
/**
|
|
258
|
+
* Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
|
|
259
|
+
*/
|
|
260
|
+
label: string;
|
|
261
|
+
/**
|
|
262
|
+
* Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
|
|
263
|
+
* If not provided, should be auto-generated from label or name.
|
|
264
|
+
*/
|
|
265
|
+
alias?: string;
|
|
266
|
+
dataType: string;
|
|
267
|
+
description?: string;
|
|
268
|
+
qualifiedEntityName?: string;
|
|
269
|
+
dateFormat?: DateFormatValue;
|
|
270
|
+
customFormat?: string;
|
|
271
|
+
granularity?: TimeGranularity;
|
|
272
|
+
entityId: string;
|
|
273
|
+
entityName: string;
|
|
274
|
+
entityType: EntityType;
|
|
275
|
+
role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare interface FileEntityReference extends DatabaseEntityReference {
|
|
279
|
+
id: string;
|
|
280
|
+
type: 'file' | 'url' | 'upload';
|
|
281
|
+
label: string;
|
|
282
|
+
description: string;
|
|
283
|
+
originalName: string;
|
|
284
|
+
file?: File;
|
|
285
|
+
url?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
189
288
|
declare interface FilterByColumn extends BaseColumn {
|
|
190
289
|
role: 'filter';
|
|
191
290
|
operators?: string[];
|
|
@@ -197,6 +296,13 @@ declare interface FilterByColumn extends BaseColumn {
|
|
|
197
296
|
staticValues?: string[];
|
|
198
297
|
}
|
|
199
298
|
|
|
299
|
+
declare interface FilterCondition {
|
|
300
|
+
id: string;
|
|
301
|
+
field: Field;
|
|
302
|
+
operator: Operator;
|
|
303
|
+
value: FilterValue;
|
|
304
|
+
}
|
|
305
|
+
|
|
200
306
|
declare type FilterForBetween = BaseFilter & {
|
|
201
307
|
operation: 'between' | 'not between';
|
|
202
308
|
values: [number, number];
|
|
@@ -227,6 +333,14 @@ declare type FilterForString = BaseFilter & {
|
|
|
227
333
|
values: [string];
|
|
228
334
|
};
|
|
229
335
|
|
|
336
|
+
declare interface FilterGroup {
|
|
337
|
+
id: string;
|
|
338
|
+
logicalOperator: LogicalOperator;
|
|
339
|
+
negate: boolean;
|
|
340
|
+
conditions: FilterCondition[];
|
|
341
|
+
groups: FilterGroup[];
|
|
342
|
+
}
|
|
343
|
+
|
|
230
344
|
declare type FilterLocation = 'dashboard' | 'frame' | undefined;
|
|
231
345
|
|
|
232
346
|
declare type FilterOnClick = {
|
|
@@ -234,7 +348,7 @@ declare type FilterOnClick = {
|
|
|
234
348
|
columnIndex: number;
|
|
235
349
|
};
|
|
236
350
|
|
|
237
|
-
declare type FilterValue = string | number |
|
|
351
|
+
declare type FilterValue = string | number | boolean | Date | [number, number] | [string, string] | string[] | number[];
|
|
238
352
|
|
|
239
353
|
export declare type GetDashboardResponse = {
|
|
240
354
|
dashboard: TDashboard;
|
|
@@ -258,10 +372,47 @@ declare interface GroupByColumn extends BaseColumn {
|
|
|
258
372
|
format?: string;
|
|
259
373
|
}
|
|
260
374
|
|
|
375
|
+
declare interface GroupByField extends Field {
|
|
376
|
+
role: 'groupby';
|
|
377
|
+
granularity?: 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
378
|
+
/**
|
|
379
|
+
* Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
|
|
380
|
+
* If present, used in SELECT and GROUP BY instead of just the column name.
|
|
381
|
+
*/
|
|
382
|
+
expression?: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
261
385
|
export declare type HtmlOptions = {
|
|
262
386
|
html: string;
|
|
263
387
|
};
|
|
264
388
|
|
|
389
|
+
declare interface Join {
|
|
390
|
+
id: string;
|
|
391
|
+
source: DatabaseEntityReference;
|
|
392
|
+
target: DatabaseEntityReference;
|
|
393
|
+
joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
|
|
394
|
+
joinKeyGroups: JoinKeyGroup[];
|
|
395
|
+
sequence: number;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
declare interface JoinKey {
|
|
399
|
+
id?: string;
|
|
400
|
+
source: Field;
|
|
401
|
+
target: Field;
|
|
402
|
+
operator: string;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare interface JoinKeyGroup {
|
|
406
|
+
id: string;
|
|
407
|
+
operator: string;
|
|
408
|
+
keys: JoinKey[];
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
declare interface JoinPlan {
|
|
412
|
+
baseEntity: DatabaseEntityReference;
|
|
413
|
+
joins: Join[];
|
|
414
|
+
}
|
|
415
|
+
|
|
265
416
|
export declare type KPICardProps = {
|
|
266
417
|
card: TCard;
|
|
267
418
|
isLoading?: boolean;
|
|
@@ -274,12 +425,46 @@ export declare type LoadingProps = {
|
|
|
274
425
|
message?: string;
|
|
275
426
|
};
|
|
276
427
|
|
|
428
|
+
declare type LogicalOperator = 'AND' | 'OR';
|
|
429
|
+
|
|
277
430
|
declare interface MetricColumn extends BaseColumn {
|
|
278
431
|
role: 'metric';
|
|
279
432
|
aggregate: AggregateFunction;
|
|
280
433
|
aliasTemplate?: string;
|
|
281
434
|
}
|
|
282
435
|
|
|
436
|
+
declare interface MetricField extends Field {
|
|
437
|
+
role: 'metric';
|
|
438
|
+
aggregate: AggregateFunction;
|
|
439
|
+
/**
|
|
440
|
+
* Optional SQL expression for the metric (e.g., ship_date - order_date).
|
|
441
|
+
* If present, used as aggregate(expression) instead of aggregate(name).
|
|
442
|
+
*/
|
|
443
|
+
expression?: string;
|
|
444
|
+
/**
|
|
445
|
+
* Optional parameters for future extensibility (e.g., window functions).
|
|
446
|
+
* * Example:
|
|
447
|
+
* {
|
|
448
|
+
aggregate: "SUM",
|
|
449
|
+
name: "sales",
|
|
450
|
+
parameters: {
|
|
451
|
+
window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
{
|
|
456
|
+
aggregate: "COUNT",
|
|
457
|
+
name: "order_id",
|
|
458
|
+
parameters: {
|
|
459
|
+
filter: "status = 'Active'"
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
*/
|
|
463
|
+
parameters?: Record<string, any>;
|
|
464
|
+
aliasTemplate?: string;
|
|
465
|
+
valueAliases?: Record<string, string>;
|
|
466
|
+
}
|
|
467
|
+
|
|
283
468
|
declare type NoneOptions = {};
|
|
284
469
|
|
|
285
470
|
export declare type NumberAxisFormat = {
|
|
@@ -296,8 +481,12 @@ export declare type NumberOptions = {
|
|
|
296
481
|
colorRanges?: ColorRange[];
|
|
297
482
|
};
|
|
298
483
|
|
|
484
|
+
declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
485
|
+
|
|
299
486
|
declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
300
487
|
|
|
488
|
+
declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in';
|
|
489
|
+
|
|
301
490
|
declare type OptionsMap = {
|
|
302
491
|
number: NumberOptions;
|
|
303
492
|
string: StringOptions;
|
|
@@ -315,6 +504,10 @@ declare type Params = {
|
|
|
315
504
|
[key: string]: string | number | string[] | number[];
|
|
316
505
|
};
|
|
317
506
|
|
|
507
|
+
declare interface PivotByField extends Field {
|
|
508
|
+
role: 'pivotby';
|
|
509
|
+
}
|
|
510
|
+
|
|
318
511
|
export declare type Placeholders = {
|
|
319
512
|
/**
|
|
320
513
|
* Placeholder for the card when there are no records to display.
|
|
@@ -338,7 +531,7 @@ declare interface QueryConfig {
|
|
|
338
531
|
|
|
339
532
|
declare type QueryFilter = {
|
|
340
533
|
filterColumnName: string;
|
|
341
|
-
filterValue:
|
|
534
|
+
filterValue: OldFilterValue;
|
|
342
535
|
};
|
|
343
536
|
|
|
344
537
|
declare type RangeValue = {
|
|
@@ -348,8 +541,15 @@ declare type RangeValue = {
|
|
|
348
541
|
gt?: string | number;
|
|
349
542
|
};
|
|
350
543
|
|
|
544
|
+
declare type SelectedEntities = DatabaseEntityReference[] | DataModelEntityReference[] | FileEntityReference[];
|
|
545
|
+
|
|
351
546
|
export declare type SelectionState = Record<Level, string | null>;
|
|
352
547
|
|
|
548
|
+
declare interface SortByField extends Field {
|
|
549
|
+
role: 'sortby';
|
|
550
|
+
direction: 'asc' | 'desc';
|
|
551
|
+
}
|
|
552
|
+
|
|
353
553
|
export declare type SqlGen = {
|
|
354
554
|
measures?: {
|
|
355
555
|
name: string;
|
|
@@ -431,6 +631,8 @@ export declare type TCard = {
|
|
|
431
631
|
type: TChartType;
|
|
432
632
|
sql?: string;
|
|
433
633
|
python?: string;
|
|
634
|
+
dataSource?: DataSource;
|
|
635
|
+
config?: CardConfig;
|
|
434
636
|
queryConfig?: QueryConfig;
|
|
435
637
|
customCfg?: any;
|
|
436
638
|
preferences?: TCardPreferences;
|
|
@@ -555,6 +757,7 @@ export declare type TCustomCardPreferences = {
|
|
|
555
757
|
export declare type TDashboard = {
|
|
556
758
|
id: string;
|
|
557
759
|
title?: string;
|
|
760
|
+
aiContext?: AIContext;
|
|
558
761
|
description?: string;
|
|
559
762
|
sheets?: TSheet[];
|
|
560
763
|
style?: TStyle;
|
|
@@ -572,6 +775,8 @@ export declare type TDataColumn = {
|
|
|
572
775
|
column_name: string;
|
|
573
776
|
data_type: string;
|
|
574
777
|
is_nullable?: string;
|
|
778
|
+
label?: string;
|
|
779
|
+
description?: string;
|
|
575
780
|
};
|
|
576
781
|
|
|
577
782
|
export declare type TDatasetOptions = {
|
|
@@ -625,6 +830,8 @@ export declare type TFrame = {
|
|
|
625
830
|
|
|
626
831
|
export declare type Theme = 'dark' | 'light' | 'system';
|
|
627
832
|
|
|
833
|
+
declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
834
|
+
|
|
628
835
|
export declare type TLegendOptions = {
|
|
629
836
|
display?: boolean;
|
|
630
837
|
position?: 'top' | 'left' | 'bottom' | 'right';
|