@magemetrics/core 0.0.59 → 0.1.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.
Files changed (46) hide show
  1. package/dist/index.d.ts +4279 -0
  2. package/dist/index.js +2884 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +12 -9
  5. package/dist/package.json +0 -59
  6. package/dist/src/adapters/storage/browser.d.ts +0 -11
  7. package/dist/src/adapters/storage/browser.d.ts.map +0 -1
  8. package/dist/src/adapters/storage/browser.js +0 -37
  9. package/dist/src/adapters/storage/browser.js.map +0 -1
  10. package/dist/src/adapters/storage/factory.d.ts +0 -8
  11. package/dist/src/adapters/storage/factory.d.ts.map +0 -1
  12. package/dist/src/adapters/storage/factory.js +0 -24
  13. package/dist/src/adapters/storage/factory.js.map +0 -1
  14. package/dist/src/adapters/storage/interface.d.ts +0 -26
  15. package/dist/src/adapters/storage/interface.d.ts.map +0 -1
  16. package/dist/src/adapters/storage/interface.js +0 -1
  17. package/dist/src/adapters/storage/interface.js.map +0 -1
  18. package/dist/src/adapters/storage/memory.d.ts +0 -11
  19. package/dist/src/adapters/storage/memory.d.ts.map +0 -1
  20. package/dist/src/adapters/storage/memory.js +0 -20
  21. package/dist/src/adapters/storage/memory.js.map +0 -1
  22. package/dist/src/core/MageMetricsClient.d.ts +0 -103
  23. package/dist/src/core/MageMetricsClient.d.ts.map +0 -1
  24. package/dist/src/core/MageMetricsClient.js +0 -509
  25. package/dist/src/core/MageMetricsClient.js.map +0 -1
  26. package/dist/src/core/MageMetricsEventEmitter.d.ts +0 -25
  27. package/dist/src/core/MageMetricsEventEmitter.d.ts.map +0 -1
  28. package/dist/src/core/MageMetricsEventEmitter.js +0 -48
  29. package/dist/src/core/MageMetricsEventEmitter.js.map +0 -1
  30. package/dist/src/core/types.d.ts +0 -37
  31. package/dist/src/core/types.d.ts.map +0 -1
  32. package/dist/src/core/types.js +0 -6
  33. package/dist/src/core/types.js.map +0 -1
  34. package/dist/src/index.d.ts +0 -8
  35. package/dist/src/index.d.ts.map +0 -1
  36. package/dist/src/index.js +0 -7
  37. package/dist/src/index.js.map +0 -1
  38. package/dist/src/utils/hash.d.ts +0 -8
  39. package/dist/src/utils/hash.d.ts.map +0 -1
  40. package/dist/src/utils/hash.js +0 -16
  41. package/dist/src/utils/hash.js.map +0 -1
  42. package/dist/src/utils/platform.d.ts +0 -10
  43. package/dist/src/utils/platform.d.ts.map +0 -1
  44. package/dist/src/utils/platform.js +0 -25
  45. package/dist/src/utils/platform.js.map +0 -1
  46. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,4279 @@
