@magemetrics/ai 0.0.48 → 0.0.52

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,12 +1,18 @@
1
1
  import { default as default_2 } from 'react';
2
+ import { FetchNextPageOptions } from '@tanstack/react-query';
3
+ import { ForwardRefExoticComponent } from 'react';
4
+ import { InfiniteData } from '@tanstack/react-query';
5
+ import { InfiniteQueryObserverResult } from '@tanstack/react-query';
2
6
  import { JSX } from 'react/jsx-runtime';
7
+ import { PropsWithChildren } from 'react';
8
+ import { RefAttributes } from 'react';
3
9
  import { UseMutateAsyncFunction } from '@tanstack/react-query';
4
10
  import { UseMutateFunction } from '@tanstack/react-query';
5
11
  import { UseMutationOptions } from '@tanstack/react-query';
6
12
  import { z } from 'zod';
7
13
 
8
14
  export declare class ApiService {
9
- private client;
15
+ private readonly client;
10
16
  constructor(baseUrl: string);
11
17
  getRecentFlows: (params: {
12
18
  limit?: number;
@@ -17,6 +23,67 @@ export declare class ApiService {
17
23
  user_id: string | null;
18
24
  }[]>;
19
25
  startFlow: (request: StartFlowParam) => Promise<string>;
26
+ getReportVisualizations: (reportId: number) => Promise<{
27
+ created_at: string;
28
+ flow_id: string;
29
+ id: number;
30
+ title: string;
31
+ data_summary: {
32
+ columns: {
33
+ [key: string]: {
34
+ position?: number;
35
+ data_type: string;
36
+ null_count: number | null;
37
+ unique_count: number | null;
38
+ unique_percentage: number | null;
39
+ };
40
+ };
41
+ };
42
+ bookmarked: boolean;
43
+ status: string | null;
44
+ visualizations: {
45
+ id: number;
46
+ flow_data_id: number;
47
+ created_at: string;
48
+ configuration: {
49
+ type: "bar";
50
+ title: string;
51
+ xAxisLabel: string;
52
+ yAxisLabel: string;
53
+ xAxisDataKey?: string;
54
+ yAxisDataKey?: string;
55
+ dimensionDataKey?: string;
56
+ valueColumns?: string[];
57
+ } | {
58
+ type: "line/area";
59
+ title: string;
60
+ xAxisLabel: string;
61
+ yAxisLabel: string;
62
+ xAxisDataKey?: string;
63
+ yAxisDataKey?: string;
64
+ dimensionDataKey?: string;
65
+ valueColumns?: string[];
66
+ } | {
67
+ type: "scatter";
68
+ title: string;
69
+ xAxisLabel: string;
70
+ yAxisLabel: string;
71
+ xAxisDataKey?: string;
72
+ yAxisDataKey?: string;
73
+ dimensionDataKey?: string;
74
+ valueColumns?: string[];
75
+ } | {
76
+ type: "pie";
77
+ title: string;
78
+ nameKey: string;
79
+ dataKey: string;
80
+ };
81
+ bookmarked: boolean;
82
+ }[];
83
+ }>;
84
+ getFlowDataInsights: (flowId: string, options: {
85
+ count: boolean;
86
+ }) => Promise<FrontendFlowDataInsights>;
20
87
  }
21
88
 
22
89
  export declare type CellContentProps = {
@@ -26,6 +93,31 @@ export declare type CellContentProps = {
26
93
  renderType?: string;
27
94
  };
28
95
 
96
+ export declare const Chat: React.FC<React.ComponentProps<typeof Chat_2>>;
97
+
98
+ declare const Chat_2: default_2.MemoExoticComponent<({ flowId, className }: {
99
+ flowId: string;
100
+ className?: string;
101
+ }) => JSX.Element>;
102
+
103
+ export declare const ChatInput: React.FC<React.ComponentProps<typeof ChatInput_2>>;
104
+
105
+ declare const ChatInput_2: default_2.FC<{
106
+ flowId: string;
107
+ }>;
108
+
109
+ export declare const ChatLayoutProvider: default_2.FC<{
110
+ children: default_2.ReactNode;
111
+ mobileBreakpoint?: string;
112
+ }>;
113
+
114
+ export declare const ChatMessages: React.FC<React.ComponentProps<typeof ChatMessages_2>>;
115
+
116
+ declare const ChatMessages_2: default_2.FC<{
117
+ flowId: string;
118
+ onWaitingMessagesCursorChange?: (value: number) => void;
119
+ }>;
120
+
29
121
  export declare interface Components {
30
122
  dataTableCells?: {
31
123
  empty?: (props: CellContentProps) => default_2.ReactNode;
@@ -37,6 +129,13 @@ export declare interface Components {
37
129
  };
38
130
  };
39
131
  dataReportTable?: (props: DataReportMessageProps) => default_2.ReactNode;
132
+ messageActions?: (props: {
133
+ type: "data-report";
134
+ report: FrontendReport;
135
+ } | {
136
+ type: "visualization";
137
+ visualization: FrontendVisualization;
138
+ }) => default_2.ReactNode;
40
139
  }
41
140
 
42
141
  declare type ControlledModalProps = {
@@ -44,11 +143,15 @@ declare type ControlledModalProps = {
44
143
  onClose: () => void;
45
144
  };
46
145
 
146
+ export declare const DataReport: React.FC<{
147
+ reportId: number;
148
+ }>;
149
+
47
150
  export declare interface DataReportMessageProps {
48
- report: FrontendFlowData;
151
+ report: FrontendReport;
49
152
  isOpened: boolean;
50
153
  setIsOpened: (opened: boolean) => void;
51
- explainability: FrontendFlowDataExplainability | null | undefined;
154
+ explainability: FrontendReportExplainability | null | undefined;
52
155
  infiniteData: {
53
156
  data?: {
54
157
  pages: Record<string, unknown>[][];
@@ -59,7 +162,7 @@ export declare interface DataReportMessageProps {
59
162
  isFetchingNextPage: boolean;
60
163
  hasNextPage: boolean | undefined;
61
164
  };
62
- columns: FrontendFlowColumns;
165
+ columns: FrontendReportColumns;
63
166
  totalRows: number;
64
167
  }
65
168
 
@@ -71,6 +174,12 @@ declare type DisplayControlProps = {
71
174
  showBackdrop?: boolean;
72
175
  };
73
176
 
177
+ export declare const DomWrapper: React.FC<PropsWithChildren<DomWrapperProps>>;
178
+
179
+ declare type DomWrapperProps = {
180
+ display?: string;
181
+ };
182
+
74
183
  /**
75
184
  * This module handles the formatting and normalization of table cell values for display and sorting.
76
185
  *
@@ -98,9 +207,439 @@ declare type FormattedData = {
98
207
  sortValue: string | number | Date | null;
99
208
  };
100
209
 
101
- declare type FrontendFlowColumns = z.infer<typeof FrontendFlowColumnsSchema>;
210
+ declare type FrontendFlowDataInsights = z.infer<typeof FrontendFlowDataInsightsSchema>;
211
+
212
+ declare const FrontendFlowDataInsightsSchema: z.ZodDiscriminatedUnion<"count", [z.ZodObject<{
213
+ count: z.ZodLiteral<false>;
214
+ data_reports: z.ZodArray<z.ZodObject<Omit<{
215
+ created_at: z.ZodString;
216
+ flow_id: z.ZodString;
217
+ id: z.ZodNumber;
218
+ is_sample: z.ZodBoolean;
219
+ schema: z.ZodString;
220
+ sql: z.ZodString;
221
+ table: z.ZodString;
222
+ title: z.ZodString;
223
+ data_sample: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
224
+ data_summary: z.ZodObject<{
225
+ columns: z.ZodRecord<z.ZodString, z.ZodObject<{
226
+ position: z.ZodOptional<z.ZodNumber>;
227
+ data_type: z.ZodString;
228
+ null_count: z.ZodNullable<z.ZodNumber>;
229
+ unique_count: z.ZodNullable<z.ZodNumber>;
230
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
231
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
232
+ position: z.ZodOptional<z.ZodNumber>;
233
+ data_type: z.ZodString;
234
+ null_count: z.ZodNullable<z.ZodNumber>;
235
+ unique_count: z.ZodNullable<z.ZodNumber>;
236
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
237
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
238
+ position: z.ZodOptional<z.ZodNumber>;
239
+ data_type: z.ZodString;
240
+ null_count: z.ZodNullable<z.ZodNumber>;
241
+ unique_count: z.ZodNullable<z.ZodNumber>;
242
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
243
+ }, z.ZodTypeAny, "passthrough">>>;
244
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
245
+ columns: z.ZodRecord<z.ZodString, z.ZodObject<{
246
+ position: z.ZodOptional<z.ZodNumber>;
247
+ data_type: z.ZodString;
248
+ null_count: z.ZodNullable<z.ZodNumber>;
249
+ unique_count: z.ZodNullable<z.ZodNumber>;
250
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
251
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
252
+ position: z.ZodOptional<z.ZodNumber>;
253
+ data_type: z.ZodString;
254
+ null_count: z.ZodNullable<z.ZodNumber>;
255
+ unique_count: z.ZodNullable<z.ZodNumber>;
256
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
257
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
258
+ position: z.ZodOptional<z.ZodNumber>;
259
+ data_type: z.ZodString;
260
+ null_count: z.ZodNullable<z.ZodNumber>;
261
+ unique_count: z.ZodNullable<z.ZodNumber>;
262
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
263
+ }, z.ZodTypeAny, "passthrough">>>;
264
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
265
+ columns: z.ZodRecord<z.ZodString, z.ZodObject<{
266
+ position: z.ZodOptional<z.ZodNumber>;
267
+ data_type: z.ZodString;
268
+ null_count: z.ZodNullable<z.ZodNumber>;
269
+ unique_count: z.ZodNullable<z.ZodNumber>;
270
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
271
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
272
+ position: z.ZodOptional<z.ZodNumber>;
273
+ data_type: z.ZodString;
274
+ null_count: z.ZodNullable<z.ZodNumber>;
275
+ unique_count: z.ZodNullable<z.ZodNumber>;
276
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
277
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
278
+ position: z.ZodOptional<z.ZodNumber>;
279
+ data_type: z.ZodString;
280
+ null_count: z.ZodNullable<z.ZodNumber>;
281
+ unique_count: z.ZodNullable<z.ZodNumber>;
282
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
283
+ }, z.ZodTypeAny, "passthrough">>>;
284
+ }, z.ZodTypeAny, "passthrough">>;
285
+ bookmarked: z.ZodBoolean;
286
+ status: z.ZodNullable<z.ZodString>;
287
+ }, "schema" | "sql" | "table" | "is_sample" | "data_sample">, "strip", z.ZodTypeAny, {
288
+ status: string | null;
289
+ title: string;
290
+ id: number;
291
+ created_at: string;
292
+ bookmarked: boolean;
293
+ flow_id: string;
294
+ data_summary: {
295
+ columns: Record<string, z.objectOutputType<{
296
+ position: z.ZodOptional<z.ZodNumber>;
297
+ data_type: z.ZodString;
298
+ null_count: z.ZodNullable<z.ZodNumber>;
299
+ unique_count: z.ZodNullable<z.ZodNumber>;
300
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
301
+ }, z.ZodTypeAny, "passthrough">>;
302
+ } & {
303
+ [k: string]: unknown;
304
+ };
305
+ }, {
306
+ status: string | null;
307
+ title: string;
308
+ id: number;
309
+ created_at: string;
310
+ bookmarked: boolean;
311
+ flow_id: string;
312
+ data_summary: {
313
+ columns: Record<string, z.objectInputType<{
314
+ position: z.ZodOptional<z.ZodNumber>;
315
+ data_type: z.ZodString;
316
+ null_count: z.ZodNullable<z.ZodNumber>;
317
+ unique_count: z.ZodNullable<z.ZodNumber>;
318
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
319
+ }, z.ZodTypeAny, "passthrough">>;
320
+ } & {
321
+ [k: string]: unknown;
322
+ };
323
+ }>, "many">;
324
+ visualizations: z.ZodArray<z.ZodObject<Omit<{
325
+ id: z.ZodNumber;
326
+ flow_data_id: z.ZodNumber;
327
+ created_at: z.ZodString;
328
+ configuration: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
329
+ xAxisLabel: z.ZodString;
330
+ yAxisLabel: z.ZodString;
331
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
332
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
333
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
334
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
335
+ title: z.ZodString;
336
+ type: z.ZodLiteral<"bar">;
337
+ }, "strip", z.ZodTypeAny, {
338
+ type: "bar";
339
+ title: string;
340
+ xAxisLabel: string;
341
+ yAxisLabel: string;
342
+ xAxisDataKey?: string | undefined;
343
+ yAxisDataKey?: string | undefined;
344
+ dimensionDataKey?: string | undefined;
345
+ valueColumns?: string[] | undefined;
346
+ }, {
347
+ type: "bar";
348
+ title: string;
349
+ xAxisLabel: string;
350
+ yAxisLabel: string;
351
+ xAxisDataKey?: string | undefined;
352
+ yAxisDataKey?: string | undefined;
353
+ dimensionDataKey?: string | undefined;
354
+ valueColumns?: string[] | undefined;
355
+ }>, z.ZodObject<{
356
+ xAxisLabel: z.ZodString;
357
+ yAxisLabel: z.ZodString;
358
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
359
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
360
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
361
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
362
+ title: z.ZodString;
363
+ type: z.ZodLiteral<"line/area">;
364
+ }, "strip", z.ZodTypeAny, {
365
+ type: "line/area";
366
+ title: string;
367
+ xAxisLabel: string;
368
+ yAxisLabel: string;
369
+ xAxisDataKey?: string | undefined;
370
+ yAxisDataKey?: string | undefined;
371
+ dimensionDataKey?: string | undefined;
372
+ valueColumns?: string[] | undefined;
373
+ }, {
374
+ type: "line/area";
375
+ title: string;
376
+ xAxisLabel: string;
377
+ yAxisLabel: string;
378
+ xAxisDataKey?: string | undefined;
379
+ yAxisDataKey?: string | undefined;
380
+ dimensionDataKey?: string | undefined;
381
+ valueColumns?: string[] | undefined;
382
+ }>, z.ZodObject<{
383
+ xAxisLabel: z.ZodString;
384
+ yAxisLabel: z.ZodString;
385
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
386
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
387
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
388
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
389
+ title: z.ZodString;
390
+ type: z.ZodLiteral<"scatter">;
391
+ }, "strip", z.ZodTypeAny, {
392
+ type: "scatter";
393
+ title: string;
394
+ xAxisLabel: string;
395
+ yAxisLabel: string;
396
+ xAxisDataKey?: string | undefined;
397
+ yAxisDataKey?: string | undefined;
398
+ dimensionDataKey?: string | undefined;
399
+ valueColumns?: string[] | undefined;
400
+ }, {
401
+ type: "scatter";
402
+ title: string;
403
+ xAxisLabel: string;
404
+ yAxisLabel: string;
405
+ xAxisDataKey?: string | undefined;
406
+ yAxisDataKey?: string | undefined;
407
+ dimensionDataKey?: string | undefined;
408
+ valueColumns?: string[] | undefined;
409
+ }>, z.ZodObject<{
410
+ nameKey: z.ZodString;
411
+ dataKey: z.ZodString;
412
+ title: z.ZodString;
413
+ type: z.ZodLiteral<"pie">;
414
+ }, "strip", z.ZodTypeAny, {
415
+ type: "pie";
416
+ title: string;
417
+ nameKey: string;
418
+ dataKey: string;
419
+ }, {
420
+ type: "pie";
421
+ title: string;
422
+ nameKey: string;
423
+ dataKey: string;
424
+ }>]>;
425
+ sql: z.ZodString;
426
+ bookmarked: z.ZodBoolean;
427
+ }, "sql">, "strip", z.ZodTypeAny, {
428
+ id: number;
429
+ flow_data_id: number;
430
+ created_at: string;
431
+ configuration: {
432
+ type: "bar";
433
+ title: string;
434
+ xAxisLabel: string;
435
+ yAxisLabel: string;
436
+ xAxisDataKey?: string | undefined;
437
+ yAxisDataKey?: string | undefined;
438
+ dimensionDataKey?: string | undefined;
439
+ valueColumns?: string[] | undefined;
440
+ } | {
441
+ type: "line/area";
442
+ title: string;
443
+ xAxisLabel: string;
444
+ yAxisLabel: string;
445
+ xAxisDataKey?: string | undefined;
446
+ yAxisDataKey?: string | undefined;
447
+ dimensionDataKey?: string | undefined;
448
+ valueColumns?: string[] | undefined;
449
+ } | {
450
+ type: "scatter";
451
+ title: string;
452
+ xAxisLabel: string;
453
+ yAxisLabel: string;
454
+ xAxisDataKey?: string | undefined;
455
+ yAxisDataKey?: string | undefined;
456
+ dimensionDataKey?: string | undefined;
457
+ valueColumns?: string[] | undefined;
458
+ } | {
459
+ type: "pie";
460
+ title: string;
461
+ nameKey: string;
462
+ dataKey: string;
463
+ };
464
+ bookmarked: boolean;
465
+ }, {
466
+ id: number;
467
+ flow_data_id: number;
468
+ created_at: string;
469
+ configuration: {
470
+ type: "bar";
471
+ title: string;
472
+ xAxisLabel: string;
473
+ yAxisLabel: string;
474
+ xAxisDataKey?: string | undefined;
475
+ yAxisDataKey?: string | undefined;
476
+ dimensionDataKey?: string | undefined;
477
+ valueColumns?: string[] | undefined;
478
+ } | {
479
+ type: "line/area";
480
+ title: string;
481
+ xAxisLabel: string;
482
+ yAxisLabel: string;
483
+ xAxisDataKey?: string | undefined;
484
+ yAxisDataKey?: string | undefined;
485
+ dimensionDataKey?: string | undefined;
486
+ valueColumns?: string[] | undefined;
487
+ } | {
488
+ type: "scatter";
489
+ title: string;
490
+ xAxisLabel: string;
491
+ yAxisLabel: string;
492
+ xAxisDataKey?: string | undefined;
493
+ yAxisDataKey?: string | undefined;
494
+ dimensionDataKey?: string | undefined;
495
+ valueColumns?: string[] | undefined;
496
+ } | {
497
+ type: "pie";
498
+ title: string;
499
+ nameKey: string;
500
+ dataKey: string;
501
+ };
502
+ bookmarked: boolean;
503
+ }>, "many">;
504
+ }, "strip", z.ZodTypeAny, {
505
+ count: false;
506
+ data_reports: {
507
+ status: string | null;
508
+ title: string;
509
+ id: number;
510
+ created_at: string;
511
+ bookmarked: boolean;
512
+ flow_id: string;
513
+ data_summary: {
514
+ columns: Record<string, z.objectOutputType<{
515
+ position: z.ZodOptional<z.ZodNumber>;
516
+ data_type: z.ZodString;
517
+ null_count: z.ZodNullable<z.ZodNumber>;
518
+ unique_count: z.ZodNullable<z.ZodNumber>;
519
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
520
+ }, z.ZodTypeAny, "passthrough">>;
521
+ } & {
522
+ [k: string]: unknown;
523
+ };
524
+ }[];
525
+ visualizations: {
526
+ id: number;
527
+ flow_data_id: number;
528
+ created_at: string;
529
+ configuration: {
530
+ type: "bar";
531
+ title: string;
532
+ xAxisLabel: string;
533
+ yAxisLabel: string;
534
+ xAxisDataKey?: string | undefined;
535
+ yAxisDataKey?: string | undefined;
536
+ dimensionDataKey?: string | undefined;
537
+ valueColumns?: string[] | undefined;
538
+ } | {
539
+ type: "line/area";
540
+ title: string;
541
+ xAxisLabel: string;
542
+ yAxisLabel: string;
543
+ xAxisDataKey?: string | undefined;
544
+ yAxisDataKey?: string | undefined;
545
+ dimensionDataKey?: string | undefined;
546
+ valueColumns?: string[] | undefined;
547
+ } | {
548
+ type: "scatter";
549
+ title: string;
550
+ xAxisLabel: string;
551
+ yAxisLabel: string;
552
+ xAxisDataKey?: string | undefined;
553
+ yAxisDataKey?: string | undefined;
554
+ dimensionDataKey?: string | undefined;
555
+ valueColumns?: string[] | undefined;
556
+ } | {
557
+ type: "pie";
558
+ title: string;
559
+ nameKey: string;
560
+ dataKey: string;
561
+ };
562
+ bookmarked: boolean;
563
+ }[];
564
+ }, {
565
+ count: false;
566
+ data_reports: {
567
+ status: string | null;
568
+ title: string;
569
+ id: number;
570
+ created_at: string;
571
+ bookmarked: boolean;
572
+ flow_id: string;
573
+ data_summary: {
574
+ columns: Record<string, z.objectInputType<{
575
+ position: z.ZodOptional<z.ZodNumber>;
576
+ data_type: z.ZodString;
577
+ null_count: z.ZodNullable<z.ZodNumber>;
578
+ unique_count: z.ZodNullable<z.ZodNumber>;
579
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
580
+ }, z.ZodTypeAny, "passthrough">>;
581
+ } & {
582
+ [k: string]: unknown;
583
+ };
584
+ }[];
585
+ visualizations: {
586
+ id: number;
587
+ flow_data_id: number;
588
+ created_at: string;
589
+ configuration: {
590
+ type: "bar";
591
+ title: string;
592
+ xAxisLabel: string;
593
+ yAxisLabel: string;
594
+ xAxisDataKey?: string | undefined;
595
+ yAxisDataKey?: string | undefined;
596
+ dimensionDataKey?: string | undefined;
597
+ valueColumns?: string[] | undefined;
598
+ } | {
599
+ type: "line/area";
600
+ title: string;
601
+ xAxisLabel: string;
602
+ yAxisLabel: string;
603
+ xAxisDataKey?: string | undefined;
604
+ yAxisDataKey?: string | undefined;
605
+ dimensionDataKey?: string | undefined;
606
+ valueColumns?: string[] | undefined;
607
+ } | {
608
+ type: "scatter";
609
+ title: string;
610
+ xAxisLabel: string;
611
+ yAxisLabel: string;
612
+ xAxisDataKey?: string | undefined;
613
+ yAxisDataKey?: string | undefined;
614
+ dimensionDataKey?: string | undefined;
615
+ valueColumns?: string[] | undefined;
616
+ } | {
617
+ type: "pie";
618
+ title: string;
619
+ nameKey: string;
620
+ dataKey: string;
621
+ };
622
+ bookmarked: boolean;
623
+ }[];
624
+ }>, z.ZodObject<{
625
+ count: z.ZodLiteral<true>;
626
+ data_reports: z.ZodNumber;
627
+ visualizations: z.ZodNumber;
628
+ }, "strip", z.ZodTypeAny, {
629
+ count: true;
630
+ data_reports: number;
631
+ visualizations: number;
632
+ }, {
633
+ count: true;
634
+ data_reports: number;
635
+ visualizations: number;
636
+ }>]>;
637
+
638
+ declare type FrontendReport = z.infer<typeof FrontendReportSchema>;
639
+
640
+ declare type FrontendReportColumns = z.infer<typeof FrontendReportColumnsSchema>;
102
641
 
103
- declare const FrontendFlowColumnsSchema: z.ZodArray<z.ZodObject<{
642
+ declare const FrontendReportColumnsSchema: z.ZodArray<z.ZodObject<{
104
643
  name: z.ZodString;
105
644
  data_type: z.ZodString;
106
645
  } & {
@@ -121,11 +660,9 @@ declare const FrontendFlowColumnsSchema: z.ZodArray<z.ZodObject<{
121
660
  renderType?: string | undefined;
122
661
  }>, "many">;
123
662
 
124
- declare type FrontendFlowData = z.infer<typeof FrontendFlowDataSchema>;
663
+ declare type FrontendReportExplainability = z.infer<typeof FrontendReportExplainabilitySchema>;
125
664
 
126
- declare type FrontendFlowDataExplainability = z.infer<typeof FrontendFlowDataExplainabilitySchema>;
127
-
128
- declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
665
+ declare const FrontendReportExplainabilitySchema: z.ZodObject<Omit<{
129
666
  sql_explanation: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
130
667
  chunk_title: z.ZodString;
131
668
  chunk_explanation: z.ZodString;
@@ -315,7 +852,7 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
315
852
  friendliness_score_reason?: string | undefined;
316
853
  }>;
317
854
 
318
- declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
855
+ declare const FrontendReportSchema: z.ZodObject<Omit<{
319
856
  created_at: z.ZodString;
320
857
  flow_id: z.ZodString;
321
858
  id: z.ZodNumber;
@@ -388,10 +925,11 @@ declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
388
925
  }, z.ZodTypeAny, "passthrough">>;
389
926
  bookmarked: z.ZodBoolean;
390
927
  status: z.ZodNullable<z.ZodString>;
391
- }, "schema" | "sql" | "table" | "created_at" | "is_sample" | "data_sample">, "strip", z.ZodTypeAny, {
928
+ }, "schema" | "sql" | "table" | "is_sample" | "data_sample">, "strip", z.ZodTypeAny, {
392
929
  status: string | null;
393
930
  title: string;
394
931
  id: number;
932
+ created_at: string;
395
933
  bookmarked: boolean;
396
934
  flow_id: string;
397
935
  data_summary: {
@@ -409,6 +947,7 @@ declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
409
947
  status: string | null;
410
948
  title: string;
411
949
  id: number;
950
+ created_at: string;
412
951
  bookmarked: boolean;
413
952
  flow_id: string;
414
953
  data_summary: {
@@ -424,6 +963,205 @@ declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
424
963
  };
425
964
  }>;
426
965
 
966
+ declare type FrontendVisualization = z.output<typeof FrontendVisualizationSchema>;
967
+
968
+ declare const FrontendVisualizationSchema: z.ZodObject<Omit<{
969
+ id: z.ZodNumber;
970
+ flow_data_id: z.ZodNumber;
971
+ created_at: z.ZodString;
972
+ configuration: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
973
+ xAxisLabel: z.ZodString;
974
+ yAxisLabel: z.ZodString;
975
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
976
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
977
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
978
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
979
+ title: z.ZodString;
980
+ type: z.ZodLiteral<"bar">;
981
+ }, "strip", z.ZodTypeAny, {
982
+ type: "bar";
983
+ title: string;
984
+ xAxisLabel: string;
985
+ yAxisLabel: string;
986
+ xAxisDataKey?: string | undefined;
987
+ yAxisDataKey?: string | undefined;
988
+ dimensionDataKey?: string | undefined;
989
+ valueColumns?: string[] | undefined;
990
+ }, {
991
+ type: "bar";
992
+ title: string;
993
+ xAxisLabel: string;
994
+ yAxisLabel: string;
995
+ xAxisDataKey?: string | undefined;
996
+ yAxisDataKey?: string | undefined;
997
+ dimensionDataKey?: string | undefined;
998
+ valueColumns?: string[] | undefined;
999
+ }>, z.ZodObject<{
1000
+ xAxisLabel: z.ZodString;
1001
+ yAxisLabel: z.ZodString;
1002
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1003
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1004
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1005
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1006
+ title: z.ZodString;
1007
+ type: z.ZodLiteral<"line/area">;
1008
+ }, "strip", z.ZodTypeAny, {
1009
+ type: "line/area";
1010
+ title: string;
1011
+ xAxisLabel: string;
1012
+ yAxisLabel: string;
1013
+ xAxisDataKey?: string | undefined;
1014
+ yAxisDataKey?: string | undefined;
1015
+ dimensionDataKey?: string | undefined;
1016
+ valueColumns?: string[] | undefined;
1017
+ }, {
1018
+ type: "line/area";
1019
+ title: string;
1020
+ xAxisLabel: string;
1021
+ yAxisLabel: string;
1022
+ xAxisDataKey?: string | undefined;
1023
+ yAxisDataKey?: string | undefined;
1024
+ dimensionDataKey?: string | undefined;
1025
+ valueColumns?: string[] | undefined;
1026
+ }>, z.ZodObject<{
1027
+ xAxisLabel: z.ZodString;
1028
+ yAxisLabel: z.ZodString;
1029
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1030
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1031
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1032
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1033
+ title: z.ZodString;
1034
+ type: z.ZodLiteral<"scatter">;
1035
+ }, "strip", z.ZodTypeAny, {
1036
+ type: "scatter";
1037
+ title: string;
1038
+ xAxisLabel: string;
1039
+ yAxisLabel: string;
1040
+ xAxisDataKey?: string | undefined;
1041
+ yAxisDataKey?: string | undefined;
1042
+ dimensionDataKey?: string | undefined;
1043
+ valueColumns?: string[] | undefined;
1044
+ }, {
1045
+ type: "scatter";
1046
+ title: string;
1047
+ xAxisLabel: string;
1048
+ yAxisLabel: string;
1049
+ xAxisDataKey?: string | undefined;
1050
+ yAxisDataKey?: string | undefined;
1051
+ dimensionDataKey?: string | undefined;
1052
+ valueColumns?: string[] | undefined;
1053
+ }>, z.ZodObject<{
1054
+ nameKey: z.ZodString;
1055
+ dataKey: z.ZodString;
1056
+ title: z.ZodString;
1057
+ type: z.ZodLiteral<"pie">;
1058
+ }, "strip", z.ZodTypeAny, {
1059
+ type: "pie";
1060
+ title: string;
1061
+ nameKey: string;
1062
+ dataKey: string;
1063
+ }, {
1064
+ type: "pie";
1065
+ title: string;
1066
+ nameKey: string;
1067
+ dataKey: string;
1068
+ }>]>;
1069
+ sql: z.ZodString;
1070
+ bookmarked: z.ZodBoolean;
1071
+ }, "sql">, "strip", z.ZodTypeAny, {
1072
+ id: number;
1073
+ flow_data_id: number;
1074
+ created_at: string;
1075
+ configuration: {
1076
+ type: "bar";
1077
+ title: string;
1078
+ xAxisLabel: string;
1079
+ yAxisLabel: string;
1080
+ xAxisDataKey?: string | undefined;
1081
+ yAxisDataKey?: string | undefined;
1082
+ dimensionDataKey?: string | undefined;
1083
+ valueColumns?: string[] | undefined;
1084
+ } | {
1085
+ type: "line/area";
1086
+ title: string;
1087
+ xAxisLabel: string;
1088
+ yAxisLabel: string;
1089
+ xAxisDataKey?: string | undefined;
1090
+ yAxisDataKey?: string | undefined;
1091
+ dimensionDataKey?: string | undefined;
1092
+ valueColumns?: string[] | undefined;
1093
+ } | {
1094
+ type: "scatter";
1095
+ title: string;
1096
+ xAxisLabel: string;
1097
+ yAxisLabel: string;
1098
+ xAxisDataKey?: string | undefined;
1099
+ yAxisDataKey?: string | undefined;
1100
+ dimensionDataKey?: string | undefined;
1101
+ valueColumns?: string[] | undefined;
1102
+ } | {
1103
+ type: "pie";
1104
+ title: string;
1105
+ nameKey: string;
1106
+ dataKey: string;
1107
+ };
1108
+ bookmarked: boolean;
1109
+ }, {
1110
+ id: number;
1111
+ flow_data_id: number;
1112
+ created_at: string;
1113
+ configuration: {
1114
+ type: "bar";
1115
+ title: string;
1116
+ xAxisLabel: string;
1117
+ yAxisLabel: string;
1118
+ xAxisDataKey?: string | undefined;
1119
+ yAxisDataKey?: string | undefined;
1120
+ dimensionDataKey?: string | undefined;
1121
+ valueColumns?: string[] | undefined;
1122
+ } | {
1123
+ type: "line/area";
1124
+ title: string;
1125
+ xAxisLabel: string;
1126
+ yAxisLabel: string;
1127
+ xAxisDataKey?: string | undefined;
1128
+ yAxisDataKey?: string | undefined;
1129
+ dimensionDataKey?: string | undefined;
1130
+ valueColumns?: string[] | undefined;
1131
+ } | {
1132
+ type: "scatter";
1133
+ title: string;
1134
+ xAxisLabel: string;
1135
+ yAxisLabel: string;
1136
+ xAxisDataKey?: string | undefined;
1137
+ yAxisDataKey?: string | undefined;
1138
+ dimensionDataKey?: string | undefined;
1139
+ valueColumns?: string[] | undefined;
1140
+ } | {
1141
+ type: "pie";
1142
+ title: string;
1143
+ nameKey: string;
1144
+ dataKey: string;
1145
+ };
1146
+ bookmarked: boolean;
1147
+ }>;
1148
+
1149
+ export declare const InfiniteDataTableUI: React.FC<InfiniteDataTableUIProps>;
1150
+
1151
+ declare type InfiniteDataTableUIProps = {
1152
+ flowDataId: number;
1153
+ data: Record<string, unknown>[];
1154
+ columns: FrontendReportColumns;
1155
+ explainability: FrontendReportExplainability | null | undefined;
1156
+ isOpened: boolean;
1157
+ setIsOpened: (opened: boolean) => void;
1158
+ hasNextPage?: boolean;
1159
+ fetchNextPage: () => Promise<unknown>;
1160
+ isFetchingNextPage: boolean;
1161
+ isFetching: boolean;
1162
+ totalRows: number;
1163
+ };
1164
+
427
1165
  export declare const logout: () => Promise<void>;
428
1166
 
429
1167
  export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps>;
@@ -475,6 +1213,68 @@ declare type StartOptions = DisplayControlProps & {
475
1213
  placeholders?: string[];
476
1214
  };
477
1215
 
1216
+ export declare const useDataReport: (flowDataId: FrontendReport["id"]) => {
1217
+ dataColumns: {
1218
+ name: string;
1219
+ data_type: string;
1220
+ dataType: string;
1221
+ renderType?: string;
1222
+ unit?: string;
1223
+ }[] | undefined;
1224
+ isPendingColumns: boolean;
1225
+ isPendingData: boolean;
1226
+ fetchNextPage: (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<InfiniteData<Record<string, unknown>[], unknown>, Error>>;
1227
+ isFetching: boolean;
1228
+ isFetchingNextPage: boolean;
1229
+ hasNextPage: boolean;
1230
+ allData: Record<string, unknown>[];
1231
+ explainability: {
1232
+ sql_explanation?: {
1233
+ chunk_title: string;
1234
+ chunk_explanation: string;
1235
+ lines: {
1236
+ sql: string;
1237
+ explanation: string;
1238
+ }[];
1239
+ }[] | null;
1240
+ business_explanation?: {
1241
+ summary: string;
1242
+ implementation: string[];
1243
+ assumptions: {
1244
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
1245
+ details: string;
1246
+ explanation: string;
1247
+ }[];
1248
+ } | null;
1249
+ columns_lineage?: {
1250
+ [key: string]: {
1251
+ nodes: {
1252
+ id: string;
1253
+ type: "entity" | "attribute" | "filter" | "process" | "combine" | "result";
1254
+ explanation: string;
1255
+ }[];
1256
+ edges: {
1257
+ source: string;
1258
+ target: string;
1259
+ }[];
1260
+ };
1261
+ } | null;
1262
+ confidence_score: number;
1263
+ confidence_score_reason: string;
1264
+ assumptions_score?: number;
1265
+ assumptions_score_reason?: string;
1266
+ friendliness_score?: number;
1267
+ friendliness_score_reason?: string;
1268
+ flow_data_id: number;
1269
+ } | null | undefined;
1270
+ totalRows: number;
1271
+ infiniteData: InfiniteData<Record<string, unknown>[], unknown> | undefined;
1272
+ };
1273
+
1274
+ export declare const useMageMetricsApiUrl: () => string;
1275
+
1276
+ export declare const useMageMetricsReady: () => boolean;
1277
+
478
1278
  export declare const useStartFlow: (options?: UseMutationOptions<string, Error, StartFlowParam>) => {
479
1279
  startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
480
1280
  startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
@@ -553,6 +1353,12 @@ export declare const useStartFlow: (options?: UseMutationOptions<string, Error,
553
1353
  mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
554
1354
  };
555
1355
 
1356
+ export declare const Visualization: ForwardRefExoticComponent< {
1357
+ visualizationId: number;
1358
+ isFullWidth: boolean;
1359
+ withTitle: boolean;
1360
+ } & RefAttributes<HTMLDivElement>>;
1361
+
556
1362
  export { }
557
1363
 
558
1364