@magemetrics/ai 0.10.0 → 0.11.0

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,8 +1,5 @@
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';
6
3
  import { CreateFlowParam } from '@magemetrics/core';
7
4
  import { default as default_2 } from 'react';
8
5
  import { DirectAuthProvider } from '@magemetrics/core';
@@ -15,16 +12,11 @@ import { InfiniteQueryObserverResult } from '@tanstack/react-query';
15
12
  import { JSX } from 'react/jsx-runtime';
16
13
  import { MageMetricsClient } from '@magemetrics/core';
17
14
  import { MageMetricsClientConfig } from '@magemetrics/core';
18
- import { MageMetricsContextProvider } from './shared/context/MageMetricsContext';
19
- import { MageMetricsContextProviderProps } from './shared/context/MageMetricsContext';
20
- import { PersistenceOptions } from '../shared/context/MageMetricsContext';
21
15
  import { PropsWithChildren } from 'react';
22
16
  import { QueryObserverResult } from '@tanstack/react-query';
23
17
  import { RefAttributes } from 'react';
24
18
  import { RefetchOptions } from '@tanstack/react-query';
25
19
  import { SortingState as SortingState_2 } from '@tanstack/react-table';
26
- import { useMageMetricsClient } from './shared/context/MageMetricsContext';
27
- import { useMageMetricsReady } from './shared/context/MageMetricsContext';
28
20
  import { UseMutateAsyncFunction } from '@tanstack/react-query';
29
21
  import { UseMutateFunction } from '@tanstack/react-query';
30
22
  import { UseMutationOptions } from '@tanstack/react-query';
@@ -128,7 +120,40 @@ declare interface ColumnSort {
128
120
  id: string;
129
121
  }
130
122
 
131
- export { Components }
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: {
134
+ report: Report_2;
135
+ }) => default_2.ReactNode;
136
+ dataReportMessageActions?: (props: {
137
+ report: Report_2;
138
+ isSelected: boolean;
139
+ }) => default_2.ReactNode;
140
+ visualizationMessageActions?: (props: {
141
+ visualization: FrontendVisualization | V1FrontendVisualization;
142
+ isSelected: boolean;
143
+ }) => default_2.ReactNode;
144
+ dataReportPanelActions?: (props: {
145
+ report: Report_2;
146
+ }) => default_2.ReactNode;
147
+ visualizationPanelActions?: (props: {
148
+ visualization: FrontendVisualization | V1FrontendVisualization;
149
+ }) => default_2.ReactNode;
150
+ avatar?: default_2.ReactNode;
151
+ getCanvasShareableLink?: (canvasId: string) => string;
152
+ canvasPanelActions?: (props: {
153
+ canvas: FrontendCanvas;
154
+ flowId: string;
155
+ }) => default_2.ReactNode;
156
+ }
132
157
 
133
158
  export declare const ConfigurableChat: ConfigurableChatComponent;
134
159
 
