semaphor 0.0.90 → 0.0.91

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.
@@ -7,6 +7,8 @@ import { DateRange } from 'react-day-picker';
7
7
  import { default as default_2 } from 'react-grid-layout';
8
8
  import { FontSpec } from 'chart.js';
9
9
  import { JSX as JSX_2 } from 'react/jsx-runtime';
10
+ import { QueryObserverResult } from '@tanstack/query-core';
11
+ import { RefetchOptions } from '@tanstack/query-core';
10
12
  import { StoreApi } from 'zustand';
11
13
  import { TBaseQuery as TBaseQuery_2 } from '..';
12
14
  import { TFilter as TFilter_2 } from '../surfboard/filter/types';
@@ -17,9 +19,12 @@ import { WritableDraft } from 'immer';
17
19
  declare type Actions = {
18
20
  setInitStore: () => void;
19
21
  setGlobalStyle: (style: TStyle) => void;
22
+ setIsDownloadingPdf: (isDownloadingPdf: boolean) => void;
20
23
  setLenses: (lenses: TLens[]) => void;
21
24
  setSelectedLensId: (lensId: string) => void;
22
25
  setAIScopeTables: (aiScopeTables: AIScopeTable[]) => void;
26
+ addToAIScope: (scopeTable: AIScopeTable) => void;
27
+ removeFromAIScope: (scopeTable: AIScopeTable) => void;
23
28
  setIsSessionExpired: (isSessionExpired: boolean) => void;
24
29
  setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
25
30
  setFilteringCards: (cards: TCard[]) => void;
@@ -99,7 +104,6 @@ declare type Actions_2 = {
99
104
  setColorRanges: (colorRanges: ColorRange[]) => void;
100
105
  setIsShowingVisual: (isShowingVisual: boolean) => void;
101
106
  setQueryResultColumns: (columns: string[]) => void;
102
- setQueryError: (error: string) => void;
103
107
  setRunSql: (runSql: boolean) => void;
104
108
  setCardPreferences: (preferences: TCardPreferences) => void;
105
109
  setCustomCardPreferences: (customPreferences: TCustomCardPreferences) => void;
@@ -112,6 +116,7 @@ declare type Actions_2 = {
112
116
  setSqlGen: (sqlGen: SqlGen) => void;
113
117
  setSqlGenMeasure: (name: string, calc: AggregateCalc) => void;
114
118
  setSqlGenDimension: (dimension: string) => void;
119
+ switchCardType: (type: TChartType) => void;
115
120
  setCardType: (type: TChartType) => void;
116
121
  setCardSql: (sql: string | undefined) => void;
117
122
  setCardPython: (python: string | undefined) => void;
@@ -138,11 +143,12 @@ declare type Actions_2 = {
138
143
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
139
144
 
140
145
  export declare type AIScopeTable = {
141
- connectinonId: string;
146
+ connectionId: string;
142
147
  connectionType: string;
143
148
  databaseName?: string;
144
149
  schemaName?: string;
145
- tableName: string;
150
+ tableName?: string;
151
+ datamodelName?: string;
146
152
  };
147
153
 
148
154
  export declare type AuthToken = {
@@ -241,9 +247,14 @@ export declare type DashboardProps = {
241
247
  * Placeholders for the dashboard.
242
248
  */
243
249
  placeholders?: Placeholders;
250
+ /**
251
+ * The id of the sheet to be selected when the dashboard is loaded.
252
+ */
253
+ selectedSheetId?: string;
244
254
  };
245
255
 
246
256
  export declare type DashboardStore = {
257
+ isDownloadingPdf?: boolean;
247
258
  isSessionExpired: boolean;
248
259
  authToken?: AuthToken;
249
260
  currentBreakpoint: Breakpoint;
@@ -284,6 +295,8 @@ export { DateRange }
284
295
 
285
296
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
286
297
 
298
+ export declare function downloadPdf(): Promise<void>;
299
+
287
300
  declare type EditorStore = {
288
301
  isShowingVisual: boolean;
289
302
  runSql: boolean;
@@ -395,6 +408,13 @@ export declare type GetDashboardResponse = {
395
408
 
396
409
  export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
397
410
 
411
+ export declare function getFormattedTableNameForQuery({ schemaName, tableName, modelName, connectionType, }: {
412
+ schemaName: string;
413
+ tableName: string;
414
+ modelName: string | undefined;
415
+ connectionType: string;
416
+ }): string;
417
+
398
418
  export declare type GetPluginsResponse = {
399
419
  plugins: {
400
420
  label: string;
@@ -402,9 +422,9 @@ export declare type GetPluginsResponse = {
402
422
  }[];
403
423
  };
404
424
 
405
- export declare function getQualifiedTableName(schemaName: string, tableName: string): string;
425
+ export declare function getQualifiedTableName(schemaName: string, tableName: string, connectionType: string): string;
406
426
 
407
- export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string): string | undefined;
427
+ export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string, connectionType: string): string | undefined;
408
428
 
409
429
  export declare type HtmlOptions = {
410
430
  html: string;
@@ -475,7 +495,7 @@ export declare type Placeholders = {
475
495
 
476
496
  export declare const resolveDataType: (value: any) => string;
477
497
 
478
- export declare function SelectComponent({ title, items, value, isLoading, isError, connectionTooltip, onChange, showNone, className, showIcon, disabled, }: SelectProps): JSX_2.Element;
498
+ export declare function SelectComponent({ title, items, value, isLoading, isError, refetch, connectionTooltip, onChange, showNone, className, showIcon, disabled, }: SelectProps): JSX_2.Element;
479
499
 
480
500
  declare type SelectProps = {
481
501
  title: string;
@@ -486,6 +506,7 @@ declare type SelectProps = {
486
506
  value: string;
487
507
  isLoading: boolean;
488
508
  isError: boolean;
509
+ refetch: () => void;
489
510
  onChange?: (value: string) => void;
490
511
  showNone?: boolean;
491
512
  className?: string;
@@ -810,6 +831,8 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
810
831
  isConnectionsLoading: boolean;
811
832
  isConnectionsError: boolean;
812
833
  modelItems: any;
834
+ selectedDatamodelId: string | undefined;
835
+ selectedDatamodelName: any;
813
836
  isModelsLoading: boolean;
814
837
  isModelsError: boolean;
815
838
  databaseItems: any;
@@ -828,6 +851,12 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
828
851
  connectionType: any;
829
852
  tableName: any;
830
853
  schemaName: string;
854
+ refetchConnections: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
855
+ refetchModels: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
856
+ refetchDatabases: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
857
+ refetchSchemas: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
858
+ refetchTables: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
859
+ refetchColumns: (options?: RefetchOptions) => Promise<QueryObserverResult<any, Error>>;
831
860
  handleConnectionChange: (value: string) => void;
832
861
  handleDatamodelChange: (value: string) => void;
833
862
  handleDatabaseChange: (value: string) => void;
@@ -853,8 +882,3 @@ export declare function useTextFilterHook(filterId: string): {
853
882
  };
854
883
 
855
884
  export { }
856
-
857
-
858
- declare namespace Calendar {
859
- var displayName: string;
860
- }
@@ -4,11 +4,12 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
4
4
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
5
5
 
6
6
  export declare type AIScopeTable = {
7
- connectinonId: string;
7
+ connectionId: string;
8
8
  connectionType: string;
9
9
  databaseName?: string;
10
10
  schemaName?: string;
11
- tableName: string;
11
+ tableName?: string;
12
+ datamodelName?: string;
12
13
  };
13
14
 
14
15
  export declare type AuthToken = {
@@ -101,6 +102,10 @@ export declare type DashboardProps = {
101
102
  * Placeholders for the dashboard.
102
103
  */
103
104
  placeholders?: Placeholders;
105
+ /**
106
+ * The id of the sheet to be selected when the dashboard is loaded.
107
+ */
108
+ selectedSheetId?: string;
104
109
  };
105
110
 
106
111
  export declare type DateOptions = {
@@ -488,8 +493,3 @@ export declare type TStyle = {
488
493
  };
489
494
 
490
495
  export { }
491
-
492
-
493
- declare namespace Calendar {
494
- var displayName: string;
495
- }
@@ -3,11 +3,12 @@ import { FontSpec } from 'chart.js';
3
3
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
4
4
 
5
5
  export declare type AIScopeTable = {
6
- connectinonId: string;
6
+ connectionId: string;
7
7
  connectionType: string;
8
8
  databaseName?: string;
9
9
  schemaName?: string;
10
- tableName: string;
10
+ tableName?: string;
11
+ datamodelName?: string;
11
12
  };
12
13
 
13
14
  export declare type AuthToken = {
@@ -95,6 +96,10 @@ export declare type DashboardProps = {
95
96
  * Placeholders for the dashboard.
96
97
  */
97
98
  placeholders?: Placeholders;
99
+ /**
100
+ * The id of the sheet to be selected when the dashboard is loaded.
101
+ */
102
+ selectedSheetId?: string;
98
103
  };
99
104
 
100
105
  export declare type DateOptions = {
@@ -480,8 +485,3 @@ export declare type TStyle = {
480
485
  };
481
486
 
482
487
  export { }
483
-
484
-
485
- declare namespace Calendar {
486
- var displayName: string;
487
- }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.90",
8
+ "version": "0.0.91",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -45,7 +45,7 @@
45
45
  "preview": "vite preview"
46
46
  },
47
47
  "dependencies": {
48
- "@ai-sdk/react": "^1.0.12",
48
+ "@ai-sdk/react": "^1.1.18",
49
49
  "@headlessui/react": "^2.2.0",
50
50
  "@monaco-editor/react": "^4.7.0-rc.0",
51
51
  "@r2wc/react-to-web-component": "^2.0.4",
@@ -71,7 +71,7 @@
71
71
  "@tailwindcss/container-queries": "^0.1.1",
72
72
  "@tanstack/react-query": "^5.62.15",
73
73
  "@tanstack/react-table": "^8.11.7",
74
- "ai": "^3.3.0",
74
+ "ai": "^4.1.46",
75
75
  "chart.js": "^4.4.1",
76
76
  "chartjs-chart-geo": "^4.3.4",
77
77
  "chartjs-plugin-datalabels": "^2.2.0",
@@ -86,6 +86,7 @@
86
86
  "lucide-react": "^0.453.0",
87
87
  "ms": "^2.1.3",
88
88
  "next-themes": "^0.4.4",
89
+ "prism-react-renderer": "^2.4.1",
89
90
  "react-day-picker": "^8.10.0",
90
91
  "react-error-boundary": "^4.1.2",
91
92
  "react-grid-layout": "^1.5.0",
@@ -100,8 +101,8 @@
100
101
  "zustand": "^4.4.7"
101
102
  },
102
103
  "peerDependencies": {
103
- "react": "^17.0.0 || ^18.0.0",
104
- "react-dom": "^17.0.0 || ^18.0.0"
104
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
105
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
105
106
  },
106
107
  "devDependencies": {
107
108
  "@microsoft/api-extractor": "^7.49.1",