@katerai/sdk 0.10.0 → 0.11.1

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 (117) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -12
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -12
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/query.d.mts +5 -0
  11. package/internal/utils/query.d.mts.map +1 -0
  12. package/internal/utils/query.d.ts +5 -0
  13. package/internal/utils/query.d.ts.map +1 -0
  14. package/internal/utils/query.js +23 -0
  15. package/internal/utils/query.js.map +1 -0
  16. package/internal/utils/query.mjs +20 -0
  17. package/internal/utils/query.mjs.map +1 -0
  18. package/internal/utils.d.mts +1 -0
  19. package/internal/utils.d.ts +1 -0
  20. package/internal/utils.js +1 -0
  21. package/internal/utils.js.map +1 -1
  22. package/internal/utils.mjs +1 -0
  23. package/package.json +1 -1
  24. package/resources/v1/compiler/cache.d.mts +0 -35
  25. package/resources/v1/compiler/cache.d.mts.map +1 -1
  26. package/resources/v1/compiler/cache.d.ts +0 -35
  27. package/resources/v1/compiler/cache.d.ts.map +1 -1
  28. package/resources/v1/compiler/cache.js +0 -9
  29. package/resources/v1/compiler/cache.js.map +1 -1
  30. package/resources/v1/compiler/cache.mjs +0 -9
  31. package/resources/v1/compiler/cache.mjs.map +1 -1
  32. package/resources/v1/compiler/combination.d.mts +123 -0
  33. package/resources/v1/compiler/combination.d.mts.map +1 -0
  34. package/resources/v1/compiler/combination.d.ts +123 -0
  35. package/resources/v1/compiler/combination.d.ts.map +1 -0
  36. package/resources/v1/compiler/combination.js +33 -0
  37. package/resources/v1/compiler/combination.js.map +1 -0
  38. package/resources/v1/compiler/combination.mjs +29 -0
  39. package/resources/v1/compiler/combination.mjs.map +1 -0
  40. package/resources/v1/compiler/compiler.d.mts +485 -84
  41. package/resources/v1/compiler/compiler.d.mts.map +1 -1
  42. package/resources/v1/compiler/compiler.d.ts +485 -84
  43. package/resources/v1/compiler/compiler.d.ts.map +1 -1
  44. package/resources/v1/compiler/compiler.js +29 -0
  45. package/resources/v1/compiler/compiler.js.map +1 -1
  46. package/resources/v1/compiler/compiler.mjs +29 -0
  47. package/resources/v1/compiler/compiler.mjs.map +1 -1
  48. package/resources/v1/compiler/index.d.mts +4 -2
  49. package/resources/v1/compiler/index.d.mts.map +1 -1
  50. package/resources/v1/compiler/index.d.ts +4 -2
  51. package/resources/v1/compiler/index.d.ts.map +1 -1
  52. package/resources/v1/compiler/index.js +3 -1
  53. package/resources/v1/compiler/index.js.map +1 -1
  54. package/resources/v1/compiler/index.mjs +1 -0
  55. package/resources/v1/compiler/index.mjs.map +1 -1
  56. package/resources/v1/compiler/manifest.d.mts +55 -0
  57. package/resources/v1/compiler/manifest.d.mts.map +1 -0
  58. package/resources/v1/compiler/manifest.d.ts +55 -0
  59. package/resources/v1/compiler/manifest.d.ts.map +1 -0
  60. package/resources/v1/compiler/manifest.js +32 -0
  61. package/resources/v1/compiler/manifest.js.map +1 -0
  62. package/resources/v1/compiler/manifest.mjs +28 -0
  63. package/resources/v1/compiler/manifest.mjs.map +1 -0
  64. package/resources/v1/connections.d.mts +3 -0
  65. package/resources/v1/connections.d.mts.map +1 -1
  66. package/resources/v1/connections.d.ts +3 -0
  67. package/resources/v1/connections.d.ts.map +1 -1
  68. package/resources/v1/connections.js +3 -0
  69. package/resources/v1/connections.js.map +1 -1
  70. package/resources/v1/connections.mjs +3 -0
  71. package/resources/v1/connections.mjs.map +1 -1
  72. package/resources/v1/index.d.mts +1 -1
  73. package/resources/v1/index.d.mts.map +1 -1
  74. package/resources/v1/index.d.ts +1 -1
  75. package/resources/v1/index.d.ts.map +1 -1
  76. package/resources/v1/index.js.map +1 -1
  77. package/resources/v1/index.mjs.map +1 -1
  78. package/resources/v1/tenants/groups.d.mts +3 -0
  79. package/resources/v1/tenants/groups.d.mts.map +1 -1
  80. package/resources/v1/tenants/groups.d.ts +3 -0
  81. package/resources/v1/tenants/groups.d.ts.map +1 -1
  82. package/resources/v1/tenants/groups.js +3 -0
  83. package/resources/v1/tenants/groups.js.map +1 -1
  84. package/resources/v1/tenants/groups.mjs +3 -0
  85. package/resources/v1/tenants/groups.mjs.map +1 -1
  86. package/resources/v1/tenants/tenants.d.mts +69 -10
  87. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  88. package/resources/v1/tenants/tenants.d.ts +69 -10
  89. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  90. package/resources/v1/tenants/tenants.js +30 -4
  91. package/resources/v1/tenants/tenants.js.map +1 -1
  92. package/resources/v1/tenants/tenants.mjs +30 -4
  93. package/resources/v1/tenants/tenants.mjs.map +1 -1
  94. package/resources/v1/v1.d.mts +2 -2
  95. package/resources/v1/v1.d.mts.map +1 -1
  96. package/resources/v1/v1.d.ts +2 -2
  97. package/resources/v1/v1.d.ts.map +1 -1
  98. package/resources/v1/v1.js.map +1 -1
  99. package/resources/v1/v1.mjs.map +1 -1
  100. package/src/client.ts +12 -16
  101. package/src/internal/utils/query.ts +23 -0
  102. package/src/internal/utils.ts +1 -0
  103. package/src/resources/v1/compiler/cache.ts +1 -47
  104. package/src/resources/v1/compiler/combination.ts +160 -0
  105. package/src/resources/v1/compiler/compiler.ts +636 -190
  106. package/src/resources/v1/compiler/index.ts +8 -1
  107. package/src/resources/v1/compiler/manifest.ts +83 -0
  108. package/src/resources/v1/connections.ts +3 -0
  109. package/src/resources/v1/index.ts +2 -0
  110. package/src/resources/v1/tenants/groups.ts +3 -0
  111. package/src/resources/v1/tenants/tenants.ts +102 -12
  112. package/src/resources/v1/v1.ts +4 -0
  113. package/src/version.ts +1 -1
  114. package/version.d.mts +1 -1
  115. package/version.d.ts +1 -1
  116. package/version.js +1 -1
  117. package/version.mjs +1 -1
