semaphor 0.0.24 → 0.0.25

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.
@@ -103,7 +103,7 @@ declare type Actions_2 = {
103
103
  setOnClose: (onClose: () => void) => void;
104
104
  };
105
105
 
106
- declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
106
+ export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
107
107
 
108
108
  export declare type AuthToken = {
109
109
  accessToken: string;
@@ -130,6 +130,8 @@ export declare type Bookmark = {
130
130
  filterValues?: TFilterValue[];
131
131
  };
132
132
 
133
+ export declare const BOOLEAN_DATA_TYPES: string[];
134
+
133
135
  declare type CardWithContent = BaseCustomCard & {
134
136
  content: React.FC<{
135
137
  card: TCard;
@@ -150,6 +152,8 @@ declare type CardWithFooter = BaseCustomCard & {
150
152
 
151
153
  export declare function cleanCard(card: TCard): TCard;
152
154
 
155
+ export declare function createSqlGenConfig(column: TDataColumn, preSqlGen: SqlGen, calc?: AggregateCalc): SqlGen;
156
+
153
157
  export declare type CustomCard = CardWithContent | CardWithFooter;
154
158
 
155
159
  export declare function Dashboard(props: DashboardProps): JSX_2.Element;
@@ -215,6 +219,8 @@ export declare type DashboardStore = {
215
219
 
216
220
  export declare const DashboardWC: CustomElementConstructor;
217
221
 
222
+ export declare const DATE_DATA_TYPES: string[];
223
+
218
224
  declare type EditorStore = {
219
225
  isShowingVisual: boolean;
220
226
  runSql: boolean;
@@ -272,8 +278,12 @@ declare type FilterForString = BaseFilter & {
272
278
  values: [string];
273
279
  };
274
280
 
281
+ export declare function fmt(str: string): string;
282
+
275
283
  export declare function getBookmarkKey(dashboardId: string): string;
276
284
 
285
+ export declare function getColumnDataType(column: TDataColumn): string;
286
+
277
287
  export declare function getDashbaordStateWithoutData(dashboardState: TDashboard): {
278
288
  sheets: {
279
289
  cards: TCard[] | undefined;
@@ -290,11 +300,41 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
290
300
  customCards?: CustomCard[] | undefined;
291
301
  };
292
302
 
303
+ export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
304
+
305
+ export declare function getQualifiedTableName(schemaName: string, tableName: string): string;
306
+
307
+ export declare function getSql(config: SqlGen, schemaName: string, tableName: string): string | undefined;
308
+
309
+ export declare function isColumnInSqlGen(column: TDataColumn, sqlGen: SqlGen): boolean | undefined;
310
+
293
311
  export declare type LoadingProps = {
294
312
  message?: string;
295
313
  };
296
314
 
297
- declare type SqlGen = {
315
+ export declare const NUMBER_DATA_TYPES: string[];
316
+
317
+ export declare const resolveDataType: (value: any) => string;
318
+
319
+ export declare function SelectComponent({ title, items, value, isLoading, isError, onChange, }: SelectProps): JSX_2.Element;
320
+
321
+ declare type SelectProps = {
322
+ title: string;
323
+ items: {
324
+ id: string;
325
+ name: string;
326
+ }[];
327
+ value: string;
328
+ isLoading: boolean;
329
+ isError: boolean;
330
+ onChange?: (value: string) => void;
331
+ };
332
+
333
+ export declare function SemaphorQueryClient({ children, }: {
334
+ children: React.ReactNode;
335
+ }): JSX_2.Element;
336
+
337
+ export declare type SqlGen = {
298
338
  measures?: {
299
339
  name: string;
300
340
  calc: AggregateCalc;
@@ -381,7 +421,7 @@ export declare type TDashboard = {
381
421
  customCards?: CustomCard[];
382
422
  };
383
423
 
384
- declare type TDataColumn = {
424
+ export declare type TDataColumn = {
385
425
  column_name: string;
386
426
  data_type: string;
387
427
  is_nullable?: string;
@@ -392,6 +432,8 @@ export declare type TEvent = {
392
432
  message: any;
393
433
  };
394
434
 
435
+ export declare const TEXT_DATA_TYPES: string[];
436
+
395
437
  declare type TFilter = {
396
438
  id: string;
397
439
  connectionId: string;
@@ -791,6 +833,30 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
791
833
 
792
834
  export declare const useEditorActions: () => Actions_2;
793
835
 
836
+ export declare function useEditorAside(token?: AuthToken, connectionQueryKey?: string): {
837
+ connectionItems: any;
838
+ isConnectionsLoading: boolean;
839
+ isConnectionsError: boolean;
840
+ databaseItems: any;
841
+ isDatabasesLoadingOrFetching: boolean;
842
+ isDatabaseError: boolean;
843
+ schemaItems: any;
844
+ isSchemaLoadingOrFetching: boolean;
845
+ isSchemaError: boolean;
846
+ tableItems: any;
847
+ isTableLoadingOrFetching: boolean;
848
+ isTableError: boolean;
849
+ columns: TDataColumn[];
850
+ isColumnsLoadingOrFetching: boolean;
851
+ isColumnsError: boolean;
852
+ isAPIConnection: boolean;
853
+ tableName: string;
854
+ schemaName: string;
855
+ handleConnectionChange: (value: string) => void;
856
+ handleDatabaseChange: (value: string) => void;
857
+ handleSchemaChange: (value: string) => void;
858
+ };
859
+
794
860
  export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "setState"> & {
795
861
  setState(nextStateOrUpdater: EditorStore | Partial<EditorStore> | ((state: {
796
862
  isShowingVisual: boolean;