semaphor 0.0.91 → 0.0.94

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.
@@ -5,6 +5,7 @@ import { ChartConfiguration } from 'chart.js';
5
5
  import { CustomCard as CustomCard_2 } from '..';
6
6
  import { DateRange } from 'react-day-picker';
7
7
  import { default as default_2 } from 'react-grid-layout';
8
+ import { EmailSettings as EmailSettings_2 } from '..';
8
9
  import { FontSpec } from 'chart.js';
9
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
10
11
  import { QueryObserverResult } from '@tanstack/query-core';
@@ -19,6 +20,7 @@ import { WritableDraft } from 'immer';
19
20
  declare type Actions = {
20
21
  setInitStore: () => void;
21
22
  setGlobalStyle: (style: TStyle) => void;
23
+ updateEmailSettings: (emailSettings: EmailSettings) => void;
22
24
  setIsDownloadingPdf: (isDownloadingPdf: boolean) => void;
23
25
  setLenses: (lenses: TLens[]) => void;
24
26
  setSelectedLensId: (lensId: string) => void;
@@ -94,6 +96,13 @@ declare type Actions = {
94
96
  };
95
97
 
96
98
  declare type Actions_2 = {
99
+ setCurrentAssitantScope: (currentAssitantScope: AIScopeTable[]) => void;
100
+ setChartGrid: (chartGrid: 'xy' | 'x' | 'y' | 'none') => void;
101
+ setLegendOptions: (legendOptions: TLegendOptions) => void;
102
+ runAssistant: (message: string) => void;
103
+ setShowAIDialog: (showAIDialog: boolean) => void;
104
+ setUserInputForAI: (userInputForAI: string) => void;
105
+ setTriggerAIRun: (triggerAIRun: boolean) => void;
97
106
  setActiveTabCardId: (activeTabCardId: string) => void;
98
107
  updateCardTab: (activeTabCardId: string, currentCard: TCard) => void;
99
108
  setSortChart: (sortChart: 'asc' | 'desc' | 'none') => void;
@@ -122,7 +131,6 @@ declare type Actions_2 = {
122
131
  setCardPython: (python: string | undefined) => void;
123
132
  setPythonStdOut: (pythonStdOut: string) => void;
124
133
  setCardCustomCfg: (cfg: any) => void;
125
- setCardCfg: (cfg: any) => void;
126
134
  setShowFilters: (showFilters: boolean) => void;
127
135
  setApplyFilters: (applyFilters: boolean) => void;
128
136
  setFilterValues: (filterValues: TFilterValue[]) => void;
@@ -145,10 +153,11 @@ export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'C
145
153
  export declare type AIScopeTable = {
146
154
  connectionId: string;
147
155
  connectionType: string;
148
- databaseName?: string;
149
- schemaName?: string;
150
- tableName?: string;
151
- datamodelName?: string;
156
+ databaseName: string;
157
+ schemaName: string;
158
+ tableName: string;
159
+ datamodelId: string;
160
+ datamodelName: string;
152
161
  };
153
162
 
154
163
  export declare type AuthToken = {
@@ -299,6 +308,9 @@ export declare function downloadPdf(): Promise<void>;
299
308
 
300
309
  declare type EditorStore = {
301
310
  isShowingVisual: boolean;
311
+ showAIDialog: boolean;
312
+ userInputForAI: string;
313
+ triggerAIRun: boolean;
302
314
  runSql: boolean;
303
315
  isSqlRunning: boolean;
304
316
  actions: Actions_2;
@@ -318,6 +330,7 @@ declare type EditorStore = {
318
330
  selectedSchemaName?: string;
319
331
  selectedTableName?: string;
320
332
  currentColumns?: TDataColumn[];
333
+ currentAssitantScope?: AIScopeTable[];
321
334
  onConnectionChange?: (connectionId: string) => void;
322
335
  onDatamodelChange?: (datamodelId: string) => void;
323
336
  onDatabaseChange?: (databaseName: string) => void;
@@ -327,6 +340,13 @@ declare type EditorStore = {
327
340
  onClose?: () => void;
328
341
  };
329
342
 
343
+ export declare type EmailSettings = {
344
+ companyName: string;
345
+ dashboardUrl: string;
346
+ supportEmail: string;
347
+ senderTitle: string;
348
+ };
349
+
330
350
  export declare type ErrorProps = {
331
351
  message?: string;
332
352
  };
@@ -397,6 +417,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
397
417
  aiScopeTables?: AIScopeTable_2[];
398
418
  globalStyle?: TStyle_2;
399
419
  globalCacheConfig?: CacheConfig_2;
420
+ emailSettings?: EmailSettings_2;
400
421
  };
401
422
 
402
423
  export declare type GetDashboardResponse = {
@@ -493,9 +514,15 @@ export declare type Placeholders = {
493
514
  SessionExpired?: React.ReactNode;
494
515
  };
495
516
 
517
+ export declare function resolveDatamodelName(datamodelName: string): string;
518
+
496
519
  export declare const resolveDataType: (value: any) => string;
497
520
 
498
- export declare function SelectComponent({ title, items, value, isLoading, isError, refetch, connectionTooltip, onChange, showNone, className, showIcon, disabled, }: SelectProps): JSX_2.Element;
521
+ export declare function ScheduleDashboard({ triggerButtonClassName, }: {
522
+ triggerButtonClassName?: string;
523
+ }): JSX_2.Element;
524
+
525
+ export declare function SelectComponent({ title, items, value, isLoading, isError, refetch, connectionTooltip, onChange, showNone, className, showIcon, disabled, type, }: SelectProps): JSX_2.Element;
499
526
 
500
527
  declare type SelectProps = {
501
528
  title: string;
@@ -513,6 +540,7 @@ declare type SelectProps = {
513
540
  showIcon?: boolean;
514
541
  connectionTooltip?: string;
515
542
  disabled?: boolean;
543
+ type?: 'select' | 'combobox';
516
544
  };
517
545
 
518
546
  declare function SemaphorQueryClient({ children, }: {
@@ -548,6 +576,14 @@ export declare type StyleProps = {
548
576
  dashboardCardContainer?: string;
549
577
  dashboardCard?: string;
550
578
  /** grid-layout config */
579
+ /**
580
+ * Border radius for the control inputs such as filter input, tabs, date picker, etc.
581
+ */
582
+ controlInputRadius?: number;
583
+ /**
584
+ * Border radius for the cards
585
+ */
586
+ cardBorderRadius?: number;
551
587
  gridLayout?: {
552
588
  /** css class for `react-grid-layout` */
553
589
  className?: string;
@@ -589,7 +625,6 @@ export declare type TCard = {
589
625
  type: TChartType;
590
626
  sql?: string;
591
627
  python?: string;
592
- cfg?: any;
593
628
  customCfg?: any;
594
629
  preferences?: TCardPreferences;
595
630
  customCardPreferences?: TCustomCardPreferences;
@@ -648,23 +683,35 @@ export declare type TChartOptions = {
648
683
  type?: TChartType;
649
684
  scales?: {
650
685
  y?: {
651
- type: 'linear' | 'logarithmic';
652
- min: number;
653
- max: number;
654
- ticks: {
655
- stepSize: number;
686
+ type?: 'linear' | 'logarithmic';
687
+ min?: number;
688
+ max?: number;
689
+ ticks?: {
690
+ stepSize?: number;
691
+ };
692
+ grid?: {
693
+ display?: boolean;
656
694
  };
657
695
  };
658
696
  x?: {
659
- type: 'linear' | 'logarithmic';
660
- min: number;
661
- max: number;
662
- ticks: {
663
- stepSize: number;
697
+ type?: 'linear' | 'logarithmic';
698
+ min?: number;
699
+ max?: number;
700
+ ticks?: {
701
+ stepSize?: number;
702
+ };
703
+ grid?: {
704
+ display?: boolean;
664
705
  };
665
706
  };
666
707
  };
667
708
  indexAxis?: 'x' | 'y' | undefined;
709
+ plugins?: {
710
+ legend?: TLegendOptions;
711
+ datalabels?: {
712
+ anchor?: string;
713
+ };
714
+ };
668
715
  };
669
716
 
670
717
  declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
@@ -708,6 +755,7 @@ export declare type TDashboard = {
708
755
  aiScopeTables?: AIScopeTable[];
709
756
  globalStyle?: TStyle;
710
757
  globalCacheConfig?: CacheConfig;
758
+ emailSettings?: EmailSettings;
711
759
  };
712
760
 
713
761
  export declare type TDataColumn = {
@@ -762,6 +810,12 @@ export declare type TFrame = {
762
810
 
763
811
  export declare type Theme = 'dark' | 'light' | 'system';
764
812
 
813
+ export declare type TLegendOptions = {
814
+ display?: boolean;
815
+ position?: 'top' | 'left' | 'bottom' | 'right';
816
+ align?: 'start' | 'center' | 'end';
817
+ };
818
+
765
819
  export declare type TLens = {
766
820
  id: string;
767
821
  name: string;
@@ -6,10 +6,11 @@ export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'C
6
6
  export declare type AIScopeTable = {
7
7
  connectionId: string;
8
8
  connectionType: string;
9
- databaseName?: string;
10
- schemaName?: string;
11
- tableName?: string;
12
- datamodelName?: string;
9
+ databaseName: string;
10
+ schemaName: string;
11
+ tableName: string;
12
+ datamodelId: string;
13
+ datamodelName: string;
13
14
  };
14
15
 
15
16
  export declare type AuthToken = {
@@ -116,6 +117,13 @@ export declare type DateOptions = {
116
117
 
117
118
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
118
119
 
120
+ export declare type EmailSettings = {
121
+ companyName: string;
122
+ dashboardUrl: string;
123
+ supportEmail: string;
124
+ senderTitle: string;
125
+ };
126
+
119
127
  export declare type ErrorProps = {
120
128
  message?: string;
121
129
  };
@@ -253,6 +261,14 @@ export declare type StyleProps = {
253
261
  dashboardCardContainer?: string;
254
262
  dashboardCard?: string;
255
263
  /** grid-layout config */
264
+ /**
265
+ * Border radius for the control inputs such as filter input, tabs, date picker, etc.
266
+ */
267
+ controlInputRadius?: number;
268
+ /**
269
+ * Border radius for the cards
270
+ */
271
+ cardBorderRadius?: number;
256
272
  gridLayout?: {
257
273
  /** css class for `react-grid-layout` */
258
274
  className?: string;
@@ -294,7 +310,6 @@ export declare type TCard = {
294
310
  type: TChartType;
295
311
  sql?: string;
296
312
  python?: string;
297
- cfg?: any;
298
313
  customCfg?: any;
299
314
  preferences?: TCardPreferences;
300
315
  customCardPreferences?: TCustomCardPreferences;
@@ -351,23 +366,35 @@ export declare type TChartOptions = {
351
366
  type?: TChartType;
352
367
  scales?: {
353
368
  y?: {
354
- type: 'linear' | 'logarithmic';
355
- min: number;
356
- max: number;
357
- ticks: {
358
- stepSize: number;
369
+ type?: 'linear' | 'logarithmic';
370
+ min?: number;
371
+ max?: number;
372
+ ticks?: {
373
+ stepSize?: number;
374
+ };
375
+ grid?: {
376
+ display?: boolean;
359
377
  };
360
378
  };
361
379
  x?: {
362
- type: 'linear' | 'logarithmic';
363
- min: number;
364
- max: number;
365
- ticks: {
366
- stepSize: number;
380
+ type?: 'linear' | 'logarithmic';
381
+ min?: number;
382
+ max?: number;
383
+ ticks?: {
384
+ stepSize?: number;
385
+ };
386
+ grid?: {
387
+ display?: boolean;
367
388
  };
368
389
  };
369
390
  };
370
391
  indexAxis?: 'x' | 'y' | undefined;
392
+ plugins?: {
393
+ legend?: TLegendOptions;
394
+ datalabels?: {
395
+ anchor?: string;
396
+ };
397
+ };
371
398
  };
372
399
 
373
400
  declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
@@ -411,6 +438,7 @@ export declare type TDashboard = {
411
438
  aiScopeTables?: AIScopeTable[];
412
439
  globalStyle?: TStyle;
413
440
  globalCacheConfig?: CacheConfig;
441
+ emailSettings?: EmailSettings;
414
442
  };
415
443
 
416
444
  export declare type TDataColumn = {
@@ -465,6 +493,12 @@ export declare type TFrame = {
465
493
 
466
494
  export declare type Theme = 'dark' | 'light' | 'system';
467
495
 
496
+ export declare type TLegendOptions = {
497
+ display?: boolean;
498
+ position?: 'top' | 'left' | 'bottom' | 'right';
499
+ align?: 'start' | 'center' | 'end';
500
+ };
501
+
468
502
  export declare type TLens = {
469
503
  id: string;
470
504
  name: string;
@@ -5,10 +5,11 @@ export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'C
5
5
  export declare type AIScopeTable = {
6
6
  connectionId: string;
7
7
  connectionType: string;
8
- databaseName?: string;
9
- schemaName?: string;
10
- tableName?: string;
11
- datamodelName?: string;
8
+ databaseName: string;
9
+ schemaName: string;
10
+ tableName: string;
11
+ datamodelId: string;
12
+ datamodelName: string;
12
13
  };
13
14
 
14
15
  export declare type AuthToken = {
@@ -110,6 +111,13 @@ export declare type DateOptions = {
110
111
 
111
112
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
112
113
 
114
+ export declare type EmailSettings = {
115
+ companyName: string;
116
+ dashboardUrl: string;
117
+ supportEmail: string;
118
+ senderTitle: string;
119
+ };
120
+
113
121
  export declare type ErrorProps = {
114
122
  message?: string;
115
123
  };
@@ -247,6 +255,14 @@ export declare type StyleProps = {
247
255
  dashboardCardContainer?: string;
248
256
  dashboardCard?: string;
249
257
  /** grid-layout config */
258
+ /**
259
+ * Border radius for the control inputs such as filter input, tabs, date picker, etc.
260
+ */
261
+ controlInputRadius?: number;
262
+ /**
263
+ * Border radius for the cards
264
+ */
265
+ cardBorderRadius?: number;
250
266
  gridLayout?: {
251
267
  /** css class for `react-grid-layout` */
252
268
  className?: string;
@@ -286,7 +302,6 @@ export declare type TCard = {
286
302
  type: TChartType;
287
303
  sql?: string;
288
304
  python?: string;
289
- cfg?: any;
290
305
  customCfg?: any;
291
306
  preferences?: TCardPreferences;
292
307
  customCardPreferences?: TCustomCardPreferences;
@@ -343,23 +358,35 @@ export declare type TChartOptions = {
343
358
  type?: TChartType;
344
359
  scales?: {
345
360
  y?: {
346
- type: 'linear' | 'logarithmic';
347
- min: number;
348
- max: number;
349
- ticks: {
350
- stepSize: number;
361
+ type?: 'linear' | 'logarithmic';
362
+ min?: number;
363
+ max?: number;
364
+ ticks?: {
365
+ stepSize?: number;
366
+ };
367
+ grid?: {
368
+ display?: boolean;
351
369
  };
352
370
  };
353
371
  x?: {
354
- type: 'linear' | 'logarithmic';
355
- min: number;
356
- max: number;
357
- ticks: {
358
- stepSize: number;
372
+ type?: 'linear' | 'logarithmic';
373
+ min?: number;
374
+ max?: number;
375
+ ticks?: {
376
+ stepSize?: number;
377
+ };
378
+ grid?: {
379
+ display?: boolean;
359
380
  };
360
381
  };
361
382
  };
362
383
  indexAxis?: 'x' | 'y' | undefined;
384
+ plugins?: {
385
+ legend?: TLegendOptions;
386
+ datalabels?: {
387
+ anchor?: string;
388
+ };
389
+ };
363
390
  };
364
391
 
365
392
  declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'kpi' | 'pyramid' | 'range' | 'text' | 'map' | 'custom';
@@ -403,6 +430,7 @@ export declare type TDashboard = {
403
430
  aiScopeTables?: AIScopeTable[];
404
431
  globalStyle?: TStyle;
405
432
  globalCacheConfig?: CacheConfig;
433
+ emailSettings?: EmailSettings;
406
434
  };
407
435
 
408
436
  export declare type TDataColumn = {
@@ -457,6 +485,12 @@ export declare type TFrame = {
457
485
 
458
486
  export declare type Theme = 'dark' | 'light' | 'system';
459
487
 
488
+ export declare type TLegendOptions = {
489
+ display?: boolean;
490
+ position?: 'top' | 'left' | 'bottom' | 'right';
491
+ align?: 'start' | 'center' | 'end';
492
+ };
493
+
460
494
  export declare type TLens = {
461
495
  id: string;
462
496
  name: string;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.91",
8
+ "version": "0.0.94",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -79,10 +79,9 @@
79
79
  "clsx": "^2.0.0",
80
80
  "cmdk": "^1.0.4",
81
81
  "date-fns": "^3.3.1",
82
- "dompurify": "^3.1.6",
83
82
  "immer": "^10.0.3",
84
83
  "jwt-decode": "^4.0.0",
85
- "lodash": "^4.17.21",
84
+ "lodash.merge": "^4.6.2",
86
85
  "lucide-react": "^0.453.0",
87
86
  "ms": "^2.1.3",
88
87
  "next-themes": "^0.4.4",
@@ -101,8 +100,8 @@
101
100
  "zustand": "^4.4.7"
102
101
  },
103
102
  "peerDependencies": {
104
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
105
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
103
+ "react": "^18.0.0 || ^19.0.0",
104
+ "react-dom": "^18.0.0 || ^19.0.0"
106
105
  },
107
106
  "devDependencies": {
108
107
  "@microsoft/api-extractor": "^7.49.1",
@@ -110,7 +109,7 @@
110
109
  "@types/chart.js": "^2.9.41",
111
110
  "@types/dompurify": "^3.0.5",
112
111
  "@types/jsoneditor": "^9.9.5",
113
- "@types/lodash": "^4.14.202",
112
+ "@types/lodash.merge": "^4.6.9",
114
113
  "@types/ms": "^0.7.34",
115
114
  "@types/node": "^20.14.2",
116
115
  "@types/postcss-prefix-selector": "^1.16.3",