@katerai/sdk 0.6.0 → 0.7.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 (321) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +23 -16
  3. package/client.d.mts +10 -13
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -13
  6. package/client.d.ts.map +1 -1
  7. package/client.js +37 -15
  8. package/client.js.map +1 -1
  9. package/client.mjs +37 -15
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/log.d.mts.map +1 -1
  12. package/internal/utils/log.d.ts.map +1 -1
  13. package/internal/utils/log.js +2 -1
  14. package/internal/utils/log.js.map +1 -1
  15. package/internal/utils/log.mjs +2 -1
  16. package/internal/utils/log.mjs.map +1 -1
  17. package/package.json +2 -2
  18. package/resources/index.d.mts +0 -2
  19. package/resources/index.d.mts.map +1 -1
  20. package/resources/index.d.ts +0 -2
  21. package/resources/index.d.ts.map +1 -1
  22. package/resources/index.js +1 -5
  23. package/resources/index.js.map +1 -1
  24. package/resources/index.mjs +0 -2
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/v1/connections.d.mts +216 -1
  27. package/resources/v1/connections.d.mts.map +1 -1
  28. package/resources/v1/connections.d.ts +216 -1
  29. package/resources/v1/connections.d.ts.map +1 -1
  30. package/resources/v1/connections.js +22 -2
  31. package/resources/v1/connections.js.map +1 -1
  32. package/resources/v1/connections.mjs +20 -1
  33. package/resources/v1/connections.mjs.map +1 -1
  34. package/resources/v1/index.d.mts +2 -6
  35. package/resources/v1/index.d.mts.map +1 -1
  36. package/resources/v1/index.d.ts +2 -6
  37. package/resources/v1/index.d.ts.map +1 -1
  38. package/resources/v1/index.js +5 -13
  39. package/resources/v1/index.js.map +1 -1
  40. package/resources/v1/index.mjs +2 -6
  41. package/resources/v1/index.mjs.map +1 -1
  42. package/resources/v1/tenants.d.mts +125 -1
  43. package/resources/v1/tenants.d.mts.map +1 -1
  44. package/resources/v1/tenants.d.ts +125 -1
  45. package/resources/v1/tenants.d.ts.map +1 -1
  46. package/resources/v1/tenants.js +46 -2
  47. package/resources/v1/tenants.js.map +1 -1
  48. package/resources/v1/tenants.mjs +44 -1
  49. package/resources/v1/tenants.mjs.map +1 -1
  50. package/resources/v1/v1.d.mts +6 -22
  51. package/resources/v1/v1.d.mts.map +1 -1
  52. package/resources/v1/v1.d.ts +6 -22
  53. package/resources/v1/v1.d.ts.map +1 -1
  54. package/resources/v1/v1.js +4 -20
  55. package/resources/v1/v1.js.map +1 -1
  56. package/resources/v1/v1.mjs +4 -20
  57. package/resources/v1/v1.mjs.map +1 -1
  58. package/src/client.ts +48 -23
  59. package/src/internal/utils/log.ts +1 -0
  60. package/src/resources/index.ts +0 -2
  61. package/src/resources/v1/connections.ts +277 -1
  62. package/src/resources/v1/index.ts +7 -44
  63. package/src/resources/v1/tenants.ts +162 -1
  64. package/src/resources/v1/v1.ts +14 -104
  65. package/src/version.ts +1 -1
  66. package/version.d.mts +1 -1
  67. package/version.d.ts +1 -1
  68. package/version.js +1 -1
  69. package/version.mjs +1 -1
  70. package/resources/healthz.d.mts +0 -16
  71. package/resources/healthz.d.mts.map +0 -1
  72. package/resources/healthz.d.ts +0 -16
  73. package/resources/healthz.d.ts.map +0 -1
  74. package/resources/healthz.js +0 -15
  75. package/resources/healthz.js.map +0 -1
  76. package/resources/healthz.mjs +0 -11
  77. package/resources/healthz.mjs.map +0 -1
  78. package/resources/readyz.d.mts +0 -16
  79. package/resources/readyz.d.mts.map +0 -1
  80. package/resources/readyz.d.ts +0 -16
  81. package/resources/readyz.d.ts.map +0 -1
  82. package/resources/readyz.js +0 -15
  83. package/resources/readyz.js.map +0 -1
  84. package/resources/readyz.mjs +0 -11
  85. package/resources/readyz.mjs.map +0 -1
  86. package/resources/v1/connections/connections.d.mts +0 -1470
  87. package/resources/v1/connections/connections.d.mts.map +0 -1
  88. package/resources/v1/connections/connections.d.ts +0 -1470
  89. package/resources/v1/connections/connections.d.ts.map +0 -1
  90. package/resources/v1/connections/connections.js +0 -163
  91. package/resources/v1/connections/connections.js.map +0 -1
  92. package/resources/v1/connections/connections.mjs +0 -158
  93. package/resources/v1/connections/connections.mjs.map +0 -1
  94. package/resources/v1/connections/databases.d.mts +0 -25
  95. package/resources/v1/connections/databases.d.mts.map +0 -1
  96. package/resources/v1/connections/databases.d.ts +0 -25
  97. package/resources/v1/connections/databases.d.ts.map +0 -1
  98. package/resources/v1/connections/databases.js +0 -26
  99. package/resources/v1/connections/databases.js.map +0 -1
  100. package/resources/v1/connections/databases.mjs +0 -22
  101. package/resources/v1/connections/databases.mjs.map +0 -1
  102. package/resources/v1/connections/index.d.mts +0 -5
  103. package/resources/v1/connections/index.d.mts.map +0 -1
  104. package/resources/v1/connections/index.d.ts +0 -5
  105. package/resources/v1/connections/index.d.ts.map +0 -1
  106. package/resources/v1/connections/index.js +0 -13
  107. package/resources/v1/connections/index.js.map +0 -1
  108. package/resources/v1/connections/index.mjs +0 -6
  109. package/resources/v1/connections/index.mjs.map +0 -1
  110. package/resources/v1/connections/views.d.mts +0 -77
  111. package/resources/v1/connections/views.d.mts.map +0 -1
  112. package/resources/v1/connections/views.d.ts +0 -77
  113. package/resources/v1/connections/views.d.ts.map +0 -1
  114. package/resources/v1/connections/views.js +0 -24
  115. package/resources/v1/connections/views.js.map +0 -1
  116. package/resources/v1/connections/views.mjs +0 -20
  117. package/resources/v1/connections/views.mjs.map +0 -1
  118. package/resources/v1/connections/yaml.d.mts +0 -57
  119. package/resources/v1/connections/yaml.d.mts.map +0 -1
  120. package/resources/v1/connections/yaml.d.ts +0 -57
  121. package/resources/v1/connections/yaml.d.ts.map +0 -1
  122. package/resources/v1/connections/yaml.js +0 -22
  123. package/resources/v1/connections/yaml.js.map +0 -1
  124. package/resources/v1/connections/yaml.mjs +0 -18
  125. package/resources/v1/connections/yaml.mjs.map +0 -1
  126. package/resources/v1/github/github.d.mts +0 -99
  127. package/resources/v1/github/github.d.mts.map +0 -1
  128. package/resources/v1/github/github.d.ts +0 -99
  129. package/resources/v1/github/github.d.ts.map +0 -1
  130. package/resources/v1/github/github.js +0 -49
  131. package/resources/v1/github/github.js.map +0 -1
  132. package/resources/v1/github/github.mjs +0 -44
  133. package/resources/v1/github/github.mjs.map +0 -1
  134. package/resources/v1/github/index.d.mts +0 -5
  135. package/resources/v1/github/index.d.mts.map +0 -1
  136. package/resources/v1/github/index.d.ts +0 -5
  137. package/resources/v1/github/index.d.ts.map +0 -1
  138. package/resources/v1/github/index.js +0 -13
  139. package/resources/v1/github/index.js.map +0 -1
  140. package/resources/v1/github/index.mjs +0 -6
  141. package/resources/v1/github/index.mjs.map +0 -1
  142. package/resources/v1/github/repos.d.mts +0 -54
  143. package/resources/v1/github/repos.d.mts.map +0 -1
  144. package/resources/v1/github/repos.d.ts +0 -54
  145. package/resources/v1/github/repos.d.ts.map +0 -1
  146. package/resources/v1/github/repos.js +0 -22
  147. package/resources/v1/github/repos.js.map +0 -1
  148. package/resources/v1/github/repos.mjs +0 -18
  149. package/resources/v1/github/repos.mjs.map +0 -1
  150. package/resources/v1/github/scaffold.d.mts +0 -29
  151. package/resources/v1/github/scaffold.d.mts.map +0 -1
  152. package/resources/v1/github/scaffold.d.ts +0 -29
  153. package/resources/v1/github/scaffold.d.ts.map +0 -1
  154. package/resources/v1/github/scaffold.js +0 -21
  155. package/resources/v1/github/scaffold.js.map +0 -1
  156. package/resources/v1/github/scaffold.mjs +0 -17
  157. package/resources/v1/github/scaffold.mjs.map +0 -1
  158. package/resources/v1/github/webhooks.d.mts +0 -28
  159. package/resources/v1/github/webhooks.d.mts.map +0 -1
  160. package/resources/v1/github/webhooks.d.ts +0 -28
  161. package/resources/v1/github/webhooks.d.ts.map +0 -1
  162. package/resources/v1/github/webhooks.js +0 -27
  163. package/resources/v1/github/webhooks.js.map +0 -1
  164. package/resources/v1/github/webhooks.mjs +0 -23
  165. package/resources/v1/github/webhooks.mjs.map +0 -1
  166. package/resources/v1/github.d.mts +0 -2
  167. package/resources/v1/github.d.mts.map +0 -1
  168. package/resources/v1/github.d.ts +0 -2
  169. package/resources/v1/github.d.ts.map +0 -1
  170. package/resources/v1/github.js +0 -6
  171. package/resources/v1/github.js.map +0 -1
  172. package/resources/v1/github.mjs +0 -3
  173. package/resources/v1/github.mjs.map +0 -1
  174. package/resources/v1/groups/groups.d.mts +0 -162
  175. package/resources/v1/groups/groups.d.mts.map +0 -1
  176. package/resources/v1/groups/groups.d.ts +0 -162
  177. package/resources/v1/groups/groups.d.ts.map +0 -1
  178. package/resources/v1/groups/groups.js +0 -81
  179. package/resources/v1/groups/groups.js.map +0 -1
  180. package/resources/v1/groups/groups.mjs +0 -76
  181. package/resources/v1/groups/groups.mjs.map +0 -1
  182. package/resources/v1/groups/index.d.mts +0 -3
  183. package/resources/v1/groups/index.d.mts.map +0 -1
  184. package/resources/v1/groups/index.d.ts +0 -3
  185. package/resources/v1/groups/index.d.ts.map +0 -1
  186. package/resources/v1/groups/index.js +0 -9
  187. package/resources/v1/groups/index.js.map +0 -1
  188. package/resources/v1/groups/index.mjs +0 -4
  189. package/resources/v1/groups/index.mjs.map +0 -1
  190. package/resources/v1/groups/tenants.d.mts +0 -55
  191. package/resources/v1/groups/tenants.d.mts.map +0 -1
  192. package/resources/v1/groups/tenants.d.ts +0 -55
  193. package/resources/v1/groups/tenants.d.ts.map +0 -1
  194. package/resources/v1/groups/tenants.js +0 -39
  195. package/resources/v1/groups/tenants.js.map +0 -1
  196. package/resources/v1/groups/tenants.mjs +0 -35
  197. package/resources/v1/groups/tenants.mjs.map +0 -1
  198. package/resources/v1/groups.d.mts +0 -2
  199. package/resources/v1/groups.d.mts.map +0 -1
  200. package/resources/v1/groups.d.ts +0 -2
  201. package/resources/v1/groups.d.ts.map +0 -1
  202. package/resources/v1/groups.js +0 -6
  203. package/resources/v1/groups.js.map +0 -1
  204. package/resources/v1/groups.mjs +0 -3
  205. package/resources/v1/groups.mjs.map +0 -1
  206. package/resources/v1/me.d.mts +0 -43
  207. package/resources/v1/me.d.mts.map +0 -1
  208. package/resources/v1/me.d.ts +0 -43
  209. package/resources/v1/me.d.ts.map +0 -1
  210. package/resources/v1/me.js +0 -20
  211. package/resources/v1/me.js.map +0 -1
  212. package/resources/v1/me.mjs +0 -16
  213. package/resources/v1/me.mjs.map +0 -1
  214. package/resources/v1/org/client.d.mts +0 -53
  215. package/resources/v1/org/client.d.mts.map +0 -1
  216. package/resources/v1/org/client.d.ts +0 -53
  217. package/resources/v1/org/client.d.ts.map +0 -1
  218. package/resources/v1/org/client.js +0 -25
  219. package/resources/v1/org/client.js.map +0 -1
  220. package/resources/v1/org/client.mjs +0 -21
  221. package/resources/v1/org/client.mjs.map +0 -1
  222. package/resources/v1/org/index.d.mts +0 -4
  223. package/resources/v1/org/index.d.mts.map +0 -1
  224. package/resources/v1/org/index.d.ts +0 -4
  225. package/resources/v1/org/index.d.ts.map +0 -1
  226. package/resources/v1/org/index.js +0 -11
  227. package/resources/v1/org/index.js.map +0 -1
  228. package/resources/v1/org/index.mjs +0 -5
  229. package/resources/v1/org/index.mjs.map +0 -1
  230. package/resources/v1/org/org.d.mts +0 -14
  231. package/resources/v1/org/org.d.mts.map +0 -1
  232. package/resources/v1/org/org.d.ts +0 -14
  233. package/resources/v1/org/org.d.ts.map +0 -1
  234. package/resources/v1/org/org.js +0 -21
  235. package/resources/v1/org/org.js.map +0 -1
  236. package/resources/v1/org/org.mjs +0 -16
  237. package/resources/v1/org/org.mjs.map +0 -1
  238. package/resources/v1/org/users.d.mts +0 -87
  239. package/resources/v1/org/users.d.mts.map +0 -1
  240. package/resources/v1/org/users.d.ts +0 -87
  241. package/resources/v1/org/users.d.ts.map +0 -1
  242. package/resources/v1/org/users.js +0 -60
  243. package/resources/v1/org/users.js.map +0 -1
  244. package/resources/v1/org/users.mjs +0 -56
  245. package/resources/v1/org/users.mjs.map +0 -1
  246. package/resources/v1/org.d.mts +0 -2
  247. package/resources/v1/org.d.mts.map +0 -1
  248. package/resources/v1/org.d.ts +0 -2
  249. package/resources/v1/org.d.ts.map +0 -1
  250. package/resources/v1/org.js +0 -6
  251. package/resources/v1/org.js.map +0 -1
  252. package/resources/v1/org.mjs +0 -3
  253. package/resources/v1/org.mjs.map +0 -1
  254. package/resources/v1/tenants/batch.d.mts +0 -159
  255. package/resources/v1/tenants/batch.d.mts.map +0 -1
  256. package/resources/v1/tenants/batch.d.ts +0 -159
  257. package/resources/v1/tenants/batch.d.ts.map +0 -1
  258. package/resources/v1/tenants/batch.js +0 -42
  259. package/resources/v1/tenants/batch.js.map +0 -1
  260. package/resources/v1/tenants/batch.mjs +0 -38
  261. package/resources/v1/tenants/batch.mjs.map +0 -1
  262. package/resources/v1/tenants/groups.d.mts +0 -43
  263. package/resources/v1/tenants/groups.d.mts.map +0 -1
  264. package/resources/v1/tenants/groups.d.ts +0 -43
  265. package/resources/v1/tenants/groups.d.ts.map +0 -1
  266. package/resources/v1/tenants/groups.js +0 -20
  267. package/resources/v1/tenants/groups.js.map +0 -1
  268. package/resources/v1/tenants/groups.mjs +0 -16
  269. package/resources/v1/tenants/groups.mjs.map +0 -1
  270. package/resources/v1/tenants/import.d.mts +0 -126
  271. package/resources/v1/tenants/import.d.mts.map +0 -1
  272. package/resources/v1/tenants/import.d.ts +0 -126
  273. package/resources/v1/tenants/import.d.ts.map +0 -1
  274. package/resources/v1/tenants/import.js +0 -50
  275. package/resources/v1/tenants/import.js.map +0 -1
  276. package/resources/v1/tenants/import.mjs +0 -46
  277. package/resources/v1/tenants/import.mjs.map +0 -1
  278. package/resources/v1/tenants/index.d.mts +0 -5
  279. package/resources/v1/tenants/index.d.mts.map +0 -1
  280. package/resources/v1/tenants/index.d.ts +0 -5
  281. package/resources/v1/tenants/index.d.ts.map +0 -1
  282. package/resources/v1/tenants/index.js +0 -13
  283. package/resources/v1/tenants/index.js.map +0 -1
  284. package/resources/v1/tenants/index.mjs +0 -6
  285. package/resources/v1/tenants/index.mjs.map +0 -1
  286. package/resources/v1/tenants/tenants.d.mts +0 -248
  287. package/resources/v1/tenants/tenants.d.mts.map +0 -1
  288. package/resources/v1/tenants/tenants.d.ts +0 -248
  289. package/resources/v1/tenants/tenants.d.ts.map +0 -1
  290. package/resources/v1/tenants/tenants.js +0 -113
  291. package/resources/v1/tenants/tenants.js.map +0 -1
  292. package/resources/v1/tenants/tenants.mjs +0 -108
  293. package/resources/v1/tenants/tenants.mjs.map +0 -1
  294. package/src/resources/healthz.ts +0 -20
  295. package/src/resources/readyz.ts +0 -20
  296. package/src/resources/v1/connections/connections.ts +0 -1905
  297. package/src/resources/v1/connections/databases.ts +0 -42
  298. package/src/resources/v1/connections/index.ts +0 -33
  299. package/src/resources/v1/connections/views.ts +0 -112
  300. package/src/resources/v1/connections/yaml.ts +0 -81
  301. package/src/resources/v1/github/github.ts +0 -165
  302. package/src/resources/v1/github/index.ts +0 -20
  303. package/src/resources/v1/github/repos.ts +0 -85
  304. package/src/resources/v1/github/scaffold.ts +0 -44
  305. package/src/resources/v1/github/webhooks.ts +0 -60
  306. package/src/resources/v1/github.ts +0 -3
  307. package/src/resources/v1/groups/groups.ts +0 -218
  308. package/src/resources/v1/groups/index.ts +0 -10
  309. package/src/resources/v1/groups/tenants.ts +0 -78
  310. package/src/resources/v1/groups.ts +0 -3
  311. package/src/resources/v1/me.ts +0 -62
  312. package/src/resources/v1/org/client.ts +0 -81
  313. package/src/resources/v1/org/index.ts +0 -11
  314. package/src/resources/v1/org/org.ts +0 -32
  315. package/src/resources/v1/org/users.ts +0 -127
  316. package/src/resources/v1/org.ts +0 -3
  317. package/src/resources/v1/tenants/batch.ts +0 -200
  318. package/src/resources/v1/tenants/groups.ts +0 -52
  319. package/src/resources/v1/tenants/import.ts +0 -158
  320. package/src/resources/v1/tenants/index.ts +0 -29
  321. package/src/resources/v1/tenants/tenants.ts +0 -344
