@katerai/sdk 0.7.0 → 0.8.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 (70) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/package.json +1 -1
  3. package/resources/v1/compiler.d.mts +1116 -0
  4. package/resources/v1/compiler.d.mts.map +1 -0
  5. package/resources/v1/compiler.d.ts +1116 -0
  6. package/resources/v1/compiler.d.ts.map +1 -0
  7. package/resources/v1/compiler.js +70 -0
  8. package/resources/v1/compiler.js.map +1 -0
  9. package/resources/v1/compiler.mjs +66 -0
  10. package/resources/v1/compiler.mjs.map +1 -0
  11. package/resources/v1/index.d.mts +2 -1
  12. package/resources/v1/index.d.mts.map +1 -1
  13. package/resources/v1/index.d.ts +2 -1
  14. package/resources/v1/index.d.ts.map +1 -1
  15. package/resources/v1/index.js +5 -3
  16. package/resources/v1/index.js.map +1 -1
  17. package/resources/v1/index.mjs +2 -1
  18. package/resources/v1/index.mjs.map +1 -1
  19. package/resources/v1/tenants/groups.d.mts +43 -0
  20. package/resources/v1/tenants/groups.d.mts.map +1 -0
  21. package/resources/v1/tenants/groups.d.ts +43 -0
  22. package/resources/v1/tenants/groups.d.ts.map +1 -0
  23. package/resources/v1/tenants/groups.js +20 -0
  24. package/resources/v1/tenants/groups.js.map +1 -0
  25. package/resources/v1/tenants/groups.mjs +16 -0
  26. package/resources/v1/tenants/groups.mjs.map +1 -0
  27. package/resources/v1/tenants/index.d.mts +3 -0
  28. package/resources/v1/tenants/index.d.mts.map +1 -0
  29. package/resources/v1/tenants/index.d.ts +3 -0
  30. package/resources/v1/tenants/index.d.ts.map +1 -0
  31. package/resources/v1/tenants/index.js +9 -0
  32. package/resources/v1/tenants/index.js.map +1 -0
  33. package/resources/v1/tenants/index.mjs +4 -0
  34. package/resources/v1/tenants/index.mjs.map +1 -0
  35. package/resources/v1/tenants/tenants.d.mts +169 -0
  36. package/resources/v1/tenants/tenants.d.mts.map +1 -0
  37. package/resources/v1/tenants/tenants.d.ts +169 -0
  38. package/resources/v1/tenants/tenants.d.ts.map +1 -0
  39. package/resources/v1/tenants/tenants.js +70 -0
  40. package/resources/v1/tenants/tenants.js.map +1 -0
  41. package/resources/v1/tenants/tenants.mjs +65 -0
  42. package/resources/v1/tenants/tenants.mjs.map +1 -0
  43. package/resources/v1/tenants.d.mts +1 -125
  44. package/resources/v1/tenants.d.mts.map +1 -1
  45. package/resources/v1/tenants.d.ts +1 -125
  46. package/resources/v1/tenants.d.ts.map +1 -1
  47. package/resources/v1/tenants.js +2 -46
  48. package/resources/v1/tenants.js.map +1 -1
  49. package/resources/v1/tenants.mjs +1 -44
  50. package/resources/v1/tenants.mjs.map +1 -1
  51. package/resources/v1/v1.d.mts +7 -3
  52. package/resources/v1/v1.d.mts.map +1 -1
  53. package/resources/v1/v1.d.ts +7 -3
  54. package/resources/v1/v1.d.ts.map +1 -1
  55. package/resources/v1/v1.js +6 -2
  56. package/resources/v1/v1.js.map +1 -1
  57. package/resources/v1/v1.mjs +6 -2
  58. package/resources/v1/v1.mjs.map +1 -1
  59. package/src/resources/v1/compiler.ts +1484 -0
  60. package/src/resources/v1/index.ts +18 -1
  61. package/src/resources/v1/tenants/groups.ts +52 -0
  62. package/src/resources/v1/tenants/index.ts +10 -0
  63. package/src/resources/v1/tenants/tenants.ts +220 -0
  64. package/src/resources/v1/tenants.ts +1 -162
  65. package/src/resources/v1/v1.ts +40 -2
  66. package/src/version.ts +1 -1
  67. package/version.d.mts +1 -1
  68. package/version.d.ts +1 -1
  69. package/version.js +1 -1
  70. package/version.mjs +1 -1
