@magemetrics/ai 0.9.0 → 0.10.0-rc1

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,22 +1,30 @@
1
1
  import { AuthProvider } from '@magemetrics/core';
2
2
  import { AuthState } from '@magemetrics/core';
3
+ import { Components } from './shared/context/MageMetricsContext';
4
+ import { Components as Components_2 } from '../shared/context/MageMetricsContext';
5
+ import { Components as Components_3 } from './MageMetricsContext';
3
6
  import { CreateFlowParam } from '@magemetrics/core';
4
7
  import { default as default_2 } from 'react';
5
8
  import { DirectAuthProvider } from '@magemetrics/core';
6
- import { Dispatch } from 'react';
7
9
  import { ExternalAuthProvider } from '@magemetrics/core';
8
10
  import { ExternalAuthProviderConfig } from '@magemetrics/core';
9
11
  import { FetchNextPageOptions } from '@tanstack/react-query';
10
12
  import { ForwardRefExoticComponent } from 'react';
11
13
  import { InfiniteData } from '@tanstack/react-query';
12
14
  import { InfiniteQueryObserverResult } from '@tanstack/react-query';
15
+ import { JSX } from 'react/jsx-runtime';
13
16
  import { MageMetricsClient } from '@magemetrics/core';
14
17
  import { MageMetricsClientConfig } from '@magemetrics/core';
15
- import { OnChangeFn } from '@tanstack/react-table';
18
+ import { MageMetricsContextProvider } from './shared/context/MageMetricsContext';
19
+ import { MageMetricsContextProviderProps } from './shared/context/MageMetricsContext';
20
+ import { PersistenceOptions } from '../shared/context/MageMetricsContext';
16
21
  import { PropsWithChildren } from 'react';
22
+ import { QueryObserverResult } from '@tanstack/react-query';
17
23
  import { RefAttributes } from 'react';
18
- import { SetStateAction } from 'react';
24
+ import { RefetchOptions } from '@tanstack/react-query';
19
25
  import { SortingState as SortingState_2 } from '@tanstack/react-table';
26
+ import { useMageMetricsClient } from './shared/context/MageMetricsContext';
27
+ import { useMageMetricsReady } from './shared/context/MageMetricsContext';
20
28
  import { UseMutateAsyncFunction } from '@tanstack/react-query';
21
29
  import { UseMutateFunction } from '@tanstack/react-query';
22
30
  import { UseMutationOptions } from '@tanstack/react-query';
@@ -120,38 +128,7 @@ declare interface ColumnSort {
120
128
  id: string;
121
129
  }
122
130
 
123
- export declare interface Components {
124
- dataTableCells?: {
125
- empty?: (props: CellContentProps) => default_2.ReactNode;
126
- units?: {
127
- [key: string]: (props: CellContentProps) => default_2.ReactNode;
128
- };
129
- renderTypes?: {
130
- [key: string]: (props: CellContentProps) => default_2.ReactNode;
131
- };
132
- };
133
- dataReportTable?: (props: DataReportMessageProps) => default_2.ReactNode;
134
- dataReportMessageActions?: (props: {
135
- report: FrontendReport;
136
- isSelected: boolean;
137
- }) => default_2.ReactNode;
138
- visualizationMessageActions?: (props: {
139
- visualization: FrontendVisualization | V1FrontendVisualization;
140
- isSelected: boolean;
141
- }) => default_2.ReactNode;
142
- dataReportPanelActions?: (props: {
143
- report: FrontendReport;
144
- }) => default_2.ReactNode;
145
- visualizationPanelActions?: (props: {
146
- visualization: FrontendVisualization | V1FrontendVisualization;
147
- }) => default_2.ReactNode;
148
- avatar?: default_2.ReactNode;
149
- getCanvasShareableLink?: (canvasId: string) => string;
150
- canvasPanelActions?: (props: {
151
- canvas: FrontendCanvas;
152
- flowId: string;
153
- }) => default_2.ReactNode;
154
- }
131
+ export { Components }
155
132
 
156
133
  export declare const ConfigurableChat: ConfigurableChatComponent;
157
134
 
@@ -178,8 +155,6 @@ declare type ControlledModalProps = {
178
155
  onClose: () => void;
179
156
  };
180
157
 
