semaphor 0.0.111 → 0.0.113

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-CCV5mAgn.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-jmg1QJuX.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as f } from "../chunks/dashboard-plus-CZggRVns.js";
1
+ import { D as f } from "../chunks/dashboard-plus-BXuu8joa.js";
2
2
  import { EMPTY_SELECTION as a } from "../types/index.js";
3
3
  export {
4
4
  a as EMPTY_SELECTION,
@@ -88,6 +88,16 @@ declare interface CardConfig {
88
88
  showTrendline?: boolean;
89
89
  trendlineWindow?: number;
90
90
  trendlineGranularity?: 'day' | 'week' | 'month';
91
+ rowAggregates?: Array<{
92
+ label?: string;
93
+ function: AggregateFunction;
94
+ groupLevel: string | 'ALL';
95
+ }>;
96
+ columnAggregates?: Array<{
97
+ label?: string;
98
+ function: AggregateFunction;
99
+ pivotLevel: string | 'ALL';
100
+ }>;
91
101
  }
92
102
 
93
103
  declare interface CardInteractionConfig {
@@ -194,7 +204,7 @@ declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL'
194
204
 
195
205
  export declare type CustomCard = CardWithContent | CardWithFooter;
196
206
 
197
- export declare function Dashboard(props: DashboardProps): JSX_2.Element;
207
+ export declare function Dashboard(props: DashboardProps): JSX_2.Element | null;
198
208
 
199
209
  export declare type DashboardEventHandlers = {
200
210
  onExportData?: (payload: ExportDataPayload) => void;
@@ -617,6 +627,14 @@ declare interface OrderBy {
617
627
  direction: 'asc' | 'desc';
618
628
  }
619
629
 
630
+ /**
631
+ * Pagination configuration for table queries
632
+ */
633
+ declare interface PaginationConfig {
634
+ page: number;
635
+ pageSize: number;
636
+ }
637
+
620
638
  declare type Params = {
621
639
  [key: string]: string | number | string[] | number[];
622
640
  };
@@ -727,6 +745,7 @@ declare type TablePreferences = {
727
745
  selectColumnVisible?: boolean;
728
746
  columnVisibility?: Record<string, boolean>;
729
747
  pageSize?: number;
748
+ enableDevModePagination?: boolean;
730
749
  };
731
750
 
732
751
  export declare type TBaseQuery = {
@@ -753,6 +772,7 @@ export declare type TCard = {
753
772
  dataSource?: DataSource;
754
773
  config?: CardConfig;
755
774
  interactionConfig?: CardInteractionConfig;
775
+ paginationConfig?: PaginationConfig;
756
776
  queryConfig?: QueryConfig;
757
777
  customCfg?: any;
758
778
  preferences?: TCardPreferences;
@@ -853,7 +873,7 @@ export declare type TChartOptions = {
853
873
  };
854
874
  };
855
875
 
856
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
876
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
857
877
 
858
878
  export declare type TColumnSetting<T extends DisplayDataType> = {
859
879
  columnIdx: number;
@@ -14,6 +14,7 @@ import { FontSpec } from 'chart.js';
14
14
  import { GroupByField as GroupByField_2 } from '../types/explorer-types';
15
15
  import { JSX as JSX_2 } from 'react/jsx-runtime';
16
16
  import { MetricField as MetricField_2 } from '../types/explorer-types';
17
+ import { PaginationMetadata as PaginationMetadata_2 } from '../types/explorer-types';
17
18
  import { PivotByField as PivotByField_2 } from '../types/explorer-types';
18
19
  import { QueryObserverResult } from '@tanstack/query-core';
19
20
  import { RefetchOptions } from '@tanstack/query-core';
@@ -199,6 +200,14 @@ declare type Actions_2 = TableActions & ExplorerActions & DrillActions & {
199
200
 
200
201
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
201
202
 
203
+ /**
204
+ * Configuration for which aggregate functions to use and at which levels (by Field.id)
205
+ */
206
+ export declare interface AggregateConfig {
207
+ functions: AggregateFunction[];
208
+ levels?: string[];
209
+ }
210
+
202
211
  export declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
203
212
 
204
213
  declare type AIContext = {
@@ -284,6 +293,16 @@ export declare interface CardConfig {
284
293
  showTrendline?: boolean;
285
294
  trendlineWindow?: number;
286
295
  trendlineGranularity?: 'day' | 'week' | 'month';
296
+ rowAggregates?: Array<{
297
+ label?: string;
298
+ function: AggregateFunction;
299
+ groupLevel: string | 'ALL';
300
+ }>;
301
+ columnAggregates?: Array<{
302
+ label?: string;
303
+ function: AggregateFunction;
304
+ pivotLevel: string | 'ALL';
305
+ }>;
287
306
  }
288
307
 
289
308
  declare interface CardInteractionConfig {
@@ -384,6 +403,13 @@ declare interface ColumnSettings {
384
403
 
385
404
  declare type ColumnSettingsMap = Record<string, ColumnSettings>;
386
405
 
406
+ export declare interface ColumnSubtotalMeta {
407
+ alias: string;
408
+ subtotalLevel?: string;
409
+ isColumnSubtotal?: boolean;
410
+ isColumnTotal?: boolean;
411
+ }
412
+
387
413
  export declare type ColumnType = 'string' | 'number' | 'date';
388
414
 
389
415
  declare type ComboBoxOption = {
@@ -410,7 +436,7 @@ export declare function createSqlGenConfig(column: TDataColumn, preSqlGen: SqlGe
410
436
 
411
437
  export declare type CustomCard = CardWithContent | CardWithFooter;
412
438
 
413
- export declare function Dashboard(props: DashboardProps): JSX_2.Element;
439
+ export declare function Dashboard(props: DashboardProps): JSX_2.Element | null;
414
440
 
415
441
  export declare type DashboardEventHandlers = {
416
442
  onExportData?: (payload: ExportDataPayload) => void;
@@ -1083,6 +1109,26 @@ export declare interface OrderBy {
1083
1109
  direction: 'asc' | 'desc';
1084
1110
  }
1085
1111
 
1112
+ /**
1113
+ * Pagination configuration for table queries
1114
+ */
1115
+ export declare interface PaginationConfig {
1116
+ page: number;
1117
+ pageSize: number;
1118
+ }
1119
+
1120
+ /**
1121
+ * Pagination metadata returned with query results
1122
+ */
1123
+ export declare interface PaginationMetadata {
1124
+ page: number;
1125
+ pageSize: number;
1126
+ pageCount: number;
1127
+ totalCount: number;
1128
+ hasNextPage: boolean;
1129
+ hasPrevPage: boolean;
1130
+ }
1131
+
1086
1132
  declare type Params = {
1087
1133
  [key: string]: string | number | string[] | number[];
1088
1134
  };
@@ -1091,14 +1137,35 @@ export declare interface PivotByField extends Field {
1091
1137
  role: 'pivotby';
1092
1138
  }
1093
1139
 
1094
- export declare interface PivotColumnSchema {
1095
- alias: string;
1096
- metricId: string;
1097
- metricName: string;
1098
- metricLabel?: string;
1099
- pivotValues: string[];
1100
- pivotFields: string[];
1101
- displayLabel?: string;
1140
+ /**
1141
+ const config: CardConfig = {
1142
+ groupByColumns: [
1143
+ { id: 'region', name: 'region', label: 'Region', ... },
1144
+ { id: 'country', name: 'country', label: 'Country', ... }
1145
+ ],
1146
+ pivotByColumns: [
1147
+ { id: 'year', name: 'year', label: 'Year', ... },
1148
+ { id: 'quarter', name: 'quarter', label: 'Quarter', ... }
1149
+ ],
1150
+ metricColumns: [ ... ],
1151
+ rowAggregates: ['SUM', 'AVG'],
1152
+ columnAggregates: ['SUM'],
1153
+ subtotals: {
1154
+ groupBy: { functions: ['SUM'], levels: ['region'] }, // subtotal at region level
1155
+ pivotBy: { functions: ['SUM'], levels: ['year'] } // subtotal at year level
1156
+ }
1157
+ };
1158
+ */
1159
+ export declare enum PivotMarkerEnum {
1160
+ SUBTOTAL = "__SUBTOTAL__",
1161
+ TOTAL = "__TOTAL__",
1162
+ ALL = "__ALL__"
1163
+ }
1164
+
1165
+ export declare interface PivotRowMetadata {
1166
+ isSubtotal?: boolean;
1167
+ subtotalLevel?: string | null;
1168
+ isGrandTotal?: boolean;
1102
1169
  }
1103
1170
 
1104
1171
  export declare type Placeholders = {
@@ -1253,7 +1320,15 @@ export declare type StyleProps = {
1253
1320
  };
1254
1321
  };
1255
1322
 
1256
- export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
1323
+ /**
1324
+ * Subtotal configuration for groupBy and pivotBy axes
1325
+ */
1326
+ export declare interface SubtotalConfig {
1327
+ groupBy?: AggregateConfig;
1328
+ pivotBy?: AggregateConfig;
1329
+ }
1330
+
1331
+ export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element | null;
1257
1332
 
1258
1333
  declare interface TableActions {
1259
1334
  updateColumnSettingsMap: (columnSettings: ColumnSettingsMap) => void;
@@ -1280,6 +1355,7 @@ declare type TablePreferences = {
1280
1355
  selectColumnVisible?: boolean;
1281
1356
  columnVisibility?: Record<string, boolean>;
1282
1357
  pageSize?: number;
1358
+ enableDevModePagination?: boolean;
1283
1359
  };
1284
1360
 
1285
1361
  export declare type TBaseQuery = {
@@ -1306,6 +1382,7 @@ export declare type TCard = {
1306
1382
  dataSource?: DataSource;
1307
1383
  config?: CardConfig;
1308
1384
  interactionConfig?: CardInteractionConfig;
1385
+ paginationConfig?: PaginationConfig;
1309
1386
  queryConfig?: QueryConfig;
1310
1387
  customCfg?: any;
1311
1388
  preferences?: TCardPreferences;
@@ -1408,7 +1485,7 @@ export declare type TChartOptions = {
1408
1485
  };
1409
1486
  };
1410
1487
 
1411
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
1488
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
1412
1489
 
1413
1490
  export declare type TColumnSetting<T extends DisplayDataType> = {
1414
1491
  columnIdx: number;
@@ -1610,6 +1687,10 @@ export declare type TokenRequest = {
1610
1687
  * Enables self-service editing and lens creation by the end user.
1611
1688
  */
1612
1689
  allowEdit?: boolean;
1690
+ /**
1691
+ * Schema level security policy. The schema name for the tenant.
1692
+ */
1693
+ sls?: string;
1613
1694
  /**
1614
1695
  * Connection-level security policies.
1615
1696
  * Can be a single policy or an array of policies.
@@ -1708,6 +1789,7 @@ export declare function useCard(cardId: string): {
1708
1789
  handleDatapointClick: (chart: Chart, datasetIndex: number, clickIndex: number, value: number) => void;
1709
1790
  cfg: TChartConfiguration | undefined;
1710
1791
  queryKey: string[];
1792
+ pagination: PaginationMetadata_2 | undefined;
1711
1793
  };
1712
1794
 
1713
1795
  export declare const useCurrentActiveCard: () => TCard | undefined;
@@ -88,6 +88,16 @@ declare interface CardConfig {
88
88
  showTrendline?: boolean;
89
89
  trendlineWindow?: number;
90
90
  trendlineGranularity?: 'day' | 'week' | 'month';
91
+ rowAggregates?: Array<{
92
+ label?: string;
93
+ function: AggregateFunction;
94
+ groupLevel: string | 'ALL';
95
+ }>;
96
+ columnAggregates?: Array<{
97
+ label?: string;
98
+ function: AggregateFunction;
99
+ pivotLevel: string | 'ALL';
100
+ }>;
91
101
  }
92
102
 
93
103
  declare interface CardInteractionConfig {
@@ -620,6 +630,14 @@ declare interface OrderBy {
620
630
  direction: 'asc' | 'desc';
621
631
  }
622
632
 
633
+ /**
634
+ * Pagination configuration for table queries
635
+ */
636
+ declare interface PaginationConfig {
637
+ page: number;
638
+ pageSize: number;
639
+ }
640
+
623
641
  declare type Params = {
624
642
  [key: string]: string | number | string[] | number[];
625
643
  };
@@ -725,13 +743,14 @@ export declare type StyleProps = {
725
743
  };
726
744
  };
727
745
 
728
- export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
746
+ export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element | null;
729
747
 
730
748
  declare type TablePreferences = {
731
749
  columnSettingsMap?: ColumnSettingsMap;
732
750
  selectColumnVisible?: boolean;
733
751
  columnVisibility?: Record<string, boolean>;
734
752
  pageSize?: number;
753
+ enableDevModePagination?: boolean;
735
754
  };
736
755
 
737
756
  export declare type TBaseQuery = {
@@ -758,6 +777,7 @@ export declare type TCard = {
758
777
  dataSource?: DataSource;
759
778
  config?: CardConfig;
760
779
  interactionConfig?: CardInteractionConfig;
780
+ paginationConfig?: PaginationConfig;
761
781
  queryConfig?: QueryConfig;
762
782
  customCfg?: any;
763
783
  preferences?: TCardPreferences;
@@ -858,7 +878,7 @@ export declare type TChartOptions = {
858
878
  };
859
879
  };
860
880
 
861
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
881
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
862
882
 
863
883
  export declare type TColumnSetting<T extends DisplayDataType> = {
864
884
  columnIdx: number;
@@ -87,6 +87,16 @@ declare interface CardConfig {
87
87
  showTrendline?: boolean;
88
88
  trendlineWindow?: number;
89
89
  trendlineGranularity?: 'day' | 'week' | 'month';
90
+ rowAggregates?: Array<{
91
+ label?: string;
92
+ function: AggregateFunction;
93
+ groupLevel: string | 'ALL';
94
+ }>;
95
+ columnAggregates?: Array<{
96
+ label?: string;
97
+ function: AggregateFunction;
98
+ pivotLevel: string | 'ALL';
99
+ }>;
90
100
  }
91
101
 
92
102
  declare interface CardInteractionConfig {
@@ -614,6 +624,14 @@ declare interface OrderBy {
614
624
  direction: 'asc' | 'desc';
615
625
  }
616
626
 
627
+ /**
628
+ * Pagination configuration for table queries
629
+ */
630
+ declare interface PaginationConfig {
631
+ page: number;
632
+ pageSize: number;
633
+ }
634
+
617
635
  declare type Params = {
618
636
  [key: string]: string | number | string[] | number[];
619
637
  };
@@ -724,6 +742,7 @@ declare type TablePreferences = {
724
742
  selectColumnVisible?: boolean;
725
743
  columnVisibility?: Record<string, boolean>;
726
744
  pageSize?: number;
745
+ enableDevModePagination?: boolean;
727
746
  };
728
747
 
729
748
  export declare type TBaseQuery = {
@@ -750,6 +769,7 @@ export declare type TCard = {
750
769
  dataSource?: DataSource;
751
770
  config?: CardConfig;
752
771
  interactionConfig?: CardInteractionConfig;
772
+ paginationConfig?: PaginationConfig;
753
773
  queryConfig?: QueryConfig;
754
774
  customCfg?: any;
755
775
  preferences?: TCardPreferences;
@@ -850,7 +870,7 @@ export declare type TChartOptions = {
850
870
  };
851
871
  };
852
872
 
853
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
873
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
854
874
 
855
875
  export declare type TColumnSetting<T extends DisplayDataType> = {
856
876
  columnIdx: number;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.111",
8
+ "version": "0.0.113",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",