@@ -1,11 +1,20 @@
1
1
  import { APIResource } from "../../../core/resource.mjs";
2
2
  import * as CompilerAPI from "./compiler.mjs";
3
3
  import * as CacheAPI from "./cache.mjs";
4
- import { Cache, CacheInvalidateParams, CacheInvalidateResponse } from "./cache.mjs";
4
+ import { Cache } from "./cache.mjs";
5
+ import * as CombinationAPI from "./combination.mjs";
6
+ import { Combination as CombinationAPICombination, CombinationPreviewParams, CombinationPreviewResponse } from "./combination.mjs";
7
+ import * as ManifestAPI from "./manifest.mjs";
8
+ import { ManifestRegenerateAndCreatePrParams, ManifestRegenerateAndCreatePrResponse } from "./manifest.mjs";
5
9
  import { APIPromise } from "../../../core/api-promise.mjs";
6
10
  import { RequestOptions } from "../../../internal/request-options.mjs";
11
+ /**
12
+ * Validate, resolve, and compile query templates to SQL
13
+ */
7
14
  export declare class Compiler extends APIResource {
8
15
  cache: CacheAPI.Cache;
16
+ combination: CombinationAPI.Combination;
17
+ manifest: ManifestAPI.Manifest;
9
18
  /**
10
19
  * Compile a resolved query to SQL.
11
20
  *
@@ -15,6 +24,15 @@ export declare class Compiler extends APIResource {
15
24
  * RLS: Filtered to current client (ClientRLSDB).
16
25
  */
17
26
  compile(params: CompilerCompileParams, options?: RequestOptions): APIPromise<CompilerCompileResponse>;
27
+ /**
28
+ * Compile a dashboard YAML file into fully resolved widget data.
29
+ *
30
+ * Reads a dashboard YAML from the client repo, resolves all data slots, executes
31
+ * queries, applies filters, and returns renderable widget data.
32
+ *
33
+ * RLS: Filtered to current client (ClientRLSDB).
34
+ */
35
+ compileDashboard(params: CompilerCompileDashboardParams, options?: RequestOptions): APIPromise<CompilerCompileDashboardResponse>;
18
36
  /**
19
37
  * Enumerate every valid query configuration for a connection.
20
38
  *
@@ -215,6 +233,10 @@ export interface CompilerCompileResponse {
215
233
  * Compilation metadata from the compiler.
216
234
  */
217
235
  metadata?: CompilerCompileResponse.Metadata | null;
236
+ /**
237
+ * Write-back request ID. Non-null when files were dispatched to CLI via WebSocket.
238
+ */
239
+ request_id?: string | null;
218
240
  /**
219
241
  * Generated SQL statement
220
242
  */
@@ -277,6 +299,244 @@ export declare namespace CompilerCompileResponse {
277
299
  views_used?: Array<string>;
278
300
  }
279
301
  }
