@magemetrics/ai 0.11.1 → 0.11.4

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.
@@ -214,6 +214,15 @@ declare type ConfigurableChatComponentProps = {
214
214
  appearance?: AppearanceConfig;
215
215
  };
216
216
 
217
+ /** Context usage — the modal reuses an ancestor `MageMetricsContextProvider`. */
218
+ declare type ContextManagedModalProps = ManagedModalInnerProps & {
219
+ apiKey?: never;
220
+ externalJwt?: never;
221
+ apiUrl?: never;
222
+ components?: never;
223
+ applicationName?: never;
224
+ };
225
+
217
226
  /** @deprecated This type is no longer used and will be removed in a future version. */
218
227
  declare type ControlledModalProps = {
219
228
  visible: boolean;
@@ -333,8 +342,8 @@ declare const FrontendReportSchema: z.ZodObject<{
333
342
  avg_length: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
334
343
  }, z.core.$loose>>;
335
344
  }, z.core.$loose>;
336
- is_removed: z.ZodBoolean;
337
345
  flow_id: z.ZodString;
346
+ is_removed: z.ZodBoolean;
338
347
  is_materialized: z.ZodNullable<z.ZodBoolean>;
339
348
  last_materialized_at: z.ZodNullable<z.ZodString>;
340
349
  materialized_error_message: z.ZodNullable<z.ZodString>;
@@ -390,7 +399,6 @@ declare const FrontendVisualizationSchema: z.ZodObject<{
390
399
  type: z.ZodLiteral<"pie">;
391
400
  }, z.core.$strip>], "type">;
392
401
  created_at: z.ZodString;
393
- flow_data_id: z.ZodNumber;
394
402
  flow_data: z.ZodOptional<z.ZodObject<{
395
403
  is_materialized: z.ZodNullable<z.ZodBoolean>;
396
404
  last_materialized_at: z.ZodNullable<z.ZodString>;
@@ -401,6 +409,7 @@ declare const FrontendVisualizationSchema: z.ZodObject<{
401
409
  running: "running";
402
410
  }>>;
403
411
  }, z.core.$strip>>;
412
+ flow_data_id: z.ZodNumber;
404
413
  }, z.core.$strip>;
405
414
 
