@magemetrics/core 0.5.3 → 0.6.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.
- package/dist/index.d.ts +589 -100
- package/dist/index.js +1253 -1467
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Client } from 'openapi-fetch';
|
|
2
2
|
import { DefaultChatTransport } from 'ai';
|
|
3
|
+
import { GoTrueClient } from '@supabase/auth-js';
|
|
3
4
|
import { GoTrueClientOptions } from '@supabase/auth-js';
|
|
4
5
|
import { HttpChatTransportInitOptions } from 'ai';
|
|
5
6
|
import type { InferUITool } from 'ai';
|
|
@@ -63,6 +64,54 @@ declare interface AsyncStorage_2 {
|
|
|
63
64
|
removeItem(key: string): Promise<void>;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Authentication provider interface for MageMetrics client.
|
|
69
|
+
* Providers handle token management and header generation.
|
|
70
|
+
*/
|
|
71
|
+
export declare interface AuthProvider {
|
|
72
|
+
/**
|
|
73
|
+
* Initialize the auth provider and perform any necessary setup.
|
|
74
|
+
*/
|
|
75
|
+
initialize(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Get authentication headers to include in API requests.
|
|
78
|
+
*/
|
|
79
|
+
getHeaders(): Promise<Record<string, string>>;
|
|
80
|
+
/**
|
|
81
|
+
* Get the current authentication state.
|
|
82
|
+
*/
|
|
83
|
+
getState(): AuthState;
|
|
84
|
+
/**
|
|
85
|
+
* Update the external JWT (if applicable).
|
|
86
|
+
*/
|
|
87
|
+
updateExternalJwt(jwt: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Logout and clear any stored tokens.
|
|
90
|
+
*/
|
|
91
|
+
logout(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Get the Supabase client (if available).
|
|
94
|
+
* Used for backward compatibility with existing code.
|
|
95
|
+
*/
|
|
96
|
+
getSupabaseClient(): GoTrueClient | null;
|
|
97
|
+
/**
|
|
98
|
+
* Add an event listener for auth events.
|
|
99
|
+
* @param type the type of the event
|
|
100
|
+
* @param listener the listener to add
|
|
101
|
+
* @param options options for the event listener
|
|
102
|
+
* @param options.signal an AbortSignal to remove the listener when aborted
|
|
103
|
+
*/
|
|
104
|
+
addEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>, options?: {
|
|
105
|
+
signal?: AbortSignal;
|
|
106
|
+
}): void;
|
|
107
|
+
/**
|
|
108
|
+
* Remove an event listener.
|
|
109
|
+
* @param type the type of the event
|
|
110
|
+
* @param listener the listener to remove
|
|
111
|
+
*/
|
|
112
|
+
removeEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>): void;
|
|
113
|
+
}
|
|
114
|
+
|
|
66
115
|
/**
|
|
67
116
|
* Authentication states
|
|
68
117
|
*/
|
|
@@ -107,6 +156,13 @@ declare interface components {
|
|
|
107
156
|
flow_data_id: number;
|
|
108
157
|
created_at: string;
|
|
109
158
|
bookmarked: boolean;
|
|
159
|
+
flow_data?: {
|
|
160
|
+
is_materialized: boolean | null;
|
|
161
|
+
last_materialized_at: string | null;
|
|
162
|
+
materialized_error_message: string | null;
|
|
163
|
+
/** @enum {string|null} */
|
|
164
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
165
|
+
};
|
|
110
166
|
configuration: {
|
|
111
167
|
/** @enum {string} */
|
|
112
168
|
type: "bar";
|
|
@@ -168,6 +224,13 @@ declare interface components {
|
|
|
168
224
|
flow_data_id: number;
|
|
169
225
|
created_at: string;
|
|
170
226
|
bookmarked: boolean;
|
|
227
|
+
flow_data?: {
|
|
228
|
+
is_materialized: boolean | null;
|
|
229
|
+
last_materialized_at: string | null;
|
|
230
|
+
materialized_error_message: string | null;
|
|
231
|
+
/** @enum {string|null} */
|
|
232
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
233
|
+
};
|
|
171
234
|
configuration: {
|
|
172
235
|
/** @enum {string} */
|
|
173
236
|
type: "bar";
|
|
@@ -254,13 +317,104 @@ export declare type CreateFlowParam = {
|
|
|
254
317
|
};
|
|
255
318
|
|
|
256
319
|
declare type CustomDataParts = {
|
|
257
|
-
"quick-actions":
|
|
258
|
-
signal:
|
|
320
|
+
"quick-actions": QuickActions;
|
|
321
|
+
signal: SignalWithReportId;
|
|
259
322
|
"node-added": {
|
|
260
323
|
node: NodeBase;
|
|
261
324
|
};
|
|
262
325
|
};
|
|
263
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Direct authentication provider that uses a Supabase JWT directly
|
|
329
|
+
* without going through the token exchange flow.
|
|
330
|
+
*
|
|
331
|
+
* This provider:
|
|
332
|
+
* - Does NOT create shadow users
|
|
333
|
+
* - Does NOT call the exchange endpoint
|
|
334
|
+
* - Simply returns the JWT in headers for backend validation
|
|
335
|
+
* - Preserves the original user's roles and permissions
|
|
336
|
+
*
|
|
337
|
+
* Use this for internal admin tools where you already have a valid
|
|
338
|
+
* Supabase JWT and want to bypass the external auth flow.
|
|
339
|
+
* @example
|
|
340
|
+
* ```typescript
|
|
341
|
+
* const authProvider = new DirectAuthProvider(internalUserJwt);
|
|
342
|
+
* const client = new MageMetricsClient(config, authProvider);
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
export declare class DirectAuthProvider implements AuthProvider {
|
|
346
|
+
private state;
|
|
347
|
+
private jwt;
|
|
348
|
+
private events;
|
|
349
|
+
constructor(jwt: string);
|
|
350
|
+
initialize(): Promise<void>;
|
|
351
|
+
getHeaders(): Promise<Record<string, string>>;
|
|
352
|
+
getState(): AuthState;
|
|
353
|
+
updateExternalJwt(jwt: string): Promise<void>;
|
|
354
|
+
logout(): Promise<void>;
|
|
355
|
+
getSupabaseClient(): GoTrueClient | null;
|
|
356
|
+
addEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>, options?: {
|
|
357
|
+
signal?: AbortSignal;
|
|
358
|
+
}): void;
|
|
359
|
+
removeEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>): void;
|
|
360
|
+
private setState;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* External authentication provider that handles the full token exchange flow.
|
|
365
|
+
*
|
|
366
|
+
* This provider:
|
|
367
|
+
* - Calls the exchange endpoint to create shadow users
|
|
368
|
+
* - Manages Supabase sessions
|
|
369
|
+
* - Handles token refresh
|
|
370
|
+
* - Supports auto-refresh and session management
|
|
371
|
+
*
|
|
372
|
+
* This is the default provider used for external customer integrations.
|
|
373
|
+
*/
|
|
374
|
+
export declare class ExternalAuthProvider implements AuthProvider {
|
|
375
|
+
private config;
|
|
376
|
+
private state;
|
|
377
|
+
private supabaseClient;
|
|
378
|
+
private noAuthApiClient;
|
|
379
|
+
private authApiResponse;
|
|
380
|
+
private processedJwt;
|
|
381
|
+
private userId;
|
|
382
|
+
private events;
|
|
383
|
+
constructor(config: ExternalAuthProviderConfig);
|
|
384
|
+
initialize(): Promise<void>;
|
|
385
|
+
getHeaders(): Promise<Record<string, string>>;
|
|
386
|
+
getState(): AuthState;
|
|
387
|
+
updateExternalJwt(jwt: string): Promise<void>;
|
|
388
|
+
logout(): Promise<void>;
|
|
389
|
+
getSupabaseClient(): GoTrueClient | null;
|
|
390
|
+
addEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>, options?: {
|
|
391
|
+
signal?: AbortSignal;
|
|
392
|
+
}): void;
|
|
393
|
+
removeEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>): void;
|
|
394
|
+
startAutoRefresh(): Promise<void> | undefined;
|
|
395
|
+
stopAutoRefresh(): Promise<void> | undefined;
|
|
396
|
+
private getApiInformation;
|
|
397
|
+
private initializeSupabaseClient;
|
|
398
|
+
private handleAuthentication;
|
|
399
|
+
private exchangeExternalToken;
|
|
400
|
+
private setState;
|
|
401
|
+
private encodeCheckKey;
|
|
402
|
+
private saveCheckKey;
|
|
403
|
+
private compareCheckKey;
|
|
404
|
+
private clearCheckKey;
|
|
405
|
+
private clearStorage;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export declare interface ExternalAuthProviderConfig {
|
|
409
|
+
apiUrl: string;
|
|
410
|
+
apiKey: string;
|
|
411
|
+
externalJwt?: string;
|
|
412
|
+
additionalHeaders?: Record<string, string>;
|
|
413
|
+
storage: AsyncStorage_2;
|
|
414
|
+
applicationName?: string;
|
|
415
|
+
authOptions?: Pick<GoTrueClientOptions, "fetch">;
|
|
416
|
+
}
|
|
417
|
+
|
|
264
418
|
declare type ExtractInsightResponse = z.infer<typeof ExtractInsightResponseSchema>;
|
|
265
419
|
|
|
266
420
|
declare const ExtractInsightResponseSchema: z.ZodUnion<[z.ZodObject<{
|
|
@@ -291,6 +445,8 @@ export declare type GenerateInsightParam = {
|
|
|
291
445
|
|
|
292
446
|
export declare const getPublicApiClient: (apiUrl: string, apiKey: string) => Client<NoAuthPaths>;
|
|
293
447
|
|
|
448
|
+
declare const HEADER_SP_TOKEN: "sp-access-token";
|
|
449
|
+
|
|
294
450
|
declare const inputSchema: z.ZodObject<{
|
|
295
451
|
userRequest: z.ZodString;
|
|
296
452
|
isNewAnalysisGoal: z.ZodBoolean;
|
|
@@ -351,18 +507,10 @@ declare type MageMetricsChatTransportOptions = Omit<HttpChatTransportInitOptions
|
|
|
351
507
|
*/
|
|
352
508
|
export declare class MageMetricsClient {
|
|
353
509
|
private config;
|
|
354
|
-
private
|
|
355
|
-
private supabaseClient;
|
|
510
|
+
private authProvider;
|
|
356
511
|
private internalApiClient;
|
|
357
|
-
private noAuthApiClient;
|
|
358
|
-
private authApiResponse;
|
|
359
512
|
private authPromise;
|
|
360
|
-
|
|
361
|
-
private userId;
|
|
362
|
-
private storageAdapter;
|
|
363
|
-
private events;
|
|
364
|
-
private authOptions;
|
|
365
|
-
constructor(config: MageMetricsClientConfig, auth?: Pick<GoTrueClientOptions, "fetch">);
|
|
513
|
+
constructor(config: MageMetricsClientConfig, authProviderOrAuthOptions?: AuthProvider | Pick<GoTrueClientOptions, "fetch">);
|
|
366
514
|
toJSON(): {
|
|
367
515
|
config: string;
|
|
368
516
|
};
|
|
@@ -390,7 +538,6 @@ export declare class MageMetricsClient {
|
|
|
390
538
|
updateExternalJwt(jwt: string): Promise<void>;
|
|
391
539
|
get state(): AuthState;
|
|
392
540
|
getHeaders(): Promise<Record<string, string>>;
|
|
393
|
-
private clearStorage;
|
|
394
541
|
logout(): Promise<void>;
|
|
395
542
|
auth: {
|
|
396
543
|
startAutoRefresh: () => Promise<void> | undefined;
|
|
@@ -405,6 +552,12 @@ export declare class MageMetricsClient {
|
|
|
405
552
|
flow_data_id: number;
|
|
406
553
|
created_at: string;
|
|
407
554
|
bookmarked: boolean;
|
|
555
|
+
flow_data?: {
|
|
556
|
+
is_materialized: boolean | null;
|
|
557
|
+
last_materialized_at: string | null;
|
|
558
|
+
materialized_error_message: string | null;
|
|
559
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
560
|
+
};
|
|
408
561
|
configuration: {
|
|
409
562
|
type: "bar";
|
|
410
563
|
title: string;
|
|
@@ -460,6 +613,16 @@ export declare class MageMetricsClient {
|
|
|
460
613
|
null_count: number | null;
|
|
461
614
|
unique_count: number | null;
|
|
462
615
|
unique_percentage: number | null;
|
|
616
|
+
min_value?: number | null;
|
|
617
|
+
max_value?: number | null;
|
|
618
|
+
avg_value?: number | null;
|
|
619
|
+
median_value?: number | null;
|
|
620
|
+
std_value?: number | null;
|
|
621
|
+
min_date?: string | null;
|
|
622
|
+
max_date?: string | null;
|
|
623
|
+
min_length?: number | null;
|
|
624
|
+
max_length?: number | null;
|
|
625
|
+
avg_length?: number | null;
|
|
463
626
|
} & {
|
|
464
627
|
[key: string]: unknown;
|
|
465
628
|
};
|
|
@@ -470,6 +633,10 @@ export declare class MageMetricsClient {
|
|
|
470
633
|
bookmarked: boolean;
|
|
471
634
|
status: string | null;
|
|
472
635
|
is_removed: boolean;
|
|
636
|
+
is_materialized: boolean | null;
|
|
637
|
+
last_materialized_at: string | null;
|
|
638
|
+
materialized_error_message: string | null;
|
|
639
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
473
640
|
}[]>;
|
|
474
641
|
getFlow: (flowId: string) => Promise<{
|
|
475
642
|
created_at: string;
|
|
@@ -553,27 +720,8 @@ export declare class MageMetricsClient {
|
|
|
553
720
|
}[]>;
|
|
554
721
|
}>;
|
|
555
722
|
};
|
|
556
|
-
/**
|
|
557
|
-
* Perform the complete authentication flow
|
|
558
|
-
*/
|
|
559
|
-
private performAuthFlow;
|
|
560
|
-
private getApiInformation;
|
|
561
|
-
private initializeSupabaseClient;
|
|
562
723
|
client(): InternalApiClient;
|
|
563
|
-
/**
|
|
564
|
-
* Handle the authentication logic (check session or exchange token)
|
|
565
|
-
*/
|
|
566
|
-
private handleAuthentication;
|
|
567
|
-
/**
|
|
568
|
-
* Exchange external JWT for Supabase tokens
|
|
569
|
-
*/
|
|
570
|
-
private exchangeExternalToken;
|
|
571
724
|
private createSupabaseHeaderMiddleware;
|
|
572
|
-
private setState;
|
|
573
|
-
private encodeCheckKey;
|
|
574
|
-
saveCheckKey(externalJwt: string, apiKey: string): Promise<void>;
|
|
575
|
-
compareCheckKey(externalJwt: string, apiKey: string): Promise<boolean>;
|
|
576
|
-
clearCheckKey(): Promise<void>;
|
|
577
725
|
}
|
|
578
726
|
|
|
579
727
|
/**
|
|
@@ -997,49 +1145,6 @@ declare interface operations {
|
|
|
997
1145
|
};
|
|
998
1146
|
};
|
|
999
1147
|
};
|
|
1000
|
-
runEnd2EndFlow: {
|
|
1001
|
-
parameters: {
|
|
1002
|
-
query?: never;
|
|
1003
|
-
header: {
|
|
1004
|
-
"sp-access-token": string;
|
|
1005
|
-
};
|
|
1006
|
-
path?: never;
|
|
1007
|
-
cookie?: never;
|
|
1008
|
-
};
|
|
1009
|
-
requestBody: {
|
|
1010
|
-
content: {
|
|
1011
|
-
"application/json": {
|
|
1012
|
-
userQuery: string;
|
|
1013
|
-
/** @default true */
|
|
1014
|
-
isNewAnalysisGoal?: boolean;
|
|
1015
|
-
/**
|
|
1016
|
-
* @default complex
|
|
1017
|
-
* @enum {string}
|
|
1018
|
-
*/
|
|
1019
|
-
difficultyLevel?: "simple" | "moderate" | "complex";
|
|
1020
|
-
};
|
|
1021
|
-
};
|
|
1022
|
-
};
|
|
1023
|
-
responses: {
|
|
1024
|
-
/** @description Run the end2end flow */
|
|
1025
|
-
200: {
|
|
1026
|
-
headers: {
|
|
1027
|
-
[name: string]: unknown;
|
|
1028
|
-
};
|
|
1029
|
-
content: {
|
|
1030
|
-
"application/json": {
|
|
1031
|
-
/** @enum {string} */
|
|
1032
|
-
status: "error";
|
|
1033
|
-
error: string;
|
|
1034
|
-
} | {
|
|
1035
|
-
/** @enum {string} */
|
|
1036
|
-
status: "success";
|
|
1037
|
-
flowId: string;
|
|
1038
|
-
};
|
|
1039
|
-
};
|
|
1040
|
-
};
|
|
1041
|
-
};
|
|
1042
|
-
};
|
|
1043
1148
|
retrieveFlow: {
|
|
1044
1149
|
parameters: {
|
|
1045
1150
|
query?: never;
|
|
@@ -1168,6 +1273,16 @@ declare interface operations {
|
|
|
1168
1273
|
null_count: number | null;
|
|
1169
1274
|
unique_count: number | null;
|
|
1170
1275
|
unique_percentage: number | null;
|
|
1276
|
+
min_value?: number | null;
|
|
1277
|
+
max_value?: number | null;
|
|
1278
|
+
avg_value?: number | null;
|
|
1279
|
+
median_value?: number | null;
|
|
1280
|
+
std_value?: number | null;
|
|
1281
|
+
min_date?: string | null;
|
|
1282
|
+
max_date?: string | null;
|
|
1283
|
+
min_length?: number | null;
|
|
1284
|
+
max_length?: number | null;
|
|
1285
|
+
avg_length?: number | null;
|
|
1171
1286
|
} & {
|
|
1172
1287
|
[key: string]: unknown;
|
|
1173
1288
|
};
|
|
@@ -1178,6 +1293,11 @@ declare interface operations {
|
|
|
1178
1293
|
bookmarked: boolean;
|
|
1179
1294
|
status: string | null;
|
|
1180
1295
|
is_removed: boolean;
|
|
1296
|
+
is_materialized: boolean | null;
|
|
1297
|
+
last_materialized_at: string | null;
|
|
1298
|
+
materialized_error_message: string | null;
|
|
1299
|
+
/** @enum {string|null} */
|
|
1300
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
1181
1301
|
}[];
|
|
1182
1302
|
};
|
|
1183
1303
|
};
|
|
@@ -1813,6 +1933,16 @@ declare interface operations {
|
|
|
1813
1933
|
null_count: number | null;
|
|
1814
1934
|
unique_count: number | null;
|
|
1815
1935
|
unique_percentage: number | null;
|
|
1936
|
+
min_value?: number | null;
|
|
1937
|
+
max_value?: number | null;
|
|
1938
|
+
avg_value?: number | null;
|
|
1939
|
+
median_value?: number | null;
|
|
1940
|
+
std_value?: number | null;
|
|
1941
|
+
min_date?: string | null;
|
|
1942
|
+
max_date?: string | null;
|
|
1943
|
+
min_length?: number | null;
|
|
1944
|
+
max_length?: number | null;
|
|
1945
|
+
avg_length?: number | null;
|
|
1816
1946
|
} & {
|
|
1817
1947
|
[key: string]: unknown;
|
|
1818
1948
|
};
|
|
@@ -1823,6 +1953,11 @@ declare interface operations {
|
|
|
1823
1953
|
bookmarked: boolean;
|
|
1824
1954
|
status: string | null;
|
|
1825
1955
|
is_removed: boolean;
|
|
1956
|
+
is_materialized: boolean | null;
|
|
1957
|
+
last_materialized_at: string | null;
|
|
1958
|
+
materialized_error_message: string | null;
|
|
1959
|
+
/** @enum {string|null} */
|
|
1960
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
1826
1961
|
};
|
|
1827
1962
|
};
|
|
1828
1963
|
};
|
|
@@ -1905,6 +2040,102 @@ declare interface operations {
|
|
|
1905
2040
|
};
|
|
1906
2041
|
};
|
|
1907
2042
|
};
|
|
2043
|
+
refreshMaterializedViews: {
|
|
2044
|
+
parameters: {
|
|
2045
|
+
query?: never;
|
|
2046
|
+
header: {
|
|
2047
|
+
"sp-access-token": string;
|
|
2048
|
+
};
|
|
2049
|
+
path?: never;
|
|
2050
|
+
cookie?: never;
|
|
2051
|
+
};
|
|
2052
|
+
requestBody: {
|
|
2053
|
+
content: {
|
|
2054
|
+
"application/json": {
|
|
2055
|
+
/** @description List of flow_data IDs to refresh */
|
|
2056
|
+
flow_data_ids: number[];
|
|
2057
|
+
};
|
|
2058
|
+
};
|
|
2059
|
+
};
|
|
2060
|
+
responses: {
|
|
2061
|
+
/** @description Successfully triggered refresh for materialized views */
|
|
2062
|
+
200: {
|
|
2063
|
+
headers: {
|
|
2064
|
+
[name: string]: unknown;
|
|
2065
|
+
};
|
|
2066
|
+
content: {
|
|
2067
|
+
"application/json": {
|
|
2068
|
+
/** @enum {string} */
|
|
2069
|
+
status: "success";
|
|
2070
|
+
triggered_at: string;
|
|
2071
|
+
};
|
|
2072
|
+
};
|
|
2073
|
+
};
|
|
2074
|
+
/** @description Invalid request */
|
|
2075
|
+
400: {
|
|
2076
|
+
headers: {
|
|
2077
|
+
[name: string]: unknown;
|
|
2078
|
+
};
|
|
2079
|
+
content: {
|
|
2080
|
+
"application/json": {
|
|
2081
|
+
error: string;
|
|
2082
|
+
};
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
/** @description Something wrong happened */
|
|
2086
|
+
500: {
|
|
2087
|
+
headers: {
|
|
2088
|
+
[name: string]: unknown;
|
|
2089
|
+
};
|
|
2090
|
+
content: {
|
|
2091
|
+
"application/json": {
|
|
2092
|
+
error: string;
|
|
2093
|
+
};
|
|
2094
|
+
};
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
2098
|
+
getMaterializationStatus: {
|
|
2099
|
+
parameters: {
|
|
2100
|
+
query: {
|
|
2101
|
+
/** @description Comma-separated list of flow_data IDs */
|
|
2102
|
+
ids: string;
|
|
2103
|
+
};
|
|
2104
|
+
header: {
|
|
2105
|
+
"sp-access-token": string;
|
|
2106
|
+
};
|
|
2107
|
+
path?: never;
|
|
2108
|
+
cookie?: never;
|
|
2109
|
+
};
|
|
2110
|
+
requestBody?: never;
|
|
2111
|
+
responses: {
|
|
2112
|
+
/** @description Materialization status for the requested flow_data IDs */
|
|
2113
|
+
200: {
|
|
2114
|
+
headers: {
|
|
2115
|
+
[name: string]: unknown;
|
|
2116
|
+
};
|
|
2117
|
+
content: {
|
|
2118
|
+
"application/json": {
|
|
2119
|
+
id: number;
|
|
2120
|
+
/** @enum {string|null} */
|
|
2121
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
2122
|
+
last_materialized_at: string | null;
|
|
2123
|
+
}[];
|
|
2124
|
+
};
|
|
2125
|
+
};
|
|
2126
|
+
/** @description Something wrong happened */
|
|
2127
|
+
500: {
|
|
2128
|
+
headers: {
|
|
2129
|
+
[name: string]: unknown;
|
|
2130
|
+
};
|
|
2131
|
+
content: {
|
|
2132
|
+
"application/json": {
|
|
2133
|
+
error: string;
|
|
2134
|
+
};
|
|
2135
|
+
};
|
|
2136
|
+
};
|
|
2137
|
+
};
|
|
2138
|
+
};
|
|
1908
2139
|
getPromptStarters: {
|
|
1909
2140
|
parameters: {
|
|
1910
2141
|
query?: {
|
|
@@ -2153,6 +2384,13 @@ declare interface operations {
|
|
|
2153
2384
|
flow_data_id: number;
|
|
2154
2385
|
created_at: string;
|
|
2155
2386
|
bookmarked: boolean;
|
|
2387
|
+
flow_data?: {
|
|
2388
|
+
is_materialized: boolean | null;
|
|
2389
|
+
last_materialized_at: string | null;
|
|
2390
|
+
materialized_error_message: string | null;
|
|
2391
|
+
/** @enum {string|null} */
|
|
2392
|
+
materialized_status: "completed" | "running" | "failed" | null;
|
|
2393
|
+
};
|
|
2156
2394
|
configuration: {
|
|
2157
2395
|
/** @enum {string} */
|
|
2158
2396
|
type: "bar";
|
|
@@ -2270,10 +2508,6 @@ declare interface operations {
|
|
|
2270
2508
|
};
|
|
2271
2509
|
content: {
|
|
2272
2510
|
"application/json": {
|
|
2273
|
-
/** @enum {string} */
|
|
2274
|
-
status: "error";
|
|
2275
|
-
error: string;
|
|
2276
|
-
} | {
|
|
2277
2511
|
/** @enum {string} */
|
|
2278
2512
|
status: "success";
|
|
2279
2513
|
flowId: string;
|
|
@@ -3242,6 +3476,209 @@ declare interface operations {
|
|
|
3242
3476
|
};
|
|
3243
3477
|
};
|
|
3244
3478
|
};
|
|
3479
|
+
getCompanySettings: {
|
|
3480
|
+
parameters: {
|
|
3481
|
+
query?: never;
|
|
3482
|
+
header?: never;
|
|
3483
|
+
path?: never;
|
|
3484
|
+
cookie?: never;
|
|
3485
|
+
};
|
|
3486
|
+
requestBody?: never;
|
|
3487
|
+
responses: {
|
|
3488
|
+
/** @description Company settings retrieved successfully */
|
|
3489
|
+
200: {
|
|
3490
|
+
headers: {
|
|
3491
|
+
[name: string]: unknown;
|
|
3492
|
+
};
|
|
3493
|
+
content: {
|
|
3494
|
+
"application/json": {
|
|
3495
|
+
name: string | null;
|
|
3496
|
+
website: string | null;
|
|
3497
|
+
context_profile: {
|
|
3498
|
+
company: {
|
|
3499
|
+
description: string;
|
|
3500
|
+
industries: string[];
|
|
3501
|
+
revenue_streams: string[];
|
|
3502
|
+
customers: {
|
|
3503
|
+
label: string;
|
|
3504
|
+
description: string;
|
|
3505
|
+
typical_users: {
|
|
3506
|
+
role: string;
|
|
3507
|
+
typical_goals: string[];
|
|
3508
|
+
}[];
|
|
3509
|
+
}[];
|
|
3510
|
+
};
|
|
3511
|
+
domain: {
|
|
3512
|
+
overview: string;
|
|
3513
|
+
concepts: {
|
|
3514
|
+
name: string;
|
|
3515
|
+
definition: string;
|
|
3516
|
+
synonyms: string[];
|
|
3517
|
+
}[];
|
|
3518
|
+
};
|
|
3519
|
+
analytics: {
|
|
3520
|
+
examples_key_metrics: {
|
|
3521
|
+
name: string;
|
|
3522
|
+
why: string;
|
|
3523
|
+
}[];
|
|
3524
|
+
};
|
|
3525
|
+
} | null;
|
|
3526
|
+
};
|
|
3527
|
+
};
|
|
3528
|
+
};
|
|
3529
|
+
/** @description Failed to retrieve company settings */
|
|
3530
|
+
500: {
|
|
3531
|
+
headers: {
|
|
3532
|
+
[name: string]: unknown;
|
|
3533
|
+
};
|
|
3534
|
+
content: {
|
|
3535
|
+
"application/json": {
|
|
3536
|
+
error: string;
|
|
3537
|
+
};
|
|
3538
|
+
};
|
|
3539
|
+
};
|
|
3540
|
+
};
|
|
3541
|
+
};
|
|
3542
|
+
updateCompanySettings: {
|
|
3543
|
+
parameters: {
|
|
3544
|
+
query?: never;
|
|
3545
|
+
header?: never;
|
|
3546
|
+
path?: never;
|
|
3547
|
+
cookie?: never;
|
|
3548
|
+
};
|
|
3549
|
+
requestBody?: {
|
|
3550
|
+
content: {
|
|
3551
|
+
"application/json": {
|
|
3552
|
+
name: string;
|
|
3553
|
+
website: string;
|
|
3554
|
+
};
|
|
3555
|
+
};
|
|
3556
|
+
};
|
|
3557
|
+
responses: {
|
|
3558
|
+
/** @description Company settings updated successfully */
|
|
3559
|
+
200: {
|
|
3560
|
+
headers: {
|
|
3561
|
+
[name: string]: unknown;
|
|
3562
|
+
};
|
|
3563
|
+
content: {
|
|
3564
|
+
"application/json": {
|
|
3565
|
+
name: string | null;
|
|
3566
|
+
website: string | null;
|
|
3567
|
+
context_profile: {
|
|
3568
|
+
company: {
|
|
3569
|
+
description: string;
|
|
3570
|
+
industries: string[];
|
|
3571
|
+
revenue_streams: string[];
|
|
3572
|
+
customers: {
|
|
3573
|
+
label: string;
|
|
3574
|
+
description: string;
|
|
3575
|
+
typical_users: {
|
|
3576
|
+
role: string;
|
|
3577
|
+
typical_goals: string[];
|
|
3578
|
+
}[];
|
|
3579
|
+
}[];
|
|
3580
|
+
};
|
|
3581
|
+
domain: {
|
|
3582
|
+
overview: string;
|
|
3583
|
+
concepts: {
|
|
3584
|
+
name: string;
|
|
3585
|
+
definition: string;
|
|
3586
|
+
synonyms: string[];
|
|
3587
|
+
}[];
|
|
3588
|
+
};
|
|
3589
|
+
analytics: {
|
|
3590
|
+
examples_key_metrics: {
|
|
3591
|
+
name: string;
|
|
3592
|
+
why: string;
|
|
3593
|
+
}[];
|
|
3594
|
+
};
|
|
3595
|
+
} | null;
|
|
3596
|
+
};
|
|
3597
|
+
};
|
|
3598
|
+
};
|
|
3599
|
+
/** @description Failed to update company settings */
|
|
3600
|
+
500: {
|
|
3601
|
+
headers: {
|
|
3602
|
+
[name: string]: unknown;
|
|
3603
|
+
};
|
|
3604
|
+
content: {
|
|
3605
|
+
"application/json": {
|
|
3606
|
+
error: string;
|
|
3607
|
+
};
|
|
3608
|
+
};
|
|
3609
|
+
};
|
|
3610
|
+
};
|
|
3611
|
+
};
|
|
3612
|
+
runCompanyResearchAgent: {
|
|
3613
|
+
parameters: {
|
|
3614
|
+
query?: never;
|
|
3615
|
+
header?: never;
|
|
3616
|
+
path?: never;
|
|
3617
|
+
cookie?: never;
|
|
3618
|
+
};
|
|
3619
|
+
requestBody?: never;
|
|
3620
|
+
responses: {
|
|
3621
|
+
/** @description Company research agent executed successfully */
|
|
3622
|
+
200: {
|
|
3623
|
+
headers: {
|
|
3624
|
+
[name: string]: unknown;
|
|
3625
|
+
};
|
|
3626
|
+
content: {
|
|
3627
|
+
"application/json": {
|
|
3628
|
+
company: {
|
|
3629
|
+
description: string;
|
|
3630
|
+
industries: string[];
|
|
3631
|
+
revenue_streams: string[];
|
|
3632
|
+
customers: {
|
|
3633
|
+
label: string;
|
|
3634
|
+
description: string;
|
|
3635
|
+
typical_users: {
|
|
3636
|
+
role: string;
|
|
3637
|
+
typical_goals: string[];
|
|
3638
|
+
}[];
|
|
3639
|
+
}[];
|
|
3640
|
+
};
|
|
3641
|
+
domain: {
|
|
3642
|
+
overview: string;
|
|
3643
|
+
concepts: {
|
|
3644
|
+
name: string;
|
|
3645
|
+
definition: string;
|
|
3646
|
+
synonyms: string[];
|
|
3647
|
+
}[];
|
|
3648
|
+
};
|
|
3649
|
+
analytics: {
|
|
3650
|
+
examples_key_metrics: {
|
|
3651
|
+
name: string;
|
|
3652
|
+
why: string;
|
|
3653
|
+
}[];
|
|
3654
|
+
};
|
|
3655
|
+
};
|
|
3656
|
+
};
|
|
3657
|
+
};
|
|
3658
|
+
/** @description Company name or website not configured */
|
|
3659
|
+
400: {
|
|
3660
|
+
headers: {
|
|
3661
|
+
[name: string]: unknown;
|
|
3662
|
+
};
|
|
3663
|
+
content: {
|
|
3664
|
+
"application/json": {
|
|
3665
|
+
error: string;
|
|
3666
|
+
};
|
|
3667
|
+
};
|
|
3668
|
+
};
|
|
3669
|
+
/** @description Company research agent failed */
|
|
3670
|
+
500: {
|
|
3671
|
+
headers: {
|
|
3672
|
+
[name: string]: unknown;
|
|
3673
|
+
};
|
|
3674
|
+
content: {
|
|
3675
|
+
"application/json": {
|
|
3676
|
+
error: string;
|
|
3677
|
+
};
|
|
3678
|
+
};
|
|
3679
|
+
};
|
|
3680
|
+
};
|
|
3681
|
+
};
|
|
3245
3682
|
}
|
|
3246
3683
|
|
|
3247
3684
|
declare type PatchParam<T, Config extends RemoveParamsConfig, P extends keyof Config> = Simplify<T extends {
|
|
@@ -3366,22 +3803,6 @@ declare interface paths {
|
|
|
3366
3803
|
patch?: never;
|
|
3367
3804
|
trace?: never;
|
|
3368
3805
|
};
|
|
3369
|
-
"/api/v1/end2end": {
|
|
3370
|
-
parameters: {
|
|
3371
|
-
query?: never;
|
|
3372
|
-
header?: never;
|
|
3373
|
-
path?: never;
|
|
3374
|
-
cookie?: never;
|
|
3375
|
-
};
|
|
3376
|
-
get?: never;
|
|
3377
|
-
put?: never;
|
|
3378
|
-
post: operations["runEnd2EndFlow"];
|
|
3379
|
-
delete?: never;
|
|
3380
|
-
options?: never;
|
|
3381
|
-
head?: never;
|
|
3382
|
-
patch?: never;
|
|
3383
|
-
trace?: never;
|
|
3384
|
-
};
|
|
3385
3806
|
"/api/v1/flows/{flowId}": {
|
|
3386
3807
|
parameters: {
|
|
3387
3808
|
query?: never;
|
|
@@ -3606,6 +4027,38 @@ declare interface paths {
|
|
|
3606
4027
|
patch?: never;
|
|
3607
4028
|
trace?: never;
|
|
3608
4029
|
};
|
|
4030
|
+
"/api/v1/flow_data/v1/materialized_views/refresh": {
|
|
4031
|
+
parameters: {
|
|
4032
|
+
query?: never;
|
|
4033
|
+
header?: never;
|
|
4034
|
+
path?: never;
|
|
4035
|
+
cookie?: never;
|
|
4036
|
+
};
|
|
4037
|
+
get?: never;
|
|
4038
|
+
put?: never;
|
|
4039
|
+
post: operations["refreshMaterializedViews"];
|
|
4040
|
+
delete?: never;
|
|
4041
|
+
options?: never;
|
|
4042
|
+
head?: never;
|
|
4043
|
+
patch?: never;
|
|
4044
|
+
trace?: never;
|
|
4045
|
+
};
|
|
4046
|
+
"/api/v1/flow_data/materialization-status": {
|
|
4047
|
+
parameters: {
|
|
4048
|
+
query?: never;
|
|
4049
|
+
header?: never;
|
|
4050
|
+
path?: never;
|
|
4051
|
+
cookie?: never;
|
|
4052
|
+
};
|
|
4053
|
+
get: operations["getMaterializationStatus"];
|
|
4054
|
+
put?: never;
|
|
4055
|
+
post?: never;
|
|
4056
|
+
delete?: never;
|
|
4057
|
+
options?: never;
|
|
4058
|
+
head?: never;
|
|
4059
|
+
patch?: never;
|
|
4060
|
+
trace?: never;
|
|
4061
|
+
};
|
|
3609
4062
|
"/api/v1/prompt-starters": {
|
|
3610
4063
|
parameters: {
|
|
3611
4064
|
query?: never;
|
|
@@ -3702,7 +4155,7 @@ declare interface paths {
|
|
|
3702
4155
|
patch?: never;
|
|
3703
4156
|
trace?: never;
|
|
3704
4157
|
};
|
|
3705
|
-
"/api/v1/trigger-flow
|
|
4158
|
+
"/api/v1/trigger-flow": {
|
|
3706
4159
|
parameters: {
|
|
3707
4160
|
query?: never;
|
|
3708
4161
|
header?: never;
|
|
@@ -3958,8 +4411,42 @@ declare interface paths {
|
|
|
3958
4411
|
patch?: never;
|
|
3959
4412
|
trace?: never;
|
|
3960
4413
|
};
|
|
4414
|
+
"/api/v1/admin-console/company-settings": {
|
|
4415
|
+
parameters: {
|
|
4416
|
+
query?: never;
|
|
4417
|
+
header?: never;
|
|
4418
|
+
path?: never;
|
|
4419
|
+
cookie?: never;
|
|
4420
|
+
};
|
|
4421
|
+
get: operations["getCompanySettings"];
|
|
4422
|
+
put?: never;
|
|
4423
|
+
post?: never;
|
|
4424
|
+
delete?: never;
|
|
4425
|
+
options?: never;
|
|
4426
|
+
head?: never;
|
|
4427
|
+
patch: operations["updateCompanySettings"];
|
|
4428
|
+
trace?: never;
|
|
4429
|
+
};
|
|
4430
|
+
"/api/v1/admin-console/company-research-agent": {
|
|
4431
|
+
parameters: {
|
|
4432
|
+
query?: never;
|
|
4433
|
+
header?: never;
|
|
4434
|
+
path?: never;
|
|
4435
|
+
cookie?: never;
|
|
4436
|
+
};
|
|
4437
|
+
get?: never;
|
|
4438
|
+
put?: never;
|
|
4439
|
+
post: operations["runCompanyResearchAgent"];
|
|
4440
|
+
delete?: never;
|
|
4441
|
+
options?: never;
|
|
4442
|
+
head?: never;
|
|
4443
|
+
patch?: never;
|
|
4444
|
+
trace?: never;
|
|
4445
|
+
};
|
|
3961
4446
|
}
|
|
3962
4447
|
|
|
4448
|
+
declare type QuickActions = z.infer<typeof QuickActionsSchema>;
|
|
4449
|
+
|
|
3963
4450
|
declare const QuickActionsSchema: z.ZodArray<z.ZodObject<{
|
|
3964
4451
|
label: z.ZodString;
|
|
3965
4452
|
explanation: z.ZodString;
|
|
@@ -4085,6 +4572,8 @@ declare type ReportDataFilters = {
|
|
|
4085
4572
|
cursor?: number;
|
|
4086
4573
|
};
|
|
4087
4574
|
|
|
4575
|
+
declare type SignalWithReportId = z.infer<typeof SignalWithReportIdSchema>;
|
|
4576
|
+
|
|
4088
4577
|
declare const SignalWithReportIdSchema: z.ZodObject<{
|
|
4089
4578
|
rule: z.ZodString;
|
|
4090
4579
|
metric: z.ZodString;
|
|
@@ -4102,9 +4591,9 @@ declare type TableFilters = Record<string, string | number>;
|
|
|
4102
4591
|
*/
|
|
4103
4592
|
export declare const TOKEN_STORAGE_KEY = "mm-ai-sp-token";
|
|
4104
4593
|
|
|
4105
|
-
declare type ToRemove =
|
|
4106
|
-
header:
|
|
4107
|
-
}
|
|
4594
|
+
declare type ToRemove = {
|
|
4595
|
+
header: typeof HEADER_SP_TOKEN;
|
|
4596
|
+
};
|
|
4108
4597
|
|
|
4109
4598
|
declare type UiTool = InferUITool<Tool<z.infer<typeof inputSchema>, z.infer<typeof redactedOutputSchema>>>;
|
|
4110
4599
|
|
|
@@ -4121,7 +4610,7 @@ declare type UiTool_6 = InferUITool<Tool<z.infer<typeof inputSchema_6>, z.infer<
|
|
|
4121
4610
|
declare type UiTool_7 = InferUITool<Tool<z.infer<typeof inputSchema_7>, z.infer<typeof redactedOutputSchema_6>>>;
|
|
4122
4611
|
|
|
4123
4612
|
declare const UpdateCanvasSchema: z.ZodObject<{
|
|
4124
|
-
id: z.
|
|
4613
|
+
id: z.ZodUUID;
|
|
4125
4614
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4126
4615
|
nodes: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
4127
4616
|
edges: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|