302
+ /**
303
+ * Response from dashboard compilation — fully resolved dashboard.
304
+ */
305
+ export interface CompilerCompileDashboardResponse {
306
+ /**
307
+ * Dashboard context for widgets
308
+ */
309
+ context: CompilerCompileDashboardResponse.Context;
310
+ /**
311
+ * Dashboard metadata
312
+ */
313
+ dashboard: CompilerCompileDashboardResponse.Dashboard;
314
+ /**
315
+ * Dashboard-level compilation errors
316
+ */
317
+ errors?: Array<CompilerErrorItem>;
318
+ /**
319
+ * Resolved filter definitions with current values
320
+ */
321
+ filters?: Array<CompilerCompileDashboardResponse.Filter>;
322
+ /**
323
+ * Fully resolved widgets with data + config
324
+ */
325
+ widgets?: Array<CompilerCompileDashboardResponse.Widget>;
326
+ }
327
+ export declare namespace CompilerCompileDashboardResponse {
328
+ /**
329
+ * Dashboard context for widgets
330
+ */
331
+ interface Context {
332
+ /**
333
+ * Active filter values: {name: {value, label}}
334
+ */
335
+ filters?: {
336
+ [key: string]: {
337
+ [key: string]: unknown;
338
+ };
339
+ } | null;
340
+ /**
341
+ * Active timeframe: {label, start, end}
342
+ */
343
+ timeframe?: {
344
+ [key: string]: string;
345
+ } | null;
346
+ /**
347
+ * Dashboard topic: {label, time_dimension}
348
+ */
349
+ topic?: {
350
+ [key: string]: string;
351
+ } | null;
352
+ }
353
+ /**
354
+ * Dashboard metadata
355
+ */
356
+ interface Dashboard {
357
+ /**
358
+ * Dashboard name
359
+ */
360
+ name: string;
361
+ /**
362
+ * Dashboard description
363
+ */
364
+ description?: string | null;
365
+ /**
366
+ * Dashboard kater_id
367
+ */
368
+ kater_id?: string | null;
369
+ /**
370
+ * Dashboard display label
371
+ */
372
+ label?: string | null;
373
+ /**
374
+ * Dashboard topic reference
375
+ */
376
+ topic?: string | null;
377
+ }
378
+ /**
379
+ * A resolved dashboard filter with current value and presets.
380
+ */
381
+ interface Filter {
382
+ /**
383
+ * Filter type: date_range, multi_select, select
384
+ */
385
+ filter_type: string;
386
+ /**
387
+ * Filter name
388
+ */
389
+ name: string;
390
+ /**
391
+ * Whether null (All) is allowed
392
+ */
393
+ allow_null?: boolean;
394
+ /**
395
+ * Whether filter auto-applies to queries
396
+ */
397
+ auto_apply?: boolean;
398
+ /**
399
+ * Current filter value
400
+ */
401
+ current_value?: string | Array<string> | null;
402
+ /**
403
+ * Default value specification
404
+ */
405
+ default?: {
406
+ [key: string]: string;
407
+ } | null;
408
+ /**
409
+ * Field reference for data-driven filters
410
+ */
411
+ field?: string | null;
412
+ /**
413
+ * Label for null/All option
414
+ */
415
+ null_label?: string | null;
416
+ /**
417
+ * Available presets
418
+ */
419
+ presets?: Array<{
420
+ [key: string]: string;
421
+ }> | null;
422
+ }
423
+ /**
424
+ * A fully resolved widget ready for rendering.
425
+ */
426
+ interface Widget {
427
+ /**
428
+ * Column metadata (single or multi-query)
429
+ */
430
+ column_map: Array<Widget.UnionMember0> | Array<Array<Widget.UnionMember1>>;
431
+ /**
432
+ * Fully resolved WidgetConfig
433
+ */
434
+ config: {
435
+ [key: string]: unknown;
436
+ };
437
+ /**
438
+ * Query result data (single or multi-query)
439
+ */
440
+ data: Array<{
441
+ [key: string]: unknown;
442
+ }> | Array<Array<{
443
+ [key: string]: unknown;
444
+ }>>;
445
+ /**
446
+ * Grid position
447
+ */
448
+ grid: Widget.Grid;
449
+ /**
450
+ * Widget unique identifier
451
+ */
452
+ kater_id: string;
453
+ /**
454
+ * Widget name
455
+ */
456
+ name: string;
457
+ /**
458
+ * Display mode for multi-query: 'tabs' or 'grid'
459
+ */
460
+ display_mode?: string | null;
461
+ /**
462
+ * Per-widget compilation errors
463
+ */
464
+ errors?: Array<CompilerAPI.CompilerErrorItem>;
465
+ /**
466
+ * Per-slot configs for multi-query containers
467
+ */
468
+ slot_configs?: Array<{
469
+ [key: string]: unknown;
470
+ }> | null;
471
+ /**
472
+ * Resolved widget type
473
+ */
474
+ widget_type?: string | null;
475
+ }
476
+ namespace Widget {
477
+ /**
478
+ * Maps a UUID column alias to its human-readable name and type.
479
+ */
480
+ interface UnionMember0 {
481
+ /**
482
+ * Field type: dimension, measure, or calculation
483
+ */
484
+ field_type: string;
485
+ /**
486
+ * UUID string used as SQL column alias
487
+ */
488
+ kater_id: string;
489
+ /**
490
+ * Human-readable column name
491
+ */
492
+ name: string;
493
+ /**
494
+ * Aggregation type for measures: sum, count, min, max, avg, unknown. None for
495
+ * non-measures.
496
+ */
497
+ aggregation?: string | null;
498
+ /**
499
+ * Display label
500
+ */
501
+ label?: string | null;
502
+ }
503
+ /**
504
+ * Maps a UUID column alias to its human-readable name and type.
505
+ */
506
+ interface UnionMember1 {
507
+ /**
508
+ * Field type: dimension, measure, or calculation
509
+ */
510
+ field_type: string;
511
+ /**
512
+ * UUID string used as SQL column alias
513
+ */
514
+ kater_id: string;
515
+ /**
516
+ * Human-readable column name
517
+ */
518
+ name: string;
519
+ /**
520
+ * Aggregation type for measures: sum, count, min, max, avg, unknown. None for
521
+ * non-measures.
522
+ */
523
+ aggregation?: string | null;
524
+ /**
525
+ * Display label
526
+ */
527
+ label?: string | null;
528
+ }
529
+ /**
530
+ * Grid position
531
+ */
532
+ interface Grid {
533
+ h?: number;
534
+ w?: number;
535
+ x?: number;
536
+ y?: number;
537
+ }
538
+ }
539
+ }
280
540
  /**
281
541
  * Response model for query combination enumeration.
282
542
  */
