semaphor 0.0.47 → 0.0.48

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.
@@ -3,6 +3,14 @@ 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
+ export declare type AIScopeTable = {
7
+ connectinonId: string;
8
+ connectionType: string;
9
+ databaseName?: string;
10
+ schemaName?: string;
11
+ tableName: string;
12
+ };
13
+
6
14
  export declare type AuthToken = {
7
15
  accessToken: string;
8
16
  refreshToken?: string;
@@ -48,6 +56,12 @@ declare type CardWithFooter = BaseCustomCard & {
48
56
  }>;
49
57
  };
50
58
 
59
+ export declare type ColorRange = {
60
+ start: number;
61
+ end: number;
62
+ color: string;
63
+ };
64
+
51
65
  export declare type ConnectionPolicy = {
52
66
  connectionId?: string;
53
67
  name: string;
@@ -75,6 +89,14 @@ export declare type DashboardProps = {
75
89
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
76
90
  };
77
91
 
92
+ export declare type DateOptions = {
93
+ locale: string;
94
+ format: string;
95
+ options: Intl.DateTimeFormatOptions;
96
+ };
97
+
98
+ export declare type DisplayDataType = 'string' | 'date' | 'number';
99
+
78
100
  export declare type ErrorProps = {
79
101
  message?: string;
80
102
  };
@@ -123,8 +145,28 @@ export declare type LoadingProps = {
123
145
  message?: string;
124
146
  };
125
147
 
148
+ export declare type NumberAxisFormat = {
149
+ decimalPlaces?: number;
150
+ suffix?: string;
151
+ currency?: string;
152
+ locale?: string;
153
+ };
154
+
155
+ export declare type NumberOptions = {
156
+ locale: string;
157
+ currency?: string;
158
+ options: Intl.NumberFormatOptions;
159
+ colorRanges?: ColorRange[];
160
+ };
161
+
126
162
  declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
127
163
 
164
+ declare type OptionsMap = {
165
+ number: NumberOptions;
166
+ string: StringOptions;
167
+ date: DateOptions;
168
+ };
169
+
128
170
  declare type Params = {
129
171
  [key: string]: string | number | string[] | number[];
130
172
  };
@@ -137,6 +179,10 @@ export declare type SqlGen = {
137
179
  dimensions?: string[];
138
180
  };
139
181
 
182
+ declare type StringOptions = {
183
+ maxLength?: number;
184
+ };
185
+
140
186
  /**
141
187
  * Style propeerites for the dashboard
142
188
  */
@@ -163,6 +209,9 @@ export declare type StyleProps = {
163
209
  /** chart options */
164
210
  options?: any;
165
211
  };
212
+ table?: {
213
+ tableHeaderColor?: string;
214
+ };
166
215
  };
167
216
 
168
217
  export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
@@ -206,14 +255,18 @@ export declare type TCardPreferences = {
206
255
  filterOnClickField?: string;
207
256
  filterOnClickColumnIndex?: number;
208
257
  formatNumber?: {
209
- format?: string;
258
+ decimalPlaces?: number;
210
259
  currency?: string;
211
260
  locale?: string;
212
261
  suffix?: string;
213
262
  enabled?: boolean | string;
263
+ colorRanges?: ColorRange[];
214
264
  };
265
+ numberAxisFormat?: NumberAxisFormat;
215
266
  datasetOptions?: TDatasetOptions[];
216
267
  chartOptions?: TChartOptions;
268
+ columnSettings?: TColumnSetting<DisplayDataType>[];
269
+ allowDownload?: boolean;
217
270
  };
218
271
 