@@ -236,8 +261,8 @@ declare type FormattedData = {
236
261
  declare type FrontendCanvas = z.infer<typeof FrontendCanvasSchema>;
237
262
 
238
263
  declare const FrontendCanvasSchema: z.ZodObject<{
239
- id: z.ZodUUID;
240
264
  title: z.ZodNullable<z.ZodString>;
265
+ id: z.ZodUUID;
241
266
  nodes: z.ZodArray<z.ZodAny>;
242
267
  edges: z.ZodArray<z.ZodAny>;
243
268
  is_public: z.ZodBoolean;
@@ -245,8 +270,8 @@ declare const FrontendCanvasSchema: z.ZodObject<{
245
270
 
246
271
  declare const FrontendReportSchema: z.ZodObject<{
247
272
  status: z.ZodNullable<z.ZodString>;
248
- id: z.ZodNumber;
249
273
  title: z.ZodString;
274
+ id: z.ZodNumber;
250
275
  request: z.ZodNullable<z.ZodString>;
251
276
  created_at: z.ZodString;
252
277
  data_summary: z.ZodObject<{
@@ -274,11 +299,68 @@ declare const FrontendReportSchema: z.ZodObject<{
274
299
  last_materialized_at: z.ZodNullable<z.ZodString>;
275
300
  materialized_error_message: z.ZodNullable<z.ZodString>;
276
301
  materialized_status: z.ZodNullable<z.ZodEnum<{
277
- running: "running";
278
302
  completed: "completed";
279
303
  failed: "failed";
304
+ running: "running";
280
305
  }>>;
281
- bookmarked: z.ZodBoolean;
306
+ }, z.core.$strip>;
307
+
308
+ declare type FrontendVisualization = z.output<typeof FrontendVisualizationSchema>;
309
+
310
+ declare const FrontendVisualizationSchema: z.ZodObject<{
311
+ id: z.ZodNumber;
312
+ configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
+ config_version: z.ZodLiteral<2>;
314
+ xAxisLabel: z.ZodString;
315
+ yAxisLabel: z.ZodString;
316
+ categoryColumn: z.ZodString;
317
+ secondaryCategoryColumn: z.ZodOptional<z.ZodString>;
318
+ valueColumn: z.ZodString;
319
+ title: z.ZodString;
320
+ type: z.ZodLiteral<"bar">;
321
+ }, z.core.$strip>, z.ZodObject<{
322
+ xAxisColumn: z.ZodString;
323
+ valueColumns: z.ZodArray<z.ZodString>;
324
+ yAxisLabels: z.ZodArray<z.ZodString>;
325
+ title: z.ZodString;
326
+ type: z.ZodLiteral<"line/area">;
327
+ config_version: z.ZodLiteral<2>;
328
+ }, z.core.$strip>, z.ZodObject<{
329
+ config_version: z.ZodLiteral<2>;
330
+ valueColumn: z.ZodString;
331
+ xAxisColumn: z.ZodString;
332
+ xAxisLabel: z.ZodString;
333
+ yAxisLabel: z.ZodString;
334
+ categoryColumn: z.ZodString;
335
+ title: z.ZodString;
336
+ type: z.ZodLiteral<"line/area-categorical">;
337
+ }, z.core.$strip>, z.ZodObject<{
338
+ config_version: z.ZodLiteral<2>;
339
+ xAxisLabel: z.ZodString;
340
+ yAxisLabel: z.ZodString;
341
+ xAxisValueColumn: z.ZodString;
342
+ yAxisValueColumn: z.ZodString;
343
+ title: z.ZodString;
344
+ type: z.ZodLiteral<"scatter">;
345
+ }, z.core.$strip>, z.ZodObject<{
346
+ config_version: z.ZodLiteral<2>;
347
+ categoryColumn: z.ZodString;
348
+ valueColumn: z.ZodString;
349
+ title: z.ZodString;
350
+ type: z.ZodLiteral<"pie">;
351
+ }, z.core.$strip>], "type">;
352
+ created_at: z.ZodString;
353
+ flow_data_id: z.ZodNumber;
354
+ flow_data: z.ZodOptional<z.ZodObject<{
355
+ is_materialized: z.ZodNullable<z.ZodBoolean>;
356
+ last_materialized_at: z.ZodNullable<z.ZodString>;
357
+ materialized_error_message: z.ZodNullable<z.ZodString>;
358
+ materialized_status: z.ZodNullable<z.ZodEnum<{
359
+ completed: "completed";
360
+ failed: "failed";
361
+ running: "running";
362
+ }>>;
363
+ }, z.core.$strip>>;
282
364
  }, z.core.$strip>;
283
365
 
284
366
  declare const InputContainer: default_2.FC<{
@@ -302,14 +384,28 @@ export { MageMetricsClient }
302
384
 
303
385
  export { MageMetricsClientConfig }
304
386
 
305
- export { MageMetricsContextProvider }
306
-
307
- export { MageMetricsContextProviderProps }
387
+ export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps>;
388
+
389
+ export declare type MageMetricsContextProviderProps = {
390
+ children: default_2.ReactNode;
391
+ components?: Components;
392
+ } & ({
393
+ /** Provide an external MageMetricsClient instance. */
394
+ client: MageMetricsClient;
395
+ apiKey?: never;
396
+ apiUrl?: never;
397
+ externalJwt?: never;
398
+ additionalHeaders?: never;
399
+ applicationName?: never;
400
+ } | ({
401
+ /** Configuration to create a new MageMetricsClient. */
402
+ client?: never;
403
+ } & MageMetricsClientConfig));
308
404
 
309
405
  export declare const MageMetricsPublicContextProvider: React.FC<MageMetricsPublicContextProviderProps>;
310
406
 
311
407
  declare type MageMetricsPublicContextProviderProps = PropsWithChildren<Pick<MageMetricsClientConfig, "apiUrl" | "apiKey"> & {
312
- components?: Components_3;
408
+ components?: Components;
313
409
  }>;
314
410
 
315
411
  export declare const ManagedModal: React.FC<ManagedModalProps>;
@@ -328,7 +424,7 @@ declare type ManagedModalBaseProps = ModalProps & {
328
424
  /** Where to persist modal state (localStorage, queryParam, or none) */
329
425
  persist?: PersistenceOptions;
330
426
  /** Custom component overrides for extending functionality */
331
- components?: Components_2;
427
+ components?: Components;
332
428
  /** Application name to associate with flows created through this modal */
333
429
  applicationName?: string;
334
430
  /**
@@ -372,6 +468,8 @@ declare interface ModalProps {
372
468
  startOptions?: StartOptions;
373
469
  }
374
470
 
471
+ declare type PersistenceOptions = "queryParam" | "none";
472
+
375
473
  /**
376
474
  * Primary color shade stops used in the UI.
377
475
  */
@@ -518,8 +616,8 @@ declare const TableFilterValueSchema: z.ZodObject<{
518
616
  * ```
519
617
  */
520
618
  export declare const useCanvas: (canvasId: string | undefined | null, options?: Omit<UseQueryOptions<FrontendCanvas, unknown>, "queryKey" | "queryFn">) => UseQueryResult< {
521
- id: string;
522
619
  title: string | null;
620
+ id: string;
523
621
  nodes: any[];
524
622
  edges: any[];
525
623
  is_public: boolean;
@@ -654,8 +752,8 @@ export declare const useDataReportColumnValue: (reportId: number, filters: Repor
654
752
  export declare const useDataTableContext: () => {
655
753
  report: {
656
754
  status: string | null;
657
- id: number;
658
755
  title: string;
756
+ id: number;
659
757
  request: string | null;
660
758
  created_at: string;
661
759
  data_summary: {
@@ -685,7 +783,6 @@ export declare const useDataTableContext: () => {
685
783
  last_materialized_at: string | null;
686
784
  materialized_error_message: string | null;
687
785
  materialized_status: "completed" | "running" | "failed" | null;
688
- bookmarked: boolean;
689
786
  };
690
787
  fetchNextPage: (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<InfiniteData< {
691
788
  [key: string]: unknown;
@@ -787,13 +884,13 @@ export declare const useDownloadReportData: (options?: UseMutationOptions<Export
787
884
 
788
885
  export declare const useMageMetricsApiUrl: () => string;
789
886
 
790
- export { useMageMetricsClient }
887
+ export declare const useMageMetricsClient: () => MageMetricsClient;
791
888
 
792
- export { useMageMetricsReady }
889
+ export declare const useMageMetricsReady: () => false | MageMetricsClient;
793
890
 
794
891
  export declare const useRecentFlows: (limit?: number) => UseQueryResult< {
795
- id: string;
796
892
  title: string | null;
893
+ id: string;
797
894
  request: string;
798
895
  created_at: string;
799
896
  user_id: string | null;
@@ -832,7 +929,6 @@ export declare const useReport: (reportId: number) => {
832
929
  } & {
833
930
  [key: string]: unknown;
834
931
  };
835
- bookmarked: boolean;
836
932
  status: string | null;
837
933
  is_removed: boolean;
838
934
  is_materialized: boolean | null;
@@ -875,7 +971,6 @@ export declare const useReport: (reportId: number) => {
875
971
  } & {
876
972
  [key: string]: unknown;
877
973
  };
878
- bookmarked: boolean;
879
974
  status: string | null;
880
975
  is_removed: boolean;
881
976
  is_materialized: boolean | null;
@@ -889,6 +984,57 @@ export declare const useReport: (reportId: number) => {
889
984
 
890
985
  export declare const useSpeechToText: () => AssemblyAIMicrophoneController;
891
986
 
987
+ declare type V1FrontendVisualization = z.output<typeof V1FrontendVisualizationSchema>;
988
+
989
+ declare const V1FrontendVisualizationSchema: z.ZodObject<{
990
+ id: z.ZodNumber;
991
+ configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
992
+ xAxisLabel: z.ZodString;
993
+ yAxisLabel: z.ZodString;
994
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
995
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
996
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
997
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
998
+ title: z.ZodString;
999
+ type: z.ZodLiteral<"bar">;
1000
+ }, z.core.$strip>, z.ZodObject<{
1001
+ xAxisLabel: z.ZodString;
1002
+ yAxisLabel: z.ZodString;
1003
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1004
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1005
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1006
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1007
+ title: z.ZodString;
1008
+ type: z.ZodLiteral<"line/area">;
1009
+ }, z.core.$strip>, z.ZodObject<{
1010
+ xAxisLabel: z.ZodString;
1011
+ yAxisLabel: z.ZodString;
1012
+ xAxisDataKey: z.ZodOptional<z.ZodString>;
1013
+ yAxisDataKey: z.ZodOptional<z.ZodString>;
1014
+ dimensionDataKey: z.ZodOptional<z.ZodString>;
1015
+ valueColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1016
+ title: z.ZodString;
1017
+ type: z.ZodLiteral<"scatter">;
1018
+ }, z.core.$strip>, z.ZodObject<{
1019
+ nameKey: z.ZodString;
1020
+ dataKey: z.ZodString;
1021
+ title: z.ZodString;
1022
+ type: z.ZodLiteral<"pie">;
1023
+ }, z.core.$strip>], "type">;
1024
+ created_at: z.ZodString;
1025
+ flow_data_id: z.ZodNumber;
1026
+ flow_data: z.ZodOptional<z.ZodObject<{
1027
+ is_materialized: z.ZodNullable<z.ZodBoolean>;
1028
+ last_materialized_at: z.ZodNullable<z.ZodString>;
1029
+ materialized_error_message: z.ZodNullable<z.ZodString>;
1030
+ materialized_status: z.ZodNullable<z.ZodEnum<{
1031
+ completed: "completed";
1032
+ failed: "failed";
1033
+ running: "running";
1034
+ }>>;
1035
+ }, z.core.$strip>>;
1036
+ }, z.core.$strip>;
1037
+
892
1038
  export declare const Visualization: ForwardRefExoticComponent< {
893
1039
  visualizationId: number;
894
1040
  withTitle: boolean;