406
415
  declare const InputContainer: default_2.FC<{
@@ -450,23 +459,18 @@ declare type MageMetricsPublicContextProviderProps = PropsWithChildren<Pick<Mage
450
459
 
451
460
  export declare const ManagedModal: React.FC<ManagedModalProps>;
452
461
 
453
- declare type ManagedModalBaseProps = ModalProps & {
454
- /** API key for authenticating with the MageMetrics service */
455
- apiKey: string;
456
- /** External JWT token for user authentication */
457
- externalJwt: string;
458
- /** Base URL for the MageMetrics API */
459
- apiUrl: string;
462
+ /**
463
+ * Props shared by both standalone and context-aware usage of `ManagedModal`.
464
+ * These are the props that `ManagedModalInner` actually consumes — they have
465
+ * nothing to do with provider initialisation.
466
+ */
467
+ declare type ManagedModalInnerProps = ModalProps & {
460
468
  /** Whether to disable canvas functionality in conversations */
461
469
  disableCanvas?: boolean;
462
470
  /** Whether to render data freshness info in the conversation header */
463
471
  showDataFreshness?: boolean;
464
472
  /** Where to persist modal state (localStorage, queryParam, or none) */
465
473
  persist?: PersistenceOptions;
466
- /** Custom component overrides for extending functionality */
467
- components?: Components;
468
- /** Application name to associate with flows created through this modal */
469
- applicationName?: string;
470
474
  /**
471
475
  * Appearance configuration for customizing the visual style.
472
476
  * Includes brand colors and modal-specific styling options.
@@ -479,10 +483,7 @@ declare type ManagedModalBaseProps = ModalProps & {
479
483
  };
480
484
  };
481
485
 
482
- /**
483
- * Props for ManagedModal component.
484
- */
485
- declare type ManagedModalProps = ManagedModalBaseProps;
486
+ declare type ManagedModalProps = StandaloneManagedModalProps | ContextManagedModalProps;
486
487
 
487
488
  declare const MessagesContainer: default_2.FC;
488
489
 
@@ -610,6 +611,32 @@ export declare const StandaloneDataTable: React.FC<{
610
611
  onStateChange?: (state: DataTableState) => void;
611
612
  }>;
612
613
 
614
+ /**
615
+ * Props for ManagedModal component.
616
+ *
617
+ * When rendered inside a `MageMetricsContextProvider`, the modal reuses the
618
+ * parent context instead of creating a duplicate. In that case `apiKey`,
619
+ * `externalJwt`, `apiUrl`, `components`, and `applicationName` must **not**
620
+ * be passed (they are inherited from the parent provider).
621
+ *
622
+ * When rendered standalone (no parent context), `apiKey`, `externalJwt`, and
623
+ * `apiUrl` are **required**, and `components`/`applicationName` may optionally
624
+ * be provided.
625
+ */
626
+ /** Standalone usage — the modal creates its own `MageMetricsContextProvider`. */
627
+ declare type StandaloneManagedModalProps = ManagedModalInnerProps & {
628
+ /** API key for authenticating with the MageMetrics service */
629
+ apiKey: string;
630
+ /** External JWT token for user authentication */
631
+ externalJwt: string;
632
+ /** Base URL for the MageMetrics API */
633
+ apiUrl: string;
634
+ /** Custom component overrides for extending functionality */
635
+ components?: Components;
636
+ /** Application name to associate with flows created through this modal */
637
+ applicationName?: string;
638
+ };
639
+
613
640
  declare type StartOptions = DisplayControlProps & {
614
641
  /** Label text displayed above the chat launcher input */
615
642
  label?: string;
@@ -792,7 +819,7 @@ export declare const useCreateFlow: (options?: UseMutationOptions<{
792
819
  };
793
820
 
794
821
  export declare const useDataReportColumnValue: (reportId: number, filters: ReportDataFilters) => UseQueryResult< {
795
- [key: string]: unknown;
822
+ [x: string]: unknown;
796
823
  }[], Error>;
797
824
 
798
825
  export declare const useDataTableContext: () => {
@@ -823,26 +850,26 @@ export declare const useDataTableContext: () => {
823
850
  avg_length?: number | null | undefined;
824
851
  }>;
825
852
  };
826
- is_removed: boolean;
827
853
  flow_id: string;
854
+ is_removed: boolean;
828
855
  is_materialized: boolean | null;
829
856
  last_materialized_at: string | null;
830
857
  materialized_error_message: string | null;
831
858
  materialized_status: "completed" | "running" | "failed" | null;
832
859
  };
833
860
  fetchNextPage: (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<InfiniteData< {
834
- [key: string]: unknown;
861
+ [x: string]: unknown;
835
862
  }[], unknown>, Error>>;
836
863
  pages: {
837
- [key: string]: unknown;
864
+ [x: string]: unknown;
838
865
  }[][] | undefined;
839
866
  columns: {
840
867
  name: string;
841
868
  data_type: string;
842
869
  dataType: string;
843
- renderType?: string;
844
- unit?: string;
845
- canonicalDataType?: "numeric" | "boolean" | "datetime" | "text" | "array" | "json" | "other";
870
+ renderType?: string | undefined;
871
+ unit?: string | undefined;
872
+ canonicalDataType?: "numeric" | "boolean" | "datetime" | "text" | "array" | "json" | "other" | undefined;
846
873
  }[] | undefined;
847
874
  isPendingColumns: boolean;
848
875
  hasMoreData: boolean;
@@ -951,29 +978,27 @@ export declare const useReport: (reportId: number) => {
951
978
  title: string;
952
979
  request: string | null;
953
980
  data_summary: {
981
+ [x: string]: unknown;
954
982
  columns: {
955
- [key: string]: {
956
- position?: number;
983
+ [x: string]: {
984
+ [x: string]: unknown;
985
+ position?: number | undefined;
957
986
  data_type: string;
958
987
  null_count: number | null;
959
988
  unique_count: number | null;
960
989
  unique_percentage: number | null;
961
- min_value?: number | null;
962
- max_value?: number | null;
963
- avg_value?: number | null;
964
- median_value?: number | null;
965
- std_value?: number | null;
966
- min_date?: string | null;
967
- max_date?: string | null;
968
- min_length?: number | null;
969
- max_length?: number | null;
970
- avg_length?: number | null;
971
- } & {
972
- [key: string]: unknown;
990
+ min_value?: number | null | undefined;
991
+ max_value?: number | null | undefined;
992
+ avg_value?: number | null | undefined;
993
+ median_value?: number | null | undefined;
994
+ std_value?: number | null | undefined;
995
+ min_date?: string | null | undefined;
996
+ max_date?: string | null | undefined;
997
+ min_length?: number | null | undefined;
998
+ max_length?: number | null | undefined;
999
+ avg_length?: number | null | undefined;
973
1000
  };
974
1001
  };
975
- } & {
976
- [key: string]: unknown;
977
1002
  };
978
1003
  status: string | null;
979
1004
  is_removed: boolean;
@@ -993,29 +1018,27 @@ export declare const useReport: (reportId: number) => {
993
1018
  title: string;
994
1019
  request: string | null;
995
1020
  data_summary: {
1021
+ [x: string]: unknown;
996
1022
  columns: {
997
- [key: string]: {
998
- position?: number;
1023
+ [x: string]: {
1024
+ [x: string]: unknown;
1025
+ position?: number | undefined;
999
1026
  data_type: string;
1000
1027
  null_count: number | null;
1001
1028
  unique_count: number | null;
1002
1029
  unique_percentage: number | null;
1003
- min_value?: number | null;
1004
- max_value?: number | null;
1005
- avg_value?: number | null;
1006
- median_value?: number | null;
1007
- std_value?: number | null;
1008
- min_date?: string | null;
1009
- max_date?: string | null;
1010
- min_length?: number | null;
1011
- max_length?: number | null;
1012
- avg_length?: number | null;
1013
- } & {
1014
- [key: string]: unknown;
1030
+ min_value?: number | null | undefined;
1031
+ max_value?: number | null | undefined;
1032
+ avg_value?: number | null | undefined;
1033
+ median_value?: number | null | undefined;
1034
+ std_value?: number | null | undefined;
1035
+ min_date?: string | null | undefined;
1036
+ max_date?: string | null | undefined;
1037
+ min_length?: number | null | undefined;
1038
+ max_length?: number | null | undefined;
1039
+ avg_length?: number | null | undefined;
1015
1040
  };
1016
1041
  };
1017
- } & {
1018
- [key: string]: unknown;
1019
1042
  };
1020
1043
  status: string | null;
1021
1044
  is_removed: boolean;
@@ -1068,7 +1091,6 @@ declare const V1FrontendVisualizationSchema: z.ZodObject<{
1068
1091
  type: z.ZodLiteral<"pie">;
1069
1092
  }, z.core.$strip>], "type">;
1070
1093
  created_at: z.ZodString;
1071
- flow_data_id: z.ZodNumber;
1072
1094
  flow_data: z.ZodOptional<z.ZodObject<{
1073
1095
  is_materialized: z.ZodNullable<z.ZodBoolean>;
1074
1096
  last_materialized_at: z.ZodNullable<z.ZodString>;
@@ -1079,6 +1101,7 @@ declare const V1FrontendVisualizationSchema: z.ZodObject<{
1079
1101
  running: "running";
1080
1102
  }>>;
1081
1103
  }, z.core.$strip>>;
1104
+ flow_data_id: z.ZodNumber;
1082
1105
  }, z.core.$strip>;
1083
1106
 
1084
1107
  export declare const Visualization: ForwardRefExoticComponent< {
@@ -1087,22 +1110,13 @@ withTitle: boolean;
1087
1110
  exportingEnabled?: boolean;
1088
1111
  } & RefAttributes<HTMLDivElement>>;
1089
1112
 
1090
- export declare type WebComponentManagedModalProps = ManagedModalProps & {
1113
+ export declare type WebComponentManagedModalProps = StandaloneManagedModalProps & {
1091
1114
  enableCsvDownload: boolean;
1092
1115
  };
1093
1116
 
1094
1117
  export { }
1095
1118
 
1096
1119
 
1097
- declare module "react" {
1098
- namespace JSX {
1099
- interface IntrinsicElements {
1100
- "magemetrics-ai": WebComponentManagedModalProps;
1101
- }
1102
- }
1103
- }
1104
-
1105
-
1106
1120
  declare module "react" {
1107
1121
  namespace JSX {
1108
1122
  interface IntrinsicElements {