219
272
  export declare type TChartOptions = {
@@ -239,7 +292,13 @@ export declare type TChartOptions = {
239
292
  indexAxis?: 'x' | 'y' | undefined;
240
293
  };
241
294
 
242
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'table' | 'kpi' | 'custom';
295
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'table' | 'kpi' | 'pyramid' | 'custom';
296
+
297
+ export declare type TColumnSetting<T extends DisplayDataType> = {
298
+ columnIdx: number;
299
+ type: T;
300
+ options: OptionsMap[T];
301
+ };
243
302
 
244
303
  export declare type TDashboard = {
245
304
  id: string;
@@ -250,6 +309,8 @@ export declare type TDashboard = {
250
309
  filters?: TFilter[];
251
310
  customCards?: CustomCard[];
252
311
  baseQueries?: TBaseQuery[];
312
+ aiScopeTables?: AIScopeTable[];
313
+ globalStyle?: TStyle;
253
314
  };
254
315
 
255
316
  export declare type TDataColumn = {
@@ -2,6 +2,14 @@ import { FontSpec } from 'chart.js';
2
2
 
3
3
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
4
4
 
5
+ export declare type AIScopeTable = {
6
+ connectinonId: string;
7
+ connectionType: string;
8
+ databaseName?: string;
9
+ schemaName?: string;
10
+ tableName: string;
11
+ };
12
+
5
13
  export declare type AuthToken = {
6
14
  accessToken: string;
7
15
  refreshToken?: string;
@@ -47,6 +55,12 @@ declare type CardWithFooter = BaseCustomCard & {
47
55
  }>;
48
56
  };
49
57
 
58
+ export declare type ColorRange = {
59
+ start: number;
60
+ end: number;
61
+ color: string;
62
+ };
63
+
50
64
  export declare type ConnectionPolicy = {
51
65
  connectionId?: string;
52
66
  name: string;
@@ -69,6 +83,14 @@ export declare type DashboardProps = {
69
83
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
70
84
  };
71
85
 
86
+ export declare type DateOptions = {
87
+ locale: string;
88
+ format: string;
89
+ options: Intl.DateTimeFormatOptions;
90
+ };
91
+
92
+ export declare type DisplayDataType = 'string' | 'date' | 'number';
93
+
72
94
  export declare type ErrorProps = {
73
95
  message?: string;
74
96
  };
@@ -117,8 +139,28 @@ export declare type LoadingProps = {
117
139
  message?: string;
118
140
  };
119
141
 
142
+ export declare type NumberAxisFormat = {
143
+ decimalPlaces?: number;
144
+ suffix?: string;
145
+ currency?: string;
146
+ locale?: string;
147
+ };
148
+
149
+ export declare type NumberOptions = {
150
+ locale: string;
151
+ currency?: string;
152
+ options: Intl.NumberFormatOptions;
153
+ colorRanges?: ColorRange[];
154
+ };
155
+
120
156
  declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
121
157
 
158
+ declare type OptionsMap = {
159
+ number: NumberOptions;
160
+ string: StringOptions;
161
+ date: DateOptions;
162
+ };
163
+
122
164
  declare type Params = {
123
165
  [key: string]: string | number | string[] | number[];
124
166
  };
@@ -131,6 +173,10 @@ export declare type SqlGen = {
131
173
  dimensions?: string[];
132
174
  };
133
175
 
176
+ declare type StringOptions = {
177
+ maxLength?: number;
178
+ };
179
+
134
180
  /**
135
181
  * Style propeerites for the dashboard
136
182
  */
@@ -157,6 +203,9 @@ export declare type StyleProps = {
157
203
  /** chart options */
158
204
  options?: any;
159
205
  };
206
+ table?: {
207
+ tableHeaderColor?: string;
208
+ };
160
209
  };
161
210
 
162
211
  export declare type TBaseQuery = {
@@ -198,14 +247,18 @@ export declare type TCardPreferences = {
198
247
  filterOnClickField?: string;
199
248
  filterOnClickColumnIndex?: number;
200
249
  formatNumber?: {
201
- format?: string;
250
+ decimalPlaces?: number;
202
251
  currency?: string;
203
252
  locale?: string;
204
253
  suffix?: string;
205
254
  enabled?: boolean | string;
255
+ colorRanges?: ColorRange[];
206
256
  };
257
+ numberAxisFormat?: NumberAxisFormat;
207
258
  datasetOptions?: TDatasetOptions[];
208
259
  chartOptions?: TChartOptions;
260
+ columnSettings?: TColumnSetting<DisplayDataType>[];
261
+ allowDownload?: boolean;
209
262
  };
210
263
 
211
264
  export declare type TChartOptions = {
@@ -231,7 +284,13 @@ export declare type TChartOptions = {
231
284
  indexAxis?: 'x' | 'y' | undefined;
232
285
  };
233
286
 
234
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'table' | 'kpi' | 'custom';
287
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'table' | 'kpi' | 'pyramid' | 'custom';
288
+
289
+ export declare type TColumnSetting<T extends DisplayDataType> = {
290
+ columnIdx: number;
291
+ type: T;
292
+ options: OptionsMap[T];
293
+ };
235
294
 
236
295
  export declare type TDashboard = {
237
296
  id: string;
@@ -242,6 +301,8 @@ export declare type TDashboard = {
242
301
  filters?: TFilter[];
243
302
  customCards?: CustomCard[];
244
303
  baseQueries?: TBaseQuery[];
304
+ aiScopeTables?: AIScopeTable[];
305
+ globalStyle?: TStyle;
245
306
  };
246
307
 
247
308
  export declare type TDataColumn = {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.47",
8
+ "version": "0.0.48",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -45,6 +45,7 @@
45
45
  "preview": "vite preview"
46
46
  },
47
47
  "dependencies": {
48
+ "@ai-sdk/react": "^0.0.36",
48
49
  "@headlessui/react": "^1.7.18",
49
50
  "@monaco-editor/react": "^4.6.0",
50
51
  "@r2wc/react-to-web-component": "^2.0.3",
@@ -69,6 +70,7 @@
69
70
  "@tailwindcss/container-queries": "^0.1.1",
70
71
  "@tanstack/react-query": "^5.15.0",
71
72
  "@tanstack/react-table": "^8.11.7",
73
+ "ai": "^3.3.0",
72
74
  "chart.js": "^4.4.1",
73
75
  "chartjs-plugin-datalabels": "^2.2.0",
74
76
  "class-variance-authority": "^0.7.0",
@@ -81,6 +83,7 @@
81
83
  "lodash": "^4.17.21",
82
84
  "lucide-react": "^0.379.0",
83
85
  "ms": "^2.1.3",
86
+ "next-themes": "^0.3.0",
84
87
  "react": "^18.2.0",
85
88
  "react-day-picker": "^8.10.0",
86
89
  "react-dom": "^18.2.0",
@@ -90,6 +93,7 @@
90
93
  "react-resizable-panels": "^1.0.7",
91
94
  "react-select": "^5.8.0",
92
95
  "react-split-pane": "^2.0.3",
96
+ "sonner": "^1.5.0",
93
97
  "tailwind-merge": "^2.1.0",
94
98
  "tailwindcss-animate": "^1.0.7",
95
99
  "uuid": "^9.0.1",