react-semaphor 0.0.3932 → 0.0.5321
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/CHANGELOG.md +54 -0
- package/dist/chunks/dashboard-plus-Bhud1IPW.js +375 -0
- package/dist/chunks/dashboard-plus-CNVP0HeC.js +13427 -0
- package/dist/chunks/index-By9l1g-q.js +638 -0
- package/dist/chunks/index-DORmhDA9.js +81778 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +4 -2
- package/dist/index.cjs +1 -257
- package/dist/index.js +55 -6449
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -1
- package/dist/types/dashboard.d.ts +493 -2
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -1
- package/dist/types/main.d.ts +873 -27
- package/dist/types/surfboard.d.ts +493 -2
- package/dist/types/types.d.ts +493 -2
- package/package.json +16 -8
- package/dist/chunks/index-BEZAy8Jv.js +0 -384
- package/dist/chunks/index-CanpZidr.js +0 -60482
|
@@ -3,6 +3,12 @@ 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 = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
|
|
7
|
+
|
|
8
|
+
declare type AIContext = {
|
|
9
|
+
selectedEntities: SelectedEntities;
|
|
10
|
+
};
|
|
11
|
+
|
|
6
12
|
export declare type AIScopeTable = {
|
|
7
13
|
connectionId: string;
|
|
8
14
|
connectionType: string;
|
|
@@ -13,11 +19,21 @@ export declare type AIScopeTable = {
|
|
|
13
19
|
datamodelName: string;
|
|
14
20
|
};
|
|
15
21
|
|
|
22
|
+
export declare type AssistantId = 'dashboard-assistant' | 'editor-assistant';
|
|
23
|
+
|
|
16
24
|
export declare type AuthToken = {
|
|
17
25
|
accessToken: string;
|
|
18
26
|
refreshToken?: string;
|
|
19
27
|
};
|
|
20
28
|
|
|
29
|
+
declare interface BaseColumn {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
label?: string;
|
|
33
|
+
type: ColumnType;
|
|
34
|
+
table?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
21
37
|
declare type BaseCustomCard = {
|
|
22
38
|
cardId: string;
|
|
23
39
|
replaceDefault?: boolean;
|
|
@@ -38,6 +54,49 @@ export declare type CacheConfig = {
|
|
|
38
54
|
status: 'on' | 'on-refresh' | 'off';
|
|
39
55
|
};
|
|
40
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
|
+
* One or more hierarchies that define drillable paths through dimensions.
|
|
67
|
+
*/
|
|
68
|
+
drillHierarchies?: DrillHierarchy[];
|
|
69
|
+
/**
|
|
70
|
+
* Optional list of dimensions allowed for dynamic drill-down across this card.
|
|
71
|
+
* Used only when drill steps contain `mode: 'dynamicDrill'` or `type: 'dynamic'`.
|
|
72
|
+
*/
|
|
73
|
+
allowedDrillTargets?: Field[];
|
|
74
|
+
/**
|
|
75
|
+
* NOT UOptional preload settings for inline drill previews
|
|
76
|
+
*/
|
|
77
|
+
inlineDrillPreview?: {
|
|
78
|
+
enabled: boolean;
|
|
79
|
+
limit: number;
|
|
80
|
+
mode: 'lazy' | 'preloaded';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Configuration for on-click dashboard filters triggered by this card.
|
|
84
|
+
*/
|
|
85
|
+
clickFilterInteractions?: ClickFilterInteraction[];
|
|
86
|
+
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target';
|
|
87
|
+
targetValue?: number;
|
|
88
|
+
showTrendline?: boolean;
|
|
89
|
+
trendlineWindow?: number;
|
|
90
|
+
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare interface CardInteractionConfig {
|
|
94
|
+
allowedDrillTargets?: Field[];
|
|
95
|
+
drillHierarchies?: DrillHierarchy[];
|
|
96
|
+
drillInteractions?: DrillInteraction[];
|
|
97
|
+
clickFilterInteractions?: ClickFilterInteraction[];
|
|
98
|
+
}
|
|
99
|
+
|
|
41
100
|
declare type CardWithContent = BaseCustomCard & {
|
|
42
101
|
content: React.FC<{
|
|
43
102
|
card: TCard;
|
|
@@ -56,22 +115,91 @@ declare type CardWithFooter = BaseCustomCard & {
|
|
|
56
115
|
}>;
|
|
57
116
|
};
|
|
58
117
|
|
|
118
|
+
declare interface ClickFilterInteraction {
|
|
119
|
+
mode: 'clickFilter';
|
|
120
|
+
/**
|
|
121
|
+
* Fields from the chart element that should be used as filters.
|
|
122
|
+
* e.g., [region, ship_mode] from a stacked bar chart
|
|
123
|
+
*/
|
|
124
|
+
filterFields: Field[];
|
|
125
|
+
/**
|
|
126
|
+
* Should this card visually highlight when clicked?
|
|
127
|
+
*/
|
|
128
|
+
highlightSelf?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Cards this filter applies to (inclusive).
|
|
131
|
+
* If omitted and `excludeCardIds` is also omitted → applies to all cards except self.
|
|
132
|
+
*/
|
|
133
|
+
applyToCardIds?: string[];
|
|
134
|
+
/**
|
|
135
|
+
* Cards to explicitly exclude from receiving this filter.
|
|
136
|
+
* Takes effect only if `applyToCardIds` is undefined (acts as override).
|
|
137
|
+
*/
|
|
138
|
+
excludeCardIds?: string[];
|
|
139
|
+
/**
|
|
140
|
+
* Optional UI label or tooltip.
|
|
141
|
+
*/
|
|
142
|
+
label?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
59
145
|
export declare type ColorRange = {
|
|
60
146
|
start: number;
|
|
61
147
|
end: number;
|
|
62
148
|
color: string;
|
|
63
149
|
};
|
|
64
150
|
|
|
151
|
+
declare interface ColorRange_2 {
|
|
152
|
+
min: number;
|
|
153
|
+
max: number;
|
|
154
|
+
color: string;
|
|
155
|
+
applyTo: 'cell' | 'row';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare interface ColumnSettings {
|
|
159
|
+
type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
|
|
160
|
+
textAlign: 'left' | 'center' | 'right';
|
|
161
|
+
width: string;
|
|
162
|
+
textWrap: 'wrap' | 'nowrap';
|
|
163
|
+
numberFormat: {
|
|
164
|
+
style: 'decimal' | 'currency' | 'percent';
|
|
165
|
+
currency: string;
|
|
166
|
+
locale: string;
|
|
167
|
+
minimumFractionDigits: number;
|
|
168
|
+
maximumFractionDigits: number;
|
|
169
|
+
showDataBar: boolean;
|
|
170
|
+
dataBarColor: string;
|
|
171
|
+
dataBarMinValue?: number;
|
|
172
|
+
dataBarMaxValue?: number;
|
|
173
|
+
};
|
|
174
|
+
dateFormat: {
|
|
175
|
+
format: string;
|
|
176
|
+
useCustomFormat: boolean;
|
|
177
|
+
customFormat: string;
|
|
178
|
+
useRelativeTime: boolean;
|
|
179
|
+
};
|
|
180
|
+
colorRanges: ColorRange_2[];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare type ColumnSettingsMap = Record<string, ColumnSettings>;
|
|
184
|
+
|
|
185
|
+
declare type ColumnType = 'string' | 'number' | 'date';
|
|
186
|
+
|
|
65
187
|
export declare type ConnectionPolicy = {
|
|
66
188
|
connectionId?: string;
|
|
67
189
|
name: string;
|
|
68
190
|
params: Params;
|
|
69
191
|
};
|
|
70
192
|
|
|
193
|
+
declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
|
|
194
|
+
|
|
71
195
|
export declare type CustomCard = CardWithContent | CardWithFooter;
|
|
72
196
|
|
|
73
197
|
export declare function Dashboard(props: DashboardProps): JSX_2.Element;
|
|
74
198
|
|
|
199
|
+
export declare type DashboardEventHandlers = {
|
|
200
|
+
onExportData?: (payload: ExportDataPayload) => void;
|
|
201
|
+
};
|
|
202
|
+
|
|
75
203
|
export declare type DashboardProps = {
|
|
76
204
|
id?: string;
|
|
77
205
|
/**
|
|
@@ -96,6 +224,7 @@ export declare type DashboardProps = {
|
|
|
96
224
|
onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
|
|
97
225
|
LoadingComponent?: (props: LoadingProps) => React.ReactNode;
|
|
98
226
|
ErrorComponent?: (props: ErrorProps) => React.ReactNode;
|
|
227
|
+
eventHandlers?: DashboardEventHandlers;
|
|
99
228
|
/**
|
|
100
229
|
* Placeholders for the dashboard.
|
|
101
230
|
*/
|
|
@@ -106,18 +235,181 @@ export declare type DashboardProps = {
|
|
|
106
235
|
selectedSheetId?: string;
|
|
107
236
|
};
|
|
108
237
|
|
|
238
|
+
declare interface DatabaseEntityReference {
|
|
239
|
+
connectionId: string;
|
|
240
|
+
connectionType: ConnectionType;
|
|
241
|
+
type: EntityType;
|
|
242
|
+
dialect?: Dialect;
|
|
243
|
+
database?: string;
|
|
244
|
+
schema?: string;
|
|
245
|
+
name: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
declare type DatabaseEntityType = 'table' | 'view';
|
|
249
|
+
|
|
250
|
+
declare interface DataModelEntityReference extends DatabaseEntityReference {
|
|
251
|
+
type: 'model';
|
|
252
|
+
id: string;
|
|
253
|
+
label: string;
|
|
254
|
+
description: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare interface DataSource {
|
|
258
|
+
connectionId: string;
|
|
259
|
+
semanticDomainId?: string;
|
|
260
|
+
connectionType: string;
|
|
261
|
+
mode: 'database' | 'upload' | 'url' | 'semanticDomain';
|
|
262
|
+
dbSelection?: {
|
|
263
|
+
database: string;
|
|
264
|
+
schema: string;
|
|
265
|
+
entityType: DatabaseEntityType;
|
|
266
|
+
};
|
|
267
|
+
selectedEntities: SelectedEntities;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM", "MMMM YYYY", "custom"];
|
|
271
|
+
|
|
272
|
+
declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
|
|
273
|
+
|
|
109
274
|
export declare type DateOptions = {
|
|
110
275
|
locale: string;
|
|
111
276
|
format: string;
|
|
112
277
|
options: Intl.DateTimeFormatOptions;
|
|
113
278
|
};
|
|
114
279
|
|
|
280
|
+
declare type Dialect = 'mysql' | 'postgresql' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb';
|
|
281
|
+
|
|
115
282
|
export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
116
283
|
|
|
284
|
+
declare interface DrillHierarchy {
|
|
285
|
+
id: string;
|
|
286
|
+
label?: string;
|
|
287
|
+
type: 'static';
|
|
288
|
+
steps: DrillHierarchyStep[];
|
|
289
|
+
default?: boolean;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare interface DrillHierarchyStep {
|
|
293
|
+
field: Field;
|
|
294
|
+
mode: 'drillDown';
|
|
295
|
+
preferredChartType?: TChartType;
|
|
296
|
+
breadcrumbLabelTemplate?: string;
|
|
297
|
+
retainFilters?: boolean;
|
|
298
|
+
label?: string;
|
|
299
|
+
linkedInsightId?: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare type DrillInteraction = DrillThroughInteraction | DrillToDetailInteraction | DrillToURLInteraction | InlineDrillInteraction;
|
|
303
|
+
|
|
304
|
+
declare interface DrillThroughInteraction {
|
|
305
|
+
mode: 'drillThrough';
|
|
306
|
+
filterFields: Field[];
|
|
307
|
+
targetSheetId: string;
|
|
308
|
+
label?: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
declare interface DrillToDetailInteraction {
|
|
312
|
+
mode: 'drillToDetail';
|
|
313
|
+
filterFields: Field[];
|
|
314
|
+
detailFields?: Field[];
|
|
315
|
+
sortBy?: SortByField[];
|
|
316
|
+
limit?: number;
|
|
317
|
+
detailTitle?: string;
|
|
318
|
+
label?: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare interface DrillToURLInteraction {
|
|
322
|
+
mode: 'drillToURL';
|
|
323
|
+
filterFields: Field[];
|
|
324
|
+
urlTemplate: string;
|
|
325
|
+
label?: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
|
|
329
|
+
|
|
330
|
+
export declare type EmailSettings = {
|
|
331
|
+
companyName: string;
|
|
332
|
+
dashboardUrl: string;
|
|
333
|
+
supportEmail: string;
|
|
334
|
+
senderTitle: string;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export declare const EMPTY_SELECTION: SelectionState;
|
|
338
|
+
|
|
339
|
+
declare type EntityType = 'table' | 'view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
|
|
340
|
+
|
|
117
341
|
export declare type ErrorProps = {
|
|
118
342
|
message?: string;
|
|
119
343
|
};
|
|
120
344
|
|
|
345
|
+
export declare type ExportDataPayload = {
|
|
346
|
+
cardId: string;
|
|
347
|
+
title: string;
|
|
348
|
+
data: Record<string, any>[];
|
|
349
|
+
sql: string;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
declare interface Field {
|
|
353
|
+
/**
|
|
354
|
+
* Unique identifier for this field instance (for joins, UI state, etc.).
|
|
355
|
+
* Should be unique within the context of the query or data model.
|
|
356
|
+
* Example: 'orders.customer_id', 'expr_12345', etc.
|
|
357
|
+
*/
|
|
358
|
+
id: string;
|
|
359
|
+
/**
|
|
360
|
+
* The physical/source column name in the database or data source.
|
|
361
|
+
* Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
|
|
362
|
+
*/
|
|
363
|
+
name: string;
|
|
364
|
+
/**
|
|
365
|
+
* Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
|
|
366
|
+
*/
|
|
367
|
+
label: string;
|
|
368
|
+
/**
|
|
369
|
+
* Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
|
|
370
|
+
* If not provided, should be auto-generated from label or name.
|
|
371
|
+
*/
|
|
372
|
+
alias?: string;
|
|
373
|
+
dataType: string;
|
|
374
|
+
description?: string;
|
|
375
|
+
qualifiedEntityName?: string;
|
|
376
|
+
dateFormat?: DateFormatValue;
|
|
377
|
+
customFormat?: string;
|
|
378
|
+
granularity?: TimeGranularity;
|
|
379
|
+
entityId: string;
|
|
380
|
+
entityName: string;
|
|
381
|
+
entityType: EntityType;
|
|
382
|
+
role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
declare interface FileEntityReference extends DatabaseEntityReference {
|
|
386
|
+
id: string;
|
|
387
|
+
type: 'file' | 'url' | 'upload';
|
|
388
|
+
label: string;
|
|
389
|
+
description: string;
|
|
390
|
+
originalName: string;
|
|
391
|
+
file?: File;
|
|
392
|
+
url?: string;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare interface FilterByColumn extends BaseColumn {
|
|
396
|
+
role: 'filter';
|
|
397
|
+
operators?: string[];
|
|
398
|
+
mode?: 'include' | 'exclude';
|
|
399
|
+
sql?: string;
|
|
400
|
+
fetchValues?: boolean;
|
|
401
|
+
fetchLimit?: number;
|
|
402
|
+
valueSource?: 'distinct' | 'static' | 'range';
|
|
403
|
+
staticValues?: string[];
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare interface FilterCondition {
|
|
407
|
+
id: string;
|
|
408
|
+
field: Field;
|
|
409
|
+
operator: Operator;
|
|
410
|
+
value: FilterValue;
|
|
411
|
+
}
|
|
412
|
+
|
|
121
413
|
declare type FilterForBetween = BaseFilter & {
|
|
122
414
|
operation: 'between' | 'not between';
|
|
123
415
|
values: [number, number];
|
|
@@ -148,6 +440,14 @@ declare type FilterForString = BaseFilter & {
|
|
|
148
440
|
values: [string];
|
|
149
441
|
};
|
|
150
442
|
|
|
443
|
+
declare interface FilterGroup {
|
|
444
|
+
id: string;
|
|
445
|
+
logicalOperator: LogicalOperator;
|
|
446
|
+
negate: boolean;
|
|
447
|
+
conditions: FilterCondition[];
|
|
448
|
+
groups: FilterGroup[];
|
|
449
|
+
}
|
|
450
|
+
|
|
151
451
|
declare type FilterLocation = 'dashboard' | 'frame' | undefined;
|
|
152
452
|
|
|
153
453
|
declare type FilterOnClick = {
|
|
@@ -155,6 +455,8 @@ declare type FilterOnClick = {
|
|
|
155
455
|
columnIndex: number;
|
|
156
456
|
};
|
|
157
457
|
|
|
458
|
+
declare type FilterValue = string | number | boolean | Date | [number, number] | [string, string] | string[] | number[];
|
|
459
|
+
|
|
158
460
|
export declare type GetDashboardResponse = {
|
|
159
461
|
dashboard: TDashboard;
|
|
160
462
|
lenses: TLens[];
|
|
@@ -166,23 +468,120 @@ export declare type GetPluginsResponse = {
|
|
|
166
468
|
plugins: {
|
|
167
469
|
label: string;
|
|
168
470
|
value: string;
|
|
471
|
+
type: PluginType;
|
|
169
472
|
}[];
|
|
170
473
|
};
|
|
171
474
|
|
|
475
|
+
declare type Granularity = 'day' | 'week' | 'month' | 'year';
|
|
476
|
+
|
|
477
|
+
declare interface GroupByColumn extends BaseColumn {
|
|
478
|
+
role: 'groupby';
|
|
479
|
+
granularity?: Granularity;
|
|
480
|
+
format?: string;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
declare interface GroupByField extends Field {
|
|
484
|
+
role: 'groupby';
|
|
485
|
+
granularity?: 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
486
|
+
/**
|
|
487
|
+
* Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
|
|
488
|
+
* If present, used in SELECT and GROUP BY instead of just the column name.
|
|
489
|
+
*/
|
|
490
|
+
expression?: string;
|
|
491
|
+
timeDrillPath?: TimeDrillStep[];
|
|
492
|
+
}
|
|
493
|
+
|
|
172
494
|
export declare type HtmlOptions = {
|
|
173
495
|
html: string;
|
|
174
496
|
};
|
|
175
497
|
|
|
498
|
+
declare interface InlineDrillInteraction {
|
|
499
|
+
mode: 'inlineDrill';
|
|
500
|
+
filterFields: Field[];
|
|
501
|
+
fetchMode?: 'lazy' | 'preloaded';
|
|
502
|
+
inlineLimit?: number;
|
|
503
|
+
label?: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare interface Join {
|
|
507
|
+
id: string;
|
|
508
|
+
source: DatabaseEntityReference;
|
|
509
|
+
target: DatabaseEntityReference;
|
|
510
|
+
joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
|
|
511
|
+
joinKeyGroups: JoinKeyGroup[];
|
|
512
|
+
sequence: number;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
declare interface JoinKey {
|
|
516
|
+
id?: string;
|
|
517
|
+
source: Field;
|
|
518
|
+
target: Field;
|
|
519
|
+
operator: string;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
declare interface JoinKeyGroup {
|
|
523
|
+
id: string;
|
|
524
|
+
operator: string;
|
|
525
|
+
keys: JoinKey[];
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
declare interface JoinPlan {
|
|
529
|
+
baseEntity: DatabaseEntityReference;
|
|
530
|
+
joins: Join[];
|
|
531
|
+
}
|
|
532
|
+
|
|
176
533
|
export declare type KPICardProps = {
|
|
177
534
|
card: TCard;
|
|
178
535
|
isLoading?: boolean;
|
|
179
536
|
renderFilterInfo?: () => JSX.Element | null;
|
|
180
537
|
};
|
|
181
538
|
|
|
539
|
+
export declare type Level = 'database' | 'schema' | 'table';
|
|
540
|
+
|
|
182
541
|
export declare type LoadingProps = {
|
|
183
542
|
message?: string;
|
|
184
543
|
};
|
|
185
544
|
|
|
545
|
+
declare type LogicalOperator = 'AND' | 'OR';
|
|
546
|
+
|
|
547
|
+
declare interface MetricColumn extends BaseColumn {
|
|
548
|
+
role: 'metric';
|
|
549
|
+
aggregate: AggregateFunction;
|
|
550
|
+
aliasTemplate?: string;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
declare interface MetricField extends Field {
|
|
554
|
+
role: 'metric';
|
|
555
|
+
aggregate: AggregateFunction;
|
|
556
|
+
/**
|
|
557
|
+
* Optional SQL expression for the metric (e.g., ship_date - order_date).
|
|
558
|
+
* If present, used as aggregate(expression) instead of aggregate(name).
|
|
559
|
+
*/
|
|
560
|
+
expression?: string;
|
|
561
|
+
/**
|
|
562
|
+
* Optional parameters for future extensibility (e.g., window functions).
|
|
563
|
+
* * Example:
|
|
564
|
+
* {
|
|
565
|
+
aggregate: "SUM",
|
|
566
|
+
name: "sales",
|
|
567
|
+
parameters: {
|
|
568
|
+
window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
{
|
|
573
|
+
aggregate: "COUNT",
|
|
574
|
+
name: "order_id",
|
|
575
|
+
parameters: {
|
|
576
|
+
filter: "status = 'Active'"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
*/
|
|
580
|
+
parameters?: Record<string, any>;
|
|
581
|
+
aliasTemplate?: string;
|
|
582
|
+
valueAliases?: Record<string, string>;
|
|
583
|
+
}
|
|
584
|
+
|
|
186
585
|
declare type NoneOptions = {};
|
|
187
586
|
|
|
188
587
|
export declare type NumberAxisFormat = {
|
|
@@ -199,8 +598,12 @@ export declare type NumberOptions = {
|
|
|
199
598
|
colorRanges?: ColorRange[];
|
|
200
599
|
};
|
|
201
600
|
|
|
601
|
+
declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
602
|
+
|
|
202
603
|
declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
203
604
|
|
|
605
|
+
declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between';
|
|
606
|
+
|
|
204
607
|
declare type OptionsMap = {
|
|
205
608
|
number: NumberOptions;
|
|
206
609
|
string: StringOptions;
|
|
@@ -209,10 +612,19 @@ declare type OptionsMap = {
|
|
|
209
612
|
none: NoneOptions;
|
|
210
613
|
};
|
|
211
614
|
|
|
615
|
+
declare interface OrderBy {
|
|
616
|
+
columnId: string;
|
|
617
|
+
direction: 'asc' | 'desc';
|
|
618
|
+
}
|
|
619
|
+
|
|
212
620
|
declare type Params = {
|
|
213
621
|
[key: string]: string | number | string[] | number[];
|
|
214
622
|
};
|
|
215
623
|
|
|
624
|
+
declare interface PivotByField extends Field {
|
|
625
|
+
role: 'pivotby';
|
|
626
|
+
}
|
|
627
|
+
|
|
216
628
|
export declare type Placeholders = {
|
|
217
629
|
/**
|
|
218
630
|
* Placeholder for the card when there are no records to display.
|
|
@@ -224,6 +636,39 @@ export declare type Placeholders = {
|
|
|
224
636
|
SessionExpired?: React.ReactNode;
|
|
225
637
|
};
|
|
226
638
|
|
|
639
|
+
export declare type PluginType = 'custom' | 'standard';
|
|
640
|
+
|
|
641
|
+
declare interface QueryConfig {
|
|
642
|
+
groupByColumns?: GroupByColumn[];
|
|
643
|
+
pivotColumns?: GroupByColumn[];
|
|
644
|
+
metricColumns?: MetricColumn[];
|
|
645
|
+
filterColumns?: FilterByColumn[];
|
|
646
|
+
filters?: QueryFilter[];
|
|
647
|
+
limit?: number;
|
|
648
|
+
orderBy?: OrderBy[];
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
declare type QueryFilter = {
|
|
652
|
+
filterColumnName: string;
|
|
653
|
+
filterValue: OldFilterValue;
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
declare type RangeValue = {
|
|
657
|
+
gte?: string | number;
|
|
658
|
+
lte?: string | number;
|
|
659
|
+
lt?: string | number;
|
|
660
|
+
gt?: string | number;
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
declare type SelectedEntities = DatabaseEntityReference[] | DataModelEntityReference[] | FileEntityReference[];
|
|
664
|
+
|
|
665
|
+
export declare type SelectionState = Record<Level, string | null>;
|
|
666
|
+
|
|
667
|
+
declare interface SortByField extends Field {
|
|
668
|
+
role: 'sortby';
|
|
669
|
+
direction: 'asc' | 'desc';
|
|
670
|
+
}
|
|
671
|
+
|
|
227
672
|
export declare type SqlGen = {
|
|
228
673
|
measures?: {
|
|
229
674
|
name: string;
|
|
@@ -251,6 +696,14 @@ export declare type StyleProps = {
|
|
|
251
696
|
dashboardCardContainer?: string;
|
|
252
697
|
dashboardCard?: string;
|
|
253
698
|
/** grid-layout config */
|
|
699
|
+
/**
|
|
700
|
+
* Border radius for the control inputs such as filter input, tabs, date picker, etc.
|
|
701
|
+
*/
|
|
702
|
+
controlInputRadius?: number;
|
|
703
|
+
/**
|
|
704
|
+
* Border radius for the cards
|
|
705
|
+
*/
|
|
706
|
+
cardBorderRadius?: number;
|
|
254
707
|
gridLayout?: {
|
|
255
708
|
/** css class for `react-grid-layout` */
|
|
256
709
|
className?: string;
|
|
@@ -269,6 +722,13 @@ export declare type StyleProps = {
|
|
|
269
722
|
};
|
|
270
723
|
};
|
|
271
724
|
|
|
725
|
+
declare type TablePreferences = {
|
|
726
|
+
columnSettingsMap?: ColumnSettingsMap;
|
|
727
|
+
selectColumnVisible?: boolean;
|
|
728
|
+
columnVisibility?: Record<string, boolean>;
|
|
729
|
+
pageSize?: number;
|
|
730
|
+
};
|
|
731
|
+
|
|
272
732
|
export declare type TBaseQuery = {
|
|
273
733
|
id: string;
|
|
274
734
|
name: string;
|
|
@@ -290,7 +750,10 @@ export declare type TCard = {
|
|
|
290
750
|
type: TChartType;
|
|
291
751
|
sql?: string;
|
|
292
752
|
python?: string;
|
|
293
|
-
|
|
753
|
+
dataSource?: DataSource;
|
|
754
|
+
config?: CardConfig;
|
|
755
|
+
interactionConfig?: CardInteractionConfig;
|
|
756
|
+
queryConfig?: QueryConfig;
|
|
294
757
|
customCfg?: any;
|
|
295
758
|
preferences?: TCardPreferences;
|
|
296
759
|
customCardPreferences?: TCustomCardPreferences;
|
|
@@ -326,6 +789,7 @@ export declare type TCardPreferences = {
|
|
|
326
789
|
datasetOptions?: TDatasetOptions[];
|
|
327
790
|
chartOptions?: TChartOptions;
|
|
328
791
|
columnSettings?: TColumnSetting<DisplayDataType>[];
|
|
792
|
+
tablePrefs?: TablePreferences;
|
|
329
793
|
allowDownload?: boolean;
|
|
330
794
|
customVisualCode?: string;
|
|
331
795
|
textVisualOptions?: {
|
|
@@ -341,6 +805,10 @@ export declare type TCardPreferences = {
|
|
|
341
805
|
projectionOffset?: [number, number];
|
|
342
806
|
colorScale?: string;
|
|
343
807
|
};
|
|
808
|
+
kpiVisualOptions?: {
|
|
809
|
+
lowerIsBetter?: boolean;
|
|
810
|
+
countryLogoId?: string;
|
|
811
|
+
};
|
|
344
812
|
};
|
|
345
813
|
|
|
346
814
|
export declare type TChartOptions = {
|
|
@@ -372,10 +840,13 @@ export declare type TChartOptions = {
|
|
|
372
840
|
indexAxis?: 'x' | 'y' | undefined;
|
|
373
841
|
plugins?: {
|
|
374
842
|
legend?: TLegendOptions;
|
|
843
|
+
datalabels?: {
|
|
844
|
+
anchor?: string;
|
|
845
|
+
};
|
|
375
846
|
};
|
|
376
847
|
};
|
|
377
848
|
|
|
378
|
-
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
|
|
849
|
+
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
|
|
379
850
|
|
|
380
851
|
export declare type TColumnSetting<T extends DisplayDataType> = {
|
|
381
852
|
columnIdx: number;
|
|
@@ -390,6 +861,7 @@ export declare type TCustomCardPreferences = {
|
|
|
390
861
|
url: string;
|
|
391
862
|
componentName: string;
|
|
392
863
|
icon?: string;
|
|
864
|
+
pluginChartType?: string;
|
|
393
865
|
type?: 'iframe' | 'component';
|
|
394
866
|
visualType?: 'single' | 'multiple';
|
|
395
867
|
settings?: any;
|
|
@@ -407,6 +879,7 @@ export declare type TCustomCardPreferences = {
|
|
|
407
879
|
export declare type TDashboard = {
|
|
408
880
|
id: string;
|
|
409
881
|
title?: string;
|
|
882
|
+
aiContext?: AIContext;
|
|
410
883
|
description?: string;
|
|
411
884
|
sheets?: TSheet[];
|
|
412
885
|
style?: TStyle;
|
|
@@ -416,12 +889,16 @@ export declare type TDashboard = {
|
|
|
416
889
|
aiScopeTables?: AIScopeTable[];
|
|
417
890
|
globalStyle?: TStyle;
|
|
418
891
|
globalCacheConfig?: CacheConfig;
|
|
892
|
+
emailSettings?: EmailSettings;
|
|
893
|
+
defaultFilterValues?: TFilterValue[];
|
|
419
894
|
};
|
|
420
895
|
|
|
421
896
|
export declare type TDataColumn = {
|
|
422
897
|
column_name: string;
|
|
423
898
|
data_type: string;
|
|
424
899
|
is_nullable?: string;
|
|
900
|
+
label?: string;
|
|
901
|
+
description?: string;
|
|
425
902
|
};
|
|
426
903
|
|
|
427
904
|
export declare type TDatasetOptions = {
|
|
@@ -437,6 +914,11 @@ export declare type TDatasetOptions = {
|
|
|
437
914
|
};
|
|
438
915
|
};
|
|
439
916
|
|
|
917
|
+
export declare type TDbCapabilities = {
|
|
918
|
+
path: Level[];
|
|
919
|
+
labels?: Partial<Record<Level, string>>;
|
|
920
|
+
};
|
|
921
|
+
|
|
440
922
|
export declare type TEvent = {
|
|
441
923
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
442
924
|
message: any;
|
|
@@ -470,6 +952,15 @@ export declare type TFrame = {
|
|
|
470
952
|
|
|
471
953
|
export declare type Theme = 'dark' | 'light' | 'system';
|
|
472
954
|
|
|
955
|
+
declare interface TimeDrillStep {
|
|
956
|
+
granularity: TimeGranularity;
|
|
957
|
+
next?: TimeGranularity;
|
|
958
|
+
comparison?: 'previous_year' | 'previous_period';
|
|
959
|
+
rollingWindow?: number;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
963
|
+
|
|
473
964
|
export declare type TLegendOptions = {
|
|
474
965
|
display?: boolean;
|
|
475
966
|
position?: 'top' | 'left' | 'bottom' | 'right';
|
package/dist/types/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={database:null,schema:null,table:null};exports.EMPTY_SELECTION=e;
|