@katerai/sdk 0.4.0 → 0.6.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 (116) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +1 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +8 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +8 -2
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/v1/connections/connections.d.mts +734 -95
  18. package/resources/v1/connections/connections.d.mts.map +1 -1
  19. package/resources/v1/connections/connections.d.ts +734 -95
  20. package/resources/v1/connections/connections.d.ts.map +1 -1
  21. package/resources/v1/connections/connections.js +77 -14
  22. package/resources/v1/connections/connections.js.map +1 -1
  23. package/resources/v1/connections/connections.mjs +78 -15
  24. package/resources/v1/connections/connections.mjs.map +1 -1
  25. package/resources/v1/connections/databases.d.mts +1 -118
  26. package/resources/v1/connections/databases.d.mts.map +1 -1
  27. package/resources/v1/connections/databases.d.ts +1 -118
  28. package/resources/v1/connections/databases.d.ts.map +1 -1
  29. package/resources/v1/connections/databases.js +0 -35
  30. package/resources/v1/connections/databases.js.map +1 -1
  31. package/resources/v1/connections/databases.mjs +0 -35
  32. package/resources/v1/connections/databases.mjs.map +1 -1
  33. package/resources/v1/connections/index.d.mts +4 -2
  34. package/resources/v1/connections/index.d.mts.map +1 -1
  35. package/resources/v1/connections/index.d.ts +4 -2
  36. package/resources/v1/connections/index.d.ts.map +1 -1
  37. package/resources/v1/connections/index.js +5 -1
  38. package/resources/v1/connections/index.js.map +1 -1
  39. package/resources/v1/connections/index.mjs +3 -1
  40. package/resources/v1/connections/index.mjs.map +1 -1
  41. package/resources/v1/connections/views.d.mts +77 -0
  42. package/resources/v1/connections/views.d.mts.map +1 -0
  43. package/resources/v1/connections/views.d.ts +77 -0
  44. package/resources/v1/connections/views.d.ts.map +1 -0
  45. package/resources/v1/connections/views.js +24 -0
  46. package/resources/v1/connections/views.js.map +1 -0
  47. package/resources/v1/connections/views.mjs +20 -0
  48. package/resources/v1/connections/views.mjs.map +1 -0
  49. package/resources/v1/connections/yaml.d.mts +57 -0
  50. package/resources/v1/connections/yaml.d.mts.map +1 -0
  51. package/resources/v1/connections/yaml.d.ts +57 -0
  52. package/resources/v1/connections/yaml.d.ts.map +1 -0
  53. package/resources/v1/connections/yaml.js +22 -0
  54. package/resources/v1/connections/yaml.js.map +1 -0
  55. package/resources/v1/connections/yaml.mjs +18 -0
  56. package/resources/v1/connections/yaml.mjs.map +1 -0
  57. package/resources/v1/github/github.d.mts +4 -0
  58. package/resources/v1/github/github.d.mts.map +1 -1
  59. package/resources/v1/github/github.d.ts +4 -0
  60. package/resources/v1/github/github.d.ts.map +1 -1
  61. package/resources/v1/github/github.js.map +1 -1
  62. package/resources/v1/github/github.mjs.map +1 -1
  63. package/resources/v1/index.d.mts +2 -2
  64. package/resources/v1/index.d.mts.map +1 -1
  65. package/resources/v1/index.d.ts +2 -2
  66. package/resources/v1/index.d.ts.map +1 -1
  67. package/resources/v1/index.js.map +1 -1
  68. package/resources/v1/index.mjs.map +1 -1
  69. package/resources/v1/tenants/groups.d.mts +43 -0
  70. package/resources/v1/tenants/groups.d.mts.map +1 -0
  71. package/resources/v1/tenants/groups.d.ts +43 -0
  72. package/resources/v1/tenants/groups.d.ts.map +1 -0
  73. package/resources/v1/tenants/groups.js +20 -0
  74. package/resources/v1/tenants/groups.js.map +1 -0
  75. package/resources/v1/tenants/groups.mjs +16 -0
  76. package/resources/v1/tenants/groups.mjs.map +1 -0
  77. package/resources/v1/tenants/index.d.mts +2 -1
  78. package/resources/v1/tenants/index.d.mts.map +1 -1
  79. package/resources/v1/tenants/index.d.ts +2 -1
  80. package/resources/v1/tenants/index.d.ts.map +1 -1
  81. package/resources/v1/tenants/index.js +3 -1
  82. package/resources/v1/tenants/index.js.map +1 -1
  83. package/resources/v1/tenants/index.mjs +1 -0
  84. package/resources/v1/tenants/index.mjs.map +1 -1
  85. package/resources/v1/tenants/tenants.d.mts +44 -1
  86. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  87. package/resources/v1/tenants/tenants.d.ts +44 -1
  88. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  89. package/resources/v1/tenants/tenants.js +16 -0
  90. package/resources/v1/tenants/tenants.js.map +1 -1
  91. package/resources/v1/tenants/tenants.mjs +16 -0
  92. package/resources/v1/tenants/tenants.mjs.map +1 -1
  93. package/resources/v1/v1.d.mts +4 -4
  94. package/resources/v1/v1.d.mts.map +1 -1
  95. package/resources/v1/v1.d.ts +4 -4
  96. package/resources/v1/v1.d.ts.map +1 -1
  97. package/resources/v1/v1.js.map +1 -1
  98. package/resources/v1/v1.mjs.map +1 -1
  99. package/src/client.ts +9 -2
  100. package/src/internal/parse.ts +6 -0
  101. package/src/resources/v1/connections/connections.ts +958 -119
  102. package/src/resources/v1/connections/databases.ts +1 -165
  103. package/src/resources/v1/connections/index.ts +20 -7
  104. package/src/resources/v1/connections/views.ts +112 -0
  105. package/src/resources/v1/connections/yaml.ts +81 -0
  106. package/src/resources/v1/github/github.ts +8 -0
  107. package/src/resources/v1/index.ts +13 -0
  108. package/src/resources/v1/tenants/groups.ts +52 -0
  109. package/src/resources/v1/tenants/index.ts +2 -0
  110. package/src/resources/v1/tenants/tenants.ts +54 -0
  111. package/src/resources/v1/v1.ts +26 -0
  112. package/src/version.ts +1 -1
  113. package/version.d.mts +1 -1
  114. package/version.d.ts +1 -1
  115. package/version.js +1 -1
  116. package/version.mjs +1 -1
