@magemetrics/core 0.11.5 → 0.12.0-rc1
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/index.d.ts +187 -9
- package/dist/index.js +178 -39
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Client } from 'openapi-fetch';
|
|
2
|
+
import { default as default_2 } from 'zod';
|
|
2
3
|
import { DefaultChatTransport } from 'ai';
|
|
3
4
|
import { GoTrueClient } from '@supabase/auth-js';
|
|
4
5
|
import { GoTrueClientOptions } from '@supabase/auth-js';
|
|
@@ -427,6 +428,8 @@ declare interface components {
|
|
|
427
428
|
/** @enum {string} */
|
|
428
429
|
model: "claude-haiku-4-5";
|
|
429
430
|
} | null;
|
|
431
|
+
/** @enum {string} */
|
|
432
|
+
execution_platform: "native" | "sandbox" | "sandbox_public";
|
|
430
433
|
master_prompt_name: string | null;
|
|
431
434
|
master_prompt_version: number | null;
|
|
432
435
|
created_at: string;
|
|
@@ -488,6 +491,7 @@ declare const CreateCanvasSchema: z.ZodObject<{
|
|
|
488
491
|
*/
|
|
489
492
|
export declare type CreateFlowParam = {
|
|
490
493
|
query: string;
|
|
494
|
+
uploadedFileIds?: UploadedFileId[];
|
|
491
495
|
} | {
|
|
492
496
|
triggerId: string;
|
|
493
497
|
variables: Record<string, string>;
|
|
@@ -604,6 +608,9 @@ declare const FrontendRecentFlowsSchema: z.ZodObject<{
|
|
|
604
608
|
created_at: z.ZodString;
|
|
605
609
|
application_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
606
610
|
user_id: z.ZodNullable<z.ZodString>;
|
|
611
|
+
context_tokens: z.ZodOptional<z.ZodNumber>;
|
|
612
|
+
acc_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
613
|
+
acc_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
607
614
|
}, z.core.$strip>;
|
|
608
615
|
|
|
609
616
|
export declare const getPublicApiClient: (apiUrl: string, apiKey: string) => Client<PublicPaths>;
|
|
@@ -614,11 +621,6 @@ declare const inputSchema: z.ZodObject<{
|
|
|
614
621
|
rawRequest: z.ZodString;
|
|
615
622
|
userRequest: z.ZodString;
|
|
616
623
|
isNewAnalysisGoal: z.ZodBoolean;
|
|
617
|
-
responseType: z.ZodEnum<{
|
|
618
|
-
text: "text";
|
|
619
|
-
visualization: "visualization";
|
|
620
|
-
table: "table";
|
|
621
|
-
}>;
|
|
622
624
|
difficultyLevel: z.ZodEnum<{
|
|
623
625
|
simple: "simple";
|
|
624
626
|
moderate: "moderate";
|
|
@@ -667,7 +669,7 @@ declare const inputSchema_8: z.ZodObject<{
|
|
|
667
669
|
declare const inputSchema_9: z.ZodObject<{
|
|
668
670
|
questions: z.ZodArray<z.ZodObject<{
|
|
669
671
|
question: z.ZodString;
|
|
670
|
-
header: z.ZodString
|
|
672
|
+
header: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
671
673
|
multiSelect: z.ZodBoolean;
|
|
672
674
|
options: z.ZodArray<z.ZodObject<{
|
|
673
675
|
label: z.ZodString;
|
|
@@ -825,6 +827,9 @@ export declare class MageMetricsClient {
|
|
|
825
827
|
title: string | null;
|
|
826
828
|
user_id: string | null;
|
|
827
829
|
application_id?: number | null | undefined;
|
|
830
|
+
context_tokens?: number | undefined;
|
|
831
|
+
acc_input_tokens?: number | undefined;
|
|
832
|
+
acc_output_tokens?: number | undefined;
|
|
828
833
|
}>;
|
|
829
834
|
getRecentFlows: (params?: {
|
|
830
835
|
limit?: number;
|
|
@@ -832,6 +837,13 @@ export declare class MageMetricsClient {
|
|
|
832
837
|
createFlow: (request: CreateFlowParam) => Promise<{
|
|
833
838
|
flowId: string;
|
|
834
839
|
}>;
|
|
840
|
+
uploadFile: (file: File, flowId?: string) => Promise<{
|
|
841
|
+
uploadedFileId: string;
|
|
842
|
+
filename: string;
|
|
843
|
+
mediaType: string;
|
|
844
|
+
sizeBytes: number;
|
|
845
|
+
}>;
|
|
846
|
+
deleteUploadedFile: (uploadedFileId: string) => Promise<void>;
|
|
835
847
|
canvas: {
|
|
836
848
|
list: (query?: string) => Promise<{
|
|
837
849
|
id: string;
|
|
@@ -846,6 +858,9 @@ export declare class MageMetricsClient {
|
|
|
846
858
|
title: string | null;
|
|
847
859
|
user_id: string | null;
|
|
848
860
|
application_id?: number | null | undefined;
|
|
861
|
+
context_tokens?: number | undefined;
|
|
862
|
+
acc_input_tokens?: number | undefined;
|
|
863
|
+
acc_output_tokens?: number | undefined;
|
|
849
864
|
}[];
|
|
850
865
|
}[]>;
|
|
851
866
|
get: (canvasId: string) => Promise<{
|
|
@@ -899,6 +914,11 @@ export declare class MageMetricsClient {
|
|
|
899
914
|
[x: string]: unknown;
|
|
900
915
|
}[]>;
|
|
901
916
|
}>;
|
|
917
|
+
getRecommendations: (count: number) => Promise<{
|
|
918
|
+
starter: string;
|
|
919
|
+
explanation: string;
|
|
920
|
+
type: string;
|
|
921
|
+
}[]>;
|
|
902
922
|
};
|
|
903
923
|
client(): PublicApiClient;
|
|
904
924
|
private createSupabaseHeaderMiddleware;
|
|
@@ -1347,6 +1367,9 @@ declare interface operations {
|
|
|
1347
1367
|
title: string | null;
|
|
1348
1368
|
user_id: string | null;
|
|
1349
1369
|
application_id?: number | null;
|
|
1370
|
+
context_tokens?: number;
|
|
1371
|
+
acc_input_tokens?: number;
|
|
1372
|
+
acc_output_tokens?: number;
|
|
1350
1373
|
};
|
|
1351
1374
|
};
|
|
1352
1375
|
};
|
|
@@ -1400,6 +1423,9 @@ declare interface operations {
|
|
|
1400
1423
|
title: string | null;
|
|
1401
1424
|
user_id: string | null;
|
|
1402
1425
|
application_id?: number | null;
|
|
1426
|
+
context_tokens?: number;
|
|
1427
|
+
acc_input_tokens?: number;
|
|
1428
|
+
acc_output_tokens?: number;
|
|
1403
1429
|
}[];
|
|
1404
1430
|
};
|
|
1405
1431
|
};
|
|
@@ -1689,13 +1715,13 @@ declare interface operations {
|
|
|
1689
1715
|
}[];
|
|
1690
1716
|
};
|
|
1691
1717
|
} | null;
|
|
1692
|
-
confidence_score
|
|
1693
|
-
confidence_score_reason
|
|
1718
|
+
confidence_score?: number;
|
|
1719
|
+
confidence_score_reason?: string;
|
|
1694
1720
|
assumptions_score?: number;
|
|
1695
1721
|
assumptions_score_reason?: string;
|
|
1722
|
+
flow_data_id: number;
|
|
1696
1723
|
friendliness_score?: number;
|
|
1697
1724
|
friendliness_score_reason?: string;
|
|
1698
|
-
flow_data_id: number;
|
|
1699
1725
|
output_dataset?: string;
|
|
1700
1726
|
sql?: string;
|
|
1701
1727
|
};
|
|
@@ -2144,6 +2170,14 @@ declare interface operations {
|
|
|
2144
2170
|
"application/json": {
|
|
2145
2171
|
userQuery: string;
|
|
2146
2172
|
applicationName?: string;
|
|
2173
|
+
files?: {
|
|
2174
|
+
/** @enum {string} */
|
|
2175
|
+
type: "file";
|
|
2176
|
+
mediaType: string;
|
|
2177
|
+
filename?: string;
|
|
2178
|
+
url: string;
|
|
2179
|
+
}[];
|
|
2180
|
+
uploadedFileIds?: string[];
|
|
2147
2181
|
};
|
|
2148
2182
|
};
|
|
2149
2183
|
};
|
|
@@ -2937,6 +2971,9 @@ declare interface operations {
|
|
|
2937
2971
|
title: string | null;
|
|
2938
2972
|
user_id: string | null;
|
|
2939
2973
|
application_id?: number | null;
|
|
2974
|
+
context_tokens?: number;
|
|
2975
|
+
acc_input_tokens?: number;
|
|
2976
|
+
acc_output_tokens?: number;
|
|
2940
2977
|
}[];
|
|
2941
2978
|
}[];
|
|
2942
2979
|
};
|
|
@@ -3250,6 +3287,11 @@ declare interface operations {
|
|
|
3250
3287
|
/** @enum {string} */
|
|
3251
3288
|
model: "claude-haiku-4-5";
|
|
3252
3289
|
};
|
|
3290
|
+
/**
|
|
3291
|
+
* @default native
|
|
3292
|
+
* @enum {string}
|
|
3293
|
+
*/
|
|
3294
|
+
execution_platform?: "native" | "sandbox" | "sandbox_public";
|
|
3253
3295
|
master_prompt_name?: string;
|
|
3254
3296
|
master_prompt_version?: number;
|
|
3255
3297
|
};
|
|
@@ -3404,6 +3446,8 @@ declare interface operations {
|
|
|
3404
3446
|
/** @enum {string} */
|
|
3405
3447
|
model: "claude-haiku-4-5";
|
|
3406
3448
|
} | null;
|
|
3449
|
+
/** @enum {string} */
|
|
3450
|
+
execution_platform?: "native" | "sandbox" | "sandbox_public";
|
|
3407
3451
|
master_prompt_name?: string | null;
|
|
3408
3452
|
master_prompt_version?: number | null;
|
|
3409
3453
|
};
|
|
@@ -5109,6 +5153,119 @@ declare interface operations {
|
|
|
5109
5153
|
};
|
|
5110
5154
|
};
|
|
5111
5155
|
};
|
|
5156
|
+
generateDataReport: {
|
|
5157
|
+
parameters: {
|
|
5158
|
+
query?: never;
|
|
5159
|
+
header?: {
|
|
5160
|
+
"sp-access-token"?: string;
|
|
5161
|
+
};
|
|
5162
|
+
path?: never;
|
|
5163
|
+
cookie?: never;
|
|
5164
|
+
};
|
|
5165
|
+
requestBody: {
|
|
5166
|
+
content: {
|
|
5167
|
+
"application/json": {
|
|
5168
|
+
/** @description The natural language data request */
|
|
5169
|
+
request: string;
|
|
5170
|
+
};
|
|
5171
|
+
};
|
|
5172
|
+
};
|
|
5173
|
+
responses: {
|
|
5174
|
+
/** @description Data report generated successfully */
|
|
5175
|
+
200: {
|
|
5176
|
+
headers: {
|
|
5177
|
+
[name: string]: unknown;
|
|
5178
|
+
};
|
|
5179
|
+
content: {
|
|
5180
|
+
"application/json": {
|
|
5181
|
+
/** @enum {string} */
|
|
5182
|
+
status: "success";
|
|
5183
|
+
generation_id: string;
|
|
5184
|
+
sql: string;
|
|
5185
|
+
title: string | null;
|
|
5186
|
+
goal: string | null;
|
|
5187
|
+
view_name: string | null;
|
|
5188
|
+
view_schema: string | null;
|
|
5189
|
+
data_sample: {
|
|
5190
|
+
[key: string]: unknown;
|
|
5191
|
+
}[] | null;
|
|
5192
|
+
data_summary: {
|
|
5193
|
+
[key: string]: unknown;
|
|
5194
|
+
} | null;
|
|
5195
|
+
is_sample: boolean;
|
|
5196
|
+
};
|
|
5197
|
+
};
|
|
5198
|
+
};
|
|
5199
|
+
/** @description Invalid request */
|
|
5200
|
+
400: {
|
|
5201
|
+
headers: {
|
|
5202
|
+
[name: string]: unknown;
|
|
5203
|
+
};
|
|
5204
|
+
content: {
|
|
5205
|
+
"application/json": {
|
|
5206
|
+
error: string;
|
|
5207
|
+
};
|
|
5208
|
+
};
|
|
5209
|
+
};
|
|
5210
|
+
/** @description Service account authentication required */
|
|
5211
|
+
403: {
|
|
5212
|
+
headers: {
|
|
5213
|
+
[name: string]: unknown;
|
|
5214
|
+
};
|
|
5215
|
+
content: {
|
|
5216
|
+
"application/json": {
|
|
5217
|
+
error: string;
|
|
5218
|
+
};
|
|
5219
|
+
};
|
|
5220
|
+
};
|
|
5221
|
+
/** @description SQL generation failed */
|
|
5222
|
+
422: {
|
|
5223
|
+
headers: {
|
|
5224
|
+
[name: string]: unknown;
|
|
5225
|
+
};
|
|
5226
|
+
content: {
|
|
5227
|
+
"application/json": {
|
|
5228
|
+
/** @enum {string} */
|
|
5229
|
+
status: "error";
|
|
5230
|
+
error: string;
|
|
5231
|
+
error_info?: {
|
|
5232
|
+
error_message: string;
|
|
5233
|
+
/** @enum {string} */
|
|
5234
|
+
category: "timeout" | "connection_error" | "auth_error" | "resource_exhausted" | "table_not_found" | "column_not_found" | "schema_not_found" | "view_not_found" | "function_not_found" | "syntax_error" | "ambiguous_column" | "type_mismatch" | "invalid_cast" | "invalid_argument" | "division_by_zero" | "constraint_violation" | "permission_denied" | "unknown";
|
|
5235
|
+
details?: string | null;
|
|
5236
|
+
hint?: string | null;
|
|
5237
|
+
line_num?: number | null;
|
|
5238
|
+
col_num?: number | null;
|
|
5239
|
+
} | null;
|
|
5240
|
+
failed_sql?: string | null;
|
|
5241
|
+
};
|
|
5242
|
+
};
|
|
5243
|
+
};
|
|
5244
|
+
/** @description Rate limit exceeded for this API key */
|
|
5245
|
+
429: {
|
|
5246
|
+
headers: {
|
|
5247
|
+
[name: string]: unknown;
|
|
5248
|
+
};
|
|
5249
|
+
content: {
|
|
5250
|
+
"application/json": {
|
|
5251
|
+
error: string;
|
|
5252
|
+
retry_after_ms: number;
|
|
5253
|
+
};
|
|
5254
|
+
};
|
|
5255
|
+
};
|
|
5256
|
+
/** @description Internal server error */
|
|
5257
|
+
500: {
|
|
5258
|
+
headers: {
|
|
5259
|
+
[name: string]: unknown;
|
|
5260
|
+
};
|
|
5261
|
+
content: {
|
|
5262
|
+
"application/json": {
|
|
5263
|
+
error: string;
|
|
5264
|
+
};
|
|
5265
|
+
};
|
|
5266
|
+
};
|
|
5267
|
+
};
|
|
5268
|
+
};
|
|
5112
5269
|
}
|
|
5113
5270
|
|
|
5114
5271
|
declare type PatchParam<T, Config extends RemoveParamsConfig, P extends keyof Config> = Simplify<T extends {
|
|
@@ -5873,6 +6030,22 @@ declare interface paths {
|
|
|
5873
6030
|
patch: operations["updateTableColumn"];
|
|
5874
6031
|
trace?: never;
|
|
5875
6032
|
};
|
|
6033
|
+
"/api/v1/data-reports/generate": {
|
|
6034
|
+
parameters: {
|
|
6035
|
+
query?: never;
|
|
6036
|
+
header?: never;
|
|
6037
|
+
path?: never;
|
|
6038
|
+
cookie?: never;
|
|
6039
|
+
};
|
|
6040
|
+
get?: never;
|
|
6041
|
+
put?: never;
|
|
6042
|
+
post: operations["generateDataReport"];
|
|
6043
|
+
delete?: never;
|
|
6044
|
+
options?: never;
|
|
6045
|
+
head?: never;
|
|
6046
|
+
patch?: never;
|
|
6047
|
+
trace?: never;
|
|
6048
|
+
};
|
|
5876
6049
|
}
|
|
5877
6050
|
|
|
5878
6051
|
declare type PublicApiClient = Simplify<Client<PublicPaths, `${string}/${string}`>>;
|
|
@@ -6122,4 +6295,9 @@ declare const UpdateCanvasSchema: z.ZodObject<{
|
|
|
6122
6295
|
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
6123
6296
|
}, z.core.$strip>;
|
|
6124
6297
|
|
|
6298
|
+
/** A previously uploaded file identifier to attach to the first message of a flow. */
|
|
6299
|
+
declare type UploadedFileId = default_2.infer<typeof UploadedFileIdSchema>;
|
|
6300
|
+
|
|
6301
|
+
declare const UploadedFileIdSchema: z.ZodUUID;
|
|
6302
|
+
|
|
6125
6303
|
export { }
|