@@ -303,10 +563,20 @@ export declare namespace CompilerEnumerateResponse {
303
563
  * Widget category (e.g. 'axis', 'table')
304
564
  */
305
565
  widget_category: string;
566
+ /**
567
+ * Deterministic UUID v5 for this combination
568
+ */
569
+ combination_id?: string | null;
306
570
  /**
307
571
  * Human-readable label for the query
308
572
  */
309
573
  query_label?: string | null;
574
+ /**
575
+ * Field-to-role mapping (e.g. {'due_month': 'x_axis'})
576
+ */
577
+ roles?: {
578
+ [key: string]: string;
579
+ };
310
580
  /**
311
581
  * Selected optional calculation names
312
582
  */
@@ -329,6 +599,10 @@ export declare namespace CompilerEnumerateResponse {
329
599
  variable_assignments?: {
330
600
  [key: string]: unknown;
331
601
  };
602
+ /**
603
+ * Resolved widget type (e.g. 'axis_metric_by_dimensiondate')
604
+ */
605
+ widget_type?: string | null;
332
606
  }
333
607
  }
334
608
  /**
@@ -451,6 +725,15 @@ export interface CompilerResolveResponse {
451
725
  * Compilation manifest with all named objects.
452
726
  */
453
727
  manifest?: Manifest | null;
728
+ /**
729
+ * Files auto-fixed due to renamed refs. None when no renames detected.
730
+ */
731
+ ref_fixes?: Array<CompilerResolveResponse.RefFix> | null;
732
+ /**
733
+ * Write-back request ID. Non-null when ref-fix files were dispatched to CLI via
734
+ * WebSocket.
735
+ */
736
+ request_id?: string | null;
454
737
  }
