@magemetrics/ai 0.0.41 → 0.0.43
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.
- package/dist/react/ai.js +19262 -3279
- package/dist/react/index.d.ts +161 -7
- package/dist/styles.css +1 -1
- package/dist/web-component/{browser-DNMMRdAD.js → browser-w1PBQiWa.js} +1 -1
- package/dist/web-component/web-component-t8s5LBp8.js +103777 -0
- package/dist/web-component/web-component.es.d.ts +3 -3
- package/dist/web-component/web-component.es.js +1 -1
- package/package.json +1 -2
- package/dist/web-component/web-component-DMzWg4-A.js +0 -83114
package/dist/react/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { FrontendFlowColumns } from '../../../../shared/src/schemas/flows';
|
|
4
|
-
import { FrontendFlowData } from '../../../../shared/src/schemas/flows';
|
|
5
|
-
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { z } from 'zod';
|
|
6
3
|
|
|
7
4
|
export declare class ApiService {
|
|
8
5
|
private client;
|
|
@@ -25,7 +22,7 @@ export declare type CellContentProps = {
|
|
|
25
22
|
renderType?: string;
|
|
26
23
|
};
|
|
27
24
|
|
|
28
|
-
declare interface Components {
|
|
25
|
+
export declare interface Components {
|
|
29
26
|
dataTableCells?: {
|
|
30
27
|
[key: string]: (props: CellContentProps) => default_2.ReactNode;
|
|
31
28
|
};
|
|
@@ -61,6 +58,161 @@ declare type DisplayControlProps = {
|
|
|
61
58
|
showBackdrop?: boolean;
|
|
62
59
|
};
|
|
63
60
|
|
|
61
|
+
/**
|
|
62
|
+
* This module handles the formatting and normalization of table cell values for display and sorting.
|
|
63
|
+
*
|
|
64
|
+
* Problem:
|
|
65
|
+
* When displaying data in tables, we often receive values in various formats (strings, dates,
|
|
66
|
+
* JSON objects, etc.). We need to:
|
|
67
|
+
* 1. Display these values in a consistent, human-readable format
|
|
68
|
+
* 2. Enable proper sorting of these values regardless of their original format
|
|
69
|
+
*
|
|
70
|
+
* Solution:
|
|
71
|
+
* The FormattedData type and formatCellValue function transform any input value into a
|
|
72
|
+
* standardized format with two properties:
|
|
73
|
+
* - display: A string representation suitable for rendering
|
|
74
|
+
* - sortValue: A normalized value (string/number/date) suitable for consistent sorting
|
|
75
|
+
*
|
|
76
|
+
* The module handles various special cases:
|
|
77
|
+
* - JSON strings (parsing them to extract actual values)
|
|
78
|
+
* - Date/time values (converting to consistent format)
|
|
79
|
+
* - BigQuery-style objects with 'value' property
|
|
80
|
+
* - Nested objects (pretty-printing them)
|
|
81
|
+
* - Null/undefined values
|
|
82
|
+
*/
|
|
83
|
+
declare type FormattedData = {
|
|
84
|
+
display: (string & {}) | "empty" | null;
|
|
85
|
+
sortValue: string | number | Date | null;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
declare type FrontendFlowColumns = z.infer<typeof FrontendFlowColumnsSchema>;
|
|
89
|
+
|
|
90
|
+
declare const FrontendFlowColumnsSchema: z.ZodArray<z.ZodObject<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
data_type: z.ZodString;
|
|
93
|
+
} & {
|
|
94
|
+
dataType: z.ZodString;
|
|
95
|
+
renderType: z.ZodOptional<z.ZodString>;
|
|
96
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
name: string;
|
|
99
|
+
data_type: string;
|
|
100
|
+
dataType: string;
|
|
101
|
+
unit?: string | undefined;
|
|
102
|
+
renderType?: string | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
name: string;
|
|
105
|
+
data_type: string;
|
|
106
|
+
dataType: string;
|
|
107
|
+
unit?: string | undefined;
|
|
108
|
+
renderType?: string | undefined;
|
|
109
|
+
}>, "many">;
|
|
110
|
+
|
|
111
|
+
declare type FrontendFlowData = z.infer<typeof FrontendFlowDataSchema>;
|
|
112
|
+
|
|
113
|
+
declare const FrontendFlowDataSchema: z.ZodObject<Omit<{
|
|
114
|
+
created_at: z.ZodString;
|
|
115
|
+
flow_id: z.ZodString;
|
|
116
|
+
id: z.ZodNumber;
|
|
117
|
+
is_sample: z.ZodBoolean;
|
|
118
|
+
schema: z.ZodString;
|
|
119
|
+
sql: z.ZodString;
|
|
120
|
+
table: z.ZodString;
|
|
121
|
+
title: z.ZodString;
|
|
122
|
+
data_sample: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
123
|
+
data_summary: z.ZodObject<{
|
|
124
|
+
columns: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
125
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
data_type: z.ZodString;
|
|
127
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
128
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
129
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
130
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
131
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
data_type: z.ZodString;
|
|
133
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
134
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
135
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
136
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
137
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
data_type: z.ZodString;
|
|
139
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
140
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
141
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
142
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
143
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
144
|
+
columns: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
145
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
data_type: z.ZodString;
|
|
147
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
148
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
149
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
150
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
151
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
data_type: z.ZodString;
|
|
153
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
154
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
155
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
156
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
157
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
data_type: z.ZodString;
|
|
159
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
160
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
161
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
162
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
163
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
164
|
+
columns: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
165
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
data_type: z.ZodString;
|
|
167
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
168
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
169
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
170
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
171
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
data_type: z.ZodString;
|
|
173
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
174
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
175
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
176
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
177
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
data_type: z.ZodString;
|
|
179
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
180
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
181
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
182
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
183
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
184
|
+
}, "schema" | "sql" | "table" | "created_at" | "is_sample" | "data_sample">, "strip", z.ZodTypeAny, {
|
|
185
|
+
title: string;
|
|
186
|
+
id: number;
|
|
187
|
+
flow_id: string;
|
|
188
|
+
data_summary: {
|
|
189
|
+
columns: Record<string, z.objectOutputType<{
|
|
190
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
data_type: z.ZodString;
|
|
192
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
193
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
194
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
195
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
196
|
+
} & {
|
|
197
|
+
[k: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
}, {
|
|
200
|
+
title: string;
|
|
201
|
+
id: number;
|
|
202
|
+
flow_id: string;
|
|
203
|
+
data_summary: {
|
|
204
|
+
columns: Record<string, z.objectInputType<{
|
|
205
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
data_type: z.ZodString;
|
|
207
|
+
null_count: z.ZodNullable<z.ZodNumber>;
|
|
208
|
+
unique_count: z.ZodNullable<z.ZodNumber>;
|
|
209
|
+
unique_percentage: z.ZodNullable<z.ZodNumber>;
|
|
210
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
211
|
+
} & {
|
|
212
|
+
[k: string]: unknown;
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
|
|
64
216
|
export declare const logout: () => Promise<void>;
|
|
65
217
|
|
|
66
218
|
export declare const MageMetricsContextProvider: default_2.FC<MageMetricsContextProviderProps>;
|
|
@@ -91,11 +243,13 @@ declare interface ModalProps {
|
|
|
91
243
|
|
|
92
244
|
declare type PersistenceOptions = "queryParam" | "none";
|
|
93
245
|
|
|
94
|
-
export declare const StandaloneConversationModal:
|
|
246
|
+
export declare const StandaloneConversationModal: React.FC<StandaloneConversationModalProps>;
|
|
247
|
+
|
|
248
|
+
declare type StandaloneConversationModalProps = {
|
|
95
249
|
opened: boolean;
|
|
96
250
|
flowId: string;
|
|
97
251
|
onOpenChange?: (open: boolean) => void;
|
|
98
|
-
}
|
|
252
|
+
};
|
|
99
253
|
|
|
100
254
|
declare type StartOptions = DisplayControlProps & {
|
|
101
255
|
label?: string;
|