@katerai/sdk 0.5.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 (107) hide show
  1. package/CHANGELOG.md +28 -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 +725 -102
  18. package/resources/v1/connections/connections.d.mts.map +1 -1
  19. package/resources/v1/connections/connections.d.ts +725 -102
  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 +77 -14
  24. package/resources/v1/connections/connections.mjs.map +1 -1
  25. package/resources/v1/connections/index.d.mts +3 -1
  26. package/resources/v1/connections/index.d.mts.map +1 -1
  27. package/resources/v1/connections/index.d.ts +3 -1
  28. package/resources/v1/connections/index.d.ts.map +1 -1
  29. package/resources/v1/connections/index.js +5 -1
  30. package/resources/v1/connections/index.js.map +1 -1
  31. package/resources/v1/connections/index.mjs +2 -0
  32. package/resources/v1/connections/index.mjs.map +1 -1
  33. package/resources/v1/connections/views.d.mts +77 -0
  34. package/resources/v1/connections/views.d.mts.map +1 -0
  35. package/resources/v1/connections/views.d.ts +77 -0
  36. package/resources/v1/connections/views.d.ts.map +1 -0
  37. package/resources/v1/connections/views.js +24 -0
  38. package/resources/v1/connections/views.js.map +1 -0
  39. package/resources/v1/connections/views.mjs +20 -0
  40. package/resources/v1/connections/views.mjs.map +1 -0
  41. package/resources/v1/connections/yaml.d.mts +57 -0
  42. package/resources/v1/connections/yaml.d.mts.map +1 -0
  43. package/resources/v1/connections/yaml.d.ts +57 -0
  44. package/resources/v1/connections/yaml.d.ts.map +1 -0
  45. package/resources/v1/connections/yaml.js +22 -0
  46. package/resources/v1/connections/yaml.js.map +1 -0
  47. package/resources/v1/connections/yaml.mjs +18 -0
  48. package/resources/v1/connections/yaml.mjs.map +1 -0
  49. package/resources/v1/github/github.d.mts +4 -0
  50. package/resources/v1/github/github.d.mts.map +1 -1
  51. package/resources/v1/github/github.d.ts +4 -0
  52. package/resources/v1/github/github.d.ts.map +1 -1
  53. package/resources/v1/github/github.js.map +1 -1
  54. package/resources/v1/github/github.mjs.map +1 -1
  55. package/resources/v1/index.d.mts +2 -2
  56. package/resources/v1/index.d.mts.map +1 -1
  57. package/resources/v1/index.d.ts +2 -2
  58. package/resources/v1/index.d.ts.map +1 -1
  59. package/resources/v1/index.js.map +1 -1
  60. package/resources/v1/index.mjs.map +1 -1
  61. package/resources/v1/tenants/groups.d.mts +43 -0
  62. package/resources/v1/tenants/groups.d.mts.map +1 -0
  63. package/resources/v1/tenants/groups.d.ts +43 -0
  64. package/resources/v1/tenants/groups.d.ts.map +1 -0
  65. package/resources/v1/tenants/groups.js +20 -0
  66. package/resources/v1/tenants/groups.js.map +1 -0
  67. package/resources/v1/tenants/groups.mjs +16 -0
  68. package/resources/v1/tenants/groups.mjs.map +1 -0
  69. package/resources/v1/tenants/index.d.mts +2 -1
  70. package/resources/v1/tenants/index.d.mts.map +1 -1
  71. package/resources/v1/tenants/index.d.ts +2 -1
  72. package/resources/v1/tenants/index.d.ts.map +1 -1
  73. package/resources/v1/tenants/index.js +3 -1
  74. package/resources/v1/tenants/index.js.map +1 -1
  75. package/resources/v1/tenants/index.mjs +1 -0
  76. package/resources/v1/tenants/index.mjs.map +1 -1
  77. package/resources/v1/tenants/tenants.d.mts +44 -1
  78. package/resources/v1/tenants/tenants.d.mts.map +1 -1
  79. package/resources/v1/tenants/tenants.d.ts +44 -1
  80. package/resources/v1/tenants/tenants.d.ts.map +1 -1
  81. package/resources/v1/tenants/tenants.js +16 -0
  82. package/resources/v1/tenants/tenants.js.map +1 -1
  83. package/resources/v1/tenants/tenants.mjs +16 -0
  84. package/resources/v1/tenants/tenants.mjs.map +1 -1
  85. package/resources/v1/v1.d.mts +4 -4
  86. package/resources/v1/v1.d.mts.map +1 -1
  87. package/resources/v1/v1.d.ts +4 -4
  88. package/resources/v1/v1.d.ts.map +1 -1
  89. package/resources/v1/v1.js.map +1 -1
  90. package/resources/v1/v1.mjs.map +1 -1
  91. package/src/client.ts +9 -2
  92. package/src/internal/parse.ts +6 -0
  93. package/src/resources/v1/connections/connections.ts +948 -115
  94. package/src/resources/v1/connections/index.ts +20 -0
  95. package/src/resources/v1/connections/views.ts +112 -0
  96. package/src/resources/v1/connections/yaml.ts +81 -0
  97. package/src/resources/v1/github/github.ts +8 -0
  98. package/src/resources/v1/index.ts +13 -0
  99. package/src/resources/v1/tenants/groups.ts +52 -0
  100. package/src/resources/v1/tenants/index.ts +2 -0
  101. package/src/resources/v1/tenants/tenants.ts +54 -0
  102. package/src/resources/v1/v1.ts +26 -0
  103. package/src/version.ts +1 -1
  104. package/version.d.mts +1 -1
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
  107. 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
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
  /**
@@ -195,9 +239,6 @@ export declare namespace Connection {
195
239
  label?: string | null;
196
240
  }
197
241
  }
198
- /**
199
- * Snowflake-specific warehouse metadata.
200
- */
201
242
  interface SnowflakeMetadata {
202
243
  /**
203
244
  * Authentication method
@@ -212,80 +253,53 @@ export declare namespace Connection {
212
253
  */
213
254
  snowflake_account_id: string;
214
255
  /**
215
- * Compute warehouse name
256
+ * Snowflake compute warehouse name
216
257
  */
217
258
  warehouse: string;
218
- /**
219
- * Warehouse type discriminator
220
- */
221
259
  warehouse_type: 'snowflake';
222
260
  }
