@magemetrics/core 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -415,15 +415,6 @@ export declare interface ExternalAuthProviderConfig {
415
415
  authOptions?: Pick<GoTrueClientOptions, "fetch">;
416
416
  }
417
417
 
418
- declare type ExtractInsightResponse = z.infer<typeof ExtractInsightResponseSchema>;
419
-
420
- declare const ExtractInsightResponseSchema: z.ZodUnion<[z.ZodObject<{
421
- type: z.ZodLiteral<"text">;
422
- insight: z.ZodString;
423
- }, z.core.$strip>, z.ZodObject<{
424
- type: z.ZodLiteral<"missing">;
425
- }, z.core.$strip>]>;
426
-
427
418
  declare type FrontendRecentFlows = z.infer<typeof FrontendRecentFlowsSchema>;
428
419
 
429
420
  declare const FrontendRecentFlowsSchema: z.ZodObject<{
@@ -435,14 +426,6 @@ declare const FrontendRecentFlowsSchema: z.ZodObject<{
435
426
  application_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
436
427
  }, z.core.$strip>;
437
428
 
438
- /**
439
- * Parameters for generating contextual insights
440
- */
441
- export declare type GenerateInsightParam = {
442
- selectedFilterValue: string;
443
- customId: string;
444
- };
445
-
446
429
  export declare const getPublicApiClient: (apiUrl: string, apiKey: string) => Client<NoAuthPaths>;
447
430
 
448
431
  declare const HEADER_SP_TOKEN: "sp-access-token";
@@ -714,7 +697,6 @@ export declare class MageMetricsClient {
714
697
  filename: string;
715
698
  data: Blob | string;
716
699
  }>;
717
- generateContextualInsight: (payload: GenerateInsightParam) => Promise<ExtractInsightResponse>;
718
700
  getChatTransport: (flowId: string, options?: MageMetricsChatTransportOptions) => MageMetricsChatTransport;
719
701
  getChatMessages: (flowId: string) => Promise<MMChatUIMessage[]>;
720
702
  fetchReportData: (reportId: number, { columns, limit, sorting, filters, cursor }: ReportDataFilters, signal?: AbortSignal) => Promise<{
@@ -2966,73 +2948,6 @@ declare interface operations {
2966
2948
  };
2967
2949
  };
2968
2950
  };
2969
- generateInsight: {
2970
- parameters: {
2971
- query?: never;
2972
- header?: never;
2973
- path?: never;
2974
- cookie?: never;
2975
- };
2976
- requestBody?: {
2977
- content: {
2978
- "application/json": {
2979
- selected_filter_value: string;
2980
- custom_id: string;
2981
- };
2982
- };
2983
- };
2984
- responses: {
2985
- /** @description Insight generated successfully */
2986
- 200: {
2987
- headers: {
2988
- [name: string]: unknown;
2989
- };
2990
- content: {
2991
- "application/json": {
2992
- /** @enum {string} */
2993
- type: "text";
2994
- insight: string;
2995
- } | {
2996
- /** @enum {string} */
2997
- type: "missing";
2998
- };
2999
- };
3000
- };
3001
- /** @description Invalid request */
3002
- 400: {
3003
- headers: {
3004
- [name: string]: unknown;
3005
- };
3006
- content: {
3007
- "application/json": {
3008
- error: string;
3009
- };
3010
- };
3011
- };
3012
- /** @description Insight not found */
3013
- 404: {
3014
- headers: {
3015
- [name: string]: unknown;
3016
- };
3017
- content: {
3018
- "application/json": {
3019
- error: string;
3020
- };
3021
- };
3022
- };
3023
- /** @description Something wrong happened */
3024
- 500: {
3025
- headers: {
3026
- [name: string]: unknown;
3027
- };
3028
- content: {
3029
- "application/json": {
3030
- error: string;
3031
- };
3032
- };
3033
- };
3034
- };
3035
- };
3036
2951
  createQueryExample: {
3037
2952
  parameters: {
3038
2953
  query?: never;
@@ -3388,270 +3303,6 @@ declare interface operations {
3388
3303
  };
3389
3304
  };
3390
3305
  };