@@ -1,1905 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../../core/resource';
4
- import * as DatabasesAPI from './databases';
5
- import { DatabaseDeleteSchemaParams, Databases } from './databases';
6
- import * as ViewsAPI from './views';
7
- import { ViewListParams, ViewListResponse, ViewRetrieveParams, ViewRetrieveResponse, Views } from './views';
8
- import * as YamlAPI from './yaml';
9
- import { Yaml, YamlCommitParams, YamlCommitResponse, YamlRetrieveResponse } from './yaml';
10
- import { APIPromise } from '../../../core/api-promise';
11
- import { buildHeaders } from '../../../internal/headers';
12
- import { RequestOptions } from '../../../internal/request-options';
13
- import { path } from '../../../internal/utils/path';
14
-
15
- export class Connections extends APIResource {
16
- databases: DatabasesAPI.Databases = new DatabasesAPI.Databases(this._client);
17
- views: ViewsAPI.Views = new ViewsAPI.Views(this._client);
18
- yaml: YamlAPI.Yaml = new YamlAPI.Yaml(this._client);
19
-
20
- /**
21
- * Create a new warehouse connection with PR approval flow.
22
- */
23
- create(body: ConnectionCreateParams, options?: RequestOptions): APIPromise<Connection> {
24
- return this._client.post('/api/v1/connections', { body, ...options });
25
- }
26
-
27
- /**
28
- * Get a single warehouse connection by ID.
29
- *
30
- * Returns connection from the database (source of truth) with full hierarchy. For
31
- * YAML output compatible with repository files (using kater_id), use the GET
32
- * /connections/{id}/schema endpoint instead.
33
- *
34
- * RLS: Filtered to current client (DualClientRLSDB).
35
- *
36
- * Raises: NotFoundError: If connection doesn't exist (404)
37
- */
38
- retrieve(connectionID: string, options?: RequestOptions): APIPromise<Connection> {
39
- return this._client.get(path`/api/v1/connections/${connectionID}`, options);
40
- }
41
-
42
- /**
43
- * Update a warehouse connection's metadata.
44
- *
45
- * Updates name, label, and/or description fields.
46
- *
47
- * RLS: Filtered to current client (ClientRLSDB).
48
- *
49
- * Raises: ConnectionNotFoundError: If connection doesn't exist (404)
50
- */
51
- update(
52
- connectionID: string,
53
- body: ConnectionUpdateParams,
54
- options?: RequestOptions,
55
- ): APIPromise<Connection> {
56
- return this._client.patch(path`/api/v1/connections/${connectionID}`, { body, ...options });
57
- }
58
-
59
- /**
60
- * List warehouse connections for the client.
61
- *
62
- * Filter connections by approval status using the `status` query parameter:
63
- *
64
- * - `approved` (default): Only approved connections (is_pending_approval=false)
65
- * - `pending`: Only connections awaiting PR approval (is_pending_approval=true)
66
- * - `all`: All connections regardless of approval status
67
- *
68
- * Pending connections include their approval PR URLs when available. Returns empty
69
- * list if GitHub is not configured.
70
- *
71
- * RLS: Filtered to current client (DualClientRLSDB).
72
- */
73
- list(
74
- query: ConnectionListParams | null | undefined = {},
75
- options?: RequestOptions,
76
- ): APIPromise<ConnectionListResponse> {
77
- return this._client.get('/api/v1/connections', { query, ...options });
78
- }
79
-
80
- /**
81
- * Delete a warehouse connection.
82
- *
83
- * Soft-deletes the connection record and cascades to all associated databases and
84
- * schemas, setting deleted_at and deleted_by fields.
85
- *
86
- * RLS: Filtered to current client (ClientRLSDB).
87
- *
88
- * Raises: ConnectionNotFoundError: If connection doesn't exist (404)
89
- */
90
- delete(connectionID: string, options?: RequestOptions): APIPromise<void> {
91
- return this._client.delete(path`/api/v1/connections/${connectionID}`, {
92
- ...options,
93
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
94
- });
95
- }
96
-
97
- /**
98
- * Merge the PR for a pending connection to finalize it.
99
- */
100
- approve(connectionID: string, options?: RequestOptions): APIPromise<Connection> {
101
- return this._client.post(path`/api/v1/connections/${connectionID}/approve`, options);
102
- }
103
-
104
- /**
105
- * Merge the PR for a completed schema sync.
106
- */
107
- approveSync(
108
- syncID: string,
109
- params: ConnectionApproveSyncParams,
110
- options?: RequestOptions,
111
- ): APIPromise<ConnectionApproveSyncResponse> {
112
- const { connection_id } = params;
113
- return this._client.post(path`/api/v1/connections/${connection_id}/sync/${syncID}/approve`, options);
114
- }
115
-
116
- /**
117
- * List all schema sync records for a connection.
118
- */
119
- listSyncs(
120
- connectionID: string,
121
- query: ConnectionListSyncsParams | null | undefined = {},
122
- options?: RequestOptions,
123
- ): APIPromise<ConnectionListSyncsResponse> {
124
- return this._client.get(path`/api/v1/connections/${connectionID}/sync`, { query, ...options });
125
- }
126
-
127
- /**
128
- * Get decrypted warehouse credentials for a connection.
129
- *
130
- * Returns the decrypted credentials for a connection. This is sensitive data and
131
- * should only be used when actually needed for warehouse operations.
132
- *
133
- * RLS: Filtered to current client (DualClientRLSDB).
134
- *
135
- * Raises: NotFoundError: If connection doesn't exist (404)
136
- */
137
- retrieveCredential(
138
- connectionID: string,
139
- options?: RequestOptions,
140
- ): APIPromise<ConnectionRetrieveCredentialResponse> {
141
- return this._client.get(path`/api/v1/connections/${connectionID}/credential`, options);
142
- }
143
-
144
- /**
145
- * Get connection as a ConnectionSchema object.
146
- *
147
- * Returns the connection in the YAML-compatible schema format with full
148
- * database/schema hierarchy.
149
- *
150
- * RLS: Automatically filtered by client_id from auth context.
151
- *
152
- * Raises: ConnectionNotFoundError: If connection not found or deleted.
153
- */
154
- retrieveSchema(
155
- connectionID: string,
156
- options?: RequestOptions,
157
- ): APIPromise<ConnectionRetrieveSchemaResponse> {
158
- return this._client.get(path`/api/v1/connections/${connectionID}/schema`, options);
159
- }
160
-
161
- /**
162
- * Get the current status of a schema sync workflow.
163
- */
164
- retrieveSyncStatus(
165
- syncID: string,
166
- params: ConnectionRetrieveSyncStatusParams,
167
- options?: RequestOptions,
168
- ): APIPromise<ConnectionRetrieveSyncStatusResponse> {
169
- const { connection_id } = params;
170
- return this._client.get(path`/api/v1/connections/${connection_id}/sync/${syncID}`, options);
171
- }
172
-
173
- /**
174
- * Server-Sent Events stream for real-time sync progress updates.
175
- */
176
- streamSyncProgress(
177
- syncID: string,
178
- params: ConnectionStreamSyncProgressParams,
179
- options?: RequestOptions,
180
- ): APIPromise<unknown> {
181
- const { connection_id } = params;
182
- return this._client.get(path`/api/v1/connections/${connection_id}/sync/${syncID}/stream`, options);
183
- }
184
-
185
- /**
186
- * Start a schema sync workflow. Returns 202 Accepted with sync_id.
187
- */
188
- sync(connectionID: string, options?: RequestOptions): APIPromise<ConnectionSyncResponse> {
189
- return this._client.post(path`/api/v1/connections/${connectionID}/sync`, options);
190
- }
191
-
192
- /**
193
- * Test and update warehouse credentials without modifying connection config.
194
- */
195
- updateCredentials(
196
- connectionID: string,
197
- body: ConnectionUpdateCredentialsParams,
198
- options?: RequestOptions,
199
- ): APIPromise<ConnectionUpdateCredentialsResponse> {
200
- return this._client.patch(path`/api/v1/connections/${connectionID}/credentials`, { body, ...options });
201
- }
202
- }
203
-
204
- /**
205
- * Response model for a single connection.
206
- *
207
- * All data comes from the database (source of truth). For YAML-compatible output
208
- * with 'kater_id', use the /schema endpoint instead.
209
- */
210
- export interface Connection {
211
- /**
212
- * Connection ID
213
- */
214
- id: string;
215
-
216
- /**
217
- * Creation timestamp
218
- */
219
- created_at: string;
220
-
221
- /**
222
- * Credential ID
223
- */
224
- credential_id: string;
225
-
226
- /**
227
- * Databases in this connection
228
- */
229
- databases: Array<Connection.Database>;
230
-
231
- /**
232
- * Connection name
233
- */
234
- name: string;
235
-
236
- /**
237
- * Last update timestamp
238
- */
239
- updated_at: string;
240
-
241
- /**
242
- * Warehouse-specific configuration
243
- */
244
- warehouse_metadata:
245
- | Connection.SnowflakeMetadata
246
- | Connection.PostgresqlMetadata
247
- | Connection.DatabricksMetadata
248
- | Connection.ClickhouseMetadata
249
- | Connection.MssqlMetadata;
250
-
251
- /**
252
- * Warehouse type (snowflake, postgresql, etc.)
253
- */
254
- warehouse_type: string;
255
-
256
- /**
257
- * GitHub PR URL for approving the connection (None if already approved)
258
- */
259
- approval_pr_url?: string | null;
260
-
261
- /**
262
- * Connection description
263
- */
264
- description?: string | null;
265
-
266
- /**
267
- * True if this connection is awaiting PR approval
268
- */
269
- is_pending_approval?: boolean;
270
-
271
- /**
272
- * Human-readable label
273
- */
274
- label?: string | null;
275
-
276
- /**
277
- * Query timeout in seconds
278
- */
279
- query_timeout?: number | null;
280
-
281
- /**
282
- * Timezone conversion mode (do_not_convert, convert_to_utc)
283
- */
284
- query_timezone_conversion?: string | null;
285
- }
286
-
287
- export namespace Connection {
288
- /**
289
- * Database info from ConnectionSchema.
290
- */
291
- export interface Database {
292
- /**
293
- * Database ID
294
- */
295
- id: string;
296
-
297
- /**
298
- * Actual name of the database in the warehouse
299
- */
300
- database_object_name: string;
301
-
302
- /**
303
- * Database name
304
- */
305
- name: string;
306
-
307
- /**
308
- * Schemas in this database
309
- */
310
- schemas: Array<Database.Schema>;
311
-
312
- /**
313
- * Database description
314
- */
315
- description?: string | null;
316
-
317
- /**
318
- * Human-readable label
319
- */
320
- label?: string | null;
321
-
322
- /**
323
- * Timezone for the database
324
- */
325
- timezone?: string | null;
326
- }
327
-
328
- export namespace Database {
329
- /**
330
- * Schema info from ConnectionSchema.
331
- */
332
- export interface Schema {
333
- /**
334
- * Schema ID
335
- */
336
- id: string;
337
-
338
- /**
339
- * Actual name of the schema in the warehouse
340
- */
341
- database_object_name: string;
342
-
343
- /**
344
- * Schema name
345
- */
346
- name: string;
347
-
348
- /**
349
- * Schema description
350
- */
351
- description?: string | null;
352
-
353
- /**
354
- * Human-readable label
355
- */
356
- label?: string | null;
357
- }
358
- }
359
-
360
- export interface SnowflakeMetadata {
361
- /**
362
- * Authentication method
363
- */
364
- auth_method: 'username_password' | 'key_pair';
365
-
366
- /**
367
- * Snowflake role
368
- */
369
- role: string;
370
-
371
- /**
372
- * Snowflake account identifier
373
- */
374
- snowflake_account_id: string;
375
-
376
- /**
377
- * Snowflake compute warehouse name
378
- */
379
- warehouse: string;
380
-
381
- warehouse_type: 'snowflake';
382
- }
383
-
384
- export interface PostgresqlMetadata {
385
- /**
386
- * Database host address
387
- */
388
- host: string;
389
-
390
- /**
391
- * Database port (default: 5432)
392
- */
393
- port: number;
394
-
395
- warehouse_type: 'postgresql';
396
- }
397
-
398
- export interface DatabricksMetadata {
399
- /**
400
- * Databricks SQL warehouse HTTP path
401
- */
402
- http_path: string;
403
-
404
- /**
405
- * Databricks server hostname
406
- */
407
- server_hostname: string;
408
-
409
- warehouse_type: 'databricks';
410
- }
411
-
412
- export interface ClickhouseMetadata {
413
- /**
414
- * ClickHouse host address
415
- */
416
- host: string;
417
-
418
- /**
419
- * ClickHouse port (default: 8443)
420
- */
421
- port: number;
422
-
423
- warehouse_type: 'clickhouse';
424
- }
425
-
426
- export interface MssqlMetadata {
427
- /**
428
- * SQL Server host address
429
- */
430
- host: string;
431
-
432
- /**
433
- * SQL Server port (default: 1433)
434
- */
435
- port: number;
436
-
437
- warehouse_type: 'mssql';
438
- }
439
- }
440
-
441
- /**
442
- * Database configuration for connection creation request.
443
- */
444
- export interface DatabaseConfig {
445
- /**
446
- * Database name (also used as the warehouse object name)
447
- */
448
- name: string;
449
-
450
- /**
451
- * Description of the database
452
- */
453
- description?: string | null;
454
-
455
- /**
456
- * Human-readable label for the database (defaults to name if not set)
457
- */
458
- label?: string | null;
459
-
460
- /**
461
- * Schema configurations to include (empty = discover all schemas)
462
- */
463
- schemas?: Array<DatabaseConfig.Schema>;
464
-
465
- /**
466
- * Timezone for the database (e.g., 'UTC', 'America/New_York')
467
- */
468
- timezone?: string | null;
469
- }
470
-
471
- export namespace DatabaseConfig {
472
- /**
473
- * Schema configuration for connection creation request.
474
- */
475
- export interface Schema {
476
- /**
477
- * Schema name (also used as the warehouse object name)
478
- */
479
- name: string;
480
-
481
- /**
482
- * Description of the schema
483
- */
484
- description?: string | null;
485
-
486
- /**
487
- * Human-readable label for the schema (defaults to name if not set)
488
- */
489
- label?: string | null;
490
- }
491
- }
492
-
493
- export type ConnectionListResponse = Array<Connection>;
494
-
495
- /**
496
- * Response for sync status endpoint.
497
- *
498
- * Contains full sync state including progress and results.
499
- */
500
- export interface ConnectionApproveSyncResponse {
501
- /**
502
- * Connection ID
503
- */
504
- connection_id: string;
505
-
506
- /**
507
- * Sync creation timestamp
508
- */
509
- created_at: string;
510
-
511
- /**
512
- * Workflow status: queued, running, succeeded, failed, canceled
513
- */
514
- run_status: string;
515
-
516
- /**
517
- * Schema sync record ID
518
- */
519
- sync_id: string;
520
-
521
- /**
522
- * Workflow completion timestamp
523
- */
524
- completed_at?: string | null;
525
-
526
- /**
527
- * Current workflow step
528
- */
529
- current_step?: string | null;
530
-
531
- /**
532
- * Error message if failed
533
- */
534
- error_message?: string | null;
535
-
536
- /**
537
- * Sync event history
538
- */
539
- events?: Array<ConnectionApproveSyncResponse.Event>;
540
-
541
- /**
542
- * Hatchet workflow run ID
543
- */
544
- hatchet_run_id?: string | null;
545
-
546
- /**
547
- * GitHub PR number
548
- */
549
- pr_number?: number | null;
550
-
551
- /**
552
- * PR status: open, merged, closed
553
- */
554
- pr_status?: string | null;
555
-
556
- /**
557
- * GitHub PR URL
558
- */
559
- pr_url?: string | null;
560
-
561
- /**
562
- * Workflow start timestamp
563
- */
564
- started_at?: string | null;
565
-
566
- /**
567
- * Number of views deleted
568
- */
569
- views_deleted?: number | null;
570
-
571
- /**
572
- * Number of new views added
573
- */
574
- views_inserted?: number | null;
575
-
576
- /**
577
- * Number of views renamed (subset of updated)
578
- */
579
- views_renamed?: number | null;
580
-
581
- /**
582
- * Number of views updated (dimension changes or renames)
583
- */
584
- views_updated?: number | null;
585
- }
586
-
587
- export namespace ConnectionApproveSyncResponse {
588
- /**
589
- * Response model for a single sync event.
590
- */
591
- export interface Event {
592
- /**
593
- * Event ID
594
- */
595
- id: string;
596
-
597
- /**
598
- * Event timestamp
599
- */
600
- created_at: string;
601
-
602
- /**
603
- * Event type: step_started, step_completed, progress, warning, error
604
- */
605
- event_type: string;
606
-
607
- /**
608
- * Human-readable event message
609
- */
610
- message: string;
611
-
612
- /**
613
- * Additional event data
614
- */
615
- metadata?: { [key: string]: unknown };
616
-
617
- /**
618
- * Step name if applicable
619
- */
620
- step_name?: string | null;
621
- }
622
- }
623
-
624
- export type ConnectionListSyncsResponse = Array<ConnectionListSyncsResponse.ConnectionListSyncsResponseItem>;
625
-
626
- export namespace ConnectionListSyncsResponse {
627
- /**
628
- * Response for sync status endpoint.
629
- *
630
- * Contains full sync state including progress and results.
631
- */
632
- export interface ConnectionListSyncsResponseItem {
633
- /**
634
- * Connection ID
635
- */
636
- connection_id: string;
637
-
638
- /**
639
- * Sync creation timestamp
640
- */
641
- created_at: string;
642
-
643
- /**
644
- * Workflow status: queued, running, succeeded, failed, canceled
645
- */
646
- run_status: string;
647
-
648
- /**
649
- * Schema sync record ID
650
- */
651
- sync_id: string;
652
-
653
- /**
654
- * Workflow completion timestamp
655
- */
656
- completed_at?: string | null;
657
-
658
- /**
659
- * Current workflow step
660
- */
661
- current_step?: string | null;
662
-
663
- /**
664
- * Error message if failed
665
- */
666
- error_message?: string | null;
667
-
668
- /**
669
- * Sync event history
670
- */
671
- events?: Array<ConnectionListSyncsResponseItem.Event>;
672
-
673
- /**
674
- * Hatchet workflow run ID
675
- */
676
- hatchet_run_id?: string | null;
677
-
678
- /**
679
- * GitHub PR number
680
- */
681
- pr_number?: number | null;
682
-
683
- /**
684
- * PR status: open, merged, closed
685
- */
686
- pr_status?: string | null;
687
-
688
- /**
689
- * GitHub PR URL
690
- */
691
- pr_url?: string | null;
692
-
693
- /**
694
- * Workflow start timestamp
695
- */
696
- started_at?: string | null;
697
-
698
- /**
699
- * Number of views deleted
700
- */
701
- views_deleted?: number | null;
702
-
703
- /**
704
- * Number of new views added
705
- */
706
- views_inserted?: number | null;
707
-
708
- /**
709
- * Number of views renamed (subset of updated)
710
- */
711
- views_renamed?: number | null;
712
-
713
- /**
714
- * Number of views updated (dimension changes or renames)
715
- */
716
- views_updated?: number | null;
717
- }
718
-
719
- export namespace ConnectionListSyncsResponseItem {
720
- /**
721
- * Response model for a single sync event.
722
- */
723
- export interface Event {
724
- /**
725
- * Event ID
726
- */
727
- id: string;
728
-
729
- /**
730
- * Event timestamp
731
- */
732
- created_at: string;
733
-
734
- /**
735
- * Event type: step_started, step_completed, progress, warning, error
736
- */
737
- event_type: string;
738
-
739
- /**
740
- * Human-readable event message
741
- */
742
- message: string;
743
-
744
- /**
745
- * Additional event data
746
- */
747
- metadata?: { [key: string]: unknown };
748
-
749
- /**
750
- * Step name if applicable
751
- */
752
- step_name?: string | null;
753
- }
754
- }
755
- }
756
-
757
- /**
758
- * PostgreSQL credential response.
759
- */
760
- export type ConnectionRetrieveCredentialResponse =
761
- | ConnectionRetrieveCredentialResponse.PostgresCredentialResponse
762
- | ConnectionRetrieveCredentialResponse.SnowflakeCredentialResponse
763
- | ConnectionRetrieveCredentialResponse.DatabricksCredentialResponse
764
- | ConnectionRetrieveCredentialResponse.ClickHouseCredentialResponse
765
- | ConnectionRetrieveCredentialResponse.MssqlCredentialResponse;
766
-
767
- export namespace ConnectionRetrieveCredentialResponse {
768
- /**
769
- * PostgreSQL credential response.
770
- */
771
- export interface PostgresCredentialResponse {
772
- /**
773
- * Database name
774
- */
775
- database: string;
776
-
777
- /**
778
- * Database host
779
- */
780
- host: string;
781
-
782
- /**
783
- * Decrypted password
784
- */
785
- password: string;
786
-
787
- /**
788
- * Database port
789
- */
790
- port: number;
791
-
792
- /**
793
- * Database username
794
- */
795
- username: string;
796
-
797
- /**
798
- * Warehouse type
799
- */
800
- warehouse_type: 'postgresql';
801
- }
802
-
803
- /**
804
- * Snowflake credential response.
805
- */
806
- export interface SnowflakeCredentialResponse {
807
- /**
808
- * Snowflake account identifier
809
- */
810
- account: string;
811
-
812
- /**
813
- * Authentication credentials
814
- */
815
- auth:
816
- | SnowflakeCredentialResponse.SnowflakePasswordAuthResponse
817
- | SnowflakeCredentialResponse.SnowflakePrivateKeyAuthResponse;
818
-
819
- /**
820
- * Snowflake role
821
- */
822
- role: string;
823
-
824
- /**
825
- * Snowflake username
826
- */
827
- username: string;
828
-
829
- /**
830
- * Compute warehouse name
831
- */
832
- warehouse: string;
833
-
834
- /**
835
- * Warehouse type
836
- */
837
- warehouse_type: 'snowflake';
838
- }
839
-
840
- export namespace SnowflakeCredentialResponse {
841
- /**
842
- * Snowflake password authentication response.
843
- */
844
- export interface SnowflakePasswordAuthResponse {
845
- /**
846
- * Authentication type
847
- */
848
- auth_type: 'password';
849
-
850
- /**
851
- * Decrypted password
852
- */
853
- password: string;
854
- }
855
-
856
- /**
857
- * Snowflake private key authentication response.
858
- */
859
- export interface SnowflakePrivateKeyAuthResponse {
860
- /**
861
- * Authentication type
862
- */
863
- auth_type: 'private_key';
864
-
865
- /**
866
- * PEM-encoded private key
867
- */
868
- private_key: string;
869
-
870
- /**
871
- * Passphrase if key is encrypted
872
- */
873
- private_key_passphrase?: string | null;
874
- }
875
- }
876
-
877
- /**
878
- * Databricks credential response.
879
- */
880
- export interface DatabricksCredentialResponse {
881
- /**
882
- * Databricks personal access token
883
- */
884
- access_token: string;
885
-
886
- /**
887
- * SQL warehouse HTTP path
888
- */
889
- http_path: string;
890
-
891
- /**
892
- * Databricks server hostname
893
- */
894
- server_hostname: string;
895
-
896
- /**
897
- * Warehouse type
898
- */
899
- warehouse_type: 'databricks';
900
- }
901
-
902
- /**
903
- * ClickHouse credential response.
904
- */
905
- export interface ClickHouseCredentialResponse {
906
- /**
907
- * ClickHouse host
908
- */
909
- host: string;
910
-
911
- /**
912
- * Decrypted password
913
- */
914
- password: string;
915
-
916
- /**
917
- * ClickHouse port
918
- */
919
- port: number;
920
-
921
- /**
922
- * ClickHouse username
923
- */
924
- username: string;
925
-
926
- /**
927
- * Warehouse type
928
- */
929
- warehouse_type: 'clickhouse';
930
-
931
- /**
932
- * Database name
933
- */
934
- database?: string | null;
935
- }
936
-
937
- /**
938
- * Microsoft SQL Server credential response.
939
- */
940
- export interface MssqlCredentialResponse {
941
- /**
942
- * SQL Server host
943
- */
944
- host: string;
945
-
946
- /**
947
- * Decrypted password
948
- */
949
- password: string;
950
-
951
- /**
952
- * SQL Server port
953
- */
954
- port: number;
955
-
956
- /**
957
- * SQL Server username
958
- */
959
- username: string;
960
-
961
- /**
962
- * Warehouse type
963
- */
964
- warehouse_type: 'mssql';
965
-
966
- /**
967
- * Database name
968
- */
969
- database?: string | null;
970
- }
971
- }
972
-
973
- /**
974
- * Schema for Kater connection configuration files
975
- */
976
- export interface ConnectionRetrieveSchemaResponse {
977
- /**
978
- * Unique identifier for the connection
979
- */
980
- kater_id: string;
981
-
982
- /**
983
- * Name of the connection
984
- */
985
- name: string;
986
-
987
- /**
988
- * Warehouse-specific configuration (non-sensitive)
989
- */
990
- warehouse_metadata:
991
- | ConnectionRetrieveSchemaResponse.SnowflakeMetadata
992
- | ConnectionRetrieveSchemaResponse.PostgresqlMetadata
993
- | ConnectionRetrieveSchemaResponse.DatabricksMetadata
994
- | ConnectionRetrieveSchemaResponse.ClickhouseMetadata
995
- | ConnectionRetrieveSchemaResponse.MssqlMetadata;
996
-
997
- /**
998
- * Additional context for AI processing
999
- */
1000
- ai_context?: string | null;
1001
-
1002
- /**
1003
- * Custom properties
1004
- */
1005
- custom_properties?: { [key: string]: unknown } | null;
1006
-
1007
- /**
1008
- * List of databases in this connection
1009
- */
1010
- databases?: Array<ConnectionRetrieveSchemaResponse.Database> | null;
1011
-
1012
- /**
1013
- * Description of the connection
1014
- */
1015
- description?: string | null;
1016
-
1017
- /**
1018
- * Human-readable label for the connection
1019
- */
1020
- label?: string | null;
1021
-
1022
- /**
1023
- * Query timeout in seconds
1024
- */
1025
- query_timeout?: number;
1026
-
1027
- /**
1028
- * Timezone conversion mode for queries
1029
- */
1030
- query_timezone_conversion?: 'do_not_convert' | 'convert_to_utc';
1031
- }
1032
-
1033
- export namespace ConnectionRetrieveSchemaResponse {
1034
- export interface SnowflakeMetadata {
1035
- /**
1036
- * Authentication method
1037
- */
1038
- auth_method: 'username_password' | 'key_pair';
1039
-
1040
- /**
1041
- * Snowflake role
1042
- */
1043
- role: string;
1044
-
1045
- /**
1046
- * Snowflake account identifier
1047
- */
1048
- snowflake_account_id: string;
1049
-
1050
- /**
1051
- * Snowflake compute warehouse name
1052
- */
1053
- warehouse: string;
1054
-
1055
- warehouse_type: 'snowflake';
1056
- }
1057
-
1058
- export interface PostgresqlMetadata {
1059
- /**
1060
- * Database host address
1061
- */
1062
- host: string;
1063
-
1064
- /**
1065
- * Database port (default: 5432)
1066
- */
1067
- port: number;
1068
-
1069
- warehouse_type: 'postgresql';
1070
- }
1071
-
1072
- export interface DatabricksMetadata {
1073
- /**
1074
- * Databricks SQL warehouse HTTP path
1075
- */
1076
- http_path: string;
1077
-
1078
- /**
1079
- * Databricks server hostname
1080
- */
1081
- server_hostname: string;
1082
-
1083
- warehouse_type: 'databricks';
1084
- }
1085
-
1086
- export interface ClickhouseMetadata {
1087
- /**
1088
- * ClickHouse host address
1089
- */
1090
- host: string;
1091
-
1092
- /**
1093
- * ClickHouse port (default: 8443)
1094
- */
1095
- port: number;
1096
-
1097
- warehouse_type: 'clickhouse';
1098
- }
1099
-
1100
- export interface MssqlMetadata {
1101
- /**
1102
- * SQL Server host address
1103
- */
1104
- host: string;
1105
-
1106
- /**
1107
- * SQL Server port (default: 1433)
1108
- */
1109
- port: number;
1110
-
1111
- warehouse_type: 'mssql';
1112
- }
1113
-
1114
- export interface Database {
1115
- /**
1116
- * The actual name of the database object in the warehouse
1117
- */
1118
- database_object_name: string;
1119
-
1120
- /**
1121
- * Unique identifier for the database
1122
- */
1123
- kater_id: string;
1124
-
1125
- /**
1126
- * Name of the database
1127
- */
1128
- name: string;
1129
-
1130
- /**
1131
- * Additional context for AI processing
1132
- */
1133
- ai_context?: string | null;
1134
-
1135
- /**
1136
- * Custom properties
1137
- */
1138
- custom_properties?: { [key: string]: unknown } | null;
1139
-
1140
- /**
1141
- * Description of the database
1142
- */
1143
- description?: string | null;
1144
-
1145
- /**
1146
- * Human-readable label for the database
1147
- */
1148
- label?: string | null;
1149
-
1150
- /**
1151
- * List of schemas in this database
1152
- */
1153
- schemas?: Array<Database.Schema> | null;
1154
-
1155
- /**
1156
- * Timezone for the database
1157
- */
1158
- timezone?: string | null;
1159
- }
1160
-
1161
- export namespace Database {
1162
- export interface Schema {
1163
- /**
1164
- * The actual name of the schema object in the warehouse
1165
- */
1166
- database_object_name: string;
1167
-
1168
- /**
1169
- * Unique identifier for the schema
1170
- */
1171
- kater_id: string;
1172
-
1173
- /**
1174
- * Name of the schema
1175
- */
1176
- name: string;
1177
-
1178
- /**
1179
- * Additional context for AI processing
1180
- */
1181
- ai_context?: string | null;
1182
-
1183
- /**
1184
- * Custom properties
1185
- */
1186
- custom_properties?: { [key: string]: unknown } | null;
1187
-
1188
- /**
1189
- * Description of the schema
1190
- */
1191
- description?: string | null;
1192
-
1193
- /**
1194
- * Human-readable label for the schema
1195
- */
1196
- label?: string | null;
1197
- }
1198
- }
1199
- }
1200
-
1201
- /**
1202
- * Response for sync status endpoint.
1203
- *
1204
- * Contains full sync state including progress and results.
1205
- */
1206
- export interface ConnectionRetrieveSyncStatusResponse {
1207
- /**
1208
- * Connection ID
1209
- */
1210
- connection_id: string;
1211
-
1212
- /**
1213
- * Sync creation timestamp
1214
- */
1215
- created_at: string;
1216
-
1217
- /**
1218
- * Workflow status: queued, running, succeeded, failed, canceled
1219
- */
1220
- run_status: string;
1221
-
1222
- /**
1223
- * Schema sync record ID
1224
- */
1225
- sync_id: string;
1226
-
1227
- /**
1228
- * Workflow completion timestamp
1229
- */
1230
- completed_at?: string | null;
1231
-
1232
- /**
1233
- * Current workflow step
1234
- */
1235
- current_step?: string | null;
1236
-
1237
- /**
1238
- * Error message if failed
1239
- */
1240
- error_message?: string | null;
1241
-
1242
- /**
1243
- * Sync event history
1244
- */
1245
- events?: Array<ConnectionRetrieveSyncStatusResponse.Event>;
1246
-
1247
- /**
1248
- * Hatchet workflow run ID
1249
- */
1250
- hatchet_run_id?: string | null;
1251
-
1252
- /**
1253
- * GitHub PR number
1254
- */
1255
- pr_number?: number | null;
1256
-
1257
- /**
1258
- * PR status: open, merged, closed
1259
- */
1260
- pr_status?: string | null;
1261
-
1262
- /**
1263
- * GitHub PR URL
1264
- */
1265
- pr_url?: string | null;
1266
-
1267
- /**
1268
- * Workflow start timestamp
1269
- */
1270
- started_at?: string | null;
1271
-
1272
- /**
1273
- * Number of views deleted
1274
- */
1275
- views_deleted?: number | null;
1276
-
1277
- /**
1278
- * Number of new views added
1279
- */
1280
- views_inserted?: number | null;
1281
-
1282
- /**
1283
- * Number of views renamed (subset of updated)
1284
- */
1285
- views_renamed?: number | null;
1286
-
1287
- /**
1288
- * Number of views updated (dimension changes or renames)
1289
- */
1290
- views_updated?: number | null;
1291
- }
1292
-
1293
- export namespace ConnectionRetrieveSyncStatusResponse {
1294
- /**
1295
- * Response model for a single sync event.
1296
- */
1297
- export interface Event {
1298
- /**
1299
- * Event ID
1300
- */
1301
- id: string;
1302
-
1303
- /**
1304
- * Event timestamp
1305
- */
1306
- created_at: string;
1307
-
1308
- /**
1309
- * Event type: step_started, step_completed, progress, warning, error
1310
- */
1311
- event_type: string;
1312
-
1313
- /**
1314
- * Human-readable event message
1315
- */
1316
- message: string;
1317
-
1318
- /**
1319
- * Additional event data
1320
- */
1321
- metadata?: { [key: string]: unknown };
1322
-
1323
- /**
1324
- * Step name if applicable
1325
- */
1326
- step_name?: string | null;
1327
- }
1328
- }
1329
-
1330
- export type ConnectionStreamSyncProgressResponse = unknown;
1331
-
1332
- /**
1333
- * Response for starting a schema sync.
1334
- *
1335
- * Returned with 202 Accepted when sync workflow is successfully queued.
1336
- */
1337
- export interface ConnectionSyncResponse {
1338
- /**
1339
- * Schema sync record ID
1340
- */
1341
- sync_id: string;
1342
-
1343
- /**
1344
- * Hatchet workflow run ID
1345
- */
1346
- hatchet_run_id?: string | null;
1347
-
1348
- /**
1349
- * Current sync status
1350
- */
1351
- status?: string;
1352
- }
1353
-
1354
- /**
1355
- * Response for credential update.
1356
- */
1357
- export interface ConnectionUpdateCredentialsResponse {
1358
- /**
1359
- * Connection ID
1360
- */
1361
- connection_id: string;
1362
-
1363
- /**
1364
- * Whether the credential update was successful
1365
- */
1366
- success: boolean;
1367
- }
1368
-
1369
- export type ConnectionCreateParams =
1370
- | ConnectionCreateParams.PostgresConnectionConfig
1371
- | ConnectionCreateParams.SnowflakeConnectionConfig
1372
- | ConnectionCreateParams.DatabricksConnectionConfig
1373
- | ConnectionCreateParams.ClickHouseConnectionConfig
1374
- | ConnectionCreateParams.MssqlConnectionConfig;
1375
-
1376
- export declare namespace ConnectionCreateParams {
1377
- export interface PostgresConnectionConfig {
1378
- /**
1379
- * Databases to include in the connection (at least one required)
1380
- */
1381
- databases: Array<DatabaseConfig>;
1382
-
1383
- /**
1384
- * Database host
1385
- */
1386
- host: string;
1387
-
1388
- /**
1389
- * Name of the connection (snake_case: lowercase letters, numbers, underscores)
1390
- */
1391
- name: string;
1392
-
1393
- /**
1394
- * Database password
1395
- */
1396
- password: string;
1397
-
1398
- /**
1399
- * Database username
1400
- */
1401
- username: string;
1402
-
1403
- /**
1404
- * Warehouse type
1405
- */
1406
- warehouse_type: 'postgresql';
1407
-
1408
- /**
1409
- * Description of the connection
1410
- */
1411
- description?: string | null;
1412
-
1413
- /**
1414
- * Human-readable label for the connection (defaults to name if not set)
1415
- */
1416
- label?: string | null;
1417
-
1418
- /**
1419
- * Database port
1420
- */
1421
- port?: number;
1422
-
1423
- /**
1424
- * Query timeout in seconds (1-3600)
1425
- */
1426
- query_timeout?: number | null;
1427
-
1428
- /**
1429
- * Timezone conversion mode: 'do_not_convert' or 'convert_to_utc'
1430
- */
1431
- query_timezone_conversion?: string | null;
1432
- }
1433
-
1434
- export interface SnowflakeConnectionConfig {
1435
- /**
1436
- * Snowflake account identifier (e.g., 'xy12345.us-east-1')
1437
- */
1438
- account: string;
1439
-
1440
- /**
1441
- * Authentication configuration
1442
- */
1443
- auth: SnowflakeConnectionConfig.SnowflakePasswordAuth | SnowflakeConnectionConfig.SnowflakePrivateKeyAuth;
1444
-
1445
- /**
1446
- * Databases to include in the connection (at least one required)
1447
- */
1448
- databases: Array<DatabaseConfig>;
1449
-
1450
- /**
1451
- * Name of the connection (snake_case: lowercase letters, numbers, underscores)
1452
- */
1453
- name: string;
1454
-
1455
- /**
1456
- * Snowflake role
1457
- */
1458
- role: string;
1459
-
1460
- /**
1461
- * Snowflake username
1462
- */
1463
- username: string;
1464
-
1465
- /**
1466
- * Compute warehouse name
1467
- */
1468
- warehouse: string;
1469
-
1470
- /**
1471
- * Warehouse type
1472
- */
1473
- warehouse_type: 'snowflake';
1474
-
1475
- /**
1476
- * Description of the connection
1477
- */
1478
- description?: string | null;
1479
-
1480
- /**
1481
- * Human-readable label for the connection (defaults to name if not set)
1482
- */
1483
- label?: string | null;
1484
-
1485
- /**
1486
- * Query timeout in seconds (1-3600)
1487
- */
1488
- query_timeout?: number | null;
1489
-
1490
- /**
1491
- * Timezone conversion mode: 'do_not_convert' or 'convert_to_utc'
1492
- */
1493
- query_timezone_conversion?: string | null;
1494
- }
1495
-
1496
- export namespace SnowflakeConnectionConfig {
1497
- /**
1498
- * Snowflake password authentication.
1499
- */
1500
- export interface SnowflakePasswordAuth {
1501
- /**
1502
- * Authentication type
1503
- */
1504
- auth_type: 'password';
1505
-
1506
- /**
1507
- * Snowflake password
1508
- */
1509
- password: string;
1510
- }
1511
-
1512
- /**
1513
- * Snowflake private key authentication.
1514
- */
1515
- export interface SnowflakePrivateKeyAuth {
1516
- /**
1517
- * Authentication type
1518
- */
1519
- auth_type: 'private_key';
1520
-
1521
- /**
1522
- * PEM-encoded private key
1523
- */
1524
- private_key: string;
1525
-
1526
- /**
1527
- * Passphrase if key is encrypted
1528
- */
1529
- private_key_passphrase?: string | null;
1530
- }
1531
- }
1532
-
1533
- export interface DatabricksConnectionConfig {
1534
- /**
1535
- * Databricks personal access token
1536
- */
1537
- access_token: string;
1538
-
1539
- /**
1540
- * Databases to include in the connection (at least one required)
1541
- */
1542
- databases: Array<DatabaseConfig>;
1543
-
1544
- /**
1545
- * SQL warehouse HTTP path (e.g., '/sql/1.0/warehouses/xxx')
1546
- */
1547
- http_path: string;
1548
-
1549
- /**
1550
- * Name of the connection (snake_case: lowercase letters, numbers, underscores)
1551
- */
1552
- name: string;
1553
-
1554
- /**
1555
- * Databricks server hostname (e.g., 'dbc-xxx.cloud.databricks.com')
1556
- */
1557
- server_hostname: string;
1558
-
1559
- /**
1560
- * Warehouse type
1561
- */
1562
- warehouse_type: 'databricks';
1563
-
1564
- /**
1565
- * Description of the connection
1566
- */
1567
- description?: string | null;
1568
-
1569
- /**
1570
- * Human-readable label for the connection (defaults to name if not set)
1571
- */
1572
- label?: string | null;
1573
-
1574
- /**
1575
- * Query timeout in seconds (1-3600)
1576
- */
1577
- query_timeout?: number | null;
1578
-
1579
- /**
1580
- * Timezone conversion mode: 'do_not_convert' or 'convert_to_utc'
1581
- */
1582
- query_timezone_conversion?: string | null;
1583
- }
1584
-
1585
- export interface ClickHouseConnectionConfig {
1586
- /**
1587
- * Databases to include in the connection (at least one required)
1588
- */
1589
- databases: Array<DatabaseConfig>;
1590
-
1591
- /**
1592
- * ClickHouse host
1593
- */
1594
- host: string;
1595
-
1596
- /**
1597
- * Name of the connection (snake_case: lowercase letters, numbers, underscores)
1598
- */
1599
- name: string;
1600
-
1601
- /**
1602
- * ClickHouse password
1603
- */
1604
- password: string;
1605
-
1606
- /**
1607
- * ClickHouse username
1608
- */
1609
- username: string;
1610
-
1611
- /**
1612
- * Warehouse type
1613
- */
1614
- warehouse_type: 'clickhouse';
1615
-
1616
- /**
1617
- * Description of the connection
1618
- */
1619
- description?: string | null;
1620
-
1621
- /**
1622
- * Human-readable label for the connection (defaults to name if not set)
1623
- */
1624
- label?: string | null;
1625
-
1626
- /**
1627
- * ClickHouse port
1628
- */
1629
- port?: number;
1630
-
1631
- /**
1632
- * Query timeout in seconds (1-3600)
1633
- */
1634
- query_timeout?: number | null;
1635
-
1636
- /**
1637
- * Timezone conversion mode: 'do_not_convert' or 'convert_to_utc'
1638
- */
1639
- query_timezone_conversion?: string | null;
1640
- }
1641
-
1642
- export interface MssqlConnectionConfig {
1643
- /**
1644
- * Databases to include in the connection (at least one required)
1645
- */
1646
- databases: Array<DatabaseConfig>;
1647
-
1648
- /**
1649
- * SQL Server host
1650
- */
1651
- host: string;
1652
-
1653
- /**
1654
- * Name of the connection (snake_case: lowercase letters, numbers, underscores)
1655
- */
1656
- name: string;
1657
-
1658
- /**
1659
- * SQL Server password
1660
- */
1661
- password: string;
1662
-
1663
- /**
1664
- * SQL Server username
1665
- */
1666
- username: string;
1667
-
1668
- /**
1669
- * Warehouse type
1670
- */
1671
- warehouse_type: 'mssql';
1672
-
1673
- /**
1674
- * Description of the connection
1675
- */
1676
- description?: string | null;
1677
-
1678
- /**
1679
- * Human-readable label for the connection (defaults to name if not set)
1680
- */
1681
- label?: string | null;
1682
-
1683
- /**
1684
- * SQL Server port
1685
- */
1686
- port?: number;
1687
-
1688
- /**
1689
- * Query timeout in seconds (1-3600)
1690
- */
1691
- query_timeout?: number | null;
1692
-
1693
- /**
1694
- * Timezone conversion mode: 'do_not_convert' or 'convert_to_utc'
1695
- */
1696
- query_timezone_conversion?: string | null;
1697
- }
1698
- }
1699
-
1700
- export interface ConnectionUpdateParams {
1701
- /**
1702
- * Connection description
1703
- */
1704
- description?: string | null;
1705
-
1706
- /**
1707
- * Human-readable display label
1708
- */
1709
- label?: string | null;
1710
-
1711
- /**
1712
- * Connection name (snake_case identifier)
1713
- */
1714
- name?: string | null;
1715
- }
1716
-
1717
- export interface ConnectionListParams {
1718
- status?: 'approved' | 'pending' | 'all';
1719
- }
1720
-
1721
- export interface ConnectionApproveSyncParams {
1722
- connection_id: string;
1723
- }
1724
-
1725
- export interface ConnectionListSyncsParams {
1726
- limit?: number;
1727
-
1728
- offset?: number;
1729
- }
1730
-
1731
- export interface ConnectionRetrieveSyncStatusParams {
1732
- connection_id: string;
1733
- }
1734
-
1735
- export interface ConnectionStreamSyncProgressParams {
1736
- connection_id: string;
1737
- }
1738
-
1739
- export type ConnectionUpdateCredentialsParams =
1740
- | ConnectionUpdateCredentialsParams.PostgreSqlCredentialUpdate
1741
- | ConnectionUpdateCredentialsParams.SnowflakeCredentialUpdate
1742
- | ConnectionUpdateCredentialsParams.DatabricksCredentialUpdate
1743
- | ConnectionUpdateCredentialsParams.ClickHouseCredentialUpdate
1744
- | ConnectionUpdateCredentialsParams.MssqlCredentialUpdate;
1745
-
1746
- export declare namespace ConnectionUpdateCredentialsParams {
1747
- export interface PostgreSqlCredentialUpdate {
1748
- /**
1749
- * Database password
1750
- */
1751
- password: string;
1752
-
1753
- /**
1754
- * Database username
1755
- */
1756
- username: string;
1757
-
1758
- /**
1759
- * Warehouse type
1760
- */
1761
- warehouse_type: 'postgresql';
1762
- }
1763
-
1764
- export interface SnowflakeCredentialUpdate {
1765
- /**
1766
- * Authentication credentials
1767
- */
1768
- auth:
1769
- | SnowflakeCredentialUpdate.SnowflakePasswordCredentialAuth
1770
- | SnowflakeCredentialUpdate.SnowflakePrivateKeyCredentialAuth;
1771
-
1772
- /**
1773
- * Snowflake username
1774
- */
1775
- username: string;
1776
-
1777
- /**
1778
- * Warehouse type
1779
- */
1780
- warehouse_type: 'snowflake';
1781
- }
1782
-
1783
- export namespace SnowflakeCredentialUpdate {
1784
- /**
1785
- * Snowflake password auth for credential update.
1786
- */
1787
- export interface SnowflakePasswordCredentialAuth {
1788
- /**
1789
- * Authentication type
1790
- */
1791
- auth_type: 'password';
1792
-
1793
- /**
1794
- * Snowflake password
1795
- */
1796
- password: string;
1797
- }
1798
-
1799
- /**
1800
- * Snowflake private key auth for credential update.
1801
- */
1802
- export interface SnowflakePrivateKeyCredentialAuth {
1803
- /**
1804
- * Authentication type
1805
- */
1806
- auth_type: 'private_key';
1807
-
1808
- /**
1809
- * PEM-encoded private key
1810
- */
1811
- private_key: string;
1812
- }
1813
- }
1814
-
1815
- export interface DatabricksCredentialUpdate {
1816
- /**
1817
- * Databricks personal access token
1818
- */
1819
- access_token: string;
1820
-
1821
- /**
1822
- * Warehouse type
1823
- */
1824
- warehouse_type: 'databricks';
1825
- }
1826
-
1827
- export interface ClickHouseCredentialUpdate {
1828
- /**
1829
- * ClickHouse password
1830
- */
1831
- password: string;
1832
-
1833
- /**
1834
- * ClickHouse username
1835
- */
1836
- username: string;
1837
-
1838
- /**
1839
- * Warehouse type
1840
- */
1841
- warehouse_type: 'clickhouse';
1842
- }
1843
-
1844
- export interface MssqlCredentialUpdate {
1845
- /**
1846
- * SQL Server password
1847
- */
1848
- password: string;
1849
-
1850
- /**
1851
- * SQL Server username
1852
- */
1853
- username: string;
1854
-
1855
- /**
1856
- * Warehouse type
1857
- */
1858
- warehouse_type: 'mssql';
1859
- }
1860
- }
1861
-
1862
- Connections.Databases = Databases;
1863
- Connections.Views = Views;
1864
- Connections.Yaml = Yaml;
1865
-
1866
- export declare namespace Connections {
1867
- export {
1868
- type Connection as Connection,
1869
- type DatabaseConfig as DatabaseConfig,
1870
- type ConnectionListResponse as ConnectionListResponse,
1871
- type ConnectionApproveSyncResponse as ConnectionApproveSyncResponse,
1872
- type ConnectionListSyncsResponse as ConnectionListSyncsResponse,
1873
- type ConnectionRetrieveCredentialResponse as ConnectionRetrieveCredentialResponse,
1874
- type ConnectionRetrieveSchemaResponse as ConnectionRetrieveSchemaResponse,
1875
- type ConnectionRetrieveSyncStatusResponse as ConnectionRetrieveSyncStatusResponse,
1876
- type ConnectionStreamSyncProgressResponse as ConnectionStreamSyncProgressResponse,
1877
- type ConnectionSyncResponse as ConnectionSyncResponse,
1878
- type ConnectionUpdateCredentialsResponse as ConnectionUpdateCredentialsResponse,
1879
- type ConnectionCreateParams as ConnectionCreateParams,
1880
- type ConnectionUpdateParams as ConnectionUpdateParams,
1881
- type ConnectionListParams as ConnectionListParams,
1882
- type ConnectionApproveSyncParams as ConnectionApproveSyncParams,
1883
- type ConnectionListSyncsParams as ConnectionListSyncsParams,
1884
- type ConnectionRetrieveSyncStatusParams as ConnectionRetrieveSyncStatusParams,
1885
- type ConnectionStreamSyncProgressParams as ConnectionStreamSyncProgressParams,
1886
- type ConnectionUpdateCredentialsParams as ConnectionUpdateCredentialsParams,
1887
- };
1888
-
1889
- export { Databases as Databases, type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams };
1890
-
1891
- export {
1892
- Views as Views,
1893
- type ViewRetrieveResponse as ViewRetrieveResponse,
1894
- type ViewListResponse as ViewListResponse,
1895
- type ViewRetrieveParams as ViewRetrieveParams,
1896
- type ViewListParams as ViewListParams,
1897
- };
1898
-
1899
- export {
1900
- Yaml as Yaml,
1901
- type YamlRetrieveResponse as YamlRetrieveResponse,
1902
- type YamlCommitResponse as YamlCommitResponse,
1903
- type YamlCommitParams as YamlCommitParams,
1904
- };
1905
- }