@katerai/sdk 0.9.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.
Files changed (99) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +7 -0
  5. package/client.js.map +1 -1
  6. package/client.mjs +7 -0
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/v1/compiler/cache.d.mts +4 -0
  10. package/resources/v1/compiler/cache.d.mts.map +1 -0
  11. package/resources/v1/compiler/cache.d.ts +4 -0
  12. package/resources/v1/compiler/cache.d.ts.map +1 -0
  13. package/resources/v1/compiler/cache.js +9 -0
  14. package/resources/v1/compiler/cache.js.map +1 -0
  15. package/resources/v1/compiler/cache.mjs +5 -0
  16. package/resources/v1/compiler/cache.mjs.map +1 -0
  17. package/resources/v1/compiler/combination.d.mts +120 -0
  18. package/resources/v1/compiler/combination.d.mts.map +1 -0
  19. package/resources/v1/compiler/combination.d.ts +120 -0
  20. package/resources/v1/compiler/combination.d.ts.map +1 -0
  21. package/resources/v1/compiler/combination.js +30 -0
  22. package/resources/v1/compiler/combination.js.map +1 -0
  23. package/resources/v1/compiler/combination.mjs +26 -0
  24. package/resources/v1/compiler/combination.mjs.map +1 -0
  25. package/resources/v1/compiler/compiler.d.mts +2291 -0
  26. package/resources/v1/compiler/compiler.d.mts.map +1 -0
  27. package/resources/v1/compiler/compiler.d.ts +2291 -0
  28. package/resources/v1/compiler/compiler.d.ts.map +1 -0
  29. package/resources/v1/compiler/compiler.js +145 -0
  30. package/resources/v1/compiler/compiler.js.map +1 -0
  31. package/resources/v1/compiler/compiler.mjs +140 -0
  32. package/resources/v1/compiler/compiler.mjs.map +1 -0
  33. package/resources/v1/compiler/index.d.mts +5 -0
  34. package/resources/v1/compiler/index.d.mts.map +1 -0
  35. package/resources/v1/compiler/index.d.ts +5 -0
  36. package/resources/v1/compiler/index.d.ts.map +1 -0
  37. package/resources/v1/compiler/index.js +11 -0
  38. package/resources/v1/compiler/index.js.map +1 -0
  39. package/resources/v1/compiler/index.mjs +5 -0
  40. package/resources/v1/compiler/index.mjs.map +1 -0
  41. package/resources/v1/compiler/manifest.d.mts +52 -0
  42. package/resources/v1/compiler/manifest.d.mts.map +1 -0
  43. package/resources/v1/compiler/manifest.d.ts +52 -0
  44. package/resources/v1/compiler/manifest.d.ts.map +1 -0
  45. package/resources/v1/compiler/manifest.js +29 -0
  46. package/resources/v1/compiler/manifest.js.map +1 -0
  47. package/resources/v1/compiler/manifest.mjs +25 -0
  48. package/resources/v1/compiler/manifest.mjs.map +1 -0
  49. package/resources/v1/compiler.d.mts +1 -1142
  50. package/resources/v1/compiler.d.mts.map +1 -1
  51. package/resources/v1/compiler.d.ts +1 -1142
  52. package/resources/v1/compiler.d.ts.map +1 -1
  53. package/resources/v1/compiler.js +2 -66
  54. package/resources/v1/compiler.js.map +1 -1
  55. package/resources/v1/compiler.mjs +1 -64
  56. package/resources/v1/compiler.mjs.map +1 -1
  57. package/resources/v1/index.d.mts +1 -1
  58. package/resources/v1/index.d.mts.map +1 -1
  59. package/resources/v1/index.d.ts +1 -1
  60. package/resources/v1/index.d.ts.map +1 -1
  61. package/resources/v1/index.js +4 -4
  62. package/resources/v1/index.js.map +1 -1
  63. package/resources/v1/index.mjs +1 -1
  64. package/resources/v1/index.mjs.map +1 -1
  65. package/resources/v1/tenants/tenants.d.mts +66 -10
  66. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  67. package/resources/v1/tenants/tenants.d.ts +66 -10
  68. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  69. package/resources/v1/tenants/tenants.js +27 -4
  70. package/resources/v1/tenants/tenants.js.map +1 -1
  71. package/resources/v1/tenants/tenants.mjs +27 -4
  72. package/resources/v1/tenants/tenants.mjs.map +1 -1
  73. package/resources/v1/v1.d.mts +3 -3
  74. package/resources/v1/v1.d.mts.map +1 -1
  75. package/resources/v1/v1.d.ts +3 -3
  76. package/resources/v1/v1.d.ts.map +1 -1
  77. package/resources/v1/v1.js +2 -2
  78. package/resources/v1/v1.js.map +1 -1
  79. package/resources/v1/v1.mjs +2 -2
  80. package/resources/v1/v1.mjs.map +1 -1
  81. package/src/client.ts +9 -1
  82. package/src/resources/v1/compiler/cache.ts +5 -0
  83. package/src/resources/v1/compiler/combination.ts +157 -0
  84. package/src/resources/v1/compiler/compiler.ts +2991 -0
  85. package/src/resources/v1/compiler/index.ts +30 -0
  86. package/src/resources/v1/compiler/manifest.ts +80 -0
  87. package/src/resources/v1/compiler.ts +1 -1514
  88. package/src/resources/v1/index.ts +7 -1
  89. package/src/resources/v1/tenants/tenants.ts +99 -12
  90. package/src/resources/v1/v1.ts +21 -9
  91. package/src/version.ts +1 -1
  92. package/version.d.mts +1 -1
  93. package/version.d.mts.map +1 -1
  94. package/version.d.ts +1 -1
  95. package/version.d.ts.map +1 -1
  96. package/version.js +1 -1
  97. package/version.js.map +1 -1
  98. package/version.mjs +1 -1
  99. package/version.mjs.map +1 -1