455
738
  export declare namespace CompilerResolveResponse {
456
739
  /**
@@ -477,7 +760,7 @@ export declare namespace CompilerResolveResponse {
477
760
  /**
478
761
  * Widget category that determines data shape constraints
479
762
  */
480
- widget_category: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static';
763
+ widget_category: 'axis' | 'funnel' | 'heatmap' | 'image' | 'kpi_card' | 'pie' | 'table' | 'text';
481
764
  /**
482
765
  * Usage guidance for AI processing
483
766
  */
@@ -507,11 +790,11 @@ export declare namespace CompilerResolveResponse {
507
790
  /**
508
791
  * Widget types within the declared widget_category that must NOT render this query
509
792
  */
510
- disallowed_widget_types?: Array<'kpi_card' | 'line_chart' | 'bar_chart' | 'pie_chart' | 'donut_chart' | 'area_chart' | 'scatter_chart' | 'data_table' | 'card_grid' | 'heatmap' | 'gauge' | 'text' | 'image' | 'styled_table' | 'stat_cards' | 'key_value_list'> | null;
793
+ disallowed_widget_types?: Array<'axis_metric_by_dimension' | 'axis_metric_by_dimensiondate' | 'axis_metric_by_dimensiondate_sliced_by_dimension' | 'axis_scatter_plot' | 'funnel_funnel_chart' | 'heatmap_heatmap' | 'image_image_grid' | 'image_single_image' | 'kpi_measure_with_dimension_expression' | 'kpi_measure_with_secondary_metric' | 'kpi_single_measure_compared_to_prev_period_sparkline' | 'kpi_single_value' | 'pie_pie_chart' | 'table_data_table' | 'table_fancy_subtotal_table' | 'table_key_value_list' | 'table_styled_table' | 'text_data_readout_with_sparkline' | 'text_narrative_text'> | null;
511
794
  /**
512
795
  * Merged required + selected optional filters
513
796
  */
514
- filters?: Array<ResolvedQuery.InlineFieldFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
797
+ filters?: Array<ResolvedQuery.InlineFormulaFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
515
798
  /**
516
799
  * Ordered list of query refs that were merged during inheritance resolution
517
800
  */
@@ -533,10 +816,6 @@ export declare namespace CompilerResolveResponse {
533
816
  * (highest/newest first) and asc for ascending (lowest/oldest first).
534
817
  */
535
818
  order_by?: ResolvedQuery.OrderBy | null;
536
- /**
537
- * Access grants required to use this query
538
- */
539
- required_access_grants?: Array<string> | null;
540
819
  /**
541
820
  * The matched chart recommendation after evaluating chart hints
542
821
  */
@@ -590,29 +869,17 @@ export declare namespace CompilerResolveResponse {
590
869
  }
591
870
  }
592
871
  /**
593
- * An inline filter using field + operator + values
872
+ * An inline filter using a SQL/expression formula
594
873
  */
595
- interface InlineFieldFilter {
596
- /**
597
- * Reference to the field to filter on
598
- */
599
- field: string;
874
+ interface InlineFormulaFilter {
600
875
  /**
601
876
  * Name of the inline filter
602
877
  */
603
878
  name: string;
604
879
  /**
605
- * Filter operator to apply
606
- */
607
- operator: 'equals' | 'not_equals' | 'in' | 'not_in' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals' | 'between' | 'in_the_last' | 'in_the_next' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'is_null' | 'is_not_null';
608
- /**
609
- * SQL expression for the filter value
880
+ * SQL expression for the filter condition
610
881
  */
611
- sql_value?: string | null;
612
- /**
613
- * Fixed values for the filter
614
- */
615
- static_values?: Array<string | number | boolean> | null;
882
+ sql: string;
616
883
  }
617
884
  /**
618
885
  * An inline filter using EXISTS or NOT EXISTS with a subquery
@@ -698,11 +965,15 @@ export declare namespace CompilerResolveResponse {
698
965
  /**
699
966
  * The concrete value bound for this resolution
700
967
  */
701
- bound_value: string | number | boolean;
968
+ bound_value: string | number | boolean | Array<string | number | boolean>;
702
969
  /**
703
970
  * Default value for this variable
704
971
  */
705
- default: string | number | boolean;
972
+ default: string | number | boolean | Array<string | number | boolean>;
973
+ /**
974
+ * Unique identifier for this variable
975
+ */
976
+ kater_id: string;
706
977
  /**
707
978
  * Variable name identifier
708
979
  */
@@ -710,7 +981,7 @@ export declare namespace CompilerResolveResponse {
710
981
  /**
711
982
  * Data type of the variable
712
983
  */
713
- type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
984
+ type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'STRING[]' | 'INT[]' | 'FLOAT[]' | 'DATE[]' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
714
985
  /**
715
986
  * Allowed values configuration
716
987
  */
@@ -727,6 +998,12 @@ export declare namespace CompilerResolveResponse {
727
998
  * True if bound_value equals the default value
728
999
  */
729
1000
  is_default?: boolean | null;
1001
+ /**
1002
+ * True if this is a runtime variable (not resolved at compile time). Runtime
1003
+ * variables have var() placeholders left in compiled SQL for literal substitution
1004
+ * at execution time.
1005
+ */
1006
+ is_runtime?: boolean | null;
730
1007
  /**
731
1008
  * Human-readable label for the variable
732
1009
  */
@@ -839,7 +1116,7 @@ export declare namespace CompilerResolveResponse {
839
1116
  /**
840
1117
  * Original type of the field in the source query
841
1118
  */
842
- source_type: 'dimension' | 'measure' | 'calculation';
1119
+ source_type: 'dimension' | 'dimension_date' | 'measure' | 'calculation';
843
1120
  }
844
1121
  }
845
1122
  }
@@ -893,6 +1170,46 @@ export declare namespace CompilerResolveResponse {
893
1170
  column?: number;
894
1171
  }
895
1172
  }
1173
+ /**
1174
+ * A file that was modified by auto-fix with its replacements.
1175
+ */
1176
+ interface RefFix {
1177
+ /**
1178
+ * Path to the modified file
1179
+ */
1180
+ file_path: string;
1181
+ /**
1182
+ * Full updated file content after fixes
1183
+ */
1184
+ new_content: string;
1185
+ /**
1186
+ * Individual ref replacements made in this file
1187
+ */
1188
+ replacements: Array<RefFix.Replacement>;
1189
+ }
1190
+ namespace RefFix {
1191
+ /**
1192
+ * A single ref replacement within a file.
1193
+ */
1194
+ interface Replacement {
1195
+ /**
1196
+ * Path to the file containing the replaced ref
1197
+ */
1198
+ file_path: string;
1199
+ /**
1200
+ * Line number where the replacement occurred
1201
+ */
1202
+ line_number: number;
1203
+ /**
1204
+ * Updated reference string
1205
+ */
1206
+ new_ref: string;
1207
+ /**
1208
+ * Original reference string
1209
+ */
1210
+ old_ref: string;
1211
+ }
1212
+ }
896
1213
  }
897
1214
  /**
898
1215
  * Response model for schema validation.
@@ -910,6 +1227,10 @@ export interface CompilerValidateResponse {
910
1227
  * Validation errors
911
1228
  */
912
1229
  errors?: Array<CompilerErrorItem>;
1230
+ /**
1231
+ * Write-back request ID. Non-null when files were dispatched to CLI via WebSocket.
1232
+ */
1233
+ request_id?: string | null;
913
1234
  /**
914
1235
  * Validation warnings
915
1236
  */
@@ -940,6 +1261,14 @@ export declare namespace CompilerValidateResponse {
940
1261
  * Validation errors for this connection
941
1262
  */
942
1263
  errors?: Array<CompilerAPI.CompilerErrorItem>;
1264
+ /**
1265
+ * Compilation manifest with all named objects.
1266
+ */
1267
+ manifest?: CompilerAPI.Manifest | null;
1268
+ /**
1269
+ * Files auto-fixed due to renamed refs. None when no renames detected.
1270
+ */
1271
+ ref_fixes?: Array<ConnectionResult.RefFix> | null;
943
1272
  /**
944
1273
  * Validation warnings for this connection
945
1274
  */
@@ -996,6 +1325,46 @@ export declare namespace CompilerValidateResponse {
996
1325
  column?: number;
997
1326
  }
998
1327
  }
1328
+ /**
1329
+ * A file that was modified by auto-fix with its replacements.
1330
+ */
1331
+ interface RefFix {
1332
+ /**
1333
+ * Path to the modified file
1334
+ */
1335
+ file_path: string;
1336
+ /**
1337
+ * Full updated file content after fixes
1338
+ */
1339
+ new_content: string;
1340
+ /**
1341
+ * Individual ref replacements made in this file
1342
+ */
1343
+ replacements: Array<RefFix.Replacement>;
1344
+ }
1345
+ namespace RefFix {
1346
+ /**
1347
+ * A single ref replacement within a file.
1348
+ */
1349
+ interface Replacement {
1350
+ /**
1351
+ * Path to the file containing the replaced ref
1352
+ */
1353
+ file_path: string;
1354
+ /**
1355
+ * Line number where the replacement occurred
1356
+ */
1357
+ line_number: number;
1358
+ /**
1359
+ * Updated reference string
1360
+ */
1361
+ new_ref: string;
1362
+ /**
1363
+ * Original reference string
1364
+ */
1365
+ old_ref: string;
1366
+ }
1367
+ }
999
1368
  }
1000
1369
  }