@@ -1,22 +1,26 @@
1
1
  import { APIResource } from "../../../core/resource.mjs";
2
2
  import * as DatabasesAPI from "./databases.mjs";
3
- import { DatabaseDeleteSchemaParams, DatabaseUpdateParams, DatabaseUpdateResponse, DatabaseUpdateSchemaParams, DatabaseUpdateSchemaResponse, Databases } from "./databases.mjs";
3
+ import { DatabaseDeleteSchemaParams, Databases } from "./databases.mjs";
4
+ import * as ViewsAPI from "./views.mjs";
5
+ import { ViewListParams, ViewListResponse, ViewRetrieveParams, ViewRetrieveResponse, Views } from "./views.mjs";
6
+ import * as YamlAPI from "./yaml.mjs";
7
+ import { Yaml, YamlCommitParams, YamlCommitResponse, YamlRetrieveResponse } from "./yaml.mjs";
4
8
  import { APIPromise } from "../../../core/api-promise.mjs";
5
9
  import { RequestOptions } from "../../../internal/request-options.mjs";
6
10
  export declare class Connections extends APIResource {
7
11
  databases: DatabasesAPI.Databases;
12
+ views: ViewsAPI.Views;
13
+ yaml: YamlAPI.Yaml;
8
14
  /**
9
- * Create a new warehouse connection.
15
+ * Create a new warehouse connection with PR approval flow.
10
16
  */
11
17
  create(body: ConnectionCreateParams, options?: RequestOptions): APIPromise<Connection>;
12
18
  /**
13
- * Get a single warehouse connection by kater_id.
19
+ * Get a single warehouse connection by ID.
14
20
  *
15
- * Returns connection from the database (source of truth) with full hierarchy.
16
- * Supports content negotiation via Accept header (handled by MultiFormatRoute):
17
- *
18
- * - application/json (default): Returns JSON response
19
- * - application/yaml: Returns YAML representation
21
+ * Returns connection from the database (source of truth) with full hierarchy. For
22
+ * YAML output compatible with repository files (using kater_id), use the GET
23
+ * /connections/{id}/schema endpoint instead.
20
24
  *
21
25
  * RLS: Filtered to current client (DualClientRLSDB).
22
26
  *
@@ -34,15 +38,20 @@ export declare class Connections extends APIResource {
34
38
  */
35
39
  update(connectionID: string, body: ConnectionUpdateParams, options?: RequestOptions): APIPromise<Connection>;
36
40
  /**
37
- * List all warehouse connections for the client.
41
+ * List warehouse connections for the client.
42
+ *
43
+ * Filter connections by approval status using the `status` query parameter:
38
44
  *
39
- * Returns connections from the database joined with schema information from
40
- * GitHub. Connections with pending PRs will have null GitHub fields until merged.
41
- * Returns empty list if GitHub is not configured.
45
+ * - `approved` (default): Only approved connections (is_pending_approval=false)
46
+ * - `pending`: Only connections awaiting PR approval (is_pending_approval=true)
47
+ * - `all`: All connections regardless of approval status
48
+ *
49
+ * Pending connections include their approval PR URLs when available. Returns empty
50
+ * list if GitHub is not configured.
42
51
  *
43
52
  * RLS: Filtered to current client (DualClientRLSDB).
44
53
  */
45
- list(options?: RequestOptions): APIPromise<ConnectionListResponse>;
54
+ list(query?: ConnectionListParams | null | undefined, options?: RequestOptions): APIPromise<ConnectionListResponse>;
46
55
  /**
47
56
  * Delete a warehouse connection.
48
57
  *
@@ -54,6 +63,18 @@ export declare class Connections extends APIResource {
54
63
  * Raises: ConnectionNotFoundError: If connection doesn't exist (404)
55
64
  */
56
65
  delete(connectionID: string, options?: RequestOptions): APIPromise<void>;
66
+ /**
67
+ * Merge the PR for a pending connection to finalize it.
68
+ */
69
+ approve(connectionID: string, options?: RequestOptions): APIPromise<Connection>;
70
+ /**
71
+ * Merge the PR for a completed schema sync.
72
+ */
73
+ approveSync(syncID: string, params: ConnectionApproveSyncParams, options?: RequestOptions): APIPromise<ConnectionApproveSyncResponse>;
74
+ /**
75
+ * List all schema sync records for a connection.
76
+ */
77
+ listSyncs(connectionID: string, query?: ConnectionListSyncsParams | null | undefined, options?: RequestOptions): APIPromise<ConnectionListSyncsResponse>;
57
78
  /**
58
79
  * Get decrypted warehouse credentials for a connection.
59
80
  *
@@ -66,15 +87,38 @@ export declare class Connections extends APIResource {
66
87
  */
67
88
  retrieveCredential(connectionID: string, options?: RequestOptions): APIPromise<ConnectionRetrieveCredentialResponse>;
68
89
  /**
69
- * Sync view schemas from warehouse and create a PR (or update existing).
90
+ * Get connection as a ConnectionSchema object.
91
+ *
92
+ * Returns the connection in the YAML-compatible schema format with full
93
+ * database/schema hierarchy.
94
+ *
95
+ * RLS: Automatically filtered by client_id from auth context.
96
+ *
97
+ * Raises: ConnectionNotFoundError: If connection not found or deleted.
98
+ */
99
+ retrieveSchema(connectionID: string, options?: RequestOptions): APIPromise<ConnectionRetrieveSchemaResponse>;
100
+ /**
101
+ * Get the current status of a schema sync workflow.
102
+ */
103
+ retrieveSyncStatus(syncID: string, params: ConnectionRetrieveSyncStatusParams, options?: RequestOptions): APIPromise<ConnectionRetrieveSyncStatusResponse>;
104
+ /**
105
+ * Server-Sent Events stream for real-time sync progress updates.
106
+ */
107
+ streamSyncProgress(syncID: string, params: ConnectionStreamSyncProgressParams, options?: RequestOptions): APIPromise<unknown>;
108
+ /**
109
+ * Start a schema sync workflow. Returns 202 Accepted with sync_id.
70
110
  */
71
111
  sync(connectionID: string, options?: RequestOptions): APIPromise<ConnectionSyncResponse>;
112
+ /**
113
+ * Test and update warehouse credentials without modifying connection config.
114
+ */
115
+ updateCredentials(connectionID: string, body: ConnectionUpdateCredentialsParams, options?: RequestOptions): APIPromise<ConnectionUpdateCredentialsResponse>;
72
116
  }
