semaphor 0.0.62 → 0.0.64

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.
@@ -15,6 +15,8 @@ import { UseBoundStore } from 'zustand';
15
15
 
16
16
  declare type Actions = {
17
17
  setGlobalStyle: (style: TStyle) => void;
18
+ setLenses: (lenses: TLens[]) => void;
19
+ setSelectedLensId: (lensId: string) => void;
18
20
  setAIScopeTables: (aiScopeTables: AIScopeTable[]) => void;
19
21
  setIsSessionExpired: (isSessionExpired: boolean) => void;
20
22
  setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
@@ -24,8 +26,8 @@ declare type Actions = {
24
26
  setCustomCards: (customCards: CustomCard[]) => void;
25
27
  setAuthToken: (authToken: AuthToken) => void;
26
28
  setThemeStyle: (themeStyle: StyleProps) => void;
27
- setBookmarkKey: (bookmarkKey: string) => void;
28
29
  setDashboard: (dashboard: TDashboard) => void;
30
+ setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[]) => void;
29
31
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
30
32
  setSheets: (sheets: TSheet[]) => void;
31
33
  addSheet: (sheet: TSheet) => void;
@@ -154,13 +156,6 @@ declare type BaseFilter = {
154
156
  connectionType?: 'database' | 'api';
155
157
  };
156
158
 
157
- export declare type Bookmark = {
158
- name: string;
159
- default: boolean;
160
- template: TDashboard;
161
- filterValues?: TFilterValue[];
162
- };
163
-
164
159
  export declare const BOOLEAN_DATA_TYPES: string[];
165
160
 
166
161
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -238,8 +233,9 @@ export declare type DashboardStore = {
238
233
  currentBreakpoint: Breakpoint;
239
234
  theme?: 'light' | 'dark' | 'system';
240
235
  themeStyle?: StyleProps;
236
+ lenses?: TLens[];
237
+ selectedLensId?: string;
241
238
  filteringCards?: TCard[];
242
- bookmarkKey?: string;
243
239
  dashboard: TDashboard;
244
240
  selectedSheetId?: string | null | undefined;
245
241
  selectedFrameId?: string | null;
@@ -343,8 +339,6 @@ declare type FilterOnClick = {
343
339
 
344
340
  export declare function fmt(str: string): string;
345
341
 
346
- export declare function getBookmarkKey(dashboardId: string): string;
347
-
348
342
  export declare function getColumnDataType(column: TDataColumn): string;
349
343
 
350
344
  export declare function getDashbaordStateWithoutData(dashboardState: TDashboard): {
@@ -373,6 +367,13 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
373
367
  globalStyle?: TStyle | undefined;
374
368
  };
375
369
 
370
+ export declare type GetDashboardResponse = {
371
+ dashboard: TDashboard;
372
+ lenses: TLens[];
373
+ filterValues?: TFilterValue[];
374
+ defaultLensId?: string;
375
+ };
376
+
376
377
  export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
377
378
 
378
379
  export declare function getQualifiedTableName(schemaName: string, tableName: string): string;
@@ -650,6 +651,15 @@ export declare type TFrame = {
650
651
 
651
652
  export declare type Theme = 'dark' | 'light' | 'system';
652
653
 
654
+ export declare type TLens = {
655
+ id: string;
656
+ name: string;
657
+ template?: string;
658
+ filterValues?: TFilterValue[];
659
+ isDefault?: boolean;
660
+ shared?: boolean;
661
+ };
662
+
653
663
  export declare type TSheet = {
654
664
  id: string;
655
665
  title?: string;
@@ -715,6 +725,63 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
715
725
  tableHeaderColor?: string | undefined;
716
726
  } | undefined;
717
727
  } | undefined;
728
+ lenses?: {
729
+ id: string;
730
+ name: string;
731
+ template?: string | undefined;
732
+ filterValues?: ({
733
+ filterId: string;
734
+ expression?: string | undefined;
735
+ name: string;
736
+ valueType: "string" | "number" | "boolean" | "date";
737
+ connectionType?: "database" | "api" | undefined;
738
+ operation: "like" | "not like";
739
+ values: [string];
740
+ } | {
741
+ filterId: string;
742
+ expression?: string | undefined;
743
+ name: string;
744
+ valueType: "string" | "number" | "boolean" | "date";
745
+ connectionType?: "database" | "api" | undefined;
746
+ operation: "=" | "!=" | "is null" | "is not null";
747
+ values: [string | number];
748
+ } | {
749
+ filterId: string;
750
+ expression?: string | undefined;
751
+ name: string;
752
+ valueType: "string" | "number" | "boolean" | "date";
753
+ connectionType?: "database" | "api" | undefined;
754
+ operation: ">" | "<" | ">=" | "<=";
755
+ values: [number];
756
+ } | {
757
+ filterId: string;
758
+ expression?: string | undefined;
759
+ name: string;
760
+ valueType: "string" | "number" | "boolean" | "date";
761
+ connectionType?: "database" | "api" | undefined;
762
+ operation: "between" | "not between";
763
+ values: [number, number];
764
+ } | {
765
+ filterId: string;
766
+ expression?: string | undefined;
767
+ name: string;
768
+ valueType: "string" | "number" | "boolean" | "date";
769
+ connectionType?: "database" | "api" | undefined;
770
+ operation: "between" | "not between";
771
+ values: [Date, Date];
772
+ } | {
773
+ filterId: string;
774
+ expression?: string | undefined;
775
+ name: string;
776
+ valueType: "string" | "number" | "boolean" | "date";
777
+ connectionType?: "database" | "api" | undefined;
778
+ operation: "in" | "not in";
779
+ values: (string | number)[];
780
+ })[] | undefined;
781
+ isDefault?: boolean | undefined;
782
+ shared?: boolean | undefined;
783
+ }[] | undefined;
784
+ selectedLensId?: string | undefined;
718
785
  filteringCards?: {
719
786
  id: string;
720
787
  title: string;
@@ -858,7 +925,6 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
858
925
  lastSelectedTable?: string | undefined;
859
926
  refreshInterval?: string | undefined;
860
927
  }[] | undefined;
861
- bookmarkKey?: string | undefined;
862
928
  dashboard: {
863
929
  id: string;
864
930
  title?: string | undefined;
@@ -1554,6 +1620,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1554
1620
  onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
1555
1621
  actions: {
1556
1622
  setGlobalStyle: (style: TStyle) => void;
1623
+ setLenses: (lenses: TLens[]) => void;
1624
+ setSelectedLensId: (lensId: string) => void;
1557
1625
  setAIScopeTables: (aiScopeTables: AIScopeTable[]) => void;
1558
1626
  setIsSessionExpired: (isSessionExpired: boolean) => void;
1559
1627
  setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
@@ -1563,8 +1631,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1563
1631
  setCustomCards: (customCards: CustomCard[]) => void;
1564
1632
  setAuthToken: (authToken: AuthToken) => void;
1565
1633
  setThemeStyle: (themeStyle: StyleProps) => void;
1566
- setBookmarkKey: (bookmarkKey: string) => void;
1567
1634
  setDashboard: (dashboard: TDashboard) => void;
1635
+ setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[]) => void;
1568
1636
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
1569
1637
  setSheets: (sheets: TSheet[]) => void;
1570
1638
  addSheet: (sheet: TSheet) => void;
@@ -29,13 +29,6 @@ declare type BaseFilter = {
29
29
  connectionType?: 'database' | 'api';
30
30
  };
31
31
 
32
- export declare type Bookmark = {
33
- name: string;
34
- default: boolean;
35
- template: TDashboard;
36
- filterValues?: TFilterValue[];
37
- };
38
-
39
32
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
40
33
 
41
34
  declare type CardWithContent = BaseCustomCard & {
@@ -139,6 +132,13 @@ declare type FilterOnClick = {
139
132
  columnIndex: number;
140
133
  };
141
134
 
135
+ export declare type GetDashboardResponse = {
136
+ dashboard: TDashboard;
137
+ lenses: TLens[];
138
+ filterValues?: TFilterValue[];
139
+ defaultLensId?: string;
140
+ };
141
+
142
142
  export declare type KPICardProps = {
143
143
  card: TCard;
144
144
  isLoading?: boolean;
@@ -377,6 +377,15 @@ export declare type TFrame = {
377
377
 
378
378
  export declare type Theme = 'dark' | 'light' | 'system';
379
379
 
380
+ export declare type TLens = {
381
+ id: string;
382
+ name: string;
383
+ template?: string;
384
+ filterValues?: TFilterValue[];
385
+ isDefault?: boolean;
386
+ shared?: boolean;
387
+ };
388
+
380
389
  export declare type TSheet = {
381
390
  id: string;
382
391
  title?: string;
@@ -28,13 +28,6 @@ declare type BaseFilter = {
28
28
  connectionType?: 'database' | 'api';
29
29
  };
30
30
 
31
- export declare type Bookmark = {
32
- name: string;
33
- default: boolean;
34
- template: TDashboard;
35
- filterValues?: TFilterValue[];
36
- };
37
-
38
31
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
39
32
 
40
33
  declare type CardWithContent = BaseCustomCard & {
@@ -133,6 +126,13 @@ declare type FilterOnClick = {
133
126
  columnIndex: number;
134
127
  };
135
128
 
129
+ export declare type GetDashboardResponse = {
130
+ dashboard: TDashboard;
131
+ lenses: TLens[];
132
+ filterValues?: TFilterValue[];
133
+ defaultLensId?: string;
134
+ };
135
+
136
136
  export declare type KPICardProps = {
137
137
  card: TCard;
138
138
  isLoading?: boolean;
@@ -369,6 +369,15 @@ export declare type TFrame = {
369
369
 
370
370
  export declare type Theme = 'dark' | 'light' | 'system';
371
371
 
372
+ export declare type TLens = {
373
+ id: string;
374
+ name: string;
375
+ template?: string;
376
+ filterValues?: TFilterValue[];
377
+ isDefault?: boolean;
378
+ shared?: boolean;
379
+ };
380
+
372
381
  export declare type TSheet = {
373
382
  id: string;
374
383
  title?: 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.62",
8
+ "version": "0.0.64",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",