1001
1370
  export interface CompilerCompileParams {
@@ -1046,7 +1415,7 @@ export declare namespace CompilerCompileParams {
1046
1415
  /**
1047
1416
  * Widget category that determines data shape constraints
1048
1417
  */
1049
- widget_category: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static';
1418
+ widget_category: 'axis' | 'funnel' | 'heatmap' | 'image' | 'kpi_card' | 'pie' | 'table' | 'text';
1050
1419
  /**
1051
1420
  * Usage guidance for AI processing
1052
1421
  */
@@ -1076,11 +1445,11 @@ export declare namespace CompilerCompileParams {
1076
1445
  /**
1077
1446
  * Widget types within the declared widget_category that must NOT render this query
1078
1447
  */
1079
- disallowed_widget_types?: Array<'kpi_card' | 'line_chart' | 'bar_chart' | 'pie_chart' | 'donut_chart' | 'area_chart' | 'scatter_chart' | 'data_table' | 'card_grid' | 'heatmap' | 'gauge' | 'text' | 'image' | 'styled_table' | 'stat_cards' | 'key_value_list'> | null;
1448
+ disallowed_widget_types?: Array<'axis_metric_by_dimension' | 'axis_metric_by_dimensiondate' | 'axis_metric_by_dimensiondate_sliced_by_dimension' | 'axis_scatter_plot' | 'funnel_funnel_chart' | 'heatmap_heatmap' | 'image_image_grid' | 'image_single_image' | 'kpi_measure_with_dimension_expression' | 'kpi_measure_with_secondary_metric' | 'kpi_single_measure_compared_to_prev_period_sparkline' | 'kpi_single_value' | 'pie_pie_chart' | 'table_data_table' | 'table_fancy_subtotal_table' | 'table_key_value_list' | 'table_styled_table' | 'text_data_readout_with_sparkline' | 'text_narrative_text'> | null;
1080
1449
  /**
1081
1450
  * Merged required + selected optional filters
1082
1451
  */
1083
- filters?: Array<ResolvedQuery.InlineFieldFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
1452
+ filters?: Array<ResolvedQuery.InlineFormulaFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
1084
1453
  /**
1085
1454
  * Ordered list of query refs that were merged during inheritance resolution
1086
1455
  */
@@ -1102,10 +1471,6 @@ export declare namespace CompilerCompileParams {
1102
1471
  * (highest/newest first) and asc for ascending (lowest/oldest first).
1103
1472
  */
1104
1473
  order_by?: ResolvedQuery.OrderBy | null;
1105
- /**
1106
- * Access grants required to use this query
1107
- */
1108
- required_access_grants?: Array<string> | null;
1109
1474
  /**
1110
1475
  * The matched chart recommendation after evaluating chart hints
1111
1476
  */
@@ -1159,29 +1524,17 @@ export declare namespace CompilerCompileParams {
1159
1524
  }
1160
1525
  }
1161
1526
  /**
1162
- * An inline filter using field + operator + values
1527
+ * An inline filter using a SQL/expression formula
1163
1528
  */
1164
- interface InlineFieldFilter {
1165
- /**
1166
- * Reference to the field to filter on
1167
- */
1168
- field: string;
1529
+ interface InlineFormulaFilter {
1169
1530
  /**
1170
1531
  * Name of the inline filter
1171
1532
  */
1172
1533
  name: string;
1173
1534
  /**
1174
- * Filter operator to apply
1175
- */
1176
- operator: 'equals' | 'not_equals' | 'in' | 'not_in' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals' | 'between' | 'in_the_last' | 'in_the_next' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'is_null' | 'is_not_null';
1177
- /**
1178
- * SQL expression for the filter value
1179
- */
1180
- sql_value?: string | null;
1181
- /**
1182
- * Fixed values for the filter
1535
+ * SQL expression for the filter condition
1183
1536
  */
1184
- static_values?: Array<string | number | boolean> | null;
1537
+ sql: string;
1185
1538
  }
1186
1539
  /**
1187
1540
  * An inline filter using EXISTS or NOT EXISTS with a subquery
@@ -1267,11 +1620,15 @@ export declare namespace CompilerCompileParams {
1267
1620
  /**
1268
1621
  * The concrete value bound for this resolution
1269
1622
  */
1270
- bound_value: string | number | boolean;
1623
+ bound_value: string | number | boolean | Array<string | number | boolean>;
1271
1624
  /**
1272
1625
  * Default value for this variable
1273
1626
  */
1274
- default: string | number | boolean;
1627
+ default: string | number | boolean | Array<string | number | boolean>;
1628
+ /**
1629
+ * Unique identifier for this variable
1630
+ */
1631
+ kater_id: string;
1275
1632
  /**
1276
1633
  * Variable name identifier
1277
1634
  */
@@ -1279,7 +1636,7 @@ export declare namespace CompilerCompileParams {
1279
1636
  /**
1280
1637
  * Data type of the variable
1281
1638
  */
1282
- type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
1639
+ type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'STRING[]' | 'INT[]' | 'FLOAT[]' | 'DATE[]' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
1283
1640
  /**
1284
1641
  * Allowed values configuration
1285
1642
  */
@@ -1296,6 +1653,12 @@ export declare namespace CompilerCompileParams {
1296
1653
  * True if bound_value equals the default value
1297
1654
  */
1298
1655
  is_default?: boolean | null;
1656
+ /**
1657
+ * True if this is a runtime variable (not resolved at compile time). Runtime
1658
+ * variables have var() placeholders left in compiled SQL for literal substitution
1659
+ * at execution time.
1660
+ */
1661
+ is_runtime?: boolean | null;
1299
1662
  /**
1300
1663
  * Human-readable label for the variable
1301
1664
  */
@@ -1408,11 +1771,40 @@ export declare namespace CompilerCompileParams {
1408
1771
  /**
1409
1772
  * Original type of the field in the source query
1410
1773
  */
1411
- source_type: 'dimension' | 'measure' | 'calculation';
1774
+ source_type: 'dimension' | 'dimension_date' | 'measure' | 'calculation';
1412
1775
  }
1413
1776
  }
1414
1777
  }
1415
1778
  }
1779
+ export interface CompilerCompileDashboardParams {
1780
+ /**
1781
+ * Body param: Connection to compile against
1782
+ */
1783
+ connection_id: string;
1784
+ /**
1785
+ * Body param: Relative path within the connection (e.g.
1786
+ * 'dashboards/compliance_overview')
1787
+ */
1788
+ dashboard_path: string;
1789
+ /**
1790
+ * Query param
1791
+ */
1792
+ source?: string | null;
1793
+ /**
1794
+ * Body param: Optional filter overrides from UI
1795
+ */
1796
+ filters?: {
1797
+ [key: string]: string | Array<string> | null;
1798
+ } | null;
1799
+ /**
1800
+ * Body param: Optional tenant key for multi-tenant execution
1801
+ */
1802
+ tenant_key?: string | null;
1803
+ /**
1804
+ * Header param
1805
+ */
1806
+ 'X-Kater-CLI-ID'?: string;
1807
+ }
1416
1808
  export interface CompilerEnumerateParams {
1417
1809
  /**
1418
1810
  * Body param: Connection to enumerate against
@@ -1427,6 +1819,11 @@ export interface CompilerEnumerateParams {
1427
1819
  * queries.
1428
1820
  */
1429
1821
  query_refs?: Array<string> | null;
1822
+ /**
1823
+ * Body param: Tenant key for multi-tenant clients. Required when the client uses
1824
+ * row or database tenancy.
1825
+ */
1826
+ tenant_key?: string | null;
1430
1827
  /**
1431
1828
  * Header param
1432
1829
  */
@@ -1479,7 +1876,7 @@ export declare namespace CompilerExecuteParams {
1479
1876
  /**
1480
1877
  * Widget category that determines data shape constraints
1481
1878
  */
1482
- widget_category: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static';
1879
+ widget_category: 'axis' | 'funnel' | 'heatmap' | 'image' | 'kpi_card' | 'pie' | 'table' | 'text';
1483
1880
  /**
1484
1881
  * Usage guidance for AI processing
1485
1882
  */
@@ -1509,11 +1906,11 @@ export declare namespace CompilerExecuteParams {
1509
1906
  /**
1510
1907
  * Widget types within the declared widget_category that must NOT render this query
1511
1908
  */
1512
- disallowed_widget_types?: Array<'kpi_card' | 'line_chart' | 'bar_chart' | 'pie_chart' | 'donut_chart' | 'area_chart' | 'scatter_chart' | 'data_table' | 'card_grid' | 'heatmap' | 'gauge' | 'text' | 'image' | 'styled_table' | 'stat_cards' | 'key_value_list'> | null;
1909
+ disallowed_widget_types?: Array<'axis_metric_by_dimension' | 'axis_metric_by_dimensiondate' | 'axis_metric_by_dimensiondate_sliced_by_dimension' | 'axis_scatter_plot' | 'funnel_funnel_chart' | 'heatmap_heatmap' | 'image_image_grid' | 'image_single_image' | 'kpi_measure_with_dimension_expression' | 'kpi_measure_with_secondary_metric' | 'kpi_single_measure_compared_to_prev_period_sparkline' | 'kpi_single_value' | 'pie_pie_chart' | 'table_data_table' | 'table_fancy_subtotal_table' | 'table_key_value_list' | 'table_styled_table' | 'text_data_readout_with_sparkline' | 'text_narrative_text'> | null;
1513
1910
  /**
1514
1911
  * Merged required + selected optional filters
1515
1912
  */
1516
- filters?: Array<ResolvedQuery.InlineFieldFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
1913
+ filters?: Array<ResolvedQuery.InlineFormulaFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
1517
1914
  /**
1518
1915
  * Ordered list of query refs that were merged during inheritance resolution
1519
1916
  */
@@ -1535,10 +1932,6 @@ export declare namespace CompilerExecuteParams {
1535
1932
  * (highest/newest first) and asc for ascending (lowest/oldest first).
1536
1933
  */
1537
1934
  order_by?: ResolvedQuery.OrderBy | null;
1538
- /**
1539
- * Access grants required to use this query
1540
- */
1541
- required_access_grants?: Array<string> | null;
1542
1935
  /**
1543
1936
  * The matched chart recommendation after evaluating chart hints
1544
1937
  */
@@ -1592,29 +1985,17 @@ export declare namespace CompilerExecuteParams {
1592
1985
  }
1593
1986
  }
1594
1987
  /**
1595
- * An inline filter using field + operator + values
1988
+ * An inline filter using a SQL/expression formula
1596
1989
  */
1597
- interface InlineFieldFilter {
1598
- /**
1599
- * Reference to the field to filter on
1600
- */
1601
- field: string;
1990
+ interface InlineFormulaFilter {
1602
1991
  /**
1603
1992
  * Name of the inline filter
1604
1993
  */
1605
1994
  name: string;
1606
1995
  /**
1607
- * Filter operator to apply
1608
- */
1609
- operator: 'equals' | 'not_equals' | 'in' | 'not_in' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals' | 'between' | 'in_the_last' | 'in_the_next' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'is_null' | 'is_not_null';
1610
- /**
1611
- * SQL expression for the filter value
1612
- */
1613
- sql_value?: string | null;
1614
- /**
1615
- * Fixed values for the filter
1996
+ * SQL expression for the filter condition
1616
1997
  */
1617
- static_values?: Array<string | number | boolean> | null;
1998
+ sql: string;
1618
1999
  }
1619
2000
  /**
1620
2001
  * An inline filter using EXISTS or NOT EXISTS with a subquery
@@ -1700,11 +2081,15 @@ export declare namespace CompilerExecuteParams {
1700
2081
  /**
1701
2082
  * The concrete value bound for this resolution
1702
2083
  */
1703
- bound_value: string | number | boolean;
2084
+ bound_value: string | number | boolean | Array<string | number | boolean>;
1704
2085
  /**
1705
2086
  * Default value for this variable
1706
2087
  */
1707
- default: string | number | boolean;
2088
+ default: string | number | boolean | Array<string | number | boolean>;
2089
+ /**
2090
+ * Unique identifier for this variable
2091
+ */
2092
+ kater_id: string;
1708
2093
  /**
1709
2094
  * Variable name identifier
1710
2095
  */
@@ -1712,7 +2097,7 @@ export declare namespace CompilerExecuteParams {
1712
2097
  /**
1713
2098
  * Data type of the variable
1714
2099
  */
1715
- type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
2100
+ type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'STRING[]' | 'INT[]' | 'FLOAT[]' | 'DATE[]' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
1716
2101
  /**
1717
2102
  * Allowed values configuration
1718
2103
  */
@@ -1729,6 +2114,12 @@ export declare namespace CompilerExecuteParams {
1729
2114
  * True if bound_value equals the default value
1730
2115
  */
1731
2116
  is_default?: boolean | null;
2117
+ /**
2118
+ * True if this is a runtime variable (not resolved at compile time). Runtime
2119
+ * variables have var() placeholders left in compiled SQL for literal substitution
2120
+ * at execution time.
2121
+ */
2122
+ is_runtime?: boolean | null;
1732
2123
  /**
1733
2124
  * Human-readable label for the variable
1734
2125
  */
@@ -1841,7 +2232,7 @@ export declare namespace CompilerExecuteParams {
1841
2232
  /**
1842
2233
  * Original type of the field in the source query
1843
2234
  */
1844
- source_type: 'dimension' | 'measure' | 'calculation';
2235
+ source_type: 'dimension' | 'dimension_date' | 'measure' | 'calculation';
1845
2236
  }
1846
2237
  }
1847
2238
  }
@@ -1859,6 +2250,10 @@ export interface CompilerResolveParams {
1859
2250
  * Query param
1860
2251
  */
1861
2252
  source?: string | null;
2253
+ /**
2254
+ * Body param: Automatically fix broken refs caused by renames. Defaults to True.
2255
+ */
2256
+ auto_fix?: boolean;
1862
2257
  /**
1863
2258
  * Body param: Comma-separated slot selections and variable assignments. Reserved
1864
2259
  * keys: measure, dimension, filter, calculation. All other keys are variable
@@ -1876,6 +2271,10 @@ export interface CompilerValidateParams {
1876
2271
  * Query param
1877
2272
  */
1878
2273
  source?: string | null;
2274
+ /**
2275
+ * Body param: Automatically fix broken refs caused by renames. Defaults to True.
2276
+ */
2277
+ auto_fix?: boolean;
1879
2278
  /**
1880
2279
  * Body param: Optional connection IDs to validate. If omitted, validates all
1881
2280
  * connections.
@@ -1887,7 +2286,9 @@ export interface CompilerValidateParams {
1887
2286
  'X-Kater-CLI-ID'?: string;
1888
2287
  }
1889
2288
  export declare namespace Compiler {
1890
- export { type ChartConfig as ChartConfig, type CompilerErrorItem as CompilerErrorItem, type InlineField as InlineField, type Manifest as Manifest, type ManifestEntry as ManifestEntry, type RefWithLabel as RefWithLabel, type SubqueryCondition as SubqueryCondition, type CompilerCompileResponse as CompilerCompileResponse, type CompilerEnumerateResponse as CompilerEnumerateResponse, type CompilerExecuteResponse as CompilerExecuteResponse, type CompilerResolveResponse as CompilerResolveResponse, type CompilerValidateResponse as CompilerValidateResponse, type CompilerCompileParams as CompilerCompileParams, type CompilerEnumerateParams as CompilerEnumerateParams, type CompilerExecuteParams as CompilerExecuteParams, type CompilerResolveParams as CompilerResolveParams, type CompilerValidateParams as CompilerValidateParams, };
1891
- export { Cache as Cache, type CacheInvalidateResponse as CacheInvalidateResponse, type CacheInvalidateParams as CacheInvalidateParams, };
2289
+ export { type ChartConfig as ChartConfig, type CompilerErrorItem as CompilerErrorItem, type InlineField as InlineField, type Manifest as Manifest, type ManifestEntry as ManifestEntry, type RefWithLabel as RefWithLabel, type SubqueryCondition as SubqueryCondition, type CompilerCompileResponse as CompilerCompileResponse, type CompilerCompileDashboardResponse as CompilerCompileDashboardResponse, type CompilerEnumerateResponse as CompilerEnumerateResponse, type CompilerExecuteResponse as CompilerExecuteResponse, type CompilerResolveResponse as CompilerResolveResponse, type CompilerValidateResponse as CompilerValidateResponse, type CompilerCompileParams as CompilerCompileParams, type CompilerCompileDashboardParams as CompilerCompileDashboardParams, type CompilerEnumerateParams as CompilerEnumerateParams, type CompilerExecuteParams as CompilerExecuteParams, type CompilerResolveParams as CompilerResolveParams, type CompilerValidateParams as CompilerValidateParams, };
2290
+ export { Cache as Cache };
2291
+ export { CombinationAPICombination as Combination, type CombinationPreviewResponse as CombinationPreviewResponse, type CombinationPreviewParams as CombinationPreviewParams, };
2292
+ export { type ManifestRegenerateAndCreatePrResponse as ManifestRegenerateAndCreatePrResponse, type ManifestRegenerateAndCreatePrParams as ManifestRegenerateAndCreatePrParams, };
1892
2293
  }
1893
2294
  //# sourceMappingURL=compiler.d.mts.map