semaphor 0.0.95 → 0.0.97
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 +20 -0
- package/dist/chunks/{index-0MEcYsnu.js → index-D-YGno0n.js} +24309 -17952
- package/dist/chunks/index-D58ery3w.js +396 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +4 -2
- package/dist/index.cjs +117 -67
- package/dist/index.js +5607 -3881
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -0
- package/dist/types/dashboard.d.ts +87 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -1
- package/dist/types/main.d.ts +169 -16
- package/dist/types/surfboard.d.ts +87 -1
- package/dist/types/types.d.ts +87 -1
- package/package.json +5 -1
- package/dist/chunks/index-Bbfo9qsA.js +0 -369
package/dist/types/types.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ 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' | 'COUNT' | 'MAX' | 'MIN' | 'DISTINCT';
|
|
6
|
+
|
|
5
7
|
export declare type AIScopeTable = {
|
|
6
8
|
connectionId: string;
|
|
7
9
|
connectionType: string;
|
|
@@ -12,11 +14,21 @@ export declare type AIScopeTable = {
|
|
|
12
14
|
datamodelName: string;
|
|
13
15
|
};
|
|
14
16
|
|
|
17
|
+
export declare type AssistantId = 'dashboard-assistant' | 'editor-assistant';
|
|
18
|
+
|
|
15
19
|
export declare type AuthToken = {
|
|
16
20
|
accessToken: string;
|
|
17
21
|
refreshToken?: string;
|
|
18
22
|
};
|
|
19
23
|
|
|
24
|
+
declare interface BaseColumn {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
type: ColumnType;
|
|
29
|
+
table?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
declare type BaseCustomCard = {
|
|
21
33
|
cardId: string;
|
|
22
34
|
replaceDefault?: boolean;
|
|
@@ -61,6 +73,8 @@ export declare type ColorRange = {
|
|
|
61
73
|
color: string;
|
|
62
74
|
};
|
|
63
75
|
|
|
76
|
+
declare type ColumnType = 'string' | 'number' | 'date';
|
|
77
|
+
|
|
64
78
|
export declare type ConnectionPolicy = {
|
|
65
79
|
connectionId?: string;
|
|
66
80
|
name: string;
|
|
@@ -111,6 +125,8 @@ export declare type DateOptions = {
|
|
|
111
125
|
|
|
112
126
|
export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
113
127
|
|
|
128
|
+
export declare type DroppableId = 'droppable-group-by' | 'droppable-metric';
|
|
129
|
+
|
|
114
130
|
export declare type EmailSettings = {
|
|
115
131
|
companyName: string;
|
|
116
132
|
dashboardUrl: string;
|
|
@@ -118,10 +134,23 @@ export declare type EmailSettings = {
|
|
|
118
134
|
senderTitle: string;
|
|
119
135
|
};
|
|
120
136
|
|
|
137
|
+
export declare const EMPTY_SELECTION: SelectionState;
|
|
138
|
+
|
|
121
139
|
export declare type ErrorProps = {
|
|
122
140
|
message?: string;
|
|
123
141
|
};
|
|
124
142
|
|
|
143
|
+
declare interface FilterByColumn extends BaseColumn {
|
|
144
|
+
role: 'filter';
|
|
145
|
+
operators?: string[];
|
|
146
|
+
mode?: 'include' | 'exclude';
|
|
147
|
+
sql?: string;
|
|
148
|
+
fetchValues?: boolean;
|
|
149
|
+
fetchLimit?: number;
|
|
150
|
+
valueSource?: 'distinct' | 'static' | 'range';
|
|
151
|
+
staticValues?: string[];
|
|
152
|
+
}
|
|
153
|
+
|
|
125
154
|
declare type FilterForBetween = BaseFilter & {
|
|
126
155
|
operation: 'between' | 'not between';
|
|
127
156
|
values: [number, number];
|
|
@@ -159,6 +188,8 @@ declare type FilterOnClick = {
|
|
|
159
188
|
columnIndex: number;
|
|
160
189
|
};
|
|
161
190
|
|
|
191
|
+
declare type FilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
192
|
+
|
|
162
193
|
export declare type GetDashboardResponse = {
|
|
163
194
|
dashboard: TDashboard;
|
|
164
195
|
lenses: TLens[];
|
|
@@ -173,6 +204,14 @@ export declare type GetPluginsResponse = {
|
|
|
173
204
|
}[];
|
|
174
205
|
};
|
|
175
206
|
|
|
207
|
+
declare type Granularity = 'day' | 'week' | 'month' | 'year';
|
|
208
|
+
|
|
209
|
+
declare interface GroupByColumn extends BaseColumn {
|
|
210
|
+
role: 'groupby';
|
|
211
|
+
granularity?: Granularity;
|
|
212
|
+
format?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
176
215
|
export declare type HtmlOptions = {
|
|
177
216
|
html: string;
|
|
178
217
|
};
|
|
@@ -183,10 +222,18 @@ export declare type KPICardProps = {
|
|
|
183
222
|
renderFilterInfo?: () => JSX.Element | null;
|
|
184
223
|
};
|
|
185
224
|
|
|
225
|
+
export declare type Level = 'database' | 'schema' | 'table';
|
|
226
|
+
|
|
186
227
|
export declare type LoadingProps = {
|
|
187
228
|
message?: string;
|
|
188
229
|
};
|
|
189
230
|
|
|
231
|
+
declare interface MetricColumn extends BaseColumn {
|
|
232
|
+
role: 'metric';
|
|
233
|
+
aggregate: AggregateFunction;
|
|
234
|
+
aliasTemplate?: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
190
237
|
declare type NoneOptions = {};
|
|
191
238
|
|
|
192
239
|
export declare type NumberAxisFormat = {
|
|
@@ -213,6 +260,11 @@ declare type OptionsMap = {
|
|
|
213
260
|
none: NoneOptions;
|
|
214
261
|
};
|
|
215
262
|
|
|
263
|
+
declare interface OrderBy {
|
|
264
|
+
columnId: string;
|
|
265
|
+
direction: 'asc' | 'desc';
|
|
266
|
+
}
|
|
267
|
+
|
|
216
268
|
declare type Params = {
|
|
217
269
|
[key: string]: string | number | string[] | number[];
|
|
218
270
|
};
|
|
@@ -228,6 +280,30 @@ export declare type Placeholders = {
|
|
|
228
280
|
SessionExpired?: React.ReactNode;
|
|
229
281
|
};
|
|
230
282
|
|
|
283
|
+
declare interface QueryConfig {
|
|
284
|
+
groupByColumns?: GroupByColumn[];
|
|
285
|
+
pivotColumns?: GroupByColumn[];
|
|
286
|
+
metricColumns?: MetricColumn[];
|
|
287
|
+
filterColumns?: FilterByColumn[];
|
|
288
|
+
filters?: QueryFilter[];
|
|
289
|
+
limit?: number;
|
|
290
|
+
orderBy?: OrderBy[];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare type QueryFilter = {
|
|
294
|
+
filterColumnName: string;
|
|
295
|
+
filterValue: FilterValue;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
declare type RangeValue = {
|
|
299
|
+
gte?: string | number;
|
|
300
|
+
lte?: string | number;
|
|
301
|
+
lt?: string | number;
|
|
302
|
+
gt?: string | number;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export declare type SelectionState = Record<Level, string | null>;
|
|
306
|
+
|
|
231
307
|
export declare type SqlGen = {
|
|
232
308
|
measures?: {
|
|
233
309
|
name: string;
|
|
@@ -302,6 +378,7 @@ export declare type TCard = {
|
|
|
302
378
|
type: TChartType;
|
|
303
379
|
sql?: string;
|
|
304
380
|
python?: string;
|
|
381
|
+
queryConfig?: QueryConfig;
|
|
305
382
|
customCfg?: any;
|
|
306
383
|
preferences?: TCardPreferences;
|
|
307
384
|
customCardPreferences?: TCustomCardPreferences;
|
|
@@ -352,6 +429,9 @@ export declare type TCardPreferences = {
|
|
|
352
429
|
projectionOffset?: [number, number];
|
|
353
430
|
colorScale?: string;
|
|
354
431
|
};
|
|
432
|
+
kpiVisualOptions?: {
|
|
433
|
+
lowerIsBetter?: boolean;
|
|
434
|
+
};
|
|
355
435
|
};
|
|
356
436
|
|
|
357
437
|
export declare type TChartOptions = {
|
|
@@ -389,7 +469,7 @@ export declare type TChartOptions = {
|
|
|
389
469
|
};
|
|
390
470
|
};
|
|
391
471
|
|
|
392
|
-
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
|
|
472
|
+
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
|
|
393
473
|
|
|
394
474
|
export declare type TColumnSetting<T extends DisplayDataType> = {
|
|
395
475
|
columnIdx: number;
|
|
@@ -431,6 +511,7 @@ export declare type TDashboard = {
|
|
|
431
511
|
globalStyle?: TStyle;
|
|
432
512
|
globalCacheConfig?: CacheConfig;
|
|
433
513
|
emailSettings?: EmailSettings;
|
|
514
|
+
defaultFilterValues?: TFilterValue[];
|
|
434
515
|
};
|
|
435
516
|
|
|
436
517
|
export declare type TDataColumn = {
|
|
@@ -452,6 +533,11 @@ export declare type TDatasetOptions = {
|
|
|
452
533
|
};
|
|
453
534
|
};
|
|
454
535
|
|
|
536
|
+
export declare type TDbCapabilities = {
|
|
537
|
+
path: Level[];
|
|
538
|
+
labels?: Partial<Record<Level, string>>;
|
|
539
|
+
};
|
|
540
|
+
|
|
455
541
|
export declare type TEvent = {
|
|
456
542
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
457
543
|
message: any;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.97",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@ai-sdk/react": "^1.1.18",
|
|
50
|
+
"@dnd-kit/core": "^6.3.1",
|
|
51
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
52
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
50
53
|
"@headlessui/react": "^2.2.0",
|
|
51
54
|
"@monaco-editor/react": "^4.7.0-rc.0",
|
|
52
55
|
"@r2wc/react-to-web-component": "^2.0.4",
|
|
@@ -74,6 +77,7 @@
|
|
|
74
77
|
"@tanstack/react-table": "^8.11.7",
|
|
75
78
|
"ai": "^4.1.46",
|
|
76
79
|
"chart.js": "^4.4.1",
|
|
80
|
+
"chartjs-chart-funnel": "^4.2.4",
|
|
77
81
|
"chartjs-chart-geo": "^4.3.4",
|
|
78
82
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
79
83
|
"class-variance-authority": "^0.7.0",
|