@katerai/sdk 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +7 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/v1/compiler/cache.d.mts +0 -35
- package/resources/v1/compiler/cache.d.mts.map +1 -1
- package/resources/v1/compiler/cache.d.ts +0 -35
- package/resources/v1/compiler/cache.d.ts.map +1 -1
- package/resources/v1/compiler/cache.js +0 -9
- package/resources/v1/compiler/cache.js.map +1 -1
- package/resources/v1/compiler/cache.mjs +0 -9
- package/resources/v1/compiler/cache.mjs.map +1 -1
- package/resources/v1/compiler/combination.d.mts +120 -0
- package/resources/v1/compiler/combination.d.mts.map +1 -0
- package/resources/v1/compiler/combination.d.ts +120 -0
- package/resources/v1/compiler/combination.d.ts.map +1 -0
- package/resources/v1/compiler/combination.js +30 -0
- package/resources/v1/compiler/combination.js.map +1 -0
- package/resources/v1/compiler/combination.mjs +26 -0
- package/resources/v1/compiler/combination.mjs.map +1 -0
- package/resources/v1/compiler/compiler.d.mts +482 -84
- package/resources/v1/compiler/compiler.d.mts.map +1 -1
- package/resources/v1/compiler/compiler.d.ts +482 -84
- package/resources/v1/compiler/compiler.d.ts.map +1 -1
- package/resources/v1/compiler/compiler.js +26 -0
- package/resources/v1/compiler/compiler.js.map +1 -1
- package/resources/v1/compiler/compiler.mjs +26 -0
- package/resources/v1/compiler/compiler.mjs.map +1 -1
- package/resources/v1/compiler/index.d.mts +4 -2
- package/resources/v1/compiler/index.d.mts.map +1 -1
- package/resources/v1/compiler/index.d.ts +4 -2
- package/resources/v1/compiler/index.d.ts.map +1 -1
- package/resources/v1/compiler/index.js +3 -1
- package/resources/v1/compiler/index.js.map +1 -1
- package/resources/v1/compiler/index.mjs +1 -0
- package/resources/v1/compiler/index.mjs.map +1 -1
- package/resources/v1/compiler/manifest.d.mts +52 -0
- package/resources/v1/compiler/manifest.d.mts.map +1 -0
- package/resources/v1/compiler/manifest.d.ts +52 -0
- package/resources/v1/compiler/manifest.d.ts.map +1 -0
- package/resources/v1/compiler/manifest.js +29 -0
- package/resources/v1/compiler/manifest.js.map +1 -0
- package/resources/v1/compiler/manifest.mjs +25 -0
- package/resources/v1/compiler/manifest.mjs.map +1 -0
- package/resources/v1/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/tenants/tenants.d.mts +66 -10
- package/resources/v1/tenants/tenants.d.mts.map +1 -1
- package/resources/v1/tenants/tenants.d.ts +66 -10
- package/resources/v1/tenants/tenants.d.ts.map +1 -1
- package/resources/v1/tenants/tenants.js +27 -4
- package/resources/v1/tenants/tenants.js.map +1 -1
- package/resources/v1/tenants/tenants.mjs +27 -4
- package/resources/v1/tenants/tenants.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +8 -0
- package/src/resources/v1/compiler/cache.ts +1 -47
- package/src/resources/v1/compiler/combination.ts +157 -0
- package/src/resources/v1/compiler/compiler.ts +633 -190
- package/src/resources/v1/compiler/index.ts +8 -1
- package/src/resources/v1/compiler/manifest.ts +80 -0
- package/src/resources/v1/index.ts +2 -0
- package/src/resources/v1/tenants/tenants.ts +99 -12
- package/src/resources/v1/v1.ts +4 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
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 { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
+
|
|
9
|
+
export class Combination extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Preview a single combination: resolve, compile, execute, and build config.
|
|
12
|
+
*
|
|
13
|
+
* Chains existing services to provide a single-call preview for the query gallery.
|
|
14
|
+
* Returns data + WidgetConfig for immediate rendering.
|
|
15
|
+
*
|
|
16
|
+
* RLS: Filtered to current client (ClientRLSDB).
|
|
17
|
+
*/
|
|
18
|
+
preview(
|
|
19
|
+
params: CombinationPreviewParams,
|
|
20
|
+
options?: RequestOptions,
|
|
21
|
+
): APIPromise<CombinationPreviewResponse> {
|
|
22
|
+
const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
|
|
23
|
+
return this._client.post('/api/v1/compiler/combination/preview', {
|
|
24
|
+
query: { source },
|
|
25
|
+
body,
|
|
26
|
+
...options,
|
|
27
|
+
headers: buildHeaders([
|
|
28
|
+
{ ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Response from combination preview with data + resolved config.
|
|
37
|
+
*/
|
|
38
|
+
export interface CombinationPreviewResponse {
|
|
39
|
+
/**
|
|
40
|
+
* Whether preview succeeded
|
|
41
|
+
*/
|
|
42
|
+
success: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Auto-generated title
|
|
46
|
+
*/
|
|
47
|
+
auto_title?: string | null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Whether the result was served from cache
|
|
51
|
+
*/
|
|
52
|
+
cache_hit?: boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Enriched column metadata
|
|
56
|
+
*/
|
|
57
|
+
column_map?: Array<CombinationPreviewResponse.ColumnMap>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resolved WidgetConfig (from config builder)
|
|
61
|
+
*/
|
|
62
|
+
config?: { [key: string]: unknown };
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Query result rows
|
|
66
|
+
*/
|
|
67
|
+
data?: Array<{ [key: string]: unknown }>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Compilation errors (if any)
|
|
71
|
+
*/
|
|
72
|
+
errors?: Array<CompilerAPI.CompilerErrorItem>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Total execution time in milliseconds
|
|
76
|
+
*/
|
|
77
|
+
execution_time_ms?: number;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Resolved widget type (e.g. 'axis_metric_by_dimensiondate')
|
|
81
|
+
*/
|
|
82
|
+
widget_type?: string | null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export namespace CombinationPreviewResponse {
|
|
86
|
+
/**
|
|
87
|
+
* Maps a UUID column alias to its human-readable name and type.
|
|
88
|
+
*/
|
|
89
|
+
export interface ColumnMap {
|
|
90
|
+
/**
|
|
91
|
+
* Field type: dimension, measure, or calculation
|
|
92
|
+
*/
|
|
93
|
+
field_type: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* UUID string used as SQL column alias
|
|
97
|
+
*/
|
|
98
|
+
kater_id: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Human-readable column name
|
|
102
|
+
*/
|
|
103
|
+
name: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Aggregation type for measures: sum, count, min, max, avg, unknown. None for
|
|
107
|
+
* non-measures.
|
|
108
|
+
*/
|
|
109
|
+
aggregation?: string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Display label
|
|
113
|
+
*/
|
|
114
|
+
label?: string | null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface CombinationPreviewParams {
|
|
119
|
+
/**
|
|
120
|
+
* Body param: Comma-separated slot selections, same format as
|
|
121
|
+
* ResolveRequest.combination. Example:
|
|
122
|
+
* 'dimension=due_month,measure=compliance_rate'
|
|
123
|
+
*/
|
|
124
|
+
combination: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Body param: Connection to preview against
|
|
128
|
+
*/
|
|
129
|
+
connection_id: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Body param: Query template reference (e.g. 'q:compliance_trend.\_base')
|
|
133
|
+
*/
|
|
134
|
+
query_ref: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Query param
|
|
138
|
+
*/
|
|
139
|
+
source?: string | null;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Body param: Optional tenant key for multi-tenant execution
|
|
143
|
+
*/
|
|
144
|
+
tenant_key?: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Header param
|
|
148
|
+
*/
|
|
149
|
+
'X-Kater-CLI-ID'?: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export declare namespace Combination {
|
|
153
|
+
export {
|
|
154
|
+
type CombinationPreviewResponse as CombinationPreviewResponse,
|
|
155
|
+
type CombinationPreviewParams as CombinationPreviewParams,
|
|
156
|
+
};
|
|
157
|
+
}
|