223
- /**
224
- * PostgreSQL-specific warehouse metadata.
225
- */
226
- interface PostgresMetadata {
261
+ interface PostgresqlMetadata {
227
262
  /**
228
- * Database host
263
+ * Database host address
229
264
  */
230
265
  host: string;
231
266
  /**
232
- * Database port
267
+ * Database port (default: 5432)
233
268
  */
234
269
  port: number;
235
- /**
236
- * Warehouse type discriminator
237
- */
238
270
  warehouse_type: 'postgresql';
239
271
  }
240
- /**
241
- * Databricks-specific warehouse metadata.
242
- */
243
272
  interface DatabricksMetadata {
244
273
  /**
245
- * SQL warehouse HTTP path
274
+ * Databricks SQL warehouse HTTP path
246
275
  */
247
276
  http_path: string;
248
277
  /**
249
278
  * Databricks server hostname
250
279
  */
251
280
  server_hostname: string;
252
- /**
253
- * Warehouse type discriminator
254
- */
255
281
  warehouse_type: 'databricks';
256
282
  }
257
- /**
258
- * ClickHouse-specific warehouse metadata.
259
- */
260
- interface ClickHouseMetadata {
283
+ interface ClickhouseMetadata {
261
284
  /**
262
- * ClickHouse host
285
+ * ClickHouse host address
263
286
  */
264
287
  host: string;
265
288
  /**
266
- * ClickHouse port
289
+ * ClickHouse port (default: 8443)
267
290
  */
268
291
  port: number;
269
- /**
270
- * Warehouse type discriminator
271
- */
272
292
  warehouse_type: 'clickhouse';
273
293
  }
274
- /**
275
- * Microsoft SQL Server-specific warehouse metadata.
276
- */
277
294
  interface MssqlMetadata {
278
295
  /**
279
- * SQL Server host
296
+ * SQL Server host address
280
297
  */
281
298
  host: string;
282
299
  /**
283
- * SQL Server port
300
+ * SQL Server port (default: 1433)
284
301
  */
285
302
  port: number;
286
- /**
287
- * Warehouse type discriminator
288
- */
289
303
  warehouse_type: 'mssql';
290
304
  }
291
305
  }
@@ -294,9 +308,9 @@ export declare namespace Connection {
294
308
  */
295
309
  export interface DatabaseConfig {
296
310
  /**
297
- * The actual name of the database object in the warehouse
311
+ * Database name (also used as the warehouse object name)
298
312
  */
299
- database_object_name: string;
313
+ name: string;
300
314
  /**
301
315
  * Description of the database
302
316
  */
@@ -305,10 +319,6 @@ export interface DatabaseConfig {
305
319
  * Human-readable label for the database (defaults to name if not set)
306
320
  */
307
321
  label?: string | null;
308
- /**
309
- * Database name (defaults to database_object_name if not set)
310
- */
311
- name?: string | null;
312
322
  /**
313
323
  * Schema configurations to include (empty = discover all schemas)
314
324
  */
@@ -324,9 +334,9 @@ export declare namespace DatabaseConfig {
324
334
  */
325
335
  interface Schema {
326
336
  /**
327
- * The actual name of the schema object in the warehouse
337
+ * Schema name (also used as the warehouse object name)
328
338
  */
329
- database_object_name: string;
339
+ name: string;
330
340
  /**
331
341
  * Description of the schema
332
342
  */
@@ -335,13 +345,228 @@ export declare namespace DatabaseConfig {
335
345
  * Human-readable label for the schema (defaults to name if not set)
336
346
  */
337
347
  label?: string | null;
348
+ }
349
+ }
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
+ };
338
453
  /**
339
- * Schema name (defaults to database_object_name if not set)
454
+ * Step name if applicable
340
455
  */
341
- name?: string | null;
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
+ }
342
568
  }
343
569
  }
344
- export type ConnectionListResponse = Array<Connection>;
345
570
  /**
346
571
  * PostgreSQL credential response.
347
572
  */
@@ -518,28 +743,331 @@ export declare namespace ConnectionRetrieveCredentialResponse {
518
743
  }
519
744
  }