3391
- generateInsightTemplate: {
3392
- parameters: {
3393
- query?: never;
3394
- header?: never;
3395
- path?: never;
3396
- cookie?: never;
3397
- };
3398
- requestBody?: {
3399
- content: {
3400
- "application/json": {
3401
- request: string;
3402
- insight_type: string;
3403
- additional_context?: string;
3404
- };
3405
- };
3406
- };
3407
- responses: {
3408
- /** @description Insight template generated successfully */
3409
- 200: {
3410
- headers: {
3411
- [name: string]: unknown;
3412
- };
3413
- content: {
3414
- "application/json": {
3415
- expanded_request: string;
3416
- };
3417
- };
3418
- };
3419
- /** @description Something wrong happened */
3420
- 500: {
3421
- headers: {
3422
- [name: string]: unknown;
3423
- };
3424
- content: {
3425
- "application/json": {
3426
- error: string;
3427
- };
3428
- };
3429
- };
3430
- };
3431
- };
3432
- getContextualInsightPreviewData: {
3433
- parameters: {
3434
- query?: {
3435
- limit?: number;
3436
- /** @example name:asc,date:desc */
3437
- order?: string;
3438
- cursor?: number;
3439
- /** @example status:active,name:John%20Doe */
3440
- filter?: string;
3441
- };
3442
- header?: never;
3443
- path: {
3444
- report_id: string;
3445
- };
3446
- cookie?: never;
3447
- };
3448
- requestBody?: never;
3449
- responses: {
3450
- /** @description The preview data for the contextual insight */
3451
- 200: {
3452
- headers: {
3453
- [name: string]: unknown;
3454
- };
3455
- content: {
3456
- "application/json": {
3457
- columns: {
3458
- id: string;
3459
- accessorKey: string;
3460
- header: string;
3461
- cell?: unknown;
3462
- meta?: {
3463
- [key: string]: unknown;
3464
- };
3465
- }[];
3466
- data: {
3467
- [key: string]: unknown;
3468
- }[];
3469
- metadata?: {
3470
- wasSampled: boolean;
3471
- originalCount: number;
3472
- sampledCount: number;
3473
- };
3474
- };
3475
- };
3476
- };
3477
- /** @description Unable to retrieve flow data with this id */
3478
- 404: {
3479
- headers: {
3480
- [name: string]: unknown;
3481
- };
3482
- content: {
3483
- "application/json": {
3484
- error: string;
3485
- };
3486
- };
3487
- };
3488
- /** @description Something wrong happened */
3489
- 500: {
3490
- headers: {
3491
- [name: string]: unknown;
3492
- };
3493
- content: {
3494
- "application/json": {
3495
- error: string;
3496
- };
3497
- };
3498
- };
3499
- };
3500
- };
3501
- getContextualInsightColumnSampleValues: {
3502
- parameters: {
3503
- query: {
3504
- /** @description The column name to get sample values for */
3505
- column_name: string;
3506
- };
3507
- header?: never;
3508
- path: {
3509
- report_id: string;
3510
- };
3511
- cookie?: never;
3512
- };
3513
- requestBody?: never;
3514
- responses: {
3515
- /** @description Sample values for the specified column */
3516
- 200: {
3517
- headers: {
3518
- [name: string]: unknown;
3519
- };
3520
- content: {
3521
- "application/json": {
3522
- options: unknown[];
3523
- };
3524
- };
3525
- };
3526
- /** @description Unable to retrieve flow data with this id */
3527
- 404: {
3528
- headers: {
3529
- [name: string]: unknown;
3530
- };
3531
- content: {
3532
- "application/json": {
3533
- error: string;
3534
- };
3535
- };
3536
- };
3537
- /** @description Something wrong happened */
3538
- 500: {
3539
- headers: {
3540
- [name: string]: unknown;
3541
- };
3542
- content: {
3543
- "application/json": {
3544
- error: string;
3545
- };
3546
- };
3547
- };
3548
- };
3549
- };
3550
- extractInsight: {
3551
- parameters: {
3552
- query?: never;
3553
- header?: never;
3554
- path?: never;
3555
- cookie?: never;
3556
- };
3557
- requestBody?: {
3558
- content: {
3559
- "application/json": {
3560
- flow_id: string;
3561
- report_id: number;
3562
- topic: string;
3563
- expanded_request: string;
3564
- insight_type: string;
3565
- selected_filter: string;
3566
- selected_filter_value: string;
3567
- additional_context?: string;
3568
- };
3569
- };
3570
- };
3571
- responses: {
3572
- /** @description Insight extracted successfully */
3573
- 200: {
3574
- headers: {
3575
- [name: string]: unknown;
3576
- };
3577
- content: {
3578
- "application/json": {
3579
- /** @enum {string} */
3580
- type: "text";
3581
- insight: string;
3582
- } | {
3583
- /** @enum {string} */
3584
- type: "missing";
3585
- };
3586
- };
3587
- };
3588
- /** @description Something wrong happened */
3589
- 500: {
3590
- headers: {
3591
- [name: string]: unknown;
3592
- };
3593
- content: {
3594
- "application/json": {
3595
- error: string;
3596
- };
3597
- };
3598
- };
3599
- };
3600
- };
3601
- suggestFilterColumn: {
3602
- parameters: {
3603
- query?: never;
3604
- header?: never;
3605
- path?: never;
3606
- cookie?: never;
3607
- };
3608
- requestBody?: {
3609
- content: {
3610
- "application/json": {
3611
- report_id: number;
3612
- request: string;
3613
- insight_type: string;
3614
- additional_context?: string;
3615
- };
3616
- };
3617
- };
3618
- responses: {
3619
- /** @description Filter column suggestion generated successfully */
3620
- 200: {
3621
- headers: {
3622
- [name: string]: unknown;
3623
- };
3624
- content: {
3625
- "application/json": {
3626
- recommended_column: string;
3627
- reasoning: string;
3628
- };
3629
- };
3630
- };
3631
- /** @description Report not found */
3632
- 404: {
3633
- headers: {
3634
- [name: string]: unknown;
3635
- };
3636
- content: {
3637
- "application/json": {
3638
- error: string;
3639
- };
3640
- };
3641
- };
3642
- /** @description Something wrong happened */
3643
- 500: {
3644
- headers: {
3645
- [name: string]: unknown;
3646
- };
3647
- content: {
3648
- "application/json": {
3649
- error: string;
3650
- };
3651
- };
3652
- };
3653
- };
3654
- };
3655
3306
  getCompanySettings: {
3656
3307
  parameters: {
3657
3308
  query?: never;
@@ -4427,22 +4078,6 @@ declare interface paths {
4427
4078
  patch?: never;
4428
4079
  trace?: never;
4429
4080
  };
4430
- "/api/v1/contextual-insights/generate-insight": {
4431
- parameters: {
4432
- query?: never;
4433
- header?: never;
4434
- path?: never;
4435
- cookie?: never;
4436
- };
4437
- get?: never;
4438
- put?: never;
4439
- post: operations["generateInsight"];
4440
- delete?: never;
4441
- options?: never;
4442
- head?: never;
4443
- patch?: never;
4444
- trace?: never;
4445
- };
4446
4081
  "/api/v1/admin-console/query-examples": {
4447
4082
  parameters: {
4448
4083
  query?: never;
@@ -4539,86 +4174,6 @@ declare interface paths {
4539
4174
  patch?: never;
4540
4175
  trace?: never;
4541
4176
  };
4542
- "/api/v1/admin-console/contextual-insights/generate-template": {
4543
- parameters: {
4544
- query?: never;
4545
- header?: never;
4546
- path?: never;
4547
- cookie?: never;
4548
- };
4549
- get?: never;
4550
- put?: never;
4551
- post: operations["generateInsightTemplate"];
4552
- delete?: never;
4553
- options?: never;
4554
- head?: never;
4555
- patch?: never;
4556
- trace?: never;
4557
- };
4558
- "/api/v1/admin-console/contextual-insights/preview/{report_id}/data": {
4559
- parameters: {
4560
- query?: never;
4561
- header?: never;
4562
- path?: never;
4563
- cookie?: never;
4564
- };
4565
- get: operations["getContextualInsightPreviewData"];
4566
- put?: never;
4567
- post?: never;
4568
- delete?: never;
4569
- options?: never;
4570
- head?: never;
4571
- patch?: never;
4572
- trace?: never;
4573
- };
4574
- "/api/v1/admin-console/contextual-insights/preview/{report_id}/sample-values": {
4575
- parameters: {
4576
- query?: never;
4577
- header?: never;
4578
- path?: never;
4579
- cookie?: never;
4580
- };
4581
- get: operations["getContextualInsightColumnSampleValues"];
4582
- put?: never;
4583
- post?: never;
4584
- delete?: never;
4585
- options?: never;
4586
- head?: never;
4587
- patch?: never;
4588
- trace?: never;
4589
- };
4590
- "/api/v1/admin-console/contextual-insights/extract-insight": {
4591
- parameters: {
4592
- query?: never;
4593
- header?: never;
4594
- path?: never;
4595
- cookie?: never;
4596
- };
4597
- get?: never;
4598
- put?: never;
4599
- post: operations["extractInsight"];
4600
- delete?: never;
4601
- options?: never;
4602
- head?: never;
4603
- patch?: never;
4604
- trace?: never;
4605
- };
4606
- "/api/v1/admin-console/contextual-insights/suggest-filter-column": {
4607
- parameters: {
4608
- query?: never;
4609
- header?: never;
4610
- path?: never;
4611
- cookie?: never;
4612
- };
4613
- get?: never;
4614
- put?: never;
4615
- post: operations["suggestFilterColumn"];
4616
- delete?: never;
4617
- options?: never;
4618
- head?: never;
4619
- patch?: never;
4620
- trace?: never;
4621
- };
4622
4177
  "/api/v1/admin-console/company-settings": {
4623
4178
  parameters: {
4624
4179
  query?: never;