@@ -10,12 +10,18 @@ export {
10
10
  type RefWithLabel,
11
11
  type SubqueryCondition,
12
12
  type CompilerCompileResponse,
13
+ type CompilerCompileDashboardResponse,
14
+ type CompilerEnumerateResponse,
15
+ type CompilerExecuteResponse,
13
16
  type CompilerResolveResponse,
14
17
  type CompilerValidateResponse,
15
18
  type CompilerCompileParams,
19
+ type CompilerCompileDashboardParams,
20
+ type CompilerEnumerateParams,
21
+ type CompilerExecuteParams,
16
22
  type CompilerResolveParams,
17
23
  type CompilerValidateParams,
18
- } from './compiler';
24
+ } from './compiler/index';
19
25
  export {
20
26
  Connections,
21
27
  type Connection,
@@ -5,6 +5,7 @@ import * as GroupsAPI from './groups';
5
5
  import { GroupGetTenantGroupsSchemaResponse, Groups } from './groups';
6
6
  import { APIPromise } from '../../../core/api-promise';
7
7
  import { type Uploadable } from '../../../core/uploads';
8
+ import { buildHeaders } from '../../../internal/headers';
8
9
  import { RequestOptions } from '../../../internal/request-options';
9
10
  import { multipartFormRequestOptions } from '../../../internal/uploads';
10
11
 
@@ -32,22 +33,38 @@ export class Tenants extends APIResource {
32
33
  * - tenant_key (required): Unique tenant identifier
33
34
  * - tenant_name (optional): Human-readable name
34
35
  * - group_names (optional): Comma-separated list of group names
36
+ * - Additional columns can be mapped to attributes via attribute_columns
35
37
  *
36
38
  * Creates new tenants and updates existing ones with new name/groups. Groups are
37
39
  * added additively (not replaced) and auto-created if needed.
38
40
  *
41
+ * Optionally processes attribute columns: values are validated against
42
+ * attributes.yaml, stored additively, and validation errors are non-fatal.
43
+ *
39
44
  * RLS: Filtered to current client (ClientRLSDB).
40
45
  *
41
46
  * Raises: ValidationError: If CSV format is invalid (400)
42
47
  * TenantCreationNotAllowedError: If tenancy type is NONE (400)
43
48
  */
44
49
  importFromCsv(
45
- body: TenantImportFromCsvParams,
50
+ params: TenantImportFromCsvParams,
46
51
  options?: RequestOptions,
47
52
  ): APIPromise<ImportTenantsResponse> {
53
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
48
54
  return this._client.post(
49
55
  '/api/v1/tenants/import/csv',
50
- multipartFormRequestOptions({ body, ...options }, this._client),
56
+ multipartFormRequestOptions(
57
+ {
58
+ query: { source },
59
+ body,
60
+ ...options,
61
+ headers: buildHeaders([
62
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
63
+ options?.headers,
64
+ ]),
65
+ },
66
+ this._client,
67
+ ),
51
68
  );
52
69
  }
53
70
 
@@ -69,10 +86,19 @@ export class Tenants extends APIResource {
69
86
  * TenantCreationNotAllowedError: If tenancy type is NONE (400)
70
87
  */
71
88
  importFromWarehouse(
72
- body: TenantImportFromWarehouseParams,
89
+ params: TenantImportFromWarehouseParams,
73
90
  options?: RequestOptions,
74
91
  ): APIPromise<ImportTenantsResponse> {
75
- return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
92
+ const { source, 'X-Kater-CLI-ID': xKaterCliID, ...body } = params;
93
+ return this._client.post('/api/v1/tenants/import/warehouse', {
94
+ query: { source },
95
+ body,
96
+ ...options,
97
+ headers: buildHeaders([
98
+ { ...(xKaterCliID != null ? { 'X-Kater-CLI-ID': xKaterCliID } : undefined) },
99
+ options?.headers,
100
+ ]),
101
+ });
76
102
  }
77
103
  }
78
104
 
@@ -95,6 +121,11 @@ export interface ImportTenantsResponse {
95
121
  */
96
122
  total_updated: number;
97
123
 
124
+ /**
125
+ * Non-fatal attribute validation errors during import
126
+ */
127
+ attribute_errors?: Array<ImportTenantsResponse.AttributeError>;
128
+
98
129
  /**
99
130
  * Tenant-specific errors
100
131
  */
@@ -107,6 +138,31 @@ export interface ImportTenantsResponse {
107
138
  }
108
139
 
109
140
  export namespace ImportTenantsResponse {
141
+ /**
142
+ * Error for a single attribute during import.
143
+ */
144
+ export interface AttributeError {
145
+ /**
146
+ * Attribute name that failed
147
+ */
148
+ attribute: string;
149
+
150
+ /**
151
+ * Error message
152
+ */
153
+ error: string;
154
+
155
+ /**
156
+ * Tenant key for which attribute processing failed
157
+ */
158
+ tenant_key: string;
159
+
160
+ /**
161
+ * Value that caused the error
162
+ */
163
+ value: string;
164
+ }
165
+
110
166
  /**
111
167
  * Error for a single tenant during import.
112
168
  */
@@ -164,46 +220,77 @@ export namespace TenantGetTenantsSchemaResponse {
164
220
 
165
221
  export interface TenantImportFromCsvParams {
166
222
  /**
167
- * CSV file with tenant data
223
+ * Body param: CSV file with tenant data
168
224
  */
169
225
  file: Uploadable;
226
+
227
+ /**
228
+ * Query param
229
+ */
230
+ source?: string | null;
231
+
232
+ /**
233
+ * Body param: JSON mapping: attribute_name -> csv_column_name
234
+ */
235
+ attribute_columns?: string | null;
236
+
237
+ /**
238
+ * Header param
239
+ */
240
+ 'X-Kater-CLI-ID'?: string;
170
241
  }
171
242
 
172
243
  export interface TenantImportFromWarehouseParams {
173
244
  /**
174
- * Warehouse connection ID to query
245
+ * Body param: Warehouse connection ID to query
175
246
  */
176
247
  connection_id: string;
177
248
 
178
249
  /**
179
- * Database name containing the tenant table
250
+ * Body param: Database name containing the tenant table
180
251
  */
181
252
  database: string;
182
253
 
183
254
  /**
184
- * Schema name containing the tenant table
255
+ * Body param: Schema name containing the tenant table
185
256
  */
186
257
  schema: string;
187
258
 
188
259
  /**
189
- * Table name containing tenant data
260
+ * Body param: Table name containing tenant data
190
261
  */
191
262
  table: string;
192
263
 
193
264
  /**
194
- * Column name for tenant key
265
+ * Body param: Column name for tenant key
195
266
  */
196
267
  tenant_key_column: string;
197
268
 
198
269
  /**
199
- * Column name for tenant group (optional)
270
+ * Query param
271
+ */
272
+ source?: string | null;
273
+
274
+ /**
275
+ * Body param: Mapping of attribute names to warehouse column names for attribute
276
+ * import
277
+ */
278
+ attribute_columns?: { [key: string]: string } | null;
279
+
280
+ /**
281
+ * Body param: Column name for tenant group (optional)
200
282
  */
201
283
  tenant_group_column?: string | null;
202
284
 
203
285
  /**
204
- * Column name for tenant display name (optional)
286
+ * Body param: Column name for tenant display name (optional)
205
287
  */
206
288
  tenant_name_column?: string | null;
289
+
290
+ /**
291
+ * Header param
292
+ */
293
+ 'X-Kater-CLI-ID'?: string;
207
294
  }
208
295
 
209
296
  Tenants.Groups = Groups;
@@ -1,13 +1,26 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
- import * as CompilerAPI from './compiler';
4
+ import * as ConnectionsAPI from './connections';
5
+ import {
6
+ Connection,
7
+ ConnectionListConnectionsParams,
8
+ ConnectionListConnectionsResponse,
9
+ Connections,
10
+ } from './connections';
11
+ import * as CompilerAPI from './compiler/compiler';
5
12
  import {
6
13
  ChartConfig,
7
14
  Compiler,
15
+ CompilerCompileDashboardParams,
16
+ CompilerCompileDashboardResponse,
8
17
  CompilerCompileParams,
9
18
  CompilerCompileResponse,
19
+ CompilerEnumerateParams,
20
+ CompilerEnumerateResponse,
10
21
  CompilerErrorItem,
22
+ CompilerExecuteParams,
23
+ CompilerExecuteResponse,
11
24
  CompilerResolveParams,
12
25
  CompilerResolveResponse,
13
26
  CompilerValidateParams,
@@ -17,14 +30,7 @@ import {
17
30
  ManifestEntry,
18
31
  RefWithLabel,
19
32
  SubqueryCondition,
20
- } from './compiler';
21
- import * as ConnectionsAPI from './connections';
22
- import {
23
- Connection,
24
- ConnectionListConnectionsParams,
25
- ConnectionListConnectionsResponse,
26
- Connections,
27
- } from './connections';
33
+ } from './compiler/compiler';
28
34
  import * as TenantsAPI from './tenants/tenants';
29
35
  import {
30
36
  ImportTenantsResponse,
@@ -55,9 +61,15 @@ export declare namespace V1 {
55
61
  type RefWithLabel as RefWithLabel,
56
62
  type SubqueryCondition as SubqueryCondition,
57
63
  type CompilerCompileResponse as CompilerCompileResponse,
64
+ type CompilerCompileDashboardResponse as CompilerCompileDashboardResponse,
65
+ type CompilerEnumerateResponse as CompilerEnumerateResponse,
66
+ type CompilerExecuteResponse as CompilerExecuteResponse,
58
67
  type CompilerResolveResponse as CompilerResolveResponse,
59
68
  type CompilerValidateResponse as CompilerValidateResponse,
60
69
  type CompilerCompileParams as CompilerCompileParams,
70
+ type CompilerCompileDashboardParams as CompilerCompileDashboardParams,
71
+ type CompilerEnumerateParams as CompilerEnumerateParams,
72
+ type CompilerExecuteParams as CompilerExecuteParams,
61
73
  type CompilerResolveParams as CompilerResolveParams,
62
74
  type CompilerValidateParams as CompilerValidateParams,
63
75
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.9.0'; // x-release-please-version
1
+ export const VERSION = '0.11.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.9.0";
1
+ export declare const VERSION = "0.11.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.9.0";
1
+ export declare const VERSION = "0.11.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.9.0'; // x-release-please-version
4
+ exports.VERSION = '0.11.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.9.0'; // x-release-please-version
1
+ export const VERSION = '0.11.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}