520
745
  /**
521
- * 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.
522
933
  *
523
- * Returned after successfully creating a PR with merged ViewSchema files, or
524
- * indicating that all views are already up to date.
934
+ * Contains full sync state including progress and results.
525
935
  */
526
- export interface ConnectionSyncResponse {
936
+ export interface ConnectionRetrieveSyncStatusResponse {
527
937
  /**
528
- * Number of views in the PR
938
+ * Connection ID
529
939
  */
530
- views_updated: number;
940
+ connection_id: string;
531
941
  /**
532
- * Status message
942
+ * Sync creation timestamp
533
943
  */
534
- message?: string | null;
944
+ created_at: string;
945
+ /**
946
+ * Workflow status: queued, running, succeeded, failed, canceled
947
+ */
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;
535
973
  /**
536
974
  * GitHub PR number
537
975
  */
538
976
  pr_number?: number | null;
977
+ /**
978
+ * PR status: open, merged, closed
979
+ */
980
+ pr_status?: string | null;
539
981
  /**
540
982
  * GitHub PR URL
541
983
  */
542
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;
543
1071
  }
544
1072
  export type ConnectionCreateParams = ConnectionCreateParams.PostgresConnectionConfig | ConnectionCreateParams.SnowflakeConnectionConfig | ConnectionCreateParams.DatabricksConnectionConfig | ConnectionCreateParams.ClickHouseConnectionConfig | ConnectionCreateParams.MssqlConnectionConfig;
545
1073
  export declare namespace ConnectionCreateParams {
@@ -568,10 +1096,6 @@ export declare namespace ConnectionCreateParams {
568
1096
  * Warehouse type
569
1097
  */
570
1098
  warehouse_type: 'postgresql';
571
- /**
572
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
573
- */
574
- database_timezone?: string | null;
575
1099
  /**
576
1100
  * Description of the connection
577
1101
  */
@@ -626,10 +1150,6 @@ export declare namespace ConnectionCreateParams {
626
1150
  * Warehouse type
627
1151
  */
628
1152
  warehouse_type: 'snowflake';
629
- /**
630
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
631
- */
632
- database_timezone?: string | null;
633
1153
  /**
634
1154
  * Description of the connection
635
1155
  */
@@ -704,10 +1224,6 @@ export declare namespace ConnectionCreateParams {
704
1224
  * Warehouse type
705
1225
  */
706
1226
  warehouse_type: 'databricks';
707
- /**
708
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
709
- */
710
- database_timezone?: string | null;
711
1227
  /**
712
1228
  * Description of the connection
713
1229
  */
@@ -750,10 +1266,6 @@ export declare namespace ConnectionCreateParams {
750
1266
  * Warehouse type
751
1267
  */
752
1268
  warehouse_type: 'clickhouse';
753
- /**
754
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
755
- */
756
- database_timezone?: string | null;
757
1269
  /**
758
1270
  * Description of the connection
759
1271
  */
@@ -800,10 +1312,6 @@ export declare namespace ConnectionCreateParams {
800
1312
  * Warehouse type
801
1313
  */
802
1314
  warehouse_type: 'mssql';
803
- /**
804
- * Default timezone for the connection (e.g., 'UTC', 'America/New_York')
805
- */
806
- database_timezone?: string | null;
807
1315
  /**
808
1316
  * Description of the connection
809
1317
  */
@@ -840,8 +1348,123 @@ export interface ConnectionUpdateParams {
840
1348
  */
841
1349
  name?: string | null;
842
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
+ }
843
1464
  export declare namespace Connections {
844
- 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, };
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, };
845
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, };
846
1469
  }
847
1470
  //# sourceMappingURL=connections.d.mts.map