@magemetrics/ai 0.0.58 → 0.0.60

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.
@@ -0,0 +1,1521 @@
1
+ import { AuthState } from '@magemetrics/core';
2
+ import { default as default_2 } from 'react';
3
+ import { FetchNextPageOptions } from '@tanstack/react-query';
4
+ import { ForwardRefExoticComponent } from 'react';
5
+ import { GenerateInsightParam } from '@magemetrics/core';
6
+ import { InfiniteData } from '@tanstack/react-query';
7
+ import { InfiniteQueryObserverResult } from '@tanstack/react-query';
8
+ import { JSX } from 'react/jsx-runtime';
9
+ import { MageMetricsClient } from '@magemetrics/core';
10
+ import { MageMetricsClientConfig } from '@magemetrics/core';
11
+ import { PropsWithChildren } from 'react';
12
+ import { RefAttributes } from 'react';
13
+ import { SortingState } from '@tanstack/react-table';
14
+ import { StartFlowParam } from '@magemetrics/core';
15
+ import { UseMutateAsyncFunction } from '@tanstack/react-query';
16
+ import { UseMutateFunction } from '@tanstack/react-query';
17
+ import { UseMutationOptions } from '@tanstack/react-query';
18
+ import { UseQueryResult } from '@tanstack/react-query';
19
+ import { z } from 'zod';
20
+
21
+ export { AuthState }
22
+
23
+ export declare type CellContentProps = {
24
+ formattedValue: FormattedData | undefined;
25
+ isOpened: boolean;
26
+ unit?: string;
27
+ renderType?: string;
28
+ };
29
+
30
+ export declare const Chat: React.FC<React.ComponentProps<typeof Chat_2>>;
31
+
32
+ declare const Chat_2: default_2.MemoExoticComponent<({ flowId, className }: {
33
+ flowId: string;
34
+ className?: string;
35
+ }) => JSX.Element>;
36
+
37
+ export declare const ChatInput: React.FC<React.ComponentProps<typeof ChatInput_2>>;
38
+
39
+ declare const ChatInput_2: React.FC<{
40
+ flowId: string;
41
+ }>;
42
+
43
+ export declare const ChatLayoutProvider: default_2.FC<{
44
+ children: default_2.ReactNode;
45
+ }>;
46
+
47
+ export declare const ChatMessages: React.FC<React.ComponentProps<typeof ChatMessages_2>>;
48
+
49
+ declare const ChatMessages_2: default_2.FC<{
50
+ flowId: string;
51
+ }>;
52
+
53
+ export declare interface Components {
54
+ dataTableCells?: {
55
+ empty?: (props: CellContentProps) => default_2.ReactNode;
56
+ units?: {
57
+ [key: string]: (props: CellContentProps) => default_2.ReactNode;
58
+ };
59
+ renderTypes?: {
60
+ [key: string]: (props: CellContentProps) => default_2.ReactNode;
61
+ };
62
+ };
63
+ dataReportTable?: (props: DataReportMessageProps) => default_2.ReactNode;
64
+ messageActions?: (props: {
65
+ type: "data-report";
66
+ report: FrontendReport;
67
+ } | {
68
+ type: "visualization";
69
+ visualization: FrontendVisualization | V1FrontendVisualization;
70
+ }) => default_2.ReactNode;
71
+ }
72
+
73
+ declare type ControlledModalProps = {
74
+ visible: boolean;
75
+ onClose: () => void;
76
+ };
77
+
78
+ export declare const Dashboard: React.FC<React.ComponentProps<typeof Dashboard_2>>;
79
+
80
+ declare const Dashboard_2: React.FC<{
81
+ dashboardId: string;
82
+ }>;
83
+
84
+ export declare const DataReport: React.FC<{
85
+ reportId: number;
86
+ }>;
87
+
88
+ export declare interface DataReportMessageProps {
89
+ report: FrontendReport;
90
+ isOpened: boolean;
91
+ setIsOpened: (opened: boolean) => void;
92
+ explainability: FrontendReportExplainability | null | undefined;
93
+ infiniteData: {
94
+ data?: {
95
+ pages: Record<string, unknown>[][];
96
+ };
97
+ isPending: boolean;
98
+ fetchNextPage: () => Promise<unknown>;
99
+ isFetching: boolean;
100
+ isFetchingNextPage: boolean;
101
+ hasNextPage: boolean | undefined;
102
+ };
103
+ columns: FrontendReportColumns;
104
+ totalRows: number;
105
+ }
106
+
107
+ export declare const DataTable: React.FC<DataReportMessageProps>;
108
+
109
+ declare type DisplayControlProps = {
110
+ showRecommendations?: boolean;
111
+ showRecentChats?: boolean;
112
+ showBackdrop?: boolean;
113
+ };
114
+
115
+ export declare const DomWrapper: React.FC<PropsWithChildren<DomWrapperProps>>;
116
+
117
+ declare type DomWrapperProps = {
118
+ display?: string;
119
+ };
120
+
121
+ declare type ExportReportDataParams = {
122
+ reportId: number;
123
+ filename?: string;
124
+ format?: "text" | "blob";
125
+ };
126
+
127
+ declare type ExportReportDataResult = {
128
+ filename: string;
129
+ data: Blob | string;
130
+ };
131
+
132
+ declare type ExtractInsightResponse = z.infer<typeof ExtractInsightResponseSchema>;
133
+
134
+ declare const ExtractInsightResponseSchema: z.ZodUnion<[z.ZodObject<{
135
+ type: z.ZodLiteral<"text">;
136
+ insight: z.ZodString;
137
+ }, "strip", z.ZodTypeAny, {
138
+ type: "text";
139
+ insight: string;
140
+ }, {
141
+ type: "text";
142
+ insight: string;
143
+ }>, z.ZodObject<{
144
+ type: z.ZodLiteral<"missing">;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: "missing";
147
+ }, {
148
+ type: "missing";
149
+ }>]>;
150
+
151
+ /**
152
+ * This module handles the formatting and normalization of table cell values for display and sorting.
153
+ *
154
+ * Problem:
155
+ * When displaying data in tables, we often receive values in various formats (strings, dates,
156
+ * JSON objects, etc.). We need to:
157
+ * 1. Display these values in a consistent, human-readable format
158
+ * 2. Enable proper sorting of these values regardless of their original format
159
+ *
160
+ * Solution:
161
+ * The FormattedData type and formatCellValue function transform any input value into a
162
+ * standardized format with two properties:
163
+ * - display: A string representation suitable for rendering
164
+ * - sortValue: A normalized value (string/number/date) suitable for consistent sorting
165
+ *
166
+ * The module handles various special cases:
167
+ * - JSON strings (parsing them to extract actual values)
168
+ * - Date/time values (converting to consistent format)
169
+ * - BigQuery-style objects with 'value' property
170
+ * - Nested objects (pretty-printing them)
171
+ * - Null/undefined values
172
+ */
173
+ declare type FormattedData = {
174
+ display: (string & {}) | "empty" | null;
175
+ sortValue: string | number | Date | null;
176
+ };
177
+
178
+ declare type FrontendReport = z.infer<typeof FrontendReportSchema>;
179
+
180
+ declare type FrontendReportColumns = z.infer<typeof FrontendReportColumnsSchema>;
181
+
182
+ declare const FrontendReportColumnsSchema: z.ZodArray<z.ZodObject<{
183
+ name: z.ZodString;
184
+ data_type: z.ZodString;
185
+ } & {
186
+ dataType: z.ZodString;
187
+ renderType: z.ZodOptional<z.ZodString>;
188
+ unit: z.ZodOptional<z.ZodString>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ name: string;
191
+ data_type: string;
192
+ dataType: string;
193
+ unit?: string | undefined;
194
+ renderType?: string | undefined;
195
+ }, {
196
+ name: string;
197
+ data_type: string;
198
+ dataType: string;
199
+ unit?: string | undefined;
200
+ renderType?: string | undefined;
201
+ }>, "many">;
202
+
203
+ declare type FrontendReportExplainability = z.infer<typeof FrontendReportExplainabilitySchema>;
204
+
205
+ declare const FrontendReportExplainabilitySchema: z.ZodObject<Omit<{
206
+ sql_explanation: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
207
+ chunk_title: z.ZodString;
208
+ chunk_explanation: z.ZodString;
209
+ lines: z.ZodArray<z.ZodObject<{
210
+ sql: z.ZodString;
211
+ explanation: z.ZodString;
212
+ }, "strip", z.ZodTypeAny, {
213
+ explanation: string;
214
+ sql: string;
215
+ }, {
216
+ explanation: string;
217
+ sql: string;
218
+ }>, "many">;
219
+ }, "strip", z.ZodTypeAny, {
220
+ chunk_title: string;
221
+ chunk_explanation: string;
222
+ lines: {
223
+ explanation: string;
224
+ sql: string;
225
+ }[];
226
+ }, {
227
+ chunk_title: string;
228
+ chunk_explanation: string;
229
+ lines: {
230
+ explanation: string;
231
+ sql: string;
232
+ }[];
233
+ }>, "many">>>;
234
+ business_explanation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
235
+ summary: z.ZodString;
236
+ implementation: z.ZodArray<z.ZodString, "many">;
237
+ assumptions: z.ZodArray<z.ZodObject<{
238
+ type: z.ZodEnum<["grain", "completeness", "transformation", "relationship", "other"]>;
239
+ details: z.ZodString;
240
+ explanation: z.ZodString;
241
+ }, "strip", z.ZodTypeAny, {
242
+ explanation: string;
243
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
244
+ details: string;
245
+ }, {
246
+ explanation: string;
247
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
248
+ details: string;
249
+ }>, "many">;
250
+ }, "strip", z.ZodTypeAny, {
251
+ implementation: string[];
252
+ summary: string;
253
+ assumptions: {
254
+ explanation: string;
255
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
256
+ details: string;
257
+ }[];
258
+ }, {
259
+ implementation: string[];
260
+ summary: string;
261
+ assumptions: {
262
+ explanation: string;
263
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
264
+ details: string;
265
+ }[];
266
+ }>>>;
267
+ columns_lineage: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
268
+ nodes: z.ZodArray<z.ZodObject<{
269
+ id: z.ZodString;
270
+ type: z.ZodEnum<["entity", "attribute", "filter", "process", "combine", "result"]>;
271
+ explanation: z.ZodString;
272
+ }, "strip", z.ZodTypeAny, {
273
+ explanation: string;
274
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
275
+ id: string;
276
+ }, {
277
+ explanation: string;
278
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
279
+ id: string;
280
+ }>, "many">;
281
+ edges: z.ZodArray<z.ZodObject<{
282
+ source: z.ZodString;
283
+ target: z.ZodString;
284
+ }, "strip", z.ZodTypeAny, {
285
+ source: string;
286
+ target: string;
287
+ }, {
288
+ source: string;
289
+ target: string;
290
+ }>, "many">;
291
+ }, "strip", z.ZodTypeAny, {
292
+ nodes: {
293
+ explanation: string;
294
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
295
+ id: string;
296
+ }[];
297
+ edges: {
298
+ source: string;
299
+ target: string;
300
+ }[];
301
+ }, {
302
+ nodes: {
303
+ explanation: string;
304
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
305
+ id: string;
306
+ }[];
307
+ edges: {
308
+ source: string;
309
+ target: string;
310
+ }[];
311
+ }>>>>;
312
+ confidence_score: z.ZodNumber;
313
+ confidence_score_reason: z.ZodString;
314
+ assumptions_score: z.ZodOptional<z.ZodNumber>;
315
+ assumptions_score_reason: z.ZodOptional<z.ZodString>;
316
+ friendliness_score: z.ZodOptional<z.ZodNumber>;
317
+ friendliness_score_reason: z.ZodOptional<z.ZodString>;
318
+ id: z.ZodNumber;
319
+ flow_data_id: z.ZodNumber;
320
+ created_at: z.ZodString;
321
+ }, "id" | "created_at">, "strip", z.ZodTypeAny, {
322
+ flow_data_id: number;
323
+ confidence_score: number;
324
+ confidence_score_reason: string;
325
+ sql_explanation?: {
326
+ chunk_title: string;
327
+ chunk_explanation: string;
328
+ lines: {
329
+ explanation: string;
330
+ sql: string;
331
+ }[];
332
+ }[] | null | undefined;
333
+ business_explanation?: {
334
+ implementation: string[];
335
+ summary: string;
336
+ assumptions: {
337
+ explanation: string;
338
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
339
+ details: string;
340
+ }[];
341
+ } | null | undefined;
342
+ columns_lineage?: Record<string, {
343
+ nodes: {
344
+ explanation: string;
345
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
346
+ id: string;
347
+ }[];
348
+ edges: {
349
+ source: string;
350
+ target: string;
351
+ }[];
352
+ }> | null | undefined;
353
+ assumptions_score?: number | undefined;
354
+ assumptions_score_reason?: string | undefined;
355
+ friendliness_score?: number | undefined;
356
+ friendliness_score_reason?: string | undefined;
357
+ }, {
358
+ flow_data_id: number;
359
+ confidence_score: number;
360
+ confidence_score_reason: string;
361
+ sql_explanation?: {
362
+ chunk_title: string;
363
+ chunk_explanation: string;
364
+ lines: {
365
+ explanation: string;
366
+ sql: string;
367
+ }[];
368
+ }[] | null | undefined;
369
+ business_explanation?: {
370
+ implementation: string[];
371
+ summary: string;
372
+ assumptions: {
373
+ explanation: string;
374
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
375
+ details: string;
376
+ }[];
377
+ } | null | undefined;
378
+ columns_lineage?: Record<string, {
379
+ nodes: {
380
+ explanation: string;
381
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
382
+ id: string;
383
+ }[];
384
+ edges: {
385
+ source: string;
386
+ target: string;
387
+ }[];
388
+ }> | null | undefined;
389
+ assumptions_score?: number | undefined;
390
+ assumptions_score_reason?: string | undefined;
391
+ friendliness_score?: number | undefined;
392
+ friendliness_score_reason?: string | undefined;
393
+ }>;
394
+
395
+ declare const FrontendReportSchema: z.ZodObject<Omit<{
396
+ created_at: z.ZodString;
397
+ flow_id: z.ZodString;
398
+ id: z.ZodNumber;
399
+ is_sample: z.ZodBoolean;
400
+ schema: z.ZodString;
401
+ sql: z.ZodString;
402
+ table: z.ZodString;
403
+ title: z.ZodString;
404
+ request: z.ZodNullable<z.ZodString>;
405
+ data_sample: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
406
+ data_summary: z.ZodObject<{
407
+ columns: z.ZodRecord<z.ZodString, z.ZodObject<{
408
+ position: z.ZodOptional<z.ZodNumber>;
409
+ data_type: z.ZodString;
410
+ null_count: z.ZodNullable<z.ZodNumber>;
411
+ unique_count: z.ZodNullable<z.ZodNumber>;
412
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
413
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
414
+ position: z.ZodOptional<z.ZodNumber>;
415
+ data_type: z.ZodString;
416
+ null_count: z.ZodNullable<z.ZodNumber>;
417
+ unique_count: z.ZodNullable<z.ZodNumber>;
418
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
419
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
420
+ position: z.ZodOptional<z.ZodNumber>;
421
+ data_type: z.ZodString;
422
+ null_count: z.ZodNullable<z.ZodNumber>;
423
+ unique_count: z.ZodNullable<z.ZodNumber>;
424
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
425
+ }, z.ZodTypeAny, "passthrough">>>;
426
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
427
+ columns: z.ZodRecord<z.ZodString, z.ZodObject<{
428
+ position: z.ZodOptional<z.ZodNumber>;
429
+ data_type: z.ZodString;
430
+ null_count: z.ZodNullable<z.ZodNumber>;
431
+ unique_count: z.ZodNullable<z.ZodNumber>;
432
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
433
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
434
+ position: z.ZodOptional<z.ZodNumber>;
435
+ data_type: z.ZodString;
436
+ null_count: z.ZodNullable<z.ZodNumber>;
437
+ unique_count: z.ZodNullable<z.ZodNumber>;
438
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
439
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
440
+ position: z.ZodOptional<z.ZodNumber>;
441
+ data_type: z.ZodString;
442
+ null_count: z.ZodNullable<z.ZodNumber>;
443
+ unique_count: z.ZodNullable<z.ZodNumber>;
444
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
445
+ }, z.ZodTypeAny, "passthrough">>>;
446
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
447
+ columns: z.ZodRecord<z.ZodString, z.ZodObject<{
448
+ position: z.ZodOptional<z.ZodNumber>;
449
+ data_type: z.ZodString;
450
+ null_count: z.ZodNullable<z.ZodNumber>;
451
+ unique_count: z.ZodNullable<z.ZodNumber>;
452
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
453
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
454
+ position: z.ZodOptional<z.ZodNumber>;
455
+ data_type: z.ZodString;
456
+ null_count: z.ZodNullable<z.ZodNumber>;
457
+ unique_count: z.ZodNullable<z.ZodNumber>;
458
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
459
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
460
+ position: z.ZodOptional<z.ZodNumber>;
461
+ data_type: z.ZodString;
462
+ null_count: z.ZodNullable<z.ZodNumber>;
463
+ unique_count: z.ZodNullable<z.ZodNumber>;
464
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
465
+ }, z.ZodTypeAny, "passthrough">>>;
466
+ }, z.ZodTypeAny, "passthrough">>;
467
+ bookmarked: z.ZodBoolean;
468
+ status: z.ZodNullable<z.ZodString>;
469
+ }, "schema" | "sql" | "table" | "data_sample" | "is_sample">, "strip", z.ZodTypeAny, {
470
+ title: string;
471
+ status: string | null;
472
+ id: number;
473
+ request: string | null;
474
+ created_at: string;
475
+ bookmarked: boolean;
476
+ data_summary: {
477
+ columns: Record<string, z.objectOutputType<{
478
+ position: z.ZodOptional<z.ZodNumber>;
479
+ data_type: z.ZodString;
480
+ null_count: z.ZodNullable<z.ZodNumber>;
481
+ unique_count: z.ZodNullable<z.ZodNumber>;
482
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
483
+ }, z.ZodTypeAny, "passthrough">>;
484
+ } & {
485
+ [k: string]: unknown;
486
+ };
487
+ flow_id: string;
488
+ }, {
489
+ title: string;
490
+ status: string | null;
491
+ id: number;
492
+ request: string | null;
493
+ created_at: string;
494
+ bookmarked: boolean;
495
+ data_summary: {
496
+ columns: Record<string, z.objectInputType<{
497
+ position: z.ZodOptional<z.ZodNumber>;
498
+ data_type: z.ZodString;
499
+ null_count: z.ZodNullable<z.ZodNumber>;
500
+ unique_count: z.ZodNullable<z.ZodNumber>;
501
+ unique_percentage: z.ZodNullable<z.ZodNumber>;
502
+ }, z.ZodTypeAny, "passthrough">>;
503
+ } & {
504
+ [k: string]: unknown;
505
+ };
506
+ flow_id: string;
507
+ }>;
508
+
509
+ declare type FrontendVisualization = z.output<typeof FrontendVisualizationSchema>;
510
+
511
+ declare const FrontendVisualizationSchema: z.ZodObject<Omit<{
512
+ id: z.ZodNumber;
513
+ flow_data_id: z.ZodNumber;
514
+ created_at: z.ZodString;
515
+ sql: z.ZodString;
516
+ bookmarked: z.ZodBoolean;
517
+ data_sample: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
518
+ is_sample: z.ZodBoolean;
519
+ data_summary: z.ZodRecord<z.ZodString, z.ZodUnknown>;
520
+ } & {
521
+ configuration: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
522
+ config_version: z.ZodLiteral<2>;
523
+ xAxisLabel: z.ZodString;
524
+ yAxisLabel: z.ZodString;
525
+ categoryColumn: z.ZodString;
526
+ secondaryCategoryColumn: z.ZodOptional<z.ZodString>;
527
+ valueColumn: z.ZodString;
528
+ title: z.ZodString;
529
+ type: z.ZodLiteral<"bar">;
530
+ }, "strip", z.ZodTypeAny, {
531
+ type: "bar";
532
+ title: string;
533
+ xAxisLabel: string;
534
+ yAxisLabel: string;
535
+ config_version: 2;
536
+ categoryColumn: string;
537
+ valueColumn: string;
538
+ secondaryCategoryColumn?: string | undefined;
539
+ }, {
540
+ type: "bar";
541
+ title: string;
542
+ xAxisLabel: string;
543
+ yAxisLabel: string;
544
+ config_version: 2;
545
+ categoryColumn: string;
546
+ valueColumn: string;
547
+ secondaryCategoryColumn?: string | undefined;
548
+ }>, z.ZodObject<{
549
+ xAxisColumn: z.ZodString;
550
+ valueColumns: z.ZodArray<z.ZodString, "many">;
551
+ yAxisLabels: z.ZodArray<z.ZodString, "many">;
552
+ title: z.ZodString;
553
+ type: z.ZodLiteral<"line/area">;
554
+ config_version: z.ZodLiteral<2>;
555
+ }, "strip", z.ZodTypeAny, {
556
+ type: "line/area";
557
+ title: string;
558
+ valueColumns: string[];
559
+ config_version: 2;
560
+ xAxisColumn: string;
561
+ yAxisLabels: string[];
562
+ }, {
563
+ type: "line/area";
564
+ title: string;
565
+ valueColumns: string[];
566
+ config_version: 2;
567
+ xAxisColumn: string;
568
+ yAxisLabels: string[];
569
+ }>, z.ZodObject<{
570
+ config_version: z.ZodLiteral<2>;
571
+ valueColumn: z.ZodString;
572
+ xAxisColumn: z.ZodString;
573
+ xAxisLabel: z.ZodString;
574
+ yAxisLabel: z.ZodString;
575
+ categoryColumn: z.ZodString;
576
+ title: z.ZodString;
577
+ type: z.ZodLiteral<"line/area-categorical">;
578
+ }, "strip", z.ZodTypeAny, {
579
+ type: "line/area-categorical";
580
+ title: string;
581
+ xAxisLabel: string;
582
+ yAxisLabel: string;
583
+ config_version: 2;
584
+ categoryColumn: string;
585
+ valueColumn: string;
586
+ xAxisColumn: string;
587
+ }, {
588
+ type: "line/area-categorical";
589
+ title: string;
590
+ xAxisLabel: string;
591
+ yAxisLabel: string;
592
+ config_version: 2;
593
+ categoryColumn: string;
594
+ valueColumn: string;
595
+ xAxisColumn: string;
596
+ }>, z.ZodObject<{
597
+ config_version: z.ZodLiteral<2>;
598
+ xAxisLabel: z.ZodString;
599
+ yAxisLabel: z.ZodString;
600
+ xAxisValueColumn: z.ZodString;
601
+ yAxisValueColumn: z.ZodString;
602
+ title: z.ZodString;
603
+ type: z.ZodLiteral<"scatter">;
604
+ }, "strip", z.ZodTypeAny, {
605
+ type: "scatter";
606
+ title: string;
607
+ xAxisLabel: string;
608
+ yAxisLabel: string;
609
+ config_version: 2;
610
+ xAxisValueColumn: string;
611
+ yAxisValueColumn: string;
612
+ }, {
613
+ type: "scatter";
614
+ title: string;
615
+ xAxisLabel: string;
616
+ yAxisLabel: string;
617
+ config_version: 2;
618
+ xAxisValueColumn: string;
619
+ yAxisValueColumn: string;
620
+ }>, z.ZodObject<{
621
+ config_version: z.ZodLiteral<2>;
622
+ categoryColumn: z.ZodString;
623
+ valueColumn: z.ZodString;
624
+ title: z.ZodString;
625
+ type: z.ZodLiteral<"pie">;
626
+ }, "strip", z.ZodTypeAny, {
627
+ type: "pie";
628
+ title: string;
629
+ config_version: 2;
630
+ categoryColumn: string;
631
+ valueColumn: string;
632
+ }, {
633
+ type: "pie";
634
+ title: string;
635
+ config_version: 2;
636
+ categoryColumn: string;
637
+ valueColumn: string;
638
+ }>]>;
639
+ }, "sql" | "data_sample" | "is_sample" | "data_summary">, "strip", z.ZodTypeAny, {
640
+ id: number;
641
+ flow_data_id: number;
642
+ created_at: string;
643
+ bookmarked: boolean;
644
+ configuration: {
645
+ type: "bar";
646
+ title: string;
647
+ xAxisLabel: string;
648
+ yAxisLabel: string;
649
+ config_version: 2;
650
+ categoryColumn: string;
651
+ valueColumn: string;
652
+ secondaryCategoryColumn?: string | undefined;
653
+ } | {
654
+ type: "line/area";
655
+ title: string;
656
+ valueColumns: string[];
657
+ config_version: 2;
658
+ xAxisColumn: string;
659
+ yAxisLabels: string[];
660
+ } | {
661
+ type: "line/area-categorical";
662
+ title: string;
663
+ xAxisLabel: string;
664
+ yAxisLabel: string;
665
+ config_version: 2;
666
+ categoryColumn: string;
667
+ valueColumn: string;
668
+ xAxisColumn: string;
669
+ } | {
670
+ type: "scatter";
671
+ title: string;
672
+ xAxisLabel: string;
673
+ yAxisLabel: string;
674
+ config_version: 2;
675
+ xAxisValueColumn: string;
676
+ yAxisValueColumn: string;
677
+ } | {
678
+ type: "pie";
679
+ title: string;
680
+ config_version: 2;
681
+ categoryColumn: string;
682
+ valueColumn: string;
683
+ };
684
+ }, {
685
+ id: number;
686
+ flow_data_id: number;
687
+ created_at: string;
688
+ bookmarked: boolean;
689
+ configuration: {
690
+ type: "bar";
691
+ title: string;
692
+ xAxisLabel: string;
693
+ yAxisLabel: string;
694
+ config_version: 2;
695
+ categoryColumn: string;
696
+ valueColumn: string;
697
+ secondaryCategoryColumn?: string | undefined;
698
+ } | {
699
+ type: "line/area";
700
+ title: string;
701
+ valueColumns: string[];
702
+ config_version: 2;
703
+ xAxisColumn: string;
704
+ yAxisLabels: string[];
705
+ } | {
706
+ type: "line/area-categorical";
707
+ title: string;
708
+ xAxisLabel: string;
709
+ yAxisLabel: string;
710
+ config_version: 2;
711
+ categoryColumn: string;
712
+ valueColumn: string;
713
+ xAxisColumn: string;
714
+ } | {
715
+ type: "scatter";
716
+ title: string;
717
+ xAxisLabel: string;
718
+ yAxisLabel: string;
719
+ config_version: 2;
720
+ xAxisValueColumn: string;
721
+ yAxisValueColumn: string;
722
+ } | {
723
+ type: "pie";
724
+ title: string;
725
+ config_version: 2;
726
+ categoryColumn: string;
727
+ valueColumn: string;
728
+ };
729
+ }>;
730
+
731
+ export { GenerateInsightParam }
732
+
733
+ export declare const InfiniteDataTableUI: React.FC<InfiniteDataTableUIProps>;
734
+
735
+ declare type InfiniteDataTableUIProps = {
736
+ flowDataId: number;
737
+ data: Record<string, unknown>[];
738
+ columns: FrontendReportColumns;
739
+ explainability: FrontendReportExplainability | null | undefined;
740
+ isOpened: boolean;
741
+ setIsOpened: (opened: boolean) => void;
742
+ hasNextPage: boolean | undefined;
743
+ fetchNextPage: () => Promise<unknown>;
744
+ isFetchingNextPage: boolean;
745
+ isFetching: boolean;
746
+ totalRows: number;
747
+ };
748
+
749
+ export declare const logout: () => Promise<void>;
750
+
751
+ export { MageMetricsClient }
752
+
753
+ export { MageMetricsClientConfig }
754
+
755
+ export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps & MageMetricsPublicContextProviderProps>;
756
+
757
+ export declare type MageMetricsContextProviderProps = PropsWithChildren<MageMetricsClientConfig>;
758
+
759
+ export declare const MageMetricsPublicContextProvider: default_2.FC<MageMetricsPublicContextProviderProps>;
760
+
761
+ declare type MageMetricsPublicContextProviderProps = PropsWithChildren<Pick<MageMetricsClientConfig, "apiUrl" | "apiKey"> & {
762
+ experimental_components?: Components;
763
+ }>;
764
+
765
+ export declare const ManagedModal: React.FC<ManagedModalProps>;
766
+
767
+ declare interface ManagedModalProps extends ModalProps {
768
+ apiKey: string;
769
+ externalJwt: string;
770
+ apiUrl: string;
771
+ persist?: PersistenceOptions;
772
+ experimental_components?: Components;
773
+ }
774
+
775
+ declare interface ModalProps {
776
+ display?: string;
777
+ modal?: ControlledModalProps;
778
+ startOptions?: StartOptions;
779
+ }
780
+
781
+ declare type PersistenceOptions = "queryParam" | "none";
782
+
783
+ export declare const PublicDashboard: React.FC<React.ComponentProps<typeof Dashboard_2>>;
784
+
785
+ export declare const PublicDataReport: React.FC<{
786
+ dashboardId: string;
787
+ reportId: number;
788
+ }>;
789
+
790
+ declare type ReportDataFilters = {
791
+ columns?: string[];
792
+ limit: number;
793
+ sorting: SortingState;
794
+ filters: TableFilters;
795
+ cursor?: number;
796
+ };
797
+
798
+ export declare const StandaloneConversationModal: React.FC<StandaloneConversationModalProps>;
799
+
800
+ declare type StandaloneConversationModalProps = {
801
+ opened: boolean;
802
+ flowId: string;
803
+ onOpenChange?: (open: boolean) => void;
804
+ };
805
+
806
+ export { StartFlowParam }
807
+
808
+ declare type StartOptions = DisplayControlProps & {
809
+ label?: string;
810
+ recommendationsLabel?: string;
811
+ placeholders?: string[];
812
+ };
813
+
814
+ declare type TableFilters = Record<string, string | number>;
815
+
816
+ export declare const useCreateFlow: (options?: UseMutationOptions<{
817
+ flowId: string;
818
+ }, Error, StartFlowParam>) => {
819
+ createFlow: UseMutateFunction< {
820
+ flowId: string;
821
+ }, Error, StartFlowParam, unknown>;
822
+ createFlowAsync: UseMutateAsyncFunction< {
823
+ flowId: string;
824
+ }, Error, StartFlowParam, unknown>;
825
+ isCreatingFlow: boolean;
826
+ data: undefined;
827
+ variables: undefined;
828
+ error: null;
829
+ isError: false;
830
+ isIdle: true;
831
+ isPending: false;
832
+ isSuccess: false;
833
+ status: "idle";
834
+ mutate: UseMutateFunction< {
835
+ flowId: string;
836
+ }, Error, StartFlowParam, unknown>;
837
+ reset: () => void;
838
+ context: unknown;
839
+ failureCount: number;
840
+ failureReason: Error | null;
841
+ isPaused: boolean;
842
+ submittedAt: number;
843
+ mutateAsync: UseMutateAsyncFunction< {
844
+ flowId: string;
845
+ }, Error, StartFlowParam, unknown>;
846
+ } | {
847
+ createFlow: UseMutateFunction< {
848
+ flowId: string;
849
+ }, Error, StartFlowParam, unknown>;
850
+ createFlowAsync: UseMutateAsyncFunction< {
851
+ flowId: string;
852
+ }, Error, StartFlowParam, unknown>;
853
+ isCreatingFlow: boolean;
854
+ data: undefined;
855
+ variables: StartFlowParam;
856
+ error: null;
857
+ isError: false;
858
+ isIdle: false;
859
+ isPending: true;
860
+ isSuccess: false;
861
+ status: "pending";
862
+ mutate: UseMutateFunction< {
863
+ flowId: string;
864
+ }, Error, StartFlowParam, unknown>;
865
+ reset: () => void;
866
+ context: unknown;
867
+ failureCount: number;
868
+ failureReason: Error | null;
869
+ isPaused: boolean;
870
+ submittedAt: number;
871
+ mutateAsync: UseMutateAsyncFunction< {
872
+ flowId: string;
873
+ }, Error, StartFlowParam, unknown>;
874
+ } | {
875
+ createFlow: UseMutateFunction< {
876
+ flowId: string;
877
+ }, Error, StartFlowParam, unknown>;
878
+ createFlowAsync: UseMutateAsyncFunction< {
879
+ flowId: string;
880
+ }, Error, StartFlowParam, unknown>;
881
+ isCreatingFlow: boolean;
882
+ data: undefined;
883
+ error: Error;
884
+ variables: StartFlowParam;
885
+ isError: true;
886
+ isIdle: false;
887
+ isPending: false;
888
+ isSuccess: false;
889
+ status: "error";
890
+ mutate: UseMutateFunction< {
891
+ flowId: string;
892
+ }, Error, StartFlowParam, unknown>;
893
+ reset: () => void;
894
+ context: unknown;
895
+ failureCount: number;
896
+ failureReason: Error | null;
897
+ isPaused: boolean;
898
+ submittedAt: number;
899
+ mutateAsync: UseMutateAsyncFunction< {
900
+ flowId: string;
901
+ }, Error, StartFlowParam, unknown>;
902
+ } | {
903
+ createFlow: UseMutateFunction< {
904
+ flowId: string;
905
+ }, Error, StartFlowParam, unknown>;
906
+ createFlowAsync: UseMutateAsyncFunction< {
907
+ flowId: string;
908
+ }, Error, StartFlowParam, unknown>;
909
+ isCreatingFlow: boolean;
910
+ data: {
911
+ flowId: string;
912
+ };
913
+ error: null;
914
+ variables: StartFlowParam;
915
+ isError: false;
916
+ isIdle: false;
917
+ isPending: false;
918
+ isSuccess: true;
919
+ status: "success";
920
+ mutate: UseMutateFunction< {
921
+ flowId: string;
922
+ }, Error, StartFlowParam, unknown>;
923
+ reset: () => void;
924
+ context: unknown;
925
+ failureCount: number;
926
+ failureReason: Error | null;
927
+ isPaused: boolean;
928
+ submittedAt: number;
929
+ mutateAsync: UseMutateAsyncFunction< {
930
+ flowId: string;
931
+ }, Error, StartFlowParam, unknown>;
932
+ };
933
+
934
+ export declare const useDataReport: (flowDataId: FrontendReport["id"]) => {
935
+ dataColumns: {
936
+ name: string;
937
+ data_type: string;
938
+ dataType: string;
939
+ renderType?: string;
940
+ unit?: string;
941
+ }[] | undefined;
942
+ isPendingColumns: boolean;
943
+ isPendingData: boolean;
944
+ fetchNextPage: (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<InfiniteData<Record<string, unknown>[], unknown>, Error>>;
945
+ isFetching: boolean;
946
+ isFetchingNextPage: boolean;
947
+ hasNextPage: boolean;
948
+ allData: Record<string, unknown>[];
949
+ explainability: {
950
+ sql_explanation?: {
951
+ chunk_title: string;
952
+ chunk_explanation: string;
953
+ lines: {
954
+ sql: string;
955
+ explanation: string;
956
+ }[];
957
+ }[] | null;
958
+ business_explanation?: {
959
+ summary: string;
960
+ implementation: string[];
961
+ assumptions: {
962
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
963
+ details: string;
964
+ explanation: string;
965
+ }[];
966
+ } | null;
967
+ columns_lineage?: {
968
+ [key: string]: {
969
+ nodes: {
970
+ id: string;
971
+ type: "entity" | "attribute" | "filter" | "process" | "combine" | "result";
972
+ explanation: string;
973
+ }[];
974
+ edges: {
975
+ source: string;
976
+ target: string;
977
+ }[];
978
+ };
979
+ } | null;
980
+ confidence_score: number;
981
+ confidence_score_reason: string;
982
+ assumptions_score?: number;
983
+ assumptions_score_reason?: string;
984
+ friendliness_score?: number;
985
+ friendliness_score_reason?: string;
986
+ flow_data_id: number;
987
+ } | null | undefined;
988
+ totalRows: number;
989
+ infiniteData: InfiniteData<Record<string, unknown>[], unknown> | undefined;
990
+ };
991
+
992
+ export declare const useDataReportColumnValue: (reportId: number, filters: ReportDataFilters) => UseQueryResult<Record<string, unknown>[], Error>;
993
+
994
+ export declare const useDownloadReportData: (options?: UseMutationOptions<ExportReportDataResult, Error, ExportReportDataParams>) => {
995
+ download: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
996
+ data: undefined;
997
+ variables: undefined;
998
+ error: null;
999
+ isError: false;
1000
+ isIdle: true;
1001
+ isPending: false;
1002
+ isSuccess: false;
1003
+ status: "idle";
1004
+ mutate: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1005
+ reset: () => void;
1006
+ context: unknown;
1007
+ failureCount: number;
1008
+ failureReason: Error | null;
1009
+ isPaused: boolean;
1010
+ submittedAt: number;
1011
+ mutateAsync: UseMutateAsyncFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1012
+ } | {
1013
+ download: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1014
+ data: undefined;
1015
+ variables: ExportReportDataParams;
1016
+ error: null;
1017
+ isError: false;
1018
+ isIdle: false;
1019
+ isPending: true;
1020
+ isSuccess: false;
1021
+ status: "pending";
1022
+ mutate: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1023
+ reset: () => void;
1024
+ context: unknown;
1025
+ failureCount: number;
1026
+ failureReason: Error | null;
1027
+ isPaused: boolean;
1028
+ submittedAt: number;
1029
+ mutateAsync: UseMutateAsyncFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1030
+ } | {
1031
+ download: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1032
+ data: undefined;
1033
+ error: Error;
1034
+ variables: ExportReportDataParams;
1035
+ isError: true;
1036
+ isIdle: false;
1037
+ isPending: false;
1038
+ isSuccess: false;
1039
+ status: "error";
1040
+ mutate: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1041
+ reset: () => void;
1042
+ context: unknown;
1043
+ failureCount: number;
1044
+ failureReason: Error | null;
1045
+ isPaused: boolean;
1046
+ submittedAt: number;
1047
+ mutateAsync: UseMutateAsyncFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1048
+ } | {
1049
+ download: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1050
+ data: ExportReportDataResult;
1051
+ error: null;
1052
+ variables: ExportReportDataParams;
1053
+ isError: false;
1054
+ isIdle: false;
1055
+ isPending: false;
1056
+ isSuccess: true;
1057
+ status: "success";
1058
+ mutate: UseMutateFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1059
+ reset: () => void;
1060
+ context: unknown;
1061
+ failureCount: number;
1062
+ failureReason: Error | null;
1063
+ isPaused: boolean;
1064
+ submittedAt: number;
1065
+ mutateAsync: UseMutateAsyncFunction<ExportReportDataResult, Error, ExportReportDataParams, unknown>;
1066
+ };
1067
+
1068
+ export declare const useGenerateContextualInsight: (options?: UseMutationOptions<ExtractInsightResponse, Error, GenerateInsightParam>) => {
1069
+ generateInsight: UseMutateFunction< {
1070
+ type: "text";
1071
+ insight: string;
1072
+ } | {
1073
+ type: "missing";
1074
+ }, Error, GenerateInsightParam, unknown>;
1075
+ generateInsightAsync: UseMutateAsyncFunction< {
1076
+ type: "text";
1077
+ insight: string;
1078
+ } | {
1079
+ type: "missing";
1080
+ }, Error, GenerateInsightParam, unknown>;
1081
+ data: undefined;
1082
+ variables: undefined;
1083
+ error: null;
1084
+ isError: false;
1085
+ isIdle: true;
1086
+ isPending: false;
1087
+ isSuccess: false;
1088
+ status: "idle";
1089
+ mutate: UseMutateFunction< {
1090
+ type: "text";
1091
+ insight: string;
1092
+ } | {
1093
+ type: "missing";
1094
+ }, Error, GenerateInsightParam, unknown>;
1095
+ reset: () => void;
1096
+ context: unknown;
1097
+ failureCount: number;
1098
+ failureReason: Error | null;
1099
+ isPaused: boolean;
1100
+ submittedAt: number;
1101
+ mutateAsync: UseMutateAsyncFunction< {
1102
+ type: "text";
1103
+ insight: string;
1104
+ } | {
1105
+ type: "missing";
1106
+ }, Error, GenerateInsightParam, unknown>;
1107
+ } | {
1108
+ generateInsight: UseMutateFunction< {
1109
+ type: "text";
1110
+ insight: string;
1111
+ } | {
1112
+ type: "missing";
1113
+ }, Error, GenerateInsightParam, unknown>;
1114
+ generateInsightAsync: UseMutateAsyncFunction< {
1115
+ type: "text";
1116
+ insight: string;
1117
+ } | {
1118
+ type: "missing";
1119
+ }, Error, GenerateInsightParam, unknown>;
1120
+ data: undefined;
1121
+ variables: GenerateInsightParam;
1122
+ error: null;
1123
+ isError: false;
1124
+ isIdle: false;
1125
+ isPending: true;
1126
+ isSuccess: false;
1127
+ status: "pending";
1128
+ mutate: UseMutateFunction< {
1129
+ type: "text";
1130
+ insight: string;
1131
+ } | {
1132
+ type: "missing";
1133
+ }, Error, GenerateInsightParam, unknown>;
1134
+ reset: () => void;
1135
+ context: unknown;
1136
+ failureCount: number;
1137
+ failureReason: Error | null;
1138
+ isPaused: boolean;
1139
+ submittedAt: number;
1140
+ mutateAsync: UseMutateAsyncFunction< {
1141
+ type: "text";
1142
+ insight: string;
1143
+ } | {
1144
+ type: "missing";
1145
+ }, Error, GenerateInsightParam, unknown>;
1146
+ } | {
1147
+ generateInsight: UseMutateFunction< {
1148
+ type: "text";
1149
+ insight: string;
1150
+ } | {
1151
+ type: "missing";
1152
+ }, Error, GenerateInsightParam, unknown>;
1153
+ generateInsightAsync: UseMutateAsyncFunction< {
1154
+ type: "text";
1155
+ insight: string;
1156
+ } | {
1157
+ type: "missing";
1158
+ }, Error, GenerateInsightParam, unknown>;
1159
+ data: undefined;
1160
+ error: Error;
1161
+ variables: GenerateInsightParam;
1162
+ isError: true;
1163
+ isIdle: false;
1164
+ isPending: false;
1165
+ isSuccess: false;
1166
+ status: "error";
1167
+ mutate: UseMutateFunction< {
1168
+ type: "text";
1169
+ insight: string;
1170
+ } | {
1171
+ type: "missing";
1172
+ }, Error, GenerateInsightParam, unknown>;
1173
+ reset: () => void;
1174
+ context: unknown;
1175
+ failureCount: number;
1176
+ failureReason: Error | null;
1177
+ isPaused: boolean;
1178
+ submittedAt: number;
1179
+ mutateAsync: UseMutateAsyncFunction< {
1180
+ type: "text";
1181
+ insight: string;
1182
+ } | {
1183
+ type: "missing";
1184
+ }, Error, GenerateInsightParam, unknown>;
1185
+ } | {
1186
+ generateInsight: UseMutateFunction< {
1187
+ type: "text";
1188
+ insight: string;
1189
+ } | {
1190
+ type: "missing";
1191
+ }, Error, GenerateInsightParam, unknown>;
1192
+ generateInsightAsync: UseMutateAsyncFunction< {
1193
+ type: "text";
1194
+ insight: string;
1195
+ } | {
1196
+ type: "missing";
1197
+ }, Error, GenerateInsightParam, unknown>;
1198
+ data: {
1199
+ type: "text";
1200
+ insight: string;
1201
+ } | {
1202
+ type: "missing";
1203
+ };
1204
+ error: null;
1205
+ variables: GenerateInsightParam;
1206
+ isError: false;
1207
+ isIdle: false;
1208
+ isPending: false;
1209
+ isSuccess: true;
1210
+ status: "success";
1211
+ mutate: UseMutateFunction< {
1212
+ type: "text";
1213
+ insight: string;
1214
+ } | {
1215
+ type: "missing";
1216
+ }, Error, GenerateInsightParam, unknown>;
1217
+ reset: () => void;
1218
+ context: unknown;
1219
+ failureCount: number;
1220
+ failureReason: Error | null;
1221
+ isPaused: boolean;
1222
+ submittedAt: number;
1223
+ mutateAsync: UseMutateAsyncFunction< {
1224
+ type: "text";
1225
+ insight: string;
1226
+ } | {
1227
+ type: "missing";
1228
+ }, Error, GenerateInsightParam, unknown>;
1229
+ };
1230
+
1231
+ export declare const useMageMetricsApiUrl: () => string;
1232
+
1233
+ export declare const useMageMetricsClient: () => MageMetricsClient | undefined;
1234
+
1235
+ export declare const useMageMetricsReady: () => false | MageMetricsClient | undefined;
1236
+
1237
+ export declare const useRecentFlows: (limit?: number) => UseQueryResult< {
1238
+ id: string;
1239
+ request: string;
1240
+ created_at: string;
1241
+ user_id: string | null;
1242
+ }[], Error>;
1243
+
1244
+ /**
1245
+ * Create a new flow with the given user query.
1246
+ * @deprecated Use `useCreateFlow` instead.
1247
+ * @param options tanstack query options to create the flow
1248
+ * @returns a mutation
1249
+ */
1250
+ export declare const useStartFlow: (options?: UseMutationOptions<string, Error, StartFlowParam>) => {
1251
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1252
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1253
+ data: undefined;
1254
+ variables: undefined;
1255
+ error: null;
1256
+ isError: false;
1257
+ isIdle: true;
1258
+ isPending: false;
1259
+ isSuccess: false;
1260
+ status: "idle";
1261
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1262
+ reset: () => void;
1263
+ context: unknown;
1264
+ failureCount: number;
1265
+ failureReason: Error | null;
1266
+ isPaused: boolean;
1267
+ submittedAt: number;
1268
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1269
+ } | {
1270
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1271
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1272
+ data: undefined;
1273
+ variables: StartFlowParam;
1274
+ error: null;
1275
+ isError: false;
1276
+ isIdle: false;
1277
+ isPending: true;
1278
+ isSuccess: false;
1279
+ status: "pending";
1280
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1281
+ reset: () => void;
1282
+ context: unknown;
1283
+ failureCount: number;
1284
+ failureReason: Error | null;
1285
+ isPaused: boolean;
1286
+ submittedAt: number;
1287
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1288
+ } | {
1289
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1290
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1291
+ data: undefined;
1292
+ error: Error;
1293
+ variables: StartFlowParam;
1294
+ isError: true;
1295
+ isIdle: false;
1296
+ isPending: false;
1297
+ isSuccess: false;
1298
+ status: "error";
1299
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1300
+ reset: () => void;
1301
+ context: unknown;
1302
+ failureCount: number;
1303
+ failureReason: Error | null;
1304
+ isPaused: boolean;
1305
+ submittedAt: number;
1306
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1307
+ } | {
1308
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1309
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1310
+ data: string;
1311
+ error: null;
1312
+ variables: StartFlowParam;
1313
+ isError: false;
1314
+ isIdle: false;
1315
+ isPending: false;
1316
+ isSuccess: true;
1317
+ status: "success";
1318
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
1319
+ reset: () => void;
1320
+ context: unknown;
1321
+ failureCount: number;
1322
+ failureReason: Error | null;
1323
+ isPaused: boolean;
1324
+ submittedAt: number;
1325
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
1326
+ };
1327
+
1328
+ declare type V1FrontendVisualization = z.output<typeof V1FrontendVisualizationSchema>;
1329
+
1330
+ declare const V1FrontendVisualizationSchema: z.ZodObject<Omit<{
1331
+ id: z.ZodNumber;
1332
+ flow_data_id: z.ZodNumber;
1333
+ created_at: z.ZodString;
1334
+ sql: z.ZodString;
1335
+ bookmarked: z.ZodBoolean;
1336
+ data_sample: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
1337
+ is_sample: z.ZodBoolean;
1338
+ data_summary: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1339
+ } & {
1340
+ configuration: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1341
+ xAxisLabel: z.ZodString;
1342
+ yAxisLabel: z.ZodString;
1343
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1344
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1345
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1346
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1347
+ title: z.ZodString;
1348
+ type: z.ZodLiteral<"bar">;
1349
+ }, "strip", z.ZodTypeAny, {
1350
+ type: "bar";
1351
+ title: string;
1352
+ xAxisLabel: string;
1353
+ yAxisLabel: string;
1354
+ valueColumns?: string[] | undefined;
1355
+ xAxisDataKey?: string | undefined;
1356
+ yAxisDataKey?: string | undefined;
1357
+ dimensionDataKey?: string | undefined;
1358
+ }, {
1359
+ type: "bar";
1360
+ title: string;
1361
+ xAxisLabel: string;
1362
+ yAxisLabel: string;
1363
+ valueColumns?: string[] | undefined;
1364
+ xAxisDataKey?: string | undefined;
1365
+ yAxisDataKey?: string | undefined;
1366
+ dimensionDataKey?: string | undefined;
1367
+ }>, z.ZodObject<{
1368
+ xAxisLabel: z.ZodString;
1369
+ yAxisLabel: z.ZodString;
1370
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1371
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1372
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1373
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1374
+ title: z.ZodString;
1375
+ type: z.ZodLiteral<"line/area">;
1376
+ }, "strip", z.ZodTypeAny, {
1377
+ type: "line/area";
1378
+ title: string;
1379
+ xAxisLabel: string;
1380
+ yAxisLabel: string;
1381
+ valueColumns?: string[] | undefined;
1382
+ xAxisDataKey?: string | undefined;
1383
+ yAxisDataKey?: string | undefined;
1384
+ dimensionDataKey?: string | undefined;
1385
+ }, {
1386
+ type: "line/area";
1387
+ title: string;
1388
+ xAxisLabel: string;
1389
+ yAxisLabel: string;
1390
+ valueColumns?: string[] | undefined;
1391
+ xAxisDataKey?: string | undefined;
1392
+ yAxisDataKey?: string | undefined;
1393
+ dimensionDataKey?: string | undefined;
1394
+ }>, z.ZodObject<{
1395
+ xAxisLabel: z.ZodString;
1396
+ yAxisLabel: z.ZodString;
1397
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1398
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1399
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1400
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1401
+ title: z.ZodString;
1402
+ type: z.ZodLiteral<"scatter">;
1403
+ }, "strip", z.ZodTypeAny, {
1404
+ type: "scatter";
1405
+ title: string;
1406
+ xAxisLabel: string;
1407
+ yAxisLabel: string;
1408
+ valueColumns?: string[] | undefined;
1409
+ xAxisDataKey?: string | undefined;
1410
+ yAxisDataKey?: string | undefined;
1411
+ dimensionDataKey?: string | undefined;
1412
+ }, {
1413
+ type: "scatter";
1414
+ title: string;
1415
+ xAxisLabel: string;
1416
+ yAxisLabel: string;
1417
+ valueColumns?: string[] | undefined;
1418
+ xAxisDataKey?: string | undefined;
1419
+ yAxisDataKey?: string | undefined;
1420
+ dimensionDataKey?: string | undefined;
1421
+ }>, z.ZodObject<{
1422
+ nameKey: z.ZodString;
1423
+ dataKey: z.ZodString;
1424
+ title: z.ZodString;
1425
+ type: z.ZodLiteral<"pie">;
1426
+ }, "strip", z.ZodTypeAny, {
1427
+ type: "pie";
1428
+ title: string;
1429
+ nameKey: string;
1430
+ dataKey: string;
1431
+ }, {
1432
+ type: "pie";
1433
+ title: string;
1434
+ nameKey: string;
1435
+ dataKey: string;
1436
+ }>]>;
1437
+ }, "sql" | "data_sample" | "is_sample" | "data_summary">, "strip", z.ZodTypeAny, {
1438
+ id: number;
1439
+ flow_data_id: number;
1440
+ created_at: string;
1441
+ bookmarked: boolean;
1442
+ configuration: {
1443
+ type: "bar";
1444
+ title: string;
1445
+ xAxisLabel: string;
1446
+ yAxisLabel: string;
1447
+ valueColumns?: string[] | undefined;
1448
+ xAxisDataKey?: string | undefined;
1449
+ yAxisDataKey?: string | undefined;
1450
+ dimensionDataKey?: string | undefined;
1451
+ } | {
1452
+ type: "line/area";
1453
+ title: string;
1454
+ xAxisLabel: string;
1455
+ yAxisLabel: string;
1456
+ valueColumns?: string[] | undefined;
1457
+ xAxisDataKey?: string | undefined;
1458
+ yAxisDataKey?: string | undefined;
1459
+ dimensionDataKey?: string | undefined;
1460
+ } | {
1461
+ type: "scatter";
1462
+ title: string;
1463
+ xAxisLabel: string;
1464
+ yAxisLabel: string;
1465
+ valueColumns?: string[] | undefined;
1466
+ xAxisDataKey?: string | undefined;
1467
+ yAxisDataKey?: string | undefined;
1468
+ dimensionDataKey?: string | undefined;
1469
+ } | {
1470
+ type: "pie";
1471
+ title: string;
1472
+ nameKey: string;
1473
+ dataKey: string;
1474
+ };
1475
+ }, {
1476
+ id: number;
1477
+ flow_data_id: number;
1478
+ created_at: string;
1479
+ bookmarked: boolean;
1480
+ configuration: {
1481
+ type: "bar";
1482
+ title: string;
1483
+ xAxisLabel: string;
1484
+ yAxisLabel: string;
1485
+ valueColumns?: string[] | undefined;
1486
+ xAxisDataKey?: string | undefined;
1487
+ yAxisDataKey?: string | undefined;
1488
+ dimensionDataKey?: string | undefined;
1489
+ } | {
1490
+ type: "line/area";
1491
+ title: string;
1492
+ xAxisLabel: string;
1493
+ yAxisLabel: string;
1494
+ valueColumns?: string[] | undefined;
1495
+ xAxisDataKey?: string | undefined;
1496
+ yAxisDataKey?: string | undefined;
1497
+ dimensionDataKey?: string | undefined;
1498
+ } | {
1499
+ type: "scatter";
1500
+ title: string;
1501
+ xAxisLabel: string;
1502
+ yAxisLabel: string;
1503
+ valueColumns?: string[] | undefined;
1504
+ xAxisDataKey?: string | undefined;
1505
+ yAxisDataKey?: string | undefined;
1506
+ dimensionDataKey?: string | undefined;
1507
+ } | {
1508
+ type: "pie";
1509
+ title: string;
1510
+ nameKey: string;
1511
+ dataKey: string;
1512
+ };
1513
+ }>;
1514
+
1515
+ export declare const Visualization: ForwardRefExoticComponent< {
1516
+ visualizationId: number;
1517
+ isFullWidth: boolean;
1518
+ withTitle: boolean;
1519
+ } & RefAttributes<HTMLDivElement>>;
1520
+
1521
+ export { }