1
+ import { Client } from 'openapi-fetch';
2
+ import { DefaultChatTransport } from 'ai';
3
+ import { HttpChatTransportInitOptions } from 'ai';
4
+ import type { InferUITool } from 'ai';
5
+ import type { Simplify } from 'type-fest';
6
+ import type { Tool } from 'ai';
7
+ import type { UIMessage } from 'ai';
8
+ import { z } from 'zod';
9
+
10
+ /**
11
+ * Universal storage adapter interface for cross-platform compatibility.
12
+ * All operations are async to accommodate different storage mechanisms.
13
+ */
14
+ export declare interface AsyncStorage {
15
+ /**
16
+ * Retrieve an item from storage
17
+ * @param key - The storage key
18
+ * @returns Promise resolving to the stored value or null if not found
19
+ */
20
+ getItem(key: string): Promise<string | null>;
21
+ /**
22
+ * Store an item in storage
23
+ * @param key - The storage key
24
+ * @param value - The value to store (must be a string)
25
+ * @returns Promise resolving when storage is complete
26
+ */
27
+ setItem(key: string, value: string): Promise<void>;
28
+ /**
29
+ * Remove an item from storage
30
+ * @param key - The storage key
31
+ * @returns Promise resolving when removal is complete
32
+ */
33
+ removeItem(key: string): Promise<void>;
34
+ }
35
+
36
+ /**
37
+ * Universal storage adapter interface for cross-platform compatibility.
38
+ * All operations are async to accommodate different storage mechanisms.
39
+ */
40
+ declare interface AsyncStorage_2 {
41
+ /**
42
+ * Retrieve an item from storage
43
+ * @param key - The storage key
44
+ * @returns Promise resolving to the stored value or null if not found
45
+ */
46
+ getItem(key: string): Promise<string | null>;
47
+
48
+ /**
49
+ * Store an item in storage
50
+ * @param key - The storage key
51
+ * @param value - The value to store (must be a string)
52
+ * @returns Promise resolving when storage is complete
53
+ */
54
+ setItem(key: string, value: string): Promise<void>;
55
+
56
+ /**
57
+ * Remove an item from storage
58
+ * @param key - The storage key
59
+ * @returns Promise resolving when removal is complete
60
+ */
61
+ removeItem(key: string): Promise<void>;
62
+ }
63
+
64
+ /**
65
+ * Authentication states
66
+ */
67
+ export declare type AuthState = "initializing" | "ready" | "error";
68
+
69
+ /**
70
+ * Browser localStorage adapter with async interface.
71
+ * Wraps the synchronous localStorage API with async methods for consistency.
72
+ */
73
+ export declare class BrowserStorageAdapter implements AsyncStorage {
74
+ getItem(key: string): Promise<string | null>;
75
+ setItem(key: string, value: string): Promise<void>;
76
+ removeItem(key: string): Promise<void>;
77
+ }
78
+
79
+ export declare const CHECK_KEY = "mm-ai-check-key";
80
+
81
+ declare interface components {
82
+ schemas: {
83
+ VisualizationData: {
84
+ [key: string]: string | (number | null) | unknown | null;
85
+ }[];
86
+ VisualizationWithData: {
87
+ id: number;
88
+ flow_data_id: number;
89
+ created_at: string;
90
+ bookmarked: boolean;
91
+ configuration: {
92
+ /** @enum {string} */
93
+ type: "bar";
94
+ title: string;
95
+ /** @enum {number} */
96
+ config_version: 2;
97
+ xAxisLabel: string;
98
+ yAxisLabel: string;
99
+ categoryColumn: string;
100
+ secondaryCategoryColumn?: string;
101
+ valueColumn: string;
102
+ } | {
103
+ /** @enum {string} */
104
+ type: "line/area";
105
+ /** @enum {number} */
106
+ config_version: 2;
107
+ title: string;
108
+ xAxisColumn: string;
109
+ valueColumns: string[];
110
+ yAxisLabels: string[];
111
+ } | {
112
+ /** @enum {string} */
113
+ type: "line/area-categorical";
114
+ title: string;
115
+ /** @enum {number} */
116
+ config_version: 2;
117
+ valueColumn: string;
118
+ xAxisColumn: string;
119
+ xAxisLabel: string;
120
+ yAxisLabel: string;
121
+ categoryColumn: string;
122
+ } | {
123
+ /** @enum {string} */
124
+ type: "scatter";
125
+ title: string;
126
+ /** @enum {number} */
127
+ config_version: 2;
128
+ xAxisLabel: string;
129
+ yAxisLabel: string;
130
+ xAxisValueColumn: string;
131
+ yAxisValueColumn: string;
132
+ } | {
133
+ /** @enum {string} */
134
+ type: "pie";
135
+ title: string;
136
+ /** @enum {number} */
137
+ config_version: 2;
138
+ categoryColumn: string;
139
+ valueColumn: string;
140
+ };
141
+ data: components["schemas"]["VisualizationData"];
142
+ _metadata?: {
143
+ wasSampled: boolean;
144
+ originalCount: number;
145
+ sampledCount: number;
146
+ };
147
+ } | {
148
+ id: number;
149
+ flow_data_id: number;
150
+ created_at: string;
151
+ bookmarked: boolean;
152
+ configuration: {
153
+ /** @enum {string} */
154
+ type: "bar";
155
+ title: string;
156
+ xAxisLabel: string;
157
+ yAxisLabel: string;
158
+ xAxisDataKey?: string;
159
+ yAxisDataKey?: string;
160
+ dimensionDataKey?: string;
161
+ valueColumns?: string[];
162
+ } | {
163
+ /** @enum {string} */
164
+ type: "line/area";
165
+ title: string;
166
+ xAxisLabel: string;
167
+ yAxisLabel: string;
168
+ xAxisDataKey?: string;
169
+ yAxisDataKey?: string;
170
+ dimensionDataKey?: string;
171
+ valueColumns?: string[];
172
+ } | {
173
+ /** @enum {string} */
174
+ type: "scatter";
175
+ title: string;
176
+ xAxisLabel: string;
177
+ yAxisLabel: string;
178
+ xAxisDataKey?: string;
179
+ yAxisDataKey?: string;
180
+ dimensionDataKey?: string;
181
+ valueColumns?: string[];
182
+ } | {
183
+ /** @enum {string} */
184
+ type: "pie";
185
+ title: string;
186
+ nameKey: string;
187
+ dataKey: string;
188
+ };
189
+ data: components["schemas"]["VisualizationData"];
190
+ _metadata?: {
191
+ wasSampled: boolean;
192
+ originalCount: number;
193
+ sampledCount: number;
194
+ };
195
+ };
196
+ /** Format: uuid */
197
+ DashboardId: string;
198
+ ReportColumns: {
199
+ name: string;
200
+ data_type: string;
201
+ dataType: string;
202
+ renderType?: string;
203
+ unit?: string;
204
+ }[];
205
+ ReportData: Record<string, unknown>[];
206
+ /** @description Starter recommendations */
207
+ StarterRecommendation: {
208
+ starter: string;
209
+ explanation: string;
210
+ type: string;
211
+ };
212
+ };
213
+ responses: never;
214
+ parameters: never;
215
+ requestBodies: never;
216
+ headers: never;
217
+ pathItems: never;
218
+ }
219
+
220
+ /**
221
+ * Parameters for starting a flow
222
+ */
223
+ export declare type CreateFlowParam = {
224
+ query: string;
225
+ } | {
226
+ triggerId: string;
227
+ variables: Record<string, string>;
228
+ };
229
+
230
+ declare type CustomDataParts = {
231
+ "quick-actions": z.infer<typeof QuickActionsSchema>;
232
+ signal: z.infer<typeof SignalWithReportIdSchema>;
233
+ };
234
+
235
+ declare type ExtractInsightResponse = z.infer<typeof ExtractInsightResponseSchema>;
236
+
237
+ declare const ExtractInsightResponseSchema: z.ZodUnion<[z.ZodObject<{
238
+ type: z.ZodLiteral<"text">;
239
+ insight: z.ZodString;
240
+ }, "strip", z.ZodTypeAny, {
241
+ type: "text";
242
+ insight: string;
243
+ }, {
244
+ type: "text";
245
+ insight: string;
246
+ }>, z.ZodObject<{
247
+ type: z.ZodLiteral<"missing">;
248
+ }, "strip", z.ZodTypeAny, {
249
+ type: "missing";
250
+ }, {
251
+ type: "missing";
252
+ }>]>;
253
+
254
+ declare type FrontendDashboard = z.infer<typeof FrontendDashboardSchema>;
255
+
256
+ declare const FrontendDashboardSchema: z.ZodObject<Omit<{
257
+ company_id: z.ZodNumber;
258
+ created_at: z.ZodString;
259
+ description: z.ZodNullable<z.ZodString>;
260
+ id: z.ZodString;
261
+ name: z.ZodString;
262
+ positions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
263
+ type: z.ZodLiteral<"data-report">;
264
+ flowId: z.ZodString;
265
+ flowDataId: z.ZodNumber;
266
+ title: z.ZodString;
267
+ col: z.ZodNumber;
268
+ colSpan: z.ZodNumber;
269
+ rowSpan: z.ZodNumber;
270
+ }, "strip", z.ZodTypeAny, {
271
+ type: "data-report";
272
+ title: string;
273
+ flowDataId: number;
274
+ flowId: string;
275
+ col: number;
276
+ colSpan: number;
277
+ rowSpan: number;
278
+ }, {
279
+ type: "data-report";
280
+ title: string;
281
+ flowDataId: number;
282
+ flowId: string;
283
+ col: number;
284
+ colSpan: number;
285
+ rowSpan: number;
286
+ }>, z.ZodObject<{
287
+ type: z.ZodLiteral<"visualization">;
288
+ visualizationId: z.ZodNumber;
289
+ title: z.ZodString;
290
+ col: z.ZodNumber;
291
+ colSpan: z.ZodNumber;
292
+ rowSpan: z.ZodNumber;
293
+ }, "strip", z.ZodTypeAny, {
294
+ type: "visualization";
295
+ title: string;
296
+ col: number;
297
+ colSpan: number;
298
+ rowSpan: number;
299
+ visualizationId: number;
300
+ }, {
301
+ type: "visualization";
302
+ title: string;
303
+ col: number;
304
+ colSpan: number;
305
+ rowSpan: number;
306
+ visualizationId: number;
307
+ }>]>, "many">;
308
+ updated_at: z.ZodString;
309
+ is_removed: z.ZodBoolean;
310
+ is_public: z.ZodBoolean;
311
+ }, "created_at" | "is_removed" | "company_id" | "updated_at">, "strip", z.ZodTypeAny, {
312
+ description: string | null;
313
+ name: string;
314
+ id: string;
315
+ positions: ({
316
+ type: "data-report";
317
+ title: string;
318
+ flowDataId: number;
319
+ flowId: string;
320
+ col: number;
321
+ colSpan: number;
322
+ rowSpan: number;
323
+ } | {
324
+ type: "visualization";
325
+ title: string;
326
+ col: number;
327
+ colSpan: number;
328
+ rowSpan: number;
329
+ visualizationId: number;
330
+ })[];
331
+ is_public: boolean;
332
+ }, {
333
+ description: string | null;
334
+ name: string;
335
+ id: string;
336
+ positions: ({
337
+ type: "data-report";
338
+ title: string;
339
+ flowDataId: number;
340
+ flowId: string;
341
+ col: number;
342
+ colSpan: number;
343
+ rowSpan: number;
344
+ } | {
345
+ type: "visualization";
346
+ title: string;
347
+ col: number;
348
+ colSpan: number;
349
+ rowSpan: number;
350
+ visualizationId: number;
351
+ })[];
352
+ is_public: boolean;
353
+ }>;
354
+
355
+ declare type FrontendRecentFlows = z.infer<typeof FrontendRecentFlowsSchema>;
356
+
357
+ declare const FrontendRecentFlowsSchema: z.ZodObject<Omit<{
358
+ created_at: z.ZodString;
359
+ id: z.ZodString;
360
+ request: z.ZodString;
361
+ user_id: z.ZodNullable<z.ZodString>;
362
+ flow_steps: z.ZodArray<z.ZodObject<{
363
+ name: z.ZodString;
364
+ status: z.ZodEnum<["running", "completed", "failed", "awaiting_input"]>;
365
+ output: z.ZodNullable<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodArray<z.ZodUnknown, "many">]>>;
366
+ }, "strip", z.ZodTypeAny, {
367
+ status: "running" | "completed" | "failed" | "awaiting_input";
368
+ name: string;
369
+ output: unknown[] | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null;
370
+ }, {
371
+ status: "running" | "completed" | "failed" | "awaiting_input";
372
+ name: string;
373
+ output: unknown[] | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null;
374
+ }>, "many">;
375
+ flow_chat_messages: z.ZodArray<z.ZodObject<{
376
+ count: z.ZodNumber;
377
+ }, "strip", z.ZodTypeAny, {
378
+ count: number;
379
+ }, {
380
+ count: number;
381
+ }>, "many">;
382
+ }, "flow_steps" | "flow_chat_messages">, "strip", z.ZodTypeAny, {
383
+ id: string;
384
+ request: string;
385
+ created_at: string;
386
+ user_id: string | null;
387
+ }, {
388
+ id: string;
389
+ request: string;
390
+ created_at: string;
391
+ user_id: string | null;
392
+ }>;
393
+
394
+ /**
395
+ * Parameters for generating contextual insights
396
+ */
397
+ export declare type GenerateInsightParam = {
398
+ selectedFilterValue: string;
399
+ customId: string;
400
+ };
401
+
402
+ export declare const getPublicApiClient: (apiUrl: string, apiKey: string) => Client<NoAuthPaths>;
403
+
404
+ declare const inputSchema: z.ZodObject<{
405
+ userRequest: z.ZodString;
406
+ isNewAnalysisGoal: z.ZodBoolean;
407
+ responseType: z.ZodEnum<["text", "table", "visualization"]>;
408
+ difficultyLevel: z.ZodEnum<["simple", "moderate", "complex"]>;
409
+ }, "strip", z.ZodTypeAny, {
410
+ userRequest: string;
411
+ isNewAnalysisGoal: boolean;
412
+ responseType: "text" | "table" | "visualization";
413
+ difficultyLevel: "simple" | "moderate" | "complex";
414
+ }, {
415
+ userRequest: string;
416
+ isNewAnalysisGoal: boolean;
417
+ responseType: "text" | "table" | "visualization";
418
+ difficultyLevel: "simple" | "moderate" | "complex";
419
+ }>;
420
+
421
+ declare const inputSchema_2: z.ZodObject<{
422
+ chartType: z.ZodEnum<["bar", "line/area", "scatter", "pie"]>;
423
+ columnConfiguration: z.ZodObject<{
424
+ dimensionColumn: z.ZodString;
425
+ valueColumns: z.ZodArray<z.ZodString, "many">;
426
+ }, "strip", z.ZodTypeAny, {
427
+ dimensionColumn: string;
428
+ valueColumns: string[];
429
+ }, {
430
+ dimensionColumn: string;
431
+ valueColumns: string[];
432
+ }>;
433
+ explanations: z.ZodString;
434
+ }, "strip", z.ZodTypeAny, {
435
+ chartType: "bar" | "line/area" | "scatter" | "pie";
436
+ columnConfiguration: {
437
+ dimensionColumn: string;
438
+ valueColumns: string[];
439
+ };
440
+ explanations: string;
441
+ }, {
442
+ chartType: "bar" | "line/area" | "scatter" | "pie";
443
+ columnConfiguration: {
444
+ dimensionColumn: string;
445
+ valueColumns: string[];
446
+ };
447
+ explanations: string;
448
+ }>;
449
+
450
+ declare const inputSchema_3: z.ZodObject<{
451
+ thought: z.ZodString;
452
+ }, "strip", z.ZodTypeAny, {
453
+ thought: string;
454
+ }, {
455
+ thought: string;
456
+ }>;
457
+
458
+ declare const inputSchema_4: z.ZodObject<{
459
+ value: z.ZodString;
460
+ }, "strip", z.ZodTypeAny, {
461
+ value: string;
462
+ }, {
463
+ value: string;
464
+ }>;
465
+
466
+ declare const inputSchema_5: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
467
+
468
+ declare const inputSchema_6: z.ZodObject<{
469
+ table_name: z.ZodString;
470
+ }, "strip", z.ZodTypeAny, {
471
+ table_name: string;
472
+ }, {
473
+ table_name: string;
474
+ }>;
475
+
476
+ declare const inputSchema_7: z.ZodObject<{
477
+ query: z.ZodString;
478
+ }, "strip", z.ZodTypeAny, {
479
+ query: string;
480
+ }, {
481
+ query: string;
482
+ }>;
483
+
484
+ declare type InternalApiClient = Simplify<Client<NoAuthPaths, `${string}/${string}`>>;
485
+
486
+ export declare class MageMetricsChatTransport extends DefaultChatTransport<MMChatUIMessage> {
487
+ constructor(apiUrl: string, flowId: string, options?: Omit<HttpChatTransportInitOptions<MMChatUIMessage>, "api" | "headers" | "prepareSendMessagesRequest">);
488
+ }
489
+
490
+ /**
491
+ * Core MageMetrics client that handles authentication lifecycle and provides
492
+ * a promise-based API that automatically waits for authentication to complete.
493
+ *
494
+ * This version uses composition instead of inheritance and pluggable storage adapters
495
+ * for cross-platform compatibility.
496
+ */
497
+ export declare class MageMetricsClient {
498
+ private config;
499
+ private authState;
500
+ private supabaseClient;
501
+ private internalApiClient;
502
+ private noAuthApiClient;
503
+ private authApiResponse;
504
+ private authPromise;
505
+ private processedJwt;
506
+ private storageAdapter;
507
+ private events;
508
+ constructor(config: MageMetricsClientConfig);
509
+ /**
510
+ * Add an event listener for authentication state changes
511
+ * @param type the type of the event
512
+ * @param listener the listener to add
513
+ * @param options options for the event listener
514
+ * @param options.signal an optional AbortSignal to abort the event listener
515
+ */
516
+ addEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>, options?: {
517
+ signal?: AbortSignal;
518
+ }): void;
519
+ /**
520
+ * Remove an event listener
521
+ * @param type the type of the event
522
+ * @param listener the listener to remove
523
+ */
524
+ removeEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>): void;
525
+ waitForAuth(): Promise<void>;
526
+ updateExternalJwt(jwt: string): Promise<void>;
527
+ get state(): AuthState;
528
+ getAuthHeaders(): Promise<Record<string, string>>;
529
+ private clearStorage;
530
+ logout(): Promise<void>;
531
+ /**
532
+ * Public API methods that automatically wait for authentication
533
+ */
534
+ api: {
535
+ getRecentFlows: (params?: {
536
+ limit?: number;
537
+ }) => Promise<FrontendRecentFlows[]>;
538
+ createFlow: (request: CreateFlowParam) => Promise<{
539
+ flowId: string;
540
+ }>;
541
+ getDashboard: (dashboardId: string) => Promise<FrontendDashboard>;
542
+ exportReportData: (reportId: number, format?: "text" | "blob") => Promise<{
543
+ filename: string;
544
+ data: Blob | string;
545
+ }>;
546
+ generateContextualInsight: (payload: GenerateInsightParam) => Promise<ExtractInsightResponse>;
547
+ };
548
+ /**
549
+ * Initialize authentication flow
550
+ */
551
+ private initializeAuth;
552
+ /**
553
+ * Perform the complete authentication flow
554
+ */
555
+ private performAuthFlow;
556
+ private getApiInformation;
557
+ private initializeSupabaseClient;
558
+ client(): Promise<InternalApiClient>;
559
+ /**
560
+ * Initialize the API client with Supabase headers
561
+ */
562
+ private initializeApiClient;
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
+ 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
+ }
578
+
579
+ /**
580
+ * Configuration options for the MageMetricsClient
581
+ */
582
+ export declare interface MageMetricsClientConfig {
583
+ apiUrl: string;
584
+ apiKey: string;
585
+ externalJwt?: string;
586
+ additionalHeaders?: Record<string, string>;
587
+ storageAdapter?: AsyncStorage_2;
588
+ }
589
+
590
+ /**
591
+ * Event types using discriminated union for type safety and extensibility
592
+ */
593
+ export declare type MageMetricsEvent = {
594
+ type: "authStateChange";
595
+ detail: AuthState;
596
+ };
597
+
598
+ /**
599
+ * Simple event emitter for MageMetrics client.
600
+ * Uses discriminated unions for type-safe events.
601
+ */
602
+ export declare class MageMetricsEventEmitter {
603
+ private listeners;
604
+ addEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>, options?: {
605
+ signal?: AbortSignal;
606
+ }): void;
607
+ removeEventListener<T extends MageMetricsEvent>(type: T["type"], listener: MageMetricsEventListener<T>): void;
608
+ dispatch<T extends MageMetricsEvent>(type: T["type"], detail: T["detail"]): void;
609
+ }
610
+
611
+ /**
612
+ * Event listener function type
613
+ */
614
+ export declare type MageMetricsEventListener<T extends MageMetricsEvent = MageMetricsEvent> = (event: T) => void;
615
+
616
+ /**
617
+ * in-memory storage adapter.
618
+ */
619
+ export declare class MemoryStorageAdapter implements AsyncStorage {
620
+ private storage;
621
+ getItem(key: string): Promise<string | null>;
622
+ setItem(key: string, value: string): Promise<void>;
623
+ removeItem(key: string): Promise<void>;
624
+ }
625
+
626
+ declare type MMChatUIMessage = UIMessage<unknown, CustomDataParts, MMUiTools>;
627
+
628
+ declare type MMUiTools = {
629
+ generateDataReport: UiTool;
630
+ generateVisualization: UiTool_2;
631
+ think: UiTool_3;
632
+ valueBasedColumnSearch: UiTool_4;
633
+ getAvailableTables: UiTool_5;
634
+ getAvailableColumnsForTable: UiTool_6;
635
+ webSearch: UiTool_7;
636
+ };
637
+
638
+ declare type NoAuthPaths = Simplify<{
639
+ [Path in keyof paths]: RemoveAuthHeader<paths[Path]>;
640
+ }>;
641
+
642
+ declare interface operations {
643
+ exchangeExternalToken: {
644
+ parameters: {
645
+ query?: never;
646
+ header?: never;
647
+ path?: never;
648
+ cookie?: never;
649
+ };
650
+ requestBody: {
651
+ content: {
652
+ "application/json": {
653
+ apiKey: string;
654
+ externalJWT: string;
655
+ };
656
+ };
657
+ };
658
+ responses: {
659
+ /** @description Retrieve a JWT for an external user */
660
+ 200: {
661
+ headers: {
662
+ [name: string]: unknown;
663
+ };
664
+ content: {
665
+ "application/json": {
666
+ accessToken: string;
667
+ refreshToken: string;
668
+ };
669
+ };
670
+ };
671
+ /** @description Invalid input */
672
+ 400: {
673
+ headers: {
674
+ [name: string]: unknown;
675
+ };
676
+ content: {
677
+ "application/json": {
678
+ error: string;
679
+ };
680
+ };
681
+ };
682
+ /** @description Unable to retrieve a JWT for an external user */
683
+ 500: {
684
+ headers: {
685
+ [name: string]: unknown;
686
+ };
687
+ content: {
688
+ "application/json": {
689
+ error: string;
690
+ };
691
+ };
692
+ };
693
+ };
694
+ };
695
+ getApiInformation: {
696
+ parameters: {
697
+ query: {
698
+ apiKey: string;
699
+ };
700
+ header?: never;
701
+ path?: never;
702
+ cookie?: never;
703
+ };
704
+ requestBody?: never;
705
+ responses: {
706
+ /** @description Retrieve the API URL and anon key */
707
+ 200: {
708
+ headers: {
709
+ [name: string]: unknown;
710
+ };
711
+ content: {
712
+ "application/json": {
713
+ apiUrl: string;
714
+ anonKey: string;
715
+ };
716
+ };
717
+ };
718
+ /** @description Invalid input */
719
+ 400: {
720
+ headers: {
721
+ [name: string]: unknown;
722
+ };
723
+ content: {
724
+ "application/json": {
725
+ error: string;
726
+ };
727
+ };
728
+ };
729
+ /** @description Unable to retrieve the API URL and anon key */
730
+ 500: {
731
+ headers: {
732
+ [name: string]: unknown;
733
+ };
734
+ content: {
735
+ "application/json": {
736
+ error: string;
737
+ };
738
+ };
739
+ };
740
+ };
741
+ };
742
+ PublicDashboardFetchVisualization: {
743
+ parameters: {
744
+ query?: never;
745
+ header?: never;
746
+ path: {
747
+ visualization_id: string;
748
+ dashboard_id: string;
749
+ };
750
+ cookie?: never;
751
+ };
752
+ requestBody?: never;
753
+ responses: {
754
+ /** @description The content of the visualization */
755
+ 200: {
756
+ headers: {
757
+ [name: string]: unknown;
758
+ };
759
+ content: {
760
+ "application/json": components["schemas"]["VisualizationWithData"];
761
+ };
762
+ };
763
+ /** @description Invalid arguments to fetch visualization */
764
+ 400: {
765
+ headers: {
766
+ [name: string]: unknown;
767
+ };
768
+ content: {
769
+ "application/json": {
770
+ error: string;
771
+ };
772
+ };
773
+ };
774
+ /** @description Unable to fetch visualization with this id */
775
+ 404: {
776
+ headers: {
777
+ [name: string]: unknown;
778
+ };
779
+ content: {
780
+ "application/json": {
781
+ error: string;
782
+ };
783
+ };
784
+ };
785
+ /** @description Something wrong happened */
786
+ 500: {
787
+ headers: {
788
+ [name: string]: unknown;
789
+ };
790
+ content: {
791
+ "application/json": {
792
+ error: string;
793
+ };
794
+ };
795
+ };
796
+ };
797
+ };
798
+ retrievePublicDashboard: {
799
+ parameters: {
800
+ query?: never;
801
+ header?: never;
802
+ path: {
803
+ dashboard_id: components["schemas"]["DashboardId"];
804
+ };
805
+ cookie?: never;
806
+ };
807
+ requestBody?: never;
808
+ responses: {
809
+ /** @description The dashboard with the given id */
810
+ 200: {
811
+ headers: {
812
+ [name: string]: unknown;
813
+ };
814
+ content: {
815
+ "application/json": {
816
+ description: string | null;
817
+ /** Format: uuid */
818
+ id: string;
819
+ name: string;
820
+ positions: ({
821
+ /** @enum {string} */
822
+ type: "data-report";
823
+ flowId: string;
824
+ flowDataId: number;
825
+ title: string;
826
+ col: number;
827
+ colSpan: number;
828
+ rowSpan: number;
829
+ } | {
830
+ /** @enum {string} */
831
+ type: "visualization";
832
+ visualizationId: number;
833
+ title: string;
834
+ col: number;
835
+ colSpan: number;
836
+ rowSpan: number;
837
+ })[];
838
+ is_public: boolean;
839
+ };
840
+ };
841
+ };
842
+ /** @description Unable to retrieve dashboard with this id */
843
+ 404: {
844
+ headers: {
845
+ [name: string]: unknown;
846
+ };
847
+ content: {
848
+ "application/json": {
849
+ error: string;
850
+ };
851
+ };
852
+ };
853
+ /** @description Something wrong happened */
854
+ 500: {
855
+ headers: {
856
+ [name: string]: unknown;
857
+ };
858
+ content: {
859
+ "application/json": {
860
+ error: string;
861
+ };
862
+ };
863
+ };
864
+ };
865
+ };
866
+ getPublicDataReportColumns: {
867
+ parameters: {
868
+ query?: never;
869
+ header?: never;
870
+ path: {
871
+ report_id: string;
872
+ dashboard_id: components["schemas"]["DashboardId"];
873
+ };
874
+ cookie?: never;
875
+ };
876
+ requestBody?: never;
877
+ responses: {
878
+ /** @description A list containing the columns of the report */
879
+ 200: {
880
+ headers: {
881
+ [name: string]: unknown;
882
+ };
883
+ content: {
884
+ "application/json": components["schemas"]["ReportColumns"];
885
+ };
886
+ };
887
+ /** @description Unable to retrieve report with this id */
888
+ 404: {
889
+ headers: {
890
+ [name: string]: unknown;
891
+ };
892
+ content: {
893
+ "application/json": {
894
+ error: string;
895
+ };
896
+ };
897
+ };
898
+ /** @description Something wrong happened */
899
+ 500: {
900
+ headers: {
901
+ [name: string]: unknown;
902
+ };
903
+ content: {
904
+ "application/json": {
905
+ error: string;
906
+ };
907
+ };
908
+ };
909
+ };
910
+ };
911
+ getPublicDataReportData: {
912
+ parameters: {
913
+ query?: {
914
+ limit?: number;
915
+ /** @example name:asc,date:desc */
916
+ order?: string;
917
+ cursor?: number;
918
+ /** @example status:active,name:John%20Doe */
919
+ filter?: string;
920
+ };
921
+ header?: never;
922
+ path: {
923
+ report_id: string;
924
+ dashboard_id: components["schemas"]["DashboardId"];
925
+ };
926
+ cookie?: never;
927
+ };
928
+ requestBody?: never;
929
+ responses: {
930
+ /** @description The content of the report */
931
+ 200: {
932
+ headers: {
933
+ [name: string]: unknown;
934
+ };
935
+ content: {
936
+ "application/json": components["schemas"]["ReportData"];
937
+ };
938
+ };
939
+ /** @description Unable to retrieve report with this id */
940
+ 404: {
941
+ headers: {
942
+ [name: string]: unknown;
943
+ };
944
+ content: {
945
+ "application/json": {
946
+ error: string;
947
+ };
948
+ };
949
+ };
950
+ /** @description Something wrong happened */
951
+ 500: {
952
+ headers: {
953
+ [name: string]: unknown;
954
+ };
955
+ content: {
956
+ "application/json": {
957
+ error: string;
958
+ };
959
+ };
960
+ };
961
+ };
962
+ };
963
+ getPublicDataReportRowCount: {
964
+ parameters: {
965
+ query?: never;
966
+ header?: never;
967
+ path: {
968
+ report_id: string;
969
+ dashboard_id: components["schemas"]["DashboardId"];
970
+ };
971
+ cookie?: never;
972
+ };
973
+ requestBody?: never;
974
+ responses: {
975
+ /** @description The total count of rows in the report */
976
+ 200: {
977
+ headers: {
978
+ [name: string]: unknown;
979
+ };
980
+ content: {
981
+ "application/json": {
982
+ /** @description Total number of rows in the report */
983
+ count: number;
984
+ };
985
+ };
986
+ };
987
+ /** @description Unable to retrieve report with this id */
988
+ 404: {
989
+ headers: {
990
+ [name: string]: unknown;
991
+ };
992
+ content: {
993
+ "application/json": {
994
+ error: string;
995
+ };
996
+ };
997
+ };
998
+ /** @description Something wrong happened */
999
+ 500: {
1000
+ headers: {
1001
+ [name: string]: unknown;
1002
+ };
1003
+ content: {
1004
+ "application/json": {
1005
+ error: string;
1006
+ };
1007
+ };
1008
+ };
1009
+ };
1010
+ };
1011
+ runEnd2EndFlow: {
1012
+ parameters: {
1013
+ query?: never;
1014
+ header: {
1015
+ "sp-access-token": string;
1016
+ };
1017
+ path?: never;
1018
+ cookie?: never;
1019
+ };
1020
+ requestBody: {
1021
+ content: {
1022
+ "application/json": {
1023
+ userQuery: string;
1024
+ /** @default true */
1025
+ isNewAnalysisGoal?: boolean;
1026
+ /**
1027
+ * @default complex
1028
+ * @enum {string}
1029
+ */
1030
+ difficultyLevel?: "simple" | "moderate" | "complex";
1031
+ };
1032
+ };
1033
+ };
1034
+ responses: {
1035
+ /** @description Run the end2end flow */
1036
+ 200: {
1037
+ headers: {
1038
+ [name: string]: unknown;
1039
+ };
1040
+ content: {
1041
+ "application/json": {
1042
+ /** @enum {string} */
1043
+ status: "error";
1044
+ error: string;
1045
+ } | {
1046
+ /** @enum {string} */
1047
+ status: "success";
1048
+ flowId: string;
1049
+ };
1050
+ };
1051
+ };
1052
+ };
1053
+ };
1054
+ retrieveFlow: {
1055
+ parameters: {
1056
+ query?: never;
1057
+ header: {
1058
+ "sp-access-token": string;
1059
+ };
1060
+ path: {
1061
+ flowId: string;
1062
+ };
1063
+ cookie?: never;
1064
+ };
1065
+ requestBody?: never;
1066
+ responses: {
1067
+ /** @description The flow with its steps */
1068
+ 200: {
1069
+ headers: {
1070
+ [name: string]: unknown;
1071
+ };
1072
+ content: {
1073
+ "application/json": {
1074
+ created_at: string;
1075
+ id: string;
1076
+ request: string;
1077
+ user_id: string | null;
1078
+ user_friendly_goal?: string;
1079
+ has_chat_messages: boolean;
1080
+ };
1081
+ };
1082
+ };
1083
+ /** @description Unable to retrieve flow with this id */
1084
+ 404: {
1085
+ headers: {
1086
+ [name: string]: unknown;
1087
+ };
1088
+ content: {
1089
+ "application/json": {
1090
+ error: string;
1091
+ };
1092
+ };
1093
+ };
1094
+ /** @description Something wrong happened */
1095
+ 500: {
1096
+ headers: {
1097
+ [name: string]: unknown;
1098
+ };
1099
+ content: {
1100
+ "application/json": {
1101
+ error: string;
1102
+ };
1103
+ };
1104
+ };
1105
+ };
1106
+ };
1107
+ retrieveRecentFlows: {
1108
+ parameters: {
1109
+ query?: {
1110
+ limit?: number;
1111
+ };
1112
+ header: {
1113
+ "sp-access-token": string;
1114
+ };
1115
+ path?: never;
1116
+ cookie?: never;
1117
+ };
1118
+ requestBody?: never;
1119
+ responses: {
1120
+ /** @description A list of recent flows */
1121
+ 200: {
1122
+ headers: {
1123
+ [name: string]: unknown;
1124
+ };
1125
+ content: {
1126
+ "application/json": {
1127
+ created_at: string;
1128
+ id: string;
1129
+ request: string;
1130
+ user_id: string | null;
1131
+ }[];
1132
+ };
1133
+ };
1134
+ /** @description Something wrong happened */
1135
+ 500: {
1136
+ headers: {
1137
+ [name: string]: unknown;
1138
+ };
1139
+ content: {
1140
+ "application/json": {
1141
+ error: string;
1142
+ };
1143
+ };
1144
+ };
1145
+ };
1146
+ };
1147
+ retrieveFlowDataReports: {
1148
+ parameters: {
1149
+ query?: never;
1150
+ header: {
1151
+ "sp-access-token": string;
1152
+ };
1153
+ path: {
1154
+ flowId: string;
1155
+ };
1156
+ cookie?: never;
1157
+ };
1158
+ requestBody?: never;
1159
+ responses: {
1160
+ /** @description The data reports associated with the flow */
1161
+ 200: {
1162
+ headers: {
1163
+ [name: string]: unknown;
1164
+ };
1165
+ content: {
1166
+ "application/json": {
1167
+ created_at: string;
1168
+ flow_id: string;
1169
+ id: number;
1170
+ title: string;
1171
+ request: string | null;
1172
+ data_summary: {
1173
+ columns: {
1174
+ [key: string]: {
1175
+ position?: number;
1176
+ data_type: string;
1177
+ null_count: number | null;
1178
+ unique_count: number | null;
1179
+ unique_percentage: number | null;
1180
+ };
1181
+ };
1182
+ };
1183
+ bookmarked: boolean;
1184
+ status: string | null;
1185
+ }[];
1186
+ };
1187
+ };
1188
+ /** @description Unable to retrieve flow with this id */
1189
+ 404: {
1190
+ headers: {
1191
+ [name: string]: unknown;
1192
+ };
1193
+ content: {
1194
+ "application/json": {
1195
+ error: string;
1196
+ };
1197
+ };
1198
+ };
1199
+ /** @description Something wrong happened */
1200
+ 500: {
1201
+ headers: {
1202
+ [name: string]: unknown;
1203
+ };
1204
+ content: {
1205
+ "application/json": {
1206
+ error: string;
1207
+ };
1208
+ };
1209
+ };
1210
+ };
1211
+ };
1212
+ getDataReportFeedback: {
1213
+ parameters: {
1214
+ query?: never;
1215
+ header: {
1216
+ "sp-access-token": string;
1217
+ };
1218
+ path: {
1219
+ report_id: string;
1220
+ };
1221
+ cookie?: never;
1222
+ };
1223
+ requestBody?: never;
1224
+ responses: {
1225
+ /** @description The feedback for the report */
1226
+ 200: {
1227
+ headers: {
1228
+ [name: string]: unknown;
1229
+ };
1230
+ content: {
1231
+ "application/json": {
1232
+ created_at: string;
1233
+ flow_data_id: number;
1234
+ /** @enum {string} */
1235
+ helpfulness: "helpful" | "partially helpful" | "not helpful" | "incorrect";
1236
+ id: number;
1237
+ } | null;
1238
+ };
1239
+ };
1240
+ /** @description Unable to retrieve feedback */
1241
+ 404: {
1242
+ headers: {
1243
+ [name: string]: unknown;
1244
+ };
1245
+ content: {
1246
+ "application/json": {
1247
+ error: string;
1248
+ };
1249
+ };
1250
+ };
1251
+ /** @description Something wrong happened */
1252
+ 500: {
1253
+ headers: {
1254
+ [name: string]: unknown;
1255
+ };
1256
+ content: {
1257
+ "application/json": {
1258
+ error: string;
1259
+ };
1260
+ };
1261
+ };
1262
+ };
1263
+ };
1264
+ upsertReportFeedback: {
1265
+ parameters: {
1266
+ query?: never;
1267
+ header: {
1268
+ "sp-access-token": string;
1269
+ };
1270
+ path: {
1271
+ report_id: string;
1272
+ };
1273
+ cookie?: never;
1274
+ };
1275
+ /** @description The feedback for the flow data */
1276
+ requestBody: {
1277
+ content: {
1278
+ "application/json": {
1279
+ /** @enum {string} */
1280
+ helpfulness: "helpful" | "partially helpful" | "not helpful" | "incorrect";
1281
+ };
1282
+ };
1283
+ };
1284
+ responses: {
1285
+ /** @description Successfully upserted feedback */
1286
+ 200: {
1287
+ headers: {
1288
+ [name: string]: unknown;
1289
+ };
1290
+ content?: never;
1291
+ };
1292
+ /** @description Something wrong happened */
1293
+ 500: {
1294
+ headers: {
1295
+ [name: string]: unknown;
1296
+ };
1297
+ content: {
1298
+ "application/json": {
1299
+ error: string;
1300
+ };
1301
+ };
1302
+ };
1303
+ };
1304
+ };
1305
+ deleteReportFeedback: {
1306
+ parameters: {
1307
+ query?: never;
1308
+ header: {
1309
+ "sp-access-token": string;
1310
+ };
1311
+ path: {
1312
+ report_id: string;
1313
+ };
1314
+ cookie?: never;
1315
+ };
1316
+ requestBody?: never;
1317
+ responses: {
1318
+ /** @description Successfully deleted feedback */
1319
+ 200: {
1320
+ headers: {
1321
+ [name: string]: unknown;
1322
+ };
1323
+ content?: never;
1324
+ };
1325
+ /** @description Unable to retrieve feedback */
1326
+ 404: {
1327
+ headers: {
1328
+ [name: string]: unknown;
1329
+ };
1330
+ content: {
1331
+ "application/json": {
1332
+ error: string;
1333
+ };
1334
+ };
1335
+ };
1336
+ /** @description Something wrong happened */
1337
+ 500: {
1338
+ headers: {
1339
+ [name: string]: unknown;
1340
+ };
1341
+ content: {
1342
+ "application/json": {
1343
+ error: string;
1344
+ };
1345
+ };
1346
+ };
1347
+ };
1348
+ };
1349
+ retrieveLatestDataReportStatus: {
1350
+ parameters: {
1351
+ query?: never;
1352
+ header: {
1353
+ "sp-access-token": string;
1354
+ };
1355
+ path: {
1356
+ flowId: string;
1357
+ };
1358
+ cookie?: never;
1359
+ };
1360
+ requestBody?: never;
1361
+ responses: {
1362
+ /** @description The status of the latest flow data for a given flow */
1363
+ 200: {
1364
+ headers: {
1365
+ [name: string]: unknown;
1366
+ };
1367
+ content: {
1368
+ "application/json": {
1369
+ status: string | null;
1370
+ };
1371
+ };
1372
+ };
1373
+ /** @description Unable to retrieve status for latest flow data of flow with this id */
1374
+ 404: {
1375
+ headers: {
1376
+ [name: string]: unknown;
1377
+ };
1378
+ content: {
1379
+ "application/json": {
1380
+ error: string;
1381
+ };
1382
+ };
1383
+ };
1384
+ /** @description Something wrong happened */
1385
+ 500: {
1386
+ headers: {
1387
+ [name: string]: unknown;
1388
+ };
1389
+ content: {
1390
+ "application/json": {
1391
+ error: string;
1392
+ };
1393
+ };
1394
+ };
1395
+ };
1396
+ };
1397
+ getDataReportExplainability: {
1398
+ parameters: {
1399
+ query?: never;
1400
+ header: {
1401
+ "sp-access-token": string;
1402
+ };
1403
+ path: {
1404
+ report_id: string;
1405
+ };
1406
+ cookie?: never;
1407
+ };
1408
+ requestBody?: never;
1409
+ responses: {
1410
+ /** @description The explainability of the report */
1411
+ 200: {
1412
+ headers: {
1413
+ [name: string]: unknown;
1414
+ };
1415
+ content: {
1416
+ "application/json": {
1417
+ sql_explanation?: {
1418
+ chunk_title: string;
1419
+ chunk_explanation: string;
1420
+ lines: {
1421
+ sql: string;
1422
+ explanation: string;
1423
+ }[];
1424
+ }[] | null;
1425
+ business_explanation?: {
1426
+ summary: string;
1427
+ implementation: string[];
1428
+ assumptions: {
1429
+ /** @enum {string} */
1430
+ type: "grain" | "completeness" | "transformation" | "relationship" | "other";
1431
+ details: string;
1432
+ explanation: string;
1433
+ }[];
1434
+ } | null;
1435
+ columns_lineage?: {
1436
+ [key: string]: {
1437
+ nodes: {
1438
+ id: string;
1439
+ /** @enum {string} */
1440
+ type: "entity" | "attribute" | "filter" | "process" | "combine" | "result";
1441
+ explanation: string;
1442
+ }[];
1443
+ edges: {
1444
+ source: string;
1445
+ target: string;
1446
+ }[];
1447
+ };
1448
+ } | null;
1449
+ confidence_score: number;
1450
+ confidence_score_reason: string;
1451
+ assumptions_score?: number;
1452
+ assumptions_score_reason?: string;
1453
+ friendliness_score?: number;
1454
+ friendliness_score_reason?: string;
1455
+ flow_data_id: number;
1456
+ };
1457
+ };
1458
+ };
1459
+ /** @description Unable to retrieve report with this id */
1460
+ 404: {
1461
+ headers: {
1462
+ [name: string]: unknown;
1463
+ };
1464
+ content: {
1465
+ "application/json": {
1466
+ error: string;
1467
+ };
1468
+ };
1469
+ };
1470
+ /** @description Something wrong happened */
1471
+ 500: {
1472
+ headers: {
1473
+ [name: string]: unknown;
1474
+ };
1475
+ content: {
1476
+ "application/json": {
1477
+ error: string;
1478
+ };
1479
+ };
1480
+ };
1481
+ };
1482
+ };
1483
+ toggleBookmark: {
1484
+ parameters: {
1485
+ query?: never;
1486
+ header: {
1487
+ "sp-access-token": string;
1488
+ };
1489
+ path?: never;
1490
+ cookie?: never;
1491
+ };
1492
+ /** @description Toggle bookmark for timeline item */
1493
+ requestBody: {
1494
+ content: {
1495
+ "application/json": {
1496
+ /** @enum {string} */
1497
+ type: "dataReport";
1498
+ flowDataId: number;
1499
+ bookmarked: boolean;
1500
+ } | {
1501
+ /** @enum {string} */
1502
+ type: "visualization";
1503
+ flowDataVisualizationId: number;
1504
+ bookmarked: boolean;
1505
+ };
1506
+ };
1507
+ };
1508
+ responses: {
1509
+ /** @description Successfully toggled bookmark */
1510
+ 200: {
1511
+ headers: {
1512
+ [name: string]: unknown;
1513
+ };
1514
+ content: {
1515
+ "application/json": {
1516
+ success: boolean;
1517
+ bookmarked: boolean;
1518
+ };
1519
+ };
1520
+ };
1521
+ /** @description Timeline item not found */
1522
+ 404: {
1523
+ headers: {
1524
+ [name: string]: unknown;
1525
+ };
1526
+ content: {
1527
+ "application/json": {
1528
+ error: string;
1529
+ };
1530
+ };
1531
+ };
1532
+ /** @description Something wrong happened */
1533
+ 500: {
1534
+ headers: {
1535
+ [name: string]: unknown;
1536
+ };
1537
+ content: {
1538
+ "application/json": {
1539
+ error: string;
1540
+ };
1541
+ };
1542
+ };
1543
+ };
1544
+ };
1545
+ retrieveLatestDataRefresh: {
1546
+ parameters: {
1547
+ query?: never;
1548
+ header: {
1549
+ "sp-access-token": string;
1550
+ };
1551
+ path?: never;
1552
+ cookie?: never;
1553
+ };
1554
+ requestBody?: never;
1555
+ responses: {
1556
+ /** @description The latest data refresh */
1557
+ 200: {
1558
+ headers: {
1559
+ [name: string]: unknown;
1560
+ };
1561
+ content: {
1562
+ "application/json": {
1563
+ updated_at: string;
1564
+ };
1565
+ };
1566
+ };
1567
+ /** @description Unable to retrieve latest data refresh */
1568
+ 404: {
1569
+ headers: {
1570
+ [name: string]: unknown;
1571
+ };
1572
+ content: {
1573
+ "application/json": {
1574
+ error: string;
1575
+ };
1576
+ };
1577
+ };
1578
+ /** @description Something wrong happened */
1579
+ 500: {
1580
+ headers: {
1581
+ [name: string]: unknown;
1582
+ };
1583
+ content: {
1584
+ "application/json": {
1585
+ error: string;
1586
+ };
1587
+ };
1588
+ };
1589
+ };
1590
+ };
1591
+ exportReportData: {
1592
+ parameters: {
1593
+ query?: never;
1594
+ header: {
1595
+ "sp-access-token": string;
1596
+ };
1597
+ path: {
1598
+ report_id: string;
1599
+ };
1600
+ cookie?: never;
1601
+ };
1602
+ requestBody?: never;
1603
+ responses: {
1604
+ /** @description The report data exported in CSV format */
1605
+ 200: {
1606
+ headers: {
1607
+ [name: string]: unknown;
1608
+ };
1609
+ content: {
1610
+ "text/csv": string;
1611
+ };
1612
+ };
1613
+ /** @description Unable to retrieve flow with this id */
1614
+ 404: {
1615
+ headers: {
1616
+ [name: string]: unknown;
1617
+ };
1618
+ content: {
1619
+ "application/json": {
1620
+ error: string;
1621
+ };
1622
+ };
1623
+ };
1624
+ /** @description Something wrong happened */
1625
+ 500: {
1626
+ headers: {
1627
+ [name: string]: unknown;
1628
+ };
1629
+ content: {
1630
+ "application/json": {
1631
+ error: string;
1632
+ };
1633
+ };
1634
+ };
1635
+ };
1636
+ };
1637
+ getDataReportColumns: {
1638
+ parameters: {
1639
+ query?: never;
1640
+ header: {
1641
+ "sp-access-token": string;
1642
+ };
1643
+ path: {
1644
+ report_id: string;
1645
+ };
1646
+ cookie?: never;
1647
+ };
1648
+ requestBody?: never;
1649
+ responses: {
1650
+ /** @description A list containing the columns of the report */
1651
+ 200: {
1652
+ headers: {
1653
+ [name: string]: unknown;
1654
+ };
1655
+ content: {
1656
+ "application/json": components["schemas"]["ReportColumns"];
1657
+ };
1658
+ };
1659
+ /** @description Unable to retrieve report with this id */
1660
+ 404: {
1661
+ headers: {
1662
+ [name: string]: unknown;
1663
+ };
1664
+ content: {
1665
+ "application/json": {
1666
+ error: string;
1667
+ };
1668
+ };
1669
+ };
1670
+ /** @description Something wrong happened */
1671
+ 500: {
1672
+ headers: {
1673
+ [name: string]: unknown;
1674
+ };
1675
+ content: {
1676
+ "application/json": {
1677
+ error: string;
1678
+ };
1679
+ };
1680
+ };
1681
+ };
1682
+ };
1683
+ getDataReportData: {
1684
+ parameters: {
1685
+ query?: {
1686
+ /** @example name,date */
1687
+ columns?: string;
1688
+ limit?: number;
1689
+ /** @example name:asc,date:desc */
1690
+ order?: string;
1691
+ cursor?: number;
1692
+ /** @example status:active,name:John%20Doe */
1693
+ filter?: string;
1694
+ };
1695
+ header: {
1696
+ "sp-access-token": string;
1697
+ };
1698
+ path: {
1699
+ report_id: string;
1700
+ };
1701
+ cookie?: never;
1702
+ };
1703
+ requestBody?: never;
1704
+ responses: {
1705
+ /** @description The content of the report */
1706
+ 200: {
1707
+ headers: {
1708
+ [name: string]: unknown;
1709
+ };
1710
+ content: {
1711
+ "application/json": components["schemas"]["ReportData"];
1712
+ };
1713
+ };
1714
+ /** @description Unable to retrieve report with this id */
1715
+ 404: {
1716
+ headers: {
1717
+ [name: string]: unknown;
1718
+ };
1719
+ content: {
1720
+ "application/json": {
1721
+ error: string;
1722
+ };
1723
+ };
1724
+ };
1725
+ /** @description Something wrong happened */
1726
+ 500: {
1727
+ headers: {
1728
+ [name: string]: unknown;
1729
+ };
1730
+ content: {
1731
+ "application/json": {
1732
+ error: string;
1733
+ };
1734
+ };
1735
+ };
1736
+ };
1737
+ };
1738
+ getDataReportRowCount: {
1739
+ parameters: {
1740
+ query?: never;
1741
+ header: {
1742
+ "sp-access-token": string;
1743
+ };
1744
+ path: {
1745
+ report_id: string;
1746
+ };
1747
+ cookie?: never;
1748
+ };
1749
+ requestBody?: never;
1750
+ responses: {
1751
+ /** @description The total count of rows in the report */
1752
+ 200: {
1753
+ headers: {
1754
+ [name: string]: unknown;
1755
+ };
1756
+ content: {
1757
+ "application/json": {
1758
+ /** @description Total number of rows in the report */
1759
+ count: number;
1760
+ };
1761
+ };
1762
+ };
1763
+ /** @description Unable to retrieve report with this id */
1764
+ 404: {
1765
+ headers: {
1766
+ [name: string]: unknown;
1767
+ };
1768
+ content: {
1769
+ "application/json": {
1770
+ error: string;
1771
+ };
1772
+ };
1773
+ };
1774
+ /** @description Something wrong happened */
1775
+ 500: {
1776
+ headers: {
1777
+ [name: string]: unknown;
1778
+ };
1779
+ content: {
1780
+ "application/json": {
1781
+ error: string;
1782
+ };
1783
+ };
1784
+ };
1785
+ };
1786
+ };
1787
+ getDataReport: {
1788
+ parameters: {
1789
+ query?: never;
1790
+ header: {
1791
+ "sp-access-token": string;
1792
+ };
1793
+ path: {
1794
+ report_id: string;
1795
+ };
1796
+ cookie?: never;
1797
+ };
1798
+ requestBody?: never;
1799
+ responses: {
1800
+ /** @description The visualizations for the report */
1801
+ 200: {
1802
+ headers: {
1803
+ [name: string]: unknown;
1804
+ };
1805
+ content: {
1806
+ "application/json": {
1807
+ created_at: string;
1808
+ flow_id: string;
1809
+ id: number;
1810
+ title: string;
1811
+ request: string | null;
1812
+ data_summary: {
1813
+ columns: {
1814
+ [key: string]: {
1815
+ position?: number;
1816
+ data_type: string;
1817
+ null_count: number | null;
1818
+ unique_count: number | null;
1819
+ unique_percentage: number | null;
1820
+ };
1821
+ };
1822
+ };
1823
+ bookmarked: boolean;
1824
+ status: string | null;
1825
+ };
1826
+ };
1827
+ };
1828
+ /** @description Unable to retrieve report with this id */
1829
+ 404: {
1830
+ headers: {
1831
+ [name: string]: unknown;
1832
+ };
1833
+ content: {
1834
+ "application/json": {
1835
+ error: string;
1836
+ };
1837
+ };
1838
+ };
1839
+ /** @description Something wrong happened */
1840
+ 500: {
1841
+ headers: {
1842
+ [name: string]: unknown;
1843
+ };
1844
+ content: {
1845
+ "application/json": {
1846
+ error: string;
1847
+ };
1848
+ };
1849
+ };
1850
+ };
1851
+ };
1852
+ createFlow: {
1853
+ parameters: {
1854
+ query?: never;
1855
+ header: {
1856
+ "sp-access-token": string;
1857
+ };
1858
+ path?: never;
1859
+ cookie?: never;
1860
+ };
1861
+ requestBody: {
1862
+ content: {
1863
+ "application/json": {
1864
+ userQuery: string;
1865
+ };
1866
+ };
1867
+ };
1868
+ responses: {
1869
+ /** @description Create a new flow */
1870
+ 200: {
1871
+ headers: {
1872
+ [name: string]: unknown;
1873
+ };
1874
+ content: {
1875
+ "application/json": {
1876
+ /** @enum {string} */
1877
+ status: "success";
1878
+ flowId: string;
1879
+ };
1880
+ };
1881
+ };
1882
+ /** @description Something wrong happened */
1883
+ 500: {
1884
+ headers: {
1885
+ [name: string]: unknown;
1886
+ };
1887
+ content: {
1888
+ "application/json": {
1889
+ error: string;
1890
+ };
1891
+ };
1892
+ };
1893
+ };
1894
+ };
1895
+ retrieveChatTimeline: {
1896
+ parameters: {
1897
+ query?: never;
1898
+ header: {
1899
+ "sp-access-token": string;
1900
+ };
1901
+ path: {
1902
+ flowId: string;
1903
+ };
1904
+ cookie?: never;
1905
+ };
1906
+ requestBody?: never;
1907
+ responses: {
1908
+ /** @description The timeline of generated insights for the flow */
1909
+ 200: {
1910
+ headers: {
1911
+ [name: string]: unknown;
1912
+ };
1913
+ content: {
1914
+ "application/json": ({
1915
+ /** @enum {string} */
1916
+ type: "dataReport";
1917
+ flowDataId: number;
1918
+ flowId: string;
1919
+ title: string;
1920
+ bookmarked: boolean;
1921
+ answer: string | null;
1922
+ } | {
1923
+ /** @enum {string} */
1924
+ type: "visualization";
1925
+ flowId: string;
1926
+ flowDataId: number;
1927
+ flowDataVisualizationId: number;
1928
+ title: string;
1929
+ bookmarked: boolean;
1930
+ } | {
1931
+ /** @enum {string} */
1932
+ type: "message";
1933
+ })[];
1934
+ };
1935
+ };
1936
+ /** @description Unable to retrieve flow with this id */
1937
+ 404: {
1938
+ headers: {
1939
+ [name: string]: unknown;
1940
+ };
1941
+ content: {
1942
+ "application/json": {
1943
+ error: string;
1944
+ };
1945
+ };
1946
+ };
1947
+ /** @description Something wrong happened */
1948
+ 500: {
1949
+ headers: {
1950
+ [name: string]: unknown;
1951
+ };
1952
+ content: {
1953
+ "application/json": {
1954
+ error: string;
1955
+ };
1956
+ };
1957
+ };
1958
+ };
1959
+ };
1960
+ retrieveChatMessages: {
1961
+ parameters: {
1962
+ query?: never;
1963
+ header: {
1964
+ "sp-access-token": string;
1965
+ };
1966
+ path: {
1967
+ flowId: string;
1968
+ };
1969
+ cookie?: never;
1970
+ };
1971
+ requestBody?: never;
1972
+ responses: {
1973
+ /** @description The messages from the given flow */
1974
+ 200: {
1975
+ headers: {
1976
+ [name: string]: unknown;
1977
+ };
1978
+ content: {
1979
+ "application/json": {
1980
+ messages: Record<string, unknown>[];
1981
+ };
1982
+ };
1983
+ };
1984
+ /** @description Unable to retrieve flow with this id */
1985
+ 404: {
1986
+ headers: {
1987
+ [name: string]: unknown;
1988
+ };
1989
+ content: {
1990
+ "application/json": {
1991
+ error: string;
1992
+ };
1993
+ };
1994
+ };
1995
+ /** @description Something wrong happened */
1996
+ 500: {
1997
+ headers: {
1998
+ [name: string]: unknown;
1999
+ };
2000
+ content: {
2001
+ "application/json": {
2002
+ error: string;
2003
+ };
2004
+ };
2005
+ };
2006
+ };
2007
+ };
2008
+ getStarterRecommendations: {
2009
+ parameters: {
2010
+ query?: {
2011
+ count?: number;
2012
+ };
2013
+ header: {
2014
+ "sp-access-token": string;
2015
+ };
2016
+ path?: never;
2017
+ cookie?: never;
2018
+ };
2019
+ requestBody?: never;
2020
+ responses: {
2021
+ /** @description Get starter recommendations */
2022
+ 200: {
2023
+ headers: {
2024
+ [name: string]: unknown;
2025
+ };
2026
+ content: {
2027
+ "application/json": {
2028
+ recommendations: components["schemas"]["StarterRecommendation"][];
2029
+ };
2030
+ };
2031
+ };
2032
+ /** @description Something wrong happened */
2033
+ 500: {
2034
+ headers: {
2035
+ [name: string]: unknown;
2036
+ };
2037
+ content: {
2038
+ "application/json": {
2039
+ error: string;
2040
+ };
2041
+ };
2042
+ };
2043
+ };
2044
+ };
2045
+ fetchVisualization: {
2046
+ parameters: {
2047
+ query?: never;
2048
+ header: {
2049
+ "sp-access-token": string;
2050
+ };
2051
+ path: {
2052
+ visualization_id: string;
2053
+ };
2054
+ cookie?: never;
2055
+ };
2056
+ requestBody?: never;
2057
+ responses: {
2058
+ /** @description The content of the visualization */
2059
+ 200: {
2060
+ headers: {
2061
+ [name: string]: unknown;
2062
+ };
2063
+ content: {
2064
+ "application/json": components["schemas"]["VisualizationWithData"];
2065
+ };
2066
+ };
2067
+ /** @description Invalid arguments to fetch visualization */
2068
+ 400: {
2069
+ headers: {
2070
+ [name: string]: unknown;
2071
+ };
2072
+ content: {
2073
+ "application/json": {
2074
+ error: string;
2075
+ };
2076
+ };
2077
+ };
2078
+ /** @description Unable to fetch visualization with this id */
2079
+ 404: {
2080
+ headers: {
2081
+ [name: string]: unknown;
2082
+ };
2083
+ content: {
2084
+ "application/json": {
2085
+ error: string;
2086
+ };
2087
+ };
2088
+ };
2089
+ /** @description Something wrong happened */
2090
+ 500: {
2091
+ headers: {
2092
+ [name: string]: unknown;
2093
+ };
2094
+ content: {
2095
+ "application/json": {
2096
+ error: string;
2097
+ };
2098
+ };
2099
+ };
2100
+ };
2101
+ };
2102
+ listVisualizationsForFlow: {
2103
+ parameters: {
2104
+ query?: {
2105
+ flowDataId?: string;
2106
+ };
2107
+ header: {
2108
+ "sp-access-token": string;
2109
+ };
2110
+ path: {
2111
+ flowId: string;
2112
+ };
2113
+ cookie?: never;
2114
+ };
2115
+ requestBody?: never;
2116
+ responses: {
2117
+ /** @description List visualizations for a given flow. Can be filtered by flow data id as well */
2118
+ 200: {
2119
+ headers: {
2120
+ [name: string]: unknown;
2121
+ };
2122
+ content: {
2123
+ "application/json": {
2124
+ id: number;
2125
+ flow_data_id: number;
2126
+ created_at: string;
2127
+ bookmarked: boolean;
2128
+ configuration: {
2129
+ /** @enum {string} */
2130
+ type: "bar";
2131
+ title: string;
2132
+ /** @enum {number} */
2133
+ config_version: 2;
2134
+ xAxisLabel: string;
2135
+ yAxisLabel: string;
2136
+ categoryColumn: string;
2137
+ secondaryCategoryColumn?: string;
2138
+ valueColumn: string;
2139
+ } | {
2140
+ /** @enum {string} */
2141
+ type: "line/area";
2142
+ /** @enum {number} */
2143
+ config_version: 2;
2144
+ title: string;
2145
+ xAxisColumn: string;
2146
+ valueColumns: string[];
2147
+ yAxisLabels: string[];
2148
+ } | {
2149
+ /** @enum {string} */
2150
+ type: "line/area-categorical";
2151
+ title: string;
2152
+ /** @enum {number} */
2153
+ config_version: 2;
2154
+ valueColumn: string;
2155
+ xAxisColumn: string;
2156
+ xAxisLabel: string;
2157
+ yAxisLabel: string;
2158
+ categoryColumn: string;
2159
+ } | {
2160
+ /** @enum {string} */
2161
+ type: "scatter";
2162
+ title: string;
2163
+ /** @enum {number} */
2164
+ config_version: 2;
2165
+ xAxisLabel: string;
2166
+ yAxisLabel: string;
2167
+ xAxisValueColumn: string;
2168
+ yAxisValueColumn: string;
2169
+ } | {
2170
+ /** @enum {string} */
2171
+ type: "pie";
2172
+ title: string;
2173
+ /** @enum {number} */
2174
+ config_version: 2;
2175
+ categoryColumn: string;
2176
+ valueColumn: string;
2177
+ };
2178
+ }[];
2179
+ };
2180
+ };
2181
+ /** @description Invalid arguments to fetch visualization */
2182
+ 400: {
2183
+ headers: {
2184
+ [name: string]: unknown;
2185
+ };
2186
+ content: {
2187
+ "application/json": {
2188
+ error: string;
2189
+ };
2190
+ };
2191
+ };
2192
+ /** @description Unable to list visualizations */
2193
+ 404: {
2194
+ headers: {
2195
+ [name: string]: unknown;
2196
+ };
2197
+ content: {
2198
+ "application/json": {
2199
+ error: string;
2200
+ };
2201
+ };
2202
+ };
2203
+ /** @description Something wrong happened */
2204
+ 500: {
2205
+ headers: {
2206
+ [name: string]: unknown;
2207
+ };
2208
+ content: {
2209
+ "application/json": {
2210
+ error: string;
2211
+ };
2212
+ };
2213
+ };
2214
+ };
2215
+ };
2216
+ triggerFlow: {
2217
+ parameters: {
2218
+ query?: never;
2219
+ header: {
2220
+ "sp-access-token": string;
2221
+ };
2222
+ path?: never;
2223
+ cookie?: never;
2224
+ };
2225
+ /** @description Trigger flow request body */
2226
+ requestBody: {
2227
+ content: {
2228
+ "application/json": {
2229
+ triggerId: string;
2230
+ variables: {
2231
+ [key: string]: string;
2232
+ };
2233
+ };
2234
+ };
2235
+ };
2236
+ responses: {
2237
+ /** @description Flow id */
2238
+ 200: {
2239
+ headers: {
2240
+ [name: string]: unknown;
2241
+ };
2242
+ content: {
2243
+ "application/json": {
2244
+ /** @enum {string} */
2245
+ status: "error";
2246
+ error: string;
2247
+ } | {
2248
+ /** @enum {string} */
2249
+ status: "success";
2250
+ flowId: string;
2251
+ };
2252
+ };
2253
+ };
2254
+ /** @description Invalid template or variable values */
2255
+ 400: {
2256
+ headers: {
2257
+ [name: string]: unknown;
2258
+ };
2259
+ content: {
2260
+ "application/json": {
2261
+ error: string;
2262
+ };
2263
+ };
2264
+ };
2265
+ /** @description Unable to retrieve trigger with this id */
2266
+ 404: {
2267
+ headers: {
2268
+ [name: string]: unknown;
2269
+ };
2270
+ content: {
2271
+ "application/json": {
2272
+ error: string;
2273
+ };
2274
+ };
2275
+ };
2276
+ /** @description Something wrong happened */
2277
+ 500: {
2278
+ headers: {
2279
+ [name: string]: unknown;
2280
+ };
2281
+ content: {
2282
+ "application/json": {
2283
+ error: string;
2284
+ };
2285
+ };
2286
+ };
2287
+ };
2288
+ };
2289
+ retrieveDashboard: {
2290
+ parameters: {
2291
+ query?: never;
2292
+ header: {
2293
+ "sp-access-token": string;
2294
+ };
2295
+ path: {
2296
+ dashboard_id: components["schemas"]["DashboardId"];
2297
+ };
2298
+ cookie?: never;
2299
+ };
2300
+ requestBody?: never;
2301
+ responses: {
2302
+ /** @description The dashboard with the given id */
2303
+ 200: {
2304
+ headers: {
2305
+ [name: string]: unknown;
2306
+ };
2307
+ content: {
2308
+ "application/json": {
2309
+ description: string | null;
2310
+ /** Format: uuid */
2311
+ id: string;
2312
+ name: string;
2313
+ positions: ({
2314
+ /** @enum {string} */
2315
+ type: "data-report";
2316
+ flowId: string;
2317
+ flowDataId: number;
2318
+ title: string;
2319
+ col: number;
2320
+ colSpan: number;
2321
+ rowSpan: number;
2322
+ } | {
2323
+ /** @enum {string} */
2324
+ type: "visualization";
2325
+ visualizationId: number;
2326
+ title: string;
2327
+ col: number;
2328
+ colSpan: number;
2329
+ rowSpan: number;
2330
+ })[];
2331
+ is_public: boolean;
2332
+ };
2333
+ };
2334
+ };
2335
+ /** @description Unable to retrieve dashboard with this id */
2336
+ 404: {
2337
+ headers: {
2338
+ [name: string]: unknown;
2339
+ };
2340
+ content: {
2341
+ "application/json": {
2342
+ error: string;
2343
+ };
2344
+ };
2345
+ };
2346
+ /** @description Something wrong happened */
2347
+ 500: {
2348
+ headers: {
2349
+ [name: string]: unknown;
2350
+ };
2351
+ content: {
2352
+ "application/json": {
2353
+ error: string;
2354
+ };
2355
+ };
2356
+ };
2357
+ };
2358
+ };
2359
+ generateInsight: {
2360
+ parameters: {
2361
+ query?: never;
2362
+ header?: never;
2363
+ path?: never;
2364
+ cookie?: never;
2365
+ };
2366
+ requestBody?: {
2367
+ content: {
2368
+ "application/json": {
2369
+ selected_filter_value: string;
2370
+ custom_id: string;
2371
+ };
2372
+ };
2373
+ };
2374
+ responses: {
2375
+ /** @description Insight generated successfully */
2376
+ 200: {
2377
+ headers: {
2378
+ [name: string]: unknown;
2379
+ };
2380
+ content: {
2381
+ "application/json": {
2382
+ /** @enum {string} */
2383
+ type: "text";
2384
+ insight: string;
2385
+ } | {
2386
+ /** @enum {string} */
2387
+ type: "missing";
2388
+ };
2389
+ };
2390
+ };
2391
+ /** @description Invalid request */
2392
+ 400: {
2393
+ headers: {
2394
+ [name: string]: unknown;
2395
+ };
2396
+ content: {
2397
+ "application/json": {
2398
+ error: string;
2399
+ };
2400
+ };
2401
+ };
2402
+ /** @description Insight not found */
2403
+ 404: {
2404
+ headers: {
2405
+ [name: string]: unknown;
2406
+ };
2407
+ content: {
2408
+ "application/json": {
2409
+ error: string;
2410
+ };
2411
+ };
2412
+ };
2413
+ /** @description Something wrong happened */
2414
+ 500: {
2415
+ headers: {
2416
+ [name: string]: unknown;
2417
+ };
2418
+ content: {
2419
+ "application/json": {
2420
+ error: string;
2421
+ };
2422
+ };
2423
+ };
2424
+ };
2425
+ };
2426
+ createQueryExample: {
2427
+ parameters: {
2428
+ query?: never;
2429
+ header?: never;
2430
+ path?: never;
2431
+ cookie?: never;
2432
+ };
2433
+ requestBody?: {
2434
+ content: {
2435
+ "application/json": {
2436
+ request: string;
2437
+ sql: string;
2438
+ };
2439
+ };
2440
+ };
2441
+ responses: {
2442
+ /** @description Query example created successfully */
2443
+ 200: {
2444
+ headers: {
2445
+ [name: string]: unknown;
2446
+ };
2447
+ content: {
2448
+ "application/json": {
2449
+ id: number;
2450
+ };
2451
+ };
2452
+ };
2453
+ /** @description Something wrong happened */
2454
+ 500: {
2455
+ headers: {
2456
+ [name: string]: unknown;
2457
+ };
2458
+ content: {
2459
+ "application/json": {
2460
+ error: string;
2461
+ };
2462
+ };
2463
+ };
2464
+ };
2465
+ };
2466
+ updateQueryExample: {
2467
+ parameters: {
2468
+ query?: never;
2469
+ header?: never;
2470
+ path: {
2471
+ id: string;
2472
+ };
2473
+ cookie?: never;
2474
+ };
2475
+ requestBody?: {
2476
+ content: {
2477
+ "application/json": {
2478
+ request?: string;
2479
+ sql?: string;
2480
+ is_active?: boolean;
2481
+ is_removed?: boolean;
2482
+ };
2483
+ };
2484
+ };
2485
+ responses: {
2486
+ /** @description Query example updated successfully */
2487
+ 200: {
2488
+ headers: {
2489
+ [name: string]: unknown;
2490
+ };
2491
+ content: {
2492
+ "application/json": {
2493
+ id: number;
2494
+ };
2495
+ };
2496
+ };
2497
+ /** @description Something wrong happened */
2498
+ 500: {
2499
+ headers: {
2500
+ [name: string]: unknown;
2501
+ };
2502
+ content: {
2503
+ "application/json": {
2504
+ error: string;
2505
+ };
2506
+ };
2507
+ };
2508
+ };
2509
+ };
2510
+ sqlPreview: {
2511
+ parameters: {
2512
+ query?: never;
2513
+ header?: never;
2514
+ path?: never;
2515
+ cookie?: never;
2516
+ };
2517
+ requestBody?: {
2518
+ content: {
2519
+ "application/json": {
2520
+ sql: string;
2521
+ };
2522
+ };
2523
+ };
2524
+ responses: {
2525
+ /** @description SQL query executed successfully */
2526
+ 200: {
2527
+ headers: {
2528
+ [name: string]: unknown;
2529
+ };
2530
+ content: {
2531
+ "application/json": {
2532
+ columns: {
2533
+ id: string;
2534
+ accessorKey: string;
2535
+ header: string;
2536
+ cell?: unknown;
2537
+ meta?: {
2538
+ [key: string]: unknown;
2539
+ };
2540
+ }[];
2541
+ data: {
2542
+ [key: string]: unknown;
2543
+ }[];
2544
+ metadata?: {
2545
+ wasSampled: boolean;
2546
+ originalCount: number;
2547
+ sampledCount: number;
2548
+ };
2549
+ };
2550
+ };
2551
+ };
2552
+ /** @description Invalid SQL query or request */
2553
+ 400: {
2554
+ headers: {
2555
+ [name: string]: unknown;
2556
+ };
2557
+ content: {
2558
+ "application/json": {
2559
+ error: string;
2560
+ };
2561
+ };
2562
+ };
2563
+ /** @description Internal server error */
2564
+ 500: {
2565
+ headers: {
2566
+ [name: string]: unknown;
2567
+ };
2568
+ content: {
2569
+ "application/json": {
2570
+ error: string;
2571
+ };
2572
+ };
2573
+ };
2574
+ };
2575
+ };
2576
+ listSankeyUserFilters: {
2577
+ parameters: {
2578
+ query?: never;
2579
+ header?: never;
2580
+ path?: never;
2581
+ cookie?: never;
2582
+ };
2583
+ requestBody?: never;
2584
+ responses: {
2585
+ /** @description List of available user filters */
2586
+ 200: {
2587
+ headers: {
2588
+ [name: string]: unknown;
2589
+ };
2590
+ content: {
2591
+ "application/json": {
2592
+ id: number;
2593
+ field_key: string;
2594
+ display_name: string;
2595
+ /** @default true */
2596
+ is_active: boolean;
2597
+ /** @default false */
2598
+ include_visualization: boolean;
2599
+ values: (string | {
2600
+ label: string;
2601
+ value: string;
2602
+ })[];
2603
+ }[];
2604
+ };
2605
+ };
2606
+ /** @description Something wrong happened */
2607
+ 500: {
2608
+ headers: {
2609
+ [name: string]: unknown;
2610
+ };
2611
+ content: {
2612
+ "application/json": {
2613
+ error: string;
2614
+ };
2615
+ };
2616
+ };
2617
+ };
2618
+ };
2619
+ getSankeyData: {
2620
+ parameters: {
2621
+ query?: {
2622
+ user_id?: string;
2623
+ cluster_id?: number | null;
2624
+ subcluster_id?: number | null;
2625
+ /** @description Comma-separated list of bins: lt0.6,0.6-0.8,0.8-1 (applies to average score) */
2626
+ score_ranges?: string;
2627
+ /** @description JSON-encoded map of { [field_key]: string[] } to be passed to RPC */
2628
+ external_filters?: string;
2629
+ max_results?: number;
2630
+ };
2631
+ header?: never;
2632
+ path?: never;
2633
+ cookie?: never;
2634
+ };
2635
+ requestBody?: never;
2636
+ responses: {
2637
+ /** @description Sankey data retrieved successfully */
2638
+ 200: {
2639
+ headers: {
2640
+ [name: string]: unknown;
2641
+ };
2642
+ content: {
2643
+ "application/json": {
2644
+ metadata: {
2645
+ total_clusters: number;
2646
+ total_requests: number;
2647
+ generation_timestamp: string;
2648
+ };
2649
+ clusters: {
2650
+ cluster_id: number;
2651
+ subcluster_id?: number | null;
2652
+ cluster_name: string;
2653
+ representative_questions: {
2654
+ subcluster_id: number;
2655
+ question: string;
2656
+ count: number;
2657
+ sample_requests: string[];
2658
+ avg_confidence_score?: number | null;
2659
+ avg_assumptions_score?: number | null;
2660
+ avg_friendliness_score?: number | null;
2661
+ }[];
2662
+ count: number;
2663
+ avg_confidence_score?: number | null;
2664
+ avg_assumptions_score?: number | null;
2665
+ avg_friendliness_score?: number | null;
2666
+ }[];
2667
+ rows?: {
2668
+ flow_data_id: number;
2669
+ company_id: number;
2670
+ main_cluster_id: number;
2671
+ main_cluster_name: string;
2672
+ subcluster_id: number | null;
2673
+ subcluster_name: string | null;
2674
+ core_question: string | null;
2675
+ /** Format: uuid */
2676
+ user_id: string;
2677
+ initial_user_request: string | null;
2678
+ flow_data_request: string | null;
2679
+ flow_data_created_at: string | null;
2680
+ confidence_score: number | null;
2681
+ assumptions_score: number | null;
2682
+ friendliness_score: number | null;
2683
+ user_email: string | null;
2684
+ external: {
2685
+ [key: string]: unknown;
2686
+ } | null;
2687
+ }[];
2688
+ };
2689
+ };
2690
+ };
2691
+ /** @description Something wrong happened */
2692
+ 500: {
2693
+ headers: {
2694
+ [name: string]: unknown;
2695
+ };
2696
+ content: {
2697
+ "application/json": {
2698
+ error: string;
2699
+ };
2700
+ };
2701
+ };
2702
+ };
2703
+ };
2704
+ generateInsightTemplate: {
2705
+ parameters: {
2706
+ query?: never;
2707
+ header?: never;
2708
+ path?: never;
2709
+ cookie?: never;
2710
+ };
2711
+ requestBody?: {
2712
+ content: {
2713
+ "application/json": {
2714
+ request: string;
2715
+ insight_type: string;
2716
+ additional_context?: string;
2717
+ };
2718
+ };
2719
+ };
2720
+ responses: {
2721
+ /** @description Insight template generated successfully */
2722
+ 200: {
2723
+ headers: {
2724
+ [name: string]: unknown;
2725
+ };
2726
+ content: {
2727
+ "application/json": {
2728
+ expanded_request: string;
2729
+ };
2730
+ };
2731
+ };
2732
+ /** @description Something wrong happened */
2733
+ 500: {
2734
+ headers: {
2735
+ [name: string]: unknown;
2736
+ };
2737
+ content: {
2738
+ "application/json": {
2739
+ error: string;
2740
+ };
2741
+ };
2742
+ };
2743
+ };
2744
+ };
2745
+ getContextualInsightPreviewData: {
2746
+ parameters: {
2747
+ query?: {
2748
+ limit?: number;
2749
+ /** @example name:asc,date:desc */
2750
+ order?: string;
2751
+ cursor?: number;
2752
+ /** @example status:active,name:John%20Doe */
2753
+ filter?: string;
2754
+ };
2755
+ header?: never;
2756
+ path: {
2757
+ report_id: string;
2758
+ };
2759
+ cookie?: never;
2760
+ };
2761
+ requestBody?: never;
2762
+ responses: {
2763
+ /** @description The preview data for the contextual insight */
2764
+ 200: {
2765
+ headers: {
2766
+ [name: string]: unknown;
2767
+ };
2768
+ content: {
2769
+ "application/json": {
2770
+ columns: {
2771
+ id: string;
2772
+ accessorKey: string;
2773
+ header: string;
2774
+ cell?: unknown;
2775
+ meta?: {
2776
+ [key: string]: unknown;
2777
+ };
2778
+ }[];
2779
+ data: {
2780
+ [key: string]: unknown;
2781
+ }[];
2782
+ metadata?: {
2783
+ wasSampled: boolean;
2784
+ originalCount: number;
2785
+ sampledCount: number;
2786
+ };
2787
+ };
2788
+ };
2789
+ };
2790
+ /** @description Unable to retrieve flow data with this id */
2791
+ 404: {
2792
+ headers: {
2793
+ [name: string]: unknown;
2794
+ };
2795
+ content: {
2796
+ "application/json": {
2797
+ error: string;
2798
+ };
2799
+ };
2800
+ };
2801
+ /** @description Something wrong happened */
2802
+ 500: {
2803
+ headers: {
2804
+ [name: string]: unknown;
2805
+ };
2806
+ content: {
2807
+ "application/json": {
2808
+ error: string;
2809
+ };
2810
+ };
2811
+ };
2812
+ };
2813
+ };
2814
+ getContextualInsightColumnSampleValues: {
2815
+ parameters: {
2816
+ query: {
2817
+ column_name: string;
2818
+ };
2819
+ header?: never;
2820
+ path: {
2821
+ report_id: string;
2822
+ };
2823
+ cookie?: never;
2824
+ };
2825
+ requestBody?: never;
2826
+ responses: {
2827
+ /** @description Sample values for the specified column */
2828
+ 200: {
2829
+ headers: {
2830
+ [name: string]: unknown;
2831
+ };
2832
+ content: {
2833
+ "application/json": {
2834
+ options: unknown[];
2835
+ };
2836
+ };
2837
+ };
2838
+ /** @description Unable to retrieve flow data with this id */
2839
+ 404: {
2840
+ headers: {
2841
+ [name: string]: unknown;
2842
+ };
2843
+ content: {
2844
+ "application/json": {
2845
+ error: string;
2846
+ };
2847
+ };
2848
+ };
2849
+ /** @description Something wrong happened */
2850
+ 500: {
2851
+ headers: {
2852
+ [name: string]: unknown;
2853
+ };
2854
+ content: {
2855
+ "application/json": {
2856
+ error: string;
2857
+ };
2858
+ };
2859
+ };
2860
+ };
2861
+ };
2862
+ extractInsight: {
2863
+ parameters: {
2864
+ query?: never;
2865
+ header?: never;
2866
+ path?: never;
2867
+ cookie?: never;
2868
+ };
2869
+ requestBody?: {
2870
+ content: {
2871
+ "application/json": {
2872
+ flow_id: string;
2873
+ report_id: number;
2874
+ topic: string;
2875
+ expanded_request: string;
2876
+ insight_type: string;
2877
+ selected_filter: string;
2878
+ selected_filter_value: string;
2879
+ additional_context?: string;
2880
+ };
2881
+ };
2882
+ };
2883
+ responses: {
2884
+ /** @description Insight extracted successfully */
2885
+ 200: {
2886
+ headers: {
2887
+ [name: string]: unknown;
2888
+ };
2889
+ content: {
2890
+ "application/json": {
2891
+ /** @enum {string} */
2892
+ type: "text";
2893
+ insight: string;
2894
+ } | {
2895
+ /** @enum {string} */
2896
+ type: "missing";
2897
+ };
2898
+ };
2899
+ };
2900
+ /** @description Something wrong happened */
2901
+ 500: {
2902
+ headers: {
2903
+ [name: string]: unknown;
2904
+ };
2905
+ content: {
2906
+ "application/json": {
2907
+ error: string;
2908
+ };
2909
+ };
2910
+ };
2911
+ };
2912
+ };
2913
+ suggestFilterColumn: {
2914
+ parameters: {
2915
+ query?: never;
2916
+ header?: never;
2917
+ path?: never;
2918
+ cookie?: never;
2919
+ };
2920
+ requestBody?: {
2921
+ content: {
2922
+ "application/json": {
2923
+ report_id: number;
2924
+ request: string;
2925
+ insight_type: string;
2926
+ additional_context?: string;
2927
+ };
2928
+ };
2929
+ };
2930
+ responses: {
2931
+ /** @description Filter column suggestion generated successfully */
2932
+ 200: {
2933
+ headers: {
2934
+ [name: string]: unknown;
2935
+ };
2936
+ content: {
2937
+ "application/json": {
2938
+ recommended_column: string;
2939
+ reasoning: string;
2940
+ };
2941
+ };
2942
+ };
2943
+ /** @description Report not found */
2944
+ 404: {
2945
+ headers: {
2946
+ [name: string]: unknown;
2947
+ };
2948
+ content: {
2949
+ "application/json": {
2950
+ error: string;
2951
+ };
2952
+ };
2953
+ };
2954
+ /** @description Something wrong happened */
2955
+ 500: {
2956
+ headers: {
2957
+ [name: string]: unknown;
2958
+ };
2959
+ content: {
2960
+ "application/json": {
2961
+ error: string;
2962
+ };
2963
+ };
2964
+ };
2965
+ };
2966
+ };
2967
+ }
2968
+
2969
+ declare type PatchParam<T, Config extends RemoveParamsConfig, P extends keyof Config> = Simplify<T extends {
2970
+ [key in P]: infer H;
2971
+ } ? H extends Partial<Record<string, unknown>> ? Config[P] extends string ? Omit<H, Config[P]> : H : never : never>;
2972
+
2973
+ /**
2974
+ * This file was auto-generated by openapi-typescript.
2975
+ * Do not make direct changes to the file.
2976
+ */
2977
+
2978
+ declare interface paths {
2979
+ "/api/v1/auth/exchangeExternalToken": {
2980
+ parameters: {
2981
+ query?: never;
2982
+ header?: never;
2983
+ path?: never;
2984
+ cookie?: never;
2985
+ };
2986
+ get?: never;
2987
+ put?: never;
2988
+ post: operations["exchangeExternalToken"];
2989
+ delete?: never;
2990
+ options?: never;
2991
+ head?: never;
2992
+ patch?: never;
2993
+ trace?: never;
2994
+ };
2995
+ "/api/v1/auth/apiInformation": {
2996
+ parameters: {
2997
+ query?: never;
2998
+ header?: never;
2999
+ path?: never;
3000
+ cookie?: never;
3001
+ };
3002
+ get: operations["getApiInformation"];
3003
+ put?: never;
3004
+ post?: never;
3005
+ delete?: never;
3006
+ options?: never;
3007
+ head?: never;
3008
+ patch?: never;
3009
+ trace?: never;
3010
+ };
3011
+ "/api/v1/public/dashboards/{dashboard_id}/visualizations/{visualization_id}": {
3012
+ parameters: {
3013
+ query?: never;
3014
+ header?: never;
3015
+ path?: never;
3016
+ cookie?: never;
3017
+ };
3018
+ get: operations["PublicDashboardFetchVisualization"];
3019
+ put?: never;
3020
+ post?: never;
3021
+ delete?: never;
3022
+ options?: never;
3023
+ head?: never;
3024
+ patch?: never;
3025
+ trace?: never;
3026
+ };
3027
+ "/api/v1/public/dashboards/{dashboard_id}": {
3028
+ parameters: {
3029
+ query?: never;
3030
+ header?: never;
3031
+ path?: never;
3032
+ cookie?: never;
3033
+ };
3034
+ get: operations["retrievePublicDashboard"];
3035
+ put?: never;
3036
+ post?: never;
3037
+ delete?: never;
3038
+ options?: never;
3039
+ head?: never;
3040
+ patch?: never;
3041
+ trace?: never;
3042
+ };
3043
+ "/api/v1/public/dashboards/{dashboard_id}/data-reports/{report_id}/columns": {
3044
+ parameters: {
3045
+ query?: never;
3046
+ header?: never;
3047
+ path?: never;
3048
+ cookie?: never;
3049
+ };
3050
+ get: operations["getPublicDataReportColumns"];
3051
+ put?: never;
3052
+ post?: never;
3053
+ delete?: never;
3054
+ options?: never;
3055
+ head?: never;
3056
+ patch?: never;
3057
+ trace?: never;
3058
+ };
3059
+ "/api/v1/public/dashboards/{dashboard_id}/data-reports/{report_id}/data": {
3060
+ parameters: {
3061
+ query?: never;
3062
+ header?: never;
3063
+ path?: never;
3064
+ cookie?: never;
3065
+ };
3066
+ get: operations["getPublicDataReportData"];
3067
+ put?: never;
3068
+ post?: never;
3069
+ delete?: never;
3070
+ options?: never;
3071
+ head?: never;
3072
+ patch?: never;
3073
+ trace?: never;
3074
+ };
3075
+ "/api/v1/public/dashboards/{dashboard_id}/data-reports/{report_id}/count": {
3076
+ parameters: {
3077
+ query?: never;
3078
+ header?: never;
3079
+ path?: never;
3080
+ cookie?: never;
3081
+ };
3082
+ get: operations["getPublicDataReportRowCount"];
3083
+ put?: never;
3084
+ post?: never;
3085
+ delete?: never;
3086
+ options?: never;
3087
+ head?: never;
3088
+ patch?: never;
3089
+ trace?: never;
3090
+ };
3091
+ "/api/v1/end2end": {
3092
+ parameters: {
3093
+ query?: never;
3094
+ header?: never;
3095
+ path?: never;
3096
+ cookie?: never;
3097
+ };
3098
+ get?: never;
3099
+ put?: never;
3100
+ post: operations["runEnd2EndFlow"];
3101
+ delete?: never;
3102
+ options?: never;
3103
+ head?: never;
3104
+ patch?: never;
3105
+ trace?: never;
3106
+ };
3107
+ "/api/v1/flows/{flowId}": {
3108
+ parameters: {
3109
+ query?: never;
3110
+ header?: never;
3111
+ path?: never;
3112
+ cookie?: never;
3113
+ };
3114
+ get: operations["retrieveFlow"];
3115
+ put?: never;
3116
+ post?: never;
3117
+ delete?: never;
3118
+ options?: never;
3119
+ head?: never;
3120
+ patch?: never;
3121
+ trace?: never;
3122
+ };
3123
+ "/api/v1/recent-flows": {
3124
+ parameters: {
3125
+ query?: never;
3126
+ header?: never;
3127
+ path?: never;
3128
+ cookie?: never;
3129
+ };
3130
+ get: operations["retrieveRecentFlows"];
3131
+ put?: never;
3132
+ post?: never;
3133
+ delete?: never;
3134
+ options?: never;
3135
+ head?: never;
3136
+ patch?: never;
3137
+ trace?: never;
3138
+ };
3139
+ "/api/v1/flows/{flowId}/data-reports": {
3140
+ parameters: {
3141
+ query?: never;
3142
+ header?: never;
3143
+ path?: never;
3144
+ cookie?: never;
3145
+ };
3146
+ get: operations["retrieveFlowDataReports"];
3147
+ put?: never;
3148
+ post?: never;
3149
+ delete?: never;
3150
+ options?: never;
3151
+ head?: never;
3152
+ patch?: never;
3153
+ trace?: never;
3154
+ };
3155
+ "/api/v1/data-reports/{report_id}/feedback": {
3156
+ parameters: {
3157
+ query?: never;
3158
+ header?: never;
3159
+ path?: never;
3160
+ cookie?: never;
3161
+ };
3162
+ get: operations["getDataReportFeedback"];
3163
+ put?: never;
3164
+ post: operations["upsertReportFeedback"];
3165
+ delete: operations["deleteReportFeedback"];
3166
+ options?: never;
3167
+ head?: never;
3168
+ patch?: never;
3169
+ trace?: never;
3170
+ };
3171
+ "/api/v1/flows/{flowId}/data-reports/last/status": {
3172
+ parameters: {
3173
+ query?: never;
3174
+ header?: never;
3175
+ path?: never;
3176
+ cookie?: never;
3177
+ };
3178
+ get: operations["retrieveLatestDataReportStatus"];
3179
+ put?: never;
3180
+ post?: never;
3181
+ delete?: never;
3182
+ options?: never;
3183
+ head?: never;
3184
+ patch?: never;
3185
+ trace?: never;
3186
+ };
3187
+ "/api/v1/data-reports/{report_id}/explainability": {
3188
+ parameters: {
3189
+ query?: never;
3190
+ header?: never;
3191
+ path?: never;
3192
+ cookie?: never;
3193
+ };
3194
+ get: operations["getDataReportExplainability"];
3195
+ put?: never;
3196
+ post?: never;
3197
+ delete?: never;
3198
+ options?: never;
3199
+ head?: never;
3200
+ patch?: never;
3201
+ trace?: never;
3202
+ };
3203
+ "/api/v1/timeline/bookmark": {
3204
+ parameters: {
3205
+ query?: never;
3206
+ header?: never;
3207
+ path?: never;
3208
+ cookie?: never;
3209
+ };
3210
+ get?: never;
3211
+ put?: never;
3212
+ post: operations["toggleBookmark"];
3213
+ delete?: never;
3214
+ options?: never;
3215
+ head?: never;
3216
+ patch?: never;
3217
+ trace?: never;
3218
+ };
3219
+ "/api/v1/data-tables/latest-refresh": {
3220
+ parameters: {
3221
+ query?: never;
3222
+ header?: never;
3223
+ path?: never;
3224
+ cookie?: never;
3225
+ };
3226
+ get: operations["retrieveLatestDataRefresh"];
3227
+ put?: never;
3228
+ post?: never;
3229
+ delete?: never;
3230
+ options?: never;
3231
+ head?: never;
3232
+ patch?: never;
3233
+ trace?: never;
3234
+ };
3235
+ "/api/v1/data-reports/{report_id}/export": {
3236
+ parameters: {
3237
+ query?: never;
3238
+ header?: never;
3239
+ path?: never;
3240
+ cookie?: never;
3241
+ };
3242
+ get: operations["exportReportData"];
3243
+ put?: never;
3244
+ post?: never;
3245
+ delete?: never;
3246
+ options?: never;
3247
+ head?: never;
3248
+ patch?: never;
3249
+ trace?: never;
3250
+ };
3251
+ "/api/v1/data-reports/{report_id}/columns": {
3252
+ parameters: {
3253
+ query?: never;
3254
+ header?: never;
3255
+ path?: never;
3256
+ cookie?: never;
3257
+ };
3258
+ get: operations["getDataReportColumns"];
3259
+ put?: never;
3260
+ post?: never;
3261
+ delete?: never;
3262
+ options?: never;
3263
+ head?: never;
3264
+ patch?: never;
3265
+ trace?: never;
3266
+ };
3267
+ "/api/v1/data-reports/{report_id}/data": {
3268
+ parameters: {
3269
+ query?: never;
3270
+ header?: never;
3271
+ path?: never;
3272
+ cookie?: never;
3273
+ };
3274
+ get: operations["getDataReportData"];
3275
+ put?: never;
3276
+ post?: never;
3277
+ delete?: never;
3278
+ options?: never;
3279
+ head?: never;
3280
+ patch?: never;
3281
+ trace?: never;
3282
+ };
3283
+ "/api/v1/data-reports/{report_id}/count": {
3284
+ parameters: {
3285
+ query?: never;
3286
+ header?: never;
3287
+ path?: never;
3288
+ cookie?: never;
3289
+ };
3290
+ get: operations["getDataReportRowCount"];
3291
+ put?: never;
3292
+ post?: never;
3293
+ delete?: never;
3294
+ options?: never;
3295
+ head?: never;
3296
+ patch?: never;
3297
+ trace?: never;
3298
+ };
3299
+ "/api/v1/data-reports/{report_id}": {
3300
+ parameters: {
3301
+ query?: never;
3302
+ header?: never;
3303
+ path?: never;
3304
+ cookie?: never;
3305
+ };
3306
+ get: operations["getDataReport"];
3307
+ put?: never;
3308
+ post?: never;
3309
+ delete?: never;
3310
+ options?: never;
3311
+ head?: never;
3312
+ patch?: never;
3313
+ trace?: never;
3314
+ };
3315
+ "/api/v1/flows": {
3316
+ parameters: {
3317
+ query?: never;
3318
+ header?: never;
3319
+ path?: never;
3320
+ cookie?: never;
3321
+ };
3322
+ get?: never;
3323
+ put?: never;
3324
+ post: operations["createFlow"];
3325
+ delete?: never;
3326
+ options?: never;
3327
+ head?: never;
3328
+ patch?: never;
3329
+ trace?: never;
3330
+ };
3331
+ "/api/v1/chat/{flowId}/timeline": {
3332
+ parameters: {
3333
+ query?: never;
3334
+ header?: never;
3335
+ path?: never;
3336
+ cookie?: never;
3337
+ };
3338
+ get: operations["retrieveChatTimeline"];
3339
+ put?: never;
3340
+ post?: never;
3341
+ delete?: never;
3342
+ options?: never;
3343
+ head?: never;
3344
+ patch?: never;
3345
+ trace?: never;
3346
+ };
3347
+ "/api/v1/chat/{flowId}/messages": {
3348
+ parameters: {
3349
+ query?: never;
3350
+ header?: never;
3351
+ path?: never;
3352
+ cookie?: never;
3353
+ };
3354
+ get: operations["retrieveChatMessages"];
3355
+ put?: never;
3356
+ post?: never;
3357
+ delete?: never;
3358
+ options?: never;
3359
+ head?: never;
3360
+ patch?: never;
3361
+ trace?: never;
3362
+ };
3363
+ "/api/v1/recommendations": {
3364
+ parameters: {
3365
+ query?: never;
3366
+ header?: never;
3367
+ path?: never;
3368
+ cookie?: never;
3369
+ };
3370
+ get: operations["getStarterRecommendations"];
3371
+ put?: never;
3372
+ post?: never;
3373
+ delete?: never;
3374
+ options?: never;
3375
+ head?: never;
3376
+ patch?: never;
3377
+ trace?: never;
3378
+ };
3379
+ "/api/v1/visualizations/{visualization_id}": {
3380
+ parameters: {
3381
+ query?: never;
3382
+ header?: never;
3383
+ path?: never;
3384
+ cookie?: never;
3385
+ };
3386
+ get: operations["fetchVisualization"];
3387
+ put?: never;
3388
+ post?: never;
3389
+ delete?: never;
3390
+ options?: never;
3391
+ head?: never;
3392
+ patch?: never;
3393
+ trace?: never;
3394
+ };
3395
+ "/api/v1/flows/{flowId}/visualizations": {
3396
+ parameters: {
3397
+ query?: never;
3398
+ header?: never;
3399
+ path?: never;
3400
+ cookie?: never;
3401
+ };
3402
+ get: operations["listVisualizationsForFlow"];
3403
+ put?: never;
3404
+ post?: never;
3405
+ delete?: never;
3406
+ options?: never;
3407
+ head?: never;
3408
+ patch?: never;
3409
+ trace?: never;
3410
+ };
3411
+ "/api/v1/trigger-flow/": {
3412
+ parameters: {
3413
+ query?: never;
3414
+ header?: never;
3415
+ path?: never;
3416
+ cookie?: never;
3417
+ };
3418
+ get?: never;
3419
+ put?: never;
3420
+ post: operations["triggerFlow"];
3421
+ delete?: never;
3422
+ options?: never;
3423
+ head?: never;
3424
+ patch?: never;
3425
+ trace?: never;
3426
+ };
3427
+ "/api/v1/dashboard/{dashboard_id}": {
3428
+ parameters: {
3429
+ query?: never;
3430
+ header?: never;
3431
+ path?: never;
3432
+ cookie?: never;
3433
+ };
3434
+ get: operations["retrieveDashboard"];
3435
+ put?: never;
3436
+ post?: never;
3437
+ delete?: never;
3438
+ options?: never;
3439
+ head?: never;
3440
+ patch?: never;
3441
+ trace?: never;
3442
+ };
3443
+ "/api/v1/contextual-insights/generate-insight": {
3444
+ parameters: {
3445
+ query?: never;
3446
+ header?: never;
3447
+ path?: never;
3448
+ cookie?: never;
3449
+ };
3450
+ get?: never;
3451
+ put?: never;
3452
+ post: operations["generateInsight"];
3453
+ delete?: never;
3454
+ options?: never;
3455
+ head?: never;
3456
+ patch?: never;
3457
+ trace?: never;
3458
+ };
3459
+ "/api/v1/admin-console/query-examples": {
3460
+ parameters: {
3461
+ query?: never;
3462
+ header?: never;
3463
+ path?: never;
3464
+ cookie?: never;
3465
+ };
3466
+ get?: never;
3467
+ put?: never;
3468
+ post: operations["createQueryExample"];
3469
+ delete?: never;
3470
+ options?: never;
3471
+ head?: never;
3472
+ patch?: never;
3473
+ trace?: never;
3474
+ };
3475
+ "/api/v1/admin-console/query-examples/{id}": {
3476
+ parameters: {
3477
+ query?: never;
3478
+ header?: never;
3479
+ path?: never;
3480
+ cookie?: never;
3481
+ };
3482
+ get?: never;
3483
+ put?: never;
3484
+ post?: never;
3485
+ delete?: never;
3486
+ options?: never;
3487
+ head?: never;
3488
+ patch: operations["updateQueryExample"];
3489
+ trace?: never;
3490
+ };
3491
+ "/api/v1/admin-console/sql/preview": {
3492
+ parameters: {
3493
+ query?: never;
3494
+ header?: never;
3495
+ path?: never;
3496
+ cookie?: never;
3497
+ };
3498
+ get?: never;
3499
+ put?: never;
3500
+ post: operations["sqlPreview"];
3501
+ delete?: never;
3502
+ options?: never;
3503
+ head?: never;
3504
+ patch?: never;
3505
+ trace?: never;
3506
+ };
3507
+ "/api/v1/admin-console/usage-insights/filters": {
3508
+ parameters: {
3509
+ query?: never;
3510
+ header?: never;
3511
+ path?: never;
3512
+ cookie?: never;
3513
+ };
3514
+ get: operations["listSankeyUserFilters"];
3515
+ put?: never;
3516
+ post?: never;
3517
+ delete?: never;
3518
+ options?: never;
3519
+ head?: never;
3520
+ patch?: never;
3521
+ trace?: never;
3522
+ };
3523
+ "/api/v1/admin-console/usage-insights/sankey": {
3524
+ parameters: {
3525
+ query?: never;
3526
+ header?: never;
3527
+ path?: never;
3528
+ cookie?: never;
3529
+ };
3530
+ get: operations["getSankeyData"];
3531
+ put?: never;
3532
+ post?: never;
3533
+ delete?: never;
3534
+ options?: never;
3535
+ head?: never;
3536
+ patch?: never;
3537
+ trace?: never;
3538
+ };
3539
+ "/api/v1/admin-console/contextual-insights/generate-template": {
3540
+ parameters: {
3541
+ query?: never;
3542
+ header?: never;
3543
+ path?: never;
3544
+ cookie?: never;
3545
+ };
3546
+ get?: never;
3547
+ put?: never;
3548
+ post: operations["generateInsightTemplate"];
3549
+ delete?: never;
3550
+ options?: never;
3551
+ head?: never;
3552
+ patch?: never;
3553
+ trace?: never;
3554
+ };
3555
+ "/api/v1/admin-console/contextual-insights/preview/{report_id}/data": {
3556
+ parameters: {
3557
+ query?: never;
3558
+ header?: never;
3559
+ path?: never;
3560
+ cookie?: never;
3561
+ };
3562
+ get: operations["getContextualInsightPreviewData"];
3563
+ put?: never;
3564
+ post?: never;
3565
+ delete?: never;
3566
+ options?: never;
3567
+ head?: never;
3568
+ patch?: never;
3569
+ trace?: never;
3570
+ };
3571
+ "/api/v1/admin-console/contextual-insights/preview/{report_id}/sample-values": {
3572
+ parameters: {
3573
+ query?: never;
3574
+ header?: never;
3575
+ path?: never;
3576
+ cookie?: never;
3577
+ };
3578
+ get: operations["getContextualInsightColumnSampleValues"];
3579
+ put?: never;
3580
+ post?: never;
3581
+ delete?: never;
3582
+ options?: never;
3583
+ head?: never;
3584
+ patch?: never;
3585
+ trace?: never;
3586
+ };
3587
+ "/api/v1/admin-console/contextual-insights/extract-insight": {
3588
+ parameters: {
3589
+ query?: never;
3590
+ header?: never;
3591
+ path?: never;
3592
+ cookie?: never;
3593
+ };
3594
+ get?: never;
3595
+ put?: never;
3596
+ post: operations["extractInsight"];
3597
+ delete?: never;
3598
+ options?: never;
3599
+ head?: never;
3600
+ patch?: never;
3601
+ trace?: never;
3602
+ };
3603
+ "/api/v1/admin-console/contextual-insights/suggest-filter-column": {
3604
+ parameters: {
3605
+ query?: never;
3606
+ header?: never;
3607
+ path?: never;
3608
+ cookie?: never;
3609
+ };
3610
+ get?: never;
3611
+ put?: never;
3612
+ post: operations["suggestFilterColumn"];
3613
+ delete?: never;
3614
+ options?: never;
3615
+ head?: never;
3616
+ patch?: never;
3617
+ trace?: never;
3618
+ };
3619
+ }
3620
+
3621
+ declare const QuickActionsSchema: z.ZodArray<z.ZodObject<{
3622
+ label: z.ZodString;
3623
+ explanation: z.ZodString;
3624
+ }, "strip", z.ZodTypeAny, {
3625
+ label: string;
3626
+ explanation: string;
3627
+ }, {
3628
+ label: string;
3629
+ explanation: string;
3630
+ }>, "many">;
3631
+
3632
+ declare const redactedOutputSchema: z.ZodObject<{
3633
+ tool: z.ZodLiteral<"generateDataReport">;
3634
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3635
+ status: z.ZodLiteral<"success">;
3636
+ public: z.ZodObject<{
3637
+ flowDataId: z.ZodNumber;
3638
+ answer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3639
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3640
+ }, "strip", z.ZodTypeAny, {
3641
+ flowDataId: number;
3642
+ title?: string | null | undefined;
3643
+ answer?: string | null | undefined;
3644
+ }, {
3645
+ flowDataId: number;
3646
+ title?: string | null | undefined;
3647
+ answer?: string | null | undefined;
3648
+ }>;
3649
+ private: z.ZodObject<{
3650
+ sql: z.ZodString;
3651
+ dataReportSummary: z.ZodString;
3652
+ }, "strip", z.ZodTypeAny, {
3653
+ sql: string;
3654
+ dataReportSummary: string;
3655
+ }, {
3656
+ sql: string;
3657
+ dataReportSummary: string;
3658
+ }>;
3659
+ }, "private">, "strip", z.ZodTypeAny, {
3660
+ status: "success";
3661
+ public: {
3662
+ flowDataId: number;
3663
+ title?: string | null | undefined;
3664
+ answer?: string | null | undefined;
3665
+ };
3666
+ }, {
3667
+ status: "success";
3668
+ public: {
3669
+ flowDataId: number;
3670
+ title?: string | null | undefined;
3671
+ answer?: string | null | undefined;
3672
+ };
3673
+ }>, z.ZodObject<{
3674
+ status: z.ZodLiteral<"error">;
3675
+ message: z.ZodString;
3676
+ }, "strip", z.ZodTypeAny, {
3677
+ message: string;
3678
+ status: "error";
3679
+ }, {
3680
+ message: string;
3681
+ status: "error";
3682
+ }>]>>;
3683
+ }, "strip", z.ZodTypeAny, {
3684
+ tool: "generateDataReport";
3685
+ result?: {
3686
+ status: "success";
3687
+ public: {
3688
+ flowDataId: number;
3689
+ title?: string | null | undefined;
3690
+ answer?: string | null | undefined;
3691
+ };
3692
+ } | {
3693
+ message: string;
3694
+ status: "error";
3695
+ } | undefined;
3696
+ }, {
3697
+ tool: "generateDataReport";
3698
+ result?: {
3699
+ status: "success";
3700
+ public: {
3701
+ flowDataId: number;
3702
+ title?: string | null | undefined;
3703
+ answer?: string | null | undefined;
3704
+ };
3705
+ } | {
3706
+ message: string;
3707
+ status: "error";
3708
+ } | undefined;
3709
+ }>;
3710
+
3711
+ declare const redactedOutputSchema_2: z.ZodObject<{
3712
+ tool: z.ZodLiteral<"generateVisualization">;
3713
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3714
+ status: z.ZodLiteral<"success">;
3715
+ public: z.ZodObject<{
3716
+ flowDataId: z.ZodNumber;
3717
+ flowDataVisualizationId: z.ZodNumber;
3718
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3719
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3720
+ }, "strip", z.ZodTypeAny, {
3721
+ flowDataId: number;
3722
+ flowDataVisualizationId: number;
3723
+ type?: string | null | undefined;
3724
+ title?: string | null | undefined;
3725
+ }, {
3726
+ flowDataId: number;
3727
+ flowDataVisualizationId: number;
3728
+ type?: string | null | undefined;
3729
+ title?: string | null | undefined;
3730
+ }>;
3731
+ private: z.ZodObject<{
3732
+ sql: z.ZodOptional<z.ZodString>;
3733
+ dataReportSummary: z.ZodOptional<z.ZodString>;
3734
+ }, "strip", z.ZodTypeAny, {
3735
+ sql?: string | undefined;
3736
+ dataReportSummary?: string | undefined;
3737
+ }, {
3738
+ sql?: string | undefined;
3739
+ dataReportSummary?: string | undefined;
3740
+ }>;
3741
+ }, "private">, "strip", z.ZodTypeAny, {
3742
+ status: "success";
3743
+ public: {
3744
+ flowDataId: number;
3745
+ flowDataVisualizationId: number;
3746
+ type?: string | null | undefined;
3747
+ title?: string | null | undefined;
3748
+ };
3749
+ }, {
3750
+ status: "success";
3751
+ public: {
3752
+ flowDataId: number;
3753
+ flowDataVisualizationId: number;
3754
+ type?: string | null | undefined;
3755
+ title?: string | null | undefined;
3756
+ };
3757
+ }>, z.ZodObject<{
3758
+ status: z.ZodLiteral<"error">;
3759
+ message: z.ZodString;
3760
+ }, "strip", z.ZodTypeAny, {
3761
+ message: string;
3762
+ status: "error";
3763
+ }, {
3764
+ message: string;
3765
+ status: "error";
3766
+ }>]>>;
3767
+ }, "strip", z.ZodTypeAny, {
3768
+ tool: "generateVisualization";
3769
+ result?: {
3770
+ status: "success";
3771
+ public: {
3772
+ flowDataId: number;
3773
+ flowDataVisualizationId: number;
3774
+ type?: string | null | undefined;
3775
+ title?: string | null | undefined;
3776
+ };
3777
+ } | {
3778
+ message: string;
3779
+ status: "error";
3780
+ } | undefined;
3781
+ }, {
3782
+ tool: "generateVisualization";
3783
+ result?: {
3784
+ status: "success";
3785
+ public: {
3786
+ flowDataId: number;
3787
+ flowDataVisualizationId: number;
3788
+ type?: string | null | undefined;
3789
+ title?: string | null | undefined;
3790
+ };
3791
+ } | {
3792
+ message: string;
3793
+ status: "error";
3794
+ } | undefined;
3795
+ }>;
3796
+
3797
+ declare const redactedOutputSchema_3: z.ZodObject<{
3798
+ tool: z.ZodLiteral<"valueBasedColumnSearch">;
3799
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3800
+ status: z.ZodLiteral<"success">;
3801
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3802
+ private: z.ZodObject<{
3803
+ message: z.ZodOptional<z.ZodString>;
3804
+ columns: z.ZodArray<z.ZodObject<{
3805
+ id: z.ZodNumber;
3806
+ name: z.ZodString;
3807
+ data_type: z.ZodNullable<z.ZodString>;
3808
+ description: z.ZodNullable<z.ZodString>;
3809
+ null_percentage: z.ZodNullable<z.ZodNumber>;
3810
+ unique_values: z.ZodNullable<z.ZodNumber>;
3811
+ sample_values: z.ZodNullable<z.ZodArray<z.ZodAny, "many">>;
3812
+ table: z.ZodObject<{
3813
+ table_name: z.ZodString;
3814
+ description: z.ZodNullable<z.ZodString>;
3815
+ }, "strip", z.ZodTypeAny, {
3816
+ description: string | null;
3817
+ table_name: string;
3818
+ }, {
3819
+ description: string | null;
3820
+ table_name: string;
3821
+ }>;
3822
+ matched_values: z.ZodArray<z.ZodString, "many">;
3823
+ }, "strip", z.ZodTypeAny, {
3824
+ description: string | null;
3825
+ name: string;
3826
+ table: {
3827
+ description: string | null;
3828
+ table_name: string;
3829
+ };
3830
+ id: number;
3831
+ data_type: string | null;
3832
+ null_percentage: number | null;
3833
+ unique_values: number | null;
3834
+ sample_values: any[] | null;
3835
+ matched_values: string[];
3836
+ }, {
3837
+ description: string | null;
3838
+ name: string;
3839
+ table: {
3840
+ description: string | null;
3841
+ table_name: string;
3842
+ };
3843
+ id: number;
3844
+ data_type: string | null;
3845
+ null_percentage: number | null;
3846
+ unique_values: number | null;
3847
+ sample_values: any[] | null;
3848
+ matched_values: string[];
3849
+ }>, "many">;
3850
+ }, "strip", z.ZodTypeAny, {
3851
+ columns: {
3852
+ description: string | null;
3853
+ name: string;
3854
+ table: {
3855
+ description: string | null;
3856
+ table_name: string;
3857
+ };
3858
+ id: number;
3859
+ data_type: string | null;
3860
+ null_percentage: number | null;
3861
+ unique_values: number | null;
3862
+ sample_values: any[] | null;
3863
+ matched_values: string[];
3864
+ }[];
3865
+ message?: string | undefined;
3866
+ }, {
3867
+ columns: {
3868
+ description: string | null;
3869
+ name: string;
3870
+ table: {
3871
+ description: string | null;
3872
+ table_name: string;
3873
+ };
3874
+ id: number;
3875
+ data_type: string | null;
3876
+ null_percentage: number | null;
3877
+ unique_values: number | null;
3878
+ sample_values: any[] | null;
3879
+ matched_values: string[];
3880
+ }[];
3881
+ message?: string | undefined;
3882
+ }>;
3883
+ }, "private">, "strip", z.ZodTypeAny, {
3884
+ status: "success";
3885
+ public: {};
3886
+ }, {
3887
+ status: "success";
3888
+ public: {};
3889
+ }>, z.ZodObject<{
3890
+ status: z.ZodLiteral<"error">;
3891
+ message: z.ZodString;
3892
+ }, "strip", z.ZodTypeAny, {
3893
+ message: string;
3894
+ status: "error";
3895
+ }, {
3896
+ message: string;
3897
+ status: "error";
3898
+ }>]>>;
3899
+ }, "strip", z.ZodTypeAny, {
3900
+ tool: "valueBasedColumnSearch";
3901
+ result?: {
3902
+ status: "success";
3903
+ public: {};
3904
+ } | {
3905
+ message: string;
3906
+ status: "error";
3907
+ } | undefined;
3908
+ }, {
3909
+ tool: "valueBasedColumnSearch";
3910
+ result?: {
3911
+ status: "success";
3912
+ public: {};
3913
+ } | {
3914
+ message: string;
3915
+ status: "error";
3916
+ } | undefined;
3917
+ }>;
3918
+
3919
+ declare const redactedOutputSchema_4: z.ZodObject<{
3920
+ tool: z.ZodLiteral<"getAvailableTables">;
3921
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3922
+ status: z.ZodLiteral<"success">;
3923
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3924
+ private: z.ZodObject<{
3925
+ tables: z.ZodArray<z.ZodObject<{
3926
+ id: z.ZodNumber;
3927
+ table_name: z.ZodString;
3928
+ description: z.ZodNullable<z.ZodString>;
3929
+ }, "strip", z.ZodTypeAny, {
3930
+ description: string | null;
3931
+ id: number;
3932
+ table_name: string;
3933
+ }, {
3934
+ description: string | null;
3935
+ id: number;
3936
+ table_name: string;
3937
+ }>, "many">;
3938
+ }, "strip", z.ZodTypeAny, {
3939
+ tables: {
3940
+ description: string | null;
3941
+ id: number;
3942
+ table_name: string;
3943
+ }[];
3944
+ }, {
3945
+ tables: {
3946
+ description: string | null;
3947
+ id: number;
3948
+ table_name: string;
3949
+ }[];
3950
+ }>;
3951
+ }, "private">, "strip", z.ZodTypeAny, {
3952
+ status: "success";
3953
+ public: {};
3954
+ }, {
3955
+ status: "success";
3956
+ public: {};
3957
+ }>, z.ZodObject<{
3958
+ status: z.ZodLiteral<"error">;
3959
+ message: z.ZodString;
3960
+ }, "strip", z.ZodTypeAny, {
3961
+ message: string;
3962
+ status: "error";
3963
+ }, {
3964
+ message: string;
3965
+ status: "error";
3966
+ }>]>>;
3967
+ }, "strip", z.ZodTypeAny, {
3968
+ tool: "getAvailableTables";
3969
+ result?: {
3970
+ status: "success";
3971
+ public: {};
3972
+ } | {
3973
+ message: string;
3974
+ status: "error";
3975
+ } | undefined;
3976
+ }, {
3977
+ tool: "getAvailableTables";
3978
+ result?: {
3979
+ status: "success";
3980
+ public: {};
3981
+ } | {
3982
+ message: string;
3983
+ status: "error";
3984
+ } | undefined;
3985
+ }>;
3986
+
3987
+ declare const redactedOutputSchema_5: z.ZodObject<{
3988
+ tool: z.ZodLiteral<"getAvailableColumnsForTable">;
3989
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
3990
+ status: z.ZodLiteral<"success">;
3991
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3992
+ private: z.ZodObject<{
3993
+ message: z.ZodOptional<z.ZodString>;
3994
+ columns: z.ZodArray<z.ZodObject<{
3995
+ id: z.ZodNumber;
3996
+ name: z.ZodString;
3997
+ data_type: z.ZodNullable<z.ZodString>;
3998
+ description: z.ZodNullable<z.ZodString>;
3999
+ null_percentage: z.ZodNullable<z.ZodNumber>;
4000
+ unique_values: z.ZodNullable<z.ZodNumber>;
4001
+ sample_values: z.ZodNullable<z.ZodArray<z.ZodAny, "many">>;
4002
+ }, "strip", z.ZodTypeAny, {
4003
+ description: string | null;
4004
+ name: string;
4005
+ id: number;
4006
+ data_type: string | null;
4007
+ null_percentage: number | null;
4008
+ unique_values: number | null;
4009
+ sample_values: any[] | null;
4010
+ }, {
4011
+ description: string | null;
4012
+ name: string;
4013
+ id: number;
4014
+ data_type: string | null;
4015
+ null_percentage: number | null;
4016
+ unique_values: number | null;
4017
+ sample_values: any[] | null;
4018
+ }>, "many">;
4019
+ }, "strip", z.ZodTypeAny, {
4020
+ columns: {
4021
+ description: string | null;
4022
+ name: string;
4023
+ id: number;
4024
+ data_type: string | null;
4025
+ null_percentage: number | null;
4026
+ unique_values: number | null;
4027
+ sample_values: any[] | null;
4028
+ }[];
4029
+ message?: string | undefined;
4030
+ }, {
4031
+ columns: {
4032
+ description: string | null;
4033
+ name: string;
4034
+ id: number;
4035
+ data_type: string | null;
4036
+ null_percentage: number | null;
4037
+ unique_values: number | null;
4038
+ sample_values: any[] | null;
4039
+ }[];
4040
+ message?: string | undefined;
4041
+ }>;
4042
+ }, "private">, "strip", z.ZodTypeAny, {
4043
+ status: "success";
4044
+ public: {};
4045
+ }, {
4046
+ status: "success";
4047
+ public: {};
4048
+ }>, z.ZodObject<{
4049
+ status: z.ZodLiteral<"error">;
4050
+ message: z.ZodString;
4051
+ }, "strip", z.ZodTypeAny, {
4052
+ message: string;
4053
+ status: "error";
4054
+ }, {
4055
+ message: string;
4056
+ status: "error";
4057
+ }>]>>;
4058
+ }, "strip", z.ZodTypeAny, {
4059
+ tool: "getAvailableColumnsForTable";
4060
+ result?: {
4061
+ status: "success";
4062
+ public: {};
4063
+ } | {
4064
+ message: string;
4065
+ status: "error";
4066
+ } | undefined;
4067
+ }, {
4068
+ tool: "getAvailableColumnsForTable";
4069
+ result?: {
4070
+ status: "success";
4071
+ public: {};
4072
+ } | {
4073
+ message: string;
4074
+ status: "error";
4075
+ } | undefined;
4076
+ }>;
4077
+
4078
+ declare const redactedOutputSchema_6: z.ZodObject<{
4079
+ tool: z.ZodLiteral<"search">;
4080
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<Omit<{
4081
+ status: z.ZodLiteral<"success">;
4082
+ public: z.ZodObject<{
4083
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
4084
+ sourceType: z.ZodLiteral<"url">;
4085
+ id: z.ZodString;
4086
+ url: z.ZodString;
4087
+ title: z.ZodString;
4088
+ }, "strip", z.ZodTypeAny, {
4089
+ title: string;
4090
+ id: string;
4091
+ sourceType: "url";
4092
+ url: string;
4093
+ }, {
4094
+ title: string;
4095
+ id: string;
4096
+ sourceType: "url";
4097
+ url: string;
4098
+ }>, "many">>;
4099
+ }, "strip", z.ZodTypeAny, {
4100
+ sources?: {
4101
+ title: string;
4102
+ id: string;
4103
+ sourceType: "url";
4104
+ url: string;
4105
+ }[] | undefined;
4106
+ }, {
4107
+ sources?: {
4108
+ title: string;
4109
+ id: string;
4110
+ sourceType: "url";
4111
+ url: string;
4112
+ }[] | undefined;
4113
+ }>;
4114
+ private: z.ZodObject<{
4115
+ answer: z.ZodOptional<z.ZodString>;
4116
+ }, "strip", z.ZodTypeAny, {
4117
+ answer?: string | undefined;
4118
+ }, {
4119
+ answer?: string | undefined;
4120
+ }>;
4121
+ }, "private">, "strip", z.ZodTypeAny, {
4122
+ status: "success";
4123
+ public: {
4124
+ sources?: {
4125
+ title: string;
4126
+ id: string;
4127
+ sourceType: "url";
4128
+ url: string;
4129
+ }[] | undefined;
4130
+ };
4131
+ }, {
4132
+ status: "success";
4133
+ public: {
4134
+ sources?: {
4135
+ title: string;
4136
+ id: string;
4137
+ sourceType: "url";
4138
+ url: string;
4139
+ }[] | undefined;
4140
+ };
4141
+ }>, z.ZodObject<{
4142
+ status: z.ZodLiteral<"error">;
4143
+ message: z.ZodString;
4144
+ }, "strip", z.ZodTypeAny, {
4145
+ message: string;
4146
+ status: "error";
4147
+ }, {
4148
+ message: string;
4149
+ status: "error";
4150
+ }>]>>;
4151
+ }, "strip", z.ZodTypeAny, {
4152
+ tool: "search";
4153
+ result?: {
4154
+ status: "success";
4155
+ public: {
4156
+ sources?: {
4157
+ title: string;
4158
+ id: string;
4159
+ sourceType: "url";
4160
+ url: string;
4161
+ }[] | undefined;
4162
+ };
4163
+ } | {
4164
+ message: string;
4165
+ status: "error";
4166
+ } | undefined;
4167
+ }, {
4168
+ tool: "search";
4169
+ result?: {
4170
+ status: "success";
4171
+ public: {
4172
+ sources?: {
4173
+ title: string;
4174
+ id: string;
4175
+ sourceType: "url";
4176
+ url: string;
4177
+ }[] | undefined;
4178
+ };
4179
+ } | {
4180
+ message: string;
4181
+ status: "error";
4182
+ } | undefined;
4183
+ }>;
4184
+
4185
+ declare const RedactedThinkResponse: z.ZodObject<{
4186
+ tool: z.ZodDefault<z.ZodLiteral<"think">>;
4187
+ } & {
4188
+ result: z.ZodOptional<z.ZodObject<Omit<{
4189
+ status: z.ZodLiteral<"success">;
4190
+ public: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4191
+ private: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4192
+ }, "private">, "strip", z.ZodTypeAny, {
4193
+ status: "success";
4194
+ public: {};
4195
+ }, {
4196
+ status: "success";
4197
+ public: {};
4198
+ }>>;
4199
+ }, "strip", z.ZodTypeAny, {
4200
+ tool: "think";
4201
+ result?: {
4202
+ status: "success";
4203
+ public: {};
4204
+ } | undefined;
4205
+ }, {
4206
+ tool?: "think" | undefined;
4207
+ result?: {
4208
+ status: "success";
4209
+ public: {};
4210
+ } | undefined;
4211
+ }>;
4212
+
4213
+ declare type RemoveAuthHeader<PathSchema> = Simplify<{
4214
+ [Method in keyof PathSchema]: RemoveParams<PathSchema[Method], ToRemove>;
4215
+ }>;
4216
+
4217
+ declare type RemoveParams<MethodSchema, Config extends RemoveParamsConfig> = Simplify<MethodSchema extends {
4218
+ parameters: infer P;
4219
+ } ? Omit<MethodSchema, "parameters"> & {
4220
+ parameters: {
4221
+ header?: PatchParam<P, Config, "header">;
4222
+ query?: PatchParam<P, Config, "query">;
4223
+ path?: PatchParam<P, Config, "path">;
4224
+ cookie?: PatchParam<P, Config, "cookie">;
4225
+ };
4226
+ } : MethodSchema>;
4227
+
4228
+ declare type RemoveParamsConfig = Simplify<{
4229
+ header?: string;
4230
+ query?: string;
4231
+ path?: string;
4232
+ cookie?: string;
4233
+ }>;
4234
+
4235
+ declare const SignalWithReportIdSchema: z.ZodObject<{
4236
+ rule: z.ZodString;
4237
+ metric: z.ZodString;
4238
+ trigger: z.ZodString;
4239
+ implementation: z.ZodString;
4240
+ } & {
4241
+ reportId: z.ZodNumber;
4242
+ }, "strip", z.ZodTypeAny, {
4243
+ rule: string;
4244
+ metric: string;
4245
+ trigger: string;
4246
+ implementation: string;
4247
+ reportId: number;
4248
+ }, {
4249
+ rule: string;
4250
+ metric: string;
4251
+ trigger: string;
4252
+ implementation: string;
4253
+ reportId: number;
4254
+ }>;
4255
+
4256
+ /**
4257
+ * Token storage keys
4258
+ */
4259
+ export declare const TOKEN_STORAGE_KEY = "mm-ai-sp-token";
4260
+
4261
+ declare type ToRemove = Simplify<{
4262
+ header: "sp-access-token";
4263
+ }>;
4264
+
4265
+ declare type UiTool = InferUITool<Tool<z.infer<typeof inputSchema>, z.infer<typeof redactedOutputSchema>>>;
4266
+
4267
+ declare type UiTool_2 = InferUITool<Tool<z.infer<typeof inputSchema_2>, z.infer<typeof redactedOutputSchema_2>>>;
4268
+
4269
+ declare type UiTool_3 = InferUITool<Tool<z.infer<typeof inputSchema_3>, z.infer<typeof RedactedThinkResponse>>>;
4270
+
4271
+ declare type UiTool_4 = InferUITool<Tool<z.infer<typeof inputSchema_4>, z.infer<typeof redactedOutputSchema_3>>>;
4272
+
4273
+ declare type UiTool_5 = InferUITool<Tool<z.infer<typeof inputSchema_5>, z.infer<typeof redactedOutputSchema_4>>>;
4274
+
4275
+ declare type UiTool_6 = InferUITool<Tool<z.infer<typeof inputSchema_6>, z.infer<typeof redactedOutputSchema_5>>>;
4276
+
4277
+ declare type UiTool_7 = InferUITool<Tool<z.infer<typeof inputSchema_7>, z.infer<typeof redactedOutputSchema_6>>>;
4278
+
4279
+ export { }