73
117
  /**
74
118
  * Response model for a single connection.
75
119
  *
76
- * All data comes from the database (source of truth). JSON responses use 'id'
77
- * field; YAML responses transform to 'kater_id' via MultiFormatRoute.
120
+ * All data comes from the database (source of truth). For YAML-compatible output
121
+ * with 'kater_id', use the /schema endpoint instead.
78
122
  */
79
123
  export interface Connection {
80
124
  /**
@@ -104,19 +148,23 @@ export interface Connection {
104
148
  /**
105
149
  * Warehouse-specific configuration
106
150
  */
107
- warehouse_metadata: Connection.SnowflakeMetadata | Connection.PostgresMetadata | Connection.DatabricksMetadata | Connection.ClickHouseMetadata | Connection.MssqlMetadata;
151
+ warehouse_metadata: Connection.SnowflakeMetadata | Connection.PostgresqlMetadata | Connection.DatabricksMetadata | Connection.ClickhouseMetadata | Connection.MssqlMetadata;
108
152
  /**
109
153
  * Warehouse type (snowflake, postgresql, etc.)
110
154
  */
111
155
  warehouse_type: string;
112
156
  /**
113
- * Default timezone for the connection
157
+ * GitHub PR URL for approving the connection (None if already approved)
114
158
  */
115
- database_timezone?: string | null;
159
+ approval_pr_url?: string | null;
116
160
  /**
117
161
  * Connection description
118
162
  */
119
163
  description?: string | null;
164
+ /**
165
+ * True if this connection is awaiting PR approval
166
+ */
167
+ is_pending_approval?: boolean;
120
168
  /**
121
169
  * Human-readable label
122
170
  */
@@ -129,10 +177,6 @@ export interface Connection {
129
177
  * Timezone conversion mode (do_not_convert, convert_to_utc)
130
178
  */
131
179
  query_timezone_conversion?: string | null;
132
- /**
133
- * Sync identifier for schema sync
134
- */
135
- sync_id?: string | null;
136
180
  }
137
181
  export declare namespace Connection {
138
182
  /**
@@ -143,6 +187,10 @@ export declare namespace Connection {
143
187
  * Database ID
144
188
  */
145
189
  id: string;
190
+ /**
191
+ * Actual name of the database in the warehouse
192
+ */
193
+ database_object_name: string;
146
194
  /**
147
195
  * Database name
148
196
  */
@@ -173,6 +221,10 @@ export declare namespace Connection {
173
221
  * Schema ID
174
222
  */
175
223
  id: string;
224
+ /**
225
+ * Actual name of the schema in the warehouse
226
+ */
227
+ database_object_name: string;
176
228
  /**
177
229
  * Schema name
178
230
  */
@@ -187,9 +239,6 @@ export declare namespace Connection {
187
239
  label?: string | null;
188
240
  }
189
241
  }
190
- /**
191
- * Snowflake-specific warehouse metadata.
192
- */
193
242
  interface SnowflakeMetadata {
194
243
  /**
195
244
  * Authentication method
@@ -204,80 +253,53 @@ export declare namespace Connection {
204
253
  */
205
254
  snowflake_account_id: string;
206
255
  /**
207
- * Compute warehouse name
256
+ * Snowflake compute warehouse name
208
257
  */
209
258
  warehouse: string;
210
- /**
211
- * Warehouse type discriminator
212
- */
213
259
  warehouse_type: 'snowflake';
214
260
  }
215
- /**
216
- * PostgreSQL-specific warehouse metadata.
217
- */
218
- interface PostgresMetadata {
261
+ interface PostgresqlMetadata {
219
262
  /**
220
- * Database host
263
+ * Database host address
221
264
  */
222
265
  host: string;
223
266
  /**
224
- * Database port
267
+ * Database port (default: 5432)
225
268
  */
226
269
  port: number;
227
- /**
228
- * Warehouse type discriminator
229
- */
230
270
  warehouse_type: 'postgresql';
231
271
  }
232
- /**
233
- * Databricks-specific warehouse metadata.
234
- */
235
272
  interface DatabricksMetadata {
236
273
  /**
237
- * SQL warehouse HTTP path
274
+ * Databricks SQL warehouse HTTP path
238
275
  */
239
276
  http_path: string;
240
277
  /**
241
278
  * Databricks server hostname
242
279
  */
243
280
  server_hostname: string;
244
- /**
245
- * Warehouse type discriminator
246
- */
247
281
  warehouse_type: 'databricks';
248
282
  }
249
- /**
250
- * ClickHouse-specific warehouse metadata.
251
- */
252
- interface ClickHouseMetadata {
283
+ interface ClickhouseMetadata {
253
284
  /**
254
- * ClickHouse host
285
+ * ClickHouse host address
255
286
  */
256
287
  host: string;
257
288
  /**
258
- * ClickHouse port
289
+ * ClickHouse port (default: 8443)
259
290
  */
260
291
  port: number;
261
- /**
262
- * Warehouse type discriminator
263
- */
264
292
  warehouse_type: 'clickhouse';
265
293
  }
266
- /**
267
- * Microsoft SQL Server-specific warehouse metadata.
268
- */
269
294
  interface MssqlMetadata {
270
295
  /**
271
- * SQL Server host
296
+ * SQL Server host address
272
297
  */
273
298
  host: string;
274
299
  /**
275
- * SQL Server port
300
+ * SQL Server port (default: 1433)
276
301
  */
277
302
  port: number;
278
- /**
279
- * Warehouse type discriminator
280
- */
281
303
  warehouse_type: 'mssql';
282
304
  }
283
305
  }
@@ -286,7 +308,7 @@ export declare namespace Connection {
286
308
  */
287
309
  export interface DatabaseConfig {
288
310
  /**
289
- * Database name
311
+ * Database name (also used as the warehouse object name)
290
312
  */
291
313
  name: string;
292
314
  /**
@@ -312,7 +334,7 @@ export declare namespace DatabaseConfig {
312
334
  */
313
335
  interface Schema {
314
336
  /**
315
- * Schema name
337
+ * Schema name (also used as the warehouse object name)
316
338
  */
317
339
  name: string;
318
340
  /**
@@ -326,6 +348,225 @@ export declare namespace DatabaseConfig {
326
348
  }
327
349
  }
328
350
  export type ConnectionListResponse = Array<Connection>;
351
+ /**
352
+ * Response for sync status endpoint.
353
+ *
354
+ * Contains full sync state including progress and results.
355
+ */
356
+ export interface ConnectionApproveSyncResponse {
357
+ /**
358
+ * Connection ID
359
+ */
360
+ connection_id: string;
361
+ /**
362
+ * Sync creation timestamp
363
+ */
364
+ created_at: string;
365
+ /**
366
+ * Workflow status: queued, running, succeeded, failed, canceled
367
+ */
368
+ run_status: string;
369
+ /**
370
+ * Schema sync record ID
371
+ */
372
+ sync_id: string;
373
+ /**
374
+ * Workflow completion timestamp
375
+ */
376
+ completed_at?: string | null;
377
+ /**
378
+ * Current workflow step
379
+ */
380
+ current_step?: string | null;
381
+ /**
382
+ * Error message if failed
383
+ */
384
+ error_message?: string | null;
385
+ /**
386
+ * Sync event history
387
+ */
388
+ events?: Array<ConnectionApproveSyncResponse.Event>;
389
+ /**
390
+ * Hatchet workflow run ID
391
+ */
392
+ hatchet_run_id?: string | null;
393
+ /**
394
+ * GitHub PR number
395
+ */
396
+ pr_number?: number | null;
397
+ /**
398
+ * PR status: open, merged, closed
399
+ */
400
+ pr_status?: string | null;
401
+ /**
402
+ * GitHub PR URL
403
+ */
404
+ pr_url?: string | null;
405
+ /**
406
+ * Workflow start timestamp
407
+ */
408
+ started_at?: string | null;
409
+ /**
410
+ * Number of views deleted
411
+ */
412
+ views_deleted?: number | null;
413
+ /**
414
+ * Number of new views added
415
+ */
416
+ views_inserted?: number | null;
417
+ /**
418
+ * Number of views renamed (subset of updated)
419
+ */
420
+ views_renamed?: number | null;
421
+ /**
422
+ * Number of views updated (dimension changes or renames)
423
+ */
424
+ views_updated?: number | null;
425
+ }
426
+ export declare namespace ConnectionApproveSyncResponse {
427
+ /**
428
+ * Response model for a single sync event.
429
+ */
430
+ interface Event {
431
+ /**
432
+ * Event ID
433
+ */
434
+ id: string;
435
+ /**
436
+ * Event timestamp
437
+ */
438
+ created_at: string;
439
+ /**
440
+ * Event type: step_started, step_completed, progress, warning, error
441
+ */
442
+ event_type: string;
443
+ /**
444
+ * Human-readable event message
445
+ */
446
+ message: string;
447
+ /**
448
+ * Additional event data
449
+ */
450
+ metadata?: {
451
+ [key: string]: unknown;
452
+ };
453
+ /**
454
+ * Step name if applicable
455
+ */
456
+ step_name?: string | null;
457
+ }
458
+ }
459
+ export type ConnectionListSyncsResponse = Array<ConnectionListSyncsResponse.ConnectionListSyncsResponseItem>;
460
+ export declare namespace ConnectionListSyncsResponse {
461
+ /**
462
+ * Response for sync status endpoint.
463
+ *
464
+ * Contains full sync state including progress and results.
465
+ */
466
+ interface ConnectionListSyncsResponseItem {
467
+ /**
468
+ * Connection ID
469
+ */
470
+ connection_id: string;
471
+ /**
472
+ * Sync creation timestamp
473
+ */
474
+ created_at: string;
475
+ /**
476
+ * Workflow status: queued, running, succeeded, failed, canceled
477
+ */
478
+ run_status: string;
479
+ /**
480
+ * Schema sync record ID
481
+ */
482
+ sync_id: string;
483
+ /**
484
+ * Workflow completion timestamp
485
+ */
486
+ completed_at?: string | null;
487
+ /**
488
+ * Current workflow step
489
+ */
490
+ current_step?: string | null;
491
+ /**
492
+ * Error message if failed
493
+ */
494
+ error_message?: string | null;
495
+ /**
496
+ * Sync event history
497
+ */
498
+ events?: Array<ConnectionListSyncsResponseItem.Event>;
499
+ /**
500
+ * Hatchet workflow run ID
501
+ */
502
+ hatchet_run_id?: string | null;
503
+ /**
504
+ * GitHub PR number
505
+ */
506
+ pr_number?: number | null;
507
+ /**
508
+ * PR status: open, merged, closed
509
+ */
510
+ pr_status?: string | null;
511
+ /**
512
+ * GitHub PR URL
513
+ */
514
+ pr_url?: string | null;
515
+ /**
516
+ * Workflow start timestamp
517
+ */
518
+ started_at?: string | null;
519
+ /**
520
+ * Number of views deleted
521
+ */
522
+ views_deleted?: number | null;
523
+ /**
524
+ * Number of new views added
525
+ */
526
+ views_inserted?: number | null;
527
+ /**
528
+ * Number of views renamed (subset of updated)
529
+ */
530
+ views_renamed?: number | null;
531
+ /**
532
+ * Number of views updated (dimension changes or renames)
533
+ */
534
+ views_updated?: number | null;
535
+ }
536
+ namespace ConnectionListSyncsResponseItem {
537
+ /**
538
+ * Response model for a single sync event.
539
+ */
540
+ interface Event {
541
+ /**
542
+ * Event ID
543
+ */
544
+ id: string;
545
+ /**
546
+ * Event timestamp
547
+ */
548
+ created_at: string;
549
+ /**
550
+ * Event type: step_started, step_completed, progress, warning, error
551
+ */
552
+ event_type: string;
553
+ /**
554
+ * Human-readable event message
555
+ */
556
+ message: string;
557
+ /**
558
+ * Additional event data
559
+ */
560
+ metadata?: {
561
+ [key: string]: unknown;
562
+ };
563
+ /**
564
+ * Step name if applicable
565
+ */
566
+ step_name?: string | null;
567
+ }
568
+ }
569
+ }
329
570
  /**
330
571
  * PostgreSQL credential response.
331
572
  */
@@ -502,28 +743,331 @@ export declare namespace ConnectionRetrieveCredentialResponse {
502
743
  }
503
744
  }
504
745
  /**
505
- * Response for syncing views.
746
+ * Schema for Kater connection configuration files
747
+ */
748
+ export interface ConnectionRetrieveSchemaResponse {
749
+ /**
750
+ * Unique identifier for the connection
751
+ */
752
+ kater_id: string;
753
+ /**
754
+ * Name of the connection
755
+ */
756
+ name: string;
757
+ /**
758
+ * Warehouse-specific configuration (non-sensitive)
759
+ */
760
+ warehouse_metadata: ConnectionRetrieveSchemaResponse.SnowflakeMetadata | ConnectionRetrieveSchemaResponse.PostgresqlMetadata | ConnectionRetrieveSchemaResponse.DatabricksMetadata | ConnectionRetrieveSchemaResponse.ClickhouseMetadata | ConnectionRetrieveSchemaResponse.MssqlMetadata;
761
+ /**
762
+ * Additional context for AI processing
763
+ */
764
+ ai_context?: string | null;
765
+ /**
766
+ * Custom properties
767
+ */
768
+ custom_properties?: {
769
+ [key: string]: unknown;
770
+ } | null;
771
+ /**
772
+ * List of databases in this connection
773
+ */
774
+ databases?: Array<ConnectionRetrieveSchemaResponse.Database> | null;
775
+ /**
776
+ * Description of the connection
777
+ */
778
+ description?: string | null;
779
+ /**
780
+ * Human-readable label for the connection
781
+ */
782
+ label?: string | null;
783
+ /**
784
+ * Query timeout in seconds
785
+ */
786
+ query_timeout?: number;
787
+ /**
788
+ * Timezone conversion mode for queries
789
+ */
790
+ query_timezone_conversion?: 'do_not_convert' | 'convert_to_utc';
791
+ }
792
+ export declare namespace ConnectionRetrieveSchemaResponse {
793
+ interface SnowflakeMetadata {
794
+ /**
795
+ * Authentication method
796
+ */
797
+ auth_method: 'username_password' | 'key_pair';
798
+ /**
799
+ * Snowflake role
800
+ */
801
+ role: string;
802
+ /**
803
+ * Snowflake account identifier
804
+ */
805
+ snowflake_account_id: string;
806
+ /**
807
+ * Snowflake compute warehouse name
808
+ */
809
+ warehouse: string;
810
+ warehouse_type: 'snowflake';
811
+ }
812
+ interface PostgresqlMetadata {
813
+ /**
814
+ * Database host address
815
+ */
816
+ host: string;
817
+ /**
818
+ * Database port (default: 5432)
819
+ */
820
+ port: number;
821
+ warehouse_type: 'postgresql';
822
+ }
823
+ interface DatabricksMetadata {
824
+ /**
825
+ * Databricks SQL warehouse HTTP path
826
+ */
827
+ http_path: string;
828
+ /**
829
+ * Databricks server hostname
830
+ */
831
+ server_hostname: string;
832
+ warehouse_type: 'databricks';
833
+ }
834
+ interface ClickhouseMetadata {
835
+ /**
836
+ * ClickHouse host address
837
+ */
838
+ host: string;
839
+ /**
840
+ * ClickHouse port (default: 8443)
841
+ */
842
+ port: number;
843
+ warehouse_type: 'clickhouse';
844
+ }
845
+ interface MssqlMetadata {
846
+ /**
847
+ * SQL Server host address
848
+ */
849
+ host: string;
850
+ /**
851
+ * SQL Server port (default: 1433)
852
+ */
853
+ port: number;
854
+ warehouse_type: 'mssql';
855
+ }
856
+ interface Database {
857
+ /**
858
+ * The actual name of the database object in the warehouse
859
+ */
860
+ database_object_name: string;
861
+ /**
862
+ * Unique identifier for the database
863
+ */
864
+ kater_id: string;
865
+ /**
866
+ * Name of the database
867
+ */
868
+ name: string;
869
+ /**
870
+ * Additional context for AI processing
871
+ */
872
+ ai_context?: string | null;
873
+ /**
874
+ * Custom properties
875
+ */
876
+ custom_properties?: {
877
+ [key: string]: unknown;
878
+ } | null;
879
+ /**
880
+ * Description of the database
881
+ */
882
+ description?: string | null;
883
+ /**
884
+ * Human-readable label for the database
885
+ */
886
+ label?: string | null;
887
+ /**
888
+ * List of schemas in this database
889
+ */
890
+ schemas?: Array<Database.Schema> | null;
891
+ /**
892
+ * Timezone for the database
893
+ */
894
+ timezone?: string | null;
895
+ }
896
+ namespace Database {
897
+ interface Schema {
898
+ /**
899
+ * The actual name of the schema object in the warehouse
900
+ */
901
+ database_object_name: string;
902
+ /**
903
+ * Unique identifier for the schema
904
+ */
905
+ kater_id: string;
906
+ /**
907
+ * Name of the schema
908
+ */
909
+ name: string;
910
+ /**
911
+ * Additional context for AI processing
912
+ */
913
+ ai_context?: string | null;
914
+ /**
915
+ * Custom properties
916
+ */
917
+ custom_properties?: {
918
+ [key: string]: unknown;
919
+ } | null;
920
+ /**
921
+ * Description of the schema
922
+ */
923
+ description?: string | null;
924
+ /**
925
+ * Human-readable label for the schema
926
+ */
927
+ label?: string | null;
928
+ }
929
+ }
930
+ }
931
+ /**
932
+ * Response for sync status endpoint.
506
933
  *
507
- * Returned after successfully creating a PR with merged ViewSchema files, or
508
- * indicating that all views are already up to date.
934
+ * Contains full sync state including progress and results.
509
935
  */
510
- export interface ConnectionSyncResponse {
936
+ export interface ConnectionRetrieveSyncStatusResponse {
511
937
  /**
512
- * Number of views in the PR
938
+ * Connection ID
513
939
  */
514
- views_updated: number;
940
+ connection_id: string;
941
+ /**
942
+ * Sync creation timestamp
943
+ */
944
+ created_at: string;
515
945
  /**
516
- * Status message
946
+ * Workflow status: queued, running, succeeded, failed, canceled
517
947
  */
518
- message?: string | null;
948
+ run_status: string;
949
+ /**
950
+ * Schema sync record ID
951
+ */
952
+ sync_id: string;
953
+ /**
954
+ * Workflow completion timestamp
955
+ */
956
+ completed_at?: string | null;
957
+ /**
958
+ * Current workflow step
959
+ */
960
+ current_step?: string | null;
961
+ /**
962
+ * Error message if failed
963
+ */
964
+ error_message?: string | null;
965
+ /**
966
+ * Sync event history
967
+ */
968
+ events?: Array<ConnectionRetrieveSyncStatusResponse.Event>;
969
+ /**
970
+ * Hatchet workflow run ID
971
+ */
972
+ hatchet_run_id?: string | null;
519
973
  /**
520
974
  * GitHub PR number
521
975
  */
522
976
  pr_number?: number | null;
977
+ /**
978
+ * PR status: open, merged, closed
979
+ */
980
+ pr_status?: string | null;
523
981
  /**
524
982
  * GitHub PR URL
525
983
  */
526
984
  pr_url?: string | null;
985
+ /**
986
+ * Workflow start timestamp
987
+ */
988
+ started_at?: string | null;
989
+ /**
990
+ * Number of views deleted
991
+ */
992
+ views_deleted?: number | null;
993
+ /**
994
+ * Number of new views added
995
+ */
996
+ views_inserted?: number | null;
997
+ /**
998
+ * Number of views renamed (subset of updated)
999
+ */
1000
+ views_renamed?: number | null;
1001
+ /**
1002
+ * Number of views updated (dimension changes or renames)
1003
+ */
1004
+ views_updated?: number | null;
1005
+ }
1006
+ export declare namespace ConnectionRetrieveSyncStatusResponse {
1007
+ /**
1008
+ * Response model for a single sync event.
1009
+ */
1010
+ interface Event {
1011
+ /**
1012
+ * Event ID
1013
+ */
1014
+ id: string;
1015
+ /**
1016
+ * Event timestamp
1017
+ */
1018
+ created_at: string;
1019
+ /**
1020
+ * Event type: step_started, step_completed, progress, warning, error
1021
+ */
1022
+ event_type: string;
1023
+ /**
1024
+ * Human-readable event message
1025
+ */
1026
+ message: string;
1027
+ /**
1028
+ * Additional event data
1029
+ */
1030
+ metadata?: {
1031
+ [key: string]: unknown;
1032
+ };
1033
+ /**
1034
+ * Step name if applicable
1035
+ */
1036
+ step_name?: string | null;
1037
+ }
1038
+ }
1039
+ export type ConnectionStreamSyncProgressResponse = unknown;
1040
+ /**
1041
+ * Response for starting a schema sync.
1042
+ *
1043
+ * Returned with 202 Accepted when sync workflow is successfully queued.
1044
+ */
1045
+ export interface ConnectionSyncResponse {
1046
+ /**
1047
+ * Schema sync record ID
1048
+ */
1049
+ sync_id: string;
1050
+ /**
1051
+ * Hatchet workflow run ID
1052
+ */
1053
+ hatchet_run_id?: string | null;
1054
+ /**
1055
+ * Current sync status
1056
+ */
1057
+ status?: string;
1058
+ }
1059
+ /**
1060
+ * Response for credential update.
1061
+ */
1062
+ export interface ConnectionUpdateCredentialsResponse {
1063
+ /**
1064
+ * Connection ID
1065
+ */
1066
+ connection_id: string;
1067
+ /**
1068
+ * Whether the credential update was successful
1069
+ */
1070
+ success: boolean;
527
1071
  }
528
1072
  export type ConnectionCreateParams = ConnectionCreateParams.PostgresConnectionConfig | ConnectionCreateParams.SnowflakeConnectionConfig | ConnectionCreateParams.DatabricksConnectionConfig | ConnectionCreateParams.ClickHouseConnectionConfig | ConnectionCreateParams.MssqlConnectionConfig;
529
1073
  export declare namespace ConnectionCreateParams {
@@ -552,10 +1096,6 @@ export declare namespace ConnectionCreateParams {
552
1096
  * Warehouse type
553
1097
  */
554
1098
  warehouse_type: 'postgresql';
555
- /**
556
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
557
- */
558
- database_timezone?: string | null;
559
1099
  /**
560
1100
  * Description of the connection
561
1101
  */
@@ -610,10 +1150,6 @@ export declare namespace ConnectionCreateParams {
610
1150
  * Warehouse type
611
1151
  */
612
1152
  warehouse_type: 'snowflake';
613
- /**
614
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
615
- */
616
- database_timezone?: string | null;
617
1153
  /**
618
1154
  * Description of the connection
619
1155
  */
@@ -688,10 +1224,6 @@ export declare namespace ConnectionCreateParams {
688
1224
  * Warehouse type
689
1225
  */
690
1226
  warehouse_type: 'databricks';
691
- /**
692
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
693
- */
694
- database_timezone?: string | null;
695
1227
  /**
696
1228
  * Description of the connection
697
1229
  */
@@ -734,10 +1266,6 @@ export declare namespace ConnectionCreateParams {
734
1266
  * Warehouse type
735
1267
  */
736
1268
  warehouse_type: 'clickhouse';
737
- /**
738
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
739
- */
740
- database_timezone?: string | null;
741
1269
  /**
742
1270
  * Description of the connection
743
1271
  */
@@ -784,10 +1312,6 @@ export declare namespace ConnectionCreateParams {
784
1312
  * Warehouse type
785
1313
  */
786
1314
  warehouse_type: 'mssql';
787
- /**
788
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
789
- */
790
- database_timezone?: string | null;
791
1315
  /**
792
1316
  * Description of the connection
793
1317
  */
@@ -824,8 +1348,123 @@ export interface ConnectionUpdateParams {
824
1348
  */
825
1349
  name?: string | null;
826
1350
  }
1351
+ export interface ConnectionListParams {
1352
+ status?: 'approved' | 'pending' | 'all';
1353
+ }
1354
+ export interface ConnectionApproveSyncParams {
1355
+ connection_id: string;
1356
+ }
1357
+ export interface ConnectionListSyncsParams {
1358
+ limit?: number;
1359
+ offset?: number;
1360
+ }
1361
+ export interface ConnectionRetrieveSyncStatusParams {
1362
+ connection_id: string;
1363
+ }
1364
+ export interface ConnectionStreamSyncProgressParams {
1365
+ connection_id: string;
1366
+ }
1367
+ export type ConnectionUpdateCredentialsParams = ConnectionUpdateCredentialsParams.PostgreSqlCredentialUpdate | ConnectionUpdateCredentialsParams.SnowflakeCredentialUpdate | ConnectionUpdateCredentialsParams.DatabricksCredentialUpdate | ConnectionUpdateCredentialsParams.ClickHouseCredentialUpdate | ConnectionUpdateCredentialsParams.MssqlCredentialUpdate;
1368
+ export declare namespace ConnectionUpdateCredentialsParams {
1369
+ interface PostgreSqlCredentialUpdate {
1370
+ /**
1371
+ * Database password
1372
+ */
1373
+ password: string;
1374
+ /**
1375
+ * Database username
1376
+ */
1377
+ username: string;
1378
+ /**
1379
+ * Warehouse type
1380
+ */
1381
+ warehouse_type: 'postgresql';
1382
+ }
1383
+ interface SnowflakeCredentialUpdate {
1384
+ /**
1385
+ * Authentication credentials
1386
+ */
1387
+ auth: SnowflakeCredentialUpdate.SnowflakePasswordCredentialAuth | SnowflakeCredentialUpdate.SnowflakePrivateKeyCredentialAuth;
1388
+ /**
1389
+ * Snowflake username
1390
+ */
1391
+ username: string;
1392
+ /**
1393
+ * Warehouse type
1394
+ */
1395
+ warehouse_type: 'snowflake';
1396
+ }
1397
+ namespace SnowflakeCredentialUpdate {
1398
+ /**
1399
+ * Snowflake password auth for credential update.
1400
+ */
1401
+ interface SnowflakePasswordCredentialAuth {
1402
+ /**
1403
+ * Authentication type
1404
+ */
1405
+ auth_type: 'password';
1406
+ /**
1407
+ * Snowflake password
1408
+ */
1409
+ password: string;
1410
+ }
1411
+ /**
1412
+ * Snowflake private key auth for credential update.
1413
+ */
1414
+ interface SnowflakePrivateKeyCredentialAuth {
1415
+ /**
1416
+ * Authentication type
1417
+ */
1418
+ auth_type: 'private_key';
1419
+ /**
1420
+ * PEM-encoded private key
1421
+ */
1422
+ private_key: string;
1423
+ }
1424
+ }
1425
+ interface DatabricksCredentialUpdate {
1426
+ /**
1427
+ * Databricks personal access token
1428
+ */
1429
+ access_token: string;
1430
+ /**
1431
+ * Warehouse type
1432
+ */
1433
+ warehouse_type: 'databricks';
1434
+ }
1435
+ interface ClickHouseCredentialUpdate {
1436
+ /**
1437
+ * ClickHouse password
1438
+ */
1439
+ password: string;
1440
+ /**
1441
+ * ClickHouse username
1442
+ */
1443
+ username: string;
1444
+ /**
1445
+ * Warehouse type
1446
+ */
1447
+ warehouse_type: 'clickhouse';
1448
+ }
1449
+ interface MssqlCredentialUpdate {
1450
+ /**
1451
+ * SQL Server password
1452
+ */
1453
+ password: string;
1454
+ /**
1455
+ * SQL Server username
1456
+ */
1457
+ username: string;
1458
+ /**
1459
+ * Warehouse type
1460
+ */
1461
+ warehouse_type: 'mssql';
1462
+ }
1463
+ }
827
1464
  export declare namespace Connections {
828
- export { type Connection as Connection, type DatabaseConfig as DatabaseConfig, type ConnectionListResponse as ConnectionListResponse, type ConnectionRetrieveCredentialResponse as ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse as ConnectionSyncResponse, type ConnectionCreateParams as ConnectionCreateParams, type ConnectionUpdateParams as ConnectionUpdateParams, };
829
- export { Databases as Databases, type DatabaseUpdateResponse as DatabaseUpdateResponse, type DatabaseUpdateSchemaResponse as DatabaseUpdateSchemaResponse, type DatabaseUpdateParams as DatabaseUpdateParams, type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams, type DatabaseUpdateSchemaParams as DatabaseUpdateSchemaParams, };
1465
+ export { type Connection as Connection, type DatabaseConfig as DatabaseConfig, type ConnectionListResponse as ConnectionListResponse, type ConnectionApproveSyncResponse as ConnectionApproveSyncResponse, type ConnectionListSyncsResponse as ConnectionListSyncsResponse, type ConnectionRetrieveCredentialResponse as ConnectionRetrieveCredentialResponse, type ConnectionRetrieveSchemaResponse as ConnectionRetrieveSchemaResponse, type ConnectionRetrieveSyncStatusResponse as ConnectionRetrieveSyncStatusResponse, type ConnectionStreamSyncProgressResponse as ConnectionStreamSyncProgressResponse, type ConnectionSyncResponse as ConnectionSyncResponse, type ConnectionUpdateCredentialsResponse as ConnectionUpdateCredentialsResponse, type ConnectionCreateParams as ConnectionCreateParams, type ConnectionUpdateParams as ConnectionUpdateParams, type ConnectionListParams as ConnectionListParams, type ConnectionApproveSyncParams as ConnectionApproveSyncParams, type ConnectionListSyncsParams as ConnectionListSyncsParams, type ConnectionRetrieveSyncStatusParams as ConnectionRetrieveSyncStatusParams, type ConnectionStreamSyncProgressParams as ConnectionStreamSyncProgressParams, type ConnectionUpdateCredentialsParams as ConnectionUpdateCredentialsParams, };
1466
+ export { Databases as Databases, type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams };
1467
+ export { Views as Views, type ViewRetrieveResponse as ViewRetrieveResponse, type ViewListResponse as ViewListResponse, type ViewRetrieveParams as ViewRetrieveParams, type ViewListParams as ViewListParams, };
1468
+ export { Yaml as Yaml, type YamlRetrieveResponse as YamlRetrieveResponse, type YamlCommitResponse as YamlCommitResponse, type YamlCommitParams as YamlCommitParams, };
830
1469
  }
831
1470
  //# sourceMappingURL=connections.d.mts.map