@magemetrics/ai 0.0.39 → 0.0.41

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,11 +1,60 @@
1
- import { ComponentPropsWithoutRef } from 'react';
1
+ import { default as default_2 } from 'react';
2
+ import { FormattedData } from '../../../../../shared/src/data/FormattedData';
3
+ import { FrontendFlowColumns } from '../../../../shared/src/schemas/flows';
4
+ import { FrontendFlowData } from '../../../../shared/src/schemas/flows';
2
5
  import { JSX } from 'react/jsx-runtime';
3
6
 
7
+ export declare class ApiService {
8
+ private client;
9
+ constructor(baseUrl: string);
10
+ getRecentFlows: (params: {
11
+ limit?: number;
12
+ }) => Promise<{
13
+ created_at: string;
14
+ id: string;
15
+ request: string;
16
+ user_id: string | null;
17
+ }[]>;
18
+ startFlow: (request: string) => Promise<string>;
19
+ }
20
+
21
+ export declare type CellContentProps = {
22
+ formattedValue: FormattedData | undefined;
23
+ isOpened: boolean;
24
+ unit?: string;
25
+ renderType?: string;
26
+ };
27
+
28
+ declare interface Components {
29
+ dataTableCells?: {
30
+ [key: string]: (props: CellContentProps) => default_2.ReactNode;
31
+ };
32
+ dataReportTable?: (props: DataReportMessageProps) => default_2.ReactNode;
33
+ }
34
+
4
35
  declare type ControlledModalProps = {
5
36
  visible: boolean;
6
37
  onClose: () => void;
7
38
  };
8
39
 
40
+ export declare interface DataReportMessageProps {
41
+ report: FrontendFlowData;
42
+ isOpened: boolean;
43
+ setIsOpened: (opened: boolean) => void;
44
+ infiniteData: {
45
+ data?: {
46
+ pages: unknown[][];
47
+ };
48
+ isPending: boolean;
49
+ fetchNextPage: () => Promise<unknown>;
50
+ isFetching: boolean;
51
+ isFetchingNextPage: boolean;
52
+ hasNextPage: boolean | undefined;
53
+ };
54
+ columns: FrontendFlowColumns;
55
+ totalRows: number;
56
+ }
57
+
9
58
  declare type DisplayControlProps = {
10
59
  showRecommendations?: boolean;
11
60
  showRecentChats?: boolean;
@@ -14,24 +63,43 @@ declare type DisplayControlProps = {
14
63
 
15
64
  export declare const logout: () => Promise<void>;
16
65
 
17
- export declare const MageMetricsModal: (props: MageMetricsModalProps) => JSX.Element;
66
+ export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps>;
18
67
 
19
- declare type MageMetricsModalProps = ComponentPropsWithoutRef<typeof MainModal>;
68
+ export declare interface MageMetricsContextProviderProps {
69
+ children: default_2.ReactNode;
70
+ apiKey?: string;
71
+ externalJwt?: string;
72
+ apiUrl: string;
73
+ experimental_components?: Components;
74
+ }
20
75
 
21
- declare const MainModal: React.FC<{
76
+ export declare const ManagedModal: React.FC<ManagedModalProps>;
77
+
78
+ declare interface ManagedModalProps extends ModalProps {
22
79
  apiKey: string;
23
80
  externalJwt: string;
24
81
  apiUrl: string;
25
- display?: string;
26
82
  persist?: PersistenceOptions;
83
+ experimental_components?: Components;
84
+ }
85
+
86
+ declare interface ModalProps {
87
+ display?: string;
27
88
  modal?: ControlledModalProps;
28
89
  startOptions?: StartOptions;
29
- }>;
90
+ }
91
+
92
+ declare type PersistenceOptions = "queryParam" | "none";
30
93
 
31
- declare type PersistenceOptions = "localStorage" | "queryParam" | "none";
94
+ export declare const StandaloneConversationModal: ({ opened, flowId, onOpenChange, }: {
95
+ opened: boolean;
96
+ flowId: string;
97
+ onOpenChange?: (open: boolean) => void;
98
+ }) => JSX.Element;
32
99
 
33
100
  declare type StartOptions = DisplayControlProps & {
34
101
  label?: string;
102
+ recommendationsLabel?: string;
35
103
  };
36
104
 
37
105
  export { }
@@ -40,7 +108,7 @@ export { }
40
108
  declare module "react" {
41
109
  namespace JSX {
42
110
  interface IntrinsicElements {
43
- "magemetrics-ai": SearchElementAttributes;
111
+ "magemetrics-ai": ManagedModalProps;
44
112
  }
45
113
  }
46
114
  }