@katerai/sdk 0.8.0 → 0.10.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 (68) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/client.js.map +1 -1
  3. package/client.mjs.map +1 -1
  4. package/package.json +1 -1
  5. package/resources/v1/compiler/cache.d.mts +39 -0
  6. package/resources/v1/compiler/cache.d.mts.map +1 -0
  7. package/resources/v1/compiler/cache.d.ts +39 -0
  8. package/resources/v1/compiler/cache.d.ts.map +1 -0
  9. package/resources/v1/compiler/cache.js +18 -0
  10. package/resources/v1/compiler/cache.js.map +1 -0
  11. package/resources/v1/compiler/cache.mjs +14 -0
  12. package/resources/v1/compiler/cache.mjs.map +1 -0
  13. package/resources/v1/compiler/compiler.d.mts +1893 -0
  14. package/resources/v1/compiler/compiler.d.mts.map +1 -0
  15. package/resources/v1/compiler/compiler.d.ts +1893 -0
  16. package/resources/v1/compiler/compiler.d.ts.map +1 -0
  17. package/resources/v1/compiler/compiler.js +119 -0
  18. package/resources/v1/compiler/compiler.js.map +1 -0
  19. package/resources/v1/compiler/compiler.mjs +114 -0
  20. package/resources/v1/compiler/compiler.mjs.map +1 -0
  21. package/resources/v1/compiler/index.d.mts +3 -0
  22. package/resources/v1/compiler/index.d.mts.map +1 -0
  23. package/resources/v1/compiler/index.d.ts +3 -0
  24. package/resources/v1/compiler/index.d.ts.map +1 -0
  25. package/resources/v1/compiler/index.js +9 -0
  26. package/resources/v1/compiler/index.js.map +1 -0
  27. package/resources/v1/compiler/index.mjs +4 -0
  28. package/resources/v1/compiler/index.mjs.map +1 -0
  29. package/resources/v1/compiler.d.mts +1 -1115
  30. package/resources/v1/compiler.d.mts.map +1 -1
  31. package/resources/v1/compiler.d.ts +1 -1115
  32. package/resources/v1/compiler.d.ts.map +1 -1
  33. package/resources/v1/compiler.js +2 -66
  34. package/resources/v1/compiler.js.map +1 -1
  35. package/resources/v1/compiler.mjs +1 -64
  36. package/resources/v1/compiler.mjs.map +1 -1
  37. package/resources/v1/index.d.mts +1 -1
  38. package/resources/v1/index.d.mts.map +1 -1
  39. package/resources/v1/index.d.ts +1 -1
  40. package/resources/v1/index.d.ts.map +1 -1
  41. package/resources/v1/index.js +4 -4
  42. package/resources/v1/index.js.map +1 -1
  43. package/resources/v1/index.mjs +1 -1
  44. package/resources/v1/index.mjs.map +1 -1
  45. package/resources/v1/v1.d.mts +3 -3
  46. package/resources/v1/v1.d.mts.map +1 -1
  47. package/resources/v1/v1.d.ts +3 -3
  48. package/resources/v1/v1.d.ts.map +1 -1
  49. package/resources/v1/v1.js +2 -2
  50. package/resources/v1/v1.js.map +1 -1
  51. package/resources/v1/v1.mjs +2 -2
  52. package/resources/v1/v1.mjs.map +1 -1
  53. package/src/client.ts +1 -1
  54. package/src/resources/v1/compiler/cache.ts +51 -0
  55. package/src/resources/v1/compiler/compiler.ts +2548 -0
  56. package/src/resources/v1/compiler/index.ts +23 -0
  57. package/src/resources/v1/compiler.ts +1 -1482
  58. package/src/resources/v1/index.ts +5 -1
  59. package/src/resources/v1/v1.ts +17 -9
  60. package/src/version.ts +1 -1
  61. package/version.d.mts +1 -1
  62. package/version.d.mts.map +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.d.ts.map +1 -1
  65. package/version.js +1 -1
  66. package/version.js.map +1 -1
  67. package/version.mjs +1 -1
  68. package/version.mjs.map +1 -1