181
- export declare const ConversationContent: React.FC<ConversationContentProps>;
182
-
183
158
  declare interface ConversationContentProps {
184
159
  flowId?: string;
185
160
  className?: string;
@@ -192,44 +167,13 @@ declare interface ConversationContentProps {
192
167
 
193
168
  export { CreateFlowParam }
194
169
 
195
- /**
196
- * This component is not bounded in height and must be wrapped in a container to properly work
197
- * @param props - props
198
- * @param props.reportId - The ID of the report to display
199
- * @param props.initialState - The initial state of data table
200
- * @param props.onStateChange - Callback function to handle state changes
201
- * @returns JSX.Element
202
- */
203
- export declare const DataReport: React.FC<{
204
- reportId: number;
205
- initialState?: DataTableState;
206
- onStateChange?: (state: DataTableState) => void;
207
- }>;
208
-
209
- export declare interface DataReportMessageProps {
210
- report: FrontendReport;
211
- explainability: FrontendReportExplainability | null | undefined;
212
- infiniteData: {
213
- data?: {
214
- pages: Record<string, unknown>[][];
215
- };
216
- isPending: boolean;
217
- fetchNextPage: () => Promise<unknown>;
218
- isFetching: boolean;
219
- isFetchingNextPage: boolean;
220
- hasNextPage: boolean | undefined;
221
- };
222
- columns: FrontendReportColumns;
223
- totalRows: number;
224
- }
225
-
226
- export declare const DataTable: React.FC<DataReportMessageProps>;
170
+ export declare const DataTable: () => JSX.Element;
227
171
 
228
172
  declare type DataTableState = {
229
- pageIndex: number;
230
- pageSize: number;
231
- sorting: SortingState;
232
- filters: TableFilters;
173
+ pageIndex?: number;
174
+ sorting?: SortingState;
175
+ filters?: TableFilters;
176
+ pageSize?: number;
233
177
  };
234
178
 
235
179
  export { DirectAuthProvider }
@@ -247,10 +191,6 @@ export declare const DomWrapper: React.FC<PropsWithChildren<DomWrapperProps>>;
247
191
 
248
192
  declare type DomWrapperProps = InternalColorSwatchProps;
249
193
 
250
- export declare const DownloadDataReportButton: React.FC<{
251
- reportId: number;
252
- }>;
253
-
254
194
  declare type ExportReportDataParams = {
255
195
  reportId: number;
256
196
  filename?: string;
@@ -296,84 +236,17 @@ declare type FormattedData = {
296
236
  declare type FrontendCanvas = z.infer<typeof FrontendCanvasSchema>;
297
237
 
298
238
  declare const FrontendCanvasSchema: z.ZodObject<{
299
- title: z.ZodNullable<z.ZodString>;
300
239
  id: z.ZodUUID;
240
+ title: z.ZodNullable<z.ZodString>;
301
241
  nodes: z.ZodArray<z.ZodAny>;
302
242
  edges: z.ZodArray<z.ZodAny>;
303
243
  is_public: z.ZodBoolean;
304
244
  }, z.core.$strip>;
305
245
 
306
- declare type FrontendReport = z.infer<typeof FrontendReportSchema>;
307
-
308
- declare type FrontendReportColumns = z.infer<typeof FrontendReportColumnsSchema>;
309
-
310
- declare const FrontendReportColumnsSchema: z.ZodArray<z.ZodObject<{
311
- dataType: z.ZodString;
312
- renderType: z.ZodOptional<z.ZodString>;
313
- unit: z.ZodOptional<z.ZodString>;
314
- name: z.ZodString;
315
- data_type: z.ZodString;
316
- }, z.core.$strip>>;
317
-
318
- declare type FrontendReportExplainability = z.infer<typeof FrontendReportExplainabilitySchema>;
319
-
320
- declare const FrontendReportExplainabilitySchema: z.ZodObject<{
321
- confidence_score: z.ZodNumber;
322
- confidence_score_reason: z.ZodString;
323
- assumptions_score: z.ZodOptional<z.ZodNumber>;
324
- assumptions_score_reason: z.ZodOptional<z.ZodString>;
325
- friendliness_score: z.ZodOptional<z.ZodNumber>;
326
- friendliness_score_reason: z.ZodOptional<z.ZodString>;
327
- columns_lineage: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
328
- nodes: z.ZodArray<z.ZodObject<{
329
- id: z.ZodString;
330
- type: z.ZodEnum<{
331
- result: "result";
332
- filter: "filter";
333
- entity: "entity";
334
- attribute: "attribute";
335
- process: "process";
336
- combine: "combine";
337
- }>;
338
- explanation: z.ZodString;
339
- }, z.core.$strip>>;
340
- edges: z.ZodArray<z.ZodObject<{
341
- source: z.ZodString;
342
- target: z.ZodString;
343
- }, z.core.$strip>>;
344
- }, z.core.$strip>>>>;
345
- sql_explanation: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
346
- chunk_title: z.ZodString;
347
- chunk_explanation: z.ZodString;
348
- lines: z.ZodArray<z.ZodObject<{
349
- sql: z.ZodString;
350
- explanation: z.ZodString;
351
- }, z.core.$strip>>;
352
- }, z.core.$strip>>>>;
353
- business_explanation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
354
- summary: z.ZodString;
355
- implementation: z.ZodArray<z.ZodString>;
356
- assumptions: z.ZodArray<z.ZodObject<{
357
- type: z.ZodEnum<{
358
- grain: "grain";
359
- completeness: "completeness";
360
- transformation: "transformation";
361
- relationship: "relationship";
362
- other: "other";
363
- }>;
364
- details: z.ZodString;
365
- explanation: z.ZodString;
366
- }, z.core.$strip>>;
367
- }, z.core.$strip>>>;
368
- flow_data_id: z.ZodNumber;
369
- output_dataset: z.ZodOptional<z.ZodString>;
370
- sql: z.ZodOptional<z.ZodString>;
371
- }, z.core.$strip>;
372
-
373
246
  declare const FrontendReportSchema: z.ZodObject<{
374
247
  status: z.ZodNullable<z.ZodString>;
375
- title: z.ZodString;
376
248
  id: z.ZodNumber;
249
+ title: z.ZodString;
377
250
  request: z.ZodNullable<z.ZodString>;
378
251
  created_at: z.ZodString;
379
252
  data_summary: z.ZodObject<{
@@ -408,79 +281,6 @@ declare const FrontendReportSchema: z.ZodObject<{
408
281
  bookmarked: z.ZodBoolean;
409
282
  }, z.core.$strip>;
410
283
 
411
- declare type FrontendVisualization = z.output<typeof FrontendVisualizationSchema>;
412
-
413
- declare const FrontendVisualizationSchema: z.ZodObject<{
414
- id: z.ZodNumber;
415
- configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
416
- config_version: z.ZodLiteral<2>;
417
- xAxisLabel: z.ZodString;
418
- yAxisLabel: z.ZodString;
419
- categoryColumn: z.ZodString;
420
- secondaryCategoryColumn: z.ZodOptional<z.ZodString>;
421
- valueColumn: z.ZodString;
422
- title: z.ZodString;
423
- type: z.ZodLiteral<"bar">;
424
- }, z.core.$strip>, z.ZodObject<{
425
- xAxisColumn: z.ZodString;
426
- valueColumns: z.ZodArray<z.ZodString>;
427
- yAxisLabels: z.ZodArray<z.ZodString>;
428
- title: z.ZodString;
429
- type: z.ZodLiteral<"line/area">;
430
- config_version: z.ZodLiteral<2>;
431
- }, z.core.$strip>, z.ZodObject<{
432
- config_version: z.ZodLiteral<2>;
433
- valueColumn: z.ZodString;
434
- xAxisColumn: z.ZodString;
435
- xAxisLabel: z.ZodString;
436
- yAxisLabel: z.ZodString;
437
- categoryColumn: z.ZodString;
438
- title: z.ZodString;
439
- type: z.ZodLiteral<"line/area-categorical">;
440
- }, z.core.$strip>, z.ZodObject<{
441
- config_version: z.ZodLiteral<2>;
442
- xAxisLabel: z.ZodString;
443
- yAxisLabel: z.ZodString;
444
- xAxisValueColumn: z.ZodString;
445
- yAxisValueColumn: z.ZodString;
446
- title: z.ZodString;
447
- type: z.ZodLiteral<"scatter">;
448
- }, z.core.$strip>, z.ZodObject<{
449
- config_version: z.ZodLiteral<2>;
450
- categoryColumn: z.ZodString;
451
- valueColumn: z.ZodString;
452
- title: z.ZodString;
453
- type: z.ZodLiteral<"pie">;
454
- }, z.core.$strip>], "type">;
455
- created_at: z.ZodString;
456
- bookmarked: z.ZodBoolean;
457
- flow_data_id: z.ZodNumber;
458
- flow_data: z.ZodOptional<z.ZodObject<{
459
- is_materialized: z.ZodNullable<z.ZodBoolean>;
460
- last_materialized_at: z.ZodNullable<z.ZodString>;
461
- materialized_error_message: z.ZodNullable<z.ZodString>;
462
- materialized_status: z.ZodNullable<z.ZodEnum<{
463
- running: "running";
464
- completed: "completed";
465
- failed: "failed";
466
- }>>;
467
- }, z.core.$strip>>;
468
- }, z.core.$strip>;
469
-
470
- export declare const InfiniteDataTableUI: React.FC<InfiniteDataTableUIProps>;
471
-
472
- declare type InfiniteDataTableUIProps = {
473
- flowDataId: number;
474
- data: Record<string, unknown>[];
475
- columns: FrontendReportColumns;
476
- explainability: FrontendReportExplainability | null | undefined;
477
- hasNextPage: boolean | undefined;
478
- fetchNextPage: () => Promise<unknown>;
479
- isFetchingNextPage: boolean;
480
- isFetching: boolean;
481
- totalRows: number;
482
- };
483
-
484
284
  declare const InputContainer: default_2.FC<{
485
285
  children?: default_2.ReactNode | ((context: ChatInputContextValue) => default_2.ReactNode);
486
286
  }>;
@@ -502,28 +302,14 @@ export { MageMetricsClient }
502
302
 
503
303
  export { MageMetricsClientConfig }
504
304
 
505
- export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps>;
506
-
507
- export declare type MageMetricsContextProviderProps = {
508
- children: default_2.ReactNode;
509
- components?: Components;
510
- } & ({
511
- /** Provide an external MageMetricsClient instance. */
512
- client: MageMetricsClient;
513
- apiKey?: never;
514
- apiUrl?: never;
515
- externalJwt?: never;
516
- additionalHeaders?: never;
517
- applicationName?: never;
518
- } | ({
519
- /** Configuration to create a new MageMetricsClient. */
520
- client?: never;
521
- } & MageMetricsClientConfig));
305
+ export { MageMetricsContextProvider }
306
+
307
+ export { MageMetricsContextProviderProps }
522
308
 
523
309
  export declare const MageMetricsPublicContextProvider: React.FC<MageMetricsPublicContextProviderProps>;
524
310
 
525
311
  declare type MageMetricsPublicContextProviderProps = PropsWithChildren<Pick<MageMetricsClientConfig, "apiUrl" | "apiKey"> & {
526
- components?: Components;
312
+ components?: Components_3;
527
313
  }>;
528
314
 
529
315
  export declare const ManagedModal: React.FC<ManagedModalProps>;
@@ -542,7 +328,7 @@ declare type ManagedModalBaseProps = ModalProps & {
542
328
  /** Where to persist modal state (localStorage, queryParam, or none) */
543
329
  persist?: PersistenceOptions;
544
330
  /** Custom component overrides for extending functionality */
545
- components?: Components;
331
+ components?: Components_2;
546
332
  /** Application name to associate with flows created through this modal */
547
333
  applicationName?: string;
548
334
  /**
@@ -586,39 +372,6 @@ declare interface ModalProps {
586
372
  startOptions?: StartOptions;
587
373
  }
588
374
 
589
- export declare const PaginatedDataTableUI: React.FC<PaginatedDataTableUIProps>;
590
-
591
- declare type PaginatedDataTableUIProps = {
592
- reportId: number;
593
- data: Record<string, unknown>[];
594
- columns: FrontendReportColumns;
595
- explainability: FrontendReportExplainability | null | undefined;
596
- isFetching: boolean;
597
- totalRows?: number;
598
- pageIndex: number;
599
- pageSize: number;
600
- totalPages?: number;
601
- hasNextPage: boolean;
602
- hasPreviousPage: boolean;
603
- onNextPage: () => void;
604
- onPreviousPage: () => void;
605
- goToPage: (page: number) => void;
606
- sorting: SortingState;
607
- onSortingChange: OnChangeFn<SortingState>;
608
- filters: TableFilters;
609
- onFiltersChange: (filters: TableFilters) => void;
610
- onCalculatedPageSize?: (pageSize: number) => void;
611
- onStateChange?: (state: {
612
- pageIndex: number;
613
- pageSize: number;
614
- sorting: SortingState;
615
- filters: TableFilters;
616
- }) => void;
617
- emptyState?: React.ReactNode;
618
- };
619
-
620
- declare type PersistenceOptions = "queryParam" | "none";
621
-
622
375
  /**
623
376
  * Primary color shade stops used in the UI.
624
377
  */
@@ -657,21 +410,8 @@ export declare type PublicChatProps = Omit<ConversationContentProps, "children">
657
410
  appearance?: AppearanceConfig;
658
411
  };
659
412
 
660
- /**
661
- * This component is not bounded in height and must be wrapped in a container to properly work
662
- * @param props - props
663
- * @param props.canvasId - The ID of the canvas to display
664
- * @param props.reportId - The ID of the report to display
665
- * @param props.initialState - The initial state of data table
666
- * @param props.onStateChange - Callback function to handle state changes
667
- * @returns JSX.Element
668
- */
669
- export declare const PublicDataReport: React.FC<{
670
- canvasId: string;
671
- reportId: number;
672
- initialState?: DataTableState;
673
- onStateChange?: (state: DataTableState) => void;
674
- }>;
413
+ declare type Report_2 = z.infer<typeof FrontendReportSchema>;
414
+ export { Report_2 as Report }
675
415
 
676
416
  declare type ReportDataFilters = {
677
417
  columns?: string[];
@@ -718,6 +458,20 @@ declare type StandaloneConversationModalProps = {
718
458
  appearance?: AppearanceConfig;
719
459
  };
720
460
 
461
+ /**
462
+ * This component is not bounded in height and must be wrapped in a container to properly work
463
+ * @param props - props
464
+ * @param props.report - The report to display
465
+ * @param props.initialState - Initial state for the report
466
+ * @param props.onStateChange - Callback function to handle state changes
467
+ * @returns JSX.Element
468
+ */
469
+ export declare const StandaloneDataTable: React.FC<{
470
+ report: Report_2;
471
+ initialState?: DataTableState;
472
+ onStateChange?: (state: DataTableState) => void;
473
+ }>;
474
+
721
475
  declare type StartOptions = DisplayControlProps & {
722
476
  /** Label text displayed above the chat launcher input */
723
477
  label?: string;
@@ -729,7 +483,26 @@ declare type StartOptions = DisplayControlProps & {
729
483
  enableSpeechToText?: boolean;
730
484
  };
731
485
 
732
- declare type TableFilters = Record<string, string | number>;
486
+ declare type TableFilters = Record<string, TableFilterValue>;
487
+
488
+ declare type TableFilterValue = z.infer<typeof TableFilterValueSchema>;
489
+
490
+ declare const TableFilterValueSchema: z.ZodObject<{
491
+ operator: z.ZodEnum<{
492
+ contains: "contains";
493
+ eq: "eq";
494
+ gt: "gt";
495
+ gte: "gte";
496
+ lt: "lt";
497
+ lte: "lte";
498
+ endsWith: "endsWith";
499
+ startsWith: "startsWith";
500
+ neq: "neq";
501
+ regex: "regex";
502
+ between: "between";
503
+ }>;
504
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
505
+ }, z.core.$strip>;
733
506
 
734
507
  /**
735
508
  * Hook to fetch a canvas by its ID.
@@ -745,8 +518,8 @@ declare type TableFilters = Record<string, string | number>;
745
518
  * ```
746
519
  */
747
520
  export declare const useCanvas: (canvasId: string | undefined | null, options?: Omit<UseQueryOptions<FrontendCanvas, unknown>, "queryKey" | "queryFn">) => UseQueryResult< {
748
- title: string | null;
749
521
  id: string;
522
+ title: string | null;
750
523
  nodes: any[];
751
524
  edges: any[];
752
525
  is_public: boolean;
@@ -874,70 +647,64 @@ export declare const useCreateFlow: (options?: UseMutationOptions<{
874
647
  }, Error, CreateFlowParam, unknown>;
875
648
  };
876
649
 
877
- export declare const useDataReport: (reportId: FrontendReport["id"]) => {
650
+ export declare const useCustomReportData: () => {
651
+ report: {
652
+ status: string | null;
653
+ id: number;
654
+ title: string;
655
+ request: string | null;
656
+ created_at: string;
657
+ data_summary: {
658
+ [x: string]: unknown;
659
+ columns: Record<string, {
660
+ [x: string]: unknown;
661
+ data_type: string;
662
+ null_count: number | null;
663
+ unique_count: number | null;
664
+ unique_percentage: number | null;
665
+ position?: number | undefined;
666
+ min_value?: number | null | undefined;
667
+ max_value?: number | null | undefined;
668
+ avg_value?: number | null | undefined;
669
+ median_value?: number | null | undefined;
670
+ std_value?: number | null | undefined;
671
+ min_date?: string | null | undefined;
672
+ max_date?: string | null | undefined;
673
+ min_length?: number | null | undefined;
674
+ max_length?: number | null | undefined;
675
+ avg_length?: number | null | undefined;
676
+ }>;
677
+ };
678
+ is_removed: boolean;
679
+ flow_id: string;
680
+ is_materialized: boolean | null;
681
+ last_materialized_at: string | null;
682
+ materialized_error_message: string | null;
683
+ materialized_status: "completed" | "running" | "failed" | null;
684
+ bookmarked: boolean;
685
+ };
686
+ fetchNextPage: (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<InfiniteData< {
687
+ [key: string]: unknown;
688
+ }[], unknown>, Error>>;
689
+ pages: {
690
+ [key: string]: unknown;
691
+ }[][] | undefined;
878
692
  columns: {
879
693
  name: string;
880
694
  data_type: string;
881
695
  dataType: string;
882
696
  renderType?: string;
883
697
  unit?: string;
698
+ canonicalDataType?: "numeric" | "boolean" | "datetime" | "text" | "array" | "json" | "other";
884
699
  }[] | undefined;
885
700
  isPendingColumns: boolean;
886
- isPendingData: boolean;
887
- fetchNextPage: (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<InfiniteData< {
888
- [key: string]: unknown;
889
- }[], unknown>, Error>>;
701
+ hasMoreData: boolean;
890
702
  isFetching: boolean;
891
- isFetchingNextPage: boolean;
892
- hasNextPage: boolean;
893
- allData: {
894
- [key: string]: unknown;
895
- }[];
896
- explainability: {
897
- sql_explanation?: {
898
- chunk_title: string;
899
- chunk_explanation: string;
900
- lines: {
901
- sql: string;
902
- explanation: string;
903
- }[];
904
- }[] | null;
905
- business_explanation?: {
906
- summary: string;
907
- implementation: string[];
908
- assumptions: {
909
- type: "grain" | "completeness" | "transformation" | "relationship" | "other";
910
- details: string;
911
- explanation: string;
912
- }[];
913
- } | null;
914
- columns_lineage?: {
915
- [key: string]: {
916
- nodes: {
917
- id: string;
918
- type: "entity" | "attribute" | "filter" | "process" | "combine" | "result";
919
- explanation: string;
920
- }[];
921
- edges: {
922
- source: string;
923
- target: string;
924
- }[];
925
- };
926
- } | null;
927
- confidence_score: number;
928
- confidence_score_reason: string;
929
- assumptions_score?: number;
930
- assumptions_score_reason?: string;
931
- friendliness_score?: number;
932
- friendliness_score_reason?: string;
933
- flow_data_id: number;
934
- output_dataset?: string;
935
- sql?: string;
936
- } | null | undefined;
937
- totalRows: number;
938
- infiniteData: InfiniteData< {
939
- [key: string]: unknown;
940
- }[], unknown> | undefined;
703
+ isPendingData: boolean;
704
+ totalRows: number | undefined;
705
+ totalPages: number | undefined;
706
+ sorting: SortingState_2;
707
+ filters: TableFilters;
941
708
  };
942
709
 
943
710
  export declare const useDataReportColumnValue: (reportId: number, filters: ReportDataFilters) => UseQueryResult< {
@@ -1020,147 +787,107 @@ export declare const useDownloadReportData: (options?: UseMutationOptions<Export
1020
787
 
1021
788
  export declare const useMageMetricsApiUrl: () => string;
1022
789
 
1023
- export declare const useMageMetricsClient: () => MageMetricsClient;
790
+ export { useMageMetricsClient }
1024
791
 
1025
- export declare const useMageMetricsReady: () => false | MageMetricsClient;
1026
-
1027
- export declare const usePaginatedDataReport: (reportId: FrontendReport["id"], options?: {
1028
- pageSize?: number;
1029
- initialPageIndex?: number;
1030
- initialSorting?: SortingState_2;
1031
- initialFilters?: TableFilters;
1032
- }) => {
1033
- columns: {
1034
- name: string;
1035
- data_type: string;
1036
- dataType: string;
1037
- renderType?: string;
1038
- unit?: string;
1039
- }[] | undefined;
1040
- isPendingColumns: boolean;
1041
- isPendingData: boolean;
1042
- isFetching: boolean;
1043
- data: {
1044
- [key: string]: unknown;
1045
- }[];
1046
- explainability: {
1047
- sql_explanation?: {
1048
- chunk_title: string;
1049
- chunk_explanation: string;
1050
- lines: {
1051
- sql: string;
1052
- explanation: string;
1053
- }[];
1054
- }[] | null;
1055
- business_explanation?: {
1056
- summary: string;
1057
- implementation: string[];
1058
- assumptions: {
1059
- type: "grain" | "completeness" | "transformation" | "relationship" | "other";
1060
- details: string;
1061
- explanation: string;
1062
- }[];
1063
- } | null;
1064
- columns_lineage?: {
1065
- [key: string]: {
1066
- nodes: {
1067
- id: string;
1068
- type: "entity" | "attribute" | "filter" | "process" | "combine" | "result";
1069
- explanation: string;
1070
- }[];
1071
- edges: {
1072
- source: string;
1073
- target: string;
1074
- }[];
1075
- };
1076
- } | null;
1077
- confidence_score: number;
1078
- confidence_score_reason: string;
1079
- assumptions_score?: number;
1080
- assumptions_score_reason?: string;
1081
- friendliness_score?: number;
1082
- friendliness_score_reason?: string;
1083
- flow_data_id: number;
1084
- output_dataset?: string;
1085
- sql?: string;
1086
- } | null | undefined;
1087
- totalRows: number | undefined;
1088
- pageIndex: number;
1089
- pageSize: number;
1090
- totalPages: number | undefined;
1091
- nextPage: () => void;
1092
- previousPage: () => void;
1093
- goToPage: (page: number) => void;
1094
- hasNextPage: boolean;
1095
- hasPreviousPage: boolean;
1096
- sorting: SortingState_2;
1097
- setSorting: Dispatch<SetStateAction<SortingState_2>>;
1098
- filters: TableFilters;
1099
- setFilters: (newFilters: TableFilters) => void;
1100
- };
792
+ export { useMageMetricsReady }
1101
793
 
1102
794
  export declare const useRecentFlows: (limit?: number) => UseQueryResult< {
1103
- title: string | null;
1104
795
  id: string;
796
+ title: string | null;
1105
797
  request: string;
1106
798
  created_at: string;
1107
799
  user_id: string | null;
1108
800
  application_id?: number | null | undefined;
1109
801
  }[], Error>;
1110
802
 
1111
- export declare const useSpeechToText: () => AssemblyAIMicrophoneController;
1112
-
1113
- declare type V1FrontendVisualization = z.output<typeof V1FrontendVisualizationSchema>;
803
+ export declare const useReport: (reportId: number) => {
804
+ data: {
805
+ created_at: string;
806
+ flow_id: string;
807
+ id: number;
808
+ title: string;
809
+ request: string | null;
810
+ data_summary: {
811
+ columns: {
812
+ [key: string]: {
813
+ position?: number;
814
+ data_type: string;
815
+ null_count: number | null;
816
+ unique_count: number | null;
817
+ unique_percentage: number | null;
818
+ min_value?: number | null;
819
+ max_value?: number | null;
820
+ avg_value?: number | null;
821
+ median_value?: number | null;
822
+ std_value?: number | null;
823
+ min_date?: string | null;
824
+ max_date?: string | null;
825
+ min_length?: number | null;
826
+ max_length?: number | null;
827
+ avg_length?: number | null;
828
+ } & {
829
+ [key: string]: unknown;
830
+ };
831
+ };
832
+ } & {
833
+ [key: string]: unknown;
834
+ };
835
+ bookmarked: boolean;
836
+ status: string | null;
837
+ is_removed: boolean;
838
+ is_materialized: boolean | null;
839
+ last_materialized_at: string | null;
840
+ materialized_error_message: string | null;
841
+ materialized_status: "completed" | "running" | "failed" | null;
842
+ } | null | undefined;
843
+ isLoading: boolean;
844
+ error: Error | null;
845
+ isError: boolean;
846
+ isSuccess: boolean;
847
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult< {
848
+ created_at: string;
849
+ flow_id: string;
850
+ id: number;
851
+ title: string;
852
+ request: string | null;
853
+ data_summary: {
854
+ columns: {
855
+ [key: string]: {
856
+ position?: number;
857
+ data_type: string;
858
+ null_count: number | null;
859
+ unique_count: number | null;
860
+ unique_percentage: number | null;
861
+ min_value?: number | null;
862
+ max_value?: number | null;
863
+ avg_value?: number | null;
864
+ median_value?: number | null;
865
+ std_value?: number | null;
866
+ min_date?: string | null;
867
+ max_date?: string | null;
868
+ min_length?: number | null;
869
+ max_length?: number | null;
870
+ avg_length?: number | null;
871
+ } & {
872
+ [key: string]: unknown;
873
+ };
874
+ };
875
+ } & {
876
+ [key: string]: unknown;
877
+ };
878
+ bookmarked: boolean;
879
+ status: string | null;
880
+ is_removed: boolean;
881
+ is_materialized: boolean | null;
882
+ last_materialized_at: string | null;
883
+ materialized_error_message: string | null;
884
+ materialized_status: "completed" | "running" | "failed" | null;
885
+ } | null, Error>>;
886
+ isRefetching: boolean;
887
+ isFetching: boolean;
888
+ };
1114
889
 
1115
- declare const V1FrontendVisualizationSchema: z.ZodObject<{
1116
- id: z.ZodNumber;
1117
- configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
1118
- xAxisLabel: z.ZodString;
1119
- yAxisLabel: z.ZodString;
1120
- xAxisDataKey: z.ZodOptional<z.ZodString>;
1121
- yAxisDataKey: z.ZodOptional<z.ZodString>;
1122
- dimensionDataKey: z.ZodOptional<z.ZodString>;
1123
- valueColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1124
- title: z.ZodString;
1125
- type: z.ZodLiteral<"bar">;
1126
- }, z.core.$strip>, z.ZodObject<{
1127
- xAxisLabel: z.ZodString;
1128
- yAxisLabel: z.ZodString;
1129
- xAxisDataKey: z.ZodOptional<z.ZodString>;
1130
- yAxisDataKey: z.ZodOptional<z.ZodString>;
1131
- dimensionDataKey: z.ZodOptional<z.ZodString>;
1132
- valueColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1133
- title: z.ZodString;
1134
- type: z.ZodLiteral<"line/area">;
1135
- }, z.core.$strip>, z.ZodObject<{
1136
- xAxisLabel: z.ZodString;
1137
- yAxisLabel: z.ZodString;
1138
- xAxisDataKey: z.ZodOptional<z.ZodString>;
1139
- yAxisDataKey: z.ZodOptional<z.ZodString>;
1140
- dimensionDataKey: z.ZodOptional<z.ZodString>;
1141
- valueColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1142
- title: z.ZodString;
1143
- type: z.ZodLiteral<"scatter">;
1144
- }, z.core.$strip>, z.ZodObject<{
1145
- nameKey: z.ZodString;
1146
- dataKey: z.ZodString;
1147
- title: z.ZodString;
1148
- type: z.ZodLiteral<"pie">;
1149
- }, z.core.$strip>], "type">;
1150
- created_at: z.ZodString;
1151
- bookmarked: z.ZodBoolean;
1152
- flow_data_id: z.ZodNumber;
1153
- flow_data: z.ZodOptional<z.ZodObject<{
1154
- is_materialized: z.ZodNullable<z.ZodBoolean>;
1155
- last_materialized_at: z.ZodNullable<z.ZodString>;
1156
- materialized_error_message: z.ZodNullable<z.ZodString>;
1157
- materialized_status: z.ZodNullable<z.ZodEnum<{
1158
- running: "running";
1159
- completed: "completed";
1160
- failed: "failed";
1161
- }>>;
1162
- }, z.core.$strip>>;
1163
- }, z.core.$strip>;
890
+ export declare const useSpeechToText: () => AssemblyAIMicrophoneController;
1164
891
 
1165
892
  export declare const Visualization: ForwardRefExoticComponent< {
1166
893
  visualizationId: number;