@magemetrics/ai 0.0.44 → 0.0.46

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,4 +1,8 @@
1
1
  import { default as default_2 } from 'react';
2
+ import { JSX } from 'react/jsx-runtime';
3
+ import { UseMutateAsyncFunction } from '@tanstack/react-query';
4
+ import { UseMutateFunction } from '@tanstack/react-query';
5
+ import { UseMutationOptions } from '@tanstack/react-query';
2
6
  import { z } from 'zod';
3
7
 
4
8
  export declare class ApiService {
@@ -12,7 +16,7 @@ export declare class ApiService {
12
16
  request: string;
13
17
  user_id: string | null;
14
18
  }[]>;
15
- startFlow: (request: string) => Promise<string>;
19
+ startFlow: (request: StartFlowParam) => Promise<string>;
16
20
  }
17
21
 
18
22
  export declare type CellContentProps = {
@@ -59,7 +63,7 @@ export declare interface DataReportMessageProps {
59
63
  totalRows: number;
60
64
  }
61
65
 
62
- export declare const DataTable: React.FC<InfiniteDataTableUIProps>;
66
+ export declare const DataTable: (props: DataReportMessageProps) => JSX.Element;
63
67
 
64
68
  declare type DisplayControlProps = {
65
69
  showRecommendations?: boolean;
@@ -183,7 +187,7 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
183
187
  details: string;
184
188
  }[];
185
189
  }>>>;
186
- columns_lineage: z.ZodRecord<z.ZodString, z.ZodObject<{
190
+ columns_lineage: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
187
191
  nodes: z.ZodArray<z.ZodObject<{
188
192
  id: z.ZodString;
189
193
  type: z.ZodEnum<["entity", "attribute", "filter", "process", "combine", "result"]>;
@@ -227,7 +231,7 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
227
231
  source: string;
228
232
  target: string;
229
233
  }[];
230
- }>>;
234
+ }>>>>;
231
235
  confidence_score: z.ZodNumber;
232
236
  confidence_score_reason: z.ZodString;
233
237
  id: z.ZodNumber;
@@ -235,17 +239,6 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
235
239
  created_at: z.ZodString;
236
240
  }, "id" | "created_at">, "strip", z.ZodTypeAny, {
237
241
  flow_data_id: number;
238
- columns_lineage: Record<string, {
239
- nodes: {
240
- type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
241
- id: string;
242
- explanation: string;
243
- }[];
244
- edges: {
245
- source: string;
246
- target: string;
247
- }[];
248
- }>;
249
242
  confidence_score: number;
250
243
  confidence_score_reason: string;
251
244
  sql_explanation?: {
@@ -265,9 +258,7 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
265
258
  details: string;
266
259
  }[];
267
260
  } | null | undefined;
268
- }, {
269
- flow_data_id: number;
270
- columns_lineage: Record<string, {
261
+ columns_lineage?: Record<string, {
271
262
  nodes: {
272
263
  type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
273
264
  id: string;
@@ -277,7 +268,9 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
277
268
  source: string;
278
269
  target: string;
279
270
  }[];
280
- }>;
271
+ }> | null | undefined;
272
+ }, {
273
+ flow_data_id: number;
281
274
  confidence_score: number;
282
275
  confidence_score_reason: string;
283
276
  sql_explanation?: {
@@ -297,6 +290,17 @@ declare const FrontendFlowDataExplainabilitySchema: z.ZodObject<Omit<{
297
290
  details: string;
298
291
  }[];
299
292
  } | null | undefined;
293
+ columns_lineage?: Record<string, {
294
+ nodes: {
295
+ type: "filter" | "result" | "entity" | "attribute" | "process" | "combine";
296
+ id: string;
297
+ explanation: string;
298
+ }[];
299
+ edges: {
300
+ source: string;
301
+ target: string;
302
+ }[];
303
+ }> | null | undefined;
300
304
  }>;
301
305
 
302
306
  declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
@@ -408,20 +412,6 @@ declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
408
412
  };
409
413
  }>;
410
414
 
411
- declare type InfiniteDataTableUIProps = {
412
- flowId: string;
413
- data: Record<string, unknown>[];
414
- columns: FrontendFlowColumns;
415
- explainability: FrontendFlowDataExplainability | null | undefined;
416
- isOpened: boolean;
417
- setIsOpened: (opened: boolean) => void;
418
- hasNextPage?: boolean;
419
- fetchNextPage: () => Promise<unknown>;
420
- isFetchingNextPage: boolean;
421
- isFetching: boolean;
422
- totalRows: number;
423
- };
424
-
425
415
  export declare const logout: () => Promise<void>;
426
416
 
427
417
  export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps>;
@@ -460,12 +450,97 @@ declare type StandaloneConversationModalProps = {
460
450
  onOpenChange?: (open: boolean) => void;
461
451
  };
462
452
 
453
+ declare type StartFlowParam = {
454
+ query: string;
455
+ } | {
456
+ triggerId: string;
457
+ variables: Record<string, string>;
458
+ };
459
+
463
460
  declare type StartOptions = DisplayControlProps & {
464
461
  label?: string;
465
462
  recommendationsLabel?: string;
466
463
  placeholders?: string[];
467
464
  };
468
465
 
466
+ export declare const useStartFlow: (options?: UseMutationOptions<string, Error, StartFlowParam>) => {
467
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
468
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
469
+ data: undefined;
470
+ variables: undefined;
471
+ error: null;
472
+ isError: false;
473
+ isIdle: true;
474
+ isPending: false;
475
+ isSuccess: false;
476
+ status: "idle";
477
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
478
+ reset: () => void;
479
+ context: unknown;
480
+ failureCount: number;
481
+ failureReason: Error | null;
482
+ isPaused: boolean;
483
+ submittedAt: number;
484
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
485
+ } | {
486
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
487
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
488
+ data: undefined;
489
+ variables: StartFlowParam;
490
+ error: null;
491
+ isError: false;
492
+ isIdle: false;
493
+ isPending: true;
494
+ isSuccess: false;
495
+ status: "pending";
496
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
497
+ reset: () => void;
498
+ context: unknown;
499
+ failureCount: number;
500
+ failureReason: Error | null;
501
+ isPaused: boolean;
502
+ submittedAt: number;
503
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
504
+ } | {
505
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
506
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
507
+ data: undefined;
508
+ error: Error;
509
+ variables: StartFlowParam;
510
+ isError: true;
511
+ isIdle: false;
512
+ isPending: false;
513
+ isSuccess: false;
514
+ status: "error";
515
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
516
+ reset: () => void;
517
+ context: unknown;
518
+ failureCount: number;
519
+ failureReason: Error | null;
520
+ isPaused: boolean;
521
+ submittedAt: number;
522
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
523
+ } | {
524
+ startFlow: UseMutateFunction<string, Error, StartFlowParam, unknown>;
525
+ startFlowAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
526
+ data: string;
527
+ error: null;
528
+ variables: StartFlowParam;
529
+ isError: false;
530
+ isIdle: false;
531
+ isPending: false;
532
+ isSuccess: true;
533
+ status: "success";
534
+ mutate: UseMutateFunction<string, Error, StartFlowParam, unknown>;
535
+ reset: () => void;
536
+ context: unknown;
537
+ failureCount: number;
538
+ failureReason: Error | null;
539
+ isPaused: boolean;
540
+ submittedAt: number;
541
+ mutateAsync: UseMutateAsyncFunction<string, Error, StartFlowParam, unknown>;
542
+ };
543
+
469
544
  export { }
470
545
 
471
546