@@ -0,0 +1,1116 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as CompilerAPI from "./compiler.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Compiler extends APIResource {
6
+ /**
7
+ * Compile a resolved query to SQL.
8
+ *
9
+ * Takes a previously resolved query and generates the final SQL statement for the
10
+ * target dialect.
11
+ *
12
+ * RLS: Filtered to current client (ClientRLSDB).
13
+ */
14
+ compile(params: CompilerCompileParams, options?: RequestOptions): APIPromise<CompilerCompileResponse>;
15
+ /**
16
+ * Resolve a query template with user-selected parameters.
17
+ *
18
+ * Takes a query reference and variable selections, returns the fully resolved
19
+ * query object ready for compilation.
20
+ *
21
+ * RLS: Filtered to current client (ClientRLSDB).
22
+ */
23
+ resolve(params: CompilerResolveParams, options?: RequestOptions): APIPromise<CompilerResolveResponse>;
24
+ /**
25
+ * Validate a schema file set against a connection.
26
+ *
27
+ * Checks all views, queries, and related schemas for correctness and returns any
28
+ * errors or warnings found.
29
+ *
30
+ * RLS: Filtered to current client (ClientRLSDB).
31
+ */
32
+ validate(params: CompilerValidateParams, options?: RequestOptions): APIPromise<CompilerValidateResponse>;
33
+ }
34
+ /**
35
+ * Chart configuration with variable references
36
+ */
37
+ export interface ChartConfig {
38
+ /**
39
+ * Field or variable reference for color grouping
40
+ */
41
+ color_by?: string | null;
42
+ /**
43
+ * Field or variable reference for size
44
+ */
45
+ size?: string | null;
46
+ /**
47
+ * Field or variable reference for stacking
48
+ */
49
+ stack_by?: string | null;
50
+ /**
51
+ * Field or variable reference for x-axis
52
+ */
53
+ x_axis?: string | null;
54
+ /**
55
+ * Field or variable reference for y-axis
56
+ */
57
+ y_axis?: string | null;
58
+ }
59
+ /**
60
+ * A single compiler validation or compilation error.
61
+ */
62
+ export interface CompilerErrorItem {
63
+ /**
64
+ * Machine-readable error code
65
+ */
66
+ code: string;
67
+ /**
68
+ * Human-readable error description
69
+ */
70
+ message: string;
71
+ /**
72
+ * Source file path where the error occurred
73
+ */
74
+ file?: string | null;
75
+ /**
76
+ * Line number in the source file
77
+ */
78
+ line?: number | null;
79
+ /**
80
+ * Reference to the source element (e.g. view or query name)
81
+ */
82
+ ref?: string | null;
83
+ /**
84
+ * Suggested fix for this error
85
+ */
86
+ remediation?: string | null;
87
+ }
88
+ /**
89
+ * An inline field definition for dimensions/measures/calculations
90
+ */
91
+ export interface InlineField {
92
+ /**
93
+ * Unique identifier for this inline field
94
+ */
95
+ kater_id: string;
96
+ /**
97
+ * Name of the inline field
98
+ */
99
+ name: string;
100
+ /**
101
+ * SQL expression for the field
102
+ */
103
+ sql: string;
104
+ /**
105
+ * Human-readable label
106
+ */
107
+ label?: string | null;
108
+ }
109
+ /**
110
+ * Compilation manifest with all named objects.
111
+ */
112
+ export interface Manifest {
113
+ generated_at: string;
114
+ objects: {
115
+ [key: string]: ManifestEntry;
116
+ };
117
+ schema_version?: string;
118
+ }
119
+ /**
120
+ * A single object entry in the manifest.
121
+ */
122
+ export interface ManifestEntry {
123
+ kater_id: string;
124
+ name: string;
125
+ type: string;
126
+ label?: string | null;
127
+ parent_id?: string | null;
128
+ source_file?: string | null;
129
+ }
130
+ /**
131
+ * A reference with optional label override
132
+ */
133
+ export interface RefWithLabel {
134
+ /**
135
+ * Reference using ref(), var(), or expr() syntax
136
+ */
137
+ ref: string;
138
+ /**
139
+ * Optional label override for this reference
140
+ */
141
+ label?: string | null;
142
+ }
143
+ /**
144
+ * A subquery condition for EXISTS/NOT EXISTS filters
145
+ */
146
+ export interface SubqueryCondition {
147
+ /**
148
+ * Reference to the source view/table for the subquery
149
+ */
150
+ from: string;
151
+ /**
152
+ * WHERE conditions for the subquery
153
+ */
154
+ where: Array<string>;
155
+ }
156
+ /**
157
+ * Response model for SQL compilation.
158
+ */
159
+ export interface CompilerCompileResponse {
160
+ /**
161
+ * SQL dialect used (e.g. 'snowflake')
162
+ */
163
+ dialect: string;
164
+ /**
165
+ * Whether compilation succeeded
166
+ */
167
+ success: boolean;
168
+ /**
169
+ * Compilation errors
170
+ */
171
+ errors?: Array<CompilerErrorItem>;
172
+ /**
173
+ * Compilation manifest with all named objects.
174
+ */
175
+ manifest?: Manifest | null;
176
+ /**
177
+ * Compilation metadata from the compiler.
178
+ */
179
+ metadata?: CompilerCompileResponse.Metadata | null;
180
+ /**
181
+ * Generated SQL statement
182
+ */
183
+ sql?: string | null;
184
+ }
185
+ export declare namespace CompilerCompileResponse {
186
+ /**
187
+ * Compilation metadata from the compiler.
188
+ */
189
+ interface Metadata {
190
+ /**
191
+ * SQL dialect used (e.g. 'snowflake')
192
+ */
193
+ dialect: string;
194
+ /**
195
+ * Reference to the compiled query
196
+ */
197
+ query_ref: string;
198
+ /**
199
+ * Dimension names used in compilation
200
+ */
201
+ dimensions_used?: Array<string>;
202
+ /**
203
+ * Filter names used in compilation
204
+ */
205
+ filters_used?: Array<string>;
206
+ /**
207
+ * Measure names used in compilation
208
+ */
209
+ measures_used?: Array<string>;
210
+ /**
211
+ * View names used in compilation
212
+ */
213
+ views_used?: Array<string>;
214
+ }
215
+ }
216
+ /**
217
+ * Response model for a resolved query.
218
+ */
219
+ export interface CompilerResolveResponse {
220
+ /**
221
+ * The fully resolved query object
222
+ */
223
+ resolved_query: CompilerResolveResponse.ResolvedQuery;
224
+ /**
225
+ * Dependency graph between schema objects.
226
+ */
227
+ dependency_graph?: CompilerResolveResponse.DependencyGraph | null;
228
+ /**
229
+ * Compilation manifest with all named objects.
230
+ */
231
+ manifest?: Manifest | null;
232
+ }
233
+ export declare namespace CompilerResolveResponse {
234
+ /**
235
+ * The fully resolved query object
236
+ */
237
+ interface ResolvedQuery {
238
+ /**
239
+ * Unique identifier for this resolved query instance
240
+ */
241
+ kater_id: string;
242
+ /**
243
+ * Name from the leaf query in the inheritance chain
244
+ */
245
+ name: string;
246
+ /**
247
+ * Reference to the original query template this was resolved from
248
+ */
249
+ source_query: string;
250
+ /**
251
+ * Reference to the topic this query uses (always known after inheritance
252
+ * resolution)
253
+ */
254
+ topic: string;
255
+ /**
256
+ * Usage guidance for AI processing
257
+ */
258
+ ai_context?: string | null;
259
+ /**
260
+ * Merged required + selected optional calculations
261
+ */
262
+ calculations?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
263
+ /**
264
+ * Chart recommendations preserved for evaluation
265
+ */
266
+ chart_hints?: Array<ResolvedQuery.ChartHint1 | ResolvedQuery.ChartHint2Output> | null;
267
+ /**
268
+ * Custom properties
269
+ */
270
+ custom_properties?: {
271
+ [key: string]: unknown;
272
+ } | null;
273
+ /**
274
+ * Description of the query
275
+ */
276
+ description?: string | null;
277
+ /**
278
+ * Merged required + selected optional dimensions
279
+ */
280
+ dimensions?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
281
+ /**
282
+ * Merged required + selected optional filters
283
+ */
284
+ filters?: Array<ResolvedQuery.InlineFieldFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
285
+ /**
286
+ * Ordered list of query refs that were merged during inheritance resolution
287
+ */
288
+ inheritance_chain?: Array<string> | null;
289
+ /**
290
+ * Human-readable label with var() values substituted
291
+ */
292
+ label?: string | null;
293
+ /**
294
+ * Maximum number of rows to return
295
+ */
296
+ limit?: number | null;
297
+ /**
298
+ * Merged required + selected optional measures
299
+ */
300
+ measures?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
301
+ /**
302
+ * Sort order specification for query results. Use desc for descending
303
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
304
+ */
305
+ order_by?: ResolvedQuery.OrderBy | null;
306
+ /**
307
+ * Access grants required to use this query
308
+ */
309
+ required_access_grants?: Array<string> | null;
310
+ /**
311
+ * The matched chart recommendation after evaluating chart hints
312
+ */
313
+ resolved_chart?: ResolvedQuery.ResolvedChart | null;
314
+ /**
315
+ * Full variable definitions with bound values
316
+ */
317
+ resolved_variables?: Array<ResolvedQuery.ResolvedVariable> | null;
318
+ /**
319
+ * Category of widget that determines data shape constraints for queries
320
+ */
321
+ widget_category?: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static' | null;
322
+ }
323
+ namespace ResolvedQuery {
324
+ /**
325
+ * A chart recommendation rule
326
+ */
327
+ interface ChartHint1 {
328
+ /**
329
+ * Chart configuration with variable references
330
+ */
331
+ config: CompilerAPI.ChartConfig;
332
+ /**
333
+ * Type of chart visualization
334
+ */
335
+ recommend: 'line' | 'bar' | 'stacked_bar' | 'area' | 'pie' | 'donut' | 'scatter' | 'table' | 'heatmap' | 'single_value';
336
+ /**
337
+ * Conditions based on variable values - can be single value (string) or multiple
338
+ * values (array)
339
+ */
340
+ when: {
341
+ [key: string]: string | Array<string>;
342
+ };
343
+ }
344
+ /**
345
+ * A chart recommendation rule
346
+ */
347
+ interface ChartHint2Output {
348
+ default: ChartHint2Output.Default;
349
+ }
350
+ namespace ChartHint2Output {
351
+ interface Default {
352
+ /**
353
+ * Chart configuration with variable references
354
+ */
355
+ config: CompilerAPI.ChartConfig;
356
+ /**
357
+ * Type of chart visualization
358
+ */
359
+ recommend: 'line' | 'bar' | 'stacked_bar' | 'area' | 'pie' | 'donut' | 'scatter' | 'table' | 'heatmap' | 'single_value';
360
+ }
361
+ }
362
+ /**
363
+ * An inline filter using field + operator + values
364
+ */
365
+ interface InlineFieldFilter {
366
+ /**
367
+ * Reference to the field to filter on
368
+ */
369
+ field: string;
370
+ /**
371
+ * Name of the inline filter
372
+ */
373
+ name: string;
374
+ /**
375
+ * Filter operator to apply
376
+ */
377
+ 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';
378
+ /**
379
+ * SQL expression for the filter value
380
+ */
381
+ sql_value?: string | null;
382
+ /**
383
+ * Fixed values for the filter
384
+ */
385
+ static_values?: Array<string | number | boolean> | null;
386
+ }
387
+ /**
388
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
389
+ */
390
+ interface InlineExistsFilter1 {
391
+ /**
392
+ * EXISTS subquery condition
393
+ */
394
+ exists: CompilerAPI.SubqueryCondition;
395
+ /**
396
+ * Name of the inline filter
397
+ */
398
+ name: string;
399
+ /**
400
+ * Description of the filter
401
+ */
402
+ description?: string | null;
403
+ /**
404
+ * Human-readable label
405
+ */
406
+ label?: string | null;
407
+ /**
408
+ * A subquery condition for EXISTS/NOT EXISTS filters
409
+ */
410
+ not_exists?: CompilerAPI.SubqueryCondition | null;
411
+ }
412
+ /**
413
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
414
+ */
415
+ interface InlineExistsFilter2 {
416
+ /**
417
+ * Name of the inline filter
418
+ */
419
+ name: string;
420
+ /**
421
+ * NOT EXISTS subquery condition
422
+ */
423
+ not_exists: CompilerAPI.SubqueryCondition;
424
+ /**
425
+ * Description of the filter
426
+ */
427
+ description?: string | null;
428
+ /**
429
+ * A subquery condition for EXISTS/NOT EXISTS filters
430
+ */
431
+ exists?: CompilerAPI.SubqueryCondition | null;
432
+ /**
433
+ * Human-readable label
434
+ */
435
+ label?: string | null;
436
+ }
437
+ /**
438
+ * Sort order specification for query results. Use desc for descending
439
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
440
+ */
441
+ interface OrderBy {
442
+ /**
443
+ * Fields to sort in ascending order (lowest/oldest first)
444
+ */
445
+ asc?: Array<string> | null;
446
+ /**
447
+ * Fields to sort in descending order (highest/newest first)
448
+ */
449
+ desc?: Array<string> | null;
450
+ }
451
+ /**
452
+ * The matched chart recommendation after evaluating chart hints
453
+ */
454
+ interface ResolvedChart {
455
+ /**
456
+ * Chart configuration
457
+ */
458
+ config: CompilerAPI.ChartConfig;
459
+ /**
460
+ * Recommended chart type
461
+ */
462
+ recommend: 'line' | 'bar' | 'stacked_bar' | 'area' | 'pie' | 'donut' | 'scatter' | 'table' | 'heatmap' | 'single_value';
463
+ }
464
+ /**
465
+ * A variable definition with its bound value
466
+ */
467
+ interface ResolvedVariable {
468
+ /**
469
+ * The concrete value bound for this resolution
470
+ */
471
+ bound_value: string | number | boolean;
472
+ /**
473
+ * Default value for this variable
474
+ */
475
+ default: string | number | boolean;
476
+ /**
477
+ * Variable name identifier
478
+ */
479
+ name: string;
480
+ /**
481
+ * Data type of the variable
482
+ */
483
+ type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
484
+ /**
485
+ * Allowed values configuration
486
+ */
487
+ allowed_values?: ResolvedVariable.VariableAllowedValues1 | ResolvedVariable.VariableAllowedValues2 | null;
488
+ /**
489
+ * Constraints for variable types
490
+ */
491
+ constraints?: ResolvedVariable.Constraints | null;
492
+ /**
493
+ * Description of the variable's purpose
494
+ */
495
+ description?: string | null;
496
+ /**
497
+ * True if bound_value equals the default value
498
+ */
499
+ is_default?: boolean | null;
500
+ /**
501
+ * Human-readable label for the variable
502
+ */
503
+ label?: string | null;
504
+ }
505
+ namespace ResolvedVariable {
506
+ /**
507
+ * Allowed values for a variable - either static list or from column
508
+ */
509
+ interface VariableAllowedValues1 {
510
+ /**
511
+ * Static list of allowed values with optional labels
512
+ */
513
+ static: Array<VariableAllowedValues1.Static>;
514
+ }
515
+ namespace VariableAllowedValues1 {
516
+ /**
517
+ * A value with optional display label
518
+ */
519
+ interface Static {
520
+ /**
521
+ * The actual value
522
+ */
523
+ value: string | number | boolean;
524
+ /**
525
+ * Human-readable label for the value
526
+ */
527
+ label?: string | null;
528
+ }
529
+ }
530
+ /**
531
+ * Allowed values for a variable - either static list or from column
532
+ */
533
+ interface VariableAllowedValues2 {
534
+ /**
535
+ * Reference to column for dynamic values
536
+ */
537
+ from_column: string;
538
+ /**
539
+ * Cache time-to-live in seconds
540
+ */
541
+ cache_ttl?: number;
542
+ /**
543
+ * Maximum number of values to retrieve
544
+ */
545
+ limit?: number;
546
+ /**
547
+ * Sort order for values
548
+ */
549
+ order_by?: 'asc' | 'desc';
550
+ }
551
+ /**
552
+ * Constraints for variable types
553
+ */
554
+ interface Constraints {
555
+ /**
556
+ * Maximum allowed value
557
+ */
558
+ max?: number | null;
559
+ /**
560
+ * Maximum length for STRING variables
561
+ */
562
+ max_length?: number | null;
563
+ /**
564
+ * Minimum allowed value
565
+ */
566
+ min?: number | null;
567
+ /**
568
+ * Step increment for numeric input
569
+ */
570
+ step?: number | null;
571
+ }
572
+ }
573
+ }
574
+ /**
575
+ * Dependency graph between schema objects.
576
+ */
577
+ interface DependencyGraph {
578
+ /**
579
+ * Edge relationships with UUID string keys
580
+ */
581
+ edges: {
582
+ [key: string]: {
583
+ [key: string]: Array<string>;
584
+ };
585
+ };
586
+ /**
587
+ * UUID string to node mapping
588
+ */
589
+ nodes: {
590
+ [key: string]: DependencyGraph.Nodes;
591
+ };
592
+ }
593
+ namespace DependencyGraph {
594
+ /**
595
+ * A node in the dependency graph.
596
+ */
597
+ interface Nodes {
598
+ /**
599
+ * Source file path
600
+ */
601
+ file: string;
602
+ /**
603
+ * Fully qualified name (e.g. 'dim_customer.region')
604
+ */
605
+ fqn: string;
606
+ /**
607
+ * UUID of the schema object
608
+ */
609
+ kater_id: string;
610
+ /**
611
+ * Line number in source file
612
+ */
613
+ line: number;
614
+ /**
615
+ * Node type: QUERY, VIEW, DIMENSION, MEASURE, FILTER, EXPRESSION
616
+ */
617
+ node_type: string;
618
+ }
619
+ }
620
+ }
621
+ /**
622
+ * Response model for schema validation.
623
+ */
624
+ export interface CompilerValidateResponse {
625
+ /**
626
+ * Whether validation passed without errors
627
+ */
628
+ success: boolean;
629
+ /**
630
+ * Dependency graph between schema objects.
631
+ */
632
+ dependency_graph?: CompilerValidateResponse.DependencyGraph | null;
633
+ /**
634
+ * Validation errors
635
+ */
636
+ errors?: Array<CompilerErrorItem>;
637
+ /**
638
+ * Compilation manifest with all named objects.
639
+ */
640
+ manifest?: Manifest | null;
641
+ /**
642
+ * Validation warnings
643
+ */
644
+ warnings?: Array<CompilerErrorItem>;
645
+ }
646
+ export declare namespace CompilerValidateResponse {
647
+ /**
648
+ * Dependency graph between schema objects.
649
+ */
650
+ interface DependencyGraph {
651
+ /**
652
+ * Edge relationships with UUID string keys
653
+ */
654
+ edges: {
655
+ [key: string]: {
656
+ [key: string]: Array<string>;
657
+ };
658
+ };
659
+ /**
660
+ * UUID string to node mapping
661
+ */
662
+ nodes: {
663
+ [key: string]: DependencyGraph.Nodes;
664
+ };
665
+ }
666
+ namespace DependencyGraph {
667
+ /**
668
+ * A node in the dependency graph.
669
+ */
670
+ interface Nodes {
671
+ /**
672
+ * Source file path
673
+ */
674
+ file: string;
675
+ /**
676
+ * Fully qualified name (e.g. 'dim_customer.region')
677
+ */
678
+ fqn: string;
679
+ /**
680
+ * UUID of the schema object
681
+ */
682
+ kater_id: string;
683
+ /**
684
+ * Line number in source file
685
+ */
686
+ line: number;
687
+ /**
688
+ * Node type: QUERY, VIEW, DIMENSION, MEASURE, FILTER, EXPRESSION
689
+ */
690
+ node_type: string;
691
+ }
692
+ }
693
+ }
694
+ export interface CompilerCompileParams {
695
+ /**
696
+ * Body param: Connection to compile against
697
+ */
698
+ connection_id: string;
699
+ /**
700
+ * Body param: Previously resolved query object from /resolve
701
+ */
702
+ resolved_query: CompilerCompileParams.ResolvedQuery;
703
+ /**
704
+ * Query param
705
+ */
706
+ source?: string | null;
707
+ /**
708
+ * Body param: Optional tenant database override
709
+ */
710
+ tenant_database?: string | null;
711
+ /**
712
+ * Header param
713
+ */
714
+ 'X-Kater-CLI-ID'?: string;
715
+ }
716
+ export declare namespace CompilerCompileParams {
717
+ /**
718
+ * Previously resolved query object from /resolve
719
+ */
720
+ interface ResolvedQuery {
721
+ /**
722
+ * Unique identifier for this resolved query instance
723
+ */
724
+ kater_id: string;
725
+ /**
726
+ * Name from the leaf query in the inheritance chain
727
+ */
728
+ name: string;
729
+ /**
730
+ * Reference to the original query template this was resolved from
731
+ */
732
+ source_query: string;
733
+ /**
734
+ * Reference to the topic this query uses (always known after inheritance
735
+ * resolution)
736
+ */
737
+ topic: string;
738
+ /**
739
+ * Usage guidance for AI processing
740
+ */
741
+ ai_context?: string | null;
742
+ /**
743
+ * Merged required + selected optional calculations
744
+ */
745
+ calculations?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
746
+ /**
747
+ * Chart recommendations preserved for evaluation
748
+ */
749
+ chart_hints?: Array<ResolvedQuery.ChartHint1 | ResolvedQuery.ChartHint2Input> | null;
750
+ /**
751
+ * Custom properties
752
+ */
753
+ custom_properties?: {
754
+ [key: string]: unknown;
755
+ } | null;
756
+ /**
757
+ * Description of the query
758
+ */
759
+ description?: string | null;
760
+ /**
761
+ * Merged required + selected optional dimensions
762
+ */
763
+ dimensions?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
764
+ /**
765
+ * Merged required + selected optional filters
766
+ */
767
+ filters?: Array<ResolvedQuery.InlineFieldFilter | string | ResolvedQuery.InlineExistsFilter1 | ResolvedQuery.InlineExistsFilter2> | null;
768
+ /**
769
+ * Ordered list of query refs that were merged during inheritance resolution
770
+ */
771
+ inheritance_chain?: Array<string> | null;
772
+ /**
773
+ * Human-readable label with var() values substituted
774
+ */
775
+ label?: string | null;
776
+ /**
777
+ * Maximum number of rows to return
778
+ */
779
+ limit?: number | null;
780
+ /**
781
+ * Merged required + selected optional measures
782
+ */
783
+ measures?: Array<CompilerAPI.RefWithLabel | CompilerAPI.InlineField | string> | null;
784
+ /**
785
+ * Sort order specification for query results. Use desc for descending
786
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
787
+ */
788
+ order_by?: ResolvedQuery.OrderBy | null;
789
+ /**
790
+ * Access grants required to use this query
791
+ */
792
+ required_access_grants?: Array<string> | null;
793
+ /**
794
+ * The matched chart recommendation after evaluating chart hints
795
+ */
796
+ resolved_chart?: ResolvedQuery.ResolvedChart | null;
797
+ /**
798
+ * Full variable definitions with bound values
799
+ */
800
+ resolved_variables?: Array<ResolvedQuery.ResolvedVariable> | null;
801
+ /**
802
+ * Category of widget that determines data shape constraints for queries
803
+ */
804
+ widget_category?: 'axis' | 'pie' | 'single_value' | 'heatmap' | 'table' | 'static' | null;
805
+ }
806
+ namespace ResolvedQuery {
807
+ /**
808
+ * A chart recommendation rule
809
+ */
810
+ interface ChartHint1 {
811
+ /**
812
+ * Chart configuration with variable references
813
+ */
814
+ config: CompilerAPI.ChartConfig;
815
+ /**
816
+ * Type of chart visualization
817
+ */
818
+ recommend: 'line' | 'bar' | 'stacked_bar' | 'area' | 'pie' | 'donut' | 'scatter' | 'table' | 'heatmap' | 'single_value';
819
+ /**
820
+ * Conditions based on variable values - can be single value (string) or multiple
821
+ * values (array)
822
+ */
823
+ when: {
824
+ [key: string]: string | Array<string>;
825
+ };
826
+ }
827
+ /**
828
+ * A chart recommendation rule
829
+ */
830
+ interface ChartHint2Input {
831
+ default: ChartHint2Input.Default;
832
+ }
833
+ namespace ChartHint2Input {
834
+ interface Default {
835
+ /**
836
+ * Chart configuration with variable references
837
+ */
838
+ config: CompilerAPI.ChartConfig;
839
+ /**
840
+ * Type of chart visualization
841
+ */
842
+ recommend: 'line' | 'bar' | 'stacked_bar' | 'area' | 'pie' | 'donut' | 'scatter' | 'table' | 'heatmap' | 'single_value';
843
+ }
844
+ }
845
+ /**
846
+ * An inline filter using field + operator + values
847
+ */
848
+ interface InlineFieldFilter {
849
+ /**
850
+ * Reference to the field to filter on
851
+ */
852
+ field: string;
853
+ /**
854
+ * Name of the inline filter
855
+ */
856
+ name: string;
857
+ /**
858
+ * Filter operator to apply
859
+ */
860
+ 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';
861
+ /**
862
+ * SQL expression for the filter value
863
+ */
864
+ sql_value?: string | null;
865
+ /**
866
+ * Fixed values for the filter
867
+ */
868
+ static_values?: Array<string | number | boolean> | null;
869
+ }
870
+ /**
871
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
872
+ */
873
+ interface InlineExistsFilter1 {
874
+ /**
875
+ * EXISTS subquery condition
876
+ */
877
+ exists: CompilerAPI.SubqueryCondition;
878
+ /**
879
+ * Name of the inline filter
880
+ */
881
+ name: string;
882
+ /**
883
+ * Description of the filter
884
+ */
885
+ description?: string | null;
886
+ /**
887
+ * Human-readable label
888
+ */
889
+ label?: string | null;
890
+ /**
891
+ * A subquery condition for EXISTS/NOT EXISTS filters
892
+ */
893
+ not_exists?: CompilerAPI.SubqueryCondition | null;
894
+ }
895
+ /**
896
+ * An inline filter using EXISTS or NOT EXISTS with a subquery
897
+ */
898
+ interface InlineExistsFilter2 {
899
+ /**
900
+ * Name of the inline filter
901
+ */
902
+ name: string;
903
+ /**
904
+ * NOT EXISTS subquery condition
905
+ */
906
+ not_exists: CompilerAPI.SubqueryCondition;
907
+ /**
908
+ * Description of the filter
909
+ */
910
+ description?: string | null;
911
+ /**
912
+ * A subquery condition for EXISTS/NOT EXISTS filters
913
+ */
914
+ exists?: CompilerAPI.SubqueryCondition | null;
915
+ /**
916
+ * Human-readable label
917
+ */
918
+ label?: string | null;
919
+ }
920
+ /**
921
+ * Sort order specification for query results. Use desc for descending
922
+ * (highest/newest first) and asc for ascending (lowest/oldest first).
923
+ */
924
+ interface OrderBy {
925
+ /**
926
+ * Fields to sort in ascending order (lowest/oldest first)
927
+ */
928
+ asc?: Array<string> | null;
929
+ /**
930
+ * Fields to sort in descending order (highest/newest first)
931
+ */
932
+ desc?: Array<string> | null;
933
+ }
934
+ /**
935
+ * The matched chart recommendation after evaluating chart hints
936
+ */
937
+ interface ResolvedChart {
938
+ /**
939
+ * Chart configuration
940
+ */
941
+ config: CompilerAPI.ChartConfig;
942
+ /**
943
+ * Recommended chart type
944
+ */
945
+ recommend: 'line' | 'bar' | 'stacked_bar' | 'area' | 'pie' | 'donut' | 'scatter' | 'table' | 'heatmap' | 'single_value';
946
+ }
947
+ /**
948
+ * A variable definition with its bound value
949
+ */
950
+ interface ResolvedVariable {
951
+ /**
952
+ * The concrete value bound for this resolution
953
+ */
954
+ bound_value: string | number | boolean;
955
+ /**
956
+ * Default value for this variable
957
+ */
958
+ default: string | number | boolean;
959
+ /**
960
+ * Variable name identifier
961
+ */
962
+ name: string;
963
+ /**
964
+ * Data type of the variable
965
+ */
966
+ type: 'STRING' | 'INT' | 'FLOAT' | 'DATE' | 'TIMESTAMP' | 'BOOL' | 'DIMENSION' | 'MEASURE' | 'CALCULATION' | 'FILTER';
967
+ /**
968
+ * Allowed values configuration
969
+ */
970
+ allowed_values?: ResolvedVariable.VariableAllowedValues1 | ResolvedVariable.VariableAllowedValues2 | null;
971
+ /**
972
+ * Constraints for variable types
973
+ */
974
+ constraints?: ResolvedVariable.Constraints | null;
975
+ /**
976
+ * Description of the variable's purpose
977
+ */
978
+ description?: string | null;
979
+ /**
980
+ * True if bound_value equals the default value
981
+ */
982
+ is_default?: boolean | null;
983
+ /**
984
+ * Human-readable label for the variable
985
+ */
986
+ label?: string | null;
987
+ }
988
+ namespace ResolvedVariable {
989
+ /**
990
+ * Allowed values for a variable - either static list or from column
991
+ */
992
+ interface VariableAllowedValues1 {
993
+ /**
994
+ * Static list of allowed values with optional labels
995
+ */
996
+ static: Array<VariableAllowedValues1.Static>;
997
+ }
998
+ namespace VariableAllowedValues1 {
999
+ /**
1000
+ * A value with optional display label
1001
+ */
1002
+ interface Static {
1003
+ /**
1004
+ * The actual value
1005
+ */
1006
+ value: string | number | boolean;
1007
+ /**
1008
+ * Human-readable label for the value
1009
+ */
1010
+ label?: string | null;
1011
+ }
1012
+ }
1013
+ /**
1014
+ * Allowed values for a variable - either static list or from column
1015
+ */
1016
+ interface VariableAllowedValues2 {
1017
+ /**
1018
+ * Reference to column for dynamic values
1019
+ */
1020
+ from_column: string;
1021
+ /**
1022
+ * Cache time-to-live in seconds
1023
+ */
1024
+ cache_ttl?: number;
1025
+ /**
1026
+ * Maximum number of values to retrieve
1027
+ */
1028
+ limit?: number;
1029
+ /**
1030
+ * Sort order for values
1031
+ */
1032
+ order_by?: 'asc' | 'desc';
1033
+ }
1034
+ /**
1035
+ * Constraints for variable types
1036
+ */
1037
+ interface Constraints {
1038
+ /**
1039
+ * Maximum allowed value
1040
+ */
1041
+ max?: number | null;
1042
+ /**
1043
+ * Maximum length for STRING variables
1044
+ */
1045
+ max_length?: number | null;
1046
+ /**
1047
+ * Minimum allowed value
1048
+ */
1049
+ min?: number | null;
1050
+ /**
1051
+ * Step increment for numeric input
1052
+ */
1053
+ step?: number | null;
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+ export interface CompilerResolveParams {
1059
+ /**
1060
+ * Body param: Connection to resolve against
1061
+ */
1062
+ connection_id: string;
1063
+ /**
1064
+ * Body param: Reference to the query template (e.g. 'ref(MY_QUERY)')
1065
+ */
1066
+ query_ref: string;
1067
+ /**
1068
+ * Query param
1069
+ */
1070
+ source?: string | null;
1071
+ /**
1072
+ * Body param: Calculation names to include
1073
+ */
1074
+ include_calculations?: Array<string>;
1075
+ /**
1076
+ * Body param: Dimension names to include
1077
+ */
1078
+ include_dimensions?: Array<string>;
1079
+ /**
1080
+ * Body param: Filter names to include
1081
+ */
1082
+ include_filters?: Array<string>;
1083
+ /**
1084
+ * Body param: Measure names to include
1085
+ */
1086
+ include_measures?: Array<string>;
1087
+ /**
1088
+ * Body param: User-selected variable values
1089
+ */
1090
+ variables?: {
1091
+ [key: string]: unknown;
1092
+ };
1093
+ /**
1094
+ * Header param
1095
+ */
1096
+ 'X-Kater-CLI-ID'?: string;
1097
+ }
1098
+ export interface CompilerValidateParams {
1099
+ /**
1100
+ * Query param
1101
+ */
1102
+ source?: string | null;
1103
+ /**
1104
+ * Body param: Optional connection IDs to validate. If omitted, validates all
1105
+ * connections.
1106
+ */
1107
+ connection_ids?: Array<string> | null;
1108
+ /**
1109
+ * Header param
1110
+ */
1111
+ 'X-Kater-CLI-ID'?: string;
1112
+ }
1113
+ export declare namespace Compiler {
1114
+ 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 CompilerResolveResponse as CompilerResolveResponse, type CompilerValidateResponse as CompilerValidateResponse, type CompilerCompileParams as CompilerCompileParams, type CompilerResolveParams as CompilerResolveParams, type CompilerValidateParams as CompilerValidateParams, };
1115
+ }
1116
+ //# sourceMappingURL=compiler.d.mts.map