@@ -0,0 +1,2548 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as CompilerAPI from './compiler';
5
+ import * as CacheAPI from './cache';
6
+ import { Cache, CacheInvalidateParams, CacheInvalidateResponse } from './cache';
7
+ import { APIPromise } from '../../../core/api-promise';
8
+ import { buildHeaders } from '../../../internal/headers';
9
+ import { RequestOptions } from '../../../internal/request-options';
10
+
11
+ export class Compiler extends APIResource {
12
+ cache: CacheAPI.Cache = new CacheAPI.Cache(this._client);
13
+
14
+ /**
15
+ * Compile a resolved query to SQL.
16
+ *
17
+ * Takes a previously resolved query and generates the final SQL statement for the
18
+ * target dialect.
19
+ *
20
+ * RLS: Filtered to current client (ClientRLSDB).
21
+ */
22
+ compile(params: CompilerCompileParams, options?: RequestOptions): APIPromise<CompilerCompileResponse> {
23
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
24
+ return this._client.post('/api/v1/compiler/compile', {
25
+ query: { source },
26
+ body,
27
+ ...options,
28
+ headers: buildHeaders([
29
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
30
+ options?.headers,
31
+ ]),
32
+ });
33
+ }
34
+
35
+ /**
36
+ * Enumerate every valid query configuration for a connection.
37
+ *
38
+ * Generates all valid combinations of optional dimensions, measures, calculations,
39
+ * filters, and variable values, constrained by widget category rules.
40
+ *
41
+ * RLS: Filtered to current client (ClientRLSDB).
42
+ */
43
+ enumerate(
44
+ params: CompilerEnumerateParams,
45
+ options?: RequestOptions,
46
+ ): APIPromise<CompilerEnumerateResponse> {
47
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
48
+ return this._client.post('/api/v1/compiler/enumerate', {
49
+ query: { source },
50
+ body,
51
+ ...options,
52
+ headers: buildHeaders([
53
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
54
+ options?.headers,
55
+ ]),
56
+ });
57
+ }
58
+
59
+ /**
60
+ * Execute a query with transparent caching.
61
+ *
62
+ * Compiles the resolved query to SQL, checks the cache for existing results,
63
+ * executes against the warehouse on cache miss, and stores the result for future
64
+ * requests. Cache failures are invisible to the caller.
65
+ *
66
+ * RLS: Filtered to current client (ClientRLSDB).
67
+ */
68
+ execute(params: CompilerExecuteParams, options?: RequestOptions): APIPromise<CompilerExecuteResponse> {
69
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
70
+ return this._client.post('/api/v1/compiler/execute', {
71
+ query: { source },
72
+ body,
73
+ ...options,
74
+ headers: buildHeaders([
75
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
76
+ options?.headers,
77
+ ]),
78
+ });
79
+ }
80
+
81
+ /**
82
+ * Resolve a query template with user-selected parameters.
83
+ *
84
+ * Takes a query reference and variable selections, returns the fully resolved
85
+ * query object ready for compilation.
86
+ *
87
+ * RLS: Filtered to current client (ClientRLSDB).
88
+ */
89
+ resolve(params: CompilerResolveParams, options?: RequestOptions): APIPromise<CompilerResolveResponse> {
90
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
91
+ return this._client.post('/api/v1/compiler/resolve', {
92
+ query: { source },
93
+ body,
94
+ ...options,
95
+ headers: buildHeaders([
96
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
97
+ options?.headers,
98
+ ]),
99
+ });
100
+ }
101
+
102
+ /**
103
+ * Validate a schema file set against a connection.
104
+ *
105
+ * Checks all views, queries, and related schemas for correctness and returns any
106
+ * errors or warnings found.
107
+ *
108
+ * RLS: Filtered to current client (ClientRLSDB).
109
+ */
110
+ validate(params: CompilerValidateParams, options?: RequestOptions): APIPromise<CompilerValidateResponse> {
111
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
112
+ return this._client.post('/api/v1/compiler/validate', {
113
+ query: { source },
114
+ body,
115
+ ...options,
116
+ headers: buildHeaders([
117
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
118
+ options?.headers,
119
+ ]),
120
+ });
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Chart configuration with variable references
126
+ */
127
+ export interface ChartConfig {
128
+ /**
129
+ * Field or variable reference for color grouping
130
+ */
131
+ color_by?: string | null;
132
+
133
+ /**
134
+ * Comparison mode for single_value widgets (e.g., previous_period, target)
135
+ */
136
+ comparison?: 'previous_period' | 'target' | null;
137
+
138
+ /**
139
+ * Field or variable reference for size
140
+ */
141
+ size?: string | null;
142
+
143
+ /**
144
+ * Field or variable reference for stacking
145
+ */
146
+ stack_by?: string | null;
147
+
148
+ /**
149
+ * Target value for comparison: target mode
150
+ */
151
+ target_value?: string | null;
152
+
153
+ /**
154
+ * Field or variable reference for x-axis
155
+ */
156
+ x_axis?: string | null;
157
+
158
+ /**
159
+ * Field or variable reference for y-axis
160
+ */
161
+ y_axis?: string | null;
162
+ }
163
+
164
+ /**
165
+ * A single compiler validation or compilation error.
166
+ */
167
+ export interface CompilerErrorItem {
168
+ /**
169
+ * Machine-readable error code
170
+ */
171
+ code: string;
172
+
173
+ /**
174
+ * Human-readable error description
175
+ */
176
+ message: string;
177
+
178
+ /**
179
+ * Column number in the source file
180
+ */
181
+ column?: number | null;
182
+
183
+ /**
184
+ * Source file path where the error occurred
185
+ */
186
+ file?: string | null;
187
+
188
+ /**
189
+ * Line number in the source file
190
+ */
191
+ line?: number | null;
192
+
193
+ /**
194
+ * Reference to the source element (e.g. view or query name)
195
+ */
196
+ ref?: string | null;
197
+
198
+ /**
199
+ * Suggested fix for this error
200
+ */
201
+ remediation?: string | null;
202
+ }
203
+
204
+ /**
205
+ * An inline field definition for dimensions/measures/calculations
206
+ */
207
+ export interface InlineField {
208
+ /**
209
+ * Unique identifier for this inline field
210
+ */
211
+ kater_id: string;
212
+
213
+ /**
214
+ * Name of the inline field
215
+ */
216
+ name: string;
217
+
218
+ /**
219
+ * SQL expression for the field
220
+ */
221
+ sql: string;
222
+
223
+ /**
224
+ * Human-readable label
225
+ */
226
+ label?: string | null;
227
+ }
228
+
229
+ /**
230
+ * Compilation manifest with all named objects.
231
+ */
232
+ export interface Manifest {
233
+ generated_at: string;
234
+
235
+ objects: { [key: string]: ManifestEntry };
236
+
237
+ schema_version?: string;
238
+ }
239
+
240
+ /**
241
+ * A single object entry in the manifest.
242
+ */
243
+ export interface ManifestEntry {
244
+ kater_id: string;
245
+
246
+ name: string;
247
+
248
+ type: string;
249
+
250
+ label?: string | null;
251
+
252
+ parent_id?: string | null;
253
+
254
+ source_file?: string | null;
255
+ }
256
+
257
+ /**
258
+ * A reference with optional label override
259
+ */
260
+ export interface RefWithLabel {
261
+ /**
262
+ * Reference using ref(), var(), or expr() syntax
263
+ */
264
+ ref: string;
265
+
266
+ /**
267
+ * Optional label override for this reference
268
+ */
269
+ label?: string | null;
270
+ }
271
+
272
+ /**
273
+ * A subquery condition for EXISTS/NOT EXISTS filters
274
+ */
275
+ export interface SubqueryCondition {
276
+ /**
277
+ * Reference to the source view/table for the subquery
278
+ */
279
+ from: string;
280
+
281
+ /**
282
+ * WHERE conditions for the subquery
283
+ */
284
+ where: Array<string>;
285
+ }
286
+
287
+ /**
288
+ * Response model for SQL compilation.
289
+ */
290
+ export interface CompilerCompileResponse {
291
+ /**
292
+ * SQL dialect used (e.g. 'snowflake')
293
+ */
294
+ dialect: string;
295
+
296
+ /**
297
+ * Whether compilation succeeded
298
+ */
299
+ success: boolean;
300
+
301
+ /**
302
+ * Maps UUID column aliases to human-readable names and types
303
+ */
304
+ column_map?: Array<CompilerCompileResponse.ColumnMap>;
305
+
306
+ /**
307
+ * Compilation errors
308
+ */
309
+ errors?: Array<CompilerErrorItem>;
310
+
311
+ /**
312
+ * Compilation manifest with all named objects.
313
+ */
314
+ manifest?: Manifest | null;
315
+
316
+ /**
317
+ * Compilation metadata from the compiler.
318
+ */
319
+ metadata?: CompilerCompileResponse.Metadata | null;
320
+
321
+ /**
322
+ * Generated SQL statement
323
+ */
324
+ sql?: string | null;
325
+ }
326
+
327
+ export namespace CompilerCompileResponse {
328
+ /**
329
+ * Maps a UUID column alias to its human-readable name and type.
330
+ */
331
+ export interface ColumnMap {
332
+ /**
333
+ * Field type: dimension, measure, or calculation
334
+ */
335
+ field_type: string;
336
+
337
+ /**
338
+ * UUID string used as SQL column alias
339
+ */
340
+ kater_id: string;
341
+
342
+ /**
343
+ * Human-readable column name
344
+ */
345
+ name: string;
346
+
347
+ /**
348
+ * Aggregation type for measures: sum, count, min, max, avg, unknown. None for
349
+ * non-measures.
350
+ */
351
+ aggregation?: string | null;
352
+
353
+ /**
354
+ * Display label
355
+ */
356
+ label?: string | null;
357
+ }
358
+
359
+ /**
360
+ * Compilation metadata from the compiler.
361
+ */
362
+ export interface Metadata {
363
+ /**
364
+ * SQL dialect used (e.g. 'snowflake')
365
+ */
366
+ dialect: string;
367
+
368
+ /**
369
+ * Reference to the compiled query
370
+ */
371
+ query_ref: string;
372
+
373
+ /**
374
+ * Dimension names used in compilation
375
+ */
376
+ dimensions_used?: Array<string>;
377
+
378
+ /**
379
+ * Filter names used in compilation
380
+ */
381
+ filters_used?: Array<string>;
382
+
383
+ /**
384
+ * Measure names used in compilation
385
+ */
386
+ measures_used?: Array<string>;
387
+
388
+ /**
389
+ * View names used in compilation
390
+ */
391
+ views_used?: Array<string>;
392
+ }
393
+ }
394
+
395
+ /**
396
+ * Response model for query combination enumeration.
397
+ */
398
+ export interface CompilerEnumerateResponse {
399
+ /**
400
+ * All valid query configurations
401
+ */
402
+ combinations: Array<CompilerEnumerateResponse.Combination>;
403
+
404
+ /**
405
+ * Total number of combinations
406
+ */
407
+ total_count: number;
408
+ }
409
+
410
+ export namespace CompilerEnumerateResponse {
411
+ /**
412
+ * A single valid query configuration.
413
+ */
414
+ export interface Combination {
415
+ /**
416
+ * Query template reference (e.g. 'q:COMPLIANCE_OVERVIEW')
417
+ */
418
+ query_ref: string;
419
+
420
+ /**
421
+ * Widget category (e.g. 'axis', 'table')
422
+ */
423
+ widget_category: string;
424
+
425
+ /**
426
+ * Human-readable label for the query
427
+ */
428
+ query_label?: string | null;
429
+
430
+ /**
431
+ * Selected optional calculation names
432
+ */
433
+ selected_calculations?: Array<string>;
434
+
435
+ /**
436
+ * Selected optional dimension names
437
+ */
438
+ selected_dimensions?: Array<string>;
439
+
440
+ /**
441
+ * Selected optional filter names
442
+ */
443
+ selected_filters?: Array<string>;
444
+
445
+ /**
446
+ * Selected optional measure names
447
+ */
448
+ selected_measures?: Array<string>;
449
+
450
+ /**
451
+ * Variable name to value assignments
452
+ */
453
+ variable_assignments?: { [key: string]: unknown };
454
+ }
455
+ }
456
+
457
+ /**
458
+ * Response model for query execution.
459
+ */
460
+ export interface CompilerExecuteResponse {
461
+ /**
462
+ * SQL dialect used
463
+ */
464
+ dialect: string;
465
+
466
+ /**
467
+ * Whether execution succeeded
468
+ */
469
+ success: boolean;
470
+
471
+ /**
472
+ * Whether the result was served from cache
473
+ */
474
+ cache_hit?: boolean;
475
+
476
+ /**
477
+ * Maps UUID column aliases to human-readable names
478
+ */
479
+ column_map?: Array<CompilerExecuteResponse.ColumnMap>;
480
+
481
+ /**
482
+ * Query result rows as list of column-value dicts
483
+ */
484
+ data?: Array<{ [key: string]: unknown }>;
485
+
486
+ /**
487
+ * Compilation errors (if any)
488
+ */
489
+ errors?: Array<CompilerErrorItem>;
490
+
491
+ /**
492
+ * Total execution time in milliseconds
493
+ */
494
+ execution_time_ms?: number;
495
+
496
+ /**
497
+ * Compilation metadata from the compiler.
498
+ */
499
+ metadata?: CompilerExecuteResponse.Metadata | null;
500
+
501
+ /**
502
+ * Number of rows returned
503
+ */
504
+ row_count?: number;
505
+
506
+ /**
507
+ * Generated SQL statement
508
+ */
509
+ sql?: string | null;
510
+ }
511
+
512
+ export namespace CompilerExecuteResponse {
513
+ /**
514
+ * Maps a UUID column alias to its human-readable name and type.
515
+ */
516
+ export interface ColumnMap {
517
+ /**
518
+ * Field type: dimension, measure, or calculation
519
+ */
520
+ field_type: string;
521
+
522
+ /**
523
+ * UUID string used as SQL column alias
524
+ */
525
+ kater_id: string;
526
+
527
+ /**
528
+ * Human-readable column name
529
+ */
530
+ name: string;
531
+
532
+ /**
533
+ * Aggregation type for measures: sum, count, min, max, avg, unknown. None for
534
+ * non-measures.
535
+ */
536
+ aggregation?: string | null;
537
+
538
+ /**
539
+ * Display label
540
+ */
541
+ label?: string | null;
542
+ }
543
+
544
+ /**
545
+ * Compilation metadata from the compiler.
546
+ */
547
+ export interface Metadata {
548
+ /**
549
+ * SQL dialect used (e.g. 'snowflake')
550
+ */
551
+ dialect: string;
552
+
553
+ /**
554
+ * Reference to the compiled query
555
+ */
556
+ query_ref: string;
557
+
558
+ /**
559
+ * Dimension names used in compilation
560
+ */
561
+ dimensions_used?: Array<string>;
562
+
563
+ /**
564
+ * Filter names used in compilation
565
+ */
566
+ filters_used?: Array<string>;
567
+
568
+ /**
569
+ * Measure names used in compilation
570
+ */
571
+ measures_used?: Array<string>;
572
+
573
+ /**
574
+ * View names used in compilation
575
+ */
576
+ views_used?: Array<string>;
577
+ }
578
+ }
579
+
580
+ /**
581
+ * Response model for a resolved query.
582
+ */
583
+ export interface CompilerResolveResponse {
584
+ /**
585
+ * The fully resolved query object
586
+ */
587
+ resolved_query: CompilerResolveResponse.ResolvedQuery;
588
+
589
+ /**
590
+ * Dependency graph between schema objects.
591
+ */
592
+ dependency_graph?: CompilerResolveResponse.DependencyGraph | null;
593
+
594
+ /**
595
+ * Compilation manifest with all named objects.
596
+ */
597
+ manifest?: Manifest | null;
598
+ }
599
+
600
+ export namespace CompilerResolveResponse {
601
+ /**
602
+ * The fully resolved query object
603
+ */
604
+ export interface ResolvedQuery {
605
+ /**
606
+ * Unique identifier for this resolved query instance
607
+ */
608
+ kater_id: string;
609
+
610
+ /**
611
+ * Name from the leaf query in the inheritance chain
612
+ */
613
+ name: string;
614
+
615
+ /**
616
+ * Reference to the original query template this was resolved from
617
+ */
618
+ source_query: string;
619
+
620
+ /**
621
+ * Reference to the topic this query uses (always known after inheritance
622
+ * resolution)
623
+ */
624
+ topic: string;
625
+
626
+ /**
627
+ * Widget category that determines data shape constraints
628
+ */
629
+ widget_category: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static';
630
+
631
+ /**
632
+ * Usage guidance for AI processing
633
+ */
634
+ ai_context?: string | null;
635
+
636
+ /**
637
+ * Merged required + selected optional calculations
638
+ */
639
+ calculations?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
640
+
641
+ /**
642
+ * Chart recommendations preserved for evaluation
643
+ */
644
+ chart_hints?: Array<ResolvedQuery.ChartHint1Output | ResolvedQuery.ChartHint2Output> | null;
645
+
646
+ /**
647
+ * Custom properties
648
+ */
649
+ custom_properties?: { [key: string]: unknown } | null;
650
+
651
+ /**
652
+ * Description of the query
653
+ */
654
+ description?: string | null;
655
+
656
+ /**
657
+ * Merged required + selected optional dimensions
658
+ */
659
+ dimensions?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
660
+
661
+ /**
662
+ * Widget types within the declared widget_category that must NOT render this query
663
+ */
664
+ disallowed_widget_types?: Array<
665
+ | 'kpi_card'
666
+ | 'line_chart'
667
+ | 'bar_chart'
668
+ | 'pie_chart'
669
+ | 'donut_chart'
670
+ | 'area_chart'
671
+ | 'scatter_chart'
672
+ | 'data_table'
673
+ | 'card_grid'
674
+ | 'heatmap'
675
+ | 'gauge'
676
+ | 'text'
677
+ | 'image'
678
+ | 'styled_table'
679
+ | 'stat_cards'
680
+ | 'key_value_list'
681
+ > | null;
682
+
683
+ /**
684
+ * Merged required + selected optional filters
685
+ */
686
+ filters?: Array<
687
+ | ResolvedQuery.InlineFieldFilter
688
+ | string
689
+ | ResolvedQuery.InlineExistsFilter1
690
+ | ResolvedQuery.InlineExistsFilter2
691
+ > | null;
692
+
693
+ /**
694
+ * Ordered list of query refs that were merged during inheritance resolution
695
+ */
696
+ inheritance_chain?: Array<string> | null;
697
+
698
+ /**
699
+ * Human-readable label with var() values substituted
700
+ */
701
+ label?: string | null;
702
+
703
+ /**
704
+ * Maximum number of rows to return
705
+ */
706
+ limit?: number | null;
707
+
708
+ /**
709
+ * Merged required + selected optional measures
710
+ */
711
+ measures?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
712
+
713
+ /**
714
+ * Sort order specification for query results. Use desc for descending
715
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
716
+ */
717
+ order_by?: ResolvedQuery.OrderBy | null;
718
+
719
+ /**
720
+ * Access grants required to use this query
721
+ */
722
+ required_access_grants?: Array<string> | null;
723
+
724
+ /**
725
+ * The matched chart recommendation after evaluating chart hints
726
+ */
727
+ resolved_chart?: ResolvedQuery.ResolvedChart | null;
728
+
729
+ /**
730
+ * Full variable definitions with bound values
731
+ */
732
+ resolved_variables?: Array<ResolvedQuery.ResolvedVariable> | null;
733
+
734
+ /**
735
+ * Resolved select_from entries with CTE metadata
736
+ */
737
+ select_from?: Array<ResolvedQuery.SelectFrom> | null;
738
+ }
739
+
740
+ export namespace ResolvedQuery {
741
+ /**
742
+ * A chart recommendation rule
743
+ */
744
+ export interface ChartHint1Output {
745
+ /**
746
+ * Chart configuration with variable references
747
+ */
748
+ config: CompilerAPI.ChartConfig;
749
+
750
+ /**
751
+ * Type of chart visualization
752
+ */
753
+ recommend:
754
+ | 'line'
755
+ | 'bar'
756
+ | 'stacked_bar'
757
+ | 'area'
758
+ | 'pie'
759
+ | 'donut'
760
+ | 'scatter'
761
+ | 'table'
762
+ | 'heatmap'
763
+ | 'single_value';
764
+
765
+ /**
766
+ * Conditions based on variable values - can be single value (string) or multiple
767
+ * values (array)
768
+ */
769
+ when: { [key: string]: string | Array<string> };
770
+ }
771
+
772
+ /**
773
+ * A chart recommendation rule
774
+ */
775
+ export interface ChartHint2Output {
776
+ default: ChartHint2Output.Default;
777
+ }
778
+
779
+ export namespace ChartHint2Output {
780
+ export interface Default {
781
+ /**
782
+ * Chart configuration with variable references
783
+ */
784
+ config: CompilerAPI.ChartConfig;
785
+
786
+ /**
787
+ * Type of chart visualization
788
+ */
789
+ recommend:
790
+ | 'line'
791
+ | 'bar'
792
+ | 'stacked_bar'
793
+ | 'area'
794
+ | 'pie'
795
+ | 'donut'
796
+ | 'scatter'
797
+ | 'table'
798
+ | 'heatmap'
799
+ | 'single_value';
800
+ }
801
+ }
802
+
803
+ /**
804
+ * An inline filter using field + operator + values
805
+ */
806
+ export interface InlineFieldFilter {
807
+ /**
808
+ * Reference to the field to filter on
809
+ */
810
+ field: string;
811
+
812
+ /**
813
+ * Name of the inline filter
814
+ */
815
+ name: string;
816
+
817
+ /**
818
+ * Filter operator to apply
819
+ */
820
+ operator:
821
+ | 'equals'
822
+ | 'not_equals'
823
+ | 'in'
824
+ | 'not_in'
825
+ | 'greater_than'
826
+ | 'less_than'
827
+ | 'greater_than_or_equals'
828
+ | 'less_than_or_equals'
829
+ | 'between'
830
+ | 'in_the_last'
831
+ | 'in_the_next'
832
+ | 'contains'
833
+ | 'not_contains'
834
+ | 'starts_with'
835
+ | 'ends_with'
836
+ | 'is_null'
837
+ | 'is_not_null';
838
+
839
+ /**
840
+ * SQL expression for the filter value
841
+ */
842
+ sql_value?: string | null;
843
+
844
+ /**
845
+ * Fixed values for the filter
846
+ */
847
+ static_values?: Array<string | number | boolean> | null;
848
+ }
849
+
850
+ /**
851
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
852
+ */
853
+ export interface InlineExistsFilter1 {
854
+ /**
855
+ * EXISTS subquery condition
856
+ */
857
+ exists: CompilerAPI.SubqueryCondition;
858
+
859
+ /**
860
+ * Name of the inline filter
861
+ */
862
+ name: string;
863
+
864
+ /**
865
+ * Description of the filter
866
+ */
867
+ description?: string | null;
868
+
869
+ /**
870
+ * Human-readable label
871
+ */
872
+ label?: string | null;
873
+
874
+ /**
875
+ * A subquery condition for EXISTS/NOT EXISTS filters
876
+ */
877
+ not_exists?: CompilerAPI.SubqueryCondition | null;
878
+ }
879
+
880
+ /**
881
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
882
+ */
883
+ export interface InlineExistsFilter2 {
884
+ /**
885
+ * Name of the inline filter
886
+ */
887
+ name: string;
888
+
889
+ /**
890
+ * NOT EXISTS subquery condition
891
+ */
892
+ not_exists: CompilerAPI.SubqueryCondition;
893
+
894
+ /**
895
+ * Description of the filter
896
+ */
897
+ description?: string | null;
898
+
899
+ /**
900
+ * A subquery condition for EXISTS/NOT EXISTS filters
901
+ */
902
+ exists?: CompilerAPI.SubqueryCondition | null;
903
+
904
+ /**
905
+ * Human-readable label
906
+ */
907
+ label?: string | null;
908
+ }
909
+
910
+ /**
911
+ * Sort order specification for query results. Use desc for descending
912
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
913
+ */
914
+ export interface OrderBy {
915
+ /**
916
+ * Fields to sort in ascending order (lowest/oldest first)
917
+ */
918
+ asc?: Array<string> | null;
919
+
920
+ /**
921
+ * Fields to sort in descending order (highest/newest first)
922
+ */
923
+ desc?: Array<string> | null;
924
+ }
925
+
926
+ /**
927
+ * The matched chart recommendation after evaluating chart hints
928
+ */
929
+ export interface ResolvedChart {
930
+ /**
931
+ * Chart configuration
932
+ */
933
+ config: CompilerAPI.ChartConfig;
934
+
935
+ /**
936
+ * Recommended chart type
937
+ */
938
+ recommend:
939
+ | 'line'
940
+ | 'bar'
941
+ | 'stacked_bar'
942
+ | 'area'
943
+ | 'pie'
944
+ | 'donut'
945
+ | 'scatter'
946
+ | 'table'
947
+ | 'heatmap'
948
+ | 'single_value';
949
+ }
950
+
951
+ /**
952
+ * A variable definition with its bound value
953
+ */
954
+ export interface ResolvedVariable {
955
+ /**
956
+ * The concrete value bound for this resolution
957
+ */
958
+ bound_value: string | number | boolean;
959
+
960
+ /**
961
+ * Default value for this variable
962
+ */
963
+ default: string | number | boolean;
964
+
965
+ /**
966
+ * Variable name identifier
967
+ */
968
+ name: string;
969
+
970
+ /**
971
+ * Data type of the variable
972
+ */
973
+ type:
974
+ | 'STRING'
975
+ | 'INT'
976
+ | 'FLOAT'
977
+ | 'DATE'
978
+ | 'TIMESTAMP'
979
+ | 'BOOL'
980
+ | 'DIMENSION'
981
+ | 'MEASURE'
982
+ | 'CALCULATION'
983
+ | 'FILTER';
984
+
985
+ /**
986
+ * Allowed values configuration
987
+ */
988
+ allowed_values?:
989
+ | ResolvedVariable.VariableAllowedValues1
990
+ | ResolvedVariable.VariableAllowedValues2
991
+ | null;
992
+
993
+ /**
994
+ * Constraints for variable types
995
+ */
996
+ constraints?: ResolvedVariable.Constraints | null;
997
+
998
+ /**
999
+ * Description of the variable's purpose
1000
+ */
1001
+ description?: string | null;
1002
+
1003
+ /**
1004
+ * True if bound_value equals the default value
1005
+ */
1006
+ is_default?: boolean | null;
1007
+
1008
+ /**
1009
+ * Human-readable label for the variable
1010
+ */
1011
+ label?: string | null;
1012
+ }
1013
+
1014
+ export namespace ResolvedVariable {
1015
+ /**
1016
+ * Allowed values for a variable - either static list or from column
1017
+ */
1018
+ export interface VariableAllowedValues1 {
1019
+ /**
1020
+ * Static list of allowed values with optional labels
1021
+ */
1022
+ static: Array<VariableAllowedValues1.Static>;
1023
+ }
1024
+
1025
+ export namespace VariableAllowedValues1 {
1026
+ /**
1027
+ * A value with optional display label
1028
+ */
1029
+ export interface Static {
1030
+ /**
1031
+ * The actual value
1032
+ */
1033
+ value: string | number | boolean;
1034
+
1035
+ /**
1036
+ * Human-readable label for the value
1037
+ */
1038
+ label?: string | null;
1039
+ }
1040
+ }
1041
+
1042
+ /**
1043
+ * Allowed values for a variable - either static list or from column
1044
+ */
1045
+ export interface VariableAllowedValues2 {
1046
+ /**
1047
+ * Reference to column for dynamic values
1048
+ */
1049
+ from_column: string;
1050
+
1051
+ /**
1052
+ * Cache time-to-live in seconds
1053
+ */
1054
+ cache_ttl?: number;
1055
+
1056
+ /**
1057
+ * Maximum number of values to retrieve
1058
+ */
1059
+ limit?: number;
1060
+
1061
+ /**
1062
+ * Sort order for values
1063
+ */
1064
+ order_by?: 'asc' | 'desc';
1065
+ }
1066
+
1067
+ /**
1068
+ * Constraints for variable types
1069
+ */
1070
+ export interface Constraints {
1071
+ /**
1072
+ * Maximum allowed value
1073
+ */
1074
+ max?: number | null;
1075
+
1076
+ /**
1077
+ * Maximum length for STRING variables
1078
+ */
1079
+ max_length?: number | null;
1080
+
1081
+ /**
1082
+ * Minimum allowed value
1083
+ */
1084
+ min?: number | null;
1085
+
1086
+ /**
1087
+ * Step increment for numeric input
1088
+ */
1089
+ step?: number | null;
1090
+ }
1091
+ }
1092
+
1093
+ /**
1094
+ * A resolved select_from entry with CTE metadata
1095
+ */
1096
+ export interface SelectFrom {
1097
+ /**
1098
+ * CTE alias used in the WITH clause (e.g., **sf_compliance_rate**base)
1099
+ */
1100
+ cte_alias: string;
1101
+
1102
+ /**
1103
+ * Columns produced by the CTE, available as q:query_name.field_name in the parent
1104
+ */
1105
+ output_columns: Array<SelectFrom.OutputColumn>;
1106
+
1107
+ /**
1108
+ * Reference to the source query
1109
+ */
1110
+ ref: string;
1111
+
1112
+ /**
1113
+ * Variable overrides passed to the referenced query
1114
+ */
1115
+ variables?: { [key: string]: string | number | boolean } | null;
1116
+ }
1117
+
1118
+ export namespace SelectFrom {
1119
+ /**
1120
+ * A column produced by a select_from CTE
1121
+ */
1122
+ export interface OutputColumn {
1123
+ /**
1124
+ * The SQL column alias in the CTE output
1125
+ */
1126
+ column_alias: string;
1127
+
1128
+ /**
1129
+ * The field name used in q:query_name.field_name references
1130
+ */
1131
+ field_name: string;
1132
+
1133
+ /**
1134
+ * Original type of the field in the source query
1135
+ */
1136
+ source_type: 'dimension' | 'measure' | 'calculation';
1137
+ }
1138
+ }
1139
+ }
1140
+
1141
+ /**
1142
+ * Dependency graph between schema objects.
1143
+ */
1144
+ export interface DependencyGraph {
1145
+ /**
1146
+ * Edge relationships with UUID string keys
1147
+ */
1148
+ edges: { [key: string]: { [key: string]: Array<string> } };
1149
+
1150
+ /**
1151
+ * UUID string to node mapping
1152
+ */
1153
+ nodes: { [key: string]: DependencyGraph.Nodes };
1154
+ }
1155
+
1156
+ export namespace DependencyGraph {
1157
+ /**
1158
+ * A node in the dependency graph.
1159
+ */
1160
+ export interface Nodes {
1161
+ /**
1162
+ * Source file path
1163
+ */
1164
+ file: string;
1165
+
1166
+ /**
1167
+ * Fully qualified name (e.g. 'dim_customer.region')
1168
+ */
1169
+ fqn: string;
1170
+
1171
+ /**
1172
+ * UUID of the schema object
1173
+ */
1174
+ kater_id: string;
1175
+
1176
+ /**
1177
+ * Line number in source file
1178
+ */
1179
+ line: number;
1180
+
1181
+ /**
1182
+ * Node type: QUERY, VIEW, DIMENSION, MEASURE, FILTER, EXPRESSION
1183
+ */
1184
+ node_type: string;
1185
+
1186
+ /**
1187
+ * Column number in source file
1188
+ */
1189
+ column?: number;
1190
+ }
1191
+ }
1192
+ }
1193
+
1194
+ /**
1195
+ * Response model for schema validation.
1196
+ */
1197
+ export interface CompilerValidateResponse {
1198
+ /**
1199
+ * Whether validation passed without errors
1200
+ */
1201
+ success: boolean;
1202
+
1203
+ /**
1204
+ * Per-connection validation results with dependency graphs
1205
+ */
1206
+ connection_results?: Array<CompilerValidateResponse.ConnectionResult>;
1207
+
1208
+ /**
1209
+ * Validation errors
1210
+ */
1211
+ errors?: Array<CompilerErrorItem>;
1212
+
1213
+ /**
1214
+ * Validation warnings
1215
+ */
1216
+ warnings?: Array<CompilerErrorItem>;
1217
+ }
1218
+
1219
+ export namespace CompilerValidateResponse {
1220
+ /**
1221
+ * Validation result for a single connection.
1222
+ */
1223
+ export interface ConnectionResult {
1224
+ /**
1225
+ * Connection UUID
1226
+ */
1227
+ connection_id: string;
1228
+
1229
+ /**
1230
+ * Connection name
1231
+ */
1232
+ connection_name: string;
1233
+
1234
+ /**
1235
+ * Whether this connection validated without errors
1236
+ */
1237
+ success: boolean;
1238
+
1239
+ /**
1240
+ * Dependency graph between schema objects.
1241
+ */
1242
+ dependency_graph?: ConnectionResult.DependencyGraph | null;
1243
+
1244
+ /**
1245
+ * Validation errors for this connection
1246
+ */
1247
+ errors?: Array<CompilerAPI.CompilerErrorItem>;
1248
+
1249
+ /**
1250
+ * Validation warnings for this connection
1251
+ */
1252
+ warnings?: Array<CompilerAPI.CompilerErrorItem>;
1253
+ }
1254
+
1255
+ export namespace ConnectionResult {
1256
+ /**
1257
+ * Dependency graph between schema objects.
1258
+ */
1259
+ export interface DependencyGraph {
1260
+ /**
1261
+ * Edge relationships with UUID string keys
1262
+ */
1263
+ edges: { [key: string]: { [key: string]: Array<string> } };
1264
+
1265
+ /**
1266
+ * UUID string to node mapping
1267
+ */
1268
+ nodes: { [key: string]: DependencyGraph.Nodes };
1269
+ }
1270
+
1271
+ export namespace DependencyGraph {
1272
+ /**
1273
+ * A node in the dependency graph.
1274
+ */
1275
+ export interface Nodes {
1276
+ /**
1277
+ * Source file path
1278
+ */
1279
+ file: string;
1280
+
1281
+ /**
1282
+ * Fully qualified name (e.g. 'dim_customer.region')
1283
+ */
1284
+ fqn: string;
1285
+
1286
+ /**
1287
+ * UUID of the schema object
1288
+ */
1289
+ kater_id: string;
1290
+
1291
+ /**
1292
+ * Line number in source file
1293
+ */
1294
+ line: number;
1295
+
1296
+ /**
1297
+ * Node type: QUERY, VIEW, DIMENSION, MEASURE, FILTER, EXPRESSION
1298
+ */
1299
+ node_type: string;
1300
+
1301
+ /**
1302
+ * Column number in source file
1303
+ */
1304
+ column?: number;
1305
+ }
1306
+ }
1307
+ }
1308
+ }
1309
+
1310
+ export interface CompilerCompileParams {
1311
+ /**
1312
+ * Body param: Connection to compile against
1313
+ */
1314
+ connection_id: string;
1315
+
1316
+ /**
1317
+ * Body param: Previously resolved query object from /resolve
1318
+ */
1319
+ resolved_query: CompilerCompileParams.ResolvedQuery;
1320
+
1321
+ /**
1322
+ * Query param
1323
+ */
1324
+ source?: string | null;
1325
+
1326
+ /**
1327
+ * Body param: Tenant key for multi-tenant compilation. For database tenancy, maps
1328
+ * to the tenant's database. For row tenancy, used as the row-level filter value.
1329
+ */
1330
+ tenant_key?: string | null;
1331
+
1332
+ /**
1333
+ * Header param
1334
+ */
1335
+ 'X-Kater-CLI-ID'?: string;
1336
+ }
1337
+
1338
+ export namespace CompilerCompileParams {
1339
+ /**
1340
+ * Previously resolved query object from /resolve
1341
+ */
1342
+ export interface ResolvedQuery {
1343
+ /**
1344
+ * Unique identifier for this resolved query instance
1345
+ */
1346
+ kater_id: string;
1347
+
1348
+ /**
1349
+ * Name from the leaf query in the inheritance chain
1350
+ */
1351
+ name: string;
1352
+
1353
+ /**
1354
+ * Reference to the original query template this was resolved from
1355
+ */
1356
+ source_query: string;
1357
+
1358
+ /**
1359
+ * Reference to the topic this query uses (always known after inheritance
1360
+ * resolution)
1361
+ */
1362
+ topic: string;
1363
+
1364
+ /**
1365
+ * Widget category that determines data shape constraints
1366
+ */
1367
+ widget_category: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static';
1368
+
1369
+ /**
1370
+ * Usage guidance for AI processing
1371
+ */
1372
+ ai_context?: string | null;
1373
+
1374
+ /**
1375
+ * Merged required + selected optional calculations
1376
+ */
1377
+ calculations?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
1378
+
1379
+ /**
1380
+ * Chart recommendations preserved for evaluation
1381
+ */
1382
+ chart_hints?: Array<ResolvedQuery.ChartHint1Input | ResolvedQuery.ChartHint2Input> | null;
1383
+
1384
+ /**
1385
+ * Custom properties
1386
+ */
1387
+ custom_properties?: { [key: string]: unknown } | null;
1388
+
1389
+ /**
1390
+ * Description of the query
1391
+ */
1392
+ description?: string | null;
1393
+
1394
+ /**
1395
+ * Merged required + selected optional dimensions
1396
+ */
1397
+ dimensions?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
1398
+
1399
+ /**
1400
+ * Widget types within the declared widget_category that must NOT render this query
1401
+ */
1402
+ disallowed_widget_types?: Array<
1403
+ | 'kpi_card'
1404
+ | 'line_chart'
1405
+ | 'bar_chart'
1406
+ | 'pie_chart'
1407
+ | 'donut_chart'
1408
+ | 'area_chart'
1409
+ | 'scatter_chart'
1410
+ | 'data_table'
1411
+ | 'card_grid'
1412
+ | 'heatmap'
1413
+ | 'gauge'
1414
+ | 'text'
1415
+ | 'image'
1416
+ | 'styled_table'
1417
+ | 'stat_cards'
1418
+ | 'key_value_list'
1419
+ > | null;
1420
+
1421
+ /**
1422
+ * Merged required + selected optional filters
1423
+ */
1424
+ filters?: Array<
1425
+ | ResolvedQuery.InlineFieldFilter
1426
+ | string
1427
+ | ResolvedQuery.InlineExistsFilter1
1428
+ | ResolvedQuery.InlineExistsFilter2
1429
+ > | null;
1430
+
1431
+ /**
1432
+ * Ordered list of query refs that were merged during inheritance resolution
1433
+ */
1434
+ inheritance_chain?: Array<string> | null;
1435
+
1436
+ /**
1437
+ * Human-readable label with var() values substituted
1438
+ */
1439
+ label?: string | null;
1440
+
1441
+ /**
1442
+ * Maximum number of rows to return
1443
+ */
1444
+ limit?: number | null;
1445
+
1446
+ /**
1447
+ * Merged required + selected optional measures
1448
+ */
1449
+ measures?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
1450
+
1451
+ /**
1452
+ * Sort order specification for query results. Use desc for descending
1453
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
1454
+ */
1455
+ order_by?: ResolvedQuery.OrderBy | null;
1456
+
1457
+ /**
1458
+ * Access grants required to use this query
1459
+ */
1460
+ required_access_grants?: Array<string> | null;
1461
+
1462
+ /**
1463
+ * The matched chart recommendation after evaluating chart hints
1464
+ */
1465
+ resolved_chart?: ResolvedQuery.ResolvedChart | null;
1466
+
1467
+ /**
1468
+ * Full variable definitions with bound values
1469
+ */
1470
+ resolved_variables?: Array<ResolvedQuery.ResolvedVariable> | null;
1471
+
1472
+ /**
1473
+ * Resolved select_from entries with CTE metadata
1474
+ */
1475
+ select_from?: Array<ResolvedQuery.SelectFrom> | null;
1476
+ }
1477
+
1478
+ export namespace ResolvedQuery {
1479
+ /**
1480
+ * A chart recommendation rule
1481
+ */
1482
+ export interface ChartHint1Input {
1483
+ /**
1484
+ * Chart configuration with variable references
1485
+ */
1486
+ config: CompilerAPI.ChartConfig;
1487
+
1488
+ /**
1489
+ * Type of chart visualization
1490
+ */
1491
+ recommend:
1492
+ | 'line'
1493
+ | 'bar'
1494
+ | 'stacked_bar'
1495
+ | 'area'
1496
+ | 'pie'
1497
+ | 'donut'
1498
+ | 'scatter'
1499
+ | 'table'
1500
+ | 'heatmap'
1501
+ | 'single_value';
1502
+
1503
+ /**
1504
+ * Conditions based on variable values - can be single value (string) or multiple
1505
+ * values (array)
1506
+ */
1507
+ when: { [key: string]: string | Array<string> };
1508
+ }
1509
+
1510
+ /**
1511
+ * A chart recommendation rule
1512
+ */
1513
+ export interface ChartHint2Input {
1514
+ default: ChartHint2Input.Default;
1515
+ }
1516
+
1517
+ export namespace ChartHint2Input {
1518
+ export interface Default {
1519
+ /**
1520
+ * Chart configuration with variable references
1521
+ */
1522
+ config: CompilerAPI.ChartConfig;
1523
+
1524
+ /**
1525
+ * Type of chart visualization
1526
+ */
1527
+ recommend:
1528
+ | 'line'
1529
+ | 'bar'
1530
+ | 'stacked_bar'
1531
+ | 'area'
1532
+ | 'pie'
1533
+ | 'donut'
1534
+ | 'scatter'
1535
+ | 'table'
1536
+ | 'heatmap'
1537
+ | 'single_value';
1538
+ }
1539
+ }
1540
+
1541
+ /**
1542
+ * An inline filter using field + operator + values
1543
+ */
1544
+ export interface InlineFieldFilter {
1545
+ /**
1546
+ * Reference to the field to filter on
1547
+ */
1548
+ field: string;
1549
+
1550
+ /**
1551
+ * Name of the inline filter
1552
+ */
1553
+ name: string;
1554
+
1555
+ /**
1556
+ * Filter operator to apply
1557
+ */
1558
+ operator:
1559
+ | 'equals'
1560
+ | 'not_equals'
1561
+ | 'in'
1562
+ | 'not_in'
1563
+ | 'greater_than'
1564
+ | 'less_than'
1565
+ | 'greater_than_or_equals'
1566
+ | 'less_than_or_equals'
1567
+ | 'between'
1568
+ | 'in_the_last'
1569
+ | 'in_the_next'
1570
+ | 'contains'
1571
+ | 'not_contains'
1572
+ | 'starts_with'
1573
+ | 'ends_with'
1574
+ | 'is_null'
1575
+ | 'is_not_null';
1576
+
1577
+ /**
1578
+ * SQL expression for the filter value
1579
+ */
1580
+ sql_value?: string | null;
1581
+
1582
+ /**
1583
+ * Fixed values for the filter
1584
+ */
1585
+ static_values?: Array<string | number | boolean> | null;
1586
+ }
1587
+
1588
+ /**
1589
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
1590
+ */
1591
+ export interface InlineExistsFilter1 {
1592
+ /**
1593
+ * EXISTS subquery condition
1594
+ */
1595
+ exists: CompilerAPI.SubqueryCondition;
1596
+
1597
+ /**
1598
+ * Name of the inline filter
1599
+ */
1600
+ name: string;
1601
+
1602
+ /**
1603
+ * Description of the filter
1604
+ */
1605
+ description?: string | null;
1606
+
1607
+ /**
1608
+ * Human-readable label
1609
+ */
1610
+ label?: string | null;
1611
+
1612
+ /**
1613
+ * A subquery condition for EXISTS/NOT EXISTS filters
1614
+ */
1615
+ not_exists?: CompilerAPI.SubqueryCondition | null;
1616
+ }
1617
+
1618
+ /**
1619
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
1620
+ */
1621
+ export interface InlineExistsFilter2 {
1622
+ /**
1623
+ * Name of the inline filter
1624
+ */
1625
+ name: string;
1626
+
1627
+ /**
1628
+ * NOT EXISTS subquery condition
1629
+ */
1630
+ not_exists: CompilerAPI.SubqueryCondition;
1631
+
1632
+ /**
1633
+ * Description of the filter
1634
+ */
1635
+ description?: string | null;
1636
+
1637
+ /**
1638
+ * A subquery condition for EXISTS/NOT EXISTS filters
1639
+ */
1640
+ exists?: CompilerAPI.SubqueryCondition | null;
1641
+
1642
+ /**
1643
+ * Human-readable label
1644
+ */
1645
+ label?: string | null;
1646
+ }
1647
+
1648
+ /**
1649
+ * Sort order specification for query results. Use desc for descending
1650
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
1651
+ */
1652
+ export interface OrderBy {
1653
+ /**
1654
+ * Fields to sort in ascending order (lowest/oldest first)
1655
+ */
1656
+ asc?: Array<string> | null;
1657
+
1658
+ /**
1659
+ * Fields to sort in descending order (highest/newest first)
1660
+ */
1661
+ desc?: Array<string> | null;
1662
+ }
1663
+
1664
+ /**
1665
+ * The matched chart recommendation after evaluating chart hints
1666
+ */
1667
+ export interface ResolvedChart {
1668
+ /**
1669
+ * Chart configuration
1670
+ */
1671
+ config: CompilerAPI.ChartConfig;
1672
+
1673
+ /**
1674
+ * Recommended chart type
1675
+ */
1676
+ recommend:
1677
+ | 'line'
1678
+ | 'bar'
1679
+ | 'stacked_bar'
1680
+ | 'area'
1681
+ | 'pie'
1682
+ | 'donut'
1683
+ | 'scatter'
1684
+ | 'table'
1685
+ | 'heatmap'
1686
+ | 'single_value';
1687
+ }
1688
+
1689
+ /**
1690
+ * A variable definition with its bound value
1691
+ */
1692
+ export interface ResolvedVariable {
1693
+ /**
1694
+ * The concrete value bound for this resolution
1695
+ */
1696
+ bound_value: string | number | boolean;
1697
+
1698
+ /**
1699
+ * Default value for this variable
1700
+ */
1701
+ default: string | number | boolean;
1702
+
1703
+ /**
1704
+ * Variable name identifier
1705
+ */
1706
+ name: string;
1707
+
1708
+ /**
1709
+ * Data type of the variable
1710
+ */
1711
+ type:
1712
+ | 'STRING'
1713
+ | 'INT'
1714
+ | 'FLOAT'
1715
+ | 'DATE'
1716
+ | 'TIMESTAMP'
1717
+ | 'BOOL'
1718
+ | 'DIMENSION'
1719
+ | 'MEASURE'
1720
+ | 'CALCULATION'
1721
+ | 'FILTER';
1722
+
1723
+ /**
1724
+ * Allowed values configuration
1725
+ */
1726
+ allowed_values?:
1727
+ | ResolvedVariable.VariableAllowedValues1
1728
+ | ResolvedVariable.VariableAllowedValues2
1729
+ | null;
1730
+
1731
+ /**
1732
+ * Constraints for variable types
1733
+ */
1734
+ constraints?: ResolvedVariable.Constraints | null;
1735
+
1736
+ /**
1737
+ * Description of the variable's purpose
1738
+ */
1739
+ description?: string | null;
1740
+
1741
+ /**
1742
+ * True if bound_value equals the default value
1743
+ */
1744
+ is_default?: boolean | null;
1745
+
1746
+ /**
1747
+ * Human-readable label for the variable
1748
+ */
1749
+ label?: string | null;
1750
+ }
1751
+
1752
+ export namespace ResolvedVariable {
1753
+ /**
1754
+ * Allowed values for a variable - either static list or from column
1755
+ */
1756
+ export interface VariableAllowedValues1 {
1757
+ /**
1758
+ * Static list of allowed values with optional labels
1759
+ */
1760
+ static: Array<VariableAllowedValues1.Static>;
1761
+ }
1762
+
1763
+ export namespace VariableAllowedValues1 {
1764
+ /**
1765
+ * A value with optional display label
1766
+ */
1767
+ export interface Static {
1768
+ /**
1769
+ * The actual value
1770
+ */
1771
+ value: string | number | boolean;
1772
+
1773
+ /**
1774
+ * Human-readable label for the value
1775
+ */
1776
+ label?: string | null;
1777
+ }
1778
+ }
1779
+
1780
+ /**
1781
+ * Allowed values for a variable - either static list or from column
1782
+ */
1783
+ export interface VariableAllowedValues2 {
1784
+ /**
1785
+ * Reference to column for dynamic values
1786
+ */
1787
+ from_column: string;
1788
+
1789
+ /**
1790
+ * Cache time-to-live in seconds
1791
+ */
1792
+ cache_ttl?: number;
1793
+
1794
+ /**
1795
+ * Maximum number of values to retrieve
1796
+ */
1797
+ limit?: number;
1798
+
1799
+ /**
1800
+ * Sort order for values
1801
+ */
1802
+ order_by?: 'asc' | 'desc';
1803
+ }
1804
+
1805
+ /**
1806
+ * Constraints for variable types
1807
+ */
1808
+ export interface Constraints {
1809
+ /**
1810
+ * Maximum allowed value
1811
+ */
1812
+ max?: number | null;
1813
+
1814
+ /**
1815
+ * Maximum length for STRING variables
1816
+ */
1817
+ max_length?: number | null;
1818
+
1819
+ /**
1820
+ * Minimum allowed value
1821
+ */
1822
+ min?: number | null;
1823
+
1824
+ /**
1825
+ * Step increment for numeric input
1826
+ */
1827
+ step?: number | null;
1828
+ }
1829
+ }
1830
+
1831
+ /**
1832
+ * A resolved select_from entry with CTE metadata
1833
+ */
1834
+ export interface SelectFrom {
1835
+ /**
1836
+ * CTE alias used in the WITH clause (e.g., **sf_compliance_rate**base)
1837
+ */
1838
+ cte_alias: string;
1839
+
1840
+ /**
1841
+ * Columns produced by the CTE, available as q:query_name.field_name in the parent
1842
+ */
1843
+ output_columns: Array<SelectFrom.OutputColumn>;
1844
+
1845
+ /**
1846
+ * Reference to the source query
1847
+ */
1848
+ ref: string;
1849
+
1850
+ /**
1851
+ * Variable overrides passed to the referenced query
1852
+ */
1853
+ variables?: { [key: string]: string | number | boolean } | null;
1854
+ }
1855
+
1856
+ export namespace SelectFrom {
1857
+ /**
1858
+ * A column produced by a select_from CTE
1859
+ */
1860
+ export interface OutputColumn {
1861
+ /**
1862
+ * The SQL column alias in the CTE output
1863
+ */
1864
+ column_alias: string;
1865
+
1866
+ /**
1867
+ * The field name used in q:query_name.field_name references
1868
+ */
1869
+ field_name: string;
1870
+
1871
+ /**
1872
+ * Original type of the field in the source query
1873
+ */
1874
+ source_type: 'dimension' | 'measure' | 'calculation';
1875
+ }
1876
+ }
1877
+ }
1878
+ }
1879
+
1880
+ export interface CompilerEnumerateParams {
1881
+ /**
1882
+ * Body param: Connection to enumerate against
1883
+ */
1884
+ connection_id: string;
1885
+
1886
+ /**
1887
+ * Query param
1888
+ */
1889
+ source?: string | null;
1890
+
1891
+ /**
1892
+ * Body param: Optional query refs to limit enumeration. If omitted, enumerates all
1893
+ * queries.
1894
+ */
1895
+ query_refs?: Array<string> | null;
1896
+
1897
+ /**
1898
+ * Header param
1899
+ */
1900
+ 'X-Kater-CLI-ID'?: string;
1901
+ }
1902
+
1903
+ export interface CompilerExecuteParams {
1904
+ /**
1905
+ * Body param: Connection to execute against
1906
+ */
1907
+ connection_id: string;
1908
+
1909
+ /**
1910
+ * Body param: Previously resolved query object from /resolve
1911
+ */
1912
+ resolved_query: CompilerExecuteParams.ResolvedQuery;
1913
+
1914
+ /**
1915
+ * Query param
1916
+ */
1917
+ source?: string | null;
1918
+
1919
+ /**
1920
+ * Body param: Tenant key for multi-tenant execution
1921
+ */
1922
+ tenant_key?: string | null;
1923
+
1924
+ /**
1925
+ * Header param
1926
+ */
1927
+ 'X-Kater-CLI-ID'?: string;
1928
+ }
1929
+
1930
+ export namespace CompilerExecuteParams {
1931
+ /**
1932
+ * Previously resolved query object from /resolve
1933
+ */
1934
+ export interface ResolvedQuery {
1935
+ /**
1936
+ * Unique identifier for this resolved query instance
1937
+ */
1938
+ kater_id: string;
1939
+
1940
+ /**
1941
+ * Name from the leaf query in the inheritance chain
1942
+ */
1943
+ name: string;
1944
+
1945
+ /**
1946
+ * Reference to the original query template this was resolved from
1947
+ */
1948
+ source_query: string;
1949
+
1950
+ /**
1951
+ * Reference to the topic this query uses (always known after inheritance
1952
+ * resolution)
1953
+ */
1954
+ topic: string;
1955
+
1956
+ /**
1957
+ * Widget category that determines data shape constraints
1958
+ */
1959
+ widget_category: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static';
1960
+
1961
+ /**
1962
+ * Usage guidance for AI processing
1963
+ */
1964
+ ai_context?: string | null;
1965
+
1966
+ /**
1967
+ * Merged required + selected optional calculations
1968
+ */
1969
+ calculations?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
1970
+
1971
+ /**
1972
+ * Chart recommendations preserved for evaluation
1973
+ */
1974
+ chart_hints?: Array<ResolvedQuery.ChartHint1Input | ResolvedQuery.ChartHint2Input> | null;
1975
+
1976
+ /**
1977
+ * Custom properties
1978
+ */
1979
+ custom_properties?: { [key: string]: unknown } | null;
1980
+
1981
+ /**
1982
+ * Description of the query
1983
+ */
1984
+ description?: string | null;
1985
+
1986
+ /**
1987
+ * Merged required + selected optional dimensions
1988
+ */
1989
+ dimensions?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
1990
+
1991
+ /**
1992
+ * Widget types within the declared widget_category that must NOT render this query
1993
+ */
1994
+ disallowed_widget_types?: Array<
1995
+ | 'kpi_card'
1996
+ | 'line_chart'
1997
+ | 'bar_chart'
1998
+ | 'pie_chart'
1999
+ | 'donut_chart'
2000
+ | 'area_chart'
2001
+ | 'scatter_chart'
2002
+ | 'data_table'
2003
+ | 'card_grid'
2004
+ | 'heatmap'
2005
+ | 'gauge'
2006
+ | 'text'
2007
+ | 'image'
2008
+ | 'styled_table'
2009
+ | 'stat_cards'
2010
+ | 'key_value_list'
2011
+ > | null;
2012
+
2013
+ /**
2014
+ * Merged required + selected optional filters
2015
+ */
2016
+ filters?: Array<
2017
+ | ResolvedQuery.InlineFieldFilter
2018
+ | string
2019
+ | ResolvedQuery.InlineExistsFilter1
2020
+ | ResolvedQuery.InlineExistsFilter2
2021
+ > | null;
2022
+
2023
+ /**
2024
+ * Ordered list of query refs that were merged during inheritance resolution
2025
+ */
2026
+ inheritance_chain?: Array<string> | null;
2027
+
2028
+ /**
2029
+ * Human-readable label with var() values substituted
2030
+ */
2031
+ label?: string | null;
2032
+
2033
+ /**
2034
+ * Maximum number of rows to return
2035
+ */
2036
+ limit?: number | null;
2037
+
2038
+ /**
2039
+ * Merged required + selected optional measures
2040
+ */
2041
+ measures?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
2042
+
2043
+ /**
2044
+ * Sort order specification for query results. Use desc for descending
2045
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
2046
+ */
2047
+ order_by?: ResolvedQuery.OrderBy | null;
2048
+
2049
+ /**
2050
+ * Access grants required to use this query
2051
+ */
2052
+ required_access_grants?: Array<string> | null;
2053
+
2054
+ /**
2055
+ * The matched chart recommendation after evaluating chart hints
2056
+ */
2057
+ resolved_chart?: ResolvedQuery.ResolvedChart | null;
2058
+
2059
+ /**
2060
+ * Full variable definitions with bound values
2061
+ */
2062
+ resolved_variables?: Array<ResolvedQuery.ResolvedVariable> | null;
2063
+
2064
+ /**
2065
+ * Resolved select_from entries with CTE metadata
2066
+ */
2067
+ select_from?: Array<ResolvedQuery.SelectFrom> | null;
2068
+ }
2069
+
2070
+ export namespace ResolvedQuery {
2071
+ /**
2072
+ * A chart recommendation rule
2073
+ */
2074
+ export interface ChartHint1Input {
2075
+ /**
2076
+ * Chart configuration with variable references
2077
+ */
2078
+ config: CompilerAPI.ChartConfig;
2079
+
2080
+ /**
2081
+ * Type of chart visualization
2082
+ */
2083
+ recommend:
2084
+ | 'line'
2085
+ | 'bar'
2086
+ | 'stacked_bar'
2087
+ | 'area'
2088
+ | 'pie'
2089
+ | 'donut'
2090
+ | 'scatter'
2091
+ | 'table'
2092
+ | 'heatmap'
2093
+ | 'single_value';
2094
+
2095
+ /**
2096
+ * Conditions based on variable values - can be single value (string) or multiple
2097
+ * values (array)
2098
+ */
2099
+ when: { [key: string]: string | Array<string> };
2100
+ }
2101
+
2102
+ /**
2103
+ * A chart recommendation rule
2104
+ */
2105
+ export interface ChartHint2Input {
2106
+ default: ChartHint2Input.Default;
2107
+ }
2108
+
2109
+ export namespace ChartHint2Input {
2110
+ export interface Default {
2111
+ /**
2112
+ * Chart configuration with variable references
2113
+ */
2114
+ config: CompilerAPI.ChartConfig;
2115
+
2116
+ /**
2117
+ * Type of chart visualization
2118
+ */
2119
+ recommend:
2120
+ | 'line'
2121
+ | 'bar'
2122
+ | 'stacked_bar'
2123
+ | 'area'
2124
+ | 'pie'
2125
+ | 'donut'
2126
+ | 'scatter'
2127
+ | 'table'
2128
+ | 'heatmap'
2129
+ | 'single_value';
2130
+ }
2131
+ }
2132
+
2133
+ /**
2134
+ * An inline filter using field + operator + values
2135
+ */
2136
+ export interface InlineFieldFilter {
2137
+ /**
2138
+ * Reference to the field to filter on
2139
+ */
2140
+ field: string;
2141
+
2142
+ /**
2143
+ * Name of the inline filter
2144
+ */
2145
+ name: string;
2146
+
2147
+ /**
2148
+ * Filter operator to apply
2149
+ */
2150
+ operator:
2151
+ | 'equals'
2152
+ | 'not_equals'
2153
+ | 'in'
2154
+ | 'not_in'
2155
+ | 'greater_than'
2156
+ | 'less_than'
2157
+ | 'greater_than_or_equals'
2158
+ | 'less_than_or_equals'
2159
+ | 'between'
2160
+ | 'in_the_last'
2161
+ | 'in_the_next'
2162
+ | 'contains'
2163
+ | 'not_contains'
2164
+ | 'starts_with'
2165
+ | 'ends_with'
2166
+ | 'is_null'
2167
+ | 'is_not_null';
2168
+
2169
+ /**
2170
+ * SQL expression for the filter value
2171
+ */
2172
+ sql_value?: string | null;
2173
+
2174
+ /**
2175
+ * Fixed values for the filter
2176
+ */
2177
+ static_values?: Array<string | number | boolean> | null;
2178
+ }
2179
+
2180
+ /**
2181
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
2182
+ */
2183
+ export interface InlineExistsFilter1 {
2184
+ /**
2185
+ * EXISTS subquery condition
2186
+ */
2187
+ exists: CompilerAPI.SubqueryCondition;
2188
+
2189
+ /**
2190
+ * Name of the inline filter
2191
+ */
2192
+ name: string;
2193
+
2194
+ /**
2195
+ * Description of the filter
2196
+ */
2197
+ description?: string | null;
2198
+
2199
+ /**
2200
+ * Human-readable label
2201
+ */
2202
+ label?: string | null;
2203
+
2204
+ /**
2205
+ * A subquery condition for EXISTS/NOT EXISTS filters
2206
+ */
2207
+ not_exists?: CompilerAPI.SubqueryCondition | null;
2208
+ }
2209
+
2210
+ /**
2211
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
2212
+ */
2213
+ export interface InlineExistsFilter2 {
2214
+ /**
2215
+ * Name of the inline filter
2216
+ */
2217
+ name: string;
2218
+
2219
+ /**
2220
+ * NOT EXISTS subquery condition
2221
+ */
2222
+ not_exists: CompilerAPI.SubqueryCondition;
2223
+
2224
+ /**
2225
+ * Description of the filter
2226
+ */
2227
+ description?: string | null;
2228
+
2229
+ /**
2230
+ * A subquery condition for EXISTS/NOT EXISTS filters
2231
+ */
2232
+ exists?: CompilerAPI.SubqueryCondition | null;
2233
+
2234
+ /**
2235
+ * Human-readable label
2236
+ */
2237
+ label?: string | null;
2238
+ }
2239
+
2240
+ /**
2241
+ * Sort order specification for query results. Use desc for descending
2242
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
2243
+ */
2244
+ export interface OrderBy {
2245
+ /**
2246
+ * Fields to sort in ascending order (lowest/oldest first)
2247
+ */
2248
+ asc?: Array<string> | null;
2249
+
2250
+ /**
2251
+ * Fields to sort in descending order (highest/newest first)
2252
+ */
2253
+ desc?: Array<string> | null;
2254
+ }
2255
+
2256
+ /**
2257
+ * The matched chart recommendation after evaluating chart hints
2258
+ */
2259
+ export interface ResolvedChart {
2260
+ /**
2261
+ * Chart configuration
2262
+ */
2263
+ config: CompilerAPI.ChartConfig;
2264
+
2265
+ /**
2266
+ * Recommended chart type
2267
+ */
2268
+ recommend:
2269
+ | 'line'
2270
+ | 'bar'
2271
+ | 'stacked_bar'
2272
+ | 'area'
2273
+ | 'pie'
2274
+ | 'donut'
2275
+ | 'scatter'
2276
+ | 'table'
2277
+ | 'heatmap'
2278
+ | 'single_value';
2279
+ }
2280
+
2281
+ /**
2282
+ * A variable definition with its bound value
2283
+ */
2284
+ export interface ResolvedVariable {
2285
+ /**
2286
+ * The concrete value bound for this resolution
2287
+ */
2288
+ bound_value: string | number | boolean;
2289
+
2290
+ /**
2291
+ * Default value for this variable
2292
+ */
2293
+ default: string | number | boolean;
2294
+
2295
+ /**
2296
+ * Variable name identifier
2297
+ */
2298
+ name: string;
2299
+
2300
+ /**
2301
+ * Data type of the variable
2302
+ */
2303
+ type:
2304
+ | 'STRING'
2305
+ | 'INT'
2306
+ | 'FLOAT'
2307
+ | 'DATE'
2308
+ | 'TIMESTAMP'
2309
+ | 'BOOL'
2310
+ | 'DIMENSION'
2311
+ | 'MEASURE'
2312
+ | 'CALCULATION'
2313
+ | 'FILTER';
2314
+
2315
+ /**
2316
+ * Allowed values configuration
2317
+ */
2318
+ allowed_values?:
2319
+ | ResolvedVariable.VariableAllowedValues1
2320
+ | ResolvedVariable.VariableAllowedValues2
2321
+ | null;
2322
+
2323
+ /**
2324
+ * Constraints for variable types
2325
+ */
2326
+ constraints?: ResolvedVariable.Constraints | null;
2327
+
2328
+ /**
2329
+ * Description of the variable's purpose
2330
+ */
2331
+ description?: string | null;
2332
+
2333
+ /**
2334
+ * True if bound_value equals the default value
2335
+ */
2336
+ is_default?: boolean | null;
2337
+
2338
+ /**
2339
+ * Human-readable label for the variable
2340
+ */
2341
+ label?: string | null;
2342
+ }
2343
+
2344
+ export namespace ResolvedVariable {
2345
+ /**
2346
+ * Allowed values for a variable - either static list or from column
2347
+ */
2348
+ export interface VariableAllowedValues1 {
2349
+ /**
2350
+ * Static list of allowed values with optional labels
2351
+ */
2352
+ static: Array<VariableAllowedValues1.Static>;
2353
+ }
2354
+
2355
+ export namespace VariableAllowedValues1 {
2356
+ /**
2357
+ * A value with optional display label
2358
+ */
2359
+ export interface Static {
2360
+ /**
2361
+ * The actual value
2362
+ */
2363
+ value: string | number | boolean;
2364
+
2365
+ /**
2366
+ * Human-readable label for the value
2367
+ */
2368
+ label?: string | null;
2369
+ }
2370
+ }
2371
+
2372
+ /**
2373
+ * Allowed values for a variable - either static list or from column
2374
+ */
2375
+ export interface VariableAllowedValues2 {
2376
+ /**
2377
+ * Reference to column for dynamic values
2378
+ */
2379
+ from_column: string;
2380
+
2381
+ /**
2382
+ * Cache time-to-live in seconds
2383
+ */
2384
+ cache_ttl?: number;
2385
+
2386
+ /**
2387
+ * Maximum number of values to retrieve
2388
+ */
2389
+ limit?: number;
2390
+
2391
+ /**
2392
+ * Sort order for values
2393
+ */
2394
+ order_by?: 'asc' | 'desc';
2395
+ }
2396
+
2397
+ /**
2398
+ * Constraints for variable types
2399
+ */
2400
+ export interface Constraints {
2401
+ /**
2402
+ * Maximum allowed value
2403
+ */
2404
+ max?: number | null;
2405
+
2406
+ /**
2407
+ * Maximum length for STRING variables
2408
+ */
2409
+ max_length?: number | null;
2410
+
2411
+ /**
2412
+ * Minimum allowed value
2413
+ */
2414
+ min?: number | null;
2415
+
2416
+ /**
2417
+ * Step increment for numeric input
2418
+ */
2419
+ step?: number | null;
2420
+ }
2421
+ }
2422
+
2423
+ /**
2424
+ * A resolved select_from entry with CTE metadata
2425
+ */
2426
+ export interface SelectFrom {
2427
+ /**
2428
+ * CTE alias used in the WITH clause (e.g., **sf_compliance_rate**base)
2429
+ */
2430
+ cte_alias: string;
2431
+
2432
+ /**
2433
+ * Columns produced by the CTE, available as q:query_name.field_name in the parent
2434
+ */
2435
+ output_columns: Array<SelectFrom.OutputColumn>;
2436
+
2437
+ /**
2438
+ * Reference to the source query
2439
+ */
2440
+ ref: string;
2441
+
2442
+ /**
2443
+ * Variable overrides passed to the referenced query
2444
+ */
2445
+ variables?: { [key: string]: string | number | boolean } | null;
2446
+ }
2447
+
2448
+ export namespace SelectFrom {
2449
+ /**
2450
+ * A column produced by a select_from CTE
2451
+ */
2452
+ export interface OutputColumn {
2453
+ /**
2454
+ * The SQL column alias in the CTE output
2455
+ */
2456
+ column_alias: string;
2457
+
2458
+ /**
2459
+ * The field name used in q:query_name.field_name references
2460
+ */
2461
+ field_name: string;
2462
+
2463
+ /**
2464
+ * Original type of the field in the source query
2465
+ */
2466
+ source_type: 'dimension' | 'measure' | 'calculation';
2467
+ }
2468
+ }
2469
+ }
2470
+ }
2471
+
2472
+ export interface CompilerResolveParams {
2473
+ /**
2474
+ * Body param: Connection to resolve against
2475
+ */
2476
+ connection_id: string;
2477
+
2478
+ /**
2479
+ * Body param: Reference to the query template (e.g. 'ref(MY_QUERY)')
2480
+ */
2481
+ query_ref: string;
2482
+
2483
+ /**
2484
+ * Query param
2485
+ */
2486
+ source?: string | null;
2487
+
2488
+ /**
2489
+ * Body param: Comma-separated slot selections and variable assignments. Reserved
2490
+ * keys: measure, dimension, filter, calculation. All other keys are variable
2491
+ * assignments. Example: 'measure=Compliance
2492
+ * Rate,dimension=Department,breakdown=region'
2493
+ */
2494
+ combination?: string;
2495
+
2496
+ /**
2497
+ * Header param
2498
+ */
2499
+ 'X-Kater-CLI-ID'?: string;
2500
+ }
2501
+
2502
+ export interface CompilerValidateParams {
2503
+ /**
2504
+ * Query param
2505
+ */
2506
+ source?: string | null;
2507
+
2508
+ /**
2509
+ * Body param: Optional connection IDs to validate. If omitted, validates all
2510
+ * connections.
2511
+ */
2512
+ connection_ids?: Array<string> | null;
2513
+
2514
+ /**
2515
+ * Header param
2516
+ */
2517
+ 'X-Kater-CLI-ID'?: string;
2518
+ }
2519
+
2520
+ Compiler.Cache = Cache;
2521
+
2522
+ export declare namespace Compiler {
2523
+ export {
2524
+ type ChartConfig as ChartConfig,
2525
+ type CompilerErrorItem as CompilerErrorItem,
2526
+ type InlineField as InlineField,
2527
+ type Manifest as Manifest,
2528
+ type ManifestEntry as ManifestEntry,
2529
+ type RefWithLabel as RefWithLabel,
2530
+ type SubqueryCondition as SubqueryCondition,
2531
+ type CompilerCompileResponse as CompilerCompileResponse,
2532
+ type CompilerEnumerateResponse as CompilerEnumerateResponse,
2533
+ type CompilerExecuteResponse as CompilerExecuteResponse,
2534
+ type CompilerResolveResponse as CompilerResolveResponse,
2535
+ type CompilerValidateResponse as CompilerValidateResponse,
2536
+ type CompilerCompileParams as CompilerCompileParams,
2537
+ type CompilerEnumerateParams as CompilerEnumerateParams,
2538
+ type CompilerExecuteParams as CompilerExecuteParams,
2539
+ type CompilerResolveParams as CompilerResolveParams,
2540
+ type CompilerValidateParams as CompilerValidateParams,
2541
+ };
2542
+
2543
+ export {
2544
+ Cache as Cache,
2545
+ type CacheInvalidateResponse as CacheInvalidateResponse,
2546
+ type CacheInvalidateParams as CacheInvalidateParams,
2547
+ };
2548
+ }